quickvo-sdk-js 1.3.1 → 1.4.0

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.
@@ -1,9 +1,9 @@
1
- (function(Se,Oe){typeof exports=="object"&&typeof module<"u"?Oe(exports):typeof define=="function"&&define.amd?define(["exports"],Oe):(Se=typeof globalThis<"u"?globalThis:Se||self,Oe(Se["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var un=Object.defineProperty;var an=Se=>{throw TypeError(Se)};var fn=(Se,Oe,Re)=>Oe in Se?un(Se,Oe,{enumerable:!0,configurable:!0,writable:!0,value:Re}):Se[Oe]=Re;var ee=(Se,Oe,Re)=>fn(Se,typeof Oe!="symbol"?Oe+"":Oe,Re),cn=(Se,Oe,Re)=>Oe.has(Se)||an("Cannot "+Re);var ce=(Se,Oe,Re)=>(cn(Se,Oe,"read from private field"),Re?Re.call(Se):Oe.get(Se)),be=(Se,Oe,Re)=>Oe.has(Se)?an("Cannot add the same private member more than once"):Oe instanceof WeakSet?Oe.add(Se):Oe.set(Se,Re),De=(Se,Oe,Re,at)=>(cn(Se,Oe,"write to private field"),at?at.call(Se,Re):Oe.set(Se,Re),Re);var Se,Oe,Re,at,zt,Ht,Zt,Je,yt,ct,Bt,qt,Ye,et,vt,kt,Nt,Ot,Ge,je,Xe,tt,st,It,Jt,Gt,Tt,Vt,Mt,Ut,Lt,Wt,Ft,$t,Kt,Yt,Xt,Et,xt,_t,Qt,lt,Rt,gt,At,jt,en,St,tn,nn;const it=($,D={})=>{const O={unit:"B",splitStr:" ",...D};let{unit:A,splitStr:b}=O;const S=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=S.findIndex(C=>C===A),c=S.slice(i+1,S.length);let k=$;for(const C of c)if(A=C,k=k/1024,k<1024)break;return`${k.toFixed(2)}${b}${A}`},V=($,D=[])=>{const O={...$},A=Object.keys(O);for(const b of A)D.findIndex(S=>String(S)===b)===-1&&delete O[b];return O},pt=($,D=[],O=!0)=>{const A=new Map;for(const S of $){const i=[];for(const k of D)i.push(S[k]);const c=`map-${i.join("-")}`;if(!A.has(c)){A.set(c,S);continue}O&&A.set(c,S)}const b=A.entries();return Array.from(b,([S,i])=>i)},dt=($,D=[])=>{const O=[];for(const A of $){const b=V(A,D);O.push(b)}return O},ht=($,D="value",O="label")=>{const A=[],b=Object.entries($);for(const[S,i]of b){const c={[O]:i,[D]:S};A.push(c)}return A},v$1=($=0,D=1)=>{const O=Math.max(0,$),A=Math.max(1,D),b=Math.random()*(A-O+1)+O;return parseInt(`${b}`,10)},wt=($=16,D=16)=>{const O="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),A=Math.min(O.length,D),b=Date.now().toString(A),S=b.split(""),i=Math.max(4,$-b.length);for(let c=0;c<i;c++){const k=v$1(0,A-1),C=O[k];S.push(C)}return S.join("").toUpperCase()},W=($,D)=>{try{let O=Number($);if(isNaN(O)){const A=new Date(`${$}`);if(`${A}`=="Invalid Date")return 0;O=A.getTime()}if(D!==void 0){const A=new Date().getTimezoneOffset();O+=(A+D)*60*1e3}return O}catch(O){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:$,_offset:D,error:O}),0}},H=1e3,R$1=6e4,U=36e5,T$1=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L=$=>W($),E=($,D="YYYY-MM-DD hh:mm:ss",O={})=>{const A={empty_str:"-",...O},{empty_str:b,offset:S}=A,i=W($,S);if(Number($)!==0&&i===0)return b;const c=new Date(i),k=`${c.getFullYear()}`,C=`${c.getMonth()+1}`,N=`${c.getDate()}`,j=`${c.getDay()===0?7:c.getDay()}`,Z=`${c.getHours()}`,z=`${c.getMinutes()}`,K=`${c.getSeconds()}`,te=`${Math.ceil((i-L(`${k}/01/01 00:00:00`)+1)/864e5)}`,ie=`${Math.ceil(((i-L(`${k}/01/01 00:00:00`))/864e5-Number(j))/7)+1}`,Q=[{k:"Y+",v:k},{k:"M+",v:C},{k:"D+",v:N},{k:"W+",v:j},{k:"h+",v:Z},{k:"m+",v:z},{k:"s+",v:K},{k:"d+",v:te},{k:"w+",v:ie}];let se;for(let{k:he,v:X}of Q)if(se=new RegExp(`(${he})`).exec(D),se){const oe=se[1];let de=X.padStart(oe.length,"0");oe.includes("W")&&(de=_[de.slice(0,2)]),D=D.replace(oe,de)}return D},P$1=new Map,bt=async($,D={})=>{await new Promise(async(O,A)=>{const{timeout:b=5*1e3,message:S="timeout"}=D,i=window.setTimeout(()=>A(S),b);try{const c=await $();O(c)}catch(c){A(c)}clearTimeout(i)})},Ct=($,D,O)=>{const A=new Date().getTime(),b=P$1.get($)||0;A-O>b&&(D(),P$1.set($,A))},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};ht(enum_mediaType);const mediaType_keys=Object.keys(enum_mediaType);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var $=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(D){return D.encoding?"rtpmap:%d %s/%s/%s":D.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(D){return D.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(D){return D.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(D){return"extmap:%d"+(D.direction?"/%s":"%v")+(D["encrypt-uri"]?" %s":"%v")+" %s"+(D.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(D){return D.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"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%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(D){var O="candidate:%s %d %s %d %s %d typ %s";return O+=D.raddr!=null?" raddr %s rport %d":"%v%v",O+=D.tcptype!=null?" tcptype %s":"%v",D.generation!=null&&(O+=" generation %d"),O+=D["network-id"]!=null?" network-id %d":"%v",O+=D["network-cost"]!=null?" network-cost %d":"%v",O}},{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(D){var O="ssrc:%d";return D.attribute!=null&&(O+=" %s",D.value!=null&&(O+=":%s")),O}},{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(D){return D.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(D){return D.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(D){return"imageattr:%s %s %s"+(D.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(D){return"simulcast:%s %s"+(D.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(D){return"ts-refclk:%s"+(D.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(D){var O="mediaclk:";return O+=D.id!=null?"id=%s %s":"%v%s",O+=D.mediaClockValue!=null?"=%s":"",O+=D.rateNumerator!=null?" rate=%s":"",O+=D.rateDenominator!=null?"/%s":"",O}},{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($).forEach(function(D){var O=$[D];O.forEach(function(A){A.reg||(A.reg=/(.*)/),A.format||(A.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function($){var D=function(c){return String(Number(c))===c?Number(c):c},O=function(c,k,C,N){if(N&&!C)k[N]=D(c[1]);else for(var j=0;j<C.length;j+=1)c[j+1]!=null&&(k[C[j]]=D(c[j+1]))},A=function(c,k,C){var N=c.name&&c.names;c.push&&!k[c.push]?k[c.push]=[]:N&&!k[c.name]&&(k[c.name]={});var j=c.push?{}:N?k[c.name]:k;O(C.match(c.reg),j,c.names,c.name),c.push&&k[c.push].push(j)},b=requireGrammar(),S=RegExp.prototype.test.bind(/^([a-z])=(.*)/);$.parse=function(c){var k={},C=[],N=k;return c.split(/(\r\n|\r|\n)/).filter(S).forEach(function(j){var Z=j[0],z=j.slice(2);Z==="m"&&(C.push({rtp:[],fmtp:[]}),N=C[C.length-1]);for(var K=0;K<(b[Z]||[]).length;K+=1){var te=b[Z][K];if(te.reg.test(z))return A(te,N,z)}}),k.media=C,k};var i=function(c,k){var C=k.split(/=(.+)/,2);return C.length===2?c[C[0]]=D(C[1]):C.length===1&&k.length>1&&(c[C[0]]=void 0),c};$.parseParams=function(c){return c.split(/;\s?/).reduce(i,{})},$.parseFmtpConfig=$.parseParams,$.parsePayloads=function(c){return c.toString().split(" ").map(Number)},$.parseRemoteCandidates=function(c){for(var k=[],C=c.split(" ").map(D),N=0;N<C.length;N+=3)k.push({component:C[N],ip:C[N+1],port:C[N+2]});return k},$.parseImageAttributes=function(c){return c.split(" ").map(function(k){return k.substring(1,k.length-1).split(",").reduce(i,{})})},$.parseSimulcastStreamList=function(c){return c.split(";").map(function(k){return k.split(",").map(function(C){var N,j=!1;return C[0]!=="~"?N=D(C):(N=D(C.substring(1,C.length)),j=!0),{scid:N,paused:j}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var $=requireGrammar(),D=/%[sdv%]/g,O=function(i){var c=1,k=arguments,C=k.length;return i.replace(D,function(N){if(c>=C)return N;var j=k[c];switch(c+=1,N){case"%%":return"%";case"%s":return String(j);case"%d":return Number(j);case"%v":return""}})},A=function(i,c,k){var C=c.format instanceof Function?c.format(c.push?k:k[c.name]):c.format,N=[i+"="+C];if(c.names)for(var j=0;j<c.names.length;j+=1){var Z=c.names[j];c.name?N.push(k[c.name][Z]):N.push(k[c.names[j]])}else N.push(k[c.name]);return O.apply(null,N)},b=["v","o","s","i","u","e","p","c","b","t","r","z","a"],S=["i","c","b","a"];return writer$1=function(i,c){c=c||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(j){j.payloads==null&&(j.payloads="")});var k=c.outerOrder||b,C=c.innerOrder||S,N=[];return k.forEach(function(j){$[j].forEach(function(Z){Z.name in i&&i[Z.name]!=null?N.push(A(j,Z,i)):Z.push in i&&i[Z.push]!=null&&i[Z.push].forEach(function(z){N.push(A(j,Z,z))})})}),i.media.forEach(function(j){N.push(A("m",$.m[0],j)),C.forEach(function(Z){$[Z].forEach(function(z){z.name in j&&j[z.name]!=null?N.push(A(Z,z,j)):z.push in j&&j[z.push]!=null&&j[z.push].forEach(function(K){N.push(A(Z,z,K))})})})}),N.join(`\r
1
+ (function(ge,Oe){typeof exports=="object"&&typeof module<"u"?Oe(exports):typeof define=="function"&&define.amd?define(["exports"],Oe):(ge=typeof globalThis<"u"?globalThis:ge||self,Oe(ge["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var cn=Object.defineProperty;var rn=ge=>{throw TypeError(ge)};var ln=(ge,Oe,Re)=>Oe in ge?cn(ge,Oe,{enumerable:!0,configurable:!0,writable:!0,value:Re}):ge[Oe]=Re;var Q=(ge,Oe,Re)=>ln(ge,typeof Oe!="symbol"?Oe+"":Oe,Re),on=(ge,Oe,Re)=>Oe.has(ge)||rn("Cannot "+Re);var ce=(ge,Oe,Re)=>(on(ge,Oe,"read from private field"),Re?Re.call(ge):Oe.get(ge)),ke=(ge,Oe,Re)=>Oe.has(ge)?rn("Cannot add the same private member more than once"):Oe instanceof WeakSet?Oe.add(ge):Oe.set(ge,Re),Ae=(ge,Oe,Re,at)=>(on(ge,Oe,"write to private field"),at?at.call(ge,Re):Oe.set(ge,Re),Re);var ge,Oe,Re,at,Ut,Lt,Ft,Je,kt,st,Dt,Bt,Ye,et,bt,_t,qt,Ot,Ve,je,Xe,tt,ct,It,jt,zt,Tt,Ht,Zt,Jt,Vt,lt,Gt,Wt,Kt,$t,gt,Nt,Yt,ut,xt,Et,Rt,Mt,Xt,St,Qt,en;const it=($,D={})=>{const O={unit:"B",splitStr:" ",...D};let{unit:A,splitStr:k}=O;const S=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=S.findIndex(C=>C===A),c=S.slice(i+1,S.length);let b=$;for(const C of c)if(A=C,b=b/1024,b<1024)break;return`${b.toFixed(2)}${k}${A}`},V=($,D=[])=>{const O={...$},A=Object.keys(O);for(const k of A)D.findIndex(S=>String(S)===k)===-1&&delete O[k];return O},pt=($,D=[],O=!0)=>{const A=new Map;for(const S of $){const i=[];for(const b of D)i.push(S[b]);const c=`map-${i.join("-")}`;if(!A.has(c)){A.set(c,S);continue}O&&A.set(c,S)}const k=A.entries();return Array.from(k,([S,i])=>i)},dt=($,D=[])=>{const O=[];for(const A of $){const k=V(A,D);O.push(k)}return O},ht=($,D="value",O="label")=>{const A=[],k=Object.entries($);for(const[S,i]of k){const c={[O]:i,[D]:S};A.push(c)}return A},v$1=($=0,D=1)=>{const O=Math.max(0,$),A=Math.max(1,D),k=Math.random()*(A-O+1)+O;return parseInt(`${k}`,10)},wt=($=16,D=16)=>{const O="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),A=Math.min(O.length,D),k=Date.now().toString(A),S=k.split(""),i=Math.max(4,$-k.length);for(let c=0;c<i;c++){const b=v$1(0,A-1),C=O[b];S.push(C)}return S.join("").toUpperCase()},W=($,D)=>{try{let O=Number($);if(isNaN(O)){const A=new Date(`${$}`);if(`${A}`=="Invalid Date")return 0;O=A.getTime()}if(D!==void 0){const A=new Date().getTimezoneOffset();O+=(A+D)*60*1e3}return O}catch(O){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:$,_offset:D,error:O}),0}},H=1e3,R$1=6e4,U=36e5,T$1=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L=$=>W($),E=($,D="YYYY-MM-DD hh:mm:ss",O={})=>{const A={empty_str:"-",...O},{empty_str:k,offset:S}=A,i=W($,S);if(Number($)!==0&&i===0)return k;const c=new Date(i),b=`${c.getFullYear()}`,C=`${c.getMonth()+1}`,N=`${c.getDate()}`,j=`${c.getDay()===0?7:c.getDay()}`,Z=`${c.getHours()}`,z=`${c.getMinutes()}`,K=`${c.getSeconds()}`,te=`${Math.ceil((i-L(`${b}/01/01 00:00:00`)+1)/864e5)}`,ie=`${Math.ceil(((i-L(`${b}/01/01 00:00:00`))/864e5-Number(j))/7)+1}`,ee=[{k:"Y+",v:b},{k:"M+",v:C},{k:"D+",v:N},{k:"W+",v:j},{k:"h+",v:Z},{k:"m+",v:z},{k:"s+",v:K},{k:"d+",v:te},{k:"w+",v:ie}];let ae;for(let{k:de,v:X}of ee)if(ae=new RegExp(`(${de})`).exec(D),ae){const ne=ae[1];let fe=X.padStart(ne.length,"0");ne.includes("W")&&(fe=_[fe.slice(0,2)]),D=D.replace(ne,fe)}return D},P$1=new Map,yt=($,D={})=>new Promise(async(O,A)=>{const{timeout:k=5*1e3,message:S="timeout"}=D,i=window.setTimeout(()=>A(S),k);try{const c=await $();O(c)}catch(c){A(c)}clearTimeout(i)}),Ct=($,D,O)=>{const A=new Date().getTime(),k=P$1.get($)||0;A-O>k&&(D(),P$1.set($,A))},enum_mediaType={microphoneCamera_audio:"麦克风-默认轨道",microphoneCamera_video:"摄像头-默认轨道",screenSharing_video:"屏幕共享-视频轨道",screenSharing_audio:"屏幕共享-音频轨道"};ht(enum_mediaType);const mediaType_keys=Object.keys(enum_mediaType);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var $=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(D){return D.encoding?"rtpmap:%d %s/%s/%s":D.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(D){return D.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(D){return D.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(D){return"extmap:%d"+(D.direction?"/%s":"%v")+(D["encrypt-uri"]?" %s":"%v")+" %s"+(D.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(D){return D.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"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%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(D){var O="candidate:%s %d %s %d %s %d typ %s";return O+=D.raddr!=null?" raddr %s rport %d":"%v%v",O+=D.tcptype!=null?" tcptype %s":"%v",D.generation!=null&&(O+=" generation %d"),O+=D["network-id"]!=null?" network-id %d":"%v",O+=D["network-cost"]!=null?" network-cost %d":"%v",O}},{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(D){var O="ssrc:%d";return D.attribute!=null&&(O+=" %s",D.value!=null&&(O+=":%s")),O}},{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(D){return D.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(D){return D.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(D){return"imageattr:%s %s %s"+(D.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(D){return"simulcast:%s %s"+(D.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(D){return"ts-refclk:%s"+(D.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(D){var O="mediaclk:";return O+=D.id!=null?"id=%s %s":"%v%s",O+=D.mediaClockValue!=null?"=%s":"",O+=D.rateNumerator!=null?" rate=%s":"",O+=D.rateDenominator!=null?"/%s":"",O}},{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($).forEach(function(D){var O=$[D];O.forEach(function(A){A.reg||(A.reg=/(.*)/),A.format||(A.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function($){var D=function(c){return String(Number(c))===c?Number(c):c},O=function(c,b,C,N){if(N&&!C)b[N]=D(c[1]);else for(var j=0;j<C.length;j+=1)c[j+1]!=null&&(b[C[j]]=D(c[j+1]))},A=function(c,b,C){var N=c.name&&c.names;c.push&&!b[c.push]?b[c.push]=[]:N&&!b[c.name]&&(b[c.name]={});var j=c.push?{}:N?b[c.name]:b;O(C.match(c.reg),j,c.names,c.name),c.push&&b[c.push].push(j)},k=requireGrammar(),S=RegExp.prototype.test.bind(/^([a-z])=(.*)/);$.parse=function(c){var b={},C=[],N=b;return c.split(/(\r\n|\r|\n)/).filter(S).forEach(function(j){var Z=j[0],z=j.slice(2);Z==="m"&&(C.push({rtp:[],fmtp:[]}),N=C[C.length-1]);for(var K=0;K<(k[Z]||[]).length;K+=1){var te=k[Z][K];if(te.reg.test(z))return A(te,N,z)}}),b.media=C,b};var i=function(c,b){var C=b.split(/=(.+)/,2);return C.length===2?c[C[0]]=D(C[1]):C.length===1&&b.length>1&&(c[C[0]]=void 0),c};$.parseParams=function(c){return c.split(/;\s?/).reduce(i,{})},$.parseFmtpConfig=$.parseParams,$.parsePayloads=function(c){return c.toString().split(" ").map(Number)},$.parseRemoteCandidates=function(c){for(var b=[],C=c.split(" ").map(D),N=0;N<C.length;N+=3)b.push({component:C[N],ip:C[N+1],port:C[N+2]});return b},$.parseImageAttributes=function(c){return c.split(" ").map(function(b){return b.substring(1,b.length-1).split(",").reduce(i,{})})},$.parseSimulcastStreamList=function(c){return c.split(";").map(function(b){return b.split(",").map(function(C){var N,j=!1;return C[0]!=="~"?N=D(C):(N=D(C.substring(1,C.length)),j=!0),{scid:N,paused:j}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var $=requireGrammar(),D=/%[sdv%]/g,O=function(i){var c=1,b=arguments,C=b.length;return i.replace(D,function(N){if(c>=C)return N;var j=b[c];switch(c+=1,N){case"%%":return"%";case"%s":return String(j);case"%d":return Number(j);case"%v":return""}})},A=function(i,c,b){var C=c.format instanceof Function?c.format(c.push?b:b[c.name]):c.format,N=[i+"="+C];if(c.names)for(var j=0;j<c.names.length;j+=1){var Z=c.names[j];c.name?N.push(b[c.name][Z]):N.push(b[c.names[j]])}else N.push(b[c.name]);return O.apply(null,N)},k=["v","o","s","i","u","e","p","c","b","t","r","z","a"],S=["i","c","b","a"];return writer$1=function(i,c){c=c||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(j){j.payloads==null&&(j.payloads="")});var b=c.outerOrder||k,C=c.innerOrder||S,N=[];return b.forEach(function(j){$[j].forEach(function(Z){Z.name in i&&i[Z.name]!=null?N.push(A(j,Z,i)):Z.push in i&&i[Z.push]!=null&&i[Z.push].forEach(function(z){N.push(A(j,Z,z))})})}),i.media.forEach(function(j){N.push(A("m",$.m[0],j)),C.forEach(function(Z){$[Z].forEach(function(z){z.name in j&&j[z.name]!=null?N.push(A(Z,z,j)):z.push in j&&j[z.push]!=null&&j[z.push].forEach(function(K){N.push(A(Z,z,K))})})})}),N.join(`\r
2
2
  `)+`\r
3
- `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var $=requireParser(),D=requireWriter$1(),O=requireGrammar();return lib$1.grammar=O,lib$1.write=D,lib$1.parse=$.parse,lib$1.parseParams=$.parseParams,lib$1.parseFmtpConfig=$.parseFmtpConfig,lib$1.parsePayloads=$.parsePayloads,lib$1.parseRemoteCandidates=$.parseRemoteCandidates,lib$1.parseImageAttributes=$.parseImageAttributes,lib$1.parseSimulcastStreamList=$.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(D){ee(this,"kind","video");ee(this,"stream",new MediaStream);ee(this,"stop",()=>{const D=this.stream.getTracks();for(const O of D)O.stop(),this.stream.removeTrack(O)});ee(this,"replaceStream",D=>{const O=this.stream,A=O.getTracks();for(const S of A)O.removeTrack(S);const[b]=D.getVideoTracks();b&&O.addTrack(b)});ee(this,"getStream",()=>this.stream);ee(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(D)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var B=Object.defineProperty,T=$=>{throw TypeError($)},R=($,D,O)=>D in $?B($,D,{enumerable:!0,configurable:!0,writable:!0,value:O}):$[D]=O,o$1=($,D,O)=>R($,typeof D!="symbol"?D+"":D,O),y$1=($,D,O)=>D.has($)||T("Cannot "+O),t=($,D,O)=>(y$1($,D,"read from private field"),O?O.call($):D.get($)),r=($,D,O)=>D.has($)?T("Cannot add the same private member more than once"):D instanceof WeakSet?D.add($):D.set($,O),a$1=($,D,O,A)=>(y$1($,D,"write to private field"),D.set($,O),O),n$1,h$1,l$1,u,p$1,f,d$1,w,x,g$2,m$1;class I{constructor(D){r(this,n$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4}),o$1(this,"ws"),o$1(this,"checkReconnect",async O=>(t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,n$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,h$1)}`),await new Promise(A=>setTimeout(()=>A(!0),t(this,n$1).reconnectIntervalTime)),!0)),o$1(this,"onReconnectSuccess",async O=>{}),o$1(this,"onReconnectStop",async O=>{}),o$1(this,"getHeartbeatMsg",()=>JSON.stringify({event:"heartbeat"})),o$1(this,"onMessage",O=>{}),r(this,h$1,-1),r(this,l$1,-1),r(this,u,0),r(this,p$1,0),r(this,f,0),r(this,d$1,!1),o$1(this,"setOptions",O=>{a$1(this,n$1,{...t(this,n$1),...O})}),o$1(this,"connect",()=>new Promise(async(O,A)=>{this.ws=new WebSocket(t(this,n$1).url),this.ws.binaryType=t(this,n$1).binaryType,this.ws.addEventListener("message",t(this,x)),this.ws.addEventListener("open",b=>{clearTimeout(t(this,u)),a$1(this,h$1,t(this,n$1).reconnectCount),a$1(this,l$1,-1),t(this,g$2).call(this),t(this,n$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),O(b)}),this.ws.addEventListener("error",b=>{clearTimeout(t(this,u)),t(this,n$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",b),A(b)}),this.ws.addEventListener("close",b=>{if(t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${b.code}, permanentClosed is ${t(this,d$1)}.`,b),t(this,m$1).call(this),!t(this,d$1))return this.reconnect(b);this.ws=void 0}),a$1(this,u,window.setTimeout(()=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",this),A("connect is timeout.")},t(this,n$1).timeout))})),o$1(this,"reconnect",async O=>new Promise(async A=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const b=S=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${S}`),this.onReconnectStop({msg:S}),A(S)};if(t(this,w).call(this)===!1)return b("stop reconnect. exceed maxReconnectionTime.");if(t(this,h$1)!==-1&&t(this,h$1)===0)return b("stop reconnect. surplusReconnectCount is 0.");if(!await this.checkReconnect(O))return b("stop reconnect. checkReconnect is false.");a$1(this,h$1,Math.max(-1,t(this,h$1)-1)),await this.connect().then(()=>this.onReconnectSuccess(this.ws)),A(!0)})),o$1(this,"sendMessage",async O=>{var A;(!this.ws||this.ws.readyState!==1)&&(t(this,n$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t(this,n$1).autoConnect&&(t(this,n$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(A=this.ws)==null||A.send(O)}),o$1(this,"close",async(O=1e3,A="correctly close.")=>{var b;this.ws&&(a$1(this,d$1,!0),t(this,m$1).call(this),(b=this.ws)==null||b.close(O,A))}),r(this,w,()=>{const O=Date.now();return t(this,l$1)===-1&&a$1(this,l$1,O+t(this,n$1).reconnectTime),!(O>t(this,l$1))}),r(this,x,O=>{const{data:A}=O;this.onMessage(A)}),r(this,g$2,()=>{a$1(this,f,window.setInterval(()=>{const O=this.getHeartbeatMsg();O&&this.sendMessage(O)},t(this,n$1).heartbeatIntervalTime))}),r(this,m$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,f))}),a$1(this,n$1,{...t(this,n$1),...D}),a$1(this,h$1,t(this,n$1).reconnectCount)}}n$1=new WeakMap,h$1=new WeakMap,l$1=new WeakMap,u=new WeakMap,p$1=new WeakMap,f=new WeakMap,d$1=new WeakMap,w=new WeakMap,x=new WeakMap,g$2=new WeakMap,m$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=$;function $(D,O){for(var A=new Array(arguments.length-1),b=0,S=2,i=!0;S<arguments.length;)A[b++]=arguments[S++];return new Promise(function(k,C){A[b]=function(j){if(i)if(i=!1,j)C(j);else{for(var Z=new Array(arguments.length-1),z=0;z<Z.length;)Z[z++]=arguments[z];k.apply(null,Z)}};try{D.apply(O||null,A)}catch(N){i&&(i=!1,C(N))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function($){var D=$;D.length=function(c){var k=c.length;if(!k)return 0;for(var C=0;--k%4>1&&c.charAt(k)==="=";)++C;return Math.ceil(c.length*3)/4-C};for(var O=new Array(64),A=new Array(123),b=0;b<64;)A[O[b]=b<26?b+65:b<52?b+71:b<62?b-4:b-59|43]=b++;D.encode=function(c,k,C){for(var N=null,j=[],Z=0,z=0,K;k<C;){var te=c[k++];switch(z){case 0:j[Z++]=O[te>>2],K=(te&3)<<4,z=1;break;case 1:j[Z++]=O[K|te>>4],K=(te&15)<<2,z=2;break;case 2:j[Z++]=O[K|te>>6],j[Z++]=O[te&63],z=0;break}Z>8191&&((N||(N=[])).push(String.fromCharCode.apply(String,j)),Z=0)}return z&&(j[Z++]=O[K],j[Z++]=61,z===1&&(j[Z++]=61)),N?(Z&&N.push(String.fromCharCode.apply(String,j.slice(0,Z))),N.join("")):String.fromCharCode.apply(String,j.slice(0,Z))};var S="invalid encoding";D.decode=function(c,k,C){for(var N=C,j=0,Z,z=0;z<c.length;){var K=c.charCodeAt(z++);if(K===61&&j>1)break;if((K=A[K])===void 0)throw Error(S);switch(j){case 0:Z=K,j=1;break;case 1:k[C++]=Z<<2|(K&48)>>4,Z=K,j=2;break;case 2:k[C++]=(Z&15)<<4|(K&60)>>2,Z=K,j=3;break;case 3:k[C++]=(Z&3)<<6|K,j=0;break}}if(j===1)throw Error(S);return C-N},D.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=$;function $(){this._listeners={}}return $.prototype.on=function(O,A,b){return(this._listeners[O]||(this._listeners[O]=[])).push({fn:A,ctx:b||this}),this},$.prototype.off=function(O,A){if(O===void 0)this._listeners={};else if(A===void 0)this._listeners[O]=[];else for(var b=this._listeners[O],S=0;S<b.length;)b[S].fn===A?b.splice(S,1):++S;return this},$.prototype.emit=function(O){var A=this._listeners[O];if(A){for(var b=[],S=1;S<arguments.length;)b.push(arguments[S++]);for(S=0;S<A.length;)A[S].fn.apply(A[S++].ctx,b)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=$($);function $(S){return typeof Float32Array<"u"?function(){var i=new Float32Array([-0]),c=new Uint8Array(i.buffer),k=c[3]===128;function C(z,K,te){i[0]=z,K[te]=c[0],K[te+1]=c[1],K[te+2]=c[2],K[te+3]=c[3]}function N(z,K,te){i[0]=z,K[te]=c[3],K[te+1]=c[2],K[te+2]=c[1],K[te+3]=c[0]}S.writeFloatLE=k?C:N,S.writeFloatBE=k?N:C;function j(z,K){return c[0]=z[K],c[1]=z[K+1],c[2]=z[K+2],c[3]=z[K+3],i[0]}function Z(z,K){return c[3]=z[K],c[2]=z[K+1],c[1]=z[K+2],c[0]=z[K+3],i[0]}S.readFloatLE=k?j:Z,S.readFloatBE=k?Z:j}():function(){function i(k,C,N,j){var Z=C<0?1:0;if(Z&&(C=-C),C===0)k(1/C>0?0:2147483648,N,j);else if(isNaN(C))k(2143289344,N,j);else if(C>34028234663852886e22)k((Z<<31|2139095040)>>>0,N,j);else if(C<11754943508222875e-54)k((Z<<31|Math.round(C/1401298464324817e-60))>>>0,N,j);else{var z=Math.floor(Math.log(C)/Math.LN2),K=Math.round(C*Math.pow(2,-z)*8388608)&8388607;k((Z<<31|z+127<<23|K)>>>0,N,j)}}S.writeFloatLE=i.bind(null,D),S.writeFloatBE=i.bind(null,O);function c(k,C,N){var j=k(C,N),Z=(j>>31)*2+1,z=j>>>23&255,K=j&8388607;return z===255?K?NaN:Z*(1/0):z===0?Z*1401298464324817e-60*K:Z*Math.pow(2,z-150)*(K+8388608)}S.readFloatLE=c.bind(null,A),S.readFloatBE=c.bind(null,b)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),c=new Uint8Array(i.buffer),k=c[7]===128;function C(z,K,te){i[0]=z,K[te]=c[0],K[te+1]=c[1],K[te+2]=c[2],K[te+3]=c[3],K[te+4]=c[4],K[te+5]=c[5],K[te+6]=c[6],K[te+7]=c[7]}function N(z,K,te){i[0]=z,K[te]=c[7],K[te+1]=c[6],K[te+2]=c[5],K[te+3]=c[4],K[te+4]=c[3],K[te+5]=c[2],K[te+6]=c[1],K[te+7]=c[0]}S.writeDoubleLE=k?C:N,S.writeDoubleBE=k?N:C;function j(z,K){return c[0]=z[K],c[1]=z[K+1],c[2]=z[K+2],c[3]=z[K+3],c[4]=z[K+4],c[5]=z[K+5],c[6]=z[K+6],c[7]=z[K+7],i[0]}function Z(z,K){return c[7]=z[K],c[6]=z[K+1],c[5]=z[K+2],c[4]=z[K+3],c[3]=z[K+4],c[2]=z[K+5],c[1]=z[K+6],c[0]=z[K+7],i[0]}S.readDoubleLE=k?j:Z,S.readDoubleBE=k?Z:j}():function(){function i(k,C,N,j,Z,z){var K=j<0?1:0;if(K&&(j=-j),j===0)k(0,Z,z+C),k(1/j>0?0:2147483648,Z,z+N);else if(isNaN(j))k(0,Z,z+C),k(2146959360,Z,z+N);else if(j>17976931348623157e292)k(0,Z,z+C),k((K<<31|2146435072)>>>0,Z,z+N);else{var te;if(j<22250738585072014e-324)te=j/5e-324,k(te>>>0,Z,z+C),k((K<<31|te/4294967296)>>>0,Z,z+N);else{var ie=Math.floor(Math.log(j)/Math.LN2);ie===1024&&(ie=1023),te=j*Math.pow(2,-ie),k(te*4503599627370496>>>0,Z,z+C),k((K<<31|ie+1023<<20|te*1048576&1048575)>>>0,Z,z+N)}}}S.writeDoubleLE=i.bind(null,D,0,4),S.writeDoubleBE=i.bind(null,O,4,0);function c(k,C,N,j,Z){var z=k(j,Z+C),K=k(j,Z+N),te=(K>>31)*2+1,ie=K>>>20&2047,Q=4294967296*(K&1048575)+z;return ie===2047?Q?NaN:te*(1/0):ie===0?te*5e-324*Q:te*Math.pow(2,ie-1075)*(Q+4503599627370496)}S.readDoubleLE=c.bind(null,A,0,4),S.readDoubleBE=c.bind(null,b,4,0)}(),S}function D(S,i,c){i[c]=S&255,i[c+1]=S>>>8&255,i[c+2]=S>>>16&255,i[c+3]=S>>>24}function O(S,i,c){i[c]=S>>>24,i[c+1]=S>>>16&255,i[c+2]=S>>>8&255,i[c+3]=S&255}function A(S,i){return(S[i]|S[i+1]<<8|S[i+2]<<16|S[i+3]<<24)>>>0}function b(S,i){return(S[i]<<24|S[i+1]<<16|S[i+2]<<8|S[i+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($){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function($){var D=$;D.length=function(A){for(var b=0,S=0,i=0;i<A.length;++i)S=A.charCodeAt(i),S<128?b+=1:S<2048?b+=2:(S&64512)===55296&&(A.charCodeAt(i+1)&64512)===56320?(++i,b+=4):b+=3;return b},D.read=function(A,b,S){var i=S-b;if(i<1)return"";for(var c=null,k=[],C=0,N;b<S;)N=A[b++],N<128?k[C++]=N:N>191&&N<224?k[C++]=(N&31)<<6|A[b++]&63:N>239&&N<365?(N=((N&7)<<18|(A[b++]&63)<<12|(A[b++]&63)<<6|A[b++]&63)-65536,k[C++]=55296+(N>>10),k[C++]=56320+(N&1023)):k[C++]=(N&15)<<12|(A[b++]&63)<<6|A[b++]&63,C>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,k)),C=0);return c?(C&&c.push(String.fromCharCode.apply(String,k.slice(0,C))),c.join("")):String.fromCharCode.apply(String,k.slice(0,C))},D.write=function(A,b,S){for(var i=S,c,k,C=0;C<A.length;++C)c=A.charCodeAt(C),c<128?b[S++]=c:c<2048?(b[S++]=c>>6|192,b[S++]=c&63|128):(c&64512)===55296&&((k=A.charCodeAt(C+1))&64512)===56320?(c=65536+((c&1023)<<10)+(k&1023),++C,b[S++]=c>>18|240,b[S++]=c>>12&63|128,b[S++]=c>>6&63|128,b[S++]=c&63|128):(b[S++]=c>>12|224,b[S++]=c>>6&63|128,b[S++]=c&63|128);return S-i}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=$;function $(D,O,A){var b=A||8192,S=b>>>1,i=null,c=b;return function(C){if(C<1||C>S)return D(C);c+C>b&&(i=D(b),c=0);var N=O.call(i,c,c+=C);return c&7&&(c=(c|7)+1),N}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=D;var $=requireMinimal$1();function D(S,i){this.lo=S>>>0,this.hi=i>>>0}var O=D.zero=new D(0,0);O.toNumber=function(){return 0},O.zzEncode=O.zzDecode=function(){return this},O.length=function(){return 1};var A=D.zeroHash="\0\0\0\0\0\0\0\0";D.fromNumber=function(i){if(i===0)return O;var c=i<0;c&&(i=-i);var k=i>>>0,C=(i-k)/4294967296>>>0;return c&&(C=~C>>>0,k=~k>>>0,++k>4294967295&&(k=0,++C>4294967295&&(C=0))),new D(k,C)},D.from=function(i){if(typeof i=="number")return D.fromNumber(i);if($.isString(i))if($.Long)i=$.Long.fromString(i);else return D.fromNumber(parseInt(i,10));return i.low||i.high?new D(i.low>>>0,i.high>>>0):O},D.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var c=~this.lo+1>>>0,k=~this.hi>>>0;return c||(k=k+1>>>0),-(c+k*4294967296)}return this.lo+this.hi*4294967296},D.prototype.toLong=function(i){return $.Long?new $.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var b=String.prototype.charCodeAt;return D.fromHash=function(i){return i===A?O:new D((b.call(i,0)|b.call(i,1)<<8|b.call(i,2)<<16|b.call(i,3)<<24)>>>0,(b.call(i,4)|b.call(i,5)<<8|b.call(i,6)<<16|b.call(i,7)<<24)>>>0)},D.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)},D.prototype.zzEncode=function(){var i=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^i)>>>0,this.lo=(this.lo<<1^i)>>>0,this},D.prototype.zzDecode=function(){var i=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^i)>>>0,this.hi=(this.hi>>>1^i)>>>0,this},D.prototype.length=function(){var i=this.lo,c=(this.lo>>>28|this.hi<<4)>>>0,k=this.hi>>>24;return k===0?c===0?i<16384?i<128?1:2:i<2097152?3:4:c<16384?c<128?5:6:c<2097152?7:8:k<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function($){var D=$;D.asPromise=requireAspromise(),D.base64=requireBase64(),D.EventEmitter=requireEventemitter(),D.float=requireFloat(),D.inquire=requireInquire(),D.utf8=requireUtf8(),D.pool=requirePool(),D.LongBits=requireLongbits(),D.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),D.global=D.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,D.emptyArray=Object.freeze?Object.freeze([]):[],D.emptyObject=Object.freeze?Object.freeze({}):{},D.isInteger=Number.isInteger||function(S){return typeof S=="number"&&isFinite(S)&&Math.floor(S)===S},D.isString=function(S){return typeof S=="string"||S instanceof String},D.isObject=function(S){return S&&typeof S=="object"},D.isset=D.isSet=function(S,i){var c=S[i];return c!=null&&S.hasOwnProperty(i)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},D.Buffer=function(){try{var b=D.inquire("buffer").Buffer;return b.prototype.utf8Write?b:null}catch{return null}}(),D._Buffer_from=null,D._Buffer_allocUnsafe=null,D.newBuffer=function(S){return typeof S=="number"?D.Buffer?D._Buffer_allocUnsafe(S):new D.Array(S):D.Buffer?D._Buffer_from(S):typeof Uint8Array>"u"?S:new Uint8Array(S)},D.Array=typeof Uint8Array<"u"?Uint8Array:Array,D.Long=D.global.dcodeIO&&D.global.dcodeIO.Long||D.global.Long||D.inquire("long"),D.key2Re=/^true|false|0|1$/,D.key32Re=/^-?(?:0|[1-9][0-9]*)$/,D.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,D.longToHash=function(S){return S?D.LongBits.from(S).toHash():D.LongBits.zeroHash},D.longFromHash=function(S,i){var c=D.LongBits.fromHash(S);return D.Long?D.Long.fromBits(c.lo,c.hi,i):c.toNumber(!!i)};function O(b,S,i){for(var c=Object.keys(S),k=0;k<c.length;++k)(b[c[k]]===void 0||!i)&&(b[c[k]]=S[c[k]]);return b}D.merge=O,D.lcFirst=function(S){return S.charAt(0).toLowerCase()+S.substring(1)};function A(b){function S(i,c){if(!(this instanceof S))return new S(i,c);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,S):Object.defineProperty(this,"stack",{value:new Error().stack||""}),c&&O(this,c)}return S.prototype=Object.create(Error.prototype,{constructor:{value:S,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return b},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),S}D.newError=A,D.ProtocolError=A("ProtocolError"),D.oneOfGetter=function(S){for(var i={},c=0;c<S.length;++c)i[S[c]]=1;return function(){for(var k=Object.keys(this),C=k.length-1;C>-1;--C)if(i[k[C]]===1&&this[k[C]]!==void 0&&this[k[C]]!==null)return k[C]}},D.oneOfSetter=function(S){return function(i){for(var c=0;c<S.length;++c)S[c]!==i&&delete this[S[c]]}},D.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},D._configure=function(){var b=D.Buffer;if(!b){D._Buffer_from=D._Buffer_allocUnsafe=null;return}D._Buffer_from=b.from!==Uint8Array.from&&b.from||function(i,c){return new b(i,c)},D._Buffer_allocUnsafe=b.allocUnsafe||function(i){return new b(i)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=k;var $=requireMinimal$1(),D,O=$.LongBits,A=$.base64,b=$.utf8;function S(ie,Q,se){this.fn=ie,this.len=Q,this.next=void 0,this.val=se}function i(){}function c(ie){this.head=ie.head,this.tail=ie.tail,this.len=ie.len,this.next=ie.states}function k(){this.len=0,this.head=new S(i,0,0),this.tail=this.head,this.states=null}var C=function(){return $.Buffer?function(){return(k.create=function(){return new D})()}:function(){return new k}};k.create=C(),k.alloc=function(Q){return new $.Array(Q)},$.Array!==Array&&(k.alloc=$.pool(k.alloc,$.Array.prototype.subarray)),k.prototype._push=function(Q,se,he){return this.tail=this.tail.next=new S(Q,se,he),this.len+=se,this};function N(ie,Q,se){Q[se]=ie&255}function j(ie,Q,se){for(;ie>127;)Q[se++]=ie&127|128,ie>>>=7;Q[se]=ie}function Z(ie,Q){this.len=ie,this.next=void 0,this.val=Q}Z.prototype=Object.create(S.prototype),Z.prototype.fn=j,k.prototype.uint32=function(Q){return this.len+=(this.tail=this.tail.next=new Z((Q=Q>>>0)<128?1:Q<16384?2:Q<2097152?3:Q<268435456?4:5,Q)).len,this},k.prototype.int32=function(Q){return Q<0?this._push(z,10,O.fromNumber(Q)):this.uint32(Q)},k.prototype.sint32=function(Q){return this.uint32((Q<<1^Q>>31)>>>0)};function z(ie,Q,se){for(;ie.hi;)Q[se++]=ie.lo&127|128,ie.lo=(ie.lo>>>7|ie.hi<<25)>>>0,ie.hi>>>=7;for(;ie.lo>127;)Q[se++]=ie.lo&127|128,ie.lo=ie.lo>>>7;Q[se++]=ie.lo}k.prototype.uint64=function(Q){var se=O.from(Q);return this._push(z,se.length(),se)},k.prototype.int64=k.prototype.uint64,k.prototype.sint64=function(Q){var se=O.from(Q).zzEncode();return this._push(z,se.length(),se)},k.prototype.bool=function(Q){return this._push(N,1,Q?1:0)};function K(ie,Q,se){Q[se]=ie&255,Q[se+1]=ie>>>8&255,Q[se+2]=ie>>>16&255,Q[se+3]=ie>>>24}k.prototype.fixed32=function(Q){return this._push(K,4,Q>>>0)},k.prototype.sfixed32=k.prototype.fixed32,k.prototype.fixed64=function(Q){var se=O.from(Q);return this._push(K,4,se.lo)._push(K,4,se.hi)},k.prototype.sfixed64=k.prototype.fixed64,k.prototype.float=function(Q){return this._push($.float.writeFloatLE,4,Q)},k.prototype.double=function(Q){return this._push($.float.writeDoubleLE,8,Q)};var te=$.Array.prototype.set?function(Q,se,he){se.set(Q,he)}:function(Q,se,he){for(var X=0;X<Q.length;++X)se[he+X]=Q[X]};return k.prototype.bytes=function(Q){var se=Q.length>>>0;if(!se)return this._push(N,1,0);if($.isString(Q)){var he=k.alloc(se=A.length(Q));A.decode(Q,he,0),Q=he}return this.uint32(se)._push(te,se,Q)},k.prototype.string=function(Q){var se=b.length(Q);return se?this.uint32(se)._push(b.write,se,Q):this._push(N,1,0)},k.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new S(i,0,0),this.len=0,this},k.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 S(i,0,0),this.len=0),this},k.prototype.ldelim=function(){var Q=this.head,se=this.tail,he=this.len;return this.reset().uint32(he),he&&(this.tail.next=Q.next,this.tail=se,this.len+=he),this},k.prototype.finish=function(){for(var Q=this.head.next,se=this.constructor.alloc(this.len),he=0;Q;)Q.fn(Q.val,se,he),he+=Q.len,Q=Q.next;return se},k._configure=function(ie){D=ie,k.create=C(),D._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=O;var $=requireWriter();(O.prototype=Object.create($.prototype)).constructor=O;var D=requireMinimal$1();function O(){$.call(this)}O._configure=function(){O.alloc=D._Buffer_allocUnsafe,O.writeBytesBuffer=D.Buffer&&D.Buffer.prototype instanceof Uint8Array&&D.Buffer.prototype.set.name==="set"?function(S,i,c){i.set(S,c)}:function(S,i,c){if(S.copy)S.copy(i,c,0,S.length);else for(var k=0;k<S.length;)i[c++]=S[k++]}},O.prototype.bytes=function(S){D.isString(S)&&(S=D._Buffer_from(S,"base64"));var i=S.length>>>0;return this.uint32(i),i&&this._push(O.writeBytesBuffer,i,S),this};function A(b,S,i){b.length<40?D.utf8.write(b,S,i):S.utf8Write?S.utf8Write(b,i):S.write(b,i)}return O.prototype.string=function(S){var i=D.Buffer.byteLength(S);return this.uint32(i),i&&this._push(A,i,S),this},O._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=S;var $=requireMinimal$1(),D,O=$.LongBits,A=$.utf8;function b(j,Z){return RangeError("index out of range: "+j.pos+" + "+(Z||1)+" > "+j.len)}function S(j){this.buf=j,this.pos=0,this.len=j.length}var i=typeof Uint8Array<"u"?function(Z){if(Z instanceof Uint8Array||Array.isArray(Z))return new S(Z);throw Error("illegal buffer")}:function(Z){if(Array.isArray(Z))return new S(Z);throw Error("illegal buffer")},c=function(){return $.Buffer?function(z){return(S.create=function(te){return $.Buffer.isBuffer(te)?new D(te):i(te)})(z)}:i};S.create=c(),S.prototype._slice=$.Array.prototype.subarray||$.Array.prototype.slice,S.prototype.uint32=function(){var Z=4294967295;return function(){if(Z=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(Z=(Z|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return Z;if((this.pos+=5)>this.len)throw this.pos=this.len,b(this,10);return Z}}(),S.prototype.int32=function(){return this.uint32()|0},S.prototype.sint32=function(){var Z=this.uint32();return Z>>>1^-(Z&1)|0};function k(){var j=new O(0,0),Z=0;if(this.len-this.pos>4){for(;Z<4;++Z)if(j.lo=(j.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return j;if(j.lo=(j.lo|(this.buf[this.pos]&127)<<28)>>>0,j.hi=(j.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return j;Z=0}else{for(;Z<3;++Z){if(this.pos>=this.len)throw b(this);if(j.lo=(j.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return j}return j.lo=(j.lo|(this.buf[this.pos++]&127)<<Z*7)>>>0,j}if(this.len-this.pos>4){for(;Z<5;++Z)if(j.hi=(j.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return j}else for(;Z<5;++Z){if(this.pos>=this.len)throw b(this);if(j.hi=(j.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return j}throw Error("invalid varint encoding")}S.prototype.bool=function(){return this.uint32()!==0};function C(j,Z){return(j[Z-4]|j[Z-3]<<8|j[Z-2]<<16|j[Z-1]<<24)>>>0}S.prototype.fixed32=function(){if(this.pos+4>this.len)throw b(this,4);return C(this.buf,this.pos+=4)},S.prototype.sfixed32=function(){if(this.pos+4>this.len)throw b(this,4);return C(this.buf,this.pos+=4)|0};function N(){if(this.pos+8>this.len)throw b(this,8);return new O(C(this.buf,this.pos+=4),C(this.buf,this.pos+=4))}return S.prototype.float=function(){if(this.pos+4>this.len)throw b(this,4);var Z=$.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Z},S.prototype.double=function(){if(this.pos+8>this.len)throw b(this,4);var Z=$.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Z},S.prototype.bytes=function(){var Z=this.uint32(),z=this.pos,K=this.pos+Z;if(K>this.len)throw b(this,Z);if(this.pos+=Z,Array.isArray(this.buf))return this.buf.slice(z,K);if(z===K){var te=$.Buffer;return te?te.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,z,K)},S.prototype.string=function(){var Z=this.bytes();return A.read(Z,0,Z.length)},S.prototype.skip=function(Z){if(typeof Z=="number"){if(this.pos+Z>this.len)throw b(this,Z);this.pos+=Z}else do if(this.pos>=this.len)throw b(this);while(this.buf[this.pos++]&128);return this},S.prototype.skipType=function(j){switch(j){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(j=this.uint32()&7)!==4;)this.skipType(j);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+j+" at offset "+this.pos)}return this},S._configure=function(j){D=j,S.create=c(),D._configure();var Z=$.Long?"toLong":"toNumber";$.merge(S.prototype,{int64:function(){return k.call(this)[Z](!1)},uint64:function(){return k.call(this)[Z](!0)},sint64:function(){return k.call(this).zzDecode()[Z](!1)},fixed64:function(){return N.call(this)[Z](!0)},sfixed64:function(){return N.call(this)[Z](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=O;var $=requireReader();(O.prototype=Object.create($.prototype)).constructor=O;var D=requireMinimal$1();function O(A){$.call(this,A)}return O._configure=function(){D.Buffer&&(O.prototype._slice=D.Buffer.prototype.slice)},O.prototype.string=function(){var b=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+b,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+b,this.len))},O._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=D;var $=requireMinimal$1();(D.prototype=Object.create($.EventEmitter.prototype)).constructor=D;function D(O,A,b){if(typeof O!="function")throw TypeError("rpcImpl must be a function");$.EventEmitter.call(this),this.rpcImpl=O,this.requestDelimited=!!A,this.responseDelimited=!!b}return D.prototype.rpcCall=function O(A,b,S,i,c){if(!i)throw TypeError("request must be specified");var k=this;if(!c)return $.asPromise(O,k,A,b,S,i);if(!k.rpcImpl){setTimeout(function(){c(Error("already ended"))},0);return}try{return k.rpcImpl(A,b[k.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(N,j){if(N)return k.emit("error",N,A),c(N);if(j===null){k.end(!0);return}if(!(j instanceof S))try{j=S[k.responseDelimited?"decodeDelimited":"decode"](j)}catch(Z){return k.emit("error",Z,A),c(Z)}return k.emit("data",j,A),c(null,j)})}catch(C){k.emit("error",C,A),setTimeout(function(){c(C)},0);return}},D.prototype.end=function(A){return this.rpcImpl&&(A||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function($){var D=$;D.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function($){var D=$;D.build="minimal",D.Writer=requireWriter(),D.BufferWriter=requireWriter_buffer(),D.Reader=requireReader(),D.BufferReader=requireReader_buffer(),D.util=requireMinimal$1(),D.rpc=requireRpc(),D.roots=requireRoots(),D.configure=O;function O(){D.util._configure(),D.Writer._configure(D.BufferWriter),D.Reader._configure(D.BufferReader)}O()}(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 $={};return $.quick=function(){const D={};return D.voice=function(){const O={};return O.proto=function(){const A={};return A.CommonReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.event="",b.prototype.data=$util.newBuffer([]),b.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.version=0,b.prototype.compress=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(56).bool(i.compress),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.version=i.int32();break}case 7:{C.compress=i.bool();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let c=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},b.toObject=function(i,c){c||(c={});let k={};if(c.defaults){if(k.event="",c.bytes===String?k.data="":(k.data=[],c.bytes!==Array&&(k.data=$util.newBuffer(k.data))),$util.Long){let C=new $util.Long(0,0,!1);k.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);k.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);k.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.valid=c.longs===String?"0":0;k.version=0,k.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(k.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(k.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?k.sn=c.longs===String?String(i.sn):i.sn:k.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?k.time=c.longs===String?String(i.time):i.time:k.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?k.valid=c.longs===String?String(i.valid):i.valid:k.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&(k.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(k.compress=i.compress),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},b}(),A.CommonRsp=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.event="",b.prototype.data=$util.newBuffer([]),b.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,b.prototype.code=0,b.prototype.desc="",b.prototype.version=0,b.prototype.compress=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&c.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&c.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(72).bool(i.compress),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.code=i.int32();break}case 7:{C.desc=i.string();break}case 8:{C.version=i.int32();break}case 9:{C.compress=i.bool();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.code!=null&&i.hasOwnProperty("code")&&!$util.isInteger(i.code)?"code: integer expected":i.desc!=null&&i.hasOwnProperty("desc")&&!$util.isString(i.desc)?"desc: string expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let c=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(c.code=i.code|0),i.desc!=null&&(c.desc=String(i.desc)),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},b.toObject=function(i,c){c||(c={});let k={};if(c.defaults){if(k.event="",c.bytes===String?k.data="":(k.data=[],c.bytes!==Array&&(k.data=$util.newBuffer(k.data))),$util.Long){let C=new $util.Long(0,0,!1);k.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);k.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);k.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.valid=c.longs===String?"0":0;k.code=0,k.desc="",k.version=0,k.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(k.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(k.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?k.sn=c.longs===String?String(i.sn):i.sn:k.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?k.time=c.longs===String?String(i.time):i.time:k.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?k.valid=c.longs===String?String(i.valid):i.valid:k.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&(k.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&(k.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&(k.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(k.compress=i.compress),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},b}(),A.User=function(){function b(i){if(this.tracks=[],i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.id="",b.prototype.callAction=null,b.prototype.callState=null,b.prototype.joinTime=null,b.prototype.tracks=$util.emptyArray,b.prototype.permissions=null,b.prototype.isPublished=null,b.prototype.behavior=null,b.prototype.channelCache=null;let S;return Object.defineProperty(b.prototype,"_callAction",{get:$util.oneOfGetter(S=["callAction"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_callState",{get:$util.oneOfGetter(S=["callState"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_joinTime",{get:$util.oneOfGetter(S=["joinTime"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_permissions",{get:$util.oneOfGetter(S=["permissions"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_isPublished",{get:$util.oneOfGetter(S=["isPublished"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_behavior",{get:$util.oneOfGetter(S=["behavior"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_channelCache",{get:$util.oneOfGetter(S=["channelCache"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){if(k||(k=$Writer.create()),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&k.uint32(10).string(c.id),c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&k.uint32(16).int32(c.callAction),c.callState!=null&&Object.hasOwnProperty.call(c,"callState")&&k.uint32(24).int32(c.callState),c.joinTime!=null&&Object.hasOwnProperty.call(c,"joinTime")&&k.uint32(32).int64(c.joinTime),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],k.uint32(42).fork()).ldelim();return c.permissions!=null&&Object.hasOwnProperty.call(c,"permissions")&&k.uint32(48).int32(c.permissions),c.isPublished!=null&&Object.hasOwnProperty.call(c,"isPublished")&&k.uint32(56).bool(c.isPublished),c.behavior!=null&&Object.hasOwnProperty.call(c,"behavior")&&k.uint32(64).int32(c.behavior),c.channelCache!=null&&Object.hasOwnProperty.call(c,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(c.channelCache,k.uint32(74).fork()).ldelim(),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.User;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.id=c.string();break}case 2:{N.callAction=c.int32();break}case 3:{N.callState=c.int32();break}case 4:{N.joinTime=c.int64();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 6:{N.permissions=c.int32();break}case 7:{N.isPublished=c.bool();break}case 8:{N.behavior=c.int32();break}case 9:{N.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(c,c.uint32());break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.id!=null&&c.hasOwnProperty("id")&&!$util.isString(c.id))return"id: string expected";if(c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction))return"callAction: integer expected";if(c.callState!=null&&c.hasOwnProperty("callState")&&!$util.isInteger(c.callState))return"callState: integer expected";if(c.joinTime!=null&&c.hasOwnProperty("joinTime")&&!$util.isInteger(c.joinTime)&&!(c.joinTime&&$util.isInteger(c.joinTime.low)&&$util.isInteger(c.joinTime.high)))return"joinTime: integer|Long expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let k=0;k<c.tracks.length;++k){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[k]);if(C)return"tracks."+C}}if(c.permissions!=null&&c.hasOwnProperty("permissions")&&!$util.isInteger(c.permissions))return"permissions: integer expected";if(c.isPublished!=null&&c.hasOwnProperty("isPublished")&&typeof c.isPublished!="boolean")return"isPublished: boolean expected";if(c.behavior!=null&&c.hasOwnProperty("behavior")&&!$util.isInteger(c.behavior))return"behavior: integer expected";if(c.channelCache!=null&&c.hasOwnProperty("channelCache")){let k=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(c.channelCache);if(k)return"channelCache."+k}return null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.User)return c;let k=new $root.com.quick.voice.proto.User;if(c.id!=null&&(k.id=String(c.id)),c.callAction!=null&&(k.callAction=c.callAction|0),c.callState!=null&&(k.callState=c.callState|0),c.joinTime!=null&&($util.Long?(k.joinTime=$util.Long.fromValue(c.joinTime)).unsigned=!1:typeof c.joinTime=="string"?k.joinTime=parseInt(c.joinTime,10):typeof c.joinTime=="number"?k.joinTime=c.joinTime:typeof c.joinTime=="object"&&(k.joinTime=new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber())),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");k.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");k.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}if(c.permissions!=null&&(k.permissions=c.permissions|0),c.isPublished!=null&&(k.isPublished=!!c.isPublished),c.behavior!=null&&(k.behavior=c.behavior|0),c.channelCache!=null){if(typeof c.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");k.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(c.channelCache)}return k},b.toObject=function(c,k){k||(k={});let C={};if((k.arrays||k.defaults)&&(C.tracks=[]),k.defaults&&(C.id=""),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id),c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction,k.oneofs&&(C._callAction="callAction")),c.callState!=null&&c.hasOwnProperty("callState")&&(C.callState=c.callState,k.oneofs&&(C._callState="callState")),c.joinTime!=null&&c.hasOwnProperty("joinTime")&&(typeof c.joinTime=="number"?C.joinTime=k.longs===String?String(c.joinTime):c.joinTime:C.joinTime=k.longs===String?$util.Long.prototype.toString.call(c.joinTime):k.longs===Number?new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber():c.joinTime,k.oneofs&&(C._joinTime="joinTime")),c.tracks&&c.tracks.length){C.tracks=[];for(let N=0;N<c.tracks.length;++N)C.tracks[N]=$root.com.quick.voice.proto.Track.toObject(c.tracks[N],k)}return c.permissions!=null&&c.hasOwnProperty("permissions")&&(C.permissions=c.permissions,k.oneofs&&(C._permissions="permissions")),c.isPublished!=null&&c.hasOwnProperty("isPublished")&&(C.isPublished=c.isPublished,k.oneofs&&(C._isPublished="isPublished")),c.behavior!=null&&c.hasOwnProperty("behavior")&&(C.behavior=c.behavior,k.oneofs&&(C._behavior="behavior")),c.channelCache!=null&&c.hasOwnProperty("channelCache")&&(C.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(c.channelCache,k),k.oneofs&&(C._channelCache="channelCache")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.User"},b}(),A.DataChannelCacheInfo=function(){function b(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let k=0;k<i.channels.length;++k)$root.com.quick.voice.proto.DataChannel.encode(i.channels[k],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let k=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(k)return"channels."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let c=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");c.channels=[];for(let k=0;k<i.channels.length;++k){if(typeof i.channels[k]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");c.channels[k]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.channels=[]),i.channels&&i.channels.length){k.channels=[];for(let C=0;C<i.channels.length;++C)k.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},b}(),A.DataChannel=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.dataChannelName="",b.prototype.id=null;let S;return Object.defineProperty(b.prototype,"_id",{get:$util.oneOfGetter(S=["id"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.dataChannelName!=null&&Object.hasOwnProperty.call(c,"dataChannelName")&&k.uint32(10).string(c.dataChannelName),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&k.uint32(16).int32(c.id),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.DataChannel;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.dataChannelName=c.string();break}case 2:{N.id=c.int32();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){return typeof c!="object"||c===null?"object expected":c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&!$util.isString(c.dataChannelName)?"dataChannelName: string expected":c.id!=null&&c.hasOwnProperty("id")&&!$util.isInteger(c.id)?"id: integer expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannel)return c;let k=new $root.com.quick.voice.proto.DataChannel;return c.dataChannelName!=null&&(k.dataChannelName=String(c.dataChannelName)),c.id!=null&&(k.id=c.id|0),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.dataChannelName=""),c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&(C.dataChannelName=c.dataChannelName),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id,k.oneofs&&(C._id="id")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannel"},b}(),A.Login=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.appid="",b.prototype.userId="",b.prototype.sdkToken="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&c.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(26).string(i.sdkToken),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Login;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.appid=i.string();break}case 2:{C.userId=i.string();break}case 3:{C.sdkToken=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.appid!=null&&i.hasOwnProperty("appid")&&!$util.isString(i.appid)?"appid: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let c=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(c.appid=String(i.appid)),i.userId!=null&&(c.userId=String(i.userId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.appid="",k.userId="",k.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&(k.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&(k.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(k.sdkToken=i.sdkToken),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},b}(),A.Track=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.mid="",b.prototype.trackName=null,b.prototype.location=null,b.prototype.userId=null,b.prototype.code=null,b.prototype.desc=null,b.prototype.type=null,b.prototype.isValid=null,b.prototype.simulcast=null;let S;return Object.defineProperty(b.prototype,"_trackName",{get:$util.oneOfGetter(S=["trackName"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_location",{get:$util.oneOfGetter(S=["location"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_userId",{get:$util.oneOfGetter(S=["userId"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_code",{get:$util.oneOfGetter(S=["code"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_desc",{get:$util.oneOfGetter(S=["desc"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_type",{get:$util.oneOfGetter(S=["type"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_isValid",{get:$util.oneOfGetter(S=["isValid"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_simulcast",{get:$util.oneOfGetter(S=["simulcast"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.mid!=null&&Object.hasOwnProperty.call(c,"mid")&&k.uint32(10).string(c.mid),c.trackName!=null&&Object.hasOwnProperty.call(c,"trackName")&&k.uint32(18).string(c.trackName),c.location!=null&&Object.hasOwnProperty.call(c,"location")&&k.uint32(26).string(c.location),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&k.uint32(34).string(c.userId),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&k.uint32(40).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&k.uint32(50).string(c.desc),c.type!=null&&Object.hasOwnProperty.call(c,"type")&&k.uint32(56).int32(c.type),c.isValid!=null&&Object.hasOwnProperty.call(c,"isValid")&&k.uint32(64).bool(c.isValid),c.simulcast!=null&&Object.hasOwnProperty.call(c,"simulcast")&&k.uint32(74).string(c.simulcast),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.Track;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.mid=c.string();break}case 2:{N.trackName=c.string();break}case 3:{N.location=c.string();break}case 4:{N.userId=c.string();break}case 5:{N.code=c.int32();break}case 6:{N.desc=c.string();break}case 7:{N.type=c.int32();break}case 8:{N.isValid=c.bool();break}case 9:{N.simulcast=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.mid!=null&&c.hasOwnProperty("mid")&&!$util.isString(c.mid))return"mid: string expected";if(c.trackName!=null&&c.hasOwnProperty("trackName")&&!$util.isString(c.trackName))return"trackName: string expected";if(c.location!=null&&c.hasOwnProperty("location")&&!$util.isString(c.location))return"location: string expected";if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code))return"code: integer expected";if(c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc))return"desc: string expected";if(c.type!=null&&c.hasOwnProperty("type"))switch(c.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return c.isValid!=null&&c.hasOwnProperty("isValid")&&typeof c.isValid!="boolean"?"isValid: boolean expected":c.simulcast!=null&&c.hasOwnProperty("simulcast")&&!$util.isString(c.simulcast)?"simulcast: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.Track)return c;let k=new $root.com.quick.voice.proto.Track;switch(c.mid!=null&&(k.mid=String(c.mid)),c.trackName!=null&&(k.trackName=String(c.trackName)),c.location!=null&&(k.location=String(c.location)),c.userId!=null&&(k.userId=String(c.userId)),c.code!=null&&(k.code=c.code|0),c.desc!=null&&(k.desc=String(c.desc)),c.type){default:if(typeof c.type=="number"){k.type=c.type;break}break;case"Microphone":case 0:k.type=0;break;case"Camera":case 1:k.type=1;break;case"Screen":case 2:k.type=2;break;case"SystemVoice":case 3:k.type=3;break}return c.isValid!=null&&(k.isValid=!!c.isValid),c.simulcast!=null&&(k.simulcast=String(c.simulcast)),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.mid=""),c.mid!=null&&c.hasOwnProperty("mid")&&(C.mid=c.mid),c.trackName!=null&&c.hasOwnProperty("trackName")&&(C.trackName=c.trackName,k.oneofs&&(C._trackName="trackName")),c.location!=null&&c.hasOwnProperty("location")&&(C.location=c.location,k.oneofs&&(C._location="location")),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId,k.oneofs&&(C._userId="userId")),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,k.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,k.oneofs&&(C._desc="desc")),c.type!=null&&c.hasOwnProperty("type")&&(C.type=k.enums===String?$root.com.quick.voice.proto.TrackType[c.type]===void 0?c.type:$root.com.quick.voice.proto.TrackType[c.type]:c.type,k.oneofs&&(C._type="type")),c.isValid!=null&&c.hasOwnProperty("isValid")&&(C.isValid=c.isValid,k.oneofs&&(C._isValid="isValid")),c.simulcast!=null&&c.hasOwnProperty("simulcast")&&(C.simulcast=c.simulcast,k.oneofs&&(C._simulcast="simulcast")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.Track"},b}(),A.JoinReq=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.roomId="",b.prototype.user=null,b.prototype.callType=0,b.prototype.token=null;let S;return Object.defineProperty(b.prototype,"_token",{get:$util.oneOfGetter(S=["token"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&k.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,k.uint32(18).fork()).ldelim(),c.callType!=null&&Object.hasOwnProperty.call(c,"callType")&&k.uint32(24).int32(c.callType),c.token!=null&&Object.hasOwnProperty.call(c,"token")&&k.uint32(34).string(c.token),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.JoinReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.callType=c.int32();break}case 4:{N.token=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(c.user);if(k)return"user."+k}if(c.callType!=null&&c.hasOwnProperty("callType"))switch(c.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return c.token!=null&&c.hasOwnProperty("token")&&!$util.isString(c.token)?"token: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.JoinReq)return c;let k=new $root.com.quick.voice.proto.JoinReq;if(c.roomId!=null&&(k.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(c.user)}switch(c.callType){default:if(typeof c.callType=="number"){k.callType=c.callType;break}break;case"Normal":case 0:k.callType=0;break;case"Meeting":case 1:k.callType=1;break;case"Live":case 2:k.callType=2;break}return c.token!=null&&(k.token=String(c.token)),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.roomId="",C.user=null,C.callType=k.enums===String?"Normal":0),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,k)),c.callType!=null&&c.hasOwnProperty("callType")&&(C.callType=k.enums===String?$root.com.quick.voice.proto.CallType[c.callType]===void 0?c.callType:$root.com.quick.voice.proto.CallType[c.callType]:c.callType),c.token!=null&&c.hasOwnProperty("token")&&(C.token=c.token,k.oneofs&&(C._token="token")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.JoinReq"},b}(),A.JoinRsp=function(){function b(S){if(this.roomUsers=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.roomUsers=$util.emptyArray,b.prototype.callType=0,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let k=0;k<i.roomUsers.length;++k)$root.com.quick.voice.proto.User.encode(i.roomUsers[k],c.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&c.uint32(24).int32(i.callType),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.roomUsers&&C.roomUsers.length||(C.roomUsers=[]),C.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{C.callType=i.int32();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let c=0;c<i.roomUsers.length;++c){let k=$root.com.quick.voice.proto.User.verify(i.roomUsers[c]);if(k)return"roomUsers."+k}}if(i.callType!=null&&i.hasOwnProperty("callType"))switch(i.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let c=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");c.roomUsers=[];for(let k=0;k<i.roomUsers.length;++k){if(typeof i.roomUsers[k]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");c.roomUsers[k]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[k])}}switch(i.callType){default:if(typeof i.callType=="number"){c.callType=i.callType;break}break;case"Normal":case 0:c.callType=0;break;case"Meeting":case 1:c.callType=1;break;case"Live":case 2:c.callType=2;break}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.roomUsers=[]),c.defaults&&(k.roomId="",k.callType=c.enums===String?"Normal":0),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){k.roomUsers=[];for(let C=0;C<i.roomUsers.length;++C)k.roomUsers[C]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[C],c)}return i.callType!=null&&i.hasOwnProperty("callType")&&(k.callType=c.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},b}(),A.JoinNotify=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let c=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.roomId="",k.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(k.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},b}(),A.ConnectCFReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.sdp="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.sdp=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let c=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(c.sdp=String(i.sdp)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(k.sdp=i.sdp),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},b}(),A.ConnectCFRsp=function(){function b(i){if(this.subscribeUsers=[],i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.remoteSdp="",b.prototype.subscribeUsers=$util.emptyArray,b.prototype.session=null;let S;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){if(k||(k=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&k.uint32(10).string(c.remoteSdp),c.subscribeUsers!=null&&c.subscribeUsers.length)for(let C=0;C<c.subscribeUsers.length;++C)$root.com.quick.voice.proto.User.encode(c.subscribeUsers[C],k.uint32(18).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&k.uint32(26).string(c.session),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.ConnectCFRsp;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.remoteSdp=c.string();break}case 2:{N.subscribeUsers&&N.subscribeUsers.length||(N.subscribeUsers=[]),N.subscribeUsers.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 3:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp))return"remoteSdp: string expected";if(c.subscribeUsers!=null&&c.hasOwnProperty("subscribeUsers")){if(!Array.isArray(c.subscribeUsers))return"subscribeUsers: array expected";for(let k=0;k<c.subscribeUsers.length;++k){let C=$root.com.quick.voice.proto.User.verify(c.subscribeUsers[k]);if(C)return"subscribeUsers."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.ConnectCFRsp)return c;let k=new $root.com.quick.voice.proto.ConnectCFRsp;if(c.remoteSdp!=null&&(k.remoteSdp=String(c.remoteSdp)),c.subscribeUsers){if(!Array.isArray(c.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");k.subscribeUsers=[];for(let C=0;C<c.subscribeUsers.length;++C){if(typeof c.subscribeUsers[C]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");k.subscribeUsers[C]=$root.com.quick.voice.proto.User.fromObject(c.subscribeUsers[C])}}return c.session!=null&&(k.session=String(c.session)),k},b.toObject=function(c,k){k||(k={});let C={};if((k.arrays||k.defaults)&&(C.subscribeUsers=[]),k.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.subscribeUsers&&c.subscribeUsers.length){C.subscribeUsers=[];for(let N=0;N<c.subscribeUsers.length;++N)C.subscribeUsers[N]=$root.com.quick.voice.proto.User.toObject(c.subscribeUsers[N],k)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,k.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.ConnectCFRsp"},b}(),A.PublishReq=function(){function b(i){if(this.tracks=[],i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.sdp="",b.prototype.tracks=$util.emptyArray,b.prototype.callAction=0,b.prototype.recreate=null,b.prototype.session=null;let S;return Object.defineProperty(b.prototype,"_recreate",{get:$util.oneOfGetter(S=["recreate"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){if(k||(k=$Writer.create()),c.sdp!=null&&Object.hasOwnProperty.call(c,"sdp")&&k.uint32(10).string(c.sdp),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],k.uint32(18).fork()).ldelim();return c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&k.uint32(24).int32(c.callAction),c.recreate!=null&&Object.hasOwnProperty.call(c,"recreate")&&k.uint32(32).bool(c.recreate),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&k.uint32(42).string(c.session),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.PublishReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.sdp=c.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 3:{N.callAction=c.int32();break}case 4:{N.recreate=c.bool();break}case 5:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.sdp!=null&&c.hasOwnProperty("sdp")&&!$util.isString(c.sdp))return"sdp: string expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let k=0;k<c.tracks.length;++k){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[k]);if(C)return"tracks."+C}}return c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction)?"callAction: integer expected":c.recreate!=null&&c.hasOwnProperty("recreate")&&typeof c.recreate!="boolean"?"recreate: boolean expected":c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishReq)return c;let k=new $root.com.quick.voice.proto.PublishReq;if(c.sdp!=null&&(k.sdp=String(c.sdp)),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");k.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");k.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}return c.callAction!=null&&(k.callAction=c.callAction|0),c.recreate!=null&&(k.recreate=!!c.recreate),c.session!=null&&(k.session=String(c.session)),k},b.toObject=function(c,k){k||(k={});let C={};if((k.arrays||k.defaults)&&(C.tracks=[]),k.defaults&&(C.sdp="",C.callAction=0),c.sdp!=null&&c.hasOwnProperty("sdp")&&(C.sdp=c.sdp),c.tracks&&c.tracks.length){C.tracks=[];for(let N=0;N<c.tracks.length;++N)C.tracks[N]=$root.com.quick.voice.proto.Track.toObject(c.tracks[N],k)}return c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction),c.recreate!=null&&c.hasOwnProperty("recreate")&&(C.recreate=c.recreate,k.oneofs&&(C._recreate="recreate")),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,k.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishReq"},b}(),A.PublishRsp=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.remoteSdp="",b.prototype.session=null;let S;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&k.uint32(10).string(c.remoteSdp),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&k.uint32(18).string(c.session),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.PublishRsp;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.remoteSdp=c.string();break}case 2:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){return typeof c!="object"||c===null?"object expected":c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp)?"remoteSdp: string expected":c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishRsp)return c;let k=new $root.com.quick.voice.proto.PublishRsp;return c.remoteSdp!=null&&(k.remoteSdp=String(c.remoteSdp)),c.session!=null&&(k.session=String(c.session)),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,k.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishRsp"},b}(),A.PublishNotify=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.roomId="",b.prototype.user=null,b.prototype.session=null;let S;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&k.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,k.uint32(18).fork()).ldelim(),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&k.uint32(26).string(c.session),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.PublishNotify;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(c.user);if(k)return"user."+k}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishNotify)return c;let k=new $root.com.quick.voice.proto.PublishNotify;if(c.roomId!=null&&(k.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(c.user)}return c.session!=null&&(k.session=String(c.session)),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.roomId="",C.user=null),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,k)),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,k.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishNotify"},b}(),A.SubscribeReq=function(){function b(i){if(this.users=[],i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.users=$util.emptyArray,b.prototype.session=null;let S;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){if(k||(k=$Writer.create()),c.users!=null&&c.users.length)for(let C=0;C<c.users.length;++C)$root.com.quick.voice.proto.User.encode(c.users[C],k.uint32(10).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&k.uint32(18).string(c.session),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.SubscribeReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 2:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.users!=null&&c.hasOwnProperty("users")){if(!Array.isArray(c.users))return"users: array expected";for(let k=0;k<c.users.length;++k){let C=$root.com.quick.voice.proto.User.verify(c.users[k]);if(C)return"users."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SubscribeReq)return c;let k=new $root.com.quick.voice.proto.SubscribeReq;if(c.users){if(!Array.isArray(c.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");k.users=[];for(let C=0;C<c.users.length;++C){if(typeof c.users[C]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");k.users[C]=$root.com.quick.voice.proto.User.fromObject(c.users[C])}}return c.session!=null&&(k.session=String(c.session)),k},b.toObject=function(c,k){k||(k={});let C={};if((k.arrays||k.defaults)&&(C.users=[]),c.users&&c.users.length){C.users=[];for(let N=0;N<c.users.length;++N)C.users[N]=$root.com.quick.voice.proto.User.toObject(c.users[N],k)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,k.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SubscribeReq"},b}(),A.SubscribeRsp=function(){function b(i){if(this.users=[],i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.remoteSdp="",b.prototype.users=$util.emptyArray,b.prototype.session=null;let S;return Object.defineProperty(b.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){if(k||(k=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&k.uint32(10).string(c.remoteSdp),c.users!=null&&c.users.length)for(let C=0;C<c.users.length;++C)$root.com.quick.voice.proto.User.encode(c.users[C],k.uint32(18).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&k.uint32(26).string(c.session),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.SubscribeRsp;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.remoteSdp=c.string();break}case 2:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 3:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp))return"remoteSdp: string expected";if(c.users!=null&&c.hasOwnProperty("users")){if(!Array.isArray(c.users))return"users: array expected";for(let k=0;k<c.users.length;++k){let C=$root.com.quick.voice.proto.User.verify(c.users[k]);if(C)return"users."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SubscribeRsp)return c;let k=new $root.com.quick.voice.proto.SubscribeRsp;if(c.remoteSdp!=null&&(k.remoteSdp=String(c.remoteSdp)),c.users){if(!Array.isArray(c.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");k.users=[];for(let C=0;C<c.users.length;++C){if(typeof c.users[C]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");k.users[C]=$root.com.quick.voice.proto.User.fromObject(c.users[C])}}return c.session!=null&&(k.session=String(c.session)),k},b.toObject=function(c,k){k||(k={});let C={};if((k.arrays||k.defaults)&&(C.users=[]),k.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.users&&c.users.length){C.users=[];for(let N=0;N<c.users.length;++N)C.users[N]=$root.com.quick.voice.proto.User.toObject(c.users[N],k)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,k.oneofs&&(C._session="session")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SubscribeRsp"},b}(),A.RenegotiateReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.userId="",b.prototype.sdp="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(18).string(i.sdp),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.sdp=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let c=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(c.userId=String(i.userId)),i.sdp!=null&&(c.sdp=String(i.sdp)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.userId="",k.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&(k.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&(k.sdp=i.sdp),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},b}(),A.QuitReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.userId="",b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let c=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.userId="",k.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(k.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},b}(),A.QuitNotify=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.roomId="",b.prototype.user=null,b.prototype.code=null,b.prototype.desc=null;let S;return Object.defineProperty(b.prototype,"_code",{get:$util.oneOfGetter(S=["code"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_desc",{get:$util.oneOfGetter(S=["desc"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&k.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,k.uint32(18).fork()).ldelim(),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&k.uint32(24).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&k.uint32(34).string(c.desc),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.QuitNotify;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.code=c.int32();break}case 4:{N.desc=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let k=$root.com.quick.voice.proto.User.verify(c.user);if(k)return"user."+k}return c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code)?"code: integer expected":c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc)?"desc: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.QuitNotify)return c;let k=new $root.com.quick.voice.proto.QuitNotify;if(c.roomId!=null&&(k.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");k.user=$root.com.quick.voice.proto.User.fromObject(c.user)}return c.code!=null&&(k.code=c.code|0),c.desc!=null&&(k.desc=String(c.desc)),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.roomId="",C.user=null),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,k)),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,k.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,k.oneofs&&(C._desc="desc")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.QuitNotify"},b}(),A.TokenExpireNotify=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let c=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},b}(),A.UpdateTokenReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.sdkToken="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(18).string(i.sdkToken),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.sdkToken=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let c=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(c.roomId=String(i.roomId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.roomId="",k.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(k.sdkToken=i.sdkToken),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},b}(),A.NetQualityChange=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.userId="",b.prototype.roomId="",b.prototype.egress=0,b.prototype.ingress=0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&c.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&c.uint32(32).int32(i.ingress),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}case 3:{C.egress=i.int32();break}case 4:{C.ingress=i.int32();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.egress!=null&&i.hasOwnProperty("egress")&&!$util.isInteger(i.egress)?"egress: integer expected":i.ingress!=null&&i.hasOwnProperty("ingress")&&!$util.isInteger(i.ingress)?"ingress: integer expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let c=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),i.egress!=null&&(c.egress=i.egress|0),i.ingress!=null&&(c.ingress=i.ingress|0),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.userId="",k.roomId="",k.egress=0,k.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&(k.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&(k.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&(k.ingress=i.ingress),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},b}(),A.NetQualityNotify=function(){function b(S){if(this.qualities=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.qualities=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let k=0;k<i.qualities.length;++k)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[k],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.qualities&&C.qualities.length||(C.qualities=[]),C.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.qualities!=null&&i.hasOwnProperty("qualities")){if(!Array.isArray(i.qualities))return"qualities: array expected";for(let c=0;c<i.qualities.length;++c){let k=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[c]);if(k)return"qualities."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let c=new $root.com.quick.voice.proto.NetQualityNotify;if(i.qualities){if(!Array.isArray(i.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");c.qualities=[];for(let k=0;k<i.qualities.length;++k){if(typeof i.qualities[k]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");c.qualities[k]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.qualities=[]),i.qualities&&i.qualities.length){k.qualities=[];for(let C=0;C<i.qualities.length;++C)k.qualities[C]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},b}(),A.UpdateCall=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let c=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.roomId="",k.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(k.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},b}(),A.SyncRoomInfoReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.roomId="",k.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(k.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},b}(),A.SyncRoomInfoRsp=function(){function b(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.isValid=!1,b.prototype.users=$util.emptyArray,b.prototype.isActive=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&c.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let k=0;k<i.users.length;++k)$root.com.quick.voice.proto.User.encode(i.users[k],c.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&c.uint32(32).bool(i.isActive),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.isValid=i.bool();break}case 3:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{C.isActive=i.bool();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.isValid!=null&&i.hasOwnProperty("isValid")&&typeof i.isValid!="boolean")return"isValid: boolean expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let k=$root.com.quick.voice.proto.User.verify(i.users[c]);if(k)return"users."+k}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.isValid!=null&&(c.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");c.users=[];for(let k=0;k<i.users.length;++k){if(typeof i.users[k]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");c.users[k]=$root.com.quick.voice.proto.User.fromObject(i.users[k])}}return i.isActive!=null&&(c.isActive=!!i.isActive),c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.users=[]),c.defaults&&(k.roomId="",k.isValid=!1,k.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&(k.isValid=i.isValid),i.users&&i.users.length){k.users=[];for(let C=0;C<i.users.length;++C)k.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&(k.isActive=i.isActive),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},b}(),A.UpdateTime=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(8).int64(i.time),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.time=i.int64();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let c=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),c},b.toObject=function(i,c){c||(c={});let k={};if(c.defaults)if($util.Long){let C=new $util.Long(0,0,!1);k.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.time=c.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?k.time=c.longs===String?String(i.time):i.time:k.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},b}(),A.CloseTrackReq=function(){function b(S){if(this.tracks=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.sdp="",b.prototype.tracks=$util.emptyArray,b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let k=0;k<i.tracks.length;++k)$root.com.quick.voice.proto.Track.encode(i.tracks[k],c.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(26).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.sdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp))return"sdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let k=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(k)return"tracks."+k}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let c=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(c.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");c.tracks=[];for(let k=0;k<i.tracks.length;++k){if(typeof i.tracks[k]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");c.tracks[k]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[k])}}return i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.tracks=[]),c.defaults&&(k.sdp="",k.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(k.sdp=i.sdp),i.tracks&&i.tracks.length){k.tracks=[];for(let C=0;C<i.tracks.length;++C)k.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},b}(),A.CloseTrackRsp=function(){function b(S){if(this.tracks=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.remoteSdp="",b.prototype.tracks=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&c.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let k=0;k<i.tracks.length;++k)$root.com.quick.voice.proto.Track.encode(i.tracks[k],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.remoteSdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let k=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(k)return"tracks."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let c=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(c.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");c.tracks=[];for(let k=0;k<i.tracks.length;++k){if(typeof i.tracks[k]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");c.tracks[k]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.tracks=[]),c.defaults&&(k.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&(k.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){k.tracks=[];for(let C=0;C<i.tracks.length;++C)k.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},b}(),A.CloseTrackNotify=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(10).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let c=new $root.com.quick.voice.proto.CloseTrackNotify;if(i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.user=null),i.user!=null&&i.hasOwnProperty("user")&&(k.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},b}(),A.TrackType=function(){const b={},S=Object.create(b);return S[b[0]="Microphone"]=0,S[b[1]="Camera"]=1,S[b[2]="Screen"]=2,S[b[3]="SystemVoice"]=3,S}(),A.UpdatePermissions=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.user=null,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let c=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.roomId="",k.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(k.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},b}(),A.CallType=function(){const b={},S=Object.create(b);return S[b[0]="Normal"]=0,S[b[1]="Meeting"]=1,S[b[2]="Live"]=2,S}(),A.QuitNotifyCode=function(){const b={},S=Object.create(b);return S[b[0]="NormalQuit"]=0,S[b[2021]="Timeout"]=2021,S[b[2011]="TokenExpired"]=2011,S[b[2022]="KickOut"]=2022,S[b[2023]="EndPk"]=2023,S[b[2024]="EndLive"]=2024,S}(),A.UserBehavior=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.type=0,b.prototype.behavior=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&c.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&c.uint32(16).bool(i.behavior),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.type=i.int32();break}case 2:{C.behavior=i.bool();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.behavior!=null&&i.hasOwnProperty("behavior")&&typeof i.behavior!="boolean"?"behavior: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let c=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){c.type=i.type;break}break;case"Microphone":case 0:c.type=0;break;case"Camera":case 1:c.type=1;break;case"Screen":case 2:c.type=2;break;case"SystemVoice":case 3:c.type=3;break}return i.behavior!=null&&(c.behavior=!!i.behavior),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.type=c.enums===String?"Microphone":0,k.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&(k.type=c.enums===String?$root.com.quick.voice.proto.TrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.TrackType[i.type]:i.type),i.behavior!=null&&i.hasOwnProperty("behavior")&&(k.behavior=i.behavior),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},b}(),A.PreventUser=function(){function b(S){if(this.behaviors=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.id="",b.prototype.behaviors=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&c.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let k=0;k<i.behaviors.length;++k)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[k],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.id=i.string();break}case 2:{C.behaviors&&C.behaviors.length||(C.behaviors=[]),C.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.id!=null&&i.hasOwnProperty("id")&&!$util.isString(i.id))return"id: string expected";if(i.behaviors!=null&&i.hasOwnProperty("behaviors")){if(!Array.isArray(i.behaviors))return"behaviors: array expected";for(let c=0;c<i.behaviors.length;++c){let k=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[c]);if(k)return"behaviors."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let c=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(c.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");c.behaviors=[];for(let k=0;k<i.behaviors.length;++k){if(typeof i.behaviors[k]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");c.behaviors[k]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.behaviors=[]),c.defaults&&(k.id=""),i.id!=null&&i.hasOwnProperty("id")&&(k.id=i.id),i.behaviors&&i.behaviors.length){k.behaviors=[];for(let C=0;C<i.behaviors.length;++C)k.behaviors[C]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},b}(),A.PreventUsersBehaviorReq=function(){function b(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.users=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let k=0;k<i.users.length;++k)$root.com.quick.voice.proto.PreventUser.encode(i.users[k],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let k=$root.com.quick.voice.proto.PreventUser.verify(i.users[c]);if(k)return"users."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");c.users=[];for(let k=0;k<i.users.length;++k){if(typeof i.users[k]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");c.users[k]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.users=[]),c.defaults&&(k.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.users&&i.users.length){k.users=[];for(let C=0;C<i.users.length;++C)k.users[C]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},b}(),A.PreventUsersBehaviorNotify=function(){function b(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.users=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let k=0;k<i.users.length;++k)$root.com.quick.voice.proto.User.encode(i.users[k],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let k=$root.com.quick.voice.proto.User.verify(i.users[c]);if(k)return"users."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");c.users=[];for(let k=0;k<i.users.length;++k){if(typeof i.users[k]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");c.users[k]=$root.com.quick.voice.proto.User.fromObject(i.users[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.users=[]),c.defaults&&(k.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.users&&i.users.length){k.users=[];for(let C=0;C<i.users.length;++C)k.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},b}(),A.AccelerationAreas=function(){const b={},S=Object.create(b);return S[b[0]="chinaMainland"]=0,S[b[1]="global"]=1,S[b[2]="overseas"]=2,S}(),A.CountMethods=function(){const b={},S=Object.create(b);return S[b[0]="flow"]=0,S[b[1]="minutes"]=1,S}(),A.BaseCDNAddress=function(){function b(S){if(this.urlMap={},S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.area=0,b.prototype.countType=0,b.prototype.urlMap=$util.emptyObject,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&c.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&c.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let k=Object.keys(i.urlMap),C=0;C<k.length;++C)c.uint32(26).fork().uint32(10).string(k[C]).uint32(18).string(i.urlMap[k[C]]).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.BaseCDNAddress,N,j;for(;i.pos<k;){let Z=i.uint32();switch(Z>>>3){case 1:{C.area=i.int32();break}case 2:{C.countType=i.int32();break}case 3:{C.urlMap===$util.emptyObject&&(C.urlMap={});let z=i.uint32()+i.pos;for(N="",j="";i.pos<z;){let K=i.uint32();switch(K>>>3){case 1:N=i.string();break;case 2:j=i.string();break;default:i.skipType(K&7);break}}C.urlMap[N]=j;break}default:i.skipType(Z&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.area!=null&&i.hasOwnProperty("area"))switch(i.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(i.countType!=null&&i.hasOwnProperty("countType"))switch(i.countType){default:return"countType: enum value expected";case 0:case 1:break}if(i.urlMap!=null&&i.hasOwnProperty("urlMap")){if(!$util.isObject(i.urlMap))return"urlMap: object expected";let c=Object.keys(i.urlMap);for(let k=0;k<c.length;++k)if(!$util.isString(i.urlMap[c[k]]))return"urlMap: string{k:string} expected"}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let c=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){c.area=i.area;break}break;case"chinaMainland":case 0:c.area=0;break;case"global":case 1:c.area=1;break;case"overseas":case 2:c.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){c.countType=i.countType;break}break;case"flow":case 0:c.countType=0;break;case"minutes":case 1:c.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");c.urlMap={};for(let k=Object.keys(i.urlMap),C=0;C<k.length;++C)c.urlMap[k[C]]=String(i.urlMap[k[C]])}return c},b.toObject=function(i,c){c||(c={});let k={};(c.objects||c.defaults)&&(k.urlMap={}),c.defaults&&(k.area=c.enums===String?"chinaMainland":0,k.countType=c.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&(k.area=c.enums===String?$root.com.quick.voice.proto.AccelerationAreas[i.area]===void 0?i.area:$root.com.quick.voice.proto.AccelerationAreas[i.area]:i.area),i.countType!=null&&i.hasOwnProperty("countType")&&(k.countType=c.enums===String?$root.com.quick.voice.proto.CountMethods[i.countType]===void 0?i.countType:$root.com.quick.voice.proto.CountMethods[i.countType]:i.countType);let C;if(i.urlMap&&(C=Object.keys(i.urlMap)).length){k.urlMap={};for(let N=0;N<C.length;++N)k.urlMap[C[N]]=i.urlMap[C[N]]}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},b}(),A.CDNPlayAddressNotify=function(){function b(i){if(this.standLines=[],i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.roomId="",b.prototype.m3u8=null,b.prototype.rtmp=null,b.prototype.flv=null,b.prototype.rtmps=null,b.prototype.mainLine=null,b.prototype.standLines=$util.emptyArray;let S;return Object.defineProperty(b.prototype,"_m3u8",{get:$util.oneOfGetter(S=["m3u8"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_rtmp",{get:$util.oneOfGetter(S=["rtmp"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_flv",{get:$util.oneOfGetter(S=["flv"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_rtmps",{get:$util.oneOfGetter(S=["rtmps"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_mainLine",{get:$util.oneOfGetter(S=["mainLine"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){if(k||(k=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&k.uint32(10).string(c.roomId),c.m3u8!=null&&Object.hasOwnProperty.call(c,"m3u8")&&k.uint32(18).string(c.m3u8),c.rtmp!=null&&Object.hasOwnProperty.call(c,"rtmp")&&k.uint32(26).string(c.rtmp),c.flv!=null&&Object.hasOwnProperty.call(c,"flv")&&k.uint32(34).string(c.flv),c.rtmps!=null&&Object.hasOwnProperty.call(c,"rtmps")&&k.uint32(42).string(c.rtmps),c.mainLine!=null&&Object.hasOwnProperty.call(c,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(c.mainLine,k.uint32(50).fork()).ldelim(),c.standLines!=null&&c.standLines.length)for(let C=0;C<c.standLines.length;++C)$root.com.quick.voice.proto.BaseCDNAddress.encode(c.standLines[C],k.uint32(58).fork()).ldelim();return k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.m3u8=c.string();break}case 3:{N.rtmp=c.string();break}case 4:{N.flv=c.string();break}case 5:{N.rtmps=c.string();break}case 6:{N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32());break}case 7:{N.standLines&&N.standLines.length||(N.standLines=[]),N.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32()));break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.m3u8!=null&&c.hasOwnProperty("m3u8")&&!$util.isString(c.m3u8))return"m3u8: string expected";if(c.rtmp!=null&&c.hasOwnProperty("rtmp")&&!$util.isString(c.rtmp))return"rtmp: string expected";if(c.flv!=null&&c.hasOwnProperty("flv")&&!$util.isString(c.flv))return"flv: string expected";if(c.rtmps!=null&&c.hasOwnProperty("rtmps")&&!$util.isString(c.rtmps))return"rtmps: string expected";if(c.mainLine!=null&&c.hasOwnProperty("mainLine")){let k=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.mainLine);if(k)return"mainLine."+k}if(c.standLines!=null&&c.hasOwnProperty("standLines")){if(!Array.isArray(c.standLines))return"standLines: array expected";for(let k=0;k<c.standLines.length;++k){let C=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.standLines[k]);if(C)return"standLines."+C}}return null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return c;let k=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(c.roomId!=null&&(k.roomId=String(c.roomId)),c.m3u8!=null&&(k.m3u8=String(c.m3u8)),c.rtmp!=null&&(k.rtmp=String(c.rtmp)),c.flv!=null&&(k.flv=String(c.flv)),c.rtmps!=null&&(k.rtmps=String(c.rtmps)),c.mainLine!=null){if(typeof c.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");k.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.mainLine)}if(c.standLines){if(!Array.isArray(c.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");k.standLines=[];for(let C=0;C<c.standLines.length;++C){if(typeof c.standLines[C]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");k.standLines[C]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.standLines[C])}}return k},b.toObject=function(c,k){k||(k={});let C={};if((k.arrays||k.defaults)&&(C.standLines=[]),k.defaults&&(C.roomId=""),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.m3u8!=null&&c.hasOwnProperty("m3u8")&&(C.m3u8=c.m3u8,k.oneofs&&(C._m3u8="m3u8")),c.rtmp!=null&&c.hasOwnProperty("rtmp")&&(C.rtmp=c.rtmp,k.oneofs&&(C._rtmp="rtmp")),c.flv!=null&&c.hasOwnProperty("flv")&&(C.flv=c.flv,k.oneofs&&(C._flv="flv")),c.rtmps!=null&&c.hasOwnProperty("rtmps")&&(C.rtmps=c.rtmps,k.oneofs&&(C._rtmps="rtmps")),c.mainLine!=null&&c.hasOwnProperty("mainLine")&&(C.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.mainLine,k),k.oneofs&&(C._mainLine="mainLine")),c.standLines&&c.standLines.length){C.standLines=[];for(let N=0;N<c.standLines.length;++N)C.standLines[N]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.standLines[N],k)}return C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.CDNPlayAddressNotify"},b}(),A.UserChannel=function(){function b(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.userId="",b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let k=0;k<i.channels.length;++k)$root.com.quick.voice.proto.DataChannel.encode(i.channels[k],c.uint32(18).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let k=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(k)return"channels."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let c=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(c.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");c.channels=[];for(let k=0;k<i.channels.length;++k){if(typeof i.channels[k]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");c.channels[k]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.channels=[]),c.defaults&&(k.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(k.userId=i.userId),i.channels&&i.channels.length){k.channels=[];for(let C=0;C<i.channels.length;++C)k.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},b}(),A.ChannelPublishReq=function(){function b(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let k=0;k<i.channels.length;++k)$root.com.quick.voice.proto.DataChannel.encode(i.channels[k],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let k=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(k)return"channels."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishReq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");c.channels=[];for(let k=0;k<i.channels.length;++k){if(typeof i.channels[k]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");c.channels[k]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.channels=[]),i.channels&&i.channels.length){k.channels=[];for(let C=0;C<i.channels.length;++C)k.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},b}(),A.ChannelPublishRsq=function(){function b(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let k=0;k<i.channels.length;++k)$root.com.quick.voice.proto.UserChannel.encode(i.channels[k],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let k=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if(k)return"channels."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");c.channels=[];for(let k=0;k<i.channels.length;++k){if(typeof i.channels[k]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");c.channels[k]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.channels=[]),i.channels&&i.channels.length){k.channels=[];for(let C=0;C<i.channels.length;++C)k.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},b}(),A.ChannelSubscribeReq=function(){function b(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.users=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.users!=null&&i.users.length)for(let k=0;k<i.users.length;++k)$root.com.quick.voice.proto.UserChannel.encode(i.users[k],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let k=$root.com.quick.voice.proto.UserChannel.verify(i.users[c]);if(k)return"users."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");c.users=[];for(let k=0;k<i.users.length;++k){if(typeof i.users[k]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");c.users[k]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.users=[]),i.users&&i.users.length){k.users=[];for(let C=0;C<i.users.length;++C)k.users[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},b}(),A.ChannelSubscribeRsq=function(){function b(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.channels=$util.emptyArray,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let k=0;k<i.channels.length;++k)$root.com.quick.voice.proto.UserChannel.encode(i.channels[k],c.uint32(10).fork()).ldelim();return c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let k=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if(k)return"channels."+k}}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");c.channels=[];for(let k=0;k<i.channels.length;++k){if(typeof i.channels[k]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");c.channels[k]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[k])}}return c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.channels=[]),i.channels&&i.channels.length){k.channels=[];for(let C=0;C<i.channels.length;++C)k.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},b}(),A.DataChannelData=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.userId="",b.prototype.type=0,b.prototype.audioData=null;let S;return Object.defineProperty(b.prototype,"_audioData",{get:$util.oneOfGetter(S=["audioData"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&k.uint32(10).string(c.userId),c.type!=null&&Object.hasOwnProperty.call(c,"type")&&k.uint32(16).int32(c.type),c.audioData!=null&&Object.hasOwnProperty.call(c,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(c.audioData,k.uint32(26).fork()).ldelim(),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.DataChannelData;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.userId=c.string();break}case 2:{N.type=c.int32();break}case 3:{N.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(c,c.uint32());break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.type!=null&&c.hasOwnProperty("type"))switch(c.type){default:return"type: enum value expected";case 0:break}if(c.audioData!=null&&c.hasOwnProperty("audioData")){let k=$root.com.quick.voice.proto.DataChannelAudioData.verify(c.audioData);if(k)return"audioData."+k}return null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannelData)return c;let k=new $root.com.quick.voice.proto.DataChannelData;switch(c.userId!=null&&(k.userId=String(c.userId)),c.type){default:if(typeof c.type=="number"){k.type=c.type;break}break;case"backAuido":case 0:k.type=0;break}if(c.audioData!=null){if(typeof c.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");k.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(c.audioData)}return k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.userId="",C.type=k.enums===String?"backAuido":0),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId),c.type!=null&&c.hasOwnProperty("type")&&(C.type=k.enums===String?$root.com.quick.voice.proto.DataChannelType[c.type]===void 0?c.type:$root.com.quick.voice.proto.DataChannelType[c.type]:c.type),c.audioData!=null&&c.hasOwnProperty("audioData")&&(C.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(c.audioData,k),k.oneofs&&(C._audioData="audioData")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannelData"},b}(),A.DataChannelType=function(){const b={},S=Object.create(b);return S[b[0]="backAuido"]=0,S}(),A.DataChannelAudioData=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.data=$util.newBuffer([]),b.prototype.format=null,b.prototype.time=null;let S;return Object.defineProperty(b.prototype,"_time",{get:$util.oneOfGetter(S=["time"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.data!=null&&Object.hasOwnProperty.call(c,"data")&&k.uint32(10).bytes(c.data),c.format!=null&&Object.hasOwnProperty.call(c,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(c.format,k.uint32(18).fork()).ldelim(),c.time!=null&&Object.hasOwnProperty.call(c,"time")&&k.uint32(24).int64(c.time),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.DataChannelAudioData;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.data=c.bytes();break}case 2:{N.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(c,c.uint32());break}case 3:{N.time=c.int64();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.data!=null&&c.hasOwnProperty("data")&&!(c.data&&typeof c.data.length=="number"||$util.isString(c.data)))return"data: buffer expected";if(c.format!=null&&c.hasOwnProperty("format")){let k=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(c.format);if(k)return"format."+k}return c.time!=null&&c.hasOwnProperty("time")&&!$util.isInteger(c.time)&&!(c.time&&$util.isInteger(c.time.low)&&$util.isInteger(c.time.high))?"time: integer|Long expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannelAudioData)return c;let k=new $root.com.quick.voice.proto.DataChannelAudioData;if(c.data!=null&&(typeof c.data=="string"?$util.base64.decode(c.data,k.data=$util.newBuffer($util.base64.length(c.data)),0):c.data.length>=0&&(k.data=c.data)),c.format!=null){if(typeof c.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");k.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(c.format)}return c.time!=null&&($util.Long?(k.time=$util.Long.fromValue(c.time)).unsigned=!1:typeof c.time=="string"?k.time=parseInt(c.time,10):typeof c.time=="number"?k.time=c.time:typeof c.time=="object"&&(k.time=new $util.LongBits(c.time.low>>>0,c.time.high>>>0).toNumber())),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(k.bytes===String?C.data="":(C.data=[],k.bytes!==Array&&(C.data=$util.newBuffer(C.data))),C.format=null),c.data!=null&&c.hasOwnProperty("data")&&(C.data=k.bytes===String?$util.base64.encode(c.data,0,c.data.length):k.bytes===Array?Array.prototype.slice.call(c.data):c.data),c.format!=null&&c.hasOwnProperty("format")&&(C.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(c.format,k)),c.time!=null&&c.hasOwnProperty("time")&&(typeof c.time=="number"?C.time=k.longs===String?String(c.time):c.time:C.time=k.longs===String?$util.Long.prototype.toString.call(c.time):k.longs===Number?new $util.LongBits(c.time.low>>>0,c.time.high>>>0).toNumber():c.time,k.oneofs&&(C._time="time")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannelAudioData"},b}(),A.DataChannelAudioFormat=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.sampleRate=0,b.prototype.channels=0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.sampleRate!=null&&Object.hasOwnProperty.call(i,"sampleRate")&&c.uint32(9).double(i.sampleRate),i.channels!=null&&Object.hasOwnProperty.call(i,"channels")&&c.uint32(16).int32(i.channels),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.sampleRate=i.double();break}case 2:{C.channels=i.int32();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&typeof i.sampleRate!="number"?"sampleRate: number expected":i.channels!=null&&i.hasOwnProperty("channels")&&!$util.isInteger(i.channels)?"channels: integer expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return i;let c=new $root.com.quick.voice.proto.DataChannelAudioFormat;return i.sampleRate!=null&&(c.sampleRate=Number(i.sampleRate)),i.channels!=null&&(c.channels=i.channels|0),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.sampleRate=0,k.channels=0),i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&(k.sampleRate=c.json&&!isFinite(i.sampleRate)?String(i.sampleRate):i.sampleRate),i.channels!=null&&i.hasOwnProperty("channels")&&(k.channels=i.channels),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelAudioFormat"},b}(),A.AckMsgReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.msgId!=null&&Object.hasOwnProperty.call(i,"msgId")&&c.uint32(8).int64(i.msgId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.AckMsgReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.msgId=i.int64();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.msgId!=null&&i.hasOwnProperty("msgId")&&!$util.isInteger(i.msgId)&&!(i.msgId&&$util.isInteger(i.msgId.low)&&$util.isInteger(i.msgId.high))?"msgId: integer|Long expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AckMsgReq)return i;let c=new $root.com.quick.voice.proto.AckMsgReq;return i.msgId!=null&&($util.Long?(c.msgId=$util.Long.fromValue(i.msgId)).unsigned=!1:typeof i.msgId=="string"?c.msgId=parseInt(i.msgId,10):typeof i.msgId=="number"?c.msgId=i.msgId:typeof i.msgId=="object"&&(c.msgId=new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber())),c},b.toObject=function(i,c){c||(c={});let k={};if(c.defaults)if($util.Long){let C=new $util.Long(0,0,!1);k.msgId=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else k.msgId=c.longs===String?"0":0;return i.msgId!=null&&i.hasOwnProperty("msgId")&&(typeof i.msgId=="number"?k.msgId=c.longs===String?String(i.msgId):i.msgId:k.msgId=c.longs===String?$util.Long.prototype.toString.call(i.msgId):c.longs===Number?new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber():i.msgId),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AckMsgReq"},b}(),A.SdpConsult=function(){function b(i){if(this.tracks=[],i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.roomId="",b.prototype.sender=null,b.prototype.receiverId="",b.prototype.sdp="",b.prototype.tracks=$util.emptyArray;let S;return Object.defineProperty(b.prototype,"_sender",{get:$util.oneOfGetter(S=["sender"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){if(k||(k=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&k.uint32(10).string(c.roomId),c.sender!=null&&Object.hasOwnProperty.call(c,"sender")&&$root.com.quick.voice.proto.User.encode(c.sender,k.uint32(18).fork()).ldelim(),c.receiverId!=null&&Object.hasOwnProperty.call(c,"receiverId")&&k.uint32(26).string(c.receiverId),c.sdp!=null&&Object.hasOwnProperty.call(c,"sdp")&&k.uint32(34).string(c.sdp),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],k.uint32(42).fork()).ldelim();return k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.SdpConsult;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.sender=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.receiverId=c.string();break}case 4:{N.sdp=c.string();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.sender!=null&&c.hasOwnProperty("sender")){let k=$root.com.quick.voice.proto.User.verify(c.sender);if(k)return"sender."+k}if(c.receiverId!=null&&c.hasOwnProperty("receiverId")&&!$util.isString(c.receiverId))return"receiverId: string expected";if(c.sdp!=null&&c.hasOwnProperty("sdp")&&!$util.isString(c.sdp))return"sdp: string expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let k=0;k<c.tracks.length;++k){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[k]);if(C)return"tracks."+C}}return null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SdpConsult)return c;let k=new $root.com.quick.voice.proto.SdpConsult;if(c.roomId!=null&&(k.roomId=String(c.roomId)),c.sender!=null){if(typeof c.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");k.sender=$root.com.quick.voice.proto.User.fromObject(c.sender)}if(c.receiverId!=null&&(k.receiverId=String(c.receiverId)),c.sdp!=null&&(k.sdp=String(c.sdp)),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");k.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");k.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}return k},b.toObject=function(c,k){k||(k={});let C={};if((k.arrays||k.defaults)&&(C.tracks=[]),k.defaults&&(C.roomId="",C.receiverId="",C.sdp=""),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.sender!=null&&c.hasOwnProperty("sender")&&(C.sender=$root.com.quick.voice.proto.User.toObject(c.sender,k),k.oneofs&&(C._sender="sender")),c.receiverId!=null&&c.hasOwnProperty("receiverId")&&(C.receiverId=c.receiverId),c.sdp!=null&&c.hasOwnProperty("sdp")&&(C.sdp=c.sdp),c.tracks&&c.tracks.length){C.tracks=[];for(let N=0;N<c.tracks.length;++N)C.tracks[N]=$root.com.quick.voice.proto.Track.toObject(c.tracks[N],k)}return C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SdpConsult"},b}(),A.Candidate=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.sdpMid="",b.prototype.sdpMLineIndex=0,b.prototype.sdp="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.sdpMid!=null&&Object.hasOwnProperty.call(i,"sdpMid")&&c.uint32(10).string(i.sdpMid),i.sdpMLineIndex!=null&&Object.hasOwnProperty.call(i,"sdpMLineIndex")&&c.uint32(16).int32(i.sdpMLineIndex),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(26).string(i.sdp),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Candidate;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.sdpMid=i.string();break}case 2:{C.sdpMLineIndex=i.int32();break}case 3:{C.sdp=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&!$util.isString(i.sdpMid)?"sdpMid: string expected":i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&!$util.isInteger(i.sdpMLineIndex)?"sdpMLineIndex: integer expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidate)return i;let c=new $root.com.quick.voice.proto.Candidate;return i.sdpMid!=null&&(c.sdpMid=String(i.sdpMid)),i.sdpMLineIndex!=null&&(c.sdpMLineIndex=i.sdpMLineIndex|0),i.sdp!=null&&(c.sdp=String(i.sdp)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.sdpMid="",k.sdpMLineIndex=0,k.sdp=""),i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&(k.sdpMid=i.sdpMid),i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&(k.sdpMLineIndex=i.sdpMLineIndex),i.sdp!=null&&i.hasOwnProperty("sdp")&&(k.sdp=i.sdp),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidate"},b}(),A.Candidates=function(){function b(S){if(this.candidates=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.roomId="",b.prototype.senderId="",b.prototype.receiverId="",b.prototype.candidates=$util.emptyArray,b.prototype.isSubscribeReceiver=!1,b.create=function(i){return new b(i)},b.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.senderId!=null&&Object.hasOwnProperty.call(i,"senderId")&&c.uint32(18).string(i.senderId),i.receiverId!=null&&Object.hasOwnProperty.call(i,"receiverId")&&c.uint32(26).string(i.receiverId),i.candidates!=null&&i.candidates.length)for(let k=0;k<i.candidates.length;++k)$root.com.quick.voice.proto.Candidate.encode(i.candidates[k],c.uint32(34).fork()).ldelim();return i.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(i,"isSubscribeReceiver")&&c.uint32(40).bool(i.isSubscribeReceiver),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Candidates;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.senderId=i.string();break}case 3:{C.receiverId=i.string();break}case 4:{C.candidates&&C.candidates.length||(C.candidates=[]),C.candidates.push($root.com.quick.voice.proto.Candidate.decode(i,i.uint32()));break}case 5:{C.isSubscribeReceiver=i.bool();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.senderId!=null&&i.hasOwnProperty("senderId")&&!$util.isString(i.senderId))return"senderId: string expected";if(i.receiverId!=null&&i.hasOwnProperty("receiverId")&&!$util.isString(i.receiverId))return"receiverId: string expected";if(i.candidates!=null&&i.hasOwnProperty("candidates")){if(!Array.isArray(i.candidates))return"candidates: array expected";for(let c=0;c<i.candidates.length;++c){let k=$root.com.quick.voice.proto.Candidate.verify(i.candidates[c]);if(k)return"candidates."+k}}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&typeof i.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidates)return i;let c=new $root.com.quick.voice.proto.Candidates;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.senderId!=null&&(c.senderId=String(i.senderId)),i.receiverId!=null&&(c.receiverId=String(i.receiverId)),i.candidates){if(!Array.isArray(i.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");c.candidates=[];for(let k=0;k<i.candidates.length;++k){if(typeof i.candidates[k]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");c.candidates[k]=$root.com.quick.voice.proto.Candidate.fromObject(i.candidates[k])}}return i.isSubscribeReceiver!=null&&(c.isSubscribeReceiver=!!i.isSubscribeReceiver),c},b.toObject=function(i,c){c||(c={});let k={};if((c.arrays||c.defaults)&&(k.candidates=[]),c.defaults&&(k.roomId="",k.senderId="",k.receiverId="",k.isSubscribeReceiver=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),i.senderId!=null&&i.hasOwnProperty("senderId")&&(k.senderId=i.senderId),i.receiverId!=null&&i.hasOwnProperty("receiverId")&&(k.receiverId=i.receiverId),i.candidates&&i.candidates.length){k.candidates=[];for(let C=0;C<i.candidates.length;++C)k.candidates[C]=$root.com.quick.voice.proto.Candidate.toObject(i.candidates[C],c)}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&(k.isSubscribeReceiver=i.isSubscribeReceiver),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidates"},b}(),A.NatType=function(){const b={},S=Object.create(b);return S[b[0]="Symmetric"]=0,S[b[1]="Cone"]=1,S[b[2]="Port"]=2,S[b[3]="IP"]=3,S[b[4]="UnKnown"]=4,S}(),A.NetworkType=function(){const b={},S=Object.create(b);return S[b[0]="Wifi"]=0,S[b[1]="Wired"]=1,S[b[2]="Mobile"]=2,S}(),A.ReportNetInfo=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.nat=0,b.prototype.type=0,b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.nat!=null&&Object.hasOwnProperty.call(i,"nat")&&c.uint32(8).int32(i.nat),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&c.uint32(16).int32(i.type),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ReportNetInfo;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.nat=i.int32();break}case 2:{C.type=i.int32();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.nat!=null&&i.hasOwnProperty("nat"))switch(i.nat){default:return"nat: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportNetInfo)return i;let c=new $root.com.quick.voice.proto.ReportNetInfo;switch(i.nat){default:if(typeof i.nat=="number"){c.nat=i.nat;break}break;case"Symmetric":case 0:c.nat=0;break;case"Cone":case 1:c.nat=1;break;case"Port":case 2:c.nat=2;break;case"IP":case 3:c.nat=3;break;case"UnKnown":case 4:c.nat=4;break}switch(i.type){default:if(typeof i.type=="number"){c.type=i.type;break}break;case"Wifi":case 0:c.type=0;break;case"Wired":case 1:c.type=1;break;case"Mobile":case 2:c.type=2;break}return c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.nat=c.enums===String?"Symmetric":0,k.type=c.enums===String?"Wifi":0),i.nat!=null&&i.hasOwnProperty("nat")&&(k.nat=c.enums===String?$root.com.quick.voice.proto.NatType[i.nat]===void 0?i.nat:$root.com.quick.voice.proto.NatType[i.nat]:i.nat),i.type!=null&&i.hasOwnProperty("type")&&(k.type=c.enums===String?$root.com.quick.voice.proto.NetworkType[i.type]===void 0?i.type:$root.com.quick.voice.proto.NetworkType[i.type]:i.type),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportNetInfo"},b}(),A.P2PCode=function(){const b={},S=Object.create(b);return S[b[0]="Success"]=0,S[b[1]="Failed"]=1,S[b[2]="Ignore"]=2,S[b[3]="Disconnected"]=3,S}(),A.ReportP2PReq=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.code=0,b.prototype.userId="",b.prototype.reason=null;let S;return Object.defineProperty(b.prototype,"_reason",{get:$util.oneOfGetter(S=["reason"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&k.uint32(8).int32(c.code),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&k.uint32(18).string(c.userId),c.reason!=null&&Object.hasOwnProperty.call(c,"reason")&&k.uint32(26).string(c.reason),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.ReportP2PReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.code=c.int32();break}case 2:{N.userId=c.string();break}case 3:{N.reason=c.string();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.code!=null&&c.hasOwnProperty("code"))switch(c.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:break}return c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId)?"userId: string expected":c.reason!=null&&c.hasOwnProperty("reason")&&!$util.isString(c.reason)?"reason: string expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.ReportP2PReq)return c;let k=new $root.com.quick.voice.proto.ReportP2PReq;switch(c.code){default:if(typeof c.code=="number"){k.code=c.code;break}break;case"Success":case 0:k.code=0;break;case"Failed":case 1:k.code=1;break;case"Ignore":case 2:k.code=2;break;case"Disconnected":case 3:k.code=3;break}return c.userId!=null&&(k.userId=String(c.userId)),c.reason!=null&&(k.reason=String(c.reason)),k},b.toObject=function(c,k){k||(k={});let C={};return k.defaults&&(C.code=k.enums===String?"Success":0,C.userId=""),c.code!=null&&c.hasOwnProperty("code")&&(C.code=k.enums===String?$root.com.quick.voice.proto.P2PCode[c.code]===void 0?c.code:$root.com.quick.voice.proto.P2PCode[c.code]:c.code),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId),c.reason!=null&&c.hasOwnProperty("reason")&&(C.reason=c.reason,k.oneofs&&(C._reason="reason")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.ReportP2PReq"},b}(),A.ReportTrafficUsage=function(){function b(i){if(i)for(let c=Object.keys(i),k=0;k<c.length;++k)i[c[k]]!=null&&(this[c[k]]=i[c[k]])}b.prototype.p2pPush=null,b.prototype.p2pPull=null,b.prototype.sfuPush=null,b.prototype.sfuPull=null;let S;return Object.defineProperty(b.prototype,"_p2pPush",{get:$util.oneOfGetter(S=["p2pPush"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_p2pPull",{get:$util.oneOfGetter(S=["p2pPull"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_sfuPush",{get:$util.oneOfGetter(S=["sfuPush"]),set:$util.oneOfSetter(S)}),Object.defineProperty(b.prototype,"_sfuPull",{get:$util.oneOfGetter(S=["sfuPull"]),set:$util.oneOfSetter(S)}),b.create=function(c){return new b(c)},b.encode=function(c,k){return k||(k=$Writer.create()),c.p2pPush!=null&&Object.hasOwnProperty.call(c,"p2pPush")&&k.uint32(8).int64(c.p2pPush),c.p2pPull!=null&&Object.hasOwnProperty.call(c,"p2pPull")&&k.uint32(16).int64(c.p2pPull),c.sfuPush!=null&&Object.hasOwnProperty.call(c,"sfuPush")&&k.uint32(24).int64(c.sfuPush),c.sfuPull!=null&&Object.hasOwnProperty.call(c,"sfuPull")&&k.uint32(32).int64(c.sfuPull),k},b.encodeDelimited=function(c,k){return this.encode(c,k).ldelim()},b.decode=function(c,k){c instanceof $Reader||(c=$Reader.create(c));let C=k===void 0?c.len:c.pos+k,N=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.p2pPush=c.int64();break}case 2:{N.p2pPull=c.int64();break}case 3:{N.sfuPush=c.int64();break}case 4:{N.sfuPull=c.int64();break}default:c.skipType(j&7);break}}return N},b.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},b.verify=function(c){return typeof c!="object"||c===null?"object expected":c.p2pPush!=null&&c.hasOwnProperty("p2pPush")&&!$util.isInteger(c.p2pPush)&&!(c.p2pPush&&$util.isInteger(c.p2pPush.low)&&$util.isInteger(c.p2pPush.high))?"p2pPush: integer|Long expected":c.p2pPull!=null&&c.hasOwnProperty("p2pPull")&&!$util.isInteger(c.p2pPull)&&!(c.p2pPull&&$util.isInteger(c.p2pPull.low)&&$util.isInteger(c.p2pPull.high))?"p2pPull: integer|Long expected":c.sfuPush!=null&&c.hasOwnProperty("sfuPush")&&!$util.isInteger(c.sfuPush)&&!(c.sfuPush&&$util.isInteger(c.sfuPush.low)&&$util.isInteger(c.sfuPush.high))?"sfuPush: integer|Long expected":c.sfuPull!=null&&c.hasOwnProperty("sfuPull")&&!$util.isInteger(c.sfuPull)&&!(c.sfuPull&&$util.isInteger(c.sfuPull.low)&&$util.isInteger(c.sfuPull.high))?"sfuPull: integer|Long expected":null},b.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return c;let k=new $root.com.quick.voice.proto.ReportTrafficUsage;return c.p2pPush!=null&&($util.Long?(k.p2pPush=$util.Long.fromValue(c.p2pPush)).unsigned=!1:typeof c.p2pPush=="string"?k.p2pPush=parseInt(c.p2pPush,10):typeof c.p2pPush=="number"?k.p2pPush=c.p2pPush:typeof c.p2pPush=="object"&&(k.p2pPush=new $util.LongBits(c.p2pPush.low>>>0,c.p2pPush.high>>>0).toNumber())),c.p2pPull!=null&&($util.Long?(k.p2pPull=$util.Long.fromValue(c.p2pPull)).unsigned=!1:typeof c.p2pPull=="string"?k.p2pPull=parseInt(c.p2pPull,10):typeof c.p2pPull=="number"?k.p2pPull=c.p2pPull:typeof c.p2pPull=="object"&&(k.p2pPull=new $util.LongBits(c.p2pPull.low>>>0,c.p2pPull.high>>>0).toNumber())),c.sfuPush!=null&&($util.Long?(k.sfuPush=$util.Long.fromValue(c.sfuPush)).unsigned=!1:typeof c.sfuPush=="string"?k.sfuPush=parseInt(c.sfuPush,10):typeof c.sfuPush=="number"?k.sfuPush=c.sfuPush:typeof c.sfuPush=="object"&&(k.sfuPush=new $util.LongBits(c.sfuPush.low>>>0,c.sfuPush.high>>>0).toNumber())),c.sfuPull!=null&&($util.Long?(k.sfuPull=$util.Long.fromValue(c.sfuPull)).unsigned=!1:typeof c.sfuPull=="string"?k.sfuPull=parseInt(c.sfuPull,10):typeof c.sfuPull=="number"?k.sfuPull=c.sfuPull:typeof c.sfuPull=="object"&&(k.sfuPull=new $util.LongBits(c.sfuPull.low>>>0,c.sfuPull.high>>>0).toNumber())),k},b.toObject=function(c,k){k||(k={});let C={};return c.p2pPush!=null&&c.hasOwnProperty("p2pPush")&&(typeof c.p2pPush=="number"?C.p2pPush=k.longs===String?String(c.p2pPush):c.p2pPush:C.p2pPush=k.longs===String?$util.Long.prototype.toString.call(c.p2pPush):k.longs===Number?new $util.LongBits(c.p2pPush.low>>>0,c.p2pPush.high>>>0).toNumber():c.p2pPush,k.oneofs&&(C._p2pPush="p2pPush")),c.p2pPull!=null&&c.hasOwnProperty("p2pPull")&&(typeof c.p2pPull=="number"?C.p2pPull=k.longs===String?String(c.p2pPull):c.p2pPull:C.p2pPull=k.longs===String?$util.Long.prototype.toString.call(c.p2pPull):k.longs===Number?new $util.LongBits(c.p2pPull.low>>>0,c.p2pPull.high>>>0).toNumber():c.p2pPull,k.oneofs&&(C._p2pPull="p2pPull")),c.sfuPush!=null&&c.hasOwnProperty("sfuPush")&&(typeof c.sfuPush=="number"?C.sfuPush=k.longs===String?String(c.sfuPush):c.sfuPush:C.sfuPush=k.longs===String?$util.Long.prototype.toString.call(c.sfuPush):k.longs===Number?new $util.LongBits(c.sfuPush.low>>>0,c.sfuPush.high>>>0).toNumber():c.sfuPush,k.oneofs&&(C._sfuPush="sfuPush")),c.sfuPull!=null&&c.hasOwnProperty("sfuPull")&&(typeof c.sfuPull=="number"?C.sfuPull=k.longs===String?String(c.sfuPull):c.sfuPull:C.sfuPull=k.longs===String?$util.Long.prototype.toString.call(c.sfuPull):k.longs===Number?new $util.LongBits(c.sfuPull.low>>>0,c.sfuPull.high>>>0).toNumber():c.sfuPull,k.oneofs&&(C._sfuPull="sfuPull")),C},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.ReportTrafficUsage"},b}(),A.P2PAttemptConnectReq=function(){function b(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return b.prototype.userId="",b.prototype.roomId="",b.create=function(i){return new b(i)},b.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),c},b.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},b.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let k=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.P2PAttemptConnectReq;for(;i.pos<k;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},b.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},b.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},b.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PAttemptConnectReq)return i;let c=new $root.com.quick.voice.proto.P2PAttemptConnectReq;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),c},b.toObject=function(i,c){c||(c={});let k={};return c.defaults&&(k.userId="",k.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(k.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(k.roomId=i.roomId),k},b.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},b.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PAttemptConnectReq"},b}(),A}(),O}(),D}(),$})(),enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onAttemptP2PReq:"尝试与对方建立P2P连接",onOffer:"收到P2P-offer",onAnswer:"收到P2P-answer",onCandidate:"收到P2P候选信息-candidate",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",onUpdateBehavior:"行为允许权限变更",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onDestroy:"SDK销毁"};ht(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1($){let D=$.length;for(;--D>=0;)$[D]=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($,D,O,A,b){this.static_tree=$,this.extra_bits=D,this.extra_base=O,this.elems=A,this.max_length=b,this.has_stree=$&&$.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc($,D){this.dyn_tree=$,this.max_code=0,this.stat_desc=D}const d_code=$=>$<256?_dist_code[$]:_dist_code[256+($>>>7)],put_short=($,D)=>{$.pending_buf[$.pending++]=D&255,$.pending_buf[$.pending++]=D>>>8&255},send_bits=($,D,O)=>{$.bi_valid>Buf_size-O?($.bi_buf|=D<<$.bi_valid&65535,put_short($,$.bi_buf),$.bi_buf=D>>Buf_size-$.bi_valid,$.bi_valid+=O-Buf_size):($.bi_buf|=D<<$.bi_valid&65535,$.bi_valid+=O)},send_code=($,D,O)=>{send_bits($,O[D*2],O[D*2+1])},bi_reverse=($,D)=>{let O=0;do O|=$&1,$>>>=1,O<<=1;while(--D>0);return O>>>1},bi_flush=$=>{$.bi_valid===16?(put_short($,$.bi_buf),$.bi_buf=0,$.bi_valid=0):$.bi_valid>=8&&($.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8)},gen_bitlen=($,D)=>{const O=D.dyn_tree,A=D.max_code,b=D.stat_desc.static_tree,S=D.stat_desc.has_stree,i=D.stat_desc.extra_bits,c=D.stat_desc.extra_base,k=D.stat_desc.max_length;let C,N,j,Z,z,K,te=0;for(Z=0;Z<=MAX_BITS$1;Z++)$.bl_count[Z]=0;for(O[$.heap[$.heap_max]*2+1]=0,C=$.heap_max+1;C<HEAP_SIZE$1;C++)N=$.heap[C],Z=O[O[N*2+1]*2+1]+1,Z>k&&(Z=k,te++),O[N*2+1]=Z,!(N>A)&&($.bl_count[Z]++,z=0,N>=c&&(z=i[N-c]),K=O[N*2],$.opt_len+=K*(Z+z),S&&($.static_len+=K*(b[N*2+1]+z)));if(te!==0){do{for(Z=k-1;$.bl_count[Z]===0;)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[k]--,te-=2}while(te>0);for(Z=k;Z!==0;Z--)for(N=$.bl_count[Z];N!==0;)j=$.heap[--C],!(j>A)&&(O[j*2+1]!==Z&&($.opt_len+=(Z-O[j*2+1])*O[j*2],O[j*2+1]=Z),N--)}},gen_codes=($,D,O)=>{const A=new Array(MAX_BITS$1+1);let b=0,S,i;for(S=1;S<=MAX_BITS$1;S++)b=b+O[S-1]<<1,A[S]=b;for(i=0;i<=D;i++){let c=$[i*2+1];c!==0&&($[i*2]=bi_reverse(A[c]++,c))}},tr_static_init=()=>{let $,D,O,A,b;const S=new Array(MAX_BITS$1+1);for(O=0,A=0;A<LENGTH_CODES$1-1;A++)for(base_length[A]=O,$=0;$<1<<extra_lbits[A];$++)_length_code[O++]=A;for(_length_code[O-1]=A,b=0,A=0;A<16;A++)for(base_dist[A]=b,$=0;$<1<<extra_dbits[A];$++)_dist_code[b++]=A;for(b>>=7;A<D_CODES$1;A++)for(base_dist[A]=b<<7,$=0;$<1<<extra_dbits[A]-7;$++)_dist_code[256+b++]=A;for(D=0;D<=MAX_BITS$1;D++)S[D]=0;for($=0;$<=143;)static_ltree[$*2+1]=8,$++,S[8]++;for(;$<=255;)static_ltree[$*2+1]=9,$++,S[9]++;for(;$<=279;)static_ltree[$*2+1]=7,$++,S[7]++;for(;$<=287;)static_ltree[$*2+1]=8,$++,S[8]++;for(gen_codes(static_ltree,L_CODES$1+1,S),$=0;$<D_CODES$1;$++)static_dtree[$*2+1]=5,static_dtree[$*2]=bi_reverse($,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=$=>{let D;for(D=0;D<L_CODES$1;D++)$.dyn_ltree[D*2]=0;for(D=0;D<D_CODES$1;D++)$.dyn_dtree[D*2]=0;for(D=0;D<BL_CODES$1;D++)$.bl_tree[D*2]=0;$.dyn_ltree[END_BLOCK*2]=1,$.opt_len=$.static_len=0,$.sym_next=$.matches=0},bi_windup=$=>{$.bi_valid>8?put_short($,$.bi_buf):$.bi_valid>0&&($.pending_buf[$.pending++]=$.bi_buf),$.bi_buf=0,$.bi_valid=0},smaller=($,D,O,A)=>{const b=D*2,S=O*2;return $[b]<$[S]||$[b]===$[S]&&A[D]<=A[O]},pqdownheap=($,D,O)=>{const A=$.heap[O];let b=O<<1;for(;b<=$.heap_len&&(b<$.heap_len&&smaller(D,$.heap[b+1],$.heap[b],$.depth)&&b++,!smaller(D,A,$.heap[b],$.depth));)$.heap[O]=$.heap[b],O=b,b<<=1;$.heap[O]=A},compress_block=($,D,O)=>{let A,b,S=0,i,c;if($.sym_next!==0)do A=$.pending_buf[$.sym_buf+S++]&255,A+=($.pending_buf[$.sym_buf+S++]&255)<<8,b=$.pending_buf[$.sym_buf+S++],A===0?send_code($,b,D):(i=_length_code[b],send_code($,i+LITERALS$1+1,D),c=extra_lbits[i],c!==0&&(b-=base_length[i],send_bits($,b,c)),A--,i=d_code(A),send_code($,i,O),c=extra_dbits[i],c!==0&&(A-=base_dist[i],send_bits($,A,c)));while(S<$.sym_next);send_code($,END_BLOCK,D)},build_tree=($,D)=>{const O=D.dyn_tree,A=D.stat_desc.static_tree,b=D.stat_desc.has_stree,S=D.stat_desc.elems;let i,c,k=-1,C;for($.heap_len=0,$.heap_max=HEAP_SIZE$1,i=0;i<S;i++)O[i*2]!==0?($.heap[++$.heap_len]=k=i,$.depth[i]=0):O[i*2+1]=0;for(;$.heap_len<2;)C=$.heap[++$.heap_len]=k<2?++k:0,O[C*2]=1,$.depth[C]=0,$.opt_len--,b&&($.static_len-=A[C*2+1]);for(D.max_code=k,i=$.heap_len>>1;i>=1;i--)pqdownheap($,O,i);C=S;do i=$.heap[1],$.heap[1]=$.heap[$.heap_len--],pqdownheap($,O,1),c=$.heap[1],$.heap[--$.heap_max]=i,$.heap[--$.heap_max]=c,O[C*2]=O[i*2]+O[c*2],$.depth[C]=($.depth[i]>=$.depth[c]?$.depth[i]:$.depth[c])+1,O[i*2+1]=O[c*2+1]=C,$.heap[1]=C++,pqdownheap($,O,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],gen_bitlen($,D),gen_codes(O,k,$.bl_count)},scan_tree=($,D,O)=>{let A,b=-1,S,i=D[1],c=0,k=7,C=4;for(i===0&&(k=138,C=3),D[(O+1)*2+1]=65535,A=0;A<=O;A++)S=i,i=D[(A+1)*2+1],!(++c<k&&S===i)&&(c<C?$.bl_tree[S*2]+=c:S!==0?(S!==b&&$.bl_tree[S*2]++,$.bl_tree[REP_3_6*2]++):c<=10?$.bl_tree[REPZ_3_10*2]++:$.bl_tree[REPZ_11_138*2]++,c=0,b=S,i===0?(k=138,C=3):S===i?(k=6,C=3):(k=7,C=4))},send_tree=($,D,O)=>{let A,b=-1,S,i=D[1],c=0,k=7,C=4;for(i===0&&(k=138,C=3),A=0;A<=O;A++)if(S=i,i=D[(A+1)*2+1],!(++c<k&&S===i)){if(c<C)do send_code($,S,$.bl_tree);while(--c!==0);else S!==0?(S!==b&&(send_code($,S,$.bl_tree),c--),send_code($,REP_3_6,$.bl_tree),send_bits($,c-3,2)):c<=10?(send_code($,REPZ_3_10,$.bl_tree),send_bits($,c-3,3)):(send_code($,REPZ_11_138,$.bl_tree),send_bits($,c-11,7));c=0,b=S,i===0?(k=138,C=3):S===i?(k=6,C=3):(k=7,C=4)}},build_bl_tree=$=>{let D;for(scan_tree($,$.dyn_ltree,$.l_desc.max_code),scan_tree($,$.dyn_dtree,$.d_desc.max_code),build_tree($,$.bl_desc),D=BL_CODES$1-1;D>=3&&$.bl_tree[bl_order[D]*2+1]===0;D--);return $.opt_len+=3*(D+1)+5+5+4,D},send_all_trees=($,D,O,A)=>{let b;for(send_bits($,D-257,5),send_bits($,O-1,5),send_bits($,A-4,4),b=0;b<A;b++)send_bits($,$.bl_tree[bl_order[b]*2+1],3);send_tree($,$.dyn_ltree,D-1),send_tree($,$.dyn_dtree,O-1)},detect_data_type=$=>{let D=4093624447,O;for(O=0;O<=31;O++,D>>>=1)if(D&1&&$.dyn_ltree[O*2]!==0)return Z_BINARY;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return Z_TEXT;for(O=32;O<LITERALS$1;O++)if($.dyn_ltree[O*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=$=>{static_init_done||(tr_static_init(),static_init_done=!0),$.l_desc=new TreeDesc($.dyn_ltree,static_l_desc),$.d_desc=new TreeDesc($.dyn_dtree,static_d_desc),$.bl_desc=new TreeDesc($.bl_tree,static_bl_desc),$.bi_buf=0,$.bi_valid=0,init_block($)},_tr_stored_block$1=($,D,O,A)=>{send_bits($,(STORED_BLOCK<<1)+(A?1:0),3),bi_windup($),put_short($,O),put_short($,~O),O&&$.pending_buf.set($.window.subarray(D,D+O),$.pending),$.pending+=O},_tr_align$1=$=>{send_bits($,STATIC_TREES<<1,3),send_code($,END_BLOCK,static_ltree),bi_flush($)},_tr_flush_block$1=($,D,O,A)=>{let b,S,i=0;$.level>0?($.strm.data_type===Z_UNKNOWN$1&&($.strm.data_type=detect_data_type($)),build_tree($,$.l_desc),build_tree($,$.d_desc),i=build_bl_tree($),b=$.opt_len+3+7>>>3,S=$.static_len+3+7>>>3,S<=b&&(b=S)):b=S=O+5,O+4<=b&&D!==-1?_tr_stored_block$1($,D,O,A):$.strategy===Z_FIXED$1||S===b?(send_bits($,(STATIC_TREES<<1)+(A?1:0),3),compress_block($,static_ltree,static_dtree)):(send_bits($,(DYN_TREES<<1)+(A?1:0),3),send_all_trees($,$.l_desc.max_code+1,$.d_desc.max_code+1,i+1),compress_block($,$.dyn_ltree,$.dyn_dtree)),init_block($),A&&bi_windup($)},_tr_tally$1=($,D,O)=>($.pending_buf[$.sym_buf+$.sym_next++]=D,$.pending_buf[$.sym_buf+$.sym_next++]=D>>8,$.pending_buf[$.sym_buf+$.sym_next++]=O,D===0?$.dyn_ltree[O*2]++:($.matches++,D--,$.dyn_ltree[(_length_code[O]+LITERALS$1+1)*2]++,$.dyn_dtree[d_code(D)*2]++),$.sym_next===$.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=($,D,O,A)=>{let b=$&65535|0,S=$>>>16&65535|0,i=0;for(;O!==0;){i=O>2e3?2e3:O,O-=i;do b=b+D[A++]|0,S=S+b|0;while(--i);b%=65521,S%=65521}return b|S<<16|0};var adler32_1=adler32;const makeTable=()=>{let $,D=[];for(var O=0;O<256;O++){$=O;for(var A=0;A<8;A++)$=$&1?3988292384^$>>>1:$>>>1;D[O]=$}return D},crcTable=new Uint32Array(makeTable()),crc32=($,D,O,A)=>{const b=crcTable,S=A+O;$^=-1;for(let i=A;i<S;i++)$=$>>>8^b[($^D[i])&255];return $^-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=($,D)=>($.msg=messages[D],D),rank=$=>$*2-($>4?9:0),zero=$=>{let D=$.length;for(;--D>=0;)$[D]=0},slide_hash=$=>{let D,O,A,b=$.w_size;D=$.hash_size,A=D;do O=$.head[--A],$.head[A]=O>=b?O-b:0;while(--D);D=b,A=D;do O=$.prev[--A],$.prev[A]=O>=b?O-b:0;while(--D)};let HASH_ZLIB=($,D,O)=>(D<<$.hash_shift^O)&$.hash_mask,HASH=HASH_ZLIB;const flush_pending=$=>{const D=$.state;let O=D.pending;O>$.avail_out&&(O=$.avail_out),O!==0&&($.output.set(D.pending_buf.subarray(D.pending_out,D.pending_out+O),$.next_out),$.next_out+=O,D.pending_out+=O,$.total_out+=O,$.avail_out-=O,D.pending-=O,D.pending===0&&(D.pending_out=0))},flush_block_only=($,D)=>{_tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,D),$.block_start=$.strstart,flush_pending($.strm)},put_byte=($,D)=>{$.pending_buf[$.pending++]=D},putShortMSB=($,D)=>{$.pending_buf[$.pending++]=D>>>8&255,$.pending_buf[$.pending++]=D&255},read_buf=($,D,O,A)=>{let b=$.avail_in;return b>A&&(b=A),b===0?0:($.avail_in-=b,D.set($.input.subarray($.next_in,$.next_in+b),O),$.state.wrap===1?$.adler=adler32_1($.adler,D,b,O):$.state.wrap===2&&($.adler=crc32_1($.adler,D,b,O)),$.next_in+=b,$.total_in+=b,b)},longest_match=($,D)=>{let O=$.max_chain_length,A=$.strstart,b,S,i=$.prev_length,c=$.nice_match;const k=$.strstart>$.w_size-MIN_LOOKAHEAD?$.strstart-($.w_size-MIN_LOOKAHEAD):0,C=$.window,N=$.w_mask,j=$.prev,Z=$.strstart+MAX_MATCH;let z=C[A+i-1],K=C[A+i];$.prev_length>=$.good_match&&(O>>=2),c>$.lookahead&&(c=$.lookahead);do if(b=D,!(C[b+i]!==K||C[b+i-1]!==z||C[b]!==C[A]||C[++b]!==C[A+1])){A+=2,b++;do;while(C[++A]===C[++b]&&C[++A]===C[++b]&&C[++A]===C[++b]&&C[++A]===C[++b]&&C[++A]===C[++b]&&C[++A]===C[++b]&&C[++A]===C[++b]&&C[++A]===C[++b]&&A<Z);if(S=MAX_MATCH-(Z-A),A=Z-MAX_MATCH,S>i){if($.match_start=D,i=S,S>=c)break;z=C[A+i-1],K=C[A+i]}}while((D=j[D&N])>k&&--O!==0);return i<=$.lookahead?i:$.lookahead},fill_window=$=>{const D=$.w_size;let O,A,b;do{if(A=$.window_size-$.lookahead-$.strstart,$.strstart>=D+(D-MIN_LOOKAHEAD)&&($.window.set($.window.subarray(D,D+D-A),0),$.match_start-=D,$.strstart-=D,$.block_start-=D,$.insert>$.strstart&&($.insert=$.strstart),slide_hash($),A+=D),$.strm.avail_in===0)break;if(O=read_buf($.strm,$.window,$.strstart+$.lookahead,A),$.lookahead+=O,$.lookahead+$.insert>=MIN_MATCH)for(b=$.strstart-$.insert,$.ins_h=$.window[b],$.ins_h=HASH($,$.ins_h,$.window[b+1]);$.insert&&($.ins_h=HASH($,$.ins_h,$.window[b+MIN_MATCH-1]),$.prev[b&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=b,b++,$.insert--,!($.lookahead+$.insert<MIN_MATCH)););}while($.lookahead<MIN_LOOKAHEAD&&$.strm.avail_in!==0)},deflate_stored=($,D)=>{let O=$.pending_buf_size-5>$.w_size?$.w_size:$.pending_buf_size-5,A,b,S,i=0,c=$.strm.avail_in;do{if(A=65535,S=$.bi_valid+42>>3,$.strm.avail_out<S||(S=$.strm.avail_out-S,b=$.strstart-$.block_start,A>b+$.strm.avail_in&&(A=b+$.strm.avail_in),A>S&&(A=S),A<O&&(A===0&&D!==Z_FINISH$3||D===Z_NO_FLUSH$2||A!==b+$.strm.avail_in)))break;i=D===Z_FINISH$3&&A===b+$.strm.avail_in?1:0,_tr_stored_block($,0,0,i),$.pending_buf[$.pending-4]=A,$.pending_buf[$.pending-3]=A>>8,$.pending_buf[$.pending-2]=~A,$.pending_buf[$.pending-1]=~A>>8,flush_pending($.strm),b&&(b>A&&(b=A),$.strm.output.set($.window.subarray($.block_start,$.block_start+b),$.strm.next_out),$.strm.next_out+=b,$.strm.avail_out-=b,$.strm.total_out+=b,$.block_start+=b,A-=b),A&&(read_buf($.strm,$.strm.output,$.strm.next_out,A),$.strm.next_out+=A,$.strm.avail_out-=A,$.strm.total_out+=A)}while(i===0);return c-=$.strm.avail_in,c&&(c>=$.w_size?($.matches=2,$.window.set($.strm.input.subarray($.strm.next_in-$.w_size,$.strm.next_in),0),$.strstart=$.w_size,$.insert=$.strstart):($.window_size-$.strstart<=c&&($.strstart-=$.w_size,$.window.set($.window.subarray($.w_size,$.w_size+$.strstart),0),$.matches<2&&$.matches++,$.insert>$.strstart&&($.insert=$.strstart)),$.window.set($.strm.input.subarray($.strm.next_in-c,$.strm.next_in),$.strstart),$.strstart+=c,$.insert+=c>$.w_size-$.insert?$.w_size-$.insert:c),$.block_start=$.strstart),$.high_water<$.strstart&&($.high_water=$.strstart),i?BS_FINISH_DONE:D!==Z_NO_FLUSH$2&&D!==Z_FINISH$3&&$.strm.avail_in===0&&$.strstart===$.block_start?BS_BLOCK_DONE:(S=$.window_size-$.strstart,$.strm.avail_in>S&&$.block_start>=$.w_size&&($.block_start-=$.w_size,$.strstart-=$.w_size,$.window.set($.window.subarray($.w_size,$.w_size+$.strstart),0),$.matches<2&&$.matches++,S+=$.w_size,$.insert>$.strstart&&($.insert=$.strstart)),S>$.strm.avail_in&&(S=$.strm.avail_in),S&&(read_buf($.strm,$.window,$.strstart,S),$.strstart+=S,$.insert+=S>$.w_size-$.insert?$.w_size-$.insert:S),$.high_water<$.strstart&&($.high_water=$.strstart),S=$.bi_valid+42>>3,S=$.pending_buf_size-S>65535?65535:$.pending_buf_size-S,O=S>$.w_size?$.w_size:S,b=$.strstart-$.block_start,(b>=O||(b||D===Z_FINISH$3)&&D!==Z_NO_FLUSH$2&&$.strm.avail_in===0&&b<=S)&&(A=b>S?S:b,i=D===Z_FINISH$3&&$.strm.avail_in===0&&A===b?1:0,_tr_stored_block($,$.block_start,A,i),$.block_start+=A,flush_pending($.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=($,D)=>{let O,A;for(;;){if($.lookahead<MIN_LOOKAHEAD){if(fill_window($),$.lookahead<MIN_LOOKAHEAD&&D===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if(O=0,$.lookahead>=MIN_MATCH&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),O!==0&&$.strstart-O<=$.w_size-MIN_LOOKAHEAD&&($.match_length=longest_match($,O)),$.match_length>=MIN_MATCH)if(A=_tr_tally($,$.strstart-$.match_start,$.match_length-MIN_MATCH),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=MIN_MATCH){$.match_length--;do $.strstart++,$.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=HASH($,$.ins_h,$.window[$.strstart+1]);else A=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(A&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=$.strstart<MIN_MATCH-1?$.strstart:MIN_MATCH-1,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=($,D)=>{let O,A,b;for(;;){if($.lookahead<MIN_LOOKAHEAD){if(fill_window($),$.lookahead<MIN_LOOKAHEAD&&D===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if(O=0,$.lookahead>=MIN_MATCH&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),$.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=MIN_MATCH-1,O!==0&&$.prev_length<$.max_lazy_match&&$.strstart-O<=$.w_size-MIN_LOOKAHEAD&&($.match_length=longest_match($,O),$.match_length<=5&&($.strategy===Z_FILTERED||$.match_length===MIN_MATCH&&$.strstart-$.match_start>4096)&&($.match_length=MIN_MATCH-1)),$.prev_length>=MIN_MATCH&&$.match_length<=$.prev_length){b=$.strstart+$.lookahead-MIN_MATCH,A=_tr_tally($,$.strstart-1-$.prev_match,$.prev_length-MIN_MATCH),$.lookahead-=$.prev_length-1,$.prev_length-=2;do++$.strstart<=b&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart);while(--$.prev_length!==0);if($.match_available=0,$.match_length=MIN_MATCH-1,$.strstart++,A&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}else if($.match_available){if(A=_tr_tally($,0,$.window[$.strstart-1]),A&&flush_block_only($,!1),$.strstart++,$.lookahead--,$.strm.avail_out===0)return BS_NEED_MORE}else $.match_available=1,$.strstart++,$.lookahead--}return $.match_available&&(A=_tr_tally($,0,$.window[$.strstart-1]),$.match_available=0),$.insert=$.strstart<MIN_MATCH-1?$.strstart:MIN_MATCH-1,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=($,D)=>{let O,A,b,S;const i=$.window;for(;;){if($.lookahead<=MAX_MATCH){if(fill_window($),$.lookahead<=MAX_MATCH&&D===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=MIN_MATCH&&$.strstart>0&&(b=$.strstart-1,A=i[b],A===i[++b]&&A===i[++b]&&A===i[++b])){S=$.strstart+MAX_MATCH;do;while(A===i[++b]&&A===i[++b]&&A===i[++b]&&A===i[++b]&&A===i[++b]&&A===i[++b]&&A===i[++b]&&A===i[++b]&&b<S);$.match_length=MAX_MATCH-(S-b),$.match_length>$.lookahead&&($.match_length=$.lookahead)}if($.match_length>=MIN_MATCH?(O=_tr_tally($,1,$.match_length-MIN_MATCH),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0):(O=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++),O&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=0,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=($,D)=>{let O;for(;;){if($.lookahead===0&&(fill_window($),$.lookahead===0)){if(D===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if($.match_length=0,O=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,O&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=0,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config($,D,O,A,b){this.good_length=$,this.max_lazy=D,this.nice_length=O,this.max_chain=A,this.func=b}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=$=>{$.window_size=2*$.w_size,zero($.head),$.max_lazy_match=configuration_table[$.level].max_lazy,$.good_match=configuration_table[$.level].good_length,$.nice_match=configuration_table[$.level].nice_length,$.max_chain_length=configuration_table[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=MIN_MATCH-1,$.match_available=0,$.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=$=>{if(!$)return 1;const D=$.state;return!D||D.strm!==$||D.status!==INIT_STATE&&D.status!==GZIP_STATE&&D.status!==EXTRA_STATE&&D.status!==NAME_STATE&&D.status!==COMMENT_STATE&&D.status!==HCRC_STATE&&D.status!==BUSY_STATE&&D.status!==FINISH_STATE?1:0},deflateResetKeep=$=>{if(deflateStateCheck($))return err($,Z_STREAM_ERROR$2);$.total_in=$.total_out=0,$.data_type=Z_UNKNOWN;const D=$.state;return D.pending=0,D.pending_out=0,D.wrap<0&&(D.wrap=-D.wrap),D.status=D.wrap===2?GZIP_STATE:D.wrap?INIT_STATE:BUSY_STATE,$.adler=D.wrap===2?0:1,D.last_flush=-2,_tr_init(D),Z_OK$3},deflateReset=$=>{const D=deflateResetKeep($);return D===Z_OK$3&&lm_init($.state),D},deflateSetHeader=($,D)=>deflateStateCheck($)||$.state.wrap!==2?Z_STREAM_ERROR$2:($.state.gzhead=D,Z_OK$3),deflateInit2=($,D,O,A,b,S)=>{if(!$)return Z_STREAM_ERROR$2;let i=1;if(D===Z_DEFAULT_COMPRESSION$1&&(D=6),A<0?(i=0,A=-A):A>15&&(i=2,A-=16),b<1||b>MAX_MEM_LEVEL||O!==Z_DEFLATED$2||A<8||A>15||D<0||D>9||S<0||S>Z_FIXED||A===8&&i!==1)return err($,Z_STREAM_ERROR$2);A===8&&(A=9);const c=new DeflateState;return $.state=c,c.strm=$,c.status=INIT_STATE,c.wrap=i,c.gzhead=null,c.w_bits=A,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=b+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+MIN_MATCH-1)/MIN_MATCH),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<b+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=D,c.strategy=S,c.method=O,deflateReset($)},deflateInit=($,D)=>deflateInit2($,D,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=($,D)=>{if(deflateStateCheck($)||D>Z_BLOCK$1||D<0)return $?err($,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const O=$.state;if(!$.output||$.avail_in!==0&&!$.input||O.status===FINISH_STATE&&D!==Z_FINISH$3)return err($,$.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const A=O.last_flush;if(O.last_flush=D,O.pending!==0){if(flush_pending($),$.avail_out===0)return O.last_flush=-1,Z_OK$3}else if($.avail_in===0&&rank(D)<=rank(A)&&D!==Z_FINISH$3)return err($,Z_BUF_ERROR$1);if(O.status===FINISH_STATE&&$.avail_in!==0)return err($,Z_BUF_ERROR$1);if(O.status===INIT_STATE&&O.wrap===0&&(O.status=BUSY_STATE),O.status===INIT_STATE){let b=Z_DEFLATED$2+(O.w_bits-8<<4)<<8,S=-1;if(O.strategy>=Z_HUFFMAN_ONLY||O.level<2?S=0:O.level<6?S=1:O.level===6?S=2:S=3,b|=S<<6,O.strstart!==0&&(b|=PRESET_DICT),b+=31-b%31,putShortMSB(O,b),O.strstart!==0&&(putShortMSB(O,$.adler>>>16),putShortMSB(O,$.adler&65535)),$.adler=1,O.status=BUSY_STATE,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3}if(O.status===GZIP_STATE){if($.adler=0,put_byte(O,31),put_byte(O,139),put_byte(O,8),O.gzhead)put_byte(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),put_byte(O,O.gzhead.time&255),put_byte(O,O.gzhead.time>>8&255),put_byte(O,O.gzhead.time>>16&255),put_byte(O,O.gzhead.time>>24&255),put_byte(O,O.level===9?2:O.strategy>=Z_HUFFMAN_ONLY||O.level<2?4:0),put_byte(O,O.gzhead.os&255),O.gzhead.extra&&O.gzhead.extra.length&&(put_byte(O,O.gzhead.extra.length&255),put_byte(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&($.adler=crc32_1($.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=EXTRA_STATE;else if(put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,O.level===9?2:O.strategy>=Z_HUFFMAN_ONLY||O.level<2?4:0),put_byte(O,OS_CODE),O.status=BUSY_STATE,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3}if(O.status===EXTRA_STATE){if(O.gzhead.extra){let b=O.pending,S=(O.gzhead.extra.length&65535)-O.gzindex;for(;O.pending+S>O.pending_buf_size;){let c=O.pending_buf_size-O.pending;if(O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex,O.gzindex+c),O.pending),O.pending=O.pending_buf_size,O.gzhead.hcrc&&O.pending>b&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-b,b)),O.gzindex+=c,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3;b=0,S-=c}let i=new Uint8Array(O.gzhead.extra);O.pending_buf.set(i.subarray(O.gzindex,O.gzindex+S),O.pending),O.pending+=S,O.gzhead.hcrc&&O.pending>b&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-b,b)),O.gzindex=0}O.status=NAME_STATE}if(O.status===NAME_STATE){if(O.gzhead.name){let b=O.pending,S;do{if(O.pending===O.pending_buf_size){if(O.gzhead.hcrc&&O.pending>b&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-b,b)),flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3;b=0}O.gzindex<O.gzhead.name.length?S=O.gzhead.name.charCodeAt(O.gzindex++)&255:S=0,put_byte(O,S)}while(S!==0);O.gzhead.hcrc&&O.pending>b&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-b,b)),O.gzindex=0}O.status=COMMENT_STATE}if(O.status===COMMENT_STATE){if(O.gzhead.comment){let b=O.pending,S;do{if(O.pending===O.pending_buf_size){if(O.gzhead.hcrc&&O.pending>b&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-b,b)),flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3;b=0}O.gzindex<O.gzhead.comment.length?S=O.gzhead.comment.charCodeAt(O.gzindex++)&255:S=0,put_byte(O,S)}while(S!==0);O.gzhead.hcrc&&O.pending>b&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-b,b))}O.status=HCRC_STATE}if(O.status===HCRC_STATE){if(O.gzhead.hcrc){if(O.pending+2>O.pending_buf_size&&(flush_pending($),O.pending!==0))return O.last_flush=-1,Z_OK$3;put_byte(O,$.adler&255),put_byte(O,$.adler>>8&255),$.adler=0}if(O.status=BUSY_STATE,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3}if($.avail_in!==0||O.lookahead!==0||D!==Z_NO_FLUSH$2&&O.status!==FINISH_STATE){let b=O.level===0?deflate_stored(O,D):O.strategy===Z_HUFFMAN_ONLY?deflate_huff(O,D):O.strategy===Z_RLE?deflate_rle(O,D):configuration_table[O.level].func(O,D);if((b===BS_FINISH_STARTED||b===BS_FINISH_DONE)&&(O.status=FINISH_STATE),b===BS_NEED_MORE||b===BS_FINISH_STARTED)return $.avail_out===0&&(O.last_flush=-1),Z_OK$3;if(b===BS_BLOCK_DONE&&(D===Z_PARTIAL_FLUSH?_tr_align(O):D!==Z_BLOCK$1&&(_tr_stored_block(O,0,0,!1),D===Z_FULL_FLUSH$1&&(zero(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),flush_pending($),$.avail_out===0))return O.last_flush=-1,Z_OK$3}return D!==Z_FINISH$3?Z_OK$3:O.wrap<=0?Z_STREAM_END$3:(O.wrap===2?(put_byte(O,$.adler&255),put_byte(O,$.adler>>8&255),put_byte(O,$.adler>>16&255),put_byte(O,$.adler>>24&255),put_byte(O,$.total_in&255),put_byte(O,$.total_in>>8&255),put_byte(O,$.total_in>>16&255),put_byte(O,$.total_in>>24&255)):(putShortMSB(O,$.adler>>>16),putShortMSB(O,$.adler&65535)),flush_pending($),O.wrap>0&&(O.wrap=-O.wrap),O.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=$=>{if(deflateStateCheck($))return Z_STREAM_ERROR$2;const D=$.state.status;return $.state=null,D===BUSY_STATE?err($,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=($,D)=>{let O=D.length;if(deflateStateCheck($))return Z_STREAM_ERROR$2;const A=$.state,b=A.wrap;if(b===2||b===1&&A.status!==INIT_STATE||A.lookahead)return Z_STREAM_ERROR$2;if(b===1&&($.adler=adler32_1($.adler,D,O,0)),A.wrap=0,O>=A.w_size){b===0&&(zero(A.head),A.strstart=0,A.block_start=0,A.insert=0);let k=new Uint8Array(A.w_size);k.set(D.subarray(O-A.w_size,O),0),D=k,O=A.w_size}const S=$.avail_in,i=$.next_in,c=$.input;for($.avail_in=O,$.next_in=0,$.input=D,fill_window(A);A.lookahead>=MIN_MATCH;){let k=A.strstart,C=A.lookahead-(MIN_MATCH-1);do A.ins_h=HASH(A,A.ins_h,A.window[k+MIN_MATCH-1]),A.prev[k&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=k,k++;while(--C);A.strstart=k,A.lookahead=MIN_MATCH-1,fill_window(A)}return A.strstart+=A.lookahead,A.block_start=A.strstart,A.insert=A.lookahead,A.lookahead=0,A.match_length=A.prev_length=MIN_MATCH-1,A.match_available=0,$.next_in=i,$.input=c,$.avail_in=S,A.wrap=b,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=($,D)=>Object.prototype.hasOwnProperty.call($,D);var assign=function($){const D=Array.prototype.slice.call(arguments,1);for(;D.length;){const O=D.shift();if(O){if(typeof O!="object")throw new TypeError(O+"must be non-object");for(const A in O)_has(O,A)&&($[A]=O[A])}}return $},flattenChunks=$=>{let D=0;for(let A=0,b=$.length;A<b;A++)D+=$[A].length;const O=new Uint8Array(D);for(let A=0,b=0,S=$.length;A<S;A++){let i=$[A];O.set(i,b),b+=i.length}return O},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let $=0;$<256;$++)_utf8len[$]=$>=252?6:$>=248?5:$>=240?4:$>=224?3:$>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=$=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode($);let D,O,A,b,S,i=$.length,c=0;for(b=0;b<i;b++)O=$.charCodeAt(b),(O&64512)===55296&&b+1<i&&(A=$.charCodeAt(b+1),(A&64512)===56320&&(O=65536+(O-55296<<10)+(A-56320),b++)),c+=O<128?1:O<2048?2:O<65536?3:4;for(D=new Uint8Array(c),S=0,b=0;S<c;b++)O=$.charCodeAt(b),(O&64512)===55296&&b+1<i&&(A=$.charCodeAt(b+1),(A&64512)===56320&&(O=65536+(O-55296<<10)+(A-56320),b++)),O<128?D[S++]=O:O<2048?(D[S++]=192|O>>>6,D[S++]=128|O&63):O<65536?(D[S++]=224|O>>>12,D[S++]=128|O>>>6&63,D[S++]=128|O&63):(D[S++]=240|O>>>18,D[S++]=128|O>>>12&63,D[S++]=128|O>>>6&63,D[S++]=128|O&63);return D};const buf2binstring=($,D)=>{if(D<65534&&$.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,$.length===D?$:$.subarray(0,D));let O="";for(let A=0;A<D;A++)O+=String.fromCharCode($[A]);return O};var buf2string=($,D)=>{const O=D||$.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode($.subarray(0,D));let A,b;const S=new Array(O*2);for(b=0,A=0;A<O;){let i=$[A++];if(i<128){S[b++]=i;continue}let c=_utf8len[i];if(c>4){S[b++]=65533,A+=c-1;continue}for(i&=c===2?31:c===3?15:7;c>1&&A<O;)i=i<<6|$[A++]&63,c--;if(c>1){S[b++]=65533;continue}i<65536?S[b++]=i:(i-=65536,S[b++]=55296|i>>10&1023,S[b++]=56320|i&1023)}return buf2binstring(S,b)},utf8border=($,D)=>{D=D||$.length,D>$.length&&(D=$.length);let O=D-1;for(;O>=0&&($[O]&192)===128;)O--;return O<0||O===0?D:O+_utf8len[$[O]]>D?O:D},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($){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},$||{});let D=this.options;D.raw&&D.windowBits>0?D.windowBits=-D.windowBits:D.gzip&&D.windowBits>0&&D.windowBits<16&&(D.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let O=deflate_1$2.deflateInit2(this.strm,D.level,D.method,D.windowBits,D.memLevel,D.strategy);if(O!==Z_OK$2)throw new Error(messages[O]);if(D.header&&deflate_1$2.deflateSetHeader(this.strm,D.header),D.dictionary){let A;if(typeof D.dictionary=="string"?A=strings.string2buf(D.dictionary):toString$1.call(D.dictionary)==="[object ArrayBuffer]"?A=new Uint8Array(D.dictionary):A=D.dictionary,O=deflate_1$2.deflateSetDictionary(this.strm,A),O!==Z_OK$2)throw new Error(messages[O]);this._dict_set=!0}}Deflate$1.prototype.push=function($,D){const O=this.strm,A=this.options.chunkSize;let b,S;if(this.ended)return!1;for(D===~~D?S=D:S=D===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof $=="string"?O.input=strings.string2buf($):toString$1.call($)==="[object ArrayBuffer]"?O.input=new Uint8Array($):O.input=$,O.next_in=0,O.avail_in=O.input.length;;){if(O.avail_out===0&&(O.output=new Uint8Array(A),O.next_out=0,O.avail_out=A),(S===Z_SYNC_FLUSH||S===Z_FULL_FLUSH)&&O.avail_out<=6){this.onData(O.output.subarray(0,O.next_out)),O.avail_out=0;continue}if(b=deflate_1$2.deflate(O,S),b===Z_STREAM_END$2)return O.next_out>0&&this.onData(O.output.subarray(0,O.next_out)),b=deflate_1$2.deflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===Z_OK$2;if(O.avail_out===0){this.onData(O.output);continue}if(S>0&&O.next_out>0){this.onData(O.output.subarray(0,O.next_out)),O.avail_out=0;continue}if(O.avail_in===0)break}return!0},Deflate$1.prototype.onData=function($){this.chunks.push($)},Deflate$1.prototype.onEnd=function($){$===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function deflate$1($,D){const O=new Deflate$1(D);if(O.push($,!0),O.err)throw O.msg||messages[O.err];return O.result}function deflateRaw$1($,D){return D=D||{},D.raw=!0,deflate$1($,D)}function gzip$1($,D){return D=D||{},D.gzip=!0,deflate$1($,D)}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 $(D,O){let A,b,S,i,c,k,C,N,j,Z,z,K,te,ie,Q,se,he,X,oe,de,ae,le,pe,ne;const ue=D.state;A=D.next_in,pe=D.input,b=A+(D.avail_in-5),S=D.next_out,ne=D.output,i=S-(O-D.avail_out),c=S+(D.avail_out-257),k=ue.dmax,C=ue.wsize,N=ue.whave,j=ue.wnext,Z=ue.window,z=ue.hold,K=ue.bits,te=ue.lencode,ie=ue.distcode,Q=(1<<ue.lenbits)-1,se=(1<<ue.distbits)-1;e:do{K<15&&(z+=pe[A++]<<K,K+=8,z+=pe[A++]<<K,K+=8),he=te[z&Q];t:for(;;){if(X=he>>>24,z>>>=X,K-=X,X=he>>>16&255,X===0)ne[S++]=he&65535;else if(X&16){oe=he&65535,X&=15,X&&(K<X&&(z+=pe[A++]<<K,K+=8),oe+=z&(1<<X)-1,z>>>=X,K-=X),K<15&&(z+=pe[A++]<<K,K+=8,z+=pe[A++]<<K,K+=8),he=ie[z&se];n:for(;;){if(X=he>>>24,z>>>=X,K-=X,X=he>>>16&255,X&16){if(de=he&65535,X&=15,K<X&&(z+=pe[A++]<<K,K+=8,K<X&&(z+=pe[A++]<<K,K+=8)),de+=z&(1<<X)-1,de>k){D.msg="invalid distance too far back",ue.mode=BAD$1;break e}if(z>>>=X,K-=X,X=S-i,de>X){if(X=de-X,X>N&&ue.sane){D.msg="invalid distance too far back",ue.mode=BAD$1;break e}if(ae=0,le=Z,j===0){if(ae+=C-X,X<oe){oe-=X;do ne[S++]=Z[ae++];while(--X);ae=S-de,le=ne}}else if(j<X){if(ae+=C+j-X,X-=j,X<oe){oe-=X;do ne[S++]=Z[ae++];while(--X);if(ae=0,j<oe){X=j,oe-=X;do ne[S++]=Z[ae++];while(--X);ae=S-de,le=ne}}}else if(ae+=j-X,X<oe){oe-=X;do ne[S++]=Z[ae++];while(--X);ae=S-de,le=ne}for(;oe>2;)ne[S++]=le[ae++],ne[S++]=le[ae++],ne[S++]=le[ae++],oe-=3;oe&&(ne[S++]=le[ae++],oe>1&&(ne[S++]=le[ae++]))}else{ae=S-de;do ne[S++]=ne[ae++],ne[S++]=ne[ae++],ne[S++]=ne[ae++],oe-=3;while(oe>2);oe&&(ne[S++]=ne[ae++],oe>1&&(ne[S++]=ne[ae++]))}}else if((X&64)===0){he=ie[(he&65535)+(z&(1<<X)-1)];continue n}else{D.msg="invalid distance code",ue.mode=BAD$1;break e}break}}else if((X&64)===0){he=te[(he&65535)+(z&(1<<X)-1)];continue t}else if(X&32){ue.mode=TYPE$1;break e}else{D.msg="invalid literal/length code",ue.mode=BAD$1;break e}break}}while(A<b&&S<c);oe=K>>3,A-=oe,K-=oe<<3,z&=(1<<K)-1,D.next_in=A,D.next_out=S,D.avail_in=A<b?5+(b-A):5-(A-b),D.avail_out=S<c?257+(c-S):257-(S-c),ue.hold=z,ue.bits=K};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=($,D,O,A,b,S,i,c)=>{const k=c.bits;let C=0,N=0,j=0,Z=0,z=0,K=0,te=0,ie=0,Q=0,se=0,he,X,oe,de,ae,le=null,pe;const ne=new Uint16Array(MAXBITS+1),ue=new Uint16Array(MAXBITS+1);let ye=null,ve,we,Ee;for(C=0;C<=MAXBITS;C++)ne[C]=0;for(N=0;N<A;N++)ne[D[O+N]]++;for(z=k,Z=MAXBITS;Z>=1&&ne[Z]===0;Z--);if(z>Z&&(z=Z),Z===0)return b[S++]=1<<24|64<<16|0,b[S++]=1<<24|64<<16|0,c.bits=1,0;for(j=1;j<Z&&ne[j]===0;j++);for(z<j&&(z=j),ie=1,C=1;C<=MAXBITS;C++)if(ie<<=1,ie-=ne[C],ie<0)return-1;if(ie>0&&($===CODES$1||Z!==1))return-1;for(ue[1]=0,C=1;C<MAXBITS;C++)ue[C+1]=ue[C]+ne[C];for(N=0;N<A;N++)D[O+N]!==0&&(i[ue[D[O+N]]++]=N);if($===CODES$1?(le=ye=i,pe=20):$===LENS$1?(le=lbase,ye=lext,pe=257):(le=dbase,ye=dext,pe=0),se=0,N=0,C=j,ae=S,K=z,te=0,oe=-1,Q=1<<z,de=Q-1,$===LENS$1&&Q>ENOUGH_LENS$1||$===DISTS$1&&Q>ENOUGH_DISTS$1)return 1;for(;;){ve=C-te,i[N]+1<pe?(we=0,Ee=i[N]):i[N]>=pe?(we=ye[i[N]-pe],Ee=le[i[N]-pe]):(we=96,Ee=0),he=1<<C-te,X=1<<K,j=X;do X-=he,b[ae+(se>>te)+X]=ve<<24|we<<16|Ee|0;while(X!==0);for(he=1<<C-1;se&he;)he>>=1;if(he!==0?(se&=he-1,se+=he):se=0,N++,--ne[C]===0){if(C===Z)break;C=D[O+i[N]]}if(C>z&&(se&de)!==oe){for(te===0&&(te=z),ae+=j,K=C-te,ie=1<<K;K+te<Z&&(ie-=ne[K+te],!(ie<=0));)K++,ie<<=1;if(Q+=1<<K,$===LENS$1&&Q>ENOUGH_LENS$1||$===DISTS$1&&Q>ENOUGH_DISTS$1)return 1;oe=se&de,b[oe]=z<<24|K<<16|ae-S|0}}return se!==0&&(b[ae+se]=C-te<<24|64<<16|0),c.bits=z,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=$=>($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&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=$=>{if(!$)return 1;const D=$.state;return!D||D.strm!==$||D.mode<HEAD||D.mode>SYNC?1:0},inflateResetKeep=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const D=$.state;return $.total_in=$.total_out=D.total=0,$.msg="",D.wrap&&($.adler=D.wrap&1),D.mode=HEAD,D.last=0,D.havedict=0,D.flags=-1,D.dmax=32768,D.head=null,D.hold=0,D.bits=0,D.lencode=D.lendyn=new Int32Array(ENOUGH_LENS),D.distcode=D.distdyn=new Int32Array(ENOUGH_DISTS),D.sane=1,D.back=-1,Z_OK$1},inflateReset=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const D=$.state;return D.wsize=0,D.whave=0,D.wnext=0,inflateResetKeep($)},inflateReset2=($,D)=>{let O;if(inflateStateCheck($))return Z_STREAM_ERROR$1;const A=$.state;return D<0?(O=0,D=-D):(O=(D>>4)+5,D<48&&(D&=15)),D&&(D<8||D>15)?Z_STREAM_ERROR$1:(A.window!==null&&A.wbits!==D&&(A.window=null),A.wrap=O,A.wbits=D,inflateReset($))},inflateInit2=($,D)=>{if(!$)return Z_STREAM_ERROR$1;const O=new InflateState;$.state=O,O.strm=$,O.window=null,O.mode=HEAD;const A=inflateReset2($,D);return A!==Z_OK$1&&($.state=null),A},inflateInit=$=>inflateInit2($,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=$=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let D=0;for(;D<144;)$.lens[D++]=8;for(;D<256;)$.lens[D++]=9;for(;D<280;)$.lens[D++]=7;for(;D<288;)$.lens[D++]=8;for(inftrees(LENS,$.lens,0,288,lenfix,0,$.work,{bits:9}),D=0;D<32;)$.lens[D++]=5;inftrees(DISTS,$.lens,0,32,distfix,0,$.work,{bits:5}),virgin=!1}$.lencode=lenfix,$.lenbits=9,$.distcode=distfix,$.distbits=5},updatewindow=($,D,O,A)=>{let b;const S=$.state;return S.window===null&&(S.wsize=1<<S.wbits,S.wnext=0,S.whave=0,S.window=new Uint8Array(S.wsize)),A>=S.wsize?(S.window.set(D.subarray(O-S.wsize,O),0),S.wnext=0,S.whave=S.wsize):(b=S.wsize-S.wnext,b>A&&(b=A),S.window.set(D.subarray(O-A,O-A+b),S.wnext),A-=b,A?(S.window.set(D.subarray(O-A,O),0),S.wnext=A,S.whave=S.wsize):(S.wnext+=b,S.wnext===S.wsize&&(S.wnext=0),S.whave<S.wsize&&(S.whave+=b))),0},inflate$2=($,D)=>{let O,A,b,S,i,c,k,C,N,j,Z,z,K,te,ie=0,Q,se,he,X,oe,de,ae,le;const pe=new Uint8Array(4);let ne,ue;const ye=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck($)||!$.output||!$.input&&$.avail_in!==0)return Z_STREAM_ERROR$1;O=$.state,O.mode===TYPE&&(O.mode=TYPEDO),i=$.next_out,b=$.output,k=$.avail_out,S=$.next_in,A=$.input,c=$.avail_in,C=O.hold,N=O.bits,j=c,Z=k,le=Z_OK$1;e:for(;;)switch(O.mode){case HEAD:if(O.wrap===0){O.mode=TYPEDO;break}for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.wrap&2&&C===35615){O.wbits===0&&(O.wbits=15),O.check=0,pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0),C=0,N=0,O.mode=FLAGS;break}if(O.head&&(O.head.done=!1),!(O.wrap&1)||(((C&255)<<8)+(C>>8))%31){$.msg="incorrect header check",O.mode=BAD;break}if((C&15)!==Z_DEFLATED){$.msg="unknown compression method",O.mode=BAD;break}if(C>>>=4,N-=4,ae=(C&15)+8,O.wbits===0&&(O.wbits=ae),ae>15||ae>O.wbits){$.msg="invalid window size",O.mode=BAD;break}O.dmax=1<<O.wbits,O.flags=0,$.adler=O.check=1,O.mode=C&512?DICTID:TYPE,C=0,N=0;break;case FLAGS:for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.flags=C,(O.flags&255)!==Z_DEFLATED){$.msg="unknown compression method",O.mode=BAD;break}if(O.flags&57344){$.msg="unknown header flags set",O.mode=BAD;break}O.head&&(O.head.text=C>>8&1),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0)),C=0,N=0,O.mode=TIME;case TIME:for(;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.head&&(O.head.time=C),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,pe[2]=C>>>16&255,pe[3]=C>>>24&255,O.check=crc32_1(O.check,pe,4,0)),C=0,N=0,O.mode=OS;case OS:for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.head&&(O.head.xflags=C&255,O.head.os=C>>8),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0)),C=0,N=0,O.mode=EXLEN;case EXLEN:if(O.flags&1024){for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.length=C,O.head&&(O.head.extra_len=C),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0)),C=0,N=0}else O.head&&(O.head.extra=null);O.mode=EXTRA;case EXTRA:if(O.flags&1024&&(z=O.length,z>c&&(z=c),z&&(O.head&&(ae=O.head.extra_len-O.length,O.head.extra||(O.head.extra=new Uint8Array(O.head.extra_len)),O.head.extra.set(A.subarray(S,S+z),ae)),O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,A,z,S)),c-=z,S+=z,O.length-=z),O.length))break e;O.length=0,O.mode=NAME;case NAME:if(O.flags&2048){if(c===0)break e;z=0;do ae=A[S+z++],O.head&&ae&&O.length<65536&&(O.head.name+=String.fromCharCode(ae));while(ae&&z<c);if(O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,A,z,S)),c-=z,S+=z,ae)break e}else O.head&&(O.head.name=null);O.length=0,O.mode=COMMENT;case COMMENT:if(O.flags&4096){if(c===0)break e;z=0;do ae=A[S+z++],O.head&&ae&&O.length<65536&&(O.head.comment+=String.fromCharCode(ae));while(ae&&z<c);if(O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,A,z,S)),c-=z,S+=z,ae)break e}else O.head&&(O.head.comment=null);O.mode=HCRC;case HCRC:if(O.flags&512){for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.wrap&4&&C!==(O.check&65535)){$.msg="header crc mismatch",O.mode=BAD;break}C=0,N=0}O.head&&(O.head.hcrc=O.flags>>9&1,O.head.done=!0),$.adler=O.check=0,O.mode=TYPE;break;case DICTID:for(;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}$.adler=O.check=zswap32(C),C=0,N=0,O.mode=DICT;case DICT:if(O.havedict===0)return $.next_out=i,$.avail_out=k,$.next_in=S,$.avail_in=c,O.hold=C,O.bits=N,Z_NEED_DICT$1;$.adler=O.check=1,O.mode=TYPE;case TYPE:if(D===Z_BLOCK||D===Z_TREES)break e;case TYPEDO:if(O.last){C>>>=N&7,N-=N&7,O.mode=CHECK;break}for(;N<3;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}switch(O.last=C&1,C>>>=1,N-=1,C&3){case 0:O.mode=STORED;break;case 1:if(fixedtables(O),O.mode=LEN_,D===Z_TREES){C>>>=2,N-=2;break e}break;case 2:O.mode=TABLE;break;case 3:$.msg="invalid block type",O.mode=BAD}C>>>=2,N-=2;break;case STORED:for(C>>>=N&7,N-=N&7;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if((C&65535)!==(C>>>16^65535)){$.msg="invalid stored block lengths",O.mode=BAD;break}if(O.length=C&65535,C=0,N=0,O.mode=COPY_,D===Z_TREES)break e;case COPY_:O.mode=COPY;case COPY:if(z=O.length,z){if(z>c&&(z=c),z>k&&(z=k),z===0)break e;b.set(A.subarray(S,S+z),i),c-=z,S+=z,k-=z,i+=z,O.length-=z;break}O.mode=TYPE;break;case TABLE:for(;N<14;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.nlen=(C&31)+257,C>>>=5,N-=5,O.ndist=(C&31)+1,C>>>=5,N-=5,O.ncode=(C&15)+4,C>>>=4,N-=4,O.nlen>286||O.ndist>30){$.msg="too many length or distance symbols",O.mode=BAD;break}O.have=0,O.mode=LENLENS;case LENLENS:for(;O.have<O.ncode;){for(;N<3;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.lens[ye[O.have++]]=C&7,C>>>=3,N-=3}for(;O.have<19;)O.lens[ye[O.have++]]=0;if(O.lencode=O.lendyn,O.lenbits=7,ne={bits:O.lenbits},le=inftrees(CODES,O.lens,0,19,O.lencode,0,O.work,ne),O.lenbits=ne.bits,le){$.msg="invalid code lengths set",O.mode=BAD;break}O.have=0,O.mode=CODELENS;case CODELENS:for(;O.have<O.nlen+O.ndist;){for(;ie=O.lencode[C&(1<<O.lenbits)-1],Q=ie>>>24,se=ie>>>16&255,he=ie&65535,!(Q<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(he<16)C>>>=Q,N-=Q,O.lens[O.have++]=he;else{if(he===16){for(ue=Q+2;N<ue;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(C>>>=Q,N-=Q,O.have===0){$.msg="invalid bit length repeat",O.mode=BAD;break}ae=O.lens[O.have-1],z=3+(C&3),C>>>=2,N-=2}else if(he===17){for(ue=Q+3;N<ue;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=Q,N-=Q,ae=0,z=3+(C&7),C>>>=3,N-=3}else{for(ue=Q+7;N<ue;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=Q,N-=Q,ae=0,z=11+(C&127),C>>>=7,N-=7}if(O.have+z>O.nlen+O.ndist){$.msg="invalid bit length repeat",O.mode=BAD;break}for(;z--;)O.lens[O.have++]=ae}}if(O.mode===BAD)break;if(O.lens[256]===0){$.msg="invalid code -- missing end-of-block",O.mode=BAD;break}if(O.lenbits=9,ne={bits:O.lenbits},le=inftrees(LENS,O.lens,0,O.nlen,O.lencode,0,O.work,ne),O.lenbits=ne.bits,le){$.msg="invalid literal/lengths set",O.mode=BAD;break}if(O.distbits=6,O.distcode=O.distdyn,ne={bits:O.distbits},le=inftrees(DISTS,O.lens,O.nlen,O.ndist,O.distcode,0,O.work,ne),O.distbits=ne.bits,le){$.msg="invalid distances set",O.mode=BAD;break}if(O.mode=LEN_,D===Z_TREES)break e;case LEN_:O.mode=LEN;case LEN:if(c>=6&&k>=258){$.next_out=i,$.avail_out=k,$.next_in=S,$.avail_in=c,O.hold=C,O.bits=N,inffast($,Z),i=$.next_out,b=$.output,k=$.avail_out,S=$.next_in,A=$.input,c=$.avail_in,C=O.hold,N=O.bits,O.mode===TYPE&&(O.back=-1);break}for(O.back=0;ie=O.lencode[C&(1<<O.lenbits)-1],Q=ie>>>24,se=ie>>>16&255,he=ie&65535,!(Q<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(se&&(se&240)===0){for(X=Q,oe=se,de=he;ie=O.lencode[de+((C&(1<<X+oe)-1)>>X)],Q=ie>>>24,se=ie>>>16&255,he=ie&65535,!(X+Q<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=X,N-=X,O.back+=X}if(C>>>=Q,N-=Q,O.back+=Q,O.length=he,se===0){O.mode=LIT;break}if(se&32){O.back=-1,O.mode=TYPE;break}if(se&64){$.msg="invalid literal/length code",O.mode=BAD;break}O.extra=se&15,O.mode=LENEXT;case LENEXT:if(O.extra){for(ue=O.extra;N<ue;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.length+=C&(1<<O.extra)-1,C>>>=O.extra,N-=O.extra,O.back+=O.extra}O.was=O.length,O.mode=DIST;case DIST:for(;ie=O.distcode[C&(1<<O.distbits)-1],Q=ie>>>24,se=ie>>>16&255,he=ie&65535,!(Q<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if((se&240)===0){for(X=Q,oe=se,de=he;ie=O.distcode[de+((C&(1<<X+oe)-1)>>X)],Q=ie>>>24,se=ie>>>16&255,he=ie&65535,!(X+Q<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=X,N-=X,O.back+=X}if(C>>>=Q,N-=Q,O.back+=Q,se&64){$.msg="invalid distance code",O.mode=BAD;break}O.offset=he,O.extra=se&15,O.mode=DISTEXT;case DISTEXT:if(O.extra){for(ue=O.extra;N<ue;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.offset+=C&(1<<O.extra)-1,C>>>=O.extra,N-=O.extra,O.back+=O.extra}if(O.offset>O.dmax){$.msg="invalid distance too far back",O.mode=BAD;break}O.mode=MATCH;case MATCH:if(k===0)break e;if(z=Z-k,O.offset>z){if(z=O.offset-z,z>O.whave&&O.sane){$.msg="invalid distance too far back",O.mode=BAD;break}z>O.wnext?(z-=O.wnext,K=O.wsize-z):K=O.wnext-z,z>O.length&&(z=O.length),te=O.window}else te=b,K=i-O.offset,z=O.length;z>k&&(z=k),k-=z,O.length-=z;do b[i++]=te[K++];while(--z);O.length===0&&(O.mode=LEN);break;case LIT:if(k===0)break e;b[i++]=O.length,k--,O.mode=LEN;break;case CHECK:if(O.wrap){for(;N<32;){if(c===0)break e;c--,C|=A[S++]<<N,N+=8}if(Z-=k,$.total_out+=Z,O.total+=Z,O.wrap&4&&Z&&($.adler=O.check=O.flags?crc32_1(O.check,b,Z,i-Z):adler32_1(O.check,b,Z,i-Z)),Z=k,O.wrap&4&&(O.flags?C:zswap32(C))!==O.check){$.msg="incorrect data check",O.mode=BAD;break}C=0,N=0}O.mode=LENGTH;case LENGTH:if(O.wrap&&O.flags){for(;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.wrap&4&&C!==(O.total&4294967295)){$.msg="incorrect length check",O.mode=BAD;break}C=0,N=0}O.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 $.next_out=i,$.avail_out=k,$.next_in=S,$.avail_in=c,O.hold=C,O.bits=N,(O.wsize||Z!==$.avail_out&&O.mode<BAD&&(O.mode<CHECK||D!==Z_FINISH$1))&&updatewindow($,$.output,$.next_out,Z-$.avail_out),j-=$.avail_in,Z-=$.avail_out,$.total_in+=j,$.total_out+=Z,O.total+=Z,O.wrap&4&&Z&&($.adler=O.check=O.flags?crc32_1(O.check,b,Z,$.next_out-Z):adler32_1(O.check,b,Z,$.next_out-Z)),$.data_type=O.bits+(O.last?64:0)+(O.mode===TYPE?128:0)+(O.mode===LEN_||O.mode===COPY_?256:0),(j===0&&Z===0||D===Z_FINISH$1)&&le===Z_OK$1&&(le=Z_BUF_ERROR),le},inflateEnd=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;let D=$.state;return D.window&&(D.window=null),$.state=null,Z_OK$1},inflateGetHeader=($,D)=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const O=$.state;return(O.wrap&2)===0?Z_STREAM_ERROR$1:(O.head=D,D.done=!1,Z_OK$1)},inflateSetDictionary=($,D)=>{const O=D.length;let A,b,S;return inflateStateCheck($)||(A=$.state,A.wrap!==0&&A.mode!==DICT)?Z_STREAM_ERROR$1:A.mode===DICT&&(b=1,b=adler32_1(b,D,O,0),b!==A.check)?Z_DATA_ERROR$1:(S=updatewindow($,D,O,O),S?(A.mode=MEM,Z_MEM_ERROR$1):(A.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($){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},$||{});const D=this.options;D.raw&&D.windowBits>=0&&D.windowBits<16&&(D.windowBits=-D.windowBits,D.windowBits===0&&(D.windowBits=-15)),D.windowBits>=0&&D.windowBits<16&&!($&&$.windowBits)&&(D.windowBits+=32),D.windowBits>15&&D.windowBits<48&&(D.windowBits&15)===0&&(D.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let O=inflate_1$2.inflateInit2(this.strm,D.windowBits);if(O!==Z_OK)throw new Error(messages[O]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),D.dictionary&&(typeof D.dictionary=="string"?D.dictionary=strings.string2buf(D.dictionary):toString.call(D.dictionary)==="[object ArrayBuffer]"&&(D.dictionary=new Uint8Array(D.dictionary)),D.raw&&(O=inflate_1$2.inflateSetDictionary(this.strm,D.dictionary),O!==Z_OK)))throw new Error(messages[O])}Inflate$1.prototype.push=function($,D){const O=this.strm,A=this.options.chunkSize,b=this.options.dictionary;let S,i,c;if(this.ended)return!1;for(D===~~D?i=D:i=D===!0?Z_FINISH:Z_NO_FLUSH,toString.call($)==="[object ArrayBuffer]"?O.input=new Uint8Array($):O.input=$,O.next_in=0,O.avail_in=O.input.length;;){for(O.avail_out===0&&(O.output=new Uint8Array(A),O.next_out=0,O.avail_out=A),S=inflate_1$2.inflate(O,i),S===Z_NEED_DICT&&b&&(S=inflate_1$2.inflateSetDictionary(O,b),S===Z_OK?S=inflate_1$2.inflate(O,i):S===Z_DATA_ERROR&&(S=Z_NEED_DICT));O.avail_in>0&&S===Z_STREAM_END&&O.state.wrap>0&&$[O.next_in]!==0;)inflate_1$2.inflateReset(O),S=inflate_1$2.inflate(O,i);switch(S){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(S),this.ended=!0,!1}if(c=O.avail_out,O.next_out&&(O.avail_out===0||S===Z_STREAM_END))if(this.options.to==="string"){let k=strings.utf8border(O.output,O.next_out),C=O.next_out-k,N=strings.buf2string(O.output,k);O.next_out=C,O.avail_out=A-C,C&&O.output.set(O.output.subarray(k,k+C),0),this.onData(N)}else this.onData(O.output.length===O.next_out?O.output:O.output.subarray(0,O.next_out));if(!(S===Z_OK&&c===0)){if(S===Z_STREAM_END)return S=inflate_1$2.inflateEnd(this.strm),this.onEnd(S),this.ended=!0,!0;if(O.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function($){this.chunks.push($)},Inflate$1.prototype.onEnd=function($){$===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function inflate$1($,D){const O=new Inflate$1(D);if(O.push($),O.err)throw O.msg||messages[O.err];return O.result}function inflateRaw$1($,D){return D=D||{},D.raw=!0,inflate$1($,D)}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};const reqIgnoreEvents=["updateSeverTime"];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),reqIgnoreEvents.push("onNetQuality"),reqIgnoreEvents.push("updateCall"),reqIgnoreEvents.push("pubNotify"),reqIgnoreEvents.push("reportNetwork"),reqIgnoreEvents.push("ackMsg");const resIgnoreEvents=["updateSeverTime"];resIgnoreEvents.push("heartbeat"),resIgnoreEvents.push("heartbeatEx"),resIgnoreEvents.push("networkQualityChange"),resIgnoreEvents.push("onNetQuality"),resIgnoreEvents.push("updateCall"),resIgnoreEvents.push("pubNotify"),resIgnoreEvents.push("reportNetwork"),resIgnoreEvents.push("ackMsg"),resIgnoreEvents.push("offer"),resIgnoreEvents.push("candidate"),resIgnoreEvents.push("answer"),resIgnoreEvents.push("reportP2PConnect");const compressArrayBuffer=$=>{const D=new Uint8Array($),O=pako.deflate(D,{gzip:!0});return new Uint8Array(O==null?void 0:O.buffer)},decompressArrayBuffer=$=>{const D=new Uint8Array($),O=pako.inflate(D,{gzip:!0});return new Uint8Array(O==null?void 0:O.buffer)},sendMessageFormat=$=>{const{event:D}=$;switch($.data_original=$.data,$.time&&($.timeStr=E($.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),D){case"login":$.data=com.quick.voice.proto.Login.encode($.data).finish();break;case"joinRoom":case"joinRoomEx":$.data=com.quick.voice.proto.JoinReq.encode($.data).finish();break;case"quitRoom":$.data=com.quick.voice.proto.QuitReq.encode($.data).finish();break;case"connectCF":$.data=com.quick.voice.proto.ConnectCFReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"publish":$.data=com.quick.voice.proto.PublishReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"pubChannel":$.data=com.quick.voice.proto.ChannelPublishReq.encode($.data).finish();break;case"subscribe":$.data=com.quick.voice.proto.SubscribeReq.encode($.data).finish();break;case"offer":$.data=com.quick.voice.proto.SdpConsult.encode($.data).finish();break;case"answer":$.data=com.quick.voice.proto.SdpConsult.encode($.data).finish();break;case"candidate":$.data=com.quick.voice.proto.Candidates.encode($.data).finish();break;case"subChannel":$.data=com.quick.voice.proto.ChannelSubscribeRsq.encode($.data).finish();break;case"closeTrack":$.data=com.quick.voice.proto.CloseTrackReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"renegotiate":$.data=com.quick.voice.proto.RenegotiateReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"reportNetwork":$.data=com.quick.voice.proto.ReportNetInfo.encode($.data).finish();break;case"reportP2PConnect":$.data=com.quick.voice.proto.ReportP2PReq.encode($.data).finish();break;case"syncRoomInfo":$.data=com.quick.voice.proto.SyncRoomInfoReq.encode($.data).finish();break;case"updateCall":$.data=com.quick.voice.proto.UpdateCall.encode($.data).finish();break;case"networkQualityChange":$.data=com.quick.voice.proto.NetQualityChange.encode($.data).finish();break;case"pubNotify":$.data=com.quick.voice.proto.PublishNotify.encode($.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":$.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode($.data).finish();break;case"heartbeat":{$.data=com.quick.voice.proto.ReportTrafficUsage.encode($.data).finish();break}case"ackMsg":{$.data=com.quick.voice.proto.AckMsgReq.encode($.data).finish();break}default:$.data=new Uint8Array;break}return $},onMessageFormat=$=>{const{event:D,compress:O=!1}=$;if($.data_remote=$.data,$.time&&($.timeStr=E($.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),O)try{$.data=decompressArrayBuffer($.data)}catch(A){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",A)}switch(D){case"login":$.data=com.quick.voice.proto.Login.decode($.data);break;case"joinRoom":case"joinRoomEx":$.data=com.quick.voice.proto.JoinRsp.decode($.data);break;case"onJoinRoom":$.data=com.quick.voice.proto.JoinNotify.decode($.data);break;case"onQuitRoom":$.data=com.quick.voice.proto.QuitNotify.decode($.data);break;case"connectCF":$.data=com.quick.voice.proto.ConnectCFRsp.decode($.data);break;case"publish":$.data=com.quick.voice.proto.PublishRsp.decode($.data);break;case"pubChannel":$.data=com.quick.voice.proto.ChannelPublishRsq.decode($.data);break;case"onPublish":$.data=com.quick.voice.proto.PublishNotify.decode($.data);break;case"subscribe":$.data=com.quick.voice.proto.SubscribeRsp.decode($.data);break;case"onAttemptP2PReq":$.data=com.quick.voice.proto.P2PAttemptConnectReq.decode($.data);break;case"onOffer":$.data=com.quick.voice.proto.SdpConsult.decode($.data);break;case"onAnswer":$.data=com.quick.voice.proto.SdpConsult.decode($.data);break;case"onCandidate":$.data=com.quick.voice.proto.Candidates.decode($.data);break;case"subChannel":$.data=com.quick.voice.proto.ChannelSubscribeRsq.decode($.data);break;case"closeTrack":$.data=com.quick.voice.proto.CloseTrackRsp.decode($.data);break;case"onCloseTrack":$.data=com.quick.voice.proto.CloseTrackNotify.decode($.data);break;case"onUpdateCall":$.data=com.quick.voice.proto.UpdateCall.decode($.data);break;case"onDataChannelPublish":$.data=com.quick.voice.proto.UserChannel.decode($.data);break;case"onDestroyRoom":$.data=com.quick.voice.proto.QuitNotify.decode($.data);break;case"onUpdatePermissions":$.data=com.quick.voice.proto.UpdatePermissions.decode($.data);break;case"onNetQuality":$.data=com.quick.voice.proto.NetQualityNotify.decode($.data);break;case"syncRoomInfo":$.data=com.quick.voice.proto.SyncRoomInfoRsp.decode($.data);break;case"onCDNPlayUrlAdd":$.data=com.quick.voice.proto.CDNPlayAddressNotify.decode($.data);break;case"onUpdateBehavior":$.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode($.data);break;case"debugger":$.data=JSON.parse(new TextDecoder().decode($.data));break}return $};class CallsWebSocket{constructor(D){be(this,Se,{url:"wss://demo.putplay.cc/websocket",debug:!1,timeout:30*1e3});ee(this,"prws",new I({url:"",binaryType:"arraybuffer",reconnectCount:5,timeout:10*1e3}));be(this,Oe,{});be(this,Re,{});ee(this,"state","closed");be(this,at,(D,O={})=>{try{const{time:A,event:b,data:S={},data_original:i={},data_remote:c,...k}=O,C=E(A,"YYYY-MM-DD hh:mm:ss",{offset:480});let N={};const j=(he={})=>{const X=JSON.parse(JSON.stringify(he)),oe=Object.keys(X);for(const de of oe)(de.includes("sdp")||de.includes("Sdp"))&&(X[de]="");return X};let Z="res ↓";switch(D){case"res":Z="res ↓",N=j(S);break;case"req":Z="req ↑",N=j(i);break}let z="#quickvo.logs";(reqIgnoreEvents.includes(b)||resIgnoreEvents.includes(b))&&(z="#quickvo.ignoreEvents");const K={"#action":Z,timeStr:C,event:b,data:N,time:A,...k},te=localStorage.getItem(z)||JSON.stringify([]),ie=JSON.parse(te);let Q=b==="heartbeat"||b==="heartbeatEx";const se=[K];for(const he of ie){const{event:X}=he;if(X==="heartbeat"||X==="heartbeatEx"){if(Q)continue;Q=!0}if(se.length===200)break;se.push(he)}localStorage.setItem(z,JSON.stringify(se))}catch(A){ce(this,Se).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",A)}});be(this,zt,(D,{resolve:O,reject:A})=>{const{sn:b=""}=D,S=()=>{const c=ce(this,Oe)[b];clearTimeout(c.destructionTimer),delete ce(this,Oe)[b]},i=window.setTimeout(()=>{const c=ce(this,Oe)[b];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",c.message),S(),A("event is timeout")},ce(this,Se).timeout);ce(this,Oe)[b]={message:D,resolve:O,reject:A,destruction:S,destructionTimer:i}});be(this,Ht,D=>ce(this,Oe)[D]);be(this,Zt,async D=>{const O=new Uint8Array(D),A=com.quick.voice.proto.CommonRsp.decode(O),{sn:b,event:S}=A,i=onMessageFormat(A);if(ce(this,Se).debug&&!resIgnoreEvents.includes(S)&&(ce(this,at).call(this,"res",i),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i)),notifyName_keys.includes(S))return this.emitNotify(S,V(i,["code","data","desc"]));const k=ce(this,Ht).call(this,b);if(k){const{resolve:C=j=>{},destruction:N=()=>{}}=k;C(V(i,["code","data","desc","sn"])),N()}});ee(this,"clearEvents",(D=[])=>{const O=Object.keys(ce(this,Oe));D.length===0&&(D=O);for(const A of O){if(!D.includes(A))continue;const b=ce(this,Oe)[A];if(b){const{destruction:S}=b;S()}}});ee(this,"connect",async()=>new Promise(async(D,O)=>{try{this.prws&&(this.prws.close(),this.state="closed");const A=new Date().getTime();if(this.state="connecting",await this.prws.connect(),this.state="connected",ce(this,Se).debug){const S=new Date().getTime()-A;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${S}ms-广播事件`,ce(this,Re))}D(this.prws)}catch(A){O(A)}}));ee(this,"close",async()=>{var O;ce(this,Se).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const D=Object.keys(ce(this,Oe));for(const A of D){const{destructionTimer:b}=ce(this,Oe)[A];clearTimeout(b)}De(this,Oe,{}),await((O=this.prws)==null?void 0:O.close()),this.state="closed"});ee(this,"sendMessage",(D,O=!0)=>new Promise(async(A,b)=>{var N;const{event:S,...i}=D,c=Date.now(),k=sendMessageFormat({event:S,sn:+`${c}${v$1(1e3,9999)}`,time:c,valid:ce(this,Se).timeout,version:1,compress:!1,...i});ce(this,Se).debug&&!reqIgnoreEvents.includes(S)&&(ce(this,at).call(this,"req",k),console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",k)),O&&ce(this,zt).call(this,k,{resolve:A,reject:b});const C=com.quick.voice.proto.CommonReq.encode(k).finish();(N=this.prws)==null||N.sendMessage(C)}));ee(this,"emitNotify",async(D,O)=>{const A=ce(this,Re)[D]||[];for(const b of A){const{callback:S=async()=>{}}=b;await S(O)}});ee(this,"addNotify",(D,O=!1)=>{const{event:A,sn:b=wt(32)}=D;ce(this,Re)[A]||(ce(this,Re)[A]=[]);const S=ce(this,Re)[A],i=S.findIndex(c=>c.sn===b);return i!==-1&&S.splice(i,1),O?S.unshift(D):S.push(D),b});ee(this,"removeNotify",(D=[])=>{if(D.length===0)De(this,Re,{});else{const O=Object.keys(ce(this,Re));for(const A of O)ce(this,Re)[A]=ce(this,Re)[A].filter(b=>!D.includes(b.sn||""))}ce(this,Se).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",ce(this,Re))});De(this,Se,{...ce(this,Se),...D}),this.prws.setOptions(ce(this,Se)),this.prws.onMessage=ce(this,Zt),this.prws.getHeartbeatMsg=()=>""}}Se=new WeakMap,Oe=new WeakMap,Re=new WeakMap,at=new WeakMap,zt=new WeakMap,Ht=new WeakMap,Zt=new WeakMap;const createMutedAudioStream=$=>{const D=$.createOscillator();D.type="sine",D.frequency.setValueAtTime(0,$.currentTime);const O=$.createGain();O.gain.value=0,D.connect(O),O.connect($.destination),D.start();const A=$.createMediaStreamDestination();return O.disconnect(),D.connect(A),A.stream},createFakeVideoStream=($=10,D=10,O=30)=>{const A=document.createElement("canvas"),b=A.getContext("2d");A.width=$,A.height=D;let S=0;return setInterval(()=>{b.clearRect(0,0,A.width,A.height);const k=b.createLinearGradient(0,0,A.width,A.height);k.addColorStop(0,`hsla(${S}, 100%, 50%, 0)`),k.addColorStop(1,`hsla(${S+120}, 100%, 50%, 0)`),b.fillStyle=k,b.fillRect(0,0,A.width,A.height),S=(S+1)%360},100),A.captureStream(O)};class NetworkQualityTester{constructor(D=[]){ee(this,"targetUrls",[]);ee(this,"results",[]);D.length===0&&D.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=D,this.results=[]}async testAll(){const D=this.targetUrls.map(O=>this.testUrl(O));return await Promise.all(D),this.analyzeResults()}async testUrl(D){const O=performance.now();let A=0,b=!1;try{await fetch(D,{method:"HEAD",cache:"no-store"});const S=performance.now()-O,i=performance.now(),k=await(await fetch(D,{cache:"no-store"})).blob(),C=performance.now()-i;A=k.size,b=!0,this.results.push({url:D,success:b,headTime:S,getTime:C,size:A,downloadSpeed:A>0?(A/1024/(C/1e3)).toFixed(2):0,totalTime:performance.now()-O})}catch(S){this.results.push({url:D,success:!1,error:S.message,totalTime:performance.now()-O})}}analyzeResults(){const D=this.results.filter(S=>S.success);if(D.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const O=D.reduce((S,i)=>S+i.size,0),A=D.reduce((S,i)=>S+i.totalTime,0),b=D.reduce((S,i)=>S+parseFloat(i.downloadSpeed),0)/D.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:D.length,averageDownloadSpeed:`${b.toFixed(2)} KB/s`,averageResponseTime:`${(A/D.length).toFixed(2)}ms`,totalDataTransferred:`${(O/1024).toFixed(2)} KB`,detailedResults:this.results}}}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($){(function(D){var O="undefined",A=O!==typeof Buffer&&Buffer,b=O!==typeof Uint8Array&&Uint8Array,S=O!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],c=Array.isArray||de,k=4294967296,C=16777216,N;j("Uint64BE",!0,!0),j("Int64BE",!0,!1),j("Uint64LE",!1,!0),j("Int64LE",!1,!1);function j(ae,le,pe){var ne=le?0:4,ue=le?4:0,ye=le?0:3,ve=le?1:2,we=le?2:1,Ee=le?3:0,Be=le?se:X,Ue=le?he:oe,Le=xe.prototype,Ve="is"+ae,ut="_"+Ve;return Le.buffer=void 0,Le.offset=0,Le[ut]=!0,Le.toNumber=We,Le.toString=rt,Le.toJSON=We,Le.toArray=Z,A&&(Le.toBuffer=z),b&&(Le.toArrayBuffer=K),xe[Ve]=$e,D[ae]=xe,xe;function xe(_e,ke,ge,Ie){return this instanceof xe?nt(this,_e,ke,ge,Ie):new xe(_e,ke,ge,Ie)}function $e(_e){return!!(_e&&_e[ut])}function nt(_e,ke,ge,Ie,Ce){if(b&&S&&(ke instanceof S&&(ke=new b(ke)),Ie instanceof S&&(Ie=new b(Ie))),!ke&&!ge&&!Ie&&!N){_e.buffer=Q(i,0);return}if(!te(ke,ge)){var Fe=N||Array;Ce=ge,Ie=ke,ge=0,ke=N===A?A.alloc(8):new Fe(8)}_e.buffer=ke,_e.offset=ge|=0,O!==typeof Ie&&(typeof Ie=="string"?Me(ke,ge,Ie,Ce||10):te(Ie,Ce)?ie(ke,ge,Ie,Ce):typeof Ce=="number"?(Ke(ke,ge+ne,Ie),Ke(ke,ge+ue,Ce)):Ie>0?Be(ke,ge,Ie):Ie<0?Ue(ke,ge,Ie):ie(ke,ge,i,0))}function Me(_e,ke,ge,Ie){var Ce=0,Fe=ge.length,Ze=0,He=0;ge[0]==="-"&&Ce++;for(var ot=Ce;Ce<Fe;){var ft=parseInt(ge[Ce++],Ie);if(!(ft>=0))break;He=He*Ie+ft,Ze=Ze*Ie+Math.floor(He/k),He%=k}ot&&(Ze=~Ze,He?He=k-He:Ze++),Ke(_e,ke+ne,Ze),Ke(_e,ke+ue,He)}function We(){var _e=this.buffer,ke=this.offset,ge=ze(_e,ke+ne),Ie=ze(_e,ke+ue);return pe||(ge|=0),ge?ge*k+Ie:Ie}function rt(_e){var ke=this.buffer,ge=this.offset,Ie=ze(ke,ge+ne),Ce=ze(ke,ge+ue),Fe="",Ze=!pe&&Ie&2147483648;for(Ze&&(Ie=~Ie,Ce=k-Ce),_e=_e||10;;){var He=Ie%_e*k+Ce;if(Ie=Math.floor(Ie/_e),Ce=Math.floor(He/_e),Fe=(He%_e).toString(_e)+Fe,!Ie&&!Ce)break}return Ze&&(Fe="-"+Fe),Fe}function Ke(_e,ke,ge){_e[ke+Ee]=ge&255,ge=ge>>8,_e[ke+we]=ge&255,ge=ge>>8,_e[ke+ve]=ge&255,ge=ge>>8,_e[ke+ye]=ge&255}function ze(_e,ke){return _e[ke+ye]*C+(_e[ke+ve]<<16)+(_e[ke+we]<<8)+_e[ke+Ee]}}function Z(ae){var le=this.buffer,pe=this.offset;return N=null,ae!==!1&&c(le)?le.length===8?le:le.slice(pe,pe+8):Q(le,pe)}function z(ae){var le=this.buffer,pe=this.offset;return N=A,ae!==!1&&A.isBuffer(le)?le.length===8?le:le.slice(pe,pe+8):A.from(K.call(this,ae))}function K(ae){var le=this.buffer,pe=this.offset,ne=le.buffer;if(N=b,ae!==!1&&!le.offset&&ne instanceof S)return ne.byteLength===8?ne:ne.slice(pe,pe+8);var ue=new b(8);return ie(ue,0,le,pe),ue.buffer}function te(ae,le){var pe=ae&&ae.length;return le|=0,pe&&le+8<=pe&&typeof ae[le]!="string"}function ie(ae,le,pe,ne){le|=0,ne|=0;for(var ue=0;ue<8;ue++)ae[le++]=pe[ne++]&255}function Q(ae,le){return Array.prototype.slice.call(ae,le,le+8)}function se(ae,le,pe){for(var ne=le+8;ne>le;)ae[--ne]=pe&255,pe/=256}function he(ae,le,pe){var ne=le+8;for(pe++;ne>le;)ae[--ne]=-pe&255^255,pe/=256}function X(ae,le,pe){for(var ne=le+8;le<ne;)ae[le++]=pe&255,pe/=256}function oe(ae,le,pe){var ne=le+8;for(pe++;le<ne;)ae[le++]=-pe&255^255,pe/=256}function de(ae){return!!ae&&Object.prototype.toString.call(ae)=="[object Array]"}})(typeof $.nodeName!="string"?$: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 $=requireTools(),D=requireTools(),O=requireEbmlID(),A=function(){function b(){this._schema=O.byEbmlID,this._buffers=[],this._stack=[]}return b.prototype.encode=function(S){var i=this;return $.concat(S.reduce(function(c,k){return c.concat(i.encodeChunk(k))},[])).buffer},b.prototype.encodeChunk=function(S){return S.type==="m"?S.isEnd?this.endTag(S):this.startTag(S):(S.data=D.Buffer.from(S.data),this.writeTag(S)),this.flush()},b.prototype.flush=function(){var S=this._buffers;return this._buffers=[],S},b.prototype.getSchemaInfo=function(S){for(var i=Object.keys(this._schema).map(Number),c=0;c<i.length;c++){var k=i[c];if(this._schema[k].name===S)return new D.Buffer(k.toString(16),"hex")}return null},b.prototype.writeTag=function(S){var i=S.name,c=this.getSchemaInfo(i),k=S.data;if(c==null)throw new Error("No schema entry found for "+i);var C=$.encodeTag(c,k);if(this._stack.length>0){var N=this._stack[this._stack.length-1];N.children.push({tagId:c,elm:S,children:[],data:C});return}this._buffers=this._buffers.concat(C)},b.prototype.startTag=function(S){var i=S.name,c=this.getSchemaInfo(i);if(c==null)throw new Error("No schema entry found for "+i);if(S.unknownSize){var k=$.encodeTag(c,new D.Buffer(0),S.unknownSize);this._buffers=this._buffers.concat(k);return}var C={tagId:c,elm:S,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(C),this._stack.push(C)},b.prototype.endTag=function(S){S.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==S.name)throw new Error("EBML structure is broken");var c=i.children.reduce(function(C,N){if(N.data===null)throw new Error("EBML structure is broken");return C.concat(N.data)},[]),k=$.concat(c);i.elm.type==="m"?i.data=$.encodeTag(i.tagId,k,i.elm.unknownSize):i.data=$.encodeTag(i.tagId,k),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},b}();return EBMLEncoder.default=A,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=c,base64Js.toByteArray=C,base64Js.fromByteArray=Z;for(var $=[],D=[],O=typeof Uint8Array<"u"?Uint8Array:Array,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",b=0,S=A.length;b<S;++b)$[b]=A[b],D[A.charCodeAt(b)]=b;D[45]=62,D[95]=63;function i(z){var K=z.length;if(K%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var te=z.indexOf("=");te===-1&&(te=K);var ie=te===K?0:4-te%4;return[te,ie]}function c(z){var K=i(z),te=K[0],ie=K[1];return(te+ie)*3/4-ie}function k(z,K,te){return(K+te)*3/4-te}function C(z){var K,te=i(z),ie=te[0],Q=te[1],se=new O(k(z,ie,Q)),he=0,X=Q>0?ie-4:ie,oe;for(oe=0;oe<X;oe+=4)K=D[z.charCodeAt(oe)]<<18|D[z.charCodeAt(oe+1)]<<12|D[z.charCodeAt(oe+2)]<<6|D[z.charCodeAt(oe+3)],se[he++]=K>>16&255,se[he++]=K>>8&255,se[he++]=K&255;return Q===2&&(K=D[z.charCodeAt(oe)]<<2|D[z.charCodeAt(oe+1)]>>4,se[he++]=K&255),Q===1&&(K=D[z.charCodeAt(oe)]<<10|D[z.charCodeAt(oe+1)]<<4|D[z.charCodeAt(oe+2)]>>2,se[he++]=K>>8&255,se[he++]=K&255),se}function N(z){return $[z>>18&63]+$[z>>12&63]+$[z>>6&63]+$[z&63]}function j(z,K,te){for(var ie,Q=[],se=K;se<te;se+=3)ie=(z[se]<<16&16711680)+(z[se+1]<<8&65280)+(z[se+2]&255),Q.push(N(ie));return Q.join("")}function Z(z){for(var K,te=z.length,ie=te%3,Q=[],se=16383,he=0,X=te-ie;he<X;he+=se)Q.push(j(z,he,he+se>X?X:he+se));return ie===1?(K=z[te-1],Q.push($[K>>2]+$[K<<4&63]+"==")):ie===2&&(K=(z[te-2]<<8)+z[te-1],Q.push($[K>>10]+$[K>>4&63]+$[K<<2&63]+"=")),Q.join("")}return base64Js}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function($,D,O,A,b){var S,i,c=b*8-A-1,k=(1<<c)-1,C=k>>1,N=-7,j=O?b-1:0,Z=O?-1:1,z=$[D+j];for(j+=Z,S=z&(1<<-N)-1,z>>=-N,N+=c;N>0;S=S*256+$[D+j],j+=Z,N-=8);for(i=S&(1<<-N)-1,S>>=-N,N+=A;N>0;i=i*256+$[D+j],j+=Z,N-=8);if(S===0)S=1-C;else{if(S===k)return i?NaN:(z?-1:1)*(1/0);i=i+Math.pow(2,A),S=S-C}return(z?-1:1)*i*Math.pow(2,S-A)},ieee754.write=function($,D,O,A,b,S){var i,c,k,C=S*8-b-1,N=(1<<C)-1,j=N>>1,Z=b===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=A?0:S-1,K=A?1:-1,te=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(c=isNaN(D)?1:0,i=N):(i=Math.floor(Math.log(D)/Math.LN2),D*(k=Math.pow(2,-i))<1&&(i--,k*=2),i+j>=1?D+=Z/k:D+=Z*Math.pow(2,1-j),D*k>=2&&(i++,k/=2),i+j>=N?(c=0,i=N):i+j>=1?(c=(D*k-1)*Math.pow(2,b),i=i+j):(c=D*Math.pow(2,j-1)*Math.pow(2,b),i=0));b>=8;$[O+z]=c&255,z+=K,c/=256,b-=8);for(i=i<<b|c,C+=b;C>0;$[O+z]=i&255,z+=K,i/=256,C-=8);$[O+z-K]|=te*128}),ieee754}/*!
3
+ `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var $=requireParser(),D=requireWriter$1(),O=requireGrammar();return lib$1.grammar=O,lib$1.write=D,lib$1.parse=$.parse,lib$1.parseParams=$.parseParams,lib$1.parseFmtpConfig=$.parseFmtpConfig,lib$1.parsePayloads=$.parsePayloads,lib$1.parseRemoteCandidates=$.parseRemoteCandidates,lib$1.parseImageAttributes=$.parseImageAttributes,lib$1.parseSimulcastStreamList=$.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(D){Q(this,"kind","video");Q(this,"stream",new MediaStream);Q(this,"stop",()=>{const D=this.stream.getTracks();for(const O of D)O.stop(),this.stream.removeTrack(O)});Q(this,"replaceStream",D=>{const O=this.stream,A=O.getTracks();for(const S of A)O.removeTrack(S);const[k]=D.getVideoTracks();k&&O.addTrack(k)});Q(this,"getStream",()=>this.stream);Q(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(D)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var B=Object.defineProperty,T=$=>{throw TypeError($)},R=($,D,O)=>D in $?B($,D,{enumerable:!0,configurable:!0,writable:!0,value:O}):$[D]=O,o$1=($,D,O)=>R($,typeof D!="symbol"?D+"":D,O),y$1=($,D,O)=>D.has($)||T("Cannot "+O),t=($,D,O)=>(y$1($,D,"read from private field"),O?O.call($):D.get($)),r=($,D,O)=>D.has($)?T("Cannot add the same private member more than once"):D instanceof WeakSet?D.add($):D.set($,O),a$1=($,D,O,A)=>(y$1($,D,"write to private field"),D.set($,O),O),n$1,h$1,l$1,u,p$1,f,d$1,w,x,g$2,m$1;class I{constructor(D){r(this,n$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4}),o$1(this,"ws"),o$1(this,"checkReconnect",async O=>(t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,n$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,h$1)}`),await new Promise(A=>setTimeout(()=>A(!0),t(this,n$1).reconnectIntervalTime)),!0)),o$1(this,"onReconnectSuccess",async O=>{}),o$1(this,"onReconnectStop",async O=>{}),o$1(this,"getHeartbeatMsg",()=>JSON.stringify({event:"heartbeat"})),o$1(this,"onMessage",O=>{}),r(this,h$1,-1),r(this,l$1,-1),r(this,u,0),r(this,p$1,0),r(this,f,0),r(this,d$1,!1),o$1(this,"setOptions",O=>{a$1(this,n$1,{...t(this,n$1),...O})}),o$1(this,"connect",()=>new Promise(async(O,A)=>{this.ws=new WebSocket(t(this,n$1).url),this.ws.binaryType=t(this,n$1).binaryType,this.ws.addEventListener("message",t(this,x)),this.ws.addEventListener("open",k=>{clearTimeout(t(this,u)),a$1(this,h$1,t(this,n$1).reconnectCount),a$1(this,l$1,-1),t(this,g$2).call(this),t(this,n$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),O(k)}),this.ws.addEventListener("error",k=>{clearTimeout(t(this,u)),t(this,n$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",k),A(k)}),this.ws.addEventListener("close",k=>{if(t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${k.code}, permanentClosed is ${t(this,d$1)}.`,k),t(this,m$1).call(this),!t(this,d$1))return this.reconnect(k);this.ws=void 0}),a$1(this,u,window.setTimeout(()=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",this),A("connect is timeout.")},t(this,n$1).timeout))})),o$1(this,"reconnect",async O=>new Promise(async A=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const k=S=>{t(this,n$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${S}`),this.onReconnectStop({msg:S}),A(S)};if(t(this,w).call(this)===!1)return k("stop reconnect. exceed maxReconnectionTime.");if(t(this,h$1)!==-1&&t(this,h$1)===0)return k("stop reconnect. surplusReconnectCount is 0.");if(!await this.checkReconnect(O))return k("stop reconnect. checkReconnect is false.");a$1(this,h$1,Math.max(-1,t(this,h$1)-1)),await this.connect().then(()=>this.onReconnectSuccess(this.ws)),A(!0)})),o$1(this,"sendMessage",async O=>{var A;(!this.ws||this.ws.readyState!==1)&&(t(this,n$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t(this,n$1).autoConnect&&(t(this,n$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(A=this.ws)==null||A.send(O)}),o$1(this,"close",async(O=1e3,A="correctly close.")=>{var k;this.ws&&(a$1(this,d$1,!0),t(this,m$1).call(this),(k=this.ws)==null||k.close(O,A))}),r(this,w,()=>{const O=Date.now();return t(this,l$1)===-1&&a$1(this,l$1,O+t(this,n$1).reconnectTime),!(O>t(this,l$1))}),r(this,x,O=>{const{data:A}=O;this.onMessage(A)}),r(this,g$2,()=>{a$1(this,f,window.setInterval(()=>{const O=this.getHeartbeatMsg();O&&this.sendMessage(O)},t(this,n$1).heartbeatIntervalTime))}),r(this,m$1,()=>{clearInterval(t(this,p$1)),clearInterval(t(this,f))}),a$1(this,n$1,{...t(this,n$1),...D}),a$1(this,h$1,t(this,n$1).reconnectCount)}}n$1=new WeakMap,h$1=new WeakMap,l$1=new WeakMap,u=new WeakMap,p$1=new WeakMap,f=new WeakMap,d$1=new WeakMap,w=new WeakMap,x=new WeakMap,g$2=new WeakMap,m$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=$;function $(D,O){for(var A=new Array(arguments.length-1),k=0,S=2,i=!0;S<arguments.length;)A[k++]=arguments[S++];return new Promise(function(b,C){A[k]=function(j){if(i)if(i=!1,j)C(j);else{for(var Z=new Array(arguments.length-1),z=0;z<Z.length;)Z[z++]=arguments[z];b.apply(null,Z)}};try{D.apply(O||null,A)}catch(N){i&&(i=!1,C(N))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function($){var D=$;D.length=function(c){var b=c.length;if(!b)return 0;for(var C=0;--b%4>1&&c.charAt(b)==="=";)++C;return Math.ceil(c.length*3)/4-C};for(var O=new Array(64),A=new Array(123),k=0;k<64;)A[O[k]=k<26?k+65:k<52?k+71:k<62?k-4:k-59|43]=k++;D.encode=function(c,b,C){for(var N=null,j=[],Z=0,z=0,K;b<C;){var te=c[b++];switch(z){case 0:j[Z++]=O[te>>2],K=(te&3)<<4,z=1;break;case 1:j[Z++]=O[K|te>>4],K=(te&15)<<2,z=2;break;case 2:j[Z++]=O[K|te>>6],j[Z++]=O[te&63],z=0;break}Z>8191&&((N||(N=[])).push(String.fromCharCode.apply(String,j)),Z=0)}return z&&(j[Z++]=O[K],j[Z++]=61,z===1&&(j[Z++]=61)),N?(Z&&N.push(String.fromCharCode.apply(String,j.slice(0,Z))),N.join("")):String.fromCharCode.apply(String,j.slice(0,Z))};var S="invalid encoding";D.decode=function(c,b,C){for(var N=C,j=0,Z,z=0;z<c.length;){var K=c.charCodeAt(z++);if(K===61&&j>1)break;if((K=A[K])===void 0)throw Error(S);switch(j){case 0:Z=K,j=1;break;case 1:b[C++]=Z<<2|(K&48)>>4,Z=K,j=2;break;case 2:b[C++]=(Z&15)<<4|(K&60)>>2,Z=K,j=3;break;case 3:b[C++]=(Z&3)<<6|K,j=0;break}}if(j===1)throw Error(S);return C-N},D.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=$;function $(){this._listeners={}}return $.prototype.on=function(O,A,k){return(this._listeners[O]||(this._listeners[O]=[])).push({fn:A,ctx:k||this}),this},$.prototype.off=function(O,A){if(O===void 0)this._listeners={};else if(A===void 0)this._listeners[O]=[];else for(var k=this._listeners[O],S=0;S<k.length;)k[S].fn===A?k.splice(S,1):++S;return this},$.prototype.emit=function(O){var A=this._listeners[O];if(A){for(var k=[],S=1;S<arguments.length;)k.push(arguments[S++]);for(S=0;S<A.length;)A[S].fn.apply(A[S++].ctx,k)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=$($);function $(S){return typeof Float32Array<"u"?function(){var i=new Float32Array([-0]),c=new Uint8Array(i.buffer),b=c[3]===128;function C(z,K,te){i[0]=z,K[te]=c[0],K[te+1]=c[1],K[te+2]=c[2],K[te+3]=c[3]}function N(z,K,te){i[0]=z,K[te]=c[3],K[te+1]=c[2],K[te+2]=c[1],K[te+3]=c[0]}S.writeFloatLE=b?C:N,S.writeFloatBE=b?N:C;function j(z,K){return c[0]=z[K],c[1]=z[K+1],c[2]=z[K+2],c[3]=z[K+3],i[0]}function Z(z,K){return c[3]=z[K],c[2]=z[K+1],c[1]=z[K+2],c[0]=z[K+3],i[0]}S.readFloatLE=b?j:Z,S.readFloatBE=b?Z:j}():function(){function i(b,C,N,j){var Z=C<0?1:0;if(Z&&(C=-C),C===0)b(1/C>0?0:2147483648,N,j);else if(isNaN(C))b(2143289344,N,j);else if(C>34028234663852886e22)b((Z<<31|2139095040)>>>0,N,j);else if(C<11754943508222875e-54)b((Z<<31|Math.round(C/1401298464324817e-60))>>>0,N,j);else{var z=Math.floor(Math.log(C)/Math.LN2),K=Math.round(C*Math.pow(2,-z)*8388608)&8388607;b((Z<<31|z+127<<23|K)>>>0,N,j)}}S.writeFloatLE=i.bind(null,D),S.writeFloatBE=i.bind(null,O);function c(b,C,N){var j=b(C,N),Z=(j>>31)*2+1,z=j>>>23&255,K=j&8388607;return z===255?K?NaN:Z*(1/0):z===0?Z*1401298464324817e-60*K:Z*Math.pow(2,z-150)*(K+8388608)}S.readFloatLE=c.bind(null,A),S.readFloatBE=c.bind(null,k)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),c=new Uint8Array(i.buffer),b=c[7]===128;function C(z,K,te){i[0]=z,K[te]=c[0],K[te+1]=c[1],K[te+2]=c[2],K[te+3]=c[3],K[te+4]=c[4],K[te+5]=c[5],K[te+6]=c[6],K[te+7]=c[7]}function N(z,K,te){i[0]=z,K[te]=c[7],K[te+1]=c[6],K[te+2]=c[5],K[te+3]=c[4],K[te+4]=c[3],K[te+5]=c[2],K[te+6]=c[1],K[te+7]=c[0]}S.writeDoubleLE=b?C:N,S.writeDoubleBE=b?N:C;function j(z,K){return c[0]=z[K],c[1]=z[K+1],c[2]=z[K+2],c[3]=z[K+3],c[4]=z[K+4],c[5]=z[K+5],c[6]=z[K+6],c[7]=z[K+7],i[0]}function Z(z,K){return c[7]=z[K],c[6]=z[K+1],c[5]=z[K+2],c[4]=z[K+3],c[3]=z[K+4],c[2]=z[K+5],c[1]=z[K+6],c[0]=z[K+7],i[0]}S.readDoubleLE=b?j:Z,S.readDoubleBE=b?Z:j}():function(){function i(b,C,N,j,Z,z){var K=j<0?1:0;if(K&&(j=-j),j===0)b(0,Z,z+C),b(1/j>0?0:2147483648,Z,z+N);else if(isNaN(j))b(0,Z,z+C),b(2146959360,Z,z+N);else if(j>17976931348623157e292)b(0,Z,z+C),b((K<<31|2146435072)>>>0,Z,z+N);else{var te;if(j<22250738585072014e-324)te=j/5e-324,b(te>>>0,Z,z+C),b((K<<31|te/4294967296)>>>0,Z,z+N);else{var ie=Math.floor(Math.log(j)/Math.LN2);ie===1024&&(ie=1023),te=j*Math.pow(2,-ie),b(te*4503599627370496>>>0,Z,z+C),b((K<<31|ie+1023<<20|te*1048576&1048575)>>>0,Z,z+N)}}}S.writeDoubleLE=i.bind(null,D,0,4),S.writeDoubleBE=i.bind(null,O,4,0);function c(b,C,N,j,Z){var z=b(j,Z+C),K=b(j,Z+N),te=(K>>31)*2+1,ie=K>>>20&2047,ee=4294967296*(K&1048575)+z;return ie===2047?ee?NaN:te*(1/0):ie===0?te*5e-324*ee:te*Math.pow(2,ie-1075)*(ee+4503599627370496)}S.readDoubleLE=c.bind(null,A,0,4),S.readDoubleBE=c.bind(null,k,4,0)}(),S}function D(S,i,c){i[c]=S&255,i[c+1]=S>>>8&255,i[c+2]=S>>>16&255,i[c+3]=S>>>24}function O(S,i,c){i[c]=S>>>24,i[c+1]=S>>>16&255,i[c+2]=S>>>8&255,i[c+3]=S&255}function A(S,i){return(S[i]|S[i+1]<<8|S[i+2]<<16|S[i+3]<<24)>>>0}function k(S,i){return(S[i]<<24|S[i+1]<<16|S[i+2]<<8|S[i+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($){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function($){var D=$;D.length=function(A){for(var k=0,S=0,i=0;i<A.length;++i)S=A.charCodeAt(i),S<128?k+=1:S<2048?k+=2:(S&64512)===55296&&(A.charCodeAt(i+1)&64512)===56320?(++i,k+=4):k+=3;return k},D.read=function(A,k,S){var i=S-k;if(i<1)return"";for(var c=null,b=[],C=0,N;k<S;)N=A[k++],N<128?b[C++]=N:N>191&&N<224?b[C++]=(N&31)<<6|A[k++]&63:N>239&&N<365?(N=((N&7)<<18|(A[k++]&63)<<12|(A[k++]&63)<<6|A[k++]&63)-65536,b[C++]=55296+(N>>10),b[C++]=56320+(N&1023)):b[C++]=(N&15)<<12|(A[k++]&63)<<6|A[k++]&63,C>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,b)),C=0);return c?(C&&c.push(String.fromCharCode.apply(String,b.slice(0,C))),c.join("")):String.fromCharCode.apply(String,b.slice(0,C))},D.write=function(A,k,S){for(var i=S,c,b,C=0;C<A.length;++C)c=A.charCodeAt(C),c<128?k[S++]=c:c<2048?(k[S++]=c>>6|192,k[S++]=c&63|128):(c&64512)===55296&&((b=A.charCodeAt(C+1))&64512)===56320?(c=65536+((c&1023)<<10)+(b&1023),++C,k[S++]=c>>18|240,k[S++]=c>>12&63|128,k[S++]=c>>6&63|128,k[S++]=c&63|128):(k[S++]=c>>12|224,k[S++]=c>>6&63|128,k[S++]=c&63|128);return S-i}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=$;function $(D,O,A){var k=A||8192,S=k>>>1,i=null,c=k;return function(C){if(C<1||C>S)return D(C);c+C>k&&(i=D(k),c=0);var N=O.call(i,c,c+=C);return c&7&&(c=(c|7)+1),N}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=D;var $=requireMinimal$1();function D(S,i){this.lo=S>>>0,this.hi=i>>>0}var O=D.zero=new D(0,0);O.toNumber=function(){return 0},O.zzEncode=O.zzDecode=function(){return this},O.length=function(){return 1};var A=D.zeroHash="\0\0\0\0\0\0\0\0";D.fromNumber=function(i){if(i===0)return O;var c=i<0;c&&(i=-i);var b=i>>>0,C=(i-b)/4294967296>>>0;return c&&(C=~C>>>0,b=~b>>>0,++b>4294967295&&(b=0,++C>4294967295&&(C=0))),new D(b,C)},D.from=function(i){if(typeof i=="number")return D.fromNumber(i);if($.isString(i))if($.Long)i=$.Long.fromString(i);else return D.fromNumber(parseInt(i,10));return i.low||i.high?new D(i.low>>>0,i.high>>>0):O},D.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var c=~this.lo+1>>>0,b=~this.hi>>>0;return c||(b=b+1>>>0),-(c+b*4294967296)}return this.lo+this.hi*4294967296},D.prototype.toLong=function(i){return $.Long?new $.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var k=String.prototype.charCodeAt;return D.fromHash=function(i){return i===A?O:new D((k.call(i,0)|k.call(i,1)<<8|k.call(i,2)<<16|k.call(i,3)<<24)>>>0,(k.call(i,4)|k.call(i,5)<<8|k.call(i,6)<<16|k.call(i,7)<<24)>>>0)},D.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)},D.prototype.zzEncode=function(){var i=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^i)>>>0,this.lo=(this.lo<<1^i)>>>0,this},D.prototype.zzDecode=function(){var i=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^i)>>>0,this.hi=(this.hi>>>1^i)>>>0,this},D.prototype.length=function(){var i=this.lo,c=(this.lo>>>28|this.hi<<4)>>>0,b=this.hi>>>24;return b===0?c===0?i<16384?i<128?1:2:i<2097152?3:4:c<16384?c<128?5:6:c<2097152?7:8:b<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function($){var D=$;D.asPromise=requireAspromise(),D.base64=requireBase64(),D.EventEmitter=requireEventemitter(),D.float=requireFloat(),D.inquire=requireInquire(),D.utf8=requireUtf8(),D.pool=requirePool(),D.LongBits=requireLongbits(),D.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),D.global=D.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,D.emptyArray=Object.freeze?Object.freeze([]):[],D.emptyObject=Object.freeze?Object.freeze({}):{},D.isInteger=Number.isInteger||function(S){return typeof S=="number"&&isFinite(S)&&Math.floor(S)===S},D.isString=function(S){return typeof S=="string"||S instanceof String},D.isObject=function(S){return S&&typeof S=="object"},D.isset=D.isSet=function(S,i){var c=S[i];return c!=null&&S.hasOwnProperty(i)?typeof c!="object"||(Array.isArray(c)?c.length:Object.keys(c).length)>0:!1},D.Buffer=function(){try{var k=D.inquire("buffer").Buffer;return k.prototype.utf8Write?k:null}catch{return null}}(),D._Buffer_from=null,D._Buffer_allocUnsafe=null,D.newBuffer=function(S){return typeof S=="number"?D.Buffer?D._Buffer_allocUnsafe(S):new D.Array(S):D.Buffer?D._Buffer_from(S):typeof Uint8Array>"u"?S:new Uint8Array(S)},D.Array=typeof Uint8Array<"u"?Uint8Array:Array,D.Long=D.global.dcodeIO&&D.global.dcodeIO.Long||D.global.Long||D.inquire("long"),D.key2Re=/^true|false|0|1$/,D.key32Re=/^-?(?:0|[1-9][0-9]*)$/,D.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,D.longToHash=function(S){return S?D.LongBits.from(S).toHash():D.LongBits.zeroHash},D.longFromHash=function(S,i){var c=D.LongBits.fromHash(S);return D.Long?D.Long.fromBits(c.lo,c.hi,i):c.toNumber(!!i)};function O(k,S,i){for(var c=Object.keys(S),b=0;b<c.length;++b)(k[c[b]]===void 0||!i)&&(k[c[b]]=S[c[b]]);return k}D.merge=O,D.lcFirst=function(S){return S.charAt(0).toLowerCase()+S.substring(1)};function A(k){function S(i,c){if(!(this instanceof S))return new S(i,c);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,S):Object.defineProperty(this,"stack",{value:new Error().stack||""}),c&&O(this,c)}return S.prototype=Object.create(Error.prototype,{constructor:{value:S,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return k},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),S}D.newError=A,D.ProtocolError=A("ProtocolError"),D.oneOfGetter=function(S){for(var i={},c=0;c<S.length;++c)i[S[c]]=1;return function(){for(var b=Object.keys(this),C=b.length-1;C>-1;--C)if(i[b[C]]===1&&this[b[C]]!==void 0&&this[b[C]]!==null)return b[C]}},D.oneOfSetter=function(S){return function(i){for(var c=0;c<S.length;++c)S[c]!==i&&delete this[S[c]]}},D.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},D._configure=function(){var k=D.Buffer;if(!k){D._Buffer_from=D._Buffer_allocUnsafe=null;return}D._Buffer_from=k.from!==Uint8Array.from&&k.from||function(i,c){return new k(i,c)},D._Buffer_allocUnsafe=k.allocUnsafe||function(i){return new k(i)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=b;var $=requireMinimal$1(),D,O=$.LongBits,A=$.base64,k=$.utf8;function S(ie,ee,ae){this.fn=ie,this.len=ee,this.next=void 0,this.val=ae}function i(){}function c(ie){this.head=ie.head,this.tail=ie.tail,this.len=ie.len,this.next=ie.states}function b(){this.len=0,this.head=new S(i,0,0),this.tail=this.head,this.states=null}var C=function(){return $.Buffer?function(){return(b.create=function(){return new D})()}:function(){return new b}};b.create=C(),b.alloc=function(ee){return new $.Array(ee)},$.Array!==Array&&(b.alloc=$.pool(b.alloc,$.Array.prototype.subarray)),b.prototype._push=function(ee,ae,de){return this.tail=this.tail.next=new S(ee,ae,de),this.len+=ae,this};function N(ie,ee,ae){ee[ae]=ie&255}function j(ie,ee,ae){for(;ie>127;)ee[ae++]=ie&127|128,ie>>>=7;ee[ae]=ie}function Z(ie,ee){this.len=ie,this.next=void 0,this.val=ee}Z.prototype=Object.create(S.prototype),Z.prototype.fn=j,b.prototype.uint32=function(ee){return this.len+=(this.tail=this.tail.next=new Z((ee=ee>>>0)<128?1:ee<16384?2:ee<2097152?3:ee<268435456?4:5,ee)).len,this},b.prototype.int32=function(ee){return ee<0?this._push(z,10,O.fromNumber(ee)):this.uint32(ee)},b.prototype.sint32=function(ee){return this.uint32((ee<<1^ee>>31)>>>0)};function z(ie,ee,ae){for(;ie.hi;)ee[ae++]=ie.lo&127|128,ie.lo=(ie.lo>>>7|ie.hi<<25)>>>0,ie.hi>>>=7;for(;ie.lo>127;)ee[ae++]=ie.lo&127|128,ie.lo=ie.lo>>>7;ee[ae++]=ie.lo}b.prototype.uint64=function(ee){var ae=O.from(ee);return this._push(z,ae.length(),ae)},b.prototype.int64=b.prototype.uint64,b.prototype.sint64=function(ee){var ae=O.from(ee).zzEncode();return this._push(z,ae.length(),ae)},b.prototype.bool=function(ee){return this._push(N,1,ee?1:0)};function K(ie,ee,ae){ee[ae]=ie&255,ee[ae+1]=ie>>>8&255,ee[ae+2]=ie>>>16&255,ee[ae+3]=ie>>>24}b.prototype.fixed32=function(ee){return this._push(K,4,ee>>>0)},b.prototype.sfixed32=b.prototype.fixed32,b.prototype.fixed64=function(ee){var ae=O.from(ee);return this._push(K,4,ae.lo)._push(K,4,ae.hi)},b.prototype.sfixed64=b.prototype.fixed64,b.prototype.float=function(ee){return this._push($.float.writeFloatLE,4,ee)},b.prototype.double=function(ee){return this._push($.float.writeDoubleLE,8,ee)};var te=$.Array.prototype.set?function(ee,ae,de){ae.set(ee,de)}:function(ee,ae,de){for(var X=0;X<ee.length;++X)ae[de+X]=ee[X]};return b.prototype.bytes=function(ee){var ae=ee.length>>>0;if(!ae)return this._push(N,1,0);if($.isString(ee)){var de=b.alloc(ae=A.length(ee));A.decode(ee,de,0),ee=de}return this.uint32(ae)._push(te,ae,ee)},b.prototype.string=function(ee){var ae=k.length(ee);return ae?this.uint32(ae)._push(k.write,ae,ee):this._push(N,1,0)},b.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new S(i,0,0),this.len=0,this},b.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 S(i,0,0),this.len=0),this},b.prototype.ldelim=function(){var ee=this.head,ae=this.tail,de=this.len;return this.reset().uint32(de),de&&(this.tail.next=ee.next,this.tail=ae,this.len+=de),this},b.prototype.finish=function(){for(var ee=this.head.next,ae=this.constructor.alloc(this.len),de=0;ee;)ee.fn(ee.val,ae,de),de+=ee.len,ee=ee.next;return ae},b._configure=function(ie){D=ie,b.create=C(),D._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=O;var $=requireWriter();(O.prototype=Object.create($.prototype)).constructor=O;var D=requireMinimal$1();function O(){$.call(this)}O._configure=function(){O.alloc=D._Buffer_allocUnsafe,O.writeBytesBuffer=D.Buffer&&D.Buffer.prototype instanceof Uint8Array&&D.Buffer.prototype.set.name==="set"?function(S,i,c){i.set(S,c)}:function(S,i,c){if(S.copy)S.copy(i,c,0,S.length);else for(var b=0;b<S.length;)i[c++]=S[b++]}},O.prototype.bytes=function(S){D.isString(S)&&(S=D._Buffer_from(S,"base64"));var i=S.length>>>0;return this.uint32(i),i&&this._push(O.writeBytesBuffer,i,S),this};function A(k,S,i){k.length<40?D.utf8.write(k,S,i):S.utf8Write?S.utf8Write(k,i):S.write(k,i)}return O.prototype.string=function(S){var i=D.Buffer.byteLength(S);return this.uint32(i),i&&this._push(A,i,S),this},O._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=S;var $=requireMinimal$1(),D,O=$.LongBits,A=$.utf8;function k(j,Z){return RangeError("index out of range: "+j.pos+" + "+(Z||1)+" > "+j.len)}function S(j){this.buf=j,this.pos=0,this.len=j.length}var i=typeof Uint8Array<"u"?function(Z){if(Z instanceof Uint8Array||Array.isArray(Z))return new S(Z);throw Error("illegal buffer")}:function(Z){if(Array.isArray(Z))return new S(Z);throw Error("illegal buffer")},c=function(){return $.Buffer?function(z){return(S.create=function(te){return $.Buffer.isBuffer(te)?new D(te):i(te)})(z)}:i};S.create=c(),S.prototype._slice=$.Array.prototype.subarray||$.Array.prototype.slice,S.prototype.uint32=function(){var Z=4294967295;return function(){if(Z=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(Z=(Z|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(Z=(Z|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return Z;if((this.pos+=5)>this.len)throw this.pos=this.len,k(this,10);return Z}}(),S.prototype.int32=function(){return this.uint32()|0},S.prototype.sint32=function(){var Z=this.uint32();return Z>>>1^-(Z&1)|0};function b(){var j=new O(0,0),Z=0;if(this.len-this.pos>4){for(;Z<4;++Z)if(j.lo=(j.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return j;if(j.lo=(j.lo|(this.buf[this.pos]&127)<<28)>>>0,j.hi=(j.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return j;Z=0}else{for(;Z<3;++Z){if(this.pos>=this.len)throw k(this);if(j.lo=(j.lo|(this.buf[this.pos]&127)<<Z*7)>>>0,this.buf[this.pos++]<128)return j}return j.lo=(j.lo|(this.buf[this.pos++]&127)<<Z*7)>>>0,j}if(this.len-this.pos>4){for(;Z<5;++Z)if(j.hi=(j.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return j}else for(;Z<5;++Z){if(this.pos>=this.len)throw k(this);if(j.hi=(j.hi|(this.buf[this.pos]&127)<<Z*7+3)>>>0,this.buf[this.pos++]<128)return j}throw Error("invalid varint encoding")}S.prototype.bool=function(){return this.uint32()!==0};function C(j,Z){return(j[Z-4]|j[Z-3]<<8|j[Z-2]<<16|j[Z-1]<<24)>>>0}S.prototype.fixed32=function(){if(this.pos+4>this.len)throw k(this,4);return C(this.buf,this.pos+=4)},S.prototype.sfixed32=function(){if(this.pos+4>this.len)throw k(this,4);return C(this.buf,this.pos+=4)|0};function N(){if(this.pos+8>this.len)throw k(this,8);return new O(C(this.buf,this.pos+=4),C(this.buf,this.pos+=4))}return S.prototype.float=function(){if(this.pos+4>this.len)throw k(this,4);var Z=$.float.readFloatLE(this.buf,this.pos);return this.pos+=4,Z},S.prototype.double=function(){if(this.pos+8>this.len)throw k(this,4);var Z=$.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,Z},S.prototype.bytes=function(){var Z=this.uint32(),z=this.pos,K=this.pos+Z;if(K>this.len)throw k(this,Z);if(this.pos+=Z,Array.isArray(this.buf))return this.buf.slice(z,K);if(z===K){var te=$.Buffer;return te?te.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,z,K)},S.prototype.string=function(){var Z=this.bytes();return A.read(Z,0,Z.length)},S.prototype.skip=function(Z){if(typeof Z=="number"){if(this.pos+Z>this.len)throw k(this,Z);this.pos+=Z}else do if(this.pos>=this.len)throw k(this);while(this.buf[this.pos++]&128);return this},S.prototype.skipType=function(j){switch(j){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(j=this.uint32()&7)!==4;)this.skipType(j);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+j+" at offset "+this.pos)}return this},S._configure=function(j){D=j,S.create=c(),D._configure();var Z=$.Long?"toLong":"toNumber";$.merge(S.prototype,{int64:function(){return b.call(this)[Z](!1)},uint64:function(){return b.call(this)[Z](!0)},sint64:function(){return b.call(this).zzDecode()[Z](!1)},fixed64:function(){return N.call(this)[Z](!0)},sfixed64:function(){return N.call(this)[Z](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=O;var $=requireReader();(O.prototype=Object.create($.prototype)).constructor=O;var D=requireMinimal$1();function O(A){$.call(this,A)}return O._configure=function(){D.Buffer&&(O.prototype._slice=D.Buffer.prototype.slice)},O.prototype.string=function(){var k=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+k,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+k,this.len))},O._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=D;var $=requireMinimal$1();(D.prototype=Object.create($.EventEmitter.prototype)).constructor=D;function D(O,A,k){if(typeof O!="function")throw TypeError("rpcImpl must be a function");$.EventEmitter.call(this),this.rpcImpl=O,this.requestDelimited=!!A,this.responseDelimited=!!k}return D.prototype.rpcCall=function O(A,k,S,i,c){if(!i)throw TypeError("request must be specified");var b=this;if(!c)return $.asPromise(O,b,A,k,S,i);if(!b.rpcImpl){setTimeout(function(){c(Error("already ended"))},0);return}try{return b.rpcImpl(A,k[b.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(N,j){if(N)return b.emit("error",N,A),c(N);if(j===null){b.end(!0);return}if(!(j instanceof S))try{j=S[b.responseDelimited?"decodeDelimited":"decode"](j)}catch(Z){return b.emit("error",Z,A),c(Z)}return b.emit("data",j,A),c(null,j)})}catch(C){b.emit("error",C,A),setTimeout(function(){c(C)},0);return}},D.prototype.end=function(A){return this.rpcImpl&&(A||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function($){var D=$;D.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function($){var D=$;D.build="minimal",D.Writer=requireWriter(),D.BufferWriter=requireWriter_buffer(),D.Reader=requireReader(),D.BufferReader=requireReader_buffer(),D.util=requireMinimal$1(),D.rpc=requireRpc(),D.roots=requireRoots(),D.configure=O;function O(){D.util._configure(),D.Writer._configure(D.BufferWriter),D.Reader._configure(D.BufferReader)}O()}(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 $={};return $.quick=function(){const D={};return D.voice=function(){const O={};return O.proto=function(){const A={};return A.CommonReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.event="",k.prototype.data=$util.newBuffer([]),k.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,k.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,k.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,k.prototype.version=0,k.prototype.compress=!1,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(56).bool(i.compress),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.version=i.int32();break}case 7:{C.compress=i.bool();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let c=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},k.toObject=function(i,c){c||(c={});let b={};if(c.defaults){if(b.event="",c.bytes===String?b.data="":(b.data=[],c.bytes!==Array&&(b.data=$util.newBuffer(b.data))),$util.Long){let C=new $util.Long(0,0,!1);b.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);b.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);b.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.valid=c.longs===String?"0":0;b.version=0,b.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(b.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(b.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?b.sn=c.longs===String?String(i.sn):i.sn:b.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?b.time=c.longs===String?String(i.time):i.time:b.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?b.valid=c.longs===String?String(i.valid):i.valid:b.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&(b.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(b.compress=i.compress),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},k}(),A.CommonRsp=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.event="",k.prototype.data=$util.newBuffer([]),k.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,k.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,k.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,k.prototype.code=0,k.prototype.desc="",k.prototype.version=0,k.prototype.compress=!1,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&c.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&c.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&c.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&c.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&c.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&c.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&c.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&c.uint32(72).bool(i.compress),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.event=i.string();break}case 2:{C.data=i.bytes();break}case 3:{C.sn=i.int64();break}case 4:{C.time=i.int64();break}case 5:{C.valid=i.int64();break}case 6:{C.code=i.int32();break}case 7:{C.desc=i.string();break}case 8:{C.version=i.int32();break}case 9:{C.compress=i.bool();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.event!=null&&i.hasOwnProperty("event")&&!$util.isString(i.event)?"event: string expected":i.data!=null&&i.hasOwnProperty("data")&&!(i.data&&typeof i.data.length=="number"||$util.isString(i.data))?"data: buffer expected":i.sn!=null&&i.hasOwnProperty("sn")&&!$util.isInteger(i.sn)&&!(i.sn&&$util.isInteger(i.sn.low)&&$util.isInteger(i.sn.high))?"sn: integer|Long expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":i.valid!=null&&i.hasOwnProperty("valid")&&!$util.isInteger(i.valid)&&!(i.valid&&$util.isInteger(i.valid.low)&&$util.isInteger(i.valid.high))?"valid: integer|Long expected":i.code!=null&&i.hasOwnProperty("code")&&!$util.isInteger(i.code)?"code: integer expected":i.desc!=null&&i.hasOwnProperty("desc")&&!$util.isString(i.desc)?"desc: string expected":i.version!=null&&i.hasOwnProperty("version")&&!$util.isInteger(i.version)?"version: integer expected":i.compress!=null&&i.hasOwnProperty("compress")&&typeof i.compress!="boolean"?"compress: boolean expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let c=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(c.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,c.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(c.data=i.data)),i.sn!=null&&($util.Long?(c.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?c.sn=parseInt(i.sn,10):typeof i.sn=="number"?c.sn=i.sn:typeof i.sn=="object"&&(c.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(c.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?c.valid=parseInt(i.valid,10):typeof i.valid=="number"?c.valid=i.valid:typeof i.valid=="object"&&(c.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(c.code=i.code|0),i.desc!=null&&(c.desc=String(i.desc)),i.version!=null&&(c.version=i.version|0),i.compress!=null&&(c.compress=!!i.compress),c},k.toObject=function(i,c){c||(c={});let b={};if(c.defaults){if(b.event="",c.bytes===String?b.data="":(b.data=[],c.bytes!==Array&&(b.data=$util.newBuffer(b.data))),$util.Long){let C=new $util.Long(0,0,!1);b.sn=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.sn=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);b.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.time=c.longs===String?"0":0;if($util.Long){let C=new $util.Long(0,0,!1);b.valid=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.valid=c.longs===String?"0":0;b.code=0,b.desc="",b.version=0,b.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&(b.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&(b.data=c.bytes===String?$util.base64.encode(i.data,0,i.data.length):c.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?b.sn=c.longs===String?String(i.sn):i.sn:b.sn=c.longs===String?$util.Long.prototype.toString.call(i.sn):c.longs===Number?new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber():i.sn),i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?b.time=c.longs===String?String(i.time):i.time:b.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),i.valid!=null&&i.hasOwnProperty("valid")&&(typeof i.valid=="number"?b.valid=c.longs===String?String(i.valid):i.valid:b.valid=c.longs===String?$util.Long.prototype.toString.call(i.valid):c.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&(b.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&(b.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&(b.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&(b.compress=i.compress),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},k}(),A.User=function(){function k(i){if(this.tracks=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.id="",k.prototype.callAction=null,k.prototype.callState=null,k.prototype.joinTime=null,k.prototype.tracks=$util.emptyArray,k.prototype.permissions=null,k.prototype.isPublished=null,k.prototype.behavior=null,k.prototype.channelCache=null;let S;return Object.defineProperty(k.prototype,"_callAction",{get:$util.oneOfGetter(S=["callAction"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_callState",{get:$util.oneOfGetter(S=["callState"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_joinTime",{get:$util.oneOfGetter(S=["joinTime"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_permissions",{get:$util.oneOfGetter(S=["permissions"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_isPublished",{get:$util.oneOfGetter(S=["isPublished"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_behavior",{get:$util.oneOfGetter(S=["behavior"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_channelCache",{get:$util.oneOfGetter(S=["channelCache"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&b.uint32(10).string(c.id),c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&b.uint32(16).int32(c.callAction),c.callState!=null&&Object.hasOwnProperty.call(c,"callState")&&b.uint32(24).int32(c.callState),c.joinTime!=null&&Object.hasOwnProperty.call(c,"joinTime")&&b.uint32(32).int64(c.joinTime),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],b.uint32(42).fork()).ldelim();return c.permissions!=null&&Object.hasOwnProperty.call(c,"permissions")&&b.uint32(48).int32(c.permissions),c.isPublished!=null&&Object.hasOwnProperty.call(c,"isPublished")&&b.uint32(56).bool(c.isPublished),c.behavior!=null&&Object.hasOwnProperty.call(c,"behavior")&&b.uint32(64).int32(c.behavior),c.channelCache!=null&&Object.hasOwnProperty.call(c,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(c.channelCache,b.uint32(74).fork()).ldelim(),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.User;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.id=c.string();break}case 2:{N.callAction=c.int32();break}case 3:{N.callState=c.int32();break}case 4:{N.joinTime=c.int64();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 6:{N.permissions=c.int32();break}case 7:{N.isPublished=c.bool();break}case 8:{N.behavior=c.int32();break}case 9:{N.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(c,c.uint32());break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.id!=null&&c.hasOwnProperty("id")&&!$util.isString(c.id))return"id: string expected";if(c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction))return"callAction: integer expected";if(c.callState!=null&&c.hasOwnProperty("callState")&&!$util.isInteger(c.callState))return"callState: integer expected";if(c.joinTime!=null&&c.hasOwnProperty("joinTime")&&!$util.isInteger(c.joinTime)&&!(c.joinTime&&$util.isInteger(c.joinTime.low)&&$util.isInteger(c.joinTime.high)))return"joinTime: integer|Long expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let b=0;b<c.tracks.length;++b){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[b]);if(C)return"tracks."+C}}if(c.permissions!=null&&c.hasOwnProperty("permissions")&&!$util.isInteger(c.permissions))return"permissions: integer expected";if(c.isPublished!=null&&c.hasOwnProperty("isPublished")&&typeof c.isPublished!="boolean")return"isPublished: boolean expected";if(c.behavior!=null&&c.hasOwnProperty("behavior")&&!$util.isInteger(c.behavior))return"behavior: integer expected";if(c.channelCache!=null&&c.hasOwnProperty("channelCache")){let b=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(c.channelCache);if(b)return"channelCache."+b}return null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.User)return c;let b=new $root.com.quick.voice.proto.User;if(c.id!=null&&(b.id=String(c.id)),c.callAction!=null&&(b.callAction=c.callAction|0),c.callState!=null&&(b.callState=c.callState|0),c.joinTime!=null&&($util.Long?(b.joinTime=$util.Long.fromValue(c.joinTime)).unsigned=!1:typeof c.joinTime=="string"?b.joinTime=parseInt(c.joinTime,10):typeof c.joinTime=="number"?b.joinTime=c.joinTime:typeof c.joinTime=="object"&&(b.joinTime=new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber())),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");b.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");b.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}if(c.permissions!=null&&(b.permissions=c.permissions|0),c.isPublished!=null&&(b.isPublished=!!c.isPublished),c.behavior!=null&&(b.behavior=c.behavior|0),c.channelCache!=null){if(typeof c.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");b.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(c.channelCache)}return b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.tracks=[]),b.defaults&&(C.id=""),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id),c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction,b.oneofs&&(C._callAction="callAction")),c.callState!=null&&c.hasOwnProperty("callState")&&(C.callState=c.callState,b.oneofs&&(C._callState="callState")),c.joinTime!=null&&c.hasOwnProperty("joinTime")&&(typeof c.joinTime=="number"?C.joinTime=b.longs===String?String(c.joinTime):c.joinTime:C.joinTime=b.longs===String?$util.Long.prototype.toString.call(c.joinTime):b.longs===Number?new $util.LongBits(c.joinTime.low>>>0,c.joinTime.high>>>0).toNumber():c.joinTime,b.oneofs&&(C._joinTime="joinTime")),c.tracks&&c.tracks.length){C.tracks=[];for(let N=0;N<c.tracks.length;++N)C.tracks[N]=$root.com.quick.voice.proto.Track.toObject(c.tracks[N],b)}return c.permissions!=null&&c.hasOwnProperty("permissions")&&(C.permissions=c.permissions,b.oneofs&&(C._permissions="permissions")),c.isPublished!=null&&c.hasOwnProperty("isPublished")&&(C.isPublished=c.isPublished,b.oneofs&&(C._isPublished="isPublished")),c.behavior!=null&&c.hasOwnProperty("behavior")&&(C.behavior=c.behavior,b.oneofs&&(C._behavior="behavior")),c.channelCache!=null&&c.hasOwnProperty("channelCache")&&(C.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(c.channelCache,b),b.oneofs&&(C._channelCache="channelCache")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.User"},k}(),A.DataChannelCacheInfo=function(){function k(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.channels=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let b=0;b<i.channels.length;++b)$root.com.quick.voice.proto.DataChannel.encode(i.channels[b],c.uint32(10).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let b=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(b)return"channels."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let c=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");c.channels=[];for(let b=0;b<i.channels.length;++b){if(typeof i.channels[b]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");c.channels[b]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.channels=[]),i.channels&&i.channels.length){b.channels=[];for(let C=0;C<i.channels.length;++C)b.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},k}(),A.DataChannel=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.dataChannelName="",k.prototype.id=null;let S;return Object.defineProperty(k.prototype,"_id",{get:$util.oneOfGetter(S=["id"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.dataChannelName!=null&&Object.hasOwnProperty.call(c,"dataChannelName")&&b.uint32(10).string(c.dataChannelName),c.id!=null&&Object.hasOwnProperty.call(c,"id")&&b.uint32(16).int32(c.id),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.DataChannel;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.dataChannelName=c.string();break}case 2:{N.id=c.int32();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){return typeof c!="object"||c===null?"object expected":c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&!$util.isString(c.dataChannelName)?"dataChannelName: string expected":c.id!=null&&c.hasOwnProperty("id")&&!$util.isInteger(c.id)?"id: integer expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannel)return c;let b=new $root.com.quick.voice.proto.DataChannel;return c.dataChannelName!=null&&(b.dataChannelName=String(c.dataChannelName)),c.id!=null&&(b.id=c.id|0),b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(C.dataChannelName=""),c.dataChannelName!=null&&c.hasOwnProperty("dataChannelName")&&(C.dataChannelName=c.dataChannelName),c.id!=null&&c.hasOwnProperty("id")&&(C.id=c.id,b.oneofs&&(C._id="id")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannel"},k}(),A.Login=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.appid="",k.prototype.userId="",k.prototype.sdkToken="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&c.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(26).string(i.sdkToken),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Login;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.appid=i.string();break}case 2:{C.userId=i.string();break}case 3:{C.sdkToken=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.appid!=null&&i.hasOwnProperty("appid")&&!$util.isString(i.appid)?"appid: string expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let c=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(c.appid=String(i.appid)),i.userId!=null&&(c.userId=String(i.userId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.appid="",b.userId="",b.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&(b.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&(b.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(b.sdkToken=i.sdkToken),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},k}(),A.Track=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.mid="",k.prototype.trackName=null,k.prototype.location=null,k.prototype.userId=null,k.prototype.code=null,k.prototype.desc=null,k.prototype.type=null,k.prototype.isValid=null,k.prototype.simulcast=null,k.prototype.lastRetry=null;let S;return Object.defineProperty(k.prototype,"_trackName",{get:$util.oneOfGetter(S=["trackName"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_location",{get:$util.oneOfGetter(S=["location"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_userId",{get:$util.oneOfGetter(S=["userId"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_code",{get:$util.oneOfGetter(S=["code"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_desc",{get:$util.oneOfGetter(S=["desc"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_type",{get:$util.oneOfGetter(S=["type"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_isValid",{get:$util.oneOfGetter(S=["isValid"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_simulcast",{get:$util.oneOfGetter(S=["simulcast"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_lastRetry",{get:$util.oneOfGetter(S=["lastRetry"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.mid!=null&&Object.hasOwnProperty.call(c,"mid")&&b.uint32(10).string(c.mid),c.trackName!=null&&Object.hasOwnProperty.call(c,"trackName")&&b.uint32(18).string(c.trackName),c.location!=null&&Object.hasOwnProperty.call(c,"location")&&b.uint32(26).string(c.location),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&b.uint32(34).string(c.userId),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&b.uint32(40).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&b.uint32(50).string(c.desc),c.type!=null&&Object.hasOwnProperty.call(c,"type")&&b.uint32(56).int32(c.type),c.isValid!=null&&Object.hasOwnProperty.call(c,"isValid")&&b.uint32(64).bool(c.isValid),c.simulcast!=null&&Object.hasOwnProperty.call(c,"simulcast")&&b.uint32(74).string(c.simulcast),c.lastRetry!=null&&Object.hasOwnProperty.call(c,"lastRetry")&&b.uint32(80).bool(c.lastRetry),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.Track;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.mid=c.string();break}case 2:{N.trackName=c.string();break}case 3:{N.location=c.string();break}case 4:{N.userId=c.string();break}case 5:{N.code=c.int32();break}case 6:{N.desc=c.string();break}case 7:{N.type=c.int32();break}case 8:{N.isValid=c.bool();break}case 9:{N.simulcast=c.string();break}case 10:{N.lastRetry=c.bool();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.mid!=null&&c.hasOwnProperty("mid")&&!$util.isString(c.mid))return"mid: string expected";if(c.trackName!=null&&c.hasOwnProperty("trackName")&&!$util.isString(c.trackName))return"trackName: string expected";if(c.location!=null&&c.hasOwnProperty("location")&&!$util.isString(c.location))return"location: string expected";if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code))return"code: integer expected";if(c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc))return"desc: string expected";if(c.type!=null&&c.hasOwnProperty("type"))switch(c.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return c.isValid!=null&&c.hasOwnProperty("isValid")&&typeof c.isValid!="boolean"?"isValid: boolean expected":c.simulcast!=null&&c.hasOwnProperty("simulcast")&&!$util.isString(c.simulcast)?"simulcast: string expected":c.lastRetry!=null&&c.hasOwnProperty("lastRetry")&&typeof c.lastRetry!="boolean"?"lastRetry: boolean expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.Track)return c;let b=new $root.com.quick.voice.proto.Track;switch(c.mid!=null&&(b.mid=String(c.mid)),c.trackName!=null&&(b.trackName=String(c.trackName)),c.location!=null&&(b.location=String(c.location)),c.userId!=null&&(b.userId=String(c.userId)),c.code!=null&&(b.code=c.code|0),c.desc!=null&&(b.desc=String(c.desc)),c.type){default:if(typeof c.type=="number"){b.type=c.type;break}break;case"Microphone":case 0:b.type=0;break;case"Camera":case 1:b.type=1;break;case"Screen":case 2:b.type=2;break;case"SystemVoice":case 3:b.type=3;break}return c.isValid!=null&&(b.isValid=!!c.isValid),c.simulcast!=null&&(b.simulcast=String(c.simulcast)),c.lastRetry!=null&&(b.lastRetry=!!c.lastRetry),b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(C.mid=""),c.mid!=null&&c.hasOwnProperty("mid")&&(C.mid=c.mid),c.trackName!=null&&c.hasOwnProperty("trackName")&&(C.trackName=c.trackName,b.oneofs&&(C._trackName="trackName")),c.location!=null&&c.hasOwnProperty("location")&&(C.location=c.location,b.oneofs&&(C._location="location")),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId,b.oneofs&&(C._userId="userId")),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,b.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,b.oneofs&&(C._desc="desc")),c.type!=null&&c.hasOwnProperty("type")&&(C.type=b.enums===String?$root.com.quick.voice.proto.TrackType[c.type]===void 0?c.type:$root.com.quick.voice.proto.TrackType[c.type]:c.type,b.oneofs&&(C._type="type")),c.isValid!=null&&c.hasOwnProperty("isValid")&&(C.isValid=c.isValid,b.oneofs&&(C._isValid="isValid")),c.simulcast!=null&&c.hasOwnProperty("simulcast")&&(C.simulcast=c.simulcast,b.oneofs&&(C._simulcast="simulcast")),c.lastRetry!=null&&c.hasOwnProperty("lastRetry")&&(C.lastRetry=c.lastRetry,b.oneofs&&(C._lastRetry="lastRetry")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.Track"},k}(),A.JoinReq=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.roomId="",k.prototype.user=null,k.prototype.callType=0,k.prototype.token=null;let S;return Object.defineProperty(k.prototype,"_token",{get:$util.oneOfGetter(S=["token"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&b.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,b.uint32(18).fork()).ldelim(),c.callType!=null&&Object.hasOwnProperty.call(c,"callType")&&b.uint32(24).int32(c.callType),c.token!=null&&Object.hasOwnProperty.call(c,"token")&&b.uint32(34).string(c.token),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.JoinReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.callType=c.int32();break}case 4:{N.token=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let b=$root.com.quick.voice.proto.User.verify(c.user);if(b)return"user."+b}if(c.callType!=null&&c.hasOwnProperty("callType"))switch(c.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return c.token!=null&&c.hasOwnProperty("token")&&!$util.isString(c.token)?"token: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.JoinReq)return c;let b=new $root.com.quick.voice.proto.JoinReq;if(c.roomId!=null&&(b.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");b.user=$root.com.quick.voice.proto.User.fromObject(c.user)}switch(c.callType){default:if(typeof c.callType=="number"){b.callType=c.callType;break}break;case"Normal":case 0:b.callType=0;break;case"Meeting":case 1:b.callType=1;break;case"Live":case 2:b.callType=2;break}return c.token!=null&&(b.token=String(c.token)),b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(C.roomId="",C.user=null,C.callType=b.enums===String?"Normal":0),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,b)),c.callType!=null&&c.hasOwnProperty("callType")&&(C.callType=b.enums===String?$root.com.quick.voice.proto.CallType[c.callType]===void 0?c.callType:$root.com.quick.voice.proto.CallType[c.callType]:c.callType),c.token!=null&&c.hasOwnProperty("token")&&(C.token=c.token,b.oneofs&&(C._token="token")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.JoinReq"},k}(),A.JoinRsp=function(){function k(S){if(this.roomUsers=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.roomUsers=$util.emptyArray,k.prototype.callType=0,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let b=0;b<i.roomUsers.length;++b)$root.com.quick.voice.proto.User.encode(i.roomUsers[b],c.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&c.uint32(24).int32(i.callType),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.roomUsers&&C.roomUsers.length||(C.roomUsers=[]),C.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{C.callType=i.int32();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.roomUsers!=null&&i.hasOwnProperty("roomUsers")){if(!Array.isArray(i.roomUsers))return"roomUsers: array expected";for(let c=0;c<i.roomUsers.length;++c){let b=$root.com.quick.voice.proto.User.verify(i.roomUsers[c]);if(b)return"roomUsers."+b}}if(i.callType!=null&&i.hasOwnProperty("callType"))switch(i.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let c=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");c.roomUsers=[];for(let b=0;b<i.roomUsers.length;++b){if(typeof i.roomUsers[b]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");c.roomUsers[b]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[b])}}switch(i.callType){default:if(typeof i.callType=="number"){c.callType=i.callType;break}break;case"Normal":case 0:c.callType=0;break;case"Meeting":case 1:c.callType=1;break;case"Live":case 2:c.callType=2;break}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.roomUsers=[]),c.defaults&&(b.roomId="",b.callType=c.enums===String?"Normal":0),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){b.roomUsers=[];for(let C=0;C<i.roomUsers.length;++C)b.roomUsers[C]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[C],c)}return i.callType!=null&&i.hasOwnProperty("callType")&&(b.callType=c.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},k}(),A.JoinNotify=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.user=null,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let c=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.roomId="",b.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(b.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},k}(),A.ConnectCFReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.sdp="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.sdp=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let c=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(c.sdp=String(i.sdp)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(b.sdp=i.sdp),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},k}(),A.ConnectCFRsp=function(){function k(i){if(this.subscribeUsers=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.remoteSdp="",k.prototype.subscribeUsers=$util.emptyArray,k.prototype.session=null;let S;return Object.defineProperty(k.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&b.uint32(10).string(c.remoteSdp),c.subscribeUsers!=null&&c.subscribeUsers.length)for(let C=0;C<c.subscribeUsers.length;++C)$root.com.quick.voice.proto.User.encode(c.subscribeUsers[C],b.uint32(18).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&b.uint32(26).string(c.session),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.ConnectCFRsp;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.remoteSdp=c.string();break}case 2:{N.subscribeUsers&&N.subscribeUsers.length||(N.subscribeUsers=[]),N.subscribeUsers.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 3:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp))return"remoteSdp: string expected";if(c.subscribeUsers!=null&&c.hasOwnProperty("subscribeUsers")){if(!Array.isArray(c.subscribeUsers))return"subscribeUsers: array expected";for(let b=0;b<c.subscribeUsers.length;++b){let C=$root.com.quick.voice.proto.User.verify(c.subscribeUsers[b]);if(C)return"subscribeUsers."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.ConnectCFRsp)return c;let b=new $root.com.quick.voice.proto.ConnectCFRsp;if(c.remoteSdp!=null&&(b.remoteSdp=String(c.remoteSdp)),c.subscribeUsers){if(!Array.isArray(c.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");b.subscribeUsers=[];for(let C=0;C<c.subscribeUsers.length;++C){if(typeof c.subscribeUsers[C]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");b.subscribeUsers[C]=$root.com.quick.voice.proto.User.fromObject(c.subscribeUsers[C])}}return c.session!=null&&(b.session=String(c.session)),b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.subscribeUsers=[]),b.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.subscribeUsers&&c.subscribeUsers.length){C.subscribeUsers=[];for(let N=0;N<c.subscribeUsers.length;++N)C.subscribeUsers[N]=$root.com.quick.voice.proto.User.toObject(c.subscribeUsers[N],b)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,b.oneofs&&(C._session="session")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.ConnectCFRsp"},k}(),A.PublishReq=function(){function k(i){if(this.tracks=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.sdp="",k.prototype.tracks=$util.emptyArray,k.prototype.callAction=0,k.prototype.recreate=null,k.prototype.session=null;let S;return Object.defineProperty(k.prototype,"_recreate",{get:$util.oneOfGetter(S=["recreate"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.sdp!=null&&Object.hasOwnProperty.call(c,"sdp")&&b.uint32(10).string(c.sdp),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],b.uint32(18).fork()).ldelim();return c.callAction!=null&&Object.hasOwnProperty.call(c,"callAction")&&b.uint32(24).int32(c.callAction),c.recreate!=null&&Object.hasOwnProperty.call(c,"recreate")&&b.uint32(32).bool(c.recreate),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&b.uint32(42).string(c.session),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.PublishReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.sdp=c.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}case 3:{N.callAction=c.int32();break}case 4:{N.recreate=c.bool();break}case 5:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.sdp!=null&&c.hasOwnProperty("sdp")&&!$util.isString(c.sdp))return"sdp: string expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let b=0;b<c.tracks.length;++b){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[b]);if(C)return"tracks."+C}}return c.callAction!=null&&c.hasOwnProperty("callAction")&&!$util.isInteger(c.callAction)?"callAction: integer expected":c.recreate!=null&&c.hasOwnProperty("recreate")&&typeof c.recreate!="boolean"?"recreate: boolean expected":c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishReq)return c;let b=new $root.com.quick.voice.proto.PublishReq;if(c.sdp!=null&&(b.sdp=String(c.sdp)),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");b.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");b.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}return c.callAction!=null&&(b.callAction=c.callAction|0),c.recreate!=null&&(b.recreate=!!c.recreate),c.session!=null&&(b.session=String(c.session)),b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.tracks=[]),b.defaults&&(C.sdp="",C.callAction=0),c.sdp!=null&&c.hasOwnProperty("sdp")&&(C.sdp=c.sdp),c.tracks&&c.tracks.length){C.tracks=[];for(let N=0;N<c.tracks.length;++N)C.tracks[N]=$root.com.quick.voice.proto.Track.toObject(c.tracks[N],b)}return c.callAction!=null&&c.hasOwnProperty("callAction")&&(C.callAction=c.callAction),c.recreate!=null&&c.hasOwnProperty("recreate")&&(C.recreate=c.recreate,b.oneofs&&(C._recreate="recreate")),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,b.oneofs&&(C._session="session")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishReq"},k}(),A.PublishRsp=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.remoteSdp="",k.prototype.session=null;let S;return Object.defineProperty(k.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&b.uint32(10).string(c.remoteSdp),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&b.uint32(18).string(c.session),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.PublishRsp;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.remoteSdp=c.string();break}case 2:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){return typeof c!="object"||c===null?"object expected":c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp)?"remoteSdp: string expected":c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishRsp)return c;let b=new $root.com.quick.voice.proto.PublishRsp;return c.remoteSdp!=null&&(b.remoteSdp=String(c.remoteSdp)),c.session!=null&&(b.session=String(c.session)),b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,b.oneofs&&(C._session="session")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishRsp"},k}(),A.PublishNotify=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.roomId="",k.prototype.user=null,k.prototype.session=null;let S;return Object.defineProperty(k.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&b.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,b.uint32(18).fork()).ldelim(),c.session!=null&&Object.hasOwnProperty.call(c,"session")&&b.uint32(26).string(c.session),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.PublishNotify;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let b=$root.com.quick.voice.proto.User.verify(c.user);if(b)return"user."+b}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.PublishNotify)return c;let b=new $root.com.quick.voice.proto.PublishNotify;if(c.roomId!=null&&(b.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");b.user=$root.com.quick.voice.proto.User.fromObject(c.user)}return c.session!=null&&(b.session=String(c.session)),b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(C.roomId="",C.user=null),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,b)),c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,b.oneofs&&(C._session="session")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.PublishNotify"},k}(),A.SubscribeReq=function(){function k(i){if(this.users=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.users=$util.emptyArray,k.prototype.session=null,k.prototype.isLastSub=null;let S;return Object.defineProperty(k.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_isLastSub",{get:$util.oneOfGetter(S=["isLastSub"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.users!=null&&c.users.length)for(let C=0;C<c.users.length;++C)$root.com.quick.voice.proto.User.encode(c.users[C],b.uint32(10).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&b.uint32(18).string(c.session),c.isLastSub!=null&&Object.hasOwnProperty.call(c,"isLastSub")&&b.uint32(24).bool(c.isLastSub),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.SubscribeReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 2:{N.session=c.string();break}case 3:{N.isLastSub=c.bool();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.users!=null&&c.hasOwnProperty("users")){if(!Array.isArray(c.users))return"users: array expected";for(let b=0;b<c.users.length;++b){let C=$root.com.quick.voice.proto.User.verify(c.users[b]);if(C)return"users."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":c.isLastSub!=null&&c.hasOwnProperty("isLastSub")&&typeof c.isLastSub!="boolean"?"isLastSub: boolean expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SubscribeReq)return c;let b=new $root.com.quick.voice.proto.SubscribeReq;if(c.users){if(!Array.isArray(c.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");b.users=[];for(let C=0;C<c.users.length;++C){if(typeof c.users[C]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");b.users[C]=$root.com.quick.voice.proto.User.fromObject(c.users[C])}}return c.session!=null&&(b.session=String(c.session)),c.isLastSub!=null&&(b.isLastSub=!!c.isLastSub),b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.users=[]),c.users&&c.users.length){C.users=[];for(let N=0;N<c.users.length;++N)C.users[N]=$root.com.quick.voice.proto.User.toObject(c.users[N],b)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,b.oneofs&&(C._session="session")),c.isLastSub!=null&&c.hasOwnProperty("isLastSub")&&(C.isLastSub=c.isLastSub,b.oneofs&&(C._isLastSub="isLastSub")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SubscribeReq"},k}(),A.SubscribeRsp=function(){function k(i){if(this.users=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.remoteSdp="",k.prototype.users=$util.emptyArray,k.prototype.session=null;let S;return Object.defineProperty(k.prototype,"_session",{get:$util.oneOfGetter(S=["session"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.remoteSdp!=null&&Object.hasOwnProperty.call(c,"remoteSdp")&&b.uint32(10).string(c.remoteSdp),c.users!=null&&c.users.length)for(let C=0;C<c.users.length;++C)$root.com.quick.voice.proto.User.encode(c.users[C],b.uint32(18).fork()).ldelim();return c.session!=null&&Object.hasOwnProperty.call(c,"session")&&b.uint32(26).string(c.session),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.SubscribeRsp;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.remoteSdp=c.string();break}case 2:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.User.decode(c,c.uint32()));break}case 3:{N.session=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&!$util.isString(c.remoteSdp))return"remoteSdp: string expected";if(c.users!=null&&c.hasOwnProperty("users")){if(!Array.isArray(c.users))return"users: array expected";for(let b=0;b<c.users.length;++b){let C=$root.com.quick.voice.proto.User.verify(c.users[b]);if(C)return"users."+C}}return c.session!=null&&c.hasOwnProperty("session")&&!$util.isString(c.session)?"session: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SubscribeRsp)return c;let b=new $root.com.quick.voice.proto.SubscribeRsp;if(c.remoteSdp!=null&&(b.remoteSdp=String(c.remoteSdp)),c.users){if(!Array.isArray(c.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");b.users=[];for(let C=0;C<c.users.length;++C){if(typeof c.users[C]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");b.users[C]=$root.com.quick.voice.proto.User.fromObject(c.users[C])}}return c.session!=null&&(b.session=String(c.session)),b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.users=[]),b.defaults&&(C.remoteSdp=""),c.remoteSdp!=null&&c.hasOwnProperty("remoteSdp")&&(C.remoteSdp=c.remoteSdp),c.users&&c.users.length){C.users=[];for(let N=0;N<c.users.length;++N)C.users[N]=$root.com.quick.voice.proto.User.toObject(c.users[N],b)}return c.session!=null&&c.hasOwnProperty("session")&&(C.session=c.session,b.oneofs&&(C._session="session")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SubscribeRsp"},k}(),A.RenegotiateReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.userId="",k.prototype.sdp="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(18).string(i.sdp),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.sdp=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let c=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(c.userId=String(i.userId)),i.sdp!=null&&(c.sdp=String(i.sdp)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.userId="",b.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&(b.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&(b.sdp=i.sdp),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},k}(),A.QuitReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.userId="",k.prototype.roomId="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let c=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.userId="",b.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(b.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},k}(),A.QuitNotify=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.roomId="",k.prototype.user=null,k.prototype.code=null,k.prototype.desc=null;let S;return Object.defineProperty(k.prototype,"_code",{get:$util.oneOfGetter(S=["code"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_desc",{get:$util.oneOfGetter(S=["desc"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&b.uint32(10).string(c.roomId),c.user!=null&&Object.hasOwnProperty.call(c,"user")&&$root.com.quick.voice.proto.User.encode(c.user,b.uint32(18).fork()).ldelim(),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&b.uint32(24).int32(c.code),c.desc!=null&&Object.hasOwnProperty.call(c,"desc")&&b.uint32(34).string(c.desc),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.QuitNotify;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.code=c.int32();break}case 4:{N.desc=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.user!=null&&c.hasOwnProperty("user")){let b=$root.com.quick.voice.proto.User.verify(c.user);if(b)return"user."+b}return c.code!=null&&c.hasOwnProperty("code")&&!$util.isInteger(c.code)?"code: integer expected":c.desc!=null&&c.hasOwnProperty("desc")&&!$util.isString(c.desc)?"desc: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.QuitNotify)return c;let b=new $root.com.quick.voice.proto.QuitNotify;if(c.roomId!=null&&(b.roomId=String(c.roomId)),c.user!=null){if(typeof c.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");b.user=$root.com.quick.voice.proto.User.fromObject(c.user)}return c.code!=null&&(b.code=c.code|0),c.desc!=null&&(b.desc=String(c.desc)),b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(C.roomId="",C.user=null),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.user!=null&&c.hasOwnProperty("user")&&(C.user=$root.com.quick.voice.proto.User.toObject(c.user,b)),c.code!=null&&c.hasOwnProperty("code")&&(C.code=c.code,b.oneofs&&(C._code="code")),c.desc!=null&&c.hasOwnProperty("desc")&&(C.desc=c.desc,b.oneofs&&(C._desc="desc")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.QuitNotify"},k}(),A.TokenExpireNotify=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let c=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(c.roomId=String(i.roomId)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},k}(),A.UpdateTokenReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.sdkToken="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&c.uint32(18).string(i.sdkToken),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.sdkToken=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&!$util.isString(i.sdkToken)?"sdkToken: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let c=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(c.roomId=String(i.roomId)),i.sdkToken!=null&&(c.sdkToken=String(i.sdkToken)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.roomId="",b.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&(b.sdkToken=i.sdkToken),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},k}(),A.NetQualityChange=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.userId="",k.prototype.roomId="",k.prototype.egress=0,k.prototype.ingress=0,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&c.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&c.uint32(32).int32(i.ingress),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}case 3:{C.egress=i.int32();break}case 4:{C.ingress=i.int32();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":i.egress!=null&&i.hasOwnProperty("egress")&&!$util.isInteger(i.egress)?"egress: integer expected":i.ingress!=null&&i.hasOwnProperty("ingress")&&!$util.isInteger(i.ingress)?"ingress: integer expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let c=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),i.egress!=null&&(c.egress=i.egress|0),i.ingress!=null&&(c.ingress=i.ingress|0),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.userId="",b.roomId="",b.egress=0,b.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&(b.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&(b.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&(b.ingress=i.ingress),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},k}(),A.NetQualityNotify=function(){function k(S){if(this.qualities=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.qualities=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let b=0;b<i.qualities.length;++b)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[b],c.uint32(10).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.qualities&&C.qualities.length||(C.qualities=[]),C.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.qualities!=null&&i.hasOwnProperty("qualities")){if(!Array.isArray(i.qualities))return"qualities: array expected";for(let c=0;c<i.qualities.length;++c){let b=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[c]);if(b)return"qualities."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let c=new $root.com.quick.voice.proto.NetQualityNotify;if(i.qualities){if(!Array.isArray(i.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");c.qualities=[];for(let b=0;b<i.qualities.length;++b){if(typeof i.qualities[b]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");c.qualities[b]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.qualities=[]),i.qualities&&i.qualities.length){b.qualities=[];for(let C=0;C<i.qualities.length;++C)b.qualities[C]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},k}(),A.UpdateCall=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.user=null,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let c=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.roomId="",b.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(b.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},k}(),A.SyncRoomInfoReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.user=null,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.roomId="",b.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(b.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},k}(),A.SyncRoomInfoRsp=function(){function k(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.isValid=!1,k.prototype.users=$util.emptyArray,k.prototype.isActive=!1,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&c.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let b=0;b<i.users.length;++b)$root.com.quick.voice.proto.User.encode(i.users[b],c.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&c.uint32(32).bool(i.isActive),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.isValid=i.bool();break}case 3:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{C.isActive=i.bool();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.isValid!=null&&i.hasOwnProperty("isValid")&&typeof i.isValid!="boolean")return"isValid: boolean expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let b=$root.com.quick.voice.proto.User.verify(i.users[c]);if(b)return"users."+b}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let c=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.isValid!=null&&(c.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");c.users=[];for(let b=0;b<i.users.length;++b){if(typeof i.users[b]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");c.users[b]=$root.com.quick.voice.proto.User.fromObject(i.users[b])}}return i.isActive!=null&&(c.isActive=!!i.isActive),c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.users=[]),c.defaults&&(b.roomId="",b.isValid=!1,b.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&(b.isValid=i.isValid),i.users&&i.users.length){b.users=[];for(let C=0;C<i.users.length;++C)b.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&(b.isActive=i.isActive),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},k}(),A.UpdateTime=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&c.uint32(8).int64(i.time),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.time=i.int64();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.time!=null&&i.hasOwnProperty("time")&&!$util.isInteger(i.time)&&!(i.time&&$util.isInteger(i.time.low)&&$util.isInteger(i.time.high))?"time: integer|Long expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let c=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(c.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?c.time=parseInt(i.time,10):typeof i.time=="number"?c.time=i.time:typeof i.time=="object"&&(c.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),c},k.toObject=function(i,c){c||(c={});let b={};if(c.defaults)if($util.Long){let C=new $util.Long(0,0,!1);b.time=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.time=c.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?b.time=c.longs===String?String(i.time):i.time:b.time=c.longs===String?$util.Long.prototype.toString.call(i.time):c.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},k}(),A.CloseTrackReq=function(){function k(S){if(this.tracks=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.sdp="",k.prototype.tracks=$util.emptyArray,k.prototype.roomId="",k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let b=0;b<i.tracks.length;++b)$root.com.quick.voice.proto.Track.encode(i.tracks[b],c.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(26).string(i.roomId),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.sdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp))return"sdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let b=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(b)return"tracks."+b}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let c=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(c.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");c.tracks=[];for(let b=0;b<i.tracks.length;++b){if(typeof i.tracks[b]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");c.tracks[b]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[b])}}return i.roomId!=null&&(c.roomId=String(i.roomId)),c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.tracks=[]),c.defaults&&(b.sdp="",b.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&(b.sdp=i.sdp),i.tracks&&i.tracks.length){b.tracks=[];for(let C=0;C<i.tracks.length;++C)b.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},k}(),A.CloseTrackRsp=function(){function k(S){if(this.tracks=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.remoteSdp="",k.prototype.tracks=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&c.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let b=0;b<i.tracks.length;++b)$root.com.quick.voice.proto.Track.encode(i.tracks[b],c.uint32(18).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.remoteSdp=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&!$util.isString(i.remoteSdp))return"remoteSdp: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let b=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(b)return"tracks."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let c=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(c.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");c.tracks=[];for(let b=0;b<i.tracks.length;++b){if(typeof i.tracks[b]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");c.tracks[b]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.tracks=[]),c.defaults&&(b.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&(b.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){b.tracks=[];for(let C=0;C<i.tracks.length;++C)b.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},k}(),A.CloseTrackNotify=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.user=null,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(10).fork()).ldelim(),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let c=new $root.com.quick.voice.proto.CloseTrackNotify;if(i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.user=null),i.user!=null&&i.hasOwnProperty("user")&&(b.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},k}(),A.TrackType=function(){const k={},S=Object.create(k);return S[k[0]="Microphone"]=0,S[k[1]="Camera"]=1,S[k[2]="Screen"]=2,S[k[3]="SystemVoice"]=3,S}(),A.UpdatePermissions=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.user=null,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,c.uint32(18).fork()).ldelim(),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.user!=null&&i.hasOwnProperty("user")){let c=$root.com.quick.voice.proto.User.verify(i.user);if(c)return"user."+c}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let c=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");c.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.roomId="",b.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&(b.user=$root.com.quick.voice.proto.User.toObject(i.user,c)),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},k}(),A.CallType=function(){const k={},S=Object.create(k);return S[k[0]="Normal"]=0,S[k[1]="Meeting"]=1,S[k[2]="Live"]=2,S}(),A.QuitNotifyCode=function(){const k={},S=Object.create(k);return S[k[0]="NormalQuit"]=0,S[k[2021]="Timeout"]=2021,S[k[2011]="TokenExpired"]=2011,S[k[2022]="KickOut"]=2022,S[k[2023]="EndPk"]=2023,S[k[2024]="EndLive"]=2024,S}(),A.UserBehavior=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.type=0,k.prototype.behavior=!1,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&c.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&c.uint32(16).bool(i.behavior),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.type=i.int32();break}case 2:{C.behavior=i.bool();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return i.behavior!=null&&i.hasOwnProperty("behavior")&&typeof i.behavior!="boolean"?"behavior: boolean expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let c=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){c.type=i.type;break}break;case"Microphone":case 0:c.type=0;break;case"Camera":case 1:c.type=1;break;case"Screen":case 2:c.type=2;break;case"SystemVoice":case 3:c.type=3;break}return i.behavior!=null&&(c.behavior=!!i.behavior),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.type=c.enums===String?"Microphone":0,b.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&(b.type=c.enums===String?$root.com.quick.voice.proto.TrackType[i.type]===void 0?i.type:$root.com.quick.voice.proto.TrackType[i.type]:i.type),i.behavior!=null&&i.hasOwnProperty("behavior")&&(b.behavior=i.behavior),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},k}(),A.PreventUser=function(){function k(S){if(this.behaviors=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.id="",k.prototype.behaviors=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&c.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let b=0;b<i.behaviors.length;++b)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[b],c.uint32(18).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.id=i.string();break}case 2:{C.behaviors&&C.behaviors.length||(C.behaviors=[]),C.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.id!=null&&i.hasOwnProperty("id")&&!$util.isString(i.id))return"id: string expected";if(i.behaviors!=null&&i.hasOwnProperty("behaviors")){if(!Array.isArray(i.behaviors))return"behaviors: array expected";for(let c=0;c<i.behaviors.length;++c){let b=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[c]);if(b)return"behaviors."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let c=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(c.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");c.behaviors=[];for(let b=0;b<i.behaviors.length;++b){if(typeof i.behaviors[b]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");c.behaviors[b]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.behaviors=[]),c.defaults&&(b.id=""),i.id!=null&&i.hasOwnProperty("id")&&(b.id=i.id),i.behaviors&&i.behaviors.length){b.behaviors=[];for(let C=0;C<i.behaviors.length;++C)b.behaviors[C]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},k}(),A.PreventUsersBehaviorReq=function(){function k(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.users=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let b=0;b<i.users.length;++b)$root.com.quick.voice.proto.PreventUser.encode(i.users[b],c.uint32(18).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let b=$root.com.quick.voice.proto.PreventUser.verify(i.users[c]);if(b)return"users."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");c.users=[];for(let b=0;b<i.users.length;++b){if(typeof i.users[b]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");c.users[b]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.users=[]),c.defaults&&(b.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.users&&i.users.length){b.users=[];for(let C=0;C<i.users.length;++C)b.users[C]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},k}(),A.PreventUsersBehaviorNotify=function(){function k(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.users=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let b=0;b<i.users.length;++b)$root.com.quick.voice.proto.User.encode(i.users[b],c.uint32(18).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let b=$root.com.quick.voice.proto.User.verify(i.users[c]);if(b)return"users."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let c=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");c.users=[];for(let b=0;b<i.users.length;++b){if(typeof i.users[b]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");c.users[b]=$root.com.quick.voice.proto.User.fromObject(i.users[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.users=[]),c.defaults&&(b.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.users&&i.users.length){b.users=[];for(let C=0;C<i.users.length;++C)b.users[C]=$root.com.quick.voice.proto.User.toObject(i.users[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},k}(),A.AccelerationAreas=function(){const k={},S=Object.create(k);return S[k[0]="chinaMainland"]=0,S[k[1]="global"]=1,S[k[2]="overseas"]=2,S}(),A.CountMethods=function(){const k={},S=Object.create(k);return S[k[0]="flow"]=0,S[k[1]="minutes"]=1,S}(),A.BaseCDNAddress=function(){function k(S){if(this.urlMap={},S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.area=0,k.prototype.countType=0,k.prototype.urlMap=$util.emptyObject,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&c.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&c.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let b=Object.keys(i.urlMap),C=0;C<b.length;++C)c.uint32(26).fork().uint32(10).string(b[C]).uint32(18).string(i.urlMap[b[C]]).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.BaseCDNAddress,N,j;for(;i.pos<b;){let Z=i.uint32();switch(Z>>>3){case 1:{C.area=i.int32();break}case 2:{C.countType=i.int32();break}case 3:{C.urlMap===$util.emptyObject&&(C.urlMap={});let z=i.uint32()+i.pos;for(N="",j="";i.pos<z;){let K=i.uint32();switch(K>>>3){case 1:N=i.string();break;case 2:j=i.string();break;default:i.skipType(K&7);break}}C.urlMap[N]=j;break}default:i.skipType(Z&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.area!=null&&i.hasOwnProperty("area"))switch(i.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(i.countType!=null&&i.hasOwnProperty("countType"))switch(i.countType){default:return"countType: enum value expected";case 0:case 1:break}if(i.urlMap!=null&&i.hasOwnProperty("urlMap")){if(!$util.isObject(i.urlMap))return"urlMap: object expected";let c=Object.keys(i.urlMap);for(let b=0;b<c.length;++b)if(!$util.isString(i.urlMap[c[b]]))return"urlMap: string{k:string} expected"}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let c=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){c.area=i.area;break}break;case"chinaMainland":case 0:c.area=0;break;case"global":case 1:c.area=1;break;case"overseas":case 2:c.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){c.countType=i.countType;break}break;case"flow":case 0:c.countType=0;break;case"minutes":case 1:c.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");c.urlMap={};for(let b=Object.keys(i.urlMap),C=0;C<b.length;++C)c.urlMap[b[C]]=String(i.urlMap[b[C]])}return c},k.toObject=function(i,c){c||(c={});let b={};(c.objects||c.defaults)&&(b.urlMap={}),c.defaults&&(b.area=c.enums===String?"chinaMainland":0,b.countType=c.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&(b.area=c.enums===String?$root.com.quick.voice.proto.AccelerationAreas[i.area]===void 0?i.area:$root.com.quick.voice.proto.AccelerationAreas[i.area]:i.area),i.countType!=null&&i.hasOwnProperty("countType")&&(b.countType=c.enums===String?$root.com.quick.voice.proto.CountMethods[i.countType]===void 0?i.countType:$root.com.quick.voice.proto.CountMethods[i.countType]:i.countType);let C;if(i.urlMap&&(C=Object.keys(i.urlMap)).length){b.urlMap={};for(let N=0;N<C.length;++N)b.urlMap[C[N]]=i.urlMap[C[N]]}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},k}(),A.CDNPlayAddressNotify=function(){function k(i){if(this.standLines=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.roomId="",k.prototype.m3u8=null,k.prototype.rtmp=null,k.prototype.flv=null,k.prototype.rtmps=null,k.prototype.mainLine=null,k.prototype.standLines=$util.emptyArray;let S;return Object.defineProperty(k.prototype,"_m3u8",{get:$util.oneOfGetter(S=["m3u8"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_rtmp",{get:$util.oneOfGetter(S=["rtmp"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_flv",{get:$util.oneOfGetter(S=["flv"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_rtmps",{get:$util.oneOfGetter(S=["rtmps"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_mainLine",{get:$util.oneOfGetter(S=["mainLine"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&b.uint32(10).string(c.roomId),c.m3u8!=null&&Object.hasOwnProperty.call(c,"m3u8")&&b.uint32(18).string(c.m3u8),c.rtmp!=null&&Object.hasOwnProperty.call(c,"rtmp")&&b.uint32(26).string(c.rtmp),c.flv!=null&&Object.hasOwnProperty.call(c,"flv")&&b.uint32(34).string(c.flv),c.rtmps!=null&&Object.hasOwnProperty.call(c,"rtmps")&&b.uint32(42).string(c.rtmps),c.mainLine!=null&&Object.hasOwnProperty.call(c,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(c.mainLine,b.uint32(50).fork()).ldelim(),c.standLines!=null&&c.standLines.length)for(let C=0;C<c.standLines.length;++C)$root.com.quick.voice.proto.BaseCDNAddress.encode(c.standLines[C],b.uint32(58).fork()).ldelim();return b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.m3u8=c.string();break}case 3:{N.rtmp=c.string();break}case 4:{N.flv=c.string();break}case 5:{N.rtmps=c.string();break}case 6:{N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32());break}case 7:{N.standLines&&N.standLines.length||(N.standLines=[]),N.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(c,c.uint32()));break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.m3u8!=null&&c.hasOwnProperty("m3u8")&&!$util.isString(c.m3u8))return"m3u8: string expected";if(c.rtmp!=null&&c.hasOwnProperty("rtmp")&&!$util.isString(c.rtmp))return"rtmp: string expected";if(c.flv!=null&&c.hasOwnProperty("flv")&&!$util.isString(c.flv))return"flv: string expected";if(c.rtmps!=null&&c.hasOwnProperty("rtmps")&&!$util.isString(c.rtmps))return"rtmps: string expected";if(c.mainLine!=null&&c.hasOwnProperty("mainLine")){let b=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.mainLine);if(b)return"mainLine."+b}if(c.standLines!=null&&c.hasOwnProperty("standLines")){if(!Array.isArray(c.standLines))return"standLines: array expected";for(let b=0;b<c.standLines.length;++b){let C=$root.com.quick.voice.proto.BaseCDNAddress.verify(c.standLines[b]);if(C)return"standLines."+C}}return null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return c;let b=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(c.roomId!=null&&(b.roomId=String(c.roomId)),c.m3u8!=null&&(b.m3u8=String(c.m3u8)),c.rtmp!=null&&(b.rtmp=String(c.rtmp)),c.flv!=null&&(b.flv=String(c.flv)),c.rtmps!=null&&(b.rtmps=String(c.rtmps)),c.mainLine!=null){if(typeof c.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");b.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.mainLine)}if(c.standLines){if(!Array.isArray(c.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");b.standLines=[];for(let C=0;C<c.standLines.length;++C){if(typeof c.standLines[C]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");b.standLines[C]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(c.standLines[C])}}return b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.standLines=[]),b.defaults&&(C.roomId=""),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.m3u8!=null&&c.hasOwnProperty("m3u8")&&(C.m3u8=c.m3u8,b.oneofs&&(C._m3u8="m3u8")),c.rtmp!=null&&c.hasOwnProperty("rtmp")&&(C.rtmp=c.rtmp,b.oneofs&&(C._rtmp="rtmp")),c.flv!=null&&c.hasOwnProperty("flv")&&(C.flv=c.flv,b.oneofs&&(C._flv="flv")),c.rtmps!=null&&c.hasOwnProperty("rtmps")&&(C.rtmps=c.rtmps,b.oneofs&&(C._rtmps="rtmps")),c.mainLine!=null&&c.hasOwnProperty("mainLine")&&(C.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.mainLine,b),b.oneofs&&(C._mainLine="mainLine")),c.standLines&&c.standLines.length){C.standLines=[];for(let N=0;N<c.standLines.length;++N)C.standLines[N]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(c.standLines[N],b)}return C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.CDNPlayAddressNotify"},k}(),A.UserChannel=function(){function k(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.userId="",k.prototype.channels=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let b=0;b<i.channels.length;++b)$root.com.quick.voice.proto.DataChannel.encode(i.channels[b],c.uint32(18).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId))return"userId: string expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let b=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(b)return"channels."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let c=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(c.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");c.channels=[];for(let b=0;b<i.channels.length;++b){if(typeof i.channels[b]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");c.channels[b]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.channels=[]),c.defaults&&(b.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(b.userId=i.userId),i.channels&&i.channels.length){b.channels=[];for(let C=0;C<i.channels.length;++C)b.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},k}(),A.ChannelPublishReq=function(){function k(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.channels=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let b=0;b<i.channels.length;++b)$root.com.quick.voice.proto.DataChannel.encode(i.channels[b],c.uint32(10).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let b=$root.com.quick.voice.proto.DataChannel.verify(i.channels[c]);if(b)return"channels."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishReq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");c.channels=[];for(let b=0;b<i.channels.length;++b){if(typeof i.channels[b]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");c.channels[b]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.channels=[]),i.channels&&i.channels.length){b.channels=[];for(let C=0;C<i.channels.length;++C)b.channels[C]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},k}(),A.ChannelPublishRsq=function(){function k(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.channels=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let b=0;b<i.channels.length;++b)$root.com.quick.voice.proto.UserChannel.encode(i.channels[b],c.uint32(10).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let b=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if(b)return"channels."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let c=new $root.com.quick.voice.proto.ChannelPublishRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");c.channels=[];for(let b=0;b<i.channels.length;++b){if(typeof i.channels[b]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");c.channels[b]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.channels=[]),i.channels&&i.channels.length){b.channels=[];for(let C=0;C<i.channels.length;++C)b.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},k}(),A.ChannelSubscribeReq=function(){function k(S){if(this.users=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.users=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.users!=null&&i.users.length)for(let b=0;b<i.users.length;++b)$root.com.quick.voice.proto.UserChannel.encode(i.users[b],c.uint32(10).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.users&&C.users.length||(C.users=[]),C.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.users!=null&&i.hasOwnProperty("users")){if(!Array.isArray(i.users))return"users: array expected";for(let c=0;c<i.users.length;++c){let b=$root.com.quick.voice.proto.UserChannel.verify(i.users[c]);if(b)return"users."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");c.users=[];for(let b=0;b<i.users.length;++b){if(typeof i.users[b]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");c.users[b]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.users=[]),i.users&&i.users.length){b.users=[];for(let C=0;C<i.users.length;++C)b.users[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},k}(),A.ChannelSubscribeRsq=function(){function k(S){if(this.channels=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.channels=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.channels!=null&&i.channels.length)for(let b=0;b<i.channels.length;++b)$root.com.quick.voice.proto.UserChannel.encode(i.channels[b],c.uint32(10).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.channels&&C.channels.length||(C.channels=[]),C.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.channels!=null&&i.hasOwnProperty("channels")){if(!Array.isArray(i.channels))return"channels: array expected";for(let c=0;c<i.channels.length;++c){let b=$root.com.quick.voice.proto.UserChannel.verify(i.channels[c]);if(b)return"channels."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let c=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");c.channels=[];for(let b=0;b<i.channels.length;++b){if(typeof i.channels[b]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");c.channels[b]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.channels=[]),i.channels&&i.channels.length){b.channels=[];for(let C=0;C<i.channels.length;++C)b.channels[C]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},k}(),A.DataChannelData=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.userId="",k.prototype.type=0,k.prototype.audioData=null;let S;return Object.defineProperty(k.prototype,"_audioData",{get:$util.oneOfGetter(S=["audioData"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&b.uint32(10).string(c.userId),c.type!=null&&Object.hasOwnProperty.call(c,"type")&&b.uint32(16).int32(c.type),c.audioData!=null&&Object.hasOwnProperty.call(c,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(c.audioData,b.uint32(26).fork()).ldelim(),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.DataChannelData;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.userId=c.string();break}case 2:{N.type=c.int32();break}case 3:{N.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(c,c.uint32());break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.type!=null&&c.hasOwnProperty("type"))switch(c.type){default:return"type: enum value expected";case 0:break}if(c.audioData!=null&&c.hasOwnProperty("audioData")){let b=$root.com.quick.voice.proto.DataChannelAudioData.verify(c.audioData);if(b)return"audioData."+b}return null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannelData)return c;let b=new $root.com.quick.voice.proto.DataChannelData;switch(c.userId!=null&&(b.userId=String(c.userId)),c.type){default:if(typeof c.type=="number"){b.type=c.type;break}break;case"backAuido":case 0:b.type=0;break}if(c.audioData!=null){if(typeof c.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");b.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(c.audioData)}return b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(C.userId="",C.type=b.enums===String?"backAuido":0),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId),c.type!=null&&c.hasOwnProperty("type")&&(C.type=b.enums===String?$root.com.quick.voice.proto.DataChannelType[c.type]===void 0?c.type:$root.com.quick.voice.proto.DataChannelType[c.type]:c.type),c.audioData!=null&&c.hasOwnProperty("audioData")&&(C.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(c.audioData,b),b.oneofs&&(C._audioData="audioData")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannelData"},k}(),A.DataChannelType=function(){const k={},S=Object.create(k);return S[k[0]="backAuido"]=0,S}(),A.DataChannelAudioData=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.data=$util.newBuffer([]),k.prototype.format=null,k.prototype.time=null;let S;return Object.defineProperty(k.prototype,"_time",{get:$util.oneOfGetter(S=["time"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.data!=null&&Object.hasOwnProperty.call(c,"data")&&b.uint32(10).bytes(c.data),c.format!=null&&Object.hasOwnProperty.call(c,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(c.format,b.uint32(18).fork()).ldelim(),c.time!=null&&Object.hasOwnProperty.call(c,"time")&&b.uint32(24).int64(c.time),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.DataChannelAudioData;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.data=c.bytes();break}case 2:{N.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(c,c.uint32());break}case 3:{N.time=c.int64();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.data!=null&&c.hasOwnProperty("data")&&!(c.data&&typeof c.data.length=="number"||$util.isString(c.data)))return"data: buffer expected";if(c.format!=null&&c.hasOwnProperty("format")){let b=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(c.format);if(b)return"format."+b}return c.time!=null&&c.hasOwnProperty("time")&&!$util.isInteger(c.time)&&!(c.time&&$util.isInteger(c.time.low)&&$util.isInteger(c.time.high))?"time: integer|Long expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.DataChannelAudioData)return c;let b=new $root.com.quick.voice.proto.DataChannelAudioData;if(c.data!=null&&(typeof c.data=="string"?$util.base64.decode(c.data,b.data=$util.newBuffer($util.base64.length(c.data)),0):c.data.length>=0&&(b.data=c.data)),c.format!=null){if(typeof c.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");b.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(c.format)}return c.time!=null&&($util.Long?(b.time=$util.Long.fromValue(c.time)).unsigned=!1:typeof c.time=="string"?b.time=parseInt(c.time,10):typeof c.time=="number"?b.time=c.time:typeof c.time=="object"&&(b.time=new $util.LongBits(c.time.low>>>0,c.time.high>>>0).toNumber())),b},k.toObject=function(c,b){b||(b={});let C={};return b.defaults&&(b.bytes===String?C.data="":(C.data=[],b.bytes!==Array&&(C.data=$util.newBuffer(C.data))),C.format=null),c.data!=null&&c.hasOwnProperty("data")&&(C.data=b.bytes===String?$util.base64.encode(c.data,0,c.data.length):b.bytes===Array?Array.prototype.slice.call(c.data):c.data),c.format!=null&&c.hasOwnProperty("format")&&(C.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(c.format,b)),c.time!=null&&c.hasOwnProperty("time")&&(typeof c.time=="number"?C.time=b.longs===String?String(c.time):c.time:C.time=b.longs===String?$util.Long.prototype.toString.call(c.time):b.longs===Number?new $util.LongBits(c.time.low>>>0,c.time.high>>>0).toNumber():c.time,b.oneofs&&(C._time="time")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.DataChannelAudioData"},k}(),A.DataChannelAudioFormat=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.sampleRate=0,k.prototype.channels=0,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.sampleRate!=null&&Object.hasOwnProperty.call(i,"sampleRate")&&c.uint32(9).double(i.sampleRate),i.channels!=null&&Object.hasOwnProperty.call(i,"channels")&&c.uint32(16).int32(i.channels),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.sampleRate=i.double();break}case 2:{C.channels=i.int32();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&typeof i.sampleRate!="number"?"sampleRate: number expected":i.channels!=null&&i.hasOwnProperty("channels")&&!$util.isInteger(i.channels)?"channels: integer expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return i;let c=new $root.com.quick.voice.proto.DataChannelAudioFormat;return i.sampleRate!=null&&(c.sampleRate=Number(i.sampleRate)),i.channels!=null&&(c.channels=i.channels|0),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.sampleRate=0,b.channels=0),i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&(b.sampleRate=c.json&&!isFinite(i.sampleRate)?String(i.sampleRate):i.sampleRate),i.channels!=null&&i.hasOwnProperty("channels")&&(b.channels=i.channels),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelAudioFormat"},k}(),A.AckMsgReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.msgId!=null&&Object.hasOwnProperty.call(i,"msgId")&&c.uint32(8).int64(i.msgId),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.AckMsgReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.msgId=i.int64();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.msgId!=null&&i.hasOwnProperty("msgId")&&!$util.isInteger(i.msgId)&&!(i.msgId&&$util.isInteger(i.msgId.low)&&$util.isInteger(i.msgId.high))?"msgId: integer|Long expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AckMsgReq)return i;let c=new $root.com.quick.voice.proto.AckMsgReq;return i.msgId!=null&&($util.Long?(c.msgId=$util.Long.fromValue(i.msgId)).unsigned=!1:typeof i.msgId=="string"?c.msgId=parseInt(i.msgId,10):typeof i.msgId=="number"?c.msgId=i.msgId:typeof i.msgId=="object"&&(c.msgId=new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber())),c},k.toObject=function(i,c){c||(c={});let b={};if(c.defaults)if($util.Long){let C=new $util.Long(0,0,!1);b.msgId=c.longs===String?C.toString():c.longs===Number?C.toNumber():C}else b.msgId=c.longs===String?"0":0;return i.msgId!=null&&i.hasOwnProperty("msgId")&&(typeof i.msgId=="number"?b.msgId=c.longs===String?String(i.msgId):i.msgId:b.msgId=c.longs===String?$util.Long.prototype.toString.call(i.msgId):c.longs===Number?new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber():i.msgId),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AckMsgReq"},k}(),A.SdpConsult=function(){function k(i){if(this.tracks=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.roomId="",k.prototype.sender=null,k.prototype.receiverId="",k.prototype.sdp="",k.prototype.tracks=$util.emptyArray;let S;return Object.defineProperty(k.prototype,"_sender",{get:$util.oneOfGetter(S=["sender"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.roomId!=null&&Object.hasOwnProperty.call(c,"roomId")&&b.uint32(10).string(c.roomId),c.sender!=null&&Object.hasOwnProperty.call(c,"sender")&&$root.com.quick.voice.proto.User.encode(c.sender,b.uint32(18).fork()).ldelim(),c.receiverId!=null&&Object.hasOwnProperty.call(c,"receiverId")&&b.uint32(26).string(c.receiverId),c.sdp!=null&&Object.hasOwnProperty.call(c,"sdp")&&b.uint32(34).string(c.sdp),c.tracks!=null&&c.tracks.length)for(let C=0;C<c.tracks.length;++C)$root.com.quick.voice.proto.Track.encode(c.tracks[C],b.uint32(42).fork()).ldelim();return b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.SdpConsult;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.roomId=c.string();break}case 2:{N.sender=$root.com.quick.voice.proto.User.decode(c,c.uint32());break}case 3:{N.receiverId=c.string();break}case 4:{N.sdp=c.string();break}case 5:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(c,c.uint32()));break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.roomId!=null&&c.hasOwnProperty("roomId")&&!$util.isString(c.roomId))return"roomId: string expected";if(c.sender!=null&&c.hasOwnProperty("sender")){let b=$root.com.quick.voice.proto.User.verify(c.sender);if(b)return"sender."+b}if(c.receiverId!=null&&c.hasOwnProperty("receiverId")&&!$util.isString(c.receiverId))return"receiverId: string expected";if(c.sdp!=null&&c.hasOwnProperty("sdp")&&!$util.isString(c.sdp))return"sdp: string expected";if(c.tracks!=null&&c.hasOwnProperty("tracks")){if(!Array.isArray(c.tracks))return"tracks: array expected";for(let b=0;b<c.tracks.length;++b){let C=$root.com.quick.voice.proto.Track.verify(c.tracks[b]);if(C)return"tracks."+C}}return null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.SdpConsult)return c;let b=new $root.com.quick.voice.proto.SdpConsult;if(c.roomId!=null&&(b.roomId=String(c.roomId)),c.sender!=null){if(typeof c.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");b.sender=$root.com.quick.voice.proto.User.fromObject(c.sender)}if(c.receiverId!=null&&(b.receiverId=String(c.receiverId)),c.sdp!=null&&(b.sdp=String(c.sdp)),c.tracks){if(!Array.isArray(c.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");b.tracks=[];for(let C=0;C<c.tracks.length;++C){if(typeof c.tracks[C]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");b.tracks[C]=$root.com.quick.voice.proto.Track.fromObject(c.tracks[C])}}return b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.tracks=[]),b.defaults&&(C.roomId="",C.receiverId="",C.sdp=""),c.roomId!=null&&c.hasOwnProperty("roomId")&&(C.roomId=c.roomId),c.sender!=null&&c.hasOwnProperty("sender")&&(C.sender=$root.com.quick.voice.proto.User.toObject(c.sender,b),b.oneofs&&(C._sender="sender")),c.receiverId!=null&&c.hasOwnProperty("receiverId")&&(C.receiverId=c.receiverId),c.sdp!=null&&c.hasOwnProperty("sdp")&&(C.sdp=c.sdp),c.tracks&&c.tracks.length){C.tracks=[];for(let N=0;N<c.tracks.length;++N)C.tracks[N]=$root.com.quick.voice.proto.Track.toObject(c.tracks[N],b)}return C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.SdpConsult"},k}(),A.Candidate=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.sdpMid="",k.prototype.sdpMLineIndex=0,k.prototype.sdp="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.sdpMid!=null&&Object.hasOwnProperty.call(i,"sdpMid")&&c.uint32(10).string(i.sdpMid),i.sdpMLineIndex!=null&&Object.hasOwnProperty.call(i,"sdpMLineIndex")&&c.uint32(16).int32(i.sdpMLineIndex),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&c.uint32(26).string(i.sdp),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Candidate;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.sdpMid=i.string();break}case 2:{C.sdpMLineIndex=i.int32();break}case 3:{C.sdp=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&!$util.isString(i.sdpMid)?"sdpMid: string expected":i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&!$util.isInteger(i.sdpMLineIndex)?"sdpMLineIndex: integer expected":i.sdp!=null&&i.hasOwnProperty("sdp")&&!$util.isString(i.sdp)?"sdp: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidate)return i;let c=new $root.com.quick.voice.proto.Candidate;return i.sdpMid!=null&&(c.sdpMid=String(i.sdpMid)),i.sdpMLineIndex!=null&&(c.sdpMLineIndex=i.sdpMLineIndex|0),i.sdp!=null&&(c.sdp=String(i.sdp)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.sdpMid="",b.sdpMLineIndex=0,b.sdp=""),i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&(b.sdpMid=i.sdpMid),i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&(b.sdpMLineIndex=i.sdpMLineIndex),i.sdp!=null&&i.hasOwnProperty("sdp")&&(b.sdp=i.sdp),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidate"},k}(),A.Candidates=function(){function k(S){if(this.candidates=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.roomId="",k.prototype.senderId="",k.prototype.receiverId="",k.prototype.candidates=$util.emptyArray,k.prototype.isSubscribeReceiver=!1,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(10).string(i.roomId),i.senderId!=null&&Object.hasOwnProperty.call(i,"senderId")&&c.uint32(18).string(i.senderId),i.receiverId!=null&&Object.hasOwnProperty.call(i,"receiverId")&&c.uint32(26).string(i.receiverId),i.candidates!=null&&i.candidates.length)for(let b=0;b<i.candidates.length;++b)$root.com.quick.voice.proto.Candidate.encode(i.candidates[b],c.uint32(34).fork()).ldelim();return i.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(i,"isSubscribeReceiver")&&c.uint32(40).bool(i.isSubscribeReceiver),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.Candidates;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.roomId=i.string();break}case 2:{C.senderId=i.string();break}case 3:{C.receiverId=i.string();break}case 4:{C.candidates&&C.candidates.length||(C.candidates=[]),C.candidates.push($root.com.quick.voice.proto.Candidate.decode(i,i.uint32()));break}case 5:{C.isSubscribeReceiver=i.bool();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId))return"roomId: string expected";if(i.senderId!=null&&i.hasOwnProperty("senderId")&&!$util.isString(i.senderId))return"senderId: string expected";if(i.receiverId!=null&&i.hasOwnProperty("receiverId")&&!$util.isString(i.receiverId))return"receiverId: string expected";if(i.candidates!=null&&i.hasOwnProperty("candidates")){if(!Array.isArray(i.candidates))return"candidates: array expected";for(let c=0;c<i.candidates.length;++c){let b=$root.com.quick.voice.proto.Candidate.verify(i.candidates[c]);if(b)return"candidates."+b}}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&typeof i.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidates)return i;let c=new $root.com.quick.voice.proto.Candidates;if(i.roomId!=null&&(c.roomId=String(i.roomId)),i.senderId!=null&&(c.senderId=String(i.senderId)),i.receiverId!=null&&(c.receiverId=String(i.receiverId)),i.candidates){if(!Array.isArray(i.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");c.candidates=[];for(let b=0;b<i.candidates.length;++b){if(typeof i.candidates[b]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");c.candidates[b]=$root.com.quick.voice.proto.Candidate.fromObject(i.candidates[b])}}return i.isSubscribeReceiver!=null&&(c.isSubscribeReceiver=!!i.isSubscribeReceiver),c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.candidates=[]),c.defaults&&(b.roomId="",b.senderId="",b.receiverId="",b.isSubscribeReceiver=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),i.senderId!=null&&i.hasOwnProperty("senderId")&&(b.senderId=i.senderId),i.receiverId!=null&&i.hasOwnProperty("receiverId")&&(b.receiverId=i.receiverId),i.candidates&&i.candidates.length){b.candidates=[];for(let C=0;C<i.candidates.length;++C)b.candidates[C]=$root.com.quick.voice.proto.Candidate.toObject(i.candidates[C],c)}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&(b.isSubscribeReceiver=i.isSubscribeReceiver),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidates"},k}(),A.NatType=function(){const k={},S=Object.create(k);return S[k[0]="Symmetric"]=0,S[k[1]="Cone"]=1,S[k[2]="Port"]=2,S[k[3]="IP"]=3,S[k[4]="UnKnown"]=4,S}(),A.NetworkType=function(){const k={},S=Object.create(k);return S[k[0]="Wifi"]=0,S[k[1]="Wired"]=1,S[k[2]="Mobile"]=2,S}(),A.ReportNetInfo=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.nat=0,k.prototype.type=0,k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.nat!=null&&Object.hasOwnProperty.call(i,"nat")&&c.uint32(8).int32(i.nat),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&c.uint32(16).int32(i.type),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.ReportNetInfo;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.nat=i.int32();break}case 2:{C.type=i.int32();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.nat!=null&&i.hasOwnProperty("nat"))switch(i.nat){default:return"nat: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(i.type!=null&&i.hasOwnProperty("type"))switch(i.type){default:return"type: enum value expected";case 0:case 1:case 2:break}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportNetInfo)return i;let c=new $root.com.quick.voice.proto.ReportNetInfo;switch(i.nat){default:if(typeof i.nat=="number"){c.nat=i.nat;break}break;case"Symmetric":case 0:c.nat=0;break;case"Cone":case 1:c.nat=1;break;case"Port":case 2:c.nat=2;break;case"IP":case 3:c.nat=3;break;case"UnKnown":case 4:c.nat=4;break}switch(i.type){default:if(typeof i.type=="number"){c.type=i.type;break}break;case"Wifi":case 0:c.type=0;break;case"Wired":case 1:c.type=1;break;case"Mobile":case 2:c.type=2;break}return c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.nat=c.enums===String?"Symmetric":0,b.type=c.enums===String?"Wifi":0),i.nat!=null&&i.hasOwnProperty("nat")&&(b.nat=c.enums===String?$root.com.quick.voice.proto.NatType[i.nat]===void 0?i.nat:$root.com.quick.voice.proto.NatType[i.nat]:i.nat),i.type!=null&&i.hasOwnProperty("type")&&(b.type=c.enums===String?$root.com.quick.voice.proto.NetworkType[i.type]===void 0?i.type:$root.com.quick.voice.proto.NetworkType[i.type]:i.type),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportNetInfo"},k}(),A.P2PCode=function(){const k={},S=Object.create(k);return S[k[0]="Success"]=0,S[k[1]="Failed"]=1,S[k[2]="Ignore"]=2,S[k[3]="Disconnected"]=3,S}(),A.ReportP2PReq=function(){function k(i){if(this.pushUserIds=[],i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.code=0,k.prototype.userId="",k.prototype.reason=null,k.prototype.pushUserIds=$util.emptyArray,k.prototype.origin="",k.prototype.connectedTime=null;let S;return Object.defineProperty(k.prototype,"_reason",{get:$util.oneOfGetter(S=["reason"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_connectedTime",{get:$util.oneOfGetter(S=["connectedTime"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){if(b||(b=$Writer.create()),c.code!=null&&Object.hasOwnProperty.call(c,"code")&&b.uint32(8).int32(c.code),c.userId!=null&&Object.hasOwnProperty.call(c,"userId")&&b.uint32(18).string(c.userId),c.reason!=null&&Object.hasOwnProperty.call(c,"reason")&&b.uint32(26).string(c.reason),c.pushUserIds!=null&&c.pushUserIds.length)for(let C=0;C<c.pushUserIds.length;++C)b.uint32(34).string(c.pushUserIds[C]);return c.origin!=null&&Object.hasOwnProperty.call(c,"origin")&&b.uint32(42).string(c.origin),c.connectedTime!=null&&Object.hasOwnProperty.call(c,"connectedTime")&&b.uint32(50).string(c.connectedTime),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.ReportP2PReq;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.code=c.int32();break}case 2:{N.userId=c.string();break}case 3:{N.reason=c.string();break}case 4:{N.pushUserIds&&N.pushUserIds.length||(N.pushUserIds=[]),N.pushUserIds.push(c.string());break}case 5:{N.origin=c.string();break}case 6:{N.connectedTime=c.string();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.code!=null&&c.hasOwnProperty("code"))switch(c.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:break}if(c.userId!=null&&c.hasOwnProperty("userId")&&!$util.isString(c.userId))return"userId: string expected";if(c.reason!=null&&c.hasOwnProperty("reason")&&!$util.isString(c.reason))return"reason: string expected";if(c.pushUserIds!=null&&c.hasOwnProperty("pushUserIds")){if(!Array.isArray(c.pushUserIds))return"pushUserIds: array expected";for(let b=0;b<c.pushUserIds.length;++b)if(!$util.isString(c.pushUserIds[b]))return"pushUserIds: string[] expected"}return c.origin!=null&&c.hasOwnProperty("origin")&&!$util.isString(c.origin)?"origin: string expected":c.connectedTime!=null&&c.hasOwnProperty("connectedTime")&&!$util.isString(c.connectedTime)?"connectedTime: string expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.ReportP2PReq)return c;let b=new $root.com.quick.voice.proto.ReportP2PReq;switch(c.code){default:if(typeof c.code=="number"){b.code=c.code;break}break;case"Success":case 0:b.code=0;break;case"Failed":case 1:b.code=1;break;case"Ignore":case 2:b.code=2;break;case"Disconnected":case 3:b.code=3;break}if(c.userId!=null&&(b.userId=String(c.userId)),c.reason!=null&&(b.reason=String(c.reason)),c.pushUserIds){if(!Array.isArray(c.pushUserIds))throw TypeError(".com.quick.voice.proto.ReportP2PReq.pushUserIds: array expected");b.pushUserIds=[];for(let C=0;C<c.pushUserIds.length;++C)b.pushUserIds[C]=String(c.pushUserIds[C])}return c.origin!=null&&(b.origin=String(c.origin)),c.connectedTime!=null&&(b.connectedTime=String(c.connectedTime)),b},k.toObject=function(c,b){b||(b={});let C={};if((b.arrays||b.defaults)&&(C.pushUserIds=[]),b.defaults&&(C.code=b.enums===String?"Success":0,C.userId="",C.origin=""),c.code!=null&&c.hasOwnProperty("code")&&(C.code=b.enums===String?$root.com.quick.voice.proto.P2PCode[c.code]===void 0?c.code:$root.com.quick.voice.proto.P2PCode[c.code]:c.code),c.userId!=null&&c.hasOwnProperty("userId")&&(C.userId=c.userId),c.reason!=null&&c.hasOwnProperty("reason")&&(C.reason=c.reason,b.oneofs&&(C._reason="reason")),c.pushUserIds&&c.pushUserIds.length){C.pushUserIds=[];for(let N=0;N<c.pushUserIds.length;++N)C.pushUserIds[N]=c.pushUserIds[N]}return c.origin!=null&&c.hasOwnProperty("origin")&&(C.origin=c.origin),c.connectedTime!=null&&c.hasOwnProperty("connectedTime")&&(C.connectedTime=c.connectedTime,b.oneofs&&(C._connectedTime="connectedTime")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.ReportP2PReq"},k}(),A.ReportTrafficUsage=function(){function k(i){if(i)for(let c=Object.keys(i),b=0;b<c.length;++b)i[c[b]]!=null&&(this[c[b]]=i[c[b]])}k.prototype.p2pPush=null,k.prototype.p2pPull=null,k.prototype.sfuPush=null,k.prototype.sfuPull=null;let S;return Object.defineProperty(k.prototype,"_p2pPush",{get:$util.oneOfGetter(S=["p2pPush"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_p2pPull",{get:$util.oneOfGetter(S=["p2pPull"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_sfuPush",{get:$util.oneOfGetter(S=["sfuPush"]),set:$util.oneOfSetter(S)}),Object.defineProperty(k.prototype,"_sfuPull",{get:$util.oneOfGetter(S=["sfuPull"]),set:$util.oneOfSetter(S)}),k.create=function(c){return new k(c)},k.encode=function(c,b){return b||(b=$Writer.create()),c.p2pPush!=null&&Object.hasOwnProperty.call(c,"p2pPush")&&b.uint32(8).int64(c.p2pPush),c.p2pPull!=null&&Object.hasOwnProperty.call(c,"p2pPull")&&b.uint32(16).int64(c.p2pPull),c.sfuPush!=null&&Object.hasOwnProperty.call(c,"sfuPush")&&b.uint32(24).int64(c.sfuPush),c.sfuPull!=null&&Object.hasOwnProperty.call(c,"sfuPull")&&b.uint32(32).int64(c.sfuPull),b},k.encodeDelimited=function(c,b){return this.encode(c,b).ldelim()},k.decode=function(c,b){c instanceof $Reader||(c=$Reader.create(c));let C=b===void 0?c.len:c.pos+b,N=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;c.pos<C;){let j=c.uint32();switch(j>>>3){case 1:{N.p2pPush=c.int64();break}case 2:{N.p2pPull=c.int64();break}case 3:{N.sfuPush=c.int64();break}case 4:{N.sfuPull=c.int64();break}default:c.skipType(j&7);break}}return N},k.decodeDelimited=function(c){return c instanceof $Reader||(c=new $Reader(c)),this.decode(c,c.uint32())},k.verify=function(c){return typeof c!="object"||c===null?"object expected":c.p2pPush!=null&&c.hasOwnProperty("p2pPush")&&!$util.isInteger(c.p2pPush)&&!(c.p2pPush&&$util.isInteger(c.p2pPush.low)&&$util.isInteger(c.p2pPush.high))?"p2pPush: integer|Long expected":c.p2pPull!=null&&c.hasOwnProperty("p2pPull")&&!$util.isInteger(c.p2pPull)&&!(c.p2pPull&&$util.isInteger(c.p2pPull.low)&&$util.isInteger(c.p2pPull.high))?"p2pPull: integer|Long expected":c.sfuPush!=null&&c.hasOwnProperty("sfuPush")&&!$util.isInteger(c.sfuPush)&&!(c.sfuPush&&$util.isInteger(c.sfuPush.low)&&$util.isInteger(c.sfuPush.high))?"sfuPush: integer|Long expected":c.sfuPull!=null&&c.hasOwnProperty("sfuPull")&&!$util.isInteger(c.sfuPull)&&!(c.sfuPull&&$util.isInteger(c.sfuPull.low)&&$util.isInteger(c.sfuPull.high))?"sfuPull: integer|Long expected":null},k.fromObject=function(c){if(c instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return c;let b=new $root.com.quick.voice.proto.ReportTrafficUsage;return c.p2pPush!=null&&($util.Long?(b.p2pPush=$util.Long.fromValue(c.p2pPush)).unsigned=!1:typeof c.p2pPush=="string"?b.p2pPush=parseInt(c.p2pPush,10):typeof c.p2pPush=="number"?b.p2pPush=c.p2pPush:typeof c.p2pPush=="object"&&(b.p2pPush=new $util.LongBits(c.p2pPush.low>>>0,c.p2pPush.high>>>0).toNumber())),c.p2pPull!=null&&($util.Long?(b.p2pPull=$util.Long.fromValue(c.p2pPull)).unsigned=!1:typeof c.p2pPull=="string"?b.p2pPull=parseInt(c.p2pPull,10):typeof c.p2pPull=="number"?b.p2pPull=c.p2pPull:typeof c.p2pPull=="object"&&(b.p2pPull=new $util.LongBits(c.p2pPull.low>>>0,c.p2pPull.high>>>0).toNumber())),c.sfuPush!=null&&($util.Long?(b.sfuPush=$util.Long.fromValue(c.sfuPush)).unsigned=!1:typeof c.sfuPush=="string"?b.sfuPush=parseInt(c.sfuPush,10):typeof c.sfuPush=="number"?b.sfuPush=c.sfuPush:typeof c.sfuPush=="object"&&(b.sfuPush=new $util.LongBits(c.sfuPush.low>>>0,c.sfuPush.high>>>0).toNumber())),c.sfuPull!=null&&($util.Long?(b.sfuPull=$util.Long.fromValue(c.sfuPull)).unsigned=!1:typeof c.sfuPull=="string"?b.sfuPull=parseInt(c.sfuPull,10):typeof c.sfuPull=="number"?b.sfuPull=c.sfuPull:typeof c.sfuPull=="object"&&(b.sfuPull=new $util.LongBits(c.sfuPull.low>>>0,c.sfuPull.high>>>0).toNumber())),b},k.toObject=function(c,b){b||(b={});let C={};return c.p2pPush!=null&&c.hasOwnProperty("p2pPush")&&(typeof c.p2pPush=="number"?C.p2pPush=b.longs===String?String(c.p2pPush):c.p2pPush:C.p2pPush=b.longs===String?$util.Long.prototype.toString.call(c.p2pPush):b.longs===Number?new $util.LongBits(c.p2pPush.low>>>0,c.p2pPush.high>>>0).toNumber():c.p2pPush,b.oneofs&&(C._p2pPush="p2pPush")),c.p2pPull!=null&&c.hasOwnProperty("p2pPull")&&(typeof c.p2pPull=="number"?C.p2pPull=b.longs===String?String(c.p2pPull):c.p2pPull:C.p2pPull=b.longs===String?$util.Long.prototype.toString.call(c.p2pPull):b.longs===Number?new $util.LongBits(c.p2pPull.low>>>0,c.p2pPull.high>>>0).toNumber():c.p2pPull,b.oneofs&&(C._p2pPull="p2pPull")),c.sfuPush!=null&&c.hasOwnProperty("sfuPush")&&(typeof c.sfuPush=="number"?C.sfuPush=b.longs===String?String(c.sfuPush):c.sfuPush:C.sfuPush=b.longs===String?$util.Long.prototype.toString.call(c.sfuPush):b.longs===Number?new $util.LongBits(c.sfuPush.low>>>0,c.sfuPush.high>>>0).toNumber():c.sfuPush,b.oneofs&&(C._sfuPush="sfuPush")),c.sfuPull!=null&&c.hasOwnProperty("sfuPull")&&(typeof c.sfuPull=="number"?C.sfuPull=b.longs===String?String(c.sfuPull):c.sfuPull:C.sfuPull=b.longs===String?$util.Long.prototype.toString.call(c.sfuPull):b.longs===Number?new $util.LongBits(c.sfuPull.low>>>0,c.sfuPull.high>>>0).toNumber():c.sfuPull,b.oneofs&&(C._sfuPull="sfuPull")),C},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/com.quick.voice.proto.ReportTrafficUsage"},k}(),A.P2PAttemptConnectReq=function(){function k(S){if(S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.userId="",k.prototype.roomId="",k.create=function(i){return new k(i)},k.encode=function(i,c){return c||(c=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&c.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&c.uint32(18).string(i.roomId),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.P2PAttemptConnectReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.userId=i.string();break}case 2:{C.roomId=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){return typeof i!="object"||i===null?"object expected":i.userId!=null&&i.hasOwnProperty("userId")&&!$util.isString(i.userId)?"userId: string expected":i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PAttemptConnectReq)return i;let c=new $root.com.quick.voice.proto.P2PAttemptConnectReq;return i.userId!=null&&(c.userId=String(i.userId)),i.roomId!=null&&(c.roomId=String(i.roomId)),c},k.toObject=function(i,c){c||(c={});let b={};return c.defaults&&(b.userId="",b.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&(b.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&(b.roomId=i.roomId),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PAttemptConnectReq"},k}(),A.CheckSessionReq=function(){function k(S){if(this.tracks=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.session="",k.prototype.tracks=$util.emptyArray,k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.session!=null&&Object.hasOwnProperty.call(i,"session")&&c.uint32(10).string(i.session),i.tracks!=null&&i.tracks.length)for(let b=0;b<i.tracks.length;++b)$root.com.quick.voice.proto.Track.encode(i.tracks[b],c.uint32(18).fork()).ldelim();return c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CheckSessionReq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.session=i.string();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session))return"session: string expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let b=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(b)return"tracks."+b}}return null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionReq)return i;let c=new $root.com.quick.voice.proto.CheckSessionReq;if(i.session!=null&&(c.session=String(i.session)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");c.tracks=[];for(let b=0;b<i.tracks.length;++b){if(typeof i.tracks[b]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");c.tracks[b]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[b])}}return c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.tracks=[]),c.defaults&&(b.session=""),i.session!=null&&i.hasOwnProperty("session")&&(b.session=i.session),i.tracks&&i.tracks.length){b.tracks=[];for(let C=0;C<i.tracks.length;++C)b.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionReq"},k}(),A.CheckSessionRsq=function(){function k(S){if(this.tracks=[],S)for(let i=Object.keys(S),c=0;c<i.length;++c)S[i[c]]!=null&&(this[i[c]]=S[i[c]])}return k.prototype.sessionIsValid=!1,k.prototype.tracks=$util.emptyArray,k.prototype.session="",k.create=function(i){return new k(i)},k.encode=function(i,c){if(c||(c=$Writer.create()),i.sessionIsValid!=null&&Object.hasOwnProperty.call(i,"sessionIsValid")&&c.uint32(8).bool(i.sessionIsValid),i.tracks!=null&&i.tracks.length)for(let b=0;b<i.tracks.length;++b)$root.com.quick.voice.proto.Track.encode(i.tracks[b],c.uint32(18).fork()).ldelim();return i.session!=null&&Object.hasOwnProperty.call(i,"session")&&c.uint32(26).string(i.session),c},k.encodeDelimited=function(i,c){return this.encode(i,c).ldelim()},k.decode=function(i,c){i instanceof $Reader||(i=$Reader.create(i));let b=c===void 0?i.len:i.pos+c,C=new $root.com.quick.voice.proto.CheckSessionRsq;for(;i.pos<b;){let N=i.uint32();switch(N>>>3){case 1:{C.sessionIsValid=i.bool();break}case 2:{C.tracks&&C.tracks.length||(C.tracks=[]),C.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{C.session=i.string();break}default:i.skipType(N&7);break}}return C},k.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},k.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&typeof i.sessionIsValid!="boolean")return"sessionIsValid: boolean expected";if(i.tracks!=null&&i.hasOwnProperty("tracks")){if(!Array.isArray(i.tracks))return"tracks: array expected";for(let c=0;c<i.tracks.length;++c){let b=$root.com.quick.voice.proto.Track.verify(i.tracks[c]);if(b)return"tracks."+b}}return i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session)?"session: string expected":null},k.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionRsq)return i;let c=new $root.com.quick.voice.proto.CheckSessionRsq;if(i.sessionIsValid!=null&&(c.sessionIsValid=!!i.sessionIsValid),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");c.tracks=[];for(let b=0;b<i.tracks.length;++b){if(typeof i.tracks[b]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");c.tracks[b]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[b])}}return i.session!=null&&(c.session=String(i.session)),c},k.toObject=function(i,c){c||(c={});let b={};if((c.arrays||c.defaults)&&(b.tracks=[]),c.defaults&&(b.sessionIsValid=!1,b.session=""),i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&(b.sessionIsValid=i.sessionIsValid),i.tracks&&i.tracks.length){b.tracks=[];for(let C=0;C<i.tracks.length;++C)b.tracks[C]=$root.com.quick.voice.proto.Track.toObject(i.tracks[C],c)}return i.session!=null&&i.hasOwnProperty("session")&&(b.session=i.session),b},k.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},k.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionRsq"},k}(),A}(),O}(),D}(),$})(),enum_notifyName={onChangeNetwork:"网络情况变更",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onIceState:"webrtc状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",onTrackInactive:"通知轨道失效",onAttemptP2PReq:"尝试与对方建立P2P连接",onOffer:"收到P2P-offer",onAnswer:"收到P2P-answer",onCandidate:"收到P2P候选信息-candidate",onUpdatePermissions:"更新推流权限通知",onTokenExpired:"Token已过期",onDestroyRoom:"直播模式房间销毁",onUpdateBehavior:"行为允许权限变更",destroyRoom:"服务器要求销毁房间",onCDNPlayUrlAdd:"cdn播放地址变化",onDestroy:"SDK销毁"};ht(enum_notifyName);const notifyName_keys=Object.keys(enum_notifyName);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1($){let D=$.length;for(;--D>=0;)$[D]=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($,D,O,A,k){this.static_tree=$,this.extra_bits=D,this.extra_base=O,this.elems=A,this.max_length=k,this.has_stree=$&&$.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc($,D){this.dyn_tree=$,this.max_code=0,this.stat_desc=D}const d_code=$=>$<256?_dist_code[$]:_dist_code[256+($>>>7)],put_short=($,D)=>{$.pending_buf[$.pending++]=D&255,$.pending_buf[$.pending++]=D>>>8&255},send_bits=($,D,O)=>{$.bi_valid>Buf_size-O?($.bi_buf|=D<<$.bi_valid&65535,put_short($,$.bi_buf),$.bi_buf=D>>Buf_size-$.bi_valid,$.bi_valid+=O-Buf_size):($.bi_buf|=D<<$.bi_valid&65535,$.bi_valid+=O)},send_code=($,D,O)=>{send_bits($,O[D*2],O[D*2+1])},bi_reverse=($,D)=>{let O=0;do O|=$&1,$>>>=1,O<<=1;while(--D>0);return O>>>1},bi_flush=$=>{$.bi_valid===16?(put_short($,$.bi_buf),$.bi_buf=0,$.bi_valid=0):$.bi_valid>=8&&($.pending_buf[$.pending++]=$.bi_buf&255,$.bi_buf>>=8,$.bi_valid-=8)},gen_bitlen=($,D)=>{const O=D.dyn_tree,A=D.max_code,k=D.stat_desc.static_tree,S=D.stat_desc.has_stree,i=D.stat_desc.extra_bits,c=D.stat_desc.extra_base,b=D.stat_desc.max_length;let C,N,j,Z,z,K,te=0;for(Z=0;Z<=MAX_BITS$1;Z++)$.bl_count[Z]=0;for(O[$.heap[$.heap_max]*2+1]=0,C=$.heap_max+1;C<HEAP_SIZE$1;C++)N=$.heap[C],Z=O[O[N*2+1]*2+1]+1,Z>b&&(Z=b,te++),O[N*2+1]=Z,!(N>A)&&($.bl_count[Z]++,z=0,N>=c&&(z=i[N-c]),K=O[N*2],$.opt_len+=K*(Z+z),S&&($.static_len+=K*(k[N*2+1]+z)));if(te!==0){do{for(Z=b-1;$.bl_count[Z]===0;)Z--;$.bl_count[Z]--,$.bl_count[Z+1]+=2,$.bl_count[b]--,te-=2}while(te>0);for(Z=b;Z!==0;Z--)for(N=$.bl_count[Z];N!==0;)j=$.heap[--C],!(j>A)&&(O[j*2+1]!==Z&&($.opt_len+=(Z-O[j*2+1])*O[j*2],O[j*2+1]=Z),N--)}},gen_codes=($,D,O)=>{const A=new Array(MAX_BITS$1+1);let k=0,S,i;for(S=1;S<=MAX_BITS$1;S++)k=k+O[S-1]<<1,A[S]=k;for(i=0;i<=D;i++){let c=$[i*2+1];c!==0&&($[i*2]=bi_reverse(A[c]++,c))}},tr_static_init=()=>{let $,D,O,A,k;const S=new Array(MAX_BITS$1+1);for(O=0,A=0;A<LENGTH_CODES$1-1;A++)for(base_length[A]=O,$=0;$<1<<extra_lbits[A];$++)_length_code[O++]=A;for(_length_code[O-1]=A,k=0,A=0;A<16;A++)for(base_dist[A]=k,$=0;$<1<<extra_dbits[A];$++)_dist_code[k++]=A;for(k>>=7;A<D_CODES$1;A++)for(base_dist[A]=k<<7,$=0;$<1<<extra_dbits[A]-7;$++)_dist_code[256+k++]=A;for(D=0;D<=MAX_BITS$1;D++)S[D]=0;for($=0;$<=143;)static_ltree[$*2+1]=8,$++,S[8]++;for(;$<=255;)static_ltree[$*2+1]=9,$++,S[9]++;for(;$<=279;)static_ltree[$*2+1]=7,$++,S[7]++;for(;$<=287;)static_ltree[$*2+1]=8,$++,S[8]++;for(gen_codes(static_ltree,L_CODES$1+1,S),$=0;$<D_CODES$1;$++)static_dtree[$*2+1]=5,static_dtree[$*2]=bi_reverse($,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=$=>{let D;for(D=0;D<L_CODES$1;D++)$.dyn_ltree[D*2]=0;for(D=0;D<D_CODES$1;D++)$.dyn_dtree[D*2]=0;for(D=0;D<BL_CODES$1;D++)$.bl_tree[D*2]=0;$.dyn_ltree[END_BLOCK*2]=1,$.opt_len=$.static_len=0,$.sym_next=$.matches=0},bi_windup=$=>{$.bi_valid>8?put_short($,$.bi_buf):$.bi_valid>0&&($.pending_buf[$.pending++]=$.bi_buf),$.bi_buf=0,$.bi_valid=0},smaller=($,D,O,A)=>{const k=D*2,S=O*2;return $[k]<$[S]||$[k]===$[S]&&A[D]<=A[O]},pqdownheap=($,D,O)=>{const A=$.heap[O];let k=O<<1;for(;k<=$.heap_len&&(k<$.heap_len&&smaller(D,$.heap[k+1],$.heap[k],$.depth)&&k++,!smaller(D,A,$.heap[k],$.depth));)$.heap[O]=$.heap[k],O=k,k<<=1;$.heap[O]=A},compress_block=($,D,O)=>{let A,k,S=0,i,c;if($.sym_next!==0)do A=$.pending_buf[$.sym_buf+S++]&255,A+=($.pending_buf[$.sym_buf+S++]&255)<<8,k=$.pending_buf[$.sym_buf+S++],A===0?send_code($,k,D):(i=_length_code[k],send_code($,i+LITERALS$1+1,D),c=extra_lbits[i],c!==0&&(k-=base_length[i],send_bits($,k,c)),A--,i=d_code(A),send_code($,i,O),c=extra_dbits[i],c!==0&&(A-=base_dist[i],send_bits($,A,c)));while(S<$.sym_next);send_code($,END_BLOCK,D)},build_tree=($,D)=>{const O=D.dyn_tree,A=D.stat_desc.static_tree,k=D.stat_desc.has_stree,S=D.stat_desc.elems;let i,c,b=-1,C;for($.heap_len=0,$.heap_max=HEAP_SIZE$1,i=0;i<S;i++)O[i*2]!==0?($.heap[++$.heap_len]=b=i,$.depth[i]=0):O[i*2+1]=0;for(;$.heap_len<2;)C=$.heap[++$.heap_len]=b<2?++b:0,O[C*2]=1,$.depth[C]=0,$.opt_len--,k&&($.static_len-=A[C*2+1]);for(D.max_code=b,i=$.heap_len>>1;i>=1;i--)pqdownheap($,O,i);C=S;do i=$.heap[1],$.heap[1]=$.heap[$.heap_len--],pqdownheap($,O,1),c=$.heap[1],$.heap[--$.heap_max]=i,$.heap[--$.heap_max]=c,O[C*2]=O[i*2]+O[c*2],$.depth[C]=($.depth[i]>=$.depth[c]?$.depth[i]:$.depth[c])+1,O[i*2+1]=O[c*2+1]=C,$.heap[1]=C++,pqdownheap($,O,1);while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],gen_bitlen($,D),gen_codes(O,b,$.bl_count)},scan_tree=($,D,O)=>{let A,k=-1,S,i=D[1],c=0,b=7,C=4;for(i===0&&(b=138,C=3),D[(O+1)*2+1]=65535,A=0;A<=O;A++)S=i,i=D[(A+1)*2+1],!(++c<b&&S===i)&&(c<C?$.bl_tree[S*2]+=c:S!==0?(S!==k&&$.bl_tree[S*2]++,$.bl_tree[REP_3_6*2]++):c<=10?$.bl_tree[REPZ_3_10*2]++:$.bl_tree[REPZ_11_138*2]++,c=0,k=S,i===0?(b=138,C=3):S===i?(b=6,C=3):(b=7,C=4))},send_tree=($,D,O)=>{let A,k=-1,S,i=D[1],c=0,b=7,C=4;for(i===0&&(b=138,C=3),A=0;A<=O;A++)if(S=i,i=D[(A+1)*2+1],!(++c<b&&S===i)){if(c<C)do send_code($,S,$.bl_tree);while(--c!==0);else S!==0?(S!==k&&(send_code($,S,$.bl_tree),c--),send_code($,REP_3_6,$.bl_tree),send_bits($,c-3,2)):c<=10?(send_code($,REPZ_3_10,$.bl_tree),send_bits($,c-3,3)):(send_code($,REPZ_11_138,$.bl_tree),send_bits($,c-11,7));c=0,k=S,i===0?(b=138,C=3):S===i?(b=6,C=3):(b=7,C=4)}},build_bl_tree=$=>{let D;for(scan_tree($,$.dyn_ltree,$.l_desc.max_code),scan_tree($,$.dyn_dtree,$.d_desc.max_code),build_tree($,$.bl_desc),D=BL_CODES$1-1;D>=3&&$.bl_tree[bl_order[D]*2+1]===0;D--);return $.opt_len+=3*(D+1)+5+5+4,D},send_all_trees=($,D,O,A)=>{let k;for(send_bits($,D-257,5),send_bits($,O-1,5),send_bits($,A-4,4),k=0;k<A;k++)send_bits($,$.bl_tree[bl_order[k]*2+1],3);send_tree($,$.dyn_ltree,D-1),send_tree($,$.dyn_dtree,O-1)},detect_data_type=$=>{let D=4093624447,O;for(O=0;O<=31;O++,D>>>=1)if(D&1&&$.dyn_ltree[O*2]!==0)return Z_BINARY;if($.dyn_ltree[18]!==0||$.dyn_ltree[20]!==0||$.dyn_ltree[26]!==0)return Z_TEXT;for(O=32;O<LITERALS$1;O++)if($.dyn_ltree[O*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=$=>{static_init_done||(tr_static_init(),static_init_done=!0),$.l_desc=new TreeDesc($.dyn_ltree,static_l_desc),$.d_desc=new TreeDesc($.dyn_dtree,static_d_desc),$.bl_desc=new TreeDesc($.bl_tree,static_bl_desc),$.bi_buf=0,$.bi_valid=0,init_block($)},_tr_stored_block$1=($,D,O,A)=>{send_bits($,(STORED_BLOCK<<1)+(A?1:0),3),bi_windup($),put_short($,O),put_short($,~O),O&&$.pending_buf.set($.window.subarray(D,D+O),$.pending),$.pending+=O},_tr_align$1=$=>{send_bits($,STATIC_TREES<<1,3),send_code($,END_BLOCK,static_ltree),bi_flush($)},_tr_flush_block$1=($,D,O,A)=>{let k,S,i=0;$.level>0?($.strm.data_type===Z_UNKNOWN$1&&($.strm.data_type=detect_data_type($)),build_tree($,$.l_desc),build_tree($,$.d_desc),i=build_bl_tree($),k=$.opt_len+3+7>>>3,S=$.static_len+3+7>>>3,S<=k&&(k=S)):k=S=O+5,O+4<=k&&D!==-1?_tr_stored_block$1($,D,O,A):$.strategy===Z_FIXED$1||S===k?(send_bits($,(STATIC_TREES<<1)+(A?1:0),3),compress_block($,static_ltree,static_dtree)):(send_bits($,(DYN_TREES<<1)+(A?1:0),3),send_all_trees($,$.l_desc.max_code+1,$.d_desc.max_code+1,i+1),compress_block($,$.dyn_ltree,$.dyn_dtree)),init_block($),A&&bi_windup($)},_tr_tally$1=($,D,O)=>($.pending_buf[$.sym_buf+$.sym_next++]=D,$.pending_buf[$.sym_buf+$.sym_next++]=D>>8,$.pending_buf[$.sym_buf+$.sym_next++]=O,D===0?$.dyn_ltree[O*2]++:($.matches++,D--,$.dyn_ltree[(_length_code[O]+LITERALS$1+1)*2]++,$.dyn_dtree[d_code(D)*2]++),$.sym_next===$.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=($,D,O,A)=>{let k=$&65535|0,S=$>>>16&65535|0,i=0;for(;O!==0;){i=O>2e3?2e3:O,O-=i;do k=k+D[A++]|0,S=S+k|0;while(--i);k%=65521,S%=65521}return k|S<<16|0};var adler32_1=adler32;const makeTable=()=>{let $,D=[];for(var O=0;O<256;O++){$=O;for(var A=0;A<8;A++)$=$&1?3988292384^$>>>1:$>>>1;D[O]=$}return D},crcTable=new Uint32Array(makeTable()),crc32=($,D,O,A)=>{const k=crcTable,S=A+O;$^=-1;for(let i=A;i<S;i++)$=$>>>8^k[($^D[i])&255];return $^-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=($,D)=>($.msg=messages[D],D),rank=$=>$*2-($>4?9:0),zero=$=>{let D=$.length;for(;--D>=0;)$[D]=0},slide_hash=$=>{let D,O,A,k=$.w_size;D=$.hash_size,A=D;do O=$.head[--A],$.head[A]=O>=k?O-k:0;while(--D);D=k,A=D;do O=$.prev[--A],$.prev[A]=O>=k?O-k:0;while(--D)};let HASH_ZLIB=($,D,O)=>(D<<$.hash_shift^O)&$.hash_mask,HASH=HASH_ZLIB;const flush_pending=$=>{const D=$.state;let O=D.pending;O>$.avail_out&&(O=$.avail_out),O!==0&&($.output.set(D.pending_buf.subarray(D.pending_out,D.pending_out+O),$.next_out),$.next_out+=O,D.pending_out+=O,$.total_out+=O,$.avail_out-=O,D.pending-=O,D.pending===0&&(D.pending_out=0))},flush_block_only=($,D)=>{_tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,D),$.block_start=$.strstart,flush_pending($.strm)},put_byte=($,D)=>{$.pending_buf[$.pending++]=D},putShortMSB=($,D)=>{$.pending_buf[$.pending++]=D>>>8&255,$.pending_buf[$.pending++]=D&255},read_buf=($,D,O,A)=>{let k=$.avail_in;return k>A&&(k=A),k===0?0:($.avail_in-=k,D.set($.input.subarray($.next_in,$.next_in+k),O),$.state.wrap===1?$.adler=adler32_1($.adler,D,k,O):$.state.wrap===2&&($.adler=crc32_1($.adler,D,k,O)),$.next_in+=k,$.total_in+=k,k)},longest_match=($,D)=>{let O=$.max_chain_length,A=$.strstart,k,S,i=$.prev_length,c=$.nice_match;const b=$.strstart>$.w_size-MIN_LOOKAHEAD?$.strstart-($.w_size-MIN_LOOKAHEAD):0,C=$.window,N=$.w_mask,j=$.prev,Z=$.strstart+MAX_MATCH;let z=C[A+i-1],K=C[A+i];$.prev_length>=$.good_match&&(O>>=2),c>$.lookahead&&(c=$.lookahead);do if(k=D,!(C[k+i]!==K||C[k+i-1]!==z||C[k]!==C[A]||C[++k]!==C[A+1])){A+=2,k++;do;while(C[++A]===C[++k]&&C[++A]===C[++k]&&C[++A]===C[++k]&&C[++A]===C[++k]&&C[++A]===C[++k]&&C[++A]===C[++k]&&C[++A]===C[++k]&&C[++A]===C[++k]&&A<Z);if(S=MAX_MATCH-(Z-A),A=Z-MAX_MATCH,S>i){if($.match_start=D,i=S,S>=c)break;z=C[A+i-1],K=C[A+i]}}while((D=j[D&N])>b&&--O!==0);return i<=$.lookahead?i:$.lookahead},fill_window=$=>{const D=$.w_size;let O,A,k;do{if(A=$.window_size-$.lookahead-$.strstart,$.strstart>=D+(D-MIN_LOOKAHEAD)&&($.window.set($.window.subarray(D,D+D-A),0),$.match_start-=D,$.strstart-=D,$.block_start-=D,$.insert>$.strstart&&($.insert=$.strstart),slide_hash($),A+=D),$.strm.avail_in===0)break;if(O=read_buf($.strm,$.window,$.strstart+$.lookahead,A),$.lookahead+=O,$.lookahead+$.insert>=MIN_MATCH)for(k=$.strstart-$.insert,$.ins_h=$.window[k],$.ins_h=HASH($,$.ins_h,$.window[k+1]);$.insert&&($.ins_h=HASH($,$.ins_h,$.window[k+MIN_MATCH-1]),$.prev[k&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=k,k++,$.insert--,!($.lookahead+$.insert<MIN_MATCH)););}while($.lookahead<MIN_LOOKAHEAD&&$.strm.avail_in!==0)},deflate_stored=($,D)=>{let O=$.pending_buf_size-5>$.w_size?$.w_size:$.pending_buf_size-5,A,k,S,i=0,c=$.strm.avail_in;do{if(A=65535,S=$.bi_valid+42>>3,$.strm.avail_out<S||(S=$.strm.avail_out-S,k=$.strstart-$.block_start,A>k+$.strm.avail_in&&(A=k+$.strm.avail_in),A>S&&(A=S),A<O&&(A===0&&D!==Z_FINISH$3||D===Z_NO_FLUSH$2||A!==k+$.strm.avail_in)))break;i=D===Z_FINISH$3&&A===k+$.strm.avail_in?1:0,_tr_stored_block($,0,0,i),$.pending_buf[$.pending-4]=A,$.pending_buf[$.pending-3]=A>>8,$.pending_buf[$.pending-2]=~A,$.pending_buf[$.pending-1]=~A>>8,flush_pending($.strm),k&&(k>A&&(k=A),$.strm.output.set($.window.subarray($.block_start,$.block_start+k),$.strm.next_out),$.strm.next_out+=k,$.strm.avail_out-=k,$.strm.total_out+=k,$.block_start+=k,A-=k),A&&(read_buf($.strm,$.strm.output,$.strm.next_out,A),$.strm.next_out+=A,$.strm.avail_out-=A,$.strm.total_out+=A)}while(i===0);return c-=$.strm.avail_in,c&&(c>=$.w_size?($.matches=2,$.window.set($.strm.input.subarray($.strm.next_in-$.w_size,$.strm.next_in),0),$.strstart=$.w_size,$.insert=$.strstart):($.window_size-$.strstart<=c&&($.strstart-=$.w_size,$.window.set($.window.subarray($.w_size,$.w_size+$.strstart),0),$.matches<2&&$.matches++,$.insert>$.strstart&&($.insert=$.strstart)),$.window.set($.strm.input.subarray($.strm.next_in-c,$.strm.next_in),$.strstart),$.strstart+=c,$.insert+=c>$.w_size-$.insert?$.w_size-$.insert:c),$.block_start=$.strstart),$.high_water<$.strstart&&($.high_water=$.strstart),i?BS_FINISH_DONE:D!==Z_NO_FLUSH$2&&D!==Z_FINISH$3&&$.strm.avail_in===0&&$.strstart===$.block_start?BS_BLOCK_DONE:(S=$.window_size-$.strstart,$.strm.avail_in>S&&$.block_start>=$.w_size&&($.block_start-=$.w_size,$.strstart-=$.w_size,$.window.set($.window.subarray($.w_size,$.w_size+$.strstart),0),$.matches<2&&$.matches++,S+=$.w_size,$.insert>$.strstart&&($.insert=$.strstart)),S>$.strm.avail_in&&(S=$.strm.avail_in),S&&(read_buf($.strm,$.window,$.strstart,S),$.strstart+=S,$.insert+=S>$.w_size-$.insert?$.w_size-$.insert:S),$.high_water<$.strstart&&($.high_water=$.strstart),S=$.bi_valid+42>>3,S=$.pending_buf_size-S>65535?65535:$.pending_buf_size-S,O=S>$.w_size?$.w_size:S,k=$.strstart-$.block_start,(k>=O||(k||D===Z_FINISH$3)&&D!==Z_NO_FLUSH$2&&$.strm.avail_in===0&&k<=S)&&(A=k>S?S:k,i=D===Z_FINISH$3&&$.strm.avail_in===0&&A===k?1:0,_tr_stored_block($,$.block_start,A,i),$.block_start+=A,flush_pending($.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=($,D)=>{let O,A;for(;;){if($.lookahead<MIN_LOOKAHEAD){if(fill_window($),$.lookahead<MIN_LOOKAHEAD&&D===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if(O=0,$.lookahead>=MIN_MATCH&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),O!==0&&$.strstart-O<=$.w_size-MIN_LOOKAHEAD&&($.match_length=longest_match($,O)),$.match_length>=MIN_MATCH)if(A=_tr_tally($,$.strstart-$.match_start,$.match_length-MIN_MATCH),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=MIN_MATCH){$.match_length--;do $.strstart++,$.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart;while(--$.match_length!==0);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=HASH($,$.ins_h,$.window[$.strstart+1]);else A=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(A&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=$.strstart<MIN_MATCH-1?$.strstart:MIN_MATCH-1,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=($,D)=>{let O,A,k;for(;;){if($.lookahead<MIN_LOOKAHEAD){if(fill_window($),$.lookahead<MIN_LOOKAHEAD&&D===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if(O=0,$.lookahead>=MIN_MATCH&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),$.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=MIN_MATCH-1,O!==0&&$.prev_length<$.max_lazy_match&&$.strstart-O<=$.w_size-MIN_LOOKAHEAD&&($.match_length=longest_match($,O),$.match_length<=5&&($.strategy===Z_FILTERED||$.match_length===MIN_MATCH&&$.strstart-$.match_start>4096)&&($.match_length=MIN_MATCH-1)),$.prev_length>=MIN_MATCH&&$.match_length<=$.prev_length){k=$.strstart+$.lookahead-MIN_MATCH,A=_tr_tally($,$.strstart-1-$.prev_match,$.prev_length-MIN_MATCH),$.lookahead-=$.prev_length-1,$.prev_length-=2;do++$.strstart<=k&&($.ins_h=HASH($,$.ins_h,$.window[$.strstart+MIN_MATCH-1]),O=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart);while(--$.prev_length!==0);if($.match_available=0,$.match_length=MIN_MATCH-1,$.strstart++,A&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}else if($.match_available){if(A=_tr_tally($,0,$.window[$.strstart-1]),A&&flush_block_only($,!1),$.strstart++,$.lookahead--,$.strm.avail_out===0)return BS_NEED_MORE}else $.match_available=1,$.strstart++,$.lookahead--}return $.match_available&&(A=_tr_tally($,0,$.window[$.strstart-1]),$.match_available=0),$.insert=$.strstart<MIN_MATCH-1?$.strstart:MIN_MATCH-1,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=($,D)=>{let O,A,k,S;const i=$.window;for(;;){if($.lookahead<=MAX_MATCH){if(fill_window($),$.lookahead<=MAX_MATCH&&D===Z_NO_FLUSH$2)return BS_NEED_MORE;if($.lookahead===0)break}if($.match_length=0,$.lookahead>=MIN_MATCH&&$.strstart>0&&(k=$.strstart-1,A=i[k],A===i[++k]&&A===i[++k]&&A===i[++k])){S=$.strstart+MAX_MATCH;do;while(A===i[++k]&&A===i[++k]&&A===i[++k]&&A===i[++k]&&A===i[++k]&&A===i[++k]&&A===i[++k]&&A===i[++k]&&k<S);$.match_length=MAX_MATCH-(S-k),$.match_length>$.lookahead&&($.match_length=$.lookahead)}if($.match_length>=MIN_MATCH?(O=_tr_tally($,1,$.match_length-MIN_MATCH),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0):(O=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++),O&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=0,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=($,D)=>{let O;for(;;){if($.lookahead===0&&(fill_window($),$.lookahead===0)){if(D===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if($.match_length=0,O=_tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,O&&(flush_block_only($,!1),$.strm.avail_out===0))return BS_NEED_MORE}return $.insert=0,D===Z_FINISH$3?(flush_block_only($,!0),$.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):$.sym_next&&(flush_block_only($,!1),$.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config($,D,O,A,k){this.good_length=$,this.max_lazy=D,this.nice_length=O,this.max_chain=A,this.func=k}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=$=>{$.window_size=2*$.w_size,zero($.head),$.max_lazy_match=configuration_table[$.level].max_lazy,$.good_match=configuration_table[$.level].good_length,$.nice_match=configuration_table[$.level].nice_length,$.max_chain_length=configuration_table[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=MIN_MATCH-1,$.match_available=0,$.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=$=>{if(!$)return 1;const D=$.state;return!D||D.strm!==$||D.status!==INIT_STATE&&D.status!==GZIP_STATE&&D.status!==EXTRA_STATE&&D.status!==NAME_STATE&&D.status!==COMMENT_STATE&&D.status!==HCRC_STATE&&D.status!==BUSY_STATE&&D.status!==FINISH_STATE?1:0},deflateResetKeep=$=>{if(deflateStateCheck($))return err($,Z_STREAM_ERROR$2);$.total_in=$.total_out=0,$.data_type=Z_UNKNOWN;const D=$.state;return D.pending=0,D.pending_out=0,D.wrap<0&&(D.wrap=-D.wrap),D.status=D.wrap===2?GZIP_STATE:D.wrap?INIT_STATE:BUSY_STATE,$.adler=D.wrap===2?0:1,D.last_flush=-2,_tr_init(D),Z_OK$3},deflateReset=$=>{const D=deflateResetKeep($);return D===Z_OK$3&&lm_init($.state),D},deflateSetHeader=($,D)=>deflateStateCheck($)||$.state.wrap!==2?Z_STREAM_ERROR$2:($.state.gzhead=D,Z_OK$3),deflateInit2=($,D,O,A,k,S)=>{if(!$)return Z_STREAM_ERROR$2;let i=1;if(D===Z_DEFAULT_COMPRESSION$1&&(D=6),A<0?(i=0,A=-A):A>15&&(i=2,A-=16),k<1||k>MAX_MEM_LEVEL||O!==Z_DEFLATED$2||A<8||A>15||D<0||D>9||S<0||S>Z_FIXED||A===8&&i!==1)return err($,Z_STREAM_ERROR$2);A===8&&(A=9);const c=new DeflateState;return $.state=c,c.strm=$,c.status=INIT_STATE,c.wrap=i,c.gzhead=null,c.w_bits=A,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=k+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+MIN_MATCH-1)/MIN_MATCH),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<k+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=D,c.strategy=S,c.method=O,deflateReset($)},deflateInit=($,D)=>deflateInit2($,D,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=($,D)=>{if(deflateStateCheck($)||D>Z_BLOCK$1||D<0)return $?err($,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const O=$.state;if(!$.output||$.avail_in!==0&&!$.input||O.status===FINISH_STATE&&D!==Z_FINISH$3)return err($,$.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const A=O.last_flush;if(O.last_flush=D,O.pending!==0){if(flush_pending($),$.avail_out===0)return O.last_flush=-1,Z_OK$3}else if($.avail_in===0&&rank(D)<=rank(A)&&D!==Z_FINISH$3)return err($,Z_BUF_ERROR$1);if(O.status===FINISH_STATE&&$.avail_in!==0)return err($,Z_BUF_ERROR$1);if(O.status===INIT_STATE&&O.wrap===0&&(O.status=BUSY_STATE),O.status===INIT_STATE){let k=Z_DEFLATED$2+(O.w_bits-8<<4)<<8,S=-1;if(O.strategy>=Z_HUFFMAN_ONLY||O.level<2?S=0:O.level<6?S=1:O.level===6?S=2:S=3,k|=S<<6,O.strstart!==0&&(k|=PRESET_DICT),k+=31-k%31,putShortMSB(O,k),O.strstart!==0&&(putShortMSB(O,$.adler>>>16),putShortMSB(O,$.adler&65535)),$.adler=1,O.status=BUSY_STATE,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3}if(O.status===GZIP_STATE){if($.adler=0,put_byte(O,31),put_byte(O,139),put_byte(O,8),O.gzhead)put_byte(O,(O.gzhead.text?1:0)+(O.gzhead.hcrc?2:0)+(O.gzhead.extra?4:0)+(O.gzhead.name?8:0)+(O.gzhead.comment?16:0)),put_byte(O,O.gzhead.time&255),put_byte(O,O.gzhead.time>>8&255),put_byte(O,O.gzhead.time>>16&255),put_byte(O,O.gzhead.time>>24&255),put_byte(O,O.level===9?2:O.strategy>=Z_HUFFMAN_ONLY||O.level<2?4:0),put_byte(O,O.gzhead.os&255),O.gzhead.extra&&O.gzhead.extra.length&&(put_byte(O,O.gzhead.extra.length&255),put_byte(O,O.gzhead.extra.length>>8&255)),O.gzhead.hcrc&&($.adler=crc32_1($.adler,O.pending_buf,O.pending,0)),O.gzindex=0,O.status=EXTRA_STATE;else if(put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,0),put_byte(O,O.level===9?2:O.strategy>=Z_HUFFMAN_ONLY||O.level<2?4:0),put_byte(O,OS_CODE),O.status=BUSY_STATE,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3}if(O.status===EXTRA_STATE){if(O.gzhead.extra){let k=O.pending,S=(O.gzhead.extra.length&65535)-O.gzindex;for(;O.pending+S>O.pending_buf_size;){let c=O.pending_buf_size-O.pending;if(O.pending_buf.set(O.gzhead.extra.subarray(O.gzindex,O.gzindex+c),O.pending),O.pending=O.pending_buf_size,O.gzhead.hcrc&&O.pending>k&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-k,k)),O.gzindex+=c,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3;k=0,S-=c}let i=new Uint8Array(O.gzhead.extra);O.pending_buf.set(i.subarray(O.gzindex,O.gzindex+S),O.pending),O.pending+=S,O.gzhead.hcrc&&O.pending>k&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-k,k)),O.gzindex=0}O.status=NAME_STATE}if(O.status===NAME_STATE){if(O.gzhead.name){let k=O.pending,S;do{if(O.pending===O.pending_buf_size){if(O.gzhead.hcrc&&O.pending>k&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-k,k)),flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3;k=0}O.gzindex<O.gzhead.name.length?S=O.gzhead.name.charCodeAt(O.gzindex++)&255:S=0,put_byte(O,S)}while(S!==0);O.gzhead.hcrc&&O.pending>k&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-k,k)),O.gzindex=0}O.status=COMMENT_STATE}if(O.status===COMMENT_STATE){if(O.gzhead.comment){let k=O.pending,S;do{if(O.pending===O.pending_buf_size){if(O.gzhead.hcrc&&O.pending>k&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-k,k)),flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3;k=0}O.gzindex<O.gzhead.comment.length?S=O.gzhead.comment.charCodeAt(O.gzindex++)&255:S=0,put_byte(O,S)}while(S!==0);O.gzhead.hcrc&&O.pending>k&&($.adler=crc32_1($.adler,O.pending_buf,O.pending-k,k))}O.status=HCRC_STATE}if(O.status===HCRC_STATE){if(O.gzhead.hcrc){if(O.pending+2>O.pending_buf_size&&(flush_pending($),O.pending!==0))return O.last_flush=-1,Z_OK$3;put_byte(O,$.adler&255),put_byte(O,$.adler>>8&255),$.adler=0}if(O.status=BUSY_STATE,flush_pending($),O.pending!==0)return O.last_flush=-1,Z_OK$3}if($.avail_in!==0||O.lookahead!==0||D!==Z_NO_FLUSH$2&&O.status!==FINISH_STATE){let k=O.level===0?deflate_stored(O,D):O.strategy===Z_HUFFMAN_ONLY?deflate_huff(O,D):O.strategy===Z_RLE?deflate_rle(O,D):configuration_table[O.level].func(O,D);if((k===BS_FINISH_STARTED||k===BS_FINISH_DONE)&&(O.status=FINISH_STATE),k===BS_NEED_MORE||k===BS_FINISH_STARTED)return $.avail_out===0&&(O.last_flush=-1),Z_OK$3;if(k===BS_BLOCK_DONE&&(D===Z_PARTIAL_FLUSH?_tr_align(O):D!==Z_BLOCK$1&&(_tr_stored_block(O,0,0,!1),D===Z_FULL_FLUSH$1&&(zero(O.head),O.lookahead===0&&(O.strstart=0,O.block_start=0,O.insert=0))),flush_pending($),$.avail_out===0))return O.last_flush=-1,Z_OK$3}return D!==Z_FINISH$3?Z_OK$3:O.wrap<=0?Z_STREAM_END$3:(O.wrap===2?(put_byte(O,$.adler&255),put_byte(O,$.adler>>8&255),put_byte(O,$.adler>>16&255),put_byte(O,$.adler>>24&255),put_byte(O,$.total_in&255),put_byte(O,$.total_in>>8&255),put_byte(O,$.total_in>>16&255),put_byte(O,$.total_in>>24&255)):(putShortMSB(O,$.adler>>>16),putShortMSB(O,$.adler&65535)),flush_pending($),O.wrap>0&&(O.wrap=-O.wrap),O.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=$=>{if(deflateStateCheck($))return Z_STREAM_ERROR$2;const D=$.state.status;return $.state=null,D===BUSY_STATE?err($,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=($,D)=>{let O=D.length;if(deflateStateCheck($))return Z_STREAM_ERROR$2;const A=$.state,k=A.wrap;if(k===2||k===1&&A.status!==INIT_STATE||A.lookahead)return Z_STREAM_ERROR$2;if(k===1&&($.adler=adler32_1($.adler,D,O,0)),A.wrap=0,O>=A.w_size){k===0&&(zero(A.head),A.strstart=0,A.block_start=0,A.insert=0);let b=new Uint8Array(A.w_size);b.set(D.subarray(O-A.w_size,O),0),D=b,O=A.w_size}const S=$.avail_in,i=$.next_in,c=$.input;for($.avail_in=O,$.next_in=0,$.input=D,fill_window(A);A.lookahead>=MIN_MATCH;){let b=A.strstart,C=A.lookahead-(MIN_MATCH-1);do A.ins_h=HASH(A,A.ins_h,A.window[b+MIN_MATCH-1]),A.prev[b&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=b,b++;while(--C);A.strstart=b,A.lookahead=MIN_MATCH-1,fill_window(A)}return A.strstart+=A.lookahead,A.block_start=A.strstart,A.insert=A.lookahead,A.lookahead=0,A.match_length=A.prev_length=MIN_MATCH-1,A.match_available=0,$.next_in=i,$.input=c,$.avail_in=S,A.wrap=k,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=($,D)=>Object.prototype.hasOwnProperty.call($,D);var assign=function($){const D=Array.prototype.slice.call(arguments,1);for(;D.length;){const O=D.shift();if(O){if(typeof O!="object")throw new TypeError(O+"must be non-object");for(const A in O)_has(O,A)&&($[A]=O[A])}}return $},flattenChunks=$=>{let D=0;for(let A=0,k=$.length;A<k;A++)D+=$[A].length;const O=new Uint8Array(D);for(let A=0,k=0,S=$.length;A<S;A++){let i=$[A];O.set(i,k),k+=i.length}return O},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch($){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let $=0;$<256;$++)_utf8len[$]=$>=252?6:$>=248?5:$>=240?4:$>=224?3:$>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=$=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode($);let D,O,A,k,S,i=$.length,c=0;for(k=0;k<i;k++)O=$.charCodeAt(k),(O&64512)===55296&&k+1<i&&(A=$.charCodeAt(k+1),(A&64512)===56320&&(O=65536+(O-55296<<10)+(A-56320),k++)),c+=O<128?1:O<2048?2:O<65536?3:4;for(D=new Uint8Array(c),S=0,k=0;S<c;k++)O=$.charCodeAt(k),(O&64512)===55296&&k+1<i&&(A=$.charCodeAt(k+1),(A&64512)===56320&&(O=65536+(O-55296<<10)+(A-56320),k++)),O<128?D[S++]=O:O<2048?(D[S++]=192|O>>>6,D[S++]=128|O&63):O<65536?(D[S++]=224|O>>>12,D[S++]=128|O>>>6&63,D[S++]=128|O&63):(D[S++]=240|O>>>18,D[S++]=128|O>>>12&63,D[S++]=128|O>>>6&63,D[S++]=128|O&63);return D};const buf2binstring=($,D)=>{if(D<65534&&$.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,$.length===D?$:$.subarray(0,D));let O="";for(let A=0;A<D;A++)O+=String.fromCharCode($[A]);return O};var buf2string=($,D)=>{const O=D||$.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode($.subarray(0,D));let A,k;const S=new Array(O*2);for(k=0,A=0;A<O;){let i=$[A++];if(i<128){S[k++]=i;continue}let c=_utf8len[i];if(c>4){S[k++]=65533,A+=c-1;continue}for(i&=c===2?31:c===3?15:7;c>1&&A<O;)i=i<<6|$[A++]&63,c--;if(c>1){S[k++]=65533;continue}i<65536?S[k++]=i:(i-=65536,S[k++]=55296|i>>10&1023,S[k++]=56320|i&1023)}return buf2binstring(S,k)},utf8border=($,D)=>{D=D||$.length,D>$.length&&(D=$.length);let O=D-1;for(;O>=0&&($[O]&192)===128;)O--;return O<0||O===0?D:O+_utf8len[$[O]]>D?O:D},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($){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},$||{});let D=this.options;D.raw&&D.windowBits>0?D.windowBits=-D.windowBits:D.gzip&&D.windowBits>0&&D.windowBits<16&&(D.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let O=deflate_1$2.deflateInit2(this.strm,D.level,D.method,D.windowBits,D.memLevel,D.strategy);if(O!==Z_OK$2)throw new Error(messages[O]);if(D.header&&deflate_1$2.deflateSetHeader(this.strm,D.header),D.dictionary){let A;if(typeof D.dictionary=="string"?A=strings.string2buf(D.dictionary):toString$1.call(D.dictionary)==="[object ArrayBuffer]"?A=new Uint8Array(D.dictionary):A=D.dictionary,O=deflate_1$2.deflateSetDictionary(this.strm,A),O!==Z_OK$2)throw new Error(messages[O]);this._dict_set=!0}}Deflate$1.prototype.push=function($,D){const O=this.strm,A=this.options.chunkSize;let k,S;if(this.ended)return!1;for(D===~~D?S=D:S=D===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof $=="string"?O.input=strings.string2buf($):toString$1.call($)==="[object ArrayBuffer]"?O.input=new Uint8Array($):O.input=$,O.next_in=0,O.avail_in=O.input.length;;){if(O.avail_out===0&&(O.output=new Uint8Array(A),O.next_out=0,O.avail_out=A),(S===Z_SYNC_FLUSH||S===Z_FULL_FLUSH)&&O.avail_out<=6){this.onData(O.output.subarray(0,O.next_out)),O.avail_out=0;continue}if(k=deflate_1$2.deflate(O,S),k===Z_STREAM_END$2)return O.next_out>0&&this.onData(O.output.subarray(0,O.next_out)),k=deflate_1$2.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===Z_OK$2;if(O.avail_out===0){this.onData(O.output);continue}if(S>0&&O.next_out>0){this.onData(O.output.subarray(0,O.next_out)),O.avail_out=0;continue}if(O.avail_in===0)break}return!0},Deflate$1.prototype.onData=function($){this.chunks.push($)},Deflate$1.prototype.onEnd=function($){$===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function deflate$1($,D){const O=new Deflate$1(D);if(O.push($,!0),O.err)throw O.msg||messages[O.err];return O.result}function deflateRaw$1($,D){return D=D||{},D.raw=!0,deflate$1($,D)}function gzip$1($,D){return D=D||{},D.gzip=!0,deflate$1($,D)}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 $(D,O){let A,k,S,i,c,b,C,N,j,Z,z,K,te,ie,ee,ae,de,X,ne,fe,se,ue,pe,re;const le=D.state;A=D.next_in,pe=D.input,k=A+(D.avail_in-5),S=D.next_out,re=D.output,i=S-(O-D.avail_out),c=S+(D.avail_out-257),b=le.dmax,C=le.wsize,N=le.whave,j=le.wnext,Z=le.window,z=le.hold,K=le.bits,te=le.lencode,ie=le.distcode,ee=(1<<le.lenbits)-1,ae=(1<<le.distbits)-1;e:do{K<15&&(z+=pe[A++]<<K,K+=8,z+=pe[A++]<<K,K+=8),de=te[z&ee];t:for(;;){if(X=de>>>24,z>>>=X,K-=X,X=de>>>16&255,X===0)re[S++]=de&65535;else if(X&16){ne=de&65535,X&=15,X&&(K<X&&(z+=pe[A++]<<K,K+=8),ne+=z&(1<<X)-1,z>>>=X,K-=X),K<15&&(z+=pe[A++]<<K,K+=8,z+=pe[A++]<<K,K+=8),de=ie[z&ae];n:for(;;){if(X=de>>>24,z>>>=X,K-=X,X=de>>>16&255,X&16){if(fe=de&65535,X&=15,K<X&&(z+=pe[A++]<<K,K+=8,K<X&&(z+=pe[A++]<<K,K+=8)),fe+=z&(1<<X)-1,fe>b){D.msg="invalid distance too far back",le.mode=BAD$1;break e}if(z>>>=X,K-=X,X=S-i,fe>X){if(X=fe-X,X>N&&le.sane){D.msg="invalid distance too far back",le.mode=BAD$1;break e}if(se=0,ue=Z,j===0){if(se+=C-X,X<ne){ne-=X;do re[S++]=Z[se++];while(--X);se=S-fe,ue=re}}else if(j<X){if(se+=C+j-X,X-=j,X<ne){ne-=X;do re[S++]=Z[se++];while(--X);if(se=0,j<ne){X=j,ne-=X;do re[S++]=Z[se++];while(--X);se=S-fe,ue=re}}}else if(se+=j-X,X<ne){ne-=X;do re[S++]=Z[se++];while(--X);se=S-fe,ue=re}for(;ne>2;)re[S++]=ue[se++],re[S++]=ue[se++],re[S++]=ue[se++],ne-=3;ne&&(re[S++]=ue[se++],ne>1&&(re[S++]=ue[se++]))}else{se=S-fe;do re[S++]=re[se++],re[S++]=re[se++],re[S++]=re[se++],ne-=3;while(ne>2);ne&&(re[S++]=re[se++],ne>1&&(re[S++]=re[se++]))}}else if((X&64)===0){de=ie[(de&65535)+(z&(1<<X)-1)];continue n}else{D.msg="invalid distance code",le.mode=BAD$1;break e}break}}else if((X&64)===0){de=te[(de&65535)+(z&(1<<X)-1)];continue t}else if(X&32){le.mode=TYPE$1;break e}else{D.msg="invalid literal/length code",le.mode=BAD$1;break e}break}}while(A<k&&S<c);ne=K>>3,A-=ne,K-=ne<<3,z&=(1<<K)-1,D.next_in=A,D.next_out=S,D.avail_in=A<k?5+(k-A):5-(A-k),D.avail_out=S<c?257+(c-S):257-(S-c),le.hold=z,le.bits=K};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=($,D,O,A,k,S,i,c)=>{const b=c.bits;let C=0,N=0,j=0,Z=0,z=0,K=0,te=0,ie=0,ee=0,ae=0,de,X,ne,fe,se,ue=null,pe;const re=new Uint16Array(MAXBITS+1),le=new Uint16Array(MAXBITS+1);let ye=null,ve,we,xe;for(C=0;C<=MAXBITS;C++)re[C]=0;for(N=0;N<A;N++)re[D[O+N]]++;for(z=b,Z=MAXBITS;Z>=1&&re[Z]===0;Z--);if(z>Z&&(z=Z),Z===0)return k[S++]=1<<24|64<<16|0,k[S++]=1<<24|64<<16|0,c.bits=1,0;for(j=1;j<Z&&re[j]===0;j++);for(z<j&&(z=j),ie=1,C=1;C<=MAXBITS;C++)if(ie<<=1,ie-=re[C],ie<0)return-1;if(ie>0&&($===CODES$1||Z!==1))return-1;for(le[1]=0,C=1;C<MAXBITS;C++)le[C+1]=le[C]+re[C];for(N=0;N<A;N++)D[O+N]!==0&&(i[le[D[O+N]]++]=N);if($===CODES$1?(ue=ye=i,pe=20):$===LENS$1?(ue=lbase,ye=lext,pe=257):(ue=dbase,ye=dext,pe=0),ae=0,N=0,C=j,se=S,K=z,te=0,ne=-1,ee=1<<z,fe=ee-1,$===LENS$1&&ee>ENOUGH_LENS$1||$===DISTS$1&&ee>ENOUGH_DISTS$1)return 1;for(;;){ve=C-te,i[N]+1<pe?(we=0,xe=i[N]):i[N]>=pe?(we=ye[i[N]-pe],xe=ue[i[N]-pe]):(we=96,xe=0),de=1<<C-te,X=1<<K,j=X;do X-=de,k[se+(ae>>te)+X]=ve<<24|we<<16|xe|0;while(X!==0);for(de=1<<C-1;ae&de;)de>>=1;if(de!==0?(ae&=de-1,ae+=de):ae=0,N++,--re[C]===0){if(C===Z)break;C=D[O+i[N]]}if(C>z&&(ae&fe)!==ne){for(te===0&&(te=z),se+=j,K=C-te,ie=1<<K;K+te<Z&&(ie-=re[K+te],!(ie<=0));)K++,ie<<=1;if(ee+=1<<K,$===LENS$1&&ee>ENOUGH_LENS$1||$===DISTS$1&&ee>ENOUGH_DISTS$1)return 1;ne=ae&fe,k[ne]=z<<24|K<<16|se-S|0}}return ae!==0&&(k[se+ae]=C-te<<24|64<<16|0),c.bits=z,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=$=>($>>>24&255)+($>>>8&65280)+(($&65280)<<8)+(($&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=$=>{if(!$)return 1;const D=$.state;return!D||D.strm!==$||D.mode<HEAD||D.mode>SYNC?1:0},inflateResetKeep=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const D=$.state;return $.total_in=$.total_out=D.total=0,$.msg="",D.wrap&&($.adler=D.wrap&1),D.mode=HEAD,D.last=0,D.havedict=0,D.flags=-1,D.dmax=32768,D.head=null,D.hold=0,D.bits=0,D.lencode=D.lendyn=new Int32Array(ENOUGH_LENS),D.distcode=D.distdyn=new Int32Array(ENOUGH_DISTS),D.sane=1,D.back=-1,Z_OK$1},inflateReset=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const D=$.state;return D.wsize=0,D.whave=0,D.wnext=0,inflateResetKeep($)},inflateReset2=($,D)=>{let O;if(inflateStateCheck($))return Z_STREAM_ERROR$1;const A=$.state;return D<0?(O=0,D=-D):(O=(D>>4)+5,D<48&&(D&=15)),D&&(D<8||D>15)?Z_STREAM_ERROR$1:(A.window!==null&&A.wbits!==D&&(A.window=null),A.wrap=O,A.wbits=D,inflateReset($))},inflateInit2=($,D)=>{if(!$)return Z_STREAM_ERROR$1;const O=new InflateState;$.state=O,O.strm=$,O.window=null,O.mode=HEAD;const A=inflateReset2($,D);return A!==Z_OK$1&&($.state=null),A},inflateInit=$=>inflateInit2($,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=$=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let D=0;for(;D<144;)$.lens[D++]=8;for(;D<256;)$.lens[D++]=9;for(;D<280;)$.lens[D++]=7;for(;D<288;)$.lens[D++]=8;for(inftrees(LENS,$.lens,0,288,lenfix,0,$.work,{bits:9}),D=0;D<32;)$.lens[D++]=5;inftrees(DISTS,$.lens,0,32,distfix,0,$.work,{bits:5}),virgin=!1}$.lencode=lenfix,$.lenbits=9,$.distcode=distfix,$.distbits=5},updatewindow=($,D,O,A)=>{let k;const S=$.state;return S.window===null&&(S.wsize=1<<S.wbits,S.wnext=0,S.whave=0,S.window=new Uint8Array(S.wsize)),A>=S.wsize?(S.window.set(D.subarray(O-S.wsize,O),0),S.wnext=0,S.whave=S.wsize):(k=S.wsize-S.wnext,k>A&&(k=A),S.window.set(D.subarray(O-A,O-A+k),S.wnext),A-=k,A?(S.window.set(D.subarray(O-A,O),0),S.wnext=A,S.whave=S.wsize):(S.wnext+=k,S.wnext===S.wsize&&(S.wnext=0),S.whave<S.wsize&&(S.whave+=k))),0},inflate$2=($,D)=>{let O,A,k,S,i,c,b,C,N,j,Z,z,K,te,ie=0,ee,ae,de,X,ne,fe,se,ue;const pe=new Uint8Array(4);let re,le;const ye=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck($)||!$.output||!$.input&&$.avail_in!==0)return Z_STREAM_ERROR$1;O=$.state,O.mode===TYPE&&(O.mode=TYPEDO),i=$.next_out,k=$.output,b=$.avail_out,S=$.next_in,A=$.input,c=$.avail_in,C=O.hold,N=O.bits,j=c,Z=b,ue=Z_OK$1;e:for(;;)switch(O.mode){case HEAD:if(O.wrap===0){O.mode=TYPEDO;break}for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.wrap&2&&C===35615){O.wbits===0&&(O.wbits=15),O.check=0,pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0),C=0,N=0,O.mode=FLAGS;break}if(O.head&&(O.head.done=!1),!(O.wrap&1)||(((C&255)<<8)+(C>>8))%31){$.msg="incorrect header check",O.mode=BAD;break}if((C&15)!==Z_DEFLATED){$.msg="unknown compression method",O.mode=BAD;break}if(C>>>=4,N-=4,se=(C&15)+8,O.wbits===0&&(O.wbits=se),se>15||se>O.wbits){$.msg="invalid window size",O.mode=BAD;break}O.dmax=1<<O.wbits,O.flags=0,$.adler=O.check=1,O.mode=C&512?DICTID:TYPE,C=0,N=0;break;case FLAGS:for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.flags=C,(O.flags&255)!==Z_DEFLATED){$.msg="unknown compression method",O.mode=BAD;break}if(O.flags&57344){$.msg="unknown header flags set",O.mode=BAD;break}O.head&&(O.head.text=C>>8&1),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0)),C=0,N=0,O.mode=TIME;case TIME:for(;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.head&&(O.head.time=C),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,pe[2]=C>>>16&255,pe[3]=C>>>24&255,O.check=crc32_1(O.check,pe,4,0)),C=0,N=0,O.mode=OS;case OS:for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.head&&(O.head.xflags=C&255,O.head.os=C>>8),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0)),C=0,N=0,O.mode=EXLEN;case EXLEN:if(O.flags&1024){for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.length=C,O.head&&(O.head.extra_len=C),O.flags&512&&O.wrap&4&&(pe[0]=C&255,pe[1]=C>>>8&255,O.check=crc32_1(O.check,pe,2,0)),C=0,N=0}else O.head&&(O.head.extra=null);O.mode=EXTRA;case EXTRA:if(O.flags&1024&&(z=O.length,z>c&&(z=c),z&&(O.head&&(se=O.head.extra_len-O.length,O.head.extra||(O.head.extra=new Uint8Array(O.head.extra_len)),O.head.extra.set(A.subarray(S,S+z),se)),O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,A,z,S)),c-=z,S+=z,O.length-=z),O.length))break e;O.length=0,O.mode=NAME;case NAME:if(O.flags&2048){if(c===0)break e;z=0;do se=A[S+z++],O.head&&se&&O.length<65536&&(O.head.name+=String.fromCharCode(se));while(se&&z<c);if(O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,A,z,S)),c-=z,S+=z,se)break e}else O.head&&(O.head.name=null);O.length=0,O.mode=COMMENT;case COMMENT:if(O.flags&4096){if(c===0)break e;z=0;do se=A[S+z++],O.head&&se&&O.length<65536&&(O.head.comment+=String.fromCharCode(se));while(se&&z<c);if(O.flags&512&&O.wrap&4&&(O.check=crc32_1(O.check,A,z,S)),c-=z,S+=z,se)break e}else O.head&&(O.head.comment=null);O.mode=HCRC;case HCRC:if(O.flags&512){for(;N<16;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.wrap&4&&C!==(O.check&65535)){$.msg="header crc mismatch",O.mode=BAD;break}C=0,N=0}O.head&&(O.head.hcrc=O.flags>>9&1,O.head.done=!0),$.adler=O.check=0,O.mode=TYPE;break;case DICTID:for(;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}$.adler=O.check=zswap32(C),C=0,N=0,O.mode=DICT;case DICT:if(O.havedict===0)return $.next_out=i,$.avail_out=b,$.next_in=S,$.avail_in=c,O.hold=C,O.bits=N,Z_NEED_DICT$1;$.adler=O.check=1,O.mode=TYPE;case TYPE:if(D===Z_BLOCK||D===Z_TREES)break e;case TYPEDO:if(O.last){C>>>=N&7,N-=N&7,O.mode=CHECK;break}for(;N<3;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}switch(O.last=C&1,C>>>=1,N-=1,C&3){case 0:O.mode=STORED;break;case 1:if(fixedtables(O),O.mode=LEN_,D===Z_TREES){C>>>=2,N-=2;break e}break;case 2:O.mode=TABLE;break;case 3:$.msg="invalid block type",O.mode=BAD}C>>>=2,N-=2;break;case STORED:for(C>>>=N&7,N-=N&7;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if((C&65535)!==(C>>>16^65535)){$.msg="invalid stored block lengths",O.mode=BAD;break}if(O.length=C&65535,C=0,N=0,O.mode=COPY_,D===Z_TREES)break e;case COPY_:O.mode=COPY;case COPY:if(z=O.length,z){if(z>c&&(z=c),z>b&&(z=b),z===0)break e;k.set(A.subarray(S,S+z),i),c-=z,S+=z,b-=z,i+=z,O.length-=z;break}O.mode=TYPE;break;case TABLE:for(;N<14;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.nlen=(C&31)+257,C>>>=5,N-=5,O.ndist=(C&31)+1,C>>>=5,N-=5,O.ncode=(C&15)+4,C>>>=4,N-=4,O.nlen>286||O.ndist>30){$.msg="too many length or distance symbols",O.mode=BAD;break}O.have=0,O.mode=LENLENS;case LENLENS:for(;O.have<O.ncode;){for(;N<3;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.lens[ye[O.have++]]=C&7,C>>>=3,N-=3}for(;O.have<19;)O.lens[ye[O.have++]]=0;if(O.lencode=O.lendyn,O.lenbits=7,re={bits:O.lenbits},ue=inftrees(CODES,O.lens,0,19,O.lencode,0,O.work,re),O.lenbits=re.bits,ue){$.msg="invalid code lengths set",O.mode=BAD;break}O.have=0,O.mode=CODELENS;case CODELENS:for(;O.have<O.nlen+O.ndist;){for(;ie=O.lencode[C&(1<<O.lenbits)-1],ee=ie>>>24,ae=ie>>>16&255,de=ie&65535,!(ee<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(de<16)C>>>=ee,N-=ee,O.lens[O.have++]=de;else{if(de===16){for(le=ee+2;N<le;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(C>>>=ee,N-=ee,O.have===0){$.msg="invalid bit length repeat",O.mode=BAD;break}se=O.lens[O.have-1],z=3+(C&3),C>>>=2,N-=2}else if(de===17){for(le=ee+3;N<le;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=ee,N-=ee,se=0,z=3+(C&7),C>>>=3,N-=3}else{for(le=ee+7;N<le;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=ee,N-=ee,se=0,z=11+(C&127),C>>>=7,N-=7}if(O.have+z>O.nlen+O.ndist){$.msg="invalid bit length repeat",O.mode=BAD;break}for(;z--;)O.lens[O.have++]=se}}if(O.mode===BAD)break;if(O.lens[256]===0){$.msg="invalid code -- missing end-of-block",O.mode=BAD;break}if(O.lenbits=9,re={bits:O.lenbits},ue=inftrees(LENS,O.lens,0,O.nlen,O.lencode,0,O.work,re),O.lenbits=re.bits,ue){$.msg="invalid literal/lengths set",O.mode=BAD;break}if(O.distbits=6,O.distcode=O.distdyn,re={bits:O.distbits},ue=inftrees(DISTS,O.lens,O.nlen,O.ndist,O.distcode,0,O.work,re),O.distbits=re.bits,ue){$.msg="invalid distances set",O.mode=BAD;break}if(O.mode=LEN_,D===Z_TREES)break e;case LEN_:O.mode=LEN;case LEN:if(c>=6&&b>=258){$.next_out=i,$.avail_out=b,$.next_in=S,$.avail_in=c,O.hold=C,O.bits=N,inffast($,Z),i=$.next_out,k=$.output,b=$.avail_out,S=$.next_in,A=$.input,c=$.avail_in,C=O.hold,N=O.bits,O.mode===TYPE&&(O.back=-1);break}for(O.back=0;ie=O.lencode[C&(1<<O.lenbits)-1],ee=ie>>>24,ae=ie>>>16&255,de=ie&65535,!(ee<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(ae&&(ae&240)===0){for(X=ee,ne=ae,fe=de;ie=O.lencode[fe+((C&(1<<X+ne)-1)>>X)],ee=ie>>>24,ae=ie>>>16&255,de=ie&65535,!(X+ee<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=X,N-=X,O.back+=X}if(C>>>=ee,N-=ee,O.back+=ee,O.length=de,ae===0){O.mode=LIT;break}if(ae&32){O.back=-1,O.mode=TYPE;break}if(ae&64){$.msg="invalid literal/length code",O.mode=BAD;break}O.extra=ae&15,O.mode=LENEXT;case LENEXT:if(O.extra){for(le=O.extra;N<le;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.length+=C&(1<<O.extra)-1,C>>>=O.extra,N-=O.extra,O.back+=O.extra}O.was=O.length,O.mode=DIST;case DIST:for(;ie=O.distcode[C&(1<<O.distbits)-1],ee=ie>>>24,ae=ie>>>16&255,de=ie&65535,!(ee<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if((ae&240)===0){for(X=ee,ne=ae,fe=de;ie=O.distcode[fe+((C&(1<<X+ne)-1)>>X)],ee=ie>>>24,ae=ie>>>16&255,de=ie&65535,!(X+ee<=N);){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}C>>>=X,N-=X,O.back+=X}if(C>>>=ee,N-=ee,O.back+=ee,ae&64){$.msg="invalid distance code",O.mode=BAD;break}O.offset=de,O.extra=ae&15,O.mode=DISTEXT;case DISTEXT:if(O.extra){for(le=O.extra;N<le;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}O.offset+=C&(1<<O.extra)-1,C>>>=O.extra,N-=O.extra,O.back+=O.extra}if(O.offset>O.dmax){$.msg="invalid distance too far back",O.mode=BAD;break}O.mode=MATCH;case MATCH:if(b===0)break e;if(z=Z-b,O.offset>z){if(z=O.offset-z,z>O.whave&&O.sane){$.msg="invalid distance too far back",O.mode=BAD;break}z>O.wnext?(z-=O.wnext,K=O.wsize-z):K=O.wnext-z,z>O.length&&(z=O.length),te=O.window}else te=k,K=i-O.offset,z=O.length;z>b&&(z=b),b-=z,O.length-=z;do k[i++]=te[K++];while(--z);O.length===0&&(O.mode=LEN);break;case LIT:if(b===0)break e;k[i++]=O.length,b--,O.mode=LEN;break;case CHECK:if(O.wrap){for(;N<32;){if(c===0)break e;c--,C|=A[S++]<<N,N+=8}if(Z-=b,$.total_out+=Z,O.total+=Z,O.wrap&4&&Z&&($.adler=O.check=O.flags?crc32_1(O.check,k,Z,i-Z):adler32_1(O.check,k,Z,i-Z)),Z=b,O.wrap&4&&(O.flags?C:zswap32(C))!==O.check){$.msg="incorrect data check",O.mode=BAD;break}C=0,N=0}O.mode=LENGTH;case LENGTH:if(O.wrap&&O.flags){for(;N<32;){if(c===0)break e;c--,C+=A[S++]<<N,N+=8}if(O.wrap&4&&C!==(O.total&4294967295)){$.msg="incorrect length check",O.mode=BAD;break}C=0,N=0}O.mode=DONE;case DONE:ue=Z_STREAM_END$1;break e;case BAD:ue=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return $.next_out=i,$.avail_out=b,$.next_in=S,$.avail_in=c,O.hold=C,O.bits=N,(O.wsize||Z!==$.avail_out&&O.mode<BAD&&(O.mode<CHECK||D!==Z_FINISH$1))&&updatewindow($,$.output,$.next_out,Z-$.avail_out),j-=$.avail_in,Z-=$.avail_out,$.total_in+=j,$.total_out+=Z,O.total+=Z,O.wrap&4&&Z&&($.adler=O.check=O.flags?crc32_1(O.check,k,Z,$.next_out-Z):adler32_1(O.check,k,Z,$.next_out-Z)),$.data_type=O.bits+(O.last?64:0)+(O.mode===TYPE?128:0)+(O.mode===LEN_||O.mode===COPY_?256:0),(j===0&&Z===0||D===Z_FINISH$1)&&ue===Z_OK$1&&(ue=Z_BUF_ERROR),ue},inflateEnd=$=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;let D=$.state;return D.window&&(D.window=null),$.state=null,Z_OK$1},inflateGetHeader=($,D)=>{if(inflateStateCheck($))return Z_STREAM_ERROR$1;const O=$.state;return(O.wrap&2)===0?Z_STREAM_ERROR$1:(O.head=D,D.done=!1,Z_OK$1)},inflateSetDictionary=($,D)=>{const O=D.length;let A,k,S;return inflateStateCheck($)||(A=$.state,A.wrap!==0&&A.mode!==DICT)?Z_STREAM_ERROR$1:A.mode===DICT&&(k=1,k=adler32_1(k,D,O,0),k!==A.check)?Z_DATA_ERROR$1:(S=updatewindow($,D,O,O),S?(A.mode=MEM,Z_MEM_ERROR$1):(A.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($){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},$||{});const D=this.options;D.raw&&D.windowBits>=0&&D.windowBits<16&&(D.windowBits=-D.windowBits,D.windowBits===0&&(D.windowBits=-15)),D.windowBits>=0&&D.windowBits<16&&!($&&$.windowBits)&&(D.windowBits+=32),D.windowBits>15&&D.windowBits<48&&(D.windowBits&15)===0&&(D.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let O=inflate_1$2.inflateInit2(this.strm,D.windowBits);if(O!==Z_OK)throw new Error(messages[O]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),D.dictionary&&(typeof D.dictionary=="string"?D.dictionary=strings.string2buf(D.dictionary):toString.call(D.dictionary)==="[object ArrayBuffer]"&&(D.dictionary=new Uint8Array(D.dictionary)),D.raw&&(O=inflate_1$2.inflateSetDictionary(this.strm,D.dictionary),O!==Z_OK)))throw new Error(messages[O])}Inflate$1.prototype.push=function($,D){const O=this.strm,A=this.options.chunkSize,k=this.options.dictionary;let S,i,c;if(this.ended)return!1;for(D===~~D?i=D:i=D===!0?Z_FINISH:Z_NO_FLUSH,toString.call($)==="[object ArrayBuffer]"?O.input=new Uint8Array($):O.input=$,O.next_in=0,O.avail_in=O.input.length;;){for(O.avail_out===0&&(O.output=new Uint8Array(A),O.next_out=0,O.avail_out=A),S=inflate_1$2.inflate(O,i),S===Z_NEED_DICT&&k&&(S=inflate_1$2.inflateSetDictionary(O,k),S===Z_OK?S=inflate_1$2.inflate(O,i):S===Z_DATA_ERROR&&(S=Z_NEED_DICT));O.avail_in>0&&S===Z_STREAM_END&&O.state.wrap>0&&$[O.next_in]!==0;)inflate_1$2.inflateReset(O),S=inflate_1$2.inflate(O,i);switch(S){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(S),this.ended=!0,!1}if(c=O.avail_out,O.next_out&&(O.avail_out===0||S===Z_STREAM_END))if(this.options.to==="string"){let b=strings.utf8border(O.output,O.next_out),C=O.next_out-b,N=strings.buf2string(O.output,b);O.next_out=C,O.avail_out=A-C,C&&O.output.set(O.output.subarray(b,b+C),0),this.onData(N)}else this.onData(O.output.length===O.next_out?O.output:O.output.subarray(0,O.next_out));if(!(S===Z_OK&&c===0)){if(S===Z_STREAM_END)return S=inflate_1$2.inflateEnd(this.strm),this.onEnd(S),this.ended=!0,!0;if(O.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function($){this.chunks.push($)},Inflate$1.prototype.onEnd=function($){$===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=$,this.msg=this.strm.msg};function inflate$1($,D){const O=new Inflate$1(D);if(O.push($),O.err)throw O.msg||messages[O.err];return O.result}function inflateRaw$1($,D){return D=D||{},D.raw=!0,inflate$1($,D)}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};const reqIgnoreEvents=["updateSeverTime"];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),reqIgnoreEvents.push("onNetQuality"),reqIgnoreEvents.push("updateCall"),reqIgnoreEvents.push("reportNetwork"),reqIgnoreEvents.push("ackMsg");const resIgnoreEvents=["updateSeverTime"];resIgnoreEvents.push("heartbeat"),resIgnoreEvents.push("heartbeatEx"),resIgnoreEvents.push("networkQualityChange"),resIgnoreEvents.push("onNetQuality"),resIgnoreEvents.push("updateCall"),resIgnoreEvents.push("pubNotify"),resIgnoreEvents.push("reportNetwork"),resIgnoreEvents.push("ackMsg"),resIgnoreEvents.push("offer"),resIgnoreEvents.push("candidate"),resIgnoreEvents.push("answer"),resIgnoreEvents.push("reportP2PConnect");const compressArrayBuffer=$=>{const D=new Uint8Array($),O=pako.deflate(D,{gzip:!0});return new Uint8Array(O==null?void 0:O.buffer)},decompressArrayBuffer=$=>{const D=new Uint8Array($),O=pako.inflate(D,{gzip:!0});return new Uint8Array(O==null?void 0:O.buffer)},sendMessageFormat=$=>{const{event:D}=$;switch($.data_original=$.data,$.time&&($.timeStr=E($.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),D){case"login":$.data=com.quick.voice.proto.Login.encode($.data).finish();break;case"joinRoom":case"joinRoomEx":$.data=com.quick.voice.proto.JoinReq.encode($.data).finish();break;case"quitRoom":$.data=com.quick.voice.proto.QuitReq.encode($.data).finish();break;case"connectCF":$.data=com.quick.voice.proto.ConnectCFReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"publish":$.data=com.quick.voice.proto.PublishReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"pubChannel":$.data=com.quick.voice.proto.ChannelPublishReq.encode($.data).finish();break;case"subscribe":$.data=com.quick.voice.proto.SubscribeReq.encode($.data).finish();break;case"offer":$.data=com.quick.voice.proto.SdpConsult.encode($.data).finish();break;case"answer":$.data=com.quick.voice.proto.SdpConsult.encode($.data).finish();break;case"candidate":$.data=com.quick.voice.proto.Candidates.encode($.data).finish();break;case"subChannel":$.data=com.quick.voice.proto.ChannelSubscribeRsq.encode($.data).finish();break;case"closeTrack":$.data=com.quick.voice.proto.CloseTrackReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"renegotiate":$.data=com.quick.voice.proto.RenegotiateReq.encode($.data).finish(),$.data=compressArrayBuffer($.data),$.compress=!0;break;case"reportNetwork":$.data=com.quick.voice.proto.ReportNetInfo.encode($.data).finish();break;case"reportP2PConnect":$.data=com.quick.voice.proto.ReportP2PReq.encode($.data).finish();break;case"syncRoomInfo":$.data=com.quick.voice.proto.SyncRoomInfoReq.encode($.data).finish();break;case"updateCall":$.data=com.quick.voice.proto.UpdateCall.encode($.data).finish();break;case"networkQualityChange":$.data=com.quick.voice.proto.NetQualityChange.encode($.data).finish();break;case"pubNotify":$.data=com.quick.voice.proto.PublishNotify.encode($.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":$.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode($.data).finish();break;case"heartbeat":{$.data=com.quick.voice.proto.ReportTrafficUsage.encode($.data).finish();break}case"ackMsg":{$.data=com.quick.voice.proto.AckMsgReq.encode($.data).finish();break}default:$.data=new Uint8Array;break}return $},onMessageFormat=$=>{const{event:D,compress:O=!1}=$;if($.data_remote=$.data,$.time&&($.timeStr=E($.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),O)try{$.data=decompressArrayBuffer($.data)}catch(A){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",A)}switch(D){case"login":$.data=com.quick.voice.proto.Login.decode($.data);break;case"joinRoom":case"joinRoomEx":$.data=com.quick.voice.proto.JoinRsp.decode($.data);break;case"onJoinRoom":$.data=com.quick.voice.proto.JoinNotify.decode($.data);break;case"onQuitRoom":$.data=com.quick.voice.proto.QuitNotify.decode($.data);break;case"connectCF":$.data=com.quick.voice.proto.ConnectCFRsp.decode($.data);break;case"publish":$.data=com.quick.voice.proto.PublishRsp.decode($.data);break;case"pubChannel":$.data=com.quick.voice.proto.ChannelPublishRsq.decode($.data);break;case"onPublish":$.data=com.quick.voice.proto.PublishNotify.decode($.data);break;case"subscribe":$.data=com.quick.voice.proto.SubscribeRsp.decode($.data);break;case"onAttemptP2PReq":$.data=com.quick.voice.proto.P2PAttemptConnectReq.decode($.data);break;case"onOffer":$.data=com.quick.voice.proto.SdpConsult.decode($.data);break;case"onAnswer":$.data=com.quick.voice.proto.SdpConsult.decode($.data);break;case"onCandidate":$.data=com.quick.voice.proto.Candidates.decode($.data);break;case"subChannel":$.data=com.quick.voice.proto.ChannelSubscribeRsq.decode($.data);break;case"closeTrack":$.data=com.quick.voice.proto.CloseTrackRsp.decode($.data);break;case"onCloseTrack":$.data=com.quick.voice.proto.CloseTrackNotify.decode($.data);break;case"onTrackInactive":$.data=com.quick.voice.proto.CheckSessionRsq.decode($.data);break;case"onUpdateCall":$.data=com.quick.voice.proto.UpdateCall.decode($.data);break;case"onDataChannelPublish":$.data=com.quick.voice.proto.UserChannel.decode($.data);break;case"onDestroyRoom":$.data=com.quick.voice.proto.QuitNotify.decode($.data);break;case"onUpdatePermissions":$.data=com.quick.voice.proto.UpdatePermissions.decode($.data);break;case"onNetQuality":$.data=com.quick.voice.proto.NetQualityNotify.decode($.data);break;case"syncRoomInfo":$.data=com.quick.voice.proto.SyncRoomInfoRsp.decode($.data);break;case"onCDNPlayUrlAdd":$.data=com.quick.voice.proto.CDNPlayAddressNotify.decode($.data);break;case"onUpdateBehavior":$.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode($.data);break;case"debugger":$.data=JSON.parse(new TextDecoder().decode($.data));break}return $};class CallsWebSocket{constructor(D){ke(this,ge,{url:"wss://putplay.cqrjz.com/websocket",debug:!1,timeout:30*1e3});Q(this,"prws",new I({url:"",binaryType:"arraybuffer",reconnectCount:8,timeout:10*1e3,reconnectTime:40*1e3}));Q(this,"activeTimeStamp",0);ke(this,Oe,{});ke(this,Re,{});Q(this,"getUrl",async(D="prod")=>{try{const k=(await(await fetch(`https://address.putplay.cc/?env=${D}`)).json()).domain;ce(this,ge).url=k,this.prws.setOptions({url:k})}catch(O){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: get serve url is error.",O)}});Q(this,"afreshSends",()=>{const D=Object.keys(ce(this,Oe));for(const O of D){const A=ce(this,Oe)[O];A&&A.send()}});ke(this,at,(D,O={})=>{try{const{time:A,event:k,data:S={},data_original:i={},data_remote:c,...b}=O,C=E(A,"YYYY-MM-DD hh:mm:ss",{offset:480});let N={};const j=(de={})=>{const X=JSON.parse(JSON.stringify(de)),ne=Object.keys(X);for(const fe of ne)(fe.includes("sdp")||fe.includes("Sdp"))&&(X[fe]="");return X};let Z="res ↓";switch(D){case"res":Z="res ↓",N=j(S);break;case"req":Z="req ↑",N=j(i);break}let z="#quickvo.logs";(reqIgnoreEvents.includes(k)||resIgnoreEvents.includes(k))&&(z="#quickvo.ignoreEvents");const K={"#action":Z,timeStr:C,event:k,data:N,time:A,...b},te=localStorage.getItem(z)||JSON.stringify([]),ie=JSON.parse(te);let ee=k==="heartbeat"||k==="heartbeatEx";const ae=[K];for(const de of ie){const{event:X}=de;if(X==="heartbeat"||X==="heartbeatEx"){if(ee)continue;ee=!0}if(ae.length===200)break;ae.push(de)}localStorage.setItem(z,JSON.stringify(ae))}catch(A){ce(this,ge).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",A)}});ke(this,Ut,(D,{resolve:O,reject:A},k)=>{const{sn:S=""}=D,i={message:D,resolve:O,reject:A,send:()=>{},destruction:()=>{},destructionTimer:0};return i.send=()=>{var b;clearTimeout(i.destructionTimer),k&&(i.destruction=()=>{const C=ce(this,Oe)[S];clearTimeout(C.destructionTimer),delete ce(this,Oe)[S]},i.destructionTimer=window.setTimeout(()=>{const C=ce(this,Oe)[S];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: event is timeout",C),C.destruction(),A("event is timeout")},ce(this,ge).timeout));const c=com.quick.voice.proto.CommonReq.encode(D).finish();(b=this.prws)==null||b.sendMessage(c),k||O(!0)},ce(this,Oe)[S]=i,i});ke(this,Lt,D=>ce(this,Oe)[D]);ke(this,Ft,async D=>{const O=new Uint8Array(D),A=com.quick.voice.proto.CommonRsp.decode(O),{sn:k,event:S}=A,i=onMessageFormat(A);if(ce(this,at).call(this,"res",i),ce(this,ge).debug&&!resIgnoreEvents.includes(S)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i),["heartbeat","heartbeatEx"].includes(S)&&(this.activeTimeStamp=new Date().getTime()),notifyName_keys.includes(S))return this.emitNotify(S,V(i,["code","data","desc"]));const b=ce(this,Lt).call(this,k);if(b){const{resolve:C=j=>{},destruction:N=()=>{}}=b;C(V(i,["code","data","desc","sn"])),N()}});Q(this,"clearEvents",(D=[])=>{const O=Object.keys(ce(this,Oe));D.length===0&&(D=O);for(const A of O){if(!D.includes(A))continue;const k=ce(this,Oe)[A];if(k){const{destruction:S}=k;S()}}});Q(this,"connect",async()=>new Promise(async(D,O)=>{try{const A=new Date().getTime();await this.prws.connect();const k=new Date().getTime();if(this.activeTimeStamp=k,ce(this,ge).debug){const S=k-A;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${S}ms-广播事件`,ce(this,Re))}D(this.prws)}catch(A){O(A)}}));Q(this,"close",async()=>{var O;ce(this,ge).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const D=Object.keys(ce(this,Oe));for(const A of D){const{destructionTimer:k}=ce(this,Oe)[A];clearTimeout(k)}Ae(this,Oe,{}),await((O=this.prws)==null?void 0:O.close())});Q(this,"sendMessage",(D,O=!0)=>new Promise(async(A,k)=>{const{event:S,...i}=D,c=Date.now(),b=sendMessageFormat({event:S,sn:+`${c}${v$1(1e3,9999)}`,time:c,valid:ce(this,ge).timeout,version:1,compress:!1,...i});ce(this,at).call(this,"req",b),ce(this,ge).debug&&!reqIgnoreEvents.includes(S)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",b),ce(this,Ut).call(this,b,{resolve:A,reject:k},O).send()}));Q(this,"emitNotify",async(D,O)=>{const A=ce(this,Re)[D]||[];for(const k of A){const{callback:S=async()=>{}}=k;await S(O)}});Q(this,"addNotify",(D,O=!1)=>{const{event:A,sn:k=wt(32)}=D;ce(this,Re)[A]||(ce(this,Re)[A]=[]);const S=ce(this,Re)[A],i=S.findIndex(c=>c.sn===k);return i!==-1&&S.splice(i,1),O?S.unshift(D):S.push(D),k});Q(this,"removeNotify",(D=[])=>{if(D.length===0)Ae(this,Re,{});else{const O=Object.keys(ce(this,Re));for(const A of O)ce(this,Re)[A]=ce(this,Re)[A].filter(k=>!D.includes(k.sn||""))}ce(this,ge).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",ce(this,Re))});Ae(this,ge,{...ce(this,ge),...D}),this.prws.setOptions(ce(this,ge)),this.prws.onMessage=ce(this,Ft),this.prws.getHeartbeatMsg=()=>""}}ge=new WeakMap,Oe=new WeakMap,Re=new WeakMap,at=new WeakMap,Ut=new WeakMap,Lt=new WeakMap,Ft=new WeakMap;const createMutedAudioStream=$=>{const D=$.createOscillator();D.type="sine",D.frequency.setValueAtTime(0,$.currentTime);const O=$.createGain();O.gain.value=0,D.connect(O),O.connect($.destination),D.start();const A=$.createMediaStreamDestination();return O.disconnect(),D.connect(A),A.stream},createFakeVideoStream=($=10,D=10,O=30)=>{const A=document.createElement("canvas"),k=A.getContext("2d");A.width=$,A.height=D;let S=0;return setInterval(()=>{k.clearRect(0,0,A.width,A.height);const b=k.createLinearGradient(0,0,A.width,A.height);b.addColorStop(0,`hsla(${S}, 100%, 50%, 0)`),b.addColorStop(1,`hsla(${S+120}, 100%, 50%, 0)`),k.fillStyle=b,k.fillRect(0,0,A.width,A.height),S=(S+1)%360},100),A.captureStream(O)};class NetworkQualityTester{constructor(D=[]){Q(this,"targetUrls",[]);Q(this,"results",[]);D.length===0&&D.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=D,this.results=[]}async testAll(){const D=this.targetUrls.map(O=>this.testUrl(O));return await Promise.all(D),this.analyzeResults()}async testUrl(D){const O=performance.now();let A=0,k=!1;try{await fetch(D,{method:"HEAD",cache:"no-store"});const S=performance.now()-O,i=performance.now(),b=await(await fetch(D,{cache:"no-store"})).blob(),C=performance.now()-i;A=b.size,k=!0,this.results.push({url:D,success:k,headTime:S,getTime:C,size:A,downloadSpeed:A>0?(A/1024/(C/1e3)).toFixed(2):0,totalTime:performance.now()-O})}catch(S){this.results.push({url:D,success:!1,error:S.message,totalTime:performance.now()-O})}}analyzeResults(){const D=this.results.filter(S=>S.success);if(D.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const O=D.reduce((S,i)=>S+i.size,0),A=D.reduce((S,i)=>S+i.totalTime,0),k=D.reduce((S,i)=>S+parseFloat(i.downloadSpeed),0)/D.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:D.length,averageDownloadSpeed:`${k.toFixed(2)} KB/s`,averageResponseTime:`${(A/D.length).toFixed(2)}ms`,totalDataTransferred:`${(O/1024).toFixed(2)} KB`,detailedResults:this.results}}}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($){(function(D){var O="undefined",A=O!==typeof Buffer&&Buffer,k=O!==typeof Uint8Array&&Uint8Array,S=O!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],c=Array.isArray||fe,b=4294967296,C=16777216,N;j("Uint64BE",!0,!0),j("Int64BE",!0,!1),j("Uint64LE",!1,!0),j("Int64LE",!1,!1);function j(se,ue,pe){var re=ue?0:4,le=ue?4:0,ye=ue?0:3,ve=ue?1:2,we=ue?2:1,xe=ue?3:0,De=ue?ae:X,Me=ue?de:ne,Le=Ee.prototype,Ge="is"+se,ft="_"+Ge;return Le.buffer=void 0,Le.offset=0,Le[ft]=!0,Le.toNumber=We,Le.toString=rt,Le.toJSON=We,Le.toArray=Z,A&&(Le.toBuffer=z),k&&(Le.toArrayBuffer=K),Ee[Ge]=$e,D[se]=Ee,Ee;function Ee(_e,be,Se,Ie){return this instanceof Ee?nt(this,_e,be,Se,Ie):new Ee(_e,be,Se,Ie)}function $e(_e){return!!(_e&&_e[ft])}function nt(_e,be,Se,Ie,Ce){if(k&&S&&(be instanceof S&&(be=new k(be)),Ie instanceof S&&(Ie=new k(Ie))),!be&&!Se&&!Ie&&!N){_e.buffer=ee(i,0);return}if(!te(be,Se)){var Fe=N||Array;Ce=Se,Ie=be,Se=0,be=N===A?A.alloc(8):new Fe(8)}_e.buffer=be,_e.offset=Se|=0,O!==typeof Ie&&(typeof Ie=="string"?Ue(be,Se,Ie,Ce||10):te(Ie,Ce)?ie(be,Se,Ie,Ce):typeof Ce=="number"?(Ke(be,Se+re,Ie),Ke(be,Se+le,Ce)):Ie>0?De(be,Se,Ie):Ie<0?Me(be,Se,Ie):ie(be,Se,i,0))}function Ue(_e,be,Se,Ie){var Ce=0,Fe=Se.length,Ze=0,He=0;Se[0]==="-"&&Ce++;for(var ot=Ce;Ce<Fe;){var mt=parseInt(Se[Ce++],Ie);if(!(mt>=0))break;He=He*Ie+mt,Ze=Ze*Ie+Math.floor(He/b),He%=b}ot&&(Ze=~Ze,He?He=b-He:Ze++),Ke(_e,be+re,Ze),Ke(_e,be+le,He)}function We(){var _e=this.buffer,be=this.offset,Se=ze(_e,be+re),Ie=ze(_e,be+le);return pe||(Se|=0),Se?Se*b+Ie:Ie}function rt(_e){var be=this.buffer,Se=this.offset,Ie=ze(be,Se+re),Ce=ze(be,Se+le),Fe="",Ze=!pe&&Ie&2147483648;for(Ze&&(Ie=~Ie,Ce=b-Ce),_e=_e||10;;){var He=Ie%_e*b+Ce;if(Ie=Math.floor(Ie/_e),Ce=Math.floor(He/_e),Fe=(He%_e).toString(_e)+Fe,!Ie&&!Ce)break}return Ze&&(Fe="-"+Fe),Fe}function Ke(_e,be,Se){_e[be+xe]=Se&255,Se=Se>>8,_e[be+we]=Se&255,Se=Se>>8,_e[be+ve]=Se&255,Se=Se>>8,_e[be+ye]=Se&255}function ze(_e,be){return _e[be+ye]*C+(_e[be+ve]<<16)+(_e[be+we]<<8)+_e[be+xe]}}function Z(se){var ue=this.buffer,pe=this.offset;return N=null,se!==!1&&c(ue)?ue.length===8?ue:ue.slice(pe,pe+8):ee(ue,pe)}function z(se){var ue=this.buffer,pe=this.offset;return N=A,se!==!1&&A.isBuffer(ue)?ue.length===8?ue:ue.slice(pe,pe+8):A.from(K.call(this,se))}function K(se){var ue=this.buffer,pe=this.offset,re=ue.buffer;if(N=k,se!==!1&&!ue.offset&&re instanceof S)return re.byteLength===8?re:re.slice(pe,pe+8);var le=new k(8);return ie(le,0,ue,pe),le.buffer}function te(se,ue){var pe=se&&se.length;return ue|=0,pe&&ue+8<=pe&&typeof se[ue]!="string"}function ie(se,ue,pe,re){ue|=0,re|=0;for(var le=0;le<8;le++)se[ue++]=pe[re++]&255}function ee(se,ue){return Array.prototype.slice.call(se,ue,ue+8)}function ae(se,ue,pe){for(var re=ue+8;re>ue;)se[--re]=pe&255,pe/=256}function de(se,ue,pe){var re=ue+8;for(pe++;re>ue;)se[--re]=-pe&255^255,pe/=256}function X(se,ue,pe){for(var re=ue+8;ue<re;)se[ue++]=pe&255,pe/=256}function ne(se,ue,pe){var re=ue+8;for(pe++;ue<re;)se[ue++]=-pe&255^255,pe/=256}function fe(se){return!!se&&Object.prototype.toString.call(se)=="[object Array]"}})(typeof $.nodeName!="string"?$: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 $=requireTools(),D=requireTools(),O=requireEbmlID(),A=function(){function k(){this._schema=O.byEbmlID,this._buffers=[],this._stack=[]}return k.prototype.encode=function(S){var i=this;return $.concat(S.reduce(function(c,b){return c.concat(i.encodeChunk(b))},[])).buffer},k.prototype.encodeChunk=function(S){return S.type==="m"?S.isEnd?this.endTag(S):this.startTag(S):(S.data=D.Buffer.from(S.data),this.writeTag(S)),this.flush()},k.prototype.flush=function(){var S=this._buffers;return this._buffers=[],S},k.prototype.getSchemaInfo=function(S){for(var i=Object.keys(this._schema).map(Number),c=0;c<i.length;c++){var b=i[c];if(this._schema[b].name===S)return new D.Buffer(b.toString(16),"hex")}return null},k.prototype.writeTag=function(S){var i=S.name,c=this.getSchemaInfo(i),b=S.data;if(c==null)throw new Error("No schema entry found for "+i);var C=$.encodeTag(c,b);if(this._stack.length>0){var N=this._stack[this._stack.length-1];N.children.push({tagId:c,elm:S,children:[],data:C});return}this._buffers=this._buffers.concat(C)},k.prototype.startTag=function(S){var i=S.name,c=this.getSchemaInfo(i);if(c==null)throw new Error("No schema entry found for "+i);if(S.unknownSize){var b=$.encodeTag(c,new D.Buffer(0),S.unknownSize);this._buffers=this._buffers.concat(b);return}var C={tagId:c,elm:S,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(C),this._stack.push(C)},k.prototype.endTag=function(S){S.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==S.name)throw new Error("EBML structure is broken");var c=i.children.reduce(function(C,N){if(N.data===null)throw new Error("EBML structure is broken");return C.concat(N.data)},[]),b=$.concat(c);i.elm.type==="m"?i.data=$.encodeTag(i.tagId,b,i.elm.unknownSize):i.data=$.encodeTag(i.tagId,b),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},k}();return EBMLEncoder.default=A,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=c,base64Js.toByteArray=C,base64Js.fromByteArray=Z;for(var $=[],D=[],O=typeof Uint8Array<"u"?Uint8Array:Array,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k=0,S=A.length;k<S;++k)$[k]=A[k],D[A.charCodeAt(k)]=k;D[45]=62,D[95]=63;function i(z){var K=z.length;if(K%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var te=z.indexOf("=");te===-1&&(te=K);var ie=te===K?0:4-te%4;return[te,ie]}function c(z){var K=i(z),te=K[0],ie=K[1];return(te+ie)*3/4-ie}function b(z,K,te){return(K+te)*3/4-te}function C(z){var K,te=i(z),ie=te[0],ee=te[1],ae=new O(b(z,ie,ee)),de=0,X=ee>0?ie-4:ie,ne;for(ne=0;ne<X;ne+=4)K=D[z.charCodeAt(ne)]<<18|D[z.charCodeAt(ne+1)]<<12|D[z.charCodeAt(ne+2)]<<6|D[z.charCodeAt(ne+3)],ae[de++]=K>>16&255,ae[de++]=K>>8&255,ae[de++]=K&255;return ee===2&&(K=D[z.charCodeAt(ne)]<<2|D[z.charCodeAt(ne+1)]>>4,ae[de++]=K&255),ee===1&&(K=D[z.charCodeAt(ne)]<<10|D[z.charCodeAt(ne+1)]<<4|D[z.charCodeAt(ne+2)]>>2,ae[de++]=K>>8&255,ae[de++]=K&255),ae}function N(z){return $[z>>18&63]+$[z>>12&63]+$[z>>6&63]+$[z&63]}function j(z,K,te){for(var ie,ee=[],ae=K;ae<te;ae+=3)ie=(z[ae]<<16&16711680)+(z[ae+1]<<8&65280)+(z[ae+2]&255),ee.push(N(ie));return ee.join("")}function Z(z){for(var K,te=z.length,ie=te%3,ee=[],ae=16383,de=0,X=te-ie;de<X;de+=ae)ee.push(j(z,de,de+ae>X?X:de+ae));return ie===1?(K=z[te-1],ee.push($[K>>2]+$[K<<4&63]+"==")):ie===2&&(K=(z[te-2]<<8)+z[te-1],ee.push($[K>>10]+$[K>>4&63]+$[K<<2&63]+"=")),ee.join("")}return base64Js}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var hasRequiredIeee754;function requireIeee754(){return hasRequiredIeee754||(hasRequiredIeee754=1,ieee754.read=function($,D,O,A,k){var S,i,c=k*8-A-1,b=(1<<c)-1,C=b>>1,N=-7,j=O?k-1:0,Z=O?-1:1,z=$[D+j];for(j+=Z,S=z&(1<<-N)-1,z>>=-N,N+=c;N>0;S=S*256+$[D+j],j+=Z,N-=8);for(i=S&(1<<-N)-1,S>>=-N,N+=A;N>0;i=i*256+$[D+j],j+=Z,N-=8);if(S===0)S=1-C;else{if(S===b)return i?NaN:(z?-1:1)*(1/0);i=i+Math.pow(2,A),S=S-C}return(z?-1:1)*i*Math.pow(2,S-A)},ieee754.write=function($,D,O,A,k,S){var i,c,b,C=S*8-k-1,N=(1<<C)-1,j=N>>1,Z=k===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=A?0:S-1,K=A?1:-1,te=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(c=isNaN(D)?1:0,i=N):(i=Math.floor(Math.log(D)/Math.LN2),D*(b=Math.pow(2,-i))<1&&(i--,b*=2),i+j>=1?D+=Z/b:D+=Z*Math.pow(2,1-j),D*b>=2&&(i++,b/=2),i+j>=N?(c=0,i=N):i+j>=1?(c=(D*b-1)*Math.pow(2,k),i=i+j):(c=D*Math.pow(2,j-1)*Math.pow(2,k),i=0));k>=8;$[O+z]=c&255,z+=K,c/=256,k-=8);for(i=i<<k|c,C+=k;C>0;$[O+z]=i&255,z+=K,i/=256,C-=8);$[O+z-K]|=te*128}),ieee754}/*!
5
5
  * The buffer module from node.js, for the browser.
6
6
  *
7
7
  * @author Feross Aboukhadijeh <https://feross.org>
8
8
  * @license MIT
9
- */var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function($){const D=requireBase64Js(),O=requireIeee754(),A=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$.Buffer=c,$.SlowBuffer=se,$.INSPECT_MAX_BYTES=50;const b=2147483647;$.kMaxLength=b,c.TYPED_ARRAY_SUPPORT=S(),!c.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 S(){try{const J=new Uint8Array(1),M={foo:function(){return 42}};return Object.setPrototypeOf(M,Uint8Array.prototype),Object.setPrototypeOf(J,M),J.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function i(J){if(J>b)throw new RangeError('The value "'+J+'" is invalid for option "size"');const M=new Uint8Array(J);return Object.setPrototypeOf(M,c.prototype),M}function c(J,M,F){if(typeof J=="number"){if(typeof M=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return j(J)}return k(J,M,F)}c.poolSize=8192;function k(J,M,F){if(typeof J=="string")return Z(J,M);if(ArrayBuffer.isView(J))return K(J);if(J==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof J);if(Qe(J,ArrayBuffer)||J&&Qe(J.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Qe(J,SharedArrayBuffer)||J&&Qe(J.buffer,SharedArrayBuffer)))return te(J,M,F);if(typeof J=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=J.valueOf&&J.valueOf();if(Y!=null&&Y!==J)return c.from(Y,M,F);const re=ie(J);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof J[Symbol.toPrimitive]=="function")return c.from(J[Symbol.toPrimitive]("string"),M,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof J)}c.from=function(J,M,F){return k(J,M,F)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function C(J){if(typeof J!="number")throw new TypeError('"size" argument must be of type number');if(J<0)throw new RangeError('The value "'+J+'" is invalid for option "size"')}function N(J,M,F){return C(J),J<=0?i(J):M!==void 0?typeof F=="string"?i(J).fill(M,F):i(J).fill(M):i(J)}c.alloc=function(J,M,F){return N(J,M,F)};function j(J){return C(J),i(J<0?0:Q(J)|0)}c.allocUnsafe=function(J){return j(J)},c.allocUnsafeSlow=function(J){return j(J)};function Z(J,M){if((typeof M!="string"||M==="")&&(M="utf8"),!c.isEncoding(M))throw new TypeError("Unknown encoding: "+M);const F=he(J,M)|0;let Y=i(F);const re=Y.write(J,M);return re!==F&&(Y=Y.slice(0,re)),Y}function z(J){const M=J.length<0?0:Q(J.length)|0,F=i(M);for(let Y=0;Y<M;Y+=1)F[Y]=J[Y]&255;return F}function K(J){if(Qe(J,Uint8Array)){const M=new Uint8Array(J);return te(M.buffer,M.byteOffset,M.byteLength)}return z(J)}function te(J,M,F){if(M<0||J.byteLength<M)throw new RangeError('"offset" is outside of buffer bounds');if(J.byteLength<M+(F||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return M===void 0&&F===void 0?Y=new Uint8Array(J):F===void 0?Y=new Uint8Array(J,M):Y=new Uint8Array(J,M,F),Object.setPrototypeOf(Y,c.prototype),Y}function ie(J){if(c.isBuffer(J)){const M=Q(J.length)|0,F=i(M);return F.length===0||J.copy(F,0,0,M),F}if(J.length!==void 0)return typeof J.length!="number"||on(J.length)?i(0):z(J);if(J.type==="Buffer"&&Array.isArray(J.data))return z(J.data)}function Q(J){if(J>=b)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+b.toString(16)+" bytes");return J|0}function se(J){return+J!=J&&(J=0),c.alloc(+J)}c.isBuffer=function(M){return M!=null&&M._isBuffer===!0&&M!==c.prototype},c.compare=function(M,F){if(Qe(M,Uint8Array)&&(M=c.from(M,M.offset,M.byteLength)),Qe(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),!c.isBuffer(M)||!c.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(M===F)return 0;let Y=M.length,re=F.length;for(let fe=0,me=Math.min(Y,re);fe<me;++fe)if(M[fe]!==F[fe]){Y=M[fe],re=F[fe];break}return Y<re?-1:re<Y?1:0},c.isEncoding=function(M){switch(String(M).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}},c.concat=function(M,F){if(!Array.isArray(M))throw new TypeError('"list" argument must be an Array of Buffers');if(M.length===0)return c.alloc(0);let Y;if(F===void 0)for(F=0,Y=0;Y<M.length;++Y)F+=M[Y].length;const re=c.allocUnsafe(F);let fe=0;for(Y=0;Y<M.length;++Y){let me=M[Y];if(Qe(me,Uint8Array))fe+me.length>re.length?(c.isBuffer(me)||(me=c.from(me)),me.copy(re,fe)):Uint8Array.prototype.set.call(re,me,fe);else if(c.isBuffer(me))me.copy(re,fe);else throw new TypeError('"list" argument must be an Array of Buffers');fe+=me.length}return re};function he(J,M){if(c.isBuffer(J))return J.length;if(ArrayBuffer.isView(J)||Qe(J,ArrayBuffer))return J.byteLength;if(typeof J!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof J);const F=J.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&F===0)return 0;let re=!1;for(;;)switch(M){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return ot(J).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return Dt(J).length;default:if(re)return Y?-1:ot(J).length;M=(""+M).toLowerCase(),re=!0}}c.byteLength=he;function X(J,M,F){let Y=!1;if((M===void 0||M<0)&&(M=0),M>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0,M>>>=0,F<=M))return"";for(J||(J="utf8");;)switch(J){case"hex":return Ve(this,M,F);case"utf8":case"utf-8":return we(this,M,F);case"ascii":return Ue(this,M,F);case"latin1":case"binary":return Le(this,M,F);case"base64":return ve(this,M,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ut(this,M,F);default:if(Y)throw new TypeError("Unknown encoding: "+J);J=(J+"").toLowerCase(),Y=!0}}c.prototype._isBuffer=!0;function oe(J,M,F){const Y=J[M];J[M]=J[F],J[F]=Y}c.prototype.swap16=function(){const M=this.length;if(M%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let F=0;F<M;F+=2)oe(this,F,F+1);return this},c.prototype.swap32=function(){const M=this.length;if(M%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let F=0;F<M;F+=4)oe(this,F,F+3),oe(this,F+1,F+2);return this},c.prototype.swap64=function(){const M=this.length;if(M%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let F=0;F<M;F+=8)oe(this,F,F+7),oe(this,F+1,F+6),oe(this,F+2,F+5),oe(this,F+3,F+4);return this},c.prototype.toString=function(){const M=this.length;return M===0?"":arguments.length===0?we(this,0,M):X.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(M){if(!c.isBuffer(M))throw new TypeError("Argument must be a Buffer");return this===M?!0:c.compare(this,M)===0},c.prototype.inspect=function(){let M="";const F=$.INSPECT_MAX_BYTES;return M=this.toString("hex",0,F).replace(/(.{2})/g,"$1 ").trim(),this.length>F&&(M+=" ... "),"<Buffer "+M+">"},A&&(c.prototype[A]=c.prototype.inspect),c.prototype.compare=function(M,F,Y,re,fe){if(Qe(M,Uint8Array)&&(M=c.from(M,M.offset,M.byteLength)),!c.isBuffer(M))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof M);if(F===void 0&&(F=0),Y===void 0&&(Y=M?M.length:0),re===void 0&&(re=0),fe===void 0&&(fe=this.length),F<0||Y>M.length||re<0||fe>this.length)throw new RangeError("out of range index");if(re>=fe&&F>=Y)return 0;if(re>=fe)return-1;if(F>=Y)return 1;if(F>>>=0,Y>>>=0,re>>>=0,fe>>>=0,this===M)return 0;let me=fe-re,Te=Y-F;const qe=Math.min(me,Te),Pe=this.slice(re,fe),Ne=M.slice(F,Y);for(let Ae=0;Ae<qe;++Ae)if(Pe[Ae]!==Ne[Ae]){me=Pe[Ae],Te=Ne[Ae];break}return me<Te?-1:Te<me?1:0};function de(J,M,F,Y,re){if(J.length===0)return-1;if(typeof F=="string"?(Y=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,on(F)&&(F=re?0:J.length-1),F<0&&(F=J.length+F),F>=J.length){if(re)return-1;F=J.length-1}else if(F<0)if(re)F=0;else return-1;if(typeof M=="string"&&(M=c.from(M,Y)),c.isBuffer(M))return M.length===0?-1:ae(J,M,F,Y,re);if(typeof M=="number")return M=M&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(J,M,F):Uint8Array.prototype.lastIndexOf.call(J,M,F):ae(J,[M],F,Y,re);throw new TypeError("val must be string, number or Buffer")}function ae(J,M,F,Y,re){let fe=1,me=J.length,Te=M.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(J.length<2||M.length<2)return-1;fe=2,me/=2,Te/=2,F/=2}function qe(Ne,Ae){return fe===1?Ne[Ae]:Ne.readUInt16BE(Ae*fe)}let Pe;if(re){let Ne=-1;for(Pe=F;Pe<me;Pe++)if(qe(J,Pe)===qe(M,Ne===-1?0:Pe-Ne)){if(Ne===-1&&(Ne=Pe),Pe-Ne+1===Te)return Ne*fe}else Ne!==-1&&(Pe-=Pe-Ne),Ne=-1}else for(F+Te>me&&(F=me-Te),Pe=F;Pe>=0;Pe--){let Ne=!0;for(let Ae=0;Ae<Te;Ae++)if(qe(J,Pe+Ae)!==qe(M,Ae)){Ne=!1;break}if(Ne)return Pe}return-1}c.prototype.includes=function(M,F,Y){return this.indexOf(M,F,Y)!==-1},c.prototype.indexOf=function(M,F,Y){return de(this,M,F,Y,!0)},c.prototype.lastIndexOf=function(M,F,Y){return de(this,M,F,Y,!1)};function le(J,M,F,Y){F=Number(F)||0;const re=J.length-F;Y?(Y=Number(Y),Y>re&&(Y=re)):Y=re;const fe=M.length;Y>fe/2&&(Y=fe/2);let me;for(me=0;me<Y;++me){const Te=parseInt(M.substr(me*2,2),16);if(on(Te))return me;J[F+me]=Te}return me}function pe(J,M,F,Y){return Pt(ot(M,J.length-F),J,F,Y)}function ne(J,M,F,Y){return Pt(ft(M),J,F,Y)}function ue(J,M,F,Y){return Pt(Dt(M),J,F,Y)}function ye(J,M,F,Y){return Pt(rn(M,J.length-F),J,F,Y)}c.prototype.write=function(M,F,Y,re){if(F===void 0)re="utf8",Y=this.length,F=0;else if(Y===void 0&&typeof F=="string")re=F,Y=this.length,F=0;else if(isFinite(F))F=F>>>0,isFinite(Y)?(Y=Y>>>0,re===void 0&&(re="utf8")):(re=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const fe=this.length-F;if((Y===void 0||Y>fe)&&(Y=fe),M.length>0&&(Y<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let me=!1;for(;;)switch(re){case"hex":return le(this,M,F,Y);case"utf8":case"utf-8":return pe(this,M,F,Y);case"ascii":case"latin1":case"binary":return ne(this,M,F,Y);case"base64":return ue(this,M,F,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,M,F,Y);default:if(me)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),me=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ve(J,M,F){return M===0&&F===J.length?D.fromByteArray(J):D.fromByteArray(J.slice(M,F))}function we(J,M,F){F=Math.min(J.length,F);const Y=[];let re=M;for(;re<F;){const fe=J[re];let me=null,Te=fe>239?4:fe>223?3:fe>191?2:1;if(re+Te<=F){let qe,Pe,Ne,Ae;switch(Te){case 1:fe<128&&(me=fe);break;case 2:qe=J[re+1],(qe&192)===128&&(Ae=(fe&31)<<6|qe&63,Ae>127&&(me=Ae));break;case 3:qe=J[re+1],Pe=J[re+2],(qe&192)===128&&(Pe&192)===128&&(Ae=(fe&15)<<12|(qe&63)<<6|Pe&63,Ae>2047&&(Ae<55296||Ae>57343)&&(me=Ae));break;case 4:qe=J[re+1],Pe=J[re+2],Ne=J[re+3],(qe&192)===128&&(Pe&192)===128&&(Ne&192)===128&&(Ae=(fe&15)<<18|(qe&63)<<12|(Pe&63)<<6|Ne&63,Ae>65535&&Ae<1114112&&(me=Ae))}}me===null?(me=65533,Te=1):me>65535&&(me-=65536,Y.push(me>>>10&1023|55296),me=56320|me&1023),Y.push(me),re+=Te}return Be(Y)}const Ee=4096;function Be(J){const M=J.length;if(M<=Ee)return String.fromCharCode.apply(String,J);let F="",Y=0;for(;Y<M;)F+=String.fromCharCode.apply(String,J.slice(Y,Y+=Ee));return F}function Ue(J,M,F){let Y="";F=Math.min(J.length,F);for(let re=M;re<F;++re)Y+=String.fromCharCode(J[re]&127);return Y}function Le(J,M,F){let Y="";F=Math.min(J.length,F);for(let re=M;re<F;++re)Y+=String.fromCharCode(J[re]);return Y}function Ve(J,M,F){const Y=J.length;(!M||M<0)&&(M=0),(!F||F<0||F>Y)&&(F=Y);let re="";for(let fe=M;fe<F;++fe)re+=sn[J[fe]];return re}function ut(J,M,F){const Y=J.slice(M,F);let re="";for(let fe=0;fe<Y.length-1;fe+=2)re+=String.fromCharCode(Y[fe]+Y[fe+1]*256);return re}c.prototype.slice=function(M,F){const Y=this.length;M=~~M,F=F===void 0?Y:~~F,M<0?(M+=Y,M<0&&(M=0)):M>Y&&(M=Y),F<0?(F+=Y,F<0&&(F=0)):F>Y&&(F=Y),F<M&&(F=M);const re=this.subarray(M,F);return Object.setPrototypeOf(re,c.prototype),re};function xe(J,M,F){if(J%1!==0||J<0)throw new RangeError("offset is not uint");if(J+M>F)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||xe(M,F,this.length);let re=this[M],fe=1,me=0;for(;++me<F&&(fe*=256);)re+=this[M+me]*fe;return re},c.prototype.readUintBE=c.prototype.readUIntBE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||xe(M,F,this.length);let re=this[M+--F],fe=1;for(;F>0&&(fe*=256);)re+=this[M+--F]*fe;return re},c.prototype.readUint8=c.prototype.readUInt8=function(M,F){return M=M>>>0,F||xe(M,1,this.length),this[M]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(M,F){return M=M>>>0,F||xe(M,2,this.length),this[M]|this[M+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(M,F){return M=M>>>0,F||xe(M,2,this.length),this[M]<<8|this[M+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(M,F){return M=M>>>0,F||xe(M,4,this.length),(this[M]|this[M+1]<<8|this[M+2]<<16)+this[M+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(M,F){return M=M>>>0,F||xe(M,4,this.length),this[M]*16777216+(this[M+1]<<16|this[M+2]<<8|this[M+3])},c.prototype.readBigUInt64LE=mt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const re=F+this[++M]*2**8+this[++M]*2**16+this[++M]*2**24,fe=this[++M]+this[++M]*2**8+this[++M]*2**16+Y*2**24;return BigInt(re)+(BigInt(fe)<<BigInt(32))}),c.prototype.readBigUInt64BE=mt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const re=F*2**24+this[++M]*2**16+this[++M]*2**8+this[++M],fe=this[++M]*2**24+this[++M]*2**16+this[++M]*2**8+Y;return(BigInt(re)<<BigInt(32))+BigInt(fe)}),c.prototype.readIntLE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||xe(M,F,this.length);let re=this[M],fe=1,me=0;for(;++me<F&&(fe*=256);)re+=this[M+me]*fe;return fe*=128,re>=fe&&(re-=Math.pow(2,8*F)),re},c.prototype.readIntBE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||xe(M,F,this.length);let re=F,fe=1,me=this[M+--re];for(;re>0&&(fe*=256);)me+=this[M+--re]*fe;return fe*=128,me>=fe&&(me-=Math.pow(2,8*F)),me},c.prototype.readInt8=function(M,F){return M=M>>>0,F||xe(M,1,this.length),this[M]&128?(255-this[M]+1)*-1:this[M]},c.prototype.readInt16LE=function(M,F){M=M>>>0,F||xe(M,2,this.length);const Y=this[M]|this[M+1]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt16BE=function(M,F){M=M>>>0,F||xe(M,2,this.length);const Y=this[M+1]|this[M]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt32LE=function(M,F){return M=M>>>0,F||xe(M,4,this.length),this[M]|this[M+1]<<8|this[M+2]<<16|this[M+3]<<24},c.prototype.readInt32BE=function(M,F){return M=M>>>0,F||xe(M,4,this.length),this[M]<<24|this[M+1]<<16|this[M+2]<<8|this[M+3]},c.prototype.readBigInt64LE=mt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const re=this[M+4]+this[M+5]*2**8+this[M+6]*2**16+(Y<<24);return(BigInt(re)<<BigInt(32))+BigInt(F+this[++M]*2**8+this[++M]*2**16+this[++M]*2**24)}),c.prototype.readBigInt64BE=mt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const re=(F<<24)+this[++M]*2**16+this[++M]*2**8+this[++M];return(BigInt(re)<<BigInt(32))+BigInt(this[++M]*2**24+this[++M]*2**16+this[++M]*2**8+Y)}),c.prototype.readFloatLE=function(M,F){return M=M>>>0,F||xe(M,4,this.length),O.read(this,M,!0,23,4)},c.prototype.readFloatBE=function(M,F){return M=M>>>0,F||xe(M,4,this.length),O.read(this,M,!1,23,4)},c.prototype.readDoubleLE=function(M,F){return M=M>>>0,F||xe(M,8,this.length),O.read(this,M,!0,52,8)},c.prototype.readDoubleBE=function(M,F){return M=M>>>0,F||xe(M,8,this.length),O.read(this,M,!1,52,8)};function $e(J,M,F,Y,re,fe){if(!c.isBuffer(J))throw new TypeError('"buffer" argument must be a Buffer instance');if(M>re||M<fe)throw new RangeError('"value" argument is out of bounds');if(F+Y>J.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(M,F,Y,re){if(M=+M,F=F>>>0,Y=Y>>>0,!re){const Te=Math.pow(2,8*Y)-1;$e(this,M,F,Y,Te,0)}let fe=1,me=0;for(this[F]=M&255;++me<Y&&(fe*=256);)this[F+me]=M/fe&255;return F+Y},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(M,F,Y,re){if(M=+M,F=F>>>0,Y=Y>>>0,!re){const Te=Math.pow(2,8*Y)-1;$e(this,M,F,Y,Te,0)}let fe=Y-1,me=1;for(this[F+fe]=M&255;--fe>=0&&(me*=256);)this[F+fe]=M/me&255;return F+Y},c.prototype.writeUint8=c.prototype.writeUInt8=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,1,255,0),this[F]=M&255,F+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,65535,0),this[F]=M&255,this[F+1]=M>>>8,F+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,65535,0),this[F]=M>>>8,this[F+1]=M&255,F+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,4294967295,0),this[F+3]=M>>>24,this[F+2]=M>>>16,this[F+1]=M>>>8,this[F]=M&255,F+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,4294967295,0),this[F]=M>>>24,this[F+1]=M>>>16,this[F+2]=M>>>8,this[F+3]=M&255,F+4};function nt(J,M,F,Y,re){Ie(M,Y,re,J,F,7);let fe=Number(M&BigInt(4294967295));J[F++]=fe,fe=fe>>8,J[F++]=fe,fe=fe>>8,J[F++]=fe,fe=fe>>8,J[F++]=fe;let me=Number(M>>BigInt(32)&BigInt(4294967295));return J[F++]=me,me=me>>8,J[F++]=me,me=me>>8,J[F++]=me,me=me>>8,J[F++]=me,F}function Me(J,M,F,Y,re){Ie(M,Y,re,J,F,7);let fe=Number(M&BigInt(4294967295));J[F+7]=fe,fe=fe>>8,J[F+6]=fe,fe=fe>>8,J[F+5]=fe,fe=fe>>8,J[F+4]=fe;let me=Number(M>>BigInt(32)&BigInt(4294967295));return J[F+3]=me,me=me>>8,J[F+2]=me,me=me>>8,J[F+1]=me,me=me>>8,J[F]=me,F+8}c.prototype.writeBigUInt64LE=mt(function(M,F=0){return nt(this,M,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=mt(function(M,F=0){return Me(this,M,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(M,F,Y,re){if(M=+M,F=F>>>0,!re){const qe=Math.pow(2,8*Y-1);$e(this,M,F,Y,qe-1,-qe)}let fe=0,me=1,Te=0;for(this[F]=M&255;++fe<Y&&(me*=256);)M<0&&Te===0&&this[F+fe-1]!==0&&(Te=1),this[F+fe]=(M/me>>0)-Te&255;return F+Y},c.prototype.writeIntBE=function(M,F,Y,re){if(M=+M,F=F>>>0,!re){const qe=Math.pow(2,8*Y-1);$e(this,M,F,Y,qe-1,-qe)}let fe=Y-1,me=1,Te=0;for(this[F+fe]=M&255;--fe>=0&&(me*=256);)M<0&&Te===0&&this[F+fe+1]!==0&&(Te=1),this[F+fe]=(M/me>>0)-Te&255;return F+Y},c.prototype.writeInt8=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,1,127,-128),M<0&&(M=255+M+1),this[F]=M&255,F+1},c.prototype.writeInt16LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,32767,-32768),this[F]=M&255,this[F+1]=M>>>8,F+2},c.prototype.writeInt16BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,32767,-32768),this[F]=M>>>8,this[F+1]=M&255,F+2},c.prototype.writeInt32LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,2147483647,-2147483648),this[F]=M&255,this[F+1]=M>>>8,this[F+2]=M>>>16,this[F+3]=M>>>24,F+4},c.prototype.writeInt32BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,2147483647,-2147483648),M<0&&(M=4294967295+M+1),this[F]=M>>>24,this[F+1]=M>>>16,this[F+2]=M>>>8,this[F+3]=M&255,F+4},c.prototype.writeBigInt64LE=mt(function(M,F=0){return nt(this,M,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=mt(function(M,F=0){return Me(this,M,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function We(J,M,F,Y,re,fe){if(F+Y>J.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function rt(J,M,F,Y,re){return M=+M,F=F>>>0,re||We(J,M,F,4),O.write(J,M,F,Y,23,4),F+4}c.prototype.writeFloatLE=function(M,F,Y){return rt(this,M,F,!0,Y)},c.prototype.writeFloatBE=function(M,F,Y){return rt(this,M,F,!1,Y)};function Ke(J,M,F,Y,re){return M=+M,F=F>>>0,re||We(J,M,F,8),O.write(J,M,F,Y,52,8),F+8}c.prototype.writeDoubleLE=function(M,F,Y){return Ke(this,M,F,!0,Y)},c.prototype.writeDoubleBE=function(M,F,Y){return Ke(this,M,F,!1,Y)},c.prototype.copy=function(M,F,Y,re){if(!c.isBuffer(M))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!re&&re!==0&&(re=this.length),F>=M.length&&(F=M.length),F||(F=0),re>0&&re<Y&&(re=Y),re===Y||M.length===0||this.length===0)return 0;if(F<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),M.length-F<re-Y&&(re=M.length-F+Y);const fe=re-Y;return this===M&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(F,Y,re):Uint8Array.prototype.set.call(M,this.subarray(Y,re),F),fe},c.prototype.fill=function(M,F,Y,re){if(typeof M=="string"){if(typeof F=="string"?(re=F,F=0,Y=this.length):typeof Y=="string"&&(re=Y,Y=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!c.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(M.length===1){const me=M.charCodeAt(0);(re==="utf8"&&me<128||re==="latin1")&&(M=me)}}else typeof M=="number"?M=M&255:typeof M=="boolean"&&(M=Number(M));if(F<0||this.length<F||this.length<Y)throw new RangeError("Out of range index");if(Y<=F)return this;F=F>>>0,Y=Y===void 0?this.length:Y>>>0,M||(M=0);let fe;if(typeof M=="number")for(fe=F;fe<Y;++fe)this[fe]=M;else{const me=c.isBuffer(M)?M:c.from(M,re),Te=me.length;if(Te===0)throw new TypeError('The value "'+M+'" is invalid for argument "value"');for(fe=0;fe<Y-F;++fe)this[fe+F]=me[fe%Te]}return this};const ze={};function _e(J,M,F){ze[J]=class extends F{constructor(){super(),Object.defineProperty(this,"message",{value:M.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${J}]`,this.stack,delete this.name}get code(){return J}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${J}]: ${this.message}`}}}_e("ERR_BUFFER_OUT_OF_BOUNDS",function(J){return J?`${J} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_e("ERR_INVALID_ARG_TYPE",function(J,M){return`The "${J}" argument must be of type number. Received type ${typeof M}`},TypeError),_e("ERR_OUT_OF_RANGE",function(J,M,F){let Y=`The value of "${J}" is out of range.`,re=F;return Number.isInteger(F)&&Math.abs(F)>2**32?re=ke(String(F)):typeof F=="bigint"&&(re=String(F),(F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))&&(re=ke(re)),re+="n"),Y+=` It must be ${M}. Received ${re}`,Y},RangeError);function ke(J){let M="",F=J.length;const Y=J[0]==="-"?1:0;for(;F>=Y+4;F-=3)M=`_${J.slice(F-3,F)}${M}`;return`${J.slice(0,F)}${M}`}function ge(J,M,F){Ce(M,"offset"),(J[M]===void 0||J[M+F]===void 0)&&Fe(M,J.length-(F+1))}function Ie(J,M,F,Y,re,fe){if(J>F||J<M){const me=typeof M=="bigint"?"n":"";let Te;throw M===0||M===BigInt(0)?Te=`>= 0${me} and < 2${me} ** ${(fe+1)*8}${me}`:Te=`>= -(2${me} ** ${(fe+1)*8-1}${me}) and < 2 ** ${(fe+1)*8-1}${me}`,new ze.ERR_OUT_OF_RANGE("value",Te,J)}ge(Y,re,fe)}function Ce(J,M){if(typeof J!="number")throw new ze.ERR_INVALID_ARG_TYPE(M,"number",J)}function Fe(J,M,F){throw Math.floor(J)!==J?(Ce(J,F),new ze.ERR_OUT_OF_RANGE("offset","an integer",J)):M<0?new ze.ERR_BUFFER_OUT_OF_BOUNDS:new ze.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${M}`,J)}const Ze=/[^+/0-9A-Za-z-_]/g;function He(J){if(J=J.split("=")[0],J=J.trim().replace(Ze,""),J.length<2)return"";for(;J.length%4!==0;)J=J+"=";return J}function ot(J,M){M=M||1/0;let F;const Y=J.length;let re=null;const fe=[];for(let me=0;me<Y;++me){if(F=J.charCodeAt(me),F>55295&&F<57344){if(!re){if(F>56319){(M-=3)>-1&&fe.push(239,191,189);continue}else if(me+1===Y){(M-=3)>-1&&fe.push(239,191,189);continue}re=F;continue}if(F<56320){(M-=3)>-1&&fe.push(239,191,189),re=F;continue}F=(re-55296<<10|F-56320)+65536}else re&&(M-=3)>-1&&fe.push(239,191,189);if(re=null,F<128){if((M-=1)<0)break;fe.push(F)}else if(F<2048){if((M-=2)<0)break;fe.push(F>>6|192,F&63|128)}else if(F<65536){if((M-=3)<0)break;fe.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((M-=4)<0)break;fe.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw new Error("Invalid code point")}return fe}function ft(J){const M=[];for(let F=0;F<J.length;++F)M.push(J.charCodeAt(F)&255);return M}function rn(J,M){let F,Y,re;const fe=[];for(let me=0;me<J.length&&!((M-=2)<0);++me)F=J.charCodeAt(me),Y=F>>8,re=F%256,fe.push(re),fe.push(Y);return fe}function Dt(J){return D.toByteArray(He(J))}function Pt(J,M,F,Y){let re;for(re=0;re<Y&&!(re+F>=M.length||re>=J.length);++re)M[re+F]=J[re];return re}function Qe(J,M){return J instanceof M||J!=null&&J.constructor!=null&&J.constructor.name!=null&&J.constructor.name===M.name}function on(J){return J!==J}const sn=function(){const J="0123456789abcdef",M=new Array(256);for(let F=0;F<16;++F){const Y=F*16;for(let re=0;re<16;++re)M[Y+re]=J[F]+J[re]}return M}();function mt(J){return typeof BigInt>"u"?ln:J}function ln(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var $=toolsEbml&&toolsEbml.__assign||function(){return $=Object.assign||function(b){for(var S,i=1,c=arguments.length;i<c;i++){S=arguments[i];for(var k in S)Object.prototype.hasOwnProperty.call(S,k)&&(b[k]=S[k])}return b},$.apply(this,arguments)},D=toolsEbml&&toolsEbml.__spreadArray||function(b,S,i){if(i||arguments.length===2)for(var c=0,k=S.length,C;c<k;c++)(C||!(c in S))&&(C||(C=Array.prototype.slice.call(S,0,c)),C[c]=S[c]);return b.concat(C||Array.prototype.slice.call(S))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var O=requireTools(),A=function(){function b(){}return b.readVint=function(S,i){i===void 0&&(i=0);var c=8-Math.floor(Math.log2(S[i]));if(c>8){var k=b.readHexString(S,i,i+c);throw new Error("Unrepresentable length: ".concat(c," ").concat(k))}if(i+c>S.length)return null;for(var C=S[i]&(1<<8-c)-1,N=1;N<c;N+=1){if(N===7&&C>=Math.pow(2,8)&&S[i+7]>0)return{length:c,value:-1};C*=Math.pow(2,8),C+=S[i+N]}return{length:c,value:C}},b.writeVint=function(S){if(S<0||S>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(S));var i=1;for(i=1;i<=8&&!(S<Math.pow(2,7*i)-1);i+=1);for(var c=O.Buffer.alloc(i),k=S,C=1;C<=i;C+=1){var N=k&255;c[i-C]=N,k-=N,k/=Math.pow(2,8)}return c[0]|=1<<8-i,c},b.concatenate=function(S,i){return!S&&!i?O.Buffer.from([]):!S||S.byteLength===0?i:!i||i.byteLength===0?S:O.Buffer.from(D(D([],S,!0),i,!0))},b.readHexString=function(S,i,c){return i===void 0&&(i=0),c===void 0&&(c=S.byteLength),Array.from(S.slice(i,c)).map(function(k){return Number(k).toString(16)}).reduce(function(k,C){return"".concat(k).concat(C.padStart(2,"0"))},"")},b.readUtf8=function(S){try{return O.Buffer.from(S).toString("utf8")}catch{return null}},b.readUnsigned=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return S.byteLength<=6?S.reduce(function(c,k){return c*256+k},0):b.readHexString(S,0,S.byteLength)},b.readSigned=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},b.readFloat=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},b.readDate=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 1:return new Date(i.getUint8(0));case 2:return new Date(i.getUint16(0));case 4:return new Date(i.getUint32(0));case 8:return new Date(Number.parseInt(b.readHexString(S),16));default:return new Date(0)}},b.readDataFromTag=function(S,i){var c=S.type,k=S.name,C=S.track,N=S.discardable||!1,j=S.keyframe||!1,Z=null,z;switch(c){case"u":z=b.readUnsigned(i);break;case"f":z=b.readFloat(i);break;case"i":z=b.readSigned(i);break;case"s":z=String.fromCharCode.apply(String,i);break;case"8":z=b.readUtf8(i);break;case"d":z=b.readDate(i);break}if(k==="SimpleBlock"||k==="Block"){var K=0,te=b.readVint(i,K),ie=te.length,Q=te.value;K+=ie,C=Q,z=b.readSigned(i.subarray(K,K+2)),K+=2,k==="SimpleBlock"&&(j=!!(i[ie+2]&128),N=!!(i[ie+2]&1)),K+=1,Z=i.subarray(K)}return $($({},S),{data:i,discardable:N,keyframe:j,payload:Z,track:C,value:z})},b}();return toolsEbml.default=A,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function($,D,O){D=D||0;for(var A=1;A<=8&&!($[D]>=Math.pow(2,8-A));A++);if(A>8)throw new Error("Unrepresentable length: "+A+" "+$.toString("hex",D,D+A));if(D+A>$.length)return null;var b,S=$[D]&(1<<8-A)-1;for(b=1;b<A;b++){if(b===7&&S>=Math.pow(2,45)&&$[D+7]>0)return{length:A,value:-1};S*=Math.pow(2,8),S+=$[D+b]}return O&&(S-=Math.pow(2,A*7-1)-1),{length:A,value:S}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var $=requireVint();function D(O){this.buffer=O,this.offset=0}return D.prototype.nextInt16BE=function(){var O=this.buffer.readInt16BE(this.offset);return this.offset+=2,O},D.prototype.nextUInt8=function(){var O=this.buffer.readUInt8(this.offset);return this.offset+=1,O},D.prototype.nextUIntV=function(){var O=$(this.buffer,this.offset);return this.offset+=O.length,O.value},D.prototype.nextIntV=function(){var O=$(this.buffer,this.offset,!0);return this.offset+=O.length,O.value},D.prototype.nextBuffer=function(O){var A=O?this.buffer.slice(this.offset,this.offset+O):this.buffer.slice(this.offset);return this.offset+=O||this.length,A},Object.defineProperty(D.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=D,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var $=requireBufferReader(),D=1,O=3,A=2;ebmlBlock=function(S){var i={},c=new $(S);i.trackNumber=c.nextUIntV(),i.timecode=c.nextInt16BE();var k=c.nextUInt8();i.invisible=!!(k&8),i.keyframe=!!(k&128),i.discardable=!!(k&1);var C=(k&6)>>1;return i.frames=b(c,C),i};function b(S,i){if(!i)return[S.nextBuffer()];var c,k,C=[],N=S.nextUInt8()+1;if(i===A){if(S.length%N!==0)throw new Error("Fixed-Size Lacing Error");for(k=S.length/N,c=0;c<N;c++)C.push(S.nextBuffer(k));return C}var j=[];if(i===D)for(c=0;c<N-1;c++){var Z;k=0;do Z=S.nextUInt8(),k+=Z;while(Z===255);j.push(k)}else if(i===O)for(k=S.nextUIntV(),j.push(k),c=1;c<N-1;c++)k+=S.nextIntV(),j.push(k);for(c=0;c<N-1;c++)C.push(S.nextBuffer(j[c]));return C.push(S.nextBuffer()),C}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function($){Object.defineProperty($,"__esModule",{value:!0}),$.convertEBMLDateToJSDate=$.createFloatBuffer=$.createIntBuffer=$.createUIntBuffer=$.encodeValueToBuffer=$.concat=$.putRefinedMetaData=$.extractElement=$.removeElement=$.makeMetadataSeekable=$.createRIFFChunk=$.VP8BitStreamToRiffWebPBuffer=$.WebPBlockFilter=$.encodeTag=$.readBlock=$.ebmlBlock=$.writeVint=$.readVint=$.Buffer=void 0;var D=requireInt64Buffer(),O=requireEBMLEncoder(),A=requireBuffer(),b=requireToolsEbml(),S=requireEbmlBlock();$.Buffer=A.Buffer,$.readVint=b.default.readVint,$.writeVint=b.default.writeVint,$.ebmlBlock=S;function i(ne){return(0,$.ebmlBlock)(new $.Buffer(ne))}$.readBlock=i;function c(ne,ue,ye){return ye===void 0&&(ye=!1),X([ne,ye?new $.Buffer("01ffffffffffffff","hex"):(0,$.writeVint)(ue.length),ue])}$.encodeTag=c;function k(ne){return ne.reduce(function(ue,ye){if(ye.type!=="b"||ye.name!=="SimpleBlock")return ue;var ve=(0,$.ebmlBlock)(ye.data),we=ve.frames.some(function(Ee){var Be=Ee.slice(3,6).toString("hex");return Be==="9d012a"});return we?ue.concat(ye):ue},[])}$.WebPBlockFilter=k;function C(ne){var ue=N("VP8 ",ne),ye=X([new $.Buffer("WEBP","ascii"),ue]);return N("RIFF",ye)}$.VP8BitStreamToRiffWebPBuffer=C;function N(ne,ue){var ye=new $.Buffer(4);return ye.writeUInt32LE(ue.byteLength,0),X([new $.Buffer(ne.substr(0,4),"ascii"),ye,ue,new $.Buffer(ue.byteLength%2===0?0:1)])}$.createRIFFChunk=N;function j(ne,ue,ye){var ve=z("EBML",ne),we=te(ve),Ee=we+12,Be=ne[ne.length-1].dataEnd-Ee,Ue=z("Info",ne);Z("Duration",Ue),Ue.splice(1,0,{name:"Duration",type:"f",data:le(ue,8)});for(var Le=te(Ue),Ve=z("Tracks",ne),ut=te(Ve),xe=47,$e=[],nt=5+ye.length*15,Me=[],We=-1,rt=10,Ke=function(Ie){var Ce=xe,Fe=Ce+Le,Ze=Fe+ut,He=Ze+nt,ot=He-Be;if($e=[],$e.push({name:"SeekHead",type:"m",isEnd:!1}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new $.Buffer([21,73,169,102])}),$e.push({name:"SeekPosition",type:"u",data:de(Ce)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new $.Buffer([22,84,174,107])}),$e.push({name:"SeekPosition",type:"u",data:de(Fe)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new $.Buffer([28,83,187,107])}),$e.push({name:"SeekPosition",type:"u",data:de(Ze)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"SeekHead",type:"m",isEnd:!0}),xe=te($e),Me=[],Me.push({name:"Cues",type:"m",isEnd:!1}),ye.forEach(function(ft){var rn=ft.CueTrack,Dt=ft.CueClusterPosition,Pt=ft.CueTime;Me.push({name:"CuePoint",type:"m",isEnd:!1}),Me.push({name:"CueTime",type:"u",data:de(Pt)}),Me.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Me.push({name:"CueTrack",type:"u",data:de(rn)}),Dt-=Ee,Dt+=ot,Me.push({name:"CueClusterPosition",type:"u",data:de(Dt)}),Me.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Me.push({name:"CuePoint",type:"m",isEnd:!0})}),Me.push({name:"Cues",type:"m",isEnd:!0}),nt=te(Me),We!==ot){if(We=ot,Ie===rt-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},ze=0;ze<rt;ze++){var _e=Ke(ze);if(_e==="break")break}var ke=[].concat.apply([],[ve,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},$e,Ue,Ve,Me]),ge=new O.default().encode(ke);return ge}$.makeMetadataSeekable=j;function Z(ne,ue){for(var ye=-1,ve=0;ve<ue.length;ve++){var we=ue[ve];if(we.name===ne)if(we.type==="m")if(!we.isEnd)ye=ve;else{if(ye==-1)throw new Error("Detected ".concat(ne," closing element before finding the start"));ue.splice(ye,ve-ye+1);return}else{ue.splice(ve,1);return}}}$.removeElement=Z;function z(ne,ue){for(var ye=[],ve=-1,we=0;we<ue.length;we++){var Ee=ue[we];if(Ee.name===ne)if(Ee.type==="m")if(!Ee.isEnd)ve=we;else{if(ve==-1)throw new Error("Detected ".concat(ne," closing element before finding the start"));ye=ue.slice(ve,we+1);break}else{ye.push(ue[we]);break}}return ye}$.extractElement=z;function K(ne,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 ye=[],ve=[],we=0;we<ne.length;we++){var Ee=ne[we];if(Ee.type==="m"&&Ee.name==="Segment"){if(ye=ne.slice(0,we),ve=ne.slice(we),Ee.unknownSize){ve.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(ve[ve.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Be=ve[ve.length-1].dataEnd,Ue=ye[ye.length-1].dataEnd,Le=new O.default().encode(ye).byteLength,Ve=Le-Ue,ut=Be-ve[0].tagStart;ve[0].tagStart-Ue,ve[0].tagStart;var xe=new $.Buffer([24,83,128,103]),$e=new $.Buffer("01ffffffffffffff","hex"),nt=xe.byteLength+$e.byteLength,Me=ut,We;for(We=1;We<20;We++){var rt=Ue+nt+Me,Ke=rt-Be,ze=Ve+Ke,_e=ie(ve,ze,ue),ke=new O.default().encode(_e).byteLength;if(ke===Me)return new O.default().encode([].concat(ye,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],_e));Me=ke}throw new Error("unable to refine metadata, stable size could not be found in "+We+" iterations!")}$.putRefinedMetaData=K;function te(ne){var ue=new O.default;return ne.reduce(function(ye,ve){return ye.concat(ue.encode([ve]))},[]).reduce(function(ye,ve){return ye+ve.byteLength},0)}function ie(ne,ue,ye){var ve=ye.duration,we=ye.clusterPtrs,Ee=ye.cues,Be=ne.slice(0);if(typeof ve=="number"){var Ue=!1;Be.forEach(function(Ve){Ve.type==="f"&&Ve.name==="Duration"&&(Ue=!0,Ve.data=le(ve,8))}),Ue||he(Be,"Info",[{name:"Duration",type:"f",data:le(ve,8)}])}Array.isArray(Ee)&&he(Be,"Cues",se(Ee,ue));var Le=[];return Array.isArray(we)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Le=Q(we,ue)),he(Be,"SeekHead",Le,!0),Be}function Q(ne,ue){var ye=[];return ne.forEach(function(ve){ye.push({name:"Seek",type:"m",isEnd:!1}),ye.push({name:"SeekID",type:"b",data:new $.Buffer([31,67,182,117])}),ye.push({name:"SeekPosition",type:"u",data:de(ve+ue)}),ye.push({name:"Seek",type:"m",isEnd:!0})}),ye}function se(ne,ue){var ye=[];return ne.forEach(function(ve){var we=ve.CueTrack,Ee=ve.CueClusterPosition,Be=ve.CueTime;ye.push({name:"CuePoint",type:"m",isEnd:!1}),ye.push({name:"CueTime",type:"u",data:de(Be)}),ye.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ye.push({name:"CueTrack",type:"u",data:de(we)}),ye.push({name:"CueClusterPosition",type:"u",data:de(Ee+ue)}),ye.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ye.push({name:"CuePoint",type:"m",isEnd:!0})}),ye}function he(ne,ue,ye,ve){ve===void 0&&(ve=!1);for(var we=-1,Ee=0;Ee<ne.length;Ee++){var Be=ne[Ee];if(Be.type==="m"&&Be.name===ue&&Be.isEnd===!1){we=Ee;break}}we>=0?Array.prototype.splice.apply(ne,[we+1,0].concat(ye)):ve?[].concat([{name:ue,type:"m",isEnd:!1}],ye,[{name:ue,type:"m",isEnd:!0}]).reverse().forEach(function(Ue){ne.unshift(Ue)}):(ne.push({name:ue,type:"m",isEnd:!1}),ye.forEach(function(Ue){ne.push(Ue)}),ne.push({name:ue,type:"m",isEnd:!0}))}function X(ne){return $.Buffer.concat(ne)}$.concat=X;function oe(ne){var ue=new $.Buffer(0);if(ne.type==="m")return ne;switch(ne.type){case"u":ue=de(ne.value);break;case"i":ue=ae(ne.value);break;case"f":ue=le(ne.value);break;case"s":ue=new $.Buffer(ne.value,"ascii");break;case"8":ue=new $.Buffer(ne.value,"utf8");break;case"b":ue=ne.value;break;case"d":ue=new D.Int64BE(ne.value.getTime().toString()).toBuffer();break}return Object.assign({},ne,{data:ue})}$.encodeValueToBuffer=oe;function de(ne){for(var ue=1;ne>=Math.pow(2,8*ue);ue++);if(ue>=7)return console.warn("7bit or more bigger uint not supported."),new D.Uint64BE(ne).toBuffer();var ye=new $.Buffer(ue);return ye.writeUIntBE(ne,0,ue),ye}$.createUIntBuffer=de;function ae(ne){for(var ue=1;ne>=Math.pow(2,8*ue);ue++);if(ue>=7)return console.warn("7bit or more bigger uint not supported."),new D.Int64BE(ne).toBuffer();var ye=new $.Buffer(ue);return ye.writeIntBE(ne,0,ue),ye}$.createIntBuffer=ae;function le(ne,ue){if(ue===void 0&&(ue=8),ue===8){var ye=new $.Buffer(8);return ye.writeDoubleBE(ne,0),ye}else if(ue===4){var ye=new $.Buffer(4);return ye.writeFloatBE(ne,0),ye}else throw new Error("float type bits must 4bytes or 8bytes")}$.createFloatBuffer=le;function pe(ne){return ne instanceof Date?ne:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(ne)/1e3/1e3)}$.convertEBMLDateToJSDate=pe}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var $=requireInt64Buffer(),D=requireTools(),O=requireTools(),A=requireEbmlID(),b;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(b||(b={}));var S=function(){function i(){this._buffer=new D.Buffer(0),this._tag_stack=[],this._state=b.STATE_TAG,this._cursor=0,this._total=0,this._schema=A.byEbmlID,this._result=[]}return i.prototype.decode=function(c){this.readChunk(c);var k=this._result;return this._result=[],k},i.prototype.readChunk=function(c){for(this._buffer=O.concat([this._buffer,new D.Buffer(c)]);this._cursor<this._buffer.length&&!(this._state===b.STATE_TAG&&!this.readTag()||this._state===b.STATE_SIZE&&!this.readSize()||this._state===b.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(c){return this._schema[c]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,D.readVint)(this._buffer,this._cursor);if(c==null)return!1;var k=this._buffer.slice(this._cursor,this._cursor+c.length),C=k.reduce(function(Z,z,K,te){return Z+z*Math.pow(16,2*(te.length-1-K))},0),N=this.getSchemaInfo(C),j={EBML_ID:C.toString(16),schema:N,type:N.type,name:N.name,level:N.level,tagStart:this._total,tagEnd:this._total+c.length,sizeStart:this._total+c.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(j),this._cursor+=c.length,this._total+=c.length,this._state=b.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,D.readVint)(this._buffer,this._cursor);if(c==null)return!1;var k=this._tag_stack[this._tag_stack.length-1];return k.sizeEnd=k.sizeStart+c.length,k.dataStart=k.sizeEnd,k.dataSize=c.value,c.value===-1?(k.dataEnd=-1,k.type==="m"&&(k.unknownSize=!0)):k.dataEnd=k.sizeEnd+c.value,this._cursor+=c.length,this._total+=c.length,this._state=b.STATE_CONTENT,!0},i.prototype.readContent=function(){var c=this._tag_stack[this._tag_stack.length-1];if(c.type==="m"){if(c.isEnd=!1,this._result.push(c),this._state=b.STATE_TAG,c.dataSize===0){var k=Object.assign({},c,{isEnd:!0});this._result.push(k),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+c.dataSize)return!1;var C=this._buffer.slice(this._cursor,this._cursor+c.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+c.dataSize),c.data=C,c.type){case"u":c.value=C.readUIntBE(0,C.length);break;case"i":c.value=C.readIntBE(0,C.length);break;case"f":c.value=c.dataSize===4?C.readFloatBE(0):c.dataSize===8?C.readDoubleBE(0):(console.warn("cannot read ".concat(c.dataSize," octets float. failback to 0")),0);break;case"s":c.value=C.toString("ascii");break;case"8":c.value=C.toString("utf8");break;case"b":c.value=C;break;case"d":c.value=(0,D.convertEBMLDateToJSDate)(new $.Int64BE(C).toNumber());break}if(c.value===null)throw new Error("unknown tag type:"+c.type);for(this._result.push(c),this._total+=c.dataSize,this._state=b.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var N=this._tag_stack[this._tag_stack.length-1];if(N.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<N.dataEnd)break;if(N.type!=="m")throw new Error("parent element is not master element");var k=Object.assign({},N,{isEnd:!0});this._result.push(k),this._tag_stack.pop()}return!0},i}();return EBMLDecoder.default=S,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var $=typeof Reflect=="object"?Reflect:null,D=$&&typeof $.apply=="function"?$.apply:function(oe,de,ae){return Function.prototype.apply.call(oe,de,ae)},O;$&&typeof $.ownKeys=="function"?O=$.ownKeys:Object.getOwnPropertySymbols?O=function(oe){return Object.getOwnPropertyNames(oe).concat(Object.getOwnPropertySymbols(oe))}:O=function(oe){return Object.getOwnPropertyNames(oe)};function A(X){console&&console.warn&&console.warn(X)}var b=Number.isNaN||function(oe){return oe!==oe};function S(){S.init.call(this)}events.exports=S,events.exports.once=Q,S.EventEmitter=S,S.prototype._events=void 0,S.prototype._eventsCount=0,S.prototype._maxListeners=void 0;var i=10;function c(X){if(typeof X!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof X)}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(X){if(typeof X!="number"||X<0||b(X))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+X+".");i=X}}),S.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},S.prototype.setMaxListeners=function(oe){if(typeof oe!="number"||oe<0||b(oe))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+oe+".");return this._maxListeners=oe,this};function k(X){return X._maxListeners===void 0?S.defaultMaxListeners:X._maxListeners}S.prototype.getMaxListeners=function(){return k(this)},S.prototype.emit=function(oe){for(var de=[],ae=1;ae<arguments.length;ae++)de.push(arguments[ae]);var le=oe==="error",pe=this._events;if(pe!==void 0)le=le&&pe.error===void 0;else if(!le)return!1;if(le){var ne;if(de.length>0&&(ne=de[0]),ne instanceof Error)throw ne;var ue=new Error("Unhandled error."+(ne?" ("+ne.message+")":""));throw ue.context=ne,ue}var ye=pe[oe];if(ye===void 0)return!1;if(typeof ye=="function")D(ye,this,de);else for(var ve=ye.length,we=K(ye,ve),ae=0;ae<ve;++ae)D(we[ae],this,de);return!0};function C(X,oe,de,ae){var le,pe,ne;if(c(de),pe=X._events,pe===void 0?(pe=X._events=Object.create(null),X._eventsCount=0):(pe.newListener!==void 0&&(X.emit("newListener",oe,de.listener?de.listener:de),pe=X._events),ne=pe[oe]),ne===void 0)ne=pe[oe]=de,++X._eventsCount;else if(typeof ne=="function"?ne=pe[oe]=ae?[de,ne]:[ne,de]:ae?ne.unshift(de):ne.push(de),le=k(X),le>0&&ne.length>le&&!ne.warned){ne.warned=!0;var ue=new Error("Possible EventEmitter memory leak detected. "+ne.length+" "+String(oe)+" listeners added. Use emitter.setMaxListeners() to increase limit");ue.name="MaxListenersExceededWarning",ue.emitter=X,ue.type=oe,ue.count=ne.length,A(ue)}return X}S.prototype.addListener=function(oe,de){return C(this,oe,de,!1)},S.prototype.on=S.prototype.addListener,S.prototype.prependListener=function(oe,de){return C(this,oe,de,!0)};function N(){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 j(X,oe,de){var ae={fired:!1,wrapFn:void 0,target:X,type:oe,listener:de},le=N.bind(ae);return le.listener=de,ae.wrapFn=le,le}S.prototype.once=function(oe,de){return c(de),this.on(oe,j(this,oe,de)),this},S.prototype.prependOnceListener=function(oe,de){return c(de),this.prependListener(oe,j(this,oe,de)),this},S.prototype.removeListener=function(oe,de){var ae,le,pe,ne,ue;if(c(de),le=this._events,le===void 0)return this;if(ae=le[oe],ae===void 0)return this;if(ae===de||ae.listener===de)--this._eventsCount===0?this._events=Object.create(null):(delete le[oe],le.removeListener&&this.emit("removeListener",oe,ae.listener||de));else if(typeof ae!="function"){for(pe=-1,ne=ae.length-1;ne>=0;ne--)if(ae[ne]===de||ae[ne].listener===de){ue=ae[ne].listener,pe=ne;break}if(pe<0)return this;pe===0?ae.shift():te(ae,pe),ae.length===1&&(le[oe]=ae[0]),le.removeListener!==void 0&&this.emit("removeListener",oe,ue||de)}return this},S.prototype.off=S.prototype.removeListener,S.prototype.removeAllListeners=function(oe){var de,ae,le;if(ae=this._events,ae===void 0)return this;if(ae.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ae[oe]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ae[oe]),this;if(arguments.length===0){var pe=Object.keys(ae),ne;for(le=0;le<pe.length;++le)ne=pe[le],ne!=="removeListener"&&this.removeAllListeners(ne);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(de=ae[oe],typeof de=="function")this.removeListener(oe,de);else if(de!==void 0)for(le=de.length-1;le>=0;le--)this.removeListener(oe,de[le]);return this};function Z(X,oe,de){var ae=X._events;if(ae===void 0)return[];var le=ae[oe];return le===void 0?[]:typeof le=="function"?de?[le.listener||le]:[le]:de?ie(le):K(le,le.length)}S.prototype.listeners=function(oe){return Z(this,oe,!0)},S.prototype.rawListeners=function(oe){return Z(this,oe,!1)},S.listenerCount=function(X,oe){return typeof X.listenerCount=="function"?X.listenerCount(oe):z.call(X,oe)},S.prototype.listenerCount=z;function z(X){var oe=this._events;if(oe!==void 0){var de=oe[X];if(typeof de=="function")return 1;if(de!==void 0)return de.length}return 0}S.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]};function K(X,oe){for(var de=new Array(oe),ae=0;ae<oe;++ae)de[ae]=X[ae];return de}function te(X,oe){for(;oe+1<X.length;oe++)X[oe]=X[oe+1];X.pop()}function ie(X){for(var oe=new Array(X.length),de=0;de<oe.length;++de)oe[de]=X[de].listener||X[de];return oe}function Q(X,oe){return new Promise(function(de,ae){function le(ne){X.removeListener(oe,pe),ae(ne)}function pe(){typeof X.removeListener=="function"&&X.removeListener("error",le),de([].slice.call(arguments))}he(X,oe,pe,{once:!0}),oe!=="error"&&se(X,le,{once:!0})})}function se(X,oe,de){typeof X.on=="function"&&he(X,"error",oe,de)}function he(X,oe,de,ae){if(typeof X.on=="function")ae.once?X.once(oe,de):X.on(oe,de);else if(typeof X.addEventListener=="function")X.addEventListener(oe,function le(pe){ae.once&&X.removeEventListener(oe,le),de(pe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof X)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var $=EBMLReader&&EBMLReader.__extends||function(){var b=function(S,i){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,k){c.__proto__=k}||function(c,k){for(var C in k)Object.prototype.hasOwnProperty.call(k,C)&&(c[C]=k[C])},b(S,i)};return function(S,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");b(S,i);function c(){this.constructor=S}S.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var D=requireEvents(),O=requireTools(),A=function(b){$(S,b);function S(){var i=b.call(this)||this;return i.logGroup="",i.hasLoggingStarted=!1,i.metadataloaded=!1,i.chunks=[],i.stack=[],i.segmentOffset=0,i.last2SimpleBlockVideoTrackTimecode=[0,0],i.last2SimpleBlockAudioTrackTimecode=[0,0],i.lastClusterTimecode=0,i.lastClusterPosition=0,i.timecodeScale=1e6,i.metadataSize=0,i.metadatas=[],i.cues=[],i.firstVideoBlockRead=!1,i.firstAudioBlockRead=!1,i.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},i.trackTypes=[],i.trackDefaultDuration=[],i.trackCodecDelay=[],i.trackInfo={type:"nothing"},i.ended=!1,i.logging=!1,i.use_duration_every_simpleblock=!1,i.use_webp=!1,i.use_segment_info=!0,i.drop_default_duration=!0,i}return S.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()},S.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var C=this.lastClusterTimecode,N=this.duration,j=this.timecodeScale;this.emit("cluster",{timecode:C,data:i}),this.emit("duration",{timecodeScale:j,duration:N})}else{this.metadataloaded=!0,this.metadatas=i;var c=this.trackTypes.indexOf(1),k=this.trackTypes.indexOf(2);if(this.trackInfo=c>=0&&k>=0?{type:"both",trackNumber:c}:c>=0?{type:"video",trackNumber:c}:k>=0?{type:"audio",trackNumber:k}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},S.prototype.read=function(i){var c=this,k=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var C=this.stack[this.stack.length-1];if(C!=null&&C.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),C.dataEnd=i.dataEnd,C.dataSize=i.dataEnd-C.dataStart,C.unknownSize=!1;var N=Object.assign({},C,{name:C.name,type:C.type,isEnd:!0});this.chunks.push(N)}this.stack.push(i)}if(i.type==="m"&&i.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=i.dataStart,this.emit("segment_offset",this.segmentOffset);else if(i.type==="b"&&i.name==="SimpleBlock"){var j=O.ebmlBlock(i.data),Z=j.timecode,z=j.trackNumber,K=j.frames;if(this.trackTypes[z]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var te=this.lastClusterTimecode+Z;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],Z]}else if(this.trackTypes[z]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var te=this.lastClusterTimecode+Z;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],Z]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&K.forEach(function(ie){var Q=ie.slice(3,6).toString("hex");if(Q==="9d012a"){var se=O.VP8BitStreamToRiffWebPBuffer(ie),he=new Blob([se],{type:"image/webp"}),X=c.duration;c.emit("webp",{currentTime:X,webp:he})}})}else i.type==="m"&&i.name==="Cluster"&&i.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",i.tagStart),this.lastClusterPosition=i.tagStart):i.type==="u"&&i.name==="Timecode"?this.lastClusterTimecode=i.value:i.type==="u"&&i.name==="TimecodeScale"?this.timecodeScale=i.value:i.type==="m"&&i.name==="TrackEntry"?i.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}:i.type==="u"&&i.name==="TrackType"?this.currentTrack.TrackType=i.value:i.type==="u"&&i.name==="TrackNumber"?this.currentTrack.TrackNumber=i.value:i.type==="u"&&i.name==="CodecDelay"?this.currentTrack.CodecDelay=i.value:i.type==="u"&&i.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),k=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),k||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(S.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,c=0,k=0,C=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof C=="number")i=C;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof N=="number"&&(c=N),k=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof N=="number"&&(c=N),k=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackInfo.trackNumber];typeof N=="number"&&(c=N),k=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackInfo.trackNumber];typeof N=="number"&&(c=N),k=this.last2SimpleBlockAudioTrackTimecode[1]}var j=(this.lastClusterTimecode+k)*this.timecodeScale+i-c,Z=j/this.timecodeScale;return Math.floor(Z)},enumerable:!1,configurable:!0}),S.prototype.addListener=function(i,c){return b.prototype.addListener.call(this,i,c)},S.prototype.put=function(i){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),i.type==="m"?i.isEnd?console.groupEnd():console.group(i.name+":"+i.tagStart):i.type==="b"?console.log(i.name,i.type):console.log(i.name,i.tagStart,i.type,i.value)},S}(D.EventEmitter);return EBMLReader.default=A,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function($){var D=ebml&&ebml.__createBinding||(Object.create?function(c,k,C,N){N===void 0&&(N=C),Object.defineProperty(c,N,{enumerable:!0,get:function(){return k[C]}})}:function(c,k,C,N){N===void 0&&(N=C),c[N]=k[C]}),O=ebml&&ebml.__exportStar||function(c,k){for(var C in c)C!=="default"&&!Object.prototype.hasOwnProperty.call(k,C)&&D(k,c,C)};Object.defineProperty($,"__esModule",{value:!0}),$.tools=$.Reader=$.Encoder=$.Decoder=void 0,O(requireEBML(),$);var A=requireEBMLDecoder();$.Decoder=A.default;var b=requireEBMLEncoder();$.Encoder=b.default;var S=requireEBMLReader();$.Reader=S.default;var i=requireTools();$.tools=i}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var $=lib&&lib.__awaiter||function(b,S,i,c){function k(C){return C instanceof i?C:new i(function(N){N(C)})}return new(i||(i=Promise))(function(C,N){function j(K){try{z(c.next(K))}catch(te){N(te)}}function Z(K){try{z(c.throw(K))}catch(te){N(te)}}function z(K){K.done?C(K.value):k(K.value).then(j,Z)}z((c=c.apply(b,S||[])).next())})},D=lib&&lib.__generator||function(b,S){var i={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},c,k,C,N;return N={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function j(z){return function(K){return Z([z,K])}}function Z(z){if(c)throw new TypeError("Generator is already executing.");for(;i;)try{if(c=1,k&&(C=z[0]&2?k.return:z[0]?k.throw||((C=k.return)&&C.call(k),0):k.next)&&!(C=C.call(k,z[1])).done)return C;switch(k=0,C&&(z=[z[0]&2,C.value]),z[0]){case 0:case 1:C=z;break;case 4:return i.label++,{value:z[1],done:!1};case 5:i.label++,k=z[1],z=[0];continue;case 7:z=i.ops.pop(),i.trys.pop();continue;default:if(C=i.trys,!(C=C.length>0&&C[C.length-1])&&(z[0]===6||z[0]===2)){i=0;continue}if(z[0]===3&&(!C||z[1]>C[0]&&z[1]<C[3])){i.label=z[1];break}if(z[0]===6&&i.label<C[1]){i.label=C[1],C=z;break}if(C&&i.label<C[2]){i.label=C[2],i.ops.push(z);break}C[2]&&i.ops.pop(),i.trys.pop();continue}z=S.call(b,i)}catch(K){z=[6,K],k=0}finally{c=C=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var O=requireEbml();function A(b){return $(this,void 0,void 0,function(){var S,i,c,k,C,N,j,Z,z,K,te,ie;return D(this,function(Q){switch(Q.label){case 0:if(!b)throw Error("call to fixWebmDuration requires a blob");S=new O.Decoder,i=new O.Reader,c=b.stream(),k=c.getReader(),Q.label=1;case 1:return[4,k.read()];case 2:return C=Q.sent(),N=C.done,j=C.value,N?(i.stop(),[3,3]):(Z=S.decode(j),Z=Z==null?void 0:Z.filter(function(se){return se.type!=="unknown"}),Z.forEach(function(se){i.read(se)}),j=null,[3,1]);case 3:return z=O.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),K=new Blob([z],{type:b.type}),te=b.slice(i.metadataSize),ie=new Blob([K,te],{type:b.type}),[2,ie]}})})}return lib.default=A,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){be(this,Je);be(this,yt,!1);be(this,ct,!1);be(this,Bt,0);be(this,qt,0);be(this,Ye,0);be(this,et,0);be(this,vt,0);ee(this,"onchange",D=>{});ee(this,"onDurationChange",D=>{});ee(this,"start",async(D="")=>{D||(D=`video_Record_${E(Date.now())}`);let O=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(A=>{const b=A.getTracks();for(const i of b)i.onended=()=>this.stop();De(this,yt,!0),De(this,ct,!1),De(this,Je,new MediaRecorder(A)),ce(this,Je).start();const S=new Date().getTime();De(this,Bt,S),De(this,Ye,S),ce(this,kt).call(this),ce(this,Nt).call(this),ce(this,Je).addEventListener("dataavailable",i=>{O.push(i.data)}),ce(this,Je).addEventListener("stop",async()=>{De(this,yt,!1);const i=new Date().getTime();De(this,qt,i),De(this,et,ce(this,et)+(i-ce(this,Ye))),ce(this,kt).call(this),clearInterval(ce(this,vt));const c=A.getTracks();for(const Z of c)Z.stop();if(ce(this,Je)===null)return;const k=new Blob(O,{type:ce(this,Je).mimeType}),C=await fixWebmDuration(k),N=URL.createObjectURL(C),j=document.createElement("a");j.href=N,j.download=`${D}.mp4`,j.click(),URL.revokeObjectURL(N),O=[],De(this,Je,null)})})});ee(this,"pause",async()=>{var O;await new Promise(A=>setTimeout(()=>A(!0),300)),(O=ce(this,Je))==null||O.pause(),De(this,ct,!0);const D=new Date().getTime();De(this,et,ce(this,et)+(D-ce(this,Ye))),ce(this,kt).call(this),clearInterval(ce(this,vt))});ee(this,"resume",async()=>{var O;(O=ce(this,Je))==null||O.resume(),De(this,ct,!1);const D=new Date().getTime();De(this,Ye,D),ce(this,kt).call(this),ce(this,Nt).call(this)});ee(this,"stop",async()=>{var D;(D=ce(this,Je))==null||D.stop()});ee(this,"getDuration",()=>{if(ce(this,Ye)===0)return 0;let D=ce(this,et);const O=new Date().getTime();if(ce(this,yt)&&ce(this,ct)===!1){const A=O-ce(this,Ye);De(this,Ye,O),D=D+A}return D});ee(this,"getInfo",()=>({active:ce(this,yt),pause:ce(this,ct),startTime:ce(this,Bt),endTime:ce(this,qt),duration:ce(this,et)}));be(this,kt,()=>{const D=this.getInfo();this.onchange(D)});be(this,Nt,()=>{clearInterval(ce(this,vt)),De(this,vt,window.setInterval(()=>{De(this,et,this.getDuration()),this.onDurationChange(ce(this,et))},500))})}}Je=new WeakMap,yt=new WeakMap,ct=new WeakMap,Bt=new WeakMap,qt=new WeakMap,Ye=new WeakMap,et=new WeakMap,vt=new WeakMap,kt=new WeakMap,Nt=new WeakMap;var l=Object.defineProperty,y=$=>{throw TypeError($)},q=($,D,O)=>D in $?l($,D,{enumerable:!0,configurable:!0,writable:!0,value:O}):$[D]=O,s=($,D,O)=>q($,typeof D!="symbol"?D+"":D,O),P=($,D,O)=>D.has($)||y("Cannot "+O),n=($,D,O)=>(P($,D,"read from private field"),O?O.call($):D.get($)),a=($,D,O)=>D.has($)?y("Cannot add the same private member more than once"):D instanceof WeakSet?D.add($):D.set($,O),d,v,o;class p{constructor(D={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(O,A={})=>new Promise(async(b,S)=>{const i=A.timeout||this.options.timeout,c=A.key||n(this,d).call(this),k=A.describe||"";if(this.queue.findIndex(N=>N.key===c)!==-1)return S(`${c} is exist.`);const C={key:c,func:O,describe:k,timeout:i,resolve:b,reject:S};this.queue.unshift(C),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,O=>{const A=this.queue.findIndex(b=>b.key===O);this.queue.splice(A,1)}),a(this,o,async()=>{const O=this.queue.length;if(O===0)return;const A=O-1,b=this.queue[A];this.activePromise=b;const{key:S,func:i,resolve:c,reject:k,timeout:C}=this.activePromise;C&&(this.timer=window.setTimeout(()=>{k(`pr-async-queue: ${S} is timeout.`),n(this,o).call(this)},C)),await i().then(c).catch(k).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,S),n(this,o).call(this)})}),this.options={timeout:0,...D}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;class RoomBase{constructor(D){ee(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:wt(),callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0});ee(this,"sdk_service_version","1.0.8");ee(this,"sdk_session","");ee(this,"prohibitNotify",!1);ee(this,"isEarly",!1);ee(this,"isInRoom",!1);ee(this,"asyncQueue");ee(this,"roomState","ready");ee(this,"createAt",Date.now());ee(this,"cwsIns");ee(this,"peerIns");ee(this,"transceiverMap",new Map);ee(this,"sendChannel");ee(this,"receiveChannel");ee(this,"userMap",new Map);ee(this,"p2pMap",new Map);ee(this,"setLocalStreamActiveMap",new Map);ee(this,"phoneyStreams",new Map);ee(this,"recorder",new StreamRecorder);ee(this,"networkQualityTester",new NetworkQualityTester);ee(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});ee(this,"reportLogs",(D,O="未知错误")=>{const{appid:A,userId:b,earlyId:S="",logUrl:i,reportErr:c}=this.options;if(!c)return;const k="web",C=N=>({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})[N].toString();{const N=C(D),j={origin:k,type:N,app_id:A,user_id:b,ins_id:S,desc:O},Z=btoa(encodeURI(JSON.stringify(j))),z=`${i}/upload/log?log_key=${Z}`;{const K=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),ie=new TextEncoder().encode(K),Q=pako.deflate(ie,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:j,url:z,size:it(Q.byteLength)}),fetch(z,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:Q})}}});ee(this,"initPhoneyStreams",(D,O=[])=>{O.length===0&&(O=mediaType_keys);for(const A of O){const b=this.phoneyStreams.get(A);if(b){const S=b.getTracks();for(const i of S)i.stop()}switch(A){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(D));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(D));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});ee(this,"getPhoneyStreams",D=>this.phoneyStreams.get(D));ee(this,"getRoomInfo",()=>{const{options:D,roomState:O,createAt:A}=this;return{...D,roomState:O,createAt:A}});ee(this,"setRoomState",D=>{this.roomState=D,D==="closed"&&(this.cwsIns.state=D);const O=enum_roomState[D],A={state:D,stateStr:O};this.cwsIns.emitNotify("onRoomState",{code:200,data:A,desc:"room state is change."})});ee(this,"setOptions",async D=>{const O={...this.options,...D};this.options=O});ee(this,"stopStream",async D=>{const O=D.getTracks();for(const A of O)A.stop()});ee(this,"getMediaDevicesErrInfo",async()=>{try{const D=await navigator.mediaDevices.enumerateDevices();D.find(A=>A.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),D.find(A=>A.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(D){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",D)}return this.mediaDevicesErrInfo});ee(this,"getUserMediaKey",(D,O)=>`${D}-${O}`);ee(this,"getCallAction",async D=>{let O="";const A=S=>D.findIndex(({type:c,enabled:k=!0})=>c===S&&k)===-1?"0":"1";return O=`${A(0)}${O}`,O=`${A(1)}${O}`,O=`${A(2)}${O}`,O=`${A(3)}${O}`,parseInt(O,2)});ee(this,"getCallActionMap",(D=0)=>{const A=Number(D).toString(2).padStart(4,"0").split(""),[b,S,i,c]=A;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(S),screenSharing_audio:!!Number(b)}});ee(this,"getBanBehaviorMap",(D=0)=>{const A=Number(D).toString(2).padStart(4,"0").split(""),[b,S,i,c]=A;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(S),screenSharing_audio:!!Number(b)}});ee(this,"getAverageVolume",(D,O)=>{D.getByteFrequencyData(O);let A=0;for(let S=0;S<O.length;S++)A+=O[S];return Math.ceil(A/O.length)});ee(this,"getTrackNamesFormTracks",(D,O=[],A="trackName")=>{const b=[];for(const S of D){const{type:i}=S;if(O.length===0||O.includes(i)){const c=S[A];c&&b.push(`${c}`)}}return b});ee(this,"usersFilter",D=>dt(D,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap","useP2P"]).sort((b,S)=>b.id.localeCompare(S.id,"en")));this.setOptions(D),this.cwsIns=new CallsWebSocket({...D}),this.asyncQueue=new p}}var m=Object.defineProperty,G=($,D,O)=>D in $?m($,D,{enumerable:!0,configurable:!0,writable:!0,value:O}):$[D]=O,e=($,D,O)=>G($,typeof D!="symbol"?D+"":D,O);let g$1=class{constructor(D,O){e(this,"inputStream",new MediaStream),e(this,"outputStream",new MediaStream),e(this,"inputGain",1),e(this,"enhanceGain",1),e(this,"bgsGain",1),e(this,"bgmGain",1),e(this,"outputGain",1),e(this,"mixAudioMap",new Map),e(this,"audioContext",new AudioContext),e(this,"sourceNode"),e(this,"inputGainNode"),e(this,"enhanceGainNode"),e(this,"bgsGainNode"),e(this,"bgmGainNode"),e(this,"analyserNode"),e(this,"analyserArrayData"),e(this,"outputGainNode"),e(this,"destinationNode"),e(this,"filterStream",A=>A),e(this,"stop",()=>{{const A=this.inputStream.getTracks();for(const b of A)b.stop(),this.inputStream.removeTrack(b)}}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(A=!0)=>{A?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",A=>{this.inputGain=A,this.inputGainNode.gain.setValueAtTime(A,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async A=>{this.enhanceGain=A+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",A=>{this.bgsGain=A,this.bgsGainNode.gain.setValueAtTime(A,this.audioContext.currentTime)}),e(this,"setBgmGain",A=>{this.bgmGain=A,this.bgmGainNode.gain.setValueAtTime(A,this.audioContext.currentTime)}),e(this,"setOutputGain",A=>{this.outputGain=A,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:A,analyserArrayData:b}=this;A.getByteFrequencyData(b);let S=0;for(let i=0;i<b.length;i++)S+=b[i];return Math.ceil(S/b.length)}),e(this,"mixAudio",(A,b="bgm")=>new Promise(async(S,i)=>{try{{const C=this.mixAudioMap.get(b);C&&C.stop()}const c=b==="bgs"?this.bgsGainNode:this.bgmGainNode,k=this.audioContext.createBufferSource();this.mixAudioMap.set(b,k),k.buffer=A,k.connect(c),k.onended=()=>{k.disconnect(c),this.mixAudioMap.delete(b),S(!0)},k.start(0)}catch(c){i(c)}})),e(this,"mixAudioStop",A=>{const b=this.mixAudioMap.get(A);b==null||b.stop()}),e(this,"changeMix",(A,b)=>{const S=A==="bgs"?this.bgsGainNode:this.bgmGainNode;b?S.connect(this.destinationNode):S.disconnect(this.destinationNode)}),O&&(this.audioContext=O),this.inputStream=D,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:A,inputGainNode:b,enhanceGainNode:S,bgsGainNode:i,bgmGainNode:c,analyserNode:k,outputGainNode:C,destinationNode:N}=this;A.connect(b),b.connect(S),S.connect(k),i.connect(k),c.connect(k),S.connect(N),i.connect(N),c.connect(N),k.connect(C),C.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}};class RoomMedias extends RoomBase{constructor(O){super(O);be(this,Ot,[]);be(this,Ge,new Map);be(this,je,new Map);be(this,Xe,new Map);be(this,tt,new Map);be(this,st,new Map);ee(this,"localStreamsActionMap",new Map);be(this,It,new Map);ee(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));ee(this,"initMediaPhoneyStreams",(O=[])=>this.initPhoneyStreams(this.audioContext,O));ee(this,"initLocalStreamsFilter",()=>{for(const O of mediaType_keys){const A=async b=>b;ce(this,It).set(O,A)}});ee(this,"setLocalFilterStream",(O,A)=>{ce(this,It).set(O,A)});be(this,Jt,()=>{ce(this,je).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),ce(this,je).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),ce(this,je).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),ce(this,je).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});be(this,Gt,()=>{ce(this,Ge).set("audioinput","default"),ce(this,Ge).set("videoinput","default"),ce(this,Ge).set("audiooutput","default")});ee(this,"emitNotifyUpdateUsersStreams",async O=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:O,desc:"users streams is change."})});ee(this,"initUserMediaStreamContext",async(O,A,b)=>{const[S]=b.getTracks();if(!S){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:O,mediaType:A,stream:b});return}this.removeUserMediaStreamContext(O,A);const i=this.getUserMediaKey(O,A),{kind:c}=S;switch(c){case"audio":{const k=new MediaStream;k.addTrack(S);const C=new g$1(k,this.audioContext);ce(this,Xe).set(i,C)}break;case"video":{const k=new VideoMediaContext(S);ce(this,tt).set(i,k)}break}});ee(this,"getUserMediaStreamContext",(O,A)=>{const b=this.getUserMediaKey(O,A);if(["microphoneCamera_audio","screenSharing_audio"].includes(A))return ce(this,Xe).get(b);if(["microphoneCamera_video","screenSharing_video"].includes(A))return ce(this,tt).get(b)});ee(this,"getUserAudioMediaStreamContext",(O,A)=>{const b=this.getUserMediaKey(O,A);return ce(this,Xe).get(b)});ee(this,"removeUserMediaStreamContext",(O,A)=>{const b=this.getUserMediaKey(O,A);if(["microphoneCamera_audio","screenSharing_audio"].includes(A)){const S=ce(this,Xe).get(b);return S==null||S.stop(),ce(this,Xe).delete(b)}if(["microphoneCamera_video","screenSharing_video"].includes(A)){const S=ce(this,tt).get(b);return S==null||S.stop(),ce(this,tt).get(b)}});ee(this,"getUserStream",(O,A)=>{const b=this.getUserMediaStreamContext(O,A);return(b==null?void 0:b.getStream())||new MediaStream});ee(this,"getUserStreams",(O,A=[])=>{A.length===0&&(A=mediaType_keys);const b={};for(const S of A){const i=this.getUserStream(O,S);b[S]=i}return b});ee(this,"removeUserStreams",async(O,A=[])=>{A.length===0&&(A=mediaType_keys);for(const b of A)this.removeUserMediaStreamContext(O,b)});ee(this,"clearUserStreams",()=>{{const O=ce(this,Xe).values();for(const A of O)A.stop();De(this,Xe,new Map)}{const O=ce(this,tt).values();for(const A of O)A.stop();De(this,tt,new Map)}});ee(this,"setMediaTrackConstraints",async(O,A)=>{ce(this,je).set(O,A);const b=await this.getLocalStream(O);if(!b)return;const S=b.getTracks();if(S.length!==0)for(const i of S){const c=i.getConstraints(),C={...ce(this,je).get(O),...c,...A};await i.applyConstraints(C)}});ee(this,"stopLocalStreams",async(O=[])=>{O.length===0&&(O=mediaType_keys);for(const A of O){const b=ce(this,st).get(A);b&&await this.stopStream(b),ce(this,st).delete(A)}});ee(this,"addLocalStream",(O,A)=>{const b=ce(this,st).get(O);b&&this.stopStream(b),ce(this,st).set(O,A)});ee(this,"initLocalStream",async O=>{switch(O){case"microphoneCamera_audio":{const A=ce(this,Ge).get("audioinput"),b=ce(this,je).get("microphoneCamera_audio"),S=await navigator.mediaDevices.getUserMedia({audio:{deviceId:A,...b},video:!1});this.addLocalStream("microphoneCamera_audio",S)}break;case"microphoneCamera_video":{const A=ce(this,Ge).get("videoinput"),b=ce(this,je).get("microphoneCamera_video"),S=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:A,...b}});this.addLocalStream("microphoneCamera_video",S)}break;case"microphoneCamera":{const A=ce(this,Ge).get("audioinput"),b=ce(this,Ge).get("videoinput"),S=ce(this,je).get("microphoneCamera_audio"),i=ce(this,je).get("microphoneCamera_video"),k=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:A,...S},video:{deviceId:b,...i}})).getTracks();for(const C of k){const{kind:N}=C;if(N==="audio"){const j=new MediaStream;j.addTrack(C),this.addLocalStream("microphoneCamera_audio",j)}if(N==="video"){const j=new MediaStream;j.addTrack(C),this.addLocalStream("microphoneCamera_video",j)}}}break;case"screenSharing_audio":{const A=ce(this,je).get("screenSharing_audio"),S=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...A})).getTracks();for(const i of S){const{kind:c}=i;if(c==="audio"){const k=new MediaStream;k.addTrack(i),this.addLocalStream("screenSharing_audio",k)}}}break;case"screenSharing_video":{const A=ce(this,je).get(O),S=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...A})).getTracks();for(const i of S){const{kind:c}=i;if(c==="video"){const k=new MediaStream;k.addTrack(i),this.addLocalStream("screenSharing_video",k)}}}break;case"screenSharing":{const A=ce(this,je).get("screenSharing_audio"),b=ce(this,je).get("screenSharing_video"),i=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...A,...b})).getTracks();for(const c of i){const{kind:k}=c;if(k==="audio"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_audio",C)}if(k==="video"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_video",C)}}}break}});ee(this,"getLocalStream",async O=>{const A=ce(this,st).get(O),b=ce(this,It).get(O);let S=A;return A&&b&&(S=await b(A)),S});ee(this,"getLocalStreams",async(O=[])=>{O.length===0&&(O=mediaType_keys);const A={};for(const b of O)A[b]=await this.getLocalStream(b);return A});be(this,Tt,async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then(O=>{const A=O.filter(b=>!["communications"].includes(b.deviceId));De(this,Ot,A.sort((b,S)=>b.label.localeCompare(S.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",O)}),ce(this,Ot)));be(this,Vt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await ce(this,Tt).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),ce(this,Tt).call(this)});ee(this,"getMediaDeviceKind",O=>ce(this,Ge).get(O));ee(this,"changeAudiooutput",async()=>{try{const O=ce(this,Ge).get("audiooutput");await this.audioContext.setSinkId(O)}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",O)}});ee(this,"setDeviceKind",(O,A)=>{ce(this,Ge).set(O,A)});ee(this,"setAudioOutputDevice",O=>this.setDeviceKind("audiooutput",O));ee(this,"getEnumerateDevices",async O=>(await ce(this,Tt).call(this),ce(this,Ot).filter(b=>b.kind===O)));ee(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));ee(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));ee(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));ce(this,Vt).call(this),ce(this,Gt).call(this),ce(this,Jt).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var A;((A=this.audioContext)==null?void 0:A.state)==="suspended"&&this.audioContext.resume()})}}Ot=new WeakMap,Ge=new WeakMap,je=new WeakMap,Xe=new WeakMap,tt=new WeakMap,st=new WeakMap,It=new WeakMap,Jt=new WeakMap,Gt=new WeakMap,Tt=new WeakMap,Vt=new WeakMap;const getIcecandidate=$=>new Promise((D,O)=>{const A=[];if(A.length!==0)return D(A);const b=async i=>{i.candidate?A.push(i.candidate):(clearTimeout(S),$.removeEventListener("icecandidate",b),D(A))},S=window.setTimeout(()=>{$.removeEventListener("icecandidate",b),O(new Error("icecandidate collect timeout."))},5*1e3);$.addEventListener("icecandidate",b)});class P2P{constructor(D){ee(this,"phoneyStreams",new Map);ee(this,"recv_peer_ins");ee(this,"recv_offer",{type:"offer",sdp:""});ee(this,"recv_icecandidates",[]);ee(this,"recv_answer",{type:"answer",sdp:""});ee(this,"transceiverMap",new Map);be(this,Mt,[]);ee(this,"send_peer_ins");ee(this,"send_offer",{type:"offer",sdp:""});ee(this,"send_icecandidates",[]);ee(this,"send_answer",{type:"answer",sdp:""});be(this,Ut,[]);be(this,Lt,[]);ee(this,"tracks",[]);ee(this,"sendIceConnected",()=>new Promise(D=>{var O;if(((O=this.send_peer_ins)==null?void 0:O.iceConnectionState)==="connected")return D(!0);ce(this,Ut).push(D)}));ee(this,"recvIceConnected",()=>new Promise(D=>{var O;if(((O=this.recv_peer_ins)==null?void 0:O.iceConnectionState)==="connected")return D(!0);ce(this,Mt).push(D)}));be(this,Wt,()=>new Promise(D=>{var O;(O=this.send_peer_ins)!=null&&O.remoteDescription&&D(!0),ce(this,Lt).push(D)}));ee(this,"getOffer",()=>this.recv_offer);ee(this,"getIcecandidates",()=>this.recv_icecandidates);ee(this,"createOffer",()=>new Promise(async(D,O)=>{try{this.recv_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.recv_peer_ins.oniceconnectionstatechange=async()=>{const S=this.recv_peer_ins.iceConnectionState;if(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: recv_peer_ins",S),S==="connected")for(const i of ce(this,Mt))await i()},this.recv_peer_ins.ontrack=S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: recv_peer_ins.ontrack",S)},this.recv_peer_ins.addTransceiver("audio",{direction:"inactive"}),(async()=>{this.recv_icecandidates=await getIcecandidate(this.recv_peer_ins)})();const b=await this.recv_peer_ins.createOffer();await this.recv_peer_ins.setLocalDescription(b),D(b)}catch(A){O(A)}}));ee(this,"initSenderPc",async()=>{this.send_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.send_peer_ins.oniceconnectionstatechange=async()=>{const O=this.send_peer_ins.iceConnectionState;if(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: send_peer_ins",O),O==="connected")for(const A of ce(this,Ut))await A()},(async()=>{this.recv_icecandidates=await getIcecandidate(this.send_peer_ins)})()});ee(this,"setOffer",async D=>{await this.send_peer_ins.setRemoteDescription(D),this.send_offer=D;for(const O of ce(this,Lt))O(!0)});ee(this,"createAnswer",async(D=[])=>new Promise(async O=>{await this.addSenders(D);const A=await this.send_peer_ins.createAnswer();await this.send_peer_ins.setLocalDescription(A),getIcecandidate(this.send_peer_ins),this.send_answer=A,O(A)}));ee(this,"addCandidates",async D=>new Promise(async O=>{await ce(this,Wt).call(this),this.send_icecandidates=D;for(const A of this.send_icecandidates)await this.send_peer_ins.addIceCandidate(A);O(!0)}));ee(this,"setAnswer",(D,O)=>new Promise(async(A,b)=>{try{await this.recv_peer_ins.setRemoteDescription(D);for(const S of O)await this.recv_peer_ins.addIceCandidate(S);A(!0)}catch(S){b(S)}}));ee(this,"getPhoneyStreams",D=>this.phoneyStreams.get(D));ee(this,"addSenders",async(D=[])=>{const O=[];for(const A of D){if(this.transceiverMap.get(A))continue;const S=this.getPhoneyStreams(A),[i]=S.getTracks(),c=this.send_peer_ins.addTransceiver(i,{direction:"sendonly"});this.transceiverMap.set(A,c),O.push(A)}return(D.length===0||O.length!==0)&&await this.send_peer_ins.createOffer(),O});ee(this,"getSenderTracks",async(D=[])=>{const O=[];for(const A of D){const b=this.transceiverMap.get(A);if(!b)continue;const{mid:S,sender:i}=b,{track:c}=i;if(!c)continue;const{id:k,enabled:C}=c,N=mediaType_keys.findIndex(z=>z===A),j=wt(),Z={type:N,enabled:C,trackName:`web-${N}-${k}`,location:"local",mid:S,key:j};O.push(Z)}return O});ee(this,"getTrack",D=>{var A;const O=this.transceiverMap.get(D);return(A=O==null?void 0:O.receiver)==null?void 0:A.track});this.phoneyStreams=D}}Mt=new WeakMap,Ut=new WeakMap,Lt=new WeakMap,Wt=new WeakMap;class RoomUsers extends RoomMedias{constructor(O){super(O);ee(this,"getP2PIns",async O=>this.p2pMap.get(O));ee(this,"getMaxVolumeUser",()=>{const O=Array.from(this.userMap.values(),({id:b})=>b);if(O.length===0)return;let A=[];for(const b of O){const S=this.getUserAudioMediaStreamContext(b,"microphoneCamera_audio");if(!S)continue;const i=S.getVolume();A.push({id:b,volume:i})}return A=A.sort((b,S)=>b.volume-S.volume>0?-1:1),A[0]});ee(this,"setVolume",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setInputGain(b)});ee(this,"setEnhanceGain",async(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setEnhanceGain(b)});ee(this,"setSpeaker",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setOutputGain(b);const i=b===0;S==null||S.setMute(i)});ee(this,"playBgs",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);return S==null?void 0:S.mixAudio(b,"bgs")});ee(this,"setBgsGain",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setBgsGain(b)});ee(this,"stopBgs",(O,A)=>{const b=this.getUserAudioMediaStreamContext(O,A);b==null||b.mixAudioStop("bgs")});ee(this,"playBgm",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);return S==null?void 0:S.mixAudio(b,"bgm")});ee(this,"setBgmGain",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setBgmGain(b)});ee(this,"stopBgm",(O,A)=>{const b=this.getUserAudioMediaStreamContext(O,A);b==null||b.mixAudioStop("bgm")});ee(this,"changBgsMix",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.changeMix("bgs",b)});ee(this,"changBgmMix",(O,A,b)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.changeMix("bgm",b)});ee(this,"getVolume",(O,A)=>{const b=this.getUserAudioMediaStreamContext(O,A);return b==null?void 0:b.getVolume()});ee(this,"clearUsers",()=>{this.userMap=new Map});ee(this,"removeUsers",async O=>{for(const A of O)this.userMap.delete(A),await this.removeUserStreams(A)});ee(this,"createUser",async O=>{const A=Date.now(),b={id:O,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},banBehavior:0,banBehaviorStr:"",banBehaviorMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isOwner:this.userMap.size===0,isSelf:O===this.options.userId,isPublished:!1,useP2P:!1,joinTime:A,updateAt:A,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(O,b);{const S=new P2P(this.phoneyStreams);this.p2pMap.set(O,S)}});ee(this,"getUser",async O=>(this.userMap.has(O)||await this.createUser(O),this.userMap.get(O)));ee(this,"getUsers",async(O=[])=>{O.length===0&&(O=[...this.userMap.keys()]);const A=[];for(const b of O){const S=await this.getUser(b);A.push(S)}return A});ee(this,"getAllUserTrackMids",async()=>{const O=await this.getUsers(),A=[];for(const b of O){const{tracks:S=[]}=b;for(const i of S)A.push(i.mid)}return A});ee(this,"getUserTrackByTrackName",async O=>{const A=await this.getUsers(),b=[];for(const S of A){const{tracks:i=[]}=S;for(const c of i){const{trackName:k}=c;O.includes(k)&&b.push(c)}}return b});ee(this,"getUserTrackFromMid",async O=>{const A=await this.getUsers();let b;for(const S of A){const{tracks:i=[]}=S;for(const c of i)if(c.mid===O){b=c;break}}return b});ee(this,"checkUserInRoom",O=>this.userMap.has(O));ee(this,"getUsersId",async()=>[...this.userMap.keys()]);ee(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));ee(this,"updateIsPublished",async(O,A=!1)=>{const b=await this.getUser(O);b.isPublished=A});ee(this,"setUserUpdateStreams",async(O,A,b=!0)=>{const S=await this.getUser(O),i={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};i[A]=b,S.updateStreams=i});ee(this,"updateUserChannels",async(O,A=[],b)=>{const S=await this.getUser(O);b&&(A=[...S.channels,...A]),S.channels=A});ee(this,"updateUsertracks",async(O,A=[],b)=>{const S=await this.getUser(O);b&&(A=[...S.tracks,...A]),A=A.filter(({mid:k=""})=>k!==""),A=pt(A,["type"]),A=A.sort((k,C)=>k.type-C.type<0?-1:1);for(const k of A)k.userId=O,k.mediaType=mediaType_keys[k.type],k.enabled===void 0&&(k.enabled=!0);S.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const i=dt(S.tracks,["mediaType","enabled","mid","msid","trackName","key"]),c=dt(A,["mediaType","enabled","mid","msid","trackName","key"]);for(const k of mediaType_keys){const C=c.find(Z=>Z.mediaType===k),N=i.find(Z=>Z.mediaType===k),j=JSON.stringify(C)!==JSON.stringify(N);S.updateStreams[k]=j}S.tracks=A});ee(this,"updateUserCallAction",async(O,A=0)=>{const b=await this.getUser(O);b.callAction=A,b.callActionStr=A.toString(2).padStart(4,"0"),b.callActionMap=this.getCallActionMap(A)});ee(this,"updateUserBehaviors",async(O,A=0)=>{const b=await this.getUser(O);b.banBehavior=A,b.banBehaviorStr=A.toString(2).padStart(4,"0"),b.banBehaviorMap=this.getBanBehaviorMap(A)});ee(this,"updateUserNetwork",async(O,A={egress:5,ingress:5})=>{const b=await this.getUser(O);b.network=A});ee(this,"updateUserPermissions",async(O,A)=>{if(A){const b=await this.getUser(O);b.permissions=A}});ee(this,"updateUserUseP2P",async(O,A)=>{const b=await this.getUser(O);b.useP2P=A});ee(this,"updateUserBase",async O=>{const A=await this.getUser(O);A.isSelf=O===this.options.userId,A.updateAt=Date.now()});ee(this,"updateUsers",async O=>{for(const A of O){const{id:b,tracks:S,callAction:i,permissions:c,isPublished:k,useP2P:C}=A;await this.updateUserBase(b),await this.updateIsPublished(b,k),await this.updateUserPermissions(b,c),await this.updateUsertracks(b,S,!0),await this.updateUserCallAction(b,i),await this.updateUserNetwork(b),await this.updateUserUseP2P(b,C)}});ee(this,"emitNotifyUpdateUser",async O=>{const A=await this.getUsers([O]),[b]=this.usersFilter(A);this.cwsIns.emitNotify("onRoomUser",{code:200,data:b,desc:"user info is change."})});ee(this,"emitNotifyUpdateUsers",async()=>{const O=await this.getUsers(),A=this.usersFilter(O);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:A,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(O){super(O);ee(this,"getPeerStatsTimer",0);ee(this,"reports",[]);ee(this,"candidates",[]);be(this,Ft,[]);be(this,$t,0);ee(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});ee(this,"initPeer",()=>{var O;clearTimeout(ce(this,$t)),this.transceiverMap=new Map,(O=this.peerIns)==null||O.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),ce(this,Kt).call(this),ce(this,Xt).call(this),this.initMediaPhoneyStreams()});ee(this,"initSendChannel",(O="",A)=>{const b=this.peerIns.createDataChannel(O,{negotiated:!0,id:A});b.addEventListener("open",async S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onopen",S),setInterval(()=>{const i=new Date().getTime();b.send(`Hi you! on: ${E(i)}`)},1e3)}),b.addEventListener("close",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: close",S)}),b.addEventListener("message",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onmessage",S)}),this.sendChannel=b,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initSendChannel",{label:O,id:A,channel:b})});ee(this,"initReceiveChannel",(O="",A)=>{const b=this.peerIns.createDataChannel(O,{negotiated:!0,id:A});b.addEventListener("open",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onopen",S)}),b.addEventListener("close",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: close",S)}),b.addEventListener("message",async S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onmessage",S)}),this.receiveChannel=b,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initReceiveChannel",{label:O,id:A,channel:b}),this.receiveChannel.send("hello")});ee(this,"replaceSenderStream",async(O=[],A)=>{const{userId:b}=this.options;O.length===0&&(O=mediaType_keys);for(const S of O){const i=this.transceiverMap.get(S);let c;if(i){const{sender:k}=i;A?c=this.getUserStream(b,S):c=this.getPhoneyStreams(S);const[C]=c.getTracks();C&&await k.replaceTrack(C)}}});ee(this,"getSenderTracks",async(O=[])=>{const A=[];for(const b of O){const S=this.transceiverMap.get(b);if(!S)continue;const{mid:i,sender:c}=S,{track:k}=c;if(!k)continue;const{id:C,enabled:N}=k,j=mediaType_keys.findIndex(K=>K===b),Z=wt(),z={type:j,enabled:N,trackName:`web-${j}-${C}`,location:"local",mid:i,key:Z};A.push(z)}return A});ee(this,"addSenders",async(O=[])=>{O.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const A=[];for(const b of O){if(this.transceiverMap.get(b))continue;const i=this.getPhoneyStreams(b),[c]=i.getTracks(),k=this.peerIns.addTransceiver(c,{direction:"sendonly"});this.transceiverMap.set(b,k),A.push(b)}if(O.length===0||A.length!==0){const b=await this.peerIns.createOffer();if(this.options.debug){const S=libExports$1.parse(b.sdp),i=dt(S.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:i,sdpJson:S,description:b})}await this.peerIns.setLocalDescription(b)}return A});ee(this,"removeSenders",async(O=[])=>{O.length===0&&(O=mediaType_keys);for(const A of O)this.transceiverMap.has(A)&&this.transceiverMap.delete(A)});ee(this,"onSubscribeUserTracks",O=>{let A=0;return new Promise(async b=>{const S=[];for(const i of O){const{tracks:c=[]}=i;for(const k of c){const{trackName:C,mid:N}=k,[j]=await this.getUserTrackByTrackName([C]);S.push({...j,mid:N})}}{let i=[];const c=async()=>{clearTimeout(A);const C=new Map;for(const j of i){const{userId:Z,mediaType:z}=j;if(!Z||!z)continue;C.has(Z)||C.set(Z,{userId:Z,tracks:[],updateStreams:{}});const te=C.get(Z);te.tracks.push(j),te.updateStreams[z]=!0}const N=[...C.values()];for(const j of N){const{userId:Z,tracks:z}=j;await this.updateUsertracks(Z,z,!0)}await this.emitNotifyUpdateUsersStreams(N),this.peerIns.removeEventListener("track",k);{const j=Array.from(S,K=>K.trackName),Z=Array.from(i,K=>K.trackName),z=j.filter(K=>!Z.includes(K));b({target:j,success:Z,fail:z})}},k=async C=>{const{streams:N,transceiver:j}=C,[Z]=N,{mid:z,receiver:K}=j,{track:te}=K,{id:ie}=te,Q=S.find(X=>X.mid===`${z}`);if(!Q)return;const{userId:se,mediaType:he}=Q;if(!(!se||!he)){{const X={...Q,mid:z,msid:ie,key:wt()};i.push(X)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${i.length}/${S.length}`,{mediaType:he,mid:z,userTrack:Q,e:C});{const X=new Audio;if(X.srcObject=Z,await this.initUserMediaStreamContext(se,he,Z),he==="microphoneCamera_audio"||he==="screenSharing_audio"){const oe=this.getUserAudioMediaStreamContext(se,he);oe==null||oe.setMute(!1)}}S.length===i.length&&c()}};this.peerIns.addEventListener("track",k),A=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${i.length}/${S.length})`),c()},5*1e3)}})});be(this,Kt,()=>{const O=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.oniceconnectionstatechange=async()=>{const A=this.peerIns.iceConnectionState;switch(clearTimeout(ce(this,$t)),A){case"connected":{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${A}`),this.setRoomState("connected");for(const b of ce(this,Ft))await b()}break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${A}`),De(this,$t,window.setTimeout(O,30*1e3));break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${A}`),this.setRoomState("failed");break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${A}`),O();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${A}`);break}}});ee(this,"iceConnected",()=>new Promise(O=>{if(this.peerIns.iceConnectionState==="connected")return O(!0);ce(this,Ft).push(O)}));ee(this,"closeUserTracks",async(O,A=[],b=!1)=>{const S=[];for(const C of A){const{trackName:N,msid:j}=C;S.push(N),j&&S.push(j)}const i=C=>S.includes(C),c=this.peerIns.getTransceivers();for(const C of c){const{mid:N,sender:j,receiver:Z}=C;j.track&&i(j.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${N} is stop.`,C)),Z.track&&i(Z.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${N} is stop.`,C))}const k=await this.getUser(O);if(k){for(const C of k.tracks){const{trackName:N,msid:j,userId:Z,mediaType:z}=C;!Z||!z||!i(N)||(this.removeUserMediaStreamContext(Z,z),j&&delete C.msid)}if(b){const C=k.tracks.filter(({trackName:N})=>!i(N));await this.updateUsertracks(O,C,!1)}}});ee(this,"createOffer",async()=>{const O=await this.peerIns.createOffer();if(this.options.debug){const A=libExports$1.parse(O.sdp),b=dt(A.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:b,sdpJson:A,description:O})}await this.peerIns.setLocalDescription(O)});ee(this,"createAnswer",async()=>{const O=await this.peerIns.createAnswer();if(this.options.debug){const A=libExports$1.parse(O.sdp),b=dt(A.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:b,sdpJson:A,description:O})}await this.peerIns.setLocalDescription(O)});ee(this,"getSdp",()=>{var O;return(O=this.peerIns.localDescription)==null?void 0:O.sdp});ee(this,"setRemoteDescription",async O=>{if(this.options.debug){const A=libExports$1.parse(O.sdp),b=dt(A.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:b,sdpJson:A,description:O})}return await this.peerIns.setRemoteDescription(O),O});ee(this,"setCallStrategy",async(O,A=[])=>{A.length===0&&(A=mediaType_keys);let b="balanced";switch(O){case"qualityPriority":b="maintain-resolution";break;case"fluencyPriority":b="maintain-framerate";break;case"balancedDowngrade":b="balanced";break}const S=await this.getSelfInfo(),i=Array.from(S.tracks,({trackName:k})=>k),c=this.peerIns.getSenders();for(const k of c){const{track:C}=k;if(!C||!i.includes(C.id))continue;const N=k.getParameters();k.setParameters({...N,degradationPreference:b})}});ee(this,"setRTCRtpSenderParameters",O=>{try{const A=this.peerIns.getSenders();for(const b of A){const S=b.getParameters();b.setParameters({...S,...O})}}catch(A){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",A)}});ee(this,"getReportsByMid",async(O=[])=>O.length===0?this.reports:this.reports.filter(A=>O.includes(A.mid)));ee(this,"getRoomNetwork",()=>this.peerNetwork);ee(this,"getPeerNetwork",()=>this.peerNetwork);be(this,Yt,async()=>{try{const O=await this.peerIns.getStats(),A=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],S=[...O.values()].filter(oe=>A.includes(oe.type));let i=0,c=0,k=0,C=0,N=0,j=0,Z=[],z=[];for(const oe of this.reports){const{packetsSent:de,packetsLost:ae}=oe;de&&(k+=de),ae&&(C+=ae)}this.reports=S;for(const oe of this.reports){const{bytesSent:de,bytesReceived:ae,packetsSent:le,packetsLost:pe,roundTripTime:ne,jitter:ue}=oe;de&&(c=de),ae&&(i=ae),le&&(N+=le),pe&&(j+=pe),ne&&Z.push((ne*100).toFixed(2)),ue&&z.push(ue.toFixed(2))}z.sort().reverse(),Z.sort().reverse();const K=N-k,te=j-C,ie=K===0?"0.00":(te/K).toFixed(2),[Q="0"]=Z,[se="0"]=z,he={outboundBytes:c,inboundBytes:i,lostRate:ie,roundTripTime:Q,jitter:se};this.peerNetwork=he;const X=(oe,de,ae)=>{const le=Number(oe),pe=Number(de),ne=Number(ae);let ue="0";return le<.03&&pe<100&&ne<.05?ue="5":le<.06&&pe<160&&ne<.1?ue="4":le<.1&&pe<250&&ne<.15?ue="3":le<.15&&pe<400&&ne<.2?ue="2":ue="1",Number(ue)};{const oe=X(ie,Q,se),de=await this.getSelfInfo(),{network:ae}=de,le={egress:oe,ingress:oe};Ct("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,le),JSON.stringify(ae)!==JSON.stringify(le)){this.emitNotifyUpdateUsers();const{userId:ue,roomId:ye}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...le,userId:ue,roomId:ye}},!1)}},3*1e3)}}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",O)}});be(this,Xt,()=>{const O=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||ce(this,Yt).call(this)};this.getPeerStatsTimer=window.setInterval(O,1*1e3)});ee(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer));this.initPeer()}}Ft=new WeakMap,$t=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap;const g=($,D)=>{if(!($!=null&&$.ip)||!($!=null&&$.port)||!($!=null&&$.serve_ip)||!($!=null&&$.serve_port)||!(D!=null&&D.ip)||!(D!=null&&D.port)||!(D!=null&&D.serve_ip)||!(D!=null&&D.serve_port))return"Unknown";const[O,A]=[$.ip,$.port],[b,S]=[$.serve_ip,$.serve_port],[i,c]=[D.ip,D.port],[k,C]=[D.serve_ip,D.serve_port];return O===i&&A===c?"Full Cone":O===b&&(i!==b||c!==A)||i===k&&(O!==k||A!==c)?"Restricted Cone":O===b&&A===S&&(i!==b||c!==S)||i===k&&c===C&&(O!==k||A!==C)?"Port Restricted Cone":"Symmetric"},h=async()=>{const $="stun.cloudflare.com:3478",D="stun.l.google.com:19302",O=async A=>new Promise(b=>{const S=new RTCPeerConnection({iceServers:[{urls:`stun:${A}`}]});S.createDataChannel("ice-channel");let i=null;S.onicecandidate=c=>{var k,C;if(((k=c.candidate)==null?void 0:k.type)==="srflx"){const[N,j]=A.split(":").map(Z=>Z.trim());i={ip:c.candidate.address||"",port:(C=c.candidate.port)==null?void 0:C.toString(),serve_ip:N,serve_port:j},S.close(),b(i)}},setTimeout(()=>{S.close(),b(null)},5e3),S.createOffer().then(c=>S.setLocalDescription(c)).catch(()=>b(null))});try{const A=await O($),b=await O(D);if(!A||!b)return{address:"",natType:"Unknown"};const S=g(A,b);return{address:A.ip||"",natType:S}}catch(A){return console.error("获取NAT类型失败:",A),{address:"",natType:"Unknown"}}};class RoomCalls extends RoomPeer{constructor(O){super(O);be(this,Et,0);be(this,xt,[]);be(this,_t,()=>{});ee(this,"setLocalStream",(O,A)=>new Promise(async(b,S)=>{try{typeof O=="string"&&(O=[O]);for(const c of O)this.localStreamsActionMap.set(c,A);if(A){if(O.includes("microphoneCamera_audio")&&O.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):O.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):O.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):O.includes("screenSharing_audio")&&O.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):O.includes("screenSharing_audio")&&!O.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):O.includes("screenSharing_video")&&!O.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),O.includes("screenSharing_audio")){const c=await this.getLocalStream("screenSharing_audio");if(c){const k=c.getTracks();for(const C of k)C.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(O.includes("screenSharing_video")){const c=await this.getLocalStream("screenSharing_video");if(c){const k=c.getTracks();for(const C of k)C.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(O);const i=await this.getLocalStreams(O);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:i,desc:"local stream is change."}),b(i)}catch(i){S(i)}}));ee(this,"setMediaDeviceKind",(O,A)=>new Promise(async(b,S)=>{this.setDeviceKind(O,A);const i=await this.getSelfInfo(),{id:c,tracks:k=[],callActionMap:C}=i,N=[],j=async Z=>{const z=this.localStreamsActionMap.get(Z),K=k.find(ie=>ie.mediaType===Z),te=C[Z];if(z){N.push(Z),await this.stopLocalStreams([Z]);try{await this.initLocalStream(Z)}catch(ie){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",ie),await this.inactiveTracks([Z],!1),S(ie)}}if(K){const ie=await this.getLocalStream(Z);if(ie&&(await this.initUserMediaStreamContext(c,Z,ie),te)){await this.replaceSenderStream([Z],!0);const Q=await this.getUsersId();await this.p2p.replaceSenderStreams(Q,N,!0)}}{if(N.length!==0){const ie=await this.getLocalStreams(N);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:ie,desc:"local stream is change."});const Q={};for(const se of N)Q[se]=!0;await this.emitNotifyUpdateUsersStreams([{userId:this.options.userId,updateStreams:Q}]),await this.emitNotifyUpdateUsers()}b(!0)}};O==="audioinput"&&await j("microphoneCamera_audio"),O==="videoinput"&&await j("microphoneCamera_video"),O==="audiooutput"&&(await this.changeAudiooutput(),b(!0))}));ee(this,"changeScreenSharing",async O=>{const A=await this.getSelfInfo(),{tracks:b=[],callActionMap:S}=A;try{await this.setLocalStream(O,!0);for(const i of O)b.find(k=>k.mediaType===i&&S[i])&&await this.replaceSenderStream([i],!0)}catch(i){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",i)}});ee(this,"earlyConnect",(O=[])=>{this.isEarly=!0;const A=async()=>new Promise(async(b,S)=>{try{await ce(this,gt).call(this).then(async()=>{await ce(this,At).call(this),O.length===0&&(O=["microphoneCamera_audio","microphoneCamera_video"]),await ce(this,jt).call(this,O),b(!0)})}catch(i){S(i)}});return this.asyncQueue.add(A,{describe:"earlyConnect"})});ee(this,"joinRoom",async O=>(this.isInRoom=!0,this.setOptions(O),await ce(this,gt).call(this),new Promise(async(A,b)=>{De(this,_t,async()=>{try{this.clearUsers();const{roomId:S,userId:i,callType:c,sdkToken:k}=this.options;await this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:c,roomId:S,user:{id:i,tracks:[],callAction:0},token:k},version:2}).then(async C=>{const{code:N=0,desc:j="服务器繁忙",data:Z}=C;if(N!==200)throw new Error(j);const{roomId:z="",roomUsers:K=[]}=Z;if(z!==S)return b("加入的房间不匹配");this.initHeartbeat(),this.isEarly===!1&&await ce(this,At).call(this),await this.updateUsers(K);const te=[];for(const Q of K){const{id:se,channelCache:he}=Q,{channels:X=[]}=he;await this.updateUserBehaviors(se,Q.behavior),await this.updateUserChannels(se,X,!1),X.length!==0&&te.push({userId:se,channels:X})}await this.subChannel(te),await this.emitNotifyUpdateUsers();const ie=await this.getUsers();A(ie)})}catch(S){b(S)}}),ce(this,_t).call(this)})));ee(this,"quitRoom",()=>new Promise(async O=>{const{roomId:A,userId:b}=this.options,S={roomId:A,user:{id:b}};try{this.isInRoom=!1,this.options.roomId="",this.asyncQueue.clear(),clearInterval(ce(this,Et)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(i){this.reportLogs("quit_room_error",i.message||i)}await new Promise(i=>setTimeout(()=>i(!0),300)),await this.cwsIns.sendMessage({event:"quitRoom",data:S}),O(!0)}));ee(this,"quitRoomEx",()=>new Promise(async O=>{const{roomId:A,userId:b}=this.options,S={roomId:A,user:{id:b}};try{this.isInRoom=!1,this.options.roomId="",this.asyncQueue.clear(),this.stopHeartbeat(),this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe().catch(()=>{this.reconstruct()}),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(i){this.reportLogs("quit_room_error",i.message||i)}await new Promise(i=>setTimeout(()=>i(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:S}),O(!0)}));ee(this,"syncRoomInfo",()=>new Promise(async(O,A)=>{try{const{userId:b}=this.options,S=await this.getUser(b),{id:i=b,callAction:c=0}=S;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:c}}}).then(async k=>{const{code:C=0,desc:N,data:j={}}=k;if(C!==200)throw new Error(N);const{isActive:Z=!1,users:z=[]}=j;if(Z===!1)throw new Error("Do not stay in this room.");if(z.find(te=>te.id===this.options.userId)===!1)throw new Error("Need to rejoin the room.");this.clearUsers(),await this.updateUsers(z),await this.updateUsertracks(S.id,S.tracks,!1);{const te=await this.getUsers();O(te)}})}catch(b){A(b)}}));ee(this,"checkInRoom",()=>new Promise(async O=>{const{userId:A}=this.options,b=await this.getUser(A),{id:S=A,callAction:i=0}=b;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:S,callAction:i}}}).then(async c=>{var Z;const{code:k=0,desc:C}=c;if(k!==200)throw new Error(C);const N=c.data.users;return(Z=c.data)!=null&&Z.isActive||N.find(z=>z.id===this.options.userId)?O(!0):O(!1)}).catch(()=>O(!1))}));ee(this,"publish",O=>{const A=()=>new Promise(async(b,S)=>{try{{const Z=await this.getSelfInfo(),{banBehaviorMap:z}=Z;let K=!0;for(const te of O)if(z[te]){K=!1;break}if(K===!1)return S("publish is error: prohibited by administrator.")}try{await this.setLocalStream(O,!0)}catch(Z){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",Z)}const i=await this.getSelfInfo(),c=[];for(const Z of O){{const z=this.getPhoneyStreams(Z);await this.initUserMediaStreamContext(i.id,Z,z)}{const z=await this.getLocalStream(Z);z?await this.initUserMediaStreamContext(i.id,Z,z):c.push(Z)}}const k=O.filter(Z=>!c.includes(Z)||["microphoneCamera_audio","microphoneCamera_video"].includes(Z));await this.replaceSenderStream(O,!1),await ce(this,jt).call(this,k);const C=await this.getSenderTracks(k),N=[...i.tracks,...C];await this.updateUsertracks(i.id,N,!0),c.length!==0&&await this.inactiveTracks(c,!1),k.length!==0&&await this.replaceSenderStream(k,!0);const j=await this.getCallAction(N);await ce(this,Rt).call(this,j),await new Promise(Z=>setTimeout(()=>Z(!0),230)),ce(this,Qt).call(this,O);{await this.emitNotifyUpdateUsers();const Z=await this.getSelfInfo(),z={};for(const K of O)z[K]=!0;await this.emitNotifyUpdateUsersStreams([{userId:Z.id,updateStreams:z}]),b(Z)}}catch(i){this.reportLogs("publish_error",i.message||i),S(i)}});return this.asyncQueue.add(A,{describe:"publish"})});ee(this,"stopPublish",(O=[])=>{const A=()=>new Promise(async(b,S)=>{try{const i=await this.getSelfInfo();O.length===0&&(O=mediaType_keys);const c=i.tracks.filter(({mediaType:C})=>C&&O.includes(C)),k=async()=>{const C=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),b(C)};if(c.length===0)return k();await this.replaceSenderStream(O,!0),await this.closeUserTracks(i.id,c,!0),await this.removeSenders(O);{const C=await this.getCallAction(i.tracks);await ce(this,Rt).call(this,C)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{session:this.sdk_session,roomId:this.options.roomId,sdp:this.getSdp(),tracks:c}}).then(async C=>{const{code:N=0,desc:j,sn:Z="",data:z={}}=C;if(await ce(this,lt).call(this,Z),N!==200)throw new Error(j);const{remoteSdp:K}=z;await this.setRemoteDescription({type:"answer",sdp:K}),k()})}catch(i){this.reportLogs("close_track_error",i.message||i),S(i)}});return this.asyncQueue.add(A,{describe:"stopPublish"})});ee(this,"subscribe",(O=[],A=3)=>{const b=()=>new Promise(async(S,i)=>{var c;try{await this.iceConnected();const k=await this.getUsers();let C=[];for(const z of k){const{isSelf:K,tracks:te=[]}=z;if(!K){const ie=te.filter(({trackName:Q,mid:se=""})=>se!==""&&(O.includes(Q)||O.length===0));ie.length!==0&&C.push({...z,tracks:ie});for(const Q of ie)if(Q.mediaType==="microphoneCamera_video"){await this.updateUserUseP2P(z.id,!1);const se=await this.getP2PIns(z.id);(c=se==null?void 0:se.recv_peer_ins)==null||c.close()}}}const N=async(z={})=>{const K=Array.from(C,({id:ie})=>ie),te=await this.getUsers(K);await this.emitNotifyUpdateUsers(),S({users:te,detail:z})};if(C.length===0)return N();const j=[];for(const z of C){const{id:K,tracks:te}=z,ie=dt(te,["type","trackName"]),Q={id:K,tracks:ie};j.push(Q)}const Z=async()=>{A--,await this.cwsIns.sendMessage({event:"subscribe",data:{session:this.sdk_session,users:j}}).then(async z=>{const{code:K=0,desc:te,sn:ie="",data:Q={}}=z;if(await ce(this,lt).call(this,ie),K===2017&&te.includes("renegotiation is expected before pulling or pushing tracks")&&await this.renegotiate(),K!==200){if(A>=0)return await new Promise(X=>setTimeout(()=>X(!0),500)),await Z();throw new Error(te)}const{remoteSdp:se,users:he=[]}=Q;this.onSubscribeUserTracks(he).then(async X=>{await this.renegotiate().then(()=>N(X))}).catch(X=>{throw new Error(X)}),await this.setRemoteDescription({type:"offer",sdp:se})})};await Z()}catch(k){this.reportLogs("subscribe_error",k.message||k),i(k)}});return this.asyncQueue.add(b,{describe:"subscribe"})});ee(this,"renegotiate",()=>new Promise(async(O,A)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(async b=>{const{code:S=0,desc:i,sn:c=""}=b;if(await ce(this,lt).call(this,c),S!==200)throw new Error(i);O(b)})}catch(b){A(b)}}));ee(this,"stopSubscribe",(O=[])=>{const A=()=>new Promise(async(b,S)=>{try{const i=await this.getUsers(),c=[];for(const C of i){const{tracks:N=[]}=C;for(const j of N){const{type:Z,mid:z,trackName:K,mediaType:te,msid:ie}=j;if(!(!te||!ie)&&(O.length===0||O.includes(K))){const Q={type:Z,mid:z,trackName:ie};c.push(Q),await this.closeUserTracks(C.id,[j])}}}const k=async()=>{await this.emitNotifyUpdateUsers(),b(!0)};if(c.length===0)return k();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:c}}).then(async C=>{const{code:N=0,desc:j,sn:Z="",data:z={}}=C;if(N!==200)throw new Error(j);await ce(this,lt).call(this,Z);const{remoteSdp:K}=z;await this.setRemoteDescription({type:"answer",sdp:K})}),k()}catch(i){this.reportLogs("close_track_error",i.message||i),S(i)}});return this.asyncQueue.add(A,{describe:"stopSubscribe"})});ee(this,"inactiveTracks",async(O,A)=>new Promise(async b=>{const S=await this.getSelfInfo();if(!S||!S.id)return b(!0);const{tracks:i=[]}=S,c=[...i];for(let C of c){const{mediaType:N}=C;if(N&&O.includes(N)){C.enabled=A;const j=await this.getLocalStream(N);if(!j)continue;const Z=j.getTracks();for(const z of Z)z.enabled=A}}await this.replaceSenderStream(O,A);const k=await this.getCallAction(c);await ce(this,Rt).call(this,k),await this.emitNotifyUpdateUsers(),b(!0)}));ee(this,"setBanBehaviors",O=>new Promise(async(A,b)=>{try{const{roomId:S}=this.options,i=[];for(const c of O){const{id:k,banBehaviors:C}=c,N=Object.keys(C);if(N.length===0)continue;const j=[];for(const z of N){const K=mediaType_keys.findIndex(Q=>Q===z),te=C[z],ie={type:K,behavior:te};j.push(ie)}const Z={id:k,behaviors:j};i.push(Z)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:S,users:i}}).then(async c=>{const{code:k=0,desc:C}=c;if(k!==200)return b(C);A(c)})}catch(S){b(S)}}));ee(this,"pubChannel",()=>new Promise(async(O,A)=>{const S=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:S}}).then(async i=>{const{code:c=0,data:k,desc:C}=i;if(c!==200)throw new Error(C);const{channels:N=[]}=k;for(const j of N){const{channels:Z=[]}=j;for(const z of Z){const{dataChannelName:K,id:te}=z;this.initSendChannel(K,te)}}O(!0)}).catch(i=>{A(i)})}));ee(this,"subChannel",(O=[])=>new Promise(async A=>{if(O.length===0)return A(!0);await this.cwsIns.sendMessage({event:"subChannel",data:{channels:O}}).then(async b=>{const{code:S=0,data:i,desc:c}=b;if(S!==200)throw new Error(c);const{channels:k=[]}=i;for(const C of k){const{channels:N=[]}=C;for(const j of N){const{dataChannelName:Z,id:z}=j;this.initReceiveChannel(Z,z)}}})}));ee(this,"debugger",()=>new Promise(async(O,A)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async b=>{if(b.code!==200)return A(b.desc);O(!0)}).catch(b=>{A(b)})}));ee(this,"shutdown",()=>new Promise(async(O,A)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async b=>{if(b.code!==200)return A(b.desc);O(!0)}).catch(b=>{A(b)})}));ee(this,"reconstruct",async()=>{if(this.asyncQueue.clear(),this.setRoomState("ready"),this.asyncQueue.clear(),this.initPeer(),this.isEarly&&this.earlyConnect(),this.isInRoom===!1)return;const O=[],A=[],b=await this.getUsers();for(const S of b){const{isSelf:i,callActionMap:c,tracks:k=[]}=S;if(i)for(const C of mediaType_keys)c[C]&&O.push(C);for(const C of k)C.msid&&A.push(C.trackName)}this.isInRoom&&(this.isEarly===!1&&await ce(this,gt).call(this).then(async()=>{await ce(this,At).call(this)}),ce(this,_t)&&await ce(this,_t).call(this)),await this.syncRoomInfo().then(async()=>{await this.publish(O),await this.subscribe(A)}).catch(()=>{this.setRoomState("closed")})});ee(this,"initHeartbeat",()=>{this.stopHeartbeat();const O=()=>{let b=0,S=0,i=0,c=0;{const{outboundBytes:k,inboundBytes:C}=this.getPeerNetwork();i=Math.ceil(k/1024),c=Math.ceil(C/1024)}this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx",data:{p2pPush:b,p2pPull:S,sfuPull:c,sfuPush:i}},!1)},A=this.isInRoom?10*1e3:30*1e3;De(this,Et,window.setInterval(O,A)),O()});ee(this,"stopHeartbeat",()=>{clearInterval(ce(this,Et))});be(this,Qt,async O=>new Promise(async(A,b)=>{try{const{roomId:S}=this.options;if(!S)return;const{id:i,tracks:c=[]}=await this.getSelfInfo(),k=c.filter(C=>C.mediaType&&O.includes(C.mediaType));if(k.length===0)return;await this.cwsIns.sendMessage({event:"pubNotify",data:{session:this.sdk_session,roomId:S,user:{id:i,tracks:k}}}),A(!0)}catch(S){b(S)}}));be(this,lt,O=>new Promise(A=>{this.cwsIns.sendMessage({event:"ackMsg",data:{msgId:O}},!1),A(!0)}));be(this,Rt,async O=>new Promise(async(A,b)=>{const{roomId:S,userId:i}=this.options,c={roomId:S,user:{id:i,callAction:O}};await this.cwsIns.sendMessage({event:"updateCall",data:c}).then(async k=>{const{code:C=0}=k;if(C!==200)return b(k);await this.updateUserCallAction(i,O),A(O)}).catch(k=>b(k))}));ee(this,"setSession",()=>{const{appid:O,roomId:A,userId:b}=this.options;if(!O)throw new Error("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const S={c:O,r:A,p:"web",h:location.hostname,v:this.sdk_service_version};this.isEarly?S.i=this.options.earlyId:S.b=b;const i=btoa(encodeURI(JSON.stringify(S)));this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSession",S);const c=`${this.options.url}?s=${i}&t=${Date.now()}`;this.cwsIns.prws.setOptions({url:c})});be(this,gt,()=>new Promise(async(O,A)=>{try{switch(this.cwsIns.state){case"connected":this.cwsIns.state==="connected"&&O(!0);break;case"connecting":ce(this,xt).push(O);break;case"closed":{ce(this,xt).push(O),this.cwsIns.clearEvents(),this.setSession(),await this.cwsIns.connect(),this.initHeartbeat();for(const b of ce(this,xt))await b()}break}}catch(b){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",b),this.reportLogs("ws_c_timeout",b.message||b),A(b)}}));be(this,At,async()=>new Promise(async(O,A)=>{try{await ce(this,gt).call(this),this.p2p.reportNetwork(),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async b=>{const{code:S=0,desc:i,data:c}=b;if(S!==200)throw new Error(i);const{remoteSdp:k,session:C=""}=c;if(this.sdk_session=C,this.options.debug){const N=libExports$1.parse(k),j=dt(N.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:j,sdpJson:N})}await this.setRemoteDescription({type:"answer",sdp:k}),await this.iceConnected().then(()=>{O(!0)})})}catch(b){A(b)}}));be(this,jt,async O=>new Promise(async(A,b)=>{try{await this.iceConnected();const S=await this.addSenders(O),i=await this.getSenderTracks(S);if(i.length===0)return A(!0);const c=await this.cwsIns.sendMessage({event:"publish",data:{session:this.sdk_session,sdp:this.getSdp(),tracks:i,callAction:0}}),{code:k=0,desc:C,sn:N="",data:j={}}=c;if(await ce(this,lt).call(this,N),k!==200)throw new Error(C);const{remoteSdp:Z}=j;await this.setRemoteDescription({type:"answer",sdp:Z}),A(!0)}catch(S){this.reportLogs("publish_error",S.message||S),await this.removeSenders(O),b(S)}}));be(this,en,()=>{{const O=async A=>{const{code:b,data:S}=A;if(b!==200)return;const{sdp:i,sender:c={},tracks:k=[]}=S,{id:C}=c,N=await this.getP2PIns(C);if(!N)return;await N.initSenderPc();const j=[];for(const Q of k)j.push(mediaType_keys[Q.type]);await N.addSenders(j),await N.setOffer({type:"offer",sdp:i});const Z=await N.createAnswer(),{roomId:z}=this.options,K=await this.getSelfInfo(),te=()=>new Promise(async(Q,se)=>{try{const he=await N.getSenderTracks(j),X=await this.cwsIns.sendMessage({event:"answer",data:{roomId:z,tracks:he,sender:{id:K.id,callAction:K.callAction},receiverId:C,sdp:Z.sdp}}),{code:oe=0,desc:de}=X;if(oe!==200)throw new Error(de);Q(!0)}catch(he){se(he)}}),ie=()=>new Promise(async(Q,se)=>{try{const he=N.getIcecandidates(),X=Array.from(he,({sdpMid:le,sdpMLineIndex:pe,candidate:ne})=>({sdpMid:le,sdpMLineIndex:pe,sdp:ne})),oe=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:z,senderId:K.id,receiverId:C,candidates:X,isSubscribeReceiver:!1}}),{code:de=0,desc:ae}=oe;if(de!==200)throw new Error(ae);Q(!0)}catch(he){se(he)}});await te(),await ie(),await this.p2p.replaceSenderStreams([C],j,!0)};this.cwsIns.addNotify({event:"onOffer",callback:O},!0)}{const O=async A=>{const{code:b,data:S}=A;if(b!==200)return;const{senderId:i,candidates:c=[],receiverId:k,isSubscribeReceiver:C=!1}=S;if(C===!1||k!==this.options.userId)return;const N=await this.getP2PIns(i);if(!N)return;const j=Array.from(c,({sdpMid:Z,sdpMLineIndex:z,sdp:K})=>({sdpMid:Z,sdpMLineIndex:z,candidate:K}));await N.addCandidates(j),await N.sendIceConnected()};this.cwsIns.addNotify({event:"onCandidate",callback:O},!0)}});ee(this,"p2p",{open:(O,A=["microphoneCamera_video"])=>new Promise(async(b,S)=>{const i=c=>{this.p2p.reportP2PConnect(O,1,c.message||c),S(c)};try{A.length===0&&(A=mediaType_keys);const c=await this.getP2PIns(O);if(!c)return S("illegal user object.");const{roomId:k}=this.options,C=await this.getSelfInfo(),N=wt(),j=()=>new Promise(async(te,ie)=>{try{const Q=await c.createOffer(),he=(await this.getUser(O)).tracks.filter(ae=>A.includes(ae.mediaType)),X=await this.cwsIns.sendMessage({event:"offer",data:{roomId:k,tracks:he,sender:{id:C.id,callAction:C.callAction},receiverId:O,sdp:Q.sdp}}),{code:oe=0,desc:de}=X;if(oe!==200)throw new Error(de);te(!0)}catch(Q){ie(Q)}}),Z=()=>new Promise((te,ie)=>{const Q=window.setTimeout(()=>{this.cwsIns.removeNotify([`onAnswer: ${N}`]),ie("await_answer is timeout.")},2e4),se=async he=>{const{code:X,data:oe}=he;if(X!==200)return;const{sender:de,sdp:ae,tracks:le=[]}=oe,{id:pe}=de;O===pe&&(clearTimeout(Q),this.cwsIns.removeNotify([`onAnswer: ${N}`]),te({answer:{type:"answer",sdp:ae},tracks:le}))};this.cwsIns.addNotify({event:"onAnswer",callback:se,sn:`onAnswer: ${N}`},!0)}),z=()=>new Promise(async(te,ie)=>{try{const Q=c.getIcecandidates(),se=Array.from(Q,({sdpMid:de,sdpMLineIndex:ae,candidate:le})=>({sdpMid:de,sdpMLineIndex:ae,sdp:le})),he=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:k,senderId:C.id,receiverId:O,candidates:se,isSubscribeReceiver:!0}}),{code:X=0,desc:oe}=he;if(X!==200)throw new Error(oe);te(!0)}catch(Q){ie(Q)}}),K=()=>new Promise((te,ie)=>{const Q=window.setTimeout(()=>{this.cwsIns.removeNotify([`onCandidate: ${N}`]),ie("await_answer_candidates is timeout.")},2e4),se=async he=>{const{code:X,data:oe}=he;if(X!==200)return;const{candidates:de=[],isSubscribeReceiver:ae=!1}=oe;if(ae===!1){clearTimeout(Q),this.cwsIns.removeNotify([`onCandidate: ${N}`]);const le=Array.from(de,({sdpMid:pe,sdpMLineIndex:ne,sdp:ue})=>({sdpMid:pe,sdpMLineIndex:ne,candidate:ue}));te(le)}};this.cwsIns.addNotify({event:"onCandidate",callback:se,sn:`onCandidate: ${N}`},!0)});Promise.all([Z(),K()]).then(async te=>{const[{answer:ie,tracks:Q},se]=te;await c.setAnswer(ie,se),await bt(c.recvIceConnected,{message:"connect is timeout.",timeout:10*1e3});const he=[];for(const X of Q)he.push(mediaType_keys[X.type]);{const X=await this.getUser(O),oe=Array.from(Q,ae=>ae.type),de=[];for(const ae of X.tracks)oe.includes(ae.type)&&de.push(ae.trackName);await this.stopSubscribe(de)}{const X=c.getTrack("microphoneCamera_video");if(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: track",X),!X)return;const oe=new MediaStream;oe.addTrack(X),await this.initUserMediaStreamContext(O,"microphoneCamera_video",oe);const de=await this.getUser(O),{tracks:ae=[]}=de;for(const le of ae)le.mediaType==="microphoneCamera_video"&&(await this.updateUserUseP2P(O,!0),await this.emitNotifyUpdateUsers(),await this.emitNotifyUpdateUsersStreams([{userId:O,updateStreams:{microphoneCamera_video:!0}}]))}this.p2p.reportP2PConnect(O,0,"连接成功"),b(!0)}).catch(te=>i(te)),await j(),await z()}catch(c){i(c)}}),replaceSenderStreams:async(O,A=[],b)=>{for(const S of O){const{userId:i}=this.options,c=await this.getP2PIns(S);if(!(!c||!c.send_peer_ins))for(const k of A){const C=c.transceiverMap.get(k);let N;if(C){const{sender:j}=C;b?N=this.getUserStream(i,k):N=this.getPhoneyStreams(k);const[Z]=N.getTracks();Z&&await j.replaceTrack(Z)}}}},reportNetwork:()=>new Promise(async(O,A)=>{try{let b=0;switch((await h()).natType){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 S=0;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"wifi":S=0;break;case"4g":case"3g":case"2g":case"slow-2g":S=2;break;default:S=1;break}await this.cwsIns.sendMessage({event:"reportNetwork",data:{nat:b,type:S}}),O(!0)}catch(b){A(b)}}),reportP2PConnect:(O,A,b="")=>this.cwsIns.sendMessage({event:"reportP2PConnect",data:{userId:O,code:A,reason:b}}),close:async O=>{}});ce(this,en).call(this)}}Et=new WeakMap,xt=new WeakMap,_t=new WeakMap,Qt=new WeakMap,lt=new WeakMap,Rt=new WeakMap,gt=new WeakMap,At=new WeakMap,jt=new WeakMap,en=new WeakMap;class Room extends RoomCalls{constructor(D){super(D)}}class QuickVO extends Room{constructor(O){super(O);be(this,St,new Map);be(this,tn,()=>{{const O=async A=>{const{state:b}=A.data;if(b==="closed"){const{roomId:S,userId:i}=this.options,c={roomId:S,user:{id:i}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:c}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:O},!0)}{const O=async A=>{const{qualities:b=[]}=A.data,[S]=b;if(!(S&&S.userId===this.options.userId&&b.length===1)){for(const i of b){const{userId:c,egress:k,ingress:C}=i;this.checkUserInRoom(c)&&await this.updateUserNetwork(c,{egress:k,ingress:C})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:O},!0)}{const O=async A=>{const b=A.data.user;await this.removeUsers([b.id]),await this.updateUsers([b]),await this.updateUsertracks(b.id,b.track,!1),await this.updateUserBehaviors(b.id,b.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:O},!0)}{const O=async A=>{await this.removeUsers([A.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:O},!0)}{const O=async A=>{const{user:b}=A.data,{id:S,tracks:i=[],callAction:c=0}=b;if(await this.updateUserCallAction(S,c),await this.updateUserPermissions(S,3),await this.updateUsertracks(S,i,!0),this.options.newPublishAutoSubscribe){const k=this.getTrackNamesFormTracks(i);await this.subscribe(k)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:O},!0)}{const O=async A=>{const b=[A.data];this.subChannel(b)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:O},!0)}{const O=async A=>{const{id:b,tracks:S}=A.data.user;b!==this.options.userId&&(await this.closeUserTracks(b,S,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:O},!0)}{const O=async A=>{const{id:b,callAction:S}=A.data.user;this.checkUserInRoom(b)&&(await this.updateUserCallAction(b,S),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:O},!0)}{const O=async A=>{const{user:b}=A.data,{id:S,permissions:i=1}=b;i===1?await this.removeUsers([S]):i===3&&await this.updateUsers([b]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:O},!0)}{const O=async A=>{const{users:b}=A.data;for(const S of b){const{id:i,behavior:c}=S;await this.updateUserBehaviors(i,c)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:O},!0)}{const O=async A=>{const{roomId:b,userId:S}=A.data;this.options.roomId===b&&this.p2p.open(S)};this.cwsIns.addNotify({event:"onAttemptP2PReq",callback:O},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async O=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});ee(this,"addNotify",O=>this.cwsIns.addNotify(O));be(this,nn,()=>{this.cwsIns.prws.checkReconnect=async O=>O.code===1e3?(this.setRoomState("closed"),!1):O.code===4001?(this.setRoomState("closed"),!1):O.code===4002?(this.setRoomState("closed"),!1):O.code===4003?(this.setRoomState("closed"),!1):(this.setSession(),O.code===4010||await new Promise(A=>setTimeout(()=>A(!0),5*1e3)),!0),this.cwsIns.prws.onReconnectSuccess=async O=>{this.reconstruct()},this.cwsIns.prws.onReconnectStop=async O=>{this.setRoomState("closed")}});ee(this,"addRequestAnimationFrame",async(O,A)=>{{const S=ce(this,St).get(O);S&&cancelAnimationFrame(S)}const b=(S=Date.now())=>{A(S);const i=requestAnimationFrame(b);ce(this,St).set(O,i)};b()});ee(this,"clearRequestAnimationFrame",async(O=[])=>{O.length===0&&(O=[...ce(this,St).keys()]);const A=[];for(const b of O){const S=ce(this,St).get(b);S&&(cancelAnimationFrame(S),A.push(S))}return A});ee(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise(O=>setTimeout(()=>O(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.clearEvents()});ce(this,nn).call(this),ce(this,tn).call(this)}}St=new WeakMap,tn=new WeakMap,nn=new WeakMap,exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
9
+ */var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function($){const D=requireBase64Js(),O=requireIeee754(),A=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;$.Buffer=c,$.SlowBuffer=ae,$.INSPECT_MAX_BYTES=50;const k=2147483647;$.kMaxLength=k,c.TYPED_ARRAY_SUPPORT=S(),!c.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 S(){try{const J=new Uint8Array(1),M={foo:function(){return 42}};return Object.setPrototypeOf(M,Uint8Array.prototype),Object.setPrototypeOf(J,M),J.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function i(J){if(J>k)throw new RangeError('The value "'+J+'" is invalid for option "size"');const M=new Uint8Array(J);return Object.setPrototypeOf(M,c.prototype),M}function c(J,M,F){if(typeof J=="number"){if(typeof M=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return j(J)}return b(J,M,F)}c.poolSize=8192;function b(J,M,F){if(typeof J=="string")return Z(J,M);if(ArrayBuffer.isView(J))return K(J);if(J==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof J);if(Qe(J,ArrayBuffer)||J&&Qe(J.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Qe(J,SharedArrayBuffer)||J&&Qe(J.buffer,SharedArrayBuffer)))return te(J,M,F);if(typeof J=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=J.valueOf&&J.valueOf();if(Y!=null&&Y!==J)return c.from(Y,M,F);const oe=ie(J);if(oe)return oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof J[Symbol.toPrimitive]=="function")return c.from(J[Symbol.toPrimitive]("string"),M,F);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof J)}c.from=function(J,M,F){return b(J,M,F)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function C(J){if(typeof J!="number")throw new TypeError('"size" argument must be of type number');if(J<0)throw new RangeError('The value "'+J+'" is invalid for option "size"')}function N(J,M,F){return C(J),J<=0?i(J):M!==void 0?typeof F=="string"?i(J).fill(M,F):i(J).fill(M):i(J)}c.alloc=function(J,M,F){return N(J,M,F)};function j(J){return C(J),i(J<0?0:ee(J)|0)}c.allocUnsafe=function(J){return j(J)},c.allocUnsafeSlow=function(J){return j(J)};function Z(J,M){if((typeof M!="string"||M==="")&&(M="utf8"),!c.isEncoding(M))throw new TypeError("Unknown encoding: "+M);const F=de(J,M)|0;let Y=i(F);const oe=Y.write(J,M);return oe!==F&&(Y=Y.slice(0,oe)),Y}function z(J){const M=J.length<0?0:ee(J.length)|0,F=i(M);for(let Y=0;Y<M;Y+=1)F[Y]=J[Y]&255;return F}function K(J){if(Qe(J,Uint8Array)){const M=new Uint8Array(J);return te(M.buffer,M.byteOffset,M.byteLength)}return z(J)}function te(J,M,F){if(M<0||J.byteLength<M)throw new RangeError('"offset" is outside of buffer bounds');if(J.byteLength<M+(F||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return M===void 0&&F===void 0?Y=new Uint8Array(J):F===void 0?Y=new Uint8Array(J,M):Y=new Uint8Array(J,M,F),Object.setPrototypeOf(Y,c.prototype),Y}function ie(J){if(c.isBuffer(J)){const M=ee(J.length)|0,F=i(M);return F.length===0||J.copy(F,0,0,M),F}if(J.length!==void 0)return typeof J.length!="number"||nn(J.length)?i(0):z(J);if(J.type==="Buffer"&&Array.isArray(J.data))return z(J.data)}function ee(J){if(J>=k)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+k.toString(16)+" bytes");return J|0}function ae(J){return+J!=J&&(J=0),c.alloc(+J)}c.isBuffer=function(M){return M!=null&&M._isBuffer===!0&&M!==c.prototype},c.compare=function(M,F){if(Qe(M,Uint8Array)&&(M=c.from(M,M.offset,M.byteLength)),Qe(F,Uint8Array)&&(F=c.from(F,F.offset,F.byteLength)),!c.isBuffer(M)||!c.isBuffer(F))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(M===F)return 0;let Y=M.length,oe=F.length;for(let he=0,me=Math.min(Y,oe);he<me;++he)if(M[he]!==F[he]){Y=M[he],oe=F[he];break}return Y<oe?-1:oe<Y?1:0},c.isEncoding=function(M){switch(String(M).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}},c.concat=function(M,F){if(!Array.isArray(M))throw new TypeError('"list" argument must be an Array of Buffers');if(M.length===0)return c.alloc(0);let Y;if(F===void 0)for(F=0,Y=0;Y<M.length;++Y)F+=M[Y].length;const oe=c.allocUnsafe(F);let he=0;for(Y=0;Y<M.length;++Y){let me=M[Y];if(Qe(me,Uint8Array))he+me.length>oe.length?(c.isBuffer(me)||(me=c.from(me)),me.copy(oe,he)):Uint8Array.prototype.set.call(oe,me,he);else if(c.isBuffer(me))me.copy(oe,he);else throw new TypeError('"list" argument must be an Array of Buffers');he+=me.length}return oe};function de(J,M){if(c.isBuffer(J))return J.length;if(ArrayBuffer.isView(J)||Qe(J,ArrayBuffer))return J.byteLength;if(typeof J!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof J);const F=J.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&F===0)return 0;let oe=!1;for(;;)switch(M){case"ascii":case"latin1":case"binary":return F;case"utf8":case"utf-8":return ot(J).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F*2;case"hex":return F>>>1;case"base64":return Pt(J).length;default:if(oe)return Y?-1:ot(J).length;M=(""+M).toLowerCase(),oe=!0}}c.byteLength=de;function X(J,M,F){let Y=!1;if((M===void 0||M<0)&&(M=0),M>this.length||((F===void 0||F>this.length)&&(F=this.length),F<=0)||(F>>>=0,M>>>=0,F<=M))return"";for(J||(J="utf8");;)switch(J){case"hex":return Ge(this,M,F);case"utf8":case"utf-8":return we(this,M,F);case"ascii":return Me(this,M,F);case"latin1":case"binary":return Le(this,M,F);case"base64":return ve(this,M,F);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ft(this,M,F);default:if(Y)throw new TypeError("Unknown encoding: "+J);J=(J+"").toLowerCase(),Y=!0}}c.prototype._isBuffer=!0;function ne(J,M,F){const Y=J[M];J[M]=J[F],J[F]=Y}c.prototype.swap16=function(){const M=this.length;if(M%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let F=0;F<M;F+=2)ne(this,F,F+1);return this},c.prototype.swap32=function(){const M=this.length;if(M%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let F=0;F<M;F+=4)ne(this,F,F+3),ne(this,F+1,F+2);return this},c.prototype.swap64=function(){const M=this.length;if(M%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let F=0;F<M;F+=8)ne(this,F,F+7),ne(this,F+1,F+6),ne(this,F+2,F+5),ne(this,F+3,F+4);return this},c.prototype.toString=function(){const M=this.length;return M===0?"":arguments.length===0?we(this,0,M):X.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(M){if(!c.isBuffer(M))throw new TypeError("Argument must be a Buffer");return this===M?!0:c.compare(this,M)===0},c.prototype.inspect=function(){let M="";const F=$.INSPECT_MAX_BYTES;return M=this.toString("hex",0,F).replace(/(.{2})/g,"$1 ").trim(),this.length>F&&(M+=" ... "),"<Buffer "+M+">"},A&&(c.prototype[A]=c.prototype.inspect),c.prototype.compare=function(M,F,Y,oe,he){if(Qe(M,Uint8Array)&&(M=c.from(M,M.offset,M.byteLength)),!c.isBuffer(M))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof M);if(F===void 0&&(F=0),Y===void 0&&(Y=M?M.length:0),oe===void 0&&(oe=0),he===void 0&&(he=this.length),F<0||Y>M.length||oe<0||he>this.length)throw new RangeError("out of range index");if(oe>=he&&F>=Y)return 0;if(oe>=he)return-1;if(F>=Y)return 1;if(F>>>=0,Y>>>=0,oe>>>=0,he>>>=0,this===M)return 0;let me=he-oe,Te=Y-F;const qe=Math.min(me,Te),Be=this.slice(oe,he),Ne=M.slice(F,Y);for(let Pe=0;Pe<qe;++Pe)if(Be[Pe]!==Ne[Pe]){me=Be[Pe],Te=Ne[Pe];break}return me<Te?-1:Te<me?1:0};function fe(J,M,F,Y,oe){if(J.length===0)return-1;if(typeof F=="string"?(Y=F,F=0):F>2147483647?F=2147483647:F<-2147483648&&(F=-2147483648),F=+F,nn(F)&&(F=oe?0:J.length-1),F<0&&(F=J.length+F),F>=J.length){if(oe)return-1;F=J.length-1}else if(F<0)if(oe)F=0;else return-1;if(typeof M=="string"&&(M=c.from(M,Y)),c.isBuffer(M))return M.length===0?-1:se(J,M,F,Y,oe);if(typeof M=="number")return M=M&255,typeof Uint8Array.prototype.indexOf=="function"?oe?Uint8Array.prototype.indexOf.call(J,M,F):Uint8Array.prototype.lastIndexOf.call(J,M,F):se(J,[M],F,Y,oe);throw new TypeError("val must be string, number or Buffer")}function se(J,M,F,Y,oe){let he=1,me=J.length,Te=M.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(J.length<2||M.length<2)return-1;he=2,me/=2,Te/=2,F/=2}function qe(Ne,Pe){return he===1?Ne[Pe]:Ne.readUInt16BE(Pe*he)}let Be;if(oe){let Ne=-1;for(Be=F;Be<me;Be++)if(qe(J,Be)===qe(M,Ne===-1?0:Be-Ne)){if(Ne===-1&&(Ne=Be),Be-Ne+1===Te)return Ne*he}else Ne!==-1&&(Be-=Be-Ne),Ne=-1}else for(F+Te>me&&(F=me-Te),Be=F;Be>=0;Be--){let Ne=!0;for(let Pe=0;Pe<Te;Pe++)if(qe(J,Be+Pe)!==qe(M,Pe)){Ne=!1;break}if(Ne)return Be}return-1}c.prototype.includes=function(M,F,Y){return this.indexOf(M,F,Y)!==-1},c.prototype.indexOf=function(M,F,Y){return fe(this,M,F,Y,!0)},c.prototype.lastIndexOf=function(M,F,Y){return fe(this,M,F,Y,!1)};function ue(J,M,F,Y){F=Number(F)||0;const oe=J.length-F;Y?(Y=Number(Y),Y>oe&&(Y=oe)):Y=oe;const he=M.length;Y>he/2&&(Y=he/2);let me;for(me=0;me<Y;++me){const Te=parseInt(M.substr(me*2,2),16);if(nn(Te))return me;J[F+me]=Te}return me}function pe(J,M,F,Y){return At(ot(M,J.length-F),J,F,Y)}function re(J,M,F,Y){return At(mt(M),J,F,Y)}function le(J,M,F,Y){return At(Pt(M),J,F,Y)}function ye(J,M,F,Y){return At(tn(M,J.length-F),J,F,Y)}c.prototype.write=function(M,F,Y,oe){if(F===void 0)oe="utf8",Y=this.length,F=0;else if(Y===void 0&&typeof F=="string")oe=F,Y=this.length,F=0;else if(isFinite(F))F=F>>>0,isFinite(Y)?(Y=Y>>>0,oe===void 0&&(oe="utf8")):(oe=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const he=this.length-F;if((Y===void 0||Y>he)&&(Y=he),M.length>0&&(Y<0||F<0)||F>this.length)throw new RangeError("Attempt to write outside buffer bounds");oe||(oe="utf8");let me=!1;for(;;)switch(oe){case"hex":return ue(this,M,F,Y);case"utf8":case"utf-8":return pe(this,M,F,Y);case"ascii":case"latin1":case"binary":return re(this,M,F,Y);case"base64":return le(this,M,F,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,M,F,Y);default:if(me)throw new TypeError("Unknown encoding: "+oe);oe=(""+oe).toLowerCase(),me=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ve(J,M,F){return M===0&&F===J.length?D.fromByteArray(J):D.fromByteArray(J.slice(M,F))}function we(J,M,F){F=Math.min(J.length,F);const Y=[];let oe=M;for(;oe<F;){const he=J[oe];let me=null,Te=he>239?4:he>223?3:he>191?2:1;if(oe+Te<=F){let qe,Be,Ne,Pe;switch(Te){case 1:he<128&&(me=he);break;case 2:qe=J[oe+1],(qe&192)===128&&(Pe=(he&31)<<6|qe&63,Pe>127&&(me=Pe));break;case 3:qe=J[oe+1],Be=J[oe+2],(qe&192)===128&&(Be&192)===128&&(Pe=(he&15)<<12|(qe&63)<<6|Be&63,Pe>2047&&(Pe<55296||Pe>57343)&&(me=Pe));break;case 4:qe=J[oe+1],Be=J[oe+2],Ne=J[oe+3],(qe&192)===128&&(Be&192)===128&&(Ne&192)===128&&(Pe=(he&15)<<18|(qe&63)<<12|(Be&63)<<6|Ne&63,Pe>65535&&Pe<1114112&&(me=Pe))}}me===null?(me=65533,Te=1):me>65535&&(me-=65536,Y.push(me>>>10&1023|55296),me=56320|me&1023),Y.push(me),oe+=Te}return De(Y)}const xe=4096;function De(J){const M=J.length;if(M<=xe)return String.fromCharCode.apply(String,J);let F="",Y=0;for(;Y<M;)F+=String.fromCharCode.apply(String,J.slice(Y,Y+=xe));return F}function Me(J,M,F){let Y="";F=Math.min(J.length,F);for(let oe=M;oe<F;++oe)Y+=String.fromCharCode(J[oe]&127);return Y}function Le(J,M,F){let Y="";F=Math.min(J.length,F);for(let oe=M;oe<F;++oe)Y+=String.fromCharCode(J[oe]);return Y}function Ge(J,M,F){const Y=J.length;(!M||M<0)&&(M=0),(!F||F<0||F>Y)&&(F=Y);let oe="";for(let he=M;he<F;++he)oe+=an[J[he]];return oe}function ft(J,M,F){const Y=J.slice(M,F);let oe="";for(let he=0;he<Y.length-1;he+=2)oe+=String.fromCharCode(Y[he]+Y[he+1]*256);return oe}c.prototype.slice=function(M,F){const Y=this.length;M=~~M,F=F===void 0?Y:~~F,M<0?(M+=Y,M<0&&(M=0)):M>Y&&(M=Y),F<0?(F+=Y,F<0&&(F=0)):F>Y&&(F=Y),F<M&&(F=M);const oe=this.subarray(M,F);return Object.setPrototypeOf(oe,c.prototype),oe};function Ee(J,M,F){if(J%1!==0||J<0)throw new RangeError("offset is not uint");if(J+M>F)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||Ee(M,F,this.length);let oe=this[M],he=1,me=0;for(;++me<F&&(he*=256);)oe+=this[M+me]*he;return oe},c.prototype.readUintBE=c.prototype.readUIntBE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||Ee(M,F,this.length);let oe=this[M+--F],he=1;for(;F>0&&(he*=256);)oe+=this[M+--F]*he;return oe},c.prototype.readUint8=c.prototype.readUInt8=function(M,F){return M=M>>>0,F||Ee(M,1,this.length),this[M]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(M,F){return M=M>>>0,F||Ee(M,2,this.length),this[M]|this[M+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(M,F){return M=M>>>0,F||Ee(M,2,this.length),this[M]<<8|this[M+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(M,F){return M=M>>>0,F||Ee(M,4,this.length),(this[M]|this[M+1]<<8|this[M+2]<<16)+this[M+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(M,F){return M=M>>>0,F||Ee(M,4,this.length),this[M]*16777216+(this[M+1]<<16|this[M+2]<<8|this[M+3])},c.prototype.readBigUInt64LE=vt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const oe=F+this[++M]*2**8+this[++M]*2**16+this[++M]*2**24,he=this[++M]+this[++M]*2**8+this[++M]*2**16+Y*2**24;return BigInt(oe)+(BigInt(he)<<BigInt(32))}),c.prototype.readBigUInt64BE=vt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const oe=F*2**24+this[++M]*2**16+this[++M]*2**8+this[++M],he=this[++M]*2**24+this[++M]*2**16+this[++M]*2**8+Y;return(BigInt(oe)<<BigInt(32))+BigInt(he)}),c.prototype.readIntLE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||Ee(M,F,this.length);let oe=this[M],he=1,me=0;for(;++me<F&&(he*=256);)oe+=this[M+me]*he;return he*=128,oe>=he&&(oe-=Math.pow(2,8*F)),oe},c.prototype.readIntBE=function(M,F,Y){M=M>>>0,F=F>>>0,Y||Ee(M,F,this.length);let oe=F,he=1,me=this[M+--oe];for(;oe>0&&(he*=256);)me+=this[M+--oe]*he;return he*=128,me>=he&&(me-=Math.pow(2,8*F)),me},c.prototype.readInt8=function(M,F){return M=M>>>0,F||Ee(M,1,this.length),this[M]&128?(255-this[M]+1)*-1:this[M]},c.prototype.readInt16LE=function(M,F){M=M>>>0,F||Ee(M,2,this.length);const Y=this[M]|this[M+1]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt16BE=function(M,F){M=M>>>0,F||Ee(M,2,this.length);const Y=this[M+1]|this[M]<<8;return Y&32768?Y|4294901760:Y},c.prototype.readInt32LE=function(M,F){return M=M>>>0,F||Ee(M,4,this.length),this[M]|this[M+1]<<8|this[M+2]<<16|this[M+3]<<24},c.prototype.readInt32BE=function(M,F){return M=M>>>0,F||Ee(M,4,this.length),this[M]<<24|this[M+1]<<16|this[M+2]<<8|this[M+3]},c.prototype.readBigInt64LE=vt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const oe=this[M+4]+this[M+5]*2**8+this[M+6]*2**16+(Y<<24);return(BigInt(oe)<<BigInt(32))+BigInt(F+this[++M]*2**8+this[++M]*2**16+this[++M]*2**24)}),c.prototype.readBigInt64BE=vt(function(M){M=M>>>0,Ce(M,"offset");const F=this[M],Y=this[M+7];(F===void 0||Y===void 0)&&Fe(M,this.length-8);const oe=(F<<24)+this[++M]*2**16+this[++M]*2**8+this[++M];return(BigInt(oe)<<BigInt(32))+BigInt(this[++M]*2**24+this[++M]*2**16+this[++M]*2**8+Y)}),c.prototype.readFloatLE=function(M,F){return M=M>>>0,F||Ee(M,4,this.length),O.read(this,M,!0,23,4)},c.prototype.readFloatBE=function(M,F){return M=M>>>0,F||Ee(M,4,this.length),O.read(this,M,!1,23,4)},c.prototype.readDoubleLE=function(M,F){return M=M>>>0,F||Ee(M,8,this.length),O.read(this,M,!0,52,8)},c.prototype.readDoubleBE=function(M,F){return M=M>>>0,F||Ee(M,8,this.length),O.read(this,M,!1,52,8)};function $e(J,M,F,Y,oe,he){if(!c.isBuffer(J))throw new TypeError('"buffer" argument must be a Buffer instance');if(M>oe||M<he)throw new RangeError('"value" argument is out of bounds');if(F+Y>J.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(M,F,Y,oe){if(M=+M,F=F>>>0,Y=Y>>>0,!oe){const Te=Math.pow(2,8*Y)-1;$e(this,M,F,Y,Te,0)}let he=1,me=0;for(this[F]=M&255;++me<Y&&(he*=256);)this[F+me]=M/he&255;return F+Y},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(M,F,Y,oe){if(M=+M,F=F>>>0,Y=Y>>>0,!oe){const Te=Math.pow(2,8*Y)-1;$e(this,M,F,Y,Te,0)}let he=Y-1,me=1;for(this[F+he]=M&255;--he>=0&&(me*=256);)this[F+he]=M/me&255;return F+Y},c.prototype.writeUint8=c.prototype.writeUInt8=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,1,255,0),this[F]=M&255,F+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,65535,0),this[F]=M&255,this[F+1]=M>>>8,F+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,65535,0),this[F]=M>>>8,this[F+1]=M&255,F+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,4294967295,0),this[F+3]=M>>>24,this[F+2]=M>>>16,this[F+1]=M>>>8,this[F]=M&255,F+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,4294967295,0),this[F]=M>>>24,this[F+1]=M>>>16,this[F+2]=M>>>8,this[F+3]=M&255,F+4};function nt(J,M,F,Y,oe){Ie(M,Y,oe,J,F,7);let he=Number(M&BigInt(4294967295));J[F++]=he,he=he>>8,J[F++]=he,he=he>>8,J[F++]=he,he=he>>8,J[F++]=he;let me=Number(M>>BigInt(32)&BigInt(4294967295));return J[F++]=me,me=me>>8,J[F++]=me,me=me>>8,J[F++]=me,me=me>>8,J[F++]=me,F}function Ue(J,M,F,Y,oe){Ie(M,Y,oe,J,F,7);let he=Number(M&BigInt(4294967295));J[F+7]=he,he=he>>8,J[F+6]=he,he=he>>8,J[F+5]=he,he=he>>8,J[F+4]=he;let me=Number(M>>BigInt(32)&BigInt(4294967295));return J[F+3]=me,me=me>>8,J[F+2]=me,me=me>>8,J[F+1]=me,me=me>>8,J[F]=me,F+8}c.prototype.writeBigUInt64LE=vt(function(M,F=0){return nt(this,M,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=vt(function(M,F=0){return Ue(this,M,F,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(M,F,Y,oe){if(M=+M,F=F>>>0,!oe){const qe=Math.pow(2,8*Y-1);$e(this,M,F,Y,qe-1,-qe)}let he=0,me=1,Te=0;for(this[F]=M&255;++he<Y&&(me*=256);)M<0&&Te===0&&this[F+he-1]!==0&&(Te=1),this[F+he]=(M/me>>0)-Te&255;return F+Y},c.prototype.writeIntBE=function(M,F,Y,oe){if(M=+M,F=F>>>0,!oe){const qe=Math.pow(2,8*Y-1);$e(this,M,F,Y,qe-1,-qe)}let he=Y-1,me=1,Te=0;for(this[F+he]=M&255;--he>=0&&(me*=256);)M<0&&Te===0&&this[F+he+1]!==0&&(Te=1),this[F+he]=(M/me>>0)-Te&255;return F+Y},c.prototype.writeInt8=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,1,127,-128),M<0&&(M=255+M+1),this[F]=M&255,F+1},c.prototype.writeInt16LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,32767,-32768),this[F]=M&255,this[F+1]=M>>>8,F+2},c.prototype.writeInt16BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,2,32767,-32768),this[F]=M>>>8,this[F+1]=M&255,F+2},c.prototype.writeInt32LE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,2147483647,-2147483648),this[F]=M&255,this[F+1]=M>>>8,this[F+2]=M>>>16,this[F+3]=M>>>24,F+4},c.prototype.writeInt32BE=function(M,F,Y){return M=+M,F=F>>>0,Y||$e(this,M,F,4,2147483647,-2147483648),M<0&&(M=4294967295+M+1),this[F]=M>>>24,this[F+1]=M>>>16,this[F+2]=M>>>8,this[F+3]=M&255,F+4},c.prototype.writeBigInt64LE=vt(function(M,F=0){return nt(this,M,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=vt(function(M,F=0){return Ue(this,M,F,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function We(J,M,F,Y,oe,he){if(F+Y>J.length)throw new RangeError("Index out of range");if(F<0)throw new RangeError("Index out of range")}function rt(J,M,F,Y,oe){return M=+M,F=F>>>0,oe||We(J,M,F,4),O.write(J,M,F,Y,23,4),F+4}c.prototype.writeFloatLE=function(M,F,Y){return rt(this,M,F,!0,Y)},c.prototype.writeFloatBE=function(M,F,Y){return rt(this,M,F,!1,Y)};function Ke(J,M,F,Y,oe){return M=+M,F=F>>>0,oe||We(J,M,F,8),O.write(J,M,F,Y,52,8),F+8}c.prototype.writeDoubleLE=function(M,F,Y){return Ke(this,M,F,!0,Y)},c.prototype.writeDoubleBE=function(M,F,Y){return Ke(this,M,F,!1,Y)},c.prototype.copy=function(M,F,Y,oe){if(!c.isBuffer(M))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!oe&&oe!==0&&(oe=this.length),F>=M.length&&(F=M.length),F||(F=0),oe>0&&oe<Y&&(oe=Y),oe===Y||M.length===0||this.length===0)return 0;if(F<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(oe<0)throw new RangeError("sourceEnd out of bounds");oe>this.length&&(oe=this.length),M.length-F<oe-Y&&(oe=M.length-F+Y);const he=oe-Y;return this===M&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(F,Y,oe):Uint8Array.prototype.set.call(M,this.subarray(Y,oe),F),he},c.prototype.fill=function(M,F,Y,oe){if(typeof M=="string"){if(typeof F=="string"?(oe=F,F=0,Y=this.length):typeof Y=="string"&&(oe=Y,Y=this.length),oe!==void 0&&typeof oe!="string")throw new TypeError("encoding must be a string");if(typeof oe=="string"&&!c.isEncoding(oe))throw new TypeError("Unknown encoding: "+oe);if(M.length===1){const me=M.charCodeAt(0);(oe==="utf8"&&me<128||oe==="latin1")&&(M=me)}}else typeof M=="number"?M=M&255:typeof M=="boolean"&&(M=Number(M));if(F<0||this.length<F||this.length<Y)throw new RangeError("Out of range index");if(Y<=F)return this;F=F>>>0,Y=Y===void 0?this.length:Y>>>0,M||(M=0);let he;if(typeof M=="number")for(he=F;he<Y;++he)this[he]=M;else{const me=c.isBuffer(M)?M:c.from(M,oe),Te=me.length;if(Te===0)throw new TypeError('The value "'+M+'" is invalid for argument "value"');for(he=0;he<Y-F;++he)this[he+F]=me[he%Te]}return this};const ze={};function _e(J,M,F){ze[J]=class extends F{constructor(){super(),Object.defineProperty(this,"message",{value:M.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${J}]`,this.stack,delete this.name}get code(){return J}set code(oe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:oe,writable:!0})}toString(){return`${this.name} [${J}]: ${this.message}`}}}_e("ERR_BUFFER_OUT_OF_BOUNDS",function(J){return J?`${J} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_e("ERR_INVALID_ARG_TYPE",function(J,M){return`The "${J}" argument must be of type number. Received type ${typeof M}`},TypeError),_e("ERR_OUT_OF_RANGE",function(J,M,F){let Y=`The value of "${J}" is out of range.`,oe=F;return Number.isInteger(F)&&Math.abs(F)>2**32?oe=be(String(F)):typeof F=="bigint"&&(oe=String(F),(F>BigInt(2)**BigInt(32)||F<-(BigInt(2)**BigInt(32)))&&(oe=be(oe)),oe+="n"),Y+=` It must be ${M}. Received ${oe}`,Y},RangeError);function be(J){let M="",F=J.length;const Y=J[0]==="-"?1:0;for(;F>=Y+4;F-=3)M=`_${J.slice(F-3,F)}${M}`;return`${J.slice(0,F)}${M}`}function Se(J,M,F){Ce(M,"offset"),(J[M]===void 0||J[M+F]===void 0)&&Fe(M,J.length-(F+1))}function Ie(J,M,F,Y,oe,he){if(J>F||J<M){const me=typeof M=="bigint"?"n":"";let Te;throw M===0||M===BigInt(0)?Te=`>= 0${me} and < 2${me} ** ${(he+1)*8}${me}`:Te=`>= -(2${me} ** ${(he+1)*8-1}${me}) and < 2 ** ${(he+1)*8-1}${me}`,new ze.ERR_OUT_OF_RANGE("value",Te,J)}Se(Y,oe,he)}function Ce(J,M){if(typeof J!="number")throw new ze.ERR_INVALID_ARG_TYPE(M,"number",J)}function Fe(J,M,F){throw Math.floor(J)!==J?(Ce(J,F),new ze.ERR_OUT_OF_RANGE("offset","an integer",J)):M<0?new ze.ERR_BUFFER_OUT_OF_BOUNDS:new ze.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${M}`,J)}const Ze=/[^+/0-9A-Za-z-_]/g;function He(J){if(J=J.split("=")[0],J=J.trim().replace(Ze,""),J.length<2)return"";for(;J.length%4!==0;)J=J+"=";return J}function ot(J,M){M=M||1/0;let F;const Y=J.length;let oe=null;const he=[];for(let me=0;me<Y;++me){if(F=J.charCodeAt(me),F>55295&&F<57344){if(!oe){if(F>56319){(M-=3)>-1&&he.push(239,191,189);continue}else if(me+1===Y){(M-=3)>-1&&he.push(239,191,189);continue}oe=F;continue}if(F<56320){(M-=3)>-1&&he.push(239,191,189),oe=F;continue}F=(oe-55296<<10|F-56320)+65536}else oe&&(M-=3)>-1&&he.push(239,191,189);if(oe=null,F<128){if((M-=1)<0)break;he.push(F)}else if(F<2048){if((M-=2)<0)break;he.push(F>>6|192,F&63|128)}else if(F<65536){if((M-=3)<0)break;he.push(F>>12|224,F>>6&63|128,F&63|128)}else if(F<1114112){if((M-=4)<0)break;he.push(F>>18|240,F>>12&63|128,F>>6&63|128,F&63|128)}else throw new Error("Invalid code point")}return he}function mt(J){const M=[];for(let F=0;F<J.length;++F)M.push(J.charCodeAt(F)&255);return M}function tn(J,M){let F,Y,oe;const he=[];for(let me=0;me<J.length&&!((M-=2)<0);++me)F=J.charCodeAt(me),Y=F>>8,oe=F%256,he.push(oe),he.push(Y);return he}function Pt(J){return D.toByteArray(He(J))}function At(J,M,F,Y){let oe;for(oe=0;oe<Y&&!(oe+F>=M.length||oe>=J.length);++oe)M[oe+F]=J[oe];return oe}function Qe(J,M){return J instanceof M||J!=null&&J.constructor!=null&&J.constructor.name!=null&&J.constructor.name===M.name}function nn(J){return J!==J}const an=function(){const J="0123456789abcdef",M=new Array(256);for(let F=0;F<16;++F){const Y=F*16;for(let oe=0;oe<16;++oe)M[Y+oe]=J[F]+J[oe]}return M}();function vt(J){return typeof BigInt>"u"?sn:J}function sn(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var $=toolsEbml&&toolsEbml.__assign||function(){return $=Object.assign||function(k){for(var S,i=1,c=arguments.length;i<c;i++){S=arguments[i];for(var b in S)Object.prototype.hasOwnProperty.call(S,b)&&(k[b]=S[b])}return k},$.apply(this,arguments)},D=toolsEbml&&toolsEbml.__spreadArray||function(k,S,i){if(i||arguments.length===2)for(var c=0,b=S.length,C;c<b;c++)(C||!(c in S))&&(C||(C=Array.prototype.slice.call(S,0,c)),C[c]=S[c]);return k.concat(C||Array.prototype.slice.call(S))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var O=requireTools(),A=function(){function k(){}return k.readVint=function(S,i){i===void 0&&(i=0);var c=8-Math.floor(Math.log2(S[i]));if(c>8){var b=k.readHexString(S,i,i+c);throw new Error("Unrepresentable length: ".concat(c," ").concat(b))}if(i+c>S.length)return null;for(var C=S[i]&(1<<8-c)-1,N=1;N<c;N+=1){if(N===7&&C>=Math.pow(2,8)&&S[i+7]>0)return{length:c,value:-1};C*=Math.pow(2,8),C+=S[i+N]}return{length:c,value:C}},k.writeVint=function(S){if(S<0||S>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(S));var i=1;for(i=1;i<=8&&!(S<Math.pow(2,7*i)-1);i+=1);for(var c=O.Buffer.alloc(i),b=S,C=1;C<=i;C+=1){var N=b&255;c[i-C]=N,b-=N,b/=Math.pow(2,8)}return c[0]|=1<<8-i,c},k.concatenate=function(S,i){return!S&&!i?O.Buffer.from([]):!S||S.byteLength===0?i:!i||i.byteLength===0?S:O.Buffer.from(D(D([],S,!0),i,!0))},k.readHexString=function(S,i,c){return i===void 0&&(i=0),c===void 0&&(c=S.byteLength),Array.from(S.slice(i,c)).map(function(b){return Number(b).toString(16)}).reduce(function(b,C){return"".concat(b).concat(C.padStart(2,"0"))},"")},k.readUtf8=function(S){try{return O.Buffer.from(S).toString("utf8")}catch{return null}},k.readUnsigned=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return S.byteLength<=6?S.reduce(function(c,b){return c*256+b},0):k.readHexString(S,0,S.byteLength)},k.readSigned=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},k.readFloat=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},k.readDate=function(S){var i=new DataView(S.buffer,S.byteOffset,S.byteLength);switch(S.byteLength){case 1:return new Date(i.getUint8(0));case 2:return new Date(i.getUint16(0));case 4:return new Date(i.getUint32(0));case 8:return new Date(Number.parseInt(k.readHexString(S),16));default:return new Date(0)}},k.readDataFromTag=function(S,i){var c=S.type,b=S.name,C=S.track,N=S.discardable||!1,j=S.keyframe||!1,Z=null,z;switch(c){case"u":z=k.readUnsigned(i);break;case"f":z=k.readFloat(i);break;case"i":z=k.readSigned(i);break;case"s":z=String.fromCharCode.apply(String,i);break;case"8":z=k.readUtf8(i);break;case"d":z=k.readDate(i);break}if(b==="SimpleBlock"||b==="Block"){var K=0,te=k.readVint(i,K),ie=te.length,ee=te.value;K+=ie,C=ee,z=k.readSigned(i.subarray(K,K+2)),K+=2,b==="SimpleBlock"&&(j=!!(i[ie+2]&128),N=!!(i[ie+2]&1)),K+=1,Z=i.subarray(K)}return $($({},S),{data:i,discardable:N,keyframe:j,payload:Z,track:C,value:z})},k}();return toolsEbml.default=A,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function($,D,O){D=D||0;for(var A=1;A<=8&&!($[D]>=Math.pow(2,8-A));A++);if(A>8)throw new Error("Unrepresentable length: "+A+" "+$.toString("hex",D,D+A));if(D+A>$.length)return null;var k,S=$[D]&(1<<8-A)-1;for(k=1;k<A;k++){if(k===7&&S>=Math.pow(2,45)&&$[D+7]>0)return{length:A,value:-1};S*=Math.pow(2,8),S+=$[D+k]}return O&&(S-=Math.pow(2,A*7-1)-1),{length:A,value:S}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var $=requireVint();function D(O){this.buffer=O,this.offset=0}return D.prototype.nextInt16BE=function(){var O=this.buffer.readInt16BE(this.offset);return this.offset+=2,O},D.prototype.nextUInt8=function(){var O=this.buffer.readUInt8(this.offset);return this.offset+=1,O},D.prototype.nextUIntV=function(){var O=$(this.buffer,this.offset);return this.offset+=O.length,O.value},D.prototype.nextIntV=function(){var O=$(this.buffer,this.offset,!0);return this.offset+=O.length,O.value},D.prototype.nextBuffer=function(O){var A=O?this.buffer.slice(this.offset,this.offset+O):this.buffer.slice(this.offset);return this.offset+=O||this.length,A},Object.defineProperty(D.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=D,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var $=requireBufferReader(),D=1,O=3,A=2;ebmlBlock=function(S){var i={},c=new $(S);i.trackNumber=c.nextUIntV(),i.timecode=c.nextInt16BE();var b=c.nextUInt8();i.invisible=!!(b&8),i.keyframe=!!(b&128),i.discardable=!!(b&1);var C=(b&6)>>1;return i.frames=k(c,C),i};function k(S,i){if(!i)return[S.nextBuffer()];var c,b,C=[],N=S.nextUInt8()+1;if(i===A){if(S.length%N!==0)throw new Error("Fixed-Size Lacing Error");for(b=S.length/N,c=0;c<N;c++)C.push(S.nextBuffer(b));return C}var j=[];if(i===D)for(c=0;c<N-1;c++){var Z;b=0;do Z=S.nextUInt8(),b+=Z;while(Z===255);j.push(b)}else if(i===O)for(b=S.nextUIntV(),j.push(b),c=1;c<N-1;c++)b+=S.nextIntV(),j.push(b);for(c=0;c<N-1;c++)C.push(S.nextBuffer(j[c]));return C.push(S.nextBuffer()),C}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function($){Object.defineProperty($,"__esModule",{value:!0}),$.convertEBMLDateToJSDate=$.createFloatBuffer=$.createIntBuffer=$.createUIntBuffer=$.encodeValueToBuffer=$.concat=$.putRefinedMetaData=$.extractElement=$.removeElement=$.makeMetadataSeekable=$.createRIFFChunk=$.VP8BitStreamToRiffWebPBuffer=$.WebPBlockFilter=$.encodeTag=$.readBlock=$.ebmlBlock=$.writeVint=$.readVint=$.Buffer=void 0;var D=requireInt64Buffer(),O=requireEBMLEncoder(),A=requireBuffer(),k=requireToolsEbml(),S=requireEbmlBlock();$.Buffer=A.Buffer,$.readVint=k.default.readVint,$.writeVint=k.default.writeVint,$.ebmlBlock=S;function i(re){return(0,$.ebmlBlock)(new $.Buffer(re))}$.readBlock=i;function c(re,le,ye){return ye===void 0&&(ye=!1),X([re,ye?new $.Buffer("01ffffffffffffff","hex"):(0,$.writeVint)(le.length),le])}$.encodeTag=c;function b(re){return re.reduce(function(le,ye){if(ye.type!=="b"||ye.name!=="SimpleBlock")return le;var ve=(0,$.ebmlBlock)(ye.data),we=ve.frames.some(function(xe){var De=xe.slice(3,6).toString("hex");return De==="9d012a"});return we?le.concat(ye):le},[])}$.WebPBlockFilter=b;function C(re){var le=N("VP8 ",re),ye=X([new $.Buffer("WEBP","ascii"),le]);return N("RIFF",ye)}$.VP8BitStreamToRiffWebPBuffer=C;function N(re,le){var ye=new $.Buffer(4);return ye.writeUInt32LE(le.byteLength,0),X([new $.Buffer(re.substr(0,4),"ascii"),ye,le,new $.Buffer(le.byteLength%2===0?0:1)])}$.createRIFFChunk=N;function j(re,le,ye){var ve=z("EBML",re),we=te(ve),xe=we+12,De=re[re.length-1].dataEnd-xe,Me=z("Info",re);Z("Duration",Me),Me.splice(1,0,{name:"Duration",type:"f",data:ue(le,8)});for(var Le=te(Me),Ge=z("Tracks",re),ft=te(Ge),Ee=47,$e=[],nt=5+ye.length*15,Ue=[],We=-1,rt=10,Ke=function(Ie){var Ce=Ee,Fe=Ce+Le,Ze=Fe+ft,He=Ze+nt,ot=He-De;if($e=[],$e.push({name:"SeekHead",type:"m",isEnd:!1}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new $.Buffer([21,73,169,102])}),$e.push({name:"SeekPosition",type:"u",data:fe(Ce)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new $.Buffer([22,84,174,107])}),$e.push({name:"SeekPosition",type:"u",data:fe(Fe)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"Seek",type:"m",isEnd:!1}),$e.push({name:"SeekID",type:"b",data:new $.Buffer([28,83,187,107])}),$e.push({name:"SeekPosition",type:"u",data:fe(Ze)}),$e.push({name:"Seek",type:"m",isEnd:!0}),$e.push({name:"SeekHead",type:"m",isEnd:!0}),Ee=te($e),Ue=[],Ue.push({name:"Cues",type:"m",isEnd:!1}),ye.forEach(function(mt){var tn=mt.CueTrack,Pt=mt.CueClusterPosition,At=mt.CueTime;Ue.push({name:"CuePoint",type:"m",isEnd:!1}),Ue.push({name:"CueTime",type:"u",data:fe(At)}),Ue.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Ue.push({name:"CueTrack",type:"u",data:fe(tn)}),Pt-=xe,Pt+=ot,Ue.push({name:"CueClusterPosition",type:"u",data:fe(Pt)}),Ue.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Ue.push({name:"CuePoint",type:"m",isEnd:!0})}),Ue.push({name:"Cues",type:"m",isEnd:!0}),nt=te(Ue),We!==ot){if(We=ot,Ie===rt-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},ze=0;ze<rt;ze++){var _e=Ke(ze);if(_e==="break")break}var be=[].concat.apply([],[ve,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},$e,Me,Ge,Ue]),Se=new O.default().encode(be);return Se}$.makeMetadataSeekable=j;function Z(re,le){for(var ye=-1,ve=0;ve<le.length;ve++){var we=le[ve];if(we.name===re)if(we.type==="m")if(!we.isEnd)ye=ve;else{if(ye==-1)throw new Error("Detected ".concat(re," closing element before finding the start"));le.splice(ye,ve-ye+1);return}else{le.splice(ve,1);return}}}$.removeElement=Z;function z(re,le){for(var ye=[],ve=-1,we=0;we<le.length;we++){var xe=le[we];if(xe.name===re)if(xe.type==="m")if(!xe.isEnd)ve=we;else{if(ve==-1)throw new Error("Detected ".concat(re," closing element before finding the start"));ye=le.slice(ve,we+1);break}else{ye.push(le[we]);break}}return ye}$.extractElement=z;function K(re,le){Array.isArray(le.cueInfos)&&!Array.isArray(le.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),le.cues=le.cueInfos);for(var ye=[],ve=[],we=0;we<re.length;we++){var xe=re[we];if(xe.type==="m"&&xe.name==="Segment"){if(ye=re.slice(0,we),ve=re.slice(we),xe.unknownSize){ve.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(ve[ve.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var De=ve[ve.length-1].dataEnd,Me=ye[ye.length-1].dataEnd,Le=new O.default().encode(ye).byteLength,Ge=Le-Me,ft=De-ve[0].tagStart;ve[0].tagStart-Me,ve[0].tagStart;var Ee=new $.Buffer([24,83,128,103]),$e=new $.Buffer("01ffffffffffffff","hex"),nt=Ee.byteLength+$e.byteLength,Ue=ft,We;for(We=1;We<20;We++){var rt=Me+nt+Ue,Ke=rt-De,ze=Ge+Ke,_e=ie(ve,ze,le),be=new O.default().encode(_e).byteLength;if(be===Ue)return new O.default().encode([].concat(ye,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],_e));Ue=be}throw new Error("unable to refine metadata, stable size could not be found in "+We+" iterations!")}$.putRefinedMetaData=K;function te(re){var le=new O.default;return re.reduce(function(ye,ve){return ye.concat(le.encode([ve]))},[]).reduce(function(ye,ve){return ye+ve.byteLength},0)}function ie(re,le,ye){var ve=ye.duration,we=ye.clusterPtrs,xe=ye.cues,De=re.slice(0);if(typeof ve=="number"){var Me=!1;De.forEach(function(Ge){Ge.type==="f"&&Ge.name==="Duration"&&(Me=!0,Ge.data=ue(ve,8))}),Me||de(De,"Info",[{name:"Duration",type:"f",data:ue(ve,8)}])}Array.isArray(xe)&&de(De,"Cues",ae(xe,le));var Le=[];return Array.isArray(we)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Le=ee(we,le)),de(De,"SeekHead",Le,!0),De}function ee(re,le){var ye=[];return re.forEach(function(ve){ye.push({name:"Seek",type:"m",isEnd:!1}),ye.push({name:"SeekID",type:"b",data:new $.Buffer([31,67,182,117])}),ye.push({name:"SeekPosition",type:"u",data:fe(ve+le)}),ye.push({name:"Seek",type:"m",isEnd:!0})}),ye}function ae(re,le){var ye=[];return re.forEach(function(ve){var we=ve.CueTrack,xe=ve.CueClusterPosition,De=ve.CueTime;ye.push({name:"CuePoint",type:"m",isEnd:!1}),ye.push({name:"CueTime",type:"u",data:fe(De)}),ye.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ye.push({name:"CueTrack",type:"u",data:fe(we)}),ye.push({name:"CueClusterPosition",type:"u",data:fe(xe+le)}),ye.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ye.push({name:"CuePoint",type:"m",isEnd:!0})}),ye}function de(re,le,ye,ve){ve===void 0&&(ve=!1);for(var we=-1,xe=0;xe<re.length;xe++){var De=re[xe];if(De.type==="m"&&De.name===le&&De.isEnd===!1){we=xe;break}}we>=0?Array.prototype.splice.apply(re,[we+1,0].concat(ye)):ve?[].concat([{name:le,type:"m",isEnd:!1}],ye,[{name:le,type:"m",isEnd:!0}]).reverse().forEach(function(Me){re.unshift(Me)}):(re.push({name:le,type:"m",isEnd:!1}),ye.forEach(function(Me){re.push(Me)}),re.push({name:le,type:"m",isEnd:!0}))}function X(re){return $.Buffer.concat(re)}$.concat=X;function ne(re){var le=new $.Buffer(0);if(re.type==="m")return re;switch(re.type){case"u":le=fe(re.value);break;case"i":le=se(re.value);break;case"f":le=ue(re.value);break;case"s":le=new $.Buffer(re.value,"ascii");break;case"8":le=new $.Buffer(re.value,"utf8");break;case"b":le=re.value;break;case"d":le=new D.Int64BE(re.value.getTime().toString()).toBuffer();break}return Object.assign({},re,{data:le})}$.encodeValueToBuffer=ne;function fe(re){for(var le=1;re>=Math.pow(2,8*le);le++);if(le>=7)return console.warn("7bit or more bigger uint not supported."),new D.Uint64BE(re).toBuffer();var ye=new $.Buffer(le);return ye.writeUIntBE(re,0,le),ye}$.createUIntBuffer=fe;function se(re){for(var le=1;re>=Math.pow(2,8*le);le++);if(le>=7)return console.warn("7bit or more bigger uint not supported."),new D.Int64BE(re).toBuffer();var ye=new $.Buffer(le);return ye.writeIntBE(re,0,le),ye}$.createIntBuffer=se;function ue(re,le){if(le===void 0&&(le=8),le===8){var ye=new $.Buffer(8);return ye.writeDoubleBE(re,0),ye}else if(le===4){var ye=new $.Buffer(4);return ye.writeFloatBE(re,0),ye}else throw new Error("float type bits must 4bytes or 8bytes")}$.createFloatBuffer=ue;function pe(re){return re instanceof Date?re:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(re)/1e3/1e3)}$.convertEBMLDateToJSDate=pe}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var $=requireInt64Buffer(),D=requireTools(),O=requireTools(),A=requireEbmlID(),k;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(k||(k={}));var S=function(){function i(){this._buffer=new D.Buffer(0),this._tag_stack=[],this._state=k.STATE_TAG,this._cursor=0,this._total=0,this._schema=A.byEbmlID,this._result=[]}return i.prototype.decode=function(c){this.readChunk(c);var b=this._result;return this._result=[],b},i.prototype.readChunk=function(c){for(this._buffer=O.concat([this._buffer,new D.Buffer(c)]);this._cursor<this._buffer.length&&!(this._state===k.STATE_TAG&&!this.readTag()||this._state===k.STATE_SIZE&&!this.readSize()||this._state===k.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(c){return this._schema[c]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,D.readVint)(this._buffer,this._cursor);if(c==null)return!1;var b=this._buffer.slice(this._cursor,this._cursor+c.length),C=b.reduce(function(Z,z,K,te){return Z+z*Math.pow(16,2*(te.length-1-K))},0),N=this.getSchemaInfo(C),j={EBML_ID:C.toString(16),schema:N,type:N.type,name:N.name,level:N.level,tagStart:this._total,tagEnd:this._total+c.length,sizeStart:this._total+c.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(j),this._cursor+=c.length,this._total+=c.length,this._state=k.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var c=(0,D.readVint)(this._buffer,this._cursor);if(c==null)return!1;var b=this._tag_stack[this._tag_stack.length-1];return b.sizeEnd=b.sizeStart+c.length,b.dataStart=b.sizeEnd,b.dataSize=c.value,c.value===-1?(b.dataEnd=-1,b.type==="m"&&(b.unknownSize=!0)):b.dataEnd=b.sizeEnd+c.value,this._cursor+=c.length,this._total+=c.length,this._state=k.STATE_CONTENT,!0},i.prototype.readContent=function(){var c=this._tag_stack[this._tag_stack.length-1];if(c.type==="m"){if(c.isEnd=!1,this._result.push(c),this._state=k.STATE_TAG,c.dataSize===0){var b=Object.assign({},c,{isEnd:!0});this._result.push(b),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+c.dataSize)return!1;var C=this._buffer.slice(this._cursor,this._cursor+c.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+c.dataSize),c.data=C,c.type){case"u":c.value=C.readUIntBE(0,C.length);break;case"i":c.value=C.readIntBE(0,C.length);break;case"f":c.value=c.dataSize===4?C.readFloatBE(0):c.dataSize===8?C.readDoubleBE(0):(console.warn("cannot read ".concat(c.dataSize," octets float. failback to 0")),0);break;case"s":c.value=C.toString("ascii");break;case"8":c.value=C.toString("utf8");break;case"b":c.value=C;break;case"d":c.value=(0,D.convertEBMLDateToJSDate)(new $.Int64BE(C).toNumber());break}if(c.value===null)throw new Error("unknown tag type:"+c.type);for(this._result.push(c),this._total+=c.dataSize,this._state=k.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var N=this._tag_stack[this._tag_stack.length-1];if(N.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<N.dataEnd)break;if(N.type!=="m")throw new Error("parent element is not master element");var b=Object.assign({},N,{isEnd:!0});this._result.push(b),this._tag_stack.pop()}return!0},i}();return EBMLDecoder.default=S,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var $=typeof Reflect=="object"?Reflect:null,D=$&&typeof $.apply=="function"?$.apply:function(ne,fe,se){return Function.prototype.apply.call(ne,fe,se)},O;$&&typeof $.ownKeys=="function"?O=$.ownKeys:Object.getOwnPropertySymbols?O=function(ne){return Object.getOwnPropertyNames(ne).concat(Object.getOwnPropertySymbols(ne))}:O=function(ne){return Object.getOwnPropertyNames(ne)};function A(X){console&&console.warn&&console.warn(X)}var k=Number.isNaN||function(ne){return ne!==ne};function S(){S.init.call(this)}events.exports=S,events.exports.once=ee,S.EventEmitter=S,S.prototype._events=void 0,S.prototype._eventsCount=0,S.prototype._maxListeners=void 0;var i=10;function c(X){if(typeof X!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof X)}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(X){if(typeof X!="number"||X<0||k(X))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+X+".");i=X}}),S.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},S.prototype.setMaxListeners=function(ne){if(typeof ne!="number"||ne<0||k(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 b(X){return X._maxListeners===void 0?S.defaultMaxListeners:X._maxListeners}S.prototype.getMaxListeners=function(){return b(this)},S.prototype.emit=function(ne){for(var fe=[],se=1;se<arguments.length;se++)fe.push(arguments[se]);var ue=ne==="error",pe=this._events;if(pe!==void 0)ue=ue&&pe.error===void 0;else if(!ue)return!1;if(ue){var re;if(fe.length>0&&(re=fe[0]),re instanceof Error)throw re;var le=new Error("Unhandled error."+(re?" ("+re.message+")":""));throw le.context=re,le}var ye=pe[ne];if(ye===void 0)return!1;if(typeof ye=="function")D(ye,this,fe);else for(var ve=ye.length,we=K(ye,ve),se=0;se<ve;++se)D(we[se],this,fe);return!0};function C(X,ne,fe,se){var ue,pe,re;if(c(fe),pe=X._events,pe===void 0?(pe=X._events=Object.create(null),X._eventsCount=0):(pe.newListener!==void 0&&(X.emit("newListener",ne,fe.listener?fe.listener:fe),pe=X._events),re=pe[ne]),re===void 0)re=pe[ne]=fe,++X._eventsCount;else if(typeof re=="function"?re=pe[ne]=se?[fe,re]:[re,fe]:se?re.unshift(fe):re.push(fe),ue=b(X),ue>0&&re.length>ue&&!re.warned){re.warned=!0;var le=new Error("Possible EventEmitter memory leak detected. "+re.length+" "+String(ne)+" listeners added. Use emitter.setMaxListeners() to increase limit");le.name="MaxListenersExceededWarning",le.emitter=X,le.type=ne,le.count=re.length,A(le)}return X}S.prototype.addListener=function(ne,fe){return C(this,ne,fe,!1)},S.prototype.on=S.prototype.addListener,S.prototype.prependListener=function(ne,fe){return C(this,ne,fe,!0)};function N(){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 j(X,ne,fe){var se={fired:!1,wrapFn:void 0,target:X,type:ne,listener:fe},ue=N.bind(se);return ue.listener=fe,se.wrapFn=ue,ue}S.prototype.once=function(ne,fe){return c(fe),this.on(ne,j(this,ne,fe)),this},S.prototype.prependOnceListener=function(ne,fe){return c(fe),this.prependListener(ne,j(this,ne,fe)),this},S.prototype.removeListener=function(ne,fe){var se,ue,pe,re,le;if(c(fe),ue=this._events,ue===void 0)return this;if(se=ue[ne],se===void 0)return this;if(se===fe||se.listener===fe)--this._eventsCount===0?this._events=Object.create(null):(delete ue[ne],ue.removeListener&&this.emit("removeListener",ne,se.listener||fe));else if(typeof se!="function"){for(pe=-1,re=se.length-1;re>=0;re--)if(se[re]===fe||se[re].listener===fe){le=se[re].listener,pe=re;break}if(pe<0)return this;pe===0?se.shift():te(se,pe),se.length===1&&(ue[ne]=se[0]),ue.removeListener!==void 0&&this.emit("removeListener",ne,le||fe)}return this},S.prototype.off=S.prototype.removeListener,S.prototype.removeAllListeners=function(ne){var fe,se,ue;if(se=this._events,se===void 0)return this;if(se.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):se[ne]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete se[ne]),this;if(arguments.length===0){var pe=Object.keys(se),re;for(ue=0;ue<pe.length;++ue)re=pe[ue],re!=="removeListener"&&this.removeAllListeners(re);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(fe=se[ne],typeof fe=="function")this.removeListener(ne,fe);else if(fe!==void 0)for(ue=fe.length-1;ue>=0;ue--)this.removeListener(ne,fe[ue]);return this};function Z(X,ne,fe){var se=X._events;if(se===void 0)return[];var ue=se[ne];return ue===void 0?[]:typeof ue=="function"?fe?[ue.listener||ue]:[ue]:fe?ie(ue):K(ue,ue.length)}S.prototype.listeners=function(ne){return Z(this,ne,!0)},S.prototype.rawListeners=function(ne){return Z(this,ne,!1)},S.listenerCount=function(X,ne){return typeof X.listenerCount=="function"?X.listenerCount(ne):z.call(X,ne)},S.prototype.listenerCount=z;function z(X){var ne=this._events;if(ne!==void 0){var fe=ne[X];if(typeof fe=="function")return 1;if(fe!==void 0)return fe.length}return 0}S.prototype.eventNames=function(){return this._eventsCount>0?O(this._events):[]};function K(X,ne){for(var fe=new Array(ne),se=0;se<ne;++se)fe[se]=X[se];return fe}function te(X,ne){for(;ne+1<X.length;ne++)X[ne]=X[ne+1];X.pop()}function ie(X){for(var ne=new Array(X.length),fe=0;fe<ne.length;++fe)ne[fe]=X[fe].listener||X[fe];return ne}function ee(X,ne){return new Promise(function(fe,se){function ue(re){X.removeListener(ne,pe),se(re)}function pe(){typeof X.removeListener=="function"&&X.removeListener("error",ue),fe([].slice.call(arguments))}de(X,ne,pe,{once:!0}),ne!=="error"&&ae(X,ue,{once:!0})})}function ae(X,ne,fe){typeof X.on=="function"&&de(X,"error",ne,fe)}function de(X,ne,fe,se){if(typeof X.on=="function")se.once?X.once(ne,fe):X.on(ne,fe);else if(typeof X.addEventListener=="function")X.addEventListener(ne,function ue(pe){se.once&&X.removeEventListener(ne,ue),fe(pe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof X)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var $=EBMLReader&&EBMLReader.__extends||function(){var k=function(S,i){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,b){c.__proto__=b}||function(c,b){for(var C in b)Object.prototype.hasOwnProperty.call(b,C)&&(c[C]=b[C])},k(S,i)};return function(S,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");k(S,i);function c(){this.constructor=S}S.prototype=i===null?Object.create(i):(c.prototype=i.prototype,new c)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var D=requireEvents(),O=requireTools(),A=function(k){$(S,k);function S(){var i=k.call(this)||this;return i.logGroup="",i.hasLoggingStarted=!1,i.metadataloaded=!1,i.chunks=[],i.stack=[],i.segmentOffset=0,i.last2SimpleBlockVideoTrackTimecode=[0,0],i.last2SimpleBlockAudioTrackTimecode=[0,0],i.lastClusterTimecode=0,i.lastClusterPosition=0,i.timecodeScale=1e6,i.metadataSize=0,i.metadatas=[],i.cues=[],i.firstVideoBlockRead=!1,i.firstAudioBlockRead=!1,i.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},i.trackTypes=[],i.trackDefaultDuration=[],i.trackCodecDelay=[],i.trackInfo={type:"nothing"},i.ended=!1,i.logging=!1,i.use_duration_every_simpleblock=!1,i.use_webp=!1,i.use_segment_info=!0,i.drop_default_duration=!0,i}return S.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()},S.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var C=this.lastClusterTimecode,N=this.duration,j=this.timecodeScale;this.emit("cluster",{timecode:C,data:i}),this.emit("duration",{timecodeScale:j,duration:N})}else{this.metadataloaded=!0,this.metadatas=i;var c=this.trackTypes.indexOf(1),b=this.trackTypes.indexOf(2);if(this.trackInfo=c>=0&&b>=0?{type:"both",trackNumber:c}:c>=0?{type:"video",trackNumber:c}:b>=0?{type:"audio",trackNumber:b}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},S.prototype.read=function(i){var c=this,b=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var C=this.stack[this.stack.length-1];if(C!=null&&C.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),C.dataEnd=i.dataEnd,C.dataSize=i.dataEnd-C.dataStart,C.unknownSize=!1;var N=Object.assign({},C,{name:C.name,type:C.type,isEnd:!0});this.chunks.push(N)}this.stack.push(i)}if(i.type==="m"&&i.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=i.dataStart,this.emit("segment_offset",this.segmentOffset);else if(i.type==="b"&&i.name==="SimpleBlock"){var j=O.ebmlBlock(i.data),Z=j.timecode,z=j.trackNumber,K=j.frames;if(this.trackTypes[z]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var te=this.lastClusterTimecode+Z;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],Z]}else if(this.trackTypes[z]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var te=this.lastClusterTimecode+Z;this.cues.push({CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te}),this.emit("cue_info",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:z,CueClusterPosition:this.lastClusterPosition,CueTime:te})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],Z]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&K.forEach(function(ie){var ee=ie.slice(3,6).toString("hex");if(ee==="9d012a"){var ae=O.VP8BitStreamToRiffWebPBuffer(ie),de=new Blob([ae],{type:"image/webp"}),X=c.duration;c.emit("webp",{currentTime:X,webp:de})}})}else i.type==="m"&&i.name==="Cluster"&&i.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",i.tagStart),this.lastClusterPosition=i.tagStart):i.type==="u"&&i.name==="Timecode"?this.lastClusterTimecode=i.value:i.type==="u"&&i.name==="TimecodeScale"?this.timecodeScale=i.value:i.type==="m"&&i.name==="TrackEntry"?i.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}:i.type==="u"&&i.name==="TrackType"?this.currentTrack.TrackType=i.value:i.type==="u"&&i.name==="TrackNumber"?this.currentTrack.TrackNumber=i.value:i.type==="u"&&i.name==="CodecDelay"?this.currentTrack.CodecDelay=i.value:i.type==="u"&&i.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),b=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),b||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(S.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,c=0,b=0,C=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof C=="number")i=C;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof N=="number"&&(c=N),b=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof N=="number"&&(c=N),b=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackInfo.trackNumber];typeof N=="number"&&(c=N),b=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var N=this.trackCodecDelay[this.trackInfo.trackNumber];typeof N=="number"&&(c=N),b=this.last2SimpleBlockAudioTrackTimecode[1]}var j=(this.lastClusterTimecode+b)*this.timecodeScale+i-c,Z=j/this.timecodeScale;return Math.floor(Z)},enumerable:!1,configurable:!0}),S.prototype.addListener=function(i,c){return k.prototype.addListener.call(this,i,c)},S.prototype.put=function(i){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),i.type==="m"?i.isEnd?console.groupEnd():console.group(i.name+":"+i.tagStart):i.type==="b"?console.log(i.name,i.type):console.log(i.name,i.tagStart,i.type,i.value)},S}(D.EventEmitter);return EBMLReader.default=A,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function($){var D=ebml&&ebml.__createBinding||(Object.create?function(c,b,C,N){N===void 0&&(N=C),Object.defineProperty(c,N,{enumerable:!0,get:function(){return b[C]}})}:function(c,b,C,N){N===void 0&&(N=C),c[N]=b[C]}),O=ebml&&ebml.__exportStar||function(c,b){for(var C in c)C!=="default"&&!Object.prototype.hasOwnProperty.call(b,C)&&D(b,c,C)};Object.defineProperty($,"__esModule",{value:!0}),$.tools=$.Reader=$.Encoder=$.Decoder=void 0,O(requireEBML(),$);var A=requireEBMLDecoder();$.Decoder=A.default;var k=requireEBMLEncoder();$.Encoder=k.default;var S=requireEBMLReader();$.Reader=S.default;var i=requireTools();$.tools=i}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var $=lib&&lib.__awaiter||function(k,S,i,c){function b(C){return C instanceof i?C:new i(function(N){N(C)})}return new(i||(i=Promise))(function(C,N){function j(K){try{z(c.next(K))}catch(te){N(te)}}function Z(K){try{z(c.throw(K))}catch(te){N(te)}}function z(K){K.done?C(K.value):b(K.value).then(j,Z)}z((c=c.apply(k,S||[])).next())})},D=lib&&lib.__generator||function(k,S){var i={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},c,b,C,N;return N={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(N[Symbol.iterator]=function(){return this}),N;function j(z){return function(K){return Z([z,K])}}function Z(z){if(c)throw new TypeError("Generator is already executing.");for(;i;)try{if(c=1,b&&(C=z[0]&2?b.return:z[0]?b.throw||((C=b.return)&&C.call(b),0):b.next)&&!(C=C.call(b,z[1])).done)return C;switch(b=0,C&&(z=[z[0]&2,C.value]),z[0]){case 0:case 1:C=z;break;case 4:return i.label++,{value:z[1],done:!1};case 5:i.label++,b=z[1],z=[0];continue;case 7:z=i.ops.pop(),i.trys.pop();continue;default:if(C=i.trys,!(C=C.length>0&&C[C.length-1])&&(z[0]===6||z[0]===2)){i=0;continue}if(z[0]===3&&(!C||z[1]>C[0]&&z[1]<C[3])){i.label=z[1];break}if(z[0]===6&&i.label<C[1]){i.label=C[1],C=z;break}if(C&&i.label<C[2]){i.label=C[2],i.ops.push(z);break}C[2]&&i.ops.pop(),i.trys.pop();continue}z=S.call(k,i)}catch(K){z=[6,K],b=0}finally{c=C=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var O=requireEbml();function A(k){return $(this,void 0,void 0,function(){var S,i,c,b,C,N,j,Z,z,K,te,ie;return D(this,function(ee){switch(ee.label){case 0:if(!k)throw Error("call to fixWebmDuration requires a blob");S=new O.Decoder,i=new O.Reader,c=k.stream(),b=c.getReader(),ee.label=1;case 1:return[4,b.read()];case 2:return C=ee.sent(),N=C.done,j=C.value,N?(i.stop(),[3,3]):(Z=S.decode(j),Z=Z==null?void 0:Z.filter(function(ae){return ae.type!=="unknown"}),Z.forEach(function(ae){i.read(ae)}),j=null,[3,1]);case 3:return z=O.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),K=new Blob([z],{type:k.type}),te=k.slice(i.metadataSize),ie=new Blob([K,te],{type:k.type}),[2,ie]}})})}return lib.default=A,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){ke(this,Je);ke(this,kt,!1);ke(this,st,!1);ke(this,Dt,0);ke(this,Bt,0);ke(this,Ye,0);ke(this,et,0);ke(this,bt,0);Q(this,"onchange",D=>{});Q(this,"onDurationChange",D=>{});Q(this,"start",async(D="")=>{D||(D=`video_Record_${E(Date.now())}`);let O=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(A=>{const k=A.getTracks();for(const i of k)i.onended=()=>this.stop();Ae(this,kt,!0),Ae(this,st,!1),Ae(this,Je,new MediaRecorder(A)),ce(this,Je).start();const S=new Date().getTime();Ae(this,Dt,S),Ae(this,Ye,S),ce(this,_t).call(this),ce(this,qt).call(this),ce(this,Je).addEventListener("dataavailable",i=>{O.push(i.data)}),ce(this,Je).addEventListener("stop",async()=>{Ae(this,kt,!1);const i=new Date().getTime();Ae(this,Bt,i),Ae(this,et,ce(this,et)+(i-ce(this,Ye))),ce(this,_t).call(this),clearInterval(ce(this,bt));const c=A.getTracks();for(const Z of c)Z.stop();if(ce(this,Je)===null)return;const b=new Blob(O,{type:ce(this,Je).mimeType}),C=await fixWebmDuration(b),N=URL.createObjectURL(C),j=document.createElement("a");j.href=N,j.download=`${D}.mp4`,j.click(),URL.revokeObjectURL(N),O=[],Ae(this,Je,null)})})});Q(this,"pause",async()=>{var O;await new Promise(A=>setTimeout(()=>A(!0),300)),(O=ce(this,Je))==null||O.pause(),Ae(this,st,!0);const D=new Date().getTime();Ae(this,et,ce(this,et)+(D-ce(this,Ye))),ce(this,_t).call(this),clearInterval(ce(this,bt))});Q(this,"resume",async()=>{var O;(O=ce(this,Je))==null||O.resume(),Ae(this,st,!1);const D=new Date().getTime();Ae(this,Ye,D),ce(this,_t).call(this),ce(this,qt).call(this)});Q(this,"stop",async()=>{var D;(D=ce(this,Je))==null||D.stop()});Q(this,"getDuration",()=>{if(ce(this,Ye)===0)return 0;let D=ce(this,et);const O=new Date().getTime();if(ce(this,kt)&&ce(this,st)===!1){const A=O-ce(this,Ye);Ae(this,Ye,O),D=D+A}return D});Q(this,"getInfo",()=>({active:ce(this,kt),pause:ce(this,st),startTime:ce(this,Dt),endTime:ce(this,Bt),duration:ce(this,et)}));ke(this,_t,()=>{const D=this.getInfo();this.onchange(D)});ke(this,qt,()=>{clearInterval(ce(this,bt)),Ae(this,bt,window.setInterval(()=>{Ae(this,et,this.getDuration()),this.onDurationChange(ce(this,et))},500))})}}Je=new WeakMap,kt=new WeakMap,st=new WeakMap,Dt=new WeakMap,Bt=new WeakMap,Ye=new WeakMap,et=new WeakMap,bt=new WeakMap,_t=new WeakMap,qt=new WeakMap;var l=Object.defineProperty,y=$=>{throw TypeError($)},q=($,D,O)=>D in $?l($,D,{enumerable:!0,configurable:!0,writable:!0,value:O}):$[D]=O,s=($,D,O)=>q($,typeof D!="symbol"?D+"":D,O),P=($,D,O)=>D.has($)||y("Cannot "+O),n=($,D,O)=>(P($,D,"read from private field"),O?O.call($):D.get($)),a=($,D,O)=>D.has($)?y("Cannot add the same private member more than once"):D instanceof WeakSet?D.add($):D.set($,O),d,v,o;class p{constructor(D={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(O,A={})=>new Promise(async(k,S)=>{const i=A.timeout||this.options.timeout,c=A.key||n(this,d).call(this),b=A.describe||"";if(this.queue.findIndex(N=>N.key===c)!==-1)return S(`${c} is exist.`);const C={key:c,func:O,describe:b,timeout:i,resolve:k,reject:S};this.queue.unshift(C),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,O=>{const A=this.queue.findIndex(k=>k.key===O);this.queue.splice(A,1)}),a(this,o,async()=>{const O=this.queue.length;if(O===0)return;const A=O-1,k=this.queue[A];this.activePromise=k;const{key:S,func:i,resolve:c,reject:b,timeout:C}=this.activePromise;C&&(this.timer=window.setTimeout(()=>{b(`pr-async-queue: ${S} is timeout.`),n(this,o).call(this)},C)),await i().then(c).catch(b).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,S),n(this,o).call(this)})}),this.options={timeout:0,...D}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;const enum_iceState={connecting:"连接中",connected:"已连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_iceState);class PrResolves{constructor(){Q(this,"resolvesMap",new Map);Q(this,"index",0);Q(this,"add",(D,O=()=>!1)=>new Promise(A=>{var c;if(O())return A(!0);this.resolvesMap.has(D)||this.resolvesMap.set(D,new Map),this.index++;const i=`${this.index}`;(c=this.resolvesMap.get(D))==null||c.set(i,A)}));Q(this,"emit",async D=>{const O=this.resolvesMap.get(D);if(!O)return;const A=[...O.keys()];for(const k of A){const S=O.get(k);S&&(await S(),O.delete(k))}})}}class RoomBase{constructor(D){Q(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:wt(),callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0});Q(this,"prResolves",new PrResolves);Q(this,"sdk_service_version","1.0.8");Q(this,"sdk_session","");Q(this,"prohibitNotify",!1);Q(this,"isEarly",!1);Q(this,"isInRoom",!1);Q(this,"asyncQueue");Q(this,"roomState","ready");Q(this,"iceState","closed");Q(this,"createAt",Date.now());Q(this,"cwsIns");Q(this,"peerIns");Q(this,"transceiverMap",new Map);Q(this,"sendChannel");Q(this,"receiveChannel");Q(this,"userMap",new Map);Q(this,"p2pMap",new Map);Q(this,"setLocalStreamActiveMap",new Map);Q(this,"phoneyStreams",new Map);Q(this,"recorder",new StreamRecorder);Q(this,"networkQualityTester",new NetworkQualityTester);Q(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Q(this,"reportLogs",(D,O="未知错误")=>{const{appid:A,userId:k,earlyId:S="",logUrl:i,reportErr:c}=this.options;if(!c)return;const b="web",C=N=>({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})[N].toString();{const N=C(D),j={origin:b,type:N,app_id:A,user_id:k,ins_id:S,desc:O},Z=btoa(encodeURI(JSON.stringify(j))),z=`${i}/upload/log?log_key=${Z}`;{const K=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),ie=new TextEncoder().encode(K),ee=pako.deflate(ie,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:j,url:z,size:it(ee.byteLength)}),fetch(z,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:ee})}}});Q(this,"initPhoneyStreams",(D,O=[])=>{O.length===0&&(O=mediaType_keys);for(const A of O){const k=this.phoneyStreams.get(A);if(k){const S=k.getTracks();for(const i of S)i.stop()}switch(A){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(D));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(D));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});Q(this,"getPhoneyStreams",D=>this.phoneyStreams.get(D));Q(this,"getRoomInfo",()=>{const{options:D,roomState:O,createAt:A}=this;return{...D,roomState:O,createAt:A}});Q(this,"setRoomState",D=>{if(this.roomState===D)return;this.roomState=D;const O=enum_roomState[D],A={state:D,stateStr:O};this.cwsIns.emitNotify("onRoomState",{code:200,data:A,desc:"room state is change."})});Q(this,"setIceState",D=>{if(this.iceState===D)return;this.iceState=D;const O=enum_iceState[D],A={state:D,stateStr:O};this.cwsIns.emitNotify("onIceState",{code:200,data:A,desc:"ice state is change."})});Q(this,"setOptions",async D=>{const O={...this.options,...D};this.options=O});Q(this,"stopStream",async D=>{const O=D.getTracks();for(const A of O)A.stop()});Q(this,"getMediaDevicesErrInfo",async()=>{try{const D=await navigator.mediaDevices.enumerateDevices();D.find(A=>A.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),D.find(A=>A.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(D){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",D)}return this.mediaDevicesErrInfo});Q(this,"getUserMediaKey",(D,O)=>`${D}-${O}`);Q(this,"getCallAction",async D=>{let O="";const A=S=>D.findIndex(({type:c,enabled:b=!0})=>c===S&&b)===-1?"0":"1";return O=`${A(0)}${O}`,O=`${A(1)}${O}`,O=`${A(2)}${O}`,O=`${A(3)}${O}`,parseInt(O,2)});Q(this,"getCallActionMap",(D=0)=>{const A=Number(D).toString(2).padStart(4,"0").split(""),[k,S,i,c]=A;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(S),screenSharing_audio:!!Number(k)}});Q(this,"getBanBehaviorMap",(D=0)=>{const A=Number(D).toString(2).padStart(4,"0").split(""),[k,S,i,c]=A;return{microphoneCamera_audio:!!Number(c),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(S),screenSharing_audio:!!Number(k)}});Q(this,"getAverageVolume",(D,O)=>{D.getByteFrequencyData(O);let A=0;for(let S=0;S<O.length;S++)A+=O[S];return Math.ceil(A/O.length)});Q(this,"getTrackNamesFormTracks",(D,O=[],A="trackName")=>{const k=[];for(const S of D){const{type:i}=S;if(O.length===0||O.includes(i)){const c=S[A];c&&k.push(`${c}`)}}return k});Q(this,"usersFilter",D=>dt(D,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap","useP2P"]).sort((k,S)=>k.id.localeCompare(S.id,"en")));this.setOptions(D),this.cwsIns=new CallsWebSocket({...D}),this.asyncQueue=new p}}var m=Object.defineProperty,G=($,D,O)=>D in $?m($,D,{enumerable:!0,configurable:!0,writable:!0,value:O}):$[D]=O,e=($,D,O)=>G($,typeof D!="symbol"?D+"":D,O);let g$1=class{constructor(D,O){e(this,"inputStream",new MediaStream),e(this,"outputStream",new MediaStream),e(this,"inputGain",1),e(this,"enhanceGain",1),e(this,"bgsGain",1),e(this,"bgmGain",1),e(this,"outputGain",1),e(this,"mixAudioMap",new Map),e(this,"audioContext",new AudioContext),e(this,"sourceNode"),e(this,"inputGainNode"),e(this,"enhanceGainNode"),e(this,"bgsGainNode"),e(this,"bgmGainNode"),e(this,"analyserNode"),e(this,"analyserArrayData"),e(this,"outputGainNode"),e(this,"destinationNode"),e(this,"filterStream",A=>A),e(this,"stop",()=>{{const A=this.inputStream.getTracks();for(const k of A)k.stop(),this.inputStream.removeTrack(k)}}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(A=!0)=>{A?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",A=>{this.inputGain=A,this.inputGainNode.gain.setValueAtTime(A,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async A=>{this.enhanceGain=A+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",A=>{this.bgsGain=A,this.bgsGainNode.gain.setValueAtTime(A,this.audioContext.currentTime)}),e(this,"setBgmGain",A=>{this.bgmGain=A,this.bgmGainNode.gain.setValueAtTime(A,this.audioContext.currentTime)}),e(this,"setOutputGain",A=>{this.outputGain=A,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:A,analyserArrayData:k}=this;A.getByteFrequencyData(k);let S=0;for(let i=0;i<k.length;i++)S+=k[i];return Math.ceil(S/k.length)}),e(this,"mixAudio",(A,k="bgm")=>new Promise(async(S,i)=>{try{{const C=this.mixAudioMap.get(k);C&&C.stop()}const c=k==="bgs"?this.bgsGainNode:this.bgmGainNode,b=this.audioContext.createBufferSource();this.mixAudioMap.set(k,b),b.buffer=A,b.connect(c),b.onended=()=>{b.disconnect(c),this.mixAudioMap.delete(k),S(!0)},b.start(0)}catch(c){i(c)}})),e(this,"mixAudioStop",A=>{const k=this.mixAudioMap.get(A);k==null||k.stop()}),e(this,"changeMix",(A,k)=>{const S=A==="bgs"?this.bgsGainNode:this.bgmGainNode;k?S.connect(this.destinationNode):S.disconnect(this.destinationNode)}),O&&(this.audioContext=O),this.inputStream=D,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:A,inputGainNode:k,enhanceGainNode:S,bgsGainNode:i,bgmGainNode:c,analyserNode:b,outputGainNode:C,destinationNode:N}=this;A.connect(k),k.connect(S),S.connect(b),i.connect(b),c.connect(b),S.connect(N),i.connect(N),c.connect(N),b.connect(C),C.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}};class RoomMedias extends RoomBase{constructor(O){super(O);ke(this,Ot,[]);ke(this,Ve,new Map);ke(this,je,new Map);ke(this,Xe,new Map);ke(this,tt,new Map);ke(this,ct,new Map);Q(this,"localStreamsActionMap",new Map);ke(this,It,new Map);Q(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Q(this,"initMediaPhoneyStreams",(O=[])=>this.initPhoneyStreams(this.audioContext,O));Q(this,"initLocalStreamsFilter",()=>{for(const O of mediaType_keys){const A=async k=>k;ce(this,It).set(O,A)}});Q(this,"setLocalFilterStream",(O,A)=>{ce(this,It).set(O,A)});ke(this,jt,()=>{ce(this,je).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),ce(this,je).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),ce(this,je).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),ce(this,je).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});ke(this,zt,()=>{ce(this,Ve).set("audioinput","default"),ce(this,Ve).set("videoinput","default"),ce(this,Ve).set("audiooutput","default")});Q(this,"emitNotifyUpdateUsersStreams",async O=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:O,desc:"users streams is change."})});Q(this,"initUserMediaStreamContext",async(O,A,k,S)=>{const[i]=k.getTracks();if(!i){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:O,mediaType:A,stream:k});return}S&&this.removeUserMediaStreamContext(O,A);const c=this.getUserMediaKey(O,A),{kind:b}=i;switch(b){case"audio":{const C=new MediaStream;C.addTrack(i);const N=new g$1(C,this.audioContext);ce(this,Xe).set(c,N)}break;case"video":{const C=new VideoMediaContext(i);ce(this,tt).set(c,C)}break}});Q(this,"getUserMediaStreamContext",(O,A)=>{const k=this.getUserMediaKey(O,A);if(["microphoneCamera_audio","screenSharing_audio"].includes(A))return ce(this,Xe).get(k);if(["microphoneCamera_video","screenSharing_video"].includes(A))return ce(this,tt).get(k)});Q(this,"getUserAudioMediaStreamContext",(O,A)=>{const k=this.getUserMediaKey(O,A);return ce(this,Xe).get(k)});Q(this,"removeUserMediaStreamContext",(O,A)=>{const k=this.getUserMediaKey(O,A);if(["microphoneCamera_audio","screenSharing_audio"].includes(A)){const S=ce(this,Xe).get(k);return S==null||S.stop(),ce(this,Xe).delete(k)}if(["microphoneCamera_video","screenSharing_video"].includes(A)){const S=ce(this,tt).get(k);return S==null||S.stop(),ce(this,tt).get(k)}});Q(this,"getUserStream",(O,A)=>{const k=this.getUserMediaStreamContext(O,A);return(k==null?void 0:k.getStream())||new MediaStream});Q(this,"getUserStreams",(O,A=[])=>{A.length===0&&(A=mediaType_keys);const k={};for(const S of A){const i=this.getUserStream(O,S);k[S]=i}return k});Q(this,"removeUserStreams",async(O,A=[])=>{A.length===0&&(A=mediaType_keys);for(const k of A)this.removeUserMediaStreamContext(O,k)});Q(this,"clearUserStreams",()=>{{const O=ce(this,Xe).values();for(const A of O)A.stop();Ae(this,Xe,new Map)}{const O=ce(this,tt).values();for(const A of O)A.stop();Ae(this,tt,new Map)}});Q(this,"setMediaTrackConstraints",async(O,A)=>{ce(this,je).set(O,A);const k=await this.getLocalStream(O);if(!k)return;const S=k.getTracks();if(S.length!==0)for(const i of S){const c=i.getConstraints(),C={...ce(this,je).get(O),...c,...A};await i.applyConstraints(C)}});Q(this,"stopLocalStreams",async(O=[])=>{O.length===0&&(O=mediaType_keys);for(const A of O){const k=ce(this,ct).get(A);k&&await this.stopStream(k),ce(this,ct).delete(A)}});Q(this,"addLocalStream",(O,A)=>{const k=ce(this,ct).get(O);k&&this.stopStream(k),ce(this,ct).set(O,A)});Q(this,"initLocalStream",async O=>{switch(O){case"microphoneCamera_audio":{const A=ce(this,Ve).get("audioinput"),k=ce(this,je).get("microphoneCamera_audio"),S=await navigator.mediaDevices.getUserMedia({audio:{deviceId:A,...k},video:!1});this.addLocalStream("microphoneCamera_audio",S)}break;case"microphoneCamera_video":{const A=ce(this,Ve).get("videoinput"),k=ce(this,je).get("microphoneCamera_video"),S=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:A,...k}});this.addLocalStream("microphoneCamera_video",S)}break;case"microphoneCamera":{const A=ce(this,Ve).get("audioinput"),k=ce(this,Ve).get("videoinput"),S=ce(this,je).get("microphoneCamera_audio"),i=ce(this,je).get("microphoneCamera_video"),b=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:A,...S},video:{deviceId:k,...i}})).getTracks();for(const C of b){const{kind:N}=C;if(N==="audio"){const j=new MediaStream;j.addTrack(C),this.addLocalStream("microphoneCamera_audio",j)}if(N==="video"){const j=new MediaStream;j.addTrack(C),this.addLocalStream("microphoneCamera_video",j)}}}break;case"screenSharing_audio":{const A=ce(this,je).get("screenSharing_audio"),S=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...A})).getTracks();for(const i of S){const{kind:c}=i;if(c==="audio"){const b=new MediaStream;b.addTrack(i),this.addLocalStream("screenSharing_audio",b)}}}break;case"screenSharing_video":{const A=ce(this,je).get(O),S=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...A})).getTracks();for(const i of S){const{kind:c}=i;if(c==="video"){const b=new MediaStream;b.addTrack(i),this.addLocalStream("screenSharing_video",b)}}}break;case"screenSharing":{const A=ce(this,je).get("screenSharing_audio"),k=ce(this,je).get("screenSharing_video"),i=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...A,...k})).getTracks();for(const c of i){const{kind:b}=c;if(b==="audio"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_audio",C)}if(b==="video"){const C=new MediaStream;C.addTrack(c),this.addLocalStream("screenSharing_video",C)}}}break}});Q(this,"getLocalStream",async O=>{const A=ce(this,ct).get(O),k=ce(this,It).get(O);let S=A;return A&&k&&(S=await k(A)),S});Q(this,"getLocalStreams",async(O=[])=>{O.length===0&&(O=mediaType_keys);const A={};for(const k of O)A[k]=await this.getLocalStream(k);return A});ke(this,Tt,async()=>!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices?(console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 不支持 enumerateDevices"),[]):(await navigator.mediaDevices.enumerateDevices().then(O=>{const A=O.filter(k=>!["communications"].includes(k.deviceId));Ae(this,Ot,A.sort((k,S)=>k.label.localeCompare(S.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",O)}),ce(this,Ot)));ke(this,Ht,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await ce(this,Tt).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),ce(this,Tt).call(this)});Q(this,"getMediaDeviceKind",O=>ce(this,Ve).get(O));Q(this,"changeAudiooutput",async()=>{try{const O=ce(this,Ve).get("audiooutput");await this.audioContext.setSinkId(O)}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",O)}});Q(this,"setDeviceKind",(O,A)=>{ce(this,Ve).set(O,A)});Q(this,"setAudioOutputDevice",O=>this.setDeviceKind("audiooutput",O));Q(this,"getEnumerateDevices",async O=>(await ce(this,Tt).call(this),ce(this,Ot).filter(k=>k.kind===O)));Q(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Q(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Q(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));ce(this,Ht).call(this),ce(this,zt).call(this),ce(this,jt).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var A;((A=this.audioContext)==null?void 0:A.state)==="suspended"&&this.audioContext.resume()})}}Ot=new WeakMap,Ve=new WeakMap,je=new WeakMap,Xe=new WeakMap,tt=new WeakMap,ct=new WeakMap,It=new WeakMap,jt=new WeakMap,zt=new WeakMap,Tt=new WeakMap,Ht=new WeakMap;class P2P{constructor(D){Q(this,"prResolves",new PrResolves);Q(this,"phoneyStreams",new Map);Q(this,"recv_peer_ins");Q(this,"recv_icecandidates",[]);Q(this,"recv_candidate_collected",!1);Q(this,"recv_transceiverMap",new Map);Q(this,"recvPeerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Q(this,"send_peer_ins");Q(this,"send_icecandidates",[]);Q(this,"send_candidate_collected",!1);Q(this,"send_transceiverMap",new Map);Q(this,"sendPeerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Q(this,"tracks",[]);Q(this,"reports",[]);Q(this,"getPeerStatsTimer",0);Q(this,"getPhoneyStreams",D=>this.phoneyStreams.get(D));Q(this,"sendIceConnected",()=>{const D=()=>this.send_peer_ins.iceConnectionState==="connected";return this.prResolves.add("sendIceConnected",D)});Q(this,"recvIceConnected",()=>{const D=()=>this.recv_peer_ins.iceConnectionState==="connected";return this.prResolves.add("recvIceConnected",D)});Q(this,"sendCandidateCollected",()=>{const D=()=>this.send_candidate_collected;return this.prResolves.add("sendCandidateCollected",D)});Q(this,"recvCandidateCollected",()=>{const D=()=>this.recv_candidate_collected;return this.prResolves.add("recvCandidateCollected",D)});Q(this,"getSendIcecandidates",async()=>(await this.sendCandidateCollected(),this.send_icecandidates));Q(this,"getRecvIcecandidates",async()=>(await this.recvCandidateCollected(),this.recv_icecandidates));Q(this,"setOffered",()=>{const D=()=>{var O;return(O=this.send_peer_ins)==null?void 0:O.remoteDescription};return this.prResolves.add("setOffered",D)});Q(this,"initSenderPc",async()=>{await this.clearSenderPc(),this.send_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]});const D=A=>{A.candidate?this.send_icecandidates.push(A.candidate):(this.send_candidate_collected=!0,this.prResolves.emit("sendCandidateCollected"))};this.send_peer_ins.addEventListener("icecandidate",D);const O=A=>{const k=A.target.connectionState;switch(k){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: send_peer_ins: ${k}`),this.prResolves.emit("sendIceConnected");break;case"failed":case"closed":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: send_peer_ins: ${k}`),this.send_peer_ins.removeEventListener("icecandidate",D),this.send_peer_ins.removeEventListener("connectionstatechange",O);break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: send_peer_ins: ${k}`);break}};ce(this,Vt).call(this),this.send_peer_ins.addEventListener("connectionstatechange",O)});Q(this,"clearSenderPc",async()=>{this.send_icecandidates=[],this.send_candidate_collected=!1,this.send_transceiverMap=new Map,this.send_peer_ins&&this.send_peer_ins.close(),clearInterval(this.getPeerStatsTimer)});Q(this,"initRecvPc",async()=>{await this.clearRecvPc(),this.recv_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]});const D=A=>{A.candidate?this.recv_icecandidates.push(A.candidate):(this.recv_candidate_collected=!0,this.prResolves.emit("recvCandidateCollected"))};this.recv_peer_ins.addEventListener("icecandidate",D);const O=A=>{const k=A.target.connectionState;switch(k){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: recv_peer_ins: ${k}`),this.prResolves.emit("recvIceConnected");break;case"failed":case"closed":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: recv_peer_ins: ${k}`),this.recv_peer_ins.removeEventListener("icecandidate",D),this.recv_peer_ins.removeEventListener("connectionstatechange",O);break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: recv_peer_ins: ${k}`);break}};this.recv_peer_ins.addEventListener("connectionstatechange",O)});Q(this,"clearRecvPc",async()=>{this.recv_icecandidates=[],this.recv_candidate_collected=!1,this.recv_transceiverMap=new Map,this.recv_peer_ins&&this.recv_peer_ins.close()});Q(this,"initSenders",async(D=[])=>{const O=this.send_peer_ins.getTransceivers();for(const A of O){const{mid:k}=A,S=D.find(b=>b.mid===k);if(!S)continue;const{type:i}=S;if(i===void 0)continue;const c=mediaType_keys[i];A.direction="sendonly",this.send_transceiverMap.set(c,A)}});Q(this,"addSenders",async(D=[])=>{const O=[];for(const A of D){if(this.send_transceiverMap.get(A))continue;const S=this.getPhoneyStreams(A),[i]=S.getTracks(),c=this.send_peer_ins.addTransceiver(i,{direction:"sendonly"});this.send_transceiverMap.set(A,c),O.push(A)}return O});Q(this,"addRecvs",async(D=[])=>{const O=[];for(const A of D)if(!this.recv_transceiverMap.get(A))switch(A){case"microphoneCamera_audio":case"screenSharing_audio":{const S=this.recv_peer_ins.addTransceiver("audio",{direction:"recvonly"});this.recv_transceiverMap.set(A,S),O.push(A)}break;case"microphoneCamera_video":case"screenSharing_video":{const S=this.recv_peer_ins.addTransceiver("video",{direction:"recvonly"});this.recv_transceiverMap.set(A,S),O.push(A)}break}return O});Q(this,"getSenderTracks",async(D=[])=>{const O=[];for(const A of D){const k=this.send_transceiverMap.get(A);if(!k)continue;const{mid:S,sender:i}=k,{track:c}=i;if(!c)continue;const{id:b,enabled:C}=c,N=mediaType_keys.findIndex(z=>z===A),j=wt(),Z={type:N,enabled:C,trackName:`web-${N}-${b}`,location:"local",mid:S,key:j,origin:"p2p"};O.push(Z)}return O});Q(this,"getRecvTracks",async(D=[])=>{const O=[];for(const A of D){const k=this.recv_transceiverMap.get(A);if(!k)continue;const{mid:S,receiver:i}=k,{track:c}=i;if(!c)continue;const{id:b,enabled:C}=c,N=mediaType_keys.findIndex(z=>z===A),j=wt(),Z={type:N,enabled:C,trackName:`web-${N}-${b}`,location:"local",mid:S,key:j};O.push(Z)}return O});Q(this,"createOffer",()=>new Promise(async(D,O)=>{try{const A=await this.recv_peer_ins.createOffer();await this.recv_peer_ins.setLocalDescription(A),D(A)}catch(A){O(A)}}));Q(this,"setOffer",async D=>{await this.send_peer_ins.setRemoteDescription(D),await this.prResolves.emit("setOffered")});Q(this,"createAnswer",()=>new Promise(async D=>{const O=await this.send_peer_ins.createAnswer();await this.send_peer_ins.setLocalDescription(O),D(O)}));Q(this,"addCandidates",async D=>{await this.setOffered();for(const O of D)await this.send_peer_ins.addIceCandidate(O)});Q(this,"setAnswer",async(D,O)=>{await this.recv_peer_ins.setRemoteDescription(D);for(const A of O)await this.recv_peer_ins.addIceCandidate(A)});Q(this,"getTrack",D=>{var A;const O=this.recv_transceiverMap.get(D);return(A=O==null?void 0:O.receiver)==null?void 0:A.track});ke(this,Zt,async()=>{try{const D=await this.send_peer_ins.getStats(),O=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],k=[...D.values()].filter(de=>O.includes(de.type));let S=0,i=0,c=0,b=0,C=0,N=0,j=[],Z=[];for(const de of this.reports){const{packetsSent:X,packetsLost:ne}=de;X&&(c+=X),ne&&(b+=ne)}this.reports=k;for(const de of this.reports){const{bytesSent:X,bytesReceived:ne,packetsSent:fe,packetsLost:se,roundTripTime:ue,jitter:pe}=de;X&&(i=X),ne&&(S=ne),fe&&(C+=fe),se&&(N+=se),ue&&j.push((ue*100).toFixed(2)),pe&&Z.push(pe.toFixed(2))}Z.sort().reverse(),j.sort().reverse();const z=C-c,K=N-b,te=z===0?"0.00":(K/z).toFixed(2),[ie="0"]=j,[ee="0"]=Z,ae={outboundBytes:i,inboundBytes:S,lostRate:te,roundTripTime:ie,jitter:ee};this.recvPeerNetwork=ae}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",D)}});ke(this,Jt,async()=>{try{const D=await this.recv_peer_ins.getStats(),O=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],k=[...D.values()].filter(de=>O.includes(de.type));let S=0,i=0,c=0,b=0,C=0,N=0,j=[],Z=[];for(const de of this.reports){const{packetsSent:X,packetsLost:ne}=de;X&&(c+=X),ne&&(b+=ne)}this.reports=k;for(const de of this.reports){const{bytesSent:X,bytesReceived:ne,packetsSent:fe,packetsLost:se,roundTripTime:ue,jitter:pe}=de;X&&(i=X),ne&&(S=ne),fe&&(C+=fe),se&&(N+=se),ue&&j.push((ue*100).toFixed(2)),pe&&Z.push(pe.toFixed(2))}Z.sort().reverse(),j.sort().reverse();const z=C-c,K=N-b,te=z===0?"0.00":(K/z).toFixed(2),[ie="0"]=j,[ee="0"]=Z,ae={outboundBytes:i,inboundBytes:S,lostRate:te,roundTripTime:ie,jitter:ee};this.recvPeerNetwork=ae}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",D)}});ke(this,Vt,()=>{const D=async()=>{var O,A;((O=this.send_peer_ins)==null?void 0:O.connectionState)==="connected"&&ce(this,Zt).call(this),((A=this.recv_peer_ins)==null?void 0:A.connectionState)==="connected"&&ce(this,Jt).call(this)};clearInterval(this.getPeerStatsTimer),this.getPeerStatsTimer=window.setInterval(D,1*1e3)});Q(this,"getSendPeerNetwork",()=>this.sendPeerNetwork);Q(this,"getRecvPeerNetwork",()=>this.recvPeerNetwork);this.phoneyStreams=D}}Zt=new WeakMap,Jt=new WeakMap,Vt=new WeakMap;class RoomUsers extends RoomMedias{constructor(O){super(O);Q(this,"getP2PIns",async O=>this.p2pMap.get(O));Q(this,"getMaxVolumeUser",()=>{const O=Array.from(this.userMap.values(),({id:k})=>k);if(O.length===0)return;let A=[];for(const k of O){const S=this.getUserAudioMediaStreamContext(k,"microphoneCamera_audio");if(!S)continue;const i=S.getVolume();A.push({id:k,volume:i})}return A=A.sort((k,S)=>k.volume-S.volume>0?-1:1),A[0]});Q(this,"setVolume",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setInputGain(k)});Q(this,"setEnhanceGain",async(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setEnhanceGain(k)});Q(this,"setSpeaker",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setOutputGain(k);const i=k===0;S==null||S.setMute(i)});Q(this,"playBgs",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);return S==null?void 0:S.mixAudio(k,"bgs")});Q(this,"setBgsGain",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setBgsGain(k)});Q(this,"stopBgs",(O,A)=>{const k=this.getUserAudioMediaStreamContext(O,A);k==null||k.mixAudioStop("bgs")});Q(this,"playBgm",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);return S==null?void 0:S.mixAudio(k,"bgm")});Q(this,"setBgmGain",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.setBgmGain(k)});Q(this,"stopBgm",(O,A)=>{const k=this.getUserAudioMediaStreamContext(O,A);k==null||k.mixAudioStop("bgm")});Q(this,"changBgsMix",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.changeMix("bgs",k)});Q(this,"changBgmMix",(O,A,k)=>{const S=this.getUserAudioMediaStreamContext(O,A);S==null||S.changeMix("bgm",k)});Q(this,"getVolume",(O,A)=>{const k=this.getUserAudioMediaStreamContext(O,A);return k==null?void 0:k.getVolume()});Q(this,"clearUsers",()=>{this.userMap=new Map});Q(this,"removeUsers",async O=>{for(const A of O)this.userMap.delete(A),await this.removeUserStreams(A)});Q(this,"createUser",async O=>{const A=Date.now(),k={id:O,permissions:0,callAction:0,callActionStr:"",callActionMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},banBehavior:0,banBehaviorStr:"",banBehaviorMap:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1},callState:0,isOwner:this.userMap.size===0,isSelf:O===this.options.userId,isPublished:!1,useP2P:!1,joinTime:A,updateAt:A,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(O,k);{const S=new P2P(this.phoneyStreams);this.p2pMap.set(O,S)}});Q(this,"getUser",async O=>(this.userMap.has(O)||await this.createUser(O),this.userMap.get(O)));Q(this,"getUsers",async(O=[])=>{O.length===0&&(O=[...this.userMap.keys()]);const A=[];for(const k of O){const S=await this.getUser(k);A.push(S)}return A});Q(this,"getAllUserTrackMids",async()=>{const O=await this.getUsers(),A=[];for(const k of O){const{tracks:S=[]}=k;for(const i of S)A.push(i.mid)}return A});Q(this,"getUserTrackByTrackName",async O=>{const A=await this.getUsers(),k=[];for(const S of A){const{tracks:i=[]}=S;for(const c of i){const{trackName:b}=c;O.includes(b)&&k.push(c)}}return k});Q(this,"getUserTrackFromMid",async O=>{const A=await this.getUsers();let k;for(const S of A){const{tracks:i=[]}=S;for(const c of i)if(c.mid===O){k=c;break}}return k});Q(this,"checkUserInRoom",O=>this.userMap.has(O));Q(this,"getUsersId",async()=>[...this.userMap.keys()]);Q(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));Q(this,"updateIsPublished",async(O,A=!1)=>{const k=await this.getUser(O);k.isPublished=A});Q(this,"setUserUpdateStreams",async(O,A,k=!0)=>{const S=await this.getUser(O),i={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};i[A]=k,S.updateStreams=i});Q(this,"updateUserChannels",async(O,A=[],k)=>{const S=await this.getUser(O);k&&(A=[...S.channels,...A]),S.channels=A});Q(this,"updateUsertracks",async(O,A=[],k)=>{const S=await this.getUser(O);k&&(A=[...S.tracks,...A]),A=A.filter(({mid:b=""})=>b!==""),A=pt(A,["type"]),A=A.sort((b,C)=>b.type-C.type<0?-1:1);for(const b of A)b.userId=O,b.mediaType=mediaType_keys[b.type],b.enabled===void 0&&(b.enabled=!0),b.origin===void 0&&(b.origin="sfu");S.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const i=dt(S.tracks,["mediaType","enabled","mid","msid","trackName","key"]),c=dt(A,["mediaType","enabled","mid","msid","trackName","key"]);for(const b of mediaType_keys){const C=c.find(Z=>Z.mediaType===b),N=i.find(Z=>Z.mediaType===b),j=JSON.stringify(C)!==JSON.stringify(N);S.updateStreams[b]=j}S.tracks=A});Q(this,"updateUserCallAction",async(O,A=0)=>{const k=await this.getUser(O);k.callAction=A,k.callActionStr=A.toString(2).padStart(4,"0"),k.callActionMap=this.getCallActionMap(A)});Q(this,"updateUserBehaviors",async(O,A=0)=>{const k=await this.getUser(O);k.banBehavior=A,k.banBehaviorStr=A.toString(2).padStart(4,"0"),k.banBehaviorMap=this.getBanBehaviorMap(A)});Q(this,"updateUserNetwork",async(O,A={egress:5,ingress:5})=>{const k=await this.getUser(O);k.network=A});Q(this,"updateUserPermissions",async(O,A)=>{if(A){const k=await this.getUser(O);k.permissions=A}});Q(this,"updateUserUseP2P",async(O,A)=>{const k=await this.getUser(O);k.useP2P=A});Q(this,"updateUserBase",async O=>{const A=await this.getUser(O);A.isSelf=O===this.options.userId,A.updateAt=Date.now()});Q(this,"updateUsers",async O=>{for(const A of O){const{id:k,tracks:S,callAction:i,permissions:c,isPublished:b,useP2P:C}=A;await this.updateUserBase(k),await this.updateIsPublished(k,b),await this.updateUserPermissions(k,c),await this.updateUsertracks(k,S,!0),await this.updateUserCallAction(k,i),await this.updateUserNetwork(k),await this.updateUserUseP2P(k,C)}});Q(this,"emitNotifyUpdateUser",async O=>{const A=await this.getUsers([O]),[k]=this.usersFilter(A);this.cwsIns.emitNotify("onRoomUser",{code:200,data:k,desc:"user info is change."})});Q(this,"emitNotifyUpdateUsers",async()=>{const O=await this.getUsers(),A=this.usersFilter(O);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:A,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(O){super(O);Q(this,"getPeerStatsTimer",0);Q(this,"reports",[]);ke(this,lt,0);Q(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Q(this,"initPeer",()=>{var O;clearTimeout(ce(this,lt)),this.transceiverMap=new Map,(O=this.peerIns)==null||O.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),ce(this,Gt).call(this),ce(this,Kt).call(this),this.initMediaPhoneyStreams()});Q(this,"initSendChannel",(O="",A)=>{const k=this.peerIns.createDataChannel(O,{negotiated:!0,id:A});k.addEventListener("open",async S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onopen",S),setInterval(()=>{const i=new Date().getTime();k.send(`Hi you! on: ${E(i)}`)},1e3)}),k.addEventListener("close",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: close",S)}),k.addEventListener("message",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->sendChannel: onmessage",S)}),this.sendChannel=k,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initSendChannel",{label:O,id:A,channel:k})});Q(this,"initReceiveChannel",(O="",A)=>{const k=this.peerIns.createDataChannel(O,{negotiated:!0,id:A});k.addEventListener("open",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onopen",S)}),k.addEventListener("close",S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: close",S)}),k.addEventListener("message",async S=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->receiveChannel: onmessage",S)}),this.receiveChannel=k,this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initReceiveChannel",{label:O,id:A,channel:k}),this.receiveChannel.send("hello")});Q(this,"replaceSenderStream",async(O=[],A)=>{const{userId:k}=this.options;O.length===0&&(O=mediaType_keys);for(const S of O){const i=this.transceiverMap.get(S);let c;if(i){const{sender:b}=i;A?c=this.getUserStream(k,S):c=this.getPhoneyStreams(S);const[C]=c.getTracks();C&&await b.replaceTrack(C)}}});Q(this,"getSenderTracks",async(O=[])=>{const A=[];for(const k of O){const S=this.transceiverMap.get(k);if(!S)continue;const{mid:i,sender:c}=S,{track:b}=c;if(!b)continue;const{id:C,enabled:N}=b,j=mediaType_keys.findIndex(K=>K===k),Z=wt(),z={type:j,enabled:N,trackName:`web-${j}-${C}`,location:"local",mid:i,key:Z,origin:"sfu"};A.push(z)}return A});Q(this,"addSenders",async(O=[])=>{O.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const A=[];for(const k of O){if(this.transceiverMap.get(k))continue;const i=this.getPhoneyStreams(k),[c]=i.getTracks(),b=this.peerIns.addTransceiver(c,{direction:"sendonly"});this.transceiverMap.set(k,b),A.push(k)}if(O.length===0||A.length!==0){const k=await this.peerIns.createOffer();if(this.options.debug){const S=libExports$1.parse(k.sdp),i=dt(S.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:i,sdpJson:S,description:k})}await this.peerIns.setLocalDescription(k)}return A});Q(this,"removeSenders",async(O=[])=>{O.length===0&&(O=mediaType_keys);for(const A of O)this.transceiverMap.has(A)&&this.transceiverMap.delete(A)});Q(this,"stopSenders",(O=[])=>{var A;O.length===0&&(O=mediaType_keys);for(const k of O){if(!this.transceiverMap.has(k))continue;const S=this.transceiverMap.get(k);(A=S==null?void 0:S.sender.track)==null||A.stop(),S==null||S.stop()}});Q(this,"onSubscribeUserTracks",O=>{let A=0;return new Promise(async k=>{const S=[];for(const i of O){const{tracks:c=[]}=i;for(const b of c){const{trackName:C,mid:N}=b,[j]=await this.getUserTrackByTrackName([C]);S.push({...j,mid:N})}}{let i=[];const c=async()=>{clearTimeout(A);const C=new Map;for(const j of i){const{userId:Z,mediaType:z}=j;if(!Z||!z)continue;C.has(Z)||C.set(Z,{userId:Z,tracks:[],updateStreams:{}});const te=C.get(Z);te.tracks.push(j),te.updateStreams[z]=!0}const N=[...C.values()];for(const j of N){const{userId:Z,tracks:z}=j;await this.updateUsertracks(Z,z,!0)}await this.emitNotifyUpdateUsersStreams(N),this.peerIns.removeEventListener("track",b);{const j=Array.from(S,K=>K.trackName),Z=Array.from(i,K=>K.trackName),z=j.filter(K=>!Z.includes(K));k({target:j,success:Z,fail:z})}},b=async C=>{const{streams:N,transceiver:j}=C,[Z]=N,{mid:z,receiver:K}=j,{track:te}=K,{id:ie}=te,ee=S.find(X=>X.mid===`${z}`);if(!ee)return;const{userId:ae,mediaType:de}=ee;if(!(!ae||!de)){{const X={...ee,mid:z,msid:ie,key:wt()};i.push(X)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${i.length}/${S.length}`,{mediaType:de,mid:z,userTrack:ee,e:C});{const X=new Audio;if(X.srcObject=Z,await this.initUserMediaStreamContext(ae,de,Z,!0),de==="microphoneCamera_audio"||de==="screenSharing_audio"){const ne=this.getUserAudioMediaStreamContext(ae,de);ne==null||ne.setMute(!1)}}S.length===i.length&&c()}};this.peerIns.addEventListener("track",b),A=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${i.length}/${S.length})`),c()},5*1e3)}})});ke(this,Gt,()=>{const O=()=>{clearTimeout(ce(this,lt)),this.setIceState("failed")};this.peerIns.onconnectionstatechange=async A=>{const k=A.target.connectionState;switch(k){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${k}`),clearTimeout(ce(this,lt)),this.setIceState("connected"),this.prResolves.emit("iceConnected");break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${k}`),this.setIceState("disconnected"),Ae(this,lt,window.setTimeout(O,15*1e3));break;case"failed":{if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${k}`),this.iceState==="closed")return;this.setIceState("failed")}break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${k}`),clearTimeout(ce(this,lt)),this.setIceState("closed");break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${k}`);break}}});Q(this,"iceConnected",()=>{const O=()=>this.peerIns.connectionState==="connected";return this.prResolves.add("iceConnected",O)});Q(this,"closeUserTracks",async(O,A=[],k=!1)=>{const S=[];for(const C of A){const{trackName:N,msid:j}=C;S.push(N),j&&S.push(j)}const i=C=>S.includes(C),c=this.peerIns.getTransceivers();for(const C of c){const{mid:N,sender:j,receiver:Z}=C;j.track&&i(j.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${N} is stop.`,C)),Z.track&&i(Z.track.id)&&(C.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${N} is stop.`,C))}const b=await this.getUser(O);if(b){for(const C of b.tracks){const{trackName:N,msid:j,userId:Z,mediaType:z}=C;!Z||!z||!i(N)||(this.removeUserMediaStreamContext(Z,z),j&&delete C.msid)}if(k){const C=b.tracks.filter(({trackName:N})=>!i(N));await this.updateUsertracks(O,C,!1)}}});Q(this,"createOffer",async()=>{const O=await this.peerIns.createOffer();if(this.options.debug){const A=libExports$1.parse(O.sdp),k=dt(A.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:k,sdpJson:A,description:O})}await this.peerIns.setLocalDescription(O)});Q(this,"createAnswer",async()=>{const O=await this.peerIns.createAnswer();if(this.options.debug){const A=libExports$1.parse(O.sdp),k=dt(A.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:k,sdpJson:A,description:O})}await this.peerIns.setLocalDescription(O)});Q(this,"getSdp",()=>{var O;return(O=this.peerIns.localDescription)==null?void 0:O.sdp});Q(this,"setRemoteDescription",async O=>{if(this.options.debug){const A=libExports$1.parse(O.sdp),k=dt(A.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:k,sdpJson:A,description:O})}return await this.peerIns.setRemoteDescription(O),O});Q(this,"setCallStrategy",async(O,A=[])=>{A.length===0&&(A=mediaType_keys);let k="balanced";switch(O){case"qualityPriority":k="maintain-resolution";break;case"fluencyPriority":k="maintain-framerate";break;case"balancedDowngrade":k="balanced";break}const S=await this.getSelfInfo(),i=Array.from(S.tracks,({trackName:b})=>b),c=this.peerIns.getSenders();for(const b of c){const{track:C}=b;if(!C||!i.includes(C.id))continue;const N=b.getParameters();b.setParameters({...N,degradationPreference:k})}});Q(this,"setRTCRtpSenderParameters",O=>{try{const A=this.peerIns.getSenders();for(const k of A){const S=k.getParameters();k.setParameters({...S,...O})}}catch(A){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",A)}});Q(this,"getReportsByMid",async(O=[])=>O.length===0?this.reports:this.reports.filter(A=>O.includes(A.mid)));Q(this,"getRoomNetwork",()=>this.peerNetwork);Q(this,"getPeerNetwork",()=>this.peerNetwork);ke(this,Wt,async()=>{try{const O=await this.peerIns.getStats(),A=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],S=[...O.values()].filter(ne=>A.includes(ne.type));let i=0,c=0,b=0,C=0,N=0,j=0,Z=[],z=[];for(const ne of this.reports){const{packetsSent:fe,packetsLost:se}=ne;fe&&(b+=fe),se&&(C+=se)}this.reports=S;for(const ne of this.reports){const{bytesSent:fe,bytesReceived:se,packetsSent:ue,packetsLost:pe,roundTripTime:re,jitter:le}=ne;fe&&(c=fe),se&&(i=se),ue&&(N+=ue),pe&&(j+=pe),re&&Z.push((re*100).toFixed(2)),le&&z.push(le.toFixed(2))}z.sort().reverse(),Z.sort().reverse();const K=N-b,te=j-C,ie=K===0?"0.00":(te/K).toFixed(2),[ee="0"]=Z,[ae="0"]=z,de={outboundBytes:c,inboundBytes:i,lostRate:ie,roundTripTime:ee,jitter:ae};this.peerNetwork=de;const X=(ne,fe,se)=>{const ue=Number(ne),pe=Number(fe),re=Number(se);let le="0";return ue<.03&&pe<100&&re<.05?le="5":ue<.06&&pe<160&&re<.1?le="4":ue<.1&&pe<250&&re<.15?le="3":ue<.15&&pe<400&&re<.2?le="2":le="1",Number(le)};{const ne=X(ie,ee,ae),fe=await this.getSelfInfo(),{network:se}=fe,ue={egress:ne,ingress:ne};Ct("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,ue),JSON.stringify(se)!==JSON.stringify(ue)){this.emitNotifyUpdateUsers();const{userId:le,roomId:ye}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...ue,userId:le,roomId:ye}},!1)}},3*1e3)}}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",O)}});ke(this,Kt,()=>{const O=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||ce(this,Wt).call(this)};this.getPeerStatsTimer=window.setInterval(O,1*1e3)});Q(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer));this.initPeer()}}lt=new WeakMap,Gt=new WeakMap,Wt=new WeakMap,Kt=new WeakMap;const g=($,D)=>{if(!($!=null&&$.ip)||!($!=null&&$.port)||!($!=null&&$.serve_ip)||!($!=null&&$.serve_port)||!(D!=null&&D.ip)||!(D!=null&&D.port)||!(D!=null&&D.serve_ip)||!(D!=null&&D.serve_port))return"Unknown";const[O,A]=[$.ip,$.port],[k,S]=[$.serve_ip,$.serve_port],[i,c]=[D.ip,D.port],[b,C]=[D.serve_ip,D.serve_port];return O===i&&A===c?"Full Cone":O===k&&(i!==k||c!==A)||i===b&&(O!==b||A!==c)?"Restricted Cone":O===k&&A===S&&(i!==k||c!==S)||i===b&&c===C&&(O!==b||A!==C)?"Port Restricted Cone":"Symmetric"},h=async()=>{const $="stun.cloudflare.com:3478",D="stun.l.google.com:19302",O=async A=>new Promise(k=>{const S=new RTCPeerConnection({iceServers:[{urls:`stun:${A}`}]});S.createDataChannel("ice-channel");let i=null;S.onicecandidate=c=>{var b,C;if(((b=c.candidate)==null?void 0:b.type)==="srflx"){const[N,j]=A.split(":").map(Z=>Z.trim());i={ip:c.candidate.address||"",port:(C=c.candidate.port)==null?void 0:C.toString(),serve_ip:N,serve_port:j},S.close(),k(i)}},setTimeout(()=>{S.close(),k(null)},5e3),S.createOffer().then(c=>S.setLocalDescription(c)).catch(()=>k(null))});try{const A=await O($),k=await O(D);if(!A||!k)return{address:"",natType:"Unknown"};const S=g(A,k);return{address:A.ip||"",natType:S}}catch(A){return console.error("获取NAT类型失败:",A),{address:"",natType:"Unknown"}}};class RoomCalls extends RoomPeer{constructor(O){super(O);ke(this,$t,0);ke(this,gt,()=>{});Q(this,"setLocalStream",(O,A)=>new Promise(async(k,S)=>{try{const i=[];typeof O=="string"?i.push(O):i.push(...O);for(const b of i)this.localStreamsActionMap.set(b,A);if(A){if(O.includes("microphoneCamera_audio")&&O.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):O.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):O.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):O.includes("screenSharing_audio")&&O.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):O.includes("screenSharing_audio")&&!O.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):O.includes("screenSharing_video")&&!O.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),O.includes("screenSharing_audio")){const b=await this.getLocalStream("screenSharing_audio");if(b){const C=b.getTracks();for(const N of C)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(O.includes("screenSharing_video")){const b=await this.getLocalStream("screenSharing_video");if(b){const C=b.getTracks();for(const N of C)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(i);const c=await this.getLocalStreams(i);if(await this.cwsIns.emitNotify("onLocalStream",{code:200,data:c,desc:"local stream is change."}),this.isInRoom){const b=()=>new Promise(async C=>{const{userId:N}=this.options,j={};for(const Z of i){const z=await this.getLocalStream(Z);z&&(j[Z]=!0,await this.initUserMediaStreamContext(N,Z,z,!1))}await this.replaceSenderStream(i,A),await this.emitNotifyUpdateUsersStreams([{userId:N,updateStreams:j}]),C(!0)});this.asyncQueue.add(b,{describe:"setLocalStream"})}k(c)}catch(i){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",i),S(i)}}));Q(this,"setMediaDeviceKind",(O,A)=>{const k=()=>new Promise(async(S,i)=>{this.setDeviceKind(O,A);const c=await this.getSelfInfo(),{id:b,tracks:C=[],callActionMap:N}=c,j=[],Z=async z=>{const K=this.localStreamsActionMap.get(z),te=C.find(ee=>ee.mediaType===z),ie=N[z];if(K){j.push(z),await this.stopLocalStreams([z]);try{await this.initLocalStream(z)}catch(ee){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",ee),await this.inactiveTracks([z],!1),i(ee)}}if(te){const ee=await this.getLocalStream(z);if(ee&&(await this.initUserMediaStreamContext(b,z,ee,!0),ie)){await this.replaceSenderStream([z],!0);const ae=await this.getUsersId();await this.p2p.replaceSenderStreams(ae,j,!0)}}{if(j.length!==0){const ee=await this.getLocalStreams(j);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:ee,desc:"local stream is change."});const ae={};for(const de of j)ae[de]=!0;await this.emitNotifyUpdateUsersStreams([{userId:this.options.userId,updateStreams:ae}]),await this.emitNotifyUpdateUsers()}S(!0)}};O==="audioinput"&&await Z("microphoneCamera_audio"),O==="videoinput"&&await Z("microphoneCamera_video"),O==="audiooutput"&&(await this.changeAudiooutput(),S(!0))});return this.asyncQueue.add(k,{describe:"publish"})});Q(this,"changeScreenSharing",async O=>{const A=await this.getSelfInfo(),{tracks:k=[],callActionMap:S}=A;try{await this.setLocalStream(O,!0);for(const i of O)k.find(b=>b.mediaType===i&&S[i])&&await this.replaceSenderStream([i],!0)}catch(i){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",i)}});Q(this,"earlyConnect",(O=[])=>{this.isEarly=!0;const A=async()=>new Promise(async(k,S)=>{try{await ce(this,Et).call(this),await ce(this,Rt).call(this),O.length===0&&(O=["microphoneCamera_audio","microphoneCamera_video"]),await ce(this,Mt).call(this,O),k(!0)}catch(i){S(i)}});return this.asyncQueue.add(A,{describe:"earlyConnect"})});Q(this,"joinRoom",async O=>(this.isInRoom=!0,this.setOptions(O),await ce(this,Et).call(this),await this.cwsConnected(),new Promise(async(A,k)=>{Ae(this,gt,async()=>{try{this.clearUsers();const{roomId:S,userId:i,callType:c,sdkToken:b}=this.options;await this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:c,roomId:S,user:{id:i,tracks:[],callAction:0},token:b},version:2}).then(async C=>{const{code:N=0,desc:j="服务器繁忙",data:Z}=C;if(N!==200)throw new Error(j);const{roomId:z="",roomUsers:K=[]}=Z;if(z!==S)return k("加入的房间不匹配");this.initHeartbeat(),this.isEarly===!1&&await ce(this,Rt).call(this),await this.updateUsers(K);const te=[];for(const ee of K){const{id:ae,channelCache:de}=ee,{channels:X=[]}=de;await this.updateUserBehaviors(ae,ee.behavior),await this.updateUserChannels(ae,X,!1),X.length!==0&&te.push({userId:ae,channels:X})}await this.subChannel(te),await this.emitNotifyUpdateUsers();const ie=await this.getUsers();A(ie)})}catch(S){k(S)}}),ce(this,gt).call(this)})));Q(this,"quitRoom",()=>new Promise(async O=>{const{roomId:A,userId:k}=this.options,S={roomId:A,user:{id:k}};try{if(this.isInRoom===!1)return O(!0);this.isInRoom=!1,this.options.roomId="",this.asyncQueue.clear(),this.transceiverMap=new Map,clearInterval(ce(this,$t)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(i){this.reportLogs("quit_room_error",i.message||i)}this.cwsIns.sendMessage({event:"quitRoom",data:S}),setTimeout(()=>O(!0),300),O(!0)}));Q(this,"quitRoomEx",()=>new Promise(async O=>{const{roomId:A,userId:k}=this.options,S={roomId:A,user:{id:k}};try{if(this.isInRoom===!1)return O(!0);this.isInRoom=!1,this.options.roomId="",this.asyncQueue.clear(),this.stopHeartbeat(),this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe().catch(()=>{this.reconstruct()}),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(i){this.reportLogs("quit_room_error",i.message||i)}this.cwsIns.sendMessage({event:"quitRoomEx",data:S}),setTimeout(()=>O(!0),300),O(!0)}));Q(this,"syncRoomInfo",()=>new Promise(async(O,A)=>{try{const{userId:k}=this.options,S=await this.getUser(k),{id:i=k,callAction:c=0}=S;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:c}}}).then(async b=>{const{code:C=0,desc:N,data:j={}}=b;if(C!==200)throw new Error(N);const{isActive:Z=!1,users:z=[]}=j;if(Z===!1)throw new Error("Do not stay in this room.");if(z.find(te=>te.id===this.options.userId)===!1)throw new Error("Need to rejoin the room.");this.clearUsers(),await this.updateUsers(z),await this.updateUsertracks(S.id,S.tracks,!1);{const te=await this.getUsers();O(te)}})}catch(k){A(k)}}));Q(this,"checkInRoom",()=>new Promise(async O=>{const{userId:A}=this.options,k=await this.getUser(A),{id:S=A,callAction:i=0}=k;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:S,callAction:i}}}).then(async c=>{var Z;const{code:b=0,desc:C}=c;if(b!==200)throw new Error(C);const N=c.data.users;return(Z=c.data)!=null&&Z.isActive||N.find(z=>z.id===this.options.userId)?O(!0):O(!1)}).catch(()=>O(!1))}));Q(this,"publish",O=>{const A=()=>new Promise(async(k,S)=>{try{{const j=await this.getSelfInfo(),{banBehaviorMap:Z}=j;let z=!0;for(const K of O)if(Z[K]){z=!1;break}if(z===!1)return S("publish is error: prohibited by administrator.")}this.setLocalStream(O,!0);const i=await this.getSelfInfo(),c=[];for(const j of O){const Z=this.getPhoneyStreams(j);await this.initUserMediaStreamContext(i.id,j,Z,!1)}await this.replaceSenderStream(O,!1),await ce(this,Mt).call(this,O);const b=await this.getSenderTracks(O),C=[...i.tracks,...b];await this.updateUsertracks(i.id,C,!0),c.length!==0&&await this.inactiveTracks(c,!1);const N=await this.getCallAction(C);await ce(this,xt).call(this,N),await new Promise(j=>setTimeout(()=>j(!0),230)),ce(this,Yt).call(this,O);{await this.emitNotifyUpdateUsers();const j=await this.getSelfInfo(),Z={};for(const z of O)Z[z]=!0;await this.emitNotifyUpdateUsersStreams([{userId:j.id,updateStreams:Z}]),k(j)}}catch(i){this.reportLogs("publish_error",i.message||i),S(i)}});return this.asyncQueue.add(A,{describe:"publish"})});Q(this,"stopPublish",(O=[])=>{const A=()=>new Promise(async(k,S)=>{try{const i=await this.getSelfInfo();O.length===0&&(O=mediaType_keys);const c=i.tracks.filter(({mediaType:C})=>C&&O.includes(C)),b=async()=>{const C=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),k(C)};if(c.length===0)return b();await this.replaceSenderStream(O,!0),await this.closeUserTracks(i.id,c,!0),await this.removeSenders(O);{const C=await this.getCallAction(i.tracks);await ce(this,xt).call(this,C)}await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{session:this.sdk_session,roomId:this.options.roomId,sdp:this.getSdp(),tracks:c}}).then(async C=>{const{code:N=0,desc:j,sn:Z="",data:z={}}=C;if(await ce(this,ut).call(this,Z),N!==200)throw new Error(j);const{remoteSdp:K}=z;await this.setRemoteDescription({type:"answer",sdp:K}),b()})}catch(i){this.reportLogs("close_track_error",i.message||i),S(i)}});return this.asyncQueue.add(A,{describe:"stopPublish"})});Q(this,"subscribe",(O=[],A=3)=>{const k=()=>new Promise(async(S,i)=>{var c;try{A=Math.max(A,1),await this.iceConnected();const b=await this.getUsers();let C=[];for(const z of b){const{isSelf:K,tracks:te=[]}=z;if(!K){const ie=te.filter(({trackName:ee,mid:ae=""})=>ae!==""&&(O.includes(ee)||O.length===0));ie.length!==0&&C.push({...z,tracks:ie});for(const ee of ie)if(ee.mediaType==="microphoneCamera_video"){await this.updateUserUseP2P(z.id,!1);const ae=await this.getP2PIns(z.id);(c=ae==null?void 0:ae.recv_peer_ins)==null||c.close()}}}const N=async(z={})=>{const K=Array.from(C,({id:ie})=>ie),te=await this.getUsers(K);await this.emitNotifyUpdateUsers(),S({users:te,detail:z})};if(C.length===0)return N();const j=[];for(const z of C){const{id:K,tracks:te}=z,ie=dt(te,["type","trackName"]),ee={id:K,tracks:ie};j.push(ee)}const Z=async()=>{A=A-1;const z=JSON.parse(JSON.stringify(j));for(const K of z){const{tracks:te=[]}=K;for(const ie of te)ie.lastRetry=A===0,ie.count=A}await this.cwsIns.sendMessage({event:"subscribe",data:{session:this.sdk_session,users:z}}).then(async K=>{const{code:te=0,desc:ie,sn:ee="",data:ae={}}=K;if(await ce(this,ut).call(this,ee),te===2017&&ie.includes("renegotiation is expected before pulling or pushing tracks")&&await this.renegotiate(),te!==200){if(A>0)return await new Promise(ne=>setTimeout(()=>ne(!0),500)),await Z();throw new Error(ie)}const{remoteSdp:de,users:X=[]}=ae;if(A>0){const ne=[];for(const fe of X){const{tracks:se=[]}=fe;for(const ue of se)ue.code!==200&&ne.push(ue.trackName)}ne.length!==0&&setTimeout(()=>{this.subscribe(ne,A)},3*1e3-(3-A)*1e3)}this.onSubscribeUserTracks(X).then(async ne=>{await this.renegotiate().then(()=>N(ne))}).catch(ne=>{throw new Error(ne)}),await this.setRemoteDescription({type:"offer",sdp:de})})};await Z()}catch(b){this.reportLogs("subscribe_error",b.message||b),i(b)}});return this.asyncQueue.add(k,{describe:"subscribe"})});Q(this,"renegotiate",()=>new Promise(async(O,A)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(async k=>{const{code:S=0,desc:i,sn:c=""}=k;if(await ce(this,ut).call(this,c),S!==200)throw new Error(i);O(k)})}catch(k){A(k)}}));Q(this,"stopSubscribe",(O=[])=>ce(this,Nt).call(this,O));ke(this,Nt,(O=[],A=["sfu","p2p"])=>{const k=()=>new Promise(async(S,i)=>{try{const c=await this.getUsers(),b=[];for(const N of c){const{id:j,tracks:Z=[]}=N;for(const z of Z){const{type:K,mid:te,trackName:ie,mediaType:ee,msid:ae,origin:de="sfu",userId:X}=z;if(ee)switch(de){case"sfu":{if(!ae)continue;if(O.length===0||O.includes(ie)){const ne={type:K,mid:te,trackName:ae,userId:X};b.push(ne),await this.closeUserTracks(N.id,[z])}}break;case"p2p":{if(!A.includes("p2p"))continue;O.includes(ie)&&(z.origin="sfu",z.msid="",await this.p2p.close(j,[ee]))}break}}}const C=async()=>{await this.emitNotifyUpdateUsers(),S(!0)};if(b.length===0)return C();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:b}}).then(async N=>{const{code:j=0,desc:Z,sn:z="",data:K={}}=N;if(j!==200)throw new Error(Z);await ce(this,ut).call(this,z);const{remoteSdp:te}=K;await this.setRemoteDescription({type:"answer",sdp:te})}),C()}catch(c){this.reportLogs("close_track_error",c.message||c),i(c)}});return this.asyncQueue.add(k,{describe:"stopSubscribe"})});Q(this,"inactiveTracks",async(O,A)=>new Promise(async k=>{const S=await this.getSelfInfo();if(!S||!S.id)return k(!0);const{tracks:i=[]}=S,c=[...i];for(let C of c){const{mediaType:N}=C;if(N&&O.includes(N)){C.enabled=A;const j=await this.getLocalStream(N);if(!j)continue;const Z=j.getTracks();for(const z of Z)z.enabled=A}}await this.replaceSenderStream(O,A);const b=await this.getCallAction(c);await ce(this,xt).call(this,b),await this.emitNotifyUpdateUsers(),k(!0)}));Q(this,"setBanBehaviors",O=>new Promise(async(A,k)=>{try{const{roomId:S}=this.options,i=[];for(const c of O){const{id:b,banBehaviors:C}=c,N=Object.keys(C);if(N.length===0)continue;const j=[];for(const z of N){const K=mediaType_keys.findIndex(ee=>ee===z),te=C[z],ie={type:K,behavior:te};j.push(ie)}const Z={id:b,behaviors:j};i.push(Z)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:S,users:i}}).then(async c=>{const{code:b=0,desc:C}=c;if(b!==200)return k(C);A(c)})}catch(S){k(S)}}));Q(this,"pubChannel",()=>new Promise(async(O,A)=>{const S=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:S}}).then(async i=>{const{code:c=0,data:b,desc:C}=i;if(c!==200)throw new Error(C);const{channels:N=[]}=b;for(const j of N){const{channels:Z=[]}=j;for(const z of Z){const{dataChannelName:K,id:te}=z;this.initSendChannel(K,te)}}O(!0)}).catch(i=>{A(i)})}));Q(this,"subChannel",(O=[])=>new Promise(async A=>{if(O.length===0)return A(!0);await this.cwsIns.sendMessage({event:"subChannel",data:{channels:O}}).then(async k=>{const{code:S=0,data:i,desc:c}=k;if(S!==200)throw new Error(c);const{channels:b=[]}=i;for(const C of b){const{channels:N=[]}=C;for(const j of N){const{dataChannelName:Z,id:z}=j;this.initReceiveChannel(Z,z)}}})}));Q(this,"debugger",()=>new Promise(async(O,A)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async k=>{if(k.code!==200)return A(k.desc);O(!0)}).catch(k=>{A(k)})}));Q(this,"shutdown",()=>new Promise(async(O,A)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async k=>{if(k.code!==200)return A(k.desc);O(!0)}).catch(k=>{A(k)})}));Q(this,"reconstruct",async()=>{if(await this.cwsConnected(),this.initPeer(),this.isEarly&&this.earlyConnect(),this.isInRoom===!1)return;if(await this.checkInRoom()===!1){this.setRoomState("closed");return}const A=[],k=[],S=await this.getUsers();for(const i of S){const{isSelf:c,callActionMap:b,tracks:C=[]}=i;if(c)for(const N of mediaType_keys)b[N]&&A.push(N);for(const N of C)(N.msid||N.origin==="p2p")&&k.push(N.trackName)}this.isInRoom&&(this.isEarly===!1&&(await ce(this,Et).call(this),await ce(this,Rt).call(this)),ce(this,gt)&&await ce(this,gt).call(this)),await this.syncRoomInfo(),await this.publish(A),k.length!==0&&await this.subscribe(k)});Q(this,"initHeartbeat",()=>{this.stopHeartbeat();const O=async()=>{let k=0,S=0;{const b=await this.getUsersId();for(const C of b){const N=await this.getP2PIns(C);if(N!=null&&N.send_peer_ins){const{outboundBytes:j}=N.getSendPeerNetwork();k+=Math.ceil(j/1024)}if(N!=null&&N.recv_peer_ins){const{inboundBytes:j}=N.getRecvPeerNetwork();S+=Math.ceil(j/1024)}}}let i=0,c=0;{const{outboundBytes:b,inboundBytes:C}=this.getPeerNetwork();i=Math.ceil(b/1024),c=Math.ceil(C/1024)}this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx",data:{p2pPush:k,p2pPull:S,sfuPull:c,sfuPush:i}},!1)},A=this.isInRoom?10*1e3:30*1e3;Ae(this,$t,window.setInterval(O,A)),O()});Q(this,"stopHeartbeat",()=>{clearInterval(ce(this,$t))});ke(this,Yt,async O=>new Promise(async(A,k)=>{try{const{roomId:S}=this.options;if(!S)return;const{id:i,tracks:c=[]}=await this.getSelfInfo(),b=c.filter(N=>N.mediaType&&O.includes(N.mediaType));if(b.length===0)return;const C=dt(b,["type","trackName","mid"]);await this.cwsIns.sendMessage({event:"pubNotify",data:{session:this.sdk_session,roomId:S,user:{id:i,tracks:C}}}),A(!0)}catch(S){k(S)}}));ke(this,ut,O=>new Promise(A=>{this.cwsIns.sendMessage({event:"ackMsg",data:{msgId:O}},!1),A(!0)}));ke(this,xt,async O=>new Promise(async(A,k)=>{const{roomId:S,userId:i}=this.options,c={roomId:S,user:{id:i,callAction:O}};await this.cwsIns.sendMessage({event:"updateCall",data:c}).then(async b=>{const{code:C=0}=b;if(C!==200)return k(b);await this.updateUserCallAction(i,O),A(O)}).catch(b=>k(b))}));Q(this,"setSession",()=>{const{appid:O,roomId:A,userId:k}=this.options;if(!O)throw new Error("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const S={c:O,r:A,p:"web",h:location.hostname,v:this.sdk_service_version};this.isEarly?S.i=this.options.earlyId:S.b=k;const i=btoa(encodeURI(JSON.stringify(S)));this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSession",S);const c=`${this.options.url}?s=${i}&t=${Date.now()}`;this.cwsIns.prws.setOptions({url:c})});ke(this,Et,()=>new Promise(async(O,A)=>{try{if(this.roomState!=="ready")return O(!0);this.cwsIns.clearEvents(),this.setSession(),this.setRoomState("connecting"),await this.cwsIns.connect(),this.initHeartbeat(),this.setRoomState("connected"),await this.prResolves.emit("cwsConnected"),O(this.cwsIns)}catch(k){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",k),this.reportLogs("ws_c_timeout",k.message||k),A(k)}}));Q(this,"cwsConnected",()=>{const O=()=>this.roomState==="connected";return this.prResolves.add("cwsConnected",O)});ke(this,Rt,async()=>new Promise(async(O,A)=>{try{await this.cwsConnected(),this.p2p.reportNetwork(),await this.addSenders(),await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async k=>{const{code:S=0,desc:i,data:c}=k;if(S!==200)throw new Error(i);const{remoteSdp:b,session:C=""}=c;if(this.sdk_session=C,this.options.debug){const N=libExports$1.parse(b),j=dt(N.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:j,sdpJson:N})}await this.setRemoteDescription({type:"answer",sdp:b}),await this.iceConnected().then(()=>{O(!0)})})}catch(k){A(k)}}));ke(this,Mt,async O=>new Promise(async(A,k)=>{try{await this.iceConnected();const S=await this.addSenders(O),i=await this.getSenderTracks(S);if(i.length===0)return A(!0);const c=await this.cwsIns.sendMessage({event:"publish",data:{session:this.sdk_session,sdp:this.getSdp(),tracks:i,callAction:0}}),{code:b=0,desc:C,sn:N="",data:j={}}=c;if(await ce(this,ut).call(this,N),b!==200)throw new Error(C);const{remoteSdp:Z}=j;await this.setRemoteDescription({type:"answer",sdp:Z}),A(!0)}catch(S){this.reportLogs("publish_error",S.message||S),await this.removeSenders(O),k(S)}}));ke(this,Xt,()=>{{const O=async A=>{let k="";const S=await this.getSelfInfo(),{code:i,data:c}=A;if(i!==200)return;const{sdp:b,sender:C={},tracks:N=[]}=c,{id:j}=C;k=j;let Z=!1;const z=new Date().getTime(),K=[];{const ee=await this.getUsersId();let ae=0;for(const de of ee){const X=await this.getP2PIns(de);X!=null&&X.send_peer_ins&&X.send_peer_ins.iceConnectionState==="connected"&&(K.push(de),ae+=1)}if(ae>=3)return this.p2p.reportP2PConnect(k,S.id,2,"P2P connections have reached the maximum limit.")}const te=await this.getP2PIns(k);if(!te)return;await te.initSenderPc();const ie=()=>{const ee=te.send_peer_ins.connectionState;(ee==="failed"||ee==="closed")&&this.p2p.reportP2PConnect(k,S.id,Z?3:1,`P2P connectionState is ${ee}.`)};te.send_peer_ins.addEventListener("connectionstatechange",ie);try{const ee=[];for(const pe of N){const{type:re}=pe;re!==void 0&&ee.push(mediaType_keys[pe.type])}const ae=new RTCSessionDescription({type:"offer",sdp:b});await te.setOffer(ae),await te.initSenders(N),await this.p2p.replaceSenderStreams([k],ee,!0);const de=await te.createAnswer();if(this.options.debug){const pe=libExports$1.parse(de.sdp),re=dt(pe.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:re,sdpJson:pe})}const X=await te.getSenderTracks(ee);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks",X);const{roomId:ne}=this.options,fe=()=>new Promise(async(pe,re)=>{try{const le=await this.cwsIns.sendMessage({event:"answer",data:{roomId:ne,tracks:X,sender:{id:S.id,callAction:S.callAction},receiverId:k,sdp:de.sdp}}),{code:ye=0,desc:ve}=le;if(ye!==200)throw new Error(ve);pe(!0)}catch(le){re(le)}}),se=()=>new Promise(async(pe,re)=>{try{const le=await yt(te.getSendIcecandidates,{message:"await get send candidates is timeout.",timeout:1e4}),ye=Array.from(le,({sdpMid:De,sdpMLineIndex:Me,candidate:Le})=>({sdpMid:De,sdpMLineIndex:Me,sdp:Le})),ve=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:ne,senderId:S.id,receiverId:k,candidates:ye,isSubscribeReceiver:!1}}),{code:we=0,desc:xe}=ve;if(we!==200)throw new Error(xe);pe(!0)}catch(le){re(le)}});await fe(),await se(),await yt(te.sendIceConnected,{message:"await send ice connect is timeout.",timeout:1e4}),Z=!0;const ue=new Date().getTime()-z;this.p2p.reportP2PConnect(k,S.id,0,"连接成功",[...K,k],ue)}catch(ee){te.send_peer_ins.removeEventListener("connectionstatechange",ie),this.p2p.reportP2PConnect(k,S.id,1,ee.message||ee)}};this.cwsIns.addNotify({event:"onOffer",callback:O},!0)}{const O=async A=>{const{code:k,data:S}=A;if(k!==200)return;const{senderId:i,candidates:c=[],receiverId:b,isSubscribeReceiver:C=!1}=S;if(C===!1||b!==this.options.userId)return;const N=await this.getP2PIns(i);if(!N)return;const j=Array.from(c,({sdpMid:Z,sdpMLineIndex:z,sdp:K})=>({sdpMid:Z,sdpMLineIndex:z,candidate:K}));await N.addCandidates(j)};this.cwsIns.addNotify({event:"onCandidate",callback:O},!0)}});Q(this,"p2p",{open:(O,A=["microphoneCamera_video"])=>new Promise(async(k,S)=>{try{const i=await this.getP2PIns(O);if(!i)return S("illegal user object.");const{roomId:c}=this.options,b=await this.getSelfInfo(),C=wt();{const K=await this.getUser(O),{tracks:te=[]}=K;let ie=!0;for(const ee of A)te.find(de=>de.mediaType===ee&&de.msid||de.origin==="p2p")||(ie=!1);if(ie===!1)return this.p2p.reportP2PConnect(O,O,1,"P2P connections without a subscription relationship are not allowed."),S("P2P connections without a subscription relationship are not allowed.")}const N=()=>new Promise(async(K,te)=>{try{await i.initRecvPc(),await i.addRecvs(A);const ie=await i.createOffer();if(this.options.debug){const ne=libExports$1.parse(ie.sdp),fe=dt(ne.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:fe,sdpJson:ne})}const ee=await i.getRecvTracks(A),ae=await this.cwsIns.sendMessage({event:"offer",data:{roomId:c,tracks:ee,sender:{id:b.id,callAction:b.callAction},receiverId:O,sdp:ie.sdp}}),{code:de=0,desc:X}=ae;if(de!==200)throw new Error(X);K(!0)}catch(ie){te(ie)}}),j=()=>yt(()=>new Promise(te=>{const ie=async ee=>{const{code:ae,data:de}=ee;if(ae!==200)return;const{sender:X,sdp:ne,tracks:fe=[]}=de,{id:se}=X;O===se&&te({answer:{type:"answer",sdp:ne},tracks:fe})};this.cwsIns.addNotify({event:"onAnswer",callback:ie,sn:`onAnswer: ${C}`},!0)}),{message:"await_answer is timeout.",timeout:20*1e3}),Z=()=>new Promise(async(K,te)=>{try{const ie=await yt(i.getRecvIcecandidates,{message:"await get recv candidates is timeout.",timeout:1e4}),ee=Array.from(ie,({sdpMid:ne,sdpMLineIndex:fe,candidate:se})=>({sdpMid:ne,sdpMLineIndex:fe,sdp:se})),ae=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:c,senderId:b.id,receiverId:O,candidates:ee,isSubscribeReceiver:!0}}),{code:de=0,desc:X}=ae;if(de!==200)throw new Error(X);K(!0)}catch(ie){te(ie)}}),z=()=>yt(()=>new Promise(te=>{const ie=async ee=>{const{code:ae,data:de}=ee;if(ae!==200)return;const{candidates:X=[],isSubscribeReceiver:ne=!1}=de;if(ne===!1){const fe=Array.from(X,({sdpMid:se,sdpMLineIndex:ue,sdp:pe})=>({sdpMid:se,sdpMLineIndex:ue,candidate:pe}));te(fe)}};this.cwsIns.addNotify({event:"onCandidate",callback:ie,sn:`onCandidate: ${C}`},!0)}),{message:"await_answer_candidates is timeout.",timeout:20*1e3});Promise.all([j(),z()]).then(async K=>{const[{answer:te,tracks:ie},ee]=K;if(this.options.debug){const de=libExports$1.parse(te.sdp),X=dt(de.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setAnswer",{msidArr:X,sdpJson:de})}await i.setAnswer(te,ee),await yt(i.recvIceConnected,{message:"recv ice connect is timeout.",timeout:10*1e3});const ae=[];for(const de of ie)ae.push(mediaType_keys[de.type]);{const de=await this.getUser(O),X=[];for(const ne of de.tracks){const{mediaType:fe}=ne;fe&&ae.includes(fe)&&X.push(ne.trackName)}await ce(this,Nt).call(this,X,["sfu"]);for(const ne of de.tracks){const{mediaType:fe}=ne;fe&&ae.includes(fe)&&(ne.origin="p2p")}}for(const de of ae){const X=i.getTrack(de);if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: emitNotifyUpdateUsersStreams",X),!X)return S("Invalid media track.");const ne=new MediaStream;ne.addTrack(X),await this.initUserMediaStreamContext(O,de,ne,!0)}if(ae.length!==0){await this.updateUserUseP2P(O,!0),await this.emitNotifyUpdateUsers();const de={};for(const X of ae)de[X]=!0;await this.emitNotifyUpdateUsersStreams([{userId:O,updateStreams:de}])}k(!0)}).catch(K=>S(K)).finally(()=>{this.cwsIns.removeNotify([`onAnswer: ${C}`,`onCandidate: ${C}`])}),await N(),await Z()}catch(i){S(i)}}),replaceSenderStreams:async(O,A=[],k)=>{for(const S of O){const{userId:i}=this.options,c=await this.getP2PIns(S);if(!(!c||!c.send_peer_ins))for(const b of A){const C=c.send_transceiverMap.get(b);let N;if(C){const{sender:j}=C;k?N=this.getUserStream(i,b):N=this.getPhoneyStreams(b);const[Z]=N.getTracks();Z&&await j.replaceTrack(Z)}}}},reportNetwork:()=>new Promise(async(O,A)=>{try{let k=0;switch((await h()).natType){case"Symmetric":k=0;break;case"Full Cone":k=1;break;case"Port Restricted Cone":k=2;break;case"Restricted Cone":k=3;break}let S=0;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"wifi":S=0;break;case"4g":case"3g":case"2g":case"slow-2g":S=2;break;default:S=1;break}await this.cwsIns.sendMessage({event:"reportNetwork",data:{nat:k,type:S}}),O(!0)}catch(k){A(k)}}),reportP2PConnect:(O,A,k,S="",i=[],c=0)=>this.cwsIns.sendMessage({event:"reportP2PConnect",data:{userId:O,origin:A,code:k,reason:S,pushUserIds:i,connectedTime:c}}),close:async(O,A=[])=>{const k=await this.getP2PIns(O);if(!(!k||!k.recv_peer_ins)){for(const S of A){const i=k.recv_transceiverMap.get(S);i==null||i.stop()}await k.clearRecvPc(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: close p2p: ${O}`,O,A)}}});ce(this,Xt).call(this)}}$t=new WeakMap,gt=new WeakMap,Nt=new WeakMap,Yt=new WeakMap,ut=new WeakMap,xt=new WeakMap,Et=new WeakMap,Rt=new WeakMap,Mt=new WeakMap,Xt=new WeakMap;class Room extends RoomCalls{constructor(D){super(D)}}class QuickVO extends Room{constructor(O){super(O);ke(this,St,new Map);ke(this,Qt,()=>{{const O=async A=>{const{state:k}=A.data;if(k==="closed"){const{roomId:S,userId:i}=this.options,c={roomId:S,user:{id:i}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:c}),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:O},!0)}{const O=async A=>{const{state:k}=A.data;["closed","failed"].includes(k)&&this.reconstruct()};this.cwsIns.addNotify({event:"onIceState",callback:O},!0)}{const O=async A=>{const{qualities:k=[]}=A.data,[S]=k;if(!(S&&S.userId===this.options.userId&&k.length===1)){for(const i of k){const{userId:c,egress:b,ingress:C}=i;this.checkUserInRoom(c)&&await this.updateUserNetwork(c,{egress:b,ingress:C})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:O},!0)}{const O=async A=>{const k=A.data.user;await this.removeUsers([k.id]),await this.updateUsers([k]),await this.updateUsertracks(k.id,k.track,!1),await this.updateUserBehaviors(k.id,k.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:O},!0)}{const O=async A=>{await this.removeUsers([A.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:O},!0)}{const O=async A=>{const{user:k}=A.data,{id:S,tracks:i=[],callAction:c=0}=k;if(await this.updateUserCallAction(S,c),await this.updateUserPermissions(S,3),await this.updateUsertracks(S,i,!0),this.options.newPublishAutoSubscribe){const b=this.getTrackNamesFormTracks(i);await this.subscribe(b)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:O},!0)}{const O=async A=>{const k=[A.data];this.subChannel(k)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:O},!0)}{const O=async A=>{const{id:k,tracks:S}=A.data.user;k!==this.options.userId&&(await this.closeUserTracks(k,S,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:O},!0)}{const O=async A=>{const{id:k,callAction:S}=A.data.user;this.checkUserInRoom(k)&&(await this.updateUserCallAction(k,S),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:O},!0)}{const O=async A=>{const{user:k}=A.data,{id:S,permissions:i=1}=k;i===1?await this.removeUsers([S]):i===3&&await this.updateUsers([k]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:O},!0)}{const O=async A=>{const{users:k}=A.data;for(const S of k){const{id:i,behavior:c}=S;await this.updateUserBehaviors(i,c)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:O},!0)}{const O=async A=>{const{roomId:k,userId:S}=A.data;this.options.roomId===k&&this.p2p.open(S)};this.cwsIns.addNotify({event:"onAttemptP2PReq",callback:O},!0)}{const O=async A=>{const{session:k,sessionIsValid:S=!0,tracks:i=[]}=A.data;if(k!==this.sdk_session||S===!1)return this.reconstruct();const c=[];for(const b of i){const{mid:C}=b,N=await this.getUserTrackFromMid(C);N&&N.mediaType&&c.push(N.mediaType)}await this.publish(c)};this.cwsIns.addNotify({event:"onTrackInactive",callback:O},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async O=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Q(this,"addNotify",O=>this.cwsIns.addNotify(O));ke(this,en,()=>{this.cwsIns.prws.checkReconnect=async O=>O.code===1e3?(this.setRoomState("closed"),!1):O.code===4001?(this.setRoomState("closed"),!1):O.code===4002?(this.setRoomState("closed"),!1):O.code===4003?(this.setRoomState("closed"),!1):(this.setSession(),O.code===4010?(this.setRoomState("connecting"),!0):(this.setRoomState("connecting"),await new Promise(A=>setTimeout(()=>A(!0),5*1e3)),!0)),this.cwsIns.prws.onReconnectSuccess=async O=>{this.setRoomState("connected"),await this.prResolves.emit("cwsConnected"),this.cwsIns.afreshSends()},this.cwsIns.prws.onReconnectStop=async O=>{this.setRoomState("closed")}});Q(this,"addRequestAnimationFrame",async(O,A)=>{{const S=ce(this,St).get(O);S&&cancelAnimationFrame(S)}const k=(S=Date.now())=>{A(S);const i=requestAnimationFrame(k);ce(this,St).set(O,i)};k()});Q(this,"clearRequestAnimationFrame",async(O=[])=>{O.length===0&&(O=[...ce(this,St).keys()]);const A=[];for(const k of O){const S=ce(this,St).get(k);S&&(cancelAnimationFrame(S),A.push(S))}return A});Q(this,"destroy",async()=>{this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise(O=>setTimeout(()=>O(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.clearEvents(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK")});ce(this,en).call(this),ce(this,Qt).call(this)}}St=new WeakMap,Qt=new WeakMap,en=new WeakMap,exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});