quickvo-sdk-js 1.6.45 → 1.6.48
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/index.js +19452 -18984
- package/dist/index.umd.cjs +3 -3
- package/dist/src/action/ActionSFU.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(m,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(m=typeof globalThis<"u"?globalThis:m||self,b(m["quickvo-sdk-js"]={}))})(this,(function(exports){"use strict";const at=(m,b={})=>{const u={unit:"B",splitStr:" ",...b};let{unit:T,splitStr:r}=u;const c=["B","KB","MB","GB","TB","PB","EB","ZB","YB","DB","NB"],e=c.findIndex(Z=>Z===T),t=c.slice(e+1,c.length);let i=`${m}`;const _=i[0]==="-";_&&(i=i.replace("-",""));const x=i.split(""),C=U(x,4).reverse();let F="",j=0;for(const Z of C)if(F=`${Z.join("")}${F}`,j=+`${F}`,!(j<1024)){for(const ee of t)if(T=ee,j=j/1024,Math.abs(j)<1024)break}return`${_?"-":""}${j.toFixed(2)}${r}${T}`},L=(m,b=[])=>{const u={...m},T=Object.keys(u);for(const r of T)b.findIndex(c=>String(c)===r)===-1&&delete u[r];return u},U=(m,b)=>{const u=Math.max(1,b),T=Math.ceil(m.length/u),r=[];for(let c=0;c<T;c++){const e=c*u,t=Math.min(e+u,m.length);r.push(m.slice(e,t))}return r},pt=(m,b=[])=>{const u=[];for(const T of m){const r=L(T,b);u.push(r)}return u},Yt=(m,b="value",u="label")=>{const T=[],r=Object.entries(m);for(const[c,e]of r){const t={[u]:e,[b]:c};T.push(t)}return T},gt=m=>{m||(m=AudioContext=new(window.AudioContext||window.webkitAudioContext));const b=m.createOscillator();b.type="sine",b.frequency.setValueAtTime(0,m.currentTime);const u=m.createGain();u.gain.value=0,b.connect(u),u.connect(m.destination),b.start();const T=m.createMediaStreamDestination();return u.disconnect(),b.connect(T),T.stream},wt=({width:m=32,height:b=32,opacity:u=1,fps:T=20,text:r=""})=>{T=Math.min(T,30);const c=document.createElement("canvas"),e=c.getContext("2d");c.width=m,c.height=b;let t=0;const i=c.captureStream(T),_=()=>{e.clearRect(0,0,c.width,c.height);const x=e.createLinearGradient(0,0,c.width,c.height);if(x.addColorStop(0,`hsla(${t}, 100%, 50%, ${u})`),x.addColorStop(1,`hsla(${t+120}, 100%, 50%, ${u})`),e.fillStyle=x,e.fillRect(0,0,c.width,c.height),r){const C=Math.min(m,b)*.8;e.font=`bold ${C/r.length}px Arial`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=`rgba(255, 255, 255, ${u})`,e.fillText(r,c.width*.5,c.height*.5)}t=(t+1)%360,i.active&&setTimeout(_,Math.round(1e3/T))};return _(),i},R=(m=0,b=1)=>{const u=Math.max(0,m),T=Math.max(1,b),r=Math.min(u,T),c=Math.max(u,T),e=Math.random()*(c-r+1)+r;return parseInt(`${e}`,10)},bt=(m=16,b=16)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),T=Math.min(u.length,b),r=Date.now().toString(T),c=r.split(""),e=Math.max(4,m-r.length);for(let t=0;t<e;t++){const i=R(0,T-1),_=u[i];c.push(_)}return c.join("").toUpperCase()},E$1=(m,b)=>{try{let u=Number(m);if(isNaN(u)){const T=new Date(`${m}`);if(`${T}`=="Invalid Date")return 0;u=T.getTime()}if(b!==void 0){const T=new Date().getTimezoneOffset();u+=(T+b)*60*1e3}return u}catch(u){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:m,_offset:b,error:u}),0}},H=1e3,Q=6e4,I=36e5,$=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},W$1=m=>E$1(m),p$1=(m,b="YYYY-MM-DD hh:mm:ss",u={})=>{const T={empty_str:"-",...u},{empty_str:r,offset:c}=T,e=E$1(m,c);if(Number(m)!==0&&e===0)return r;const t=new Date(e),i=`${t.getFullYear()}`,_=`${t.getMonth()+1}`,x=`${["1","2","3"].includes(_)?1:["4","5","6"].includes(_)?2:["7","8","9"].includes(_)?3:4}`,C=`${t.getDate()}`,F=`${t.getDay()===0?7:t.getDay()}`,j=`${t.getHours()}`,Z=`${t.getMinutes()}`,ee=`${t.getSeconds()}`,re=`${Math.ceil((e-W$1(`${i}/01/01 00:00:00`)+1)/864e5)}`,K=`${Math.ceil(((e-W$1(`${i}/01/01 00:00:00`))/864e5-Number(F))/7)+1}`,se=[{k:"Y+",v:i},{k:"M+",v:_},{k:"Q+",v:x},{k:"D+",v:C},{k:"W+",v:F},{k:"h+",v:j},{k:"m+",v:Z},{k:"s+",v:ee},{k:"d+",v:re},{k:"w+",v:K}];let fe;for(let{k:G,v:ne}of se)if(fe=new RegExp(`(${G})`).exec(b),fe){const ae=fe[1];let oe=ne.padStart(ae.length,"0");ae.includes("W")&&(oe=X[oe.slice(0,2)]),b=b.replace(ae,oe)}return b},St=(m,b="hh:mm:ss")=>{const u=`${Math.floor(m/864e5)}`;b.includes("D")&&(m=m%864e5);const T=`${Math.floor(m/36e5)}`;b.includes("h")&&(m=m%36e5);const r=`${Math.floor(m/6e4)}`;b.includes("m")&&(m=m%6e4);const c=`${Math.floor(m/1e3)}`;b.includes("s")&&(m=m%1e3);const e=[{k:"D+",v:u},{k:"h+",v:T},{k:"m+",v:r},{k:"s+",v:c}];let t;for(let{k:i,v:_}of e)if(t=new RegExp(`(${i})`).exec(b),t){const x=t[1];let C=_.padStart(x.length,"0");b=b.replace(x,C)}return b},$t=(m,b={})=>new Promise(async(u,T)=>{const{timeout:r=5*1e3,message:c="timeout"}=b,e=setTimeout(()=>T(c),r);try{const t=await m();u(t)}catch(t){T(t)}clearTimeout(e)}),version="1.6.45",isMobile=()=>{const m=navigator.userAgent.toLowerCase();return new RegExp("mobile|android|iphone|ipad|ipod|windows phone|phone|webos","i").test(m)},getNetworkQuality=(m,b,u)=>{let T=0;return m<.03&&b<100&&u<50?T=5:m<.06&&b<160&&u<100?T=4:m<.1&&b<250&&u<150?T=3:m<.15&&b<400&&u<200?T=2:T=1,T},availableWeight=[.05,.05,.05,.05,.1,.1,.1,.15,.15,.2].reverse(),estimateDataByResolution=(m,b)=>{const c=2073600/(m*b);return Math.round(307200/Math.pow(c,.9))},sortByMimeTypes=(m,b)=>m.sort((u,T)=>{const r=b.indexOf(u.mimeType),c=b.indexOf(T.mimeType),e=r>=0?r:Number.MAX_VALUE,t=c>=0?c:Number.MAX_VALUE;return e-t});let Config$1=class{url="";appid="";debug=!1;reportErr=!0;logUrl="https://logs1.quickvo.org";sdkToken="";roomId="";userId="";callType=1;stt=!0;lang={input:"",output:"",translateEnable:!1};useP2P=!0;newPublishAutoSubscribe=!0;roomState="ready";peerState="new";version=version;serviceVersion="1.0.8";callSession="";isEarly=!1;earlyId=bt();isInRoom=!1;sfuPriority=-1;network={sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}};codecPreferences={audio:[],video:[]};constructor(){{const b=RTCRtpReceiver.getCapabilities("video").codecs,u=["video/H264","video/VP8","video/VP9"];this.codecPreferences.video=sortByMimeTypes(b,u)}}setOptions=b=>{const u=Object.keys(b);for(const T of u){if(b[T]===void 0)continue;const r=b[T];this[T]=r}};createWsUrl=()=>{const{appid:b,roomId:u,userId:T,isEarly:r,earlyId:c,serviceVersion:e}=this;if(!b)throw new Error("quickvo: createSession is error. You must first use QuickVO.setOptions to set the appid.");const t={c:b,r:u,p:"web",h:location.hostname,v:e};r?t.i=c:t.b=T;const i=btoa(encodeURI(JSON.stringify(t))),_=`${this.url}?s=${i}&t=${Date.now()}`;return this.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWsUrl",{data:t,url:_}),_}};class Traffic{sfu={outboundBytes:0,inboundBytes:0};p2p={outboundBytes:0,inboundBytes:0};getUse=(b="b")=>{let u=1;return b==="kb"&&(u=1024),{sfu:{outboundBytes:Math.round(this.sfu.outboundBytes/u),inboundBytes:Math.round(this.sfu.inboundBytes/u)},p2p:{outboundBytes:Math.round(this.p2p.outboundBytes/u),inboundBytes:Math.round(this.p2p.inboundBytes/u)}}};clear=()=>{}}class Notifys{queue=new Map;emit=(b,u)=>{const T=this.queue.get(b)||[];for(const r of T){const{callback:c=()=>{}}=r;c(u)}};add=b=>{const{event:u,sn:T=bt(32)}=b;this.queue.has(u)||this.queue.set(u,[]);const r=this.queue.get(u)||[],c=r.findIndex(e=>e.sn===T);return c!==-1&&r.splice(c,1),r.push(b),T}}const enum_mediaType={mc_audio:"麦克风-默认轨道",mc_video:"摄像头-默认轨道",ss_video:"屏幕共享-视频轨道",ss_audio:"屏幕共享-音频轨道"},mediaType_options=Yt(enum_mediaType),mediaType_keys=Object.keys(enum_mediaType),mediaType_vals=Object.values(enum_mediaType);class LocalTrackAnalysis{types=["outbound-rtp","remote-inbound-rtp","media-source","codec"];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}generate=async(b,u)=>{try{if(u===void 0)throw new Error("Peer track is undefined.");if(b.connectionState!=="connected")throw new Error(`Peer connectionState is ${b.connectionState}.`);const r=[...(await b.getStats(u)).values()],c={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};let e=0,t=0;for(const i of r){const{type:_}=i;if(this.types.includes(_))switch(_){case"codec":{const{mimeType:x,payloadType:C,sdpFmtpLine:F}=i;c.mimeType=x,c.payloadType=C,c.sdpFmtpLine=F}break;case"outbound-rtp":{const{bytesSent:x,packetsSent:C,frameWidth:F=0,frameHeight:j=0,framesPerSecond:Z=0}=i;e=C,c.bytesSent=x,c.frameWidth=F,c.frameHeight=j,c.framesPerSecond=Z}break;case"remote-inbound-rtp":{const{packetsLost:x=0,roundTripTime:C=0,jitter:F=0}=i;t=x,c.roundTripTime=Math.round(C*1e3),c.jitter=Math.round(F*1e3)}break}}if(t!==0){const i=e-this.transmittedPackets,_=t-this.transmittedPacketsLost,x=i+_;c.lostRate=x===0?0:Math.round(_/x*1e4)/1e4,this.transmittedPackets=e,this.transmittedPacketsLost=t}{const{lostRate:i,roundTripTime:_,jitter:x}=c;c.quality=getNetworkQuality(i,_,x),this.averageQualitys.unshift(c.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(c.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((i,_)=>i+_)/this.averageQualitys.length)),c.offsetBytesSent=Math.max(0,c.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(c.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),c.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((i,_)=>i+_)/this.averageOffsetBytesSents.length);{const{frameWidth:i,frameHeight:_,mimeType:x}=c;if(x){if(x.includes("audio"))this.isAvailable.unshift(1);else if(i&&_){const C=Math.round(estimateDataByResolution(i,_)/3),F=c.offsetBytesSent>=C?1:0;this.isAvailable.unshift(F)}this.isAvailable=this.isAvailable.slice(0,10)}}{const i=this.isAvailable.length;let _=0;const x=[];for(let C=0;C<i;C++){const F=this.isAvailable[C]*availableWeight[C];_+=F,x.push(F)}this.availableScore=x,c.availableScore=Math.round(_*100)/100}this.trackReport=c}catch{this.clear()}return this.trackReport};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}}let d$1=class{inputStream=new MediaStream;outputStream=new MediaStream;inputGain=1;enhanceGain=1;bgsGain=1;bgmGain=1;outputGain=1;mixAudioMap=new Map;audioContext=new AudioContext;sourceNode;inputGainNode;enhanceGainNode;bgsGainNode;bgmGainNode;rnnoiseNode;analyserNode;analyserArrayData;outputGainNode;destinationNode;denoise=!1;mute=!0;rnnoiseWorklet;rnnoiseWorkletNode;filterStream=b=>b;constructor(b,u){this.inputStream=b,u&&(this.audioContext=u),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{const{sourceNode:T,inputGainNode:r,enhanceGainNode:c,bgsGainNode:e,bgmGainNode:t,analyserNode:i,outputGainNode:_,destinationNode:x}=this;T.connect(r),r.connect(c),c.connect(i),e.connect(i),t.connect(i),c.connect(x),e.connect(x),t.connect(x),_.connect(this.audioContext.destination)}this.audioContext.resume()}use=({rnnoise:b})=>{this.rnnoiseWorklet=new b.RnnoiseWorklet};_changeSource=()=>{this.sourceNode.disconnect(),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.sourceNode.connect(this.inputGainNode)};replaceTrack=b=>{const u=this.inputStream.getTracks();for(const T of u)this.inputStream.removeTrack(T);this.inputStream.addTrack(b),this._changeSource()};stop=()=>{{const b=this.inputStream.getTracks();for(const u of b)u.stop(),this.inputStream.removeTrack(u)}};pause=async b=>{const u=this.inputStream.getTracks();for(const T of u)T.enabled=!b};getStream=()=>this.filterStream(this.outputStream);setMute=(b=!0)=>{this.mute=b,this.analyserNode.disconnect(),b===!1&&this.analyserNode.connect(this.outputGainNode)};setDenoise=async(b=!0)=>{this.rnnoiseWorklet&&(this.inputGainNode.disconnect(),this.rnnoiseWorklet.destroy(),b?(this.rnnoiseWorkletNode=await this.rnnoiseWorklet.createRnnoiseWorkletNode(this.audioContext),this.inputGainNode.connect(this.rnnoiseWorkletNode),this.rnnoiseWorkletNode.connect(this.enhanceGainNode)):this.inputGainNode.connect(this.enhanceGainNode),this.denoise=b)};setInputGain=b=>{this.inputGain=b,this.inputGainNode.gain.setValueAtTime(b,this.audioContext.currentTime)};setEnhanceGain=async b=>{this.enhanceGain=b+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)};setBgsGain=b=>{this.bgsGain=b,this.bgsGainNode.gain.setValueAtTime(b,this.audioContext.currentTime)};setBgmGain=b=>{this.bgmGain=b,this.bgmGainNode.gain.setValueAtTime(b,this.audioContext.currentTime)};setOutputGain=b=>{this.outputGain=b,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)};getVolume=()=>{const{analyserNode:b,analyserArrayData:u}=this;b.getByteFrequencyData(u);let T=0;for(let r=0;r<u.length;r++)T+=u[r];return Math.ceil(T/u.length)};mixAudio=(b,u="bgm")=>new Promise(async(T,r)=>{try{{const t=this.mixAudioMap.get(u);t&&t.stop()}const c=u==="bgs"?this.bgsGainNode:this.bgmGainNode,e=this.audioContext.createBufferSource();this.mixAudioMap.set(u,e),e.buffer=b,e.connect(c),e.onended=()=>{e.disconnect(c),this.mixAudioMap.delete(u),T(!0)},e.start(0)}catch(c){r(c)}});mixAudioStop=b=>{this.mixAudioMap.get(b)?.stop()};changeMix=(b,u)=>{const T=b==="bgs"?this.bgsGainNode:this.bgmGainNode;u?T.connect(this.destinationNode):T.disconnect(this.destinationNode)}};class UserBase{config;localMedias;id="";callAction=0;callActionStr="";callActionMap={};permissions=0;permissionsStr="";permissionsMap={};banBehavior=0;banBehaviorStr="";banBehaviorMap={};isOwner=!1;network={egress:0,ingress:0};tracks={};isSelf=!1;streamControls={};streams={mc_audio:new MediaStream,mc_video:new MediaStream,ss_video:new MediaStream,ss_audio:new MediaStream};published={};constructor({config:b,localMedias:u}){this.config=b,this.localMedias=u;for(const T of mediaType_keys)switch(T){case"mc_audio":case"ss_audio":{const r=new MediaStream,c=this.localMedias.getPhoneyStreamTrack(T);r.addTrack(c);const e=new d$1(r,this.localMedias.audioContext);this.streamControls[T]=e,this.streams[T]=e.getStream()}break;default:{const r=new MediaStream,c=this.localMedias.getPhoneyStreamTrack(T);r.addTrack(c),this.streams[T]=r}break}}setMute=(b,u)=>{for(const T of b){const r=this.streamControls[T];r&&r.setMute(u)}};updateCallAction=b=>{this.callAction=b,this.callActionStr=Number(this.callAction).toString(2).padStart(4,"0");const u=this.callActionStr.split(""),[T,r,c,e]=u;this.callActionMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updatePermissions=b=>{this.permissions=b,this.permissionsStr=Number(this.permissions).toString(2).padStart(4,"0");const u=this.permissionsStr.split(""),[T,r,c,e]=u;this.permissionsMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updateBanBehavior=b=>{this.banBehavior=b,this.banBehaviorStr=Number(this.banBehavior).toString(2).padStart(4,"0");const u=this.banBehaviorStr.split(""),[T,r,c,e]=u;this.banBehaviorMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updateNetwork=b=>{const{egress:u,ingress:T}=this.network,r=b.egress===u&&b.ingress===T;return r===!1&&(this.network=b),r};updateTracks=(b,u=!1)=>{const T=this.isSelf?"local":"remote",r=!this.isSelf,c=this.id;for(const e of b){const{type:t}=e,i=mediaType_keys[t];if(u)this.tracks[i]={enabled:r,...e,location:T,mediaType:i,origin:"unknown",userId:c};else{const _=this.tracks[i];this.tracks[i]={enabled:r,..._,...e,location:T,mediaType:i,origin:"unknown",userId:c}}}};getTrack=b=>this.tracks[b];getTracks=b=>{const u=[];for(const T of b){const r=this.tracks[T];r&&u.push(r)}return u};removeTracks=b=>{const u=[];for(const T of b){const r=this.tracks[T];r&&(u.push(r),delete this.tracks[T])}return u};replaceMediaStreamTrack=(b,u)=>{switch(b){case"mc_audio":case"ss_audio":this.streamControls[b]?.replaceTrack(u);break;default:{const T=this.streams[b],r=T.getTracks();for(const c of r)T.removeTrack(c);T.addTrack(u)}break}};getStream=b=>{const u=this.streams[b];if(!u)throw new Error(`There is no mediaTrack of type streams[${JSON.stringify(b)}].`);return u};getStreams=()=>this.streams;getUserMediaStreamContext=b=>this.streamControls[b];usePhoneyStream=b=>{for(const u of b){const T=this.localMedias.getPhoneyStreamTrack(u);this.replaceMediaStreamTrack(u,T);const r=this.getTrack(u);r&&(r.origin="phoney",r.msid="",r.enabled=!1)}};getInfo=()=>{const{id:b,callAction:u,callActionStr:T,callActionMap:r,permissions:c,permissionsStr:e,permissionsMap:t,banBehavior:i,banBehaviorStr:_,banBehaviorMap:x,isOwner:C,network:F,isSelf:j}=this,Z=[];for(const ee of mediaType_keys){if(!this.published[ee])continue;const K=this.tracks[ee];K&&Z.push(K)}return{id:b,callAction:u,callActionStr:T,callActionMap:r,permissions:c,permissionsStr:e,permissionsMap:t,banBehavior:i,banBehaviorStr:_,banBehaviorMap:x,isOwner:C,network:F,tracks:Z,isSelf:j}}}class LocalUser extends UserBase{tracksAnalysis={sfu:{sends:{mc_audio:new LocalTrackAnalysis,mc_video:new LocalTrackAnalysis,ss_video:new LocalTrackAnalysis,ss_audio:new LocalTrackAnalysis}}};constructor({config:b,localMedias:u}){super({config:b,localMedias:u}),this.isSelf=!0}getTrackReports=b=>this.tracksAnalysis.sfu.sends[b].trackReport;generateTrackAnalysis=async b=>{for(const u of mediaType_keys){const T=b.getSenderTrack(u);await this.tracksAnalysis.sfu.sends[u].generate(b.pc,T)}};setActiveNoise=(b,u)=>{this.getUserMediaStreamContext(b)?.setDenoise(u)};updateSelfCallAction=()=>{let b="";const u=r=>{const c=mediaType_keys[r];return this.tracks[c]?.enabled===!0?"1":"0"};b=`${u(0)}${b}`,b=`${u(1)}${b}`,b=`${u(2)}${b}`,b=`${u(3)}${b}`;const T=parseInt(b,2);return this.updateCallAction(T),T};checkBanBehavior=b=>{const{banBehaviorMap:u}=this;let T=!0;for(const r of b)if(u[r]){T=!1;break}return T};useLocalStream=b=>{for(const u of b){const T=this.localMedias.getLocalStreamTrack(u);if(!T)continue;this.replaceMediaStreamTrack(u,T);const r=this.getTrack(u);r&&(r.origin="local",r.msid="",r.enabled=!0)}};clear=()=>{this.tracks={},this.network={egress:0,ingress:0},this.published={}}}const types=["remote-outbound-rtp","inbound-rtp","candidate-pair","media-source","codec"];class RemotePeerTrackAnalysis{reports=[];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}generate=async(b,u)=>{try{if(u===void 0)throw new Error("Peer track is undefined.");if(b.connectionState!=="connected")throw new Error(`Peer connectionState is ${b.connectionState}.`);const r=[...(await b.getStats(u)).values()],c={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};let e=0,t=0;for(const i of r){const{type:_}=i;if(types.includes(_))switch(_){case"codec":{const{mimeType:x,payloadType:C,sdpFmtpLine:F}=i;c.mimeType=x,c.payloadType=C,c.sdpFmtpLine=F}break;case"remote-outbound-rtp":break;case"inbound-rtp":{const{bytesReceived:x,packetsReceived:C,packetsLost:F=0,jitter:j=0,frameWidth:Z=0,frameHeight:ee=0,framesPerSecond:re=0}=i;e=C,t=F,c.bytesSent=x,c.jitter=Math.round(j*1e3),c.frameWidth=Z,c.frameHeight=ee,c.framesPerSecond=re}break;case"candidate-pair":{const{currentRoundTripTime:x=0}=i;c.roundTripTime=Math.round(x*1e3)}break}}if(e!==0&&t!==0){const i=e-this.transmittedPackets,_=t-this.transmittedPacketsLost,x=i+_;c.lostRate=x===0?0:Math.round(_/x*1e4)/1e4,this.transmittedPackets=e,this.transmittedPacketsLost=t}{const{lostRate:i,roundTripTime:_,jitter:x}=c;c.quality=getNetworkQuality(i,_,x),this.averageQualitys.unshift(c.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(c.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((i,_)=>i+_)/this.averageQualitys.length)),c.offsetBytesSent=Math.max(0,c.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(c.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),c.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((i,_)=>i+_)/this.averageOffsetBytesSents.length);{const{frameWidth:i,frameHeight:_,mimeType:x}=c;if(x){if(x.includes("audio"))this.isAvailable.unshift(1);else if(i&&_){const C=Math.round(estimateDataByResolution(i,_)/3),F=c.offsetBytesSent>=C?1:0;this.isAvailable.unshift(F)}this.isAvailable=this.isAvailable.slice(0,10)}}{const i=this.isAvailable.length;let _=0;const x=[];for(let C=0;C<i;C++){const F=this.isAvailable[C]*availableWeight[C];_+=F,x.push(F)}this.availableScore=x,c.availableScore=Math.round(_*100)/100}this.trackReport=c}catch{this.clear()}return this.trackReport};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}}class RemoteUser extends UserBase{tracksAnalysis={sfu:{recvs:{mc_audio:new RemotePeerTrackAnalysis,mc_video:new RemotePeerTrackAnalysis,ss_video:new RemotePeerTrackAnalysis,ss_audio:new RemotePeerTrackAnalysis}},p2p:{sends:{mc_audio:new LocalTrackAnalysis,mc_video:new LocalTrackAnalysis,ss_video:new LocalTrackAnalysis,ss_audio:new LocalTrackAnalysis},recvs:{mc_audio:new RemotePeerTrackAnalysis,mc_video:new RemotePeerTrackAnalysis,ss_video:new RemotePeerTrackAnalysis,ss_audio:new RemotePeerTrackAnalysis}}};subscribeState={};publishWaiting={};audioReceiver={mc_audio:new Audio,ss_audio:new Audio};p2p;constructor({config:b,localMedias:u}){super({config:b,localMedias:u}),this.isSelf=!1;for(const T of mediaType_keys)this.published[T]=!0}getTrackReports=(b,u,T)=>{if(b==="sfu")return this.tracksAnalysis.sfu.recvs[T].trackReport;if(b==="p2p")return this.tracksAnalysis[b][u][T].trackReport};generateTrackAnalysis=async b=>{for(const u of mediaType_keys){{const T=this.getTrack(u);if(T){const{mid:r}=T,c=b.getRecvierTrack(r);await this.tracksAnalysis.sfu.recvs[u].generate(b.pc,c)}}{if(!this.p2p||!this.p2p.peer)continue;{const T=this.p2p.getSenderTrack(u);await this.tracksAnalysis.p2p.sends[u].generate(this.p2p.peer,T)}{const T=this.p2p.getRecvierTrack(u);await this.tracksAnalysis.p2p.recvs[u].generate(this.p2p.peer,T)}}}};addSubscribe=(b,u=2)=>{for(const T of b)this.tracks[T]&&(this.subscribeState[T]=u)};executeSubscribe=()=>{const b=[],u=Object.keys(this.subscribeState);for(const T of u){if(!this.subscribeState[T])continue;const r=this.getTrack(T);r&&(b.push({...r,lastRetry:this.subscribeState[T]===1}),this.subscribeState[T]-=1)}return{id:this.id,tracks:b}};completedSubscribe=b=>{for(const u of b)delete this.subscribeState[u]};setPublishWaiting=b=>{for(const u of b)this.publishWaiting[u]=new Date().getTime()};checkSubscribed=(b,u="all")=>{const T=[],r=[];for(const c of b){let e;const t=this.tracks[c];switch(u){case"all":e=t?.origin==="sfu"&&t.msid||t?.origin==="p2p";break;case"sfu":e=t?.origin==="sfu"&&t.msid;break;case"p2p":e=t?.origin==="p2p";break}e?T.push(c):r.push(c)}return{subscribed_mediaTypes:T,prohibited_mediaTypes:r}};useRemoteStream=(b,u)=>{for(const T of b){const r=this.getTrack(T);if(!r)continue;const c=u.getTransceiver(r.mid);if(!c)continue;const{track:e}=c.receiver;if(this.replaceMediaStreamTrack(T,e),r.origin="sfu",r.msid=e.id,["mc_audio","ss_audio"].includes(T)){const t=this.getUserMediaStreamContext(T);t?.setMute(!1);const i=t?.inputStream;if(!i)continue;const _=this.audioReceiver[T];if(!_)continue;_.srcObject=i}}};useRemoteP2PStream=b=>{for(const u of b){const T=this.getTrack(u);if(!T)continue;const r=this.p2p?.getTrack(u);if(r&&(this.replaceMediaStreamTrack(u,r),T.origin="p2p",T.msid="",["mc_audio","ss_audio"].includes(u))){const c=this.getUserMediaStreamContext(u);c?.setMute(!1);const e=c?.inputStream;if(!e)continue;const t=this.audioReceiver[u];if(!t)continue;t.srcObject=e}}};clear=()=>{this.p2p?.destroy(),this.p2p=void 0,this.tracks={},this.network={egress:0,ingress:0},this.published={}}}class PrResolves{resolvesMap=new Map;index=0;constructor(){}emit=async b=>{const u=this.resolvesMap.get(b);if(!u)return;const T=u.values();for(const r of T)clearTimeout(r.timer),r.resolve(!0),u.delete(b)};add=(b,u=()=>!1,T=1e3*30)=>new Promise((r,c)=>{if(u())return r(!0);this.resolvesMap.has(b)||this.resolvesMap.set(b,new Map),this.index++;const i=`${this.index}`;T=Math.max(0,T);let _=0;T>=0&&(_=window.setTimeout(()=>c(`[PrResolves] ${b} is timeout.`),T)),this.resolvesMap.get(b)?.set(i,{resolve:r,reject:c,timer:_})});clear=()=>{const b=this.resolvesMap.keys();for(const u of b){const r=this.resolvesMap.get(u)?.values()||[];for(const c of r)clearTimeout(c.timer),c.reject(`[PrResolves] ${u} is clear.`)}this.resolvesMap=new Map}}const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(m){let b=m.length;for(;--b>=0;)m[b]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=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]),extra_dbits=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]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(m,b,u,T,r){this.static_tree=m,this.extra_bits=b,this.extra_base=u,this.elems=T,this.max_length=r,this.has_stree=m&&m.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(m,b){this.dyn_tree=m,this.max_code=0,this.stat_desc=b}const d_code=m=>m<256?_dist_code[m]:_dist_code[256+(m>>>7)],put_short=(m,b)=>{m.pending_buf[m.pending++]=b&255,m.pending_buf[m.pending++]=b>>>8&255},send_bits=(m,b,u)=>{m.bi_valid>Buf_size-u?(m.bi_buf|=b<<m.bi_valid&65535,put_short(m,m.bi_buf),m.bi_buf=b>>Buf_size-m.bi_valid,m.bi_valid+=u-Buf_size):(m.bi_buf|=b<<m.bi_valid&65535,m.bi_valid+=u)},send_code=(m,b,u)=>{send_bits(m,u[b*2],u[b*2+1])},bi_reverse=(m,b)=>{let u=0;do u|=m&1,m>>>=1,u<<=1;while(--b>0);return u>>>1},bi_flush=m=>{m.bi_valid===16?(put_short(m,m.bi_buf),m.bi_buf=0,m.bi_valid=0):m.bi_valid>=8&&(m.pending_buf[m.pending++]=m.bi_buf&255,m.bi_buf>>=8,m.bi_valid-=8)},gen_bitlen=(m,b)=>{const u=b.dyn_tree,T=b.max_code,r=b.stat_desc.static_tree,c=b.stat_desc.has_stree,e=b.stat_desc.extra_bits,t=b.stat_desc.extra_base,i=b.stat_desc.max_length;let _,x,C,F,j,Z,ee=0;for(F=0;F<=MAX_BITS$1;F++)m.bl_count[F]=0;for(u[m.heap[m.heap_max]*2+1]=0,_=m.heap_max+1;_<HEAP_SIZE$1;_++)x=m.heap[_],F=u[u[x*2+1]*2+1]+1,F>i&&(F=i,ee++),u[x*2+1]=F,!(x>T)&&(m.bl_count[F]++,j=0,x>=t&&(j=e[x-t]),Z=u[x*2],m.opt_len+=Z*(F+j),c&&(m.static_len+=Z*(r[x*2+1]+j)));if(ee!==0){do{for(F=i-1;m.bl_count[F]===0;)F--;m.bl_count[F]--,m.bl_count[F+1]+=2,m.bl_count[i]--,ee-=2}while(ee>0);for(F=i;F!==0;F--)for(x=m.bl_count[F];x!==0;)C=m.heap[--_],!(C>T)&&(u[C*2+1]!==F&&(m.opt_len+=(F-u[C*2+1])*u[C*2],u[C*2+1]=F),x--)}},gen_codes=(m,b,u)=>{const T=new Array(MAX_BITS$1+1);let r=0,c,e;for(c=1;c<=MAX_BITS$1;c++)r=r+u[c-1]<<1,T[c]=r;for(e=0;e<=b;e++){let t=m[e*2+1];t!==0&&(m[e*2]=bi_reverse(T[t]++,t))}},tr_static_init=()=>{let m,b,u,T,r;const c=new Array(MAX_BITS$1+1);for(u=0,T=0;T<LENGTH_CODES$1-1;T++)for(base_length[T]=u,m=0;m<1<<extra_lbits[T];m++)_length_code[u++]=T;for(_length_code[u-1]=T,r=0,T=0;T<16;T++)for(base_dist[T]=r,m=0;m<1<<extra_dbits[T];m++)_dist_code[r++]=T;for(r>>=7;T<D_CODES$1;T++)for(base_dist[T]=r<<7,m=0;m<1<<extra_dbits[T]-7;m++)_dist_code[256+r++]=T;for(b=0;b<=MAX_BITS$1;b++)c[b]=0;for(m=0;m<=143;)static_ltree[m*2+1]=8,m++,c[8]++;for(;m<=255;)static_ltree[m*2+1]=9,m++,c[9]++;for(;m<=279;)static_ltree[m*2+1]=7,m++,c[7]++;for(;m<=287;)static_ltree[m*2+1]=8,m++,c[8]++;for(gen_codes(static_ltree,L_CODES$1+1,c),m=0;m<D_CODES$1;m++)static_dtree[m*2+1]=5,static_dtree[m*2]=bi_reverse(m,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=m=>{let b;for(b=0;b<L_CODES$1;b++)m.dyn_ltree[b*2]=0;for(b=0;b<D_CODES$1;b++)m.dyn_dtree[b*2]=0;for(b=0;b<BL_CODES$1;b++)m.bl_tree[b*2]=0;m.dyn_ltree[END_BLOCK*2]=1,m.opt_len=m.static_len=0,m.sym_next=m.matches=0},bi_windup=m=>{m.bi_valid>8?put_short(m,m.bi_buf):m.bi_valid>0&&(m.pending_buf[m.pending++]=m.bi_buf),m.bi_buf=0,m.bi_valid=0},smaller=(m,b,u,T)=>{const r=b*2,c=u*2;return m[r]<m[c]||m[r]===m[c]&&T[b]<=T[u]},pqdownheap=(m,b,u)=>{const T=m.heap[u];let r=u<<1;for(;r<=m.heap_len&&(r<m.heap_len&&smaller(b,m.heap[r+1],m.heap[r],m.depth)&&r++,!smaller(b,T,m.heap[r],m.depth));)m.heap[u]=m.heap[r],u=r,r<<=1;m.heap[u]=T},compress_block=(m,b,u)=>{let T,r,c=0,e,t;if(m.sym_next!==0)do T=m.pending_buf[m.sym_buf+c++]&255,T+=(m.pending_buf[m.sym_buf+c++]&255)<<8,r=m.pending_buf[m.sym_buf+c++],T===0?send_code(m,r,b):(e=_length_code[r],send_code(m,e+LITERALS$1+1,b),t=extra_lbits[e],t!==0&&(r-=base_length[e],send_bits(m,r,t)),T--,e=d_code(T),send_code(m,e,u),t=extra_dbits[e],t!==0&&(T-=base_dist[e],send_bits(m,T,t)));while(c<m.sym_next);send_code(m,END_BLOCK,b)},build_tree=(m,b)=>{const u=b.dyn_tree,T=b.stat_desc.static_tree,r=b.stat_desc.has_stree,c=b.stat_desc.elems;let e,t,i=-1,_;for(m.heap_len=0,m.heap_max=HEAP_SIZE$1,e=0;e<c;e++)u[e*2]!==0?(m.heap[++m.heap_len]=i=e,m.depth[e]=0):u[e*2+1]=0;for(;m.heap_len<2;)_=m.heap[++m.heap_len]=i<2?++i:0,u[_*2]=1,m.depth[_]=0,m.opt_len--,r&&(m.static_len-=T[_*2+1]);for(b.max_code=i,e=m.heap_len>>1;e>=1;e--)pqdownheap(m,u,e);_=c;do e=m.heap[1],m.heap[1]=m.heap[m.heap_len--],pqdownheap(m,u,1),t=m.heap[1],m.heap[--m.heap_max]=e,m.heap[--m.heap_max]=t,u[_*2]=u[e*2]+u[t*2],m.depth[_]=(m.depth[e]>=m.depth[t]?m.depth[e]:m.depth[t])+1,u[e*2+1]=u[t*2+1]=_,m.heap[1]=_++,pqdownheap(m,u,1);while(m.heap_len>=2);m.heap[--m.heap_max]=m.heap[1],gen_bitlen(m,b),gen_codes(u,i,m.bl_count)},scan_tree=(m,b,u)=>{let T,r=-1,c,e=b[1],t=0,i=7,_=4;for(e===0&&(i=138,_=3),b[(u+1)*2+1]=65535,T=0;T<=u;T++)c=e,e=b[(T+1)*2+1],!(++t<i&&c===e)&&(t<_?m.bl_tree[c*2]+=t:c!==0?(c!==r&&m.bl_tree[c*2]++,m.bl_tree[REP_3_6*2]++):t<=10?m.bl_tree[REPZ_3_10*2]++:m.bl_tree[REPZ_11_138*2]++,t=0,r=c,e===0?(i=138,_=3):c===e?(i=6,_=3):(i=7,_=4))},send_tree=(m,b,u)=>{let T,r=-1,c,e=b[1],t=0,i=7,_=4;for(e===0&&(i=138,_=3),T=0;T<=u;T++)if(c=e,e=b[(T+1)*2+1],!(++t<i&&c===e)){if(t<_)do send_code(m,c,m.bl_tree);while(--t!==0);else c!==0?(c!==r&&(send_code(m,c,m.bl_tree),t--),send_code(m,REP_3_6,m.bl_tree),send_bits(m,t-3,2)):t<=10?(send_code(m,REPZ_3_10,m.bl_tree),send_bits(m,t-3,3)):(send_code(m,REPZ_11_138,m.bl_tree),send_bits(m,t-11,7));t=0,r=c,e===0?(i=138,_=3):c===e?(i=6,_=3):(i=7,_=4)}},build_bl_tree=m=>{let b;for(scan_tree(m,m.dyn_ltree,m.l_desc.max_code),scan_tree(m,m.dyn_dtree,m.d_desc.max_code),build_tree(m,m.bl_desc),b=BL_CODES$1-1;b>=3&&m.bl_tree[bl_order[b]*2+1]===0;b--);return m.opt_len+=3*(b+1)+5+5+4,b},send_all_trees=(m,b,u,T)=>{let r;for(send_bits(m,b-257,5),send_bits(m,u-1,5),send_bits(m,T-4,4),r=0;r<T;r++)send_bits(m,m.bl_tree[bl_order[r]*2+1],3);send_tree(m,m.dyn_ltree,b-1),send_tree(m,m.dyn_dtree,u-1)},detect_data_type=m=>{let b=4093624447,u;for(u=0;u<=31;u++,b>>>=1)if(b&1&&m.dyn_ltree[u*2]!==0)return Z_BINARY;if(m.dyn_ltree[18]!==0||m.dyn_ltree[20]!==0||m.dyn_ltree[26]!==0)return Z_TEXT;for(u=32;u<LITERALS$1;u++)if(m.dyn_ltree[u*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=m=>{static_init_done||(tr_static_init(),static_init_done=!0),m.l_desc=new TreeDesc(m.dyn_ltree,static_l_desc),m.d_desc=new TreeDesc(m.dyn_dtree,static_d_desc),m.bl_desc=new TreeDesc(m.bl_tree,static_bl_desc),m.bi_buf=0,m.bi_valid=0,init_block(m)},_tr_stored_block$1=(m,b,u,T)=>{send_bits(m,(STORED_BLOCK<<1)+(T?1:0),3),bi_windup(m),put_short(m,u),put_short(m,~u),u&&m.pending_buf.set(m.window.subarray(b,b+u),m.pending),m.pending+=u},_tr_align$1=m=>{send_bits(m,STATIC_TREES<<1,3),send_code(m,END_BLOCK,static_ltree),bi_flush(m)},_tr_flush_block$1=(m,b,u,T)=>{let r,c,e=0;m.level>0?(m.strm.data_type===Z_UNKNOWN$1&&(m.strm.data_type=detect_data_type(m)),build_tree(m,m.l_desc),build_tree(m,m.d_desc),e=build_bl_tree(m),r=m.opt_len+3+7>>>3,c=m.static_len+3+7>>>3,c<=r&&(r=c)):r=c=u+5,u+4<=r&&b!==-1?_tr_stored_block$1(m,b,u,T):m.strategy===Z_FIXED$1||c===r?(send_bits(m,(STATIC_TREES<<1)+(T?1:0),3),compress_block(m,static_ltree,static_dtree)):(send_bits(m,(DYN_TREES<<1)+(T?1:0),3),send_all_trees(m,m.l_desc.max_code+1,m.d_desc.max_code+1,e+1),compress_block(m,m.dyn_ltree,m.dyn_dtree)),init_block(m),T&&bi_windup(m)},_tr_tally$1=(m,b,u)=>(m.pending_buf[m.sym_buf+m.sym_next++]=b,m.pending_buf[m.sym_buf+m.sym_next++]=b>>8,m.pending_buf[m.sym_buf+m.sym_next++]=u,b===0?m.dyn_ltree[u*2]++:(m.matches++,b--,m.dyn_ltree[(_length_code[u]+LITERALS$1+1)*2]++,m.dyn_dtree[d_code(b)*2]++),m.sym_next===m.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(m,b,u,T)=>{let r=m&65535|0,c=m>>>16&65535|0,e=0;for(;u!==0;){e=u>2e3?2e3:u,u-=e;do r=r+b[T++]|0,c=c+r|0;while(--e);r%=65521,c%=65521}return r|c<<16|0};var adler32_1=adler32;const makeTable=()=>{let m,b=[];for(var u=0;u<256;u++){m=u;for(var T=0;T<8;T++)m=m&1?3988292384^m>>>1:m>>>1;b[u]=m}return b},crcTable=new Uint32Array(makeTable()),crc32=(m,b,u,T)=>{const r=crcTable,c=T+u;m^=-1;for(let e=T;e<c;e++)m=m>>>8^r[(m^b[e])&255];return m^-1};var crc32_1=crc32,messages={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"},constants$2={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};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(m,b)=>(m.msg=messages[b],b),rank=m=>m*2-(m>4?9:0),zero=m=>{let b=m.length;for(;--b>=0;)m[b]=0},slide_hash=m=>{let b,u,T,r=m.w_size;b=m.hash_size,T=b;do u=m.head[--T],m.head[T]=u>=r?u-r:0;while(--b);b=r,T=b;do u=m.prev[--T],m.prev[T]=u>=r?u-r:0;while(--b)};let HASH_ZLIB=(m,b,u)=>(b<<m.hash_shift^u)&m.hash_mask,HASH=HASH_ZLIB;const flush_pending=m=>{const b=m.state;let u=b.pending;u>m.avail_out&&(u=m.avail_out),u!==0&&(m.output.set(b.pending_buf.subarray(b.pending_out,b.pending_out+u),m.next_out),m.next_out+=u,b.pending_out+=u,m.total_out+=u,m.avail_out-=u,b.pending-=u,b.pending===0&&(b.pending_out=0))},flush_block_only=(m,b)=>{_tr_flush_block(m,m.block_start>=0?m.block_start:-1,m.strstart-m.block_start,b),m.block_start=m.strstart,flush_pending(m.strm)},put_byte=(m,b)=>{m.pending_buf[m.pending++]=b},putShortMSB=(m,b)=>{m.pending_buf[m.pending++]=b>>>8&255,m.pending_buf[m.pending++]=b&255},read_buf=(m,b,u,T)=>{let r=m.avail_in;return r>T&&(r=T),r===0?0:(m.avail_in-=r,b.set(m.input.subarray(m.next_in,m.next_in+r),u),m.state.wrap===1?m.adler=adler32_1(m.adler,b,r,u):m.state.wrap===2&&(m.adler=crc32_1(m.adler,b,r,u)),m.next_in+=r,m.total_in+=r,r)},longest_match=(m,b)=>{let u=m.max_chain_length,T=m.strstart,r,c,e=m.prev_length,t=m.nice_match;const i=m.strstart>m.w_size-MIN_LOOKAHEAD?m.strstart-(m.w_size-MIN_LOOKAHEAD):0,_=m.window,x=m.w_mask,C=m.prev,F=m.strstart+MAX_MATCH;let j=_[T+e-1],Z=_[T+e];m.prev_length>=m.good_match&&(u>>=2),t>m.lookahead&&(t=m.lookahead);do if(r=b,!(_[r+e]!==Z||_[r+e-1]!==j||_[r]!==_[T]||_[++r]!==_[T+1])){T+=2,r++;do;while(_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&T<F);if(c=MAX_MATCH-(F-T),T=F-MAX_MATCH,c>e){if(m.match_start=b,e=c,c>=t)break;j=_[T+e-1],Z=_[T+e]}}while((b=C[b&x])>i&&--u!==0);return e<=m.lookahead?e:m.lookahead},fill_window=m=>{const b=m.w_size;let u,T,r;do{if(T=m.window_size-m.lookahead-m.strstart,m.strstart>=b+(b-MIN_LOOKAHEAD)&&(m.window.set(m.window.subarray(b,b+b-T),0),m.match_start-=b,m.strstart-=b,m.block_start-=b,m.insert>m.strstart&&(m.insert=m.strstart),slide_hash(m),T+=b),m.strm.avail_in===0)break;if(u=read_buf(m.strm,m.window,m.strstart+m.lookahead,T),m.lookahead+=u,m.lookahead+m.insert>=MIN_MATCH)for(r=m.strstart-m.insert,m.ins_h=m.window[r],m.ins_h=HASH(m,m.ins_h,m.window[r+1]);m.insert&&(m.ins_h=HASH(m,m.ins_h,m.window[r+MIN_MATCH-1]),m.prev[r&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=r,r++,m.insert--,!(m.lookahead+m.insert<MIN_MATCH)););}while(m.lookahead<MIN_LOOKAHEAD&&m.strm.avail_in!==0)},deflate_stored=(m,b)=>{let u=m.pending_buf_size-5>m.w_size?m.w_size:m.pending_buf_size-5,T,r,c,e=0,t=m.strm.avail_in;do{if(T=65535,c=m.bi_valid+42>>3,m.strm.avail_out<c||(c=m.strm.avail_out-c,r=m.strstart-m.block_start,T>r+m.strm.avail_in&&(T=r+m.strm.avail_in),T>c&&(T=c),T<u&&(T===0&&b!==Z_FINISH$3||b===Z_NO_FLUSH$2||T!==r+m.strm.avail_in)))break;e=b===Z_FINISH$3&&T===r+m.strm.avail_in?1:0,_tr_stored_block(m,0,0,e),m.pending_buf[m.pending-4]=T,m.pending_buf[m.pending-3]=T>>8,m.pending_buf[m.pending-2]=~T,m.pending_buf[m.pending-1]=~T>>8,flush_pending(m.strm),r&&(r>T&&(r=T),m.strm.output.set(m.window.subarray(m.block_start,m.block_start+r),m.strm.next_out),m.strm.next_out+=r,m.strm.avail_out-=r,m.strm.total_out+=r,m.block_start+=r,T-=r),T&&(read_buf(m.strm,m.strm.output,m.strm.next_out,T),m.strm.next_out+=T,m.strm.avail_out-=T,m.strm.total_out+=T)}while(e===0);return t-=m.strm.avail_in,t&&(t>=m.w_size?(m.matches=2,m.window.set(m.strm.input.subarray(m.strm.next_in-m.w_size,m.strm.next_in),0),m.strstart=m.w_size,m.insert=m.strstart):(m.window_size-m.strstart<=t&&(m.strstart-=m.w_size,m.window.set(m.window.subarray(m.w_size,m.w_size+m.strstart),0),m.matches<2&&m.matches++,m.insert>m.strstart&&(m.insert=m.strstart)),m.window.set(m.strm.input.subarray(m.strm.next_in-t,m.strm.next_in),m.strstart),m.strstart+=t,m.insert+=t>m.w_size-m.insert?m.w_size-m.insert:t),m.block_start=m.strstart),m.high_water<m.strstart&&(m.high_water=m.strstart),e?BS_FINISH_DONE:b!==Z_NO_FLUSH$2&&b!==Z_FINISH$3&&m.strm.avail_in===0&&m.strstart===m.block_start?BS_BLOCK_DONE:(c=m.window_size-m.strstart,m.strm.avail_in>c&&m.block_start>=m.w_size&&(m.block_start-=m.w_size,m.strstart-=m.w_size,m.window.set(m.window.subarray(m.w_size,m.w_size+m.strstart),0),m.matches<2&&m.matches++,c+=m.w_size,m.insert>m.strstart&&(m.insert=m.strstart)),c>m.strm.avail_in&&(c=m.strm.avail_in),c&&(read_buf(m.strm,m.window,m.strstart,c),m.strstart+=c,m.insert+=c>m.w_size-m.insert?m.w_size-m.insert:c),m.high_water<m.strstart&&(m.high_water=m.strstart),c=m.bi_valid+42>>3,c=m.pending_buf_size-c>65535?65535:m.pending_buf_size-c,u=c>m.w_size?m.w_size:c,r=m.strstart-m.block_start,(r>=u||(r||b===Z_FINISH$3)&&b!==Z_NO_FLUSH$2&&m.strm.avail_in===0&&r<=c)&&(T=r>c?c:r,e=b===Z_FINISH$3&&m.strm.avail_in===0&&T===r?1:0,_tr_stored_block(m,m.block_start,T,e),m.block_start+=T,flush_pending(m.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(m,b)=>{let u,T;for(;;){if(m.lookahead<MIN_LOOKAHEAD){if(fill_window(m),m.lookahead<MIN_LOOKAHEAD&&b===Z_NO_FLUSH$2)return BS_NEED_MORE;if(m.lookahead===0)break}if(u=0,m.lookahead>=MIN_MATCH&&(m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),u!==0&&m.strstart-u<=m.w_size-MIN_LOOKAHEAD&&(m.match_length=longest_match(m,u)),m.match_length>=MIN_MATCH)if(T=_tr_tally(m,m.strstart-m.match_start,m.match_length-MIN_MATCH),m.lookahead-=m.match_length,m.match_length<=m.max_lazy_match&&m.lookahead>=MIN_MATCH){m.match_length--;do m.strstart++,m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart;while(--m.match_length!==0);m.strstart++}else m.strstart+=m.match_length,m.match_length=0,m.ins_h=m.window[m.strstart],m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+1]);else T=_tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++;if(T&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}return m.insert=m.strstart<MIN_MATCH-1?m.strstart:MIN_MATCH-1,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(m,b)=>{let u,T,r;for(;;){if(m.lookahead<MIN_LOOKAHEAD){if(fill_window(m),m.lookahead<MIN_LOOKAHEAD&&b===Z_NO_FLUSH$2)return BS_NEED_MORE;if(m.lookahead===0)break}if(u=0,m.lookahead>=MIN_MATCH&&(m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),m.prev_length=m.match_length,m.prev_match=m.match_start,m.match_length=MIN_MATCH-1,u!==0&&m.prev_length<m.max_lazy_match&&m.strstart-u<=m.w_size-MIN_LOOKAHEAD&&(m.match_length=longest_match(m,u),m.match_length<=5&&(m.strategy===Z_FILTERED||m.match_length===MIN_MATCH&&m.strstart-m.match_start>4096)&&(m.match_length=MIN_MATCH-1)),m.prev_length>=MIN_MATCH&&m.match_length<=m.prev_length){r=m.strstart+m.lookahead-MIN_MATCH,T=_tr_tally(m,m.strstart-1-m.prev_match,m.prev_length-MIN_MATCH),m.lookahead-=m.prev_length-1,m.prev_length-=2;do++m.strstart<=r&&(m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart);while(--m.prev_length!==0);if(m.match_available=0,m.match_length=MIN_MATCH-1,m.strstart++,T&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}else if(m.match_available){if(T=_tr_tally(m,0,m.window[m.strstart-1]),T&&flush_block_only(m,!1),m.strstart++,m.lookahead--,m.strm.avail_out===0)return BS_NEED_MORE}else m.match_available=1,m.strstart++,m.lookahead--}return m.match_available&&(T=_tr_tally(m,0,m.window[m.strstart-1]),m.match_available=0),m.insert=m.strstart<MIN_MATCH-1?m.strstart:MIN_MATCH-1,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(m,b)=>{let u,T,r,c;const e=m.window;for(;;){if(m.lookahead<=MAX_MATCH){if(fill_window(m),m.lookahead<=MAX_MATCH&&b===Z_NO_FLUSH$2)return BS_NEED_MORE;if(m.lookahead===0)break}if(m.match_length=0,m.lookahead>=MIN_MATCH&&m.strstart>0&&(r=m.strstart-1,T=e[r],T===e[++r]&&T===e[++r]&&T===e[++r])){c=m.strstart+MAX_MATCH;do;while(T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&r<c);m.match_length=MAX_MATCH-(c-r),m.match_length>m.lookahead&&(m.match_length=m.lookahead)}if(m.match_length>=MIN_MATCH?(u=_tr_tally(m,1,m.match_length-MIN_MATCH),m.lookahead-=m.match_length,m.strstart+=m.match_length,m.match_length=0):(u=_tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++),u&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}return m.insert=0,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(m,b)=>{let u;for(;;){if(m.lookahead===0&&(fill_window(m),m.lookahead===0)){if(b===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(m.match_length=0,u=_tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++,u&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}return m.insert=0,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(m,b,u,T,r){this.good_length=m,this.max_lazy=b,this.nice_length=u,this.max_chain=T,this.func=r}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=m=>{m.window_size=2*m.w_size,zero(m.head),m.max_lazy_match=configuration_table[m.level].max_lazy,m.good_match=configuration_table[m.level].good_length,m.nice_match=configuration_table[m.level].nice_length,m.max_chain_length=configuration_table[m.level].max_chain,m.strstart=0,m.block_start=0,m.lookahead=0,m.insert=0,m.match_length=m.prev_length=MIN_MATCH-1,m.match_available=0,m.ins_h=0};function DeflateState(){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=Z_DEFLATED$2,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(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(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 deflateStateCheck=m=>{if(!m)return 1;const b=m.state;return!b||b.strm!==m||b.status!==INIT_STATE&&b.status!==GZIP_STATE&&b.status!==EXTRA_STATE&&b.status!==NAME_STATE&&b.status!==COMMENT_STATE&&b.status!==HCRC_STATE&&b.status!==BUSY_STATE&&b.status!==FINISH_STATE?1:0},deflateResetKeep=m=>{if(deflateStateCheck(m))return err(m,Z_STREAM_ERROR$2);m.total_in=m.total_out=0,m.data_type=Z_UNKNOWN;const b=m.state;return b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap===2?GZIP_STATE:b.wrap?INIT_STATE:BUSY_STATE,m.adler=b.wrap===2?0:1,b.last_flush=-2,_tr_init(b),Z_OK$3},deflateReset=m=>{const b=deflateResetKeep(m);return b===Z_OK$3&&lm_init(m.state),b},deflateSetHeader=(m,b)=>deflateStateCheck(m)||m.state.wrap!==2?Z_STREAM_ERROR$2:(m.state.gzhead=b,Z_OK$3),deflateInit2=(m,b,u,T,r,c)=>{if(!m)return Z_STREAM_ERROR$2;let e=1;if(b===Z_DEFAULT_COMPRESSION$1&&(b=6),T<0?(e=0,T=-T):T>15&&(e=2,T-=16),r<1||r>MAX_MEM_LEVEL||u!==Z_DEFLATED$2||T<8||T>15||b<0||b>9||c<0||c>Z_FIXED||T===8&&e!==1)return err(m,Z_STREAM_ERROR$2);T===8&&(T=9);const t=new DeflateState;return m.state=t,t.strm=m,t.status=INIT_STATE,t.wrap=e,t.gzhead=null,t.w_bits=T,t.w_size=1<<t.w_bits,t.w_mask=t.w_size-1,t.hash_bits=r+7,t.hash_size=1<<t.hash_bits,t.hash_mask=t.hash_size-1,t.hash_shift=~~((t.hash_bits+MIN_MATCH-1)/MIN_MATCH),t.window=new Uint8Array(t.w_size*2),t.head=new Uint16Array(t.hash_size),t.prev=new Uint16Array(t.w_size),t.lit_bufsize=1<<r+6,t.pending_buf_size=t.lit_bufsize*4,t.pending_buf=new Uint8Array(t.pending_buf_size),t.sym_buf=t.lit_bufsize,t.sym_end=(t.lit_bufsize-1)*3,t.level=b,t.strategy=c,t.method=u,deflateReset(m)},deflateInit=(m,b)=>deflateInit2(m,b,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(m,b)=>{if(deflateStateCheck(m)||b>Z_BLOCK$1||b<0)return m?err(m,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const u=m.state;if(!m.output||m.avail_in!==0&&!m.input||u.status===FINISH_STATE&&b!==Z_FINISH$3)return err(m,m.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const T=u.last_flush;if(u.last_flush=b,u.pending!==0){if(flush_pending(m),m.avail_out===0)return u.last_flush=-1,Z_OK$3}else if(m.avail_in===0&&rank(b)<=rank(T)&&b!==Z_FINISH$3)return err(m,Z_BUF_ERROR$1);if(u.status===FINISH_STATE&&m.avail_in!==0)return err(m,Z_BUF_ERROR$1);if(u.status===INIT_STATE&&u.wrap===0&&(u.status=BUSY_STATE),u.status===INIT_STATE){let r=Z_DEFLATED$2+(u.w_bits-8<<4)<<8,c=-1;if(u.strategy>=Z_HUFFMAN_ONLY||u.level<2?c=0:u.level<6?c=1:u.level===6?c=2:c=3,r|=c<<6,u.strstart!==0&&(r|=PRESET_DICT),r+=31-r%31,putShortMSB(u,r),u.strstart!==0&&(putShortMSB(u,m.adler>>>16),putShortMSB(u,m.adler&65535)),m.adler=1,u.status=BUSY_STATE,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===GZIP_STATE){if(m.adler=0,put_byte(u,31),put_byte(u,139),put_byte(u,8),u.gzhead)put_byte(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),put_byte(u,u.gzhead.time&255),put_byte(u,u.gzhead.time>>8&255),put_byte(u,u.gzhead.time>>16&255),put_byte(u,u.gzhead.time>>24&255),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,u.gzhead.os&255),u.gzhead.extra&&u.gzhead.extra.length&&(put_byte(u,u.gzhead.extra.length&255),put_byte(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=EXTRA_STATE;else if(put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,OS_CODE),u.status=BUSY_STATE,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===EXTRA_STATE){if(u.gzhead.extra){let r=u.pending,c=(u.gzhead.extra.length&65535)-u.gzindex;for(;u.pending+c>u.pending_buf_size;){let t=u.pending_buf_size-u.pending;if(u.pending_buf.set(u.gzhead.extra.subarray(u.gzindex,u.gzindex+t),u.pending),u.pending=u.pending_buf_size,u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),u.gzindex+=t,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0,c-=t}let e=new Uint8Array(u.gzhead.extra);u.pending_buf.set(e.subarray(u.gzindex,u.gzindex+c),u.pending),u.pending+=c,u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),u.gzindex=0}u.status=NAME_STATE}if(u.status===NAME_STATE){if(u.gzhead.name){let r=u.pending,c;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0}u.gzindex<u.gzhead.name.length?c=u.gzhead.name.charCodeAt(u.gzindex++)&255:c=0,put_byte(u,c)}while(c!==0);u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),u.gzindex=0}u.status=COMMENT_STATE}if(u.status===COMMENT_STATE){if(u.gzhead.comment){let r=u.pending,c;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0}u.gzindex<u.gzhead.comment.length?c=u.gzhead.comment.charCodeAt(u.gzindex++)&255:c=0,put_byte(u,c)}while(c!==0);u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r))}u.status=HCRC_STATE}if(u.status===HCRC_STATE){if(u.gzhead.hcrc){if(u.pending+2>u.pending_buf_size&&(flush_pending(m),u.pending!==0))return u.last_flush=-1,Z_OK$3;put_byte(u,m.adler&255),put_byte(u,m.adler>>8&255),m.adler=0}if(u.status=BUSY_STATE,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(m.avail_in!==0||u.lookahead!==0||b!==Z_NO_FLUSH$2&&u.status!==FINISH_STATE){let r=u.level===0?deflate_stored(u,b):u.strategy===Z_HUFFMAN_ONLY?deflate_huff(u,b):u.strategy===Z_RLE?deflate_rle(u,b):configuration_table[u.level].func(u,b);if((r===BS_FINISH_STARTED||r===BS_FINISH_DONE)&&(u.status=FINISH_STATE),r===BS_NEED_MORE||r===BS_FINISH_STARTED)return m.avail_out===0&&(u.last_flush=-1),Z_OK$3;if(r===BS_BLOCK_DONE&&(b===Z_PARTIAL_FLUSH?_tr_align(u):b!==Z_BLOCK$1&&(_tr_stored_block(u,0,0,!1),b===Z_FULL_FLUSH$1&&(zero(u.head),u.lookahead===0&&(u.strstart=0,u.block_start=0,u.insert=0))),flush_pending(m),m.avail_out===0))return u.last_flush=-1,Z_OK$3}return b!==Z_FINISH$3?Z_OK$3:u.wrap<=0?Z_STREAM_END$3:(u.wrap===2?(put_byte(u,m.adler&255),put_byte(u,m.adler>>8&255),put_byte(u,m.adler>>16&255),put_byte(u,m.adler>>24&255),put_byte(u,m.total_in&255),put_byte(u,m.total_in>>8&255),put_byte(u,m.total_in>>16&255),put_byte(u,m.total_in>>24&255)):(putShortMSB(u,m.adler>>>16),putShortMSB(u,m.adler&65535)),flush_pending(m),u.wrap>0&&(u.wrap=-u.wrap),u.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=m=>{if(deflateStateCheck(m))return Z_STREAM_ERROR$2;const b=m.state.status;return m.state=null,b===BUSY_STATE?err(m,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(m,b)=>{let u=b.length;if(deflateStateCheck(m))return Z_STREAM_ERROR$2;const T=m.state,r=T.wrap;if(r===2||r===1&&T.status!==INIT_STATE||T.lookahead)return Z_STREAM_ERROR$2;if(r===1&&(m.adler=adler32_1(m.adler,b,u,0)),T.wrap=0,u>=T.w_size){r===0&&(zero(T.head),T.strstart=0,T.block_start=0,T.insert=0);let i=new Uint8Array(T.w_size);i.set(b.subarray(u-T.w_size,u),0),b=i,u=T.w_size}const c=m.avail_in,e=m.next_in,t=m.input;for(m.avail_in=u,m.next_in=0,m.input=b,fill_window(T);T.lookahead>=MIN_MATCH;){let i=T.strstart,_=T.lookahead-(MIN_MATCH-1);do T.ins_h=HASH(T,T.ins_h,T.window[i+MIN_MATCH-1]),T.prev[i&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=i,i++;while(--_);T.strstart=i,T.lookahead=MIN_MATCH-1,fill_window(T)}return T.strstart+=T.lookahead,T.block_start=T.strstart,T.insert=T.lookahead,T.lookahead=0,T.match_length=T.prev_length=MIN_MATCH-1,T.match_available=0,m.next_in=e,m.input=t,m.avail_in=c,T.wrap=r,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(m,b)=>Object.prototype.hasOwnProperty.call(m,b);var assign=function(m){const b=Array.prototype.slice.call(arguments,1);for(;b.length;){const u=b.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(const T in u)_has(u,T)&&(m[T]=u[T])}}return m},flattenChunks=m=>{let b=0;for(let T=0,r=m.length;T<r;T++)b+=m[T].length;const u=new Uint8Array(b);for(let T=0,r=0,c=m.length;T<c;T++){let e=m[T];u.set(e,r),r+=e.length}return u},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(m){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let m=0;m<256;m++)_utf8len[m]=m>=252?6:m>=248?5:m>=240?4:m>=224?3:m>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=m=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(m);let b,u,T,r,c,e=m.length,t=0;for(r=0;r<e;r++)u=m.charCodeAt(r),(u&64512)===55296&&r+1<e&&(T=m.charCodeAt(r+1),(T&64512)===56320&&(u=65536+(u-55296<<10)+(T-56320),r++)),t+=u<128?1:u<2048?2:u<65536?3:4;for(b=new Uint8Array(t),c=0,r=0;c<t;r++)u=m.charCodeAt(r),(u&64512)===55296&&r+1<e&&(T=m.charCodeAt(r+1),(T&64512)===56320&&(u=65536+(u-55296<<10)+(T-56320),r++)),u<128?b[c++]=u:u<2048?(b[c++]=192|u>>>6,b[c++]=128|u&63):u<65536?(b[c++]=224|u>>>12,b[c++]=128|u>>>6&63,b[c++]=128|u&63):(b[c++]=240|u>>>18,b[c++]=128|u>>>12&63,b[c++]=128|u>>>6&63,b[c++]=128|u&63);return b};const buf2binstring=(m,b)=>{if(b<65534&&m.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,m.length===b?m:m.subarray(0,b));let u="";for(let T=0;T<b;T++)u+=String.fromCharCode(m[T]);return u};var buf2string=(m,b)=>{const u=b||m.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(m.subarray(0,b));let T,r;const c=new Array(u*2);for(r=0,T=0;T<u;){let e=m[T++];if(e<128){c[r++]=e;continue}let t=_utf8len[e];if(t>4){c[r++]=65533,T+=t-1;continue}for(e&=t===2?31:t===3?15:7;t>1&&T<u;)e=e<<6|m[T++]&63,t--;if(t>1){c[r++]=65533;continue}e<65536?c[r++]=e:(e-=65536,c[r++]=55296|e>>10&1023,c[r++]=56320|e&1023)}return buf2binstring(c,r)},utf8border=(m,b)=>{b=b||m.length,b>m.length&&(b=m.length);let u=b-1;for(;u>=0&&(m[u]&192)===128;)u--;return u<0||u===0?b:u+_utf8len[m[u]]>b?u:b},strings={string2buf,buf2string,utf8border};function ZStream(){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}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(m){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},m||{});let b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=deflate_1$2.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(u!==Z_OK$2)throw new Error(messages[u]);if(b.header&&deflate_1$2.deflateSetHeader(this.strm,b.header),b.dictionary){let T;if(typeof b.dictionary=="string"?T=strings.string2buf(b.dictionary):toString$1.call(b.dictionary)==="[object ArrayBuffer]"?T=new Uint8Array(b.dictionary):T=b.dictionary,u=deflate_1$2.deflateSetDictionary(this.strm,T),u!==Z_OK$2)throw new Error(messages[u]);this._dict_set=!0}}Deflate$1.prototype.push=function(m,b){const u=this.strm,T=this.options.chunkSize;let r,c;if(this.ended)return!1;for(b===~~b?c=b:c=b===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof m=="string"?u.input=strings.string2buf(m):toString$1.call(m)==="[object ArrayBuffer]"?u.input=new Uint8Array(m):u.input=m,u.next_in=0,u.avail_in=u.input.length;;){if(u.avail_out===0&&(u.output=new Uint8Array(T),u.next_out=0,u.avail_out=T),(c===Z_SYNC_FLUSH||c===Z_FULL_FLUSH)&&u.avail_out<=6){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(r=deflate_1$2.deflate(u,c),r===Z_STREAM_END$2)return u.next_out>0&&this.onData(u.output.subarray(0,u.next_out)),r=deflate_1$2.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Z_OK$2;if(u.avail_out===0){this.onData(u.output);continue}if(c>0&&u.next_out>0){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(u.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(m){this.chunks.push(m)},Deflate$1.prototype.onEnd=function(m){m===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg};function deflate$1(m,b){const u=new Deflate$1(b);if(u.push(m,!0),u.err)throw u.msg||messages[u.err];return u.result}function deflateRaw$1(m,b){return b=b||{},b.raw=!0,deflate$1(m,b)}function gzip$1(m,b){return b=b||{},b.gzip=!0,deflate$1(m,b)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function(b,u){let T,r,c,e,t,i,_,x,C,F,j,Z,ee,re,K,se,fe,G,ne,ae,oe,le,pe,te;const ue=b.state;T=b.next_in,pe=b.input,r=T+(b.avail_in-5),c=b.next_out,te=b.output,e=c-(u-b.avail_out),t=c+(b.avail_out-257),i=ue.dmax,_=ue.wsize,x=ue.whave,C=ue.wnext,F=ue.window,j=ue.hold,Z=ue.bits,ee=ue.lencode,re=ue.distcode,K=(1<<ue.lenbits)-1,se=(1<<ue.distbits)-1;e:do{Z<15&&(j+=pe[T++]<<Z,Z+=8,j+=pe[T++]<<Z,Z+=8),fe=ee[j&K];t:for(;;){if(G=fe>>>24,j>>>=G,Z-=G,G=fe>>>16&255,G===0)te[c++]=fe&65535;else if(G&16){ne=fe&65535,G&=15,G&&(Z<G&&(j+=pe[T++]<<Z,Z+=8),ne+=j&(1<<G)-1,j>>>=G,Z-=G),Z<15&&(j+=pe[T++]<<Z,Z+=8,j+=pe[T++]<<Z,Z+=8),fe=re[j&se];i:for(;;){if(G=fe>>>24,j>>>=G,Z-=G,G=fe>>>16&255,G&16){if(ae=fe&65535,G&=15,Z<G&&(j+=pe[T++]<<Z,Z+=8,Z<G&&(j+=pe[T++]<<Z,Z+=8)),ae+=j&(1<<G)-1,ae>i){b.msg="invalid distance too far back",ue.mode=BAD$1;break e}if(j>>>=G,Z-=G,G=c-e,ae>G){if(G=ae-G,G>x&&ue.sane){b.msg="invalid distance too far back",ue.mode=BAD$1;break e}if(oe=0,le=F,C===0){if(oe+=_-G,G<ne){ne-=G;do te[c++]=F[oe++];while(--G);oe=c-ae,le=te}}else if(C<G){if(oe+=_+C-G,G-=C,G<ne){ne-=G;do te[c++]=F[oe++];while(--G);if(oe=0,C<ne){G=C,ne-=G;do te[c++]=F[oe++];while(--G);oe=c-ae,le=te}}}else if(oe+=C-G,G<ne){ne-=G;do te[c++]=F[oe++];while(--G);oe=c-ae,le=te}for(;ne>2;)te[c++]=le[oe++],te[c++]=le[oe++],te[c++]=le[oe++],ne-=3;ne&&(te[c++]=le[oe++],ne>1&&(te[c++]=le[oe++]))}else{oe=c-ae;do te[c++]=te[oe++],te[c++]=te[oe++],te[c++]=te[oe++],ne-=3;while(ne>2);ne&&(te[c++]=te[oe++],ne>1&&(te[c++]=te[oe++]))}}else if((G&64)===0){fe=re[(fe&65535)+(j&(1<<G)-1)];continue i}else{b.msg="invalid distance code",ue.mode=BAD$1;break e}break}}else if((G&64)===0){fe=ee[(fe&65535)+(j&(1<<G)-1)];continue t}else if(G&32){ue.mode=TYPE$1;break e}else{b.msg="invalid literal/length code",ue.mode=BAD$1;break e}break}}while(T<r&&c<t);ne=Z>>3,T-=ne,Z-=ne<<3,j&=(1<<Z)-1,b.next_in=T,b.next_out=c,b.avail_in=T<r?5+(r-T):5-(T-r),b.avail_out=c<t?257+(t-c):257-(c-t),ue.hold=j,ue.bits=Z};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=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]),lext=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]),dbase=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]),dext=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]),inflate_table=(m,b,u,T,r,c,e,t)=>{const i=t.bits;let _=0,x=0,C=0,F=0,j=0,Z=0,ee=0,re=0,K=0,se=0,fe,G,ne,ae,oe,le=null,pe;const te=new Uint16Array(MAXBITS+1),ue=new Uint16Array(MAXBITS+1);let he=null,me,be,Se;for(_=0;_<=MAXBITS;_++)te[_]=0;for(x=0;x<T;x++)te[b[u+x]]++;for(j=i,F=MAXBITS;F>=1&&te[F]===0;F--);if(j>F&&(j=F),F===0)return r[c++]=1<<24|64<<16|0,r[c++]=1<<24|64<<16|0,t.bits=1,0;for(C=1;C<F&&te[C]===0;C++);for(j<C&&(j=C),re=1,_=1;_<=MAXBITS;_++)if(re<<=1,re-=te[_],re<0)return-1;if(re>0&&(m===CODES$1||F!==1))return-1;for(ue[1]=0,_=1;_<MAXBITS;_++)ue[_+1]=ue[_]+te[_];for(x=0;x<T;x++)b[u+x]!==0&&(e[ue[b[u+x]]++]=x);if(m===CODES$1?(le=he=e,pe=20):m===LENS$1?(le=lbase,he=lext,pe=257):(le=dbase,he=dext,pe=0),se=0,x=0,_=C,oe=c,Z=j,ee=0,ne=-1,K=1<<j,ae=K-1,m===LENS$1&&K>ENOUGH_LENS$1||m===DISTS$1&&K>ENOUGH_DISTS$1)return 1;for(;;){me=_-ee,e[x]+1<pe?(be=0,Se=e[x]):e[x]>=pe?(be=he[e[x]-pe],Se=le[e[x]-pe]):(be=96,Se=0),fe=1<<_-ee,G=1<<Z,C=G;do G-=fe,r[oe+(se>>ee)+G]=me<<24|be<<16|Se|0;while(G!==0);for(fe=1<<_-1;se&fe;)fe>>=1;if(fe!==0?(se&=fe-1,se+=fe):se=0,x++,--te[_]===0){if(_===F)break;_=b[u+e[x]]}if(_>j&&(se&ae)!==ne){for(ee===0&&(ee=j),oe+=C,Z=_-ee,re=1<<Z;Z+ee<F&&(re-=te[Z+ee],!(re<=0));)Z++,re<<=1;if(K+=1<<Z,m===LENS$1&&K>ENOUGH_LENS$1||m===DISTS$1&&K>ENOUGH_DISTS$1)return 1;ne=se&ae,r[ne]=j<<24|Z<<16|oe-c|0}}return se!==0&&(r[oe+se]=_-ee<<24|64<<16|0),t.bits=j,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=m=>(m>>>24&255)+(m>>>8&65280)+((m&65280)<<8)+((m&255)<<24);function InflateState(){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 inflateStateCheck=m=>{if(!m)return 1;const b=m.state;return!b||b.strm!==m||b.mode<HEAD||b.mode>SYNC?1:0},inflateResetKeep=m=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const b=m.state;return m.total_in=m.total_out=b.total=0,m.msg="",b.wrap&&(m.adler=b.wrap&1),b.mode=HEAD,b.last=0,b.havedict=0,b.flags=-1,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new Int32Array(ENOUGH_LENS),b.distcode=b.distdyn=new Int32Array(ENOUGH_DISTS),b.sane=1,b.back=-1,Z_OK$1},inflateReset=m=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const b=m.state;return b.wsize=0,b.whave=0,b.wnext=0,inflateResetKeep(m)},inflateReset2=(m,b)=>{let u;if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const T=m.state;return b<0?(u=0,b=-b):(u=(b>>4)+5,b<48&&(b&=15)),b&&(b<8||b>15)?Z_STREAM_ERROR$1:(T.window!==null&&T.wbits!==b&&(T.window=null),T.wrap=u,T.wbits=b,inflateReset(m))},inflateInit2=(m,b)=>{if(!m)return Z_STREAM_ERROR$1;const u=new InflateState;m.state=u,u.strm=m,u.window=null,u.mode=HEAD;const T=inflateReset2(m,b);return T!==Z_OK$1&&(m.state=null),T},inflateInit=m=>inflateInit2(m,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=m=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let b=0;for(;b<144;)m.lens[b++]=8;for(;b<256;)m.lens[b++]=9;for(;b<280;)m.lens[b++]=7;for(;b<288;)m.lens[b++]=8;for(inftrees(LENS,m.lens,0,288,lenfix,0,m.work,{bits:9}),b=0;b<32;)m.lens[b++]=5;inftrees(DISTS,m.lens,0,32,distfix,0,m.work,{bits:5}),virgin=!1}m.lencode=lenfix,m.lenbits=9,m.distcode=distfix,m.distbits=5},updatewindow=(m,b,u,T)=>{let r;const c=m.state;return c.window===null&&(c.wsize=1<<c.wbits,c.wnext=0,c.whave=0,c.window=new Uint8Array(c.wsize)),T>=c.wsize?(c.window.set(b.subarray(u-c.wsize,u),0),c.wnext=0,c.whave=c.wsize):(r=c.wsize-c.wnext,r>T&&(r=T),c.window.set(b.subarray(u-T,u-T+r),c.wnext),T-=r,T?(c.window.set(b.subarray(u-T,u),0),c.wnext=T,c.whave=c.wsize):(c.wnext+=r,c.wnext===c.wsize&&(c.wnext=0),c.whave<c.wsize&&(c.whave+=r))),0},inflate$2=(m,b)=>{let u,T,r,c,e,t,i,_,x,C,F,j,Z,ee,re=0,K,se,fe,G,ne,ae,oe,le;const pe=new Uint8Array(4);let te,ue;const he=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(m)||!m.output||!m.input&&m.avail_in!==0)return Z_STREAM_ERROR$1;u=m.state,u.mode===TYPE&&(u.mode=TYPEDO),e=m.next_out,r=m.output,i=m.avail_out,c=m.next_in,T=m.input,t=m.avail_in,_=u.hold,x=u.bits,C=t,F=i,le=Z_OK$1;e:for(;;)switch(u.mode){case HEAD:if(u.wrap===0){u.mode=TYPEDO;break}for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.wrap&2&&_===35615){u.wbits===0&&(u.wbits=15),u.check=0,pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0),_=0,x=0,u.mode=FLAGS;break}if(u.head&&(u.head.done=!1),!(u.wrap&1)||(((_&255)<<8)+(_>>8))%31){m.msg="incorrect header check",u.mode=BAD;break}if((_&15)!==Z_DEFLATED){m.msg="unknown compression method",u.mode=BAD;break}if(_>>>=4,x-=4,oe=(_&15)+8,u.wbits===0&&(u.wbits=oe),oe>15||oe>u.wbits){m.msg="invalid window size",u.mode=BAD;break}u.dmax=1<<u.wbits,u.flags=0,m.adler=u.check=1,u.mode=_&512?DICTID:TYPE,_=0,x=0;break;case FLAGS:for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.flags=_,(u.flags&255)!==Z_DEFLATED){m.msg="unknown compression method",u.mode=BAD;break}if(u.flags&57344){m.msg="unknown header flags set",u.mode=BAD;break}u.head&&(u.head.text=_>>8&1),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0)),_=0,x=0,u.mode=TIME;case TIME:for(;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.head&&(u.head.time=_),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,pe[2]=_>>>16&255,pe[3]=_>>>24&255,u.check=crc32_1(u.check,pe,4,0)),_=0,x=0,u.mode=OS;case OS:for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.head&&(u.head.xflags=_&255,u.head.os=_>>8),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0)),_=0,x=0,u.mode=EXLEN;case EXLEN:if(u.flags&1024){for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.length=_,u.head&&(u.head.extra_len=_),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0)),_=0,x=0}else u.head&&(u.head.extra=null);u.mode=EXTRA;case EXTRA:if(u.flags&1024&&(j=u.length,j>t&&(j=t),j&&(u.head&&(oe=u.head.extra_len-u.length,u.head.extra||(u.head.extra=new Uint8Array(u.head.extra_len)),u.head.extra.set(T.subarray(c,c+j),oe)),u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,u.length-=j),u.length))break e;u.length=0,u.mode=NAME;case NAME:if(u.flags&2048){if(t===0)break e;j=0;do oe=T[c+j++],u.head&&oe&&u.length<65536&&(u.head.name+=String.fromCharCode(oe));while(oe&&j<t);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,oe)break e}else u.head&&(u.head.name=null);u.length=0,u.mode=COMMENT;case COMMENT:if(u.flags&4096){if(t===0)break e;j=0;do oe=T[c+j++],u.head&&oe&&u.length<65536&&(u.head.comment+=String.fromCharCode(oe));while(oe&&j<t);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,oe)break e}else u.head&&(u.head.comment=null);u.mode=HCRC;case HCRC:if(u.flags&512){for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.wrap&4&&_!==(u.check&65535)){m.msg="header crc mismatch",u.mode=BAD;break}_=0,x=0}u.head&&(u.head.hcrc=u.flags>>9&1,u.head.done=!0),m.adler=u.check=0,u.mode=TYPE;break;case DICTID:for(;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}m.adler=u.check=zswap32(_),_=0,x=0,u.mode=DICT;case DICT:if(u.havedict===0)return m.next_out=e,m.avail_out=i,m.next_in=c,m.avail_in=t,u.hold=_,u.bits=x,Z_NEED_DICT$1;m.adler=u.check=1,u.mode=TYPE;case TYPE:if(b===Z_BLOCK||b===Z_TREES)break e;case TYPEDO:if(u.last){_>>>=x&7,x-=x&7,u.mode=CHECK;break}for(;x<3;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}switch(u.last=_&1,_>>>=1,x-=1,_&3){case 0:u.mode=STORED;break;case 1:if(fixedtables(u),u.mode=LEN_,b===Z_TREES){_>>>=2,x-=2;break e}break;case 2:u.mode=TABLE;break;case 3:m.msg="invalid block type",u.mode=BAD}_>>>=2,x-=2;break;case STORED:for(_>>>=x&7,x-=x&7;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if((_&65535)!==(_>>>16^65535)){m.msg="invalid stored block lengths",u.mode=BAD;break}if(u.length=_&65535,_=0,x=0,u.mode=COPY_,b===Z_TREES)break e;case COPY_:u.mode=COPY;case COPY:if(j=u.length,j){if(j>t&&(j=t),j>i&&(j=i),j===0)break e;r.set(T.subarray(c,c+j),e),t-=j,c+=j,i-=j,e+=j,u.length-=j;break}u.mode=TYPE;break;case TABLE:for(;x<14;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.nlen=(_&31)+257,_>>>=5,x-=5,u.ndist=(_&31)+1,_>>>=5,x-=5,u.ncode=(_&15)+4,_>>>=4,x-=4,u.nlen>286||u.ndist>30){m.msg="too many length or distance symbols",u.mode=BAD;break}u.have=0,u.mode=LENLENS;case LENLENS:for(;u.have<u.ncode;){for(;x<3;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.lens[he[u.have++]]=_&7,_>>>=3,x-=3}for(;u.have<19;)u.lens[he[u.have++]]=0;if(u.lencode=u.lendyn,u.lenbits=7,te={bits:u.lenbits},le=inftrees(CODES,u.lens,0,19,u.lencode,0,u.work,te),u.lenbits=te.bits,le){m.msg="invalid code lengths set",u.mode=BAD;break}u.have=0,u.mode=CODELENS;case CODELENS:for(;u.have<u.nlen+u.ndist;){for(;re=u.lencode[_&(1<<u.lenbits)-1],K=re>>>24,se=re>>>16&255,fe=re&65535,!(K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(fe<16)_>>>=K,x-=K,u.lens[u.have++]=fe;else{if(fe===16){for(ue=K+2;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(_>>>=K,x-=K,u.have===0){m.msg="invalid bit length repeat",u.mode=BAD;break}oe=u.lens[u.have-1],j=3+(_&3),_>>>=2,x-=2}else if(fe===17){for(ue=K+3;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=K,x-=K,oe=0,j=3+(_&7),_>>>=3,x-=3}else{for(ue=K+7;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=K,x-=K,oe=0,j=11+(_&127),_>>>=7,x-=7}if(u.have+j>u.nlen+u.ndist){m.msg="invalid bit length repeat",u.mode=BAD;break}for(;j--;)u.lens[u.have++]=oe}}if(u.mode===BAD)break;if(u.lens[256]===0){m.msg="invalid code -- missing end-of-block",u.mode=BAD;break}if(u.lenbits=9,te={bits:u.lenbits},le=inftrees(LENS,u.lens,0,u.nlen,u.lencode,0,u.work,te),u.lenbits=te.bits,le){m.msg="invalid literal/lengths set",u.mode=BAD;break}if(u.distbits=6,u.distcode=u.distdyn,te={bits:u.distbits},le=inftrees(DISTS,u.lens,u.nlen,u.ndist,u.distcode,0,u.work,te),u.distbits=te.bits,le){m.msg="invalid distances set",u.mode=BAD;break}if(u.mode=LEN_,b===Z_TREES)break e;case LEN_:u.mode=LEN;case LEN:if(t>=6&&i>=258){m.next_out=e,m.avail_out=i,m.next_in=c,m.avail_in=t,u.hold=_,u.bits=x,inffast(m,F),e=m.next_out,r=m.output,i=m.avail_out,c=m.next_in,T=m.input,t=m.avail_in,_=u.hold,x=u.bits,u.mode===TYPE&&(u.back=-1);break}for(u.back=0;re=u.lencode[_&(1<<u.lenbits)-1],K=re>>>24,se=re>>>16&255,fe=re&65535,!(K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(se&&(se&240)===0){for(G=K,ne=se,ae=fe;re=u.lencode[ae+((_&(1<<G+ne)-1)>>G)],K=re>>>24,se=re>>>16&255,fe=re&65535,!(G+K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=G,x-=G,u.back+=G}if(_>>>=K,x-=K,u.back+=K,u.length=fe,se===0){u.mode=LIT;break}if(se&32){u.back=-1,u.mode=TYPE;break}if(se&64){m.msg="invalid literal/length code",u.mode=BAD;break}u.extra=se&15,u.mode=LENEXT;case LENEXT:if(u.extra){for(ue=u.extra;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.length+=_&(1<<u.extra)-1,_>>>=u.extra,x-=u.extra,u.back+=u.extra}u.was=u.length,u.mode=DIST;case DIST:for(;re=u.distcode[_&(1<<u.distbits)-1],K=re>>>24,se=re>>>16&255,fe=re&65535,!(K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if((se&240)===0){for(G=K,ne=se,ae=fe;re=u.distcode[ae+((_&(1<<G+ne)-1)>>G)],K=re>>>24,se=re>>>16&255,fe=re&65535,!(G+K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=G,x-=G,u.back+=G}if(_>>>=K,x-=K,u.back+=K,se&64){m.msg="invalid distance code",u.mode=BAD;break}u.offset=fe,u.extra=se&15,u.mode=DISTEXT;case DISTEXT:if(u.extra){for(ue=u.extra;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.offset+=_&(1<<u.extra)-1,_>>>=u.extra,x-=u.extra,u.back+=u.extra}if(u.offset>u.dmax){m.msg="invalid distance too far back",u.mode=BAD;break}u.mode=MATCH;case MATCH:if(i===0)break e;if(j=F-i,u.offset>j){if(j=u.offset-j,j>u.whave&&u.sane){m.msg="invalid distance too far back",u.mode=BAD;break}j>u.wnext?(j-=u.wnext,Z=u.wsize-j):Z=u.wnext-j,j>u.length&&(j=u.length),ee=u.window}else ee=r,Z=e-u.offset,j=u.length;j>i&&(j=i),i-=j,u.length-=j;do r[e++]=ee[Z++];while(--j);u.length===0&&(u.mode=LEN);break;case LIT:if(i===0)break e;r[e++]=u.length,i--,u.mode=LEN;break;case CHECK:if(u.wrap){for(;x<32;){if(t===0)break e;t--,_|=T[c++]<<x,x+=8}if(F-=i,m.total_out+=F,u.total+=F,u.wrap&4&&F&&(m.adler=u.check=u.flags?crc32_1(u.check,r,F,e-F):adler32_1(u.check,r,F,e-F)),F=i,u.wrap&4&&(u.flags?_:zswap32(_))!==u.check){m.msg="incorrect data check",u.mode=BAD;break}_=0,x=0}u.mode=LENGTH;case LENGTH:if(u.wrap&&u.flags){for(;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.wrap&4&&_!==(u.total&4294967295)){m.msg="incorrect length check",u.mode=BAD;break}_=0,x=0}u.mode=DONE;case DONE:le=Z_STREAM_END$1;break e;case BAD:le=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return m.next_out=e,m.avail_out=i,m.next_in=c,m.avail_in=t,u.hold=_,u.bits=x,(u.wsize||F!==m.avail_out&&u.mode<BAD&&(u.mode<CHECK||b!==Z_FINISH$1))&&updatewindow(m,m.output,m.next_out,F-m.avail_out),C-=m.avail_in,F-=m.avail_out,m.total_in+=C,m.total_out+=F,u.total+=F,u.wrap&4&&F&&(m.adler=u.check=u.flags?crc32_1(u.check,r,F,m.next_out-F):adler32_1(u.check,r,F,m.next_out-F)),m.data_type=u.bits+(u.last?64:0)+(u.mode===TYPE?128:0)+(u.mode===LEN_||u.mode===COPY_?256:0),(C===0&&F===0||b===Z_FINISH$1)&&le===Z_OK$1&&(le=Z_BUF_ERROR),le},inflateEnd=m=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;let b=m.state;return b.window&&(b.window=null),m.state=null,Z_OK$1},inflateGetHeader=(m,b)=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const u=m.state;return(u.wrap&2)===0?Z_STREAM_ERROR$1:(u.head=b,b.done=!1,Z_OK$1)},inflateSetDictionary=(m,b)=>{const u=b.length;let T,r,c;return inflateStateCheck(m)||(T=m.state,T.wrap!==0&&T.mode!==DICT)?Z_STREAM_ERROR$1:T.mode===DICT&&(r=1,r=adler32_1(r,b,u,0),r!==T.check)?Z_DATA_ERROR$1:(c=updatewindow(m,b,u,u),c?(T.mode=MEM,Z_MEM_ERROR$1):(T.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){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}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(m){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},m||{});const b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),b.windowBits>=0&&b.windowBits<16&&!(m&&m.windowBits)&&(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&(b.windowBits&15)===0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=inflate_1$2.inflateInit2(this.strm,b.windowBits);if(u!==Z_OK)throw new Error(messages[u]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),b.dictionary&&(typeof b.dictionary=="string"?b.dictionary=strings.string2buf(b.dictionary):toString.call(b.dictionary)==="[object ArrayBuffer]"&&(b.dictionary=new Uint8Array(b.dictionary)),b.raw&&(u=inflate_1$2.inflateSetDictionary(this.strm,b.dictionary),u!==Z_OK)))throw new Error(messages[u])}Inflate$1.prototype.push=function(m,b){const u=this.strm,T=this.options.chunkSize,r=this.options.dictionary;let c,e,t;if(this.ended)return!1;for(b===~~b?e=b:e=b===!0?Z_FINISH:Z_NO_FLUSH,toString.call(m)==="[object ArrayBuffer]"?u.input=new Uint8Array(m):u.input=m,u.next_in=0,u.avail_in=u.input.length;;){for(u.avail_out===0&&(u.output=new Uint8Array(T),u.next_out=0,u.avail_out=T),c=inflate_1$2.inflate(u,e),c===Z_NEED_DICT&&r&&(c=inflate_1$2.inflateSetDictionary(u,r),c===Z_OK?c=inflate_1$2.inflate(u,e):c===Z_DATA_ERROR&&(c=Z_NEED_DICT));u.avail_in>0&&c===Z_STREAM_END&&u.state.wrap>0&&m[u.next_in]!==0;)inflate_1$2.inflateReset(u),c=inflate_1$2.inflate(u,e);switch(c){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(c),this.ended=!0,!1}if(t=u.avail_out,u.next_out&&(u.avail_out===0||c===Z_STREAM_END))if(this.options.to==="string"){let i=strings.utf8border(u.output,u.next_out),_=u.next_out-i,x=strings.buf2string(u.output,i);u.next_out=_,u.avail_out=T-_,_&&u.output.set(u.output.subarray(i,i+_),0),this.onData(x)}else this.onData(u.output.length===u.next_out?u.output:u.output.subarray(0,u.next_out));if(!(c===Z_OK&&t===0)){if(c===Z_STREAM_END)return c=inflate_1$2.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,!0;if(u.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(m){this.chunks.push(m)},Inflate$1.prototype.onEnd=function(m){m===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg};function inflate$1(m,b){const u=new Inflate$1(b);if(u.push(m),u.err)throw u.msg||messages[u.err];return u.result}function inflateRaw$1(m,b){return b=b||{},b.raw=!0,inflate$1(m,b)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1},commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=m;function m(b,u){for(var T=new Array(arguments.length-1),r=0,c=2,e=!0;c<arguments.length;)T[r++]=arguments[c++];return new Promise(function(i,_){T[r]=function(C){if(e)if(e=!1,C)_(C);else{for(var F=new Array(arguments.length-1),j=0;j<F.length;)F[j++]=arguments[j];i.apply(null,F)}};try{b.apply(u||null,T)}catch(x){e&&(e=!1,_(x))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(m){var b=m;b.length=function(t){var i=t.length;if(!i)return 0;for(var _=0;--i%4>1&&t.charAt(i)==="=";)++_;return Math.ceil(t.length*3)/4-_};for(var u=new Array(64),T=new Array(123),r=0;r<64;)T[u[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;b.encode=function(t,i,_){for(var x=null,C=[],F=0,j=0,Z;i<_;){var ee=t[i++];switch(j){case 0:C[F++]=u[ee>>2],Z=(ee&3)<<4,j=1;break;case 1:C[F++]=u[Z|ee>>4],Z=(ee&15)<<2,j=2;break;case 2:C[F++]=u[Z|ee>>6],C[F++]=u[ee&63],j=0;break}F>8191&&((x||(x=[])).push(String.fromCharCode.apply(String,C)),F=0)}return j&&(C[F++]=u[Z],C[F++]=61,j===1&&(C[F++]=61)),x?(F&&x.push(String.fromCharCode.apply(String,C.slice(0,F))),x.join("")):String.fromCharCode.apply(String,C.slice(0,F))};var c="invalid encoding";b.decode=function(t,i,_){for(var x=_,C=0,F,j=0;j<t.length;){var Z=t.charCodeAt(j++);if(Z===61&&C>1)break;if((Z=T[Z])===void 0)throw Error(c);switch(C){case 0:F=Z,C=1;break;case 1:i[_++]=F<<2|(Z&48)>>4,F=Z,C=2;break;case 2:i[_++]=(F&15)<<4|(Z&60)>>2,F=Z,C=3;break;case 3:i[_++]=(F&3)<<6|Z,C=0;break}}if(C===1)throw Error(c);return _-x},b.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=m;function m(){this._listeners={}}return m.prototype.on=function(u,T,r){return(this._listeners[u]||(this._listeners[u]=[])).push({fn:T,ctx:r||this}),this},m.prototype.off=function(u,T){if(u===void 0)this._listeners={};else if(T===void 0)this._listeners[u]=[];else for(var r=this._listeners[u],c=0;c<r.length;)r[c].fn===T?r.splice(c,1):++c;return this},m.prototype.emit=function(u){var T=this._listeners[u];if(T){for(var r=[],c=1;c<arguments.length;)r.push(arguments[c++]);for(c=0;c<T.length;)T[c].fn.apply(T[c++].ctx,r)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=m(m);function m(c){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),i=t[3]===128;function _(j,Z,ee){e[0]=j,Z[ee]=t[0],Z[ee+1]=t[1],Z[ee+2]=t[2],Z[ee+3]=t[3]}function x(j,Z,ee){e[0]=j,Z[ee]=t[3],Z[ee+1]=t[2],Z[ee+2]=t[1],Z[ee+3]=t[0]}c.writeFloatLE=i?_:x,c.writeFloatBE=i?x:_;function C(j,Z){return t[0]=j[Z],t[1]=j[Z+1],t[2]=j[Z+2],t[3]=j[Z+3],e[0]}function F(j,Z){return t[3]=j[Z],t[2]=j[Z+1],t[1]=j[Z+2],t[0]=j[Z+3],e[0]}c.readFloatLE=i?C:F,c.readFloatBE=i?F:C})():(function(){function e(i,_,x,C){var F=_<0?1:0;if(F&&(_=-_),_===0)i(1/_>0?0:2147483648,x,C);else if(isNaN(_))i(2143289344,x,C);else if(_>34028234663852886e22)i((F<<31|2139095040)>>>0,x,C);else if(_<11754943508222875e-54)i((F<<31|Math.round(_/1401298464324817e-60))>>>0,x,C);else{var j=Math.floor(Math.log(_)/Math.LN2),Z=Math.round(_*Math.pow(2,-j)*8388608)&8388607;i((F<<31|j+127<<23|Z)>>>0,x,C)}}c.writeFloatLE=e.bind(null,b),c.writeFloatBE=e.bind(null,u);function t(i,_,x){var C=i(_,x),F=(C>>31)*2+1,j=C>>>23&255,Z=C&8388607;return j===255?Z?NaN:F*(1/0):j===0?F*1401298464324817e-60*Z:F*Math.pow(2,j-150)*(Z+8388608)}c.readFloatLE=t.bind(null,T),c.readFloatBE=t.bind(null,r)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),i=t[7]===128;function _(j,Z,ee){e[0]=j,Z[ee]=t[0],Z[ee+1]=t[1],Z[ee+2]=t[2],Z[ee+3]=t[3],Z[ee+4]=t[4],Z[ee+5]=t[5],Z[ee+6]=t[6],Z[ee+7]=t[7]}function x(j,Z,ee){e[0]=j,Z[ee]=t[7],Z[ee+1]=t[6],Z[ee+2]=t[5],Z[ee+3]=t[4],Z[ee+4]=t[3],Z[ee+5]=t[2],Z[ee+6]=t[1],Z[ee+7]=t[0]}c.writeDoubleLE=i?_:x,c.writeDoubleBE=i?x:_;function C(j,Z){return t[0]=j[Z],t[1]=j[Z+1],t[2]=j[Z+2],t[3]=j[Z+3],t[4]=j[Z+4],t[5]=j[Z+5],t[6]=j[Z+6],t[7]=j[Z+7],e[0]}function F(j,Z){return t[7]=j[Z],t[6]=j[Z+1],t[5]=j[Z+2],t[4]=j[Z+3],t[3]=j[Z+4],t[2]=j[Z+5],t[1]=j[Z+6],t[0]=j[Z+7],e[0]}c.readDoubleLE=i?C:F,c.readDoubleBE=i?F:C})():(function(){function e(i,_,x,C,F,j){var Z=C<0?1:0;if(Z&&(C=-C),C===0)i(0,F,j+_),i(1/C>0?0:2147483648,F,j+x);else if(isNaN(C))i(0,F,j+_),i(2146959360,F,j+x);else if(C>17976931348623157e292)i(0,F,j+_),i((Z<<31|2146435072)>>>0,F,j+x);else{var ee;if(C<22250738585072014e-324)ee=C/5e-324,i(ee>>>0,F,j+_),i((Z<<31|ee/4294967296)>>>0,F,j+x);else{var re=Math.floor(Math.log(C)/Math.LN2);re===1024&&(re=1023),ee=C*Math.pow(2,-re),i(ee*4503599627370496>>>0,F,j+_),i((Z<<31|re+1023<<20|ee*1048576&1048575)>>>0,F,j+x)}}}c.writeDoubleLE=e.bind(null,b,0,4),c.writeDoubleBE=e.bind(null,u,4,0);function t(i,_,x,C,F){var j=i(C,F+_),Z=i(C,F+x),ee=(Z>>31)*2+1,re=Z>>>20&2047,K=4294967296*(Z&1048575)+j;return re===2047?K?NaN:ee*(1/0):re===0?ee*5e-324*K:ee*Math.pow(2,re-1075)*(K+4503599627370496)}c.readDoubleLE=t.bind(null,T,0,4),c.readDoubleBE=t.bind(null,r,4,0)})(),c}function b(c,e,t){e[t]=c&255,e[t+1]=c>>>8&255,e[t+2]=c>>>16&255,e[t+3]=c>>>24}function u(c,e,t){e[t]=c>>>24,e[t+1]=c>>>16&255,e[t+2]=c>>>8&255,e[t+3]=c&255}function T(c,e){return(c[e]|c[e+1]<<8|c[e+2]<<16|c[e+3]<<24)>>>0}function r(c,e){return(c[e]<<24|c[e+1]<<16|c[e+2]<<8|c[e+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(m){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(m){var b=m;b.length=function(T){for(var r=0,c=0,e=0;e<T.length;++e)c=T.charCodeAt(e),c<128?r+=1:c<2048?r+=2:(c&64512)===55296&&(T.charCodeAt(e+1)&64512)===56320?(++e,r+=4):r+=3;return r},b.read=function(T,r,c){var e=c-r;if(e<1)return"";for(var t=null,i=[],_=0,x;r<c;)x=T[r++],x<128?i[_++]=x:x>191&&x<224?i[_++]=(x&31)<<6|T[r++]&63:x>239&&x<365?(x=((x&7)<<18|(T[r++]&63)<<12|(T[r++]&63)<<6|T[r++]&63)-65536,i[_++]=55296+(x>>10),i[_++]=56320+(x&1023)):i[_++]=(x&15)<<12|(T[r++]&63)<<6|T[r++]&63,_>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,i)),_=0);return t?(_&&t.push(String.fromCharCode.apply(String,i.slice(0,_))),t.join("")):String.fromCharCode.apply(String,i.slice(0,_))},b.write=function(T,r,c){for(var e=c,t,i,_=0;_<T.length;++_)t=T.charCodeAt(_),t<128?r[c++]=t:t<2048?(r[c++]=t>>6|192,r[c++]=t&63|128):(t&64512)===55296&&((i=T.charCodeAt(_+1))&64512)===56320?(t=65536+((t&1023)<<10)+(i&1023),++_,r[c++]=t>>18|240,r[c++]=t>>12&63|128,r[c++]=t>>6&63|128,r[c++]=t&63|128):(r[c++]=t>>12|224,r[c++]=t>>6&63|128,r[c++]=t&63|128);return c-e}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=m;function m(b,u,T){var r=T||8192,c=r>>>1,e=null,t=r;return function(_){if(_<1||_>c)return b(_);t+_>r&&(e=b(r),t=0);var x=u.call(e,t,t+=_);return t&7&&(t=(t|7)+1),x}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=b;var m=requireMinimal$1();function b(c,e){this.lo=c>>>0,this.hi=e>>>0}var u=b.zero=new b(0,0);u.toNumber=function(){return 0},u.zzEncode=u.zzDecode=function(){return this},u.length=function(){return 1};var T=b.zeroHash="\0\0\0\0\0\0\0\0";b.fromNumber=function(e){if(e===0)return u;var t=e<0;t&&(e=-e);var i=e>>>0,_=(e-i)/4294967296>>>0;return t&&(_=~_>>>0,i=~i>>>0,++i>4294967295&&(i=0,++_>4294967295&&(_=0))),new b(i,_)},b.from=function(e){if(typeof e=="number")return b.fromNumber(e);if(m.isString(e))if(m.Long)e=m.Long.fromString(e);else return b.fromNumber(parseInt(e,10));return e.low||e.high?new b(e.low>>>0,e.high>>>0):u},b.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+i*4294967296)}return this.lo+this.hi*4294967296},b.prototype.toLong=function(e){return m.Long?new m.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var r=String.prototype.charCodeAt;return b.fromHash=function(e){return e===T?u:new b((r.call(e,0)|r.call(e,1)<<8|r.call(e,2)<<16|r.call(e,3)<<24)>>>0,(r.call(e,4)|r.call(e,5)<<8|r.call(e,6)<<16|r.call(e,7)<<24)>>>0)},b.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},b.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},b.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},b.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(m){var b=m;b.asPromise=requireAspromise(),b.base64=requireBase64(),b.EventEmitter=requireEventemitter(),b.float=requireFloat(),b.inquire=requireInquire(),b.utf8=requireUtf8(),b.pool=requirePool(),b.LongBits=requireLongbits(),b.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),b.global=b.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,b.emptyArray=Object.freeze?Object.freeze([]):[],b.emptyObject=Object.freeze?Object.freeze({}):{},b.isInteger=Number.isInteger||function(c){return typeof c=="number"&&isFinite(c)&&Math.floor(c)===c},b.isString=function(c){return typeof c=="string"||c instanceof String},b.isObject=function(c){return c&&typeof c=="object"},b.isset=b.isSet=function(c,e){var t=c[e];return t!=null&&c.hasOwnProperty(e)?typeof t!="object"||(Array.isArray(t)?t.length:Object.keys(t).length)>0:!1},b.Buffer=(function(){try{var r=b.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}})(),b._Buffer_from=null,b._Buffer_allocUnsafe=null,b.newBuffer=function(c){return typeof c=="number"?b.Buffer?b._Buffer_allocUnsafe(c):new b.Array(c):b.Buffer?b._Buffer_from(c):typeof Uint8Array>"u"?c:new Uint8Array(c)},b.Array=typeof Uint8Array<"u"?Uint8Array:Array,b.Long=b.global.dcodeIO&&b.global.dcodeIO.Long||b.global.Long||b.inquire("long"),b.key2Re=/^true|false|0|1$/,b.key32Re=/^-?(?:0|[1-9][0-9]*)$/,b.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,b.longToHash=function(c){return c?b.LongBits.from(c).toHash():b.LongBits.zeroHash},b.longFromHash=function(c,e){var t=b.LongBits.fromHash(c);return b.Long?b.Long.fromBits(t.lo,t.hi,e):t.toNumber(!!e)};function u(r,c,e){for(var t=Object.keys(c),i=0;i<t.length;++i)(r[t[i]]===void 0||!e)&&(r[t[i]]=c[t[i]]);return r}b.merge=u,b.lcFirst=function(c){return c.charAt(0).toLowerCase()+c.substring(1)};function T(r){function c(e,t){if(!(this instanceof c))return new c(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,c):Object.defineProperty(this,"stack",{value:new Error().stack||""}),t&&u(this,t)}return c.prototype=Object.create(Error.prototype,{constructor:{value:c,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),c}b.newError=T,b.ProtocolError=T("ProtocolError"),b.oneOfGetter=function(c){for(var e={},t=0;t<c.length;++t)e[c[t]]=1;return function(){for(var i=Object.keys(this),_=i.length-1;_>-1;--_)if(e[i[_]]===1&&this[i[_]]!==void 0&&this[i[_]]!==null)return i[_]}},b.oneOfSetter=function(c){return function(e){for(var t=0;t<c.length;++t)c[t]!==e&&delete this[c[t]]}},b.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},b._configure=function(){var r=b.Buffer;if(!r){b._Buffer_from=b._Buffer_allocUnsafe=null;return}b._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,t){return new r(e,t)},b._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}})(minimal$1)),minimal$1}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1,writer$1=i;var m=requireMinimal$1(),b,u=m.LongBits,T=m.base64,r=m.utf8;function c(re,K,se){this.fn=re,this.len=K,this.next=void 0,this.val=se}function e(){}function t(re){this.head=re.head,this.tail=re.tail,this.len=re.len,this.next=re.states}function i(){this.len=0,this.head=new c(e,0,0),this.tail=this.head,this.states=null}var _=function(){return m.Buffer?function(){return(i.create=function(){return new b})()}:function(){return new i}};i.create=_(),i.alloc=function(K){return new m.Array(K)},m.Array!==Array&&(i.alloc=m.pool(i.alloc,m.Array.prototype.subarray)),i.prototype._push=function(K,se,fe){return this.tail=this.tail.next=new c(K,se,fe),this.len+=se,this};function x(re,K,se){K[se]=re&255}function C(re,K,se){for(;re>127;)K[se++]=re&127|128,re>>>=7;K[se]=re}function F(re,K){this.len=re,this.next=void 0,this.val=K}F.prototype=Object.create(c.prototype),F.prototype.fn=C,i.prototype.uint32=function(K){return this.len+=(this.tail=this.tail.next=new F((K=K>>>0)<128?1:K<16384?2:K<2097152?3:K<268435456?4:5,K)).len,this},i.prototype.int32=function(K){return K<0?this._push(j,10,u.fromNumber(K)):this.uint32(K)},i.prototype.sint32=function(K){return this.uint32((K<<1^K>>31)>>>0)};function j(re,K,se){for(;re.hi;)K[se++]=re.lo&127|128,re.lo=(re.lo>>>7|re.hi<<25)>>>0,re.hi>>>=7;for(;re.lo>127;)K[se++]=re.lo&127|128,re.lo=re.lo>>>7;K[se++]=re.lo}i.prototype.uint64=function(K){var se=u.from(K);return this._push(j,se.length(),se)},i.prototype.int64=i.prototype.uint64,i.prototype.sint64=function(K){var se=u.from(K).zzEncode();return this._push(j,se.length(),se)},i.prototype.bool=function(K){return this._push(x,1,K?1:0)};function Z(re,K,se){K[se]=re&255,K[se+1]=re>>>8&255,K[se+2]=re>>>16&255,K[se+3]=re>>>24}i.prototype.fixed32=function(K){return this._push(Z,4,K>>>0)},i.prototype.sfixed32=i.prototype.fixed32,i.prototype.fixed64=function(K){var se=u.from(K);return this._push(Z,4,se.lo)._push(Z,4,se.hi)},i.prototype.sfixed64=i.prototype.fixed64,i.prototype.float=function(K){return this._push(m.float.writeFloatLE,4,K)},i.prototype.double=function(K){return this._push(m.float.writeDoubleLE,8,K)};var ee=m.Array.prototype.set?function(K,se,fe){se.set(K,fe)}:function(K,se,fe){for(var G=0;G<K.length;++G)se[fe+G]=K[G]};return i.prototype.bytes=function(K){var se=K.length>>>0;if(!se)return this._push(x,1,0);if(m.isString(K)){var fe=i.alloc(se=T.length(K));T.decode(K,fe,0),K=fe}return this.uint32(se)._push(ee,se,K)},i.prototype.string=function(K){var se=r.length(K);return se?this.uint32(se)._push(r.write,se,K):this._push(x,1,0)},i.prototype.fork=function(){return this.states=new t(this),this.head=this.tail=new c(e,0,0),this.len=0,this},i.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(e,0,0),this.len=0),this},i.prototype.ldelim=function(){var K=this.head,se=this.tail,fe=this.len;return this.reset().uint32(fe),fe&&(this.tail.next=K.next,this.tail=se,this.len+=fe),this},i.prototype.finish=function(){for(var K=this.head.next,se=this.constructor.alloc(this.len),fe=0;K;)K.fn(K.val,se,fe),fe+=K.len,K=K.next;return se},i._configure=function(re){b=re,i.create=_(),b._configure()},writer$1}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=u;var m=requireWriter$1();(u.prototype=Object.create(m.prototype)).constructor=u;var b=requireMinimal$1();function u(){m.call(this)}u._configure=function(){u.alloc=b._Buffer_allocUnsafe,u.writeBytesBuffer=b.Buffer&&b.Buffer.prototype instanceof Uint8Array&&b.Buffer.prototype.set.name==="set"?function(c,e,t){e.set(c,t)}:function(c,e,t){if(c.copy)c.copy(e,t,0,c.length);else for(var i=0;i<c.length;)e[t++]=c[i++]}},u.prototype.bytes=function(c){b.isString(c)&&(c=b._Buffer_from(c,"base64"));var e=c.length>>>0;return this.uint32(e),e&&this._push(u.writeBytesBuffer,e,c),this};function T(r,c,e){r.length<40?b.utf8.write(r,c,e):c.utf8Write?c.utf8Write(r,e):c.write(r,e)}return u.prototype.string=function(c){var e=b.Buffer.byteLength(c);return this.uint32(e),e&&this._push(T,e,c),this},u._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=c;var m=requireMinimal$1(),b,u=m.LongBits,T=m.utf8;function r(C,F){return RangeError("index out of range: "+C.pos+" + "+(F||1)+" > "+C.len)}function c(C){this.buf=C,this.pos=0,this.len=C.length}var e=typeof Uint8Array<"u"?function(F){if(F instanceof Uint8Array||Array.isArray(F))return new c(F);throw Error("illegal buffer")}:function(F){if(Array.isArray(F))return new c(F);throw Error("illegal buffer")},t=function(){return m.Buffer?function(j){return(c.create=function(ee){return m.Buffer.isBuffer(ee)?new b(ee):e(ee)})(j)}:e};c.create=t(),c.prototype._slice=m.Array.prototype.subarray||m.Array.prototype.slice,c.prototype.uint32=(function(){var F=4294967295;return function(){if(F=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(F=(F|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(F=(F|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(F=(F|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(F=(F|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return F;if((this.pos+=5)>this.len)throw this.pos=this.len,r(this,10);return F}})(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var F=this.uint32();return F>>>1^-(F&1)|0};function i(){var C=new u(0,0),F=0;if(this.len-this.pos>4){for(;F<4;++F)if(C.lo=(C.lo|(this.buf[this.pos]&127)<<F*7)>>>0,this.buf[this.pos++]<128)return C;if(C.lo=(C.lo|(this.buf[this.pos]&127)<<28)>>>0,C.hi=(C.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return C;F=0}else{for(;F<3;++F){if(this.pos>=this.len)throw r(this);if(C.lo=(C.lo|(this.buf[this.pos]&127)<<F*7)>>>0,this.buf[this.pos++]<128)return C}return C.lo=(C.lo|(this.buf[this.pos++]&127)<<F*7)>>>0,C}if(this.len-this.pos>4){for(;F<5;++F)if(C.hi=(C.hi|(this.buf[this.pos]&127)<<F*7+3)>>>0,this.buf[this.pos++]<128)return C}else for(;F<5;++F){if(this.pos>=this.len)throw r(this);if(C.hi=(C.hi|(this.buf[this.pos]&127)<<F*7+3)>>>0,this.buf[this.pos++]<128)return C}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function _(C,F){return(C[F-4]|C[F-3]<<8|C[F-2]<<16|C[F-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return _(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw r(this,4);return _(this.buf,this.pos+=4)|0};function x(){if(this.pos+8>this.len)throw r(this,8);return new u(_(this.buf,this.pos+=4),_(this.buf,this.pos+=4))}return c.prototype.float=function(){if(this.pos+4>this.len)throw r(this,4);var F=m.float.readFloatLE(this.buf,this.pos);return this.pos+=4,F},c.prototype.double=function(){if(this.pos+8>this.len)throw r(this,4);var F=m.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,F},c.prototype.bytes=function(){var F=this.uint32(),j=this.pos,Z=this.pos+F;if(Z>this.len)throw r(this,F);if(this.pos+=F,Array.isArray(this.buf))return this.buf.slice(j,Z);if(j===Z){var ee=m.Buffer;return ee?ee.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,j,Z)},c.prototype.string=function(){var F=this.bytes();return T.read(F,0,F.length)},c.prototype.skip=function(F){if(typeof F=="number"){if(this.pos+F>this.len)throw r(this,F);this.pos+=F}else do if(this.pos>=this.len)throw r(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(C){switch(C){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(C=this.uint32()&7)!==4;)this.skipType(C);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+C+" at offset "+this.pos)}return this},c._configure=function(C){b=C,c.create=t(),b._configure();var F=m.Long?"toLong":"toNumber";m.merge(c.prototype,{int64:function(){return i.call(this)[F](!1)},uint64:function(){return i.call(this)[F](!0)},sint64:function(){return i.call(this).zzDecode()[F](!1)},fixed64:function(){return x.call(this)[F](!0)},sfixed64:function(){return x.call(this)[F](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=u;var m=requireReader();(u.prototype=Object.create(m.prototype)).constructor=u;var b=requireMinimal$1();function u(T){m.call(this,T)}return u._configure=function(){b.Buffer&&(u.prototype._slice=b.Buffer.prototype.slice)},u.prototype.string=function(){var r=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+r,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+r,this.len))},u._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=b;var m=requireMinimal$1();(b.prototype=Object.create(m.EventEmitter.prototype)).constructor=b;function b(u,T,r){if(typeof u!="function")throw TypeError("rpcImpl must be a function");m.EventEmitter.call(this),this.rpcImpl=u,this.requestDelimited=!!T,this.responseDelimited=!!r}return b.prototype.rpcCall=function u(T,r,c,e,t){if(!e)throw TypeError("request must be specified");var i=this;if(!t)return m.asPromise(u,i,T,r,c,e);if(!i.rpcImpl){setTimeout(function(){t(Error("already ended"))},0);return}try{return i.rpcImpl(T,r[i.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(x,C){if(x)return i.emit("error",x,T),t(x);if(C===null){i.end(!0);return}if(!(C instanceof c))try{C=c[i.responseDelimited?"decodeDelimited":"decode"](C)}catch(F){return i.emit("error",F,T),t(F)}return i.emit("data",C,T),t(null,C)})}catch(_){i.emit("error",_,T),setTimeout(function(){t(_)},0);return}},b.prototype.end=function(T){return this.rpcImpl&&(T||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(m){var b=m;b.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(m){var b=m;b.build="minimal",b.Writer=requireWriter$1(),b.BufferWriter=requireWriter_buffer(),b.Reader=requireReader(),b.BufferReader=requireReader_buffer(),b.util=requireMinimal$1(),b.rpc=requireRpc(),b.roots=requireRoots(),b.configure=u;function u(){b.util._configure(),b.Writer._configure(b.BufferWriter),b.Reader._configure(b.BufferReader)}u()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const m={};return m.quick=(function(){const b={};return b.voice=(function(){const u={};return u.proto=(function(){const T={};return T.CommonReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.event="",r.prototype.data=$util.newBuffer([]),r.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.version=0,r.prototype.compress=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&t.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&t.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&t.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&t.uint32(56).bool(e.compress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.event=e.string();break}case 2:{x.data=e.bytes();break}case 3:{x.sn=e.int64();break}case 4:{x.time=e.int64();break}case 5:{x.valid=e.int64();break}case 6:{x.version=e.int32();break}case 7:{x.compress=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let t=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(t.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,t.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.sn!=null&&($util.Long?(t.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?t.sn=parseInt(e.sn,10):typeof e.sn=="number"?t.sn=e.sn:typeof e.sn=="object"&&(t.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(t.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?t.valid=parseInt(e.valid,10):typeof e.valid=="number"?t.valid=e.valid:typeof e.valid=="object"&&(t.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(t.version=e.version|0),e.compress!=null&&(t.compress=!!e.compress),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.event="",t.bytes===String?i.data="":(i.data=[],t.bytes!==Array&&(i.data=$util.newBuffer(i.data))),$util.Long){let _=new $util.Long(0,0,!1);i.sn=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.sn=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.valid=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.valid=t.longs===String?"0":0;i.version=0,i.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(i.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?$util.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?i.sn=t.longs===String?String(e.sn):e.sn:i.sn=t.longs===String?$util.Long.prototype.toString.call(e.sn):t.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?i.valid=t.longs===String?String(e.valid):e.valid:i.valid=t.longs===String?$util.Long.prototype.toString.call(e.valid):t.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(i.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(i.compress=e.compress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},r})(),T.CommonRsp=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.event="",r.prototype.data=$util.newBuffer([]),r.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.code=0,r.prototype.desc="",r.prototype.version=0,r.prototype.compress=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&t.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&t.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&t.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&t.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&t.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&t.uint32(72).bool(e.compress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.event=e.string();break}case 2:{x.data=e.bytes();break}case 3:{x.sn=e.int64();break}case 4:{x.time=e.int64();break}case 5:{x.valid=e.int64();break}case 6:{x.code=e.int32();break}case 7:{x.desc=e.string();break}case 8:{x.version=e.int32();break}case 9:{x.compress=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.code!=null&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":e.desc!=null&&e.hasOwnProperty("desc")&&!$util.isString(e.desc)?"desc: string expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let t=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(t.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,t.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.sn!=null&&($util.Long?(t.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?t.sn=parseInt(e.sn,10):typeof e.sn=="number"?t.sn=e.sn:typeof e.sn=="object"&&(t.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(t.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?t.valid=parseInt(e.valid,10):typeof e.valid=="number"?t.valid=e.valid:typeof e.valid=="object"&&(t.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(t.code=e.code|0),e.desc!=null&&(t.desc=String(e.desc)),e.version!=null&&(t.version=e.version|0),e.compress!=null&&(t.compress=!!e.compress),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.event="",t.bytes===String?i.data="":(i.data=[],t.bytes!==Array&&(i.data=$util.newBuffer(i.data))),$util.Long){let _=new $util.Long(0,0,!1);i.sn=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.sn=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.valid=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.valid=t.longs===String?"0":0;i.code=0,i.desc="",i.version=0,i.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(i.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?$util.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?i.sn=t.longs===String?String(e.sn):e.sn:i.sn=t.longs===String?$util.Long.prototype.toString.call(e.sn):t.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?i.valid=t.longs===String?String(e.valid):e.valid:i.valid=t.longs===String?$util.Long.prototype.toString.call(e.valid):t.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(i.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(i.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(i.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(i.compress=e.compress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},r})(),T.User=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.id="",r.prototype.callAction=null,r.prototype.callState=null,r.prototype.joinTime=null,r.prototype.tracks=$util.emptyArray,r.prototype.permissions=null,r.prototype.isPublished=null,r.prototype.behavior=null,r.prototype.channelCache=null;let c;return Object.defineProperty(r.prototype,"_callAction",{get:$util.oneOfGetter(c=["callAction"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_callState",{get:$util.oneOfGetter(c=["callState"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_joinTime",{get:$util.oneOfGetter(c=["joinTime"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_permissions",{get:$util.oneOfGetter(c=["permissions"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_isPublished",{get:$util.oneOfGetter(c=["isPublished"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_behavior",{get:$util.oneOfGetter(c=["behavior"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_channelCache",{get:$util.oneOfGetter(c=["channelCache"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.id!=null&&Object.hasOwnProperty.call(t,"id")&&i.uint32(10).string(t.id),t.callAction!=null&&Object.hasOwnProperty.call(t,"callAction")&&i.uint32(16).int32(t.callAction),t.callState!=null&&Object.hasOwnProperty.call(t,"callState")&&i.uint32(24).int32(t.callState),t.joinTime!=null&&Object.hasOwnProperty.call(t,"joinTime")&&i.uint32(32).int64(t.joinTime),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(42).fork()).ldelim();return t.permissions!=null&&Object.hasOwnProperty.call(t,"permissions")&&i.uint32(48).int32(t.permissions),t.isPublished!=null&&Object.hasOwnProperty.call(t,"isPublished")&&i.uint32(56).bool(t.isPublished),t.behavior!=null&&Object.hasOwnProperty.call(t,"behavior")&&i.uint32(64).int32(t.behavior),t.channelCache!=null&&Object.hasOwnProperty.call(t,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(t.channelCache,i.uint32(74).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.User;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.id=t.string();break}case 2:{C.callAction=t.int32();break}case 3:{C.callState=t.int32();break}case 4:{C.joinTime=t.int64();break}case 5:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}case 6:{C.permissions=t.int32();break}case 7:{C.isPublished=t.bool();break}case 8:{C.behavior=t.int32();break}case 9:{C.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(t,t.uint32());break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.id!=null&&t.hasOwnProperty("id")&&!$util.isString(t.id))return"id: string expected";if(t.callAction!=null&&t.hasOwnProperty("callAction")&&!$util.isInteger(t.callAction))return"callAction: integer expected";if(t.callState!=null&&t.hasOwnProperty("callState")&&!$util.isInteger(t.callState))return"callState: integer expected";if(t.joinTime!=null&&t.hasOwnProperty("joinTime")&&!$util.isInteger(t.joinTime)&&!(t.joinTime&&$util.isInteger(t.joinTime.low)&&$util.isInteger(t.joinTime.high)))return"joinTime: integer|Long expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}if(t.permissions!=null&&t.hasOwnProperty("permissions")&&!$util.isInteger(t.permissions))return"permissions: integer expected";if(t.isPublished!=null&&t.hasOwnProperty("isPublished")&&typeof t.isPublished!="boolean")return"isPublished: boolean expected";if(t.behavior!=null&&t.hasOwnProperty("behavior")&&!$util.isInteger(t.behavior))return"behavior: integer expected";if(t.channelCache!=null&&t.hasOwnProperty("channelCache")){let i=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(t.channelCache);if(i)return"channelCache."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.User)return t;let i=new $root.com.quick.voice.proto.User;if(t.id!=null&&(i.id=String(t.id)),t.callAction!=null&&(i.callAction=t.callAction|0),t.callState!=null&&(i.callState=t.callState|0),t.joinTime!=null&&($util.Long?(i.joinTime=$util.Long.fromValue(t.joinTime)).unsigned=!1:typeof t.joinTime=="string"?i.joinTime=parseInt(t.joinTime,10):typeof t.joinTime=="number"?i.joinTime=t.joinTime:typeof t.joinTime=="object"&&(i.joinTime=new $util.LongBits(t.joinTime.low>>>0,t.joinTime.high>>>0).toNumber())),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}if(t.permissions!=null&&(i.permissions=t.permissions|0),t.isPublished!=null&&(i.isPublished=!!t.isPublished),t.behavior!=null&&(i.behavior=t.behavior|0),t.channelCache!=null){if(typeof t.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");i.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(t.channelCache)}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.id=""),t.id!=null&&t.hasOwnProperty("id")&&(_.id=t.id),t.callAction!=null&&t.hasOwnProperty("callAction")&&(_.callAction=t.callAction,i.oneofs&&(_._callAction="callAction")),t.callState!=null&&t.hasOwnProperty("callState")&&(_.callState=t.callState,i.oneofs&&(_._callState="callState")),t.joinTime!=null&&t.hasOwnProperty("joinTime")&&(typeof t.joinTime=="number"?_.joinTime=i.longs===String?String(t.joinTime):t.joinTime:_.joinTime=i.longs===String?$util.Long.prototype.toString.call(t.joinTime):i.longs===Number?new $util.LongBits(t.joinTime.low>>>0,t.joinTime.high>>>0).toNumber():t.joinTime,i.oneofs&&(_._joinTime="joinTime")),t.tracks&&t.tracks.length){_.tracks=[];for(let x=0;x<t.tracks.length;++x)_.tracks[x]=$root.com.quick.voice.proto.Track.toObject(t.tracks[x],i)}return t.permissions!=null&&t.hasOwnProperty("permissions")&&(_.permissions=t.permissions,i.oneofs&&(_._permissions="permissions")),t.isPublished!=null&&t.hasOwnProperty("isPublished")&&(_.isPublished=t.isPublished,i.oneofs&&(_._isPublished="isPublished")),t.behavior!=null&&t.hasOwnProperty("behavior")&&(_.behavior=t.behavior,i.oneofs&&(_._behavior="behavior")),t.channelCache!=null&&t.hasOwnProperty("channelCache")&&(_.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(t.channelCache,i),i.oneofs&&(_._channelCache="channelCache")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.User"},r})(),T.DataChannelCacheInfo=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return e;let t=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelCacheInfo"},r})(),T.DataChannel=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.dataChannelName="",r.prototype.id=null;let c;return Object.defineProperty(r.prototype,"_id",{get:$util.oneOfGetter(c=["id"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.dataChannelName!=null&&Object.hasOwnProperty.call(t,"dataChannelName")&&i.uint32(10).string(t.dataChannelName),t.id!=null&&Object.hasOwnProperty.call(t,"id")&&i.uint32(16).int32(t.id),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.DataChannel;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.dataChannelName=t.string();break}case 2:{C.id=t.int32();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.dataChannelName!=null&&t.hasOwnProperty("dataChannelName")&&!$util.isString(t.dataChannelName)?"dataChannelName: string expected":t.id!=null&&t.hasOwnProperty("id")&&!$util.isInteger(t.id)?"id: integer expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannel)return t;let i=new $root.com.quick.voice.proto.DataChannel;return t.dataChannelName!=null&&(i.dataChannelName=String(t.dataChannelName)),t.id!=null&&(i.id=t.id|0),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.dataChannelName=""),t.dataChannelName!=null&&t.hasOwnProperty("dataChannelName")&&(_.dataChannelName=t.dataChannelName),t.id!=null&&t.hasOwnProperty("id")&&(_.id=t.id,i.oneofs&&(_._id="id")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannel"},r})(),T.Login=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.appid="",r.prototype.userId="",r.prototype.sdkToken="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&t.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&t.uint32(26).string(e.sdkToken),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.Login;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.appid=e.string();break}case 2:{x.userId=e.string();break}case 3:{x.sdkToken=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.appid!=null&&e.hasOwnProperty("appid")&&!$util.isString(e.appid)?"appid: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let t=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(t.appid=String(e.appid)),e.userId!=null&&(t.userId=String(e.userId)),e.sdkToken!=null&&(t.sdkToken=String(e.sdkToken)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.appid="",i.userId="",i.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(i.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(i.sdkToken=e.sdkToken),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},r})(),T.Track=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.mid="",r.prototype.trackName=null,r.prototype.location=null,r.prototype.userId=null,r.prototype.code=null,r.prototype.desc=null,r.prototype.type=null,r.prototype.isValid=null,r.prototype.simulcast=null,r.prototype.lastRetry=null;let c;return Object.defineProperty(r.prototype,"_trackName",{get:$util.oneOfGetter(c=["trackName"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_location",{get:$util.oneOfGetter(c=["location"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_userId",{get:$util.oneOfGetter(c=["userId"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_code",{get:$util.oneOfGetter(c=["code"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_type",{get:$util.oneOfGetter(c=["type"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_isValid",{get:$util.oneOfGetter(c=["isValid"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_simulcast",{get:$util.oneOfGetter(c=["simulcast"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_lastRetry",{get:$util.oneOfGetter(c=["lastRetry"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.mid!=null&&Object.hasOwnProperty.call(t,"mid")&&i.uint32(10).string(t.mid),t.trackName!=null&&Object.hasOwnProperty.call(t,"trackName")&&i.uint32(18).string(t.trackName),t.location!=null&&Object.hasOwnProperty.call(t,"location")&&i.uint32(26).string(t.location),t.userId!=null&&Object.hasOwnProperty.call(t,"userId")&&i.uint32(34).string(t.userId),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(40).int32(t.code),t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(50).string(t.desc),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&i.uint32(56).int32(t.type),t.isValid!=null&&Object.hasOwnProperty.call(t,"isValid")&&i.uint32(64).bool(t.isValid),t.simulcast!=null&&Object.hasOwnProperty.call(t,"simulcast")&&i.uint32(74).string(t.simulcast),t.lastRetry!=null&&Object.hasOwnProperty.call(t,"lastRetry")&&i.uint32(80).bool(t.lastRetry),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.Track;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.mid=t.string();break}case 2:{C.trackName=t.string();break}case 3:{C.location=t.string();break}case 4:{C.userId=t.string();break}case 5:{C.code=t.int32();break}case 6:{C.desc=t.string();break}case 7:{C.type=t.int32();break}case 8:{C.isValid=t.bool();break}case 9:{C.simulcast=t.string();break}case 10:{C.lastRetry=t.bool();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.mid!=null&&t.hasOwnProperty("mid")&&!$util.isString(t.mid))return"mid: string expected";if(t.trackName!=null&&t.hasOwnProperty("trackName")&&!$util.isString(t.trackName))return"trackName: string expected";if(t.location!=null&&t.hasOwnProperty("location")&&!$util.isString(t.location))return"location: string expected";if(t.userId!=null&&t.hasOwnProperty("userId")&&!$util.isString(t.userId))return"userId: string expected";if(t.code!=null&&t.hasOwnProperty("code")&&!$util.isInteger(t.code))return"code: integer expected";if(t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc))return"desc: string expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return t.isValid!=null&&t.hasOwnProperty("isValid")&&typeof t.isValid!="boolean"?"isValid: boolean expected":t.simulcast!=null&&t.hasOwnProperty("simulcast")&&!$util.isString(t.simulcast)?"simulcast: string expected":t.lastRetry!=null&&t.hasOwnProperty("lastRetry")&&typeof t.lastRetry!="boolean"?"lastRetry: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.Track)return t;let i=new $root.com.quick.voice.proto.Track;switch(t.mid!=null&&(i.mid=String(t.mid)),t.trackName!=null&&(i.trackName=String(t.trackName)),t.location!=null&&(i.location=String(t.location)),t.userId!=null&&(i.userId=String(t.userId)),t.code!=null&&(i.code=t.code|0),t.desc!=null&&(i.desc=String(t.desc)),t.type){default:if(typeof t.type=="number"){i.type=t.type;break}break;case"Microphone":case 0:i.type=0;break;case"Camera":case 1:i.type=1;break;case"Screen":case 2:i.type=2;break;case"SystemVoice":case 3:i.type=3;break}return t.isValid!=null&&(i.isValid=!!t.isValid),t.simulcast!=null&&(i.simulcast=String(t.simulcast)),t.lastRetry!=null&&(i.lastRetry=!!t.lastRetry),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.mid=""),t.mid!=null&&t.hasOwnProperty("mid")&&(_.mid=t.mid),t.trackName!=null&&t.hasOwnProperty("trackName")&&(_.trackName=t.trackName,i.oneofs&&(_._trackName="trackName")),t.location!=null&&t.hasOwnProperty("location")&&(_.location=t.location,i.oneofs&&(_._location="location")),t.userId!=null&&t.hasOwnProperty("userId")&&(_.userId=t.userId,i.oneofs&&(_._userId="userId")),t.code!=null&&t.hasOwnProperty("code")&&(_.code=t.code,i.oneofs&&(_._code="code")),t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),t.type!=null&&t.hasOwnProperty("type")&&(_.type=i.enums===String?$root.com.quick.voice.proto.TrackType[t.type]===void 0?t.type:$root.com.quick.voice.proto.TrackType[t.type]:t.type,i.oneofs&&(_._type="type")),t.isValid!=null&&t.hasOwnProperty("isValid")&&(_.isValid=t.isValid,i.oneofs&&(_._isValid="isValid")),t.simulcast!=null&&t.hasOwnProperty("simulcast")&&(_.simulcast=t.simulcast,i.oneofs&&(_._simulcast="simulcast")),t.lastRetry!=null&&t.hasOwnProperty("lastRetry")&&(_.lastRetry=t.lastRetry,i.oneofs&&(_._lastRetry="lastRetry")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.Track"},r})(),T.JoinReq=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.callType=0,r.prototype.token=null,r.prototype.lang=null,r.prototype.stt=null;let c;return Object.defineProperty(r.prototype,"_token",{get:$util.oneOfGetter(c=["token"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_lang",{get:$util.oneOfGetter(c=["lang"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_stt",{get:$util.oneOfGetter(c=["stt"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.callType!=null&&Object.hasOwnProperty.call(t,"callType")&&i.uint32(24).int32(t.callType),t.token!=null&&Object.hasOwnProperty.call(t,"token")&&i.uint32(34).string(t.token),t.lang!=null&&Object.hasOwnProperty.call(t,"lang")&&$root.com.quick.voice.proto.AiLangSetting.encode(t.lang,i.uint32(42).fork()).ldelim(),t.stt!=null&&Object.hasOwnProperty.call(t,"stt")&&i.uint32(48).bool(t.stt),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.JoinReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.callType=t.int32();break}case 4:{C.token=t.string();break}case 5:{C.lang=$root.com.quick.voice.proto.AiLangSetting.decode(t,t.uint32());break}case 6:{C.stt=t.bool();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}if(t.callType!=null&&t.hasOwnProperty("callType"))switch(t.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}if(t.token!=null&&t.hasOwnProperty("token")&&!$util.isString(t.token))return"token: string expected";if(t.lang!=null&&t.hasOwnProperty("lang")){let i=$root.com.quick.voice.proto.AiLangSetting.verify(t.lang);if(i)return"lang."+i}return t.stt!=null&&t.hasOwnProperty("stt")&&typeof t.stt!="boolean"?"stt: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.JoinReq)return t;let i=new $root.com.quick.voice.proto.JoinReq;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}switch(t.callType){default:if(typeof t.callType=="number"){i.callType=t.callType;break}break;case"Normal":case 0:i.callType=0;break;case"Meeting":case 1:i.callType=1;break;case"Live":case 2:i.callType=2;break}if(t.token!=null&&(i.token=String(t.token)),t.lang!=null){if(typeof t.lang!="object")throw TypeError(".com.quick.voice.proto.JoinReq.lang: object expected");i.lang=$root.com.quick.voice.proto.AiLangSetting.fromObject(t.lang)}return t.stt!=null&&(i.stt=!!t.stt),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null,_.callType=i.enums===String?"Normal":0),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.callType!=null&&t.hasOwnProperty("callType")&&(_.callType=i.enums===String?$root.com.quick.voice.proto.CallType[t.callType]===void 0?t.callType:$root.com.quick.voice.proto.CallType[t.callType]:t.callType),t.token!=null&&t.hasOwnProperty("token")&&(_.token=t.token,i.oneofs&&(_._token="token")),t.lang!=null&&t.hasOwnProperty("lang")&&(_.lang=$root.com.quick.voice.proto.AiLangSetting.toObject(t.lang,i),i.oneofs&&(_._lang="lang")),t.stt!=null&&t.hasOwnProperty("stt")&&(_.stt=t.stt,i.oneofs&&(_._stt="stt")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.JoinReq"},r})(),T.JoinRsp=(function(){function r(c){if(this.roomUsers=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.roomUsers=$util.emptyArray,r.prototype.callType=0,r.prototype.wifiOnly=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let i=0;i<e.roomUsers.length;++i)$root.com.quick.voice.proto.User.encode(e.roomUsers[i],t.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&t.uint32(24).int32(e.callType),e.wifiOnly!=null&&Object.hasOwnProperty.call(e,"wifiOnly")&&t.uint32(32).bool(e.wifiOnly),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.roomUsers&&x.roomUsers.length||(x.roomUsers=[]),x.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{x.callType=e.int32();break}case 4:{x.wifiOnly=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let t=0;t<e.roomUsers.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.roomUsers[t]);if(i)return"roomUsers."+i}}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return e.wifiOnly!=null&&e.hasOwnProperty("wifiOnly")&&typeof e.wifiOnly!="boolean"?"wifiOnly: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let t=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");t.roomUsers=[];for(let i=0;i<e.roomUsers.length;++i){if(typeof e.roomUsers[i]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");t.roomUsers[i]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[i])}}switch(e.callType){default:if(typeof e.callType=="number"){t.callType=e.callType;break}break;case"Normal":case 0:t.callType=0;break;case"Meeting":case 1:t.callType=1;break;case"Live":case 2:t.callType=2;break}return e.wifiOnly!=null&&(t.wifiOnly=!!e.wifiOnly),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.roomUsers=[]),t.defaults&&(i.roomId="",i.callType=t.enums===String?"Normal":0,i.wifiOnly=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){i.roomUsers=[];for(let _=0;_<e.roomUsers.length;++_)i.roomUsers[_]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[_],t)}return e.callType!=null&&e.hasOwnProperty("callType")&&(i.callType=t.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),e.wifiOnly!=null&&e.hasOwnProperty("wifiOnly")&&(i.wifiOnly=e.wifiOnly),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},r})(),T.JoinNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let t=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},r})(),T.ConnectCFReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(10).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.sdp=e.string():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let t=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},r})(),T.ConnectCFRsp=(function(){function r(e){if(this.subscribeUsers=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.subscribeUsers=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.subscribeUsers!=null&&t.subscribeUsers.length)for(let _=0;_<t.subscribeUsers.length;++_)$root.com.quick.voice.proto.User.encode(t.subscribeUsers[_],i.uint32(18).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.ConnectCFRsp;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.remoteSdp=t.string();break}case 2:{C.subscribeUsers&&C.subscribeUsers.length||(C.subscribeUsers=[]),C.subscribeUsers.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 3:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp))return"remoteSdp: string expected";if(t.subscribeUsers!=null&&t.hasOwnProperty("subscribeUsers")){if(!Array.isArray(t.subscribeUsers))return"subscribeUsers: array expected";for(let i=0;i<t.subscribeUsers.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.subscribeUsers[i]);if(_)return"subscribeUsers."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ConnectCFRsp)return t;let i=new $root.com.quick.voice.proto.ConnectCFRsp;if(t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.subscribeUsers){if(!Array.isArray(t.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");i.subscribeUsers=[];for(let _=0;_<t.subscribeUsers.length;++_){if(typeof t.subscribeUsers[_]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");i.subscribeUsers[_]=$root.com.quick.voice.proto.User.fromObject(t.subscribeUsers[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.subscribeUsers=[]),i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.subscribeUsers&&t.subscribeUsers.length){_.subscribeUsers=[];for(let x=0;x<t.subscribeUsers.length;++x)_.subscribeUsers[x]=$root.com.quick.voice.proto.User.toObject(t.subscribeUsers[x],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ConnectCFRsp"},r})(),T.PublishReq=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.sdp="",r.prototype.tracks=$util.emptyArray,r.prototype.callAction=0,r.prototype.recreate=null,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_recreate",{get:$util.oneOfGetter(c=["recreate"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.sdp!=null&&Object.hasOwnProperty.call(t,"sdp")&&i.uint32(10).string(t.sdp),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(18).fork()).ldelim();return t.callAction!=null&&Object.hasOwnProperty.call(t,"callAction")&&i.uint32(24).int32(t.callAction),t.recreate!=null&&Object.hasOwnProperty.call(t,"recreate")&&i.uint32(32).bool(t.recreate),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(42).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.PublishReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.sdp=t.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}case 3:{C.callAction=t.int32();break}case 4:{C.recreate=t.bool();break}case 5:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.sdp!=null&&t.hasOwnProperty("sdp")&&!$util.isString(t.sdp))return"sdp: string expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}return t.callAction!=null&&t.hasOwnProperty("callAction")&&!$util.isInteger(t.callAction)?"callAction: integer expected":t.recreate!=null&&t.hasOwnProperty("recreate")&&typeof t.recreate!="boolean"?"recreate: boolean expected":t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishReq)return t;let i=new $root.com.quick.voice.proto.PublishReq;if(t.sdp!=null&&(i.sdp=String(t.sdp)),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}return t.callAction!=null&&(i.callAction=t.callAction|0),t.recreate!=null&&(i.recreate=!!t.recreate),t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.sdp="",_.callAction=0),t.sdp!=null&&t.hasOwnProperty("sdp")&&(_.sdp=t.sdp),t.tracks&&t.tracks.length){_.tracks=[];for(let x=0;x<t.tracks.length;++x)_.tracks[x]=$root.com.quick.voice.proto.Track.toObject(t.tracks[x],i)}return t.callAction!=null&&t.hasOwnProperty("callAction")&&(_.callAction=t.callAction),t.recreate!=null&&t.hasOwnProperty("recreate")&&(_.recreate=t.recreate,i.oneofs&&(_._recreate="recreate")),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishReq"},r})(),T.PublishRsp=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(18).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.PublishRsp;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.remoteSdp=t.string();break}case 2:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp)?"remoteSdp: string expected":t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishRsp)return t;let i=new $root.com.quick.voice.proto.PublishRsp;return t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishRsp"},r})(),T.PublishNotify=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.PublishNotify;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishNotify)return t;let i=new $root.com.quick.voice.proto.PublishNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishNotify"},r})(),T.SubscribeReq=(function(){function r(e){if(this.users=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.users=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.users!=null&&t.users.length)for(let _=0;_<t.users.length;++_)$root.com.quick.voice.proto.User.encode(t.users[_],i.uint32(10).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(18).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SubscribeReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 2:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.users!=null&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(let i=0;i<t.users.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.users[i]);if(_)return"users."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SubscribeReq)return t;let i=new $root.com.quick.voice.proto.SubscribeReq;if(t.users){if(!Array.isArray(t.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");i.users=[];for(let _=0;_<t.users.length;++_){if(typeof t.users[_]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");i.users[_]=$root.com.quick.voice.proto.User.fromObject(t.users[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.users=[]),t.users&&t.users.length){_.users=[];for(let x=0;x<t.users.length;++x)_.users[x]=$root.com.quick.voice.proto.User.toObject(t.users[x],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SubscribeReq"},r})(),T.SubscribeRsp=(function(){function r(e){if(this.users=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.users=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.users!=null&&t.users.length)for(let _=0;_<t.users.length;++_)$root.com.quick.voice.proto.User.encode(t.users[_],i.uint32(18).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SubscribeRsp;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.remoteSdp=t.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 3:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp))return"remoteSdp: string expected";if(t.users!=null&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(let i=0;i<t.users.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.users[i]);if(_)return"users."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SubscribeRsp)return t;let i=new $root.com.quick.voice.proto.SubscribeRsp;if(t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.users){if(!Array.isArray(t.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");i.users=[];for(let _=0;_<t.users.length;++_){if(typeof t.users[_]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");i.users[_]=$root.com.quick.voice.proto.User.fromObject(t.users[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.users=[]),i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.users&&t.users.length){_.users=[];for(let x=0;x<t.users.length;++x)_.users[x]=$root.com.quick.voice.proto.User.toObject(t.users[x],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SubscribeRsp"},r})(),T.RenegotiateReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(18).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.sdp=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let t=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(t.userId=String(e.userId)),e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},r})(),T.QuitReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(18).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.roomId=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let t=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(t.userId=String(e.userId)),e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},r})(),T.QuitNotify=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.code=null,r.prototype.desc=null;let c;return Object.defineProperty(r.prototype,"_code",{get:$util.oneOfGetter(c=["code"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(24).int32(t.code),t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(34).string(t.desc),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.QuitNotify;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.code=t.int32();break}case 4:{C.desc=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}return t.code!=null&&t.hasOwnProperty("code")&&!$util.isInteger(t.code)?"code: integer expected":t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc)?"desc: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.QuitNotify)return t;let i=new $root.com.quick.voice.proto.QuitNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}return t.code!=null&&(i.code=t.code|0),t.desc!=null&&(i.desc=String(t.desc)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.code!=null&&t.hasOwnProperty("code")&&(_.code=t.code,i.oneofs&&(_._code="code")),t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.QuitNotify"},r})(),T.TokenExpireNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.roomId=e.string():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let t=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},r})(),T.UpdateTokenReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.sdkToken="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&t.uint32(18).string(e.sdkToken),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.sdkToken=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let t=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(t.roomId=String(e.roomId)),e.sdkToken!=null&&(t.sdkToken=String(e.sdkToken)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(i.sdkToken=e.sdkToken),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},r})(),T.NetQualityChange=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.roomId="",r.prototype.egress=0,r.prototype.ingress=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&t.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&t.uint32(32).int32(e.ingress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.roomId=e.string();break}case 3:{x.egress=e.int32();break}case 4:{x.ingress=e.int32();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.egress!=null&&e.hasOwnProperty("egress")&&!$util.isInteger(e.egress)?"egress: integer expected":e.ingress!=null&&e.hasOwnProperty("ingress")&&!$util.isInteger(e.ingress)?"ingress: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let t=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(t.userId=String(e.userId)),e.roomId!=null&&(t.roomId=String(e.roomId)),e.egress!=null&&(t.egress=e.egress|0),e.ingress!=null&&(t.ingress=e.ingress|0),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.roomId="",i.egress=0,i.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(i.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(i.ingress=e.ingress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},r})(),T.NetQualityNotify=(function(){function r(c){if(this.qualities=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.qualities=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let i=0;i<e.qualities.length;++i)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.qualities&&x.qualities.length||(x.qualities=[]),x.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.qualities!=null&&e.hasOwnProperty("qualities")){if(!Array.isArray(e.qualities))return"qualities: array expected";for(let t=0;t<e.qualities.length;++t){let i=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[t]);if(i)return"qualities."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let t=new $root.com.quick.voice.proto.NetQualityNotify;if(e.qualities){if(!Array.isArray(e.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");t.qualities=[];for(let i=0;i<e.qualities.length;++i){if(typeof e.qualities[i]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");t.qualities[i]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.qualities=[]),e.qualities&&e.qualities.length){i.qualities=[];for(let _=0;_<e.qualities.length;++_)i.qualities[_]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},r})(),T.UpdateCall=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let t=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},r})(),T.P2PUserSyncItem=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.types=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.types!=null&&e.types.length){t.uint32(18).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PUserSyncItem;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{if(x.types&&x.types.length||(x.types=[]),(C&7)===2){let F=e.uint32()+e.pos;for(;e.pos<F;)x.types.push(e.int32())}else x.types.push(e.int32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PUserSyncItem)return e;let t=new $root.com.quick.voice.proto.P2PUserSyncItem;if(e.userId!=null&&(t.userId=String(e.userId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PUserSyncItem.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PUserSyncItem"},r})(),T.P2PUserSyncList=(function(){function r(c){if(this.push=[],this.pull=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.push=$util.emptyArray,r.prototype.pull=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.push!=null&&e.push.length)for(let i=0;i<e.push.length;++i)$root.com.quick.voice.proto.P2PUserSyncItem.encode(e.push[i],t.uint32(10).fork()).ldelim();if(e.pull!=null&&e.pull.length)for(let i=0;i<e.pull.length;++i)$root.com.quick.voice.proto.P2PUserSyncItem.encode(e.pull[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PUserSyncList;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.push&&x.push.length||(x.push=[]),x.push.push($root.com.quick.voice.proto.P2PUserSyncItem.decode(e,e.uint32()));break}case 2:{x.pull&&x.pull.length||(x.pull=[]),x.pull.push($root.com.quick.voice.proto.P2PUserSyncItem.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.push!=null&&e.hasOwnProperty("push")){if(!Array.isArray(e.push))return"push: array expected";for(let t=0;t<e.push.length;++t){let i=$root.com.quick.voice.proto.P2PUserSyncItem.verify(e.push[t]);if(i)return"push."+i}}if(e.pull!=null&&e.hasOwnProperty("pull")){if(!Array.isArray(e.pull))return"pull: array expected";for(let t=0;t<e.pull.length;++t){let i=$root.com.quick.voice.proto.P2PUserSyncItem.verify(e.pull[t]);if(i)return"pull."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PUserSyncList)return e;let t=new $root.com.quick.voice.proto.P2PUserSyncList;if(e.push){if(!Array.isArray(e.push))throw TypeError(".com.quick.voice.proto.P2PUserSyncList.push: array expected");t.push=[];for(let i=0;i<e.push.length;++i){if(typeof e.push[i]!="object")throw TypeError(".com.quick.voice.proto.P2PUserSyncList.push: object expected");t.push[i]=$root.com.quick.voice.proto.P2PUserSyncItem.fromObject(e.push[i])}}if(e.pull){if(!Array.isArray(e.pull))throw TypeError(".com.quick.voice.proto.P2PUserSyncList.pull: array expected");t.pull=[];for(let i=0;i<e.pull.length;++i){if(typeof e.pull[i]!="object")throw TypeError(".com.quick.voice.proto.P2PUserSyncList.pull: object expected");t.pull[i]=$root.com.quick.voice.proto.P2PUserSyncItem.fromObject(e.pull[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.push=[],i.pull=[]),e.push&&e.push.length){i.push=[];for(let _=0;_<e.push.length;++_)i.push[_]=$root.com.quick.voice.proto.P2PUserSyncItem.toObject(e.push[_],t)}if(e.pull&&e.pull.length){i.pull=[];for(let _=0;_<e.pull.length;++_)i.pull[_]=$root.com.quick.voice.proto.P2PUserSyncItem.toObject(e.pull[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PUserSyncList"},r})(),T.SyncRoomInfoReq=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.p2pState=null;let c;return Object.defineProperty(r.prototype,"_p2pState",{get:$util.oneOfGetter(c=["p2pState"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.p2pState!=null&&Object.hasOwnProperty.call(t,"p2pState")&&$root.com.quick.voice.proto.P2PUserSyncList.encode(t.p2pState,i.uint32(26).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.decode(t,t.uint32());break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}if(t.p2pState!=null&&t.hasOwnProperty("p2pState")){let i=$root.com.quick.voice.proto.P2PUserSyncList.verify(t.p2pState);if(i)return"p2pState."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return t;let i=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}if(t.p2pState!=null){if(typeof t.p2pState!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.p2pState: object expected");i.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.fromObject(t.p2pState)}return i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.p2pState!=null&&t.hasOwnProperty("p2pState")&&(_.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.toObject(t.p2pState,i),i.oneofs&&(_._p2pState="p2pState")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SyncRoomInfoReq"},r})(),T.SyncRoomInfoRsp=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.isValid=!1,r.prototype.users=$util.emptyArray,r.prototype.isActive=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&t.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&t.uint32(32).bool(e.isActive),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.isValid=e.bool();break}case 3:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{x.isActive=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.isValid!=null&&e.hasOwnProperty("isValid")&&typeof e.isValid!="boolean")return"isValid: boolean expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let t=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.isValid!=null&&(t.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return e.isActive!=null&&(t.isActive=!!e.isActive),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId="",i.isValid=!1,i.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(i.isValid=e.isValid),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(i.isActive=e.isActive),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},r})(),T.UpdateTime=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(8).int64(e.time),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.time=e.int64():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let t=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults)if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},r})(),T.CloseTrackReq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdp="",r.prototype.tracks=$util.emptyArray,r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(26).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sdp=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{x.roomId=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp))return"sdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let t=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(t.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.sdp="",i.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},r})(),T.CloseTrackRsp=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.remoteSdp="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&t.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.remoteSdp=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let t=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(t.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(i.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},r})(),T.CloseTrackNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(10).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32()):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let t=new $root.com.quick.voice.proto.CloseTrackNotify;if(e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.user=null),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},r})(),T.TrackType=(function(){const r={},c=Object.create(r);return c[r[0]="Microphone"]=0,c[r[1]="Camera"]=1,c[r[2]="Screen"]=2,c[r[3]="SystemVoice"]=3,c})(),T.UpdatePermissions=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let t=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},r})(),T.CallType=(function(){const r={},c=Object.create(r);return c[r[0]="Normal"]=0,c[r[1]="Meeting"]=1,c[r[2]="Live"]=2,c})(),T.QuitNotifyCode=(function(){const r={},c=Object.create(r);return c[r[0]="NormalQuit"]=0,c[r[2021]="Timeout"]=2021,c[r[2011]="TokenExpired"]=2011,c[r[2022]="KickOut"]=2022,c[r[2023]="EndPk"]=2023,c[r[2024]="EndLive"]=2024,c})(),T.UserBehavior=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.type=0,r.prototype.behavior=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&t.uint32(16).bool(e.behavior),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.type=e.int32();break}case 2:{x.behavior=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.behavior!=null&&e.hasOwnProperty("behavior")&&typeof e.behavior!="boolean"?"behavior: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let t=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Microphone":case 0:t.type=0;break;case"Camera":case 1:t.type=1;break;case"Screen":case 2:t.type=2;break;case"SystemVoice":case 3:t.type=3;break}return e.behavior!=null&&(t.behavior=!!e.behavior),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.type=t.enums===String?"Microphone":0,i.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.TrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.TrackType[e.type]:e.type),e.behavior!=null&&e.hasOwnProperty("behavior")&&(i.behavior=e.behavior),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},r})(),T.PreventUser=(function(){function r(c){if(this.behaviors=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.id="",r.prototype.behaviors=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let i=0;i<e.behaviors.length;++i)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.id=e.string();break}case 2:{x.behaviors&&x.behaviors.length||(x.behaviors=[]),x.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!$util.isString(e.id))return"id: string expected";if(e.behaviors!=null&&e.hasOwnProperty("behaviors")){if(!Array.isArray(e.behaviors))return"behaviors: array expected";for(let t=0;t<e.behaviors.length;++t){let i=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[t]);if(i)return"behaviors."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let t=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(t.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");t.behaviors=[];for(let i=0;i<e.behaviors.length;++i){if(typeof e.behaviors[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");t.behaviors[i]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.behaviors=[]),t.defaults&&(i.id=""),e.id!=null&&e.hasOwnProperty("id")&&(i.id=e.id),e.behaviors&&e.behaviors.length){i.behaviors=[];for(let _=0;_<e.behaviors.length;++_)i.behaviors[_]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},r})(),T.PreventUsersBehaviorReq=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.PreventUser.encode(e.users[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.PreventUser.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let t=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");t.users[i]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},r})(),T.PreventUsersBehaviorNotify=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let t=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},r})(),T.AccelerationAreas=(function(){const r={},c=Object.create(r);return c[r[0]="chinaMainland"]=0,c[r[1]="global"]=1,c[r[2]="overseas"]=2,c})(),T.CountMethods=(function(){const r={},c=Object.create(r);return c[r[0]="flow"]=0,c[r[1]="minutes"]=1,c})(),T.BaseCDNAddress=(function(){function r(c){if(this.urlMap={},c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.area=0,r.prototype.countType=0,r.prototype.urlMap=$util.emptyObject,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&t.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&t.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let i=Object.keys(e.urlMap),_=0;_<i.length;++_)t.uint32(26).fork().uint32(10).string(i[_]).uint32(18).string(e.urlMap[i[_]]).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.BaseCDNAddress,C,F;for(;e.pos<_;){let j=e.uint32();if(j===i)break;switch(j>>>3){case 1:{x.area=e.int32();break}case 2:{x.countType=e.int32();break}case 3:{x.urlMap===$util.emptyObject&&(x.urlMap={});let Z=e.uint32()+e.pos;for(C="",F="";e.pos<Z;){let ee=e.uint32();switch(ee>>>3){case 1:C=e.string();break;case 2:F=e.string();break;default:e.skipType(ee&7);break}}x.urlMap[C]=F;break}default:e.skipType(j&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.area!=null&&e.hasOwnProperty("area"))switch(e.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(e.countType!=null&&e.hasOwnProperty("countType"))switch(e.countType){default:return"countType: enum value expected";case 0:case 1:break}if(e.urlMap!=null&&e.hasOwnProperty("urlMap")){if(!$util.isObject(e.urlMap))return"urlMap: object expected";let t=Object.keys(e.urlMap);for(let i=0;i<t.length;++i)if(!$util.isString(e.urlMap[t[i]]))return"urlMap: string{k:string} expected"}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let t=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){t.area=e.area;break}break;case"chinaMainland":case 0:t.area=0;break;case"global":case 1:t.area=1;break;case"overseas":case 2:t.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){t.countType=e.countType;break}break;case"flow":case 0:t.countType=0;break;case"minutes":case 1:t.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");t.urlMap={};for(let i=Object.keys(e.urlMap),_=0;_<i.length;++_)t.urlMap[i[_]]=String(e.urlMap[i[_]])}return t},r.toObject=function(e,t){t||(t={});let i={};(t.objects||t.defaults)&&(i.urlMap={}),t.defaults&&(i.area=t.enums===String?"chinaMainland":0,i.countType=t.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(i.area=t.enums===String?$root.com.quick.voice.proto.AccelerationAreas[e.area]===void 0?e.area:$root.com.quick.voice.proto.AccelerationAreas[e.area]:e.area),e.countType!=null&&e.hasOwnProperty("countType")&&(i.countType=t.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let _;if(e.urlMap&&(_=Object.keys(e.urlMap)).length){i.urlMap={};for(let x=0;x<_.length;++x)i.urlMap[_[x]]=e.urlMap[_[x]]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},r})(),T.CDNPlayAddressNotify=(function(){function r(e){if(this.standLines=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.m3u8=null,r.prototype.rtmp=null,r.prototype.flv=null,r.prototype.rtmps=null,r.prototype.mainLine=null,r.prototype.standLines=$util.emptyArray;let c;return Object.defineProperty(r.prototype,"_m3u8",{get:$util.oneOfGetter(c=["m3u8"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_rtmp",{get:$util.oneOfGetter(c=["rtmp"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_flv",{get:$util.oneOfGetter(c=["flv"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_rtmps",{get:$util.oneOfGetter(c=["rtmps"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_mainLine",{get:$util.oneOfGetter(c=["mainLine"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.m3u8!=null&&Object.hasOwnProperty.call(t,"m3u8")&&i.uint32(18).string(t.m3u8),t.rtmp!=null&&Object.hasOwnProperty.call(t,"rtmp")&&i.uint32(26).string(t.rtmp),t.flv!=null&&Object.hasOwnProperty.call(t,"flv")&&i.uint32(34).string(t.flv),t.rtmps!=null&&Object.hasOwnProperty.call(t,"rtmps")&&i.uint32(42).string(t.rtmps),t.mainLine!=null&&Object.hasOwnProperty.call(t,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(t.mainLine,i.uint32(50).fork()).ldelim(),t.standLines!=null&&t.standLines.length)for(let _=0;_<t.standLines.length;++_)$root.com.quick.voice.proto.BaseCDNAddress.encode(t.standLines[_],i.uint32(58).fork()).ldelim();return i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.m3u8=t.string();break}case 3:{C.rtmp=t.string();break}case 4:{C.flv=t.string();break}case 5:{C.rtmps=t.string();break}case 6:{C.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(t,t.uint32());break}case 7:{C.standLines&&C.standLines.length||(C.standLines=[]),C.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(t,t.uint32()));break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.m3u8!=null&&t.hasOwnProperty("m3u8")&&!$util.isString(t.m3u8))return"m3u8: string expected";if(t.rtmp!=null&&t.hasOwnProperty("rtmp")&&!$util.isString(t.rtmp))return"rtmp: string expected";if(t.flv!=null&&t.hasOwnProperty("flv")&&!$util.isString(t.flv))return"flv: string expected";if(t.rtmps!=null&&t.hasOwnProperty("rtmps")&&!$util.isString(t.rtmps))return"rtmps: string expected";if(t.mainLine!=null&&t.hasOwnProperty("mainLine")){let i=$root.com.quick.voice.proto.BaseCDNAddress.verify(t.mainLine);if(i)return"mainLine."+i}if(t.standLines!=null&&t.hasOwnProperty("standLines")){if(!Array.isArray(t.standLines))return"standLines: array expected";for(let i=0;i<t.standLines.length;++i){let _=$root.com.quick.voice.proto.BaseCDNAddress.verify(t.standLines[i]);if(_)return"standLines."+_}}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return t;let i=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.m3u8!=null&&(i.m3u8=String(t.m3u8)),t.rtmp!=null&&(i.rtmp=String(t.rtmp)),t.flv!=null&&(i.flv=String(t.flv)),t.rtmps!=null&&(i.rtmps=String(t.rtmps)),t.mainLine!=null){if(typeof t.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");i.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(t.mainLine)}if(t.standLines){if(!Array.isArray(t.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");i.standLines=[];for(let _=0;_<t.standLines.length;++_){if(typeof t.standLines[_]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");i.standLines[_]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(t.standLines[_])}}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.standLines=[]),i.defaults&&(_.roomId=""),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.m3u8!=null&&t.hasOwnProperty("m3u8")&&(_.m3u8=t.m3u8,i.oneofs&&(_._m3u8="m3u8")),t.rtmp!=null&&t.hasOwnProperty("rtmp")&&(_.rtmp=t.rtmp,i.oneofs&&(_._rtmp="rtmp")),t.flv!=null&&t.hasOwnProperty("flv")&&(_.flv=t.flv,i.oneofs&&(_._flv="flv")),t.rtmps!=null&&t.hasOwnProperty("rtmps")&&(_.rtmps=t.rtmps,i.oneofs&&(_._rtmps="rtmps")),t.mainLine!=null&&t.hasOwnProperty("mainLine")&&(_.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(t.mainLine,i),i.oneofs&&(_._mainLine="mainLine")),t.standLines&&t.standLines.length){_.standLines=[];for(let x=0;x<t.standLines.length;++x)_.standLines[x]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(t.standLines[x],i)}return _},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.CDNPlayAddressNotify"},r})(),T.UserChannel=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UserChannel;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserChannel)return e;let t=new $root.com.quick.voice.proto.UserChannel;if(e.userId!=null&&(t.userId=String(e.userId)),e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),t.defaults&&(i.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserChannel"},r})(),T.ChannelPublishReq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelPublishReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishReq)return e;let t=new $root.com.quick.voice.proto.ChannelPublishReq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishReq"},r})(),T.ChannelPublishRsq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return e;let t=new $root.com.quick.voice.proto.ChannelPublishRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishRsq"},r})(),T.ChannelSubscribeReq=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.users[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return e;let t=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");t.users[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeReq"},r})(),T.ChannelSubscribeRsq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return e;let t=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeRsq"},r})(),T.DataChannelData=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.userId="",r.prototype.type=0,r.prototype.audioData=null;let c;return Object.defineProperty(r.prototype,"_audioData",{get:$util.oneOfGetter(c=["audioData"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.userId!=null&&Object.hasOwnProperty.call(t,"userId")&&i.uint32(10).string(t.userId),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&i.uint32(16).int32(t.type),t.audioData!=null&&Object.hasOwnProperty.call(t,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(t.audioData,i.uint32(26).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.DataChannelData;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.userId=t.string();break}case 2:{C.type=t.int32();break}case 3:{C.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(t,t.uint32());break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.userId!=null&&t.hasOwnProperty("userId")&&!$util.isString(t.userId))return"userId: string expected";if(t.type!=null&&t.hasOwnProperty("type")&&t.type!==0)return"type: enum value expected";if(t.audioData!=null&&t.hasOwnProperty("audioData")){let i=$root.com.quick.voice.proto.DataChannelAudioData.verify(t.audioData);if(i)return"audioData."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannelData)return t;let i=new $root.com.quick.voice.proto.DataChannelData;switch(t.userId!=null&&(i.userId=String(t.userId)),t.type){default:if(typeof t.type=="number"){i.type=t.type;break}break;case"backAuido":case 0:i.type=0;break}if(t.audioData!=null){if(typeof t.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");i.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(t.audioData)}return i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.userId="",_.type=i.enums===String?"backAuido":0),t.userId!=null&&t.hasOwnProperty("userId")&&(_.userId=t.userId),t.type!=null&&t.hasOwnProperty("type")&&(_.type=i.enums===String?$root.com.quick.voice.proto.DataChannelType[t.type]===void 0?t.type:$root.com.quick.voice.proto.DataChannelType[t.type]:t.type),t.audioData!=null&&t.hasOwnProperty("audioData")&&(_.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(t.audioData,i),i.oneofs&&(_._audioData="audioData")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannelData"},r})(),T.DataChannelType=(function(){const r={},c=Object.create(r);return c[r[0]="backAuido"]=0,c})(),T.DataChannelAudioData=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.data=$util.newBuffer([]),r.prototype.format=null,r.prototype.time=null;let c;return Object.defineProperty(r.prototype,"_time",{get:$util.oneOfGetter(c=["time"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.data!=null&&Object.hasOwnProperty.call(t,"data")&&i.uint32(10).bytes(t.data),t.format!=null&&Object.hasOwnProperty.call(t,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(t.format,i.uint32(18).fork()).ldelim(),t.time!=null&&Object.hasOwnProperty.call(t,"time")&&i.uint32(24).int64(t.time),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.DataChannelAudioData;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.data=t.bytes();break}case 2:{C.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(t,t.uint32());break}case 3:{C.time=t.int64();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.data!=null&&t.hasOwnProperty("data")&&!(t.data&&typeof t.data.length=="number"||$util.isString(t.data)))return"data: buffer expected";if(t.format!=null&&t.hasOwnProperty("format")){let i=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(t.format);if(i)return"format."+i}return t.time!=null&&t.hasOwnProperty("time")&&!$util.isInteger(t.time)&&!(t.time&&$util.isInteger(t.time.low)&&$util.isInteger(t.time.high))?"time: integer|Long expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannelAudioData)return t;let i=new $root.com.quick.voice.proto.DataChannelAudioData;if(t.data!=null&&(typeof t.data=="string"?$util.base64.decode(t.data,i.data=$util.newBuffer($util.base64.length(t.data)),0):t.data.length>=0&&(i.data=t.data)),t.format!=null){if(typeof t.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");i.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(t.format)}return t.time!=null&&($util.Long?(i.time=$util.Long.fromValue(t.time)).unsigned=!1:typeof t.time=="string"?i.time=parseInt(t.time,10):typeof t.time=="number"?i.time=t.time:typeof t.time=="object"&&(i.time=new $util.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber())),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(i.bytes===String?_.data="":(_.data=[],i.bytes!==Array&&(_.data=$util.newBuffer(_.data))),_.format=null),t.data!=null&&t.hasOwnProperty("data")&&(_.data=i.bytes===String?$util.base64.encode(t.data,0,t.data.length):i.bytes===Array?Array.prototype.slice.call(t.data):t.data),t.format!=null&&t.hasOwnProperty("format")&&(_.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(t.format,i)),t.time!=null&&t.hasOwnProperty("time")&&(typeof t.time=="number"?_.time=i.longs===String?String(t.time):t.time:_.time=i.longs===String?$util.Long.prototype.toString.call(t.time):i.longs===Number?new $util.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber():t.time,i.oneofs&&(_._time="time")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannelAudioData"},r})(),T.DataChannelAudioFormat=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sampleRate=0,r.prototype.channels=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sampleRate!=null&&Object.hasOwnProperty.call(e,"sampleRate")&&t.uint32(9).double(e.sampleRate),e.channels!=null&&Object.hasOwnProperty.call(e,"channels")&&t.uint32(16).int32(e.channels),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sampleRate=e.double();break}case 2:{x.channels=e.int32();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sampleRate!=null&&e.hasOwnProperty("sampleRate")&&typeof e.sampleRate!="number"?"sampleRate: number expected":e.channels!=null&&e.hasOwnProperty("channels")&&!$util.isInteger(e.channels)?"channels: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return e;let t=new $root.com.quick.voice.proto.DataChannelAudioFormat;return e.sampleRate!=null&&(t.sampleRate=Number(e.sampleRate)),e.channels!=null&&(t.channels=e.channels|0),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sampleRate=0,i.channels=0),e.sampleRate!=null&&e.hasOwnProperty("sampleRate")&&(i.sampleRate=t.json&&!isFinite(e.sampleRate)?String(e.sampleRate):e.sampleRate),e.channels!=null&&e.hasOwnProperty("channels")&&(i.channels=e.channels),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelAudioFormat"},r})(),T.AckMsgReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.msgId!=null&&Object.hasOwnProperty.call(e,"msgId")&&t.uint32(8).int64(e.msgId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.AckMsgReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.msgId=e.int64():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.msgId!=null&&e.hasOwnProperty("msgId")&&!$util.isInteger(e.msgId)&&!(e.msgId&&$util.isInteger(e.msgId.low)&&$util.isInteger(e.msgId.high))?"msgId: integer|Long expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.AckMsgReq)return e;let t=new $root.com.quick.voice.proto.AckMsgReq;return e.msgId!=null&&($util.Long?(t.msgId=$util.Long.fromValue(e.msgId)).unsigned=!1:typeof e.msgId=="string"?t.msgId=parseInt(e.msgId,10):typeof e.msgId=="number"?t.msgId=e.msgId:typeof e.msgId=="object"&&(t.msgId=new $util.LongBits(e.msgId.low>>>0,e.msgId.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults)if($util.Long){let _=new $util.Long(0,0,!1);i.msgId=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.msgId=t.longs===String?"0":0;return e.msgId!=null&&e.hasOwnProperty("msgId")&&(typeof e.msgId=="number"?i.msgId=t.longs===String?String(e.msgId):e.msgId:i.msgId=t.longs===String?$util.Long.prototype.toString.call(e.msgId):t.longs===Number?new $util.LongBits(e.msgId.low>>>0,e.msgId.high>>>0).toNumber():e.msgId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.AckMsgReq"},r})(),T.SdpConsult=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.sender=null,r.prototype.receiverId="",r.prototype.sdp="",r.prototype.tracks=$util.emptyArray;let c;return Object.defineProperty(r.prototype,"_sender",{get:$util.oneOfGetter(c=["sender"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.sender!=null&&Object.hasOwnProperty.call(t,"sender")&&$root.com.quick.voice.proto.User.encode(t.sender,i.uint32(18).fork()).ldelim(),t.receiverId!=null&&Object.hasOwnProperty.call(t,"receiverId")&&i.uint32(26).string(t.receiverId),t.sdp!=null&&Object.hasOwnProperty.call(t,"sdp")&&i.uint32(34).string(t.sdp),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(42).fork()).ldelim();return i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SdpConsult;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.sender=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.receiverId=t.string();break}case 4:{C.sdp=t.string();break}case 5:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.sender!=null&&t.hasOwnProperty("sender")){let i=$root.com.quick.voice.proto.User.verify(t.sender);if(i)return"sender."+i}if(t.receiverId!=null&&t.hasOwnProperty("receiverId")&&!$util.isString(t.receiverId))return"receiverId: string expected";if(t.sdp!=null&&t.hasOwnProperty("sdp")&&!$util.isString(t.sdp))return"sdp: string expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SdpConsult)return t;let i=new $root.com.quick.voice.proto.SdpConsult;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.sender!=null){if(typeof t.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");i.sender=$root.com.quick.voice.proto.User.fromObject(t.sender)}if(t.receiverId!=null&&(i.receiverId=String(t.receiverId)),t.sdp!=null&&(i.sdp=String(t.sdp)),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.roomId="",_.receiverId="",_.sdp=""),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.sender!=null&&t.hasOwnProperty("sender")&&(_.sender=$root.com.quick.voice.proto.User.toObject(t.sender,i),i.oneofs&&(_._sender="sender")),t.receiverId!=null&&t.hasOwnProperty("receiverId")&&(_.receiverId=t.receiverId),t.sdp!=null&&t.hasOwnProperty("sdp")&&(_.sdp=t.sdp),t.tracks&&t.tracks.length){_.tracks=[];for(let x=0;x<t.tracks.length;++x)_.tracks[x]=$root.com.quick.voice.proto.Track.toObject(t.tracks[x],i)}return _},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SdpConsult"},r})(),T.Candidate=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdpMid="",r.prototype.sdpMLineIndex=0,r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sdpMid!=null&&Object.hasOwnProperty.call(e,"sdpMid")&&t.uint32(10).string(e.sdpMid),e.sdpMLineIndex!=null&&Object.hasOwnProperty.call(e,"sdpMLineIndex")&&t.uint32(16).int32(e.sdpMLineIndex),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(26).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.Candidate;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sdpMid=e.string();break}case 2:{x.sdpMLineIndex=e.int32();break}case 3:{x.sdp=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdpMid!=null&&e.hasOwnProperty("sdpMid")&&!$util.isString(e.sdpMid)?"sdpMid: string expected":e.sdpMLineIndex!=null&&e.hasOwnProperty("sdpMLineIndex")&&!$util.isInteger(e.sdpMLineIndex)?"sdpMLineIndex: integer expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Candidate)return e;let t=new $root.com.quick.voice.proto.Candidate;return e.sdpMid!=null&&(t.sdpMid=String(e.sdpMid)),e.sdpMLineIndex!=null&&(t.sdpMLineIndex=e.sdpMLineIndex|0),e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sdpMid="",i.sdpMLineIndex=0,i.sdp=""),e.sdpMid!=null&&e.hasOwnProperty("sdpMid")&&(i.sdpMid=e.sdpMid),e.sdpMLineIndex!=null&&e.hasOwnProperty("sdpMLineIndex")&&(i.sdpMLineIndex=e.sdpMLineIndex),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Candidate"},r})(),T.Candidates=(function(){function r(c){if(this.candidates=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.senderId="",r.prototype.receiverId="",r.prototype.candidates=$util.emptyArray,r.prototype.isSubscribeReceiver=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.senderId!=null&&Object.hasOwnProperty.call(e,"senderId")&&t.uint32(18).string(e.senderId),e.receiverId!=null&&Object.hasOwnProperty.call(e,"receiverId")&&t.uint32(26).string(e.receiverId),e.candidates!=null&&e.candidates.length)for(let i=0;i<e.candidates.length;++i)$root.com.quick.voice.proto.Candidate.encode(e.candidates[i],t.uint32(34).fork()).ldelim();return e.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(e,"isSubscribeReceiver")&&t.uint32(40).bool(e.isSubscribeReceiver),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.Candidates;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.senderId=e.string();break}case 3:{x.receiverId=e.string();break}case 4:{x.candidates&&x.candidates.length||(x.candidates=[]),x.candidates.push($root.com.quick.voice.proto.Candidate.decode(e,e.uint32()));break}case 5:{x.isSubscribeReceiver=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.senderId!=null&&e.hasOwnProperty("senderId")&&!$util.isString(e.senderId))return"senderId: string expected";if(e.receiverId!=null&&e.hasOwnProperty("receiverId")&&!$util.isString(e.receiverId))return"receiverId: string expected";if(e.candidates!=null&&e.hasOwnProperty("candidates")){if(!Array.isArray(e.candidates))return"candidates: array expected";for(let t=0;t<e.candidates.length;++t){let i=$root.com.quick.voice.proto.Candidate.verify(e.candidates[t]);if(i)return"candidates."+i}}return e.isSubscribeReceiver!=null&&e.hasOwnProperty("isSubscribeReceiver")&&typeof e.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Candidates)return e;let t=new $root.com.quick.voice.proto.Candidates;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.senderId!=null&&(t.senderId=String(e.senderId)),e.receiverId!=null&&(t.receiverId=String(e.receiverId)),e.candidates){if(!Array.isArray(e.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");t.candidates=[];for(let i=0;i<e.candidates.length;++i){if(typeof e.candidates[i]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");t.candidates[i]=$root.com.quick.voice.proto.Candidate.fromObject(e.candidates[i])}}return e.isSubscribeReceiver!=null&&(t.isSubscribeReceiver=!!e.isSubscribeReceiver),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.candidates=[]),t.defaults&&(i.roomId="",i.senderId="",i.receiverId="",i.isSubscribeReceiver=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.senderId!=null&&e.hasOwnProperty("senderId")&&(i.senderId=e.senderId),e.receiverId!=null&&e.hasOwnProperty("receiverId")&&(i.receiverId=e.receiverId),e.candidates&&e.candidates.length){i.candidates=[];for(let _=0;_<e.candidates.length;++_)i.candidates[_]=$root.com.quick.voice.proto.Candidate.toObject(e.candidates[_],t)}return e.isSubscribeReceiver!=null&&e.hasOwnProperty("isSubscribeReceiver")&&(i.isSubscribeReceiver=e.isSubscribeReceiver),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Candidates"},r})(),T.NatType=(function(){const r={},c=Object.create(r);return c[r[0]="Symmetric"]=0,c[r[1]="Cone"]=1,c[r[2]="Port"]=2,c[r[3]="IP"]=3,c[r[4]="UnKnown"]=4,c})(),T.NetworkType=(function(){const r={},c=Object.create(r);return c[r[0]="Wifi"]=0,c[r[1]="Wired"]=1,c[r[2]="Mobile"]=2,c})(),T.ReportNetInfo=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.nat=0,r.prototype.type=0,r.prototype.ip="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.nat!=null&&Object.hasOwnProperty.call(e,"nat")&&t.uint32(8).int32(e.nat),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(16).int32(e.type),e.ip!=null&&Object.hasOwnProperty.call(e,"ip")&&t.uint32(26).string(e.ip),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ReportNetInfo;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.nat=e.int32();break}case 2:{x.type=e.int32();break}case 3:{x.ip=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.nat!=null&&e.hasOwnProperty("nat"))switch(e.nat){default:return"nat: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return e.ip!=null&&e.hasOwnProperty("ip")&&!$util.isString(e.ip)?"ip: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportNetInfo)return e;let t=new $root.com.quick.voice.proto.ReportNetInfo;switch(e.nat){default:if(typeof e.nat=="number"){t.nat=e.nat;break}break;case"Symmetric":case 0:t.nat=0;break;case"Cone":case 1:t.nat=1;break;case"Port":case 2:t.nat=2;break;case"IP":case 3:t.nat=3;break;case"UnKnown":case 4:t.nat=4;break}switch(e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Wifi":case 0:t.type=0;break;case"Wired":case 1:t.type=1;break;case"Mobile":case 2:t.type=2;break}return e.ip!=null&&(t.ip=String(e.ip)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.nat=t.enums===String?"Symmetric":0,i.type=t.enums===String?"Wifi":0,i.ip=""),e.nat!=null&&e.hasOwnProperty("nat")&&(i.nat=t.enums===String?$root.com.quick.voice.proto.NatType[e.nat]===void 0?e.nat:$root.com.quick.voice.proto.NatType[e.nat]:e.nat),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.NetworkType[e.type]===void 0?e.type:$root.com.quick.voice.proto.NetworkType[e.type]:e.type),e.ip!=null&&e.hasOwnProperty("ip")&&(i.ip=e.ip),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportNetInfo"},r})(),T.P2PCode=(function(){const r={},c=Object.create(r);return c[r[0]="Success"]=0,c[r[1]="Failed"]=1,c[r[2]="Ignore"]=2,c[r[3]="Disconnected"]=3,c[r[4]="LowQuality"]=4,c})(),T.ReportTrafficUsage=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.p2pPush=null,r.prototype.p2pPull=null,r.prototype.sfuPush=null,r.prototype.sfuPull=null;let c;return Object.defineProperty(r.prototype,"_p2pPush",{get:$util.oneOfGetter(c=["p2pPush"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_p2pPull",{get:$util.oneOfGetter(c=["p2pPull"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_sfuPush",{get:$util.oneOfGetter(c=["sfuPush"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_sfuPull",{get:$util.oneOfGetter(c=["sfuPull"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.p2pPush!=null&&Object.hasOwnProperty.call(t,"p2pPush")&&i.uint32(8).int64(t.p2pPush),t.p2pPull!=null&&Object.hasOwnProperty.call(t,"p2pPull")&&i.uint32(16).int64(t.p2pPull),t.sfuPush!=null&&Object.hasOwnProperty.call(t,"sfuPush")&&i.uint32(24).int64(t.sfuPush),t.sfuPull!=null&&Object.hasOwnProperty.call(t,"sfuPull")&&i.uint32(32).int64(t.sfuPull),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.p2pPush=t.int64();break}case 2:{C.p2pPull=t.int64();break}case 3:{C.sfuPush=t.int64();break}case 4:{C.sfuPull=t.int64();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.p2pPush!=null&&t.hasOwnProperty("p2pPush")&&!$util.isInteger(t.p2pPush)&&!(t.p2pPush&&$util.isInteger(t.p2pPush.low)&&$util.isInteger(t.p2pPush.high))?"p2pPush: integer|Long expected":t.p2pPull!=null&&t.hasOwnProperty("p2pPull")&&!$util.isInteger(t.p2pPull)&&!(t.p2pPull&&$util.isInteger(t.p2pPull.low)&&$util.isInteger(t.p2pPull.high))?"p2pPull: integer|Long expected":t.sfuPush!=null&&t.hasOwnProperty("sfuPush")&&!$util.isInteger(t.sfuPush)&&!(t.sfuPush&&$util.isInteger(t.sfuPush.low)&&$util.isInteger(t.sfuPush.high))?"sfuPush: integer|Long expected":t.sfuPull!=null&&t.hasOwnProperty("sfuPull")&&!$util.isInteger(t.sfuPull)&&!(t.sfuPull&&$util.isInteger(t.sfuPull.low)&&$util.isInteger(t.sfuPull.high))?"sfuPull: integer|Long expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return t;let i=new $root.com.quick.voice.proto.ReportTrafficUsage;return t.p2pPush!=null&&($util.Long?(i.p2pPush=$util.Long.fromValue(t.p2pPush)).unsigned=!1:typeof t.p2pPush=="string"?i.p2pPush=parseInt(t.p2pPush,10):typeof t.p2pPush=="number"?i.p2pPush=t.p2pPush:typeof t.p2pPush=="object"&&(i.p2pPush=new $util.LongBits(t.p2pPush.low>>>0,t.p2pPush.high>>>0).toNumber())),t.p2pPull!=null&&($util.Long?(i.p2pPull=$util.Long.fromValue(t.p2pPull)).unsigned=!1:typeof t.p2pPull=="string"?i.p2pPull=parseInt(t.p2pPull,10):typeof t.p2pPull=="number"?i.p2pPull=t.p2pPull:typeof t.p2pPull=="object"&&(i.p2pPull=new $util.LongBits(t.p2pPull.low>>>0,t.p2pPull.high>>>0).toNumber())),t.sfuPush!=null&&($util.Long?(i.sfuPush=$util.Long.fromValue(t.sfuPush)).unsigned=!1:typeof t.sfuPush=="string"?i.sfuPush=parseInt(t.sfuPush,10):typeof t.sfuPush=="number"?i.sfuPush=t.sfuPush:typeof t.sfuPush=="object"&&(i.sfuPush=new $util.LongBits(t.sfuPush.low>>>0,t.sfuPush.high>>>0).toNumber())),t.sfuPull!=null&&($util.Long?(i.sfuPull=$util.Long.fromValue(t.sfuPull)).unsigned=!1:typeof t.sfuPull=="string"?i.sfuPull=parseInt(t.sfuPull,10):typeof t.sfuPull=="number"?i.sfuPull=t.sfuPull:typeof t.sfuPull=="object"&&(i.sfuPull=new $util.LongBits(t.sfuPull.low>>>0,t.sfuPull.high>>>0).toNumber())),i},r.toObject=function(t,i){i||(i={});let _={};return t.p2pPush!=null&&t.hasOwnProperty("p2pPush")&&(typeof t.p2pPush=="number"?_.p2pPush=i.longs===String?String(t.p2pPush):t.p2pPush:_.p2pPush=i.longs===String?$util.Long.prototype.toString.call(t.p2pPush):i.longs===Number?new $util.LongBits(t.p2pPush.low>>>0,t.p2pPush.high>>>0).toNumber():t.p2pPush,i.oneofs&&(_._p2pPush="p2pPush")),t.p2pPull!=null&&t.hasOwnProperty("p2pPull")&&(typeof t.p2pPull=="number"?_.p2pPull=i.longs===String?String(t.p2pPull):t.p2pPull:_.p2pPull=i.longs===String?$util.Long.prototype.toString.call(t.p2pPull):i.longs===Number?new $util.LongBits(t.p2pPull.low>>>0,t.p2pPull.high>>>0).toNumber():t.p2pPull,i.oneofs&&(_._p2pPull="p2pPull")),t.sfuPush!=null&&t.hasOwnProperty("sfuPush")&&(typeof t.sfuPush=="number"?_.sfuPush=i.longs===String?String(t.sfuPush):t.sfuPush:_.sfuPush=i.longs===String?$util.Long.prototype.toString.call(t.sfuPush):i.longs===Number?new $util.LongBits(t.sfuPush.low>>>0,t.sfuPush.high>>>0).toNumber():t.sfuPush,i.oneofs&&(_._sfuPush="sfuPush")),t.sfuPull!=null&&t.hasOwnProperty("sfuPull")&&(typeof t.sfuPull=="number"?_.sfuPull=i.longs===String?String(t.sfuPull):t.sfuPull:_.sfuPull=i.longs===String?$util.Long.prototype.toString.call(t.sfuPull):i.longs===Number?new $util.LongBits(t.sfuPull.low>>>0,t.sfuPull.high>>>0).toNumber():t.sfuPull,i.oneofs&&(_._sfuPull="sfuPull")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ReportTrafficUsage"},r})(),T.CheckSessionReq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.session="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.session!=null&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CheckSessionReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.session=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.session!=null&&e.hasOwnProperty("session")&&!$util.isString(e.session))return"session: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CheckSessionReq)return e;let t=new $root.com.quick.voice.proto.CheckSessionReq;if(e.session!=null&&(t.session=String(e.session)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.session=""),e.session!=null&&e.hasOwnProperty("session")&&(i.session=e.session),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CheckSessionReq"},r})(),T.CheckSessionRsq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sessionIsValid=!1,r.prototype.tracks=$util.emptyArray,r.prototype.session="",r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.sessionIsValid!=null&&Object.hasOwnProperty.call(e,"sessionIsValid")&&t.uint32(8).bool(e.sessionIsValid),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return e.session!=null&&Object.hasOwnProperty.call(e,"session")&&t.uint32(26).string(e.session),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CheckSessionRsq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sessionIsValid=e.bool();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{x.session=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sessionIsValid!=null&&e.hasOwnProperty("sessionIsValid")&&typeof e.sessionIsValid!="boolean")return"sessionIsValid: boolean expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return e.session!=null&&e.hasOwnProperty("session")&&!$util.isString(e.session)?"session: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CheckSessionRsq)return e;let t=new $root.com.quick.voice.proto.CheckSessionRsq;if(e.sessionIsValid!=null&&(t.sessionIsValid=!!e.sessionIsValid),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return e.session!=null&&(t.session=String(e.session)),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.sessionIsValid=!1,i.session=""),e.sessionIsValid!=null&&e.hasOwnProperty("sessionIsValid")&&(i.sessionIsValid=e.sessionIsValid),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return e.session!=null&&e.hasOwnProperty("session")&&(i.session=e.session),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CheckSessionRsq"},r})(),T.RoomSpeechNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.userId="",r.prototype.text="",r.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.origin="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),e.text!=null&&Object.hasOwnProperty.call(e,"text")&&t.uint32(26).string(e.text),e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).int64(e.timestamp),e.origin!=null&&Object.hasOwnProperty.call(e,"origin")&&t.uint32(42).string(e.origin),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.RoomSpeechNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.userId=e.string();break}case 3:{x.text=e.string();break}case 4:{x.timestamp=e.int64();break}case 5:{x.origin=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.text!=null&&e.hasOwnProperty("text")&&!$util.isString(e.text)?"text: string expected":e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!$util.isInteger(e.timestamp)&&!(e.timestamp&&$util.isInteger(e.timestamp.low)&&$util.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":e.origin!=null&&e.hasOwnProperty("origin")&&!$util.isString(e.origin)?"origin: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RoomSpeechNotify)return e;let t=new $root.com.quick.voice.proto.RoomSpeechNotify;return e.roomId!=null&&(t.roomId=String(e.roomId)),e.userId!=null&&(t.userId=String(e.userId)),e.text!=null&&(t.text=String(e.text)),e.timestamp!=null&&($util.Long?(t.timestamp=$util.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.origin!=null&&(t.origin=String(e.origin)),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.roomId="",i.userId="",i.text="",$util.Long){let _=new $util.Long(0,0,!1);i.timestamp=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.timestamp=t.longs===String?"0":0;i.origin=""}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.text!=null&&e.hasOwnProperty("text")&&(i.text=e.text),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?i.timestamp=t.longs===String?String(e.timestamp):e.timestamp:i.timestamp=t.longs===String?$util.Long.prototype.toString.call(e.timestamp):t.longs===Number?new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),e.origin!=null&&e.hasOwnProperty("origin")&&(i.origin=e.origin),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RoomSpeechNotify"},r})(),T.AiLangSetting=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.input="",r.prototype.output="",r.prototype.translateEnable=null;let c;return Object.defineProperty(r.prototype,"_translateEnable",{get:$util.oneOfGetter(c=["translateEnable"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.input!=null&&Object.hasOwnProperty.call(t,"input")&&i.uint32(10).string(t.input),t.output!=null&&Object.hasOwnProperty.call(t,"output")&&i.uint32(18).string(t.output),t.translateEnable!=null&&Object.hasOwnProperty.call(t,"translateEnable")&&i.uint32(24).bool(t.translateEnable),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.AiLangSetting;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.input=t.string();break}case 2:{C.output=t.string();break}case 3:{C.translateEnable=t.bool();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.input!=null&&t.hasOwnProperty("input")&&!$util.isString(t.input)?"input: string expected":t.output!=null&&t.hasOwnProperty("output")&&!$util.isString(t.output)?"output: string expected":t.translateEnable!=null&&t.hasOwnProperty("translateEnable")&&typeof t.translateEnable!="boolean"?"translateEnable: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.AiLangSetting)return t;let i=new $root.com.quick.voice.proto.AiLangSetting;return t.input!=null&&(i.input=String(t.input)),t.output!=null&&(i.output=String(t.output)),t.translateEnable!=null&&(i.translateEnable=!!t.translateEnable),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.input="",_.output=""),t.input!=null&&t.hasOwnProperty("input")&&(_.input=t.input),t.output!=null&&t.hasOwnProperty("output")&&(_.output=t.output),t.translateEnable!=null&&t.hasOwnProperty("translateEnable")&&(_.translateEnable=t.translateEnable,i.oneofs&&(_._translateEnable="translateEnable")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.AiLangSetting"},r})(),T.P2PIgnoreReason=(function(){const r={},c=Object.create(r);return c[r[0]="CHANNEL_LIMIT"]=0,c[r[1]="SUBSCRIBE_NOT_EXIST"]=1,c[r[2]="Busying"]=2,c[r[3]="TRACK_NOT_EXIST"]=3,c[r[4]="OTHER"]=4,c})(),T.P2PAction=(function(){const r={},c=Object.create(r);return c[r[0]="ReverseTry"]=0,c[r[1]="ReverseTryFailed"]=1,c[r[2]="ReverseSuccess"]=2,c[r[3]="ConnectSuccess"]=3,c[r[4]="ReversePushDelay"]=4,c})(),T.P2PAvailablePeerNotify=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.pushId="",r.prototype.types=$util.emptyArray,r.prototype.isRemotePush=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.pushId!=null&&Object.hasOwnProperty.call(e,"pushId")&&t.uint32(18).string(e.pushId),e.types!=null&&e.types.length){t.uint32(26).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return e.isRemotePush!=null&&Object.hasOwnProperty.call(e,"isRemotePush")&&t.uint32(32).bool(e.isRemotePush),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.pushId=e.string();break}case 3:{if(x.types&&x.types.length||(x.types=[]),(C&7)===2){let F=e.uint32()+e.pos;for(;e.pos<F;)x.types.push(e.int32())}else x.types.push(e.int32());break}case 4:{x.isRemotePush=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.pushId!=null&&e.hasOwnProperty("pushId")&&!$util.isString(e.pushId))return"pushId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return e.isRemotePush!=null&&e.hasOwnProperty("isRemotePush")&&typeof e.isRemotePush!="boolean"?"isRemotePush: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PAvailablePeerNotify)return e;let t=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.pushId!=null&&(t.pushId=String(e.pushId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PAvailablePeerNotify.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return e.isRemotePush!=null&&(t.isRemotePush=!!e.isRemotePush),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.roomId="",i.pushId="",i.isRemotePush=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.pushId!=null&&e.hasOwnProperty("pushId")&&(i.pushId=e.pushId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return e.isRemotePush!=null&&e.hasOwnProperty("isRemotePush")&&(i.isRemotePush=e.isRemotePush),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PAvailablePeerNotify"},r})(),T.ReportP2PExReq=(function(){function r(e){if(this.types=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.pushId="",r.prototype.pullId="",r.prototype.code=0,r.prototype.types=$util.emptyArray,r.prototype.desc=null,r.prototype.connectedTime=null,r.prototype.action=null;let c;return Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_connectedTime",{get:$util.oneOfGetter(c=["connectedTime"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_action",{get:$util.oneOfGetter(c=["action"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.pushId!=null&&Object.hasOwnProperty.call(t,"pushId")&&i.uint32(18).string(t.pushId),t.pullId!=null&&Object.hasOwnProperty.call(t,"pullId")&&i.uint32(26).string(t.pullId),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(32).int32(t.code),t.types!=null&&t.types.length){i.uint32(42).fork();for(let _=0;_<t.types.length;++_)i.int32(t.types[_]);i.ldelim()}return t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(50).string(t.desc),t.connectedTime!=null&&Object.hasOwnProperty.call(t,"connectedTime")&&i.uint32(58).string(t.connectedTime),t.action!=null&&Object.hasOwnProperty.call(t,"action")&&i.uint32(64).int32(t.action),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.ReportP2PExReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.pushId=t.string();break}case 3:{C.pullId=t.string();break}case 4:{C.code=t.int32();break}case 5:{if(C.types&&C.types.length||(C.types=[]),(F&7)===2){let j=t.uint32()+t.pos;for(;t.pos<j;)C.types.push(t.int32())}else C.types.push(t.int32());break}case 6:{C.desc=t.string();break}case 7:{C.connectedTime=t.string();break}case 8:{C.action=t.int32();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.pushId!=null&&t.hasOwnProperty("pushId")&&!$util.isString(t.pushId))return"pushId: string expected";if(t.pullId!=null&&t.hasOwnProperty("pullId")&&!$util.isString(t.pullId))return"pullId: string expected";if(t.code!=null&&t.hasOwnProperty("code"))switch(t.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(t.types!=null&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(let i=0;i<t.types.length;++i)switch(t.types[i]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}if(t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc))return"desc: string expected";if(t.connectedTime!=null&&t.hasOwnProperty("connectedTime")&&!$util.isString(t.connectedTime))return"connectedTime: string expected";if(t.action!=null&&t.hasOwnProperty("action"))switch(t.action){default:return"action: enum value expected";case 0:case 1:case 2:case 3:case 4:break}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ReportP2PExReq)return t;let i=new $root.com.quick.voice.proto.ReportP2PExReq;switch(t.roomId!=null&&(i.roomId=String(t.roomId)),t.pushId!=null&&(i.pushId=String(t.pushId)),t.pullId!=null&&(i.pullId=String(t.pullId)),t.code){default:if(typeof t.code=="number"){i.code=t.code;break}break;case"Success":case 0:i.code=0;break;case"Failed":case 1:i.code=1;break;case"Ignore":case 2:i.code=2;break;case"Disconnected":case 3:i.code=3;break;case"LowQuality":case 4:i.code=4;break}if(t.types){if(!Array.isArray(t.types))throw TypeError(".com.quick.voice.proto.ReportP2PExReq.types: array expected");i.types=[];for(let _=0;_<t.types.length;++_)switch(t.types[_]){default:if(typeof t.types[_]=="number"){i.types[_]=t.types[_];break}case"Microphone":case 0:i.types[_]=0;break;case"Camera":case 1:i.types[_]=1;break;case"Screen":case 2:i.types[_]=2;break;case"SystemVoice":case 3:i.types[_]=3;break}}switch(t.desc!=null&&(i.desc=String(t.desc)),t.connectedTime!=null&&(i.connectedTime=String(t.connectedTime)),t.action){default:if(typeof t.action=="number"){i.action=t.action;break}break;case"ReverseTry":case 0:i.action=0;break;case"ReverseTryFailed":case 1:i.action=1;break;case"ReverseSuccess":case 2:i.action=2;break;case"ConnectSuccess":case 3:i.action=3;break;case"ReversePushDelay":case 4:i.action=4;break}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.types=[]),i.defaults&&(_.roomId="",_.pushId="",_.pullId="",_.code=i.enums===String?"Success":0),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.pushId!=null&&t.hasOwnProperty("pushId")&&(_.pushId=t.pushId),t.pullId!=null&&t.hasOwnProperty("pullId")&&(_.pullId=t.pullId),t.code!=null&&t.hasOwnProperty("code")&&(_.code=i.enums===String?$root.com.quick.voice.proto.P2PCode[t.code]===void 0?t.code:$root.com.quick.voice.proto.P2PCode[t.code]:t.code),t.types&&t.types.length){_.types=[];for(let x=0;x<t.types.length;++x)_.types[x]=i.enums===String?$root.com.quick.voice.proto.TrackType[t.types[x]]===void 0?t.types[x]:$root.com.quick.voice.proto.TrackType[t.types[x]]:t.types[x]}return t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),t.connectedTime!=null&&t.hasOwnProperty("connectedTime")&&(_.connectedTime=t.connectedTime,i.oneofs&&(_._connectedTime="connectedTime")),t.action!=null&&t.hasOwnProperty("action")&&(_.action=i.enums===String?$root.com.quick.voice.proto.P2PAction[t.action]===void 0?t.action:$root.com.quick.voice.proto.P2PAction[t.action]:t.action,i.oneofs&&(_._action="action")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ReportP2PExReq"},r})(),T.P2PDisconnectedNotify=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.remoteUserId="",r.prototype.types=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.remoteUserId!=null&&Object.hasOwnProperty.call(e,"remoteUserId")&&t.uint32(18).string(e.remoteUserId),e.types!=null&&e.types.length){t.uint32(26).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PDisconnectedNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.remoteUserId=e.string();break}case 3:{if(x.types&&x.types.length||(x.types=[]),(C&7)===2){let F=e.uint32()+e.pos;for(;e.pos<F;)x.types.push(e.int32())}else x.types.push(e.int32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.remoteUserId!=null&&e.hasOwnProperty("remoteUserId")&&!$util.isString(e.remoteUserId))return"remoteUserId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PDisconnectedNotify)return e;let t=new $root.com.quick.voice.proto.P2PDisconnectedNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.remoteUserId!=null&&(t.remoteUserId=String(e.remoteUserId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PDisconnectedNotify.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.roomId="",i.remoteUserId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.remoteUserId!=null&&e.hasOwnProperty("remoteUserId")&&(i.remoteUserId=e.remoteUserId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PDisconnectedNotify"},r})(),T.RtcEvent=(function(){const r={},c=Object.create(r);return c[r[0]="UpdateTrackActive"]=0,c})(),T.RtcTrack=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.mid="",r.prototype.trackName="",r.prototype.type=0,r.prototype.isActive=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.mid!=null&&Object.hasOwnProperty.call(e,"mid")&&t.uint32(18).string(e.mid),e.trackName!=null&&Object.hasOwnProperty.call(e,"trackName")&&t.uint32(26).string(e.trackName),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(32).int32(e.type),e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&t.uint32(40).bool(e.isActive),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.RtcTrack;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.mid=e.string();break}case 3:{x.trackName=e.string();break}case 4:{x.type=e.int32();break}case 5:{x.isActive=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.mid!=null&&e.hasOwnProperty("mid")&&!$util.isString(e.mid))return"mid: string expected";if(e.trackName!=null&&e.hasOwnProperty("trackName")&&!$util.isString(e.trackName))return"trackName: string expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RtcTrack)return e;let t=new $root.com.quick.voice.proto.RtcTrack;switch(e.userId!=null&&(t.userId=String(e.userId)),e.mid!=null&&(t.mid=String(e.mid)),e.trackName!=null&&(t.trackName=String(e.trackName)),e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Microphone":case 0:t.type=0;break;case"Camera":case 1:t.type=1;break;case"Screen":case 2:t.type=2;break;case"SystemVoice":case 3:t.type=3;break}return e.isActive!=null&&(t.isActive=!!e.isActive),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.mid="",i.trackName="",i.type=t.enums===String?"Microphone":0,i.isActive=!1),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.mid!=null&&e.hasOwnProperty("mid")&&(i.mid=e.mid),e.trackName!=null&&e.hasOwnProperty("trackName")&&(i.trackName=e.trackName),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.RtcTrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.RtcTrackType[e.type]:e.type),e.isActive!=null&&e.hasOwnProperty("isActive")&&(i.isActive=e.isActive),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RtcTrack"},r})(),T.RtcTrackType=(function(){const r={},c=Object.create(r);return c[r[0]="Microphone"]=0,c[r[1]="Camera"]=1,c[r[2]="Screen"]=2,c[r[3]="SystemVoice"]=3,c})(),T.UpdateTrackState=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.RtcTrack.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateTrackState;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.RtcTrack.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.RtcTrack.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTrackState)return e;let t=new $root.com.quick.voice.proto.UpdateTrackState;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.RtcTrack.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.RtcTrack.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTrackState"},r})(),T})(),u})(),b})(),m})(),compressArrayBuffer=m=>{const b=new Uint8Array(m),u=pako.deflate(b,{gzip:!0});return new Uint8Array(u?.buffer)},decompressArrayBuffer=m=>{const b=new Uint8Array(m),u=pako.inflate(b,{gzip:!0});return new Uint8Array(u?.buffer)},sendMessageFormat=m=>{const{event:b,compress:u=!1}=m,T=m.data;let r="",c;switch(m.time&&(r=p$1(m.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),b){case"heartbeat":case"heartbeatEx":c=com.quick.voice.proto.ReportTrafficUsage.encode(T).finish();break;case"ackMsg":c=com.quick.voice.proto.AckMsgReq.encode(T).finish();break;case"reportNetwork":c=com.quick.voice.proto.ReportNetInfo.encode(T).finish();break;case"connectCF":c=com.quick.voice.proto.ConnectCFReq.encode(T).finish();break;case"publish":c=com.quick.voice.proto.PublishReq.encode(T).finish();break;case"joinRoom":case"joinRoomEx":c=com.quick.voice.proto.JoinReq.encode(T).finish();break;case"pubNotify":c=com.quick.voice.proto.PublishNotify.encode(T).finish();break;case"subscribe":c=com.quick.voice.proto.SubscribeReq.encode(T).finish();break;case"renegotiate":c=com.quick.voice.proto.RenegotiateReq.encode(T).finish();break;case"closeTrack":c=com.quick.voice.proto.CloseTrackReq.encode(T).finish();break;case"preventUsersBehavior":c=com.quick.voice.proto.PreventUsersBehaviorReq.encode(T).finish();break;case"networkQualityChange":c=com.quick.voice.proto.NetQualityChange.encode(T).finish();break;case"updateCall":c=com.quick.voice.proto.UpdateCall.encode(T).finish();break;case"toggleRoomSpeechLang":c=com.quick.voice.proto.AiLangSetting.encode(T).finish();break;case"syncRoomInfo":c=com.quick.voice.proto.SyncRoomInfoReq.encode(T).finish();break;case"offer":c=com.quick.voice.proto.SdpConsult.encode(T).finish();break;case"answer":c=com.quick.voice.proto.SdpConsult.encode(T).finish();break;case"candidate":c=com.quick.voice.proto.Candidates.encode(T).finish();break;case"reportP2PConnectEx":c=com.quick.voice.proto.ReportP2PExReq.encode(T).finish();break;case"UpdateTrackActive":c=com.quick.voice.proto.UpdateTrackState.encode(T).finish();break}if(c&&u)try{c=compressArrayBuffer(c)}catch(e){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息压缩错误",e)}return{...m,timeStr:r,data_original:T,data:c}},onMessageFormat=m=>{const{event:b,compress:u=!1}=m;let T=m.data,r="",c;if(m.time&&(r=p$1(m.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),u)try{T=decompressArrayBuffer(T)}catch(e){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",e)}switch(b){case"connectCF":c=com.quick.voice.proto.ConnectCFRsp.decode(T);break;case"publish":c=com.quick.voice.proto.PublishRsp.decode(T);break;case"joinRoom":case"joinRoomEx":c=com.quick.voice.proto.JoinRsp.decode(T);break;case"subscribe":c=com.quick.voice.proto.SubscribeRsp.decode(T);break;case"closeTrack":c=com.quick.voice.proto.CloseTrackRsp.decode(T);break;case"syncRoomInfo":c=com.quick.voice.proto.SyncRoomInfoRsp.decode(T);break;case"onJoinRoom":c=com.quick.voice.proto.JoinNotify.decode(T);break;case"onPublish":c=com.quick.voice.proto.PublishNotify.decode(T);break;case"onCloseTrack":c=com.quick.voice.proto.CloseTrackNotify.decode(T);break;case"onTrackInactive":c=com.quick.voice.proto.CheckSessionRsq.decode(T);break;case"onUpdateCall":c=com.quick.voice.proto.UpdateCall.decode(T);break;case"onUpdatePermissions":c=com.quick.voice.proto.UpdatePermissions.decode(T);break;case"onNetQuality":c=com.quick.voice.proto.NetQualityNotify.decode(T);break;case"onCDNPlayUrlAdd":c=com.quick.voice.proto.CDNPlayAddressNotify.decode(T);break;case"onUpdateBehavior":c=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(T);break;case"onRoomUserSpeech":c=com.quick.voice.proto.RoomSpeechNotify.decode(T);break;case"onAttemptP2PEx":c=com.quick.voice.proto.P2PAvailablePeerNotify.decode(T);break;case"onOffer":c=com.quick.voice.proto.SdpConsult.decode(T);break;case"onAnswer":c=com.quick.voice.proto.SdpConsult.decode(T);break;case"onCandidate":c=com.quick.voice.proto.Candidates.decode(T);break;case"onDisconnectedP2P":c=com.quick.voice.proto.P2PDisconnectedNotify.decode(T);break;case"onQuitRoom":c=com.quick.voice.proto.QuitNotify.decode(T);break;case"onDestroyRoom":c=com.quick.voice.proto.QuitNotify.decode(T);break;case"debugger":case"ai":c=JSON.parse(new TextDecoder().decode(T));break;case"UpdateTrackActive":c=com.quick.voice.proto.UpdateTrackState.decode(T);break}return{...m,timeStr:r,data_remote:T,data:c}},obj2pb=m=>com.quick.voice.proto.CommonReq.encode(m).finish(),pb2obj=m=>com.quick.voice.proto.CommonRsp.decode(m);var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var m=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(b){return b.encoding?"rtpmap:%d %s/%s/%s":b.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(b){return b.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(b){return b.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(b){return"extmap:%d"+(b.direction?"/%s":"%v")+(b["encrypt-uri"]?" %s":"%v")+" %s"+(b.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(b){return b.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{push:"msid",reg:/^msid:([\w-]+)(?: ([\w-]+))?/,names:["id","appdata"],format:"msid:%s %s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(b){var u="candidate:%s %d %s %d %s %d typ %s";return u+=b.raddr!=null?" raddr %s rport %d":"%v%v",u+=b.tcptype!=null?" tcptype %s":"%v",b.generation!=null&&(u+=" generation %d"),u+=b["network-id"]!=null?" network-id %d":"%v",u+=b["network-cost"]!=null?" network-cost %d":"%v",u}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(b){var u="ssrc:%d";return b.attribute!=null&&(u+=" %s",b.value!=null&&(u+=":%s")),u}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(b){return b.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(b){return b.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(b){return"imageattr:%s %s %s"+(b.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(b){return"simulcast:%s %s"+(b.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(b){return"ts-refclk:%s"+(b.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(b){var u="mediaclk:";return u+=b.id!=null?"id=%s %s":"%v%s",u+=b.mediaClockValue!=null?"=%s":"",u+=b.rateNumerator!=null?" rate=%s":"",u+=b.rateDenominator!=null?"/%s":"",u}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(m).forEach(function(b){var u=m[b];u.forEach(function(T){T.reg||(T.reg=/(.*)/),T.format||(T.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,(function(m){var b=function(t){return String(Number(t))===t?Number(t):t},u=function(t,i,_,x){if(x&&!_)i[x]=b(t[1]);else for(var C=0;C<_.length;C+=1)t[C+1]!=null&&(i[_[C]]=b(t[C+1]))},T=function(t,i,_){var x=t.name&&t.names;t.push&&!i[t.push]?i[t.push]=[]:x&&!i[t.name]&&(i[t.name]={});var C=t.push?{}:x?i[t.name]:i;u(_.match(t.reg),C,t.names,t.name),t.push&&i[t.push].push(C)},r=requireGrammar(),c=RegExp.prototype.test.bind(/^([a-z])=(.*)/);m.parse=function(t){var i={},_=[],x=i;return t.split(/(\r\n|\r|\n)/).filter(c).forEach(function(C){var F=C[0],j=C.slice(2);F==="m"&&(_.push({rtp:[],fmtp:[]}),x=_[_.length-1]);for(var Z=0;Z<(r[F]||[]).length;Z+=1){var ee=r[F][Z];if(ee.reg.test(j))return T(ee,x,j)}}),i.media=_,i};var e=function(t,i){var _=i.split(/=(.+)/,2);return _.length===2?t[_[0]]=b(_[1]):_.length===1&&i.length>1&&(t[_[0]]=void 0),t};m.parseParams=function(t){return t.split(/;\s?/).reduce(e,{})},m.parseFmtpConfig=m.parseParams,m.parsePayloads=function(t){return t.toString().split(" ").map(Number)},m.parseRemoteCandidates=function(t){for(var i=[],_=t.split(" ").map(b),x=0;x<_.length;x+=3)i.push({component:_[x],ip:_[x+1],port:_[x+2]});return i},m.parseImageAttributes=function(t){return t.split(" ").map(function(i){return i.substring(1,i.length-1).split(",").reduce(e,{})})},m.parseSimulcastStreamList=function(t){return t.split(";").map(function(i){return i.split(",").map(function(_){var x,C=!1;return _[0]!=="~"?x=b(_):(x=b(_.substring(1,_.length)),C=!0),{scid:x,paused:C}})})}})(parser)),parser}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1;var m=requireGrammar(),b=/%[sdv%]/g,u=function(e){var t=1,i=arguments,_=i.length;return e.replace(b,function(x){if(t>=_)return x;var C=i[t];switch(t+=1,x){case"%%":return"%";case"%s":return String(C);case"%d":return Number(C);case"%v":return""}})},T=function(e,t,i){var _=t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format,x=[e+"="+_];if(t.names)for(var C=0;C<t.names.length;C+=1){var F=t.names[C];t.name?x.push(i[t.name][F]):x.push(i[t.names[C]])}else x.push(i[t.name]);return u.apply(null,x)},r=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];return writer=function(e,t){t=t||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(C){C.payloads==null&&(C.payloads="")});var i=t.outerOrder||r,_=t.innerOrder||c,x=[];return i.forEach(function(C){m[C].forEach(function(F){F.name in e&&e[F.name]!=null?x.push(T(C,F,e)):F.push in e&&e[F.push]!=null&&e[F.push].forEach(function(j){x.push(T(C,F,j))})})}),e.media.forEach(function(C){x.push(T("m",m.m[0],C)),_.forEach(function(F){m[F].forEach(function(j){j.name in C&&C[j.name]!=null?x.push(T(F,j,C)):j.push in C&&C[j.push]!=null&&C[j.push].forEach(function(Z){x.push(T(F,j,Z))})})})}),x.join(`\r
|
|
1
|
+
(function(m,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(m=typeof globalThis<"u"?globalThis:m||self,b(m["quickvo-sdk-js"]={}))})(this,(function(exports){"use strict";const at=(m,b={})=>{const u={unit:"B",splitStr:" ",...b};let{unit:T,splitStr:r}=u;const c=["B","KB","MB","GB","TB","PB","EB","ZB","YB","DB","NB"],e=c.findIndex(Z=>Z===T),t=c.slice(e+1,c.length);let i=`${m}`;const _=i[0]==="-";_&&(i=i.replace("-",""));const x=i.split(""),C=U(x,4).reverse();let F="",j=0;for(const Z of C)if(F=`${Z.join("")}${F}`,j=+`${F}`,!(j<1024)){for(const ee of t)if(T=ee,j=j/1024,Math.abs(j)<1024)break}return`${_?"-":""}${j.toFixed(2)}${r}${T}`},L=(m,b=[])=>{const u={...m},T=Object.keys(u);for(const r of T)b.findIndex(c=>String(c)===r)===-1&&delete u[r];return u},U=(m,b)=>{const u=Math.max(1,b),T=Math.ceil(m.length/u),r=[];for(let c=0;c<T;c++){const e=c*u,t=Math.min(e+u,m.length);r.push(m.slice(e,t))}return r},pt=(m,b=[])=>{const u=[];for(const T of m){const r=L(T,b);u.push(r)}return u},Yt=(m,b="value",u="label")=>{const T=[],r=Object.entries(m);for(const[c,e]of r){const t={[u]:e,[b]:c};T.push(t)}return T},gt=m=>{m||(m=AudioContext=new(window.AudioContext||window.webkitAudioContext));const b=m.createOscillator();b.type="sine",b.frequency.setValueAtTime(0,m.currentTime);const u=m.createGain();u.gain.value=0,b.connect(u),u.connect(m.destination),b.start();const T=m.createMediaStreamDestination();return u.disconnect(),b.connect(T),T.stream},wt=({width:m=32,height:b=32,opacity:u=1,fps:T=20,text:r=""})=>{T=Math.min(T,30);const c=document.createElement("canvas"),e=c.getContext("2d");c.width=m,c.height=b;let t=0;const i=c.captureStream(T),_=()=>{e.clearRect(0,0,c.width,c.height);const x=e.createLinearGradient(0,0,c.width,c.height);if(x.addColorStop(0,`hsla(${t}, 100%, 50%, ${u})`),x.addColorStop(1,`hsla(${t+120}, 100%, 50%, ${u})`),e.fillStyle=x,e.fillRect(0,0,c.width,c.height),r){const C=Math.min(m,b)*.8;e.font=`bold ${C/r.length}px Arial`,e.textAlign="center",e.textBaseline="middle",e.fillStyle=`rgba(255, 255, 255, ${u})`,e.fillText(r,c.width*.5,c.height*.5)}t=(t+1)%360,i.active&&setTimeout(_,Math.round(1e3/T))};return _(),i},R=(m=0,b=1)=>{const u=Math.max(0,m),T=Math.max(1,b),r=Math.min(u,T),c=Math.max(u,T),e=Math.random()*(c-r+1)+r;return parseInt(`${e}`,10)},bt=(m=16,b=16)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),T=Math.min(u.length,b),r=Date.now().toString(T),c=r.split(""),e=Math.max(4,m-r.length);for(let t=0;t<e;t++){const i=R(0,T-1),_=u[i];c.push(_)}return c.join("").toUpperCase()},E$1=(m,b)=>{try{let u=Number(m);if(isNaN(u)){const T=new Date(`${m}`);if(`${T}`=="Invalid Date")return 0;u=T.getTime()}if(b!==void 0){const T=new Date().getTimezoneOffset();u+=(T+b)*60*1e3}return u}catch(u){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:m,_offset:b,error:u}),0}},H=1e3,Q=6e4,I=36e5,$=864e5,X={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},W$1=m=>E$1(m),p$1=(m,b="YYYY-MM-DD hh:mm:ss",u={})=>{const T={empty_str:"-",...u},{empty_str:r,offset:c}=T,e=E$1(m,c);if(Number(m)!==0&&e===0)return r;const t=new Date(e),i=`${t.getFullYear()}`,_=`${t.getMonth()+1}`,x=`${["1","2","3"].includes(_)?1:["4","5","6"].includes(_)?2:["7","8","9"].includes(_)?3:4}`,C=`${t.getDate()}`,F=`${t.getDay()===0?7:t.getDay()}`,j=`${t.getHours()}`,Z=`${t.getMinutes()}`,ee=`${t.getSeconds()}`,re=`${Math.ceil((e-W$1(`${i}/01/01 00:00:00`)+1)/864e5)}`,K=`${Math.ceil(((e-W$1(`${i}/01/01 00:00:00`))/864e5-Number(F))/7)+1}`,se=[{k:"Y+",v:i},{k:"M+",v:_},{k:"Q+",v:x},{k:"D+",v:C},{k:"W+",v:F},{k:"h+",v:j},{k:"m+",v:Z},{k:"s+",v:ee},{k:"d+",v:re},{k:"w+",v:K}];let fe;for(let{k:G,v:ne}of se)if(fe=new RegExp(`(${G})`).exec(b),fe){const ae=fe[1];let oe=ne.padStart(ae.length,"0");ae.includes("W")&&(oe=X[oe.slice(0,2)]),b=b.replace(ae,oe)}return b},St=(m,b="hh:mm:ss")=>{const u=`${Math.floor(m/864e5)}`;b.includes("D")&&(m=m%864e5);const T=`${Math.floor(m/36e5)}`;b.includes("h")&&(m=m%36e5);const r=`${Math.floor(m/6e4)}`;b.includes("m")&&(m=m%6e4);const c=`${Math.floor(m/1e3)}`;b.includes("s")&&(m=m%1e3);const e=[{k:"D+",v:u},{k:"h+",v:T},{k:"m+",v:r},{k:"s+",v:c}];let t;for(let{k:i,v:_}of e)if(t=new RegExp(`(${i})`).exec(b),t){const x=t[1];let C=_.padStart(x.length,"0");b=b.replace(x,C)}return b},$t=(m,b={})=>new Promise(async(u,T)=>{const{timeout:r=5*1e3,message:c="timeout"}=b,e=setTimeout(()=>T(c),r);try{const t=await m();u(t)}catch(t){T(t)}clearTimeout(e)}),version="1.6.48",isMobile=()=>{const m=navigator.userAgent.toLowerCase();return new RegExp("mobile|android|iphone|ipad|ipod|windows phone|phone|webos","i").test(m)},getNetworkQuality=(m,b,u)=>{let T=0;return m<.03&&b<100&&u<50?T=5:m<.06&&b<160&&u<100?T=4:m<.1&&b<250&&u<150?T=3:m<.15&&b<400&&u<200?T=2:T=1,T},availableWeight=[.05,.05,.05,.05,.1,.1,.1,.15,.15,.2].reverse(),estimateDataByResolution=(m,b)=>{const c=2073600/(m*b);return Math.round(307200/Math.pow(c,.9))},sortByMimeTypes=(m,b)=>m.sort((u,T)=>{const r=b.indexOf(u.mimeType),c=b.indexOf(T.mimeType),e=r>=0?r:Number.MAX_VALUE,t=c>=0?c:Number.MAX_VALUE;return e-t});let Config$1=class{url="";appid="";debug=!1;reportErr=!0;logUrl="https://logs1.quickvo.org";sdkToken="";roomId="";userId="";callType=1;stt=!0;lang={input:"",output:"",translateEnable:!1};useP2P=!0;newPublishAutoSubscribe=!0;roomState="ready";peerState="new";version=version;serviceVersion="1.0.8";callSession="";isEarly=!1;earlyId=bt();isInRoom=!1;sfuPriority=-1;network={sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}};codecPreferences={audio:[],video:[]};constructor(){{const b=RTCRtpReceiver.getCapabilities("video").codecs,u=["video/H264","video/VP8","video/VP9"];this.codecPreferences.video=sortByMimeTypes(b,u)}}setOptions=b=>{const u=Object.keys(b);for(const T of u){if(b[T]===void 0)continue;const r=b[T];this[T]=r}};createWsUrl=()=>{const{appid:b,roomId:u,userId:T,isEarly:r,earlyId:c,serviceVersion:e}=this;if(!b)throw new Error("quickvo: createSession is error. You must first use QuickVO.setOptions to set the appid.");const t={c:b,r:u,p:"web",h:location.hostname,v:e};r?t.i=c:t.b=T;const i=btoa(encodeURI(JSON.stringify(t))),_=`${this.url}?s=${i}&t=${Date.now()}`;return this.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWsUrl",{data:t,url:_}),_}};class Traffic{sfu={outboundBytes:0,inboundBytes:0};p2p={outboundBytes:0,inboundBytes:0};getUse=(b="b")=>{let u=1;return b==="kb"&&(u=1024),{sfu:{outboundBytes:Math.round(this.sfu.outboundBytes/u),inboundBytes:Math.round(this.sfu.inboundBytes/u)},p2p:{outboundBytes:Math.round(this.p2p.outboundBytes/u),inboundBytes:Math.round(this.p2p.inboundBytes/u)}}};clear=()=>{}}class Notifys{queue=new Map;emit=(b,u)=>{const T=this.queue.get(b)||[];for(const r of T){const{callback:c=()=>{}}=r;c(u)}};add=b=>{const{event:u,sn:T=bt(32)}=b;this.queue.has(u)||this.queue.set(u,[]);const r=this.queue.get(u)||[],c=r.findIndex(e=>e.sn===T);return c!==-1&&r.splice(c,1),r.push(b),T}}const enum_mediaType={mc_audio:"麦克风-默认轨道",mc_video:"摄像头-默认轨道",ss_video:"屏幕共享-视频轨道",ss_audio:"屏幕共享-音频轨道"},mediaType_options=Yt(enum_mediaType),mediaType_keys=Object.keys(enum_mediaType),mediaType_vals=Object.values(enum_mediaType);class LocalTrackAnalysis{types=["outbound-rtp","remote-inbound-rtp","media-source","codec"];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}generate=async(b,u)=>{try{if(u===void 0)throw new Error("Peer track is undefined.");if(b.connectionState!=="connected")throw new Error(`Peer connectionState is ${b.connectionState}.`);const r=[...(await b.getStats(u)).values()],c={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};let e=0,t=0;for(const i of r){const{type:_}=i;if(this.types.includes(_))switch(_){case"codec":{const{mimeType:x,payloadType:C,sdpFmtpLine:F}=i;c.mimeType=x,c.payloadType=C,c.sdpFmtpLine=F}break;case"outbound-rtp":{const{bytesSent:x,packetsSent:C,frameWidth:F=0,frameHeight:j=0,framesPerSecond:Z=0}=i;e=C,c.bytesSent=x,c.frameWidth=F,c.frameHeight=j,c.framesPerSecond=Z}break;case"remote-inbound-rtp":{const{packetsLost:x=0,roundTripTime:C=0,jitter:F=0}=i;t=x,c.roundTripTime=Math.round(C*1e3),c.jitter=Math.round(F*1e3)}break}}if(t!==0){const i=e-this.transmittedPackets,_=t-this.transmittedPacketsLost,x=i+_;c.lostRate=x===0?0:Math.round(_/x*1e4)/1e4,this.transmittedPackets=e,this.transmittedPacketsLost=t}{const{lostRate:i,roundTripTime:_,jitter:x}=c;c.quality=getNetworkQuality(i,_,x),this.averageQualitys.unshift(c.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(c.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((i,_)=>i+_)/this.averageQualitys.length)),c.offsetBytesSent=Math.max(0,c.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(c.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),c.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((i,_)=>i+_)/this.averageOffsetBytesSents.length);{const{frameWidth:i,frameHeight:_,mimeType:x}=c;if(x){if(x.includes("audio"))this.isAvailable.unshift(1);else if(i&&_){const C=Math.round(estimateDataByResolution(i,_)/3),F=c.offsetBytesSent>=C?1:0;this.isAvailable.unshift(F)}this.isAvailable=this.isAvailable.slice(0,10)}}{const i=this.isAvailable.length;let _=0;const x=[];for(let C=0;C<i;C++){const F=this.isAvailable[C]*availableWeight[C];_+=F,x.push(F)}this.availableScore=x,c.availableScore=Math.round(_*100)/100}this.trackReport=c}catch{this.clear()}return this.trackReport};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}}let d$1=class{inputStream=new MediaStream;outputStream=new MediaStream;inputGain=1;enhanceGain=1;bgsGain=1;bgmGain=1;outputGain=1;mixAudioMap=new Map;audioContext=new AudioContext;sourceNode;inputGainNode;enhanceGainNode;bgsGainNode;bgmGainNode;rnnoiseNode;analyserNode;analyserArrayData;outputGainNode;destinationNode;denoise=!1;mute=!0;rnnoiseWorklet;rnnoiseWorkletNode;filterStream=b=>b;constructor(b,u){this.inputStream=b,u&&(this.audioContext=u),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,this.audioContext.currentTime),this.enhanceGainNode=this.audioContext.createGain(),this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime),this.bgsGainNode=this.audioContext.createGain(),this.bgsGainNode.gain.setValueAtTime(this.bgsGain,this.audioContext.currentTime),this.bgmGainNode=this.audioContext.createGain(),this.bgmGainNode.gain.setValueAtTime(this.bgmGain,this.audioContext.currentTime),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=512,this.analyserArrayData=new Uint8Array(this.analyserNode.frequencyBinCount),this.outputGainNode=this.audioContext.createGain(),this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime),this.destinationNode=this.audioContext.createMediaStreamDestination(),this.outputStream=this.destinationNode.stream;{const{sourceNode:T,inputGainNode:r,enhanceGainNode:c,bgsGainNode:e,bgmGainNode:t,analyserNode:i,outputGainNode:_,destinationNode:x}=this;T.connect(r),r.connect(c),c.connect(i),e.connect(i),t.connect(i),c.connect(x),e.connect(x),t.connect(x),_.connect(this.audioContext.destination)}this.audioContext.resume()}use=({rnnoise:b})=>{this.rnnoiseWorklet=new b.RnnoiseWorklet};_changeSource=()=>{this.sourceNode.disconnect(),this.sourceNode=this.audioContext.createMediaStreamSource(this.inputStream),this.sourceNode.connect(this.inputGainNode)};replaceTrack=b=>{const u=this.inputStream.getTracks();for(const T of u)this.inputStream.removeTrack(T);this.inputStream.addTrack(b),this._changeSource()};stop=()=>{{const b=this.inputStream.getTracks();for(const u of b)u.stop(),this.inputStream.removeTrack(u)}};pause=async b=>{const u=this.inputStream.getTracks();for(const T of u)T.enabled=!b};getStream=()=>this.filterStream(this.outputStream);setMute=(b=!0)=>{this.mute=b,this.analyserNode.disconnect(),b===!1&&this.analyserNode.connect(this.outputGainNode)};setDenoise=async(b=!0)=>{this.rnnoiseWorklet&&(this.inputGainNode.disconnect(),this.rnnoiseWorklet.destroy(),b?(this.rnnoiseWorkletNode=await this.rnnoiseWorklet.createRnnoiseWorkletNode(this.audioContext),this.inputGainNode.connect(this.rnnoiseWorkletNode),this.rnnoiseWorkletNode.connect(this.enhanceGainNode)):this.inputGainNode.connect(this.enhanceGainNode),this.denoise=b)};setInputGain=b=>{this.inputGain=b,this.inputGainNode.gain.setValueAtTime(b,this.audioContext.currentTime)};setEnhanceGain=async b=>{this.enhanceGain=b+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)};setBgsGain=b=>{this.bgsGain=b,this.bgsGainNode.gain.setValueAtTime(b,this.audioContext.currentTime)};setBgmGain=b=>{this.bgmGain=b,this.bgmGainNode.gain.setValueAtTime(b,this.audioContext.currentTime)};setOutputGain=b=>{this.outputGain=b,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)};getVolume=()=>{const{analyserNode:b,analyserArrayData:u}=this;b.getByteFrequencyData(u);let T=0;for(let r=0;r<u.length;r++)T+=u[r];return Math.ceil(T/u.length)};mixAudio=(b,u="bgm")=>new Promise(async(T,r)=>{try{{const t=this.mixAudioMap.get(u);t&&t.stop()}const c=u==="bgs"?this.bgsGainNode:this.bgmGainNode,e=this.audioContext.createBufferSource();this.mixAudioMap.set(u,e),e.buffer=b,e.connect(c),e.onended=()=>{e.disconnect(c),this.mixAudioMap.delete(u),T(!0)},e.start(0)}catch(c){r(c)}});mixAudioStop=b=>{this.mixAudioMap.get(b)?.stop()};changeMix=(b,u)=>{const T=b==="bgs"?this.bgsGainNode:this.bgmGainNode;u?T.connect(this.destinationNode):T.disconnect(this.destinationNode)}};class UserBase{config;localMedias;id="";callAction=0;callActionStr="";callActionMap={};permissions=0;permissionsStr="";permissionsMap={};banBehavior=0;banBehaviorStr="";banBehaviorMap={};isOwner=!1;network={egress:0,ingress:0};tracks={};isSelf=!1;streamControls={};streams={mc_audio:new MediaStream,mc_video:new MediaStream,ss_video:new MediaStream,ss_audio:new MediaStream};published={};constructor({config:b,localMedias:u}){this.config=b,this.localMedias=u;for(const T of mediaType_keys)switch(T){case"mc_audio":case"ss_audio":{const r=new MediaStream,c=this.localMedias.getPhoneyStreamTrack(T);r.addTrack(c);const e=new d$1(r,this.localMedias.audioContext);this.streamControls[T]=e,this.streams[T]=e.getStream()}break;default:{const r=new MediaStream,c=this.localMedias.getPhoneyStreamTrack(T);r.addTrack(c),this.streams[T]=r}break}}setMute=(b,u)=>{for(const T of b){const r=this.streamControls[T];r&&r.setMute(u)}};updateCallAction=b=>{this.callAction=b,this.callActionStr=Number(this.callAction).toString(2).padStart(4,"0");const u=this.callActionStr.split(""),[T,r,c,e]=u;this.callActionMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updatePermissions=b=>{this.permissions=b,this.permissionsStr=Number(this.permissions).toString(2).padStart(4,"0");const u=this.permissionsStr.split(""),[T,r,c,e]=u;this.permissionsMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updateBanBehavior=b=>{this.banBehavior=b,this.banBehaviorStr=Number(this.banBehavior).toString(2).padStart(4,"0");const u=this.banBehaviorStr.split(""),[T,r,c,e]=u;this.banBehaviorMap={mc_audio:!!Number(e),mc_video:!!Number(c),ss_video:!!Number(r),ss_audio:!!Number(T)}};updateNetwork=b=>{const{egress:u,ingress:T}=this.network,r=b.egress===u&&b.ingress===T;return r===!1&&(this.network=b),r};updateTracks=(b,u=!1)=>{const T=this.isSelf?"local":"remote",r=!this.isSelf,c=this.id;for(const e of b){const{type:t}=e,i=mediaType_keys[t];if(u)this.tracks[i]={enabled:r,...e,location:T,mediaType:i,origin:"unknown",userId:c};else{const _=this.tracks[i];this.tracks[i]={enabled:r,..._,...e,location:T,mediaType:i,origin:"unknown",userId:c}}}};getTrack=b=>this.tracks[b];getTracks=b=>{const u=[];for(const T of b){const r=this.tracks[T];r&&u.push(r)}return u};removeTracks=b=>{const u=[];for(const T of b){const r=this.tracks[T];r&&(u.push(r),delete this.tracks[T])}return u};replaceMediaStreamTrack=(b,u)=>{switch(b){case"mc_audio":case"ss_audio":this.streamControls[b]?.replaceTrack(u);break;default:{const T=this.streams[b],r=T.getTracks();for(const c of r)T.removeTrack(c);T.addTrack(u)}break}};getStream=b=>{const u=this.streams[b];if(!u)throw new Error(`There is no mediaTrack of type streams[${JSON.stringify(b)}].`);return u};getStreams=()=>this.streams;getUserMediaStreamContext=b=>this.streamControls[b];usePhoneyStream=b=>{for(const u of b){const T=this.localMedias.getPhoneyStreamTrack(u);this.replaceMediaStreamTrack(u,T);const r=this.getTrack(u);r&&(r.origin="phoney",r.msid="",r.enabled=!1)}};getInfo=()=>{const{id:b,callAction:u,callActionStr:T,callActionMap:r,permissions:c,permissionsStr:e,permissionsMap:t,banBehavior:i,banBehaviorStr:_,banBehaviorMap:x,isOwner:C,network:F,isSelf:j}=this,Z=[];for(const ee of mediaType_keys){if(!this.published[ee])continue;const K=this.tracks[ee];K&&Z.push(K)}return{id:b,callAction:u,callActionStr:T,callActionMap:r,permissions:c,permissionsStr:e,permissionsMap:t,banBehavior:i,banBehaviorStr:_,banBehaviorMap:x,isOwner:C,network:F,tracks:Z,isSelf:j}}}class LocalUser extends UserBase{tracksAnalysis={sfu:{sends:{mc_audio:new LocalTrackAnalysis,mc_video:new LocalTrackAnalysis,ss_video:new LocalTrackAnalysis,ss_audio:new LocalTrackAnalysis}}};constructor({config:b,localMedias:u}){super({config:b,localMedias:u}),this.isSelf=!0}getTrackReports=b=>this.tracksAnalysis.sfu.sends[b].trackReport;generateTrackAnalysis=async b=>{for(const u of mediaType_keys){const T=b.getSenderTrack(u);await this.tracksAnalysis.sfu.sends[u].generate(b.pc,T)}};setActiveNoise=(b,u)=>{this.getUserMediaStreamContext(b)?.setDenoise(u)};updateSelfCallAction=()=>{let b="";const u=r=>{const c=mediaType_keys[r];return this.tracks[c]?.enabled===!0?"1":"0"};b=`${u(0)}${b}`,b=`${u(1)}${b}`,b=`${u(2)}${b}`,b=`${u(3)}${b}`;const T=parseInt(b,2);return this.updateCallAction(T),T};checkBanBehavior=b=>{const{banBehaviorMap:u}=this;let T=!0;for(const r of b)if(u[r]){T=!1;break}return T};useLocalStream=b=>{for(const u of b){const T=this.localMedias.getLocalStreamTrack(u);if(!T)continue;this.replaceMediaStreamTrack(u,T);const r=this.getTrack(u);r&&(r.origin="local",r.msid="",r.enabled=!0)}};clear=()=>{this.tracks={},this.network={egress:0,ingress:0},this.published={}}}const types=["remote-outbound-rtp","inbound-rtp","candidate-pair","media-source","codec"];class RemotePeerTrackAnalysis{reports=[];trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};transmittedPackets=0;transmittedPacketsLost=0;averageQualitys=[];averageOffsetBytesSents=[];isAvailable=[];availableScore=[];constructor(){}generate=async(b,u)=>{try{if(u===void 0)throw new Error("Peer track is undefined.");if(b.connectionState!=="connected")throw new Error(`Peer connectionState is ${b.connectionState}.`);const r=[...(await b.getStats(u)).values()],c={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0};let e=0,t=0;for(const i of r){const{type:_}=i;if(types.includes(_))switch(_){case"codec":{const{mimeType:x,payloadType:C,sdpFmtpLine:F}=i;c.mimeType=x,c.payloadType=C,c.sdpFmtpLine=F}break;case"remote-outbound-rtp":break;case"inbound-rtp":{const{bytesReceived:x,packetsReceived:C,packetsLost:F=0,jitter:j=0,frameWidth:Z=0,frameHeight:ee=0,framesPerSecond:re=0}=i;e=C,t=F,c.bytesSent=x,c.jitter=Math.round(j*1e3),c.frameWidth=Z,c.frameHeight=ee,c.framesPerSecond=re}break;case"candidate-pair":{const{currentRoundTripTime:x=0}=i;c.roundTripTime=Math.round(x*1e3)}break}}if(e!==0&&t!==0){const i=e-this.transmittedPackets,_=t-this.transmittedPacketsLost,x=i+_;c.lostRate=x===0?0:Math.round(_/x*1e4)/1e4,this.transmittedPackets=e,this.transmittedPacketsLost=t}{const{lostRate:i,roundTripTime:_,jitter:x}=c;c.quality=getNetworkQuality(i,_,x),this.averageQualitys.unshift(c.quality),this.averageQualitys=this.averageQualitys.slice(0,10)}this.averageQualitys.length>=10&&(c.averageQuality=this.averageQualitys.length<10?0:Math.round(this.averageQualitys.reduce((i,_)=>i+_)/this.averageQualitys.length)),c.offsetBytesSent=Math.max(0,c.bytesSent-this.trackReport.bytesSent),this.averageOffsetBytesSents.unshift(c.offsetBytesSent),this.averageOffsetBytesSents=this.averageOffsetBytesSents.slice(0,5),c.averageOffsetBytesSent=this.averageOffsetBytesSents.length===0?0:Math.round(this.averageOffsetBytesSents.reduce((i,_)=>i+_)/this.averageOffsetBytesSents.length);{const{frameWidth:i,frameHeight:_,mimeType:x}=c;if(x){if(x.includes("audio"))this.isAvailable.unshift(1);else if(i&&_){const C=Math.round(estimateDataByResolution(i,_)/3),F=c.offsetBytesSent>=C?1:0;this.isAvailable.unshift(F)}this.isAvailable=this.isAvailable.slice(0,10)}}{const i=this.isAvailable.length;let _=0;const x=[];for(let C=0;C<i;C++){const F=this.isAvailable[C]*availableWeight[C];_+=F,x.push(F)}this.availableScore=x,c.availableScore=Math.round(_*100)/100}this.trackReport=c}catch{this.clear()}return this.trackReport};clear=()=>{this.trackReport={bytesSent:0,offsetBytesSent:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,averageOffsetBytesSent:0,mimeType:"unknown",payloadType:0,sdpFmtpLine:"",frameWidth:0,frameHeight:0,framesPerSecond:0,availableScore:0},this.transmittedPackets=0,this.transmittedPacketsLost=0,this.averageQualitys=[],this.averageOffsetBytesSents=[],this.availableScore=[],this.isAvailable=[]}}class RemoteUser extends UserBase{tracksAnalysis={sfu:{recvs:{mc_audio:new RemotePeerTrackAnalysis,mc_video:new RemotePeerTrackAnalysis,ss_video:new RemotePeerTrackAnalysis,ss_audio:new RemotePeerTrackAnalysis}},p2p:{sends:{mc_audio:new LocalTrackAnalysis,mc_video:new LocalTrackAnalysis,ss_video:new LocalTrackAnalysis,ss_audio:new LocalTrackAnalysis},recvs:{mc_audio:new RemotePeerTrackAnalysis,mc_video:new RemotePeerTrackAnalysis,ss_video:new RemotePeerTrackAnalysis,ss_audio:new RemotePeerTrackAnalysis}}};subscribeState={};publishWaiting={};audioReceiver={mc_audio:new Audio,ss_audio:new Audio};p2p;constructor({config:b,localMedias:u}){super({config:b,localMedias:u}),this.isSelf=!1;for(const T of mediaType_keys)this.published[T]=!0}getTrackReports=(b,u,T)=>{if(b==="sfu")return this.tracksAnalysis.sfu.recvs[T].trackReport;if(b==="p2p")return this.tracksAnalysis[b][u][T].trackReport};generateTrackAnalysis=async b=>{for(const u of mediaType_keys){{const T=this.getTrack(u);if(T){const{mid:r}=T,c=b.getRecvierTrack(r);await this.tracksAnalysis.sfu.recvs[u].generate(b.pc,c)}}{if(!this.p2p||!this.p2p.peer)continue;{const T=this.p2p.getSenderTrack(u);await this.tracksAnalysis.p2p.sends[u].generate(this.p2p.peer,T)}{const T=this.p2p.getRecvierTrack(u);await this.tracksAnalysis.p2p.recvs[u].generate(this.p2p.peer,T)}}}};addSubscribe=(b,u=2)=>{for(const T of b)this.tracks[T]&&(this.subscribeState[T]=u)};executeSubscribe=()=>{const b=[],u=Object.keys(this.subscribeState);for(const T of u){if(!this.subscribeState[T])continue;const r=this.getTrack(T);r&&(b.push({...r,lastRetry:this.subscribeState[T]===1}),this.subscribeState[T]-=1)}return{id:this.id,tracks:b}};completedSubscribe=b=>{for(const u of b)delete this.subscribeState[u]};setPublishWaiting=b=>{for(const u of b)this.publishWaiting[u]=new Date().getTime()};checkSubscribed=(b,u="all")=>{const T=[],r=[];for(const c of b){let e;const t=this.tracks[c];switch(u){case"all":e=t?.origin==="sfu"&&t.msid||t?.origin==="p2p";break;case"sfu":e=t?.origin==="sfu"&&t.msid;break;case"p2p":e=t?.origin==="p2p";break}e?T.push(c):r.push(c)}return{subscribed_mediaTypes:T,prohibited_mediaTypes:r}};useRemoteStream=(b,u)=>{for(const T of b){const r=this.getTrack(T);if(!r)continue;const c=u.getTransceiver(r.mid);if(!c)continue;const{track:e}=c.receiver;if(this.replaceMediaStreamTrack(T,e),r.origin="sfu",r.msid=e.id,["mc_audio","ss_audio"].includes(T)){const t=this.getUserMediaStreamContext(T);t?.setMute(!1);const i=t?.inputStream;if(!i)continue;const _=this.audioReceiver[T];if(!_)continue;_.srcObject=i}}};useRemoteP2PStream=b=>{for(const u of b){const T=this.getTrack(u);if(!T)continue;const r=this.p2p?.getTrack(u);if(r&&(this.replaceMediaStreamTrack(u,r),T.origin="p2p",T.msid="",["mc_audio","ss_audio"].includes(u))){const c=this.getUserMediaStreamContext(u);c?.setMute(!1);const e=c?.inputStream;if(!e)continue;const t=this.audioReceiver[u];if(!t)continue;t.srcObject=e}}};clear=()=>{this.p2p?.destroy(),this.p2p=void 0,this.tracks={},this.network={egress:0,ingress:0},this.published={}}}class PrResolves{resolvesMap=new Map;index=0;constructor(){}emit=async b=>{const u=this.resolvesMap.get(b);if(!u)return;const T=u.values();for(const r of T)clearTimeout(r.timer),r.resolve(!0),u.delete(b)};add=(b,u=()=>!1,T=1e3*30)=>new Promise((r,c)=>{if(u())return r(!0);this.resolvesMap.has(b)||this.resolvesMap.set(b,new Map),this.index++;const i=`${this.index}`;T=Math.max(0,T);let _=0;T>=0&&(_=window.setTimeout(()=>c(`[PrResolves] ${b} is timeout.`),T)),this.resolvesMap.get(b)?.set(i,{resolve:r,reject:c,timer:_})});clear=()=>{const b=this.resolvesMap.keys();for(const u of b){const r=this.resolvesMap.get(u)?.values()||[];for(const c of r)clearTimeout(c.timer),c.reject(`[PrResolves] ${u} is clear.`)}this.resolvesMap=new Map}}const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(m){let b=m.length;for(;--b>=0;)m[b]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=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]),extra_dbits=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]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(m,b,u,T,r){this.static_tree=m,this.extra_bits=b,this.extra_base=u,this.elems=T,this.max_length=r,this.has_stree=m&&m.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(m,b){this.dyn_tree=m,this.max_code=0,this.stat_desc=b}const d_code=m=>m<256?_dist_code[m]:_dist_code[256+(m>>>7)],put_short=(m,b)=>{m.pending_buf[m.pending++]=b&255,m.pending_buf[m.pending++]=b>>>8&255},send_bits=(m,b,u)=>{m.bi_valid>Buf_size-u?(m.bi_buf|=b<<m.bi_valid&65535,put_short(m,m.bi_buf),m.bi_buf=b>>Buf_size-m.bi_valid,m.bi_valid+=u-Buf_size):(m.bi_buf|=b<<m.bi_valid&65535,m.bi_valid+=u)},send_code=(m,b,u)=>{send_bits(m,u[b*2],u[b*2+1])},bi_reverse=(m,b)=>{let u=0;do u|=m&1,m>>>=1,u<<=1;while(--b>0);return u>>>1},bi_flush=m=>{m.bi_valid===16?(put_short(m,m.bi_buf),m.bi_buf=0,m.bi_valid=0):m.bi_valid>=8&&(m.pending_buf[m.pending++]=m.bi_buf&255,m.bi_buf>>=8,m.bi_valid-=8)},gen_bitlen=(m,b)=>{const u=b.dyn_tree,T=b.max_code,r=b.stat_desc.static_tree,c=b.stat_desc.has_stree,e=b.stat_desc.extra_bits,t=b.stat_desc.extra_base,i=b.stat_desc.max_length;let _,x,C,F,j,Z,ee=0;for(F=0;F<=MAX_BITS$1;F++)m.bl_count[F]=0;for(u[m.heap[m.heap_max]*2+1]=0,_=m.heap_max+1;_<HEAP_SIZE$1;_++)x=m.heap[_],F=u[u[x*2+1]*2+1]+1,F>i&&(F=i,ee++),u[x*2+1]=F,!(x>T)&&(m.bl_count[F]++,j=0,x>=t&&(j=e[x-t]),Z=u[x*2],m.opt_len+=Z*(F+j),c&&(m.static_len+=Z*(r[x*2+1]+j)));if(ee!==0){do{for(F=i-1;m.bl_count[F]===0;)F--;m.bl_count[F]--,m.bl_count[F+1]+=2,m.bl_count[i]--,ee-=2}while(ee>0);for(F=i;F!==0;F--)for(x=m.bl_count[F];x!==0;)C=m.heap[--_],!(C>T)&&(u[C*2+1]!==F&&(m.opt_len+=(F-u[C*2+1])*u[C*2],u[C*2+1]=F),x--)}},gen_codes=(m,b,u)=>{const T=new Array(MAX_BITS$1+1);let r=0,c,e;for(c=1;c<=MAX_BITS$1;c++)r=r+u[c-1]<<1,T[c]=r;for(e=0;e<=b;e++){let t=m[e*2+1];t!==0&&(m[e*2]=bi_reverse(T[t]++,t))}},tr_static_init=()=>{let m,b,u,T,r;const c=new Array(MAX_BITS$1+1);for(u=0,T=0;T<LENGTH_CODES$1-1;T++)for(base_length[T]=u,m=0;m<1<<extra_lbits[T];m++)_length_code[u++]=T;for(_length_code[u-1]=T,r=0,T=0;T<16;T++)for(base_dist[T]=r,m=0;m<1<<extra_dbits[T];m++)_dist_code[r++]=T;for(r>>=7;T<D_CODES$1;T++)for(base_dist[T]=r<<7,m=0;m<1<<extra_dbits[T]-7;m++)_dist_code[256+r++]=T;for(b=0;b<=MAX_BITS$1;b++)c[b]=0;for(m=0;m<=143;)static_ltree[m*2+1]=8,m++,c[8]++;for(;m<=255;)static_ltree[m*2+1]=9,m++,c[9]++;for(;m<=279;)static_ltree[m*2+1]=7,m++,c[7]++;for(;m<=287;)static_ltree[m*2+1]=8,m++,c[8]++;for(gen_codes(static_ltree,L_CODES$1+1,c),m=0;m<D_CODES$1;m++)static_dtree[m*2+1]=5,static_dtree[m*2]=bi_reverse(m,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=m=>{let b;for(b=0;b<L_CODES$1;b++)m.dyn_ltree[b*2]=0;for(b=0;b<D_CODES$1;b++)m.dyn_dtree[b*2]=0;for(b=0;b<BL_CODES$1;b++)m.bl_tree[b*2]=0;m.dyn_ltree[END_BLOCK*2]=1,m.opt_len=m.static_len=0,m.sym_next=m.matches=0},bi_windup=m=>{m.bi_valid>8?put_short(m,m.bi_buf):m.bi_valid>0&&(m.pending_buf[m.pending++]=m.bi_buf),m.bi_buf=0,m.bi_valid=0},smaller=(m,b,u,T)=>{const r=b*2,c=u*2;return m[r]<m[c]||m[r]===m[c]&&T[b]<=T[u]},pqdownheap=(m,b,u)=>{const T=m.heap[u];let r=u<<1;for(;r<=m.heap_len&&(r<m.heap_len&&smaller(b,m.heap[r+1],m.heap[r],m.depth)&&r++,!smaller(b,T,m.heap[r],m.depth));)m.heap[u]=m.heap[r],u=r,r<<=1;m.heap[u]=T},compress_block=(m,b,u)=>{let T,r,c=0,e,t;if(m.sym_next!==0)do T=m.pending_buf[m.sym_buf+c++]&255,T+=(m.pending_buf[m.sym_buf+c++]&255)<<8,r=m.pending_buf[m.sym_buf+c++],T===0?send_code(m,r,b):(e=_length_code[r],send_code(m,e+LITERALS$1+1,b),t=extra_lbits[e],t!==0&&(r-=base_length[e],send_bits(m,r,t)),T--,e=d_code(T),send_code(m,e,u),t=extra_dbits[e],t!==0&&(T-=base_dist[e],send_bits(m,T,t)));while(c<m.sym_next);send_code(m,END_BLOCK,b)},build_tree=(m,b)=>{const u=b.dyn_tree,T=b.stat_desc.static_tree,r=b.stat_desc.has_stree,c=b.stat_desc.elems;let e,t,i=-1,_;for(m.heap_len=0,m.heap_max=HEAP_SIZE$1,e=0;e<c;e++)u[e*2]!==0?(m.heap[++m.heap_len]=i=e,m.depth[e]=0):u[e*2+1]=0;for(;m.heap_len<2;)_=m.heap[++m.heap_len]=i<2?++i:0,u[_*2]=1,m.depth[_]=0,m.opt_len--,r&&(m.static_len-=T[_*2+1]);for(b.max_code=i,e=m.heap_len>>1;e>=1;e--)pqdownheap(m,u,e);_=c;do e=m.heap[1],m.heap[1]=m.heap[m.heap_len--],pqdownheap(m,u,1),t=m.heap[1],m.heap[--m.heap_max]=e,m.heap[--m.heap_max]=t,u[_*2]=u[e*2]+u[t*2],m.depth[_]=(m.depth[e]>=m.depth[t]?m.depth[e]:m.depth[t])+1,u[e*2+1]=u[t*2+1]=_,m.heap[1]=_++,pqdownheap(m,u,1);while(m.heap_len>=2);m.heap[--m.heap_max]=m.heap[1],gen_bitlen(m,b),gen_codes(u,i,m.bl_count)},scan_tree=(m,b,u)=>{let T,r=-1,c,e=b[1],t=0,i=7,_=4;for(e===0&&(i=138,_=3),b[(u+1)*2+1]=65535,T=0;T<=u;T++)c=e,e=b[(T+1)*2+1],!(++t<i&&c===e)&&(t<_?m.bl_tree[c*2]+=t:c!==0?(c!==r&&m.bl_tree[c*2]++,m.bl_tree[REP_3_6*2]++):t<=10?m.bl_tree[REPZ_3_10*2]++:m.bl_tree[REPZ_11_138*2]++,t=0,r=c,e===0?(i=138,_=3):c===e?(i=6,_=3):(i=7,_=4))},send_tree=(m,b,u)=>{let T,r=-1,c,e=b[1],t=0,i=7,_=4;for(e===0&&(i=138,_=3),T=0;T<=u;T++)if(c=e,e=b[(T+1)*2+1],!(++t<i&&c===e)){if(t<_)do send_code(m,c,m.bl_tree);while(--t!==0);else c!==0?(c!==r&&(send_code(m,c,m.bl_tree),t--),send_code(m,REP_3_6,m.bl_tree),send_bits(m,t-3,2)):t<=10?(send_code(m,REPZ_3_10,m.bl_tree),send_bits(m,t-3,3)):(send_code(m,REPZ_11_138,m.bl_tree),send_bits(m,t-11,7));t=0,r=c,e===0?(i=138,_=3):c===e?(i=6,_=3):(i=7,_=4)}},build_bl_tree=m=>{let b;for(scan_tree(m,m.dyn_ltree,m.l_desc.max_code),scan_tree(m,m.dyn_dtree,m.d_desc.max_code),build_tree(m,m.bl_desc),b=BL_CODES$1-1;b>=3&&m.bl_tree[bl_order[b]*2+1]===0;b--);return m.opt_len+=3*(b+1)+5+5+4,b},send_all_trees=(m,b,u,T)=>{let r;for(send_bits(m,b-257,5),send_bits(m,u-1,5),send_bits(m,T-4,4),r=0;r<T;r++)send_bits(m,m.bl_tree[bl_order[r]*2+1],3);send_tree(m,m.dyn_ltree,b-1),send_tree(m,m.dyn_dtree,u-1)},detect_data_type=m=>{let b=4093624447,u;for(u=0;u<=31;u++,b>>>=1)if(b&1&&m.dyn_ltree[u*2]!==0)return Z_BINARY;if(m.dyn_ltree[18]!==0||m.dyn_ltree[20]!==0||m.dyn_ltree[26]!==0)return Z_TEXT;for(u=32;u<LITERALS$1;u++)if(m.dyn_ltree[u*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=m=>{static_init_done||(tr_static_init(),static_init_done=!0),m.l_desc=new TreeDesc(m.dyn_ltree,static_l_desc),m.d_desc=new TreeDesc(m.dyn_dtree,static_d_desc),m.bl_desc=new TreeDesc(m.bl_tree,static_bl_desc),m.bi_buf=0,m.bi_valid=0,init_block(m)},_tr_stored_block$1=(m,b,u,T)=>{send_bits(m,(STORED_BLOCK<<1)+(T?1:0),3),bi_windup(m),put_short(m,u),put_short(m,~u),u&&m.pending_buf.set(m.window.subarray(b,b+u),m.pending),m.pending+=u},_tr_align$1=m=>{send_bits(m,STATIC_TREES<<1,3),send_code(m,END_BLOCK,static_ltree),bi_flush(m)},_tr_flush_block$1=(m,b,u,T)=>{let r,c,e=0;m.level>0?(m.strm.data_type===Z_UNKNOWN$1&&(m.strm.data_type=detect_data_type(m)),build_tree(m,m.l_desc),build_tree(m,m.d_desc),e=build_bl_tree(m),r=m.opt_len+3+7>>>3,c=m.static_len+3+7>>>3,c<=r&&(r=c)):r=c=u+5,u+4<=r&&b!==-1?_tr_stored_block$1(m,b,u,T):m.strategy===Z_FIXED$1||c===r?(send_bits(m,(STATIC_TREES<<1)+(T?1:0),3),compress_block(m,static_ltree,static_dtree)):(send_bits(m,(DYN_TREES<<1)+(T?1:0),3),send_all_trees(m,m.l_desc.max_code+1,m.d_desc.max_code+1,e+1),compress_block(m,m.dyn_ltree,m.dyn_dtree)),init_block(m),T&&bi_windup(m)},_tr_tally$1=(m,b,u)=>(m.pending_buf[m.sym_buf+m.sym_next++]=b,m.pending_buf[m.sym_buf+m.sym_next++]=b>>8,m.pending_buf[m.sym_buf+m.sym_next++]=u,b===0?m.dyn_ltree[u*2]++:(m.matches++,b--,m.dyn_ltree[(_length_code[u]+LITERALS$1+1)*2]++,m.dyn_dtree[d_code(b)*2]++),m.sym_next===m.sym_end);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(m,b,u,T)=>{let r=m&65535|0,c=m>>>16&65535|0,e=0;for(;u!==0;){e=u>2e3?2e3:u,u-=e;do r=r+b[T++]|0,c=c+r|0;while(--e);r%=65521,c%=65521}return r|c<<16|0};var adler32_1=adler32;const makeTable=()=>{let m,b=[];for(var u=0;u<256;u++){m=u;for(var T=0;T<8;T++)m=m&1?3988292384^m>>>1:m>>>1;b[u]=m}return b},crcTable=new Uint32Array(makeTable()),crc32=(m,b,u,T)=>{const r=crcTable,c=T+u;m^=-1;for(let e=T;e<c;e++)m=m>>>8^r[(m^b[e])&255];return m^-1};var crc32_1=crc32,messages={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"},constants$2={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};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,GZIP_STATE=57,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(m,b)=>(m.msg=messages[b],b),rank=m=>m*2-(m>4?9:0),zero=m=>{let b=m.length;for(;--b>=0;)m[b]=0},slide_hash=m=>{let b,u,T,r=m.w_size;b=m.hash_size,T=b;do u=m.head[--T],m.head[T]=u>=r?u-r:0;while(--b);b=r,T=b;do u=m.prev[--T],m.prev[T]=u>=r?u-r:0;while(--b)};let HASH_ZLIB=(m,b,u)=>(b<<m.hash_shift^u)&m.hash_mask,HASH=HASH_ZLIB;const flush_pending=m=>{const b=m.state;let u=b.pending;u>m.avail_out&&(u=m.avail_out),u!==0&&(m.output.set(b.pending_buf.subarray(b.pending_out,b.pending_out+u),m.next_out),m.next_out+=u,b.pending_out+=u,m.total_out+=u,m.avail_out-=u,b.pending-=u,b.pending===0&&(b.pending_out=0))},flush_block_only=(m,b)=>{_tr_flush_block(m,m.block_start>=0?m.block_start:-1,m.strstart-m.block_start,b),m.block_start=m.strstart,flush_pending(m.strm)},put_byte=(m,b)=>{m.pending_buf[m.pending++]=b},putShortMSB=(m,b)=>{m.pending_buf[m.pending++]=b>>>8&255,m.pending_buf[m.pending++]=b&255},read_buf=(m,b,u,T)=>{let r=m.avail_in;return r>T&&(r=T),r===0?0:(m.avail_in-=r,b.set(m.input.subarray(m.next_in,m.next_in+r),u),m.state.wrap===1?m.adler=adler32_1(m.adler,b,r,u):m.state.wrap===2&&(m.adler=crc32_1(m.adler,b,r,u)),m.next_in+=r,m.total_in+=r,r)},longest_match=(m,b)=>{let u=m.max_chain_length,T=m.strstart,r,c,e=m.prev_length,t=m.nice_match;const i=m.strstart>m.w_size-MIN_LOOKAHEAD?m.strstart-(m.w_size-MIN_LOOKAHEAD):0,_=m.window,x=m.w_mask,C=m.prev,F=m.strstart+MAX_MATCH;let j=_[T+e-1],Z=_[T+e];m.prev_length>=m.good_match&&(u>>=2),t>m.lookahead&&(t=m.lookahead);do if(r=b,!(_[r+e]!==Z||_[r+e-1]!==j||_[r]!==_[T]||_[++r]!==_[T+1])){T+=2,r++;do;while(_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&_[++T]===_[++r]&&T<F);if(c=MAX_MATCH-(F-T),T=F-MAX_MATCH,c>e){if(m.match_start=b,e=c,c>=t)break;j=_[T+e-1],Z=_[T+e]}}while((b=C[b&x])>i&&--u!==0);return e<=m.lookahead?e:m.lookahead},fill_window=m=>{const b=m.w_size;let u,T,r;do{if(T=m.window_size-m.lookahead-m.strstart,m.strstart>=b+(b-MIN_LOOKAHEAD)&&(m.window.set(m.window.subarray(b,b+b-T),0),m.match_start-=b,m.strstart-=b,m.block_start-=b,m.insert>m.strstart&&(m.insert=m.strstart),slide_hash(m),T+=b),m.strm.avail_in===0)break;if(u=read_buf(m.strm,m.window,m.strstart+m.lookahead,T),m.lookahead+=u,m.lookahead+m.insert>=MIN_MATCH)for(r=m.strstart-m.insert,m.ins_h=m.window[r],m.ins_h=HASH(m,m.ins_h,m.window[r+1]);m.insert&&(m.ins_h=HASH(m,m.ins_h,m.window[r+MIN_MATCH-1]),m.prev[r&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=r,r++,m.insert--,!(m.lookahead+m.insert<MIN_MATCH)););}while(m.lookahead<MIN_LOOKAHEAD&&m.strm.avail_in!==0)},deflate_stored=(m,b)=>{let u=m.pending_buf_size-5>m.w_size?m.w_size:m.pending_buf_size-5,T,r,c,e=0,t=m.strm.avail_in;do{if(T=65535,c=m.bi_valid+42>>3,m.strm.avail_out<c||(c=m.strm.avail_out-c,r=m.strstart-m.block_start,T>r+m.strm.avail_in&&(T=r+m.strm.avail_in),T>c&&(T=c),T<u&&(T===0&&b!==Z_FINISH$3||b===Z_NO_FLUSH$2||T!==r+m.strm.avail_in)))break;e=b===Z_FINISH$3&&T===r+m.strm.avail_in?1:0,_tr_stored_block(m,0,0,e),m.pending_buf[m.pending-4]=T,m.pending_buf[m.pending-3]=T>>8,m.pending_buf[m.pending-2]=~T,m.pending_buf[m.pending-1]=~T>>8,flush_pending(m.strm),r&&(r>T&&(r=T),m.strm.output.set(m.window.subarray(m.block_start,m.block_start+r),m.strm.next_out),m.strm.next_out+=r,m.strm.avail_out-=r,m.strm.total_out+=r,m.block_start+=r,T-=r),T&&(read_buf(m.strm,m.strm.output,m.strm.next_out,T),m.strm.next_out+=T,m.strm.avail_out-=T,m.strm.total_out+=T)}while(e===0);return t-=m.strm.avail_in,t&&(t>=m.w_size?(m.matches=2,m.window.set(m.strm.input.subarray(m.strm.next_in-m.w_size,m.strm.next_in),0),m.strstart=m.w_size,m.insert=m.strstart):(m.window_size-m.strstart<=t&&(m.strstart-=m.w_size,m.window.set(m.window.subarray(m.w_size,m.w_size+m.strstart),0),m.matches<2&&m.matches++,m.insert>m.strstart&&(m.insert=m.strstart)),m.window.set(m.strm.input.subarray(m.strm.next_in-t,m.strm.next_in),m.strstart),m.strstart+=t,m.insert+=t>m.w_size-m.insert?m.w_size-m.insert:t),m.block_start=m.strstart),m.high_water<m.strstart&&(m.high_water=m.strstart),e?BS_FINISH_DONE:b!==Z_NO_FLUSH$2&&b!==Z_FINISH$3&&m.strm.avail_in===0&&m.strstart===m.block_start?BS_BLOCK_DONE:(c=m.window_size-m.strstart,m.strm.avail_in>c&&m.block_start>=m.w_size&&(m.block_start-=m.w_size,m.strstart-=m.w_size,m.window.set(m.window.subarray(m.w_size,m.w_size+m.strstart),0),m.matches<2&&m.matches++,c+=m.w_size,m.insert>m.strstart&&(m.insert=m.strstart)),c>m.strm.avail_in&&(c=m.strm.avail_in),c&&(read_buf(m.strm,m.window,m.strstart,c),m.strstart+=c,m.insert+=c>m.w_size-m.insert?m.w_size-m.insert:c),m.high_water<m.strstart&&(m.high_water=m.strstart),c=m.bi_valid+42>>3,c=m.pending_buf_size-c>65535?65535:m.pending_buf_size-c,u=c>m.w_size?m.w_size:c,r=m.strstart-m.block_start,(r>=u||(r||b===Z_FINISH$3)&&b!==Z_NO_FLUSH$2&&m.strm.avail_in===0&&r<=c)&&(T=r>c?c:r,e=b===Z_FINISH$3&&m.strm.avail_in===0&&T===r?1:0,_tr_stored_block(m,m.block_start,T,e),m.block_start+=T,flush_pending(m.strm)),e?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(m,b)=>{let u,T;for(;;){if(m.lookahead<MIN_LOOKAHEAD){if(fill_window(m),m.lookahead<MIN_LOOKAHEAD&&b===Z_NO_FLUSH$2)return BS_NEED_MORE;if(m.lookahead===0)break}if(u=0,m.lookahead>=MIN_MATCH&&(m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),u!==0&&m.strstart-u<=m.w_size-MIN_LOOKAHEAD&&(m.match_length=longest_match(m,u)),m.match_length>=MIN_MATCH)if(T=_tr_tally(m,m.strstart-m.match_start,m.match_length-MIN_MATCH),m.lookahead-=m.match_length,m.match_length<=m.max_lazy_match&&m.lookahead>=MIN_MATCH){m.match_length--;do m.strstart++,m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart;while(--m.match_length!==0);m.strstart++}else m.strstart+=m.match_length,m.match_length=0,m.ins_h=m.window[m.strstart],m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+1]);else T=_tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++;if(T&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}return m.insert=m.strstart<MIN_MATCH-1?m.strstart:MIN_MATCH-1,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(m,b)=>{let u,T,r;for(;;){if(m.lookahead<MIN_LOOKAHEAD){if(fill_window(m),m.lookahead<MIN_LOOKAHEAD&&b===Z_NO_FLUSH$2)return BS_NEED_MORE;if(m.lookahead===0)break}if(u=0,m.lookahead>=MIN_MATCH&&(m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart),m.prev_length=m.match_length,m.prev_match=m.match_start,m.match_length=MIN_MATCH-1,u!==0&&m.prev_length<m.max_lazy_match&&m.strstart-u<=m.w_size-MIN_LOOKAHEAD&&(m.match_length=longest_match(m,u),m.match_length<=5&&(m.strategy===Z_FILTERED||m.match_length===MIN_MATCH&&m.strstart-m.match_start>4096)&&(m.match_length=MIN_MATCH-1)),m.prev_length>=MIN_MATCH&&m.match_length<=m.prev_length){r=m.strstart+m.lookahead-MIN_MATCH,T=_tr_tally(m,m.strstart-1-m.prev_match,m.prev_length-MIN_MATCH),m.lookahead-=m.prev_length-1,m.prev_length-=2;do++m.strstart<=r&&(m.ins_h=HASH(m,m.ins_h,m.window[m.strstart+MIN_MATCH-1]),u=m.prev[m.strstart&m.w_mask]=m.head[m.ins_h],m.head[m.ins_h]=m.strstart);while(--m.prev_length!==0);if(m.match_available=0,m.match_length=MIN_MATCH-1,m.strstart++,T&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}else if(m.match_available){if(T=_tr_tally(m,0,m.window[m.strstart-1]),T&&flush_block_only(m,!1),m.strstart++,m.lookahead--,m.strm.avail_out===0)return BS_NEED_MORE}else m.match_available=1,m.strstart++,m.lookahead--}return m.match_available&&(T=_tr_tally(m,0,m.window[m.strstart-1]),m.match_available=0),m.insert=m.strstart<MIN_MATCH-1?m.strstart:MIN_MATCH-1,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(m,b)=>{let u,T,r,c;const e=m.window;for(;;){if(m.lookahead<=MAX_MATCH){if(fill_window(m),m.lookahead<=MAX_MATCH&&b===Z_NO_FLUSH$2)return BS_NEED_MORE;if(m.lookahead===0)break}if(m.match_length=0,m.lookahead>=MIN_MATCH&&m.strstart>0&&(r=m.strstart-1,T=e[r],T===e[++r]&&T===e[++r]&&T===e[++r])){c=m.strstart+MAX_MATCH;do;while(T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&T===e[++r]&&r<c);m.match_length=MAX_MATCH-(c-r),m.match_length>m.lookahead&&(m.match_length=m.lookahead)}if(m.match_length>=MIN_MATCH?(u=_tr_tally(m,1,m.match_length-MIN_MATCH),m.lookahead-=m.match_length,m.strstart+=m.match_length,m.match_length=0):(u=_tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++),u&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}return m.insert=0,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(m,b)=>{let u;for(;;){if(m.lookahead===0&&(fill_window(m),m.lookahead===0)){if(b===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(m.match_length=0,u=_tr_tally(m,0,m.window[m.strstart]),m.lookahead--,m.strstart++,u&&(flush_block_only(m,!1),m.strm.avail_out===0))return BS_NEED_MORE}return m.insert=0,b===Z_FINISH$3?(flush_block_only(m,!0),m.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):m.sym_next&&(flush_block_only(m,!1),m.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(m,b,u,T,r){this.good_length=m,this.max_lazy=b,this.nice_length=u,this.max_chain=T,this.func=r}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=m=>{m.window_size=2*m.w_size,zero(m.head),m.max_lazy_match=configuration_table[m.level].max_lazy,m.good_match=configuration_table[m.level].good_length,m.nice_match=configuration_table[m.level].nice_length,m.max_chain_length=configuration_table[m.level].max_chain,m.strstart=0,m.block_start=0,m.lookahead=0,m.insert=0,m.match_length=m.prev_length=MIN_MATCH-1,m.match_available=0,m.ins_h=0};function DeflateState(){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=Z_DEFLATED$2,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(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(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 deflateStateCheck=m=>{if(!m)return 1;const b=m.state;return!b||b.strm!==m||b.status!==INIT_STATE&&b.status!==GZIP_STATE&&b.status!==EXTRA_STATE&&b.status!==NAME_STATE&&b.status!==COMMENT_STATE&&b.status!==HCRC_STATE&&b.status!==BUSY_STATE&&b.status!==FINISH_STATE?1:0},deflateResetKeep=m=>{if(deflateStateCheck(m))return err(m,Z_STREAM_ERROR$2);m.total_in=m.total_out=0,m.data_type=Z_UNKNOWN;const b=m.state;return b.pending=0,b.pending_out=0,b.wrap<0&&(b.wrap=-b.wrap),b.status=b.wrap===2?GZIP_STATE:b.wrap?INIT_STATE:BUSY_STATE,m.adler=b.wrap===2?0:1,b.last_flush=-2,_tr_init(b),Z_OK$3},deflateReset=m=>{const b=deflateResetKeep(m);return b===Z_OK$3&&lm_init(m.state),b},deflateSetHeader=(m,b)=>deflateStateCheck(m)||m.state.wrap!==2?Z_STREAM_ERROR$2:(m.state.gzhead=b,Z_OK$3),deflateInit2=(m,b,u,T,r,c)=>{if(!m)return Z_STREAM_ERROR$2;let e=1;if(b===Z_DEFAULT_COMPRESSION$1&&(b=6),T<0?(e=0,T=-T):T>15&&(e=2,T-=16),r<1||r>MAX_MEM_LEVEL||u!==Z_DEFLATED$2||T<8||T>15||b<0||b>9||c<0||c>Z_FIXED||T===8&&e!==1)return err(m,Z_STREAM_ERROR$2);T===8&&(T=9);const t=new DeflateState;return m.state=t,t.strm=m,t.status=INIT_STATE,t.wrap=e,t.gzhead=null,t.w_bits=T,t.w_size=1<<t.w_bits,t.w_mask=t.w_size-1,t.hash_bits=r+7,t.hash_size=1<<t.hash_bits,t.hash_mask=t.hash_size-1,t.hash_shift=~~((t.hash_bits+MIN_MATCH-1)/MIN_MATCH),t.window=new Uint8Array(t.w_size*2),t.head=new Uint16Array(t.hash_size),t.prev=new Uint16Array(t.w_size),t.lit_bufsize=1<<r+6,t.pending_buf_size=t.lit_bufsize*4,t.pending_buf=new Uint8Array(t.pending_buf_size),t.sym_buf=t.lit_bufsize,t.sym_end=(t.lit_bufsize-1)*3,t.level=b,t.strategy=c,t.method=u,deflateReset(m)},deflateInit=(m,b)=>deflateInit2(m,b,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(m,b)=>{if(deflateStateCheck(m)||b>Z_BLOCK$1||b<0)return m?err(m,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const u=m.state;if(!m.output||m.avail_in!==0&&!m.input||u.status===FINISH_STATE&&b!==Z_FINISH$3)return err(m,m.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const T=u.last_flush;if(u.last_flush=b,u.pending!==0){if(flush_pending(m),m.avail_out===0)return u.last_flush=-1,Z_OK$3}else if(m.avail_in===0&&rank(b)<=rank(T)&&b!==Z_FINISH$3)return err(m,Z_BUF_ERROR$1);if(u.status===FINISH_STATE&&m.avail_in!==0)return err(m,Z_BUF_ERROR$1);if(u.status===INIT_STATE&&u.wrap===0&&(u.status=BUSY_STATE),u.status===INIT_STATE){let r=Z_DEFLATED$2+(u.w_bits-8<<4)<<8,c=-1;if(u.strategy>=Z_HUFFMAN_ONLY||u.level<2?c=0:u.level<6?c=1:u.level===6?c=2:c=3,r|=c<<6,u.strstart!==0&&(r|=PRESET_DICT),r+=31-r%31,putShortMSB(u,r),u.strstart!==0&&(putShortMSB(u,m.adler>>>16),putShortMSB(u,m.adler&65535)),m.adler=1,u.status=BUSY_STATE,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===GZIP_STATE){if(m.adler=0,put_byte(u,31),put_byte(u,139),put_byte(u,8),u.gzhead)put_byte(u,(u.gzhead.text?1:0)+(u.gzhead.hcrc?2:0)+(u.gzhead.extra?4:0)+(u.gzhead.name?8:0)+(u.gzhead.comment?16:0)),put_byte(u,u.gzhead.time&255),put_byte(u,u.gzhead.time>>8&255),put_byte(u,u.gzhead.time>>16&255),put_byte(u,u.gzhead.time>>24&255),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,u.gzhead.os&255),u.gzhead.extra&&u.gzhead.extra.length&&(put_byte(u,u.gzhead.extra.length&255),put_byte(u,u.gzhead.extra.length>>8&255)),u.gzhead.hcrc&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending,0)),u.gzindex=0,u.status=EXTRA_STATE;else if(put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,0),put_byte(u,u.level===9?2:u.strategy>=Z_HUFFMAN_ONLY||u.level<2?4:0),put_byte(u,OS_CODE),u.status=BUSY_STATE,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(u.status===EXTRA_STATE){if(u.gzhead.extra){let r=u.pending,c=(u.gzhead.extra.length&65535)-u.gzindex;for(;u.pending+c>u.pending_buf_size;){let t=u.pending_buf_size-u.pending;if(u.pending_buf.set(u.gzhead.extra.subarray(u.gzindex,u.gzindex+t),u.pending),u.pending=u.pending_buf_size,u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),u.gzindex+=t,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0,c-=t}let e=new Uint8Array(u.gzhead.extra);u.pending_buf.set(e.subarray(u.gzindex,u.gzindex+c),u.pending),u.pending+=c,u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),u.gzindex=0}u.status=NAME_STATE}if(u.status===NAME_STATE){if(u.gzhead.name){let r=u.pending,c;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0}u.gzindex<u.gzhead.name.length?c=u.gzhead.name.charCodeAt(u.gzindex++)&255:c=0,put_byte(u,c)}while(c!==0);u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),u.gzindex=0}u.status=COMMENT_STATE}if(u.status===COMMENT_STATE){if(u.gzhead.comment){let r=u.pending,c;do{if(u.pending===u.pending_buf_size){if(u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r)),flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3;r=0}u.gzindex<u.gzhead.comment.length?c=u.gzhead.comment.charCodeAt(u.gzindex++)&255:c=0,put_byte(u,c)}while(c!==0);u.gzhead.hcrc&&u.pending>r&&(m.adler=crc32_1(m.adler,u.pending_buf,u.pending-r,r))}u.status=HCRC_STATE}if(u.status===HCRC_STATE){if(u.gzhead.hcrc){if(u.pending+2>u.pending_buf_size&&(flush_pending(m),u.pending!==0))return u.last_flush=-1,Z_OK$3;put_byte(u,m.adler&255),put_byte(u,m.adler>>8&255),m.adler=0}if(u.status=BUSY_STATE,flush_pending(m),u.pending!==0)return u.last_flush=-1,Z_OK$3}if(m.avail_in!==0||u.lookahead!==0||b!==Z_NO_FLUSH$2&&u.status!==FINISH_STATE){let r=u.level===0?deflate_stored(u,b):u.strategy===Z_HUFFMAN_ONLY?deflate_huff(u,b):u.strategy===Z_RLE?deflate_rle(u,b):configuration_table[u.level].func(u,b);if((r===BS_FINISH_STARTED||r===BS_FINISH_DONE)&&(u.status=FINISH_STATE),r===BS_NEED_MORE||r===BS_FINISH_STARTED)return m.avail_out===0&&(u.last_flush=-1),Z_OK$3;if(r===BS_BLOCK_DONE&&(b===Z_PARTIAL_FLUSH?_tr_align(u):b!==Z_BLOCK$1&&(_tr_stored_block(u,0,0,!1),b===Z_FULL_FLUSH$1&&(zero(u.head),u.lookahead===0&&(u.strstart=0,u.block_start=0,u.insert=0))),flush_pending(m),m.avail_out===0))return u.last_flush=-1,Z_OK$3}return b!==Z_FINISH$3?Z_OK$3:u.wrap<=0?Z_STREAM_END$3:(u.wrap===2?(put_byte(u,m.adler&255),put_byte(u,m.adler>>8&255),put_byte(u,m.adler>>16&255),put_byte(u,m.adler>>24&255),put_byte(u,m.total_in&255),put_byte(u,m.total_in>>8&255),put_byte(u,m.total_in>>16&255),put_byte(u,m.total_in>>24&255)):(putShortMSB(u,m.adler>>>16),putShortMSB(u,m.adler&65535)),flush_pending(m),u.wrap>0&&(u.wrap=-u.wrap),u.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=m=>{if(deflateStateCheck(m))return Z_STREAM_ERROR$2;const b=m.state.status;return m.state=null,b===BUSY_STATE?err(m,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(m,b)=>{let u=b.length;if(deflateStateCheck(m))return Z_STREAM_ERROR$2;const T=m.state,r=T.wrap;if(r===2||r===1&&T.status!==INIT_STATE||T.lookahead)return Z_STREAM_ERROR$2;if(r===1&&(m.adler=adler32_1(m.adler,b,u,0)),T.wrap=0,u>=T.w_size){r===0&&(zero(T.head),T.strstart=0,T.block_start=0,T.insert=0);let i=new Uint8Array(T.w_size);i.set(b.subarray(u-T.w_size,u),0),b=i,u=T.w_size}const c=m.avail_in,e=m.next_in,t=m.input;for(m.avail_in=u,m.next_in=0,m.input=b,fill_window(T);T.lookahead>=MIN_MATCH;){let i=T.strstart,_=T.lookahead-(MIN_MATCH-1);do T.ins_h=HASH(T,T.ins_h,T.window[i+MIN_MATCH-1]),T.prev[i&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=i,i++;while(--_);T.strstart=i,T.lookahead=MIN_MATCH-1,fill_window(T)}return T.strstart+=T.lookahead,T.block_start=T.strstart,T.insert=T.lookahead,T.lookahead=0,T.match_length=T.prev_length=MIN_MATCH-1,T.match_available=0,m.next_in=e,m.input=t,m.avail_in=c,T.wrap=r,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(m,b)=>Object.prototype.hasOwnProperty.call(m,b);var assign=function(m){const b=Array.prototype.slice.call(arguments,1);for(;b.length;){const u=b.shift();if(u){if(typeof u!="object")throw new TypeError(u+"must be non-object");for(const T in u)_has(u,T)&&(m[T]=u[T])}}return m},flattenChunks=m=>{let b=0;for(let T=0,r=m.length;T<r;T++)b+=m[T].length;const u=new Uint8Array(b);for(let T=0,r=0,c=m.length;T<c;T++){let e=m[T];u.set(e,r),r+=e.length}return u},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(m){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let m=0;m<256;m++)_utf8len[m]=m>=252?6:m>=248?5:m>=240?4:m>=224?3:m>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=m=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(m);let b,u,T,r,c,e=m.length,t=0;for(r=0;r<e;r++)u=m.charCodeAt(r),(u&64512)===55296&&r+1<e&&(T=m.charCodeAt(r+1),(T&64512)===56320&&(u=65536+(u-55296<<10)+(T-56320),r++)),t+=u<128?1:u<2048?2:u<65536?3:4;for(b=new Uint8Array(t),c=0,r=0;c<t;r++)u=m.charCodeAt(r),(u&64512)===55296&&r+1<e&&(T=m.charCodeAt(r+1),(T&64512)===56320&&(u=65536+(u-55296<<10)+(T-56320),r++)),u<128?b[c++]=u:u<2048?(b[c++]=192|u>>>6,b[c++]=128|u&63):u<65536?(b[c++]=224|u>>>12,b[c++]=128|u>>>6&63,b[c++]=128|u&63):(b[c++]=240|u>>>18,b[c++]=128|u>>>12&63,b[c++]=128|u>>>6&63,b[c++]=128|u&63);return b};const buf2binstring=(m,b)=>{if(b<65534&&m.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,m.length===b?m:m.subarray(0,b));let u="";for(let T=0;T<b;T++)u+=String.fromCharCode(m[T]);return u};var buf2string=(m,b)=>{const u=b||m.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(m.subarray(0,b));let T,r;const c=new Array(u*2);for(r=0,T=0;T<u;){let e=m[T++];if(e<128){c[r++]=e;continue}let t=_utf8len[e];if(t>4){c[r++]=65533,T+=t-1;continue}for(e&=t===2?31:t===3?15:7;t>1&&T<u;)e=e<<6|m[T++]&63,t--;if(t>1){c[r++]=65533;continue}e<65536?c[r++]=e:(e-=65536,c[r++]=55296|e>>10&1023,c[r++]=56320|e&1023)}return buf2binstring(c,r)},utf8border=(m,b)=>{b=b||m.length,b>m.length&&(b=m.length);let u=b-1;for(;u>=0&&(m[u]&192)===128;)u--;return u<0||u===0?b:u+_utf8len[m[u]]>b?u:b},strings={string2buf,buf2string,utf8border};function ZStream(){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}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(m){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},m||{});let b=this.options;b.raw&&b.windowBits>0?b.windowBits=-b.windowBits:b.gzip&&b.windowBits>0&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=deflate_1$2.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(u!==Z_OK$2)throw new Error(messages[u]);if(b.header&&deflate_1$2.deflateSetHeader(this.strm,b.header),b.dictionary){let T;if(typeof b.dictionary=="string"?T=strings.string2buf(b.dictionary):toString$1.call(b.dictionary)==="[object ArrayBuffer]"?T=new Uint8Array(b.dictionary):T=b.dictionary,u=deflate_1$2.deflateSetDictionary(this.strm,T),u!==Z_OK$2)throw new Error(messages[u]);this._dict_set=!0}}Deflate$1.prototype.push=function(m,b){const u=this.strm,T=this.options.chunkSize;let r,c;if(this.ended)return!1;for(b===~~b?c=b:c=b===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof m=="string"?u.input=strings.string2buf(m):toString$1.call(m)==="[object ArrayBuffer]"?u.input=new Uint8Array(m):u.input=m,u.next_in=0,u.avail_in=u.input.length;;){if(u.avail_out===0&&(u.output=new Uint8Array(T),u.next_out=0,u.avail_out=T),(c===Z_SYNC_FLUSH||c===Z_FULL_FLUSH)&&u.avail_out<=6){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(r=deflate_1$2.deflate(u,c),r===Z_STREAM_END$2)return u.next_out>0&&this.onData(u.output.subarray(0,u.next_out)),r=deflate_1$2.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Z_OK$2;if(u.avail_out===0){this.onData(u.output);continue}if(c>0&&u.next_out>0){this.onData(u.output.subarray(0,u.next_out)),u.avail_out=0;continue}if(u.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(m){this.chunks.push(m)},Deflate$1.prototype.onEnd=function(m){m===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg};function deflate$1(m,b){const u=new Deflate$1(b);if(u.push(m,!0),u.err)throw u.msg||messages[u.err];return u.result}function deflateRaw$1(m,b){return b=b||{},b.raw=!0,deflate$1(m,b)}function gzip$1(m,b){return b=b||{},b.gzip=!0,deflate$1(m,b)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function(b,u){let T,r,c,e,t,i,_,x,C,F,j,Z,ee,re,K,se,fe,G,ne,ae,oe,le,pe,te;const ue=b.state;T=b.next_in,pe=b.input,r=T+(b.avail_in-5),c=b.next_out,te=b.output,e=c-(u-b.avail_out),t=c+(b.avail_out-257),i=ue.dmax,_=ue.wsize,x=ue.whave,C=ue.wnext,F=ue.window,j=ue.hold,Z=ue.bits,ee=ue.lencode,re=ue.distcode,K=(1<<ue.lenbits)-1,se=(1<<ue.distbits)-1;e:do{Z<15&&(j+=pe[T++]<<Z,Z+=8,j+=pe[T++]<<Z,Z+=8),fe=ee[j&K];t:for(;;){if(G=fe>>>24,j>>>=G,Z-=G,G=fe>>>16&255,G===0)te[c++]=fe&65535;else if(G&16){ne=fe&65535,G&=15,G&&(Z<G&&(j+=pe[T++]<<Z,Z+=8),ne+=j&(1<<G)-1,j>>>=G,Z-=G),Z<15&&(j+=pe[T++]<<Z,Z+=8,j+=pe[T++]<<Z,Z+=8),fe=re[j&se];i:for(;;){if(G=fe>>>24,j>>>=G,Z-=G,G=fe>>>16&255,G&16){if(ae=fe&65535,G&=15,Z<G&&(j+=pe[T++]<<Z,Z+=8,Z<G&&(j+=pe[T++]<<Z,Z+=8)),ae+=j&(1<<G)-1,ae>i){b.msg="invalid distance too far back",ue.mode=BAD$1;break e}if(j>>>=G,Z-=G,G=c-e,ae>G){if(G=ae-G,G>x&&ue.sane){b.msg="invalid distance too far back",ue.mode=BAD$1;break e}if(oe=0,le=F,C===0){if(oe+=_-G,G<ne){ne-=G;do te[c++]=F[oe++];while(--G);oe=c-ae,le=te}}else if(C<G){if(oe+=_+C-G,G-=C,G<ne){ne-=G;do te[c++]=F[oe++];while(--G);if(oe=0,C<ne){G=C,ne-=G;do te[c++]=F[oe++];while(--G);oe=c-ae,le=te}}}else if(oe+=C-G,G<ne){ne-=G;do te[c++]=F[oe++];while(--G);oe=c-ae,le=te}for(;ne>2;)te[c++]=le[oe++],te[c++]=le[oe++],te[c++]=le[oe++],ne-=3;ne&&(te[c++]=le[oe++],ne>1&&(te[c++]=le[oe++]))}else{oe=c-ae;do te[c++]=te[oe++],te[c++]=te[oe++],te[c++]=te[oe++],ne-=3;while(ne>2);ne&&(te[c++]=te[oe++],ne>1&&(te[c++]=te[oe++]))}}else if((G&64)===0){fe=re[(fe&65535)+(j&(1<<G)-1)];continue i}else{b.msg="invalid distance code",ue.mode=BAD$1;break e}break}}else if((G&64)===0){fe=ee[(fe&65535)+(j&(1<<G)-1)];continue t}else if(G&32){ue.mode=TYPE$1;break e}else{b.msg="invalid literal/length code",ue.mode=BAD$1;break e}break}}while(T<r&&c<t);ne=Z>>3,T-=ne,Z-=ne<<3,j&=(1<<Z)-1,b.next_in=T,b.next_out=c,b.avail_in=T<r?5+(r-T):5-(T-r),b.avail_out=c<t?257+(t-c):257-(c-t),ue.hold=j,ue.bits=Z};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=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]),lext=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]),dbase=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]),dext=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]),inflate_table=(m,b,u,T,r,c,e,t)=>{const i=t.bits;let _=0,x=0,C=0,F=0,j=0,Z=0,ee=0,re=0,K=0,se=0,fe,G,ne,ae,oe,le=null,pe;const te=new Uint16Array(MAXBITS+1),ue=new Uint16Array(MAXBITS+1);let he=null,me,be,Se;for(_=0;_<=MAXBITS;_++)te[_]=0;for(x=0;x<T;x++)te[b[u+x]]++;for(j=i,F=MAXBITS;F>=1&&te[F]===0;F--);if(j>F&&(j=F),F===0)return r[c++]=1<<24|64<<16|0,r[c++]=1<<24|64<<16|0,t.bits=1,0;for(C=1;C<F&&te[C]===0;C++);for(j<C&&(j=C),re=1,_=1;_<=MAXBITS;_++)if(re<<=1,re-=te[_],re<0)return-1;if(re>0&&(m===CODES$1||F!==1))return-1;for(ue[1]=0,_=1;_<MAXBITS;_++)ue[_+1]=ue[_]+te[_];for(x=0;x<T;x++)b[u+x]!==0&&(e[ue[b[u+x]]++]=x);if(m===CODES$1?(le=he=e,pe=20):m===LENS$1?(le=lbase,he=lext,pe=257):(le=dbase,he=dext,pe=0),se=0,x=0,_=C,oe=c,Z=j,ee=0,ne=-1,K=1<<j,ae=K-1,m===LENS$1&&K>ENOUGH_LENS$1||m===DISTS$1&&K>ENOUGH_DISTS$1)return 1;for(;;){me=_-ee,e[x]+1<pe?(be=0,Se=e[x]):e[x]>=pe?(be=he[e[x]-pe],Se=le[e[x]-pe]):(be=96,Se=0),fe=1<<_-ee,G=1<<Z,C=G;do G-=fe,r[oe+(se>>ee)+G]=me<<24|be<<16|Se|0;while(G!==0);for(fe=1<<_-1;se&fe;)fe>>=1;if(fe!==0?(se&=fe-1,se+=fe):se=0,x++,--te[_]===0){if(_===F)break;_=b[u+e[x]]}if(_>j&&(se&ae)!==ne){for(ee===0&&(ee=j),oe+=C,Z=_-ee,re=1<<Z;Z+ee<F&&(re-=te[Z+ee],!(re<=0));)Z++,re<<=1;if(K+=1<<Z,m===LENS$1&&K>ENOUGH_LENS$1||m===DISTS$1&&K>ENOUGH_DISTS$1)return 1;ne=se&ae,r[ne]=j<<24|Z<<16|oe-c|0}}return se!==0&&(r[oe+se]=_-ee<<24|64<<16|0),t.bits=j,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=m=>(m>>>24&255)+(m>>>8&65280)+((m&65280)<<8)+((m&255)<<24);function InflateState(){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 inflateStateCheck=m=>{if(!m)return 1;const b=m.state;return!b||b.strm!==m||b.mode<HEAD||b.mode>SYNC?1:0},inflateResetKeep=m=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const b=m.state;return m.total_in=m.total_out=b.total=0,m.msg="",b.wrap&&(m.adler=b.wrap&1),b.mode=HEAD,b.last=0,b.havedict=0,b.flags=-1,b.dmax=32768,b.head=null,b.hold=0,b.bits=0,b.lencode=b.lendyn=new Int32Array(ENOUGH_LENS),b.distcode=b.distdyn=new Int32Array(ENOUGH_DISTS),b.sane=1,b.back=-1,Z_OK$1},inflateReset=m=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const b=m.state;return b.wsize=0,b.whave=0,b.wnext=0,inflateResetKeep(m)},inflateReset2=(m,b)=>{let u;if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const T=m.state;return b<0?(u=0,b=-b):(u=(b>>4)+5,b<48&&(b&=15)),b&&(b<8||b>15)?Z_STREAM_ERROR$1:(T.window!==null&&T.wbits!==b&&(T.window=null),T.wrap=u,T.wbits=b,inflateReset(m))},inflateInit2=(m,b)=>{if(!m)return Z_STREAM_ERROR$1;const u=new InflateState;m.state=u,u.strm=m,u.window=null,u.mode=HEAD;const T=inflateReset2(m,b);return T!==Z_OK$1&&(m.state=null),T},inflateInit=m=>inflateInit2(m,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=m=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let b=0;for(;b<144;)m.lens[b++]=8;for(;b<256;)m.lens[b++]=9;for(;b<280;)m.lens[b++]=7;for(;b<288;)m.lens[b++]=8;for(inftrees(LENS,m.lens,0,288,lenfix,0,m.work,{bits:9}),b=0;b<32;)m.lens[b++]=5;inftrees(DISTS,m.lens,0,32,distfix,0,m.work,{bits:5}),virgin=!1}m.lencode=lenfix,m.lenbits=9,m.distcode=distfix,m.distbits=5},updatewindow=(m,b,u,T)=>{let r;const c=m.state;return c.window===null&&(c.wsize=1<<c.wbits,c.wnext=0,c.whave=0,c.window=new Uint8Array(c.wsize)),T>=c.wsize?(c.window.set(b.subarray(u-c.wsize,u),0),c.wnext=0,c.whave=c.wsize):(r=c.wsize-c.wnext,r>T&&(r=T),c.window.set(b.subarray(u-T,u-T+r),c.wnext),T-=r,T?(c.window.set(b.subarray(u-T,u),0),c.wnext=T,c.whave=c.wsize):(c.wnext+=r,c.wnext===c.wsize&&(c.wnext=0),c.whave<c.wsize&&(c.whave+=r))),0},inflate$2=(m,b)=>{let u,T,r,c,e,t,i,_,x,C,F,j,Z,ee,re=0,K,se,fe,G,ne,ae,oe,le;const pe=new Uint8Array(4);let te,ue;const he=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(m)||!m.output||!m.input&&m.avail_in!==0)return Z_STREAM_ERROR$1;u=m.state,u.mode===TYPE&&(u.mode=TYPEDO),e=m.next_out,r=m.output,i=m.avail_out,c=m.next_in,T=m.input,t=m.avail_in,_=u.hold,x=u.bits,C=t,F=i,le=Z_OK$1;e:for(;;)switch(u.mode){case HEAD:if(u.wrap===0){u.mode=TYPEDO;break}for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.wrap&2&&_===35615){u.wbits===0&&(u.wbits=15),u.check=0,pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0),_=0,x=0,u.mode=FLAGS;break}if(u.head&&(u.head.done=!1),!(u.wrap&1)||(((_&255)<<8)+(_>>8))%31){m.msg="incorrect header check",u.mode=BAD;break}if((_&15)!==Z_DEFLATED){m.msg="unknown compression method",u.mode=BAD;break}if(_>>>=4,x-=4,oe=(_&15)+8,u.wbits===0&&(u.wbits=oe),oe>15||oe>u.wbits){m.msg="invalid window size",u.mode=BAD;break}u.dmax=1<<u.wbits,u.flags=0,m.adler=u.check=1,u.mode=_&512?DICTID:TYPE,_=0,x=0;break;case FLAGS:for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.flags=_,(u.flags&255)!==Z_DEFLATED){m.msg="unknown compression method",u.mode=BAD;break}if(u.flags&57344){m.msg="unknown header flags set",u.mode=BAD;break}u.head&&(u.head.text=_>>8&1),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0)),_=0,x=0,u.mode=TIME;case TIME:for(;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.head&&(u.head.time=_),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,pe[2]=_>>>16&255,pe[3]=_>>>24&255,u.check=crc32_1(u.check,pe,4,0)),_=0,x=0,u.mode=OS;case OS:for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.head&&(u.head.xflags=_&255,u.head.os=_>>8),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0)),_=0,x=0,u.mode=EXLEN;case EXLEN:if(u.flags&1024){for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.length=_,u.head&&(u.head.extra_len=_),u.flags&512&&u.wrap&4&&(pe[0]=_&255,pe[1]=_>>>8&255,u.check=crc32_1(u.check,pe,2,0)),_=0,x=0}else u.head&&(u.head.extra=null);u.mode=EXTRA;case EXTRA:if(u.flags&1024&&(j=u.length,j>t&&(j=t),j&&(u.head&&(oe=u.head.extra_len-u.length,u.head.extra||(u.head.extra=new Uint8Array(u.head.extra_len)),u.head.extra.set(T.subarray(c,c+j),oe)),u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,u.length-=j),u.length))break e;u.length=0,u.mode=NAME;case NAME:if(u.flags&2048){if(t===0)break e;j=0;do oe=T[c+j++],u.head&&oe&&u.length<65536&&(u.head.name+=String.fromCharCode(oe));while(oe&&j<t);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,oe)break e}else u.head&&(u.head.name=null);u.length=0,u.mode=COMMENT;case COMMENT:if(u.flags&4096){if(t===0)break e;j=0;do oe=T[c+j++],u.head&&oe&&u.length<65536&&(u.head.comment+=String.fromCharCode(oe));while(oe&&j<t);if(u.flags&512&&u.wrap&4&&(u.check=crc32_1(u.check,T,j,c)),t-=j,c+=j,oe)break e}else u.head&&(u.head.comment=null);u.mode=HCRC;case HCRC:if(u.flags&512){for(;x<16;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.wrap&4&&_!==(u.check&65535)){m.msg="header crc mismatch",u.mode=BAD;break}_=0,x=0}u.head&&(u.head.hcrc=u.flags>>9&1,u.head.done=!0),m.adler=u.check=0,u.mode=TYPE;break;case DICTID:for(;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}m.adler=u.check=zswap32(_),_=0,x=0,u.mode=DICT;case DICT:if(u.havedict===0)return m.next_out=e,m.avail_out=i,m.next_in=c,m.avail_in=t,u.hold=_,u.bits=x,Z_NEED_DICT$1;m.adler=u.check=1,u.mode=TYPE;case TYPE:if(b===Z_BLOCK||b===Z_TREES)break e;case TYPEDO:if(u.last){_>>>=x&7,x-=x&7,u.mode=CHECK;break}for(;x<3;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}switch(u.last=_&1,_>>>=1,x-=1,_&3){case 0:u.mode=STORED;break;case 1:if(fixedtables(u),u.mode=LEN_,b===Z_TREES){_>>>=2,x-=2;break e}break;case 2:u.mode=TABLE;break;case 3:m.msg="invalid block type",u.mode=BAD}_>>>=2,x-=2;break;case STORED:for(_>>>=x&7,x-=x&7;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if((_&65535)!==(_>>>16^65535)){m.msg="invalid stored block lengths",u.mode=BAD;break}if(u.length=_&65535,_=0,x=0,u.mode=COPY_,b===Z_TREES)break e;case COPY_:u.mode=COPY;case COPY:if(j=u.length,j){if(j>t&&(j=t),j>i&&(j=i),j===0)break e;r.set(T.subarray(c,c+j),e),t-=j,c+=j,i-=j,e+=j,u.length-=j;break}u.mode=TYPE;break;case TABLE:for(;x<14;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.nlen=(_&31)+257,_>>>=5,x-=5,u.ndist=(_&31)+1,_>>>=5,x-=5,u.ncode=(_&15)+4,_>>>=4,x-=4,u.nlen>286||u.ndist>30){m.msg="too many length or distance symbols",u.mode=BAD;break}u.have=0,u.mode=LENLENS;case LENLENS:for(;u.have<u.ncode;){for(;x<3;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.lens[he[u.have++]]=_&7,_>>>=3,x-=3}for(;u.have<19;)u.lens[he[u.have++]]=0;if(u.lencode=u.lendyn,u.lenbits=7,te={bits:u.lenbits},le=inftrees(CODES,u.lens,0,19,u.lencode,0,u.work,te),u.lenbits=te.bits,le){m.msg="invalid code lengths set",u.mode=BAD;break}u.have=0,u.mode=CODELENS;case CODELENS:for(;u.have<u.nlen+u.ndist;){for(;re=u.lencode[_&(1<<u.lenbits)-1],K=re>>>24,se=re>>>16&255,fe=re&65535,!(K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(fe<16)_>>>=K,x-=K,u.lens[u.have++]=fe;else{if(fe===16){for(ue=K+2;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(_>>>=K,x-=K,u.have===0){m.msg="invalid bit length repeat",u.mode=BAD;break}oe=u.lens[u.have-1],j=3+(_&3),_>>>=2,x-=2}else if(fe===17){for(ue=K+3;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=K,x-=K,oe=0,j=3+(_&7),_>>>=3,x-=3}else{for(ue=K+7;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=K,x-=K,oe=0,j=11+(_&127),_>>>=7,x-=7}if(u.have+j>u.nlen+u.ndist){m.msg="invalid bit length repeat",u.mode=BAD;break}for(;j--;)u.lens[u.have++]=oe}}if(u.mode===BAD)break;if(u.lens[256]===0){m.msg="invalid code -- missing end-of-block",u.mode=BAD;break}if(u.lenbits=9,te={bits:u.lenbits},le=inftrees(LENS,u.lens,0,u.nlen,u.lencode,0,u.work,te),u.lenbits=te.bits,le){m.msg="invalid literal/lengths set",u.mode=BAD;break}if(u.distbits=6,u.distcode=u.distdyn,te={bits:u.distbits},le=inftrees(DISTS,u.lens,u.nlen,u.ndist,u.distcode,0,u.work,te),u.distbits=te.bits,le){m.msg="invalid distances set",u.mode=BAD;break}if(u.mode=LEN_,b===Z_TREES)break e;case LEN_:u.mode=LEN;case LEN:if(t>=6&&i>=258){m.next_out=e,m.avail_out=i,m.next_in=c,m.avail_in=t,u.hold=_,u.bits=x,inffast(m,F),e=m.next_out,r=m.output,i=m.avail_out,c=m.next_in,T=m.input,t=m.avail_in,_=u.hold,x=u.bits,u.mode===TYPE&&(u.back=-1);break}for(u.back=0;re=u.lencode[_&(1<<u.lenbits)-1],K=re>>>24,se=re>>>16&255,fe=re&65535,!(K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(se&&(se&240)===0){for(G=K,ne=se,ae=fe;re=u.lencode[ae+((_&(1<<G+ne)-1)>>G)],K=re>>>24,se=re>>>16&255,fe=re&65535,!(G+K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=G,x-=G,u.back+=G}if(_>>>=K,x-=K,u.back+=K,u.length=fe,se===0){u.mode=LIT;break}if(se&32){u.back=-1,u.mode=TYPE;break}if(se&64){m.msg="invalid literal/length code",u.mode=BAD;break}u.extra=se&15,u.mode=LENEXT;case LENEXT:if(u.extra){for(ue=u.extra;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.length+=_&(1<<u.extra)-1,_>>>=u.extra,x-=u.extra,u.back+=u.extra}u.was=u.length,u.mode=DIST;case DIST:for(;re=u.distcode[_&(1<<u.distbits)-1],K=re>>>24,se=re>>>16&255,fe=re&65535,!(K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if((se&240)===0){for(G=K,ne=se,ae=fe;re=u.distcode[ae+((_&(1<<G+ne)-1)>>G)],K=re>>>24,se=re>>>16&255,fe=re&65535,!(G+K<=x);){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}_>>>=G,x-=G,u.back+=G}if(_>>>=K,x-=K,u.back+=K,se&64){m.msg="invalid distance code",u.mode=BAD;break}u.offset=fe,u.extra=se&15,u.mode=DISTEXT;case DISTEXT:if(u.extra){for(ue=u.extra;x<ue;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}u.offset+=_&(1<<u.extra)-1,_>>>=u.extra,x-=u.extra,u.back+=u.extra}if(u.offset>u.dmax){m.msg="invalid distance too far back",u.mode=BAD;break}u.mode=MATCH;case MATCH:if(i===0)break e;if(j=F-i,u.offset>j){if(j=u.offset-j,j>u.whave&&u.sane){m.msg="invalid distance too far back",u.mode=BAD;break}j>u.wnext?(j-=u.wnext,Z=u.wsize-j):Z=u.wnext-j,j>u.length&&(j=u.length),ee=u.window}else ee=r,Z=e-u.offset,j=u.length;j>i&&(j=i),i-=j,u.length-=j;do r[e++]=ee[Z++];while(--j);u.length===0&&(u.mode=LEN);break;case LIT:if(i===0)break e;r[e++]=u.length,i--,u.mode=LEN;break;case CHECK:if(u.wrap){for(;x<32;){if(t===0)break e;t--,_|=T[c++]<<x,x+=8}if(F-=i,m.total_out+=F,u.total+=F,u.wrap&4&&F&&(m.adler=u.check=u.flags?crc32_1(u.check,r,F,e-F):adler32_1(u.check,r,F,e-F)),F=i,u.wrap&4&&(u.flags?_:zswap32(_))!==u.check){m.msg="incorrect data check",u.mode=BAD;break}_=0,x=0}u.mode=LENGTH;case LENGTH:if(u.wrap&&u.flags){for(;x<32;){if(t===0)break e;t--,_+=T[c++]<<x,x+=8}if(u.wrap&4&&_!==(u.total&4294967295)){m.msg="incorrect length check",u.mode=BAD;break}_=0,x=0}u.mode=DONE;case DONE:le=Z_STREAM_END$1;break e;case BAD:le=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return m.next_out=e,m.avail_out=i,m.next_in=c,m.avail_in=t,u.hold=_,u.bits=x,(u.wsize||F!==m.avail_out&&u.mode<BAD&&(u.mode<CHECK||b!==Z_FINISH$1))&&updatewindow(m,m.output,m.next_out,F-m.avail_out),C-=m.avail_in,F-=m.avail_out,m.total_in+=C,m.total_out+=F,u.total+=F,u.wrap&4&&F&&(m.adler=u.check=u.flags?crc32_1(u.check,r,F,m.next_out-F):adler32_1(u.check,r,F,m.next_out-F)),m.data_type=u.bits+(u.last?64:0)+(u.mode===TYPE?128:0)+(u.mode===LEN_||u.mode===COPY_?256:0),(C===0&&F===0||b===Z_FINISH$1)&&le===Z_OK$1&&(le=Z_BUF_ERROR),le},inflateEnd=m=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;let b=m.state;return b.window&&(b.window=null),m.state=null,Z_OK$1},inflateGetHeader=(m,b)=>{if(inflateStateCheck(m))return Z_STREAM_ERROR$1;const u=m.state;return(u.wrap&2)===0?Z_STREAM_ERROR$1:(u.head=b,b.done=!1,Z_OK$1)},inflateSetDictionary=(m,b)=>{const u=b.length;let T,r,c;return inflateStateCheck(m)||(T=m.state,T.wrap!==0&&T.mode!==DICT)?Z_STREAM_ERROR$1:T.mode===DICT&&(r=1,r=adler32_1(r,b,u,0),r!==T.check)?Z_DATA_ERROR$1:(c=updatewindow(m,b,u,u),c?(T.mode=MEM,Z_MEM_ERROR$1):(T.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){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}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(m){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},m||{});const b=this.options;b.raw&&b.windowBits>=0&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),b.windowBits>=0&&b.windowBits<16&&!(m&&m.windowBits)&&(b.windowBits+=32),b.windowBits>15&&b.windowBits<48&&(b.windowBits&15)===0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let u=inflate_1$2.inflateInit2(this.strm,b.windowBits);if(u!==Z_OK)throw new Error(messages[u]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),b.dictionary&&(typeof b.dictionary=="string"?b.dictionary=strings.string2buf(b.dictionary):toString.call(b.dictionary)==="[object ArrayBuffer]"&&(b.dictionary=new Uint8Array(b.dictionary)),b.raw&&(u=inflate_1$2.inflateSetDictionary(this.strm,b.dictionary),u!==Z_OK)))throw new Error(messages[u])}Inflate$1.prototype.push=function(m,b){const u=this.strm,T=this.options.chunkSize,r=this.options.dictionary;let c,e,t;if(this.ended)return!1;for(b===~~b?e=b:e=b===!0?Z_FINISH:Z_NO_FLUSH,toString.call(m)==="[object ArrayBuffer]"?u.input=new Uint8Array(m):u.input=m,u.next_in=0,u.avail_in=u.input.length;;){for(u.avail_out===0&&(u.output=new Uint8Array(T),u.next_out=0,u.avail_out=T),c=inflate_1$2.inflate(u,e),c===Z_NEED_DICT&&r&&(c=inflate_1$2.inflateSetDictionary(u,r),c===Z_OK?c=inflate_1$2.inflate(u,e):c===Z_DATA_ERROR&&(c=Z_NEED_DICT));u.avail_in>0&&c===Z_STREAM_END&&u.state.wrap>0&&m[u.next_in]!==0;)inflate_1$2.inflateReset(u),c=inflate_1$2.inflate(u,e);switch(c){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(c),this.ended=!0,!1}if(t=u.avail_out,u.next_out&&(u.avail_out===0||c===Z_STREAM_END))if(this.options.to==="string"){let i=strings.utf8border(u.output,u.next_out),_=u.next_out-i,x=strings.buf2string(u.output,i);u.next_out=_,u.avail_out=T-_,_&&u.output.set(u.output.subarray(i,i+_),0),this.onData(x)}else this.onData(u.output.length===u.next_out?u.output:u.output.subarray(0,u.next_out));if(!(c===Z_OK&&t===0)){if(c===Z_STREAM_END)return c=inflate_1$2.inflateEnd(this.strm),this.onEnd(c),this.ended=!0,!0;if(u.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(m){this.chunks.push(m)},Inflate$1.prototype.onEnd=function(m){m===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg};function inflate$1(m,b){const u=new Inflate$1(b);if(u.push(m),u.err)throw u.msg||messages[u.err];return u.result}function inflateRaw$1(m,b){return b=b||{},b.raw=!0,inflate$1(m,b)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1},commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(m){return m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m}var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=m;function m(b,u){for(var T=new Array(arguments.length-1),r=0,c=2,e=!0;c<arguments.length;)T[r++]=arguments[c++];return new Promise(function(i,_){T[r]=function(C){if(e)if(e=!1,C)_(C);else{for(var F=new Array(arguments.length-1),j=0;j<F.length;)F[j++]=arguments[j];i.apply(null,F)}};try{b.apply(u||null,T)}catch(x){e&&(e=!1,_(x))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,(function(m){var b=m;b.length=function(t){var i=t.length;if(!i)return 0;for(var _=0;--i%4>1&&t.charAt(i)==="=";)++_;return Math.ceil(t.length*3)/4-_};for(var u=new Array(64),T=new Array(123),r=0;r<64;)T[u[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;b.encode=function(t,i,_){for(var x=null,C=[],F=0,j=0,Z;i<_;){var ee=t[i++];switch(j){case 0:C[F++]=u[ee>>2],Z=(ee&3)<<4,j=1;break;case 1:C[F++]=u[Z|ee>>4],Z=(ee&15)<<2,j=2;break;case 2:C[F++]=u[Z|ee>>6],C[F++]=u[ee&63],j=0;break}F>8191&&((x||(x=[])).push(String.fromCharCode.apply(String,C)),F=0)}return j&&(C[F++]=u[Z],C[F++]=61,j===1&&(C[F++]=61)),x?(F&&x.push(String.fromCharCode.apply(String,C.slice(0,F))),x.join("")):String.fromCharCode.apply(String,C.slice(0,F))};var c="invalid encoding";b.decode=function(t,i,_){for(var x=_,C=0,F,j=0;j<t.length;){var Z=t.charCodeAt(j++);if(Z===61&&C>1)break;if((Z=T[Z])===void 0)throw Error(c);switch(C){case 0:F=Z,C=1;break;case 1:i[_++]=F<<2|(Z&48)>>4,F=Z,C=2;break;case 2:i[_++]=(F&15)<<4|(Z&60)>>2,F=Z,C=3;break;case 3:i[_++]=(F&3)<<6|Z,C=0;break}}if(C===1)throw Error(c);return _-x},b.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}})(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=m;function m(){this._listeners={}}return m.prototype.on=function(u,T,r){return(this._listeners[u]||(this._listeners[u]=[])).push({fn:T,ctx:r||this}),this},m.prototype.off=function(u,T){if(u===void 0)this._listeners={};else if(T===void 0)this._listeners[u]=[];else for(var r=this._listeners[u],c=0;c<r.length;)r[c].fn===T?r.splice(c,1):++c;return this},m.prototype.emit=function(u){var T=this._listeners[u];if(T){for(var r=[],c=1;c<arguments.length;)r.push(arguments[c++]);for(c=0;c<T.length;)T[c].fn.apply(T[c++].ctx,r)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=m(m);function m(c){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),i=t[3]===128;function _(j,Z,ee){e[0]=j,Z[ee]=t[0],Z[ee+1]=t[1],Z[ee+2]=t[2],Z[ee+3]=t[3]}function x(j,Z,ee){e[0]=j,Z[ee]=t[3],Z[ee+1]=t[2],Z[ee+2]=t[1],Z[ee+3]=t[0]}c.writeFloatLE=i?_:x,c.writeFloatBE=i?x:_;function C(j,Z){return t[0]=j[Z],t[1]=j[Z+1],t[2]=j[Z+2],t[3]=j[Z+3],e[0]}function F(j,Z){return t[3]=j[Z],t[2]=j[Z+1],t[1]=j[Z+2],t[0]=j[Z+3],e[0]}c.readFloatLE=i?C:F,c.readFloatBE=i?F:C})():(function(){function e(i,_,x,C){var F=_<0?1:0;if(F&&(_=-_),_===0)i(1/_>0?0:2147483648,x,C);else if(isNaN(_))i(2143289344,x,C);else if(_>34028234663852886e22)i((F<<31|2139095040)>>>0,x,C);else if(_<11754943508222875e-54)i((F<<31|Math.round(_/1401298464324817e-60))>>>0,x,C);else{var j=Math.floor(Math.log(_)/Math.LN2),Z=Math.round(_*Math.pow(2,-j)*8388608)&8388607;i((F<<31|j+127<<23|Z)>>>0,x,C)}}c.writeFloatLE=e.bind(null,b),c.writeFloatBE=e.bind(null,u);function t(i,_,x){var C=i(_,x),F=(C>>31)*2+1,j=C>>>23&255,Z=C&8388607;return j===255?Z?NaN:F*(1/0):j===0?F*1401298464324817e-60*Z:F*Math.pow(2,j-150)*(Z+8388608)}c.readFloatLE=t.bind(null,T),c.readFloatBE=t.bind(null,r)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),i=t[7]===128;function _(j,Z,ee){e[0]=j,Z[ee]=t[0],Z[ee+1]=t[1],Z[ee+2]=t[2],Z[ee+3]=t[3],Z[ee+4]=t[4],Z[ee+5]=t[5],Z[ee+6]=t[6],Z[ee+7]=t[7]}function x(j,Z,ee){e[0]=j,Z[ee]=t[7],Z[ee+1]=t[6],Z[ee+2]=t[5],Z[ee+3]=t[4],Z[ee+4]=t[3],Z[ee+5]=t[2],Z[ee+6]=t[1],Z[ee+7]=t[0]}c.writeDoubleLE=i?_:x,c.writeDoubleBE=i?x:_;function C(j,Z){return t[0]=j[Z],t[1]=j[Z+1],t[2]=j[Z+2],t[3]=j[Z+3],t[4]=j[Z+4],t[5]=j[Z+5],t[6]=j[Z+6],t[7]=j[Z+7],e[0]}function F(j,Z){return t[7]=j[Z],t[6]=j[Z+1],t[5]=j[Z+2],t[4]=j[Z+3],t[3]=j[Z+4],t[2]=j[Z+5],t[1]=j[Z+6],t[0]=j[Z+7],e[0]}c.readDoubleLE=i?C:F,c.readDoubleBE=i?F:C})():(function(){function e(i,_,x,C,F,j){var Z=C<0?1:0;if(Z&&(C=-C),C===0)i(0,F,j+_),i(1/C>0?0:2147483648,F,j+x);else if(isNaN(C))i(0,F,j+_),i(2146959360,F,j+x);else if(C>17976931348623157e292)i(0,F,j+_),i((Z<<31|2146435072)>>>0,F,j+x);else{var ee;if(C<22250738585072014e-324)ee=C/5e-324,i(ee>>>0,F,j+_),i((Z<<31|ee/4294967296)>>>0,F,j+x);else{var re=Math.floor(Math.log(C)/Math.LN2);re===1024&&(re=1023),ee=C*Math.pow(2,-re),i(ee*4503599627370496>>>0,F,j+_),i((Z<<31|re+1023<<20|ee*1048576&1048575)>>>0,F,j+x)}}}c.writeDoubleLE=e.bind(null,b,0,4),c.writeDoubleBE=e.bind(null,u,4,0);function t(i,_,x,C,F){var j=i(C,F+_),Z=i(C,F+x),ee=(Z>>31)*2+1,re=Z>>>20&2047,K=4294967296*(Z&1048575)+j;return re===2047?K?NaN:ee*(1/0):re===0?ee*5e-324*K:ee*Math.pow(2,re-1075)*(K+4503599627370496)}c.readDoubleLE=t.bind(null,T,0,4),c.readDoubleBE=t.bind(null,r,4,0)})(),c}function b(c,e,t){e[t]=c&255,e[t+1]=c>>>8&255,e[t+2]=c>>>16&255,e[t+3]=c>>>24}function u(c,e,t){e[t]=c>>>24,e[t+1]=c>>>16&255,e[t+2]=c>>>8&255,e[t+3]=c&255}function T(c,e){return(c[e]|c[e+1]<<8|c[e+2]<<16|c[e+3]<<24)>>>0}function r(c,e){return(c[e]<<24|c[e+1]<<16|c[e+2]<<8|c[e+3])>>>0}return float}var inquire_1,hasRequiredInquire;function requireInquire(){if(hasRequiredInquire)return inquire_1;hasRequiredInquire=1,inquire_1=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(m){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,(function(m){var b=m;b.length=function(T){for(var r=0,c=0,e=0;e<T.length;++e)c=T.charCodeAt(e),c<128?r+=1:c<2048?r+=2:(c&64512)===55296&&(T.charCodeAt(e+1)&64512)===56320?(++e,r+=4):r+=3;return r},b.read=function(T,r,c){var e=c-r;if(e<1)return"";for(var t=null,i=[],_=0,x;r<c;)x=T[r++],x<128?i[_++]=x:x>191&&x<224?i[_++]=(x&31)<<6|T[r++]&63:x>239&&x<365?(x=((x&7)<<18|(T[r++]&63)<<12|(T[r++]&63)<<6|T[r++]&63)-65536,i[_++]=55296+(x>>10),i[_++]=56320+(x&1023)):i[_++]=(x&15)<<12|(T[r++]&63)<<6|T[r++]&63,_>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,i)),_=0);return t?(_&&t.push(String.fromCharCode.apply(String,i.slice(0,_))),t.join("")):String.fromCharCode.apply(String,i.slice(0,_))},b.write=function(T,r,c){for(var e=c,t,i,_=0;_<T.length;++_)t=T.charCodeAt(_),t<128?r[c++]=t:t<2048?(r[c++]=t>>6|192,r[c++]=t&63|128):(t&64512)===55296&&((i=T.charCodeAt(_+1))&64512)===56320?(t=65536+((t&1023)<<10)+(i&1023),++_,r[c++]=t>>18|240,r[c++]=t>>12&63|128,r[c++]=t>>6&63|128,r[c++]=t&63|128):(r[c++]=t>>12|224,r[c++]=t>>6&63|128,r[c++]=t&63|128);return c-e}})(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=m;function m(b,u,T){var r=T||8192,c=r>>>1,e=null,t=r;return function(_){if(_<1||_>c)return b(_);t+_>r&&(e=b(r),t=0);var x=u.call(e,t,t+=_);return t&7&&(t=(t|7)+1),x}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=b;var m=requireMinimal$1();function b(c,e){this.lo=c>>>0,this.hi=e>>>0}var u=b.zero=new b(0,0);u.toNumber=function(){return 0},u.zzEncode=u.zzDecode=function(){return this},u.length=function(){return 1};var T=b.zeroHash="\0\0\0\0\0\0\0\0";b.fromNumber=function(e){if(e===0)return u;var t=e<0;t&&(e=-e);var i=e>>>0,_=(e-i)/4294967296>>>0;return t&&(_=~_>>>0,i=~i>>>0,++i>4294967295&&(i=0,++_>4294967295&&(_=0))),new b(i,_)},b.from=function(e){if(typeof e=="number")return b.fromNumber(e);if(m.isString(e))if(m.Long)e=m.Long.fromString(e);else return b.fromNumber(parseInt(e,10));return e.low||e.high?new b(e.low>>>0,e.high>>>0):u},b.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,i=~this.hi>>>0;return t||(i=i+1>>>0),-(t+i*4294967296)}return this.lo+this.hi*4294967296},b.prototype.toLong=function(e){return m.Long?new m.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var r=String.prototype.charCodeAt;return b.fromHash=function(e){return e===T?u:new b((r.call(e,0)|r.call(e,1)<<8|r.call(e,2)<<16|r.call(e,3)<<24)>>>0,(r.call(e,4)|r.call(e,5)<<8|r.call(e,6)<<16|r.call(e,7)<<24)>>>0)},b.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},b.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},b.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},b.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:i<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,(function(m){var b=m;b.asPromise=requireAspromise(),b.base64=requireBase64(),b.EventEmitter=requireEventemitter(),b.float=requireFloat(),b.inquire=requireInquire(),b.utf8=requireUtf8(),b.pool=requirePool(),b.LongBits=requireLongbits(),b.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),b.global=b.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,b.emptyArray=Object.freeze?Object.freeze([]):[],b.emptyObject=Object.freeze?Object.freeze({}):{},b.isInteger=Number.isInteger||function(c){return typeof c=="number"&&isFinite(c)&&Math.floor(c)===c},b.isString=function(c){return typeof c=="string"||c instanceof String},b.isObject=function(c){return c&&typeof c=="object"},b.isset=b.isSet=function(c,e){var t=c[e];return t!=null&&c.hasOwnProperty(e)?typeof t!="object"||(Array.isArray(t)?t.length:Object.keys(t).length)>0:!1},b.Buffer=(function(){try{var r=b.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}})(),b._Buffer_from=null,b._Buffer_allocUnsafe=null,b.newBuffer=function(c){return typeof c=="number"?b.Buffer?b._Buffer_allocUnsafe(c):new b.Array(c):b.Buffer?b._Buffer_from(c):typeof Uint8Array>"u"?c:new Uint8Array(c)},b.Array=typeof Uint8Array<"u"?Uint8Array:Array,b.Long=b.global.dcodeIO&&b.global.dcodeIO.Long||b.global.Long||b.inquire("long"),b.key2Re=/^true|false|0|1$/,b.key32Re=/^-?(?:0|[1-9][0-9]*)$/,b.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,b.longToHash=function(c){return c?b.LongBits.from(c).toHash():b.LongBits.zeroHash},b.longFromHash=function(c,e){var t=b.LongBits.fromHash(c);return b.Long?b.Long.fromBits(t.lo,t.hi,e):t.toNumber(!!e)};function u(r,c,e){for(var t=Object.keys(c),i=0;i<t.length;++i)(r[t[i]]===void 0||!e)&&(r[t[i]]=c[t[i]]);return r}b.merge=u,b.lcFirst=function(c){return c.charAt(0).toLowerCase()+c.substring(1)};function T(r){function c(e,t){if(!(this instanceof c))return new c(e,t);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,c):Object.defineProperty(this,"stack",{value:new Error().stack||""}),t&&u(this,t)}return c.prototype=Object.create(Error.prototype,{constructor:{value:c,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),c}b.newError=T,b.ProtocolError=T("ProtocolError"),b.oneOfGetter=function(c){for(var e={},t=0;t<c.length;++t)e[c[t]]=1;return function(){for(var i=Object.keys(this),_=i.length-1;_>-1;--_)if(e[i[_]]===1&&this[i[_]]!==void 0&&this[i[_]]!==null)return i[_]}},b.oneOfSetter=function(c){return function(e){for(var t=0;t<c.length;++t)c[t]!==e&&delete this[c[t]]}},b.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},b._configure=function(){var r=b.Buffer;if(!r){b._Buffer_from=b._Buffer_allocUnsafe=null;return}b._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,t){return new r(e,t)},b._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}})(minimal$1)),minimal$1}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1,writer$1=i;var m=requireMinimal$1(),b,u=m.LongBits,T=m.base64,r=m.utf8;function c(re,K,se){this.fn=re,this.len=K,this.next=void 0,this.val=se}function e(){}function t(re){this.head=re.head,this.tail=re.tail,this.len=re.len,this.next=re.states}function i(){this.len=0,this.head=new c(e,0,0),this.tail=this.head,this.states=null}var _=function(){return m.Buffer?function(){return(i.create=function(){return new b})()}:function(){return new i}};i.create=_(),i.alloc=function(K){return new m.Array(K)},m.Array!==Array&&(i.alloc=m.pool(i.alloc,m.Array.prototype.subarray)),i.prototype._push=function(K,se,fe){return this.tail=this.tail.next=new c(K,se,fe),this.len+=se,this};function x(re,K,se){K[se]=re&255}function C(re,K,se){for(;re>127;)K[se++]=re&127|128,re>>>=7;K[se]=re}function F(re,K){this.len=re,this.next=void 0,this.val=K}F.prototype=Object.create(c.prototype),F.prototype.fn=C,i.prototype.uint32=function(K){return this.len+=(this.tail=this.tail.next=new F((K=K>>>0)<128?1:K<16384?2:K<2097152?3:K<268435456?4:5,K)).len,this},i.prototype.int32=function(K){return K<0?this._push(j,10,u.fromNumber(K)):this.uint32(K)},i.prototype.sint32=function(K){return this.uint32((K<<1^K>>31)>>>0)};function j(re,K,se){for(;re.hi;)K[se++]=re.lo&127|128,re.lo=(re.lo>>>7|re.hi<<25)>>>0,re.hi>>>=7;for(;re.lo>127;)K[se++]=re.lo&127|128,re.lo=re.lo>>>7;K[se++]=re.lo}i.prototype.uint64=function(K){var se=u.from(K);return this._push(j,se.length(),se)},i.prototype.int64=i.prototype.uint64,i.prototype.sint64=function(K){var se=u.from(K).zzEncode();return this._push(j,se.length(),se)},i.prototype.bool=function(K){return this._push(x,1,K?1:0)};function Z(re,K,se){K[se]=re&255,K[se+1]=re>>>8&255,K[se+2]=re>>>16&255,K[se+3]=re>>>24}i.prototype.fixed32=function(K){return this._push(Z,4,K>>>0)},i.prototype.sfixed32=i.prototype.fixed32,i.prototype.fixed64=function(K){var se=u.from(K);return this._push(Z,4,se.lo)._push(Z,4,se.hi)},i.prototype.sfixed64=i.prototype.fixed64,i.prototype.float=function(K){return this._push(m.float.writeFloatLE,4,K)},i.prototype.double=function(K){return this._push(m.float.writeDoubleLE,8,K)};var ee=m.Array.prototype.set?function(K,se,fe){se.set(K,fe)}:function(K,se,fe){for(var G=0;G<K.length;++G)se[fe+G]=K[G]};return i.prototype.bytes=function(K){var se=K.length>>>0;if(!se)return this._push(x,1,0);if(m.isString(K)){var fe=i.alloc(se=T.length(K));T.decode(K,fe,0),K=fe}return this.uint32(se)._push(ee,se,K)},i.prototype.string=function(K){var se=r.length(K);return se?this.uint32(se)._push(r.write,se,K):this._push(x,1,0)},i.prototype.fork=function(){return this.states=new t(this),this.head=this.tail=new c(e,0,0),this.len=0,this},i.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(e,0,0),this.len=0),this},i.prototype.ldelim=function(){var K=this.head,se=this.tail,fe=this.len;return this.reset().uint32(fe),fe&&(this.tail.next=K.next,this.tail=se,this.len+=fe),this},i.prototype.finish=function(){for(var K=this.head.next,se=this.constructor.alloc(this.len),fe=0;K;)K.fn(K.val,se,fe),fe+=K.len,K=K.next;return se},i._configure=function(re){b=re,i.create=_(),b._configure()},writer$1}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=u;var m=requireWriter$1();(u.prototype=Object.create(m.prototype)).constructor=u;var b=requireMinimal$1();function u(){m.call(this)}u._configure=function(){u.alloc=b._Buffer_allocUnsafe,u.writeBytesBuffer=b.Buffer&&b.Buffer.prototype instanceof Uint8Array&&b.Buffer.prototype.set.name==="set"?function(c,e,t){e.set(c,t)}:function(c,e,t){if(c.copy)c.copy(e,t,0,c.length);else for(var i=0;i<c.length;)e[t++]=c[i++]}},u.prototype.bytes=function(c){b.isString(c)&&(c=b._Buffer_from(c,"base64"));var e=c.length>>>0;return this.uint32(e),e&&this._push(u.writeBytesBuffer,e,c),this};function T(r,c,e){r.length<40?b.utf8.write(r,c,e):c.utf8Write?c.utf8Write(r,e):c.write(r,e)}return u.prototype.string=function(c){var e=b.Buffer.byteLength(c);return this.uint32(e),e&&this._push(T,e,c),this},u._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=c;var m=requireMinimal$1(),b,u=m.LongBits,T=m.utf8;function r(C,F){return RangeError("index out of range: "+C.pos+" + "+(F||1)+" > "+C.len)}function c(C){this.buf=C,this.pos=0,this.len=C.length}var e=typeof Uint8Array<"u"?function(F){if(F instanceof Uint8Array||Array.isArray(F))return new c(F);throw Error("illegal buffer")}:function(F){if(Array.isArray(F))return new c(F);throw Error("illegal buffer")},t=function(){return m.Buffer?function(j){return(c.create=function(ee){return m.Buffer.isBuffer(ee)?new b(ee):e(ee)})(j)}:e};c.create=t(),c.prototype._slice=m.Array.prototype.subarray||m.Array.prototype.slice,c.prototype.uint32=(function(){var F=4294967295;return function(){if(F=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(F=(F|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(F=(F|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(F=(F|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(F=(F|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return F;if((this.pos+=5)>this.len)throw this.pos=this.len,r(this,10);return F}})(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var F=this.uint32();return F>>>1^-(F&1)|0};function i(){var C=new u(0,0),F=0;if(this.len-this.pos>4){for(;F<4;++F)if(C.lo=(C.lo|(this.buf[this.pos]&127)<<F*7)>>>0,this.buf[this.pos++]<128)return C;if(C.lo=(C.lo|(this.buf[this.pos]&127)<<28)>>>0,C.hi=(C.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return C;F=0}else{for(;F<3;++F){if(this.pos>=this.len)throw r(this);if(C.lo=(C.lo|(this.buf[this.pos]&127)<<F*7)>>>0,this.buf[this.pos++]<128)return C}return C.lo=(C.lo|(this.buf[this.pos++]&127)<<F*7)>>>0,C}if(this.len-this.pos>4){for(;F<5;++F)if(C.hi=(C.hi|(this.buf[this.pos]&127)<<F*7+3)>>>0,this.buf[this.pos++]<128)return C}else for(;F<5;++F){if(this.pos>=this.len)throw r(this);if(C.hi=(C.hi|(this.buf[this.pos]&127)<<F*7+3)>>>0,this.buf[this.pos++]<128)return C}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function _(C,F){return(C[F-4]|C[F-3]<<8|C[F-2]<<16|C[F-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw r(this,4);return _(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw r(this,4);return _(this.buf,this.pos+=4)|0};function x(){if(this.pos+8>this.len)throw r(this,8);return new u(_(this.buf,this.pos+=4),_(this.buf,this.pos+=4))}return c.prototype.float=function(){if(this.pos+4>this.len)throw r(this,4);var F=m.float.readFloatLE(this.buf,this.pos);return this.pos+=4,F},c.prototype.double=function(){if(this.pos+8>this.len)throw r(this,4);var F=m.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,F},c.prototype.bytes=function(){var F=this.uint32(),j=this.pos,Z=this.pos+F;if(Z>this.len)throw r(this,F);if(this.pos+=F,Array.isArray(this.buf))return this.buf.slice(j,Z);if(j===Z){var ee=m.Buffer;return ee?ee.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,j,Z)},c.prototype.string=function(){var F=this.bytes();return T.read(F,0,F.length)},c.prototype.skip=function(F){if(typeof F=="number"){if(this.pos+F>this.len)throw r(this,F);this.pos+=F}else do if(this.pos>=this.len)throw r(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(C){switch(C){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(C=this.uint32()&7)!==4;)this.skipType(C);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+C+" at offset "+this.pos)}return this},c._configure=function(C){b=C,c.create=t(),b._configure();var F=m.Long?"toLong":"toNumber";m.merge(c.prototype,{int64:function(){return i.call(this)[F](!1)},uint64:function(){return i.call(this)[F](!0)},sint64:function(){return i.call(this).zzDecode()[F](!1)},fixed64:function(){return x.call(this)[F](!0)},sfixed64:function(){return x.call(this)[F](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=u;var m=requireReader();(u.prototype=Object.create(m.prototype)).constructor=u;var b=requireMinimal$1();function u(T){m.call(this,T)}return u._configure=function(){b.Buffer&&(u.prototype._slice=b.Buffer.prototype.slice)},u.prototype.string=function(){var r=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+r,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+r,this.len))},u._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=b;var m=requireMinimal$1();(b.prototype=Object.create(m.EventEmitter.prototype)).constructor=b;function b(u,T,r){if(typeof u!="function")throw TypeError("rpcImpl must be a function");m.EventEmitter.call(this),this.rpcImpl=u,this.requestDelimited=!!T,this.responseDelimited=!!r}return b.prototype.rpcCall=function u(T,r,c,e,t){if(!e)throw TypeError("request must be specified");var i=this;if(!t)return m.asPromise(u,i,T,r,c,e);if(!i.rpcImpl){setTimeout(function(){t(Error("already ended"))},0);return}try{return i.rpcImpl(T,r[i.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(x,C){if(x)return i.emit("error",x,T),t(x);if(C===null){i.end(!0);return}if(!(C instanceof c))try{C=c[i.responseDelimited?"decodeDelimited":"decode"](C)}catch(F){return i.emit("error",F,T),t(F)}return i.emit("data",C,T),t(null,C)})}catch(_){i.emit("error",_,T),setTimeout(function(){t(_)},0);return}},b.prototype.end=function(T){return this.rpcImpl&&(T||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,(function(m){var b=m;b.Service=requireService()})(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,(function(m){var b=m;b.build="minimal",b.Writer=requireWriter$1(),b.BufferWriter=requireWriter_buffer(),b.Reader=requireReader(),b.BufferReader=requireReader_buffer(),b.util=requireMinimal$1(),b.rpc=requireRpc(),b.roots=requireRoots(),b.configure=u;function u(){b.util._configure(),b.Writer._configure(b.BufferWriter),b.Reader._configure(b.BufferReader)}u()})(indexMinimal)),indexMinimal}var minimal,hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,minimal=requireIndexMinimal()),minimal}var minimalExports=requireMinimal();const $Reader=minimalExports.Reader,$Writer=minimalExports.Writer,$util=minimalExports.util,$root=minimalExports.roots.default||(minimalExports.roots.default={}),com=$root.com=(()=>{const m={};return m.quick=(function(){const b={};return b.voice=(function(){const u={};return u.proto=(function(){const T={};return T.CommonReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.event="",r.prototype.data=$util.newBuffer([]),r.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.version=0,r.prototype.compress=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&t.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&t.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&t.uint32(40).int64(e.valid),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(48).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&t.uint32(56).bool(e.compress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CommonReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.event=e.string();break}case 2:{x.data=e.bytes();break}case 3:{x.sn=e.int64();break}case 4:{x.time=e.int64();break}case 5:{x.valid=e.int64();break}case 6:{x.version=e.int32();break}case 7:{x.compress=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonReq)return e;let t=new $root.com.quick.voice.proto.CommonReq;return e.event!=null&&(t.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,t.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.sn!=null&&($util.Long?(t.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?t.sn=parseInt(e.sn,10):typeof e.sn=="number"?t.sn=e.sn:typeof e.sn=="object"&&(t.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(t.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?t.valid=parseInt(e.valid,10):typeof e.valid=="number"?t.valid=e.valid:typeof e.valid=="object"&&(t.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.version!=null&&(t.version=e.version|0),e.compress!=null&&(t.compress=!!e.compress),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.event="",t.bytes===String?i.data="":(i.data=[],t.bytes!==Array&&(i.data=$util.newBuffer(i.data))),$util.Long){let _=new $util.Long(0,0,!1);i.sn=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.sn=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.valid=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.valid=t.longs===String?"0":0;i.version=0,i.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(i.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?$util.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?i.sn=t.longs===String?String(e.sn):e.sn:i.sn=t.longs===String?$util.Long.prototype.toString.call(e.sn):t.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?i.valid=t.longs===String?String(e.valid):e.valid:i.valid=t.longs===String?$util.Long.prototype.toString.call(e.valid):t.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.version!=null&&e.hasOwnProperty("version")&&(i.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(i.compress=e.compress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonReq"},r})(),T.CommonRsp=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.event="",r.prototype.data=$util.newBuffer([]),r.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.code=0,r.prototype.desc="",r.prototype.version=0,r.prototype.compress=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.event!=null&&Object.hasOwnProperty.call(e,"event")&&t.uint32(10).string(e.event),e.data!=null&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),e.sn!=null&&Object.hasOwnProperty.call(e,"sn")&&t.uint32(24).int64(e.sn),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(32).int64(e.time),e.valid!=null&&Object.hasOwnProperty.call(e,"valid")&&t.uint32(40).int64(e.valid),e.code!=null&&Object.hasOwnProperty.call(e,"code")&&t.uint32(48).int32(e.code),e.desc!=null&&Object.hasOwnProperty.call(e,"desc")&&t.uint32(58).string(e.desc),e.version!=null&&Object.hasOwnProperty.call(e,"version")&&t.uint32(64).int32(e.version),e.compress!=null&&Object.hasOwnProperty.call(e,"compress")&&t.uint32(72).bool(e.compress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CommonRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.event=e.string();break}case 2:{x.data=e.bytes();break}case 3:{x.sn=e.int64();break}case 4:{x.time=e.int64();break}case 5:{x.valid=e.int64();break}case 6:{x.code=e.int32();break}case 7:{x.desc=e.string();break}case 8:{x.version=e.int32();break}case 9:{x.compress=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.event!=null&&e.hasOwnProperty("event")&&!$util.isString(e.event)?"event: string expected":e.data!=null&&e.hasOwnProperty("data")&&!(e.data&&typeof e.data.length=="number"||$util.isString(e.data))?"data: buffer expected":e.sn!=null&&e.hasOwnProperty("sn")&&!$util.isInteger(e.sn)&&!(e.sn&&$util.isInteger(e.sn.low)&&$util.isInteger(e.sn.high))?"sn: integer|Long expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":e.valid!=null&&e.hasOwnProperty("valid")&&!$util.isInteger(e.valid)&&!(e.valid&&$util.isInteger(e.valid.low)&&$util.isInteger(e.valid.high))?"valid: integer|Long expected":e.code!=null&&e.hasOwnProperty("code")&&!$util.isInteger(e.code)?"code: integer expected":e.desc!=null&&e.hasOwnProperty("desc")&&!$util.isString(e.desc)?"desc: string expected":e.version!=null&&e.hasOwnProperty("version")&&!$util.isInteger(e.version)?"version: integer expected":e.compress!=null&&e.hasOwnProperty("compress")&&typeof e.compress!="boolean"?"compress: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CommonRsp)return e;let t=new $root.com.quick.voice.proto.CommonRsp;return e.event!=null&&(t.event=String(e.event)),e.data!=null&&(typeof e.data=="string"?$util.base64.decode(e.data,t.data=$util.newBuffer($util.base64.length(e.data)),0):e.data.length>=0&&(t.data=e.data)),e.sn!=null&&($util.Long?(t.sn=$util.Long.fromValue(e.sn)).unsigned=!1:typeof e.sn=="string"?t.sn=parseInt(e.sn,10):typeof e.sn=="number"?t.sn=e.sn:typeof e.sn=="object"&&(t.sn=new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber())),e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),e.valid!=null&&($util.Long?(t.valid=$util.Long.fromValue(e.valid)).unsigned=!1:typeof e.valid=="string"?t.valid=parseInt(e.valid,10):typeof e.valid=="number"?t.valid=e.valid:typeof e.valid=="object"&&(t.valid=new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber())),e.code!=null&&(t.code=e.code|0),e.desc!=null&&(t.desc=String(e.desc)),e.version!=null&&(t.version=e.version|0),e.compress!=null&&(t.compress=!!e.compress),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.event="",t.bytes===String?i.data="":(i.data=[],t.bytes!==Array&&(i.data=$util.newBuffer(i.data))),$util.Long){let _=new $util.Long(0,0,!1);i.sn=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.sn=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;if($util.Long){let _=new $util.Long(0,0,!1);i.valid=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.valid=t.longs===String?"0":0;i.code=0,i.desc="",i.version=0,i.compress=!1}return e.event!=null&&e.hasOwnProperty("event")&&(i.event=e.event),e.data!=null&&e.hasOwnProperty("data")&&(i.data=t.bytes===String?$util.base64.encode(e.data,0,e.data.length):t.bytes===Array?Array.prototype.slice.call(e.data):e.data),e.sn!=null&&e.hasOwnProperty("sn")&&(typeof e.sn=="number"?i.sn=t.longs===String?String(e.sn):e.sn:i.sn=t.longs===String?$util.Long.prototype.toString.call(e.sn):t.longs===Number?new $util.LongBits(e.sn.low>>>0,e.sn.high>>>0).toNumber():e.sn),e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),e.valid!=null&&e.hasOwnProperty("valid")&&(typeof e.valid=="number"?i.valid=t.longs===String?String(e.valid):e.valid:i.valid=t.longs===String?$util.Long.prototype.toString.call(e.valid):t.longs===Number?new $util.LongBits(e.valid.low>>>0,e.valid.high>>>0).toNumber():e.valid),e.code!=null&&e.hasOwnProperty("code")&&(i.code=e.code),e.desc!=null&&e.hasOwnProperty("desc")&&(i.desc=e.desc),e.version!=null&&e.hasOwnProperty("version")&&(i.version=e.version),e.compress!=null&&e.hasOwnProperty("compress")&&(i.compress=e.compress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CommonRsp"},r})(),T.User=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.id="",r.prototype.callAction=null,r.prototype.callState=null,r.prototype.joinTime=null,r.prototype.tracks=$util.emptyArray,r.prototype.permissions=null,r.prototype.isPublished=null,r.prototype.behavior=null,r.prototype.channelCache=null;let c;return Object.defineProperty(r.prototype,"_callAction",{get:$util.oneOfGetter(c=["callAction"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_callState",{get:$util.oneOfGetter(c=["callState"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_joinTime",{get:$util.oneOfGetter(c=["joinTime"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_permissions",{get:$util.oneOfGetter(c=["permissions"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_isPublished",{get:$util.oneOfGetter(c=["isPublished"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_behavior",{get:$util.oneOfGetter(c=["behavior"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_channelCache",{get:$util.oneOfGetter(c=["channelCache"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.id!=null&&Object.hasOwnProperty.call(t,"id")&&i.uint32(10).string(t.id),t.callAction!=null&&Object.hasOwnProperty.call(t,"callAction")&&i.uint32(16).int32(t.callAction),t.callState!=null&&Object.hasOwnProperty.call(t,"callState")&&i.uint32(24).int32(t.callState),t.joinTime!=null&&Object.hasOwnProperty.call(t,"joinTime")&&i.uint32(32).int64(t.joinTime),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(42).fork()).ldelim();return t.permissions!=null&&Object.hasOwnProperty.call(t,"permissions")&&i.uint32(48).int32(t.permissions),t.isPublished!=null&&Object.hasOwnProperty.call(t,"isPublished")&&i.uint32(56).bool(t.isPublished),t.behavior!=null&&Object.hasOwnProperty.call(t,"behavior")&&i.uint32(64).int32(t.behavior),t.channelCache!=null&&Object.hasOwnProperty.call(t,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(t.channelCache,i.uint32(74).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.User;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.id=t.string();break}case 2:{C.callAction=t.int32();break}case 3:{C.callState=t.int32();break}case 4:{C.joinTime=t.int64();break}case 5:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}case 6:{C.permissions=t.int32();break}case 7:{C.isPublished=t.bool();break}case 8:{C.behavior=t.int32();break}case 9:{C.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(t,t.uint32());break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.id!=null&&t.hasOwnProperty("id")&&!$util.isString(t.id))return"id: string expected";if(t.callAction!=null&&t.hasOwnProperty("callAction")&&!$util.isInteger(t.callAction))return"callAction: integer expected";if(t.callState!=null&&t.hasOwnProperty("callState")&&!$util.isInteger(t.callState))return"callState: integer expected";if(t.joinTime!=null&&t.hasOwnProperty("joinTime")&&!$util.isInteger(t.joinTime)&&!(t.joinTime&&$util.isInteger(t.joinTime.low)&&$util.isInteger(t.joinTime.high)))return"joinTime: integer|Long expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}if(t.permissions!=null&&t.hasOwnProperty("permissions")&&!$util.isInteger(t.permissions))return"permissions: integer expected";if(t.isPublished!=null&&t.hasOwnProperty("isPublished")&&typeof t.isPublished!="boolean")return"isPublished: boolean expected";if(t.behavior!=null&&t.hasOwnProperty("behavior")&&!$util.isInteger(t.behavior))return"behavior: integer expected";if(t.channelCache!=null&&t.hasOwnProperty("channelCache")){let i=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(t.channelCache);if(i)return"channelCache."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.User)return t;let i=new $root.com.quick.voice.proto.User;if(t.id!=null&&(i.id=String(t.id)),t.callAction!=null&&(i.callAction=t.callAction|0),t.callState!=null&&(i.callState=t.callState|0),t.joinTime!=null&&($util.Long?(i.joinTime=$util.Long.fromValue(t.joinTime)).unsigned=!1:typeof t.joinTime=="string"?i.joinTime=parseInt(t.joinTime,10):typeof t.joinTime=="number"?i.joinTime=t.joinTime:typeof t.joinTime=="object"&&(i.joinTime=new $util.LongBits(t.joinTime.low>>>0,t.joinTime.high>>>0).toNumber())),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}if(t.permissions!=null&&(i.permissions=t.permissions|0),t.isPublished!=null&&(i.isPublished=!!t.isPublished),t.behavior!=null&&(i.behavior=t.behavior|0),t.channelCache!=null){if(typeof t.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");i.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(t.channelCache)}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.id=""),t.id!=null&&t.hasOwnProperty("id")&&(_.id=t.id),t.callAction!=null&&t.hasOwnProperty("callAction")&&(_.callAction=t.callAction,i.oneofs&&(_._callAction="callAction")),t.callState!=null&&t.hasOwnProperty("callState")&&(_.callState=t.callState,i.oneofs&&(_._callState="callState")),t.joinTime!=null&&t.hasOwnProperty("joinTime")&&(typeof t.joinTime=="number"?_.joinTime=i.longs===String?String(t.joinTime):t.joinTime:_.joinTime=i.longs===String?$util.Long.prototype.toString.call(t.joinTime):i.longs===Number?new $util.LongBits(t.joinTime.low>>>0,t.joinTime.high>>>0).toNumber():t.joinTime,i.oneofs&&(_._joinTime="joinTime")),t.tracks&&t.tracks.length){_.tracks=[];for(let x=0;x<t.tracks.length;++x)_.tracks[x]=$root.com.quick.voice.proto.Track.toObject(t.tracks[x],i)}return t.permissions!=null&&t.hasOwnProperty("permissions")&&(_.permissions=t.permissions,i.oneofs&&(_._permissions="permissions")),t.isPublished!=null&&t.hasOwnProperty("isPublished")&&(_.isPublished=t.isPublished,i.oneofs&&(_._isPublished="isPublished")),t.behavior!=null&&t.hasOwnProperty("behavior")&&(_.behavior=t.behavior,i.oneofs&&(_._behavior="behavior")),t.channelCache!=null&&t.hasOwnProperty("channelCache")&&(_.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(t.channelCache,i),i.oneofs&&(_._channelCache="channelCache")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.User"},r})(),T.DataChannelCacheInfo=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return e;let t=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelCacheInfo"},r})(),T.DataChannel=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.dataChannelName="",r.prototype.id=null;let c;return Object.defineProperty(r.prototype,"_id",{get:$util.oneOfGetter(c=["id"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.dataChannelName!=null&&Object.hasOwnProperty.call(t,"dataChannelName")&&i.uint32(10).string(t.dataChannelName),t.id!=null&&Object.hasOwnProperty.call(t,"id")&&i.uint32(16).int32(t.id),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.DataChannel;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.dataChannelName=t.string();break}case 2:{C.id=t.int32();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.dataChannelName!=null&&t.hasOwnProperty("dataChannelName")&&!$util.isString(t.dataChannelName)?"dataChannelName: string expected":t.id!=null&&t.hasOwnProperty("id")&&!$util.isInteger(t.id)?"id: integer expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannel)return t;let i=new $root.com.quick.voice.proto.DataChannel;return t.dataChannelName!=null&&(i.dataChannelName=String(t.dataChannelName)),t.id!=null&&(i.id=t.id|0),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.dataChannelName=""),t.dataChannelName!=null&&t.hasOwnProperty("dataChannelName")&&(_.dataChannelName=t.dataChannelName),t.id!=null&&t.hasOwnProperty("id")&&(_.id=t.id,i.oneofs&&(_._id="id")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannel"},r})(),T.Login=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.appid="",r.prototype.userId="",r.prototype.sdkToken="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.appid!=null&&Object.hasOwnProperty.call(e,"appid")&&t.uint32(10).string(e.appid),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&t.uint32(26).string(e.sdkToken),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.Login;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.appid=e.string();break}case 2:{x.userId=e.string();break}case 3:{x.sdkToken=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.appid!=null&&e.hasOwnProperty("appid")&&!$util.isString(e.appid)?"appid: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Login)return e;let t=new $root.com.quick.voice.proto.Login;return e.appid!=null&&(t.appid=String(e.appid)),e.userId!=null&&(t.userId=String(e.userId)),e.sdkToken!=null&&(t.sdkToken=String(e.sdkToken)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.appid="",i.userId="",i.sdkToken=""),e.appid!=null&&e.hasOwnProperty("appid")&&(i.appid=e.appid),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(i.sdkToken=e.sdkToken),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Login"},r})(),T.Track=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.mid="",r.prototype.trackName=null,r.prototype.location=null,r.prototype.userId=null,r.prototype.code=null,r.prototype.desc=null,r.prototype.type=null,r.prototype.isValid=null,r.prototype.simulcast=null,r.prototype.lastRetry=null;let c;return Object.defineProperty(r.prototype,"_trackName",{get:$util.oneOfGetter(c=["trackName"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_location",{get:$util.oneOfGetter(c=["location"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_userId",{get:$util.oneOfGetter(c=["userId"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_code",{get:$util.oneOfGetter(c=["code"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_type",{get:$util.oneOfGetter(c=["type"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_isValid",{get:$util.oneOfGetter(c=["isValid"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_simulcast",{get:$util.oneOfGetter(c=["simulcast"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_lastRetry",{get:$util.oneOfGetter(c=["lastRetry"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.mid!=null&&Object.hasOwnProperty.call(t,"mid")&&i.uint32(10).string(t.mid),t.trackName!=null&&Object.hasOwnProperty.call(t,"trackName")&&i.uint32(18).string(t.trackName),t.location!=null&&Object.hasOwnProperty.call(t,"location")&&i.uint32(26).string(t.location),t.userId!=null&&Object.hasOwnProperty.call(t,"userId")&&i.uint32(34).string(t.userId),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(40).int32(t.code),t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(50).string(t.desc),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&i.uint32(56).int32(t.type),t.isValid!=null&&Object.hasOwnProperty.call(t,"isValid")&&i.uint32(64).bool(t.isValid),t.simulcast!=null&&Object.hasOwnProperty.call(t,"simulcast")&&i.uint32(74).string(t.simulcast),t.lastRetry!=null&&Object.hasOwnProperty.call(t,"lastRetry")&&i.uint32(80).bool(t.lastRetry),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.Track;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.mid=t.string();break}case 2:{C.trackName=t.string();break}case 3:{C.location=t.string();break}case 4:{C.userId=t.string();break}case 5:{C.code=t.int32();break}case 6:{C.desc=t.string();break}case 7:{C.type=t.int32();break}case 8:{C.isValid=t.bool();break}case 9:{C.simulcast=t.string();break}case 10:{C.lastRetry=t.bool();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.mid!=null&&t.hasOwnProperty("mid")&&!$util.isString(t.mid))return"mid: string expected";if(t.trackName!=null&&t.hasOwnProperty("trackName")&&!$util.isString(t.trackName))return"trackName: string expected";if(t.location!=null&&t.hasOwnProperty("location")&&!$util.isString(t.location))return"location: string expected";if(t.userId!=null&&t.hasOwnProperty("userId")&&!$util.isString(t.userId))return"userId: string expected";if(t.code!=null&&t.hasOwnProperty("code")&&!$util.isInteger(t.code))return"code: integer expected";if(t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc))return"desc: string expected";if(t.type!=null&&t.hasOwnProperty("type"))switch(t.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return t.isValid!=null&&t.hasOwnProperty("isValid")&&typeof t.isValid!="boolean"?"isValid: boolean expected":t.simulcast!=null&&t.hasOwnProperty("simulcast")&&!$util.isString(t.simulcast)?"simulcast: string expected":t.lastRetry!=null&&t.hasOwnProperty("lastRetry")&&typeof t.lastRetry!="boolean"?"lastRetry: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.Track)return t;let i=new $root.com.quick.voice.proto.Track;switch(t.mid!=null&&(i.mid=String(t.mid)),t.trackName!=null&&(i.trackName=String(t.trackName)),t.location!=null&&(i.location=String(t.location)),t.userId!=null&&(i.userId=String(t.userId)),t.code!=null&&(i.code=t.code|0),t.desc!=null&&(i.desc=String(t.desc)),t.type){default:if(typeof t.type=="number"){i.type=t.type;break}break;case"Microphone":case 0:i.type=0;break;case"Camera":case 1:i.type=1;break;case"Screen":case 2:i.type=2;break;case"SystemVoice":case 3:i.type=3;break}return t.isValid!=null&&(i.isValid=!!t.isValid),t.simulcast!=null&&(i.simulcast=String(t.simulcast)),t.lastRetry!=null&&(i.lastRetry=!!t.lastRetry),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.mid=""),t.mid!=null&&t.hasOwnProperty("mid")&&(_.mid=t.mid),t.trackName!=null&&t.hasOwnProperty("trackName")&&(_.trackName=t.trackName,i.oneofs&&(_._trackName="trackName")),t.location!=null&&t.hasOwnProperty("location")&&(_.location=t.location,i.oneofs&&(_._location="location")),t.userId!=null&&t.hasOwnProperty("userId")&&(_.userId=t.userId,i.oneofs&&(_._userId="userId")),t.code!=null&&t.hasOwnProperty("code")&&(_.code=t.code,i.oneofs&&(_._code="code")),t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),t.type!=null&&t.hasOwnProperty("type")&&(_.type=i.enums===String?$root.com.quick.voice.proto.TrackType[t.type]===void 0?t.type:$root.com.quick.voice.proto.TrackType[t.type]:t.type,i.oneofs&&(_._type="type")),t.isValid!=null&&t.hasOwnProperty("isValid")&&(_.isValid=t.isValid,i.oneofs&&(_._isValid="isValid")),t.simulcast!=null&&t.hasOwnProperty("simulcast")&&(_.simulcast=t.simulcast,i.oneofs&&(_._simulcast="simulcast")),t.lastRetry!=null&&t.hasOwnProperty("lastRetry")&&(_.lastRetry=t.lastRetry,i.oneofs&&(_._lastRetry="lastRetry")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.Track"},r})(),T.JoinReq=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.callType=0,r.prototype.token=null,r.prototype.lang=null,r.prototype.stt=null;let c;return Object.defineProperty(r.prototype,"_token",{get:$util.oneOfGetter(c=["token"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_lang",{get:$util.oneOfGetter(c=["lang"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_stt",{get:$util.oneOfGetter(c=["stt"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.callType!=null&&Object.hasOwnProperty.call(t,"callType")&&i.uint32(24).int32(t.callType),t.token!=null&&Object.hasOwnProperty.call(t,"token")&&i.uint32(34).string(t.token),t.lang!=null&&Object.hasOwnProperty.call(t,"lang")&&$root.com.quick.voice.proto.AiLangSetting.encode(t.lang,i.uint32(42).fork()).ldelim(),t.stt!=null&&Object.hasOwnProperty.call(t,"stt")&&i.uint32(48).bool(t.stt),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.JoinReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.callType=t.int32();break}case 4:{C.token=t.string();break}case 5:{C.lang=$root.com.quick.voice.proto.AiLangSetting.decode(t,t.uint32());break}case 6:{C.stt=t.bool();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}if(t.callType!=null&&t.hasOwnProperty("callType"))switch(t.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}if(t.token!=null&&t.hasOwnProperty("token")&&!$util.isString(t.token))return"token: string expected";if(t.lang!=null&&t.hasOwnProperty("lang")){let i=$root.com.quick.voice.proto.AiLangSetting.verify(t.lang);if(i)return"lang."+i}return t.stt!=null&&t.hasOwnProperty("stt")&&typeof t.stt!="boolean"?"stt: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.JoinReq)return t;let i=new $root.com.quick.voice.proto.JoinReq;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}switch(t.callType){default:if(typeof t.callType=="number"){i.callType=t.callType;break}break;case"Normal":case 0:i.callType=0;break;case"Meeting":case 1:i.callType=1;break;case"Live":case 2:i.callType=2;break}if(t.token!=null&&(i.token=String(t.token)),t.lang!=null){if(typeof t.lang!="object")throw TypeError(".com.quick.voice.proto.JoinReq.lang: object expected");i.lang=$root.com.quick.voice.proto.AiLangSetting.fromObject(t.lang)}return t.stt!=null&&(i.stt=!!t.stt),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null,_.callType=i.enums===String?"Normal":0),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.callType!=null&&t.hasOwnProperty("callType")&&(_.callType=i.enums===String?$root.com.quick.voice.proto.CallType[t.callType]===void 0?t.callType:$root.com.quick.voice.proto.CallType[t.callType]:t.callType),t.token!=null&&t.hasOwnProperty("token")&&(_.token=t.token,i.oneofs&&(_._token="token")),t.lang!=null&&t.hasOwnProperty("lang")&&(_.lang=$root.com.quick.voice.proto.AiLangSetting.toObject(t.lang,i),i.oneofs&&(_._lang="lang")),t.stt!=null&&t.hasOwnProperty("stt")&&(_.stt=t.stt,i.oneofs&&(_._stt="stt")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.JoinReq"},r})(),T.JoinRsp=(function(){function r(c){if(this.roomUsers=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.roomUsers=$util.emptyArray,r.prototype.callType=0,r.prototype.wifiOnly=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.roomUsers!=null&&e.roomUsers.length)for(let i=0;i<e.roomUsers.length;++i)$root.com.quick.voice.proto.User.encode(e.roomUsers[i],t.uint32(18).fork()).ldelim();return e.callType!=null&&Object.hasOwnProperty.call(e,"callType")&&t.uint32(24).int32(e.callType),e.wifiOnly!=null&&Object.hasOwnProperty.call(e,"wifiOnly")&&t.uint32(32).bool(e.wifiOnly),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.JoinRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.roomUsers&&x.roomUsers.length||(x.roomUsers=[]),x.roomUsers.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 3:{x.callType=e.int32();break}case 4:{x.wifiOnly=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.roomUsers!=null&&e.hasOwnProperty("roomUsers")){if(!Array.isArray(e.roomUsers))return"roomUsers: array expected";for(let t=0;t<e.roomUsers.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.roomUsers[t]);if(i)return"roomUsers."+i}}if(e.callType!=null&&e.hasOwnProperty("callType"))switch(e.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return e.wifiOnly!=null&&e.hasOwnProperty("wifiOnly")&&typeof e.wifiOnly!="boolean"?"wifiOnly: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinRsp)return e;let t=new $root.com.quick.voice.proto.JoinRsp;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.roomUsers){if(!Array.isArray(e.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");t.roomUsers=[];for(let i=0;i<e.roomUsers.length;++i){if(typeof e.roomUsers[i]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");t.roomUsers[i]=$root.com.quick.voice.proto.User.fromObject(e.roomUsers[i])}}switch(e.callType){default:if(typeof e.callType=="number"){t.callType=e.callType;break}break;case"Normal":case 0:t.callType=0;break;case"Meeting":case 1:t.callType=1;break;case"Live":case 2:t.callType=2;break}return e.wifiOnly!=null&&(t.wifiOnly=!!e.wifiOnly),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.roomUsers=[]),t.defaults&&(i.roomId="",i.callType=t.enums===String?"Normal":0,i.wifiOnly=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.roomUsers&&e.roomUsers.length){i.roomUsers=[];for(let _=0;_<e.roomUsers.length;++_)i.roomUsers[_]=$root.com.quick.voice.proto.User.toObject(e.roomUsers[_],t)}return e.callType!=null&&e.hasOwnProperty("callType")&&(i.callType=t.enums===String?$root.com.quick.voice.proto.CallType[e.callType]===void 0?e.callType:$root.com.quick.voice.proto.CallType[e.callType]:e.callType),e.wifiOnly!=null&&e.hasOwnProperty("wifiOnly")&&(i.wifiOnly=e.wifiOnly),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinRsp"},r})(),T.JoinNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.JoinNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.JoinNotify)return e;let t=new $root.com.quick.voice.proto.JoinNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.JoinNotify"},r})(),T.ConnectCFReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(10).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ConnectCFReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.sdp=e.string():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ConnectCFReq)return e;let t=new $root.com.quick.voice.proto.ConnectCFReq;return e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sdp=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ConnectCFReq"},r})(),T.ConnectCFRsp=(function(){function r(e){if(this.subscribeUsers=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.subscribeUsers=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.subscribeUsers!=null&&t.subscribeUsers.length)for(let _=0;_<t.subscribeUsers.length;++_)$root.com.quick.voice.proto.User.encode(t.subscribeUsers[_],i.uint32(18).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.ConnectCFRsp;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.remoteSdp=t.string();break}case 2:{C.subscribeUsers&&C.subscribeUsers.length||(C.subscribeUsers=[]),C.subscribeUsers.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 3:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp))return"remoteSdp: string expected";if(t.subscribeUsers!=null&&t.hasOwnProperty("subscribeUsers")){if(!Array.isArray(t.subscribeUsers))return"subscribeUsers: array expected";for(let i=0;i<t.subscribeUsers.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.subscribeUsers[i]);if(_)return"subscribeUsers."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ConnectCFRsp)return t;let i=new $root.com.quick.voice.proto.ConnectCFRsp;if(t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.subscribeUsers){if(!Array.isArray(t.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");i.subscribeUsers=[];for(let _=0;_<t.subscribeUsers.length;++_){if(typeof t.subscribeUsers[_]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");i.subscribeUsers[_]=$root.com.quick.voice.proto.User.fromObject(t.subscribeUsers[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.subscribeUsers=[]),i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.subscribeUsers&&t.subscribeUsers.length){_.subscribeUsers=[];for(let x=0;x<t.subscribeUsers.length;++x)_.subscribeUsers[x]=$root.com.quick.voice.proto.User.toObject(t.subscribeUsers[x],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ConnectCFRsp"},r})(),T.PublishReq=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.sdp="",r.prototype.tracks=$util.emptyArray,r.prototype.callAction=0,r.prototype.recreate=null,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_recreate",{get:$util.oneOfGetter(c=["recreate"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.sdp!=null&&Object.hasOwnProperty.call(t,"sdp")&&i.uint32(10).string(t.sdp),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(18).fork()).ldelim();return t.callAction!=null&&Object.hasOwnProperty.call(t,"callAction")&&i.uint32(24).int32(t.callAction),t.recreate!=null&&Object.hasOwnProperty.call(t,"recreate")&&i.uint32(32).bool(t.recreate),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(42).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.PublishReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.sdp=t.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}case 3:{C.callAction=t.int32();break}case 4:{C.recreate=t.bool();break}case 5:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.sdp!=null&&t.hasOwnProperty("sdp")&&!$util.isString(t.sdp))return"sdp: string expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}return t.callAction!=null&&t.hasOwnProperty("callAction")&&!$util.isInteger(t.callAction)?"callAction: integer expected":t.recreate!=null&&t.hasOwnProperty("recreate")&&typeof t.recreate!="boolean"?"recreate: boolean expected":t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishReq)return t;let i=new $root.com.quick.voice.proto.PublishReq;if(t.sdp!=null&&(i.sdp=String(t.sdp)),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}return t.callAction!=null&&(i.callAction=t.callAction|0),t.recreate!=null&&(i.recreate=!!t.recreate),t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.sdp="",_.callAction=0),t.sdp!=null&&t.hasOwnProperty("sdp")&&(_.sdp=t.sdp),t.tracks&&t.tracks.length){_.tracks=[];for(let x=0;x<t.tracks.length;++x)_.tracks[x]=$root.com.quick.voice.proto.Track.toObject(t.tracks[x],i)}return t.callAction!=null&&t.hasOwnProperty("callAction")&&(_.callAction=t.callAction),t.recreate!=null&&t.hasOwnProperty("recreate")&&(_.recreate=t.recreate,i.oneofs&&(_._recreate="recreate")),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishReq"},r})(),T.PublishRsp=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(18).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.PublishRsp;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.remoteSdp=t.string();break}case 2:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp)?"remoteSdp: string expected":t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishRsp)return t;let i=new $root.com.quick.voice.proto.PublishRsp;return t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishRsp"},r})(),T.PublishNotify=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.PublishNotify;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.PublishNotify)return t;let i=new $root.com.quick.voice.proto.PublishNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.PublishNotify"},r})(),T.SubscribeReq=(function(){function r(e){if(this.users=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.users=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.users!=null&&t.users.length)for(let _=0;_<t.users.length;++_)$root.com.quick.voice.proto.User.encode(t.users[_],i.uint32(10).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(18).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SubscribeReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 2:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.users!=null&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(let i=0;i<t.users.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.users[i]);if(_)return"users."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SubscribeReq)return t;let i=new $root.com.quick.voice.proto.SubscribeReq;if(t.users){if(!Array.isArray(t.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");i.users=[];for(let _=0;_<t.users.length;++_){if(typeof t.users[_]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");i.users[_]=$root.com.quick.voice.proto.User.fromObject(t.users[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.users=[]),t.users&&t.users.length){_.users=[];for(let x=0;x<t.users.length;++x)_.users[x]=$root.com.quick.voice.proto.User.toObject(t.users[x],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SubscribeReq"},r})(),T.SubscribeRsp=(function(){function r(e){if(this.users=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.remoteSdp="",r.prototype.users=$util.emptyArray,r.prototype.session=null;let c;return Object.defineProperty(r.prototype,"_session",{get:$util.oneOfGetter(c=["session"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.remoteSdp!=null&&Object.hasOwnProperty.call(t,"remoteSdp")&&i.uint32(10).string(t.remoteSdp),t.users!=null&&t.users.length)for(let _=0;_<t.users.length;++_)$root.com.quick.voice.proto.User.encode(t.users[_],i.uint32(18).fork()).ldelim();return t.session!=null&&Object.hasOwnProperty.call(t,"session")&&i.uint32(26).string(t.session),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SubscribeRsp;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.remoteSdp=t.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(t,t.uint32()));break}case 3:{C.session=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&!$util.isString(t.remoteSdp))return"remoteSdp: string expected";if(t.users!=null&&t.hasOwnProperty("users")){if(!Array.isArray(t.users))return"users: array expected";for(let i=0;i<t.users.length;++i){let _=$root.com.quick.voice.proto.User.verify(t.users[i]);if(_)return"users."+_}}return t.session!=null&&t.hasOwnProperty("session")&&!$util.isString(t.session)?"session: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SubscribeRsp)return t;let i=new $root.com.quick.voice.proto.SubscribeRsp;if(t.remoteSdp!=null&&(i.remoteSdp=String(t.remoteSdp)),t.users){if(!Array.isArray(t.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");i.users=[];for(let _=0;_<t.users.length;++_){if(typeof t.users[_]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");i.users[_]=$root.com.quick.voice.proto.User.fromObject(t.users[_])}}return t.session!=null&&(i.session=String(t.session)),i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.users=[]),i.defaults&&(_.remoteSdp=""),t.remoteSdp!=null&&t.hasOwnProperty("remoteSdp")&&(_.remoteSdp=t.remoteSdp),t.users&&t.users.length){_.users=[];for(let x=0;x<t.users.length;++x)_.users[x]=$root.com.quick.voice.proto.User.toObject(t.users[x],i)}return t.session!=null&&t.hasOwnProperty("session")&&(_.session=t.session,i.oneofs&&(_._session="session")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SubscribeRsp"},r})(),T.RenegotiateReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(18).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.RenegotiateReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.sdp=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RenegotiateReq)return e;let t=new $root.com.quick.voice.proto.RenegotiateReq;return e.userId!=null&&(t.userId=String(e.userId)),e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.sdp=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RenegotiateReq"},r})(),T.QuitReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(18).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.QuitReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.roomId=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.QuitReq)return e;let t=new $root.com.quick.voice.proto.QuitReq;return e.userId!=null&&(t.userId=String(e.userId)),e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.roomId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.QuitReq"},r})(),T.QuitNotify=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.code=null,r.prototype.desc=null;let c;return Object.defineProperty(r.prototype,"_code",{get:$util.oneOfGetter(c=["code"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(24).int32(t.code),t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(34).string(t.desc),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.QuitNotify;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.code=t.int32();break}case 4:{C.desc=t.string();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}return t.code!=null&&t.hasOwnProperty("code")&&!$util.isInteger(t.code)?"code: integer expected":t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc)?"desc: string expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.QuitNotify)return t;let i=new $root.com.quick.voice.proto.QuitNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}return t.code!=null&&(i.code=t.code|0),t.desc!=null&&(i.desc=String(t.desc)),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.code!=null&&t.hasOwnProperty("code")&&(_.code=t.code,i.oneofs&&(_._code="code")),t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.QuitNotify"},r})(),T.TokenExpireNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.TokenExpireNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.roomId=e.string():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.TokenExpireNotify)return e;let t=new $root.com.quick.voice.proto.TokenExpireNotify;return e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.TokenExpireNotify"},r})(),T.UpdateTokenReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.sdkToken="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.sdkToken!=null&&Object.hasOwnProperty.call(e,"sdkToken")&&t.uint32(18).string(e.sdkToken),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateTokenReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.sdkToken=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&!$util.isString(e.sdkToken)?"sdkToken: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTokenReq)return e;let t=new $root.com.quick.voice.proto.UpdateTokenReq;return e.roomId!=null&&(t.roomId=String(e.roomId)),e.sdkToken!=null&&(t.sdkToken=String(e.sdkToken)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.sdkToken=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.sdkToken!=null&&e.hasOwnProperty("sdkToken")&&(i.sdkToken=e.sdkToken),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTokenReq"},r})(),T.NetQualityChange=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.roomId="",r.prototype.egress=0,r.prototype.ingress=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(18).string(e.roomId),e.egress!=null&&Object.hasOwnProperty.call(e,"egress")&&t.uint32(24).int32(e.egress),e.ingress!=null&&Object.hasOwnProperty.call(e,"ingress")&&t.uint32(32).int32(e.ingress),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.NetQualityChange;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.roomId=e.string();break}case 3:{x.egress=e.int32();break}case 4:{x.ingress=e.int32();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.egress!=null&&e.hasOwnProperty("egress")&&!$util.isInteger(e.egress)?"egress: integer expected":e.ingress!=null&&e.hasOwnProperty("ingress")&&!$util.isInteger(e.ingress)?"ingress: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityChange)return e;let t=new $root.com.quick.voice.proto.NetQualityChange;return e.userId!=null&&(t.userId=String(e.userId)),e.roomId!=null&&(t.roomId=String(e.roomId)),e.egress!=null&&(t.egress=e.egress|0),e.ingress!=null&&(t.ingress=e.ingress|0),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.roomId="",i.egress=0,i.ingress=0),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.egress!=null&&e.hasOwnProperty("egress")&&(i.egress=e.egress),e.ingress!=null&&e.hasOwnProperty("ingress")&&(i.ingress=e.ingress),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityChange"},r})(),T.NetQualityNotify=(function(){function r(c){if(this.qualities=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.qualities=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.qualities!=null&&e.qualities.length)for(let i=0;i<e.qualities.length;++i)$root.com.quick.voice.proto.NetQualityChange.encode(e.qualities[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.NetQualityNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.qualities&&x.qualities.length||(x.qualities=[]),x.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.qualities!=null&&e.hasOwnProperty("qualities")){if(!Array.isArray(e.qualities))return"qualities: array expected";for(let t=0;t<e.qualities.length;++t){let i=$root.com.quick.voice.proto.NetQualityChange.verify(e.qualities[t]);if(i)return"qualities."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.NetQualityNotify)return e;let t=new $root.com.quick.voice.proto.NetQualityNotify;if(e.qualities){if(!Array.isArray(e.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");t.qualities=[];for(let i=0;i<e.qualities.length;++i){if(typeof e.qualities[i]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");t.qualities[i]=$root.com.quick.voice.proto.NetQualityChange.fromObject(e.qualities[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.qualities=[]),e.qualities&&e.qualities.length){i.qualities=[];for(let _=0;_<e.qualities.length;++_)i.qualities[_]=$root.com.quick.voice.proto.NetQualityChange.toObject(e.qualities[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.NetQualityNotify"},r})(),T.UpdateCall=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateCall;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateCall)return e;let t=new $root.com.quick.voice.proto.UpdateCall;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateCall"},r})(),T.P2PUserSyncItem=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.types=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.types!=null&&e.types.length){t.uint32(18).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PUserSyncItem;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{if(x.types&&x.types.length||(x.types=[]),(C&7)===2){let F=e.uint32()+e.pos;for(;e.pos<F;)x.types.push(e.int32())}else x.types.push(e.int32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PUserSyncItem)return e;let t=new $root.com.quick.voice.proto.P2PUserSyncItem;if(e.userId!=null&&(t.userId=String(e.userId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PUserSyncItem.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PUserSyncItem"},r})(),T.P2PUserSyncList=(function(){function r(c){if(this.push=[],this.pull=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.push=$util.emptyArray,r.prototype.pull=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.push!=null&&e.push.length)for(let i=0;i<e.push.length;++i)$root.com.quick.voice.proto.P2PUserSyncItem.encode(e.push[i],t.uint32(10).fork()).ldelim();if(e.pull!=null&&e.pull.length)for(let i=0;i<e.pull.length;++i)$root.com.quick.voice.proto.P2PUserSyncItem.encode(e.pull[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PUserSyncList;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.push&&x.push.length||(x.push=[]),x.push.push($root.com.quick.voice.proto.P2PUserSyncItem.decode(e,e.uint32()));break}case 2:{x.pull&&x.pull.length||(x.pull=[]),x.pull.push($root.com.quick.voice.proto.P2PUserSyncItem.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.push!=null&&e.hasOwnProperty("push")){if(!Array.isArray(e.push))return"push: array expected";for(let t=0;t<e.push.length;++t){let i=$root.com.quick.voice.proto.P2PUserSyncItem.verify(e.push[t]);if(i)return"push."+i}}if(e.pull!=null&&e.hasOwnProperty("pull")){if(!Array.isArray(e.pull))return"pull: array expected";for(let t=0;t<e.pull.length;++t){let i=$root.com.quick.voice.proto.P2PUserSyncItem.verify(e.pull[t]);if(i)return"pull."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PUserSyncList)return e;let t=new $root.com.quick.voice.proto.P2PUserSyncList;if(e.push){if(!Array.isArray(e.push))throw TypeError(".com.quick.voice.proto.P2PUserSyncList.push: array expected");t.push=[];for(let i=0;i<e.push.length;++i){if(typeof e.push[i]!="object")throw TypeError(".com.quick.voice.proto.P2PUserSyncList.push: object expected");t.push[i]=$root.com.quick.voice.proto.P2PUserSyncItem.fromObject(e.push[i])}}if(e.pull){if(!Array.isArray(e.pull))throw TypeError(".com.quick.voice.proto.P2PUserSyncList.pull: array expected");t.pull=[];for(let i=0;i<e.pull.length;++i){if(typeof e.pull[i]!="object")throw TypeError(".com.quick.voice.proto.P2PUserSyncList.pull: object expected");t.pull[i]=$root.com.quick.voice.proto.P2PUserSyncItem.fromObject(e.pull[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.push=[],i.pull=[]),e.push&&e.push.length){i.push=[];for(let _=0;_<e.push.length;++_)i.push[_]=$root.com.quick.voice.proto.P2PUserSyncItem.toObject(e.push[_],t)}if(e.pull&&e.pull.length){i.pull=[];for(let _=0;_<e.pull.length;++_)i.pull[_]=$root.com.quick.voice.proto.P2PUserSyncItem.toObject(e.pull[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PUserSyncList"},r})(),T.SyncRoomInfoReq=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.user=null,r.prototype.p2pState=null;let c;return Object.defineProperty(r.prototype,"_p2pState",{get:$util.oneOfGetter(c=["p2pState"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.user!=null&&Object.hasOwnProperty.call(t,"user")&&$root.com.quick.voice.proto.User.encode(t.user,i.uint32(18).fork()).ldelim(),t.p2pState!=null&&Object.hasOwnProperty.call(t,"p2pState")&&$root.com.quick.voice.proto.P2PUserSyncList.encode(t.p2pState,i.uint32(26).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.decode(t,t.uint32());break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.user!=null&&t.hasOwnProperty("user")){let i=$root.com.quick.voice.proto.User.verify(t.user);if(i)return"user."+i}if(t.p2pState!=null&&t.hasOwnProperty("p2pState")){let i=$root.com.quick.voice.proto.P2PUserSyncList.verify(t.p2pState);if(i)return"p2pState."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return t;let i=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.user!=null){if(typeof t.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");i.user=$root.com.quick.voice.proto.User.fromObject(t.user)}if(t.p2pState!=null){if(typeof t.p2pState!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.p2pState: object expected");i.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.fromObject(t.p2pState)}return i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.roomId="",_.user=null),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.user!=null&&t.hasOwnProperty("user")&&(_.user=$root.com.quick.voice.proto.User.toObject(t.user,i)),t.p2pState!=null&&t.hasOwnProperty("p2pState")&&(_.p2pState=$root.com.quick.voice.proto.P2PUserSyncList.toObject(t.p2pState,i),i.oneofs&&(_._p2pState="p2pState")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SyncRoomInfoReq"},r})(),T.SyncRoomInfoRsp=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.isValid=!1,r.prototype.users=$util.emptyArray,r.prototype.isActive=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.isValid!=null&&Object.hasOwnProperty.call(e,"isValid")&&t.uint32(16).bool(e.isValid),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(26).fork()).ldelim();return e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&t.uint32(32).bool(e.isActive),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.isValid=e.bool();break}case 3:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}case 4:{x.isActive=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.isValid!=null&&e.hasOwnProperty("isValid")&&typeof e.isValid!="boolean")return"isValid: boolean expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return e;let t=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.isValid!=null&&(t.isValid=!!e.isValid),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return e.isActive!=null&&(t.isActive=!!e.isActive),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId="",i.isValid=!1,i.isActive=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.isValid!=null&&e.hasOwnProperty("isValid")&&(i.isValid=e.isValid),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return e.isActive!=null&&e.hasOwnProperty("isActive")&&(i.isActive=e.isActive),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.SyncRoomInfoRsp"},r})(),T.UpdateTime=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.time!=null&&Object.hasOwnProperty.call(e,"time")&&t.uint32(8).int64(e.time),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateTime;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.time=e.int64():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.time!=null&&e.hasOwnProperty("time")&&!$util.isInteger(e.time)&&!(e.time&&$util.isInteger(e.time.low)&&$util.isInteger(e.time.high))?"time: integer|Long expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTime)return e;let t=new $root.com.quick.voice.proto.UpdateTime;return e.time!=null&&($util.Long?(t.time=$util.Long.fromValue(e.time)).unsigned=!1:typeof e.time=="string"?t.time=parseInt(e.time,10):typeof e.time=="number"?t.time=e.time:typeof e.time=="object"&&(t.time=new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults)if($util.Long){let _=new $util.Long(0,0,!1);i.time=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.time=t.longs===String?"0":0;return e.time!=null&&e.hasOwnProperty("time")&&(typeof e.time=="number"?i.time=t.longs===String?String(e.time):e.time:i.time=t.longs===String?$util.Long.prototype.toString.call(e.time):t.longs===Number?new $util.LongBits(e.time.low>>>0,e.time.high>>>0).toNumber():e.time),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTime"},r})(),T.CloseTrackReq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdp="",r.prototype.tracks=$util.emptyArray,r.prototype.roomId="",r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(10).string(e.sdp),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(26).string(e.roomId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CloseTrackReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sdp=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{x.roomId=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp))return"sdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackReq)return e;let t=new $root.com.quick.voice.proto.CloseTrackReq;if(e.sdp!=null&&(t.sdp=String(e.sdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return e.roomId!=null&&(t.roomId=String(e.roomId)),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.sdp="",i.roomId=""),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackReq"},r})(),T.CloseTrackRsp=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.remoteSdp="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.remoteSdp!=null&&Object.hasOwnProperty.call(e,"remoteSdp")&&t.uint32(10).string(e.remoteSdp),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CloseTrackRsp;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.remoteSdp=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&!$util.isString(e.remoteSdp))return"remoteSdp: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackRsp)return e;let t=new $root.com.quick.voice.proto.CloseTrackRsp;if(e.remoteSdp!=null&&(t.remoteSdp=String(e.remoteSdp)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.remoteSdp=""),e.remoteSdp!=null&&e.hasOwnProperty("remoteSdp")&&(i.remoteSdp=e.remoteSdp),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackRsp"},r})(),T.CloseTrackNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(10).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CloseTrackNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32()):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CloseTrackNotify)return e;let t=new $root.com.quick.voice.proto.CloseTrackNotify;if(e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.user=null),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CloseTrackNotify"},r})(),T.TrackType=(function(){const r={},c=Object.create(r);return c[r[0]="Microphone"]=0,c[r[1]="Camera"]=1,c[r[2]="Screen"]=2,c[r[3]="SystemVoice"]=3,c})(),T.UpdatePermissions=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.user=null,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.user!=null&&Object.hasOwnProperty.call(e,"user")&&$root.com.quick.voice.proto.User.encode(e.user,t.uint32(18).fork()).ldelim(),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdatePermissions;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.user=$root.com.quick.voice.proto.User.decode(e,e.uint32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.user!=null&&e.hasOwnProperty("user")){let t=$root.com.quick.voice.proto.User.verify(e.user);if(t)return"user."+t}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdatePermissions)return e;let t=new $root.com.quick.voice.proto.UpdatePermissions;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.user!=null){if(typeof e.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");t.user=$root.com.quick.voice.proto.User.fromObject(e.user)}return t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.roomId="",i.user=null),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.user!=null&&e.hasOwnProperty("user")&&(i.user=$root.com.quick.voice.proto.User.toObject(e.user,t)),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdatePermissions"},r})(),T.CallType=(function(){const r={},c=Object.create(r);return c[r[0]="Normal"]=0,c[r[1]="Meeting"]=1,c[r[2]="Live"]=2,c})(),T.QuitNotifyCode=(function(){const r={},c=Object.create(r);return c[r[0]="NormalQuit"]=0,c[r[2021]="Timeout"]=2021,c[r[2011]="TokenExpired"]=2011,c[r[2022]="KickOut"]=2022,c[r[2023]="EndPk"]=2023,c[r[2024]="EndLive"]=2024,c})(),T.UserBehavior=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.type=0,r.prototype.behavior=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(8).int32(e.type),e.behavior!=null&&Object.hasOwnProperty.call(e,"behavior")&&t.uint32(16).bool(e.behavior),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UserBehavior;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.type=e.int32();break}case 2:{x.behavior=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.behavior!=null&&e.hasOwnProperty("behavior")&&typeof e.behavior!="boolean"?"behavior: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserBehavior)return e;let t=new $root.com.quick.voice.proto.UserBehavior;switch(e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Microphone":case 0:t.type=0;break;case"Camera":case 1:t.type=1;break;case"Screen":case 2:t.type=2;break;case"SystemVoice":case 3:t.type=3;break}return e.behavior!=null&&(t.behavior=!!e.behavior),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.type=t.enums===String?"Microphone":0,i.behavior=!1),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.TrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.TrackType[e.type]:e.type),e.behavior!=null&&e.hasOwnProperty("behavior")&&(i.behavior=e.behavior),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserBehavior"},r})(),T.PreventUser=(function(){function r(c){if(this.behaviors=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.id="",r.prototype.behaviors=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.id!=null&&Object.hasOwnProperty.call(e,"id")&&t.uint32(10).string(e.id),e.behaviors!=null&&e.behaviors.length)for(let i=0;i<e.behaviors.length;++i)$root.com.quick.voice.proto.UserBehavior.encode(e.behaviors[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.PreventUser;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.id=e.string();break}case 2:{x.behaviors&&x.behaviors.length||(x.behaviors=[]),x.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.id!=null&&e.hasOwnProperty("id")&&!$util.isString(e.id))return"id: string expected";if(e.behaviors!=null&&e.hasOwnProperty("behaviors")){if(!Array.isArray(e.behaviors))return"behaviors: array expected";for(let t=0;t<e.behaviors.length;++t){let i=$root.com.quick.voice.proto.UserBehavior.verify(e.behaviors[t]);if(i)return"behaviors."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUser)return e;let t=new $root.com.quick.voice.proto.PreventUser;if(e.id!=null&&(t.id=String(e.id)),e.behaviors){if(!Array.isArray(e.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");t.behaviors=[];for(let i=0;i<e.behaviors.length;++i){if(typeof e.behaviors[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");t.behaviors[i]=$root.com.quick.voice.proto.UserBehavior.fromObject(e.behaviors[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.behaviors=[]),t.defaults&&(i.id=""),e.id!=null&&e.hasOwnProperty("id")&&(i.id=e.id),e.behaviors&&e.behaviors.length){i.behaviors=[];for(let _=0;_<e.behaviors.length;++_)i.behaviors[_]=$root.com.quick.voice.proto.UserBehavior.toObject(e.behaviors[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUser"},r})(),T.PreventUsersBehaviorReq=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.PreventUser.encode(e.users[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.PreventUser.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.PreventUser.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return e;let t=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");t.users[i]=$root.com.quick.voice.proto.PreventUser.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.PreventUser.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorReq"},r})(),T.PreventUsersBehaviorNotify=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.User.encode(e.users[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.User.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.User.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return e;let t=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");t.users[i]=$root.com.quick.voice.proto.User.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.User.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},r})(),T.AccelerationAreas=(function(){const r={},c=Object.create(r);return c[r[0]="chinaMainland"]=0,c[r[1]="global"]=1,c[r[2]="overseas"]=2,c})(),T.CountMethods=(function(){const r={},c=Object.create(r);return c[r[0]="flow"]=0,c[r[1]="minutes"]=1,c})(),T.BaseCDNAddress=(function(){function r(c){if(this.urlMap={},c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.area=0,r.prototype.countType=0,r.prototype.urlMap=$util.emptyObject,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.area!=null&&Object.hasOwnProperty.call(e,"area")&&t.uint32(8).int32(e.area),e.countType!=null&&Object.hasOwnProperty.call(e,"countType")&&t.uint32(16).int32(e.countType),e.urlMap!=null&&Object.hasOwnProperty.call(e,"urlMap"))for(let i=Object.keys(e.urlMap),_=0;_<i.length;++_)t.uint32(26).fork().uint32(10).string(i[_]).uint32(18).string(e.urlMap[i[_]]).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.BaseCDNAddress,C,F;for(;e.pos<_;){let j=e.uint32();if(j===i)break;switch(j>>>3){case 1:{x.area=e.int32();break}case 2:{x.countType=e.int32();break}case 3:{x.urlMap===$util.emptyObject&&(x.urlMap={});let Z=e.uint32()+e.pos;for(C="",F="";e.pos<Z;){let ee=e.uint32();switch(ee>>>3){case 1:C=e.string();break;case 2:F=e.string();break;default:e.skipType(ee&7);break}}x.urlMap[C]=F;break}default:e.skipType(j&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.area!=null&&e.hasOwnProperty("area"))switch(e.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(e.countType!=null&&e.hasOwnProperty("countType"))switch(e.countType){default:return"countType: enum value expected";case 0:case 1:break}if(e.urlMap!=null&&e.hasOwnProperty("urlMap")){if(!$util.isObject(e.urlMap))return"urlMap: object expected";let t=Object.keys(e.urlMap);for(let i=0;i<t.length;++i)if(!$util.isString(e.urlMap[t[i]]))return"urlMap: string{k:string} expected"}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.BaseCDNAddress)return e;let t=new $root.com.quick.voice.proto.BaseCDNAddress;switch(e.area){default:if(typeof e.area=="number"){t.area=e.area;break}break;case"chinaMainland":case 0:t.area=0;break;case"global":case 1:t.area=1;break;case"overseas":case 2:t.area=2;break}switch(e.countType){default:if(typeof e.countType=="number"){t.countType=e.countType;break}break;case"flow":case 0:t.countType=0;break;case"minutes":case 1:t.countType=1;break}if(e.urlMap){if(typeof e.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");t.urlMap={};for(let i=Object.keys(e.urlMap),_=0;_<i.length;++_)t.urlMap[i[_]]=String(e.urlMap[i[_]])}return t},r.toObject=function(e,t){t||(t={});let i={};(t.objects||t.defaults)&&(i.urlMap={}),t.defaults&&(i.area=t.enums===String?"chinaMainland":0,i.countType=t.enums===String?"flow":0),e.area!=null&&e.hasOwnProperty("area")&&(i.area=t.enums===String?$root.com.quick.voice.proto.AccelerationAreas[e.area]===void 0?e.area:$root.com.quick.voice.proto.AccelerationAreas[e.area]:e.area),e.countType!=null&&e.hasOwnProperty("countType")&&(i.countType=t.enums===String?$root.com.quick.voice.proto.CountMethods[e.countType]===void 0?e.countType:$root.com.quick.voice.proto.CountMethods[e.countType]:e.countType);let _;if(e.urlMap&&(_=Object.keys(e.urlMap)).length){i.urlMap={};for(let x=0;x<_.length;++x)i.urlMap[_[x]]=e.urlMap[_[x]]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.BaseCDNAddress"},r})(),T.CDNPlayAddressNotify=(function(){function r(e){if(this.standLines=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.m3u8=null,r.prototype.rtmp=null,r.prototype.flv=null,r.prototype.rtmps=null,r.prototype.mainLine=null,r.prototype.standLines=$util.emptyArray;let c;return Object.defineProperty(r.prototype,"_m3u8",{get:$util.oneOfGetter(c=["m3u8"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_rtmp",{get:$util.oneOfGetter(c=["rtmp"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_flv",{get:$util.oneOfGetter(c=["flv"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_rtmps",{get:$util.oneOfGetter(c=["rtmps"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_mainLine",{get:$util.oneOfGetter(c=["mainLine"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.m3u8!=null&&Object.hasOwnProperty.call(t,"m3u8")&&i.uint32(18).string(t.m3u8),t.rtmp!=null&&Object.hasOwnProperty.call(t,"rtmp")&&i.uint32(26).string(t.rtmp),t.flv!=null&&Object.hasOwnProperty.call(t,"flv")&&i.uint32(34).string(t.flv),t.rtmps!=null&&Object.hasOwnProperty.call(t,"rtmps")&&i.uint32(42).string(t.rtmps),t.mainLine!=null&&Object.hasOwnProperty.call(t,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(t.mainLine,i.uint32(50).fork()).ldelim(),t.standLines!=null&&t.standLines.length)for(let _=0;_<t.standLines.length;++_)$root.com.quick.voice.proto.BaseCDNAddress.encode(t.standLines[_],i.uint32(58).fork()).ldelim();return i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.m3u8=t.string();break}case 3:{C.rtmp=t.string();break}case 4:{C.flv=t.string();break}case 5:{C.rtmps=t.string();break}case 6:{C.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(t,t.uint32());break}case 7:{C.standLines&&C.standLines.length||(C.standLines=[]),C.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(t,t.uint32()));break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.m3u8!=null&&t.hasOwnProperty("m3u8")&&!$util.isString(t.m3u8))return"m3u8: string expected";if(t.rtmp!=null&&t.hasOwnProperty("rtmp")&&!$util.isString(t.rtmp))return"rtmp: string expected";if(t.flv!=null&&t.hasOwnProperty("flv")&&!$util.isString(t.flv))return"flv: string expected";if(t.rtmps!=null&&t.hasOwnProperty("rtmps")&&!$util.isString(t.rtmps))return"rtmps: string expected";if(t.mainLine!=null&&t.hasOwnProperty("mainLine")){let i=$root.com.quick.voice.proto.BaseCDNAddress.verify(t.mainLine);if(i)return"mainLine."+i}if(t.standLines!=null&&t.hasOwnProperty("standLines")){if(!Array.isArray(t.standLines))return"standLines: array expected";for(let i=0;i<t.standLines.length;++i){let _=$root.com.quick.voice.proto.BaseCDNAddress.verify(t.standLines[i]);if(_)return"standLines."+_}}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return t;let i=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.m3u8!=null&&(i.m3u8=String(t.m3u8)),t.rtmp!=null&&(i.rtmp=String(t.rtmp)),t.flv!=null&&(i.flv=String(t.flv)),t.rtmps!=null&&(i.rtmps=String(t.rtmps)),t.mainLine!=null){if(typeof t.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");i.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(t.mainLine)}if(t.standLines){if(!Array.isArray(t.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");i.standLines=[];for(let _=0;_<t.standLines.length;++_){if(typeof t.standLines[_]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");i.standLines[_]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(t.standLines[_])}}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.standLines=[]),i.defaults&&(_.roomId=""),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.m3u8!=null&&t.hasOwnProperty("m3u8")&&(_.m3u8=t.m3u8,i.oneofs&&(_._m3u8="m3u8")),t.rtmp!=null&&t.hasOwnProperty("rtmp")&&(_.rtmp=t.rtmp,i.oneofs&&(_._rtmp="rtmp")),t.flv!=null&&t.hasOwnProperty("flv")&&(_.flv=t.flv,i.oneofs&&(_._flv="flv")),t.rtmps!=null&&t.hasOwnProperty("rtmps")&&(_.rtmps=t.rtmps,i.oneofs&&(_._rtmps="rtmps")),t.mainLine!=null&&t.hasOwnProperty("mainLine")&&(_.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(t.mainLine,i),i.oneofs&&(_._mainLine="mainLine")),t.standLines&&t.standLines.length){_.standLines=[];for(let x=0;x<t.standLines.length;++x)_.standLines[x]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(t.standLines[x],i)}return _},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.CDNPlayAddressNotify"},r})(),T.UserChannel=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UserChannel;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UserChannel)return e;let t=new $root.com.quick.voice.proto.UserChannel;if(e.userId!=null&&(t.userId=String(e.userId)),e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),t.defaults&&(i.userId=""),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UserChannel"},r})(),T.ChannelPublishReq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.DataChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelPublishReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.DataChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.DataChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishReq)return e;let t=new $root.com.quick.voice.proto.ChannelPublishReq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.DataChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.DataChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishReq"},r})(),T.ChannelPublishRsq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return e;let t=new $root.com.quick.voice.proto.ChannelPublishRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelPublishRsq"},r})(),T.ChannelSubscribeReq=(function(){function r(c){if(this.users=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.users=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.users!=null&&e.users.length)for(let i=0;i<e.users.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.users[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.users&&x.users.length||(x.users=[]),x.users.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.users!=null&&e.hasOwnProperty("users")){if(!Array.isArray(e.users))return"users: array expected";for(let t=0;t<e.users.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.users[t]);if(i)return"users."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return e;let t=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(e.users){if(!Array.isArray(e.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");t.users=[];for(let i=0;i<e.users.length;++i){if(typeof e.users[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");t.users[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.users[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.users=[]),e.users&&e.users.length){i.users=[];for(let _=0;_<e.users.length;++_)i.users[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.users[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeReq"},r})(),T.ChannelSubscribeRsq=(function(){function r(c){if(this.channels=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.channels=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.channels!=null&&e.channels.length)for(let i=0;i<e.channels.length;++i)$root.com.quick.voice.proto.UserChannel.encode(e.channels[i],t.uint32(10).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?(x.channels&&x.channels.length||(x.channels=[]),x.channels.push($root.com.quick.voice.proto.UserChannel.decode(e,e.uint32()))):e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.channels!=null&&e.hasOwnProperty("channels")){if(!Array.isArray(e.channels))return"channels: array expected";for(let t=0;t<e.channels.length;++t){let i=$root.com.quick.voice.proto.UserChannel.verify(e.channels[t]);if(i)return"channels."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return e;let t=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(e.channels){if(!Array.isArray(e.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");t.channels=[];for(let i=0;i<e.channels.length;++i){if(typeof e.channels[i]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");t.channels[i]=$root.com.quick.voice.proto.UserChannel.fromObject(e.channels[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.channels=[]),e.channels&&e.channels.length){i.channels=[];for(let _=0;_<e.channels.length;++_)i.channels[_]=$root.com.quick.voice.proto.UserChannel.toObject(e.channels[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ChannelSubscribeRsq"},r})(),T.DataChannelData=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.userId="",r.prototype.type=0,r.prototype.audioData=null;let c;return Object.defineProperty(r.prototype,"_audioData",{get:$util.oneOfGetter(c=["audioData"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.userId!=null&&Object.hasOwnProperty.call(t,"userId")&&i.uint32(10).string(t.userId),t.type!=null&&Object.hasOwnProperty.call(t,"type")&&i.uint32(16).int32(t.type),t.audioData!=null&&Object.hasOwnProperty.call(t,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(t.audioData,i.uint32(26).fork()).ldelim(),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.DataChannelData;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.userId=t.string();break}case 2:{C.type=t.int32();break}case 3:{C.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(t,t.uint32());break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.userId!=null&&t.hasOwnProperty("userId")&&!$util.isString(t.userId))return"userId: string expected";if(t.type!=null&&t.hasOwnProperty("type")&&t.type!==0)return"type: enum value expected";if(t.audioData!=null&&t.hasOwnProperty("audioData")){let i=$root.com.quick.voice.proto.DataChannelAudioData.verify(t.audioData);if(i)return"audioData."+i}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannelData)return t;let i=new $root.com.quick.voice.proto.DataChannelData;switch(t.userId!=null&&(i.userId=String(t.userId)),t.type){default:if(typeof t.type=="number"){i.type=t.type;break}break;case"backAuido":case 0:i.type=0;break}if(t.audioData!=null){if(typeof t.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");i.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(t.audioData)}return i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.userId="",_.type=i.enums===String?"backAuido":0),t.userId!=null&&t.hasOwnProperty("userId")&&(_.userId=t.userId),t.type!=null&&t.hasOwnProperty("type")&&(_.type=i.enums===String?$root.com.quick.voice.proto.DataChannelType[t.type]===void 0?t.type:$root.com.quick.voice.proto.DataChannelType[t.type]:t.type),t.audioData!=null&&t.hasOwnProperty("audioData")&&(_.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(t.audioData,i),i.oneofs&&(_._audioData="audioData")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannelData"},r})(),T.DataChannelType=(function(){const r={},c=Object.create(r);return c[r[0]="backAuido"]=0,c})(),T.DataChannelAudioData=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.data=$util.newBuffer([]),r.prototype.format=null,r.prototype.time=null;let c;return Object.defineProperty(r.prototype,"_time",{get:$util.oneOfGetter(c=["time"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.data!=null&&Object.hasOwnProperty.call(t,"data")&&i.uint32(10).bytes(t.data),t.format!=null&&Object.hasOwnProperty.call(t,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(t.format,i.uint32(18).fork()).ldelim(),t.time!=null&&Object.hasOwnProperty.call(t,"time")&&i.uint32(24).int64(t.time),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.DataChannelAudioData;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.data=t.bytes();break}case 2:{C.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(t,t.uint32());break}case 3:{C.time=t.int64();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.data!=null&&t.hasOwnProperty("data")&&!(t.data&&typeof t.data.length=="number"||$util.isString(t.data)))return"data: buffer expected";if(t.format!=null&&t.hasOwnProperty("format")){let i=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(t.format);if(i)return"format."+i}return t.time!=null&&t.hasOwnProperty("time")&&!$util.isInteger(t.time)&&!(t.time&&$util.isInteger(t.time.low)&&$util.isInteger(t.time.high))?"time: integer|Long expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.DataChannelAudioData)return t;let i=new $root.com.quick.voice.proto.DataChannelAudioData;if(t.data!=null&&(typeof t.data=="string"?$util.base64.decode(t.data,i.data=$util.newBuffer($util.base64.length(t.data)),0):t.data.length>=0&&(i.data=t.data)),t.format!=null){if(typeof t.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");i.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(t.format)}return t.time!=null&&($util.Long?(i.time=$util.Long.fromValue(t.time)).unsigned=!1:typeof t.time=="string"?i.time=parseInt(t.time,10):typeof t.time=="number"?i.time=t.time:typeof t.time=="object"&&(i.time=new $util.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber())),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(i.bytes===String?_.data="":(_.data=[],i.bytes!==Array&&(_.data=$util.newBuffer(_.data))),_.format=null),t.data!=null&&t.hasOwnProperty("data")&&(_.data=i.bytes===String?$util.base64.encode(t.data,0,t.data.length):i.bytes===Array?Array.prototype.slice.call(t.data):t.data),t.format!=null&&t.hasOwnProperty("format")&&(_.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(t.format,i)),t.time!=null&&t.hasOwnProperty("time")&&(typeof t.time=="number"?_.time=i.longs===String?String(t.time):t.time:_.time=i.longs===String?$util.Long.prototype.toString.call(t.time):i.longs===Number?new $util.LongBits(t.time.low>>>0,t.time.high>>>0).toNumber():t.time,i.oneofs&&(_._time="time")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.DataChannelAudioData"},r})(),T.DataChannelAudioFormat=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sampleRate=0,r.prototype.channels=0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sampleRate!=null&&Object.hasOwnProperty.call(e,"sampleRate")&&t.uint32(9).double(e.sampleRate),e.channels!=null&&Object.hasOwnProperty.call(e,"channels")&&t.uint32(16).int32(e.channels),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sampleRate=e.double();break}case 2:{x.channels=e.int32();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sampleRate!=null&&e.hasOwnProperty("sampleRate")&&typeof e.sampleRate!="number"?"sampleRate: number expected":e.channels!=null&&e.hasOwnProperty("channels")&&!$util.isInteger(e.channels)?"channels: integer expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return e;let t=new $root.com.quick.voice.proto.DataChannelAudioFormat;return e.sampleRate!=null&&(t.sampleRate=Number(e.sampleRate)),e.channels!=null&&(t.channels=e.channels|0),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sampleRate=0,i.channels=0),e.sampleRate!=null&&e.hasOwnProperty("sampleRate")&&(i.sampleRate=t.json&&!isFinite(e.sampleRate)?String(e.sampleRate):e.sampleRate),e.channels!=null&&e.hasOwnProperty("channels")&&(i.channels=e.channels),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.DataChannelAudioFormat"},r})(),T.AckMsgReq=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.msgId!=null&&Object.hasOwnProperty.call(e,"msgId")&&t.uint32(8).int64(e.msgId),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.AckMsgReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;C>>>3===1?x.msgId=e.int64():e.skipType(C&7)}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.msgId!=null&&e.hasOwnProperty("msgId")&&!$util.isInteger(e.msgId)&&!(e.msgId&&$util.isInteger(e.msgId.low)&&$util.isInteger(e.msgId.high))?"msgId: integer|Long expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.AckMsgReq)return e;let t=new $root.com.quick.voice.proto.AckMsgReq;return e.msgId!=null&&($util.Long?(t.msgId=$util.Long.fromValue(e.msgId)).unsigned=!1:typeof e.msgId=="string"?t.msgId=parseInt(e.msgId,10):typeof e.msgId=="number"?t.msgId=e.msgId:typeof e.msgId=="object"&&(t.msgId=new $util.LongBits(e.msgId.low>>>0,e.msgId.high>>>0).toNumber())),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults)if($util.Long){let _=new $util.Long(0,0,!1);i.msgId=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.msgId=t.longs===String?"0":0;return e.msgId!=null&&e.hasOwnProperty("msgId")&&(typeof e.msgId=="number"?i.msgId=t.longs===String?String(e.msgId):e.msgId:i.msgId=t.longs===String?$util.Long.prototype.toString.call(e.msgId):t.longs===Number?new $util.LongBits(e.msgId.low>>>0,e.msgId.high>>>0).toNumber():e.msgId),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.AckMsgReq"},r})(),T.SdpConsult=(function(){function r(e){if(this.tracks=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.sender=null,r.prototype.receiverId="",r.prototype.sdp="",r.prototype.tracks=$util.emptyArray;let c;return Object.defineProperty(r.prototype,"_sender",{get:$util.oneOfGetter(c=["sender"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.sender!=null&&Object.hasOwnProperty.call(t,"sender")&&$root.com.quick.voice.proto.User.encode(t.sender,i.uint32(18).fork()).ldelim(),t.receiverId!=null&&Object.hasOwnProperty.call(t,"receiverId")&&i.uint32(26).string(t.receiverId),t.sdp!=null&&Object.hasOwnProperty.call(t,"sdp")&&i.uint32(34).string(t.sdp),t.tracks!=null&&t.tracks.length)for(let _=0;_<t.tracks.length;++_)$root.com.quick.voice.proto.Track.encode(t.tracks[_],i.uint32(42).fork()).ldelim();return i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.SdpConsult;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.sender=$root.com.quick.voice.proto.User.decode(t,t.uint32());break}case 3:{C.receiverId=t.string();break}case 4:{C.sdp=t.string();break}case 5:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(t,t.uint32()));break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.sender!=null&&t.hasOwnProperty("sender")){let i=$root.com.quick.voice.proto.User.verify(t.sender);if(i)return"sender."+i}if(t.receiverId!=null&&t.hasOwnProperty("receiverId")&&!$util.isString(t.receiverId))return"receiverId: string expected";if(t.sdp!=null&&t.hasOwnProperty("sdp")&&!$util.isString(t.sdp))return"sdp: string expected";if(t.tracks!=null&&t.hasOwnProperty("tracks")){if(!Array.isArray(t.tracks))return"tracks: array expected";for(let i=0;i<t.tracks.length;++i){let _=$root.com.quick.voice.proto.Track.verify(t.tracks[i]);if(_)return"tracks."+_}}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.SdpConsult)return t;let i=new $root.com.quick.voice.proto.SdpConsult;if(t.roomId!=null&&(i.roomId=String(t.roomId)),t.sender!=null){if(typeof t.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");i.sender=$root.com.quick.voice.proto.User.fromObject(t.sender)}if(t.receiverId!=null&&(i.receiverId=String(t.receiverId)),t.sdp!=null&&(i.sdp=String(t.sdp)),t.tracks){if(!Array.isArray(t.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");i.tracks=[];for(let _=0;_<t.tracks.length;++_){if(typeof t.tracks[_]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");i.tracks[_]=$root.com.quick.voice.proto.Track.fromObject(t.tracks[_])}}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.tracks=[]),i.defaults&&(_.roomId="",_.receiverId="",_.sdp=""),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.sender!=null&&t.hasOwnProperty("sender")&&(_.sender=$root.com.quick.voice.proto.User.toObject(t.sender,i),i.oneofs&&(_._sender="sender")),t.receiverId!=null&&t.hasOwnProperty("receiverId")&&(_.receiverId=t.receiverId),t.sdp!=null&&t.hasOwnProperty("sdp")&&(_.sdp=t.sdp),t.tracks&&t.tracks.length){_.tracks=[];for(let x=0;x<t.tracks.length;++x)_.tracks[x]=$root.com.quick.voice.proto.Track.toObject(t.tracks[x],i)}return _},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.SdpConsult"},r})(),T.Candidate=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sdpMid="",r.prototype.sdpMLineIndex=0,r.prototype.sdp="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.sdpMid!=null&&Object.hasOwnProperty.call(e,"sdpMid")&&t.uint32(10).string(e.sdpMid),e.sdpMLineIndex!=null&&Object.hasOwnProperty.call(e,"sdpMLineIndex")&&t.uint32(16).int32(e.sdpMLineIndex),e.sdp!=null&&Object.hasOwnProperty.call(e,"sdp")&&t.uint32(26).string(e.sdp),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.Candidate;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sdpMid=e.string();break}case 2:{x.sdpMLineIndex=e.int32();break}case 3:{x.sdp=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.sdpMid!=null&&e.hasOwnProperty("sdpMid")&&!$util.isString(e.sdpMid)?"sdpMid: string expected":e.sdpMLineIndex!=null&&e.hasOwnProperty("sdpMLineIndex")&&!$util.isInteger(e.sdpMLineIndex)?"sdpMLineIndex: integer expected":e.sdp!=null&&e.hasOwnProperty("sdp")&&!$util.isString(e.sdp)?"sdp: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Candidate)return e;let t=new $root.com.quick.voice.proto.Candidate;return e.sdpMid!=null&&(t.sdpMid=String(e.sdpMid)),e.sdpMLineIndex!=null&&(t.sdpMLineIndex=e.sdpMLineIndex|0),e.sdp!=null&&(t.sdp=String(e.sdp)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.sdpMid="",i.sdpMLineIndex=0,i.sdp=""),e.sdpMid!=null&&e.hasOwnProperty("sdpMid")&&(i.sdpMid=e.sdpMid),e.sdpMLineIndex!=null&&e.hasOwnProperty("sdpMLineIndex")&&(i.sdpMLineIndex=e.sdpMLineIndex),e.sdp!=null&&e.hasOwnProperty("sdp")&&(i.sdp=e.sdp),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Candidate"},r})(),T.Candidates=(function(){function r(c){if(this.candidates=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.senderId="",r.prototype.receiverId="",r.prototype.candidates=$util.emptyArray,r.prototype.isSubscribeReceiver=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.senderId!=null&&Object.hasOwnProperty.call(e,"senderId")&&t.uint32(18).string(e.senderId),e.receiverId!=null&&Object.hasOwnProperty.call(e,"receiverId")&&t.uint32(26).string(e.receiverId),e.candidates!=null&&e.candidates.length)for(let i=0;i<e.candidates.length;++i)$root.com.quick.voice.proto.Candidate.encode(e.candidates[i],t.uint32(34).fork()).ldelim();return e.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(e,"isSubscribeReceiver")&&t.uint32(40).bool(e.isSubscribeReceiver),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.Candidates;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.senderId=e.string();break}case 3:{x.receiverId=e.string();break}case 4:{x.candidates&&x.candidates.length||(x.candidates=[]),x.candidates.push($root.com.quick.voice.proto.Candidate.decode(e,e.uint32()));break}case 5:{x.isSubscribeReceiver=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.senderId!=null&&e.hasOwnProperty("senderId")&&!$util.isString(e.senderId))return"senderId: string expected";if(e.receiverId!=null&&e.hasOwnProperty("receiverId")&&!$util.isString(e.receiverId))return"receiverId: string expected";if(e.candidates!=null&&e.hasOwnProperty("candidates")){if(!Array.isArray(e.candidates))return"candidates: array expected";for(let t=0;t<e.candidates.length;++t){let i=$root.com.quick.voice.proto.Candidate.verify(e.candidates[t]);if(i)return"candidates."+i}}return e.isSubscribeReceiver!=null&&e.hasOwnProperty("isSubscribeReceiver")&&typeof e.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.Candidates)return e;let t=new $root.com.quick.voice.proto.Candidates;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.senderId!=null&&(t.senderId=String(e.senderId)),e.receiverId!=null&&(t.receiverId=String(e.receiverId)),e.candidates){if(!Array.isArray(e.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");t.candidates=[];for(let i=0;i<e.candidates.length;++i){if(typeof e.candidates[i]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");t.candidates[i]=$root.com.quick.voice.proto.Candidate.fromObject(e.candidates[i])}}return e.isSubscribeReceiver!=null&&(t.isSubscribeReceiver=!!e.isSubscribeReceiver),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.candidates=[]),t.defaults&&(i.roomId="",i.senderId="",i.receiverId="",i.isSubscribeReceiver=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.senderId!=null&&e.hasOwnProperty("senderId")&&(i.senderId=e.senderId),e.receiverId!=null&&e.hasOwnProperty("receiverId")&&(i.receiverId=e.receiverId),e.candidates&&e.candidates.length){i.candidates=[];for(let _=0;_<e.candidates.length;++_)i.candidates[_]=$root.com.quick.voice.proto.Candidate.toObject(e.candidates[_],t)}return e.isSubscribeReceiver!=null&&e.hasOwnProperty("isSubscribeReceiver")&&(i.isSubscribeReceiver=e.isSubscribeReceiver),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.Candidates"},r})(),T.NatType=(function(){const r={},c=Object.create(r);return c[r[0]="Symmetric"]=0,c[r[1]="Cone"]=1,c[r[2]="Port"]=2,c[r[3]="IP"]=3,c[r[4]="UnKnown"]=4,c})(),T.NetworkType=(function(){const r={},c=Object.create(r);return c[r[0]="Wifi"]=0,c[r[1]="Wired"]=1,c[r[2]="Mobile"]=2,c})(),T.ReportNetInfo=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.nat=0,r.prototype.type=0,r.prototype.ip="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.nat!=null&&Object.hasOwnProperty.call(e,"nat")&&t.uint32(8).int32(e.nat),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(16).int32(e.type),e.ip!=null&&Object.hasOwnProperty.call(e,"ip")&&t.uint32(26).string(e.ip),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.ReportNetInfo;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.nat=e.int32();break}case 2:{x.type=e.int32();break}case 3:{x.ip=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.nat!=null&&e.hasOwnProperty("nat"))switch(e.nat){default:return"nat: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return e.ip!=null&&e.hasOwnProperty("ip")&&!$util.isString(e.ip)?"ip: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.ReportNetInfo)return e;let t=new $root.com.quick.voice.proto.ReportNetInfo;switch(e.nat){default:if(typeof e.nat=="number"){t.nat=e.nat;break}break;case"Symmetric":case 0:t.nat=0;break;case"Cone":case 1:t.nat=1;break;case"Port":case 2:t.nat=2;break;case"IP":case 3:t.nat=3;break;case"UnKnown":case 4:t.nat=4;break}switch(e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Wifi":case 0:t.type=0;break;case"Wired":case 1:t.type=1;break;case"Mobile":case 2:t.type=2;break}return e.ip!=null&&(t.ip=String(e.ip)),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.nat=t.enums===String?"Symmetric":0,i.type=t.enums===String?"Wifi":0,i.ip=""),e.nat!=null&&e.hasOwnProperty("nat")&&(i.nat=t.enums===String?$root.com.quick.voice.proto.NatType[e.nat]===void 0?e.nat:$root.com.quick.voice.proto.NatType[e.nat]:e.nat),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.NetworkType[e.type]===void 0?e.type:$root.com.quick.voice.proto.NetworkType[e.type]:e.type),e.ip!=null&&e.hasOwnProperty("ip")&&(i.ip=e.ip),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.ReportNetInfo"},r})(),T.P2PCode=(function(){const r={},c=Object.create(r);return c[r[0]="Success"]=0,c[r[1]="Failed"]=1,c[r[2]="Ignore"]=2,c[r[3]="Disconnected"]=3,c[r[4]="LowQuality"]=4,c})(),T.ReportTrafficUsage=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.p2pPush=null,r.prototype.p2pPull=null,r.prototype.sfuPush=null,r.prototype.sfuPull=null;let c;return Object.defineProperty(r.prototype,"_p2pPush",{get:$util.oneOfGetter(c=["p2pPush"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_p2pPull",{get:$util.oneOfGetter(c=["p2pPull"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_sfuPush",{get:$util.oneOfGetter(c=["sfuPush"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_sfuPull",{get:$util.oneOfGetter(c=["sfuPull"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.p2pPush!=null&&Object.hasOwnProperty.call(t,"p2pPush")&&i.uint32(8).int64(t.p2pPush),t.p2pPull!=null&&Object.hasOwnProperty.call(t,"p2pPull")&&i.uint32(16).int64(t.p2pPull),t.sfuPush!=null&&Object.hasOwnProperty.call(t,"sfuPush")&&i.uint32(24).int64(t.sfuPush),t.sfuPull!=null&&Object.hasOwnProperty.call(t,"sfuPull")&&i.uint32(32).int64(t.sfuPull),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.p2pPush=t.int64();break}case 2:{C.p2pPull=t.int64();break}case 3:{C.sfuPush=t.int64();break}case 4:{C.sfuPull=t.int64();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.p2pPush!=null&&t.hasOwnProperty("p2pPush")&&!$util.isInteger(t.p2pPush)&&!(t.p2pPush&&$util.isInteger(t.p2pPush.low)&&$util.isInteger(t.p2pPush.high))?"p2pPush: integer|Long expected":t.p2pPull!=null&&t.hasOwnProperty("p2pPull")&&!$util.isInteger(t.p2pPull)&&!(t.p2pPull&&$util.isInteger(t.p2pPull.low)&&$util.isInteger(t.p2pPull.high))?"p2pPull: integer|Long expected":t.sfuPush!=null&&t.hasOwnProperty("sfuPush")&&!$util.isInteger(t.sfuPush)&&!(t.sfuPush&&$util.isInteger(t.sfuPush.low)&&$util.isInteger(t.sfuPush.high))?"sfuPush: integer|Long expected":t.sfuPull!=null&&t.hasOwnProperty("sfuPull")&&!$util.isInteger(t.sfuPull)&&!(t.sfuPull&&$util.isInteger(t.sfuPull.low)&&$util.isInteger(t.sfuPull.high))?"sfuPull: integer|Long expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return t;let i=new $root.com.quick.voice.proto.ReportTrafficUsage;return t.p2pPush!=null&&($util.Long?(i.p2pPush=$util.Long.fromValue(t.p2pPush)).unsigned=!1:typeof t.p2pPush=="string"?i.p2pPush=parseInt(t.p2pPush,10):typeof t.p2pPush=="number"?i.p2pPush=t.p2pPush:typeof t.p2pPush=="object"&&(i.p2pPush=new $util.LongBits(t.p2pPush.low>>>0,t.p2pPush.high>>>0).toNumber())),t.p2pPull!=null&&($util.Long?(i.p2pPull=$util.Long.fromValue(t.p2pPull)).unsigned=!1:typeof t.p2pPull=="string"?i.p2pPull=parseInt(t.p2pPull,10):typeof t.p2pPull=="number"?i.p2pPull=t.p2pPull:typeof t.p2pPull=="object"&&(i.p2pPull=new $util.LongBits(t.p2pPull.low>>>0,t.p2pPull.high>>>0).toNumber())),t.sfuPush!=null&&($util.Long?(i.sfuPush=$util.Long.fromValue(t.sfuPush)).unsigned=!1:typeof t.sfuPush=="string"?i.sfuPush=parseInt(t.sfuPush,10):typeof t.sfuPush=="number"?i.sfuPush=t.sfuPush:typeof t.sfuPush=="object"&&(i.sfuPush=new $util.LongBits(t.sfuPush.low>>>0,t.sfuPush.high>>>0).toNumber())),t.sfuPull!=null&&($util.Long?(i.sfuPull=$util.Long.fromValue(t.sfuPull)).unsigned=!1:typeof t.sfuPull=="string"?i.sfuPull=parseInt(t.sfuPull,10):typeof t.sfuPull=="number"?i.sfuPull=t.sfuPull:typeof t.sfuPull=="object"&&(i.sfuPull=new $util.LongBits(t.sfuPull.low>>>0,t.sfuPull.high>>>0).toNumber())),i},r.toObject=function(t,i){i||(i={});let _={};return t.p2pPush!=null&&t.hasOwnProperty("p2pPush")&&(typeof t.p2pPush=="number"?_.p2pPush=i.longs===String?String(t.p2pPush):t.p2pPush:_.p2pPush=i.longs===String?$util.Long.prototype.toString.call(t.p2pPush):i.longs===Number?new $util.LongBits(t.p2pPush.low>>>0,t.p2pPush.high>>>0).toNumber():t.p2pPush,i.oneofs&&(_._p2pPush="p2pPush")),t.p2pPull!=null&&t.hasOwnProperty("p2pPull")&&(typeof t.p2pPull=="number"?_.p2pPull=i.longs===String?String(t.p2pPull):t.p2pPull:_.p2pPull=i.longs===String?$util.Long.prototype.toString.call(t.p2pPull):i.longs===Number?new $util.LongBits(t.p2pPull.low>>>0,t.p2pPull.high>>>0).toNumber():t.p2pPull,i.oneofs&&(_._p2pPull="p2pPull")),t.sfuPush!=null&&t.hasOwnProperty("sfuPush")&&(typeof t.sfuPush=="number"?_.sfuPush=i.longs===String?String(t.sfuPush):t.sfuPush:_.sfuPush=i.longs===String?$util.Long.prototype.toString.call(t.sfuPush):i.longs===Number?new $util.LongBits(t.sfuPush.low>>>0,t.sfuPush.high>>>0).toNumber():t.sfuPush,i.oneofs&&(_._sfuPush="sfuPush")),t.sfuPull!=null&&t.hasOwnProperty("sfuPull")&&(typeof t.sfuPull=="number"?_.sfuPull=i.longs===String?String(t.sfuPull):t.sfuPull:_.sfuPull=i.longs===String?$util.Long.prototype.toString.call(t.sfuPull):i.longs===Number?new $util.LongBits(t.sfuPull.low>>>0,t.sfuPull.high>>>0).toNumber():t.sfuPull,i.oneofs&&(_._sfuPull="sfuPull")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ReportTrafficUsage"},r})(),T.CheckSessionReq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.session="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.session!=null&&Object.hasOwnProperty.call(e,"session")&&t.uint32(10).string(e.session),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CheckSessionReq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.session=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.session!=null&&e.hasOwnProperty("session")&&!$util.isString(e.session))return"session: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CheckSessionReq)return e;let t=new $root.com.quick.voice.proto.CheckSessionReq;if(e.session!=null&&(t.session=String(e.session)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.session=""),e.session!=null&&e.hasOwnProperty("session")&&(i.session=e.session),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CheckSessionReq"},r})(),T.CheckSessionRsq=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.sessionIsValid=!1,r.prototype.tracks=$util.emptyArray,r.prototype.session="",r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.sessionIsValid!=null&&Object.hasOwnProperty.call(e,"sessionIsValid")&&t.uint32(8).bool(e.sessionIsValid),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.Track.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return e.session!=null&&Object.hasOwnProperty.call(e,"session")&&t.uint32(26).string(e.session),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.CheckSessionRsq;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.sessionIsValid=e.bool();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.Track.decode(e,e.uint32()));break}case 3:{x.session=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.sessionIsValid!=null&&e.hasOwnProperty("sessionIsValid")&&typeof e.sessionIsValid!="boolean")return"sessionIsValid: boolean expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.Track.verify(e.tracks[t]);if(i)return"tracks."+i}}return e.session!=null&&e.hasOwnProperty("session")&&!$util.isString(e.session)?"session: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.CheckSessionRsq)return e;let t=new $root.com.quick.voice.proto.CheckSessionRsq;if(e.sessionIsValid!=null&&(t.sessionIsValid=!!e.sessionIsValid),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.Track.fromObject(e.tracks[i])}}return e.session!=null&&(t.session=String(e.session)),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.sessionIsValid=!1,i.session=""),e.sessionIsValid!=null&&e.hasOwnProperty("sessionIsValid")&&(i.sessionIsValid=e.sessionIsValid),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.Track.toObject(e.tracks[_],t)}return e.session!=null&&e.hasOwnProperty("session")&&(i.session=e.session),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.CheckSessionRsq"},r})(),T.RoomSpeechNotify=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.userId="",r.prototype.text="",r.prototype.timestamp=$util.Long?$util.Long.fromBits(0,0,!1):0,r.prototype.origin="",r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),e.text!=null&&Object.hasOwnProperty.call(e,"text")&&t.uint32(26).string(e.text),e.timestamp!=null&&Object.hasOwnProperty.call(e,"timestamp")&&t.uint32(32).int64(e.timestamp),e.origin!=null&&Object.hasOwnProperty.call(e,"origin")&&t.uint32(42).string(e.origin),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.RoomSpeechNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.userId=e.string();break}case 3:{x.text=e.string();break}case 4:{x.timestamp=e.int64();break}case 5:{x.origin=e.string();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){return typeof e!="object"||e===null?"object expected":e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId)?"roomId: string expected":e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId)?"userId: string expected":e.text!=null&&e.hasOwnProperty("text")&&!$util.isString(e.text)?"text: string expected":e.timestamp!=null&&e.hasOwnProperty("timestamp")&&!$util.isInteger(e.timestamp)&&!(e.timestamp&&$util.isInteger(e.timestamp.low)&&$util.isInteger(e.timestamp.high))?"timestamp: integer|Long expected":e.origin!=null&&e.hasOwnProperty("origin")&&!$util.isString(e.origin)?"origin: string expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RoomSpeechNotify)return e;let t=new $root.com.quick.voice.proto.RoomSpeechNotify;return e.roomId!=null&&(t.roomId=String(e.roomId)),e.userId!=null&&(t.userId=String(e.userId)),e.text!=null&&(t.text=String(e.text)),e.timestamp!=null&&($util.Long?(t.timestamp=$util.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?t.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?t.timestamp=e.timestamp:typeof e.timestamp=="object"&&(t.timestamp=new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.origin!=null&&(t.origin=String(e.origin)),t},r.toObject=function(e,t){t||(t={});let i={};if(t.defaults){if(i.roomId="",i.userId="",i.text="",$util.Long){let _=new $util.Long(0,0,!1);i.timestamp=t.longs===String?_.toString():t.longs===Number?_.toNumber():_}else i.timestamp=t.longs===String?"0":0;i.origin=""}return e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.text!=null&&e.hasOwnProperty("text")&&(i.text=e.text),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?i.timestamp=t.longs===String?String(e.timestamp):e.timestamp:i.timestamp=t.longs===String?$util.Long.prototype.toString.call(e.timestamp):t.longs===Number?new $util.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber():e.timestamp),e.origin!=null&&e.hasOwnProperty("origin")&&(i.origin=e.origin),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RoomSpeechNotify"},r})(),T.AiLangSetting=(function(){function r(e){if(e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.input="",r.prototype.output="",r.prototype.translateEnable=null;let c;return Object.defineProperty(r.prototype,"_translateEnable",{get:$util.oneOfGetter(c=["translateEnable"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){return i||(i=$Writer.create()),t.input!=null&&Object.hasOwnProperty.call(t,"input")&&i.uint32(10).string(t.input),t.output!=null&&Object.hasOwnProperty.call(t,"output")&&i.uint32(18).string(t.output),t.translateEnable!=null&&Object.hasOwnProperty.call(t,"translateEnable")&&i.uint32(24).bool(t.translateEnable),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.AiLangSetting;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.input=t.string();break}case 2:{C.output=t.string();break}case 3:{C.translateEnable=t.bool();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){return typeof t!="object"||t===null?"object expected":t.input!=null&&t.hasOwnProperty("input")&&!$util.isString(t.input)?"input: string expected":t.output!=null&&t.hasOwnProperty("output")&&!$util.isString(t.output)?"output: string expected":t.translateEnable!=null&&t.hasOwnProperty("translateEnable")&&typeof t.translateEnable!="boolean"?"translateEnable: boolean expected":null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.AiLangSetting)return t;let i=new $root.com.quick.voice.proto.AiLangSetting;return t.input!=null&&(i.input=String(t.input)),t.output!=null&&(i.output=String(t.output)),t.translateEnable!=null&&(i.translateEnable=!!t.translateEnable),i},r.toObject=function(t,i){i||(i={});let _={};return i.defaults&&(_.input="",_.output=""),t.input!=null&&t.hasOwnProperty("input")&&(_.input=t.input),t.output!=null&&t.hasOwnProperty("output")&&(_.output=t.output),t.translateEnable!=null&&t.hasOwnProperty("translateEnable")&&(_.translateEnable=t.translateEnable,i.oneofs&&(_._translateEnable="translateEnable")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.AiLangSetting"},r})(),T.P2PIgnoreReason=(function(){const r={},c=Object.create(r);return c[r[0]="CHANNEL_LIMIT"]=0,c[r[1]="SUBSCRIBE_NOT_EXIST"]=1,c[r[2]="Busying"]=2,c[r[3]="TRACK_NOT_EXIST"]=3,c[r[4]="OTHER"]=4,c})(),T.P2PAction=(function(){const r={},c=Object.create(r);return c[r[0]="ReverseTry"]=0,c[r[1]="ReverseTryFailed"]=1,c[r[2]="ReverseSuccess"]=2,c[r[3]="ConnectSuccess"]=3,c[r[4]="ReversePushDelay"]=4,c})(),T.P2PAvailablePeerNotify=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.pushId="",r.prototype.types=$util.emptyArray,r.prototype.isRemotePush=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.pushId!=null&&Object.hasOwnProperty.call(e,"pushId")&&t.uint32(18).string(e.pushId),e.types!=null&&e.types.length){t.uint32(26).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return e.isRemotePush!=null&&Object.hasOwnProperty.call(e,"isRemotePush")&&t.uint32(32).bool(e.isRemotePush),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.pushId=e.string();break}case 3:{if(x.types&&x.types.length||(x.types=[]),(C&7)===2){let F=e.uint32()+e.pos;for(;e.pos<F;)x.types.push(e.int32())}else x.types.push(e.int32());break}case 4:{x.isRemotePush=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.pushId!=null&&e.hasOwnProperty("pushId")&&!$util.isString(e.pushId))return"pushId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return e.isRemotePush!=null&&e.hasOwnProperty("isRemotePush")&&typeof e.isRemotePush!="boolean"?"isRemotePush: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PAvailablePeerNotify)return e;let t=new $root.com.quick.voice.proto.P2PAvailablePeerNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.pushId!=null&&(t.pushId=String(e.pushId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PAvailablePeerNotify.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return e.isRemotePush!=null&&(t.isRemotePush=!!e.isRemotePush),t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.roomId="",i.pushId="",i.isRemotePush=!1),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.pushId!=null&&e.hasOwnProperty("pushId")&&(i.pushId=e.pushId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return e.isRemotePush!=null&&e.hasOwnProperty("isRemotePush")&&(i.isRemotePush=e.isRemotePush),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PAvailablePeerNotify"},r})(),T.ReportP2PExReq=(function(){function r(e){if(this.types=[],e)for(let t=Object.keys(e),i=0;i<t.length;++i)e[t[i]]!=null&&(this[t[i]]=e[t[i]])}r.prototype.roomId="",r.prototype.pushId="",r.prototype.pullId="",r.prototype.code=0,r.prototype.types=$util.emptyArray,r.prototype.desc=null,r.prototype.connectedTime=null,r.prototype.action=null;let c;return Object.defineProperty(r.prototype,"_desc",{get:$util.oneOfGetter(c=["desc"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_connectedTime",{get:$util.oneOfGetter(c=["connectedTime"]),set:$util.oneOfSetter(c)}),Object.defineProperty(r.prototype,"_action",{get:$util.oneOfGetter(c=["action"]),set:$util.oneOfSetter(c)}),r.create=function(t){return new r(t)},r.encode=function(t,i){if(i||(i=$Writer.create()),t.roomId!=null&&Object.hasOwnProperty.call(t,"roomId")&&i.uint32(10).string(t.roomId),t.pushId!=null&&Object.hasOwnProperty.call(t,"pushId")&&i.uint32(18).string(t.pushId),t.pullId!=null&&Object.hasOwnProperty.call(t,"pullId")&&i.uint32(26).string(t.pullId),t.code!=null&&Object.hasOwnProperty.call(t,"code")&&i.uint32(32).int32(t.code),t.types!=null&&t.types.length){i.uint32(42).fork();for(let _=0;_<t.types.length;++_)i.int32(t.types[_]);i.ldelim()}return t.desc!=null&&Object.hasOwnProperty.call(t,"desc")&&i.uint32(50).string(t.desc),t.connectedTime!=null&&Object.hasOwnProperty.call(t,"connectedTime")&&i.uint32(58).string(t.connectedTime),t.action!=null&&Object.hasOwnProperty.call(t,"action")&&i.uint32(64).int32(t.action),i},r.encodeDelimited=function(t,i){return this.encode(t,i).ldelim()},r.decode=function(t,i,_){t instanceof $Reader||(t=$Reader.create(t));let x=i===void 0?t.len:t.pos+i,C=new $root.com.quick.voice.proto.ReportP2PExReq;for(;t.pos<x;){let F=t.uint32();if(F===_)break;switch(F>>>3){case 1:{C.roomId=t.string();break}case 2:{C.pushId=t.string();break}case 3:{C.pullId=t.string();break}case 4:{C.code=t.int32();break}case 5:{if(C.types&&C.types.length||(C.types=[]),(F&7)===2){let j=t.uint32()+t.pos;for(;t.pos<j;)C.types.push(t.int32())}else C.types.push(t.int32());break}case 6:{C.desc=t.string();break}case 7:{C.connectedTime=t.string();break}case 8:{C.action=t.int32();break}default:t.skipType(F&7);break}}return C},r.decodeDelimited=function(t){return t instanceof $Reader||(t=new $Reader(t)),this.decode(t,t.uint32())},r.verify=function(t){if(typeof t!="object"||t===null)return"object expected";if(t.roomId!=null&&t.hasOwnProperty("roomId")&&!$util.isString(t.roomId))return"roomId: string expected";if(t.pushId!=null&&t.hasOwnProperty("pushId")&&!$util.isString(t.pushId))return"pushId: string expected";if(t.pullId!=null&&t.hasOwnProperty("pullId")&&!$util.isString(t.pullId))return"pullId: string expected";if(t.code!=null&&t.hasOwnProperty("code"))switch(t.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(t.types!=null&&t.hasOwnProperty("types")){if(!Array.isArray(t.types))return"types: array expected";for(let i=0;i<t.types.length;++i)switch(t.types[i]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}if(t.desc!=null&&t.hasOwnProperty("desc")&&!$util.isString(t.desc))return"desc: string expected";if(t.connectedTime!=null&&t.hasOwnProperty("connectedTime")&&!$util.isString(t.connectedTime))return"connectedTime: string expected";if(t.action!=null&&t.hasOwnProperty("action"))switch(t.action){default:return"action: enum value expected";case 0:case 1:case 2:case 3:case 4:break}return null},r.fromObject=function(t){if(t instanceof $root.com.quick.voice.proto.ReportP2PExReq)return t;let i=new $root.com.quick.voice.proto.ReportP2PExReq;switch(t.roomId!=null&&(i.roomId=String(t.roomId)),t.pushId!=null&&(i.pushId=String(t.pushId)),t.pullId!=null&&(i.pullId=String(t.pullId)),t.code){default:if(typeof t.code=="number"){i.code=t.code;break}break;case"Success":case 0:i.code=0;break;case"Failed":case 1:i.code=1;break;case"Ignore":case 2:i.code=2;break;case"Disconnected":case 3:i.code=3;break;case"LowQuality":case 4:i.code=4;break}if(t.types){if(!Array.isArray(t.types))throw TypeError(".com.quick.voice.proto.ReportP2PExReq.types: array expected");i.types=[];for(let _=0;_<t.types.length;++_)switch(t.types[_]){default:if(typeof t.types[_]=="number"){i.types[_]=t.types[_];break}case"Microphone":case 0:i.types[_]=0;break;case"Camera":case 1:i.types[_]=1;break;case"Screen":case 2:i.types[_]=2;break;case"SystemVoice":case 3:i.types[_]=3;break}}switch(t.desc!=null&&(i.desc=String(t.desc)),t.connectedTime!=null&&(i.connectedTime=String(t.connectedTime)),t.action){default:if(typeof t.action=="number"){i.action=t.action;break}break;case"ReverseTry":case 0:i.action=0;break;case"ReverseTryFailed":case 1:i.action=1;break;case"ReverseSuccess":case 2:i.action=2;break;case"ConnectSuccess":case 3:i.action=3;break;case"ReversePushDelay":case 4:i.action=4;break}return i},r.toObject=function(t,i){i||(i={});let _={};if((i.arrays||i.defaults)&&(_.types=[]),i.defaults&&(_.roomId="",_.pushId="",_.pullId="",_.code=i.enums===String?"Success":0),t.roomId!=null&&t.hasOwnProperty("roomId")&&(_.roomId=t.roomId),t.pushId!=null&&t.hasOwnProperty("pushId")&&(_.pushId=t.pushId),t.pullId!=null&&t.hasOwnProperty("pullId")&&(_.pullId=t.pullId),t.code!=null&&t.hasOwnProperty("code")&&(_.code=i.enums===String?$root.com.quick.voice.proto.P2PCode[t.code]===void 0?t.code:$root.com.quick.voice.proto.P2PCode[t.code]:t.code),t.types&&t.types.length){_.types=[];for(let x=0;x<t.types.length;++x)_.types[x]=i.enums===String?$root.com.quick.voice.proto.TrackType[t.types[x]]===void 0?t.types[x]:$root.com.quick.voice.proto.TrackType[t.types[x]]:t.types[x]}return t.desc!=null&&t.hasOwnProperty("desc")&&(_.desc=t.desc,i.oneofs&&(_._desc="desc")),t.connectedTime!=null&&t.hasOwnProperty("connectedTime")&&(_.connectedTime=t.connectedTime,i.oneofs&&(_._connectedTime="connectedTime")),t.action!=null&&t.hasOwnProperty("action")&&(_.action=i.enums===String?$root.com.quick.voice.proto.P2PAction[t.action]===void 0?t.action:$root.com.quick.voice.proto.P2PAction[t.action]:t.action,i.oneofs&&(_._action="action")),_},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(t){return t===void 0&&(t="type.googleapis.com"),t+"/com.quick.voice.proto.ReportP2PExReq"},r})(),T.P2PDisconnectedNotify=(function(){function r(c){if(this.types=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.remoteUserId="",r.prototype.types=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.remoteUserId!=null&&Object.hasOwnProperty.call(e,"remoteUserId")&&t.uint32(18).string(e.remoteUserId),e.types!=null&&e.types.length){t.uint32(26).fork();for(let i=0;i<e.types.length;++i)t.int32(e.types[i]);t.ldelim()}return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.P2PDisconnectedNotify;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.remoteUserId=e.string();break}case 3:{if(x.types&&x.types.length||(x.types=[]),(C&7)===2){let F=e.uint32()+e.pos;for(;e.pos<F;)x.types.push(e.int32())}else x.types.push(e.int32());break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.remoteUserId!=null&&e.hasOwnProperty("remoteUserId")&&!$util.isString(e.remoteUserId))return"remoteUserId: string expected";if(e.types!=null&&e.hasOwnProperty("types")){if(!Array.isArray(e.types))return"types: array expected";for(let t=0;t<e.types.length;++t)switch(e.types[t]){default:return"types: enum value[] expected";case 0:case 1:case 2:case 3:break}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.P2PDisconnectedNotify)return e;let t=new $root.com.quick.voice.proto.P2PDisconnectedNotify;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.remoteUserId!=null&&(t.remoteUserId=String(e.remoteUserId)),e.types){if(!Array.isArray(e.types))throw TypeError(".com.quick.voice.proto.P2PDisconnectedNotify.types: array expected");t.types=[];for(let i=0;i<e.types.length;++i)switch(e.types[i]){default:if(typeof e.types[i]=="number"){t.types[i]=e.types[i];break}case"Microphone":case 0:t.types[i]=0;break;case"Camera":case 1:t.types[i]=1;break;case"Screen":case 2:t.types[i]=2;break;case"SystemVoice":case 3:t.types[i]=3;break}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.types=[]),t.defaults&&(i.roomId="",i.remoteUserId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.remoteUserId!=null&&e.hasOwnProperty("remoteUserId")&&(i.remoteUserId=e.remoteUserId),e.types&&e.types.length){i.types=[];for(let _=0;_<e.types.length;++_)i.types[_]=t.enums===String?$root.com.quick.voice.proto.TrackType[e.types[_]]===void 0?e.types[_]:$root.com.quick.voice.proto.TrackType[e.types[_]]:e.types[_]}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.P2PDisconnectedNotify"},r})(),T.RtcEvent=(function(){const r={},c=Object.create(r);return c[r[0]="UpdateTrackActive"]=0,c})(),T.RtcTrack=(function(){function r(c){if(c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.userId="",r.prototype.mid="",r.prototype.trackName="",r.prototype.type=0,r.prototype.isActive=!1,r.create=function(e){return new r(e)},r.encode=function(e,t){return t||(t=$Writer.create()),e.userId!=null&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(10).string(e.userId),e.mid!=null&&Object.hasOwnProperty.call(e,"mid")&&t.uint32(18).string(e.mid),e.trackName!=null&&Object.hasOwnProperty.call(e,"trackName")&&t.uint32(26).string(e.trackName),e.type!=null&&Object.hasOwnProperty.call(e,"type")&&t.uint32(32).int32(e.type),e.isActive!=null&&Object.hasOwnProperty.call(e,"isActive")&&t.uint32(40).bool(e.isActive),t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.RtcTrack;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.userId=e.string();break}case 2:{x.mid=e.string();break}case 3:{x.trackName=e.string();break}case 4:{x.type=e.int32();break}case 5:{x.isActive=e.bool();break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.userId!=null&&e.hasOwnProperty("userId")&&!$util.isString(e.userId))return"userId: string expected";if(e.mid!=null&&e.hasOwnProperty("mid")&&!$util.isString(e.mid))return"mid: string expected";if(e.trackName!=null&&e.hasOwnProperty("trackName")&&!$util.isString(e.trackName))return"trackName: string expected";if(e.type!=null&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return e.isActive!=null&&e.hasOwnProperty("isActive")&&typeof e.isActive!="boolean"?"isActive: boolean expected":null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.RtcTrack)return e;let t=new $root.com.quick.voice.proto.RtcTrack;switch(e.userId!=null&&(t.userId=String(e.userId)),e.mid!=null&&(t.mid=String(e.mid)),e.trackName!=null&&(t.trackName=String(e.trackName)),e.type){default:if(typeof e.type=="number"){t.type=e.type;break}break;case"Microphone":case 0:t.type=0;break;case"Camera":case 1:t.type=1;break;case"Screen":case 2:t.type=2;break;case"SystemVoice":case 3:t.type=3;break}return e.isActive!=null&&(t.isActive=!!e.isActive),t},r.toObject=function(e,t){t||(t={});let i={};return t.defaults&&(i.userId="",i.mid="",i.trackName="",i.type=t.enums===String?"Microphone":0,i.isActive=!1),e.userId!=null&&e.hasOwnProperty("userId")&&(i.userId=e.userId),e.mid!=null&&e.hasOwnProperty("mid")&&(i.mid=e.mid),e.trackName!=null&&e.hasOwnProperty("trackName")&&(i.trackName=e.trackName),e.type!=null&&e.hasOwnProperty("type")&&(i.type=t.enums===String?$root.com.quick.voice.proto.RtcTrackType[e.type]===void 0?e.type:$root.com.quick.voice.proto.RtcTrackType[e.type]:e.type),e.isActive!=null&&e.hasOwnProperty("isActive")&&(i.isActive=e.isActive),i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.RtcTrack"},r})(),T.RtcTrackType=(function(){const r={},c=Object.create(r);return c[r[0]="Microphone"]=0,c[r[1]="Camera"]=1,c[r[2]="Screen"]=2,c[r[3]="SystemVoice"]=3,c})(),T.UpdateTrackState=(function(){function r(c){if(this.tracks=[],c)for(let e=Object.keys(c),t=0;t<e.length;++t)c[e[t]]!=null&&(this[e[t]]=c[e[t]])}return r.prototype.roomId="",r.prototype.tracks=$util.emptyArray,r.create=function(e){return new r(e)},r.encode=function(e,t){if(t||(t=$Writer.create()),e.roomId!=null&&Object.hasOwnProperty.call(e,"roomId")&&t.uint32(10).string(e.roomId),e.tracks!=null&&e.tracks.length)for(let i=0;i<e.tracks.length;++i)$root.com.quick.voice.proto.RtcTrack.encode(e.tracks[i],t.uint32(18).fork()).ldelim();return t},r.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},r.decode=function(e,t,i){e instanceof $Reader||(e=$Reader.create(e));let _=t===void 0?e.len:e.pos+t,x=new $root.com.quick.voice.proto.UpdateTrackState;for(;e.pos<_;){let C=e.uint32();if(C===i)break;switch(C>>>3){case 1:{x.roomId=e.string();break}case 2:{x.tracks&&x.tracks.length||(x.tracks=[]),x.tracks.push($root.com.quick.voice.proto.RtcTrack.decode(e,e.uint32()));break}default:e.skipType(C&7);break}}return x},r.decodeDelimited=function(e){return e instanceof $Reader||(e=new $Reader(e)),this.decode(e,e.uint32())},r.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.roomId!=null&&e.hasOwnProperty("roomId")&&!$util.isString(e.roomId))return"roomId: string expected";if(e.tracks!=null&&e.hasOwnProperty("tracks")){if(!Array.isArray(e.tracks))return"tracks: array expected";for(let t=0;t<e.tracks.length;++t){let i=$root.com.quick.voice.proto.RtcTrack.verify(e.tracks[t]);if(i)return"tracks."+i}}return null},r.fromObject=function(e){if(e instanceof $root.com.quick.voice.proto.UpdateTrackState)return e;let t=new $root.com.quick.voice.proto.UpdateTrackState;if(e.roomId!=null&&(t.roomId=String(e.roomId)),e.tracks){if(!Array.isArray(e.tracks))throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: array expected");t.tracks=[];for(let i=0;i<e.tracks.length;++i){if(typeof e.tracks[i]!="object")throw TypeError(".com.quick.voice.proto.UpdateTrackState.tracks: object expected");t.tracks[i]=$root.com.quick.voice.proto.RtcTrack.fromObject(e.tracks[i])}}return t},r.toObject=function(e,t){t||(t={});let i={};if((t.arrays||t.defaults)&&(i.tracks=[]),t.defaults&&(i.roomId=""),e.roomId!=null&&e.hasOwnProperty("roomId")&&(i.roomId=e.roomId),e.tracks&&e.tracks.length){i.tracks=[];for(let _=0;_<e.tracks.length;++_)i.tracks[_]=$root.com.quick.voice.proto.RtcTrack.toObject(e.tracks[_],t)}return i},r.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},r.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/com.quick.voice.proto.UpdateTrackState"},r})(),T})(),u})(),b})(),m})(),compressArrayBuffer=m=>{const b=new Uint8Array(m),u=pako.deflate(b,{gzip:!0});return new Uint8Array(u?.buffer)},decompressArrayBuffer=m=>{const b=new Uint8Array(m),u=pako.inflate(b,{gzip:!0});return new Uint8Array(u?.buffer)},sendMessageFormat=m=>{const{event:b,compress:u=!1}=m,T=m.data;let r="",c;switch(m.time&&(r=p$1(m.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),b){case"heartbeat":case"heartbeatEx":c=com.quick.voice.proto.ReportTrafficUsage.encode(T).finish();break;case"ackMsg":c=com.quick.voice.proto.AckMsgReq.encode(T).finish();break;case"reportNetwork":c=com.quick.voice.proto.ReportNetInfo.encode(T).finish();break;case"connectCF":c=com.quick.voice.proto.ConnectCFReq.encode(T).finish();break;case"publish":c=com.quick.voice.proto.PublishReq.encode(T).finish();break;case"joinRoom":case"joinRoomEx":c=com.quick.voice.proto.JoinReq.encode(T).finish();break;case"pubNotify":c=com.quick.voice.proto.PublishNotify.encode(T).finish();break;case"subscribe":c=com.quick.voice.proto.SubscribeReq.encode(T).finish();break;case"renegotiate":c=com.quick.voice.proto.RenegotiateReq.encode(T).finish();break;case"closeTrack":c=com.quick.voice.proto.CloseTrackReq.encode(T).finish();break;case"preventUsersBehavior":c=com.quick.voice.proto.PreventUsersBehaviorReq.encode(T).finish();break;case"networkQualityChange":c=com.quick.voice.proto.NetQualityChange.encode(T).finish();break;case"updateCall":c=com.quick.voice.proto.UpdateCall.encode(T).finish();break;case"toggleRoomSpeechLang":c=com.quick.voice.proto.AiLangSetting.encode(T).finish();break;case"syncRoomInfo":c=com.quick.voice.proto.SyncRoomInfoReq.encode(T).finish();break;case"offer":c=com.quick.voice.proto.SdpConsult.encode(T).finish();break;case"answer":c=com.quick.voice.proto.SdpConsult.encode(T).finish();break;case"candidate":c=com.quick.voice.proto.Candidates.encode(T).finish();break;case"reportP2PConnectEx":c=com.quick.voice.proto.ReportP2PExReq.encode(T).finish();break;case"UpdateTrackActive":c=com.quick.voice.proto.UpdateTrackState.encode(T).finish();break}if(c&&u)try{c=compressArrayBuffer(c)}catch(e){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息压缩错误",e)}return{...m,timeStr:r,data_original:T,data:c}},onMessageFormat=m=>{const{event:b,compress:u=!1}=m;let T=m.data,r="",c;if(m.time&&(r=p$1(m.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),u)try{T=decompressArrayBuffer(T)}catch(e){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",e)}switch(b){case"connectCF":c=com.quick.voice.proto.ConnectCFRsp.decode(T);break;case"publish":c=com.quick.voice.proto.PublishRsp.decode(T);break;case"joinRoom":case"joinRoomEx":c=com.quick.voice.proto.JoinRsp.decode(T);break;case"subscribe":c=com.quick.voice.proto.SubscribeRsp.decode(T);break;case"closeTrack":c=com.quick.voice.proto.CloseTrackRsp.decode(T);break;case"syncRoomInfo":c=com.quick.voice.proto.SyncRoomInfoRsp.decode(T);break;case"onJoinRoom":c=com.quick.voice.proto.JoinNotify.decode(T);break;case"onPublish":c=com.quick.voice.proto.PublishNotify.decode(T);break;case"onCloseTrack":c=com.quick.voice.proto.CloseTrackNotify.decode(T);break;case"onTrackInactive":c=com.quick.voice.proto.CheckSessionRsq.decode(T);break;case"onUpdateCall":c=com.quick.voice.proto.UpdateCall.decode(T);break;case"onUpdatePermissions":c=com.quick.voice.proto.UpdatePermissions.decode(T);break;case"onNetQuality":c=com.quick.voice.proto.NetQualityNotify.decode(T);break;case"onCDNPlayUrlAdd":c=com.quick.voice.proto.CDNPlayAddressNotify.decode(T);break;case"onUpdateBehavior":c=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(T);break;case"onRoomUserSpeech":c=com.quick.voice.proto.RoomSpeechNotify.decode(T);break;case"onAttemptP2PEx":c=com.quick.voice.proto.P2PAvailablePeerNotify.decode(T);break;case"onOffer":c=com.quick.voice.proto.SdpConsult.decode(T);break;case"onAnswer":c=com.quick.voice.proto.SdpConsult.decode(T);break;case"onCandidate":c=com.quick.voice.proto.Candidates.decode(T);break;case"onDisconnectedP2P":c=com.quick.voice.proto.P2PDisconnectedNotify.decode(T);break;case"onQuitRoom":c=com.quick.voice.proto.QuitNotify.decode(T);break;case"onDestroyRoom":c=com.quick.voice.proto.QuitNotify.decode(T);break;case"debugger":case"ai":c=JSON.parse(new TextDecoder().decode(T));break;case"UpdateTrackActive":c=com.quick.voice.proto.UpdateTrackState.decode(T);break}return{...m,timeStr:r,data_remote:T,data:c}},obj2pb=m=>com.quick.voice.proto.CommonReq.encode(m).finish(),pb2obj=m=>com.quick.voice.proto.CommonRsp.decode(m);var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var m=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(b){return b.encoding?"rtpmap:%d %s/%s/%s":b.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(b){return b.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(b){return b.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(b){return"extmap:%d"+(b.direction?"/%s":"%v")+(b["encrypt-uri"]?" %s":"%v")+" %s"+(b.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(b){return b.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{push:"msid",reg:/^msid:([\w-]+)(?: ([\w-]+))?/,names:["id","appdata"],format:"msid:%s %s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(b){var u="candidate:%s %d %s %d %s %d typ %s";return u+=b.raddr!=null?" raddr %s rport %d":"%v%v",u+=b.tcptype!=null?" tcptype %s":"%v",b.generation!=null&&(u+=" generation %d"),u+=b["network-id"]!=null?" network-id %d":"%v",u+=b["network-cost"]!=null?" network-cost %d":"%v",u}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(b){var u="ssrc:%d";return b.attribute!=null&&(u+=" %s",b.value!=null&&(u+=":%s")),u}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(b){return b.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(b){return b.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(b){return"imageattr:%s %s %s"+(b.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(b){return"simulcast:%s %s"+(b.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(b){return"ts-refclk:%s"+(b.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(b){var u="mediaclk:";return u+=b.id!=null?"id=%s %s":"%v%s",u+=b.mediaClockValue!=null?"=%s":"",u+=b.rateNumerator!=null?" rate=%s":"",u+=b.rateDenominator!=null?"/%s":"",u}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(m).forEach(function(b){var u=m[b];u.forEach(function(T){T.reg||(T.reg=/(.*)/),T.format||(T.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,(function(m){var b=function(t){return String(Number(t))===t?Number(t):t},u=function(t,i,_,x){if(x&&!_)i[x]=b(t[1]);else for(var C=0;C<_.length;C+=1)t[C+1]!=null&&(i[_[C]]=b(t[C+1]))},T=function(t,i,_){var x=t.name&&t.names;t.push&&!i[t.push]?i[t.push]=[]:x&&!i[t.name]&&(i[t.name]={});var C=t.push?{}:x?i[t.name]:i;u(_.match(t.reg),C,t.names,t.name),t.push&&i[t.push].push(C)},r=requireGrammar(),c=RegExp.prototype.test.bind(/^([a-z])=(.*)/);m.parse=function(t){var i={},_=[],x=i;return t.split(/(\r\n|\r|\n)/).filter(c).forEach(function(C){var F=C[0],j=C.slice(2);F==="m"&&(_.push({rtp:[],fmtp:[]}),x=_[_.length-1]);for(var Z=0;Z<(r[F]||[]).length;Z+=1){var ee=r[F][Z];if(ee.reg.test(j))return T(ee,x,j)}}),i.media=_,i};var e=function(t,i){var _=i.split(/=(.+)/,2);return _.length===2?t[_[0]]=b(_[1]):_.length===1&&i.length>1&&(t[_[0]]=void 0),t};m.parseParams=function(t){return t.split(/;\s?/).reduce(e,{})},m.parseFmtpConfig=m.parseParams,m.parsePayloads=function(t){return t.toString().split(" ").map(Number)},m.parseRemoteCandidates=function(t){for(var i=[],_=t.split(" ").map(b),x=0;x<_.length;x+=3)i.push({component:_[x],ip:_[x+1],port:_[x+2]});return i},m.parseImageAttributes=function(t){return t.split(" ").map(function(i){return i.substring(1,i.length-1).split(",").reduce(e,{})})},m.parseSimulcastStreamList=function(t){return t.split(";").map(function(i){return i.split(",").map(function(_){var x,C=!1;return _[0]!=="~"?x=b(_):(x=b(_.substring(1,_.length)),C=!0),{scid:x,paused:C}})})}})(parser)),parser}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1;var m=requireGrammar(),b=/%[sdv%]/g,u=function(e){var t=1,i=arguments,_=i.length;return e.replace(b,function(x){if(t>=_)return x;var C=i[t];switch(t+=1,x){case"%%":return"%";case"%s":return String(C);case"%d":return Number(C);case"%v":return""}})},T=function(e,t,i){var _=t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format,x=[e+"="+_];if(t.names)for(var C=0;C<t.names.length;C+=1){var F=t.names[C];t.name?x.push(i[t.name][F]):x.push(i[t.names[C]])}else x.push(i[t.name]);return u.apply(null,x)},r=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];return writer=function(e,t){t=t||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(C){C.payloads==null&&(C.payloads="")});var i=t.outerOrder||r,_=t.innerOrder||c,x=[];return i.forEach(function(C){m[C].forEach(function(F){F.name in e&&e[F.name]!=null?x.push(T(C,F,e)):F.push in e&&e[F.push]!=null&&e[F.push].forEach(function(j){x.push(T(C,F,j))})})}),e.media.forEach(function(C){x.push(T("m",m.m[0],C)),_.forEach(function(F){m[F].forEach(function(j){j.name in C&&C[j.name]!=null?x.push(T(F,j,C)):j.push in C&&C[j.push]!=null&&C[j.push].forEach(function(Z){x.push(T(F,j,Z))})})})}),x.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
|
-
`},writer}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var m=requireParser(),b=requireWriter(),u=requireGrammar();return lib$1.grammar=u,lib$1.write=b,lib$1.parse=m.parse,lib$1.parseParams=m.parseParams,lib$1.parseFmtpConfig=m.parseFmtpConfig,lib$1.parsePayloads=m.parsePayloads,lib$1.parseRemoteCandidates=m.parseRemoteCandidates,lib$1.parseImageAttributes=m.parseImageAttributes,lib$1.parseSimulcastStreamList=m.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class RemoteUserP2P{config;prResolves=new PrResolves;remoteUserId="";peer;timer;channelLocal;channelRemote;channelRemoteList=[];icecandidates=[];isCandidateCollected=!1;transceiverSend=new Map;transceiverRecv=new Map;activeSend={};activeRecv={};on={};waitings={candidateCollected:()=>this.prResolves.add("candidateCollected",()=>this.isCandidateCollected),remoteChannelConnected:()=>this.prResolves.add("remoteChannelConnected",()=>this.channelRemote?.readyState==="open"),connected:()=>this.prResolves.add("connected",()=>this.peer?.connectionState==="connected"),setOffered:()=>this.prResolves.add("setOffered",()=>this.peer?.remoteDescription)};constructor({config:b,remoteUserId:u}){this.config=b,this.remoteUserId=u}remoteChannelSend=async b=>{if(await this.waitings.remoteChannelConnected(),this.config.debug&&this.channelRemote?.readyState!=="open"){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [remoteChannelSend] RemoteChannel is error.",{channelRemote:this.channelRemote});return}const u=sendMessageFormat(b),T=new Uint8Array(obj2pb(u));this.channelRemote?.send(T)};init=()=>{this._clear(),this.peer=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]}),this.peer.addTransceiver("audio",{direction:"inactive"}),this.channelLocal=this.peer.createDataChannel(`Web_P2P_${this.config.userId}`,{}),this.channelLocal.onmessage=b=>{const u=new Uint8Array(b.data),T=pb2obj(u),r=onMessageFormat(T),{event:c,data:e}=r;switch(c){case"UpdateTrackActive":{const{tracks:t=[]}=e;for(const i of t){const{type:_,isActive:x=!1}=i,C=mediaType_keys[_];this.setSendTracksEnabled([C],x,"remote")}}break}},this.peer.ondatachannel=b=>{this.channelRemote=b.channel,this.channelRemoteList.push(b.channel),this.channelRemote.onopen=()=>{this.prResolves.emit("remoteChannelConnected")},this.config.debug&&this.channelRemoteList.length>1&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: There are multiple channelRemote.",this.channelRemoteList)},this.peer.onconnectionstatechange=b=>{const u=b.target.connectionState;switch(u){case"connected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),clearTimeout(this.timer),this.prResolves.emit("connected");break;case"failed":case"disconnected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),this.timer=setTimeout(()=>this.close(),20*1e3);break;case"closed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),this.destroy();break;default:this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId});break}},this.peer.onicecandidate=b=>{b.candidate?this.icecandidates.push(b.candidate):(this.isCandidateCollected=!0,this.prResolves.emit("candidateCollected"))}};getSenderTrack=b=>this.transceiverSend.get(b)?.sender.track;getRecvierTrack=b=>this.transceiverRecv.get(b)?.receiver.track;syncRecvTracksEnabled=()=>{const b=[],u=[];for(const T of mediaType_keys)T.includes("audio")||(this.activeRecv[T]?b.push(T):u.push(T));b.length!==0&&this.setRecvTracksEnabled(b,!0),u.length!==0&&this.setRecvTracksEnabled(u,!1)};initSenders=(b=[],u="sendrecv")=>{const T=this.checkPeer(),r=[],c=T?.getTransceivers()||[];for(const e of mediaType_keys){const t=this.transceiverSend.get(e);if(!t)continue;c.find(_=>_.direction!=="stopped"&&_.mid===t?.mid)||this.transceiverSend.delete(e)}for(const e of b){const{mid:t,mediaType:i}=e;let _=c?.find(C=>C.mid===t);if(!_)continue;_.direction=u;const x=this.transceiverSend.get(i);x&&x.mid===_.mid||(this.transceiverSend.set(i,_),r.push(i),u=="sendrecv"&&this.transceiverRecv.set(i,_))}return r};initRecvs=(b=[],u="sendrecv")=>{const T=this.checkPeer(),r=[],c=T?.getTransceivers()||[];for(const e of mediaType_keys){const t=this.transceiverRecv.get(e);if(!t)continue;c.find(_=>_.direction!=="stopped"&&_.mid===t?.mid)||this.transceiverRecv.delete(e)}for(const e of b){if(this.transceiverRecv.get(e))continue;const i=T.addTransceiver("video",{direction:u});i.direction=u,["mc_video","ss_video"].includes(e)&&i.setCodecPreferences(this.config.codecPreferences.video),this.transceiverRecv.set(e,i),r.push(e)}return r};hasRecvier=async b=>this.transceiverRecv.has(b);hasSender=async b=>this.transceiverSend.has(b);checkActive=()=>{if(!this.peer||this.peer.connectionState!=="connected")return!1;let b=!1;for(const u of mediaType_keys){if(!this.activeSend[u])continue;b=!0;break}for(const u of mediaType_keys){if(!this.activeRecv[u])continue;b=!0;break}return b};replaceSenderTrack=async(b,u)=>{const T=this.transceiverSend.get(b);if(!T)return;const{sender:r}=T;await r.replaceTrack(u)};setSendTracksEnabled=(b=[],u,T)=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m",`color: ${u?"#00b60f":"#b64900"};`,`------->quickvo: [p2p.setSendTracksEnabled] ${u} `,{origin:T,mediaTypes:b,remoteUserId:this.remoteUserId,time:p$1(new Date().getTime())});const r=[];for(const c of b)this.activeSend[c]=u===!0?new Date().getTime():void 0,r.push(c);return this.on.setSendTracksEnabled&&this.on.setSendTracksEnabled(b),r};setRecvTracksEnabled=(b=[],u)=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m",`color: ${u?"#00b60f":"#b64900"};`,`------->quickvo: [p2p.setRecvTracksEnabled] ${u} `,{mediaTypes:b,remoteUserId:this.remoteUserId,time:p$1(new Date().getTime())});const T=[];for(const e of b)this.activeRecv[e]=u===!0?new Date().getTime():void 0,T.push(e);const r=this.getRecvUserTracks(T);this.remoteChannelSend({event:"UpdateTrackActive",data:{roomId:this.config.roomId,tracks:r}});const c=this.checkActive();return u===!1&&c===!1&&this.close(),T};setRTCRtpSenderParameters=async(b,u=[])=>{try{for(const T of u){const r=this.transceiverSend.get(T);if(!r)continue;const{sender:c}=r,e=c.getParameters();await c.setParameters({...e,...b})}}catch(T){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",T)}};createOffer=async()=>{const b=this.checkPeer(),u=await b.createOffer();return u.sdp&&(u.sdp=u.sdp.replace(new RegExp("42e01f","g"),"42e034")),await b.setLocalDescription(u),u};setOffer=async b=>{const u=this.checkPeer();this._filterSdp(b),await u.setRemoteDescription(b),await this.prResolves.emit("setOffered")};createAnswer=async()=>{const b=this.checkPeer(),u=await b.createAnswer();return u.sdp&&(u.sdp=u.sdp.replace(new RegExp("42e01f","g"),"42e034")),await b.setLocalDescription(u),u};setAnswer=async b=>{const u=this.checkPeer();this._filterSdp(b),await u.setRemoteDescription(b)};getIcecandidates=async()=>(await this.waitings.candidateCollected(),this.icecandidates);addCandidates=async b=>{await this.waitings.setOffered();for(const u of b)u.candidate?.includes("kcp")||await this.peer?.addIceCandidate(u)};getSenderUserTracks=(b=[])=>{const u=[];for(const T of b){const r=this.transceiverSend.get(T);if(!r)continue;const{mid:c,sender:e}=r,{track:t}=e;if(!t)continue;const{id:i,enabled:_}=t,x=mediaType_keys.findIndex(F=>F===T),C={type:x,enabled:_,trackName:`web-${x}-${i}`,mid:c,mediaType:T};u.push(C)}return u};getRecvUserTracks=(b=[])=>{const u=[];for(const T of b){const r=this.transceiverRecv.get(T);if(!r)continue;const{mid:c,receiver:e}=r,{track:t}=e;if(!t)continue;const{id:i,enabled:_}=t,x=mediaType_keys.findIndex(j=>j===T),C=this.activeRecv[T],F={type:x,enabled:_,trackName:`web-${x}-${i}`,mid:c,mediaType:T,isActive:C};u.push(F)}return u};checkReceActive=b=>this.activeRecv[b]||!1;getTrack=b=>this.transceiverRecv.get(b)?.receiver?.track;checkPeer=()=>{if(!this.peer)throw new Error("you need init peer.");return this.peer};close=()=>{this.peer?.connectionState==="connected"&&this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [p2p.close]",{remoteUserId:this.remoteUserId}),clearTimeout(this.timer);{const b=[...this.transceiverSend.values()];for(const u of b)u.currentDirection!=="stopped"&&u.stop();this.transceiverSend=new Map}{const b=[...this.transceiverRecv.values()];for(const u of b)u.currentDirection!=="stopped"&&u.stop();this.transceiverRecv=new Map}this.peer?.close(),this.on.close&&this.on.close()};destroy=async()=>{this.close(),this._clear()};_clear=()=>{this.icecandidates=[],this.isCandidateCollected=!1,this.channelLocal=void 0,this.channelRemote=void 0,this.channelRemoteList=[],this.activeSend={},this.activeRecv={},this.transceiverSend=new Map,this.transceiverRecv=new Map,this.peer=void 0};_filterSdp=b=>{const u=libExports$1.parse(b.sdp),{media:T=[]}=u;for(const r of T){const{candidates:c=[]}=r,e=[];for(const t of c)t.transport!=="kcp"&&e.push(t);r.candidates=e}b.sdp=libExports$1.write(u)}}class Users{config;localMedias;notifys;localUser;remoteUsers=new Map;constructor({config:b,localMedias:u,notifys:T}){this.config=b,this.localMedias=u,this.notifys=T,this.localUser=new LocalUser({config:b,localMedias:u})}getLocalUserTrackReports=b=>this.localUser.getTrackReports(b);getRemoteUserTrackReports=(b,u,T,r)=>this.getRemoteUserContent(b)?.getTrackReports(u,T,r);getUserContent=b=>b?b===this.config.userId?this.localUser:this.getRemoteUserContent(b):this.localUser;getRemoteUserContent=b=>this.remoteUsers.get(b);getUserAudioMediaStreamContext=(b,u)=>this.getUserContent(b)?.getUserMediaStreamContext(u);setInputVolume=(b,u,T)=>{this.getUserAudioMediaStreamContext(b,u)?.setInputGain(T)};setEnhanceGain=async(b,u,T)=>{this.getUserAudioMediaStreamContext(b,u)?.setEnhanceGain(T)};setSpeakerVolume=(b,u,T)=>{const r=this.getUserAudioMediaStreamContext(b,u);r?.setOutputGain(T);const c=T===0;r?.setMute(c)};getVolume=(b,u)=>this.getUserAudioMediaStreamContext(b,u)?.getVolume();playBgs=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");await r.streamControls[u]?.mixAudio(T,"bgs")};playBgm=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");await r.streamControls[u]?.mixAudio(T,"bgm")};changBgsMix=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.changeMix("bgs",T)};changBgmMix=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.changeMix("bgm",T)};stopBgs=async(b,u)=>{const T=this.getUserContent(b);if(!T)throw new Error("This user is undefined.");T.streamControls[u]?.mixAudioStop("bgs")};stopBgm=async(b,u)=>{const T=this.getUserContent(b);if(!T)throw new Error("This user is undefined.");T.streamControls[u]?.mixAudioStop("bgm")};setBgsGain=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.setBgsGain(T)};setBgmGain=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.setBgmGain(T)};getrP2PConnectedCount=()=>{let b=0;const u=this.remoteUsers.values();for(const T of u)T.p2p&&(b+=T.p2p.transceiverSend.size);return b};addRemoteUsersSubscribes=(b=[])=>{for(const u of b){const{userId:T,mediaTypes:r}=u;this.remoteUsers.get(T)?.addSubscribe(r)}};executeRemoteUsersSubscribes=()=>{const b=[],u=this.remoteUsers.values();for(const T of u){const r=T.executeSubscribe();r.tracks.length!==0&&b.push(r)}return b};completedRemoteUsersSubscribes=b=>{for(const u of b){const{id:T,tracks:r=[]}=u,c=this.remoteUsers.get(T);c?.updateTracks(r);for(const e of r){const{type:t}=e,i=mediaType_keys[t];c?.completedSubscribe([i])}}};emitUsersChange=()=>{const b=this.getUsersInfo();this.notifys.emit("onRoomUsers",{code:200,desc:"All users info is change.",data:b})};getMaxVolumeUser=()=>{const b=[...this.remoteUsers.keys()];if(b.push(this.localUser.id),b.length===0)return;let u=[];for(const T of b){const r=this.getVolume(T,"mc_audio");r&&u.push({id:T,volume:r})}return u=u.sort((T,r)=>T.volume-r.volume>0?-1:1),u[0]};getUserStream=(b,u)=>this.getUserContent(b)?.getStream(u);getUsersInfo=()=>{const u=[this.localUser.getInfo()],T=[...this.remoteUsers.values()];for(const r of T){const c=r.getInfo();u.push(c)}return u};createRemoteUser=b=>{const{config:u,localMedias:T}=this,r=new RemoteUser({config:u,localMedias:T});return r.id=b,this.remoteUsers.set(b,r),r};checkRemoteUser=b=>this.remoteUsers.has(b);removeRemoteUser=b=>{this.remoteUsers.get(b)?.clear(),this.remoteUsers.delete(b)};initUsers=b=>{for(const u of b){const{id:T,callAction:r=0,permissions:c=0,behavior:e=0,tracks:t}=u;if(this.localUser?.id===T)this.localUser.updateCallAction(r),this.localUser.updatePermissions(c),this.localUser.updateBanBehavior(e),this.localUser.updateTracks(t||[],!0),b.length===1&&(this.localUser.isOwner=!0);else{const i=this.createRemoteUser(T);i.updateCallAction(r),i.updatePermissions(c),i.updateBanBehavior(e),i.updateTracks(t||[],!0)}}};clearUsers=()=>{this.localUser.clear();const b=[...this.remoteUsers.keys()];for(const u of b)this.remoteUsers.get(u)?.clear(),this.remoteUsers.delete(u)};createRemoteUserP2P=b=>{const u=this.getRemoteUserContent(b);if(!u)throw new Error("The remote user to be established does not exist.");const T=new RemoteUserP2P({config:this.config,remoteUserId:u.id});return T.on.setSendTracksEnabled=r=>{this.syncRemoteUserP2PSenderStreamTrack(r)},T.on.close=()=>{for(const r of mediaType_keys)u.tracksAnalysis.p2p.sends[r].clear(),u.tracksAnalysis.p2p.recvs[r].clear()},u.p2p=T,T};syncRemoteUserP2PSenderStreamTrack=async b=>{const u=this.remoteUsers.values();for(const T of u)for(const r of b){if(!T.p2p||!T.p2p.hasSender(r))continue;if(T.p2p.activeSend[r]){const e=this.localUser.getStream(r);if(!e)continue;const[t]=e.getTracks();T.p2p.replaceSenderTrack(r,t)}else{const e=this.localMedias.getPhoneyStreamTrack(r);T.p2p.replaceSenderTrack(r,e)}}}}var S=Object.defineProperty,v$1=m=>{throw TypeError(m)},O=(m,b,u)=>b in m?S(m,b,{enumerable:!0,configurable:!0,writable:!0,value:u}):m[b]=u,f=(m,b,u)=>O(m,typeof b!="symbol"?b+"":b,u),Y=(m,b,u)=>b.has(m)||v$1("Cannot "+u),k=(m,b,u)=>(Y(m,b,"read from private field"),b.get(m)),B=(m,b,u)=>b.has(m)?v$1("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(m):b.set(m,u);const J=(m=0,b=1)=>{const u=Math.max(0,m),T=Math.max(1,b),r=Math.random()*(T-u+1)+u;return parseInt(`${r}`,10)},A=(m=16,b=16)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),T=Math.min(u.length,b),r=Date.now().toString(T),c=r.split(""),e=Math.max(4,m-r.length);for(let t=0;t<e;t++){const i=J(0,T-1),_=u[i];c.push(_)}return c.join("").toUpperCase()},w=(m,b)=>{try{let u=Number(m);if(isNaN(u)){const T=new Date(`${m}`);if(`${T}`=="Invalid Date")return 0;u=T.getTime()}if(b!==void 0){const T=new Date().getTimezoneOffset();u+=(T+b)*60*1e3}return u}catch(u){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:m,_offset:b,error:u}),0}},E={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},y$1=m=>w(m),D=(m,b="YYYY-MM-DD hh:mm:ss",u={})=>{const T={empty_str:"-",...u},{empty_str:r,offset:c}=T,e=w(m,c);if(Number(m)!==0&&e===0)return r;const t=new Date(e),i=`${t.getFullYear()}`,_=`${t.getMonth()+1}`,x=`${["1","2","3"].includes(_)?1:["4","5","6"].includes(_)?2:["7","8","9"].includes(_)?3:4}`,C=`${t.getDate()}`,F=`${t.getDay()===0?7:t.getDay()}`,j=`${t.getHours()}`,Z=`${t.getMinutes()}`,ee=`${t.getSeconds()}`,re=`${Math.ceil((e-y$1(`${i}/01/01 00:00:00`)+1)/864e5)}`,K=`${Math.ceil(((e-y$1(`${i}/01/01 00:00:00`))/864e5-Number(F))/7)+1}`,se=[{k:"Y+",v:i},{k:"M+",v:_},{k:"Q+",v:x},{k:"D+",v:C},{k:"W+",v:F},{k:"h+",v:j},{k:"m+",v:Z},{k:"s+",v:ee},{k:"d+",v:re},{k:"w+",v:K}];let fe;for(let{k:G,v:ne}of se)if(fe=new RegExp(`(${G})`).exec(b),fe){const ae=fe[1];let oe=ne.padStart(ae.length,"0");ae.includes("W")&&(oe=E[oe.slice(0,2)]),b=b.replace(ae,oe)}return b};var h$1;class W{constructor(b=1e3,u=!1){f(this,"_debug",!1),f(this,"_queue",[]),f(this,"_interval",1e3),f(this,"_now",Date.now()),f(this,"removeQueueItem",(T=[])=>{for(const r of T){const c=this._queue.findIndex(e=>e.key===r);c!==-1&&(this._queue.splice(c,1),this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:移除事件",r))}}),f(this,"addQueueItem",T=>{const{key:r=A(),execution_time:c=this._now,interval:e=1e4,func:t=()=>{}}=T;this.removeQueueItem([r]);const i=c+Number(e);let _=this._queue.findIndex(C=>i>=C.execution_time);_=_===-1?this._queue.length:_;const x={key:r,execution_time:i,interval:e,func:t};return this._queue.splice(_,0,x),this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:插入事件",r,`执行时间: ${D(i)}`,`队列位置: ${_}`),r}),B(this,h$1,()=>{this._now=Date.now();const T=this._queue.length;for(let r=T;r>0;r--){const c=this._queue[this._queue.length-1],{key:e,interval:t=0,execution_time:i=0,func:_}=c,x=Math.round((i-this._now)/1e3);if(!c){this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:","当前 无 任务");break}if(this._debug){const C=Array.from(this._queue,Z=>Z.execution_time),F=Array.from(this._queue,Z=>Z.execution_time).sort((Z,ee)=>ee-Z),j=Array.from(this._queue,Z=>Z.key);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:队列keys",JSON.stringify(j)),JSON.stringify(C)!==JSON.stringify(F)&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->Breathe:时间线${C.length}`,"异常",JSON.stringify(C)),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:","当前 有 任务",`最近任务 ${D(i)} 剩余${x}s`,`任务详情:${JSON.stringify(c)}`)}if(x>0)break;if(_(),t===0)return this.removeQueueItem([e]);this.addQueueItem(c)}}),f(this,"startQueue",()=>setInterval(k(this,h$1),this._interval)),this._interval=b,this._debug=u}}h$1=new WeakMap;class LocalMedias{audioContext=new(window.AudioContext||window.webkitAudioContext);_onDocumentClick;_onDeviceChange;_destroyed=!1;phoneyStreamTracks={};enumerateDevices={audioinput:[],videoinput:[],audiooutput:[]};useMediaDevices={};mediaTrackConstraints={mc_audio:{autoGainControl:!0,noiseSuppression:!0,echoCancellation:!0,sampleRate:48e3,channelCount:2},mc_video:{},ss_video:{},ss_audio:{}};localStreamTracks={};on={};constructor(){this._onDocumentClick=()=>{this.audioContext&&this.audioContext.state==="suspended"&&this.audioContext.resume()},document.addEventListener("click",this._onDocumentClick);const b=gt(this.audioContext),u=wt({width:32,height:32,opacity:0,fps:20,text:""});{const[T]=b.getAudioTracks();this.phoneyStreamTracks.mc_audio=T}{const[T]=u.getVideoTracks();this.phoneyStreamTracks.mc_video=T}{const[T]=b.clone().getAudioTracks();this.phoneyStreamTracks.ss_audio=T}{const[T]=u.clone().getVideoTracks();this.phoneyStreamTracks.ss_video=T}navigator.mediaDevices&&(this._onDeviceChange=()=>{this._getAllEnumerateDevices(),this.on.devicechange&&this.on.devicechange()},navigator.mediaDevices.ondevicechange=this._onDeviceChange),this._getAllEnumerateDevices()}getPhoneyStreamTrack=b=>this.phoneyStreamTracks[b];initLocalStreamTrack=async b=>{switch(b){case"mc_audio":{const u=this._getSafetyMediaDeviceKind("audioinput"),T=this.mediaTrackConstraints.mc_audio,r=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:u},...T},video:!1});this.stopLocalStreamTrack("mc_audio");const[c]=r.getAudioTracks();this.localStreamTracks.mc_audio=c}break;case"mc_video":{const u=this._getSafetyMediaDeviceKind("videoinput"),T=this.mediaTrackConstraints.mc_video,r=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:u},...T}});this.stopLocalStreamTrack("mc_video");const[c]=r.getVideoTracks();this.localStreamTracks.mc_video=c}break;case"mc":{const u=this._getSafetyMediaDeviceKind("audioinput"),T=this._getSafetyMediaDeviceKind("videoinput"),r=this.mediaTrackConstraints.mc_audio,c=this.mediaTrackConstraints.mc_video,e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:u},...r},video:{deviceId:{exact:T},...c}});this.stopLocalStreamTrack("mc_audio"),this.stopLocalStreamTrack("mc_video");{const[t]=e.getAudioTracks();this.localStreamTracks.mc_audio=t}{const[t]=e.getVideoTracks();this.localStreamTracks.mc_video=t}}break;case"ss_audio":{const u=this.mediaTrackConstraints.ss_audio,T=await navigator.mediaDevices.getDisplayMedia({audio:{...u},video:!0});this.stopLocalStreamTrack("ss_audio");const[r]=T.getAudioTracks();this.localStreamTracks.ss_audio=r;{const[c]=T.getVideoTracks();c.stop()}}break;case"ss_video":{const u=this.mediaTrackConstraints.ss_video,T=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:{...u}});this.stopLocalStreamTrack("ss_video");const[r]=T.getVideoTracks();this.localStreamTracks.ss_video=r}break;case"ss":{const u=this.mediaTrackConstraints.ss_audio,T=this.mediaTrackConstraints.ss_video;let r={audio:{...u},video:{...T}};const c=await navigator.mediaDevices.getDisplayMedia(r);this.stopLocalStreamTrack("ss_audio"),this.stopLocalStreamTrack("ss_video");{const[e]=c.getAudioTracks();this.localStreamTracks.ss_audio=e}{const[e]=c.getVideoTracks();this.localStreamTracks.ss_video=e}}break}};getLocalStreamTrack=b=>this.localStreamTracks[b];checkLocalStreamTracks=b=>{const u=[],T=[];for(const r of b)this.localStreamTracks[r]?T.push(r):u.push(r);return{valid_mediaTypes:T,invalid_mediaTypes:u}};stopLocalStreamTrack=b=>{this.localStreamTracks[b]?.stop(),this.localStreamTracks[b]=void 0};isOpenMediaDevice=b=>!!this.localStreamTracks[b];setMediaTrackConstraints=async(b,u)=>{const T=this.mediaTrackConstraints[b];this.mediaTrackConstraints[b]={...T,...u}};getMediaDeviceKind=b=>this.useMediaDevices[b];setMediaDeviceKind=async(b,u)=>{this.useMediaDevices[b]=u};changeAudiooutput=async()=>{try{const b=this.useMediaDevices.audiooutput||"";await this.audioContext.setSinkId(b)}catch(b){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",b)}};getMediaDevicesErrInfo=async()=>{const b={mc_audio:"",mc_video:""};try{const u=await navigator.mediaDevices.enumerateDevices();u.find(r=>r.kind==="audioinput")||(b.mc_audio="audioinput is not available."),u.find(r=>r.kind==="videoinput")||(b.mc_video="videoinput is not available.")}catch(u){b.mc_audio=u.message||u,b.mc_video=u.message||u}return b};getEnumerateDevices=async b=>(await this._getAllEnumerateDevices(),this.enumerateDevices[b]);getEnumerateAudioinputDevices=()=>this.getEnumerateDevices("audioinput");getEnumerateAudioOutputDevices=()=>this.getEnumerateDevices("audiooutput");getEnumerateVideoinputDevices=()=>this.getEnumerateDevices("videoinput");_getAllEnumerateDevices=async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return;const b=navigator.language;await navigator.mediaDevices.enumerateDevices().then(u=>{const T={audioinput:[],videoinput:[],audiooutput:[]},r=[];for(const c of u){const{kind:e,label:t,deviceId:i}=c;i!=="communications"&&(i==="default"?T[e].push({kind:e,label:t,deviceId:i}):r.push({kind:e,label:t,deviceId:i}))}T.audioinput.length===0&&T.audioinput.push({kind:"audioinput",deviceId:"default-auto",label:b==="zh-CN"?"默认值-自动":"Default-Auto"}),T.videoinput.length===0&&T.videoinput.push({kind:"videoinput",deviceId:"default-auto",label:b==="zh-CN"?"默认值-自动":"Default-Auto"}),T.audiooutput.length===0&&T.audiooutput.push({kind:"audiooutput",deviceId:"default-auto",label:b==="zh-CN"?"默认值-自动":"Default-Auto"});for(const c of r){const{kind:e,label:t,deviceId:i}=c;T[e].push({kind:e,label:t,deviceId:i})}this.enumerateDevices=T}).catch(function(u){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getAllEnumerateDevices is err",u)})};_getSafetyMediaDeviceKind=b=>{let u=this.useMediaDevices[b];return u==="default-auto"&&(u=void 0),u};destroy=async()=>{if(!this._destroyed){this._destroyed=!0,this._onDocumentClick&&(document.removeEventListener("click",this._onDocumentClick),this._onDocumentClick=void 0),navigator.mediaDevices&&this._onDeviceChange&&navigator.mediaDevices.ondevicechange===this._onDeviceChange&&(navigator.mediaDevices.ondevicechange=null),this._onDeviceChange=void 0;for(const b of Object.keys(this.localStreamTracks))this.stopLocalStreamTrack(b);this.phoneyStreamTracks?.mc_audio&&this.phoneyStreamTracks.mc_audio.stop(),this.phoneyStreamTracks?.mc_video&&this.phoneyStreamTracks.mc_video.stop(),this.phoneyStreamTracks?.ss_audio&&this.phoneyStreamTracks.ss_audio.stop(),this.phoneyStreamTracks?.ss_video&&this.phoneyStreamTracks.ss_video.stop(),this.phoneyStreamTracks=void 0;try{this.audioContext&&this.audioContext.state!=="closed"&&await this.audioContext.close()}catch(b){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: LocalMedias.audioContext.close is error.",b)}this.audioContext=void 0}}}class Peer{config;users;prResolves=new PrResolves;pc=new RTCPeerConnection;transceiverMap=new Map;transceiverTrackMap=new Map;iceConnectionTimer=0;simulcast="f";on={};waitings={peerConnected:async()=>this.prResolves.add("peerConnected",()=>this.pc.connectionState==="connected")};constructor({config:b,users:u}){this.config=b,this.users=u}setRTCRtpSenderParameters=async(b,u=[])=>{try{for(const T of u){const r=this.transceiverMap.get(T);if(!r)continue;const{sender:c}=r,e=c.getParameters();await c.setParameters({...e,...b})}}catch(T){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",T)}};init=async()=>{this.close(),this.pc=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.pc.addTransceiver("audio",{direction:"sendonly"}),this.pc.addTransceiver("video",{direction:"sendonly"});const b=await this.pc.createOffer();await this.pc.setLocalDescription(b),this.pc.onconnectionstatechange=u=>{const T=u.target.connectionState;switch(T){case"connected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${T}`),clearTimeout(this.iceConnectionTimer),this.prResolves.emit("peerConnected");break;case"disconnected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${T}`),this.iceConnectionTimer=window.setTimeout(this.close,1e3*15);break;case"failed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${T}`);break;case"closed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${T}`);break;default:this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${T}`);break}this.on.state&&this.on.state(T)}};close=()=>{clearTimeout(this.iceConnectionTimer),this.transceiverMap=new Map,this.transceiverTrackMap=new Map,this.pc.close()};addSenders=async b=>{const u={direction:"sendonly"},T=[];for(const r of b){if(this.transceiverMap.get(r))continue;T.push(r);const e=this.users.localUser.getStream(r),[t]=e.getTracks(),i=this.pc.addTransceiver(t,u);["mc_video","ss_video"].includes(r)&&i.setCodecPreferences(this.config.codecPreferences.video),this.transceiverMap.set(r,i)}if(T.length!==0){const r=await this.pc.createOffer();if(this.config.debug){const c=libExports$1.parse(r.sdp),e=pt(c.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:e,sdpJson:c,description:r})}await this.pc.setLocalDescription(r)}for(const r of T){const c=this.transceiverMap.get(r);if(!c)continue;const{mid:e,sender:t}=c,{track:i}=t;if(!i)continue;const _=mediaType_keys.findIndex(F=>F===r),x=`WEB-${_}-${bt()}`,C={type:_,mediaType:r,trackName:x,location:"local",mid:e,origin:"local",enabled:!0};this.transceiverTrackMap.set(r,C)}return T};syncSenderStreamTrack=async b=>{for(const u of b){if(!this.hasSender(u))continue;const T=this.users.localUser.getStream(u),[r]=T.getTracks();await this.replaceSenderTrack(u,r)}};stopSenders=b=>{for(const u of b){const T=this.transceiverMap.get(u);T&&(T.stop(),this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: stopSenders: ${T.mid} is stop.`,T),this.transceiverMap.delete(u),this.transceiverTrackMap.delete(u))}};hasSender=b=>this.transceiverMap.has(b);replaceSenderTrack=async(b,u)=>{const T=this.transceiverMap.get(b);if(!T)throw new Error(`ReplaceTrack is error. no have ${b} transceiver.`);const{sender:r}=T;await r.replaceTrack(u)};getSenderUserTracks=(b=[])=>{const u=[];for(const T of b){const r=this.transceiverTrackMap.get(T);r&&u.push(r)}return u};getTransceiver=b=>this.pc.getTransceivers().find(r=>r.mid===b);getSenderTrack=b=>this.transceiverMap.get(b)?.sender.track;getRecvierTrack=b=>this.pc.getTransceivers().find(r=>r.mid===b)?.receiver.track;stopReceivers=b=>{if(b.length===0)return;const u=this.pc.getTransceivers();for(const T of u){const{mid:r}=T;r&&b.includes(r)&&(T.receiver.track.stop(),T.stop(),this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: stopReceivers: ${r} is stop.`,T))}};createOffer=async()=>{const b=await this.pc.createOffer();if(this.config.debug){const u=libExports$1.parse(b.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:T,sdpJson:u,description:b})}await this.pc.setLocalDescription(b)};createAnswer=async()=>{const b=await this.pc.createAnswer();if(this.config.debug){const u=libExports$1.parse(b.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:T,sdpJson:u,description:b})}await this.pc.setLocalDescription(b)};getSdp=()=>this.pc.localDescription?.sdp||"";setRemoteDescription=async b=>{if(this.config.debug){const u=libExports$1.parse(b.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:T,sdpJson:u,description:b})}return await this.pc.setRemoteDescription(b),b}}const enum_notifyName={onNetQuality:"网络质量回调",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onTrackInactive:"通知轨道失效",onAttemptP2PEx:"建立P2P连接",onOffer:"收到P2P-offer",onAnswer:"收到P2P-answer",onCandidate:"收到P2P候选信息-candidate",onDisconnectedP2P:"断开P2P",onUpdatePermissions:"更新推流权限通知",onBeforeTokenExpire:"Token即将过期",onTokenExpired:"Token已过期",onDestroyRoom:"销毁房间",onUpdateBehavior:"行为允许权限变更",onCDNPlayUrlAdd:"cdn播放地址变化",onRoomUserSpeech:"用户讲话"},notifyName_options=Yt(enum_notifyName),notifyName_keys=Object.keys(enum_notifyName),notifyName_vals=Object.values(enum_notifyName);class CallsWebSocketEvent{eventName;prws;message;needRetry=!0;_resolve=b=>{};_reject=b=>{};sendBefore;sendAfter;options={timeout:30*1e3,onBack:!0};timer=0;constructor(b,u,T={}){this.prws=u,T.timeout!==void 0&&T.timeout<=0&&(T.timeout=60*1e3),this.eventName=b,this.options={...this.options,...T}}resolve=b=>{if(this.options.onBack&&(b.sn!==this.message?.sn&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: Received a timeout response. ${this.message?.sn} !== ${b.sn}`,{current:this.message,response:b}),this.message&&this.message.time)){const u=b.time-this.message.time;u>=10*1e3&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: This request response is too long. ${St(u)}`,{current:this.message,response:b})}this.needRetry=!1,clearTimeout(this.timer),this._resolve(b)};reject=b=>{this.needRetry=!1,clearTimeout(this.timer),this._reject(b)};retry=()=>{if(!this.message)throw new Error(`[${this.eventName}]: Send needs to be called first.`);this.message.time=Date.now(),this.sendMsg()};send=b=>new Promise(async(u,T)=>{this._resolve=u,this._reject=T;let{data:r,compress:c=!1,version:e=3,sn:t}=b;const i=this.eventName,_=Date.now();t||(t=Number(bt(16,10)));const x=this.options.timeout,C={event:i,data:r,sn:t,time:_,valid:x,compress:c,version:e};this.message=sendMessageFormat(C),this.sendMsg()});sendMsg=()=>{if(this.prws.ws?.readyState!==1)return this._reject(new Error("WebSocket is not ready."));if(!this.message||!this.message.sn)return this.reject("Message is undefined or Message.sn is undefined.");this.sendBefore&&this.sendBefore(this.message);const b=com.quick.voice.proto.CommonReq.encode(this.message).finish();if(this.prws.send(b),this.sendAfter&&this.sendAfter(this.message),this.options.onBack===!0)this._createTimer();else{const{event:u,sn:T}=this.message;this.needRetry=!1,this._resolve({event:u,sn:T,code:200,desc:"",data:{}})}};_createTimer=()=>{this.timer=window.setTimeout(()=>{const b=new Error(`[${this.eventName}]: Event is timeout.`);b.name="timeout",this._reject(b)},this.options.timeout)};destroy=()=>{clearTimeout(this.timer);const b=new Error(`[${this.eventName}]: Event is destroy.`);b.name="destroy",this._reject(b)}}class PrWebSocket{binaryType="blob";debug=!1;url="";activeTimeStamp=0;reconnectCount=0;ws;on={};constructor(){}connect=b=>{this.url=b,this.debug&&console.log("------->pr-ws: connecting.",{url:this.url}),this.reconnectCount=0,this._open()};reconnect=()=>{this.debug&&console.log("------->pr-ws: reconnecting.",{url:this.url}),this.reconnectCount+=1,this._open()};send=b=>{if(!this.ws||this.ws.readyState!==1)throw new Error("Ws is not ready.");this.ws.send(b)};close=(b=1e3,u="Correctly close.")=>{this.ws&&(this.ws.onmessage=()=>{},this.ws.onopen=()=>{},this.ws.onerror=()=>{},this.ws.onclose=()=>{},this.ws?.readyState===1&&this.ws?.close(b,u),this.ws=void 0,this.debug&&console.log("------->pr-ws: closed.",{url:this.url}))};_open=()=>{this.close();const b=new Date().getTime();this.ws=new WebSocket(this.url),this.ws.binaryType=this.binaryType,this.ws.onmessage=u=>{this.activeTimeStamp=new Date().getTime(),this.on.message&&this.on.message(u.data)},this.ws.onopen=()=>{const u=new Date().getTime();this.activeTimeStamp=u,this.reconnectCount=0;const T=u-b;this.on.open&&this.on.open(T)},this.ws.onerror=u=>{this.on.error&&this.on.error(u)},this.ws.onclose=u=>{this.on.close&&this.on.close(u)}}}const reqIgnoreEvents=[];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),reqIgnoreEvents.push("updateCall"),reqIgnoreEvents.push("reportNetwork"),reqIgnoreEvents.push("ackMsg");const resIgnoreEvents=[];resIgnoreEvents.push("heartbeat"),resIgnoreEvents.push("heartbeatEx"),resIgnoreEvents.push("networkQualityChange"),resIgnoreEvents.push("pubNotify"),resIgnoreEvents.push("updateCall"),resIgnoreEvents.push("reportNetwork"),resIgnoreEvents.push("offer"),resIgnoreEvents.push("candidate"),resIgnoreEvents.push("answer"),resIgnoreEvents.push("reportP2PConnectEx"),resIgnoreEvents.push("onRoomUserSpeech"),resIgnoreEvents.push("onNetQuality");class CallsWebSocket{config;timeout=30*1e3;prws=new PrWebSocket;events=new Map;on={};constructor({config:b}){this.config=b,this.prws.binaryType="arraybuffer",this.prws.on.message=u=>{const T=new Uint8Array(u),r=com.quick.voice.proto.CommonRsp.decode(T),c=onMessageFormat(r),{event:e}=c;if(this._updataLogs("res",c),this.config.debug&&!resIgnoreEvents.includes(e)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",c),notifyName_keys.includes(e)){const _=this.on[e],x=L(c,["code","data","desc"]);_&&_(x);return}const i=this.events.get(e);if(i){const _=L(c,["code","data","desc","sn"]);i.resolve(_)}},this.prws.on.close=u=>{this.on.close&&this.on.close(u)},this.prws.on.open=async u=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${u}ms`),await this.retryEvents(),this.on.open&&this.on.open(u)}}needRestoreRoom=()=>{if(this.prws?.ws?.readyState!==1)return!1;const u=new Date().getTime()-this.prws.activeTimeStamp,T=u>60*1e3;return T===!0&&this.config.debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;","------->quickvo: NeedRestoreRoom.",{offsetTime:u}),T};connect=async b=>{this.prws.connect(b)};close=()=>{this.prws.ws?.readyState!==3&&(this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is closed."),this.prws.close(),this.clearEvents())};createRequest=(b,u={})=>{const T=new CallsWebSocketEvent(b,this.prws,u);return T.sendBefore=r=>{this._updataLogs("req",r),this.config.debug&&!reqIgnoreEvents.includes(r.event)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",r)},T.sendAfter=()=>{T.needRetry===!1&&this.events.delete(b)},this.events.set(b,T),T};clearEvents=()=>{const b=this.events.values();for(const u of b)u.destroy();this.events=new Map};retryEvents=async()=>{const b=this.events.values();for(const u of b)u.needRetry===!0&&u.retry()};_updataLogs=(b,u={})=>{try{const{time:T,event:r,data:c={},data_original:e={},data_remote:t,...i}=u,_=p$1(T,"YYYY-MM-DD hh:mm:ss",{offset:480});let x={};const C=(G={})=>{const ne=JSON.parse(JSON.stringify(G)),ae=Object.keys(ne);for(const oe of ae)(oe.includes("sdp")||oe.includes("Sdp"))&&(ne[oe]="");return ne};let F="res ↓";switch(b){case"res":F="res ↓",x=C(c);break;case"req":F="req ↑",x=C(e);break}let j="#quickvo.logs";(reqIgnoreEvents.includes(r)||resIgnoreEvents.includes(r))&&(j="#quickvo.ignoreEvents");const Z={"#action":F,timeStr:_,event:r,data:x,time:T,...i},ee=localStorage.getItem(j)||JSON.stringify([]),re=JSON.parse(ee);let K=b==="req"&&(r==="heartbeat"||r==="heartbeatEx"),se=b==="res"&&(r==="heartbeat"||r==="heartbeatEx");const fe=[Z];for(const G of re){const{event:ne}=G;if(ne==="heartbeat"||ne==="heartbeatEx"){if(G["#action"].includes("req")&&K||(K=!0,G["#action"].includes("res")&&se))continue;se=!0}if(fe.length===200)break;fe.push(G)}localStorage.setItem(j,JSON.stringify(fe))}catch(T){this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",T)}}}var lib={},ebml={},EBML={},hasRequiredEBML;function requireEBML(){return hasRequiredEBML||(hasRequiredEBML=1,Object.defineProperty(EBML,"__esModule",{value:!0})),EBML}var EBMLDecoder={},int64Buffer={},hasRequiredInt64Buffer;function requireInt64Buffer(){return hasRequiredInt64Buffer||(hasRequiredInt64Buffer=1,(function(m){(function(b){var u="undefined",T=u!==typeof Buffer&&Buffer,r=u!==typeof Uint8Array&&Uint8Array,c=u!==typeof ArrayBuffer&&ArrayBuffer,e=[0,0,0,0,0,0,0,0],t=Array.isArray||ae,i=4294967296,_=16777216,x;C("Uint64BE",!0,!0),C("Int64BE",!0,!1),C("Uint64LE",!1,!0),C("Int64LE",!1,!1);function C(oe,le,pe){var te=le?0:4,ue=le?4:0,he=le?0:3,me=le?1:2,be=le?2:1,Se=le?3:0,xe=le?se:G,Ce=le?fe:ne,Ae=Te.prototype,Ue="is"+oe,Ze="_"+Ue;return Ae.buffer=void 0,Ae.offset=0,Ae[Ze]=!0,Ae.toNumber=Me,Ae.toString=ze,Ae.toJSON=Me,Ae.toArray=F,T&&(Ae.toBuffer=j),r&&(Ae.toArrayBuffer=Z),Te[Ue]=ge,b[oe]=Te,Te;function Te(ke,ye,ve,_e){return this instanceof Te?je(this,ke,ye,ve,_e):new Te(ke,ye,ve,_e)}function ge(ke){return!!(ke&&ke[Ze])}function je(ke,ye,ve,_e,Oe){if(r&&c&&(ye instanceof c&&(ye=new r(ye)),_e instanceof c&&(_e=new r(_e))),!ye&&!ve&&!_e&&!x){ke.buffer=K(e,0);return}if(!ee(ye,ve)){var qe=x||Array;Oe=ve,_e=ye,ve=0,ye=x===T?T.alloc(8):new qe(8)}ke.buffer=ye,ke.offset=ve|=0,u!==typeof _e&&(typeof _e=="string"?Pe(ye,ve,_e,Oe||10):ee(_e,Oe)?re(ye,ve,_e,Oe):typeof Oe=="number"?(Le(ye,ve+te,_e),Le(ye,ve+ue,Oe)):_e>0?xe(ye,ve,_e):_e<0?Ce(ye,ve,_e):re(ye,ve,e,0))}function Pe(ke,ye,ve,_e){var Oe=0,qe=ve.length,Ne=0,Be=0;ve[0]==="-"&&Oe++;for(var He=Oe;Oe<qe;){var Je=parseInt(ve[Oe++],_e);if(!(Je>=0))break;Be=Be*_e+Je,Ne=Ne*_e+Math.floor(Be/i),Be%=i}He&&(Ne=~Ne,Be?Be=i-Be:Ne++),Le(ke,ye+te,Ne),Le(ke,ye+ue,Be)}function Me(){var ke=this.buffer,ye=this.offset,ve=De(ke,ye+te),_e=De(ke,ye+ue);return pe||(ve|=0),ve?ve*i+_e:_e}function ze(ke){var ye=this.buffer,ve=this.offset,_e=De(ye,ve+te),Oe=De(ye,ve+ue),qe="",Ne=!pe&&_e&2147483648;for(Ne&&(_e=~_e,Oe=i-Oe),ke=ke||10;;){var Be=_e%ke*i+Oe;if(_e=Math.floor(_e/ke),Oe=Math.floor(Be/ke),qe=(Be%ke).toString(ke)+qe,!_e&&!Oe)break}return Ne&&(qe="-"+qe),qe}function Le(ke,ye,ve){ke[ye+Se]=ve&255,ve=ve>>8,ke[ye+be]=ve&255,ve=ve>>8,ke[ye+me]=ve&255,ve=ve>>8,ke[ye+he]=ve&255}function De(ke,ye){return ke[ye+he]*_+(ke[ye+me]<<16)+(ke[ye+be]<<8)+ke[ye+Se]}}function F(oe){var le=this.buffer,pe=this.offset;return x=null,oe!==!1&&t(le)?le.length===8?le:le.slice(pe,pe+8):K(le,pe)}function j(oe){var le=this.buffer,pe=this.offset;return x=T,oe!==!1&&T.isBuffer(le)?le.length===8?le:le.slice(pe,pe+8):T.from(Z.call(this,oe))}function Z(oe){var le=this.buffer,pe=this.offset,te=le.buffer;if(x=r,oe!==!1&&!le.offset&&te instanceof c)return te.byteLength===8?te:te.slice(pe,pe+8);var ue=new r(8);return re(ue,0,le,pe),ue.buffer}function ee(oe,le){var pe=oe&&oe.length;return le|=0,pe&&le+8<=pe&&typeof oe[le]!="string"}function re(oe,le,pe,te){le|=0,te|=0;for(var ue=0;ue<8;ue++)oe[le++]=pe[te++]&255}function K(oe,le){return Array.prototype.slice.call(oe,le,le+8)}function se(oe,le,pe){for(var te=le+8;te>le;)oe[--te]=pe&255,pe/=256}function fe(oe,le,pe){var te=le+8;for(pe++;te>le;)oe[--te]=-pe&255^255,pe/=256}function G(oe,le,pe){for(var te=le+8;le<te;)oe[le++]=pe&255,pe/=256}function ne(oe,le,pe){var te=le+8;for(pe++;le<te;)oe[le++]=-pe&255^255,pe/=256}function ae(oe){return!!oe&&Object.prototype.toString.call(oe)=="[object Array]"}})(typeof m.nodeName!="string"?m:int64Buffer||{})})(int64Buffer)),int64Buffer}var tools={},EBMLEncoder={},ebmlID={},hasRequiredEbmlID;function requireEbmlID(){return hasRequiredEbmlID||(hasRequiredEbmlID=1,Object.defineProperty(ebmlID,"__esModule",{value:!0}),ebmlID.byEbmlID=void 0,ebmlID.byEbmlID={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,minver:1,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,minver:1,range:"1-254",description:"A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,minver:1,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,minver:1,description:"An ID corresponding to the codec, see the codec page for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)"},137:{name:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,minver:1,webm:!1,range:"not 0",description:"UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks."},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,minver:1,webm:!0,description:"Timestamp of the start of Chapter (not scaled)."},146:{name:"ChapterTimeEnd",level:4,type:"u",minver:1,webm:!1,description:"Timestamp of the end of Chapter (timestamp excluded, not scaled)."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,webm:!1,description:"Timestamp of the referenced Block."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,webm:!1,description:"The Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping"},16981:{name:"ContentCompSettings",level:6,type:"b",minver:1,webm:!1,description:"Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,minver:1,webm:!1,bytesize:16,description:"A randomly generated unique ID that all segments related to each other must use (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",minver:1,description:"Date of the origin of timestamp (value 0), i.e. production date."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Indication to know if this is the default/original language to use for the given tag. (1 bit)"},17541:{name:"TagBinary",level:4,type:"b",minver:1,webm:!1,description:"The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",minver:1,webm:!1,description:"The value of the Element."},17545:{name:"Duration",level:2,type:"f",minver:1,range:"> 0",description:"Duration of the segment (based on TimecodeScale)."},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)"},18016:{name:"FileMimeType",level:3,type:"s",mandatory:!0,minver:1,webm:!1,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18018:{name:"FileUsedEndTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18037:{name:"FileReferral",level:3,type:"b",webm:!1,description:"A binary value that a track/codec can refer to when the attachment is needed."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)"},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption"},20532:{name:"ContentCompression",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise."},21368:{name:"CueBlockNumber",level:4,type:"u",minver:1,default:1,range:"not 0",description:"Number of the Block in the specified Cluster."},22100:{name:"ChapterStringUID",level:4,type:"8",mandatory:!1,minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Writing application ("mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:1,webm:!1,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",minver:1,range:"not 0",description:"Bits per sample, mostly used for PCM."},25906:{name:"SignedElement",level:3,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,minver:1,webm:!1,description:"The track identification for the given Chapter Codec."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,minver:1,webm:!1,description:"Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)."},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,minver:1,webm:!1,description:"A tuple of corresponding ID used by chapter codecs to represent this segment."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,minver:1,webm:!1,description:"Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters."},29572:{name:"SegmentFilename",level:2,type:"8",minver:1,webm:!1,description:"A filename corresponding to this segment."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"The UID of an attachment that is used by this codec."},2459272:{name:"CodecName",level:3,type:"8",minver:1,description:"A human-readable string specifying the codec."},408125543:{name:"Segment",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment."},17530:{name:"TagLanguage",level:4,type:"s",mandatory:!0,minver:1,webm:!1,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,minver:1,webm:!1,description:"The name of the Tag that is going to be stored."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contains general information about the target."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment."},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",minver:1,webm:!1,strong:"informational",description:'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).'},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",minver:1,webm:!1,default:50,description:"A number to indicate the logical level of the target (see TargetType)."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,minver:1,webm:!1,description:"Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",minver:1,webm:!1,description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.'},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,minver:1,webm:!1,description:"The countries corresponding to the string, same 2 octets as in Internet domains."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,minver:1,webm:!0,default:"eng",description:"The languages corresponding to the string, in the bibliographic ISO-639-2 form."},143:{name:"ChapterTrack",level:4,type:"m",minver:1,webm:!1,description:"List of tracks on which the chapter applies. If this element is not present, all tracks apply"},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",minver:1,webm:!1,description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.'},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",minver:1,webm:!1,range:"not 0",description:"The EditionUID to play from the segment linked in ChapterSegmentUID."},28263:{name:"ChapterSegmentUID",level:4,type:"b",minver:1,webm:!1,range:">0",bytesize:16,description:"A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,minver:1,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},182:{name:"ChapterAtom",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},17885:{name:"EditionFlagOrdered",level:3,type:"u",minver:1,webm:!1,default:0,range:"0-1",description:"Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)"},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a flag is set (1) the edition should be used as the default one. (1 bit)"},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},17852:{name:"EditionUID",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains all information about a segment edition."},272869232:{name:"Chapters",level:1,type:"m",minver:1,webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,range:"not 0",description:"Unique ID representing the file, as random as possible."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The data of the file."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,minver:1,webm:!1,description:"Filename of the attached file."},18046:{name:"FileDescription",level:3,type:"8",minver:1,webm:!1,description:"A human-friendly name for the attached file."},24999:{name:"AttachedFile",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"An attached file."},423732329:{name:"Attachments",level:1,type:"m",minver:1,webm:!1,description:"Contain attached files."},235:{name:"CueRefCodecState",level:5,type:"u",webm:!1,default:0,description:"The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry."},21343:{name:"CueRefNumber",level:5,type:"u",webm:!1,default:1,range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,webm:!1,description:"The Clusters containing the required referenced Blocks."},234:{name:"CueCodecState",level:4,type:"u",minver:2,webm:!1,default:0,description:"The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry."},178:{name:"CueDuration",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},240:{name:"CueRelativePosition",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.",position:"clusterRelative"},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,minver:1,description:"The position of the Cluster containing the required Block.",position:"segment"},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track for which a position is given."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contain positions for different tracks corresponding to the timestamp."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp according to the segment time base."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains all information relative to a seek point in the segment."},475249515:{name:"Cues",level:1,type:"m",minver:1,description:'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.'},18406:{name:"ContentSigHashAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5"},18405:{name:"ContentSigAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA"},18404:{name:"ContentSigKeyID",level:6,type:"b",minver:1,webm:!1,description:"This is the ID of the private key the data was signed with."},18403:{name:"ContentSignature",level:6,type:"b",minver:1,webm:!1,description:"A cryptographic signature of the contents."},18402:{name:"ContentEncKeyID",level:6,type:"b",minver:1,webm:!1,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18401:{name:"ContentEncAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES"},28032:{name:"ContentEncodings",level:3,type:"m",minver:1,webm:!1,description:"Settings for several content encoding mechanisms like compression or encryption."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},199:{name:"TrickMasterTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},198:{name:"TrickTrackFlag",level:3,type:"u",divx:!0,default:0,description:"DivX trick track extenstions"},193:{name:"TrickTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},192:{name:"TrickTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,webm:!1,description:"The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)."},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of the track representing the plane."},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,webm:!1,description:"Contains a video plane track that need to be combined to create this 3D track"},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},226:{name:"TrackOperation",level:3,type:"m",minver:3,webm:!1,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",webm:!1,description:"Table of horizontal angles for each successive channel, see appendix."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,minver:1,default:1,range:"not 0",description:"Numbers of channels in the track."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",minver:1,default:"Sampling Frequency",range:"> 0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,minver:1,default:8e3,range:"> 0",description:"Sampling frequency in Hz."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",minver:1,description:"Audio settings."},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",range:"> 0",strong:"Informational",description:"Number of frames per second. only."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",webm:!1,range:"> 0",description:"Gamma Value."},3061028:{name:"ColourSpace",cppname:"VideoColourSpace",level:4,type:"b",minver:1,webm:!1,bytesize:4,description:"Same value as in AVI (32 bits)."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:1,default:0,description:"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",minver:1,default:0,description:"How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",minver:1,default:"PixelHeight",range:"not 0",description:"Height of the video frames to display. The default value is only valid when DisplayUnit is 0."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",minver:1,default:"PixelWidth",range:"not 0",description:"Width of the video frames to display. The default value is only valid when DisplayUnit is 0."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the right of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the left of the image."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the top of the image."},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the bottom of the image (for HDTV content)."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Height of the encoded video frames in pixels."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Width of the encoded video frames in pixels."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:"0",webm:!1,divx:!1,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:0,range:"0-1",description:"Set if the video is interlaced. (1 bit)"},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",minver:1,description:"Video settings."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:"After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid."},22186:{name:"CodecDelay",level:3,type:"u",multiple:!1,default:0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,minver:2,webm:!1,default:1,range:"0-1",description:"The codec can decode potentially damaged data (1 bit)."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to download about the codec used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to find information about the codec used."},3839639:{name:"CodecSettings",level:3,type:"8",webm:!1,description:"A string describing the encoding setting used."},25506:{name:"CodecPrivate",level:3,type:"b",minver:1,description:"Private data only known to the codec."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",minver:1,default:"eng",description:"Specifies the language of the track in the Matroska languages form."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",minver:1,description:"A human-readable track name."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The maximum value of BlockAdditions for this track."},21375:{name:"TrackOffset",level:3,type:"i",webm:!1,default:0,description:"A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track."},2306383:{name:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,minver:1,maxver:"3",webm:!1,default:1,range:"> 0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:`The period in nanoseconds (not scaled by TimcodeScale)
|
|
4
|
-
between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",minver:1,range:"not 0",description:"Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",minver:1,webm:!1,description:"The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if the track may contain blocks using lacing. (1 bit)"},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,minver:1,default:0,range:"0-1",description:"Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)"},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:1,range:"0-1",description:"Set if the track is usable. (1 bit)"},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Describes a track with all elements."},374648427:{name:"Tracks",level:1,type:"m",multiple:!0,minver:1,description:"A top-level block of information with many tracks described."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,webm:!1,description:"Similar to EncryptedBlock Structure)"},202:{name:"ReferenceTimeCode",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},201:{name:"ReferenceOffset",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},200:{name:"ReferenceFrame",level:3,type:"m",multiple:!1,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},207:{name:"SliceDuration",level:5,type:"u",default:0,description:"The (scaled) duration to apply to the element."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",default:0,description:"The (scaled) delay to apply to the element."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",default:0,description:"The ID of the BlockAdditional element (0 is the main Block)."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",default:0,description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:1,default:0,divx:!1,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:1,divx:!1,description:"Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},142:{name:"Slices",level:3,type:"m",minver:1,divx:!1,description:"Contains slices description."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback."},164:{name:"CodecState",level:3,type:"b",minver:2,webm:!1,description:"The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry."},253:{name:"ReferenceVirtual",level:3,type:"i",webm:!1,description:"Relative position of the data that should be in position of the virtual block."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,minver:1,description:"Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to."},250:{name:"ReferencePriority",cppname:"FlagReferenced",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},155:{name:"BlockDuration",level:3,type:"u",minver:1,default:"TrackDuration",description:'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.'},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,minver:1,webm:!1,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"An ID to identify the BlockAdditional level."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contain the BlockAdditional and some parameters."},30113:{name:"BlockAdditions",level:3,type:"m",minver:1,webm:!1,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},162:{name:"BlockVirtual",level:3,type:"b",webm:!1,description:"A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)"},161:{name:"Block",level:3,type:"b",mandatory:!0,minver:1,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)"},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,minver:1,description:"Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock."},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to SimpleBlock Structure"},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",minver:1,description:"Size of the previous Cluster, in octets. Can be useful for backward playing.",position:"prevCluster"},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",minver:1,webm:!1,description:"The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.",position:"segment"},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},231:{name:"Timecode",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp of the cluster (based on TimecodeScale)."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,minver:1,description:"The lower level element containing the (monolithic) Block structure."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Muxing application or library ("libmatroska-0.4.3").'},31657:{name:"Title",level:2,type:"8",minver:1,webm:!1,description:"General name of the segment."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},2807729:{name:"TimecodeScale",level:2,type:"u",mandatory:!0,minver:1,default:"1000000",description:"Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment."},4096955:{name:"NextFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the next segment."},4110627:{name:"NextUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the next chained segment (128 bits)."},3965867:{name:"PrevFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the previous segment."},3979555:{name:"PrevUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the previous chained segment (128 bits)."},29604:{name:"SegmentUID",level:2,type:"b",minver:1,webm:!1,range:"not 0",bytesize:16,description:"A randomly generated unique ID to identify the current segment between many others (128 bits)."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains miscellaneous general information and statistics on the file."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,minver:1,description:"The position of the element in the segment in octets (0 = first level 1 element).",position:"segment"},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,minver:1,description:"The binary ID corresponding to the element name.",type2:"ebmlID"},19899:{name:"Seek",cppname:"SeekPoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains a single seek entry to an EBML element."},290298740:{name:"SeekHead",cppname:"SeekHeader",level:1,type:"m",multiple:!0,minver:1,description:"Contains the position of other level 1 elements."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32437:{name:"Signature",level:1,type:"b",webm:!1,description:"The signature of the data (until a new."},32421:{name:"SignaturePublicKey",level:1,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32410:{name:"SignatureHash",level:1,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32394:{name:"SignatureAlgo",level:1,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},458458727:{name:"SignatureSlot",level:-1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian",crc:!0},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:8,minver:1,description:"The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:4,minver:1,description:"The maximum length of the IDs you'll find in this file (4 or less in Matroska)."},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},21936:{name:"Colour",level:"4",type:"m",mandatory:!0,multiple:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21945:{name:"Range",level:"5",type:"u",mandatory:!0,multiple:!0,description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The transfer characteristics of the video."},21947:{name:"Primaries",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."}}),ebmlID}var hasRequiredEBMLEncoder;function requireEBMLEncoder(){if(hasRequiredEBMLEncoder)return EBMLEncoder;hasRequiredEBMLEncoder=1,Object.defineProperty(EBMLEncoder,"__esModule",{value:!0});var m=requireTools(),b=requireTools(),u=requireEbmlID(),T=(function(){function r(){this._schema=u.byEbmlID,this._buffers=[],this._stack=[]}return r.prototype.encode=function(c){var e=this;return m.concat(c.reduce(function(t,i){return t.concat(e.encodeChunk(i))},[])).buffer},r.prototype.encodeChunk=function(c){return c.type==="m"?c.isEnd?this.endTag(c):this.startTag(c):(c.data=b.Buffer.from(c.data),this.writeTag(c)),this.flush()},r.prototype.flush=function(){var c=this._buffers;return this._buffers=[],c},r.prototype.getSchemaInfo=function(c){for(var e=Object.keys(this._schema).map(Number),t=0;t<e.length;t++){var i=e[t];if(this._schema[i].name===c)return new b.Buffer(i.toString(16),"hex")}return null},r.prototype.writeTag=function(c){var e=c.name,t=this.getSchemaInfo(e),i=c.data;if(t==null)throw new Error("No schema entry found for "+e);var _=m.encodeTag(t,i);if(this._stack.length>0){var x=this._stack[this._stack.length-1];x.children.push({tagId:t,elm:c,children:[],data:_});return}this._buffers=this._buffers.concat(_)},r.prototype.startTag=function(c){var e=c.name,t=this.getSchemaInfo(e);if(t==null)throw new Error("No schema entry found for "+e);if(c.unknownSize){var i=m.encodeTag(t,new b.Buffer(0),c.unknownSize);this._buffers=this._buffers.concat(i);return}var _={tagId:t,elm:c,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(_),this._stack.push(_)},r.prototype.endTag=function(c){c.name;var e=this._stack.pop();if(e==null)throw new Error("EBML structure is broken");if(e.elm.name!==c.name)throw new Error("EBML structure is broken");var t=e.children.reduce(function(_,x){if(x.data===null)throw new Error("EBML structure is broken");return _.concat(x.data)},[]),i=m.concat(t);e.elm.type==="m"?e.data=m.encodeTag(e.tagId,i,e.elm.unknownSize):e.data=m.encodeTag(e.tagId,i),this._stack.length<1&&(this._buffers=this._buffers.concat(e.data))},r})();return EBMLEncoder.default=T,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=t,base64Js.toByteArray=_,base64Js.fromByteArray=F;for(var m=[],b=[],u=typeof Uint8Array<"u"?Uint8Array:Array,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,c=T.length;r<c;++r)m[r]=T[r],b[T.charCodeAt(r)]=r;b[45]=62,b[95]=63;function e(j){var Z=j.length;if(Z%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ee=j.indexOf("=");ee===-1&&(ee=Z);var re=ee===Z?0:4-ee%4;return[ee,re]}function t(j){var Z=e(j),ee=Z[0],re=Z[1];return(ee+re)*3/4-re}function i(j,Z,ee){return(Z+ee)*3/4-ee}function _(j){var Z,ee=e(j),re=ee[0],K=ee[1],se=new u(i(j,re,K)),fe=0,G=K>0?re-4:re,ne;for(ne=0;ne<G;ne+=4)Z=b[j.charCodeAt(ne)]<<18|b[j.charCodeAt(ne+1)]<<12|b[j.charCodeAt(ne+2)]<<6|b[j.charCodeAt(ne+3)],se[fe++]=Z>>16&255,se[fe++]=Z>>8&255,se[fe++]=Z&255;return K===2&&(Z=b[j.charCodeAt(ne)]<<2|b[j.charCodeAt(ne+1)]>>4,se[fe++]=Z&255),K===1&&(Z=b[j.charCodeAt(ne)]<<10|b[j.charCodeAt(ne+1)]<<4|b[j.charCodeAt(ne+2)]>>2,se[fe++]=Z>>8&255,se[fe++]=Z&255),se}function x(j){return m[j>>18&63]+m[j>>12&63]+m[j>>6&63]+m[j&63]}function C(j,Z,ee){for(var re,K=[],se=Z;se<ee;se+=3)re=(j[se]<<16&16711680)+(j[se+1]<<8&65280)+(j[se+2]&255),K.push(x(re));return K.join("")}function F(j){for(var Z,ee=j.length,re=ee%3,K=[],se=16383,fe=0,G=ee-re;fe<G;fe+=se)K.push(C(j,fe,fe+se>G?G:fe+se));return re===1?(Z=j[ee-1],K.push(m[Z>>2]+m[Z<<4&63]+"==")):re===2&&(Z=(j[ee-2]<<8)+j[ee-1],K.push(m[Z>>10]+m[Z>>4&63]+m[Z<<2&63]+"=")),K.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(m,b,u,T,r){var c,e,t=r*8-T-1,i=(1<<t)-1,_=i>>1,x=-7,C=u?r-1:0,F=u?-1:1,j=m[b+C];for(C+=F,c=j&(1<<-x)-1,j>>=-x,x+=t;x>0;c=c*256+m[b+C],C+=F,x-=8);for(e=c&(1<<-x)-1,c>>=-x,x+=T;x>0;e=e*256+m[b+C],C+=F,x-=8);if(c===0)c=1-_;else{if(c===i)return e?NaN:(j?-1:1)*(1/0);e=e+Math.pow(2,T),c=c-_}return(j?-1:1)*e*Math.pow(2,c-T)},ieee754.write=function(m,b,u,T,r,c){var e,t,i,_=c*8-r-1,x=(1<<_)-1,C=x>>1,F=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,j=T?0:c-1,Z=T?1:-1,ee=b<0||b===0&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(t=isNaN(b)?1:0,e=x):(e=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-e))<1&&(e--,i*=2),e+C>=1?b+=F/i:b+=F*Math.pow(2,1-C),b*i>=2&&(e++,i/=2),e+C>=x?(t=0,e=x):e+C>=1?(t=(b*i-1)*Math.pow(2,r),e=e+C):(t=b*Math.pow(2,C-1)*Math.pow(2,r),e=0));r>=8;m[u+j]=t&255,j+=Z,t/=256,r-=8);for(e=e<<r|t,_+=r;_>0;m[u+j]=e&255,j+=Z,e/=256,_-=8);m[u+j-Z]|=ee*128}),ieee754}var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,(function(m){const b=requireBase64Js(),u=requireIeee754(),T=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;m.Buffer=t,m.SlowBuffer=se,m.INSPECT_MAX_BYTES=50;const r=2147483647;m.kMaxLength=r,t.TYPED_ARRAY_SUPPORT=c(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const z=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(z,N),z.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(z){if(z>r)throw new RangeError('The value "'+z+'" is invalid for option "size"');const N=new Uint8Array(z);return Object.setPrototypeOf(N,t.prototype),N}function t(z,N,M){if(typeof z=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(z)}return i(z,N,M)}t.poolSize=8192;function i(z,N,M){if(typeof z=="string")return F(z,N);if(ArrayBuffer.isView(z))return Z(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Fe(z,ArrayBuffer)||z&&Fe(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Fe(z,SharedArrayBuffer)||z&&Fe(z.buffer,SharedArrayBuffer)))return ee(z,N,M);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const V=z.valueOf&&z.valueOf();if(V!=null&&V!==z)return t.from(V,N,M);const ie=re(z);if(ie)return ie;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return t.from(z[Symbol.toPrimitive]("string"),N,M);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}t.from=function(z,N,M){return i(z,N,M)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function _(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function x(z,N,M){return _(z),z<=0?e(z):N!==void 0?typeof M=="string"?e(z).fill(N,M):e(z).fill(N):e(z)}t.alloc=function(z,N,M){return x(z,N,M)};function C(z){return _(z),e(z<0?0:K(z)|0)}t.allocUnsafe=function(z){return C(z)},t.allocUnsafeSlow=function(z){return C(z)};function F(z,N){if((typeof N!="string"||N==="")&&(N="utf8"),!t.isEncoding(N))throw new TypeError("Unknown encoding: "+N);const M=fe(z,N)|0;let V=e(M);const ie=V.write(z,N);return ie!==M&&(V=V.slice(0,ie)),V}function j(z){const N=z.length<0?0:K(z.length)|0,M=e(N);for(let V=0;V<N;V+=1)M[V]=z[V]&255;return M}function Z(z){if(Fe(z,Uint8Array)){const N=new Uint8Array(z);return ee(N.buffer,N.byteOffset,N.byteLength)}return j(z)}function ee(z,N,M){if(N<0||z.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<N+(M||0))throw new RangeError('"length" is outside of buffer bounds');let V;return N===void 0&&M===void 0?V=new Uint8Array(z):M===void 0?V=new Uint8Array(z,N):V=new Uint8Array(z,N,M),Object.setPrototypeOf(V,t.prototype),V}function re(z){if(t.isBuffer(z)){const N=K(z.length)|0,M=e(N);return M.length===0||z.copy(M,0,0,N),M}if(z.length!==void 0)return typeof z.length!="number"||Ke(z.length)?e(0):j(z);if(z.type==="Buffer"&&Array.isArray(z.data))return j(z.data)}function K(z){if(z>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return z|0}function se(z){return+z!=z&&(z=0),t.alloc(+z)}t.isBuffer=function(N){return N!=null&&N._isBuffer===!0&&N!==t.prototype},t.compare=function(N,M){if(Fe(N,Uint8Array)&&(N=t.from(N,N.offset,N.byteLength)),Fe(M,Uint8Array)&&(M=t.from(M,M.offset,M.byteLength)),!t.isBuffer(N)||!t.isBuffer(M))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(N===M)return 0;let V=N.length,ie=M.length;for(let ce=0,de=Math.min(V,ie);ce<de;++ce)if(N[ce]!==M[ce]){V=N[ce],ie=M[ce];break}return V<ie?-1:ie<V?1:0},t.isEncoding=function(N){switch(String(N).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(N,M){if(!Array.isArray(N))throw new TypeError('"list" argument must be an Array of Buffers');if(N.length===0)return t.alloc(0);let V;if(M===void 0)for(M=0,V=0;V<N.length;++V)M+=N[V].length;const ie=t.allocUnsafe(M);let ce=0;for(V=0;V<N.length;++V){let de=N[V];if(Fe(de,Uint8Array))ce+de.length>ie.length?(t.isBuffer(de)||(de=t.from(de)),de.copy(ie,ce)):Uint8Array.prototype.set.call(ie,de,ce);else if(t.isBuffer(de))de.copy(ie,ce);else throw new TypeError('"list" argument must be an Array of Buffers');ce+=de.length}return ie};function fe(z,N){if(t.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Fe(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);const M=z.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&M===0)return 0;let ie=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return M;case"utf8":case"utf-8":return He(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M*2;case"hex":return M>>>1;case"base64":return We(z).length;default:if(ie)return V?-1:He(z).length;N=(""+N).toLowerCase(),ie=!0}}t.byteLength=fe;function G(z,N,M){let V=!1;if((N===void 0||N<0)&&(N=0),N>this.length||((M===void 0||M>this.length)&&(M=this.length),M<=0)||(M>>>=0,N>>>=0,M<=N))return"";for(z||(z="utf8");;)switch(z){case"hex":return Ue(this,N,M);case"utf8":case"utf-8":return be(this,N,M);case"ascii":return Ce(this,N,M);case"latin1":case"binary":return Ae(this,N,M);case"base64":return me(this,N,M);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,N,M);default:if(V)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),V=!0}}t.prototype._isBuffer=!0;function ne(z,N,M){const V=z[N];z[N]=z[M],z[M]=V}t.prototype.swap16=function(){const N=this.length;if(N%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let M=0;M<N;M+=2)ne(this,M,M+1);return this},t.prototype.swap32=function(){const N=this.length;if(N%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let M=0;M<N;M+=4)ne(this,M,M+3),ne(this,M+1,M+2);return this},t.prototype.swap64=function(){const N=this.length;if(N%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let M=0;M<N;M+=8)ne(this,M,M+7),ne(this,M+1,M+6),ne(this,M+2,M+5),ne(this,M+3,M+4);return this},t.prototype.toString=function(){const N=this.length;return N===0?"":arguments.length===0?be(this,0,N):G.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(N){if(!t.isBuffer(N))throw new TypeError("Argument must be a Buffer");return this===N?!0:t.compare(this,N)===0},t.prototype.inspect=function(){let N="";const M=m.INSPECT_MAX_BYTES;return N=this.toString("hex",0,M).replace(/(.{2})/g,"$1 ").trim(),this.length>M&&(N+=" ... "),"<Buffer "+N+">"},T&&(t.prototype[T]=t.prototype.inspect),t.prototype.compare=function(N,M,V,ie,ce){if(Fe(N,Uint8Array)&&(N=t.from(N,N.offset,N.byteLength)),!t.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(M===void 0&&(M=0),V===void 0&&(V=N?N.length:0),ie===void 0&&(ie=0),ce===void 0&&(ce=this.length),M<0||V>N.length||ie<0||ce>this.length)throw new RangeError("out of range index");if(ie>=ce&&M>=V)return 0;if(ie>=ce)return-1;if(M>=V)return 1;if(M>>>=0,V>>>=0,ie>>>=0,ce>>>=0,this===N)return 0;let de=ce-ie,we=V-M;const Ee=Math.min(de,we),Re=this.slice(ie,ce),$e=N.slice(M,V);for(let Ie=0;Ie<Ee;++Ie)if(Re[Ie]!==$e[Ie]){de=Re[Ie],we=$e[Ie];break}return de<we?-1:we<de?1:0};function ae(z,N,M,V,ie){if(z.length===0)return-1;if(typeof M=="string"?(V=M,M=0):M>2147483647?M=2147483647:M<-2147483648&&(M=-2147483648),M=+M,Ke(M)&&(M=ie?0:z.length-1),M<0&&(M=z.length+M),M>=z.length){if(ie)return-1;M=z.length-1}else if(M<0)if(ie)M=0;else return-1;if(typeof N=="string"&&(N=t.from(N,V)),t.isBuffer(N))return N.length===0?-1:oe(z,N,M,V,ie);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?ie?Uint8Array.prototype.indexOf.call(z,N,M):Uint8Array.prototype.lastIndexOf.call(z,N,M):oe(z,[N],M,V,ie);throw new TypeError("val must be string, number or Buffer")}function oe(z,N,M,V,ie){let ce=1,de=z.length,we=N.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(z.length<2||N.length<2)return-1;ce=2,de/=2,we/=2,M/=2}function Ee($e,Ie){return ce===1?$e[Ie]:$e.readUInt16BE(Ie*ce)}let Re;if(ie){let $e=-1;for(Re=M;Re<de;Re++)if(Ee(z,Re)===Ee(N,$e===-1?0:Re-$e)){if($e===-1&&($e=Re),Re-$e+1===we)return $e*ce}else $e!==-1&&(Re-=Re-$e),$e=-1}else for(M+we>de&&(M=de-we),Re=M;Re>=0;Re--){let $e=!0;for(let Ie=0;Ie<we;Ie++)if(Ee(z,Re+Ie)!==Ee(N,Ie)){$e=!1;break}if($e)return Re}return-1}t.prototype.includes=function(N,M,V){return this.indexOf(N,M,V)!==-1},t.prototype.indexOf=function(N,M,V){return ae(this,N,M,V,!0)},t.prototype.lastIndexOf=function(N,M,V){return ae(this,N,M,V,!1)};function le(z,N,M,V){M=Number(M)||0;const ie=z.length-M;V?(V=Number(V),V>ie&&(V=ie)):V=ie;const ce=N.length;V>ce/2&&(V=ce/2);let de;for(de=0;de<V;++de){const we=parseInt(N.substr(de*2,2),16);if(Ke(we))return de;z[M+de]=we}return de}function pe(z,N,M,V){return Ge(He(N,z.length-M),z,M,V)}function te(z,N,M,V){return Ge(Je(N),z,M,V)}function ue(z,N,M,V){return Ge(We(N),z,M,V)}function he(z,N,M,V){return Ge(Qe(N,z.length-M),z,M,V)}t.prototype.write=function(N,M,V,ie){if(M===void 0)ie="utf8",V=this.length,M=0;else if(V===void 0&&typeof M=="string")ie=M,V=this.length,M=0;else if(isFinite(M))M=M>>>0,isFinite(V)?(V=V>>>0,ie===void 0&&(ie="utf8")):(ie=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ce=this.length-M;if((V===void 0||V>ce)&&(V=ce),N.length>0&&(V<0||M<0)||M>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let de=!1;for(;;)switch(ie){case"hex":return le(this,N,M,V);case"utf8":case"utf-8":return pe(this,N,M,V);case"ascii":case"latin1":case"binary":return te(this,N,M,V);case"base64":return ue(this,N,M,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,N,M,V);default:if(de)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),de=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(z,N,M){return N===0&&M===z.length?b.fromByteArray(z):b.fromByteArray(z.slice(N,M))}function be(z,N,M){M=Math.min(z.length,M);const V=[];let ie=N;for(;ie<M;){const ce=z[ie];let de=null,we=ce>239?4:ce>223?3:ce>191?2:1;if(ie+we<=M){let Ee,Re,$e,Ie;switch(we){case 1:ce<128&&(de=ce);break;case 2:Ee=z[ie+1],(Ee&192)===128&&(Ie=(ce&31)<<6|Ee&63,Ie>127&&(de=Ie));break;case 3:Ee=z[ie+1],Re=z[ie+2],(Ee&192)===128&&(Re&192)===128&&(Ie=(ce&15)<<12|(Ee&63)<<6|Re&63,Ie>2047&&(Ie<55296||Ie>57343)&&(de=Ie));break;case 4:Ee=z[ie+1],Re=z[ie+2],$e=z[ie+3],(Ee&192)===128&&(Re&192)===128&&($e&192)===128&&(Ie=(ce&15)<<18|(Ee&63)<<12|(Re&63)<<6|$e&63,Ie>65535&&Ie<1114112&&(de=Ie))}}de===null?(de=65533,we=1):de>65535&&(de-=65536,V.push(de>>>10&1023|55296),de=56320|de&1023),V.push(de),ie+=we}return xe(V)}const Se=4096;function xe(z){const N=z.length;if(N<=Se)return String.fromCharCode.apply(String,z);let M="",V=0;for(;V<N;)M+=String.fromCharCode.apply(String,z.slice(V,V+=Se));return M}function Ce(z,N,M){let V="";M=Math.min(z.length,M);for(let ie=N;ie<M;++ie)V+=String.fromCharCode(z[ie]&127);return V}function Ae(z,N,M){let V="";M=Math.min(z.length,M);for(let ie=N;ie<M;++ie)V+=String.fromCharCode(z[ie]);return V}function Ue(z,N,M){const V=z.length;(!N||N<0)&&(N=0),(!M||M<0||M>V)&&(M=V);let ie="";for(let ce=N;ce<M;++ce)ie+=Ye[z[ce]];return ie}function Ze(z,N,M){const V=z.slice(N,M);let ie="";for(let ce=0;ce<V.length-1;ce+=2)ie+=String.fromCharCode(V[ce]+V[ce+1]*256);return ie}t.prototype.slice=function(N,M){const V=this.length;N=~~N,M=M===void 0?V:~~M,N<0?(N+=V,N<0&&(N=0)):N>V&&(N=V),M<0?(M+=V,M<0&&(M=0)):M>V&&(M=V),M<N&&(M=N);const ie=this.subarray(N,M);return Object.setPrototypeOf(ie,t.prototype),ie};function Te(z,N,M){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+N>M)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=this[N],ce=1,de=0;for(;++de<M&&(ce*=256);)ie+=this[N+de]*ce;return ie},t.prototype.readUintBE=t.prototype.readUIntBE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=this[N+--M],ce=1;for(;M>0&&(ce*=256);)ie+=this[N+--M]*ce;return ie},t.prototype.readUint8=t.prototype.readUInt8=function(N,M){return N=N>>>0,M||Te(N,1,this.length),this[N]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(N,M){return N=N>>>0,M||Te(N,2,this.length),this[N]|this[N+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(N,M){return N=N>>>0,M||Te(N,2,this.length),this[N]<<8|this[N+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+this[N+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),this[N]*16777216+(this[N+1]<<16|this[N+2]<<8|this[N+3])},t.prototype.readBigUInt64LE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=M+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24,ce=this[++N]+this[++N]*2**8+this[++N]*2**16+V*2**24;return BigInt(ie)+(BigInt(ce)<<BigInt(32))}),t.prototype.readBigUInt64BE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=M*2**24+this[++N]*2**16+this[++N]*2**8+this[++N],ce=this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+V;return(BigInt(ie)<<BigInt(32))+BigInt(ce)}),t.prototype.readIntLE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=this[N],ce=1,de=0;for(;++de<M&&(ce*=256);)ie+=this[N+de]*ce;return ce*=128,ie>=ce&&(ie-=Math.pow(2,8*M)),ie},t.prototype.readIntBE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=M,ce=1,de=this[N+--ie];for(;ie>0&&(ce*=256);)de+=this[N+--ie]*ce;return ce*=128,de>=ce&&(de-=Math.pow(2,8*M)),de},t.prototype.readInt8=function(N,M){return N=N>>>0,M||Te(N,1,this.length),this[N]&128?(255-this[N]+1)*-1:this[N]},t.prototype.readInt16LE=function(N,M){N=N>>>0,M||Te(N,2,this.length);const V=this[N]|this[N+1]<<8;return V&32768?V|4294901760:V},t.prototype.readInt16BE=function(N,M){N=N>>>0,M||Te(N,2,this.length);const V=this[N+1]|this[N]<<8;return V&32768?V|4294901760:V},t.prototype.readInt32LE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},t.prototype.readInt32BE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},t.prototype.readBigInt64LE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=this[N+4]+this[N+5]*2**8+this[N+6]*2**16+(V<<24);return(BigInt(ie)<<BigInt(32))+BigInt(M+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24)}),t.prototype.readBigInt64BE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=(M<<24)+this[++N]*2**16+this[++N]*2**8+this[++N];return(BigInt(ie)<<BigInt(32))+BigInt(this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+V)}),t.prototype.readFloatLE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),u.read(this,N,!0,23,4)},t.prototype.readFloatBE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),u.read(this,N,!1,23,4)},t.prototype.readDoubleLE=function(N,M){return N=N>>>0,M||Te(N,8,this.length),u.read(this,N,!0,52,8)},t.prototype.readDoubleBE=function(N,M){return N=N>>>0,M||Te(N,8,this.length),u.read(this,N,!1,52,8)};function ge(z,N,M,V,ie,ce){if(!t.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>ie||N<ce)throw new RangeError('"value" argument is out of bounds');if(M+V>z.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(N,M,V,ie){if(N=+N,M=M>>>0,V=V>>>0,!ie){const we=Math.pow(2,8*V)-1;ge(this,N,M,V,we,0)}let ce=1,de=0;for(this[M]=N&255;++de<V&&(ce*=256);)this[M+de]=N/ce&255;return M+V},t.prototype.writeUintBE=t.prototype.writeUIntBE=function(N,M,V,ie){if(N=+N,M=M>>>0,V=V>>>0,!ie){const we=Math.pow(2,8*V)-1;ge(this,N,M,V,we,0)}let ce=V-1,de=1;for(this[M+ce]=N&255;--ce>=0&&(de*=256);)this[M+ce]=N/de&255;return M+V},t.prototype.writeUint8=t.prototype.writeUInt8=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,1,255,0),this[M]=N&255,M+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,65535,0),this[M]=N&255,this[M+1]=N>>>8,M+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,65535,0),this[M]=N>>>8,this[M+1]=N&255,M+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,4294967295,0),this[M+3]=N>>>24,this[M+2]=N>>>16,this[M+1]=N>>>8,this[M]=N&255,M+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,4294967295,0),this[M]=N>>>24,this[M+1]=N>>>16,this[M+2]=N>>>8,this[M+3]=N&255,M+4};function je(z,N,M,V,ie){_e(N,V,ie,z,M,7);let ce=Number(N&BigInt(4294967295));z[M++]=ce,ce=ce>>8,z[M++]=ce,ce=ce>>8,z[M++]=ce,ce=ce>>8,z[M++]=ce;let de=Number(N>>BigInt(32)&BigInt(4294967295));return z[M++]=de,de=de>>8,z[M++]=de,de=de>>8,z[M++]=de,de=de>>8,z[M++]=de,M}function Pe(z,N,M,V,ie){_e(N,V,ie,z,M,7);let ce=Number(N&BigInt(4294967295));z[M+7]=ce,ce=ce>>8,z[M+6]=ce,ce=ce>>8,z[M+5]=ce,ce=ce>>8,z[M+4]=ce;let de=Number(N>>BigInt(32)&BigInt(4294967295));return z[M+3]=de,de=de>>8,z[M+2]=de,de=de>>8,z[M+1]=de,de=de>>8,z[M]=de,M+8}t.prototype.writeBigUInt64LE=Ve(function(N,M=0){return je(this,N,M,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=Ve(function(N,M=0){return Pe(this,N,M,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(N,M,V,ie){if(N=+N,M=M>>>0,!ie){const Ee=Math.pow(2,8*V-1);ge(this,N,M,V,Ee-1,-Ee)}let ce=0,de=1,we=0;for(this[M]=N&255;++ce<V&&(de*=256);)N<0&&we===0&&this[M+ce-1]!==0&&(we=1),this[M+ce]=(N/de>>0)-we&255;return M+V},t.prototype.writeIntBE=function(N,M,V,ie){if(N=+N,M=M>>>0,!ie){const Ee=Math.pow(2,8*V-1);ge(this,N,M,V,Ee-1,-Ee)}let ce=V-1,de=1,we=0;for(this[M+ce]=N&255;--ce>=0&&(de*=256);)N<0&&we===0&&this[M+ce+1]!==0&&(we=1),this[M+ce]=(N/de>>0)-we&255;return M+V},t.prototype.writeInt8=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,1,127,-128),N<0&&(N=255+N+1),this[M]=N&255,M+1},t.prototype.writeInt16LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,32767,-32768),this[M]=N&255,this[M+1]=N>>>8,M+2},t.prototype.writeInt16BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,32767,-32768),this[M]=N>>>8,this[M+1]=N&255,M+2},t.prototype.writeInt32LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,2147483647,-2147483648),this[M]=N&255,this[M+1]=N>>>8,this[M+2]=N>>>16,this[M+3]=N>>>24,M+4},t.prototype.writeInt32BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[M]=N>>>24,this[M+1]=N>>>16,this[M+2]=N>>>8,this[M+3]=N&255,M+4},t.prototype.writeBigInt64LE=Ve(function(N,M=0){return je(this,N,M,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=Ve(function(N,M=0){return Pe(this,N,M,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Me(z,N,M,V,ie,ce){if(M+V>z.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("Index out of range")}function ze(z,N,M,V,ie){return N=+N,M=M>>>0,ie||Me(z,N,M,4),u.write(z,N,M,V,23,4),M+4}t.prototype.writeFloatLE=function(N,M,V){return ze(this,N,M,!0,V)},t.prototype.writeFloatBE=function(N,M,V){return ze(this,N,M,!1,V)};function Le(z,N,M,V,ie){return N=+N,M=M>>>0,ie||Me(z,N,M,8),u.write(z,N,M,V,52,8),M+8}t.prototype.writeDoubleLE=function(N,M,V){return Le(this,N,M,!0,V)},t.prototype.writeDoubleBE=function(N,M,V){return Le(this,N,M,!1,V)},t.prototype.copy=function(N,M,V,ie){if(!t.isBuffer(N))throw new TypeError("argument should be a Buffer");if(V||(V=0),!ie&&ie!==0&&(ie=this.length),M>=N.length&&(M=N.length),M||(M=0),ie>0&&ie<V&&(ie=V),ie===V||N.length===0||this.length===0)return 0;if(M<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),N.length-M<ie-V&&(ie=N.length-M+V);const ce=ie-V;return this===N&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(M,V,ie):Uint8Array.prototype.set.call(N,this.subarray(V,ie),M),ce},t.prototype.fill=function(N,M,V,ie){if(typeof N=="string"){if(typeof M=="string"?(ie=M,M=0,V=this.length):typeof V=="string"&&(ie=V,V=this.length),ie!==void 0&&typeof ie!="string")throw new TypeError("encoding must be a string");if(typeof ie=="string"&&!t.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);if(N.length===1){const de=N.charCodeAt(0);(ie==="utf8"&&de<128||ie==="latin1")&&(N=de)}}else typeof N=="number"?N=N&255:typeof N=="boolean"&&(N=Number(N));if(M<0||this.length<M||this.length<V)throw new RangeError("Out of range index");if(V<=M)return this;M=M>>>0,V=V===void 0?this.length:V>>>0,N||(N=0);let ce;if(typeof N=="number")for(ce=M;ce<V;++ce)this[ce]=N;else{const de=t.isBuffer(N)?N:t.from(N,ie),we=de.length;if(we===0)throw new TypeError('The value "'+N+'" is invalid for argument "value"');for(ce=0;ce<V-M;++ce)this[ce+M]=de[ce%we]}return this};const De={};function ke(z,N,M){De[z]=class extends M{constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${z}]`,this.stack,delete this.name}get code(){return z}set code(ie){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ie,writable:!0})}toString(){return`${this.name} [${z}]: ${this.message}`}}}ke("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?`${z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ke("ERR_INVALID_ARG_TYPE",function(z,N){return`The "${z}" argument must be of type number. Received type ${typeof N}`},TypeError),ke("ERR_OUT_OF_RANGE",function(z,N,M){let V=`The value of "${z}" is out of range.`,ie=M;return Number.isInteger(M)&&Math.abs(M)>2**32?ie=ye(String(M)):typeof M=="bigint"&&(ie=String(M),(M>BigInt(2)**BigInt(32)||M<-(BigInt(2)**BigInt(32)))&&(ie=ye(ie)),ie+="n"),V+=` It must be ${N}. Received ${ie}`,V},RangeError);function ye(z){let N="",M=z.length;const V=z[0]==="-"?1:0;for(;M>=V+4;M-=3)N=`_${z.slice(M-3,M)}${N}`;return`${z.slice(0,M)}${N}`}function ve(z,N,M){Oe(N,"offset"),(z[N]===void 0||z[N+M]===void 0)&&qe(N,z.length-(M+1))}function _e(z,N,M,V,ie,ce){if(z>M||z<N){const de=typeof N=="bigint"?"n":"";let we;throw N===0||N===BigInt(0)?we=`>= 0${de} and < 2${de} ** ${(ce+1)*8}${de}`:we=`>= -(2${de} ** ${(ce+1)*8-1}${de}) and < 2 ** ${(ce+1)*8-1}${de}`,new De.ERR_OUT_OF_RANGE("value",we,z)}ve(V,ie,ce)}function Oe(z,N){if(typeof z!="number")throw new De.ERR_INVALID_ARG_TYPE(N,"number",z)}function qe(z,N,M){throw Math.floor(z)!==z?(Oe(z,M),new De.ERR_OUT_OF_RANGE("offset","an integer",z)):N<0?new De.ERR_BUFFER_OUT_OF_BOUNDS:new De.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${N}`,z)}const Ne=/[^+/0-9A-Za-z-_]/g;function Be(z){if(z=z.split("=")[0],z=z.trim().replace(Ne,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function He(z,N){N=N||1/0;let M;const V=z.length;let ie=null;const ce=[];for(let de=0;de<V;++de){if(M=z.charCodeAt(de),M>55295&&M<57344){if(!ie){if(M>56319){(N-=3)>-1&&ce.push(239,191,189);continue}else if(de+1===V){(N-=3)>-1&&ce.push(239,191,189);continue}ie=M;continue}if(M<56320){(N-=3)>-1&&ce.push(239,191,189),ie=M;continue}M=(ie-55296<<10|M-56320)+65536}else ie&&(N-=3)>-1&&ce.push(239,191,189);if(ie=null,M<128){if((N-=1)<0)break;ce.push(M)}else if(M<2048){if((N-=2)<0)break;ce.push(M>>6|192,M&63|128)}else if(M<65536){if((N-=3)<0)break;ce.push(M>>12|224,M>>6&63|128,M&63|128)}else if(M<1114112){if((N-=4)<0)break;ce.push(M>>18|240,M>>12&63|128,M>>6&63|128,M&63|128)}else throw new Error("Invalid code point")}return ce}function Je(z){const N=[];for(let M=0;M<z.length;++M)N.push(z.charCodeAt(M)&255);return N}function Qe(z,N){let M,V,ie;const ce=[];for(let de=0;de<z.length&&!((N-=2)<0);++de)M=z.charCodeAt(de),V=M>>8,ie=M%256,ce.push(ie),ce.push(V);return ce}function We(z){return b.toByteArray(Be(z))}function Ge(z,N,M,V){let ie;for(ie=0;ie<V&&!(ie+M>=N.length||ie>=z.length);++ie)N[ie+M]=z[ie];return ie}function Fe(z,N){return z instanceof N||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===N.name}function Ke(z){return z!==z}const Ye=(function(){const z="0123456789abcdef",N=new Array(256);for(let M=0;M<16;++M){const V=M*16;for(let ie=0;ie<16;++ie)N[V+ie]=z[M]+z[ie]}return N})();function Ve(z){return typeof BigInt>"u"?Xe:z}function Xe(){throw new Error("BigInt not supported")}})(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var m=toolsEbml&&toolsEbml.__assign||function(){return m=Object.assign||function(r){for(var c,e=1,t=arguments.length;e<t;e++){c=arguments[e];for(var i in c)Object.prototype.hasOwnProperty.call(c,i)&&(r[i]=c[i])}return r},m.apply(this,arguments)},b=toolsEbml&&toolsEbml.__spreadArray||function(r,c,e){if(e||arguments.length===2)for(var t=0,i=c.length,_;t<i;t++)(_||!(t in c))&&(_||(_=Array.prototype.slice.call(c,0,t)),_[t]=c[t]);return r.concat(_||Array.prototype.slice.call(c))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var u=requireTools(),T=(function(){function r(){}return r.readVint=function(c,e){e===void 0&&(e=0);var t=8-Math.floor(Math.log2(c[e]));if(t>8){var i=r.readHexString(c,e,e+t);throw new Error("Unrepresentable length: ".concat(t," ").concat(i))}if(e+t>c.length)return null;for(var _=c[e]&(1<<8-t)-1,x=1;x<t;x+=1){if(x===7&&_>=Math.pow(2,8)&&c[e+7]>0)return{length:t,value:-1};_*=Math.pow(2,8),_+=c[e+x]}return{length:t,value:_}},r.writeVint=function(c){if(c<0||c>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(c));var e=1;for(e=1;e<=8&&!(c<Math.pow(2,7*e)-1);e+=1);for(var t=u.Buffer.alloc(e),i=c,_=1;_<=e;_+=1){var x=i&255;t[e-_]=x,i-=x,i/=Math.pow(2,8)}return t[0]|=1<<8-e,t},r.concatenate=function(c,e){return!c&&!e?u.Buffer.from([]):!c||c.byteLength===0?e:!e||e.byteLength===0?c:u.Buffer.from(b(b([],c,!0),e,!0))},r.readHexString=function(c,e,t){return e===void 0&&(e=0),t===void 0&&(t=c.byteLength),Array.from(c.slice(e,t)).map(function(i){return Number(i).toString(16)}).reduce(function(i,_){return"".concat(i).concat(_.padStart(2,"0"))},"")},r.readUtf8=function(c){try{return u.Buffer.from(c).toString("utf8")}catch{return null}},r.readUnsigned=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return e.getUint8(0);case 2:return e.getUint16(0);case 4:return e.getUint32(0)}return c.byteLength<=6?c.reduce(function(t,i){return t*256+i},0):r.readHexString(c,0,c.byteLength)},r.readSigned=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return e.getInt8(0);case 2:return e.getInt16(0);case 4:return e.getInt32(0);default:return NaN}},r.readFloat=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 4:return e.getFloat32(0);case 8:return e.getFloat64(0);default:return NaN}},r.readDate=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return new Date(e.getUint8(0));case 2:return new Date(e.getUint16(0));case 4:return new Date(e.getUint32(0));case 8:return new Date(Number.parseInt(r.readHexString(c),16));default:return new Date(0)}},r.readDataFromTag=function(c,e){var t=c.type,i=c.name,_=c.track,x=c.discardable||!1,C=c.keyframe||!1,F=null,j;switch(t){case"u":j=r.readUnsigned(e);break;case"f":j=r.readFloat(e);break;case"i":j=r.readSigned(e);break;case"s":j=String.fromCharCode.apply(String,e);break;case"8":j=r.readUtf8(e);break;case"d":j=r.readDate(e);break}if(i==="SimpleBlock"||i==="Block"){var Z=0,ee=r.readVint(e,Z),re=ee.length,K=ee.value;Z+=re,_=K,j=r.readSigned(e.subarray(Z,Z+2)),Z+=2,i==="SimpleBlock"&&(C=!!(e[re+2]&128),x=!!(e[re+2]&1)),Z+=1,F=e.subarray(Z)}return m(m({},c),{data:e,discardable:x,keyframe:C,payload:F,track:_,value:j})},r})();return toolsEbml.default=T,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(m,b,u){b=b||0;for(var T=1;T<=8&&!(m[b]>=Math.pow(2,8-T));T++);if(T>8)throw new Error("Unrepresentable length: "+T+" "+m.toString("hex",b,b+T));if(b+T>m.length)return null;var r,c=m[b]&(1<<8-T)-1;for(r=1;r<T;r++){if(r===7&&c>=Math.pow(2,45)&&m[b+7]>0)return{length:T,value:-1};c*=Math.pow(2,8),c+=m[b+r]}return u&&(c-=Math.pow(2,T*7-1)-1),{length:T,value:c}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var m=requireVint();function b(u){this.buffer=u,this.offset=0}return b.prototype.nextInt16BE=function(){var u=this.buffer.readInt16BE(this.offset);return this.offset+=2,u},b.prototype.nextUInt8=function(){var u=this.buffer.readUInt8(this.offset);return this.offset+=1,u},b.prototype.nextUIntV=function(){var u=m(this.buffer,this.offset);return this.offset+=u.length,u.value},b.prototype.nextIntV=function(){var u=m(this.buffer,this.offset,!0);return this.offset+=u.length,u.value},b.prototype.nextBuffer=function(u){var T=u?this.buffer.slice(this.offset,this.offset+u):this.buffer.slice(this.offset);return this.offset+=u||this.length,T},Object.defineProperty(b.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=b,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var m=requireBufferReader(),b=1,u=3,T=2;ebmlBlock=function(c){var e={},t=new m(c);e.trackNumber=t.nextUIntV(),e.timecode=t.nextInt16BE();var i=t.nextUInt8();e.invisible=!!(i&8),e.keyframe=!!(i&128),e.discardable=!!(i&1);var _=(i&6)>>1;return e.frames=r(t,_),e};function r(c,e){if(!e)return[c.nextBuffer()];var t,i,_=[],x=c.nextUInt8()+1;if(e===T){if(c.length%x!==0)throw new Error("Fixed-Size Lacing Error");for(i=c.length/x,t=0;t<x;t++)_.push(c.nextBuffer(i));return _}var C=[];if(e===b)for(t=0;t<x-1;t++){var F;i=0;do F=c.nextUInt8(),i+=F;while(F===255);C.push(i)}else if(e===u)for(i=c.nextUIntV(),C.push(i),t=1;t<x-1;t++)i+=c.nextIntV(),C.push(i);for(t=0;t<x-1;t++)_.push(c.nextBuffer(C[t]));return _.push(c.nextBuffer()),_}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,(function(m){Object.defineProperty(m,"__esModule",{value:!0}),m.convertEBMLDateToJSDate=m.createFloatBuffer=m.createIntBuffer=m.createUIntBuffer=m.encodeValueToBuffer=m.concat=m.putRefinedMetaData=m.extractElement=m.removeElement=m.makeMetadataSeekable=m.createRIFFChunk=m.VP8BitStreamToRiffWebPBuffer=m.WebPBlockFilter=m.encodeTag=m.readBlock=m.ebmlBlock=m.writeVint=m.readVint=m.Buffer=void 0;var b=requireInt64Buffer(),u=requireEBMLEncoder(),T=requireBuffer(),r=requireToolsEbml(),c=requireEbmlBlock();m.Buffer=T.Buffer,m.readVint=r.default.readVint,m.writeVint=r.default.writeVint,m.ebmlBlock=c;function e(te){return(0,m.ebmlBlock)(new m.Buffer(te))}m.readBlock=e;function t(te,ue,he){return he===void 0&&(he=!1),G([te,he?new m.Buffer("01ffffffffffffff","hex"):(0,m.writeVint)(ue.length),ue])}m.encodeTag=t;function i(te){return te.reduce(function(ue,he){if(he.type!=="b"||he.name!=="SimpleBlock")return ue;var me=(0,m.ebmlBlock)(he.data),be=me.frames.some(function(Se){var xe=Se.slice(3,6).toString("hex");return xe==="9d012a"});return be?ue.concat(he):ue},[])}m.WebPBlockFilter=i;function _(te){var ue=x("VP8 ",te),he=G([new m.Buffer("WEBP","ascii"),ue]);return x("RIFF",he)}m.VP8BitStreamToRiffWebPBuffer=_;function x(te,ue){var he=new m.Buffer(4);return he.writeUInt32LE(ue.byteLength,0),G([new m.Buffer(te.substr(0,4),"ascii"),he,ue,new m.Buffer(ue.byteLength%2===0?0:1)])}m.createRIFFChunk=x;function C(te,ue,he){var me=j("EBML",te),be=ee(me),Se=be+12,xe=te[te.length-1].dataEnd-Se,Ce=j("Info",te);F("Duration",Ce),Ce.splice(1,0,{name:"Duration",type:"f",data:le(ue,8)});for(var Ae=ee(Ce),Ue=j("Tracks",te),Ze=ee(Ue),Te=47,ge=[],je=5+he.length*15,Pe=[],Me=-1,ze=10,Le=function(_e){var Oe=Te,qe=Oe+Ae,Ne=qe+Ze,Be=Ne+je,He=Be-xe;if(ge=[],ge.push({name:"SeekHead",type:"m",isEnd:!1}),ge.push({name:"Seek",type:"m",isEnd:!1}),ge.push({name:"SeekID",type:"b",data:new m.Buffer([21,73,169,102])}),ge.push({name:"SeekPosition",type:"u",data:ae(Oe)}),ge.push({name:"Seek",type:"m",isEnd:!0}),ge.push({name:"Seek",type:"m",isEnd:!1}),ge.push({name:"SeekID",type:"b",data:new m.Buffer([22,84,174,107])}),ge.push({name:"SeekPosition",type:"u",data:ae(qe)}),ge.push({name:"Seek",type:"m",isEnd:!0}),ge.push({name:"Seek",type:"m",isEnd:!1}),ge.push({name:"SeekID",type:"b",data:new m.Buffer([28,83,187,107])}),ge.push({name:"SeekPosition",type:"u",data:ae(Ne)}),ge.push({name:"Seek",type:"m",isEnd:!0}),ge.push({name:"SeekHead",type:"m",isEnd:!0}),Te=ee(ge),Pe=[],Pe.push({name:"Cues",type:"m",isEnd:!1}),he.forEach(function(Je){var Qe=Je.CueTrack,We=Je.CueClusterPosition,Ge=Je.CueTime;Pe.push({name:"CuePoint",type:"m",isEnd:!1}),Pe.push({name:"CueTime",type:"u",data:ae(Ge)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Pe.push({name:"CueTrack",type:"u",data:ae(Qe)}),We-=Se,We+=He,Pe.push({name:"CueClusterPosition",type:"u",data:ae(We)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Pe.push({name:"CuePoint",type:"m",isEnd:!0})}),Pe.push({name:"Cues",type:"m",isEnd:!0}),je=ee(Pe),Me!==He){if(Me=He,_e===ze-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},De=0;De<ze;De++){var ke=Le(De);if(ke==="break")break}var ye=[].concat.apply([],[me,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},ge,Ce,Ue,Pe]),ve=new u.default().encode(ye);return ve}m.makeMetadataSeekable=C;function F(te,ue){for(var he=-1,me=0;me<ue.length;me++){var be=ue[me];if(be.name===te)if(be.type==="m")if(!be.isEnd)he=me;else{if(he==-1)throw new Error("Detected ".concat(te," closing element before finding the start"));ue.splice(he,me-he+1);return}else{ue.splice(me,1);return}}}m.removeElement=F;function j(te,ue){for(var he=[],me=-1,be=0;be<ue.length;be++){var Se=ue[be];if(Se.name===te)if(Se.type==="m")if(!Se.isEnd)me=be;else{if(me==-1)throw new Error("Detected ".concat(te," closing element before finding the start"));he=ue.slice(me,be+1);break}else{he.push(ue[be]);break}}return he}m.extractElement=j;function Z(te,ue){Array.isArray(ue.cueInfos)&&!Array.isArray(ue.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),ue.cues=ue.cueInfos);for(var he=[],me=[],be=0;be<te.length;be++){var Se=te[be];if(Se.type==="m"&&Se.name==="Segment"){if(he=te.slice(0,be),me=te.slice(be),Se.unknownSize){me.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(me[me.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var xe=me[me.length-1].dataEnd,Ce=he[he.length-1].dataEnd,Ae=new u.default().encode(he).byteLength,Ue=Ae-Ce,Ze=xe-me[0].tagStart;me[0].tagStart-Ce,me[0].tagStart;var Te=new m.Buffer([24,83,128,103]),ge=new m.Buffer("01ffffffffffffff","hex"),je=Te.byteLength+ge.byteLength,Pe=Ze,Me;for(Me=1;Me<20;Me++){var ze=Ce+je+Pe,Le=ze-xe,De=Ue+Le,ke=re(me,De,ue),ye=new u.default().encode(ke).byteLength;if(ye===Pe)return new u.default().encode([].concat(he,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],ke));Pe=ye}throw new Error("unable to refine metadata, stable size could not be found in "+Me+" iterations!")}m.putRefinedMetaData=Z;function ee(te){var ue=new u.default;return te.reduce(function(he,me){return he.concat(ue.encode([me]))},[]).reduce(function(he,me){return he+me.byteLength},0)}function re(te,ue,he){var me=he.duration,be=he.clusterPtrs,Se=he.cues,xe=te.slice(0);if(typeof me=="number"){var Ce=!1;xe.forEach(function(Ue){Ue.type==="f"&&Ue.name==="Duration"&&(Ce=!0,Ue.data=le(me,8))}),Ce||fe(xe,"Info",[{name:"Duration",type:"f",data:le(me,8)}])}Array.isArray(Se)&&fe(xe,"Cues",se(Se,ue));var Ae=[];return Array.isArray(be)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Ae=K(be,ue)),fe(xe,"SeekHead",Ae,!0),xe}function K(te,ue){var he=[];return te.forEach(function(me){he.push({name:"Seek",type:"m",isEnd:!1}),he.push({name:"SeekID",type:"b",data:new m.Buffer([31,67,182,117])}),he.push({name:"SeekPosition",type:"u",data:ae(me+ue)}),he.push({name:"Seek",type:"m",isEnd:!0})}),he}function se(te,ue){var he=[];return te.forEach(function(me){var be=me.CueTrack,Se=me.CueClusterPosition,xe=me.CueTime;he.push({name:"CuePoint",type:"m",isEnd:!1}),he.push({name:"CueTime",type:"u",data:ae(xe)}),he.push({name:"CueTrackPositions",type:"m",isEnd:!1}),he.push({name:"CueTrack",type:"u",data:ae(be)}),he.push({name:"CueClusterPosition",type:"u",data:ae(Se+ue)}),he.push({name:"CueTrackPositions",type:"m",isEnd:!0}),he.push({name:"CuePoint",type:"m",isEnd:!0})}),he}function fe(te,ue,he,me){me===void 0&&(me=!1);for(var be=-1,Se=0;Se<te.length;Se++){var xe=te[Se];if(xe.type==="m"&&xe.name===ue&&xe.isEnd===!1){be=Se;break}}be>=0?Array.prototype.splice.apply(te,[be+1,0].concat(he)):me?[].concat([{name:ue,type:"m",isEnd:!1}],he,[{name:ue,type:"m",isEnd:!0}]).reverse().forEach(function(Ce){te.unshift(Ce)}):(te.push({name:ue,type:"m",isEnd:!1}),he.forEach(function(Ce){te.push(Ce)}),te.push({name:ue,type:"m",isEnd:!0}))}function G(te){return m.Buffer.concat(te)}m.concat=G;function ne(te){var ue=new m.Buffer(0);if(te.type==="m")return te;switch(te.type){case"u":ue=ae(te.value);break;case"i":ue=oe(te.value);break;case"f":ue=le(te.value);break;case"s":ue=new m.Buffer(te.value,"ascii");break;case"8":ue=new m.Buffer(te.value,"utf8");break;case"b":ue=te.value;break;case"d":ue=new b.Int64BE(te.value.getTime().toString()).toBuffer();break}return Object.assign({},te,{data:ue})}m.encodeValueToBuffer=ne;function ae(te){for(var ue=1;te>=Math.pow(2,8*ue);ue++);if(ue>=7)return console.warn("7bit or more bigger uint not supported."),new b.Uint64BE(te).toBuffer();var he=new m.Buffer(ue);return he.writeUIntBE(te,0,ue),he}m.createUIntBuffer=ae;function oe(te){for(var ue=1;te>=Math.pow(2,8*ue);ue++);if(ue>=7)return console.warn("7bit or more bigger uint not supported."),new b.Int64BE(te).toBuffer();var he=new m.Buffer(ue);return he.writeIntBE(te,0,ue),he}m.createIntBuffer=oe;function le(te,ue){if(ue===void 0&&(ue=8),ue===8){var he=new m.Buffer(8);return he.writeDoubleBE(te,0),he}else if(ue===4){var he=new m.Buffer(4);return he.writeFloatBE(te,0),he}else throw new Error("float type bits must 4bytes or 8bytes")}m.createFloatBuffer=le;function pe(te){return te instanceof Date?te:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(te)/1e3/1e3)}m.convertEBMLDateToJSDate=pe})(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var m=requireInt64Buffer(),b=requireTools(),u=requireTools(),T=requireEbmlID(),r;(function(e){e[e.STATE_TAG=1]="STATE_TAG",e[e.STATE_SIZE=2]="STATE_SIZE",e[e.STATE_CONTENT=3]="STATE_CONTENT"})(r||(r={}));var c=(function(){function e(){this._buffer=new b.Buffer(0),this._tag_stack=[],this._state=r.STATE_TAG,this._cursor=0,this._total=0,this._schema=T.byEbmlID,this._result=[]}return e.prototype.decode=function(t){this.readChunk(t);var i=this._result;return this._result=[],i},e.prototype.readChunk=function(t){for(this._buffer=u.concat([this._buffer,new b.Buffer(t)]);this._cursor<this._buffer.length&&!(this._state===r.STATE_TAG&&!this.readTag()||this._state===r.STATE_SIZE&&!this.readSize()||this._state===r.STATE_CONTENT&&!this.readContent()););},e.prototype.getSchemaInfo=function(t){return this._schema[t]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},e.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var t=(0,b.readVint)(this._buffer,this._cursor);if(t==null)return!1;var i=this._buffer.slice(this._cursor,this._cursor+t.length),_=i.reduce(function(F,j,Z,ee){return F+j*Math.pow(16,2*(ee.length-1-Z))},0),x=this.getSchemaInfo(_),C={EBML_ID:_.toString(16),schema:x,type:x.type,name:x.name,level:x.level,tagStart:this._total,tagEnd:this._total+t.length,sizeStart:this._total+t.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(C),this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_SIZE,!0},e.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var t=(0,b.readVint)(this._buffer,this._cursor);if(t==null)return!1;var i=this._tag_stack[this._tag_stack.length-1];return i.sizeEnd=i.sizeStart+t.length,i.dataStart=i.sizeEnd,i.dataSize=t.value,t.value===-1?(i.dataEnd=-1,i.type==="m"&&(i.unknownSize=!0)):i.dataEnd=i.sizeEnd+t.value,this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_CONTENT,!0},e.prototype.readContent=function(){var t=this._tag_stack[this._tag_stack.length-1];if(t.type==="m"){if(t.isEnd=!1,this._result.push(t),this._state=r.STATE_TAG,t.dataSize===0){var i=Object.assign({},t,{isEnd:!0});this._result.push(i),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+t.dataSize)return!1;var _=this._buffer.slice(this._cursor,this._cursor+t.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+t.dataSize),t.data=_,t.type){case"u":t.value=_.readUIntBE(0,_.length);break;case"i":t.value=_.readIntBE(0,_.length);break;case"f":t.value=t.dataSize===4?_.readFloatBE(0):t.dataSize===8?_.readDoubleBE(0):(console.warn("cannot read ".concat(t.dataSize," octets float. failback to 0")),0);break;case"s":t.value=_.toString("ascii");break;case"8":t.value=_.toString("utf8");break;case"b":t.value=_;break;case"d":t.value=(0,b.convertEBMLDateToJSDate)(new m.Int64BE(_).toNumber());break}if(t.value===null)throw new Error("unknown tag type:"+t.type);for(this._result.push(t),this._total+=t.dataSize,this._state=r.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var x=this._tag_stack[this._tag_stack.length-1];if(x.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<x.dataEnd)break;if(x.type!=="m")throw new Error("parent element is not master element");var i=Object.assign({},x,{isEnd:!0});this._result.push(i),this._tag_stack.pop()}return!0},e})();return EBMLDecoder.default=c,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var m=typeof Reflect=="object"?Reflect:null,b=m&&typeof m.apply=="function"?m.apply:function(ne,ae,oe){return Function.prototype.apply.call(ne,ae,oe)},u;m&&typeof m.ownKeys=="function"?u=m.ownKeys:Object.getOwnPropertySymbols?u=function(ne){return Object.getOwnPropertyNames(ne).concat(Object.getOwnPropertySymbols(ne))}:u=function(ne){return Object.getOwnPropertyNames(ne)};function T(G){console&&console.warn&&console.warn(G)}var r=Number.isNaN||function(ne){return ne!==ne};function c(){c.init.call(this)}events.exports=c,events.exports.once=K,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var e=10;function t(G){if(typeof G!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return e},set:function(G){if(typeof G!="number"||G<0||r(G))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+G+".");e=G}}),c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(ne){if(typeof ne!="number"||ne<0||r(ne))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ne+".");return this._maxListeners=ne,this};function i(G){return G._maxListeners===void 0?c.defaultMaxListeners:G._maxListeners}c.prototype.getMaxListeners=function(){return i(this)},c.prototype.emit=function(ne){for(var ae=[],oe=1;oe<arguments.length;oe++)ae.push(arguments[oe]);var le=ne==="error",pe=this._events;if(pe!==void 0)le=le&&pe.error===void 0;else if(!le)return!1;if(le){var te;if(ae.length>0&&(te=ae[0]),te instanceof Error)throw te;var ue=new Error("Unhandled error."+(te?" ("+te.message+")":""));throw ue.context=te,ue}var he=pe[ne];if(he===void 0)return!1;if(typeof he=="function")b(he,this,ae);else for(var me=he.length,be=Z(he,me),oe=0;oe<me;++oe)b(be[oe],this,ae);return!0};function _(G,ne,ae,oe){var le,pe,te;if(t(ae),pe=G._events,pe===void 0?(pe=G._events=Object.create(null),G._eventsCount=0):(pe.newListener!==void 0&&(G.emit("newListener",ne,ae.listener?ae.listener:ae),pe=G._events),te=pe[ne]),te===void 0)te=pe[ne]=ae,++G._eventsCount;else if(typeof te=="function"?te=pe[ne]=oe?[ae,te]:[te,ae]:oe?te.unshift(ae):te.push(ae),le=i(G),le>0&&te.length>le&&!te.warned){te.warned=!0;var ue=new Error("Possible EventEmitter memory leak detected. "+te.length+" "+String(ne)+" listeners added. Use emitter.setMaxListeners() to increase limit");ue.name="MaxListenersExceededWarning",ue.emitter=G,ue.type=ne,ue.count=te.length,T(ue)}return G}c.prototype.addListener=function(ne,ae){return _(this,ne,ae,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(ne,ae){return _(this,ne,ae,!0)};function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(G,ne,ae){var oe={fired:!1,wrapFn:void 0,target:G,type:ne,listener:ae},le=x.bind(oe);return le.listener=ae,oe.wrapFn=le,le}c.prototype.once=function(ne,ae){return t(ae),this.on(ne,C(this,ne,ae)),this},c.prototype.prependOnceListener=function(ne,ae){return t(ae),this.prependListener(ne,C(this,ne,ae)),this},c.prototype.removeListener=function(ne,ae){var oe,le,pe,te,ue;if(t(ae),le=this._events,le===void 0)return this;if(oe=le[ne],oe===void 0)return this;if(oe===ae||oe.listener===ae)--this._eventsCount===0?this._events=Object.create(null):(delete le[ne],le.removeListener&&this.emit("removeListener",ne,oe.listener||ae));else if(typeof oe!="function"){for(pe=-1,te=oe.length-1;te>=0;te--)if(oe[te]===ae||oe[te].listener===ae){ue=oe[te].listener,pe=te;break}if(pe<0)return this;pe===0?oe.shift():ee(oe,pe),oe.length===1&&(le[ne]=oe[0]),le.removeListener!==void 0&&this.emit("removeListener",ne,ue||ae)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(ne){var ae,oe,le;if(oe=this._events,oe===void 0)return this;if(oe.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):oe[ne]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete oe[ne]),this;if(arguments.length===0){var pe=Object.keys(oe),te;for(le=0;le<pe.length;++le)te=pe[le],te!=="removeListener"&&this.removeAllListeners(te);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(ae=oe[ne],typeof ae=="function")this.removeListener(ne,ae);else if(ae!==void 0)for(le=ae.length-1;le>=0;le--)this.removeListener(ne,ae[le]);return this};function F(G,ne,ae){var oe=G._events;if(oe===void 0)return[];var le=oe[ne];return le===void 0?[]:typeof le=="function"?ae?[le.listener||le]:[le]:ae?re(le):Z(le,le.length)}c.prototype.listeners=function(ne){return F(this,ne,!0)},c.prototype.rawListeners=function(ne){return F(this,ne,!1)},c.listenerCount=function(G,ne){return typeof G.listenerCount=="function"?G.listenerCount(ne):j.call(G,ne)},c.prototype.listenerCount=j;function j(G){var ne=this._events;if(ne!==void 0){var ae=ne[G];if(typeof ae=="function")return 1;if(ae!==void 0)return ae.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?u(this._events):[]};function Z(G,ne){for(var ae=new Array(ne),oe=0;oe<ne;++oe)ae[oe]=G[oe];return ae}function ee(G,ne){for(;ne+1<G.length;ne++)G[ne]=G[ne+1];G.pop()}function re(G){for(var ne=new Array(G.length),ae=0;ae<ne.length;++ae)ne[ae]=G[ae].listener||G[ae];return ne}function K(G,ne){return new Promise(function(ae,oe){function le(te){G.removeListener(ne,pe),oe(te)}function pe(){typeof G.removeListener=="function"&&G.removeListener("error",le),ae([].slice.call(arguments))}fe(G,ne,pe,{once:!0}),ne!=="error"&&se(G,le,{once:!0})})}function se(G,ne,ae){typeof G.on=="function"&&fe(G,"error",ne,ae)}function fe(G,ne,ae,oe){if(typeof G.on=="function")oe.once?G.once(ne,ae):G.on(ne,ae);else if(typeof G.addEventListener=="function")G.addEventListener(ne,function le(pe){oe.once&&G.removeEventListener(ne,le),ae(pe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof G)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var m=EBMLReader&&EBMLReader.__extends||(function(){var r=function(c,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var _ in i)Object.prototype.hasOwnProperty.call(i,_)&&(t[_]=i[_])},r(c,e)};return function(c,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(c,e);function t(){this.constructor=c}c.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}})();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var b=requireEvents(),u=requireTools(),T=(function(r){m(c,r);function c(){var e=r.call(this)||this;return e.logGroup="",e.hasLoggingStarted=!1,e.metadataloaded=!1,e.chunks=[],e.stack=[],e.segmentOffset=0,e.last2SimpleBlockVideoTrackTimecode=[0,0],e.last2SimpleBlockAudioTrackTimecode=[0,0],e.lastClusterTimecode=0,e.lastClusterPosition=0,e.timecodeScale=1e6,e.metadataSize=0,e.metadatas=[],e.cues=[],e.firstVideoBlockRead=!1,e.firstAudioBlockRead=!1,e.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},e.trackTypes=[],e.trackDefaultDuration=[],e.trackCodecDelay=[],e.trackInfo={type:"nothing"},e.ended=!1,e.logging=!1,e.use_duration_every_simpleblock=!1,e.use_webp=!1,e.use_segment_info=!0,e.drop_default_duration=!0,e}return c.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},c.prototype.emit_segment_info=function(){var e=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var _=this.lastClusterTimecode,x=this.duration,C=this.timecodeScale;this.emit("cluster",{timecode:_,data:e}),this.emit("duration",{timecodeScale:C,duration:x})}else{this.metadataloaded=!0,this.metadatas=e;var t=this.trackTypes.indexOf(1),i=this.trackTypes.indexOf(2);if(this.trackInfo=t>=0&&i>=0?{type:"both",trackNumber:t}:t>=0?{type:"video",trackNumber:t}:i>=0?{type:"audio",trackNumber:i}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:e,metadataSize:this.metadataSize})}},c.prototype.read=function(e){var t=this,i=!1;if(!this.ended){if(e.type==="m")if(e.isEnd)this.stack.pop();else{var _=this.stack[this.stack.length-1];if(_!=null&&_.level>=e.level){this.stack.pop(),this.logging&&console.groupEnd(),_.dataEnd=e.dataEnd,_.dataSize=e.dataEnd-_.dataStart,_.unknownSize=!1;var x=Object.assign({},_,{name:_.name,type:_.type,isEnd:!0});this.chunks.push(x)}this.stack.push(e)}if(e.type==="m"&&e.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=e.dataStart,this.emit("segment_offset",this.segmentOffset);else if(e.type==="b"&&e.name==="SimpleBlock"){var C=u.ebmlBlock(e.data),F=C.timecode,j=C.trackNumber,Z=C.frames;if(this.trackTypes[j]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ee=this.lastClusterTimecode+F;this.cues.push({CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee}),this.emit("cue_info",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],F]}else if(this.trackTypes[j]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ee=this.lastClusterTimecode+F;this.cues.push({CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee}),this.emit("cue_info",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],F]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&Z.forEach(function(re){var K=re.slice(3,6).toString("hex");if(K==="9d012a"){var se=u.VP8BitStreamToRiffWebPBuffer(re),fe=new Blob([se],{type:"image/webp"}),G=t.duration;t.emit("webp",{currentTime:G,webp:fe})}})}else e.type==="m"&&e.name==="Cluster"&&e.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",e.tagStart),this.lastClusterPosition=e.tagStart):e.type==="u"&&e.name==="Timecode"?this.lastClusterTimecode=e.value:e.type==="u"&&e.name==="TimecodeScale"?this.timecodeScale=e.value:e.type==="m"&&e.name==="TrackEntry"?e.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:e.type==="u"&&e.name==="TrackType"?this.currentTrack.TrackType=e.value:e.type==="u"&&e.name==="TrackNumber"?this.currentTrack.TrackNumber=e.value:e.type==="u"&&e.name==="CodecDelay"?this.currentTrack.CodecDelay=e.value:e.type==="u"&&e.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),i=!0):this.currentTrack.DefaultDuration=e.value:e.name==="unknown"&&console.warn(e);!this.metadataloaded&&e.dataEnd>0&&(this.metadataSize=e.dataEnd),i||this.chunks.push(e),this.logging&&this.put(e)}},Object.defineProperty(c.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var e=0,t=0,i=0,_=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof _=="number")e=_;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof x=="number"&&(t=x),i=this.last2SimpleBlockAudioTrackTimecode[1]}else{e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof x=="number"&&(t=x),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackInfo.trackNumber];typeof x=="number"&&(t=x),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackInfo.trackNumber];typeof x=="number"&&(t=x),i=this.last2SimpleBlockAudioTrackTimecode[1]}var C=(this.lastClusterTimecode+i)*this.timecodeScale+e-t,F=C/this.timecodeScale;return Math.floor(F)},enumerable:!1,configurable:!0}),c.prototype.addListener=function(e,t){return r.prototype.addListener.call(this,e,t)},c.prototype.put=function(e){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),e.type==="m"?e.isEnd?console.groupEnd():console.group(e.name+":"+e.tagStart):e.type==="b"?console.log(e.name,e.type):console.log(e.name,e.tagStart,e.type,e.value)},c})(b.EventEmitter);return EBMLReader.default=T,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,(function(m){var b=ebml&&ebml.__createBinding||(Object.create?(function(t,i,_,x){x===void 0&&(x=_),Object.defineProperty(t,x,{enumerable:!0,get:function(){return i[_]}})}):(function(t,i,_,x){x===void 0&&(x=_),t[x]=i[_]})),u=ebml&&ebml.__exportStar||function(t,i){for(var _ in t)_!=="default"&&!Object.prototype.hasOwnProperty.call(i,_)&&b(i,t,_)};Object.defineProperty(m,"__esModule",{value:!0}),m.tools=m.Reader=m.Encoder=m.Decoder=void 0,u(requireEBML(),m);var T=requireEBMLDecoder();m.Decoder=T.default;var r=requireEBMLEncoder();m.Encoder=r.default;var c=requireEBMLReader();m.Reader=c.default;var e=requireTools();m.tools=e})(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var m=lib&&lib.__awaiter||function(r,c,e,t){function i(_){return _ instanceof e?_:new e(function(x){x(_)})}return new(e||(e=Promise))(function(_,x){function C(Z){try{j(t.next(Z))}catch(ee){x(ee)}}function F(Z){try{j(t.throw(Z))}catch(ee){x(ee)}}function j(Z){Z.done?_(Z.value):i(Z.value).then(C,F)}j((t=t.apply(r,c||[])).next())})},b=lib&&lib.__generator||function(r,c){var e={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},t,i,_,x;return x={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function C(j){return function(Z){return F([j,Z])}}function F(j){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,i&&(_=j[0]&2?i.return:j[0]?i.throw||((_=i.return)&&_.call(i),0):i.next)&&!(_=_.call(i,j[1])).done)return _;switch(i=0,_&&(j=[j[0]&2,_.value]),j[0]){case 0:case 1:_=j;break;case 4:return e.label++,{value:j[1],done:!1};case 5:e.label++,i=j[1],j=[0];continue;case 7:j=e.ops.pop(),e.trys.pop();continue;default:if(_=e.trys,!(_=_.length>0&&_[_.length-1])&&(j[0]===6||j[0]===2)){e=0;continue}if(j[0]===3&&(!_||j[1]>_[0]&&j[1]<_[3])){e.label=j[1];break}if(j[0]===6&&e.label<_[1]){e.label=_[1],_=j;break}if(_&&e.label<_[2]){e.label=_[2],e.ops.push(j);break}_[2]&&e.ops.pop(),e.trys.pop();continue}j=c.call(r,e)}catch(Z){j=[6,Z],i=0}finally{t=_=0}if(j[0]&5)throw j[1];return{value:j[0]?j[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var u=requireEbml();function T(r){return m(this,void 0,void 0,function(){var c,e,t,i,_,x,C,F,j,Z,ee,re;return b(this,function(K){switch(K.label){case 0:if(!r)throw Error("call to fixWebmDuration requires a blob");c=new u.Decoder,e=new u.Reader,t=r.stream(),i=t.getReader(),K.label=1;case 1:return[4,i.read()];case 2:return _=K.sent(),x=_.done,C=_.value,x?(e.stop(),[3,3]):(F=c.decode(C),F=F?.filter(function(se){return se.type!=="unknown"}),F.forEach(function(se){e.read(se)}),C=null,[3,1]);case 3:return j=u.tools.makeMetadataSeekable(e.metadatas,e.duration,e.cues),Z=new Blob([j],{type:r.type}),ee=r.slice(e.metadataSize),re=new Blob([Z,ee],{type:r.type}),[2,re]}})})}return lib.default=T,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{#e;#r=!1;#n=!1;#c=0;#a=0;#t=0;#i=0;#o=0;onchange=b=>{};onDurationChange=b=>{};constructor(){}start=async(b="")=>{b||(b=`video_Record_${p$1(Date.now())}`);let u=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(T=>{const r=T.getTracks();for(const e of r)e.onended=()=>this.stop();this.#r=!0,this.#n=!1,this.#e=new MediaRecorder(T),this.#e.start();const c=new Date().getTime();this.#c=c,this.#t=c,this.#s(),this.#l(),this.#e.addEventListener("dataavailable",e=>{u.push(e.data)}),this.#e.addEventListener("stop",async()=>{this.#r=!1;const e=new Date().getTime();this.#a=e,this.#i+=e-this.#t,this.#s(),clearInterval(this.#o);const t=T.getTracks();for(const F of t)F.stop();if(this.#e===null)return;const i=new Blob(u,{type:this.#e.mimeType}),_=await fixWebmDuration(i),x=URL.createObjectURL(_),C=document.createElement("a");C.href=x,C.download=`${b}.mp4`,C.click(),URL.revokeObjectURL(x),u=[],this.#e=null})})};pause=async()=>{await new Promise(u=>setTimeout(()=>u(!0),300)),this.#e?.pause(),this.#n=!0;const b=new Date().getTime();this.#i+=b-this.#t,this.#s(),clearInterval(this.#o)};resume=async()=>{this.#e?.resume(),this.#n=!1;const b=new Date().getTime();this.#t=b,this.#s(),this.#l()};stop=async()=>{this.#e?.stop()};getDuration=()=>{if(this.#t===0)return 0;let b=this.#i;const u=new Date().getTime();if(this.#r&&this.#n===!1){const T=u-this.#t;this.#t=u,b=b+T}return b};getInfo=()=>({active:this.#r,pause:this.#n,startTime:this.#c,endTime:this.#a,duration:this.#i});#s=()=>{const b=this.getInfo();this.onchange(b)};#l=()=>{clearInterval(this.#o),this.#o=window.setInterval(()=>{this.#i=this.getDuration(),this.onDurationChange(this.#i)},500)}}var l=Object.defineProperty,y=m=>{throw TypeError(m)},q=(m,b,u)=>b in m?l(m,b,{enumerable:!0,configurable:!0,writable:!0,value:u}):m[b]=u,s=(m,b,u)=>q(m,typeof b!="symbol"?b+"":b,u),P=(m,b,u)=>b.has(m)||y("Cannot "+u),n=(m,b,u)=>(P(m,b,"read from private field"),u?u.call(m):b.get(m)),a=(m,b,u)=>b.has(m)?y("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(m):b.set(m,u),d,v,o;class p{constructor(b={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(u,T={})=>new Promise(async(r,c)=>{const e=T.timeout||this.options.timeout,t=T.key||n(this,d).call(this),i=T.describe||"";if(this.queue.findIndex(x=>x.key===t)!==-1)return c(`${t} is exist.`);const _={key:t,func:u,describe:i,timeout:e,resolve:r,reject:c};this.queue.unshift(_),this.activePromise||n(this,o).call(this)})),s(this,"clear",()=>{this.queue=[],this.activePromise=void 0,clearTimeout(this.timer)}),s(this,"retry",()=>{n(this,o).call(this)}),a(this,d,()=>(this.activeIndex=this.activeIndex+1,`${this.activeIndex}`)),a(this,v,u=>{const T=this.queue.findIndex(r=>r.key===u);this.queue.splice(T,1)}),a(this,o,async()=>{const u=this.queue.length;if(u===0)return;const T=u-1,r=this.queue[T];this.activePromise=r;const{key:c,func:e,resolve:t,reject:i,timeout:_}=this.activePromise;_&&(this.timer=window.setTimeout(()=>{i(`pr-async-queue: ${c} is timeout.`),n(this,o).call(this)},_)),await e().then(t).catch(i).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,c),n(this,o).call(this)})}),this.options={timeout:0,...b}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;class Base{config=new Config$1;notifys=new Notifys;localMedias=new LocalMedias;intervalQueue=new W;asyncQueue=new p;traffic=new Traffic;recorder=new StreamRecorder;users=new Users({config:this.config,localMedias:this.localMedias,notifys:this.notifys});cws=new CallsWebSocket({config:this.config});peer=new Peer({config:this.config,users:this.users});_requestAnimationFrameMap=new Map;constructor(){this.intervalQueue.startQueue(),this.localMedias.on.devicechange=()=>this.notifys.emit("onDevicechange",{code:200,data:{},desc:"MediaDevice is change."})}use=({rnnoise:b})=>{b!==void 0&&this.users.localUser.streamControls.mc_audio?.use({rnnoise:b})};setRoomState=b=>{this.config.roomState!==b&&(this.config.roomState=b,b==="closed"&&(this.config.isInRoom=!1),this.notifys.emit("onRoomState",{code:200,desc:"RoomState is change.",data:{state:b}}))};setPeerState=b=>{this.config.peerState=b,this.notifys.emit("onPeerState",{code:200,desc:"PeerState is change.",data:{state:b}})};setCallStrategy=async(b,u=[])=>{u.length===0&&(u=mediaType_keys);let T="balanced";switch(b){case"qualityPriority":T="maintain-resolution";break;case"fluencyPriority":T="maintain-framerate";break;case"balancedDowngrade":T="balanced";break}await this.peer.setRTCRtpSenderParameters({degradationPreference:T},u);const r=this.users.remoteUsers.values();for(const c of r)c.p2p?.setRTCRtpSenderParameters({degradationPreference:T},u)};addRequestAnimationFrame=async(b,u)=>{{const r=this._requestAnimationFrameMap.get(b);r&&cancelAnimationFrame(r)}const T=(r=Date.now())=>{u(r);const c=requestAnimationFrame(T);this._requestAnimationFrameMap.set(b,c)};T()};clearRequestAnimationFrame=async(b=[])=>{b.length===0&&(b=[...this._requestAnimationFrameMap.keys()]);const u=[];for(const T of b){const r=this._requestAnimationFrameMap.get(T);r&&(cancelAnimationFrame(r),u.push(r))}return u};_checkUserStreamOrigin=({p2pAverageQuality:b,sfuAverageQuality:u})=>b-(u+this.config.sfuPriority)>=0?"p2p":"sfu";_reportP2PConnect=(b,u)=>{let T;switch(b){case"success":T=0;break;case"fail":T=1;break;case"ignore":T=2;break;case"disconnect":T=3;break;case"poor_network":T=4;break}const{mediaTypes:r,...c}=u,e=[];for(const i of r){const _=mediaType_keys.findIndex(x=>x===i);e.push(_)}return this.cws.createRequest("reportP2PConnectEx").send({data:{...c,code:T,types:e}})};_reportLog=(b,u="未知错误")=>{const{appid:T,userId:r,earlyId:c="",logUrl:e,reportErr:t}=this.config;if(!t||!this.config.logUrl)return;const i="web",_=x=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[x].toString();{const x=_(b),C={origin:i,type:x,app_id:T,user_id:r,ins_id:c,desc:u},F=btoa(encodeURI(JSON.stringify(C))),j=`${e}/upload/log?log_key=${F}`;{const Z=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),re=new TextEncoder().encode(Z),K=pako.deflate(re,{gzip:!0});this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLog",{obj:C,url:j,size:at(K.byteLength)}),fetch(j,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:K})}}}}class ActionBase{base;constructor({base:b}){this.base=b}_debugger=async()=>{await this.base.cws.createRequest("debugger",{onBack:!1}).send({data:{}})};_ai=async()=>{await this.base.cws.createRequest("ai",{onBack:!1}).send({data:{}})};_testQuitRoom=()=>{const{roomId:b,userId:u,callType:T,sdkToken:r}=this.base.config;this.base.cws.createRequest("quitRoomEx").send({data:{roomId:b,userId:u}}),this.base.cws.createRequest("joinRoomEx").send({data:{callType:T,roomId:b,user:{id:u,tracks:[],callAction:0},token:r},version:2})}}const g=(m,b)=>{if(!(m!=null&&m.ip)||!(m!=null&&m.port)||!(m!=null&&m.serve_ip)||!(m!=null&&m.serve_port)||!(b!=null&&b.ip)||!(b!=null&&b.port)||!(b!=null&&b.serve_ip)||!(b!=null&&b.serve_port))return"Unknown";const[u,T]=[m.ip,m.port],[r,c]=[m.serve_ip,m.serve_port],[e,t]=[b.ip,b.port],[i,_]=[b.serve_ip,b.serve_port];return u===e&&T===t?"Full Cone":u===r&&(e!==r||t!==T)||e===i&&(u!==i||T!==t)?"Restricted Cone":u===r&&T===c&&(e!==r||t!==c)||e===i&&t===_&&(u!==i||T!==_)?"Port Restricted Cone":"Symmetric"},h=async()=>{const m="stun.cloudflare.com:3478",b="stun.l.google.com:19302",u=async T=>new Promise(r=>{const c=new RTCPeerConnection({iceServers:[{urls:`stun:${T}`}]});c.createDataChannel("ice-channel");let e=null;c.onicecandidate=t=>{var i,_;if(((i=t.candidate)==null?void 0:i.type)==="srflx"){const[x,C]=T.split(":").map(F=>F.trim());e={ip:t.candidate.address||"",port:(_=t.candidate.port)==null?void 0:_.toString(),serve_ip:x,serve_port:C},c.close(),r(e)}},setTimeout(()=>{c.close(),r(null)},5e3),c.createOffer().then(t=>c.setLocalDescription(t)).catch(()=>r(null))});try{const T=await u(m),r=await u(b);if(!T||!r)return{address:"",natType:"Unknown"};const c=g(T,r);return{address:T.ip||"",natType:c}}catch(T){return console.error("获取NAT类型失败:",T),{address:"",natType:"Unknown"}}};class ActionSFU{base;_onOnline;_reconnectTimerId;constructor({base:b}){this.base=b,this.base.cws.on.close=u=>{switch(u.code){case 1e3:case 4001:case 4002:case 4003:this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]),this.base.setRoomState("closed");break;case 4010:this._connectCws();break;default:{if(this.base.config.isInRoom===!1)return;this.base.cws.prws.reconnectCount<8?(this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: Reconnect in 5 seconds.",{reconnectCount:this.base.cws.prws.reconnectCount,code:u.code}),this._reconnectTimerId&&clearTimeout(this._reconnectTimerId),this._reconnectTimerId=window.setTimeout(()=>{this._reconnectCws()},1e3*5)):(this.base.setRoomState("closed"),this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]))}break}},this.base.cws.on.open=()=>{this.base.setRoomState("connected"),this.base.config.isInRoom===!0&&this._syncRoomInfo().catch(()=>{this.base.peer.pc.connectionState==="connected"&&this.base.peer.close(),this.base.cws.close(),this.base.setRoomState("closed")})},this.base.peer.on.state=u=>{u==="failed"||u==="closed"?this._restorePeer():this.base.setPeerState(u)},this.base.cws.on.onJoinRoom=u=>{const{roomId:T}=u.data;if(T!==this.base.config.roomId){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: The received message does not belong to the current room.",u);return}this.base.users.initUsers([u.data.user]),this.base.users.emitUsersChange(),this.base.notifys.emit("onJoinRoom",u)},this.base.cws.on.onQuitRoom=u=>{const{id:T}=u.data.user,r=this.base.users.getRemoteUserContent(T);if(!r)return;const c=r.removeTracks(mediaType_keys),e=[],t=[];for(const i of c){const{mid:_,msid:x}=i;x&&_&&(e.push(_),t.push(i))}t.length!==0&&(this.base.peer.stopReceivers(e),this._closeTrack(t)),this.base.users.removeRemoteUser(u.data.user.id),this.base.users.emitUsersChange(),this.base.notifys.emit("onQuitRoom",u)},this.base.cws.on.onPublish=u=>{const{roomId:T}=u.data;if(T!==this.base.config.roomId){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: The received message does not belong to the current room.",u);return}const{id:r,callAction:c,tracks:e}=u.data.user,t=this.base.users.getRemoteUserContent(r);if(!t)return;const i=[];for(const _ of e){const{type:x}=_,C=mediaType_keys[x],F=t.getTrack(C);F&&F.msid&&i.push(F)}if(i.length!==0&&this._closeTrack(i),t.updateTracks(e),t.updateCallAction(c),this.base.users.emitUsersChange(),this.base.config.newPublishAutoSubscribe){const _=Array.from(e,({type:x})=>mediaType_keys[x]);this.subscribe([{userId:r,mediaTypes:_}])}else this.base.notifys.emit("onPublish",u)},this.base.cws.on.onCloseTrack=u=>{const{id:T,callAction:r,tracks:c}=u.data.user,e=this.base.users.getRemoteUserContent(T);if(!e)return;e.updateCallAction(r);const t=Array.from(c,({type:i})=>mediaType_keys[i]);this.stopSubscribe([{userId:T,mediaTypes:t}]),e.removeTracks(t)},this.base.cws.on.onTrackInactive=u=>{const{session:T,tracks:r=[]}=u.data;if(T!==this.base.config.callSession)return this._restorePeer();const c=[];for(const e of r){const{type:t,trackName:i}=e,_=mediaType_keys[t],x=this.base.users.localUser.getTrack(_);x&&x.trackName===i&&c.push(x)}if(c.length!==0){const e=Array.from(c,t=>t.mediaType);this._closeTrack(c).finally(()=>this.publish(e))}},this.base.cws.on.onUpdateCall=u=>{const{id:T,callAction:r}=u.data.user,c=this.base.users.getRemoteUserContent(T);c&&(c.updateCallAction(r),this.base.users.emitUsersChange())},this.base.cws.on.onUpdatePermissions=u=>{const{user:T}=u.data,{id:r,permissions:c=1}=T;c===1?this.base.users.localUser.id===r?(this.base.users.localUser.updatePermissions(c),this.pauseTracks(["mc_audio","mc_video"],!0)):this.base.users.removeRemoteUser(r):c===3&&this.base.users.initUsers([T]),this.base.users.emitUsersChange()},this.base.cws.on.onUpdateBehavior=u=>{const{users:T}=u.data;for(const r of T){const{id:c,behavior:e}=r,t=this.base.users.getUserContent(c);t&&t.updateBanBehavior(e)}},this.base.cws.on.onNetQuality=u=>{const{qualities:T=[]}=u.data;let r=!1;for(const c of T){const{userId:e,egress:t,ingress:i}=c,_=this.base.users.getRemoteUserContent(e);if(!_)continue;_.updateNetwork({egress:t,ingress:i})===!1&&(r=!0)}r&&this.base.users.emitUsersChange()},this.base.cws.on.onRoomUserSpeech=u=>{this.base.notifys.emit("onRoomUserSpeech",u)},this.base.cws.on.onBeforeTokenExpire=u=>{this.base.notifys.emit("onBeforeTokenExpire",u)},this.base.cws.on.onTokenExpired=u=>{this.base.notifys.emit("onTokenExpired",u)},this.base.cws.on.onCDNPlayUrlAdd=u=>{this.base.notifys.emit("onCDNPlayUrlAdd",u)},this._onOnline=()=>{this._reportNetwork()},window.addEventListener("online",this._onOnline)}setLocalStream=(b,u)=>new Promise(async(T,r)=>{try{if(this.base.users.localUser.usePhoneyStream(b),u){if(b.includes("mc_audio")&&b.includes("mc_video")?await this.base.localMedias.initLocalStreamTrack("mc"):b.includes("mc_audio")?await this.base.localMedias.initLocalStreamTrack("mc_audio"):b.includes("mc_video")?await this.base.localMedias.initLocalStreamTrack("mc_video"):b.includes("ss_audio")&&b.includes("ss_video")?await this.base.localMedias.initLocalStreamTrack("ss"):b.includes("ss_audio")&&!b.includes("ss_video")?await this.base.localMedias.initLocalStreamTrack("ss_audio"):b.includes("ss_video")&&!b.includes("ss_audio")&&await this.base.localMedias.initLocalStreamTrack("ss_video"),b.includes("ss_audio")){const c=this.base.users.localMedias.getLocalStreamTrack("ss_audio");c&&(c.onended=()=>this.stopPublish(["ss_audio","ss_video"]))}if(b.includes("ss_video")){const c=this.base.users.localMedias.getLocalStreamTrack("ss_video");c&&(c.onended=()=>this.stopPublish(["ss_audio","ss_video"]))}this.base.users.localUser.useLocalStream(b),this.base.peer.syncSenderStreamTrack(b)}else for(const c of b)this.base.localMedias.stopLocalStreamTrack(c);T(!0)}catch(c){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",c),r(c)}});setMediaDeviceKind=(b,u)=>new Promise(async(T,r)=>{try{await this.base.users.localMedias.setMediaDeviceKind(b,u);const c=this.base.users.localUser;switch(b){case"audioinput":c.usePhoneyStream(["mc_audio"]),!!this.base.localMedias.getLocalStreamTrack("mc_audio")===!0&&(await this.base.localMedias.initLocalStreamTrack("mc_audio"),c.useLocalStream(["mc_audio"])),this.base.peer.syncSenderStreamTrack(["mc_audio"]),this.base.users.syncRemoteUserP2PSenderStreamTrack(["mc_audio"]);break;case"videoinput":c.usePhoneyStream(["mc_video"]),!!this.base.localMedias.getLocalStreamTrack("mc_video")===!0&&(await this.base.localMedias.initLocalStreamTrack("mc_video"),c.useLocalStream(["mc_video"])),this.base.peer.syncSenderStreamTrack(["mc_video"]),this.base.users.syncRemoteUserP2PSenderStreamTrack(["mc_video"]);break;case"audiooutput":await this.base.users.localMedias.changeAudiooutput();break}T(!0)}catch(c){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",c),r(c)}});setMediaTrackConstraints=async(b,u)=>{this.base.localMedias.setMediaTrackConstraints(b,u),this.base.users.localMedias.isOpenMediaDevice(b)&&["video"].includes(b)&&await this.setLocalStream([b],!0)};earlyConnect=(b=[])=>new Promise(async(u,T)=>{try{b.length===0&&(b=["mc_audio","mc_video"]),this.base.config.isEarly=!0,await this._connectCws(),this._initHeartbeat("heartbeatEx"),await this._connectCF(),this._createTrack(b),u(!0)}catch(r){this.base._reportLog("ws_c_timeout",r.msg||r),T(r)}});joinRoom=async b=>new Promise(async(u,T)=>{try{this.base.config.setOptions(b),this.base.users.localUser.id=b.userId,this.base.traffic.clear(),this.base.users.remoteUsers.clear();const{userId:r,callType:c,sdkToken:e,roomId:t,stt:i=!1,lang:_,isEarly:x}=this.base.config;(x===!1||this.base.cws.prws.ws&&[2,3].includes(this.base.cws.prws.ws?.readyState))&&await this._connectCws();const{input:C="zh",output:F="zh",translateEnable:j=!1}=_||{},ee=await this.base.cws.createRequest(x?"joinRoomEx":"joinRoom").send({data:{callType:c,roomId:t,user:{id:r,tracks:[],callAction:0},token:e,stt:i,lang:{input:C,output:F,translateEnable:j}},version:2}),{code:re=0,desc:K="服务器繁忙",data:se}=ee;if(re!==200)throw new Error(K);if(se.roomId!==t)return T("加入的房间不匹配");this.base.users.config.isInRoom=!0,await this._connectCF(),await this.base.peer.waitings.peerConnected(),this._initHeartbeat("heartbeat"),this.base.users.initUsers(se.roomUsers||[]),this.base.users.emitUsersChange(),u(!0)}catch(r){T(r)}});publish=b=>new Promise(async(u,T)=>{try{if(b.includes("ss_audio")&&!b.includes("ss_video")){const i=b.findIndex(_=>_==="ss_audio");b.splice(i,1)}const r=this.base.users.localUser;if(r.checkBanBehavior(b)===!1)throw new Error("publish is error: prohibited by administrator.");await this._createTrack(b);const c=this.base.peer.getSenderUserTracks(b),{invalid_mediaTypes:e}=this.base.localMedias.checkLocalStreamTracks(b);e.length!==0&&await this.setLocalStream(b,!0),r.updateTracks(c),await this._notifySelfCallAction();const{valid_mediaTypes:t}=this.base.localMedias.checkLocalStreamTracks(b);await this._pubNotify(t),this.base.users.emitUsersChange(),u(!0)}catch(r){T(r)}});stopPublish=b=>new Promise(async(u,T)=>{try{const r=this.base.users.localUser;for(const e of b)this.base.users.localUser.published[e]=!1;this.base.peer.stopSenders(b);const c=r.removeTracks(b);if(c.length===0)return u(!0);await this._closeTrack(c),await this._notifySelfCallAction(),await this.setLocalStream(b,!1),this.base.users.emitUsersChange(),u(!0)}catch(r){this.base._reportLog("close_track_error",r.message||r),T(r)}});pauseTracks=async(b,u)=>new Promise(async(T,r)=>{try{const c=this.base.users.localUser;u?c.usePhoneyStream(b):c.useLocalStream(b),this.base.users.syncRemoteUserP2PSenderStreamTrack(b),this.base.peer.syncSenderStreamTrack(b),await this._notifySelfCallAction(),this.base.users.emitUsersChange(),T(!0)}catch(c){r(c)}});subscribe=b=>{if(b===void 0){b=[];const r=this.base.users.remoteUsers.keys();for(const c of r)b.push({userId:c,mediaTypes:mediaType_keys})}const u=[];for(const r of b){const{userId:c,mediaTypes:e}=r,t=this.base.users.getRemoteUserContent(c);if(!t)continue;const i=[];for(const _ of e)t.tracks[_]?.origin==="sfu"&&i.push(_);i.length!==0&&u.push({userId:c,mediaTypes:i})}u.length!==0&&this.stopSubscribe(u);const T=()=>new Promise(async(r,c)=>{try{if(b.length===0)return r(!0);await this.base.peer.waitings.peerConnected(),this.base.users.addRemoteUsersSubscribes(b);const e=async()=>{const i=this.base.users.executeRemoteUsersSubscribes();if(i.length===0)return!0;let _=!1;const C=await this.base.cws.createRequest("subscribe").send({data:{session:this.base.config.callSession,users:i}}),{code:F=0,desc:j,sn:Z,data:ee={}}=C;if(await this._ackMsg(Z),F===200){const{remoteSdp:re,users:K}=ee;if(re){const fe=new RTCSessionDescription({type:"offer",sdp:re});await this.base.peer.setRemoteDescription(fe),await this._renegotiate()}if(!K)throw new Error("The subscription was successful but the correct subscription object was not returned.");let se=0;for(const fe of K){const{id:G,tracks:ne}=fe;if(!G||!ne)continue;const ae=this.base.users.getRemoteUserContent(G);for(const oe of ne){const{code:le=0,type:pe,mid:te,trackName:ue}=oe;switch(le){case 200:{const he=mediaType_keys[pe],me={type:pe,mid:te,trackName:ue,mediaType:he};ae?.updateTracks([me]),ae?.completedSubscribe([he]),ae?.useRemoteStream([he],this.base.peer)}break;case 2026:{const he=mediaType_keys[pe];ae?.setPublishWaiting([he])}break;default:se+=1;break}}}se===0&&(_=!0),this.base.users.emitUsersChange()}else if(F===2017&&j.includes("renegotiation is expected before pulling or pushing tracks"))await this._renegotiate();else if(F===2026){const re=b||[];for(const K of re){const{userId:se,mediaTypes:fe}=K;this.base.users.getRemoteUserContent(se)?.setPublishWaiting(fe)}}return _};await e()===!1&&(this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: The failed track will be resubscribed after 4 seconds."),await new Promise(i=>setTimeout(()=>i(!0),1e3*4)),await e()),r(!0)}catch(e){this.base._reportLog("subscribe_error",e.message||e),c(e)}});return this.base.asyncQueue.add(T,{describe:"subscribe"})};stopSubscribe=b=>new Promise(async(u,T)=>{try{if(b===void 0){b=[];const c=this.base.users.remoteUsers.keys();for(const e of c)b.push({userId:e,mediaTypes:mediaType_keys})}if(b.length===0)return u(!0);const r=[];for(const c of b){const{userId:e,mediaTypes:t}=c,i=this.base.users.getRemoteUserContent(e);if(!i)continue;const _=[];for(const x of t){const C=i.getTrack(x);C&&(C.origin==="sfu"&&C.msid?(r.push(C),i.usePhoneyStream([x])):C.origin==="p2p"&&i.p2p?.activeRecv[x]!==void 0&&_.push(x))}_.length!==0&&(i.p2p?.setRecvTracksEnabled(_,!1),i.usePhoneyStream(_),this.base._reportP2PConnect("disconnect",{desc:"Take the initiative to disconnect.",pushId:i.id,pullId:this.base.config.userId,mediaTypes:_}))}r.length!==0&&await this._closeTrack(r),this.base.users.emitUsersChange(),u(!0)}catch(r){this.base._reportLog("close_track_error",r.message||r),T(r)}});quitRoom=()=>new Promise(async b=>{const{roomId:u,userId:T,isInRoom:r}=this.base.config;try{if(r===!1)return b(!0);this.base.config.isInRoom=!1,this.base.intervalQueue.removeQueueItem(["heartbeat-interval","peerAnalysis"]),await this.setLocalStream(mediaType_keys,!1),await this.base.cws.createRequest("quitRoom").send({data:{roomId:u,userId:T}})}catch(c){this.base._reportLog("quit_room_error",c.message||c)}this.base.users.clearUsers(),this.base.setRoomState("ready"),this.base.asyncQueue.clear();try{this.base.peer.close(),this.base.cws.close()}catch{}b(!0)});quitRoomEx=()=>new Promise(async b=>{try{const{roomId:u,userId:T,isInRoom:r}=this.base.config;if(r===!1)return b(!0);this.base.config.isInRoom=!1,this._initHeartbeat("heartbeatEx"),await this.setLocalStream(mediaType_keys,!1),await this.base.cws.createRequest("quitRoomEx").send({data:{roomId:u,userId:T}})}catch(u){this.base._reportLog("quit_room_error",u.message||u)}try{await this.stopSubscribe()}catch(u){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: StopSubscribe is error at quitRoomEx. start init earlyConnect.",u),this.earlyConnect()}this.base.users.clearUsers(),this.base.setRoomState("ready"),b(!0)});setBanBehaviors=b=>new Promise(async(u,T)=>{try{const{roomId:r}=this.base.config,c=[];for(const x of b){const{id:C,banBehaviors:F}=x,j=Object.keys(F);if(j.length===0)continue;const Z=[];for(const re of j){const K=mediaType_keys.findIndex(G=>G===re),se=F[re],fe={type:K,behavior:se};Z.push(fe)}const ee={id:C,behaviors:Z};c.push(ee)}const t=await this.base.cws.createRequest("preventUsersBehavior").send({data:{roomId:r,users:c}}),{code:i=0,desc:_}=t;if(i!==200)return T(_);u(t)}catch(r){T(r)}});toggleRoomSpeechLang=b=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest("toggleRoomSpeechLang").send({data:b})};updateToken=b=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest("updateRoomToken").send({data:{roomId:this.base.config.roomId,sdkToken:b}})};destroy=()=>{this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [Destroy]"),this.base.config.isInRoom=!1,this.base.setRoomState("closed"),this._reconnectTimerId&&(clearTimeout(this._reconnectTimerId),this._reconnectTimerId=void 0),this._onOnline&&(window.removeEventListener("online",this._onOnline),this._onOnline=void 0),this.base.cws.clearEvents(),this.base.cws.close(),this.base.peer.close(),this.base.intervalQueue.removeQueueItem(["heartbeat-interval","peerAnalysis"]),this.base.asyncQueue.clear(),this.base.users.clearUsers(),this.setLocalStream(mediaType_keys,!1),this.base.localMedias.destroy(),this.base.notifys.emit("onDestroyRoom",{code:200,desc:"Is destroy.",data:{}})};_connectCws=async()=>{this.base.setRoomState("connecting");const b=this.base.config.createWsUrl();await this.base.cws.connect(b),this.base.setRoomState("connected")};_reconnectCws=async()=>{this.base.setRoomState("connecting"),this.base.cws.prws.url=this.base.config.createWsUrl(),this.base.cws.prws.reconnect(),this.base.setRoomState("connected")};_initHeartbeat=b=>{if(this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]),this.base.cws.needRestoreRoom()===!0)return this._restoreRoom();if(b==="heartbeat"){const T=()=>{if(this.base.cws.prws.ws?.readyState!==1)return;const r=this.base.cws.createRequest(b,{onBack:!1}),c=this.base.traffic.getUse("kb"),{outboundBytes:e,inboundBytes:t}=c.sfu,{outboundBytes:i,inboundBytes:_}=c.p2p,x={sfuPush:e,sfuPull:t,p2pPush:i,p2pPull:_};r.send({data:x})};this.base.intervalQueue.addQueueItem({key:"heartbeat-interval",func:T,interval:1e3*10})}else{const T=()=>{if(this.base.cws.prws.ws?.readyState!==1)return;const r=this.base.cws.createRequest(b,{onBack:!1}),c={};r.send({data:c})};this.base.intervalQueue.addQueueItem({key:"heartbeat-interval",func:T,interval:1e3*30})}};_connectCF=async()=>{if(["connecting","connected"].includes(this.base.peer.pc.connectionState))return;await this.base.peer.init();let b;b=await this.base.cws.createRequest("connectCF").send({compress:!0,data:{sdp:this.base.peer.getSdp()}});const{code:u=0,desc:T,data:r,sn:c}=b;if(await this._ackMsg(c),u!==200)throw new Error(T);const{remoteSdp:e,session:t}=r;this.base.config.callSession=t||"";const i=e||"";await this.base.peer.setRemoteDescription({type:"answer",sdp:i}),await $t(this.base.peer.waitings.peerConnected,{message:"ice connect is timeout.",timeout:10*1e3}),this._reportNetwork(),this.base.intervalQueue.addQueueItem({key:"peerAnalysis",func:this._calculateNetwork,interval:1e3})};_createTrack=b=>{const u=()=>new Promise(async(T,r)=>{try{await this.base.peer.waitings.peerConnected();const c=await this.base.peer.addSenders(b),e=this.base.peer.getSenderUserTracks(c);if(e.length===0)return T(!0);const t=this.base.peer.getSdp(),i=this.base.cws.createRequest("publish");let _=await i.send({compress:!0,version:4,data:{session:this.base.config.callSession,sdp:t,tracks:e,callAction:0}});const{code:x=0,sn:C}=_;if(await this._ackMsg(C),x===2116){await this._connectCF(),await this.base.peer.waitings.peerConnected(),_=await i.send({compress:!0,data:{session:this.base.config.callSession,sdp:t,tracks:e,callAction:0}});const{sn:F}=_;await this._ackMsg(F)}{const{code:F=0,desc:j,data:Z={}}=_;if(F!==200)throw new Error(j);const{remoteSdp:ee}=Z;await this.base.peer.setRemoteDescription({type:"answer",sdp:ee||""})}T(!0)}catch(c){this.base._reportLog("publish_error",c.message||c),r(c)}});return this.base.asyncQueue.add(u,{describe:"createTrack"})};_closeTrack=(b=[])=>{const u=()=>new Promise(async(T,r)=>{try{await this.base.peer.createOffer();const e=await this.base.cws.createRequest("closeTrack").send({compress:!0,data:{roomId:this.base.config.roomId,sdp:this.base.peer.getSdp(),tracks:b}}),{code:t=0,desc:i,data:_={}}=e;if(t!==200)throw new Error(i);await this.base.peer.setRemoteDescription({type:"answer",sdp:_.remoteSdp||""}),T(!0)}catch(c){r(c)}});return this.base.asyncQueue.add(u,{describe:"closeTrack"})};_pubNotify=async b=>{const u=this.base.peer.getSenderUserTracks(b),T=pt(u,["type","trackName","mid"]),{callSession:r,roomId:c,userId:e}=this.base.config;await this.base.cws.createRequest("pubNotify").send({data:{session:r,roomId:c,user:{id:e,tracks:T}}});for(const i of b)this.base.users.localUser.published[i]=!0};_renegotiate=async()=>{await this.base.peer.createAnswer();const u=await this.base.cws.createRequest("renegotiate").send({data:{sdp:this.base.peer.getSdp()},compress:!0}),{code:T=0,desc:r,sn:c}=u;if(await this._ackMsg(c),T!==200)throw new Error(r)};_ackMsg=async b=>{await this.base.cws.createRequest("ackMsg",{onBack:!1}).send({data:{msgId:b}})};_notifySelfCallAction=async()=>{const b=this.base.users.localUser;b.updateSelfCallAction();const{roomId:u}=this.base.config,{id:T,callAction:r}=b,e=await this.base.cws.createRequest("updateCall").send({data:{roomId:u,user:{id:T,callAction:r}}}),{code:t=0}=e;if(t!==200)throw new Error("NotifySelfCallAction is error.")};_calculateNetwork=async()=>{if(this.base.cws.prws.ws?.readyState!==1||this.base.peer.pc.connectionState!=="connected")return;const b={sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}},u=[],T=[];{const r=[0],c=[0],e=[0],t=[],i=[],_=new Date().getTime(),x=this.base.users.localUser;await x.generateTrackAnalysis(this.base.peer);for(const Z of mediaType_keys)if(x.published[Z]&&x.getTrack(Z)){const{trackReport:ee}=x.tracksAnalysis.sfu.sends[Z],{offsetBytesSent:re,lostRate:K,roundTripTime:se,jitter:fe,quality:G,averageQuality:ne,averageOffsetBytesSent:ae}=ee;this.base.traffic.sfu.outboundBytes+=re,b.sfu.velocityPush+=ae,r.push(K),c.push(se),e.push(fe),G!==0&&t.push(G),ne!==0&&i.push(ne),u.push(G)}const C=this.base.users.remoteUsers.values();for(const Z of C){await Z.generateTrackAnalysis(this.base.peer);for(const ee of mediaType_keys)if(Z.getTrack(ee)){const{trackReport:re}=Z.tracksAnalysis.sfu.recvs[ee],{offsetBytesSent:K,lostRate:se,roundTripTime:fe,jitter:G,quality:ne,averageQuality:ae,averageOffsetBytesSent:oe}=re;this.base.traffic.sfu.inboundBytes+=K,b.sfu.velocityPull+=oe,r.push(se),c.push(fe),e.push(G),ne!==0&&t.push(ne),ae!==0&&i.push(ae),T.push(ne)}}const j=new Date().getTime()-_;j>1e3&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: generateTrackAnalysis taking too much time.",{offset_time:j}),b.sfu.lostRate=Math.max(...r),b.sfu.roundTripTime=Math.max(...c),b.sfu.jitter=Math.max(...e),b.sfu.quality=t.length===0?0:Math.min(...t),b.sfu.averageQuality=i.length===0?0:Math.min(...i)}{const r=[0],c=[0],e=[0],t=[],i=[],_=this.base.users.remoteUsers.values();for(const x of _)for(const C of mediaType_keys)if(x.p2p){{const{trackReport:F}=x.tracksAnalysis.p2p.sends[C],{offsetBytesSent:j,lostRate:Z,roundTripTime:ee,jitter:re,quality:K,averageQuality:se,averageOffsetBytesSent:fe}=F;this.base.traffic.p2p.outboundBytes+=j,b.p2p.velocityPush+=fe,r.push(Z),c.push(ee),e.push(re),K!==0&&t.push(K),se!==0&&i.push(se),u.push(K)}{const{trackReport:F}=x.tracksAnalysis.p2p.recvs[C],{offsetBytesSent:j,lostRate:Z,roundTripTime:ee,jitter:re,quality:K,averageQuality:se,averageOffsetBytesSent:fe}=F;this.base.traffic.p2p.inboundBytes+=j,b.p2p.velocityPull+=fe,r.push(Z),c.push(ee),e.push(re),K!==0&&t.push(K),se!==0&&i.push(se),T.push(K)}}b.p2p.lostRate=Math.max(...r),b.p2p.roundTripTime=Math.max(...c),b.p2p.jitter=Math.max(...e),b.p2p.quality=t.length===0?0:Math.min(...t),b.p2p.averageQuality=i.length===0?0:Math.min(...i)}{const r=this.base.traffic.getUse();b.sfu.outboundBytes=r.sfu.outboundBytes,b.sfu.inboundBytes=r.sfu.inboundBytes,b.p2p.outboundBytes=r.p2p.outboundBytes,b.p2p.inboundBytes=r.p2p.inboundBytes}this.base.config.network=b,this.base.notifys.emit("onRoomNetwork",{code:200,data:b,desc:"RoomNetwork is change."});{const r=this.base.users.localUser,c=u.length===0?0:Math.round(u.reduce((i,_)=>i+_)/u.length),e=T.length===0?0:Math.round(T.reduce((i,_)=>i+_)/T.length);r.updateNetwork({egress:c,ingress:e})===!1&&(this.base.cws.createRequest("networkQualityChange",{onBack:!1}).send({data:{egress:c,ingress:e,userId:r.id,roomId:this.base.config.roomId}}),this.base.users.emitUsersChange())}this._checkAndSelectUserStreamOrigin()};_checkAndSelectUserStreamOrigin=async()=>{if(this._hasAsyncTask("subscribe")||this._hasAsyncTask("publish")||this._hasAsyncTask("closeTrack"))return;const b=this.base.config.network.sfu.averageQuality,u=this.base.users.remoteUsers.values(),T=[],r=[],c=new Date().getTime();for(const e of u){const t=e.p2p;if(!t)continue;const i=[];for(const _ of mediaType_keys){if(!t.hasRecvier(_))continue;const C=t.checkReceActive(_);if(!C)continue;const F=e.getTrack(_);if(!F){t.setRecvTracksEnabled([_],!1);continue}const{averageQuality:j,availableScore:Z}=e.tracksAnalysis.p2p.recvs[_]?.trackReport;let ee=this.base._checkUserStreamOrigin({p2pAverageQuality:j,sfuAverageQuality:b});F.origin==="p2p"&&c-C>=1e4&&Z<.6&&(ee="sfu",this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: Switching to SFU. availableScore: ${Z}`,{remoteUserId:e.id,mediaType:_,availableScore:Z})),ee!==F.origin&&(ee==="p2p"?(e.useRemoteP2PStream([_]),r.push(F)):i.push(_))}i.length!==0&&(this.base._reportP2PConnect("disconnect",{desc:"Poor quality of P2P. ",pushId:e.id,pullId:this.base.config.userId,mediaTypes:i}),T.push({userId:e.id,mediaTypes:i}))}if(r.length!==0&&await this._closeTrack(r),T.length!==0){await this.subscribe(T);for(const e of T){const{userId:t,mediaTypes:i}=e;try{this.base.users.getRemoteUserContent(t)?.p2p?.setRecvTracksEnabled(i,!1)}catch(_){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [_checkAndSelectUserStreamOrigin]",_)}}}r.length!==0&&T.length===0&&this.base.users.emitUsersChange()};_reportNetwork=async()=>{try{let b=0;const{address:u,natType:T}=await h();switch(T){case"Symmetric":b=0;break;case"Full Cone":b=1;break;case"Port Restricted Cone":b=2;break;case"Restricted Cone":b=3;break}let r=0;{const e=isMobile(),i=(navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType;e||(["wifi","4g"].includes(i)?r=0:r=2),e&&(["wifi"].includes(i)?r=0:r=2)}await this.base.cws.createRequest("reportNetwork").send({data:{nat:b,type:r,ip:u}})}catch(b){this.base.config.debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [reportNetwork]",b)}};_hasAsyncTask=b=>{let u=!1;return this.base.asyncQueue.activePromise?.describe===b&&(u=!0),u===!1&&this.base.asyncQueue.queue.find(r=>r.describe===b)&&(u=!0),u};_syncRoomInfo=async()=>{const b=this.base.users.localUser,u={pull:[],push:[]};{const C=this.base.users.remoteUsers.values();for(const F of C){const{id:j,p2p:Z}=F;if(!Z)continue;const ee=[],re=[];for(const K of mediaType_keys){const se=mediaType_keys.findIndex(fe=>fe===K);{if((Z.activeSend[K]||!1)===!1)continue;ee.push(se)}{if((Z.activeRecv[K]||!1)===!1)continue;re.push(se)}}ee.length!==0&&u.push.push({userId:j,types:ee}),re.length!==0&&u.pull.push({userId:j,types:re})}}const r=await this.base.cws.createRequest("syncRoomInfo").send({data:{user:{id:b.id,callAction:b.callAction},p2pState:u}}),{code:c=0,desc:e,data:t={}}=r;if(c!==200)throw new Error(e);if(t.isActive===!1)throw new Error("Do not stay in this room.");const i=t.users||[];if((i.find(C=>C.id===b.id)||!1)===!1)throw new Error("Need to rejoin the room.");const x=this.base.users.remoteUsers.values();for(const C of x){const F=i.find(K=>K.id===C.id)||!1;if(!F){this.base.users.removeRemoteUser(C.id);continue}const{callAction:j=0,permissions:Z=0,behavior:ee=0,tracks:re=[]}=F;C.updateCallAction(j),C.updatePermissions(Z),C.updateBanBehavior(ee),C.updateTracks(re,!0)}this.base.users.emitUsersChange()};_restorePeer=async()=>new Promise(async(b,u)=>{try{this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [restorePeer]");let T=[];if(this.base.config.isInRoom){const i=this.base.users.remoteUsers.values();for(const _ of i){const x=[],C=_.getTracks(mediaType_keys);for(const F of C){const{mediaType:j,origin:Z,msid:ee}=F;(Z==="p2p"||Z==="sfu"&&ee!=="")&&x.push(j)}x.length!==0&&T.push({userId:_.id,mediaTypes:x})}}const r=this.base.users.localUser.getTracks(mediaType_keys),c=[],e=[],t=[];for(const i of r){const{enabled:_,mediaType:x}=i;c.push(x),_===!0?e.push(x):t.push(x)}if(await this._connectCF(),await this._syncRoomInfo(),T.length!==0&&await this.subscribe(T),c.length!==0){await this._createTrack(c);const i=this.base.peer.getSenderUserTracks(c);this.base.users.localUser.updateTracks(i),this.base.users.localUser.usePhoneyStream(c),e.length!==0&&(await this.setLocalStream(e,!0),this.base.users.localUser.useLocalStream(e)),await this._notifySelfCallAction();const{valid_mediaTypes:_}=this.base.localMedias.checkLocalStreamTracks(c);await this._pubNotify(_)}b(!0)}catch(T){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [RestorePeer is error.]",T),this.base.setRoomState("closed"),u(T)}});_restoreRoom=async()=>{try{this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]),await this._connectCws(),await this._restorePeer()}catch(b){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [RestoreRoom is error.]",b),this.base.setRoomState("closed")}}}class ActionP2P{base;_p2pCheckTimeoutMap=new Map;constructor({base:b}){this.base=b,this.base.cws.on.onOffer=u=>{this._onOffer(u)},this.base.cws.on.onCandidate=u=>{this._onCandidate(u)},this.base.cws.on.onAttemptP2PEx=u=>{const{roomId:T,pushId:r,types:c=[],isRemotePush:e=!1}=u.data;if(c.length===0){this.base.config.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [onAttemptP2PEx] There is an error. types.length === 0",u);return}if(this.base.config.roomId!==T){this.base.config.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [onAttemptP2PEx] There is an error. roomId is inequality.",u);return}const t=Array.from(c,i=>mediaType_keys[i]);t.length!==0&&this._openP2P(r,t,e)},this.base.cws.on.onDisconnectedP2P=u=>{const{roomId:T,remoteUserId:r}=u.data;if(T!==this.base.config.roomId)return;const c=this.base.users.getRemoteUserContent(r);if(!c||!c.p2p)return;c.p2p.checkActive()===!1&&c.p2p.close()}}_openP2P=async(b,u,T)=>{if(u.length===0)return;const{useP2P:r,roomId:c,userId:e}=this.base.config;if(r===!1)throw new Error("You have disabled the p2p function on the client side.");try{const t=this.base.users.localUser,i=new Date().getTime(),_=this.base.users.getRemoteUserContent(b);if(!_)throw new Error("The remote user to be established does not exist.");const x=this._getRemoteUserP2PContent(b,!0),{prohibited_mediaTypes:C=[],subscribed_mediaTypes:F=[]}=_.checkSubscribed(u);if(T===!0&&C.length!==0&&(this.base._reportP2PConnect("ignore",{desc:"P2P connections without a subscription relationship are not allowed.",pullId:e,pushId:b,mediaTypes:C}),F.length===0))return;this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${b}]: start connect p2p.`,{isRemotePush:T}),T===!1?(x.close(),x.init()):x.peer?.connectionState!=="connected"&&x.init();const j=x.initRecvs(F);if(j.length!==0){const ee=()=>{const K=async()=>{const fe=await x.createOffer(),G=x.getRecvUserTracks(F),ae=await this.base.cws.createRequest("offer").send({data:{roomId:c,tracks:G,sender:{id:e,callAction:t.callAction},receiverId:b,sdp:fe.sdp}}),{code:oe=0,desc:le}=ae;if(oe!==200)throw new Error(le)};return $t(()=>new Promise(fe=>{this.base.cws.on.onAnswer=G=>{const{code:ne,data:ae}=G;if(ne!==200)return;const{sender:oe,sdp:le,tracks:pe=[]}=ae,{id:te}=oe;b===te&&fe({answer:{type:"answer",sdp:le},tracks:pe})},K()}),{message:"await_answer is timeout.",timeout:2e4})},re=async()=>{const K=await $t(x.getIcecandidates,{message:"get recv candidates is timeout.",timeout:1e4}),se=Array.from(K,({sdpMid:oe,sdpMLineIndex:le,candidate:pe})=>({sdpMid:oe,sdpMLineIndex:le,sdp:pe})),G=await this.base.cws.createRequest("candidate",{timeout:1e3*10}).send({data:{roomId:c,senderId:e,receiverId:b,candidates:se,isSubscribeReceiver:!0}}),{code:ne=0,desc:ae}=G;if(ne!==200)throw new Error(ae)};{const K=await ee(),{answer:se,tracks:fe=[]}=K;await x.setAnswer(se),await re();const G=[],ne=[];for(const ae of fe){const{type:oe,mid:le,enabled:pe=!1}=ae;if(oe===void 0)continue;const te=mediaType_keys[ae.type];ne.push(te),G.push({mediaType:te,mid:le,enabled:pe})}x.initSenders(G),x.setSendTracksEnabled(j,!1,"local")}}await $t(x.waitings.connected,{message:"ice connect is timeout.",timeout:10*1e3}),await $t(x.waitings.remoteChannelConnected,{message:"remote_channel connect is timeout.",timeout:10*1e3}),T===!0&&x.setRecvTracksEnabled(F,!0);const Z=`${new Date().getTime()-i}`;T===!0?await this.base._reportP2PConnect("success",{action:3,desc:"P2P connection successful.",pullId:e,pushId:b,mediaTypes:F,connectedTime:Z}):await this.base._reportP2PConnect("success",{action:2,desc:"P2P connection successful.",pullId:b,pushId:e,mediaTypes:u,connectedTime:Z}),this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${b}]: switch to P2P will be attempted within 10 seconds.`);{const ee=this._p2pCheckTimeoutMap.get(b);ee&&clearTimeout(ee);const re=window.setTimeout(()=>{this._p2pCheckTimeoutMap.delete(b);const K=[],se=this.base.users.getRemoteUserContent(b);if(!(!se||!se.p2p)){for(const fe of F){const G=se.p2p.activeRecv[fe]||!1,ne=se.getTrack(fe);G&&ne?.origin!=="p2p"&&K.push(fe)}K.length!==0&&(se.p2p.setRecvTracksEnabled(K,!1),this.base._reportP2PConnect("disconnect",{desc:"Poor quality of P2P.",pushId:se.id,pullId:this.base.config.userId,mediaTypes:K}))}},1e3*10);this._p2pCheckTimeoutMap.set(b,re)}}catch(t){this.base.users.getRemoteUserContent(b)?.p2p?.destroy(),this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [p2p]: onOpen p2p with ${b} is error.`,t),T===!0?await this.base._reportP2PConnect("fail",{action:0,desc:t.message||t,pullId:e,pushId:b,mediaTypes:u}):await this.base._reportP2PConnect("fail",{action:1,desc:t.message||t,pullId:b,pushId:e,mediaTypes:u})}};_onOffer=async b=>{const{code:u,data:T}=b;if(u!==200)return;const{sdp:r,sender:c={},tracks:e=[]}=T,{id:t}=c,{userId:i,roomId:_}=this.base.config,x=this.base.users.localUser;try{const C=this.base.users.getrP2PConnectedCount(),F=[],j=[];for(const fe of e){const{type:G,mid:ne,enabled:ae=!1}=fe;if(G===void 0)continue;const oe=mediaType_keys[fe.type];F.push(oe),j.push({mediaType:oe,mid:ne,enabled:ae})}if(C+F.length>3){if(F.length===2){const fe=F.findIndex(G=>G==="ss_video");F.splice(fe,1),await this.base._reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pushId:i,pullId:t,mediaTypes:["ss_video"]})}if(F.length===1){await this.base._reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pushId:i,pullId:t,mediaTypes:F});return}}const Z=this._getRemoteUserP2PContent(t,!0);this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${t}]: start connect p2p.`),Z.peer?.connectionState!=="connected"&&Z.init(),await Z.setOffer({type:"offer",sdp:r});{const fe=Z.initSenders(j);Z.setSendTracksEnabled(fe,!1,"local")}const ee=await Z.createAnswer(),re=Z.getSenderUserTracks(F),K=()=>new Promise(async(fe,G)=>{try{const ae=await this.base.cws.createRequest("answer").send({data:{roomId:_,tracks:re,sender:{id:x.id,callAction:x.callAction},receiverId:t,sdp:ee.sdp}}),{code:oe=0,desc:le}=ae;if(oe!==200)throw new Error(le);fe(!0)}catch(ne){G(ne)}}),se=()=>new Promise(async(fe,G)=>{try{const ne=await $t(Z.getIcecandidates,{message:"get send candidates is timeout.",timeout:1e4}),ae=Array.from(ne,({sdpMid:ue,sdpMLineIndex:he,candidate:me})=>({sdpMid:ue,sdpMLineIndex:he,sdp:me})),le=await this.base.cws.createRequest("candidate").send({data:{roomId:_,senderId:x.id,receiverId:t,candidates:ae,isSubscribeReceiver:!1}}),{code:pe=0,desc:te}=le;if(pe!==200)throw new Error(te);fe(!0)}catch(ne){G(ne)}});await K(),await new Promise(fe=>setTimeout(()=>fe(!0),1e3)),await se(),await $t(Z.waitings.connected,{message:"ice connect is timeout.",timeout:20*1e3})}catch(C){this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [p2p]: onReply p2p with ${t} is error.`,C)}};_onCandidate=async b=>{const{code:u,data:T}=b;if(u!==200)return;const{senderId:r,candidates:c=[],receiverId:e,isSubscribeReceiver:t=!1}=T,{userId:i}=this.base.config;if(t===!1||e!==i)return;const _=this.base.users.getRemoteUserContent(r);if(!_||!_.p2p){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: An error occurred in onCandidate.",_);return}const x=Array.from(c,({sdpMid:C,sdpMLineIndex:F,sdp:j})=>({sdpMid:C,sdpMLineIndex:F,candidate:j}));await _.p2p.addCandidates(x)};_getRemoteUserP2PContent=(b,u)=>{const T=this.base.users.getRemoteUserContent(b);if(!T)throw new Error("The remote user to be established does not exist.");if(u===!0&&(T.p2p||this.base.users.createRemoteUserP2P(b)),!T.p2p)throw new Error("The remote user p2p to be established does not exist.");return T.p2p};destroy=()=>{for(const b of this._p2pCheckTimeoutMap.values())clearTimeout(b);this._p2pCheckTimeoutMap.clear()}}class QuickVO{_base=new Base;_ACTION_BASE=new ActionBase({base:this._base});_ACTION_SFU=new ActionSFU({base:this._base});_ACTION_P2P=new ActionP2P({base:this._base});constructor(b){this._base.config.setOptions(b)}recorder=this._base.recorder;use=this._base.use;setCallStrategy=this._base.setCallStrategy;addRequestAnimationFrame=this._base.addRequestAnimationFrame;clearRequestAnimationFrame=this._base.clearRequestAnimationFrame;addNotify=this._base.notifys.add;setOptions=this._base.config.setOptions;getLocalStream=this._base.users.localUser.getStream;getLocalStreams=this._base.users.localUser.getStreams;setActiveNoise=this._base.users.localUser.setActiveNoise;getUserContent=this._base.users.getUserContent;getUserStream=this._base.users.getUserStream;getVolume=this._base.users.getVolume;getMaxVolumeUser=this._base.users.getMaxVolumeUser;setInputVolume=this._base.users.setInputVolume;setEnhanceGain=this._base.users.setEnhanceGain;setSpeakerVolume=this._base.users.setSpeakerVolume;getUserAudioMediaStreamContext=this._base.users.getUserAudioMediaStreamContext;playBgs=this._base.users.playBgs;changBgsMix=this._base.users.changBgsMix;stopBgs=this._base.users.stopBgs;setBgsGain=this._base.users.setBgsGain;playBgm=this._base.users.playBgm;changBgmMix=this._base.users.changBgmMix;stopBgm=this._base.users.stopBgm;setBgmGain=this._base.users.setBgmGain;getEnumerateDevices=this._base.localMedias.getEnumerateDevices;getMediaDeviceKind=this._base.localMedias.getMediaDeviceKind;getMediaDevicesErrInfo=this._base.localMedias.getMediaDevicesErrInfo;setLocalStream=this._ACTION_SFU.setLocalStream;setMediaDeviceKind=this._ACTION_SFU.setMediaDeviceKind;setMediaTrackConstraints=this._ACTION_SFU.setMediaTrackConstraints;earlyConnect=this._ACTION_SFU.earlyConnect;joinRoom=this._ACTION_SFU.joinRoom;publish=this._ACTION_SFU.publish;stopPublish=this._ACTION_SFU.stopPublish;pauseTracks=this._ACTION_SFU.pauseTracks;subscribe=this._ACTION_SFU.subscribe;stopSubscribe=this._ACTION_SFU.stopSubscribe;setBanBehaviors=this._ACTION_SFU.setBanBehaviors;toggleRoomSpeechLang=this._ACTION_SFU.toggleRoomSpeechLang;updateToken=this._ACTION_SFU.updateToken;quitRoom=this._ACTION_SFU.quitRoom;quitRoomEx=this._ACTION_SFU.quitRoomEx;destroy=()=>{this._ACTION_P2P.destroy(),this._ACTION_SFU.destroy()};getLocalUserTrackReports=this._base.users.getLocalUserTrackReports;getRemoteUserTrackReports=this._base.users.getRemoteUserTrackReports;_openP2P=this._ACTION_P2P._openP2P;_restoreRoom=this._ACTION_SFU._restoreRoom;_debugger=this._ACTION_BASE._debugger;_ai=this._ACTION_BASE._ai;_testQuitRoom=this._ACTION_BASE._testQuitRoom}const enum_callStrategy={qualityPriority:"画质优先",fluencyPriority:"流畅度优先",balancedDowngrade:"均衡降级"},callStrategy_options=Yt(enum_callStrategy),callStrategy_keys=Object.keys(enum_callStrategy),callStrategy_vals=Object.values(enum_callStrategy),enum_eventName={heartbeat:"心跳",heartbeatEx:"慢心跳",ackMsg:"确认收到消息",reportNetwork:"上报网络类型",connectCF:"连接CF",publish:"发布流",joinRoom:"加入房间",joinRoomEx:"加入房间(提前建连)",pubNotify:"广播已发布的轨道",subscribe:"订阅流",renegotiate:"协商流",closeTrack:"关闭轨道",preventUsersBehavior:"阻止用户行为",networkQualityChange:"更新网络状态",updateCall:"更新通话状态",toggleRoomSpeechLang:"切换房间语音识别",syncRoomInfo:"同步房间",updateRoomToken:"更新房间SDKTOKEN",offer:"发送P2P-offer",answer:"回应P2P-answer",candidate:"发送P2P候选信息-candidate",reportP2PConnectEx:"上报P2P连接结果",quitRoom:"退出房间",quitRoomEx:"退出房间不断开连接",debugger:"调试",ai:"WorkerAi调试",UpdateTrackActive:"p2p轨道状态"},eventName_options=Yt(enum_eventName),eventName_keys=Object.keys(enum_eventName),eventName_vals=Object.values(enum_eventName),enum_quality={0:"未知",1:"极差",2:"较差",3:"一般",4:"很好",5:"极好"},quality_options=Yt(enum_quality),quality_keys=Object.keys(enum_quality),quality_vals=Object.values(enum_quality),enum_roomState={ready:"已就绪",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"},roomState_options=Yt(enum_roomState),roomState_keys=Object.keys(enum_roomState),roomState_vals=Object.values(enum_roomState),enum_trackType={0:"麦克风-默认轨道",1:"摄像头-默认轨道",2:"屏幕共享-视频轨道",3:"屏幕共享-音频轨道"},trackType_options=Yt(enum_trackType),trackType_keys=Object.keys(enum_trackType),trackType_vals=Object.values(enum_trackType);exports.QuickVO=QuickVO,exports.callStrategy_keys=callStrategy_keys,exports.callStrategy_options=callStrategy_options,exports.callStrategy_vals=callStrategy_vals,exports.enum_callStrategy=enum_callStrategy,exports.enum_eventName=enum_eventName,exports.enum_mediaType=enum_mediaType,exports.enum_notifyName=enum_notifyName,exports.enum_quality=enum_quality,exports.enum_roomState=enum_roomState,exports.enum_trackType=enum_trackType,exports.eventName_keys=eventName_keys,exports.eventName_options=eventName_options,exports.eventName_vals=eventName_vals,exports.mediaType_keys=mediaType_keys,exports.mediaType_options=mediaType_options,exports.mediaType_vals=mediaType_vals,exports.notifyName_keys=notifyName_keys,exports.notifyName_options=notifyName_options,exports.notifyName_vals=notifyName_vals,exports.quality_keys=quality_keys,exports.quality_options=quality_options,exports.quality_vals=quality_vals,exports.roomState_keys=roomState_keys,exports.roomState_options=roomState_options,exports.roomState_vals=roomState_vals,exports.trackType_keys=trackType_keys,exports.trackType_options=trackType_options,exports.trackType_vals=trackType_vals,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|
|
3
|
+
`},writer}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var m=requireParser(),b=requireWriter(),u=requireGrammar();return lib$1.grammar=u,lib$1.write=b,lib$1.parse=m.parse,lib$1.parseParams=m.parseParams,lib$1.parseFmtpConfig=m.parseFmtpConfig,lib$1.parsePayloads=m.parsePayloads,lib$1.parseRemoteCandidates=m.parseRemoteCandidates,lib$1.parseImageAttributes=m.parseImageAttributes,lib$1.parseSimulcastStreamList=m.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class RemoteUserP2P{config;prResolves=new PrResolves;remoteUserId="";peer;timer;channelLocal;channelRemote;channelRemoteList=[];icecandidates=[];isCandidateCollected=!1;transceiverSend=new Map;transceiverRecv=new Map;activeSend={};activeRecv={};on={};waitings={candidateCollected:()=>this.prResolves.add("candidateCollected",()=>this.isCandidateCollected),remoteChannelConnected:()=>this.prResolves.add("remoteChannelConnected",()=>this.channelRemote?.readyState==="open"),connected:()=>this.prResolves.add("connected",()=>this.peer?.connectionState==="connected"),setOffered:()=>this.prResolves.add("setOffered",()=>this.peer?.remoteDescription)};constructor({config:b,remoteUserId:u}){this.config=b,this.remoteUserId=u}remoteChannelSend=async b=>{if(await this.waitings.remoteChannelConnected(),this.config.debug&&this.channelRemote?.readyState!=="open"){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [remoteChannelSend] RemoteChannel is error.",{channelRemote:this.channelRemote});return}const u=sendMessageFormat(b),T=new Uint8Array(obj2pb(u));this.channelRemote?.send(T)};init=()=>{this._clear(),this.peer=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]}),this.peer.addTransceiver("audio",{direction:"inactive"}),this.channelLocal=this.peer.createDataChannel(`Web_P2P_${this.config.userId}`,{}),this.channelLocal.onmessage=b=>{const u=new Uint8Array(b.data),T=pb2obj(u),r=onMessageFormat(T),{event:c,data:e}=r;switch(c){case"UpdateTrackActive":{const{tracks:t=[]}=e;for(const i of t){const{type:_,isActive:x=!1}=i,C=mediaType_keys[_];this.setSendTracksEnabled([C],x,"remote")}}break}},this.peer.ondatachannel=b=>{this.channelRemote=b.channel,this.channelRemoteList.push(b.channel),this.channelRemote.onopen=()=>{this.prResolves.emit("remoteChannelConnected")},this.config.debug&&this.channelRemoteList.length>1&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: There are multiple channelRemote.",this.channelRemoteList)},this.peer.onconnectionstatechange=b=>{const u=b.target.connectionState;switch(u){case"connected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),clearTimeout(this.timer),this.prResolves.emit("connected");break;case"failed":case"disconnected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),this.timer=setTimeout(()=>this.close(),20*1e3);break;case"closed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId}),this.destroy();break;default:this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: [p2p.onconnectionstatechange] ${u} `,{remoteUserId:this.remoteUserId});break}},this.peer.onicecandidate=b=>{b.candidate?this.icecandidates.push(b.candidate):(this.isCandidateCollected=!0,this.prResolves.emit("candidateCollected"))}};getSenderTrack=b=>this.transceiverSend.get(b)?.sender.track;getRecvierTrack=b=>this.transceiverRecv.get(b)?.receiver.track;syncRecvTracksEnabled=()=>{const b=[],u=[];for(const T of mediaType_keys)T.includes("audio")||(this.activeRecv[T]?b.push(T):u.push(T));b.length!==0&&this.setRecvTracksEnabled(b,!0),u.length!==0&&this.setRecvTracksEnabled(u,!1)};initSenders=(b=[],u="sendrecv")=>{const T=this.checkPeer(),r=[],c=T?.getTransceivers()||[];for(const e of mediaType_keys){const t=this.transceiverSend.get(e);if(!t)continue;c.find(_=>_.direction!=="stopped"&&_.mid===t?.mid)||this.transceiverSend.delete(e)}for(const e of b){const{mid:t,mediaType:i}=e;let _=c?.find(C=>C.mid===t);if(!_)continue;_.direction=u;const x=this.transceiverSend.get(i);x&&x.mid===_.mid||(this.transceiverSend.set(i,_),r.push(i),u=="sendrecv"&&this.transceiverRecv.set(i,_))}return r};initRecvs=(b=[],u="sendrecv")=>{const T=this.checkPeer(),r=[],c=T?.getTransceivers()||[];for(const e of mediaType_keys){const t=this.transceiverRecv.get(e);if(!t)continue;c.find(_=>_.direction!=="stopped"&&_.mid===t?.mid)||this.transceiverRecv.delete(e)}for(const e of b){if(this.transceiverRecv.get(e))continue;const i=T.addTransceiver("video",{direction:u});i.direction=u,["mc_video","ss_video"].includes(e)&&i.setCodecPreferences(this.config.codecPreferences.video),this.transceiverRecv.set(e,i),r.push(e)}return r};hasRecvier=async b=>this.transceiverRecv.has(b);hasSender=async b=>this.transceiverSend.has(b);checkActive=()=>{if(!this.peer||this.peer.connectionState!=="connected")return!1;let b=!1;for(const u of mediaType_keys){if(!this.activeSend[u])continue;b=!0;break}for(const u of mediaType_keys){if(!this.activeRecv[u])continue;b=!0;break}return b};replaceSenderTrack=async(b,u)=>{const T=this.transceiverSend.get(b);if(!T)return;const{sender:r}=T;await r.replaceTrack(u)};setSendTracksEnabled=(b=[],u,T)=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m",`color: ${u?"#00b60f":"#b64900"};`,`------->quickvo: [p2p.setSendTracksEnabled] ${u} `,{origin:T,mediaTypes:b,remoteUserId:this.remoteUserId,time:p$1(new Date().getTime())});const r=[];for(const c of b)this.activeSend[c]=u===!0?new Date().getTime():void 0,r.push(c);return this.on.setSendTracksEnabled&&this.on.setSendTracksEnabled(b),r};setRecvTracksEnabled=(b=[],u)=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m",`color: ${u?"#00b60f":"#b64900"};`,`------->quickvo: [p2p.setRecvTracksEnabled] ${u} `,{mediaTypes:b,remoteUserId:this.remoteUserId,time:p$1(new Date().getTime())});const T=[];for(const e of b)this.activeRecv[e]=u===!0?new Date().getTime():void 0,T.push(e);const r=this.getRecvUserTracks(T);this.remoteChannelSend({event:"UpdateTrackActive",data:{roomId:this.config.roomId,tracks:r}});const c=this.checkActive();return u===!1&&c===!1&&this.close(),T};setRTCRtpSenderParameters=async(b,u=[])=>{try{for(const T of u){const r=this.transceiverSend.get(T);if(!r)continue;const{sender:c}=r,e=c.getParameters();await c.setParameters({...e,...b})}}catch(T){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",T)}};createOffer=async()=>{const b=this.checkPeer(),u=await b.createOffer();return u.sdp&&(u.sdp=u.sdp.replace(new RegExp("42e01f","g"),"42e034")),await b.setLocalDescription(u),u};setOffer=async b=>{const u=this.checkPeer();this._filterSdp(b),await u.setRemoteDescription(b),await this.prResolves.emit("setOffered")};createAnswer=async()=>{const b=this.checkPeer(),u=await b.createAnswer();return u.sdp&&(u.sdp=u.sdp.replace(new RegExp("42e01f","g"),"42e034")),await b.setLocalDescription(u),u};setAnswer=async b=>{const u=this.checkPeer();this._filterSdp(b),await u.setRemoteDescription(b)};getIcecandidates=async()=>(await this.waitings.candidateCollected(),this.icecandidates);addCandidates=async b=>{await this.waitings.setOffered();for(const u of b)u.candidate?.includes("kcp")||await this.peer?.addIceCandidate(u)};getSenderUserTracks=(b=[])=>{const u=[];for(const T of b){const r=this.transceiverSend.get(T);if(!r)continue;const{mid:c,sender:e}=r,{track:t}=e;if(!t)continue;const{id:i,enabled:_}=t,x=mediaType_keys.findIndex(F=>F===T),C={type:x,enabled:_,trackName:`web-${x}-${i}`,mid:c,mediaType:T};u.push(C)}return u};getRecvUserTracks=(b=[])=>{const u=[];for(const T of b){const r=this.transceiverRecv.get(T);if(!r)continue;const{mid:c,receiver:e}=r,{track:t}=e;if(!t)continue;const{id:i,enabled:_}=t,x=mediaType_keys.findIndex(j=>j===T),C=this.activeRecv[T],F={type:x,enabled:_,trackName:`web-${x}-${i}`,mid:c,mediaType:T,isActive:C};u.push(F)}return u};checkReceActive=b=>this.activeRecv[b]||!1;getTrack=b=>this.transceiverRecv.get(b)?.receiver?.track;checkPeer=()=>{if(!this.peer)throw new Error("you need init peer.");return this.peer};close=()=>{this.peer?.connectionState==="connected"&&this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [p2p.close]",{remoteUserId:this.remoteUserId}),clearTimeout(this.timer);{const b=[...this.transceiverSend.values()];for(const u of b)u.currentDirection!=="stopped"&&u.stop();this.transceiverSend=new Map}{const b=[...this.transceiverRecv.values()];for(const u of b)u.currentDirection!=="stopped"&&u.stop();this.transceiverRecv=new Map}this.peer?.close(),this.on.close&&this.on.close()};destroy=async()=>{this.close(),this._clear()};_clear=()=>{this.icecandidates=[],this.isCandidateCollected=!1,this.channelLocal=void 0,this.channelRemote=void 0,this.channelRemoteList=[],this.activeSend={},this.activeRecv={},this.transceiverSend=new Map,this.transceiverRecv=new Map,this.peer=void 0};_filterSdp=b=>{const u=libExports$1.parse(b.sdp),{media:T=[]}=u;for(const r of T){const{candidates:c=[]}=r,e=[];for(const t of c)t.transport!=="kcp"&&e.push(t);r.candidates=e}b.sdp=libExports$1.write(u)}}class Users{config;localMedias;notifys;localUser;remoteUsers=new Map;constructor({config:b,localMedias:u,notifys:T}){this.config=b,this.localMedias=u,this.notifys=T,this.localUser=new LocalUser({config:b,localMedias:u})}getLocalUserTrackReports=b=>this.localUser.getTrackReports(b);getRemoteUserTrackReports=(b,u,T,r)=>this.getRemoteUserContent(b)?.getTrackReports(u,T,r);getUserContent=b=>b?b===this.config.userId?this.localUser:this.getRemoteUserContent(b):this.localUser;getRemoteUserContent=b=>this.remoteUsers.get(b);getUserAudioMediaStreamContext=(b,u)=>this.getUserContent(b)?.getUserMediaStreamContext(u);setInputVolume=(b,u,T)=>{this.getUserAudioMediaStreamContext(b,u)?.setInputGain(T)};setEnhanceGain=async(b,u,T)=>{this.getUserAudioMediaStreamContext(b,u)?.setEnhanceGain(T)};setSpeakerVolume=(b,u,T)=>{const r=this.getUserAudioMediaStreamContext(b,u);r?.setOutputGain(T);const c=T===0;r?.setMute(c)};getVolume=(b,u)=>this.getUserAudioMediaStreamContext(b,u)?.getVolume();playBgs=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");await r.streamControls[u]?.mixAudio(T,"bgs")};playBgm=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");await r.streamControls[u]?.mixAudio(T,"bgm")};changBgsMix=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.changeMix("bgs",T)};changBgmMix=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.changeMix("bgm",T)};stopBgs=async(b,u)=>{const T=this.getUserContent(b);if(!T)throw new Error("This user is undefined.");T.streamControls[u]?.mixAudioStop("bgs")};stopBgm=async(b,u)=>{const T=this.getUserContent(b);if(!T)throw new Error("This user is undefined.");T.streamControls[u]?.mixAudioStop("bgm")};setBgsGain=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.setBgsGain(T)};setBgmGain=async(b,u,T)=>{const r=this.getUserContent(b);if(!r)throw new Error("This user is undefined.");r.streamControls[u]?.setBgmGain(T)};getrP2PConnectedCount=()=>{let b=0;const u=this.remoteUsers.values();for(const T of u)T.p2p&&(b+=T.p2p.transceiverSend.size);return b};addRemoteUsersSubscribes=(b=[])=>{for(const u of b){const{userId:T,mediaTypes:r}=u;this.remoteUsers.get(T)?.addSubscribe(r)}};executeRemoteUsersSubscribes=()=>{const b=[],u=this.remoteUsers.values();for(const T of u){const r=T.executeSubscribe();r.tracks.length!==0&&b.push(r)}return b};completedRemoteUsersSubscribes=b=>{for(const u of b){const{id:T,tracks:r=[]}=u,c=this.remoteUsers.get(T);c?.updateTracks(r);for(const e of r){const{type:t}=e,i=mediaType_keys[t];c?.completedSubscribe([i])}}};emitUsersChange=()=>{const b=this.getUsersInfo();this.notifys.emit("onRoomUsers",{code:200,desc:"All users info is change.",data:b})};getMaxVolumeUser=()=>{const b=[...this.remoteUsers.keys()];if(b.push(this.localUser.id),b.length===0)return;let u=[];for(const T of b){const r=this.getVolume(T,"mc_audio");r&&u.push({id:T,volume:r})}return u=u.sort((T,r)=>T.volume-r.volume>0?-1:1),u[0]};getUserStream=(b,u)=>this.getUserContent(b)?.getStream(u);getUsersInfo=()=>{const u=[this.localUser.getInfo()],T=[...this.remoteUsers.values()];for(const r of T){const c=r.getInfo();u.push(c)}return u};createRemoteUser=b=>{const{config:u,localMedias:T}=this,r=new RemoteUser({config:u,localMedias:T});return r.id=b,this.remoteUsers.set(b,r),r};checkRemoteUser=b=>this.remoteUsers.has(b);removeRemoteUser=b=>{this.remoteUsers.get(b)?.clear(),this.remoteUsers.delete(b)};initUsers=b=>{for(const u of b){const{id:T,callAction:r=0,permissions:c=0,behavior:e=0,tracks:t}=u;if(this.localUser?.id===T)this.localUser.updateCallAction(r),this.localUser.updatePermissions(c),this.localUser.updateBanBehavior(e),this.localUser.updateTracks(t||[],!0),b.length===1&&(this.localUser.isOwner=!0);else{const i=this.createRemoteUser(T);i.updateCallAction(r),i.updatePermissions(c),i.updateBanBehavior(e),i.updateTracks(t||[],!0)}}};clearUsers=()=>{this.localUser.clear();const b=[...this.remoteUsers.keys()];for(const u of b)this.remoteUsers.get(u)?.clear(),this.remoteUsers.delete(u)};createRemoteUserP2P=b=>{const u=this.getRemoteUserContent(b);if(!u)throw new Error("The remote user to be established does not exist.");const T=new RemoteUserP2P({config:this.config,remoteUserId:u.id});return T.on.setSendTracksEnabled=r=>{this.syncRemoteUserP2PSenderStreamTrack(r)},T.on.close=()=>{for(const r of mediaType_keys)u.tracksAnalysis.p2p.sends[r].clear(),u.tracksAnalysis.p2p.recvs[r].clear()},u.p2p=T,T};syncRemoteUserP2PSenderStreamTrack=async b=>{const u=this.remoteUsers.values();for(const T of u)for(const r of b){if(!T.p2p||!T.p2p.hasSender(r))continue;if(T.p2p.activeSend[r]){const e=this.localUser.getStream(r);if(!e)continue;const[t]=e.getTracks();T.p2p.replaceSenderTrack(r,t)}else{const e=this.localMedias.getPhoneyStreamTrack(r);T.p2p.replaceSenderTrack(r,e)}}}}var S=Object.defineProperty,v$1=m=>{throw TypeError(m)},O=(m,b,u)=>b in m?S(m,b,{enumerable:!0,configurable:!0,writable:!0,value:u}):m[b]=u,f=(m,b,u)=>O(m,typeof b!="symbol"?b+"":b,u),Y=(m,b,u)=>b.has(m)||v$1("Cannot "+u),k=(m,b,u)=>(Y(m,b,"read from private field"),b.get(m)),B=(m,b,u)=>b.has(m)?v$1("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(m):b.set(m,u);const J=(m=0,b=1)=>{const u=Math.max(0,m),T=Math.max(1,b),r=Math.random()*(T-u+1)+u;return parseInt(`${r}`,10)},A=(m=16,b=16)=>{const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),T=Math.min(u.length,b),r=Date.now().toString(T),c=r.split(""),e=Math.max(4,m-r.length);for(let t=0;t<e;t++){const i=J(0,T-1),_=u[i];c.push(_)}return c.join("").toUpperCase()},w=(m,b)=>{try{let u=Number(m);if(isNaN(u)){const T=new Date(`${m}`);if(`${T}`=="Invalid Date")return 0;u=T.getTime()}if(b!==void 0){const T=new Date().getTimezoneOffset();u+=(T+b)*60*1e3}return u}catch(u){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:m,_offset:b,error:u}),0}},E={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},y$1=m=>w(m),D=(m,b="YYYY-MM-DD hh:mm:ss",u={})=>{const T={empty_str:"-",...u},{empty_str:r,offset:c}=T,e=w(m,c);if(Number(m)!==0&&e===0)return r;const t=new Date(e),i=`${t.getFullYear()}`,_=`${t.getMonth()+1}`,x=`${["1","2","3"].includes(_)?1:["4","5","6"].includes(_)?2:["7","8","9"].includes(_)?3:4}`,C=`${t.getDate()}`,F=`${t.getDay()===0?7:t.getDay()}`,j=`${t.getHours()}`,Z=`${t.getMinutes()}`,ee=`${t.getSeconds()}`,re=`${Math.ceil((e-y$1(`${i}/01/01 00:00:00`)+1)/864e5)}`,K=`${Math.ceil(((e-y$1(`${i}/01/01 00:00:00`))/864e5-Number(F))/7)+1}`,se=[{k:"Y+",v:i},{k:"M+",v:_},{k:"Q+",v:x},{k:"D+",v:C},{k:"W+",v:F},{k:"h+",v:j},{k:"m+",v:Z},{k:"s+",v:ee},{k:"d+",v:re},{k:"w+",v:K}];let fe;for(let{k:G,v:ne}of se)if(fe=new RegExp(`(${G})`).exec(b),fe){const ae=fe[1];let oe=ne.padStart(ae.length,"0");ae.includes("W")&&(oe=E[oe.slice(0,2)]),b=b.replace(ae,oe)}return b};var h$1;class W{constructor(b=1e3,u=!1){f(this,"_debug",!1),f(this,"_queue",[]),f(this,"_interval",1e3),f(this,"_now",Date.now()),f(this,"removeQueueItem",(T=[])=>{for(const r of T){const c=this._queue.findIndex(e=>e.key===r);c!==-1&&(this._queue.splice(c,1),this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:移除事件",r))}}),f(this,"addQueueItem",T=>{const{key:r=A(),execution_time:c=this._now,interval:e=1e4,func:t=()=>{}}=T;this.removeQueueItem([r]);const i=c+Number(e);let _=this._queue.findIndex(C=>i>=C.execution_time);_=_===-1?this._queue.length:_;const x={key:r,execution_time:i,interval:e,func:t};return this._queue.splice(_,0,x),this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:插入事件",r,`执行时间: ${D(i)}`,`队列位置: ${_}`),r}),B(this,h$1,()=>{this._now=Date.now();const T=this._queue.length;for(let r=T;r>0;r--){const c=this._queue[this._queue.length-1],{key:e,interval:t=0,execution_time:i=0,func:_}=c,x=Math.round((i-this._now)/1e3);if(!c){this._debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:","当前 无 任务");break}if(this._debug){const C=Array.from(this._queue,Z=>Z.execution_time),F=Array.from(this._queue,Z=>Z.execution_time).sort((Z,ee)=>ee-Z),j=Array.from(this._queue,Z=>Z.key);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:队列keys",JSON.stringify(j)),JSON.stringify(C)!==JSON.stringify(F)&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->Breathe:时间线${C.length}`,"异常",JSON.stringify(C)),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->Breathe:","当前 有 任务",`最近任务 ${D(i)} 剩余${x}s`,`任务详情:${JSON.stringify(c)}`)}if(x>0)break;if(_(),t===0)return this.removeQueueItem([e]);this.addQueueItem(c)}}),f(this,"startQueue",()=>setInterval(k(this,h$1),this._interval)),this._interval=b,this._debug=u}}h$1=new WeakMap;class LocalMedias{audioContext=new(window.AudioContext||window.webkitAudioContext);_onDocumentClick;_onDeviceChange;_destroyed=!1;phoneyStreamTracks={};enumerateDevices={audioinput:[],videoinput:[],audiooutput:[]};useMediaDevices={};mediaTrackConstraints={mc_audio:{autoGainControl:!0,noiseSuppression:!0,echoCancellation:!0,sampleRate:48e3,channelCount:2},mc_video:{},ss_video:{},ss_audio:{}};localStreamTracks={};on={};constructor(){this._onDocumentClick=()=>{this.audioContext&&this.audioContext.state==="suspended"&&this.audioContext.resume()},document.addEventListener("click",this._onDocumentClick);const b=gt(this.audioContext),u=wt({width:32,height:32,opacity:0,fps:20,text:""});{const[T]=b.getAudioTracks();this.phoneyStreamTracks.mc_audio=T}{const[T]=u.getVideoTracks();this.phoneyStreamTracks.mc_video=T}{const[T]=b.clone().getAudioTracks();this.phoneyStreamTracks.ss_audio=T}{const[T]=u.clone().getVideoTracks();this.phoneyStreamTracks.ss_video=T}navigator.mediaDevices&&(this._onDeviceChange=()=>{this._getAllEnumerateDevices(),this.on.devicechange&&this.on.devicechange()},navigator.mediaDevices.ondevicechange=this._onDeviceChange),this._getAllEnumerateDevices()}getPhoneyStreamTrack=b=>this.phoneyStreamTracks[b];initLocalStreamTrack=async b=>{switch(b){case"mc_audio":{const u=this._getSafetyMediaDeviceKind("audioinput"),T=this.mediaTrackConstraints.mc_audio,r=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:u},...T},video:!1});this.stopLocalStreamTrack("mc_audio");const[c]=r.getAudioTracks();this.localStreamTracks.mc_audio=c}break;case"mc_video":{const u=this._getSafetyMediaDeviceKind("videoinput"),T=this.mediaTrackConstraints.mc_video,r=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:{exact:u},...T}});this.stopLocalStreamTrack("mc_video");const[c]=r.getVideoTracks();this.localStreamTracks.mc_video=c}break;case"mc":{const u=this._getSafetyMediaDeviceKind("audioinput"),T=this._getSafetyMediaDeviceKind("videoinput"),r=this.mediaTrackConstraints.mc_audio,c=this.mediaTrackConstraints.mc_video,e=await navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:u},...r},video:{deviceId:{exact:T},...c}});this.stopLocalStreamTrack("mc_audio"),this.stopLocalStreamTrack("mc_video");{const[t]=e.getAudioTracks();this.localStreamTracks.mc_audio=t}{const[t]=e.getVideoTracks();this.localStreamTracks.mc_video=t}}break;case"ss_audio":{const u=this.mediaTrackConstraints.ss_audio,T=await navigator.mediaDevices.getDisplayMedia({audio:{...u},video:!0});this.stopLocalStreamTrack("ss_audio");const[r]=T.getAudioTracks();this.localStreamTracks.ss_audio=r;{const[c]=T.getVideoTracks();c.stop()}}break;case"ss_video":{const u=this.mediaTrackConstraints.ss_video,T=await navigator.mediaDevices.getDisplayMedia({audio:!1,video:{...u}});this.stopLocalStreamTrack("ss_video");const[r]=T.getVideoTracks();this.localStreamTracks.ss_video=r}break;case"ss":{const u=this.mediaTrackConstraints.ss_audio,T=this.mediaTrackConstraints.ss_video;let r={audio:{...u},video:{...T}};const c=await navigator.mediaDevices.getDisplayMedia(r);this.stopLocalStreamTrack("ss_audio"),this.stopLocalStreamTrack("ss_video");{const[e]=c.getAudioTracks();this.localStreamTracks.ss_audio=e}{const[e]=c.getVideoTracks();this.localStreamTracks.ss_video=e}}break}};getLocalStreamTrack=b=>this.localStreamTracks[b];checkLocalStreamTracks=b=>{const u=[],T=[];for(const r of b)this.localStreamTracks[r]?T.push(r):u.push(r);return{valid_mediaTypes:T,invalid_mediaTypes:u}};stopLocalStreamTrack=b=>{this.localStreamTracks[b]?.stop(),this.localStreamTracks[b]=void 0};isOpenMediaDevice=b=>!!this.localStreamTracks[b];setMediaTrackConstraints=async(b,u)=>{const T=this.mediaTrackConstraints[b];this.mediaTrackConstraints[b]={...T,...u}};getMediaDeviceKind=b=>this.useMediaDevices[b];setMediaDeviceKind=async(b,u)=>{this.useMediaDevices[b]=u};changeAudiooutput=async()=>{try{const b=this.useMediaDevices.audiooutput||"";await this.audioContext.setSinkId(b)}catch(b){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",b)}};getMediaDevicesErrInfo=async()=>{const b={mc_audio:"",mc_video:""};try{const u=await navigator.mediaDevices.enumerateDevices();u.find(r=>r.kind==="audioinput")||(b.mc_audio="audioinput is not available."),u.find(r=>r.kind==="videoinput")||(b.mc_video="videoinput is not available.")}catch(u){b.mc_audio=u.message||u,b.mc_video=u.message||u}return b};getEnumerateDevices=async b=>(await this._getAllEnumerateDevices(),this.enumerateDevices[b]);getEnumerateAudioinputDevices=()=>this.getEnumerateDevices("audioinput");getEnumerateAudioOutputDevices=()=>this.getEnumerateDevices("audiooutput");getEnumerateVideoinputDevices=()=>this.getEnumerateDevices("videoinput");_getAllEnumerateDevices=async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return;const b=navigator.language;await navigator.mediaDevices.enumerateDevices().then(u=>{const T={audioinput:[],videoinput:[],audiooutput:[]},r=[];for(const c of u){const{kind:e,label:t,deviceId:i}=c;i!=="communications"&&(i==="default"?T[e].push({kind:e,label:t,deviceId:i}):r.push({kind:e,label:t,deviceId:i}))}T.audioinput.length===0&&T.audioinput.push({kind:"audioinput",deviceId:"default-auto",label:b==="zh-CN"?"默认值-自动":"Default-Auto"}),T.videoinput.length===0&&T.videoinput.push({kind:"videoinput",deviceId:"default-auto",label:b==="zh-CN"?"默认值-自动":"Default-Auto"}),T.audiooutput.length===0&&T.audiooutput.push({kind:"audiooutput",deviceId:"default-auto",label:b==="zh-CN"?"默认值-自动":"Default-Auto"});for(const c of r){const{kind:e,label:t,deviceId:i}=c;T[e].push({kind:e,label:t,deviceId:i})}this.enumerateDevices=T}).catch(function(u){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getAllEnumerateDevices is err",u)})};_getSafetyMediaDeviceKind=b=>{let u=this.useMediaDevices[b];return u==="default-auto"&&(u=void 0),u};destroy=async()=>{if(!this._destroyed){this._destroyed=!0,this._onDocumentClick&&(document.removeEventListener("click",this._onDocumentClick),this._onDocumentClick=void 0),navigator.mediaDevices&&this._onDeviceChange&&navigator.mediaDevices.ondevicechange===this._onDeviceChange&&(navigator.mediaDevices.ondevicechange=null),this._onDeviceChange=void 0;for(const b of Object.keys(this.localStreamTracks))this.stopLocalStreamTrack(b);this.phoneyStreamTracks?.mc_audio&&this.phoneyStreamTracks.mc_audio.stop(),this.phoneyStreamTracks?.mc_video&&this.phoneyStreamTracks.mc_video.stop(),this.phoneyStreamTracks?.ss_audio&&this.phoneyStreamTracks.ss_audio.stop(),this.phoneyStreamTracks?.ss_video&&this.phoneyStreamTracks.ss_video.stop(),this.phoneyStreamTracks=void 0;try{this.audioContext&&this.audioContext.state!=="closed"&&await this.audioContext.close()}catch(b){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: LocalMedias.audioContext.close is error.",b)}this.audioContext=void 0}}}class Peer{config;users;prResolves=new PrResolves;pc=new RTCPeerConnection;transceiverMap=new Map;transceiverTrackMap=new Map;iceConnectionTimer=0;simulcast="f";on={};waitings={peerConnected:async()=>this.prResolves.add("peerConnected",()=>this.pc.connectionState==="connected")};constructor({config:b,users:u}){this.config=b,this.users=u}setRTCRtpSenderParameters=async(b,u=[])=>{try{for(const T of u){const r=this.transceiverMap.get(T);if(!r)continue;const{sender:c}=r,e=c.getParameters();await c.setParameters({...e,...b})}}catch(T){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",T)}};init=async()=>{this.close(),this.pc=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.pc.addTransceiver("audio",{direction:"sendonly"}),this.pc.addTransceiver("video",{direction:"sendonly"});const b=await this.pc.createOffer();await this.pc.setLocalDescription(b),this.pc.onconnectionstatechange=u=>{const T=u.target.connectionState;switch(T){case"connected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${T}`),clearTimeout(this.iceConnectionTimer),this.prResolves.emit("peerConnected");break;case"disconnected":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${T}`),this.iceConnectionTimer=window.setTimeout(this.close,1e3*15);break;case"failed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${T}`);break;case"closed":this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${T}`);break;default:this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${T}`);break}this.on.state&&this.on.state(T)}};close=()=>{clearTimeout(this.iceConnectionTimer),this.transceiverMap=new Map,this.transceiverTrackMap=new Map,this.pc.close()};addSenders=async b=>{const u={direction:"sendonly"},T=[];for(const r of b){if(this.transceiverMap.get(r))continue;T.push(r);const e=this.users.localUser.getStream(r),[t]=e.getTracks(),i=this.pc.addTransceiver(t,u);["mc_video","ss_video"].includes(r)&&i.setCodecPreferences(this.config.codecPreferences.video),this.transceiverMap.set(r,i)}if(T.length!==0){const r=await this.pc.createOffer();if(this.config.debug){const c=libExports$1.parse(r.sdp),e=pt(c.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:e,sdpJson:c,description:r})}await this.pc.setLocalDescription(r)}for(const r of T){const c=this.transceiverMap.get(r);if(!c)continue;const{mid:e,sender:t}=c,{track:i}=t;if(!i)continue;const _=mediaType_keys.findIndex(F=>F===r),x=`WEB-${_}-${bt()}`,C={type:_,mediaType:r,trackName:x,location:"local",mid:e,origin:"local",enabled:!0};this.transceiverTrackMap.set(r,C)}return T};syncSenderStreamTrack=async b=>{for(const u of b){if(!this.hasSender(u))continue;const T=this.users.localUser.getStream(u),[r]=T.getTracks();await this.replaceSenderTrack(u,r)}};stopSenders=b=>{for(const u of b){const T=this.transceiverMap.get(u);T&&(T.stop(),this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: stopSenders: ${T.mid} is stop.`,T),this.transceiverMap.delete(u),this.transceiverTrackMap.delete(u))}};hasSender=b=>this.transceiverMap.has(b);replaceSenderTrack=async(b,u)=>{const T=this.transceiverMap.get(b);if(!T)throw new Error(`ReplaceTrack is error. no have ${b} transceiver.`);const{sender:r}=T;await r.replaceTrack(u)};getSenderUserTracks=(b=[])=>{const u=[];for(const T of b){const r=this.transceiverTrackMap.get(T);r&&u.push(r)}return u};getTransceiver=b=>this.pc.getTransceivers().find(r=>r.mid===b);getSenderTrack=b=>this.transceiverMap.get(b)?.sender.track;getRecvierTrack=b=>this.pc.getTransceivers().find(r=>r.mid===b)?.receiver.track;stopReceivers=b=>{if(b.length===0)return;const u=this.pc.getTransceivers();for(const T of u){const{mid:r}=T;r&&b.includes(r)&&(T.receiver.track.stop(),T.stop(),this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: stopReceivers: ${r} is stop.`,T))}};createOffer=async()=>{const b=await this.pc.createOffer();if(this.config.debug){const u=libExports$1.parse(b.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:T,sdpJson:u,description:b})}await this.pc.setLocalDescription(b)};createAnswer=async()=>{const b=await this.pc.createAnswer();if(this.config.debug){const u=libExports$1.parse(b.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:T,sdpJson:u,description:b})}await this.pc.setLocalDescription(b)};getSdp=()=>this.pc.localDescription?.sdp||"";setRemoteDescription=async b=>{if(this.config.debug){const u=libExports$1.parse(b.sdp),T=pt(u.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:T,sdpJson:u,description:b})}return await this.pc.setRemoteDescription(b),b}}const enum_notifyName={onNetQuality:"网络质量回调",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onTrackInactive:"通知轨道失效",onAttemptP2PEx:"建立P2P连接",onOffer:"收到P2P-offer",onAnswer:"收到P2P-answer",onCandidate:"收到P2P候选信息-candidate",onDisconnectedP2P:"断开P2P",onUpdatePermissions:"更新推流权限通知",onBeforeTokenExpire:"Token即将过期",onTokenExpired:"Token已过期",onDestroyRoom:"销毁房间",onUpdateBehavior:"行为允许权限变更",onCDNPlayUrlAdd:"cdn播放地址变化",onRoomUserSpeech:"用户讲话"},notifyName_options=Yt(enum_notifyName),notifyName_keys=Object.keys(enum_notifyName),notifyName_vals=Object.values(enum_notifyName);class CallsWebSocketEvent{eventName;prws;message;needRetry=!0;_resolve=b=>{};_reject=b=>{};sendBefore;sendAfter;options={timeout:30*1e3,onBack:!0};timer=0;constructor(b,u,T={}){this.prws=u,T.timeout!==void 0&&T.timeout<=0&&(T.timeout=60*1e3),this.eventName=b,this.options={...this.options,...T}}resolve=b=>{if(this.options.onBack&&(b.sn!==this.message?.sn&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: Received a timeout response. ${this.message?.sn} !== ${b.sn}`,{current:this.message,response:b}),this.message&&this.message.time)){const u=b.time-this.message.time;u>=10*1e3&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: This request response is too long. ${St(u)}`,{current:this.message,response:b})}this.needRetry=!1,clearTimeout(this.timer),this._resolve(b)};reject=b=>{this.needRetry=!1,clearTimeout(this.timer),this._reject(b)};retry=()=>{if(!this.message)throw new Error(`[${this.eventName}]: Send needs to be called first.`);this.message.time=Date.now(),this.sendMsg()};send=b=>new Promise(async(u,T)=>{this._resolve=u,this._reject=T;let{data:r,compress:c=!1,version:e=3,sn:t}=b;const i=this.eventName,_=Date.now();t||(t=Number(bt(16,10)));const x=this.options.timeout,C={event:i,data:r,sn:t,time:_,valid:x,compress:c,version:e};this.message=sendMessageFormat(C),this.sendMsg()});sendMsg=()=>{if(this.prws.ws?.readyState!==1)return;if(!this.message||!this.message.sn)return this.reject("Message is undefined or Message.sn is undefined.");this.sendBefore&&this.sendBefore(this.message);const b=com.quick.voice.proto.CommonReq.encode(this.message).finish();if(this.prws.send(b),this.sendAfter&&this.sendAfter(this.message),this.options.onBack===!0)this._createTimer();else{const{event:u,sn:T}=this.message;this.needRetry=!1,this._resolve({event:u,sn:T,code:200,desc:"",data:{}})}};_createTimer=()=>{this.timer=window.setTimeout(()=>{const b=new Error(`[${this.eventName}]: Event is timeout.`);b.name="timeout",this._reject(b)},this.options.timeout)};destroy=()=>{clearTimeout(this.timer);const b=new Error(`[${this.eventName}]: Event is destroy.`);b.name="destroy",this._reject(b)}}class PrWebSocket{binaryType="blob";debug=!1;url="";activeTimeStamp=0;reconnectCount=0;ws;on={};constructor(){}connect=b=>{this.url=b,this.debug&&console.log("------->pr-ws: connecting.",{url:this.url}),this.reconnectCount=0,this._open()};reconnect=()=>{this.debug&&console.log("------->pr-ws: reconnecting.",{url:this.url}),this.reconnectCount+=1,this._open()};send=b=>{if(!this.ws||this.ws.readyState!==1)throw new Error("Ws is not ready.");this.ws.send(b)};close=(b=1e3,u="Correctly close.")=>{this.ws&&(this.ws.onmessage=()=>{},this.ws.onopen=()=>{},this.ws.onerror=()=>{},this.ws.onclose=()=>{},this.ws?.readyState===1&&this.ws?.close(b,u),this.ws=void 0,this.debug&&console.log("------->pr-ws: closed.",{url:this.url}))};_open=()=>{this.close();const b=new Date().getTime();this.ws=new WebSocket(this.url),this.ws.binaryType=this.binaryType,this.ws.onmessage=u=>{this.activeTimeStamp=new Date().getTime(),this.on.message&&this.on.message(u.data)},this.ws.onopen=()=>{const u=new Date().getTime();this.activeTimeStamp=u,this.reconnectCount=0;const T=u-b;this.on.open&&this.on.open(T)},this.ws.onerror=u=>{this.on.error&&this.on.error(u)},this.ws.onclose=u=>{this.on.close&&this.on.close(u)}}}const reqIgnoreEvents=[];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),reqIgnoreEvents.push("updateCall"),reqIgnoreEvents.push("reportNetwork"),reqIgnoreEvents.push("ackMsg");const resIgnoreEvents=[];resIgnoreEvents.push("heartbeat"),resIgnoreEvents.push("heartbeatEx"),resIgnoreEvents.push("networkQualityChange"),resIgnoreEvents.push("pubNotify"),resIgnoreEvents.push("updateCall"),resIgnoreEvents.push("reportNetwork"),resIgnoreEvents.push("offer"),resIgnoreEvents.push("candidate"),resIgnoreEvents.push("answer"),resIgnoreEvents.push("reportP2PConnectEx"),resIgnoreEvents.push("onRoomUserSpeech"),resIgnoreEvents.push("onNetQuality");class CallsWebSocket{config;timeout=30*1e3;prws=new PrWebSocket;events=new Map;on={};constructor({config:b}){this.config=b,this.prws.binaryType="arraybuffer",this.prws.on.message=u=>{const T=new Uint8Array(u),r=com.quick.voice.proto.CommonRsp.decode(T),c=onMessageFormat(r),{event:e}=c;if(this._updataLogs("res",c),this.config.debug&&!resIgnoreEvents.includes(e)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",c),notifyName_keys.includes(e)){const _=this.on[e],x=L(c,["code","data","desc"]);_&&_(x);return}const i=this.events.get(e);if(i){const _=L(c,["code","data","desc","sn"]);i.resolve(_)}},this.prws.on.close=u=>{this.on.close&&this.on.close(u)},this.prws.on.open=async u=>{this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${u}ms`),await this.retryEvents(),this.on.open&&this.on.open(u)}}needRestoreRoom=()=>{if(this.prws?.ws?.readyState!==1)return!1;const u=new Date().getTime()-this.prws.activeTimeStamp,T=u>60*1e3;return T===!0&&this.config.debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;","------->quickvo: NeedRestoreRoom.",{offsetTime:u}),T};connect=async b=>{this.prws.connect(b)};close=()=>{this.prws.ws?.readyState!==3&&(this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is closed."),this.prws.close(),this.clearEvents())};createRequest=(b,u={})=>{const T=new CallsWebSocketEvent(b,this.prws,u);return T.sendBefore=r=>{this._updataLogs("req",r),this.config.debug&&!reqIgnoreEvents.includes(r.event)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",r)},T.sendAfter=()=>{T.needRetry===!1&&this.events.delete(b)},this.events.set(b,T),T};clearEvents=()=>{const b=this.events.values();for(const u of b)u.destroy();this.events=new Map};retryEvents=async()=>{const b=this.events.values();for(const u of b)u.needRetry===!0&&u.retry()};_updataLogs=(b,u={})=>{try{const{time:T,event:r,data:c={},data_original:e={},data_remote:t,...i}=u,_=p$1(T,"YYYY-MM-DD hh:mm:ss",{offset:480});let x={};const C=(G={})=>{const ne=JSON.parse(JSON.stringify(G)),ae=Object.keys(ne);for(const oe of ae)(oe.includes("sdp")||oe.includes("Sdp"))&&(ne[oe]="");return ne};let F="res ↓";switch(b){case"res":F="res ↓",x=C(c);break;case"req":F="req ↑",x=C(e);break}let j="#quickvo.logs";(reqIgnoreEvents.includes(r)||resIgnoreEvents.includes(r))&&(j="#quickvo.ignoreEvents");const Z={"#action":F,timeStr:_,event:r,data:x,time:T,...i},ee=localStorage.getItem(j)||JSON.stringify([]),re=JSON.parse(ee);let K=b==="req"&&(r==="heartbeat"||r==="heartbeatEx"),se=b==="res"&&(r==="heartbeat"||r==="heartbeatEx");const fe=[Z];for(const G of re){const{event:ne}=G;if(ne==="heartbeat"||ne==="heartbeatEx"){if(G["#action"].includes("req")&&K||(K=!0,G["#action"].includes("res")&&se))continue;se=!0}if(fe.length===200)break;fe.push(G)}localStorage.setItem(j,JSON.stringify(fe))}catch(T){this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",T)}}}var lib={},ebml={},EBML={},hasRequiredEBML;function requireEBML(){return hasRequiredEBML||(hasRequiredEBML=1,Object.defineProperty(EBML,"__esModule",{value:!0})),EBML}var EBMLDecoder={},int64Buffer={},hasRequiredInt64Buffer;function requireInt64Buffer(){return hasRequiredInt64Buffer||(hasRequiredInt64Buffer=1,(function(m){(function(b){var u="undefined",T=u!==typeof Buffer&&Buffer,r=u!==typeof Uint8Array&&Uint8Array,c=u!==typeof ArrayBuffer&&ArrayBuffer,e=[0,0,0,0,0,0,0,0],t=Array.isArray||ae,i=4294967296,_=16777216,x;C("Uint64BE",!0,!0),C("Int64BE",!0,!1),C("Uint64LE",!1,!0),C("Int64LE",!1,!1);function C(oe,le,pe){var te=le?0:4,ue=le?4:0,he=le?0:3,me=le?1:2,be=le?2:1,Se=le?3:0,xe=le?se:G,Ce=le?fe:ne,Ae=Te.prototype,Ue="is"+oe,Ze="_"+Ue;return Ae.buffer=void 0,Ae.offset=0,Ae[Ze]=!0,Ae.toNumber=Me,Ae.toString=ze,Ae.toJSON=Me,Ae.toArray=F,T&&(Ae.toBuffer=j),r&&(Ae.toArrayBuffer=Z),Te[Ue]=ge,b[oe]=Te,Te;function Te(ke,ye,ve,_e){return this instanceof Te?je(this,ke,ye,ve,_e):new Te(ke,ye,ve,_e)}function ge(ke){return!!(ke&&ke[Ze])}function je(ke,ye,ve,_e,Oe){if(r&&c&&(ye instanceof c&&(ye=new r(ye)),_e instanceof c&&(_e=new r(_e))),!ye&&!ve&&!_e&&!x){ke.buffer=K(e,0);return}if(!ee(ye,ve)){var qe=x||Array;Oe=ve,_e=ye,ve=0,ye=x===T?T.alloc(8):new qe(8)}ke.buffer=ye,ke.offset=ve|=0,u!==typeof _e&&(typeof _e=="string"?Pe(ye,ve,_e,Oe||10):ee(_e,Oe)?re(ye,ve,_e,Oe):typeof Oe=="number"?(Le(ye,ve+te,_e),Le(ye,ve+ue,Oe)):_e>0?xe(ye,ve,_e):_e<0?Ce(ye,ve,_e):re(ye,ve,e,0))}function Pe(ke,ye,ve,_e){var Oe=0,qe=ve.length,Ne=0,Be=0;ve[0]==="-"&&Oe++;for(var He=Oe;Oe<qe;){var Je=parseInt(ve[Oe++],_e);if(!(Je>=0))break;Be=Be*_e+Je,Ne=Ne*_e+Math.floor(Be/i),Be%=i}He&&(Ne=~Ne,Be?Be=i-Be:Ne++),Le(ke,ye+te,Ne),Le(ke,ye+ue,Be)}function Me(){var ke=this.buffer,ye=this.offset,ve=De(ke,ye+te),_e=De(ke,ye+ue);return pe||(ve|=0),ve?ve*i+_e:_e}function ze(ke){var ye=this.buffer,ve=this.offset,_e=De(ye,ve+te),Oe=De(ye,ve+ue),qe="",Ne=!pe&&_e&2147483648;for(Ne&&(_e=~_e,Oe=i-Oe),ke=ke||10;;){var Be=_e%ke*i+Oe;if(_e=Math.floor(_e/ke),Oe=Math.floor(Be/ke),qe=(Be%ke).toString(ke)+qe,!_e&&!Oe)break}return Ne&&(qe="-"+qe),qe}function Le(ke,ye,ve){ke[ye+Se]=ve&255,ve=ve>>8,ke[ye+be]=ve&255,ve=ve>>8,ke[ye+me]=ve&255,ve=ve>>8,ke[ye+he]=ve&255}function De(ke,ye){return ke[ye+he]*_+(ke[ye+me]<<16)+(ke[ye+be]<<8)+ke[ye+Se]}}function F(oe){var le=this.buffer,pe=this.offset;return x=null,oe!==!1&&t(le)?le.length===8?le:le.slice(pe,pe+8):K(le,pe)}function j(oe){var le=this.buffer,pe=this.offset;return x=T,oe!==!1&&T.isBuffer(le)?le.length===8?le:le.slice(pe,pe+8):T.from(Z.call(this,oe))}function Z(oe){var le=this.buffer,pe=this.offset,te=le.buffer;if(x=r,oe!==!1&&!le.offset&&te instanceof c)return te.byteLength===8?te:te.slice(pe,pe+8);var ue=new r(8);return re(ue,0,le,pe),ue.buffer}function ee(oe,le){var pe=oe&&oe.length;return le|=0,pe&&le+8<=pe&&typeof oe[le]!="string"}function re(oe,le,pe,te){le|=0,te|=0;for(var ue=0;ue<8;ue++)oe[le++]=pe[te++]&255}function K(oe,le){return Array.prototype.slice.call(oe,le,le+8)}function se(oe,le,pe){for(var te=le+8;te>le;)oe[--te]=pe&255,pe/=256}function fe(oe,le,pe){var te=le+8;for(pe++;te>le;)oe[--te]=-pe&255^255,pe/=256}function G(oe,le,pe){for(var te=le+8;le<te;)oe[le++]=pe&255,pe/=256}function ne(oe,le,pe){var te=le+8;for(pe++;le<te;)oe[le++]=-pe&255^255,pe/=256}function ae(oe){return!!oe&&Object.prototype.toString.call(oe)=="[object Array]"}})(typeof m.nodeName!="string"?m:int64Buffer||{})})(int64Buffer)),int64Buffer}var tools={},EBMLEncoder={},ebmlID={},hasRequiredEbmlID;function requireEbmlID(){return hasRequiredEbmlID||(hasRequiredEbmlID=1,Object.defineProperty(ebmlID,"__esModule",{value:!0}),ebmlID.byEbmlID=void 0,ebmlID.byEbmlID={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,minver:1,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,minver:1,range:"1-254",description:"A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,minver:1,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,minver:1,description:"An ID corresponding to the codec, see the codec page for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)"},137:{name:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,minver:1,webm:!1,range:"not 0",description:"UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks."},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,minver:1,webm:!0,description:"Timestamp of the start of Chapter (not scaled)."},146:{name:"ChapterTimeEnd",level:4,type:"u",minver:1,webm:!1,description:"Timestamp of the end of Chapter (timestamp excluded, not scaled)."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,webm:!1,description:"Timestamp of the referenced Block."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,webm:!1,description:"The Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping"},16981:{name:"ContentCompSettings",level:6,type:"b",minver:1,webm:!1,description:"Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,minver:1,webm:!1,bytesize:16,description:"A randomly generated unique ID that all segments related to each other must use (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",minver:1,description:"Date of the origin of timestamp (value 0), i.e. production date."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Indication to know if this is the default/original language to use for the given tag. (1 bit)"},17541:{name:"TagBinary",level:4,type:"b",minver:1,webm:!1,description:"The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",minver:1,webm:!1,description:"The value of the Element."},17545:{name:"Duration",level:2,type:"f",minver:1,range:"> 0",description:"Duration of the segment (based on TimecodeScale)."},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"0-1",description:"Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)"},18016:{name:"FileMimeType",level:3,type:"s",mandatory:!0,minver:1,webm:!1,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18018:{name:"FileUsedEndTime",level:3,type:"u",divx:!0,description:"DivX font extension"},18037:{name:"FileReferral",level:3,type:"b",webm:!1,description:"A binary value that a track/codec can refer to when the attachment is needed."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)"},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption"},20532:{name:"ContentCompression",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",minver:1,webm:!1,description:"Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise."},21368:{name:"CueBlockNumber",level:4,type:"u",minver:1,default:1,range:"not 0",description:"Number of the Block in the specified Cluster."},22100:{name:"ChapterStringUID",level:4,type:"8",mandatory:!1,minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Writing application ("mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:1,webm:!1,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",minver:1,range:"not 0",description:"Bits per sample, mostly used for PCM."},25906:{name:"SignedElement",level:3,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,minver:1,webm:!1,description:"The track identification for the given Chapter Codec."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,minver:1,webm:!1,description:"Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)."},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,minver:1,webm:!1,description:"A tuple of corresponding ID used by chapter codecs to represent this segment."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,minver:1,webm:!1,description:"Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,minver:1,webm:!1,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters."},29572:{name:"SegmentFilename",level:2,type:"8",minver:1,webm:!1,description:"A filename corresponding to this segment."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"The UID of an attachment that is used by this codec."},2459272:{name:"CodecName",level:3,type:"8",minver:1,description:"A human-readable string specifying the codec."},408125543:{name:"Segment",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment."},17530:{name:"TagLanguage",level:4,type:"s",mandatory:!0,minver:1,webm:!1,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,minver:1,webm:!1,description:"The name of the Tag that is going to be stored."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contains general information about the target."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment."},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,default:0,description:"A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",minver:1,webm:!1,strong:"informational",description:'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).'},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",minver:1,webm:!1,default:50,description:"A number to indicate the logical level of the target (see TargetType)."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,minver:1,webm:!1,description:"Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,minver:1,webm:!1,description:"Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",minver:1,webm:!1,description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.'},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,minver:1,webm:!1,description:"The countries corresponding to the string, same 2 octets as in Internet domains."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,minver:1,webm:!0,default:"eng",description:"The languages corresponding to the string, in the bibliographic ISO-639-2 form."},143:{name:"ChapterTrack",level:4,type:"m",minver:1,webm:!1,description:"List of tracks on which the chapter applies. If this element is not present, all tracks apply"},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",minver:1,webm:!1,description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.'},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",minver:1,webm:!1,range:"not 0",description:"The EditionUID to play from the segment linked in ChapterSegmentUID."},28263:{name:"ChapterSegmentUID",level:4,type:"b",minver:1,webm:!1,range:">0",bytesize:16,description:"A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,minver:1,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},182:{name:"ChapterAtom",level:3,recursive:"1",type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},17885:{name:"EditionFlagOrdered",level:3,type:"u",minver:1,webm:!1,default:0,range:"0-1",description:"Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)"},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If a flag is set (1) the edition should be used as the default one. (1 bit)"},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,range:"0-1",description:"If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)"},17852:{name:"EditionUID",level:3,type:"u",minver:1,webm:!1,range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!0,description:"Contains all information about a segment edition."},272869232:{name:"Chapters",level:1,type:"m",minver:1,webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,range:"not 0",description:"Unique ID representing the file, as random as possible."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The data of the file."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,minver:1,webm:!1,description:"Filename of the attached file."},18046:{name:"FileDescription",level:3,type:"8",minver:1,webm:!1,description:"A human-friendly name for the attached file."},24999:{name:"AttachedFile",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"An attached file."},423732329:{name:"Attachments",level:1,type:"m",minver:1,webm:!1,description:"Contain attached files."},235:{name:"CueRefCodecState",level:5,type:"u",webm:!1,default:0,description:"The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry."},21343:{name:"CueRefNumber",level:5,type:"u",webm:!1,default:1,range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,webm:!1,description:"The Clusters containing the required referenced Blocks."},234:{name:"CueCodecState",level:4,type:"u",minver:2,webm:!1,default:0,description:"The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry."},178:{name:"CueDuration",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},240:{name:"CueRelativePosition",level:4,type:"u",mandatory:!1,minver:4,webm:!1,description:"The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.",position:"clusterRelative"},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,minver:1,description:"The position of the Cluster containing the required Block.",position:"segment"},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track for which a position is given."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contain positions for different tracks corresponding to the timestamp."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp according to the segment time base."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains all information relative to a seek point in the segment."},475249515:{name:"Cues",level:1,type:"m",minver:1,description:'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.'},18406:{name:"ContentSigHashAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5"},18405:{name:"ContentSigAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA"},18404:{name:"ContentSigKeyID",level:6,type:"b",minver:1,webm:!1,description:"This is the ID of the private key the data was signed with."},18403:{name:"ContentSignature",level:6,type:"b",minver:1,webm:!1,description:"A cryptographic signature of the contents."},18402:{name:"ContentEncKeyID",level:6,type:"b",minver:1,webm:!1,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18401:{name:"ContentEncAlgo",level:6,type:"u",minver:1,webm:!1,default:0,description:"The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES"},28032:{name:"ContentEncodings",level:3,type:"m",minver:1,webm:!1,description:"Settings for several content encoding mechanisms like compression or encryption."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},199:{name:"TrickMasterTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},198:{name:"TrickTrackFlag",level:3,type:"u",divx:!0,default:0,description:"DivX trick track extenstions"},193:{name:"TrickTrackSegmentUID",level:3,type:"b",divx:!0,bytesize:16,description:"DivX trick track extenstions"},192:{name:"TrickTrackUID",level:3,type:"u",divx:!0,description:"DivX trick track extenstions"},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,webm:!1,description:"The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)."},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,webm:!1,range:"not 0",description:"The trackUID number of the track representing the plane."},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,webm:!1,description:"Contains a video plane track that need to be combined to create this 3D track"},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,webm:!1,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},226:{name:"TrackOperation",level:3,type:"m",minver:3,webm:!1,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",webm:!1,description:"Table of horizontal angles for each successive channel, see appendix."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,minver:1,default:1,range:"not 0",description:"Numbers of channels in the track."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",minver:1,default:"Sampling Frequency",range:"> 0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,minver:1,default:8e3,range:"> 0",description:"Sampling frequency in Hz."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",minver:1,description:"Audio settings."},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",range:"> 0",strong:"Informational",description:"Number of frames per second. only."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",webm:!1,range:"> 0",description:"Gamma Value."},3061028:{name:"ColourSpace",cppname:"VideoColourSpace",level:4,type:"b",minver:1,webm:!1,bytesize:4,description:"Same value as in AVI (32 bits)."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:1,default:0,description:"Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",minver:1,default:0,description:"How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",minver:1,default:"PixelHeight",range:"not 0",description:"Height of the video frames to display. The default value is only valid when DisplayUnit is 0."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",minver:1,default:"PixelWidth",range:"not 0",description:"Width of the video frames to display. The default value is only valid when DisplayUnit is 0."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the right of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove on the left of the image."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the top of the image."},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",minver:1,default:0,description:"The number of video pixels to remove at the bottom of the image (for HDTV content)."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Height of the encoded video frames in pixels."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,minver:1,range:"not 0",description:"Width of the encoded video frames in pixels."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:"0",webm:!1,divx:!1,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",minver:3,webm:!0,default:0,description:"Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:0,range:"0-1",description:"Set if the video is interlaced. (1 bit)"},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",minver:1,description:"Video settings."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,multiple:!1,default:0,minver:4,webm:!0,description:"After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid."},22186:{name:"CodecDelay",level:3,type:"u",multiple:!1,default:0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,minver:2,webm:!1,default:1,range:"0-1",description:"The codec can decode potentially damaged data (1 bit)."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to download about the codec used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,webm:!1,description:"A URL to find information about the codec used."},3839639:{name:"CodecSettings",level:3,type:"8",webm:!1,description:"A string describing the encoding setting used."},25506:{name:"CodecPrivate",level:3,type:"b",minver:1,description:"Private data only known to the codec."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",minver:1,default:"eng",description:"Specifies the language of the track in the Matroska languages form."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",minver:1,description:"A human-readable track name."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The maximum value of BlockAdditions for this track."},21375:{name:"TrackOffset",level:3,type:"i",webm:!1,default:0,description:"A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track."},2306383:{name:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,minver:1,maxver:"3",webm:!1,default:1,range:"> 0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:`The period in nanoseconds (not scaled by TimcodeScale)
|
|
4
|
+
between two successive fields at the output of the decoding process (see the notes)`},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",minver:1,range:"not 0",description:"Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",minver:1,webm:!1,description:"The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,minver:1,default:1,range:"0-1",description:"Set if the track may contain blocks using lacing. (1 bit)"},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,minver:1,default:0,range:"0-1",description:"Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)"},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:1,range:"0-1",description:"Set if the track is usable. (1 bit)"},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,minver:1,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Describes a track with all elements."},374648427:{name:"Tracks",level:1,type:"m",multiple:!0,minver:1,description:"A top-level block of information with many tracks described."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,webm:!1,description:"Similar to EncryptedBlock Structure)"},202:{name:"ReferenceTimeCode",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},201:{name:"ReferenceOffset",level:4,type:"u",multiple:!1,mandatory:!0,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},200:{name:"ReferenceFrame",level:3,type:"m",multiple:!1,minver:0,webm:!1,divx:!0,description:"DivX trick track extenstions"},207:{name:"SliceDuration",level:5,type:"u",default:0,description:"The (scaled) duration to apply to the element."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",default:0,description:"The (scaled) delay to apply to the element."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",default:0,description:"The ID of the BlockAdditional element (0 is the main Block)."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",default:0,description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:1,default:0,divx:!1,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:1,divx:!1,description:"Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback."},142:{name:"Slices",level:3,type:"m",minver:1,divx:!1,description:"Contains slices description."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback."},164:{name:"CodecState",level:3,type:"b",minver:2,webm:!1,description:"The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry."},253:{name:"ReferenceVirtual",level:3,type:"i",webm:!1,description:"Relative position of the data that should be in position of the virtual block."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,minver:1,description:"Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to."},250:{name:"ReferencePriority",cppname:"FlagReferenced",level:3,type:"u",mandatory:!0,minver:1,webm:!1,default:0,description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},155:{name:"BlockDuration",level:3,type:"u",minver:1,default:"TrackDuration",description:'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.'},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,minver:1,webm:!1,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,minver:1,webm:!1,default:1,range:"not 0",description:"An ID to identify the BlockAdditional level."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,minver:1,webm:!1,description:"Contain the BlockAdditional and some parameters."},30113:{name:"BlockAdditions",level:3,type:"m",minver:1,webm:!1,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},162:{name:"BlockVirtual",level:3,type:"b",webm:!1,description:"A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)"},161:{name:"Block",level:3,type:"b",mandatory:!0,minver:1,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)"},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,minver:1,description:"Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock."},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to SimpleBlock Structure"},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",minver:1,description:"Size of the previous Cluster, in octets. Can be useful for backward playing.",position:"prevCluster"},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",minver:1,webm:!1,description:"The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.",position:"segment"},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},231:{name:"Timecode",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,minver:1,description:"Absolute timestamp of the cluster (based on TimecodeScale)."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,minver:1,description:"The lower level element containing the (monolithic) Block structure."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,minver:1,description:'Muxing application or library ("libmatroska-0.4.3").'},31657:{name:"Title",level:2,type:"8",minver:1,webm:!1,description:"General name of the segment."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},2807729:{name:"TimecodeScale",level:2,type:"u",mandatory:!0,minver:1,default:"1000000",description:"Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,minver:1,webm:!1,description:"The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,minver:1,webm:!1,description:"The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,minver:1,webm:!1,description:"Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment."},4096955:{name:"NextFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the next segment."},4110627:{name:"NextUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the next chained segment (128 bits)."},3965867:{name:"PrevFilename",level:2,type:"8",minver:1,webm:!1,description:"An escaped filename corresponding to the previous segment."},3979555:{name:"PrevUID",level:2,type:"b",minver:1,webm:!1,bytesize:16,description:"A unique ID to identify the previous chained segment (128 bits)."},29604:{name:"SegmentUID",level:2,type:"b",minver:1,webm:!1,range:"not 0",bytesize:16,description:"A randomly generated unique ID to identify the current segment between many others (128 bits)."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains miscellaneous general information and statistics on the file."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,minver:1,description:"The position of the element in the segment in octets (0 = first level 1 element).",position:"segment"},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,minver:1,description:"The binary ID corresponding to the element name.",type2:"ebmlID"},19899:{name:"Seek",cppname:"SeekPoint",level:2,type:"m",mandatory:!0,multiple:!0,minver:1,description:"Contains a single seek entry to an EBML element."},290298740:{name:"SeekHead",cppname:"SeekHeader",level:1,type:"m",multiple:!0,minver:1,description:"Contains the position of other level 1 elements."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32437:{name:"Signature",level:1,type:"b",webm:!1,description:"The signature of the data (until a new."},32421:{name:"SignaturePublicKey",level:1,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32410:{name:"SignatureHash",level:1,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32394:{name:"SignatureAlgo",level:1,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},458458727:{name:"SignatureSlot",level:-1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian",crc:!0},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:8,minver:1,description:"The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:4,minver:1,description:"The maximum length of the IDs you'll find in this file (4 or less in Matroska)."},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!0,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},21936:{name:"Colour",level:"4",type:"m",mandatory:!0,multiple:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21945:{name:"Range",level:"5",type:"u",mandatory:!0,multiple:!0,description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The transfer characteristics of the video."},21947:{name:"Primaries",level:"5",type:"u",mandatory:!0,multiple:!0,description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."}}),ebmlID}var hasRequiredEBMLEncoder;function requireEBMLEncoder(){if(hasRequiredEBMLEncoder)return EBMLEncoder;hasRequiredEBMLEncoder=1,Object.defineProperty(EBMLEncoder,"__esModule",{value:!0});var m=requireTools(),b=requireTools(),u=requireEbmlID(),T=(function(){function r(){this._schema=u.byEbmlID,this._buffers=[],this._stack=[]}return r.prototype.encode=function(c){var e=this;return m.concat(c.reduce(function(t,i){return t.concat(e.encodeChunk(i))},[])).buffer},r.prototype.encodeChunk=function(c){return c.type==="m"?c.isEnd?this.endTag(c):this.startTag(c):(c.data=b.Buffer.from(c.data),this.writeTag(c)),this.flush()},r.prototype.flush=function(){var c=this._buffers;return this._buffers=[],c},r.prototype.getSchemaInfo=function(c){for(var e=Object.keys(this._schema).map(Number),t=0;t<e.length;t++){var i=e[t];if(this._schema[i].name===c)return new b.Buffer(i.toString(16),"hex")}return null},r.prototype.writeTag=function(c){var e=c.name,t=this.getSchemaInfo(e),i=c.data;if(t==null)throw new Error("No schema entry found for "+e);var _=m.encodeTag(t,i);if(this._stack.length>0){var x=this._stack[this._stack.length-1];x.children.push({tagId:t,elm:c,children:[],data:_});return}this._buffers=this._buffers.concat(_)},r.prototype.startTag=function(c){var e=c.name,t=this.getSchemaInfo(e);if(t==null)throw new Error("No schema entry found for "+e);if(c.unknownSize){var i=m.encodeTag(t,new b.Buffer(0),c.unknownSize);this._buffers=this._buffers.concat(i);return}var _={tagId:t,elm:c,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(_),this._stack.push(_)},r.prototype.endTag=function(c){c.name;var e=this._stack.pop();if(e==null)throw new Error("EBML structure is broken");if(e.elm.name!==c.name)throw new Error("EBML structure is broken");var t=e.children.reduce(function(_,x){if(x.data===null)throw new Error("EBML structure is broken");return _.concat(x.data)},[]),i=m.concat(t);e.elm.type==="m"?e.data=m.encodeTag(e.tagId,i,e.elm.unknownSize):e.data=m.encodeTag(e.tagId,i),this._stack.length<1&&(this._buffers=this._buffers.concat(e.data))},r})();return EBMLEncoder.default=T,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=t,base64Js.toByteArray=_,base64Js.fromByteArray=F;for(var m=[],b=[],u=typeof Uint8Array<"u"?Uint8Array:Array,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,c=T.length;r<c;++r)m[r]=T[r],b[T.charCodeAt(r)]=r;b[45]=62,b[95]=63;function e(j){var Z=j.length;if(Z%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ee=j.indexOf("=");ee===-1&&(ee=Z);var re=ee===Z?0:4-ee%4;return[ee,re]}function t(j){var Z=e(j),ee=Z[0],re=Z[1];return(ee+re)*3/4-re}function i(j,Z,ee){return(Z+ee)*3/4-ee}function _(j){var Z,ee=e(j),re=ee[0],K=ee[1],se=new u(i(j,re,K)),fe=0,G=K>0?re-4:re,ne;for(ne=0;ne<G;ne+=4)Z=b[j.charCodeAt(ne)]<<18|b[j.charCodeAt(ne+1)]<<12|b[j.charCodeAt(ne+2)]<<6|b[j.charCodeAt(ne+3)],se[fe++]=Z>>16&255,se[fe++]=Z>>8&255,se[fe++]=Z&255;return K===2&&(Z=b[j.charCodeAt(ne)]<<2|b[j.charCodeAt(ne+1)]>>4,se[fe++]=Z&255),K===1&&(Z=b[j.charCodeAt(ne)]<<10|b[j.charCodeAt(ne+1)]<<4|b[j.charCodeAt(ne+2)]>>2,se[fe++]=Z>>8&255,se[fe++]=Z&255),se}function x(j){return m[j>>18&63]+m[j>>12&63]+m[j>>6&63]+m[j&63]}function C(j,Z,ee){for(var re,K=[],se=Z;se<ee;se+=3)re=(j[se]<<16&16711680)+(j[se+1]<<8&65280)+(j[se+2]&255),K.push(x(re));return K.join("")}function F(j){for(var Z,ee=j.length,re=ee%3,K=[],se=16383,fe=0,G=ee-re;fe<G;fe+=se)K.push(C(j,fe,fe+se>G?G:fe+se));return re===1?(Z=j[ee-1],K.push(m[Z>>2]+m[Z<<4&63]+"==")):re===2&&(Z=(j[ee-2]<<8)+j[ee-1],K.push(m[Z>>10]+m[Z>>4&63]+m[Z<<2&63]+"=")),K.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function(m,b,u,T,r){var c,e,t=r*8-T-1,i=(1<<t)-1,_=i>>1,x=-7,C=u?r-1:0,F=u?-1:1,j=m[b+C];for(C+=F,c=j&(1<<-x)-1,j>>=-x,x+=t;x>0;c=c*256+m[b+C],C+=F,x-=8);for(e=c&(1<<-x)-1,c>>=-x,x+=T;x>0;e=e*256+m[b+C],C+=F,x-=8);if(c===0)c=1-_;else{if(c===i)return e?NaN:(j?-1:1)*(1/0);e=e+Math.pow(2,T),c=c-_}return(j?-1:1)*e*Math.pow(2,c-T)},ieee754.write=function(m,b,u,T,r,c){var e,t,i,_=c*8-r-1,x=(1<<_)-1,C=x>>1,F=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,j=T?0:c-1,Z=T?1:-1,ee=b<0||b===0&&1/b<0?1:0;for(b=Math.abs(b),isNaN(b)||b===1/0?(t=isNaN(b)?1:0,e=x):(e=Math.floor(Math.log(b)/Math.LN2),b*(i=Math.pow(2,-e))<1&&(e--,i*=2),e+C>=1?b+=F/i:b+=F*Math.pow(2,1-C),b*i>=2&&(e++,i/=2),e+C>=x?(t=0,e=x):e+C>=1?(t=(b*i-1)*Math.pow(2,r),e=e+C):(t=b*Math.pow(2,C-1)*Math.pow(2,r),e=0));r>=8;m[u+j]=t&255,j+=Z,t/=256,r-=8);for(e=e<<r|t,_+=r;_>0;m[u+j]=e&255,j+=Z,e/=256,_-=8);m[u+j-Z]|=ee*128}),ieee754}var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,(function(m){const b=requireBase64Js(),u=requireIeee754(),T=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;m.Buffer=t,m.SlowBuffer=se,m.INSPECT_MAX_BYTES=50;const r=2147483647;m.kMaxLength=r,t.TYPED_ARRAY_SUPPORT=c(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const z=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(z,N),z.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(z){if(z>r)throw new RangeError('The value "'+z+'" is invalid for option "size"');const N=new Uint8Array(z);return Object.setPrototypeOf(N,t.prototype),N}function t(z,N,M){if(typeof z=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(z)}return i(z,N,M)}t.poolSize=8192;function i(z,N,M){if(typeof z=="string")return F(z,N);if(ArrayBuffer.isView(z))return Z(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Fe(z,ArrayBuffer)||z&&Fe(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Fe(z,SharedArrayBuffer)||z&&Fe(z.buffer,SharedArrayBuffer)))return ee(z,N,M);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const V=z.valueOf&&z.valueOf();if(V!=null&&V!==z)return t.from(V,N,M);const ie=re(z);if(ie)return ie;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return t.from(z[Symbol.toPrimitive]("string"),N,M);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}t.from=function(z,N,M){return i(z,N,M)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function _(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function x(z,N,M){return _(z),z<=0?e(z):N!==void 0?typeof M=="string"?e(z).fill(N,M):e(z).fill(N):e(z)}t.alloc=function(z,N,M){return x(z,N,M)};function C(z){return _(z),e(z<0?0:K(z)|0)}t.allocUnsafe=function(z){return C(z)},t.allocUnsafeSlow=function(z){return C(z)};function F(z,N){if((typeof N!="string"||N==="")&&(N="utf8"),!t.isEncoding(N))throw new TypeError("Unknown encoding: "+N);const M=fe(z,N)|0;let V=e(M);const ie=V.write(z,N);return ie!==M&&(V=V.slice(0,ie)),V}function j(z){const N=z.length<0?0:K(z.length)|0,M=e(N);for(let V=0;V<N;V+=1)M[V]=z[V]&255;return M}function Z(z){if(Fe(z,Uint8Array)){const N=new Uint8Array(z);return ee(N.buffer,N.byteOffset,N.byteLength)}return j(z)}function ee(z,N,M){if(N<0||z.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<N+(M||0))throw new RangeError('"length" is outside of buffer bounds');let V;return N===void 0&&M===void 0?V=new Uint8Array(z):M===void 0?V=new Uint8Array(z,N):V=new Uint8Array(z,N,M),Object.setPrototypeOf(V,t.prototype),V}function re(z){if(t.isBuffer(z)){const N=K(z.length)|0,M=e(N);return M.length===0||z.copy(M,0,0,N),M}if(z.length!==void 0)return typeof z.length!="number"||Ke(z.length)?e(0):j(z);if(z.type==="Buffer"&&Array.isArray(z.data))return j(z.data)}function K(z){if(z>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return z|0}function se(z){return+z!=z&&(z=0),t.alloc(+z)}t.isBuffer=function(N){return N!=null&&N._isBuffer===!0&&N!==t.prototype},t.compare=function(N,M){if(Fe(N,Uint8Array)&&(N=t.from(N,N.offset,N.byteLength)),Fe(M,Uint8Array)&&(M=t.from(M,M.offset,M.byteLength)),!t.isBuffer(N)||!t.isBuffer(M))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(N===M)return 0;let V=N.length,ie=M.length;for(let ce=0,de=Math.min(V,ie);ce<de;++ce)if(N[ce]!==M[ce]){V=N[ce],ie=M[ce];break}return V<ie?-1:ie<V?1:0},t.isEncoding=function(N){switch(String(N).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},t.concat=function(N,M){if(!Array.isArray(N))throw new TypeError('"list" argument must be an Array of Buffers');if(N.length===0)return t.alloc(0);let V;if(M===void 0)for(M=0,V=0;V<N.length;++V)M+=N[V].length;const ie=t.allocUnsafe(M);let ce=0;for(V=0;V<N.length;++V){let de=N[V];if(Fe(de,Uint8Array))ce+de.length>ie.length?(t.isBuffer(de)||(de=t.from(de)),de.copy(ie,ce)):Uint8Array.prototype.set.call(ie,de,ce);else if(t.isBuffer(de))de.copy(ie,ce);else throw new TypeError('"list" argument must be an Array of Buffers');ce+=de.length}return ie};function fe(z,N){if(t.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Fe(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);const M=z.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&M===0)return 0;let ie=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return M;case"utf8":case"utf-8":return He(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M*2;case"hex":return M>>>1;case"base64":return We(z).length;default:if(ie)return V?-1:He(z).length;N=(""+N).toLowerCase(),ie=!0}}t.byteLength=fe;function G(z,N,M){let V=!1;if((N===void 0||N<0)&&(N=0),N>this.length||((M===void 0||M>this.length)&&(M=this.length),M<=0)||(M>>>=0,N>>>=0,M<=N))return"";for(z||(z="utf8");;)switch(z){case"hex":return Ue(this,N,M);case"utf8":case"utf-8":return be(this,N,M);case"ascii":return Ce(this,N,M);case"latin1":case"binary":return Ae(this,N,M);case"base64":return me(this,N,M);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,N,M);default:if(V)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),V=!0}}t.prototype._isBuffer=!0;function ne(z,N,M){const V=z[N];z[N]=z[M],z[M]=V}t.prototype.swap16=function(){const N=this.length;if(N%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let M=0;M<N;M+=2)ne(this,M,M+1);return this},t.prototype.swap32=function(){const N=this.length;if(N%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let M=0;M<N;M+=4)ne(this,M,M+3),ne(this,M+1,M+2);return this},t.prototype.swap64=function(){const N=this.length;if(N%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let M=0;M<N;M+=8)ne(this,M,M+7),ne(this,M+1,M+6),ne(this,M+2,M+5),ne(this,M+3,M+4);return this},t.prototype.toString=function(){const N=this.length;return N===0?"":arguments.length===0?be(this,0,N):G.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(N){if(!t.isBuffer(N))throw new TypeError("Argument must be a Buffer");return this===N?!0:t.compare(this,N)===0},t.prototype.inspect=function(){let N="";const M=m.INSPECT_MAX_BYTES;return N=this.toString("hex",0,M).replace(/(.{2})/g,"$1 ").trim(),this.length>M&&(N+=" ... "),"<Buffer "+N+">"},T&&(t.prototype[T]=t.prototype.inspect),t.prototype.compare=function(N,M,V,ie,ce){if(Fe(N,Uint8Array)&&(N=t.from(N,N.offset,N.byteLength)),!t.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if(M===void 0&&(M=0),V===void 0&&(V=N?N.length:0),ie===void 0&&(ie=0),ce===void 0&&(ce=this.length),M<0||V>N.length||ie<0||ce>this.length)throw new RangeError("out of range index");if(ie>=ce&&M>=V)return 0;if(ie>=ce)return-1;if(M>=V)return 1;if(M>>>=0,V>>>=0,ie>>>=0,ce>>>=0,this===N)return 0;let de=ce-ie,we=V-M;const Ee=Math.min(de,we),Re=this.slice(ie,ce),$e=N.slice(M,V);for(let Ie=0;Ie<Ee;++Ie)if(Re[Ie]!==$e[Ie]){de=Re[Ie],we=$e[Ie];break}return de<we?-1:we<de?1:0};function ae(z,N,M,V,ie){if(z.length===0)return-1;if(typeof M=="string"?(V=M,M=0):M>2147483647?M=2147483647:M<-2147483648&&(M=-2147483648),M=+M,Ke(M)&&(M=ie?0:z.length-1),M<0&&(M=z.length+M),M>=z.length){if(ie)return-1;M=z.length-1}else if(M<0)if(ie)M=0;else return-1;if(typeof N=="string"&&(N=t.from(N,V)),t.isBuffer(N))return N.length===0?-1:oe(z,N,M,V,ie);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?ie?Uint8Array.prototype.indexOf.call(z,N,M):Uint8Array.prototype.lastIndexOf.call(z,N,M):oe(z,[N],M,V,ie);throw new TypeError("val must be string, number or Buffer")}function oe(z,N,M,V,ie){let ce=1,de=z.length,we=N.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(z.length<2||N.length<2)return-1;ce=2,de/=2,we/=2,M/=2}function Ee($e,Ie){return ce===1?$e[Ie]:$e.readUInt16BE(Ie*ce)}let Re;if(ie){let $e=-1;for(Re=M;Re<de;Re++)if(Ee(z,Re)===Ee(N,$e===-1?0:Re-$e)){if($e===-1&&($e=Re),Re-$e+1===we)return $e*ce}else $e!==-1&&(Re-=Re-$e),$e=-1}else for(M+we>de&&(M=de-we),Re=M;Re>=0;Re--){let $e=!0;for(let Ie=0;Ie<we;Ie++)if(Ee(z,Re+Ie)!==Ee(N,Ie)){$e=!1;break}if($e)return Re}return-1}t.prototype.includes=function(N,M,V){return this.indexOf(N,M,V)!==-1},t.prototype.indexOf=function(N,M,V){return ae(this,N,M,V,!0)},t.prototype.lastIndexOf=function(N,M,V){return ae(this,N,M,V,!1)};function le(z,N,M,V){M=Number(M)||0;const ie=z.length-M;V?(V=Number(V),V>ie&&(V=ie)):V=ie;const ce=N.length;V>ce/2&&(V=ce/2);let de;for(de=0;de<V;++de){const we=parseInt(N.substr(de*2,2),16);if(Ke(we))return de;z[M+de]=we}return de}function pe(z,N,M,V){return Ge(He(N,z.length-M),z,M,V)}function te(z,N,M,V){return Ge(Je(N),z,M,V)}function ue(z,N,M,V){return Ge(We(N),z,M,V)}function he(z,N,M,V){return Ge(Qe(N,z.length-M),z,M,V)}t.prototype.write=function(N,M,V,ie){if(M===void 0)ie="utf8",V=this.length,M=0;else if(V===void 0&&typeof M=="string")ie=M,V=this.length,M=0;else if(isFinite(M))M=M>>>0,isFinite(V)?(V=V>>>0,ie===void 0&&(ie="utf8")):(ie=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ce=this.length-M;if((V===void 0||V>ce)&&(V=ce),N.length>0&&(V<0||M<0)||M>this.length)throw new RangeError("Attempt to write outside buffer bounds");ie||(ie="utf8");let de=!1;for(;;)switch(ie){case"hex":return le(this,N,M,V);case"utf8":case"utf-8":return pe(this,N,M,V);case"ascii":case"latin1":case"binary":return te(this,N,M,V);case"base64":return ue(this,N,M,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return he(this,N,M,V);default:if(de)throw new TypeError("Unknown encoding: "+ie);ie=(""+ie).toLowerCase(),de=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(z,N,M){return N===0&&M===z.length?b.fromByteArray(z):b.fromByteArray(z.slice(N,M))}function be(z,N,M){M=Math.min(z.length,M);const V=[];let ie=N;for(;ie<M;){const ce=z[ie];let de=null,we=ce>239?4:ce>223?3:ce>191?2:1;if(ie+we<=M){let Ee,Re,$e,Ie;switch(we){case 1:ce<128&&(de=ce);break;case 2:Ee=z[ie+1],(Ee&192)===128&&(Ie=(ce&31)<<6|Ee&63,Ie>127&&(de=Ie));break;case 3:Ee=z[ie+1],Re=z[ie+2],(Ee&192)===128&&(Re&192)===128&&(Ie=(ce&15)<<12|(Ee&63)<<6|Re&63,Ie>2047&&(Ie<55296||Ie>57343)&&(de=Ie));break;case 4:Ee=z[ie+1],Re=z[ie+2],$e=z[ie+3],(Ee&192)===128&&(Re&192)===128&&($e&192)===128&&(Ie=(ce&15)<<18|(Ee&63)<<12|(Re&63)<<6|$e&63,Ie>65535&&Ie<1114112&&(de=Ie))}}de===null?(de=65533,we=1):de>65535&&(de-=65536,V.push(de>>>10&1023|55296),de=56320|de&1023),V.push(de),ie+=we}return xe(V)}const Se=4096;function xe(z){const N=z.length;if(N<=Se)return String.fromCharCode.apply(String,z);let M="",V=0;for(;V<N;)M+=String.fromCharCode.apply(String,z.slice(V,V+=Se));return M}function Ce(z,N,M){let V="";M=Math.min(z.length,M);for(let ie=N;ie<M;++ie)V+=String.fromCharCode(z[ie]&127);return V}function Ae(z,N,M){let V="";M=Math.min(z.length,M);for(let ie=N;ie<M;++ie)V+=String.fromCharCode(z[ie]);return V}function Ue(z,N,M){const V=z.length;(!N||N<0)&&(N=0),(!M||M<0||M>V)&&(M=V);let ie="";for(let ce=N;ce<M;++ce)ie+=Ye[z[ce]];return ie}function Ze(z,N,M){const V=z.slice(N,M);let ie="";for(let ce=0;ce<V.length-1;ce+=2)ie+=String.fromCharCode(V[ce]+V[ce+1]*256);return ie}t.prototype.slice=function(N,M){const V=this.length;N=~~N,M=M===void 0?V:~~M,N<0?(N+=V,N<0&&(N=0)):N>V&&(N=V),M<0?(M+=V,M<0&&(M=0)):M>V&&(M=V),M<N&&(M=N);const ie=this.subarray(N,M);return Object.setPrototypeOf(ie,t.prototype),ie};function Te(z,N,M){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+N>M)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=this[N],ce=1,de=0;for(;++de<M&&(ce*=256);)ie+=this[N+de]*ce;return ie},t.prototype.readUintBE=t.prototype.readUIntBE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=this[N+--M],ce=1;for(;M>0&&(ce*=256);)ie+=this[N+--M]*ce;return ie},t.prototype.readUint8=t.prototype.readUInt8=function(N,M){return N=N>>>0,M||Te(N,1,this.length),this[N]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(N,M){return N=N>>>0,M||Te(N,2,this.length),this[N]|this[N+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(N,M){return N=N>>>0,M||Te(N,2,this.length),this[N]<<8|this[N+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+this[N+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),this[N]*16777216+(this[N+1]<<16|this[N+2]<<8|this[N+3])},t.prototype.readBigUInt64LE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=M+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24,ce=this[++N]+this[++N]*2**8+this[++N]*2**16+V*2**24;return BigInt(ie)+(BigInt(ce)<<BigInt(32))}),t.prototype.readBigUInt64BE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=M*2**24+this[++N]*2**16+this[++N]*2**8+this[++N],ce=this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+V;return(BigInt(ie)<<BigInt(32))+BigInt(ce)}),t.prototype.readIntLE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=this[N],ce=1,de=0;for(;++de<M&&(ce*=256);)ie+=this[N+de]*ce;return ce*=128,ie>=ce&&(ie-=Math.pow(2,8*M)),ie},t.prototype.readIntBE=function(N,M,V){N=N>>>0,M=M>>>0,V||Te(N,M,this.length);let ie=M,ce=1,de=this[N+--ie];for(;ie>0&&(ce*=256);)de+=this[N+--ie]*ce;return ce*=128,de>=ce&&(de-=Math.pow(2,8*M)),de},t.prototype.readInt8=function(N,M){return N=N>>>0,M||Te(N,1,this.length),this[N]&128?(255-this[N]+1)*-1:this[N]},t.prototype.readInt16LE=function(N,M){N=N>>>0,M||Te(N,2,this.length);const V=this[N]|this[N+1]<<8;return V&32768?V|4294901760:V},t.prototype.readInt16BE=function(N,M){N=N>>>0,M||Te(N,2,this.length);const V=this[N+1]|this[N]<<8;return V&32768?V|4294901760:V},t.prototype.readInt32LE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},t.prototype.readInt32BE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},t.prototype.readBigInt64LE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=this[N+4]+this[N+5]*2**8+this[N+6]*2**16+(V<<24);return(BigInt(ie)<<BigInt(32))+BigInt(M+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24)}),t.prototype.readBigInt64BE=Ve(function(N){N=N>>>0,Oe(N,"offset");const M=this[N],V=this[N+7];(M===void 0||V===void 0)&&qe(N,this.length-8);const ie=(M<<24)+this[++N]*2**16+this[++N]*2**8+this[++N];return(BigInt(ie)<<BigInt(32))+BigInt(this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+V)}),t.prototype.readFloatLE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),u.read(this,N,!0,23,4)},t.prototype.readFloatBE=function(N,M){return N=N>>>0,M||Te(N,4,this.length),u.read(this,N,!1,23,4)},t.prototype.readDoubleLE=function(N,M){return N=N>>>0,M||Te(N,8,this.length),u.read(this,N,!0,52,8)},t.prototype.readDoubleBE=function(N,M){return N=N>>>0,M||Te(N,8,this.length),u.read(this,N,!1,52,8)};function ge(z,N,M,V,ie,ce){if(!t.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>ie||N<ce)throw new RangeError('"value" argument is out of bounds');if(M+V>z.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(N,M,V,ie){if(N=+N,M=M>>>0,V=V>>>0,!ie){const we=Math.pow(2,8*V)-1;ge(this,N,M,V,we,0)}let ce=1,de=0;for(this[M]=N&255;++de<V&&(ce*=256);)this[M+de]=N/ce&255;return M+V},t.prototype.writeUintBE=t.prototype.writeUIntBE=function(N,M,V,ie){if(N=+N,M=M>>>0,V=V>>>0,!ie){const we=Math.pow(2,8*V)-1;ge(this,N,M,V,we,0)}let ce=V-1,de=1;for(this[M+ce]=N&255;--ce>=0&&(de*=256);)this[M+ce]=N/de&255;return M+V},t.prototype.writeUint8=t.prototype.writeUInt8=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,1,255,0),this[M]=N&255,M+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,65535,0),this[M]=N&255,this[M+1]=N>>>8,M+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,65535,0),this[M]=N>>>8,this[M+1]=N&255,M+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,4294967295,0),this[M+3]=N>>>24,this[M+2]=N>>>16,this[M+1]=N>>>8,this[M]=N&255,M+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,4294967295,0),this[M]=N>>>24,this[M+1]=N>>>16,this[M+2]=N>>>8,this[M+3]=N&255,M+4};function je(z,N,M,V,ie){_e(N,V,ie,z,M,7);let ce=Number(N&BigInt(4294967295));z[M++]=ce,ce=ce>>8,z[M++]=ce,ce=ce>>8,z[M++]=ce,ce=ce>>8,z[M++]=ce;let de=Number(N>>BigInt(32)&BigInt(4294967295));return z[M++]=de,de=de>>8,z[M++]=de,de=de>>8,z[M++]=de,de=de>>8,z[M++]=de,M}function Pe(z,N,M,V,ie){_e(N,V,ie,z,M,7);let ce=Number(N&BigInt(4294967295));z[M+7]=ce,ce=ce>>8,z[M+6]=ce,ce=ce>>8,z[M+5]=ce,ce=ce>>8,z[M+4]=ce;let de=Number(N>>BigInt(32)&BigInt(4294967295));return z[M+3]=de,de=de>>8,z[M+2]=de,de=de>>8,z[M+1]=de,de=de>>8,z[M]=de,M+8}t.prototype.writeBigUInt64LE=Ve(function(N,M=0){return je(this,N,M,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=Ve(function(N,M=0){return Pe(this,N,M,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(N,M,V,ie){if(N=+N,M=M>>>0,!ie){const Ee=Math.pow(2,8*V-1);ge(this,N,M,V,Ee-1,-Ee)}let ce=0,de=1,we=0;for(this[M]=N&255;++ce<V&&(de*=256);)N<0&&we===0&&this[M+ce-1]!==0&&(we=1),this[M+ce]=(N/de>>0)-we&255;return M+V},t.prototype.writeIntBE=function(N,M,V,ie){if(N=+N,M=M>>>0,!ie){const Ee=Math.pow(2,8*V-1);ge(this,N,M,V,Ee-1,-Ee)}let ce=V-1,de=1,we=0;for(this[M+ce]=N&255;--ce>=0&&(de*=256);)N<0&&we===0&&this[M+ce+1]!==0&&(we=1),this[M+ce]=(N/de>>0)-we&255;return M+V},t.prototype.writeInt8=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,1,127,-128),N<0&&(N=255+N+1),this[M]=N&255,M+1},t.prototype.writeInt16LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,32767,-32768),this[M]=N&255,this[M+1]=N>>>8,M+2},t.prototype.writeInt16BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,2,32767,-32768),this[M]=N>>>8,this[M+1]=N&255,M+2},t.prototype.writeInt32LE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,2147483647,-2147483648),this[M]=N&255,this[M+1]=N>>>8,this[M+2]=N>>>16,this[M+3]=N>>>24,M+4},t.prototype.writeInt32BE=function(N,M,V){return N=+N,M=M>>>0,V||ge(this,N,M,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[M]=N>>>24,this[M+1]=N>>>16,this[M+2]=N>>>8,this[M+3]=N&255,M+4},t.prototype.writeBigInt64LE=Ve(function(N,M=0){return je(this,N,M,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=Ve(function(N,M=0){return Pe(this,N,M,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Me(z,N,M,V,ie,ce){if(M+V>z.length)throw new RangeError("Index out of range");if(M<0)throw new RangeError("Index out of range")}function ze(z,N,M,V,ie){return N=+N,M=M>>>0,ie||Me(z,N,M,4),u.write(z,N,M,V,23,4),M+4}t.prototype.writeFloatLE=function(N,M,V){return ze(this,N,M,!0,V)},t.prototype.writeFloatBE=function(N,M,V){return ze(this,N,M,!1,V)};function Le(z,N,M,V,ie){return N=+N,M=M>>>0,ie||Me(z,N,M,8),u.write(z,N,M,V,52,8),M+8}t.prototype.writeDoubleLE=function(N,M,V){return Le(this,N,M,!0,V)},t.prototype.writeDoubleBE=function(N,M,V){return Le(this,N,M,!1,V)},t.prototype.copy=function(N,M,V,ie){if(!t.isBuffer(N))throw new TypeError("argument should be a Buffer");if(V||(V=0),!ie&&ie!==0&&(ie=this.length),M>=N.length&&(M=N.length),M||(M=0),ie>0&&ie<V&&(ie=V),ie===V||N.length===0||this.length===0)return 0;if(M<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("Index out of range");if(ie<0)throw new RangeError("sourceEnd out of bounds");ie>this.length&&(ie=this.length),N.length-M<ie-V&&(ie=N.length-M+V);const ce=ie-V;return this===N&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(M,V,ie):Uint8Array.prototype.set.call(N,this.subarray(V,ie),M),ce},t.prototype.fill=function(N,M,V,ie){if(typeof N=="string"){if(typeof M=="string"?(ie=M,M=0,V=this.length):typeof V=="string"&&(ie=V,V=this.length),ie!==void 0&&typeof ie!="string")throw new TypeError("encoding must be a string");if(typeof ie=="string"&&!t.isEncoding(ie))throw new TypeError("Unknown encoding: "+ie);if(N.length===1){const de=N.charCodeAt(0);(ie==="utf8"&&de<128||ie==="latin1")&&(N=de)}}else typeof N=="number"?N=N&255:typeof N=="boolean"&&(N=Number(N));if(M<0||this.length<M||this.length<V)throw new RangeError("Out of range index");if(V<=M)return this;M=M>>>0,V=V===void 0?this.length:V>>>0,N||(N=0);let ce;if(typeof N=="number")for(ce=M;ce<V;++ce)this[ce]=N;else{const de=t.isBuffer(N)?N:t.from(N,ie),we=de.length;if(we===0)throw new TypeError('The value "'+N+'" is invalid for argument "value"');for(ce=0;ce<V-M;++ce)this[ce+M]=de[ce%we]}return this};const De={};function ke(z,N,M){De[z]=class extends M{constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${z}]`,this.stack,delete this.name}get code(){return z}set code(ie){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ie,writable:!0})}toString(){return`${this.name} [${z}]: ${this.message}`}}}ke("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?`${z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ke("ERR_INVALID_ARG_TYPE",function(z,N){return`The "${z}" argument must be of type number. Received type ${typeof N}`},TypeError),ke("ERR_OUT_OF_RANGE",function(z,N,M){let V=`The value of "${z}" is out of range.`,ie=M;return Number.isInteger(M)&&Math.abs(M)>2**32?ie=ye(String(M)):typeof M=="bigint"&&(ie=String(M),(M>BigInt(2)**BigInt(32)||M<-(BigInt(2)**BigInt(32)))&&(ie=ye(ie)),ie+="n"),V+=` It must be ${N}. Received ${ie}`,V},RangeError);function ye(z){let N="",M=z.length;const V=z[0]==="-"?1:0;for(;M>=V+4;M-=3)N=`_${z.slice(M-3,M)}${N}`;return`${z.slice(0,M)}${N}`}function ve(z,N,M){Oe(N,"offset"),(z[N]===void 0||z[N+M]===void 0)&&qe(N,z.length-(M+1))}function _e(z,N,M,V,ie,ce){if(z>M||z<N){const de=typeof N=="bigint"?"n":"";let we;throw N===0||N===BigInt(0)?we=`>= 0${de} and < 2${de} ** ${(ce+1)*8}${de}`:we=`>= -(2${de} ** ${(ce+1)*8-1}${de}) and < 2 ** ${(ce+1)*8-1}${de}`,new De.ERR_OUT_OF_RANGE("value",we,z)}ve(V,ie,ce)}function Oe(z,N){if(typeof z!="number")throw new De.ERR_INVALID_ARG_TYPE(N,"number",z)}function qe(z,N,M){throw Math.floor(z)!==z?(Oe(z,M),new De.ERR_OUT_OF_RANGE("offset","an integer",z)):N<0?new De.ERR_BUFFER_OUT_OF_BOUNDS:new De.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${N}`,z)}const Ne=/[^+/0-9A-Za-z-_]/g;function Be(z){if(z=z.split("=")[0],z=z.trim().replace(Ne,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function He(z,N){N=N||1/0;let M;const V=z.length;let ie=null;const ce=[];for(let de=0;de<V;++de){if(M=z.charCodeAt(de),M>55295&&M<57344){if(!ie){if(M>56319){(N-=3)>-1&&ce.push(239,191,189);continue}else if(de+1===V){(N-=3)>-1&&ce.push(239,191,189);continue}ie=M;continue}if(M<56320){(N-=3)>-1&&ce.push(239,191,189),ie=M;continue}M=(ie-55296<<10|M-56320)+65536}else ie&&(N-=3)>-1&&ce.push(239,191,189);if(ie=null,M<128){if((N-=1)<0)break;ce.push(M)}else if(M<2048){if((N-=2)<0)break;ce.push(M>>6|192,M&63|128)}else if(M<65536){if((N-=3)<0)break;ce.push(M>>12|224,M>>6&63|128,M&63|128)}else if(M<1114112){if((N-=4)<0)break;ce.push(M>>18|240,M>>12&63|128,M>>6&63|128,M&63|128)}else throw new Error("Invalid code point")}return ce}function Je(z){const N=[];for(let M=0;M<z.length;++M)N.push(z.charCodeAt(M)&255);return N}function Qe(z,N){let M,V,ie;const ce=[];for(let de=0;de<z.length&&!((N-=2)<0);++de)M=z.charCodeAt(de),V=M>>8,ie=M%256,ce.push(ie),ce.push(V);return ce}function We(z){return b.toByteArray(Be(z))}function Ge(z,N,M,V){let ie;for(ie=0;ie<V&&!(ie+M>=N.length||ie>=z.length);++ie)N[ie+M]=z[ie];return ie}function Fe(z,N){return z instanceof N||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===N.name}function Ke(z){return z!==z}const Ye=(function(){const z="0123456789abcdef",N=new Array(256);for(let M=0;M<16;++M){const V=M*16;for(let ie=0;ie<16;++ie)N[V+ie]=z[M]+z[ie]}return N})();function Ve(z){return typeof BigInt>"u"?Xe:z}function Xe(){throw new Error("BigInt not supported")}})(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var m=toolsEbml&&toolsEbml.__assign||function(){return m=Object.assign||function(r){for(var c,e=1,t=arguments.length;e<t;e++){c=arguments[e];for(var i in c)Object.prototype.hasOwnProperty.call(c,i)&&(r[i]=c[i])}return r},m.apply(this,arguments)},b=toolsEbml&&toolsEbml.__spreadArray||function(r,c,e){if(e||arguments.length===2)for(var t=0,i=c.length,_;t<i;t++)(_||!(t in c))&&(_||(_=Array.prototype.slice.call(c,0,t)),_[t]=c[t]);return r.concat(_||Array.prototype.slice.call(c))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var u=requireTools(),T=(function(){function r(){}return r.readVint=function(c,e){e===void 0&&(e=0);var t=8-Math.floor(Math.log2(c[e]));if(t>8){var i=r.readHexString(c,e,e+t);throw new Error("Unrepresentable length: ".concat(t," ").concat(i))}if(e+t>c.length)return null;for(var _=c[e]&(1<<8-t)-1,x=1;x<t;x+=1){if(x===7&&_>=Math.pow(2,8)&&c[e+7]>0)return{length:t,value:-1};_*=Math.pow(2,8),_+=c[e+x]}return{length:t,value:_}},r.writeVint=function(c){if(c<0||c>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(c));var e=1;for(e=1;e<=8&&!(c<Math.pow(2,7*e)-1);e+=1);for(var t=u.Buffer.alloc(e),i=c,_=1;_<=e;_+=1){var x=i&255;t[e-_]=x,i-=x,i/=Math.pow(2,8)}return t[0]|=1<<8-e,t},r.concatenate=function(c,e){return!c&&!e?u.Buffer.from([]):!c||c.byteLength===0?e:!e||e.byteLength===0?c:u.Buffer.from(b(b([],c,!0),e,!0))},r.readHexString=function(c,e,t){return e===void 0&&(e=0),t===void 0&&(t=c.byteLength),Array.from(c.slice(e,t)).map(function(i){return Number(i).toString(16)}).reduce(function(i,_){return"".concat(i).concat(_.padStart(2,"0"))},"")},r.readUtf8=function(c){try{return u.Buffer.from(c).toString("utf8")}catch{return null}},r.readUnsigned=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return e.getUint8(0);case 2:return e.getUint16(0);case 4:return e.getUint32(0)}return c.byteLength<=6?c.reduce(function(t,i){return t*256+i},0):r.readHexString(c,0,c.byteLength)},r.readSigned=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return e.getInt8(0);case 2:return e.getInt16(0);case 4:return e.getInt32(0);default:return NaN}},r.readFloat=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 4:return e.getFloat32(0);case 8:return e.getFloat64(0);default:return NaN}},r.readDate=function(c){var e=new DataView(c.buffer,c.byteOffset,c.byteLength);switch(c.byteLength){case 1:return new Date(e.getUint8(0));case 2:return new Date(e.getUint16(0));case 4:return new Date(e.getUint32(0));case 8:return new Date(Number.parseInt(r.readHexString(c),16));default:return new Date(0)}},r.readDataFromTag=function(c,e){var t=c.type,i=c.name,_=c.track,x=c.discardable||!1,C=c.keyframe||!1,F=null,j;switch(t){case"u":j=r.readUnsigned(e);break;case"f":j=r.readFloat(e);break;case"i":j=r.readSigned(e);break;case"s":j=String.fromCharCode.apply(String,e);break;case"8":j=r.readUtf8(e);break;case"d":j=r.readDate(e);break}if(i==="SimpleBlock"||i==="Block"){var Z=0,ee=r.readVint(e,Z),re=ee.length,K=ee.value;Z+=re,_=K,j=r.readSigned(e.subarray(Z,Z+2)),Z+=2,i==="SimpleBlock"&&(C=!!(e[re+2]&128),x=!!(e[re+2]&1)),Z+=1,F=e.subarray(Z)}return m(m({},c),{data:e,discardable:x,keyframe:C,payload:F,track:_,value:j})},r})();return toolsEbml.default=T,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(m,b,u){b=b||0;for(var T=1;T<=8&&!(m[b]>=Math.pow(2,8-T));T++);if(T>8)throw new Error("Unrepresentable length: "+T+" "+m.toString("hex",b,b+T));if(b+T>m.length)return null;var r,c=m[b]&(1<<8-T)-1;for(r=1;r<T;r++){if(r===7&&c>=Math.pow(2,45)&&m[b+7]>0)return{length:T,value:-1};c*=Math.pow(2,8),c+=m[b+r]}return u&&(c-=Math.pow(2,T*7-1)-1),{length:T,value:c}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var m=requireVint();function b(u){this.buffer=u,this.offset=0}return b.prototype.nextInt16BE=function(){var u=this.buffer.readInt16BE(this.offset);return this.offset+=2,u},b.prototype.nextUInt8=function(){var u=this.buffer.readUInt8(this.offset);return this.offset+=1,u},b.prototype.nextUIntV=function(){var u=m(this.buffer,this.offset);return this.offset+=u.length,u.value},b.prototype.nextIntV=function(){var u=m(this.buffer,this.offset,!0);return this.offset+=u.length,u.value},b.prototype.nextBuffer=function(u){var T=u?this.buffer.slice(this.offset,this.offset+u):this.buffer.slice(this.offset);return this.offset+=u||this.length,T},Object.defineProperty(b.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=b,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var m=requireBufferReader(),b=1,u=3,T=2;ebmlBlock=function(c){var e={},t=new m(c);e.trackNumber=t.nextUIntV(),e.timecode=t.nextInt16BE();var i=t.nextUInt8();e.invisible=!!(i&8),e.keyframe=!!(i&128),e.discardable=!!(i&1);var _=(i&6)>>1;return e.frames=r(t,_),e};function r(c,e){if(!e)return[c.nextBuffer()];var t,i,_=[],x=c.nextUInt8()+1;if(e===T){if(c.length%x!==0)throw new Error("Fixed-Size Lacing Error");for(i=c.length/x,t=0;t<x;t++)_.push(c.nextBuffer(i));return _}var C=[];if(e===b)for(t=0;t<x-1;t++){var F;i=0;do F=c.nextUInt8(),i+=F;while(F===255);C.push(i)}else if(e===u)for(i=c.nextUIntV(),C.push(i),t=1;t<x-1;t++)i+=c.nextIntV(),C.push(i);for(t=0;t<x-1;t++)_.push(c.nextBuffer(C[t]));return _.push(c.nextBuffer()),_}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,(function(m){Object.defineProperty(m,"__esModule",{value:!0}),m.convertEBMLDateToJSDate=m.createFloatBuffer=m.createIntBuffer=m.createUIntBuffer=m.encodeValueToBuffer=m.concat=m.putRefinedMetaData=m.extractElement=m.removeElement=m.makeMetadataSeekable=m.createRIFFChunk=m.VP8BitStreamToRiffWebPBuffer=m.WebPBlockFilter=m.encodeTag=m.readBlock=m.ebmlBlock=m.writeVint=m.readVint=m.Buffer=void 0;var b=requireInt64Buffer(),u=requireEBMLEncoder(),T=requireBuffer(),r=requireToolsEbml(),c=requireEbmlBlock();m.Buffer=T.Buffer,m.readVint=r.default.readVint,m.writeVint=r.default.writeVint,m.ebmlBlock=c;function e(te){return(0,m.ebmlBlock)(new m.Buffer(te))}m.readBlock=e;function t(te,ue,he){return he===void 0&&(he=!1),G([te,he?new m.Buffer("01ffffffffffffff","hex"):(0,m.writeVint)(ue.length),ue])}m.encodeTag=t;function i(te){return te.reduce(function(ue,he){if(he.type!=="b"||he.name!=="SimpleBlock")return ue;var me=(0,m.ebmlBlock)(he.data),be=me.frames.some(function(Se){var xe=Se.slice(3,6).toString("hex");return xe==="9d012a"});return be?ue.concat(he):ue},[])}m.WebPBlockFilter=i;function _(te){var ue=x("VP8 ",te),he=G([new m.Buffer("WEBP","ascii"),ue]);return x("RIFF",he)}m.VP8BitStreamToRiffWebPBuffer=_;function x(te,ue){var he=new m.Buffer(4);return he.writeUInt32LE(ue.byteLength,0),G([new m.Buffer(te.substr(0,4),"ascii"),he,ue,new m.Buffer(ue.byteLength%2===0?0:1)])}m.createRIFFChunk=x;function C(te,ue,he){var me=j("EBML",te),be=ee(me),Se=be+12,xe=te[te.length-1].dataEnd-Se,Ce=j("Info",te);F("Duration",Ce),Ce.splice(1,0,{name:"Duration",type:"f",data:le(ue,8)});for(var Ae=ee(Ce),Ue=j("Tracks",te),Ze=ee(Ue),Te=47,ge=[],je=5+he.length*15,Pe=[],Me=-1,ze=10,Le=function(_e){var Oe=Te,qe=Oe+Ae,Ne=qe+Ze,Be=Ne+je,He=Be-xe;if(ge=[],ge.push({name:"SeekHead",type:"m",isEnd:!1}),ge.push({name:"Seek",type:"m",isEnd:!1}),ge.push({name:"SeekID",type:"b",data:new m.Buffer([21,73,169,102])}),ge.push({name:"SeekPosition",type:"u",data:ae(Oe)}),ge.push({name:"Seek",type:"m",isEnd:!0}),ge.push({name:"Seek",type:"m",isEnd:!1}),ge.push({name:"SeekID",type:"b",data:new m.Buffer([22,84,174,107])}),ge.push({name:"SeekPosition",type:"u",data:ae(qe)}),ge.push({name:"Seek",type:"m",isEnd:!0}),ge.push({name:"Seek",type:"m",isEnd:!1}),ge.push({name:"SeekID",type:"b",data:new m.Buffer([28,83,187,107])}),ge.push({name:"SeekPosition",type:"u",data:ae(Ne)}),ge.push({name:"Seek",type:"m",isEnd:!0}),ge.push({name:"SeekHead",type:"m",isEnd:!0}),Te=ee(ge),Pe=[],Pe.push({name:"Cues",type:"m",isEnd:!1}),he.forEach(function(Je){var Qe=Je.CueTrack,We=Je.CueClusterPosition,Ge=Je.CueTime;Pe.push({name:"CuePoint",type:"m",isEnd:!1}),Pe.push({name:"CueTime",type:"u",data:ae(Ge)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Pe.push({name:"CueTrack",type:"u",data:ae(Qe)}),We-=Se,We+=He,Pe.push({name:"CueClusterPosition",type:"u",data:ae(We)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Pe.push({name:"CuePoint",type:"m",isEnd:!0})}),Pe.push({name:"Cues",type:"m",isEnd:!0}),je=ee(Pe),Me!==He){if(Me=He,_e===ze-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},De=0;De<ze;De++){var ke=Le(De);if(ke==="break")break}var ye=[].concat.apply([],[me,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},ge,Ce,Ue,Pe]),ve=new u.default().encode(ye);return ve}m.makeMetadataSeekable=C;function F(te,ue){for(var he=-1,me=0;me<ue.length;me++){var be=ue[me];if(be.name===te)if(be.type==="m")if(!be.isEnd)he=me;else{if(he==-1)throw new Error("Detected ".concat(te," closing element before finding the start"));ue.splice(he,me-he+1);return}else{ue.splice(me,1);return}}}m.removeElement=F;function j(te,ue){for(var he=[],me=-1,be=0;be<ue.length;be++){var Se=ue[be];if(Se.name===te)if(Se.type==="m")if(!Se.isEnd)me=be;else{if(me==-1)throw new Error("Detected ".concat(te," closing element before finding the start"));he=ue.slice(me,be+1);break}else{he.push(ue[be]);break}}return he}m.extractElement=j;function Z(te,ue){Array.isArray(ue.cueInfos)&&!Array.isArray(ue.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),ue.cues=ue.cueInfos);for(var he=[],me=[],be=0;be<te.length;be++){var Se=te[be];if(Se.type==="m"&&Se.name==="Segment"){if(he=te.slice(0,be),me=te.slice(be),Se.unknownSize){me.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(me[me.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var xe=me[me.length-1].dataEnd,Ce=he[he.length-1].dataEnd,Ae=new u.default().encode(he).byteLength,Ue=Ae-Ce,Ze=xe-me[0].tagStart;me[0].tagStart-Ce,me[0].tagStart;var Te=new m.Buffer([24,83,128,103]),ge=new m.Buffer("01ffffffffffffff","hex"),je=Te.byteLength+ge.byteLength,Pe=Ze,Me;for(Me=1;Me<20;Me++){var ze=Ce+je+Pe,Le=ze-xe,De=Ue+Le,ke=re(me,De,ue),ye=new u.default().encode(ke).byteLength;if(ye===Pe)return new u.default().encode([].concat(he,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],ke));Pe=ye}throw new Error("unable to refine metadata, stable size could not be found in "+Me+" iterations!")}m.putRefinedMetaData=Z;function ee(te){var ue=new u.default;return te.reduce(function(he,me){return he.concat(ue.encode([me]))},[]).reduce(function(he,me){return he+me.byteLength},0)}function re(te,ue,he){var me=he.duration,be=he.clusterPtrs,Se=he.cues,xe=te.slice(0);if(typeof me=="number"){var Ce=!1;xe.forEach(function(Ue){Ue.type==="f"&&Ue.name==="Duration"&&(Ce=!0,Ue.data=le(me,8))}),Ce||fe(xe,"Info",[{name:"Duration",type:"f",data:le(me,8)}])}Array.isArray(Se)&&fe(xe,"Cues",se(Se,ue));var Ae=[];return Array.isArray(be)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Ae=K(be,ue)),fe(xe,"SeekHead",Ae,!0),xe}function K(te,ue){var he=[];return te.forEach(function(me){he.push({name:"Seek",type:"m",isEnd:!1}),he.push({name:"SeekID",type:"b",data:new m.Buffer([31,67,182,117])}),he.push({name:"SeekPosition",type:"u",data:ae(me+ue)}),he.push({name:"Seek",type:"m",isEnd:!0})}),he}function se(te,ue){var he=[];return te.forEach(function(me){var be=me.CueTrack,Se=me.CueClusterPosition,xe=me.CueTime;he.push({name:"CuePoint",type:"m",isEnd:!1}),he.push({name:"CueTime",type:"u",data:ae(xe)}),he.push({name:"CueTrackPositions",type:"m",isEnd:!1}),he.push({name:"CueTrack",type:"u",data:ae(be)}),he.push({name:"CueClusterPosition",type:"u",data:ae(Se+ue)}),he.push({name:"CueTrackPositions",type:"m",isEnd:!0}),he.push({name:"CuePoint",type:"m",isEnd:!0})}),he}function fe(te,ue,he,me){me===void 0&&(me=!1);for(var be=-1,Se=0;Se<te.length;Se++){var xe=te[Se];if(xe.type==="m"&&xe.name===ue&&xe.isEnd===!1){be=Se;break}}be>=0?Array.prototype.splice.apply(te,[be+1,0].concat(he)):me?[].concat([{name:ue,type:"m",isEnd:!1}],he,[{name:ue,type:"m",isEnd:!0}]).reverse().forEach(function(Ce){te.unshift(Ce)}):(te.push({name:ue,type:"m",isEnd:!1}),he.forEach(function(Ce){te.push(Ce)}),te.push({name:ue,type:"m",isEnd:!0}))}function G(te){return m.Buffer.concat(te)}m.concat=G;function ne(te){var ue=new m.Buffer(0);if(te.type==="m")return te;switch(te.type){case"u":ue=ae(te.value);break;case"i":ue=oe(te.value);break;case"f":ue=le(te.value);break;case"s":ue=new m.Buffer(te.value,"ascii");break;case"8":ue=new m.Buffer(te.value,"utf8");break;case"b":ue=te.value;break;case"d":ue=new b.Int64BE(te.value.getTime().toString()).toBuffer();break}return Object.assign({},te,{data:ue})}m.encodeValueToBuffer=ne;function ae(te){for(var ue=1;te>=Math.pow(2,8*ue);ue++);if(ue>=7)return console.warn("7bit or more bigger uint not supported."),new b.Uint64BE(te).toBuffer();var he=new m.Buffer(ue);return he.writeUIntBE(te,0,ue),he}m.createUIntBuffer=ae;function oe(te){for(var ue=1;te>=Math.pow(2,8*ue);ue++);if(ue>=7)return console.warn("7bit or more bigger uint not supported."),new b.Int64BE(te).toBuffer();var he=new m.Buffer(ue);return he.writeIntBE(te,0,ue),he}m.createIntBuffer=oe;function le(te,ue){if(ue===void 0&&(ue=8),ue===8){var he=new m.Buffer(8);return he.writeDoubleBE(te,0),he}else if(ue===4){var he=new m.Buffer(4);return he.writeFloatBE(te,0),he}else throw new Error("float type bits must 4bytes or 8bytes")}m.createFloatBuffer=le;function pe(te){return te instanceof Date?te:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(te)/1e3/1e3)}m.convertEBMLDateToJSDate=pe})(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var m=requireInt64Buffer(),b=requireTools(),u=requireTools(),T=requireEbmlID(),r;(function(e){e[e.STATE_TAG=1]="STATE_TAG",e[e.STATE_SIZE=2]="STATE_SIZE",e[e.STATE_CONTENT=3]="STATE_CONTENT"})(r||(r={}));var c=(function(){function e(){this._buffer=new b.Buffer(0),this._tag_stack=[],this._state=r.STATE_TAG,this._cursor=0,this._total=0,this._schema=T.byEbmlID,this._result=[]}return e.prototype.decode=function(t){this.readChunk(t);var i=this._result;return this._result=[],i},e.prototype.readChunk=function(t){for(this._buffer=u.concat([this._buffer,new b.Buffer(t)]);this._cursor<this._buffer.length&&!(this._state===r.STATE_TAG&&!this.readTag()||this._state===r.STATE_SIZE&&!this.readSize()||this._state===r.STATE_CONTENT&&!this.readContent()););},e.prototype.getSchemaInfo=function(t){return this._schema[t]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},e.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var t=(0,b.readVint)(this._buffer,this._cursor);if(t==null)return!1;var i=this._buffer.slice(this._cursor,this._cursor+t.length),_=i.reduce(function(F,j,Z,ee){return F+j*Math.pow(16,2*(ee.length-1-Z))},0),x=this.getSchemaInfo(_),C={EBML_ID:_.toString(16),schema:x,type:x.type,name:x.name,level:x.level,tagStart:this._total,tagEnd:this._total+t.length,sizeStart:this._total+t.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(C),this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_SIZE,!0},e.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var t=(0,b.readVint)(this._buffer,this._cursor);if(t==null)return!1;var i=this._tag_stack[this._tag_stack.length-1];return i.sizeEnd=i.sizeStart+t.length,i.dataStart=i.sizeEnd,i.dataSize=t.value,t.value===-1?(i.dataEnd=-1,i.type==="m"&&(i.unknownSize=!0)):i.dataEnd=i.sizeEnd+t.value,this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_CONTENT,!0},e.prototype.readContent=function(){var t=this._tag_stack[this._tag_stack.length-1];if(t.type==="m"){if(t.isEnd=!1,this._result.push(t),this._state=r.STATE_TAG,t.dataSize===0){var i=Object.assign({},t,{isEnd:!0});this._result.push(i),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+t.dataSize)return!1;var _=this._buffer.slice(this._cursor,this._cursor+t.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+t.dataSize),t.data=_,t.type){case"u":t.value=_.readUIntBE(0,_.length);break;case"i":t.value=_.readIntBE(0,_.length);break;case"f":t.value=t.dataSize===4?_.readFloatBE(0):t.dataSize===8?_.readDoubleBE(0):(console.warn("cannot read ".concat(t.dataSize," octets float. failback to 0")),0);break;case"s":t.value=_.toString("ascii");break;case"8":t.value=_.toString("utf8");break;case"b":t.value=_;break;case"d":t.value=(0,b.convertEBMLDateToJSDate)(new m.Int64BE(_).toNumber());break}if(t.value===null)throw new Error("unknown tag type:"+t.type);for(this._result.push(t),this._total+=t.dataSize,this._state=r.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var x=this._tag_stack[this._tag_stack.length-1];if(x.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<x.dataEnd)break;if(x.type!=="m")throw new Error("parent element is not master element");var i=Object.assign({},x,{isEnd:!0});this._result.push(i),this._tag_stack.pop()}return!0},e})();return EBMLDecoder.default=c,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var m=typeof Reflect=="object"?Reflect:null,b=m&&typeof m.apply=="function"?m.apply:function(ne,ae,oe){return Function.prototype.apply.call(ne,ae,oe)},u;m&&typeof m.ownKeys=="function"?u=m.ownKeys:Object.getOwnPropertySymbols?u=function(ne){return Object.getOwnPropertyNames(ne).concat(Object.getOwnPropertySymbols(ne))}:u=function(ne){return Object.getOwnPropertyNames(ne)};function T(G){console&&console.warn&&console.warn(G)}var r=Number.isNaN||function(ne){return ne!==ne};function c(){c.init.call(this)}events.exports=c,events.exports.once=K,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var e=10;function t(G){if(typeof G!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof G)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return e},set:function(G){if(typeof G!="number"||G<0||r(G))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+G+".");e=G}}),c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(ne){if(typeof ne!="number"||ne<0||r(ne))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ne+".");return this._maxListeners=ne,this};function i(G){return G._maxListeners===void 0?c.defaultMaxListeners:G._maxListeners}c.prototype.getMaxListeners=function(){return i(this)},c.prototype.emit=function(ne){for(var ae=[],oe=1;oe<arguments.length;oe++)ae.push(arguments[oe]);var le=ne==="error",pe=this._events;if(pe!==void 0)le=le&&pe.error===void 0;else if(!le)return!1;if(le){var te;if(ae.length>0&&(te=ae[0]),te instanceof Error)throw te;var ue=new Error("Unhandled error."+(te?" ("+te.message+")":""));throw ue.context=te,ue}var he=pe[ne];if(he===void 0)return!1;if(typeof he=="function")b(he,this,ae);else for(var me=he.length,be=Z(he,me),oe=0;oe<me;++oe)b(be[oe],this,ae);return!0};function _(G,ne,ae,oe){var le,pe,te;if(t(ae),pe=G._events,pe===void 0?(pe=G._events=Object.create(null),G._eventsCount=0):(pe.newListener!==void 0&&(G.emit("newListener",ne,ae.listener?ae.listener:ae),pe=G._events),te=pe[ne]),te===void 0)te=pe[ne]=ae,++G._eventsCount;else if(typeof te=="function"?te=pe[ne]=oe?[ae,te]:[te,ae]:oe?te.unshift(ae):te.push(ae),le=i(G),le>0&&te.length>le&&!te.warned){te.warned=!0;var ue=new Error("Possible EventEmitter memory leak detected. "+te.length+" "+String(ne)+" listeners added. Use emitter.setMaxListeners() to increase limit");ue.name="MaxListenersExceededWarning",ue.emitter=G,ue.type=ne,ue.count=te.length,T(ue)}return G}c.prototype.addListener=function(ne,ae){return _(this,ne,ae,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(ne,ae){return _(this,ne,ae,!0)};function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function C(G,ne,ae){var oe={fired:!1,wrapFn:void 0,target:G,type:ne,listener:ae},le=x.bind(oe);return le.listener=ae,oe.wrapFn=le,le}c.prototype.once=function(ne,ae){return t(ae),this.on(ne,C(this,ne,ae)),this},c.prototype.prependOnceListener=function(ne,ae){return t(ae),this.prependListener(ne,C(this,ne,ae)),this},c.prototype.removeListener=function(ne,ae){var oe,le,pe,te,ue;if(t(ae),le=this._events,le===void 0)return this;if(oe=le[ne],oe===void 0)return this;if(oe===ae||oe.listener===ae)--this._eventsCount===0?this._events=Object.create(null):(delete le[ne],le.removeListener&&this.emit("removeListener",ne,oe.listener||ae));else if(typeof oe!="function"){for(pe=-1,te=oe.length-1;te>=0;te--)if(oe[te]===ae||oe[te].listener===ae){ue=oe[te].listener,pe=te;break}if(pe<0)return this;pe===0?oe.shift():ee(oe,pe),oe.length===1&&(le[ne]=oe[0]),le.removeListener!==void 0&&this.emit("removeListener",ne,ue||ae)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(ne){var ae,oe,le;if(oe=this._events,oe===void 0)return this;if(oe.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):oe[ne]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete oe[ne]),this;if(arguments.length===0){var pe=Object.keys(oe),te;for(le=0;le<pe.length;++le)te=pe[le],te!=="removeListener"&&this.removeAllListeners(te);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(ae=oe[ne],typeof ae=="function")this.removeListener(ne,ae);else if(ae!==void 0)for(le=ae.length-1;le>=0;le--)this.removeListener(ne,ae[le]);return this};function F(G,ne,ae){var oe=G._events;if(oe===void 0)return[];var le=oe[ne];return le===void 0?[]:typeof le=="function"?ae?[le.listener||le]:[le]:ae?re(le):Z(le,le.length)}c.prototype.listeners=function(ne){return F(this,ne,!0)},c.prototype.rawListeners=function(ne){return F(this,ne,!1)},c.listenerCount=function(G,ne){return typeof G.listenerCount=="function"?G.listenerCount(ne):j.call(G,ne)},c.prototype.listenerCount=j;function j(G){var ne=this._events;if(ne!==void 0){var ae=ne[G];if(typeof ae=="function")return 1;if(ae!==void 0)return ae.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?u(this._events):[]};function Z(G,ne){for(var ae=new Array(ne),oe=0;oe<ne;++oe)ae[oe]=G[oe];return ae}function ee(G,ne){for(;ne+1<G.length;ne++)G[ne]=G[ne+1];G.pop()}function re(G){for(var ne=new Array(G.length),ae=0;ae<ne.length;++ae)ne[ae]=G[ae].listener||G[ae];return ne}function K(G,ne){return new Promise(function(ae,oe){function le(te){G.removeListener(ne,pe),oe(te)}function pe(){typeof G.removeListener=="function"&&G.removeListener("error",le),ae([].slice.call(arguments))}fe(G,ne,pe,{once:!0}),ne!=="error"&&se(G,le,{once:!0})})}function se(G,ne,ae){typeof G.on=="function"&&fe(G,"error",ne,ae)}function fe(G,ne,ae,oe){if(typeof G.on=="function")oe.once?G.once(ne,ae):G.on(ne,ae);else if(typeof G.addEventListener=="function")G.addEventListener(ne,function le(pe){oe.once&&G.removeEventListener(ne,le),ae(pe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof G)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var m=EBMLReader&&EBMLReader.__extends||(function(){var r=function(c,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var _ in i)Object.prototype.hasOwnProperty.call(i,_)&&(t[_]=i[_])},r(c,e)};return function(c,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(c,e);function t(){this.constructor=c}c.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}})();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var b=requireEvents(),u=requireTools(),T=(function(r){m(c,r);function c(){var e=r.call(this)||this;return e.logGroup="",e.hasLoggingStarted=!1,e.metadataloaded=!1,e.chunks=[],e.stack=[],e.segmentOffset=0,e.last2SimpleBlockVideoTrackTimecode=[0,0],e.last2SimpleBlockAudioTrackTimecode=[0,0],e.lastClusterTimecode=0,e.lastClusterPosition=0,e.timecodeScale=1e6,e.metadataSize=0,e.metadatas=[],e.cues=[],e.firstVideoBlockRead=!1,e.firstAudioBlockRead=!1,e.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},e.trackTypes=[],e.trackDefaultDuration=[],e.trackCodecDelay=[],e.trackInfo={type:"nothing"},e.ended=!1,e.logging=!1,e.use_duration_every_simpleblock=!1,e.use_webp=!1,e.use_segment_info=!0,e.drop_default_duration=!0,e}return c.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},c.prototype.emit_segment_info=function(){var e=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var _=this.lastClusterTimecode,x=this.duration,C=this.timecodeScale;this.emit("cluster",{timecode:_,data:e}),this.emit("duration",{timecodeScale:C,duration:x})}else{this.metadataloaded=!0,this.metadatas=e;var t=this.trackTypes.indexOf(1),i=this.trackTypes.indexOf(2);if(this.trackInfo=t>=0&&i>=0?{type:"both",trackNumber:t}:t>=0?{type:"video",trackNumber:t}:i>=0?{type:"audio",trackNumber:i}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:e,metadataSize:this.metadataSize})}},c.prototype.read=function(e){var t=this,i=!1;if(!this.ended){if(e.type==="m")if(e.isEnd)this.stack.pop();else{var _=this.stack[this.stack.length-1];if(_!=null&&_.level>=e.level){this.stack.pop(),this.logging&&console.groupEnd(),_.dataEnd=e.dataEnd,_.dataSize=e.dataEnd-_.dataStart,_.unknownSize=!1;var x=Object.assign({},_,{name:_.name,type:_.type,isEnd:!0});this.chunks.push(x)}this.stack.push(e)}if(e.type==="m"&&e.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=e.dataStart,this.emit("segment_offset",this.segmentOffset);else if(e.type==="b"&&e.name==="SimpleBlock"){var C=u.ebmlBlock(e.data),F=C.timecode,j=C.trackNumber,Z=C.frames;if(this.trackTypes[j]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ee=this.lastClusterTimecode+F;this.cues.push({CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee}),this.emit("cue_info",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],F]}else if(this.trackTypes[j]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ee=this.lastClusterTimecode+F;this.cues.push({CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee}),this.emit("cue_info",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:j,CueClusterPosition:this.lastClusterPosition,CueTime:ee})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],F]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&Z.forEach(function(re){var K=re.slice(3,6).toString("hex");if(K==="9d012a"){var se=u.VP8BitStreamToRiffWebPBuffer(re),fe=new Blob([se],{type:"image/webp"}),G=t.duration;t.emit("webp",{currentTime:G,webp:fe})}})}else e.type==="m"&&e.name==="Cluster"&&e.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",e.tagStart),this.lastClusterPosition=e.tagStart):e.type==="u"&&e.name==="Timecode"?this.lastClusterTimecode=e.value:e.type==="u"&&e.name==="TimecodeScale"?this.timecodeScale=e.value:e.type==="m"&&e.name==="TrackEntry"?e.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:e.type==="u"&&e.name==="TrackType"?this.currentTrack.TrackType=e.value:e.type==="u"&&e.name==="TrackNumber"?this.currentTrack.TrackNumber=e.value:e.type==="u"&&e.name==="CodecDelay"?this.currentTrack.CodecDelay=e.value:e.type==="u"&&e.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),i=!0):this.currentTrack.DefaultDuration=e.value:e.name==="unknown"&&console.warn(e);!this.metadataloaded&&e.dataEnd>0&&(this.metadataSize=e.dataEnd),i||this.chunks.push(e),this.logging&&this.put(e)}},Object.defineProperty(c.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var e=0,t=0,i=0,_=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof _=="number")e=_;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof x=="number"&&(t=x),i=this.last2SimpleBlockAudioTrackTimecode[1]}else{e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof x=="number"&&(t=x),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){e=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackInfo.trackNumber];typeof x=="number"&&(t=x),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){e=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var x=this.trackCodecDelay[this.trackInfo.trackNumber];typeof x=="number"&&(t=x),i=this.last2SimpleBlockAudioTrackTimecode[1]}var C=(this.lastClusterTimecode+i)*this.timecodeScale+e-t,F=C/this.timecodeScale;return Math.floor(F)},enumerable:!1,configurable:!0}),c.prototype.addListener=function(e,t){return r.prototype.addListener.call(this,e,t)},c.prototype.put=function(e){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),e.type==="m"?e.isEnd?console.groupEnd():console.group(e.name+":"+e.tagStart):e.type==="b"?console.log(e.name,e.type):console.log(e.name,e.tagStart,e.type,e.value)},c})(b.EventEmitter);return EBMLReader.default=T,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,(function(m){var b=ebml&&ebml.__createBinding||(Object.create?(function(t,i,_,x){x===void 0&&(x=_),Object.defineProperty(t,x,{enumerable:!0,get:function(){return i[_]}})}):(function(t,i,_,x){x===void 0&&(x=_),t[x]=i[_]})),u=ebml&&ebml.__exportStar||function(t,i){for(var _ in t)_!=="default"&&!Object.prototype.hasOwnProperty.call(i,_)&&b(i,t,_)};Object.defineProperty(m,"__esModule",{value:!0}),m.tools=m.Reader=m.Encoder=m.Decoder=void 0,u(requireEBML(),m);var T=requireEBMLDecoder();m.Decoder=T.default;var r=requireEBMLEncoder();m.Encoder=r.default;var c=requireEBMLReader();m.Reader=c.default;var e=requireTools();m.tools=e})(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var m=lib&&lib.__awaiter||function(r,c,e,t){function i(_){return _ instanceof e?_:new e(function(x){x(_)})}return new(e||(e=Promise))(function(_,x){function C(Z){try{j(t.next(Z))}catch(ee){x(ee)}}function F(Z){try{j(t.throw(Z))}catch(ee){x(ee)}}function j(Z){Z.done?_(Z.value):i(Z.value).then(C,F)}j((t=t.apply(r,c||[])).next())})},b=lib&&lib.__generator||function(r,c){var e={label:0,sent:function(){if(_[0]&1)throw _[1];return _[1]},trys:[],ops:[]},t,i,_,x;return x={next:C(0),throw:C(1),return:C(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function C(j){return function(Z){return F([j,Z])}}function F(j){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,i&&(_=j[0]&2?i.return:j[0]?i.throw||((_=i.return)&&_.call(i),0):i.next)&&!(_=_.call(i,j[1])).done)return _;switch(i=0,_&&(j=[j[0]&2,_.value]),j[0]){case 0:case 1:_=j;break;case 4:return e.label++,{value:j[1],done:!1};case 5:e.label++,i=j[1],j=[0];continue;case 7:j=e.ops.pop(),e.trys.pop();continue;default:if(_=e.trys,!(_=_.length>0&&_[_.length-1])&&(j[0]===6||j[0]===2)){e=0;continue}if(j[0]===3&&(!_||j[1]>_[0]&&j[1]<_[3])){e.label=j[1];break}if(j[0]===6&&e.label<_[1]){e.label=_[1],_=j;break}if(_&&e.label<_[2]){e.label=_[2],e.ops.push(j);break}_[2]&&e.ops.pop(),e.trys.pop();continue}j=c.call(r,e)}catch(Z){j=[6,Z],i=0}finally{t=_=0}if(j[0]&5)throw j[1];return{value:j[0]?j[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var u=requireEbml();function T(r){return m(this,void 0,void 0,function(){var c,e,t,i,_,x,C,F,j,Z,ee,re;return b(this,function(K){switch(K.label){case 0:if(!r)throw Error("call to fixWebmDuration requires a blob");c=new u.Decoder,e=new u.Reader,t=r.stream(),i=t.getReader(),K.label=1;case 1:return[4,i.read()];case 2:return _=K.sent(),x=_.done,C=_.value,x?(e.stop(),[3,3]):(F=c.decode(C),F=F?.filter(function(se){return se.type!=="unknown"}),F.forEach(function(se){e.read(se)}),C=null,[3,1]);case 3:return j=u.tools.makeMetadataSeekable(e.metadatas,e.duration,e.cues),Z=new Blob([j],{type:r.type}),ee=r.slice(e.metadataSize),re=new Blob([Z,ee],{type:r.type}),[2,re]}})})}return lib.default=T,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{#e;#r=!1;#n=!1;#c=0;#a=0;#t=0;#i=0;#o=0;onchange=b=>{};onDurationChange=b=>{};constructor(){}start=async(b="")=>{b||(b=`video_Record_${p$1(Date.now())}`);let u=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(T=>{const r=T.getTracks();for(const e of r)e.onended=()=>this.stop();this.#r=!0,this.#n=!1,this.#e=new MediaRecorder(T),this.#e.start();const c=new Date().getTime();this.#c=c,this.#t=c,this.#s(),this.#l(),this.#e.addEventListener("dataavailable",e=>{u.push(e.data)}),this.#e.addEventListener("stop",async()=>{this.#r=!1;const e=new Date().getTime();this.#a=e,this.#i+=e-this.#t,this.#s(),clearInterval(this.#o);const t=T.getTracks();for(const F of t)F.stop();if(this.#e===null)return;const i=new Blob(u,{type:this.#e.mimeType}),_=await fixWebmDuration(i),x=URL.createObjectURL(_),C=document.createElement("a");C.href=x,C.download=`${b}.mp4`,C.click(),URL.revokeObjectURL(x),u=[],this.#e=null})})};pause=async()=>{await new Promise(u=>setTimeout(()=>u(!0),300)),this.#e?.pause(),this.#n=!0;const b=new Date().getTime();this.#i+=b-this.#t,this.#s(),clearInterval(this.#o)};resume=async()=>{this.#e?.resume(),this.#n=!1;const b=new Date().getTime();this.#t=b,this.#s(),this.#l()};stop=async()=>{this.#e?.stop()};getDuration=()=>{if(this.#t===0)return 0;let b=this.#i;const u=new Date().getTime();if(this.#r&&this.#n===!1){const T=u-this.#t;this.#t=u,b=b+T}return b};getInfo=()=>({active:this.#r,pause:this.#n,startTime:this.#c,endTime:this.#a,duration:this.#i});#s=()=>{const b=this.getInfo();this.onchange(b)};#l=()=>{clearInterval(this.#o),this.#o=window.setInterval(()=>{this.#i=this.getDuration(),this.onDurationChange(this.#i)},500)}}var l=Object.defineProperty,y=m=>{throw TypeError(m)},q=(m,b,u)=>b in m?l(m,b,{enumerable:!0,configurable:!0,writable:!0,value:u}):m[b]=u,s=(m,b,u)=>q(m,typeof b!="symbol"?b+"":b,u),P=(m,b,u)=>b.has(m)||y("Cannot "+u),n=(m,b,u)=>(P(m,b,"read from private field"),u?u.call(m):b.get(m)),a=(m,b,u)=>b.has(m)?y("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(m):b.set(m,u),d,v,o;class p{constructor(b={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(u,T={})=>new Promise(async(r,c)=>{const e=T.timeout||this.options.timeout,t=T.key||n(this,d).call(this),i=T.describe||"";if(this.queue.findIndex(x=>x.key===t)!==-1)return c(`${t} is exist.`);const _={key:t,func:u,describe:i,timeout:e,resolve:r,reject:c};this.queue.unshift(_),this.activePromise||n(this,o).call(this)})),s(this,"clear",()=>{this.queue=[],this.activePromise=void 0,clearTimeout(this.timer)}),s(this,"retry",()=>{n(this,o).call(this)}),a(this,d,()=>(this.activeIndex=this.activeIndex+1,`${this.activeIndex}`)),a(this,v,u=>{const T=this.queue.findIndex(r=>r.key===u);this.queue.splice(T,1)}),a(this,o,async()=>{const u=this.queue.length;if(u===0)return;const T=u-1,r=this.queue[T];this.activePromise=r;const{key:c,func:e,resolve:t,reject:i,timeout:_}=this.activePromise;_&&(this.timer=window.setTimeout(()=>{i(`pr-async-queue: ${c} is timeout.`),n(this,o).call(this)},_)),await e().then(t).catch(i).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,c),n(this,o).call(this)})}),this.options={timeout:0,...b}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;class Base{config=new Config$1;notifys=new Notifys;localMedias=new LocalMedias;intervalQueue=new W;asyncQueue=new p;traffic=new Traffic;recorder=new StreamRecorder;users=new Users({config:this.config,localMedias:this.localMedias,notifys:this.notifys});cws=new CallsWebSocket({config:this.config});peer=new Peer({config:this.config,users:this.users});_requestAnimationFrameMap=new Map;constructor(){this.intervalQueue.startQueue(),this.localMedias.on.devicechange=()=>this.notifys.emit("onDevicechange",{code:200,data:{},desc:"MediaDevice is change."})}use=({rnnoise:b})=>{b!==void 0&&this.users.localUser.streamControls.mc_audio?.use({rnnoise:b})};setRoomState=b=>{this.config.roomState!==b&&(this.config.roomState=b,b==="closed"&&(this.config.isInRoom=!1),this.notifys.emit("onRoomState",{code:200,desc:"RoomState is change.",data:{state:b}}))};setPeerState=b=>{this.config.peerState=b,this.notifys.emit("onPeerState",{code:200,desc:"PeerState is change.",data:{state:b}})};setCallStrategy=async(b,u=[])=>{u.length===0&&(u=mediaType_keys);let T="balanced";switch(b){case"qualityPriority":T="maintain-resolution";break;case"fluencyPriority":T="maintain-framerate";break;case"balancedDowngrade":T="balanced";break}await this.peer.setRTCRtpSenderParameters({degradationPreference:T},u);const r=this.users.remoteUsers.values();for(const c of r)c.p2p?.setRTCRtpSenderParameters({degradationPreference:T},u)};addRequestAnimationFrame=async(b,u)=>{{const r=this._requestAnimationFrameMap.get(b);r&&cancelAnimationFrame(r)}const T=(r=Date.now())=>{u(r);const c=requestAnimationFrame(T);this._requestAnimationFrameMap.set(b,c)};T()};clearRequestAnimationFrame=async(b=[])=>{b.length===0&&(b=[...this._requestAnimationFrameMap.keys()]);const u=[];for(const T of b){const r=this._requestAnimationFrameMap.get(T);r&&(cancelAnimationFrame(r),u.push(r))}return u};_checkUserStreamOrigin=({p2pAverageQuality:b,sfuAverageQuality:u})=>b-(u+this.config.sfuPriority)>=0?"p2p":"sfu";_reportP2PConnect=(b,u)=>{let T;switch(b){case"success":T=0;break;case"fail":T=1;break;case"ignore":T=2;break;case"disconnect":T=3;break;case"poor_network":T=4;break}const{mediaTypes:r,...c}=u,e=[];for(const i of r){const _=mediaType_keys.findIndex(x=>x===i);e.push(_)}return this.cws.createRequest("reportP2PConnectEx").send({data:{...c,code:T,types:e}})};_reportLog=(b,u="未知错误")=>{const{appid:T,userId:r,earlyId:c="",logUrl:e,reportErr:t}=this.config;if(!t||!this.config.logUrl)return;const i="web",_=x=>({ws_c_timeout:0,webrtc_c_timeout:1,join_room_error:2,publish_error:3,subscribe_error:4,close_track_error:5,heartbeat_e_timeout:6,heartbeat_i_timeout:7,quit_room_error:8})[x].toString();{const x=_(b),C={origin:i,type:x,app_id:T,user_id:r,ins_id:c,desc:u},F=btoa(encodeURI(JSON.stringify(C))),j=`${e}/upload/log?log_key=${F}`;{const Z=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),re=new TextEncoder().encode(Z),K=pako.deflate(re,{gzip:!0});this.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLog",{obj:C,url:j,size:at(K.byteLength)}),fetch(j,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:K})}}}}class ActionBase{base;constructor({base:b}){this.base=b}_debugger=async()=>{await this.base.cws.createRequest("debugger",{onBack:!1}).send({data:{}})};_ai=async()=>{await this.base.cws.createRequest("ai",{onBack:!1}).send({data:{}})};_testQuitRoom=()=>{const{roomId:b,userId:u,callType:T,sdkToken:r}=this.base.config;this.base.cws.createRequest("quitRoomEx").send({data:{roomId:b,userId:u}}),this.base.cws.createRequest("joinRoomEx").send({data:{callType:T,roomId:b,user:{id:u,tracks:[],callAction:0},token:r},version:2})}}const g=(m,b)=>{if(!(m!=null&&m.ip)||!(m!=null&&m.port)||!(m!=null&&m.serve_ip)||!(m!=null&&m.serve_port)||!(b!=null&&b.ip)||!(b!=null&&b.port)||!(b!=null&&b.serve_ip)||!(b!=null&&b.serve_port))return"Unknown";const[u,T]=[m.ip,m.port],[r,c]=[m.serve_ip,m.serve_port],[e,t]=[b.ip,b.port],[i,_]=[b.serve_ip,b.serve_port];return u===e&&T===t?"Full Cone":u===r&&(e!==r||t!==T)||e===i&&(u!==i||T!==t)?"Restricted Cone":u===r&&T===c&&(e!==r||t!==c)||e===i&&t===_&&(u!==i||T!==_)?"Port Restricted Cone":"Symmetric"},h=async()=>{const m="stun.cloudflare.com:3478",b="stun.l.google.com:19302",u=async T=>new Promise(r=>{const c=new RTCPeerConnection({iceServers:[{urls:`stun:${T}`}]});c.createDataChannel("ice-channel");let e=null;c.onicecandidate=t=>{var i,_;if(((i=t.candidate)==null?void 0:i.type)==="srflx"){const[x,C]=T.split(":").map(F=>F.trim());e={ip:t.candidate.address||"",port:(_=t.candidate.port)==null?void 0:_.toString(),serve_ip:x,serve_port:C},c.close(),r(e)}},setTimeout(()=>{c.close(),r(null)},5e3),c.createOffer().then(t=>c.setLocalDescription(t)).catch(()=>r(null))});try{const T=await u(m),r=await u(b);if(!T||!r)return{address:"",natType:"Unknown"};const c=g(T,r);return{address:T.ip||"",natType:c}}catch(T){return console.error("获取NAT类型失败:",T),{address:"",natType:"Unknown"}}};class ActionSFU{base;_onOnline;_reconnectTimerId;constructor({base:b}){this.base=b,this.base.cws.on.close=u=>{switch(u.code){case 1e3:case 4001:case 4002:case 4003:this._clear();break;case 4010:this._connectCws();break;default:{if(this.base.config.isInRoom===!1)return;if(this.base.cws.prws.reconnectCount>=8)return this._clear();if(this.base.cws.prws.reconnectCount>=8)return this._clear();this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: Reconnect in 5 seconds.",{reconnectCount:this.base.cws.prws.reconnectCount,code:u.code}),this._reconnectTimerId&&clearTimeout(this._reconnectTimerId),this._reconnectTimerId=window.setTimeout(()=>{this._reconnectCws()},1e3*5)}break}},this.base.cws.on.open=()=>{this.base.setRoomState("connected"),this.base.config.isInRoom===!0&&this._syncRoomInfo().catch(()=>this._clear())},this.base.peer.on.state=u=>{u==="failed"||u==="closed"?this._restorePeer():this.base.setPeerState(u)},this.base.cws.on.onJoinRoom=u=>{const{roomId:T}=u.data;if(T!==this.base.config.roomId){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: The received message does not belong to the current room.",u);return}this.base.users.initUsers([u.data.user]),this.base.users.emitUsersChange(),this.base.notifys.emit("onJoinRoom",u)},this.base.cws.on.onQuitRoom=u=>{const{id:T}=u.data.user,r=this.base.users.getRemoteUserContent(T);if(!r)return;const c=r.removeTracks(mediaType_keys),e=[],t=[];for(const i of c){const{mid:_,msid:x}=i;x&&_&&(e.push(_),t.push(i))}t.length!==0&&(this.base.peer.stopReceivers(e),this._closeTrack(t)),this.base.users.removeRemoteUser(u.data.user.id),this.base.users.emitUsersChange(),this.base.notifys.emit("onQuitRoom",u)},this.base.cws.on.onPublish=u=>{const{roomId:T}=u.data;if(T!==this.base.config.roomId){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: The received message does not belong to the current room.",u);return}const{id:r,callAction:c,tracks:e}=u.data.user,t=this.base.users.getRemoteUserContent(r);if(!t)return;const i=[];for(const _ of e){const{type:x}=_,C=mediaType_keys[x],F=t.getTrack(C);F&&F.msid&&i.push(F)}if(i.length!==0&&this._closeTrack(i),t.updateTracks(e),t.updateCallAction(c),this.base.users.emitUsersChange(),this.base.config.newPublishAutoSubscribe){const _=Array.from(e,({type:x})=>mediaType_keys[x]);this.subscribe([{userId:r,mediaTypes:_}])}else this.base.notifys.emit("onPublish",u)},this.base.cws.on.onCloseTrack=u=>{const{id:T,callAction:r,tracks:c}=u.data.user,e=this.base.users.getRemoteUserContent(T);if(!e)return;e.updateCallAction(r);const t=Array.from(c,({type:i})=>mediaType_keys[i]);this.stopSubscribe([{userId:T,mediaTypes:t}]),e.removeTracks(t)},this.base.cws.on.onTrackInactive=u=>{const{session:T,tracks:r=[]}=u.data;if(T!==this.base.config.callSession)return this._restorePeer();const c=[];for(const e of r){const{type:t,trackName:i}=e,_=mediaType_keys[t],x=this.base.users.localUser.getTrack(_);x&&x.trackName===i&&c.push(x)}if(c.length!==0){const e=Array.from(c,t=>t.mediaType);this._closeTrack(c).finally(()=>this.publish(e))}},this.base.cws.on.onUpdateCall=u=>{const{id:T,callAction:r}=u.data.user,c=this.base.users.getRemoteUserContent(T);c&&(c.updateCallAction(r),this.base.users.emitUsersChange())},this.base.cws.on.onUpdatePermissions=u=>{const{user:T}=u.data,{id:r,permissions:c=1}=T;c===1?this.base.users.localUser.id===r?(this.base.users.localUser.updatePermissions(c),this.pauseTracks(["mc_audio","mc_video"],!0)):this.base.users.removeRemoteUser(r):c===3&&this.base.users.initUsers([T]),this.base.users.emitUsersChange()},this.base.cws.on.onUpdateBehavior=u=>{const{users:T}=u.data;for(const r of T){const{id:c,behavior:e}=r,t=this.base.users.getUserContent(c);t&&t.updateBanBehavior(e)}},this.base.cws.on.onNetQuality=u=>{const{qualities:T=[]}=u.data;let r=!1;for(const c of T){const{userId:e,egress:t,ingress:i}=c,_=this.base.users.getRemoteUserContent(e);if(!_)continue;_.updateNetwork({egress:t,ingress:i})===!1&&(r=!0)}r&&this.base.users.emitUsersChange()},this.base.cws.on.onRoomUserSpeech=u=>{this.base.notifys.emit("onRoomUserSpeech",u)},this.base.cws.on.onBeforeTokenExpire=u=>{this.base.notifys.emit("onBeforeTokenExpire",u)},this.base.cws.on.onTokenExpired=u=>{this.base.notifys.emit("onTokenExpired",u)},this.base.cws.on.onCDNPlayUrlAdd=u=>{this.base.notifys.emit("onCDNPlayUrlAdd",u)},this._onOnline=()=>{this._reportNetwork()},window.addEventListener("online",this._onOnline)}setLocalStream=(b,u)=>new Promise(async(T,r)=>{try{if(this.base.users.localUser.usePhoneyStream(b),u){if(b.includes("mc_audio")&&b.includes("mc_video")?await this.base.localMedias.initLocalStreamTrack("mc"):b.includes("mc_audio")?await this.base.localMedias.initLocalStreamTrack("mc_audio"):b.includes("mc_video")?await this.base.localMedias.initLocalStreamTrack("mc_video"):b.includes("ss_audio")&&b.includes("ss_video")?await this.base.localMedias.initLocalStreamTrack("ss"):b.includes("ss_audio")&&!b.includes("ss_video")?await this.base.localMedias.initLocalStreamTrack("ss_audio"):b.includes("ss_video")&&!b.includes("ss_audio")&&await this.base.localMedias.initLocalStreamTrack("ss_video"),b.includes("ss_audio")){const c=this.base.users.localMedias.getLocalStreamTrack("ss_audio");c&&(c.onended=()=>this.stopPublish(["ss_audio","ss_video"]))}if(b.includes("ss_video")){const c=this.base.users.localMedias.getLocalStreamTrack("ss_video");c&&(c.onended=()=>this.stopPublish(["ss_audio","ss_video"]))}this.base.users.localUser.useLocalStream(b),this.base.peer.syncSenderStreamTrack(b)}else for(const c of b)this.base.localMedias.stopLocalStreamTrack(c);T(!0)}catch(c){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",c),r(c)}});setMediaDeviceKind=(b,u)=>new Promise(async(T,r)=>{try{await this.base.users.localMedias.setMediaDeviceKind(b,u);const c=this.base.users.localUser;switch(b){case"audioinput":c.usePhoneyStream(["mc_audio"]),!!this.base.localMedias.getLocalStreamTrack("mc_audio")===!0&&(await this.base.localMedias.initLocalStreamTrack("mc_audio"),c.useLocalStream(["mc_audio"])),this.base.peer.syncSenderStreamTrack(["mc_audio"]),this.base.users.syncRemoteUserP2PSenderStreamTrack(["mc_audio"]);break;case"videoinput":c.usePhoneyStream(["mc_video"]),!!this.base.localMedias.getLocalStreamTrack("mc_video")===!0&&(await this.base.localMedias.initLocalStreamTrack("mc_video"),c.useLocalStream(["mc_video"])),this.base.peer.syncSenderStreamTrack(["mc_video"]),this.base.users.syncRemoteUserP2PSenderStreamTrack(["mc_video"]);break;case"audiooutput":await this.base.users.localMedias.changeAudiooutput();break}T(!0)}catch(c){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",c),r(c)}});setMediaTrackConstraints=async(b,u)=>{this.base.localMedias.setMediaTrackConstraints(b,u),this.base.users.localMedias.isOpenMediaDevice(b)&&["video"].includes(b)&&await this.setLocalStream([b],!0)};earlyConnect=(b=[])=>new Promise(async(u,T)=>{try{b.length===0&&(b=["mc_audio","mc_video"]),this.base.config.isEarly=!0,await this._connectCws(),this._initHeartbeat("heartbeatEx"),await this._connectCF(),this._createTrack(b),u(!0)}catch(r){this.base._reportLog("ws_c_timeout",r.msg||r),T(r)}});joinRoom=async b=>new Promise(async(u,T)=>{try{this.base.config.setOptions(b),this.base.users.localUser.id=b.userId,this.base.traffic.clear(),this.base.users.remoteUsers.clear();const{userId:r,callType:c,sdkToken:e,roomId:t,stt:i=!1,lang:_,isEarly:x}=this.base.config;(x===!1||this.base.cws.prws.ws&&[2,3].includes(this.base.cws.prws.ws?.readyState))&&await this._connectCws();const{input:C="zh",output:F="zh",translateEnable:j=!1}=_||{},ee=await this.base.cws.createRequest(x?"joinRoomEx":"joinRoom").send({data:{callType:c,roomId:t,user:{id:r,tracks:[],callAction:0},token:e,stt:i,lang:{input:C,output:F,translateEnable:j}},version:2}),{code:re=0,desc:K="服务器繁忙",data:se}=ee;if(re!==200)throw new Error(K);if(se.roomId!==t)return T("加入的房间不匹配");this.base.users.config.isInRoom=!0,await this._connectCF(),await this.base.peer.waitings.peerConnected(),this._initHeartbeat("heartbeat"),this.base.users.initUsers(se.roomUsers||[]),this.base.users.emitUsersChange(),u(!0)}catch(r){T(r)}});publish=b=>new Promise(async(u,T)=>{try{if(b.includes("ss_audio")&&!b.includes("ss_video")){const i=b.findIndex(_=>_==="ss_audio");b.splice(i,1)}const r=this.base.users.localUser;if(r.checkBanBehavior(b)===!1)throw new Error("publish is error: prohibited by administrator.");await this._createTrack(b);const c=this.base.peer.getSenderUserTracks(b),{invalid_mediaTypes:e}=this.base.localMedias.checkLocalStreamTracks(b);e.length!==0&&await this.setLocalStream(b,!0),r.updateTracks(c),await this._notifySelfCallAction();const{valid_mediaTypes:t}=this.base.localMedias.checkLocalStreamTracks(b);await this._pubNotify(t),this.base.users.emitUsersChange(),u(!0)}catch(r){T(r)}});stopPublish=b=>new Promise(async(u,T)=>{try{const r=this.base.users.localUser;for(const e of b)this.base.users.localUser.published[e]=!1;this.base.peer.stopSenders(b);const c=r.removeTracks(b);if(c.length===0)return u(!0);await this._closeTrack(c),await this._notifySelfCallAction(),await this.setLocalStream(b,!1),this.base.users.emitUsersChange(),u(!0)}catch(r){this.base._reportLog("close_track_error",r.message||r),T(r)}});pauseTracks=async(b,u)=>new Promise(async(T,r)=>{try{const c=this.base.users.localUser;u?c.usePhoneyStream(b):c.useLocalStream(b),this.base.users.syncRemoteUserP2PSenderStreamTrack(b),this.base.peer.syncSenderStreamTrack(b),await this._notifySelfCallAction(),this.base.users.emitUsersChange(),T(!0)}catch(c){r(c)}});subscribe=b=>{if(b===void 0){b=[];const r=this.base.users.remoteUsers.keys();for(const c of r)b.push({userId:c,mediaTypes:mediaType_keys})}const u=[];for(const r of b){const{userId:c,mediaTypes:e}=r,t=this.base.users.getRemoteUserContent(c);if(!t)continue;const i=[];for(const _ of e)t.tracks[_]?.origin==="sfu"&&i.push(_);i.length!==0&&u.push({userId:c,mediaTypes:i})}u.length!==0&&this.stopSubscribe(u);const T=()=>new Promise(async(r,c)=>{try{if(b.length===0)return r(!0);await this.base.peer.waitings.peerConnected(),this.base.users.addRemoteUsersSubscribes(b);const e=async()=>{const i=this.base.users.executeRemoteUsersSubscribes();if(i.length===0)return!0;let _=!1;const C=await this.base.cws.createRequest("subscribe").send({data:{session:this.base.config.callSession,users:i}}),{code:F=0,desc:j,sn:Z,data:ee={}}=C;if(await this._ackMsg(Z),F===200){const{remoteSdp:re,users:K}=ee;if(re){const fe=new RTCSessionDescription({type:"offer",sdp:re});await this.base.peer.setRemoteDescription(fe),await this._renegotiate()}if(!K)throw new Error("The subscription was successful but the correct subscription object was not returned.");let se=0;for(const fe of K){const{id:G,tracks:ne}=fe;if(!G||!ne)continue;const ae=this.base.users.getRemoteUserContent(G);for(const oe of ne){const{code:le=0,type:pe,mid:te,trackName:ue}=oe;switch(le){case 200:{const he=mediaType_keys[pe],me={type:pe,mid:te,trackName:ue,mediaType:he};ae?.updateTracks([me]),ae?.completedSubscribe([he]),ae?.useRemoteStream([he],this.base.peer)}break;case 2026:{const he=mediaType_keys[pe];ae?.setPublishWaiting([he])}break;default:se+=1;break}}}se===0&&(_=!0),this.base.users.emitUsersChange()}else if(F===2017&&j.includes("renegotiation is expected before pulling or pushing tracks"))await this._renegotiate();else if(F===2026){const re=b||[];for(const K of re){const{userId:se,mediaTypes:fe}=K;this.base.users.getRemoteUserContent(se)?.setPublishWaiting(fe)}}return _};await e()===!1&&(this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: The failed track will be resubscribed after 4 seconds."),await new Promise(i=>setTimeout(()=>i(!0),1e3*4)),await e()),r(!0)}catch(e){this.base._reportLog("subscribe_error",e.message||e),c(e)}});return this.base.asyncQueue.add(T,{describe:"subscribe"})};stopSubscribe=b=>new Promise(async(u,T)=>{try{if(b===void 0){b=[];const c=this.base.users.remoteUsers.keys();for(const e of c)b.push({userId:e,mediaTypes:mediaType_keys})}if(b.length===0)return u(!0);const r=[];for(const c of b){const{userId:e,mediaTypes:t}=c,i=this.base.users.getRemoteUserContent(e);if(!i)continue;const _=[];for(const x of t){const C=i.getTrack(x);C&&(C.origin==="sfu"&&C.msid?(r.push(C),i.usePhoneyStream([x])):C.origin==="p2p"&&i.p2p?.activeRecv[x]!==void 0&&_.push(x))}_.length!==0&&(i.p2p?.setRecvTracksEnabled(_,!1),i.usePhoneyStream(_),this.base._reportP2PConnect("disconnect",{desc:"Take the initiative to disconnect.",pushId:i.id,pullId:this.base.config.userId,mediaTypes:_}))}r.length!==0&&await this._closeTrack(r),this.base.users.emitUsersChange(),u(!0)}catch(r){this.base._reportLog("close_track_error",r.message||r),T(r)}});quitRoom=()=>new Promise(async b=>{const{roomId:u,userId:T,isInRoom:r}=this.base.config;try{if(r===!1)return b(!0);this.base.config.isInRoom=!1,this.base.intervalQueue.removeQueueItem(["heartbeat-interval","peerAnalysis"]),await this.setLocalStream(mediaType_keys,!1),await this.base.cws.createRequest("quitRoom").send({data:{roomId:u,userId:T}})}catch(c){this.base._reportLog("quit_room_error",c.message||c)}this.base.users.clearUsers(),this.base.setRoomState("ready"),this.base.asyncQueue.clear();try{this.base.peer.close(),this.base.cws.close()}catch{}b(!0)});quitRoomEx=()=>new Promise(async b=>{try{const{roomId:u,userId:T,isInRoom:r}=this.base.config;if(r===!1)return b(!0);this.base.config.isInRoom=!1,this._initHeartbeat("heartbeatEx"),await this.setLocalStream(mediaType_keys,!1),await this.base.cws.createRequest("quitRoomEx").send({data:{roomId:u,userId:T}})}catch(u){this.base._reportLog("quit_room_error",u.message||u)}try{await this.stopSubscribe()}catch(u){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: StopSubscribe is error at quitRoomEx. start init earlyConnect.",u),this.earlyConnect()}this.base.users.clearUsers(),this.base.setRoomState("ready"),b(!0)});setBanBehaviors=b=>new Promise(async(u,T)=>{try{const{roomId:r}=this.base.config,c=[];for(const x of b){const{id:C,banBehaviors:F}=x,j=Object.keys(F);if(j.length===0)continue;const Z=[];for(const re of j){const K=mediaType_keys.findIndex(G=>G===re),se=F[re],fe={type:K,behavior:se};Z.push(fe)}const ee={id:C,behaviors:Z};c.push(ee)}const t=await this.base.cws.createRequest("preventUsersBehavior").send({data:{roomId:r,users:c}}),{code:i=0,desc:_}=t;if(i!==200)return T(_);u(t)}catch(r){T(r)}});toggleRoomSpeechLang=b=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest("toggleRoomSpeechLang").send({data:b})};updateToken=b=>{this.base.config.isInRoom===!0&&this.base.cws.createRequest("updateRoomToken").send({data:{roomId:this.base.config.roomId,sdkToken:b}})};destroy=()=>{this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [Destroy]"),this.base.config.isInRoom=!1,this._clear(),this._reconnectTimerId&&(clearTimeout(this._reconnectTimerId),this._reconnectTimerId=void 0),this._onOnline&&(window.removeEventListener("online",this._onOnline),this._onOnline=void 0),this.base.localMedias.destroy(),this.base.notifys.emit("onDestroyRoom",{code:200,desc:"Is destroy.",data:{}})};_clear=()=>{this.base.cws.clearEvents(),this.base.cws.close(),this.base.peer.close(),this.base.intervalQueue.removeQueueItem(["heartbeat-interval","peerAnalysis"]),this.base.asyncQueue.clear(),this.base.users.clearUsers(),this.setLocalStream(mediaType_keys,!1),this.base.setRoomState("closed")};_connectCws=async()=>{this.base.setRoomState("connecting");const b=this.base.config.createWsUrl();await this.base.cws.connect(b),this.base.setRoomState("connected")};_reconnectCws=async()=>{this.base.setRoomState("connecting"),this.base.cws.prws.url=this.base.config.createWsUrl(),this.base.cws.prws.reconnect(),this.base.setRoomState("connected")};_initHeartbeat=b=>{if(this.base.cws.needRestoreRoom()===!0)return this._restoreRoom();if(this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]),b==="heartbeat"){const T=()=>{if(this.base.cws.prws.ws?.readyState!==1)return;const r=this.base.cws.createRequest(b,{onBack:!1}),c=this.base.traffic.getUse("kb"),{outboundBytes:e,inboundBytes:t}=c.sfu,{outboundBytes:i,inboundBytes:_}=c.p2p,x={sfuPush:e,sfuPull:t,p2pPush:i,p2pPull:_};r.send({data:x})};this.base.intervalQueue.addQueueItem({key:"heartbeat-interval",func:T,interval:1e3*10})}else{const T=()=>{if(this.base.cws.prws.ws?.readyState!==1)return;const r=this.base.cws.createRequest(b,{onBack:!1}),c={};r.send({data:c})};this.base.intervalQueue.addQueueItem({key:"heartbeat-interval",func:T,interval:1e3*30})}};_connectCF=async()=>{if(["connecting","connected"].includes(this.base.peer.pc.connectionState))return;await this.base.peer.init();let b;b=await this.base.cws.createRequest("connectCF").send({compress:!0,data:{sdp:this.base.peer.getSdp()}});const{code:u=0,desc:T,data:r,sn:c}=b;if(await this._ackMsg(c),u!==200)throw new Error(T);const{remoteSdp:e,session:t}=r;this.base.config.callSession=t||"";const i=e||"";await this.base.peer.setRemoteDescription({type:"answer",sdp:i}),await $t(this.base.peer.waitings.peerConnected,{message:"ice connect is timeout.",timeout:10*1e3}),this._reportNetwork(),this.base.intervalQueue.addQueueItem({key:"peerAnalysis",func:this._calculateNetwork,interval:1e3})};_createTrack=b=>{const u=()=>new Promise(async(T,r)=>{try{await this.base.peer.waitings.peerConnected();const c=await this.base.peer.addSenders(b),e=this.base.peer.getSenderUserTracks(c);if(e.length===0)return T(!0);const t=this.base.peer.getSdp(),i=this.base.cws.createRequest("publish");let _=await i.send({compress:!0,version:4,data:{session:this.base.config.callSession,sdp:t,tracks:e,callAction:0}});const{code:x=0,sn:C}=_;if(await this._ackMsg(C),x===2116){await this._connectCF(),await this.base.peer.waitings.peerConnected(),_=await i.send({compress:!0,data:{session:this.base.config.callSession,sdp:t,tracks:e,callAction:0}});const{sn:F}=_;await this._ackMsg(F)}{const{code:F=0,desc:j,data:Z={}}=_;if(F!==200)throw new Error(j);const{remoteSdp:ee}=Z;await this.base.peer.setRemoteDescription({type:"answer",sdp:ee||""})}T(!0)}catch(c){this.base._reportLog("publish_error",c.message||c),r(c)}});return this.base.asyncQueue.add(u,{describe:"createTrack"})};_closeTrack=(b=[])=>{const u=()=>new Promise(async(T,r)=>{try{await this.base.peer.createOffer();const e=await this.base.cws.createRequest("closeTrack").send({compress:!0,data:{roomId:this.base.config.roomId,sdp:this.base.peer.getSdp(),tracks:b}}),{code:t=0,desc:i,data:_={}}=e;if(t!==200)throw new Error(i);await this.base.peer.setRemoteDescription({type:"answer",sdp:_.remoteSdp||""}),T(!0)}catch(c){r(c)}});return this.base.asyncQueue.add(u,{describe:"closeTrack"})};_pubNotify=async b=>{const u=this.base.peer.getSenderUserTracks(b),T=pt(u,["type","trackName","mid"]),{callSession:r,roomId:c,userId:e}=this.base.config;await this.base.cws.createRequest("pubNotify").send({data:{session:r,roomId:c,user:{id:e,tracks:T}}});for(const i of b)this.base.users.localUser.published[i]=!0};_renegotiate=async()=>{await this.base.peer.createAnswer();const u=await this.base.cws.createRequest("renegotiate").send({data:{sdp:this.base.peer.getSdp()},compress:!0}),{code:T=0,desc:r,sn:c}=u;if(await this._ackMsg(c),T!==200)throw new Error(r)};_ackMsg=async b=>{await this.base.cws.createRequest("ackMsg",{onBack:!1}).send({data:{msgId:b}})};_notifySelfCallAction=async()=>{const b=this.base.users.localUser;b.updateSelfCallAction();const{roomId:u}=this.base.config,{id:T,callAction:r}=b,e=await this.base.cws.createRequest("updateCall").send({data:{roomId:u,user:{id:T,callAction:r}}}),{code:t=0}=e;if(t!==200)throw new Error("NotifySelfCallAction is error.")};_calculateNetwork=async()=>{if(this.base.cws.prws.ws?.readyState!==1||this.base.peer.pc.connectionState!=="connected")return;const b={sfu:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0},p2p:{inboundBytes:0,outboundBytes:0,lostRate:0,roundTripTime:0,jitter:0,quality:0,averageQuality:0,velocityPush:0,velocityPull:0}},u=[],T=[];{const r=[0],c=[0],e=[0],t=[],i=[],_=new Date().getTime(),x=this.base.users.localUser;await x.generateTrackAnalysis(this.base.peer);for(const Z of mediaType_keys)if(x.published[Z]&&x.getTrack(Z)){const{trackReport:ee}=x.tracksAnalysis.sfu.sends[Z],{offsetBytesSent:re,lostRate:K,roundTripTime:se,jitter:fe,quality:G,averageQuality:ne,averageOffsetBytesSent:ae}=ee;this.base.traffic.sfu.outboundBytes+=re,b.sfu.velocityPush+=ae,r.push(K),c.push(se),e.push(fe),G!==0&&t.push(G),ne!==0&&i.push(ne),u.push(G)}const C=this.base.users.remoteUsers.values();for(const Z of C){await Z.generateTrackAnalysis(this.base.peer);for(const ee of mediaType_keys)if(Z.getTrack(ee)){const{trackReport:re}=Z.tracksAnalysis.sfu.recvs[ee],{offsetBytesSent:K,lostRate:se,roundTripTime:fe,jitter:G,quality:ne,averageQuality:ae,averageOffsetBytesSent:oe}=re;this.base.traffic.sfu.inboundBytes+=K,b.sfu.velocityPull+=oe,r.push(se),c.push(fe),e.push(G),ne!==0&&t.push(ne),ae!==0&&i.push(ae),T.push(ne)}}const j=new Date().getTime()-_;j>1e3&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: generateTrackAnalysis taking too much time.",{offset_time:j}),b.sfu.lostRate=Math.max(...r),b.sfu.roundTripTime=Math.max(...c),b.sfu.jitter=Math.max(...e),b.sfu.quality=t.length===0?0:Math.min(...t),b.sfu.averageQuality=i.length===0?0:Math.min(...i)}{const r=[0],c=[0],e=[0],t=[],i=[],_=this.base.users.remoteUsers.values();for(const x of _)for(const C of mediaType_keys)if(x.p2p){{const{trackReport:F}=x.tracksAnalysis.p2p.sends[C],{offsetBytesSent:j,lostRate:Z,roundTripTime:ee,jitter:re,quality:K,averageQuality:se,averageOffsetBytesSent:fe}=F;this.base.traffic.p2p.outboundBytes+=j,b.p2p.velocityPush+=fe,r.push(Z),c.push(ee),e.push(re),K!==0&&t.push(K),se!==0&&i.push(se),u.push(K)}{const{trackReport:F}=x.tracksAnalysis.p2p.recvs[C],{offsetBytesSent:j,lostRate:Z,roundTripTime:ee,jitter:re,quality:K,averageQuality:se,averageOffsetBytesSent:fe}=F;this.base.traffic.p2p.inboundBytes+=j,b.p2p.velocityPull+=fe,r.push(Z),c.push(ee),e.push(re),K!==0&&t.push(K),se!==0&&i.push(se),T.push(K)}}b.p2p.lostRate=Math.max(...r),b.p2p.roundTripTime=Math.max(...c),b.p2p.jitter=Math.max(...e),b.p2p.quality=t.length===0?0:Math.min(...t),b.p2p.averageQuality=i.length===0?0:Math.min(...i)}{const r=this.base.traffic.getUse();b.sfu.outboundBytes=r.sfu.outboundBytes,b.sfu.inboundBytes=r.sfu.inboundBytes,b.p2p.outboundBytes=r.p2p.outboundBytes,b.p2p.inboundBytes=r.p2p.inboundBytes}this.base.config.network=b,this.base.notifys.emit("onRoomNetwork",{code:200,data:b,desc:"RoomNetwork is change."});{const r=this.base.users.localUser,c=u.length===0?0:Math.round(u.reduce((i,_)=>i+_)/u.length),e=T.length===0?0:Math.round(T.reduce((i,_)=>i+_)/T.length);r.updateNetwork({egress:c,ingress:e})===!1&&(this.base.cws.createRequest("networkQualityChange",{onBack:!1}).send({data:{egress:c,ingress:e,userId:r.id,roomId:this.base.config.roomId}}),this.base.users.emitUsersChange())}this._checkAndSelectUserStreamOrigin()};_checkAndSelectUserStreamOrigin=async()=>{if(this._hasAsyncTask("subscribe")||this._hasAsyncTask("publish")||this._hasAsyncTask("closeTrack"))return;const b=this.base.config.network.sfu.averageQuality,u=this.base.users.remoteUsers.values(),T=[],r=[],c=new Date().getTime();for(const e of u){const t=e.p2p;if(!t)continue;const i=[];for(const _ of mediaType_keys){if(!t.hasRecvier(_))continue;const C=t.checkReceActive(_);if(!C)continue;const F=e.getTrack(_);if(!F){t.setRecvTracksEnabled([_],!1);continue}const{averageQuality:j,availableScore:Z}=e.tracksAnalysis.p2p.recvs[_]?.trackReport;let ee=this.base._checkUserStreamOrigin({p2pAverageQuality:j,sfuAverageQuality:b});F.origin==="p2p"&&c-C>=1e4&&Z<.6&&(ee="sfu",this.base.config.debug===!0&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: Switching to SFU. availableScore: ${Z}`,{remoteUserId:e.id,mediaType:_,availableScore:Z})),ee!==F.origin&&(ee==="p2p"?(e.useRemoteP2PStream([_]),r.push(F)):i.push(_))}i.length!==0&&(this.base._reportP2PConnect("disconnect",{desc:"Poor quality of P2P. ",pushId:e.id,pullId:this.base.config.userId,mediaTypes:i}),T.push({userId:e.id,mediaTypes:i}))}if(r.length!==0&&await this._closeTrack(r),T.length!==0){await this.subscribe(T);for(const e of T){const{userId:t,mediaTypes:i}=e;try{this.base.users.getRemoteUserContent(t)?.p2p?.setRecvTracksEnabled(i,!1)}catch(_){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [_checkAndSelectUserStreamOrigin]",_)}}}r.length!==0&&T.length===0&&this.base.users.emitUsersChange()};_reportNetwork=async()=>{try{let b=0;const{address:u,natType:T}=await h();switch(T){case"Symmetric":b=0;break;case"Full Cone":b=1;break;case"Port Restricted Cone":b=2;break;case"Restricted Cone":b=3;break}let r=0;{const e=isMobile(),i=(navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType;e||(["wifi","4g"].includes(i)?r=0:r=2),e&&(["wifi"].includes(i)?r=0:r=2)}await this.base.cws.createRequest("reportNetwork").send({data:{nat:b,type:r,ip:u}})}catch(b){this.base.config.debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [reportNetwork]",b)}};_hasAsyncTask=b=>{let u=!1;return this.base.asyncQueue.activePromise?.describe===b&&(u=!0),u===!1&&this.base.asyncQueue.queue.find(r=>r.describe===b)&&(u=!0),u};_syncRoomInfo=async()=>{const b=this.base.users.localUser,u={pull:[],push:[]};{const C=this.base.users.remoteUsers.values();for(const F of C){const{id:j,p2p:Z}=F;if(!Z)continue;const ee=[],re=[];for(const K of mediaType_keys){const se=mediaType_keys.findIndex(fe=>fe===K);{if((Z.activeSend[K]||!1)===!1)continue;ee.push(se)}{if((Z.activeRecv[K]||!1)===!1)continue;re.push(se)}}ee.length!==0&&u.push.push({userId:j,types:ee}),re.length!==0&&u.pull.push({userId:j,types:re})}}const r=await this.base.cws.createRequest("syncRoomInfo").send({data:{user:{id:b.id,callAction:b.callAction},p2pState:u}}),{code:c=0,desc:e,data:t={}}=r;if(c!==200)throw new Error(e);if(t.isActive===!1)throw new Error("Do not stay in this room.");const i=t.users||[];if((i.find(C=>C.id===b.id)||!1)===!1)throw new Error("Need to rejoin the room.");const x=this.base.users.remoteUsers.values();for(const C of x){const F=i.find(K=>K.id===C.id)||!1;if(!F){this.base.users.removeRemoteUser(C.id);continue}const{callAction:j=0,permissions:Z=0,behavior:ee=0,tracks:re=[]}=F;C.updateCallAction(j),C.updatePermissions(Z),C.updateBanBehavior(ee),C.updateTracks(re,!0)}this.base.users.emitUsersChange()};_restorePeer=async()=>new Promise(async(b,u)=>{try{this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [restorePeer]");let T=[];if(this.base.config.isInRoom){const i=this.base.users.remoteUsers.values();for(const _ of i){const x=[],C=_.getTracks(mediaType_keys);for(const F of C){const{mediaType:j,origin:Z,msid:ee}=F;(Z==="p2p"||Z==="sfu"&&ee!=="")&&x.push(j)}x.length!==0&&T.push({userId:_.id,mediaTypes:x})}}const r=this.base.users.localUser.getTracks(mediaType_keys),c=[],e=[],t=[];for(const i of r){const{enabled:_,mediaType:x}=i;c.push(x),_===!0?e.push(x):t.push(x)}if(await this._connectCF(),await this._syncRoomInfo(),T.length!==0&&await this.subscribe(T),c.length!==0){await this._createTrack(c);const i=this.base.peer.getSenderUserTracks(c);this.base.users.localUser.updateTracks(i),this.base.users.localUser.usePhoneyStream(c),e.length!==0&&(await this.setLocalStream(e,!0),this.base.users.localUser.useLocalStream(e)),await this._notifySelfCallAction();const{valid_mediaTypes:_}=this.base.localMedias.checkLocalStreamTracks(c);await this._pubNotify(_)}b(!0)}catch(T){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [RestorePeer is error.]",T),this._clear(),u(T)}});_restoreRoom=async()=>{this.base.intervalQueue.removeQueueItem(["heartbeat-interval"]);try{await this._connectCws().catch(b=>{throw this._clear(),b}),await this._restorePeer()}catch(b){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [RestoreRoom is error.]",b)}}}class ActionP2P{base;_p2pCheckTimeoutMap=new Map;constructor({base:b}){this.base=b,this.base.cws.on.onOffer=u=>{this._onOffer(u)},this.base.cws.on.onCandidate=u=>{this._onCandidate(u)},this.base.cws.on.onAttemptP2PEx=u=>{const{roomId:T,pushId:r,types:c=[],isRemotePush:e=!1}=u.data;if(c.length===0){this.base.config.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [onAttemptP2PEx] There is an error. types.length === 0",u);return}if(this.base.config.roomId!==T){this.base.config.debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: [onAttemptP2PEx] There is an error. roomId is inequality.",u);return}const t=Array.from(c,i=>mediaType_keys[i]);t.length!==0&&this._openP2P(r,t,e)},this.base.cws.on.onDisconnectedP2P=u=>{const{roomId:T,remoteUserId:r}=u.data;if(T!==this.base.config.roomId)return;const c=this.base.users.getRemoteUserContent(r);if(!c||!c.p2p)return;c.p2p.checkActive()===!1&&c.p2p.close()}}_openP2P=async(b,u,T)=>{if(u.length===0)return;const{useP2P:r,roomId:c,userId:e}=this.base.config;if(r===!1)throw new Error("You have disabled the p2p function on the client side.");try{const t=this.base.users.localUser,i=new Date().getTime(),_=this.base.users.getRemoteUserContent(b);if(!_)throw new Error("The remote user to be established does not exist.");const x=this._getRemoteUserP2PContent(b,!0),{prohibited_mediaTypes:C=[],subscribed_mediaTypes:F=[]}=_.checkSubscribed(u);if(T===!0&&C.length!==0&&(this.base._reportP2PConnect("ignore",{desc:"P2P connections without a subscription relationship are not allowed.",pullId:e,pushId:b,mediaTypes:C}),F.length===0))return;this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${b}]: start connect p2p.`,{isRemotePush:T}),T===!1?(x.close(),x.init()):x.peer?.connectionState!=="connected"&&x.init();const j=x.initRecvs(F);if(j.length!==0){const ee=()=>{const K=async()=>{const fe=await x.createOffer(),G=x.getRecvUserTracks(F),ae=await this.base.cws.createRequest("offer").send({data:{roomId:c,tracks:G,sender:{id:e,callAction:t.callAction},receiverId:b,sdp:fe.sdp}}),{code:oe=0,desc:le}=ae;if(oe!==200)throw new Error(le)};return $t(()=>new Promise(fe=>{this.base.cws.on.onAnswer=G=>{const{code:ne,data:ae}=G;if(ne!==200)return;const{sender:oe,sdp:le,tracks:pe=[]}=ae,{id:te}=oe;b===te&&fe({answer:{type:"answer",sdp:le},tracks:pe})},K()}),{message:"await_answer is timeout.",timeout:2e4})},re=async()=>{const K=await $t(x.getIcecandidates,{message:"get recv candidates is timeout.",timeout:1e4}),se=Array.from(K,({sdpMid:oe,sdpMLineIndex:le,candidate:pe})=>({sdpMid:oe,sdpMLineIndex:le,sdp:pe})),G=await this.base.cws.createRequest("candidate",{timeout:1e3*10}).send({data:{roomId:c,senderId:e,receiverId:b,candidates:se,isSubscribeReceiver:!0}}),{code:ne=0,desc:ae}=G;if(ne!==200)throw new Error(ae)};{const K=await ee(),{answer:se,tracks:fe=[]}=K;await x.setAnswer(se),await re();const G=[],ne=[];for(const ae of fe){const{type:oe,mid:le,enabled:pe=!1}=ae;if(oe===void 0)continue;const te=mediaType_keys[ae.type];ne.push(te),G.push({mediaType:te,mid:le,enabled:pe})}x.initSenders(G),x.setSendTracksEnabled(j,!1,"local")}}await $t(x.waitings.connected,{message:"ice connect is timeout.",timeout:10*1e3}),await $t(x.waitings.remoteChannelConnected,{message:"remote_channel connect is timeout.",timeout:10*1e3}),T===!0&&x.setRecvTracksEnabled(F,!0);const Z=`${new Date().getTime()-i}`;T===!0?await this.base._reportP2PConnect("success",{action:3,desc:"P2P connection successful.",pullId:e,pushId:b,mediaTypes:F,connectedTime:Z}):await this.base._reportP2PConnect("success",{action:2,desc:"P2P connection successful.",pullId:b,pushId:e,mediaTypes:u,connectedTime:Z}),this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${b}]: switch to P2P will be attempted within 10 seconds.`);{const ee=this._p2pCheckTimeoutMap.get(b);ee&&clearTimeout(ee);const re=window.setTimeout(()=>{this._p2pCheckTimeoutMap.delete(b);const K=[],se=this.base.users.getRemoteUserContent(b);if(!(!se||!se.p2p)){for(const fe of F){const G=se.p2p.activeRecv[fe]||!1,ne=se.getTrack(fe);G&&ne?.origin!=="p2p"&&K.push(fe)}K.length!==0&&(se.p2p.setRecvTracksEnabled(K,!1),this.base._reportP2PConnect("disconnect",{desc:"Poor quality of P2P.",pushId:se.id,pullId:this.base.config.userId,mediaTypes:K}))}},1e3*10);this._p2pCheckTimeoutMap.set(b,re)}}catch(t){this.base.users.getRemoteUserContent(b)?.p2p?.destroy(),this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [p2p]: onOpen p2p with ${b} is error.`,t),T===!0?await this.base._reportP2PConnect("fail",{action:0,desc:t.message||t,pullId:e,pushId:b,mediaTypes:u}):await this.base._reportP2PConnect("fail",{action:1,desc:t.message||t,pullId:b,pushId:e,mediaTypes:u})}};_onOffer=async b=>{const{code:u,data:T}=b;if(u!==200)return;const{sdp:r,sender:c={},tracks:e=[]}=T,{id:t}=c,{userId:i,roomId:_}=this.base.config,x=this.base.users.localUser;try{const C=this.base.users.getrP2PConnectedCount(),F=[],j=[];for(const fe of e){const{type:G,mid:ne,enabled:ae=!1}=fe;if(G===void 0)continue;const oe=mediaType_keys[fe.type];F.push(oe),j.push({mediaType:oe,mid:ne,enabled:ae})}if(C+F.length>3){if(F.length===2){const fe=F.findIndex(G=>G==="ss_video");F.splice(fe,1),await this.base._reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pushId:i,pullId:t,mediaTypes:["ss_video"]})}if(F.length===1){await this.base._reportP2PConnect("ignore",{desc:"P2P connections have reached the maximum limit.",pushId:i,pullId:t,mediaTypes:F});return}}const Z=this._getRemoteUserP2PContent(t,!0);this.base.config.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [${t}]: start connect p2p.`),Z.peer?.connectionState!=="connected"&&Z.init(),await Z.setOffer({type:"offer",sdp:r});{const fe=Z.initSenders(j);Z.setSendTracksEnabled(fe,!1,"local")}const ee=await Z.createAnswer(),re=Z.getSenderUserTracks(F),K=()=>new Promise(async(fe,G)=>{try{const ae=await this.base.cws.createRequest("answer").send({data:{roomId:_,tracks:re,sender:{id:x.id,callAction:x.callAction},receiverId:t,sdp:ee.sdp}}),{code:oe=0,desc:le}=ae;if(oe!==200)throw new Error(le);fe(!0)}catch(ne){G(ne)}}),se=()=>new Promise(async(fe,G)=>{try{const ne=await $t(Z.getIcecandidates,{message:"get send candidates is timeout.",timeout:1e4}),ae=Array.from(ne,({sdpMid:ue,sdpMLineIndex:he,candidate:me})=>({sdpMid:ue,sdpMLineIndex:he,sdp:me})),le=await this.base.cws.createRequest("candidate").send({data:{roomId:_,senderId:x.id,receiverId:t,candidates:ae,isSubscribeReceiver:!1}}),{code:pe=0,desc:te}=le;if(pe!==200)throw new Error(te);fe(!0)}catch(ne){G(ne)}});await K(),await new Promise(fe=>setTimeout(()=>fe(!0),1e3)),await se(),await $t(Z.waitings.connected,{message:"ice connect is timeout.",timeout:20*1e3})}catch(C){this.base.config.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: [p2p]: onReply p2p with ${t} is error.`,C)}};_onCandidate=async b=>{const{code:u,data:T}=b;if(u!==200)return;const{senderId:r,candidates:c=[],receiverId:e,isSubscribeReceiver:t=!1}=T,{userId:i}=this.base.config;if(t===!1||e!==i)return;const _=this.base.users.getRemoteUserContent(r);if(!_||!_.p2p){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: An error occurred in onCandidate.",_);return}const x=Array.from(c,({sdpMid:C,sdpMLineIndex:F,sdp:j})=>({sdpMid:C,sdpMLineIndex:F,candidate:j}));await _.p2p.addCandidates(x)};_getRemoteUserP2PContent=(b,u)=>{const T=this.base.users.getRemoteUserContent(b);if(!T)throw new Error("The remote user to be established does not exist.");if(u===!0&&(T.p2p||this.base.users.createRemoteUserP2P(b)),!T.p2p)throw new Error("The remote user p2p to be established does not exist.");return T.p2p};destroy=()=>{for(const b of this._p2pCheckTimeoutMap.values())clearTimeout(b);this._p2pCheckTimeoutMap.clear()}}class QuickVO{_base=new Base;_ACTION_BASE=new ActionBase({base:this._base});_ACTION_SFU=new ActionSFU({base:this._base});_ACTION_P2P=new ActionP2P({base:this._base});constructor(b){this._base.config.setOptions(b)}recorder=this._base.recorder;use=this._base.use;setCallStrategy=this._base.setCallStrategy;addRequestAnimationFrame=this._base.addRequestAnimationFrame;clearRequestAnimationFrame=this._base.clearRequestAnimationFrame;addNotify=this._base.notifys.add;setOptions=this._base.config.setOptions;getLocalStream=this._base.users.localUser.getStream;getLocalStreams=this._base.users.localUser.getStreams;setActiveNoise=this._base.users.localUser.setActiveNoise;getUserContent=this._base.users.getUserContent;getUserStream=this._base.users.getUserStream;getVolume=this._base.users.getVolume;getMaxVolumeUser=this._base.users.getMaxVolumeUser;setInputVolume=this._base.users.setInputVolume;setEnhanceGain=this._base.users.setEnhanceGain;setSpeakerVolume=this._base.users.setSpeakerVolume;getUserAudioMediaStreamContext=this._base.users.getUserAudioMediaStreamContext;playBgs=this._base.users.playBgs;changBgsMix=this._base.users.changBgsMix;stopBgs=this._base.users.stopBgs;setBgsGain=this._base.users.setBgsGain;playBgm=this._base.users.playBgm;changBgmMix=this._base.users.changBgmMix;stopBgm=this._base.users.stopBgm;setBgmGain=this._base.users.setBgmGain;getEnumerateDevices=this._base.localMedias.getEnumerateDevices;getMediaDeviceKind=this._base.localMedias.getMediaDeviceKind;getMediaDevicesErrInfo=this._base.localMedias.getMediaDevicesErrInfo;setLocalStream=this._ACTION_SFU.setLocalStream;setMediaDeviceKind=this._ACTION_SFU.setMediaDeviceKind;setMediaTrackConstraints=this._ACTION_SFU.setMediaTrackConstraints;earlyConnect=this._ACTION_SFU.earlyConnect;joinRoom=this._ACTION_SFU.joinRoom;publish=this._ACTION_SFU.publish;stopPublish=this._ACTION_SFU.stopPublish;pauseTracks=this._ACTION_SFU.pauseTracks;subscribe=this._ACTION_SFU.subscribe;stopSubscribe=this._ACTION_SFU.stopSubscribe;setBanBehaviors=this._ACTION_SFU.setBanBehaviors;toggleRoomSpeechLang=this._ACTION_SFU.toggleRoomSpeechLang;updateToken=this._ACTION_SFU.updateToken;quitRoom=this._ACTION_SFU.quitRoom;quitRoomEx=this._ACTION_SFU.quitRoomEx;destroy=()=>{this._ACTION_P2P.destroy(),this._ACTION_SFU.destroy()};getLocalUserTrackReports=this._base.users.getLocalUserTrackReports;getRemoteUserTrackReports=this._base.users.getRemoteUserTrackReports;_openP2P=this._ACTION_P2P._openP2P;_restoreRoom=this._ACTION_SFU._restoreRoom;_debugger=this._ACTION_BASE._debugger;_ai=this._ACTION_BASE._ai;_testQuitRoom=this._ACTION_BASE._testQuitRoom}const enum_callStrategy={qualityPriority:"画质优先",fluencyPriority:"流畅度优先",balancedDowngrade:"均衡降级"},callStrategy_options=Yt(enum_callStrategy),callStrategy_keys=Object.keys(enum_callStrategy),callStrategy_vals=Object.values(enum_callStrategy),enum_eventName={heartbeat:"心跳",heartbeatEx:"慢心跳",ackMsg:"确认收到消息",reportNetwork:"上报网络类型",connectCF:"连接CF",publish:"发布流",joinRoom:"加入房间",joinRoomEx:"加入房间(提前建连)",pubNotify:"广播已发布的轨道",subscribe:"订阅流",renegotiate:"协商流",closeTrack:"关闭轨道",preventUsersBehavior:"阻止用户行为",networkQualityChange:"更新网络状态",updateCall:"更新通话状态",toggleRoomSpeechLang:"切换房间语音识别",syncRoomInfo:"同步房间",updateRoomToken:"更新房间SDKTOKEN",offer:"发送P2P-offer",answer:"回应P2P-answer",candidate:"发送P2P候选信息-candidate",reportP2PConnectEx:"上报P2P连接结果",quitRoom:"退出房间",quitRoomEx:"退出房间不断开连接",debugger:"调试",ai:"WorkerAi调试",UpdateTrackActive:"p2p轨道状态"},eventName_options=Yt(enum_eventName),eventName_keys=Object.keys(enum_eventName),eventName_vals=Object.values(enum_eventName),enum_quality={0:"未知",1:"极差",2:"较差",3:"一般",4:"很好",5:"极好"},quality_options=Yt(enum_quality),quality_keys=Object.keys(enum_quality),quality_vals=Object.values(enum_quality),enum_roomState={ready:"已就绪",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",closed:"已关闭"},roomState_options=Yt(enum_roomState),roomState_keys=Object.keys(enum_roomState),roomState_vals=Object.values(enum_roomState),enum_trackType={0:"麦克风-默认轨道",1:"摄像头-默认轨道",2:"屏幕共享-视频轨道",3:"屏幕共享-音频轨道"},trackType_options=Yt(enum_trackType),trackType_keys=Object.keys(enum_trackType),trackType_vals=Object.values(enum_trackType);exports.QuickVO=QuickVO,exports.callStrategy_keys=callStrategy_keys,exports.callStrategy_options=callStrategy_options,exports.callStrategy_vals=callStrategy_vals,exports.enum_callStrategy=enum_callStrategy,exports.enum_eventName=enum_eventName,exports.enum_mediaType=enum_mediaType,exports.enum_notifyName=enum_notifyName,exports.enum_quality=enum_quality,exports.enum_roomState=enum_roomState,exports.enum_trackType=enum_trackType,exports.eventName_keys=eventName_keys,exports.eventName_options=eventName_options,exports.eventName_vals=eventName_vals,exports.mediaType_keys=mediaType_keys,exports.mediaType_options=mediaType_options,exports.mediaType_vals=mediaType_vals,exports.notifyName_keys=notifyName_keys,exports.notifyName_options=notifyName_options,exports.notifyName_vals=notifyName_vals,exports.quality_keys=quality_keys,exports.quality_options=quality_options,exports.quality_vals=quality_vals,exports.roomState_keys=roomState_keys,exports.roomState_options=roomState_options,exports.roomState_vals=roomState_vals,exports.trackType_keys=trackType_keys,exports.trackType_options=trackType_options,exports.trackType_vals=trackType_vals,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|