quickvo-sdk-js 1.4.1 → 1.4.2

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(Oe,xe){typeof exports=="object"&&typeof module<"u"?xe(exports):typeof define=="function"&&define.amd?define(["exports"],xe):(Oe=typeof globalThis<"u"?globalThis:Oe||self,xe(Oe["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var un=Object.defineProperty;var an=Oe=>{throw TypeError(Oe)};var fn=(Oe,xe,Ae)=>xe in Oe?un(Oe,xe,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):Oe[xe]=Ae;var ee=(Oe,xe,Ae)=>fn(Oe,typeof xe!="symbol"?xe+"":xe,Ae),sn=(Oe,xe,Ae)=>xe.has(Oe)||an("Cannot "+Ae);var fe=(Oe,xe,Ae)=>(sn(Oe,xe,"read from private field"),Ae?Ae.call(Oe):xe.get(Oe)),_e=(Oe,xe,Ae)=>xe.has(Oe)?an("Cannot add the same private member more than once"):xe instanceof WeakSet?xe.add(Oe):xe.set(Oe,Ae),Be=(Oe,xe,Ae,ct)=>(sn(Oe,xe,"write to private field"),ct?ct.call(Oe,Ae):xe.set(Oe,Ae),Ae);var Oe,xe,Ae,ct,Ht,Zt,Jt,Ge,_t,lt,qt,Nt,Xe,nt,gt,St,Mt,$t,We,He,et,rt,ut,xt,Vt,Gt,Et,Wt,ft,Kt,Qt,Yt,Ut,Ot,Lt,Xt,Rt,At,Ft,It,jt,mt,Pt,zt,en,Tt,tn,nn;const it=(D,M={})=>{const A={unit:"B",splitStr:" ",...M};let{unit:N,splitStr:O}=A;const C=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=C.findIndex(B=>B===N),u=C.slice(i+1,C.length);let $=D;for(const B of u)if(N=B,$=$/1024,$<1024)break;return`${$.toFixed(2)}${O}${N}`},V=(D,M=[])=>{const A={...D},N=Object.keys(A);for(const O of N)M.findIndex(C=>String(C)===O)===-1&&delete A[O];return A},pt=(D,M=[],A=!0)=>{const N=new Map;for(const C of D){const i=[];for(const $ of M)i.push(C[$]);const u=`map-${i.join("-")}`;if(!N.has(u)){N.set(u,C);continue}A&&N.set(u,C)}const O=N.entries();return Array.from(O,([C,i])=>i)},dt=(D,M=[])=>{const A=[];for(const N of D){const O=V(N,M);A.push(O)}return A},ht=(D,M="value",A="label")=>{const N=[],O=Object.entries(D);for(const[C,i]of O){const u={[A]:i,[M]:C};N.push(u)}return N},v$1=(D=0,M=1)=>{const A=Math.max(0,D),N=Math.max(1,M),O=Math.random()*(N-A+1)+A;return parseInt(`${O}`,10)},wt=(D=16,M=16)=>{const A="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),N=Math.min(A.length,M),O=Date.now().toString(N),C=O.split(""),i=Math.max(4,D-O.length);for(let u=0;u<i;u++){const $=v$1(0,N-1),B=A[$];C.push(B)}return C.join("").toUpperCase()},W=(D,M)=>{try{let A=Number(D);if(isNaN(A)){const N=new Date(`${D}`);if(`${N}`=="Invalid Date")return 0;A=N.getTime()}if(M!==void 0){const N=new Date().getTimezoneOffset();A+=(N+M)*60*1e3}return A}catch(A){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:D,_offset:M,error:A}),0}},H$1=1e3,R$1=6e4,U=36e5,T=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L$1=D=>W(D),E$1=(D,M="YYYY-MM-DD hh:mm:ss",A={})=>{const N={empty_str:"-",...A},{empty_str:O,offset:C}=N,i=W(D,C);if(Number(D)!==0&&i===0)return O;const u=new Date(i),$=`${u.getFullYear()}`,B=`${u.getMonth()+1}`,F=`${u.getDate()}`,Z=`${u.getDay()===0?7:u.getDay()}`,K=`${u.getHours()}`,J=`${u.getMinutes()}`,Y=`${u.getSeconds()}`,ae=`${Math.ceil((i-L$1(`${$}/01/01 00:00:00`)+1)/864e5)}`,oe=`${Math.ceil(((i-L$1(`${$}/01/01 00:00:00`))/864e5-Number(Z))/7)+1}`,ne=[{k:"Y+",v:$},{k:"M+",v:B},{k:"D+",v:F},{k:"W+",v:Z},{k:"h+",v:K},{k:"m+",v:J},{k:"s+",v:Y},{k:"d+",v:ae},{k:"w+",v:oe}];let ue;for(let{k:ye,v:te}of ne)if(ue=new RegExp(`(${ye})`).exec(M),ue){const re=ue[1];let le=te.padStart(re.length,"0");re.includes("W")&&(le=_[le.slice(0,2)]),M=M.replace(re,le)}return M},P$1=new Map,yt=(D,M={})=>new Promise(async(A,N)=>{const{timeout:O=5*1e3,message:C="timeout"}=M,i=window.setTimeout(()=>N(C),O);try{const u=await D();A(u)}catch(u){N(u)}clearTimeout(i)}),Ct=(D,M,A)=>{const N=new Date().getTime(),O=P$1.get(D)||0;N-A>O&&(M(),P$1.set(D,N))},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(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var D=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(M){return M.encoding?"rtpmap:%d %s/%s/%s":M.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(M){return M.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(M){return M.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(M){return"extmap:%d"+(M.direction?"/%s":"%v")+(M["encrypt-uri"]?" %s":"%v")+" %s"+(M.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(M){return M.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(M){var A="candidate:%s %d %s %d %s %d typ %s";return A+=M.raddr!=null?" raddr %s rport %d":"%v%v",A+=M.tcptype!=null?" tcptype %s":"%v",M.generation!=null&&(A+=" generation %d"),A+=M["network-id"]!=null?" network-id %d":"%v",A+=M["network-cost"]!=null?" network-cost %d":"%v",A}},{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(M){var A="ssrc:%d";return M.attribute!=null&&(A+=" %s",M.value!=null&&(A+=":%s")),A}},{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(M){return M.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(M){return M.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(M){return"imageattr:%s %s %s"+(M.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(M){return"simulcast:%s %s"+(M.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(M){return"ts-refclk:%s"+(M.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(M){var A="mediaclk:";return A+=M.id!=null?"id=%s %s":"%v%s",A+=M.mediaClockValue!=null?"=%s":"",A+=M.rateNumerator!=null?" rate=%s":"",A+=M.rateDenominator!=null?"/%s":"",A}},{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(D).forEach(function(M){var A=D[M];A.forEach(function(N){N.reg||(N.reg=/(.*)/),N.format||(N.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(D){var M=function(u){return String(Number(u))===u?Number(u):u},A=function(u,$,B,F){if(F&&!B)$[F]=M(u[1]);else for(var Z=0;Z<B.length;Z+=1)u[Z+1]!=null&&($[B[Z]]=M(u[Z+1]))},N=function(u,$,B){var F=u.name&&u.names;u.push&&!$[u.push]?$[u.push]=[]:F&&!$[u.name]&&($[u.name]={});var Z=u.push?{}:F?$[u.name]:$;A(B.match(u.reg),Z,u.names,u.name),u.push&&$[u.push].push(Z)},O=requireGrammar(),C=RegExp.prototype.test.bind(/^([a-z])=(.*)/);D.parse=function(u){var $={},B=[],F=$;return u.split(/(\r\n|\r|\n)/).filter(C).forEach(function(Z){var K=Z[0],J=Z.slice(2);K==="m"&&(B.push({rtp:[],fmtp:[]}),F=B[B.length-1]);for(var Y=0;Y<(O[K]||[]).length;Y+=1){var ae=O[K][Y];if(ae.reg.test(J))return N(ae,F,J)}}),$.media=B,$};var i=function(u,$){var B=$.split(/=(.+)/,2);return B.length===2?u[B[0]]=M(B[1]):B.length===1&&$.length>1&&(u[B[0]]=void 0),u};D.parseParams=function(u){return u.split(/;\s?/).reduce(i,{})},D.parseFmtpConfig=D.parseParams,D.parsePayloads=function(u){return u.toString().split(" ").map(Number)},D.parseRemoteCandidates=function(u){for(var $=[],B=u.split(" ").map(M),F=0;F<B.length;F+=3)$.push({component:B[F],ip:B[F+1],port:B[F+2]});return $},D.parseImageAttributes=function(u){return u.split(" ").map(function($){return $.substring(1,$.length-1).split(",").reduce(i,{})})},D.parseSimulcastStreamList=function(u){return u.split(";").map(function($){return $.split(",").map(function(B){var F,Z=!1;return B[0]!=="~"?F=M(B):(F=M(B.substring(1,B.length)),Z=!0),{scid:F,paused:Z}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var D=requireGrammar(),M=/%[sdv%]/g,A=function(i){var u=1,$=arguments,B=$.length;return i.replace(M,function(F){if(u>=B)return F;var Z=$[u];switch(u+=1,F){case"%%":return"%";case"%s":return String(Z);case"%d":return Number(Z);case"%v":return""}})},N=function(i,u,$){var B=u.format instanceof Function?u.format(u.push?$:$[u.name]):u.format,F=[i+"="+B];if(u.names)for(var Z=0;Z<u.names.length;Z+=1){var K=u.names[Z];u.name?F.push($[u.name][K]):F.push($[u.names[Z]])}else F.push($[u.name]);return A.apply(null,F)},O=["v","o","s","i","u","e","p","c","b","t","r","z","a"],C=["i","c","b","a"];return writer$1=function(i,u){u=u||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(Z){Z.payloads==null&&(Z.payloads="")});var $=u.outerOrder||O,B=u.innerOrder||C,F=[];return $.forEach(function(Z){D[Z].forEach(function(K){K.name in i&&i[K.name]!=null?F.push(N(Z,K,i)):K.push in i&&i[K.push]!=null&&i[K.push].forEach(function(J){F.push(N(Z,K,J))})})}),i.media.forEach(function(Z){F.push(N("m",D.m[0],Z)),B.forEach(function(K){D[K].forEach(function(J){J.name in Z&&Z[J.name]!=null?F.push(N(K,J,Z)):J.push in Z&&Z[J.push]!=null&&Z[J.push].forEach(function(Y){F.push(N(K,J,Y))})})})}),F.join(`\r
1
+ (function(A,B){typeof exports=="object"&&typeof module<"u"?B(exports):typeof define=="function"&&define.amd?define(["exports"],B):(A=typeof globalThis<"u"?globalThis:A||self,B(A["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";const it=(A,B={})=>{const D={unit:"B",splitStr:" ",...B};let{unit:M,splitStr:O}=D;const C=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=C.findIndex(N=>N===M),u=C.slice(i+1,C.length);let $=A;for(const N of u)if(M=N,$=$/1024,Math.abs($)<1024)break;return`${$.toFixed(2)}${O}${M}`},V=(A,B=[])=>{const D={...A},M=Object.keys(D);for(const O of M)B.findIndex(C=>String(C)===O)===-1&&delete D[O];return D},pt=(A,B=[],D=!0)=>{const M=new Map;for(const C of A){const i=[];for(const $ of B)i.push(C[$]);const u=`map-${i.join("-")}`;if(!M.has(u)){M.set(u,C);continue}D&&M.set(u,C)}const O=M.entries();return Array.from(O,([C,i])=>i)},dt=(A,B=[])=>{const D=[];for(const M of A){const O=V(M,B);D.push(O)}return D},ht=(A,B="value",D="label")=>{const M=[],O=Object.entries(A);for(const[C,i]of O){const u={[D]:i,[B]:C};M.push(u)}return M},v$1=(A=0,B=1)=>{const D=Math.max(0,A),M=Math.max(1,B),O=Math.random()*(M-D+1)+D;return parseInt(`${O}`,10)},wt=(A=16,B=16)=>{const D="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),M=Math.min(D.length,B),O=Date.now().toString(M),C=O.split(""),i=Math.max(4,A-O.length);for(let u=0;u<i;u++){const $=v$1(0,M-1),N=D[$];C.push(N)}return C.join("").toUpperCase()},W=(A,B)=>{try{let D=Number(A);if(isNaN(D)){const M=new Date(`${A}`);if(`${M}`=="Invalid Date")return 0;D=M.getTime()}if(B!==void 0){const M=new Date().getTimezoneOffset();D+=(M+B)*60*1e3}return D}catch(D){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:A,_offset:B,error:D}),0}},H$1=1e3,R$1=6e4,U=36e5,T=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L$1=A=>W(A),E$1=(A,B="YYYY-MM-DD hh:mm:ss",D={})=>{const M={empty_str:"-",...D},{empty_str:O,offset:C}=M,i=W(A,C);if(Number(A)!==0&&i===0)return O;const u=new Date(i),$=`${u.getFullYear()}`,N=`${u.getMonth()+1}`,F=`${u.getDate()}`,Z=`${u.getDay()===0?7:u.getDay()}`,K=`${u.getHours()}`,J=`${u.getMinutes()}`,Y=`${u.getSeconds()}`,oe=`${Math.ceil((i-L$1(`${$}/01/01 00:00:00`)+1)/864e5)}`,re=`${Math.ceil(((i-L$1(`${$}/01/01 00:00:00`))/864e5-Number(Z))/7)+1}`,te=[{k:"Y+",v:$},{k:"M+",v:N},{k:"D+",v:F},{k:"W+",v:Z},{k:"h+",v:K},{k:"m+",v:J},{k:"s+",v:Y},{k:"d+",v:oe},{k:"w+",v:re}];let ue;for(let{k:pe,v:ee}of te)if(ue=new RegExp(`(${pe})`).exec(B),ue){const ne=ue[1];let le=ee.padStart(ne.length,"0");ne.includes("W")&&(le=_[le.slice(0,2)]),B=B.replace(ne,le)}return B},P$1=new Map,yt=(A,B={})=>new Promise(async(D,M)=>{const{timeout:O=5*1e3,message:C="timeout"}=B,i=window.setTimeout(()=>M(C),O);try{const u=await A();D(u)}catch(u){M(u)}clearTimeout(i)}),Ct=(A,B,D)=>{const M=new Date().getTime(),O=P$1.get(A)||0;M-D>O&&(B(),P$1.set(A,M))},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(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var A=grammar.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(B){return B.encoding?"rtpmap:%d %s/%s/%s":B.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(B){return B.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(B){return B.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(B){return"extmap:%d"+(B.direction?"/%s":"%v")+(B["encrypt-uri"]?" %s":"%v")+" %s"+(B.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(B){return B.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{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(B){var D="candidate:%s %d %s %d %s %d typ %s";return D+=B.raddr!=null?" raddr %s rport %d":"%v%v",D+=B.tcptype!=null?" tcptype %s":"%v",B.generation!=null&&(D+=" generation %d"),D+=B["network-id"]!=null?" network-id %d":"%v",D+=B["network-cost"]!=null?" network-cost %d":"%v",D}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(B){var D="ssrc:%d";return B.attribute!=null&&(D+=" %s",B.value!=null&&(D+=":%s")),D}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(B){return B.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(B){return B.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(B){return"imageattr:%s %s %s"+(B.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(B){return"simulcast:%s %s"+(B.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(B){return"ts-refclk:%s"+(B.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(B){var D="mediaclk:";return D+=B.id!=null?"id=%s %s":"%v%s",D+=B.mediaClockValue!=null?"=%s":"",D+=B.rateNumerator!=null?" rate=%s":"",D+=B.rateDenominator!=null?"/%s":"",D}},{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(A).forEach(function(B){var D=A[B];D.forEach(function(M){M.reg||(M.reg=/(.*)/),M.format||(M.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(A){var B=function(u){return String(Number(u))===u?Number(u):u},D=function(u,$,N,F){if(F&&!N)$[F]=B(u[1]);else for(var Z=0;Z<N.length;Z+=1)u[Z+1]!=null&&($[N[Z]]=B(u[Z+1]))},M=function(u,$,N){var F=u.name&&u.names;u.push&&!$[u.push]?$[u.push]=[]:F&&!$[u.name]&&($[u.name]={});var Z=u.push?{}:F?$[u.name]:$;D(N.match(u.reg),Z,u.names,u.name),u.push&&$[u.push].push(Z)},O=requireGrammar(),C=RegExp.prototype.test.bind(/^([a-z])=(.*)/);A.parse=function(u){var $={},N=[],F=$;return u.split(/(\r\n|\r|\n)/).filter(C).forEach(function(Z){var K=Z[0],J=Z.slice(2);K==="m"&&(N.push({rtp:[],fmtp:[]}),F=N[N.length-1]);for(var Y=0;Y<(O[K]||[]).length;Y+=1){var oe=O[K][Y];if(oe.reg.test(J))return M(oe,F,J)}}),$.media=N,$};var i=function(u,$){var N=$.split(/=(.+)/,2);return N.length===2?u[N[0]]=B(N[1]):N.length===1&&$.length>1&&(u[N[0]]=void 0),u};A.parseParams=function(u){return u.split(/;\s?/).reduce(i,{})},A.parseFmtpConfig=A.parseParams,A.parsePayloads=function(u){return u.toString().split(" ").map(Number)},A.parseRemoteCandidates=function(u){for(var $=[],N=u.split(" ").map(B),F=0;F<N.length;F+=3)$.push({component:N[F],ip:N[F+1],port:N[F+2]});return $},A.parseImageAttributes=function(u){return u.split(" ").map(function($){return $.substring(1,$.length-1).split(",").reduce(i,{})})},A.parseSimulcastStreamList=function(u){return u.split(";").map(function($){return $.split(",").map(function(N){var F,Z=!1;return N[0]!=="~"?F=B(N):(F=B(N.substring(1,N.length)),Z=!0),{scid:F,paused:Z}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var A=requireGrammar(),B=/%[sdv%]/g,D=function(i){var u=1,$=arguments,N=$.length;return i.replace(B,function(F){if(u>=N)return F;var Z=$[u];switch(u+=1,F){case"%%":return"%";case"%s":return String(Z);case"%d":return Number(Z);case"%v":return""}})},M=function(i,u,$){var N=u.format instanceof Function?u.format(u.push?$:$[u.name]):u.format,F=[i+"="+N];if(u.names)for(var Z=0;Z<u.names.length;Z+=1){var K=u.names[Z];u.name?F.push($[u.name][K]):F.push($[u.names[Z]])}else F.push($[u.name]);return D.apply(null,F)},O=["v","o","s","i","u","e","p","c","b","t","r","z","a"],C=["i","c","b","a"];return writer$1=function(i,u){u=u||{},i.version==null&&(i.version=0),i.name==null&&(i.name=" "),i.media.forEach(function(Z){Z.payloads==null&&(Z.payloads="")});var $=u.outerOrder||O,N=u.innerOrder||C,F=[];return $.forEach(function(Z){A[Z].forEach(function(K){K.name in i&&i[K.name]!=null?F.push(M(Z,K,i)):K.push in i&&i[K.push]!=null&&i[K.push].forEach(function(J){F.push(M(Z,K,J))})})}),i.media.forEach(function(Z){F.push(M("m",A.m[0],Z)),N.forEach(function(K){A[K].forEach(function(J){J.name in Z&&Z[J.name]!=null?F.push(M(K,J,Z)):J.push in Z&&Z[J.push]!=null&&Z[J.push].forEach(function(Y){F.push(M(K,J,Y))})})})}),F.join(`\r
2
2
  `)+`\r
3
- `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var D=requireParser(),M=requireWriter$1(),A=requireGrammar();return lib$1.grammar=A,lib$1.write=M,lib$1.parse=D.parse,lib$1.parseParams=D.parseParams,lib$1.parseFmtpConfig=D.parseFmtpConfig,lib$1.parsePayloads=D.parsePayloads,lib$1.parseRemoteCandidates=D.parseRemoteCandidates,lib$1.parseImageAttributes=D.parseImageAttributes,lib$1.parseSimulcastStreamList=D.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(M){ee(this,"kind","video");ee(this,"stream",new MediaStream);ee(this,"stop",()=>{const M=this.stream.getTracks();for(const A of M)A.stop(),this.stream.removeTrack(A)});ee(this,"replaceStream",M=>{const A=this.stream,N=A.getTracks();for(const C of N)A.removeTrack(C);const[O]=M.getVideoTracks();O&&A.addTrack(O)});ee(this,"getStream",()=>this.stream);ee(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(M)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var I=Object.defineProperty,k=D=>{throw TypeError(D)},S=(D,M,A)=>M in D?I(D,M,{enumerable:!0,configurable:!0,writable:!0,value:A}):D[M]=A,a$1=(D,M,A)=>S(D,typeof M!="symbol"?M+"":M,A),R=(D,M,A)=>M.has(D)||k("Cannot "+A),t=(D,M,A)=>(R(D,M,"read from private field"),A?A.call(D):M.get(D)),h$1=(D,M,A)=>M.has(D)?k("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(D):M.set(D,A),r=(D,M,A,N)=>(R(D,M,"write to private field"),M.set(D,A),A);const E=(D=0,M=1)=>{const A=Math.max(0,D),N=Math.max(1,M),O=Math.random()*(N-A+1)+A;return parseInt(`${O}`,10)},L=(D=16,M=16)=>{const A="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),N=Math.min(A.length,M),O=Date.now().toString(N),C=O.split(""),i=Math.max(4,D-O.length);for(let u=0;u<i;u++){const $=E(0,N-1),B=A[$];C.push(B)}return C.join("").toUpperCase()};var s$1,c,l$1,m$1,p$1,f,w,g$2,b,y$1,x;class H{constructor(M){h$1(this,s$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4}),a$1(this,"ws"),h$1(this,c,""),h$1(this,l$1,-1),h$1(this,m$1,-1),h$1(this,p$1,0),h$1(this,f,0),h$1(this,w,!1),a$1(this,"checkReconnect",async A=>!0),a$1(this,"onReconnectSuccess",async A=>{}),a$1(this,"onReconnectStop",async A=>{}),a$1(this,"getHeartbeatMsg",()=>JSON.stringify({event:"heartbeat"})),a$1(this,"onMessage",A=>{}),a$1(this,"setOptions",A=>{r(this,s$1,{...t(this,s$1),...A})}),a$1(this,"connect",()=>new Promise(async(A,N)=>{r(this,c,L()),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;padding:16px 0;","------->pr-ws: connecting.",{key:t(this,c),url:t(this,s$1).url}),this.ws=new WebSocket(t(this,s$1).url),this.ws.binaryType=t(this,s$1).binaryType,this.ws.addEventListener("message",t(this,b)),this.ws.addEventListener("open",O=>{clearTimeout(t(this,p$1)),r(this,l$1,t(this,s$1).reconnectCount),r(this,w,!1),r(this,m$1,-1),t(this,y$1).call(this),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;padding:16px 0;","------->pr-ws: connected.",{key:t(this,c),url:t(this,s$1).url}),A(O)}),this.ws.addEventListener("error",O=>{clearTimeout(t(this,p$1)),t(this,s$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is error.",{key:t(this,c),url:t(this,s$1).url,e:O}),N(O)}),this.ws.addEventListener("close",O=>{if(t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is close.",{key:t(this,c),url:t(this,s$1).url,e:O}),t(this,w)===!1)return this.reconnect(O);t(this,x).call(this),this.ws=void 0}),r(this,p$1,window.setTimeout(()=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",{key:t(this,c),url:t(this,s$1).url}),N("connect is timeout.")},t(this,s$1).timeout))})),a$1(this,"reconnect",async A=>new Promise(async(N,O)=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.",{key:t(this,c),url:t(this,s$1).url});const C=i=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: reconnect is stop. ",{key:t(this,c),url:t(this,s$1).url,msg:i}),this.onReconnectStop({msg:i}),O(i)};if(t(this,g$2).call(this)===!1)return C("stop reconnect. exceed maxReconnectionTime.");if(t(this,l$1)!==-1&&t(this,l$1)===0)return C("stop reconnect. surplusReconnectCount is 0.");if(!await this.checkReconnect(A))return C("stop reconnect. checkReconnect is false.");t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,l$1)}`,{key:t(this,c)}),await new Promise(i=>setTimeout(()=>i(!0),t(this,s$1).reconnectIntervalTime)),r(this,l$1,Math.max(-1,t(this,l$1)-1)),await this.connect().then(this.onReconnectSuccess),N(this.ws)})),a$1(this,"sendMessage",async A=>{var N;(!this.ws||this.ws.readyState!==1)&&(t(this,s$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.",{key:t(this,c),url:t(this,s$1).url}),t(this,s$1).autoConnect&&(t(this,s$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws auto connect.",{key:t(this,c),url:t(this,s$1).url}),await this.connect())),(N=this.ws)==null||N.send(A)}),a$1(this,"close",async(A=1e3,N="correctly close.")=>{var O;this.ws&&(r(this,w,!0),t(this,x).call(this),(O=this.ws)==null||O.close(A,N))}),h$1(this,g$2,()=>{const A=Date.now();return t(this,m$1)===-1&&r(this,m$1,A+t(this,s$1).reconnectTime),!(A>t(this,m$1))}),h$1(this,b,A=>{const{data:N}=A;this.onMessage(N)}),h$1(this,y$1,()=>{r(this,f,window.setInterval(()=>{const A=this.getHeartbeatMsg();A&&this.sendMessage(A)},t(this,s$1).heartbeatIntervalTime))}),h$1(this,x,()=>{clearInterval(t(this,f))}),r(this,s$1,{...t(this,s$1),...M}),r(this,l$1,t(this,s$1).reconnectCount)}}s$1=new WeakMap,c=new WeakMap,l$1=new WeakMap,m$1=new WeakMap,p$1=new WeakMap,f=new WeakMap,w=new WeakMap,g$2=new WeakMap,b=new WeakMap,y$1=new WeakMap,x=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=D;function D(M,A){for(var N=new Array(arguments.length-1),O=0,C=2,i=!0;C<arguments.length;)N[O++]=arguments[C++];return new Promise(function($,B){N[O]=function(Z){if(i)if(i=!1,Z)B(Z);else{for(var K=new Array(arguments.length-1),J=0;J<K.length;)K[J++]=arguments[J];$.apply(null,K)}};try{M.apply(A||null,N)}catch(F){i&&(i=!1,B(F))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(D){var M=D;M.length=function(u){var $=u.length;if(!$)return 0;for(var B=0;--$%4>1&&u.charAt($)==="=";)++B;return Math.ceil(u.length*3)/4-B};for(var A=new Array(64),N=new Array(123),O=0;O<64;)N[A[O]=O<26?O+65:O<52?O+71:O<62?O-4:O-59|43]=O++;M.encode=function(u,$,B){for(var F=null,Z=[],K=0,J=0,Y;$<B;){var ae=u[$++];switch(J){case 0:Z[K++]=A[ae>>2],Y=(ae&3)<<4,J=1;break;case 1:Z[K++]=A[Y|ae>>4],Y=(ae&15)<<2,J=2;break;case 2:Z[K++]=A[Y|ae>>6],Z[K++]=A[ae&63],J=0;break}K>8191&&((F||(F=[])).push(String.fromCharCode.apply(String,Z)),K=0)}return J&&(Z[K++]=A[Y],Z[K++]=61,J===1&&(Z[K++]=61)),F?(K&&F.push(String.fromCharCode.apply(String,Z.slice(0,K))),F.join("")):String.fromCharCode.apply(String,Z.slice(0,K))};var C="invalid encoding";M.decode=function(u,$,B){for(var F=B,Z=0,K,J=0;J<u.length;){var Y=u.charCodeAt(J++);if(Y===61&&Z>1)break;if((Y=N[Y])===void 0)throw Error(C);switch(Z){case 0:K=Y,Z=1;break;case 1:$[B++]=K<<2|(Y&48)>>4,K=Y,Z=2;break;case 2:$[B++]=(K&15)<<4|(Y&60)>>2,K=Y,Z=3;break;case 3:$[B++]=(K&3)<<6|Y,Z=0;break}}if(Z===1)throw Error(C);return B-F},M.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=D;function D(){this._listeners={}}return D.prototype.on=function(A,N,O){return(this._listeners[A]||(this._listeners[A]=[])).push({fn:N,ctx:O||this}),this},D.prototype.off=function(A,N){if(A===void 0)this._listeners={};else if(N===void 0)this._listeners[A]=[];else for(var O=this._listeners[A],C=0;C<O.length;)O[C].fn===N?O.splice(C,1):++C;return this},D.prototype.emit=function(A){var N=this._listeners[A];if(N){for(var O=[],C=1;C<arguments.length;)O.push(arguments[C++]);for(C=0;C<N.length;)N[C].fn.apply(N[C++].ctx,O)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=D(D);function D(C){return typeof Float32Array<"u"?function(){var i=new Float32Array([-0]),u=new Uint8Array(i.buffer),$=u[3]===128;function B(J,Y,ae){i[0]=J,Y[ae]=u[0],Y[ae+1]=u[1],Y[ae+2]=u[2],Y[ae+3]=u[3]}function F(J,Y,ae){i[0]=J,Y[ae]=u[3],Y[ae+1]=u[2],Y[ae+2]=u[1],Y[ae+3]=u[0]}C.writeFloatLE=$?B:F,C.writeFloatBE=$?F:B;function Z(J,Y){return u[0]=J[Y],u[1]=J[Y+1],u[2]=J[Y+2],u[3]=J[Y+3],i[0]}function K(J,Y){return u[3]=J[Y],u[2]=J[Y+1],u[1]=J[Y+2],u[0]=J[Y+3],i[0]}C.readFloatLE=$?Z:K,C.readFloatBE=$?K:Z}():function(){function i($,B,F,Z){var K=B<0?1:0;if(K&&(B=-B),B===0)$(1/B>0?0:2147483648,F,Z);else if(isNaN(B))$(2143289344,F,Z);else if(B>34028234663852886e22)$((K<<31|2139095040)>>>0,F,Z);else if(B<11754943508222875e-54)$((K<<31|Math.round(B/1401298464324817e-60))>>>0,F,Z);else{var J=Math.floor(Math.log(B)/Math.LN2),Y=Math.round(B*Math.pow(2,-J)*8388608)&8388607;$((K<<31|J+127<<23|Y)>>>0,F,Z)}}C.writeFloatLE=i.bind(null,M),C.writeFloatBE=i.bind(null,A);function u($,B,F){var Z=$(B,F),K=(Z>>31)*2+1,J=Z>>>23&255,Y=Z&8388607;return J===255?Y?NaN:K*(1/0):J===0?K*1401298464324817e-60*Y:K*Math.pow(2,J-150)*(Y+8388608)}C.readFloatLE=u.bind(null,N),C.readFloatBE=u.bind(null,O)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),u=new Uint8Array(i.buffer),$=u[7]===128;function B(J,Y,ae){i[0]=J,Y[ae]=u[0],Y[ae+1]=u[1],Y[ae+2]=u[2],Y[ae+3]=u[3],Y[ae+4]=u[4],Y[ae+5]=u[5],Y[ae+6]=u[6],Y[ae+7]=u[7]}function F(J,Y,ae){i[0]=J,Y[ae]=u[7],Y[ae+1]=u[6],Y[ae+2]=u[5],Y[ae+3]=u[4],Y[ae+4]=u[3],Y[ae+5]=u[2],Y[ae+6]=u[1],Y[ae+7]=u[0]}C.writeDoubleLE=$?B:F,C.writeDoubleBE=$?F:B;function Z(J,Y){return u[0]=J[Y],u[1]=J[Y+1],u[2]=J[Y+2],u[3]=J[Y+3],u[4]=J[Y+4],u[5]=J[Y+5],u[6]=J[Y+6],u[7]=J[Y+7],i[0]}function K(J,Y){return u[7]=J[Y],u[6]=J[Y+1],u[5]=J[Y+2],u[4]=J[Y+3],u[3]=J[Y+4],u[2]=J[Y+5],u[1]=J[Y+6],u[0]=J[Y+7],i[0]}C.readDoubleLE=$?Z:K,C.readDoubleBE=$?K:Z}():function(){function i($,B,F,Z,K,J){var Y=Z<0?1:0;if(Y&&(Z=-Z),Z===0)$(0,K,J+B),$(1/Z>0?0:2147483648,K,J+F);else if(isNaN(Z))$(0,K,J+B),$(2146959360,K,J+F);else if(Z>17976931348623157e292)$(0,K,J+B),$((Y<<31|2146435072)>>>0,K,J+F);else{var ae;if(Z<22250738585072014e-324)ae=Z/5e-324,$(ae>>>0,K,J+B),$((Y<<31|ae/4294967296)>>>0,K,J+F);else{var oe=Math.floor(Math.log(Z)/Math.LN2);oe===1024&&(oe=1023),ae=Z*Math.pow(2,-oe),$(ae*4503599627370496>>>0,K,J+B),$((Y<<31|oe+1023<<20|ae*1048576&1048575)>>>0,K,J+F)}}}C.writeDoubleLE=i.bind(null,M,0,4),C.writeDoubleBE=i.bind(null,A,4,0);function u($,B,F,Z,K){var J=$(Z,K+B),Y=$(Z,K+F),ae=(Y>>31)*2+1,oe=Y>>>20&2047,ne=4294967296*(Y&1048575)+J;return oe===2047?ne?NaN:ae*(1/0):oe===0?ae*5e-324*ne:ae*Math.pow(2,oe-1075)*(ne+4503599627370496)}C.readDoubleLE=u.bind(null,N,0,4),C.readDoubleBE=u.bind(null,O,4,0)}(),C}function M(C,i,u){i[u]=C&255,i[u+1]=C>>>8&255,i[u+2]=C>>>16&255,i[u+3]=C>>>24}function A(C,i,u){i[u]=C>>>24,i[u+1]=C>>>16&255,i[u+2]=C>>>8&255,i[u+3]=C&255}function N(C,i){return(C[i]|C[i+1]<<8|C[i+2]<<16|C[i+3]<<24)>>>0}function O(C,i){return(C[i]<<24|C[i+1]<<16|C[i+2]<<8|C[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(D){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(D){var M=D;M.length=function(N){for(var O=0,C=0,i=0;i<N.length;++i)C=N.charCodeAt(i),C<128?O+=1:C<2048?O+=2:(C&64512)===55296&&(N.charCodeAt(i+1)&64512)===56320?(++i,O+=4):O+=3;return O},M.read=function(N,O,C){var i=C-O;if(i<1)return"";for(var u=null,$=[],B=0,F;O<C;)F=N[O++],F<128?$[B++]=F:F>191&&F<224?$[B++]=(F&31)<<6|N[O++]&63:F>239&&F<365?(F=((F&7)<<18|(N[O++]&63)<<12|(N[O++]&63)<<6|N[O++]&63)-65536,$[B++]=55296+(F>>10),$[B++]=56320+(F&1023)):$[B++]=(F&15)<<12|(N[O++]&63)<<6|N[O++]&63,B>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,$)),B=0);return u?(B&&u.push(String.fromCharCode.apply(String,$.slice(0,B))),u.join("")):String.fromCharCode.apply(String,$.slice(0,B))},M.write=function(N,O,C){for(var i=C,u,$,B=0;B<N.length;++B)u=N.charCodeAt(B),u<128?O[C++]=u:u<2048?(O[C++]=u>>6|192,O[C++]=u&63|128):(u&64512)===55296&&(($=N.charCodeAt(B+1))&64512)===56320?(u=65536+((u&1023)<<10)+($&1023),++B,O[C++]=u>>18|240,O[C++]=u>>12&63|128,O[C++]=u>>6&63|128,O[C++]=u&63|128):(O[C++]=u>>12|224,O[C++]=u>>6&63|128,O[C++]=u&63|128);return C-i}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=D;function D(M,A,N){var O=N||8192,C=O>>>1,i=null,u=O;return function(B){if(B<1||B>C)return M(B);u+B>O&&(i=M(O),u=0);var F=A.call(i,u,u+=B);return u&7&&(u=(u|7)+1),F}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=M;var D=requireMinimal$1();function M(C,i){this.lo=C>>>0,this.hi=i>>>0}var A=M.zero=new M(0,0);A.toNumber=function(){return 0},A.zzEncode=A.zzDecode=function(){return this},A.length=function(){return 1};var N=M.zeroHash="\0\0\0\0\0\0\0\0";M.fromNumber=function(i){if(i===0)return A;var u=i<0;u&&(i=-i);var $=i>>>0,B=(i-$)/4294967296>>>0;return u&&(B=~B>>>0,$=~$>>>0,++$>4294967295&&($=0,++B>4294967295&&(B=0))),new M($,B)},M.from=function(i){if(typeof i=="number")return M.fromNumber(i);if(D.isString(i))if(D.Long)i=D.Long.fromString(i);else return M.fromNumber(parseInt(i,10));return i.low||i.high?new M(i.low>>>0,i.high>>>0):A},M.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var u=~this.lo+1>>>0,$=~this.hi>>>0;return u||($=$+1>>>0),-(u+$*4294967296)}return this.lo+this.hi*4294967296},M.prototype.toLong=function(i){return D.Long?new D.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var O=String.prototype.charCodeAt;return M.fromHash=function(i){return i===N?A:new M((O.call(i,0)|O.call(i,1)<<8|O.call(i,2)<<16|O.call(i,3)<<24)>>>0,(O.call(i,4)|O.call(i,5)<<8|O.call(i,6)<<16|O.call(i,7)<<24)>>>0)},M.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)},M.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},M.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},M.prototype.length=function(){var i=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,$=this.hi>>>24;return $===0?u===0?i<16384?i<128?1:2:i<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:$<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(D){var M=D;M.asPromise=requireAspromise(),M.base64=requireBase64(),M.EventEmitter=requireEventemitter(),M.float=requireFloat(),M.inquire=requireInquire(),M.utf8=requireUtf8(),M.pool=requirePool(),M.LongBits=requireLongbits(),M.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),M.global=M.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,M.emptyArray=Object.freeze?Object.freeze([]):[],M.emptyObject=Object.freeze?Object.freeze({}):{},M.isInteger=Number.isInteger||function(C){return typeof C=="number"&&isFinite(C)&&Math.floor(C)===C},M.isString=function(C){return typeof C=="string"||C instanceof String},M.isObject=function(C){return C&&typeof C=="object"},M.isset=M.isSet=function(C,i){var u=C[i];return u!=null&&C.hasOwnProperty(i)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},M.Buffer=function(){try{var O=M.inquire("buffer").Buffer;return O.prototype.utf8Write?O:null}catch{return null}}(),M._Buffer_from=null,M._Buffer_allocUnsafe=null,M.newBuffer=function(C){return typeof C=="number"?M.Buffer?M._Buffer_allocUnsafe(C):new M.Array(C):M.Buffer?M._Buffer_from(C):typeof Uint8Array>"u"?C:new Uint8Array(C)},M.Array=typeof Uint8Array<"u"?Uint8Array:Array,M.Long=M.global.dcodeIO&&M.global.dcodeIO.Long||M.global.Long||M.inquire("long"),M.key2Re=/^true|false|0|1$/,M.key32Re=/^-?(?:0|[1-9][0-9]*)$/,M.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,M.longToHash=function(C){return C?M.LongBits.from(C).toHash():M.LongBits.zeroHash},M.longFromHash=function(C,i){var u=M.LongBits.fromHash(C);return M.Long?M.Long.fromBits(u.lo,u.hi,i):u.toNumber(!!i)};function A(O,C,i){for(var u=Object.keys(C),$=0;$<u.length;++$)(O[u[$]]===void 0||!i)&&(O[u[$]]=C[u[$]]);return O}M.merge=A,M.lcFirst=function(C){return C.charAt(0).toLowerCase()+C.substring(1)};function N(O){function C(i,u){if(!(this instanceof C))return new C(i,u);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,C):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&A(this,u)}return C.prototype=Object.create(Error.prototype,{constructor:{value:C,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return O},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),C}M.newError=N,M.ProtocolError=N("ProtocolError"),M.oneOfGetter=function(C){for(var i={},u=0;u<C.length;++u)i[C[u]]=1;return function(){for(var $=Object.keys(this),B=$.length-1;B>-1;--B)if(i[$[B]]===1&&this[$[B]]!==void 0&&this[$[B]]!==null)return $[B]}},M.oneOfSetter=function(C){return function(i){for(var u=0;u<C.length;++u)C[u]!==i&&delete this[C[u]]}},M.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},M._configure=function(){var O=M.Buffer;if(!O){M._Buffer_from=M._Buffer_allocUnsafe=null;return}M._Buffer_from=O.from!==Uint8Array.from&&O.from||function(i,u){return new O(i,u)},M._Buffer_allocUnsafe=O.allocUnsafe||function(i){return new O(i)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=$;var D=requireMinimal$1(),M,A=D.LongBits,N=D.base64,O=D.utf8;function C(oe,ne,ue){this.fn=oe,this.len=ne,this.next=void 0,this.val=ue}function i(){}function u(oe){this.head=oe.head,this.tail=oe.tail,this.len=oe.len,this.next=oe.states}function $(){this.len=0,this.head=new C(i,0,0),this.tail=this.head,this.states=null}var B=function(){return D.Buffer?function(){return($.create=function(){return new M})()}:function(){return new $}};$.create=B(),$.alloc=function(ne){return new D.Array(ne)},D.Array!==Array&&($.alloc=D.pool($.alloc,D.Array.prototype.subarray)),$.prototype._push=function(ne,ue,ye){return this.tail=this.tail.next=new C(ne,ue,ye),this.len+=ue,this};function F(oe,ne,ue){ne[ue]=oe&255}function Z(oe,ne,ue){for(;oe>127;)ne[ue++]=oe&127|128,oe>>>=7;ne[ue]=oe}function K(oe,ne){this.len=oe,this.next=void 0,this.val=ne}K.prototype=Object.create(C.prototype),K.prototype.fn=Z,$.prototype.uint32=function(ne){return this.len+=(this.tail=this.tail.next=new K((ne=ne>>>0)<128?1:ne<16384?2:ne<2097152?3:ne<268435456?4:5,ne)).len,this},$.prototype.int32=function(ne){return ne<0?this._push(J,10,A.fromNumber(ne)):this.uint32(ne)},$.prototype.sint32=function(ne){return this.uint32((ne<<1^ne>>31)>>>0)};function J(oe,ne,ue){for(;oe.hi;)ne[ue++]=oe.lo&127|128,oe.lo=(oe.lo>>>7|oe.hi<<25)>>>0,oe.hi>>>=7;for(;oe.lo>127;)ne[ue++]=oe.lo&127|128,oe.lo=oe.lo>>>7;ne[ue++]=oe.lo}$.prototype.uint64=function(ne){var ue=A.from(ne);return this._push(J,ue.length(),ue)},$.prototype.int64=$.prototype.uint64,$.prototype.sint64=function(ne){var ue=A.from(ne).zzEncode();return this._push(J,ue.length(),ue)},$.prototype.bool=function(ne){return this._push(F,1,ne?1:0)};function Y(oe,ne,ue){ne[ue]=oe&255,ne[ue+1]=oe>>>8&255,ne[ue+2]=oe>>>16&255,ne[ue+3]=oe>>>24}$.prototype.fixed32=function(ne){return this._push(Y,4,ne>>>0)},$.prototype.sfixed32=$.prototype.fixed32,$.prototype.fixed64=function(ne){var ue=A.from(ne);return this._push(Y,4,ue.lo)._push(Y,4,ue.hi)},$.prototype.sfixed64=$.prototype.fixed64,$.prototype.float=function(ne){return this._push(D.float.writeFloatLE,4,ne)},$.prototype.double=function(ne){return this._push(D.float.writeDoubleLE,8,ne)};var ae=D.Array.prototype.set?function(ne,ue,ye){ue.set(ne,ye)}:function(ne,ue,ye){for(var te=0;te<ne.length;++te)ue[ye+te]=ne[te]};return $.prototype.bytes=function(ne){var ue=ne.length>>>0;if(!ue)return this._push(F,1,0);if(D.isString(ne)){var ye=$.alloc(ue=N.length(ne));N.decode(ne,ye,0),ne=ye}return this.uint32(ue)._push(ae,ue,ne)},$.prototype.string=function(ne){var ue=O.length(ne);return ue?this.uint32(ue)._push(O.write,ue,ne):this._push(F,1,0)},$.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new C(i,0,0),this.len=0,this},$.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new C(i,0,0),this.len=0),this},$.prototype.ldelim=function(){var ne=this.head,ue=this.tail,ye=this.len;return this.reset().uint32(ye),ye&&(this.tail.next=ne.next,this.tail=ue,this.len+=ye),this},$.prototype.finish=function(){for(var ne=this.head.next,ue=this.constructor.alloc(this.len),ye=0;ne;)ne.fn(ne.val,ue,ye),ye+=ne.len,ne=ne.next;return ue},$._configure=function(oe){M=oe,$.create=B(),M._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=A;var D=requireWriter();(A.prototype=Object.create(D.prototype)).constructor=A;var M=requireMinimal$1();function A(){D.call(this)}A._configure=function(){A.alloc=M._Buffer_allocUnsafe,A.writeBytesBuffer=M.Buffer&&M.Buffer.prototype instanceof Uint8Array&&M.Buffer.prototype.set.name==="set"?function(C,i,u){i.set(C,u)}:function(C,i,u){if(C.copy)C.copy(i,u,0,C.length);else for(var $=0;$<C.length;)i[u++]=C[$++]}},A.prototype.bytes=function(C){M.isString(C)&&(C=M._Buffer_from(C,"base64"));var i=C.length>>>0;return this.uint32(i),i&&this._push(A.writeBytesBuffer,i,C),this};function N(O,C,i){O.length<40?M.utf8.write(O,C,i):C.utf8Write?C.utf8Write(O,i):C.write(O,i)}return A.prototype.string=function(C){var i=M.Buffer.byteLength(C);return this.uint32(i),i&&this._push(N,i,C),this},A._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=C;var D=requireMinimal$1(),M,A=D.LongBits,N=D.utf8;function O(Z,K){return RangeError("index out of range: "+Z.pos+" + "+(K||1)+" > "+Z.len)}function C(Z){this.buf=Z,this.pos=0,this.len=Z.length}var i=typeof Uint8Array<"u"?function(K){if(K instanceof Uint8Array||Array.isArray(K))return new C(K);throw Error("illegal buffer")}:function(K){if(Array.isArray(K))return new C(K);throw Error("illegal buffer")},u=function(){return D.Buffer?function(J){return(C.create=function(ae){return D.Buffer.isBuffer(ae)?new M(ae):i(ae)})(J)}:i};C.create=u(),C.prototype._slice=D.Array.prototype.subarray||D.Array.prototype.slice,C.prototype.uint32=function(){var K=4294967295;return function(){if(K=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(K=(K|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return K;if((this.pos+=5)>this.len)throw this.pos=this.len,O(this,10);return K}}(),C.prototype.int32=function(){return this.uint32()|0},C.prototype.sint32=function(){var K=this.uint32();return K>>>1^-(K&1)|0};function $(){var Z=new A(0,0),K=0;if(this.len-this.pos>4){for(;K<4;++K)if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return Z;if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<28)>>>0,Z.hi=(Z.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return Z;K=0}else{for(;K<3;++K){if(this.pos>=this.len)throw O(this);if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return Z}return Z.lo=(Z.lo|(this.buf[this.pos++]&127)<<K*7)>>>0,Z}if(this.len-this.pos>4){for(;K<5;++K)if(Z.hi=(Z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return Z}else for(;K<5;++K){if(this.pos>=this.len)throw O(this);if(Z.hi=(Z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return Z}throw Error("invalid varint encoding")}C.prototype.bool=function(){return this.uint32()!==0};function B(Z,K){return(Z[K-4]|Z[K-3]<<8|Z[K-2]<<16|Z[K-1]<<24)>>>0}C.prototype.fixed32=function(){if(this.pos+4>this.len)throw O(this,4);return B(this.buf,this.pos+=4)},C.prototype.sfixed32=function(){if(this.pos+4>this.len)throw O(this,4);return B(this.buf,this.pos+=4)|0};function F(){if(this.pos+8>this.len)throw O(this,8);return new A(B(this.buf,this.pos+=4),B(this.buf,this.pos+=4))}return C.prototype.float=function(){if(this.pos+4>this.len)throw O(this,4);var K=D.float.readFloatLE(this.buf,this.pos);return this.pos+=4,K},C.prototype.double=function(){if(this.pos+8>this.len)throw O(this,4);var K=D.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,K},C.prototype.bytes=function(){var K=this.uint32(),J=this.pos,Y=this.pos+K;if(Y>this.len)throw O(this,K);if(this.pos+=K,Array.isArray(this.buf))return this.buf.slice(J,Y);if(J===Y){var ae=D.Buffer;return ae?ae.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,J,Y)},C.prototype.string=function(){var K=this.bytes();return N.read(K,0,K.length)},C.prototype.skip=function(K){if(typeof K=="number"){if(this.pos+K>this.len)throw O(this,K);this.pos+=K}else do if(this.pos>=this.len)throw O(this);while(this.buf[this.pos++]&128);return this},C.prototype.skipType=function(Z){switch(Z){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(Z=this.uint32()&7)!==4;)this.skipType(Z);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+Z+" at offset "+this.pos)}return this},C._configure=function(Z){M=Z,C.create=u(),M._configure();var K=D.Long?"toLong":"toNumber";D.merge(C.prototype,{int64:function(){return $.call(this)[K](!1)},uint64:function(){return $.call(this)[K](!0)},sint64:function(){return $.call(this).zzDecode()[K](!1)},fixed64:function(){return F.call(this)[K](!0)},sfixed64:function(){return F.call(this)[K](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=A;var D=requireReader();(A.prototype=Object.create(D.prototype)).constructor=A;var M=requireMinimal$1();function A(N){D.call(this,N)}return A._configure=function(){M.Buffer&&(A.prototype._slice=M.Buffer.prototype.slice)},A.prototype.string=function(){var O=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+O,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+O,this.len))},A._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=M;var D=requireMinimal$1();(M.prototype=Object.create(D.EventEmitter.prototype)).constructor=M;function M(A,N,O){if(typeof A!="function")throw TypeError("rpcImpl must be a function");D.EventEmitter.call(this),this.rpcImpl=A,this.requestDelimited=!!N,this.responseDelimited=!!O}return M.prototype.rpcCall=function A(N,O,C,i,u){if(!i)throw TypeError("request must be specified");var $=this;if(!u)return D.asPromise(A,$,N,O,C,i);if(!$.rpcImpl){setTimeout(function(){u(Error("already ended"))},0);return}try{return $.rpcImpl(N,O[$.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(F,Z){if(F)return $.emit("error",F,N),u(F);if(Z===null){$.end(!0);return}if(!(Z instanceof C))try{Z=C[$.responseDelimited?"decodeDelimited":"decode"](Z)}catch(K){return $.emit("error",K,N),u(K)}return $.emit("data",Z,N),u(null,Z)})}catch(B){$.emit("error",B,N),setTimeout(function(){u(B)},0);return}},M.prototype.end=function(N){return this.rpcImpl&&(N||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(D){var M=D;M.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(D){var M=D;M.build="minimal",M.Writer=requireWriter(),M.BufferWriter=requireWriter_buffer(),M.Reader=requireReader(),M.BufferReader=requireReader_buffer(),M.util=requireMinimal$1(),M.rpc=requireRpc(),M.roots=requireRoots(),M.configure=A;function A(){M.util._configure(),M.Writer._configure(M.BufferWriter),M.Reader._configure(M.BufferReader)}A()}(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 D={};return D.quick=function(){const M={};return M.voice=function(){const A={};return A.proto=function(){const N={};return N.CommonReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.event="",O.prototype.data=$util.newBuffer([]),O.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.version=0,O.prototype.compress=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&u.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&u.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&u.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&u.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&u.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&u.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&u.uint32(56).bool(i.compress),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.event=i.string();break}case 2:{B.data=i.bytes();break}case 3:{B.sn=i.int64();break}case 4:{B.time=i.int64();break}case 5:{B.valid=i.int64();break}case 6:{B.version=i.int32();break}case 7:{B.compress=i.bool();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let u=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(u.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,u.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(u.data=i.data)),i.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?u.sn=parseInt(i.sn,10):typeof i.sn=="number"?u.sn=i.sn:typeof i.sn=="object"&&(u.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(u.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?u.time=parseInt(i.time,10):typeof i.time=="number"?u.time=i.time:typeof i.time=="object"&&(u.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?u.valid=parseInt(i.valid,10):typeof i.valid=="number"?u.valid=i.valid:typeof i.valid=="object"&&(u.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(u.version=i.version|0),i.compress!=null&&(u.compress=!!i.compress),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults){if($.event="",u.bytes===String?$.data="":($.data=[],u.bytes!==Array&&($.data=$util.newBuffer($.data))),$util.Long){let B=new $util.Long(0,0,!1);$.sn=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.sn=u.longs===String?"0":0;if($util.Long){let B=new $util.Long(0,0,!1);$.time=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.time=u.longs===String?"0":0;if($util.Long){let B=new $util.Long(0,0,!1);$.valid=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.valid=u.longs===String?"0":0;$.version=0,$.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&($.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&($.data=u.bytes===String?$util.base64.encode(i.data,0,i.data.length):u.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?$.sn=u.longs===String?String(i.sn):i.sn:$.sn=u.longs===String?$util.Long.prototype.toString.call(i.sn):u.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"?$.time=u.longs===String?String(i.time):i.time:$.time=u.longs===String?$util.Long.prototype.toString.call(i.time):u.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"?$.valid=u.longs===String?String(i.valid):i.valid:$.valid=u.longs===String?$util.Long.prototype.toString.call(i.valid):u.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&($.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&($.compress=i.compress),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},O}(),N.CommonRsp=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.event="",O.prototype.data=$util.newBuffer([]),O.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.code=0,O.prototype.desc="",O.prototype.version=0,O.prototype.compress=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&u.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&u.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&u.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&u.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&u.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&u.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&u.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&u.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&u.uint32(72).bool(i.compress),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.event=i.string();break}case 2:{B.data=i.bytes();break}case 3:{B.sn=i.int64();break}case 4:{B.time=i.int64();break}case 5:{B.valid=i.int64();break}case 6:{B.code=i.int32();break}case 7:{B.desc=i.string();break}case 8:{B.version=i.int32();break}case 9:{B.compress=i.bool();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let u=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(u.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,u.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(u.data=i.data)),i.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?u.sn=parseInt(i.sn,10):typeof i.sn=="number"?u.sn=i.sn:typeof i.sn=="object"&&(u.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(u.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?u.time=parseInt(i.time,10):typeof i.time=="number"?u.time=i.time:typeof i.time=="object"&&(u.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?u.valid=parseInt(i.valid,10):typeof i.valid=="number"?u.valid=i.valid:typeof i.valid=="object"&&(u.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(u.code=i.code|0),i.desc!=null&&(u.desc=String(i.desc)),i.version!=null&&(u.version=i.version|0),i.compress!=null&&(u.compress=!!i.compress),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults){if($.event="",u.bytes===String?$.data="":($.data=[],u.bytes!==Array&&($.data=$util.newBuffer($.data))),$util.Long){let B=new $util.Long(0,0,!1);$.sn=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.sn=u.longs===String?"0":0;if($util.Long){let B=new $util.Long(0,0,!1);$.time=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.time=u.longs===String?"0":0;if($util.Long){let B=new $util.Long(0,0,!1);$.valid=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.valid=u.longs===String?"0":0;$.code=0,$.desc="",$.version=0,$.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&($.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&($.data=u.bytes===String?$util.base64.encode(i.data,0,i.data.length):u.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?$.sn=u.longs===String?String(i.sn):i.sn:$.sn=u.longs===String?$util.Long.prototype.toString.call(i.sn):u.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"?$.time=u.longs===String?String(i.time):i.time:$.time=u.longs===String?$util.Long.prototype.toString.call(i.time):u.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"?$.valid=u.longs===String?String(i.valid):i.valid:$.valid=u.longs===String?$util.Long.prototype.toString.call(i.valid):u.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&($.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&($.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&($.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&($.compress=i.compress),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},O}(),N.User=function(){function O(i){if(this.tracks=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.id="",O.prototype.callAction=null,O.prototype.callState=null,O.prototype.joinTime=null,O.prototype.tracks=$util.emptyArray,O.prototype.permissions=null,O.prototype.isPublished=null,O.prototype.behavior=null,O.prototype.channelCache=null;let C;return Object.defineProperty(O.prototype,"_callAction",{get:$util.oneOfGetter(C=["callAction"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_callState",{get:$util.oneOfGetter(C=["callState"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_joinTime",{get:$util.oneOfGetter(C=["joinTime"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_permissions",{get:$util.oneOfGetter(C=["permissions"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_isPublished",{get:$util.oneOfGetter(C=["isPublished"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_behavior",{get:$util.oneOfGetter(C=["behavior"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_channelCache",{get:$util.oneOfGetter(C=["channelCache"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.id!=null&&Object.hasOwnProperty.call(u,"id")&&$.uint32(10).string(u.id),u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&$.uint32(16).int32(u.callAction),u.callState!=null&&Object.hasOwnProperty.call(u,"callState")&&$.uint32(24).int32(u.callState),u.joinTime!=null&&Object.hasOwnProperty.call(u,"joinTime")&&$.uint32(32).int64(u.joinTime),u.tracks!=null&&u.tracks.length)for(let B=0;B<u.tracks.length;++B)$root.com.quick.voice.proto.Track.encode(u.tracks[B],$.uint32(42).fork()).ldelim();return u.permissions!=null&&Object.hasOwnProperty.call(u,"permissions")&&$.uint32(48).int32(u.permissions),u.isPublished!=null&&Object.hasOwnProperty.call(u,"isPublished")&&$.uint32(56).bool(u.isPublished),u.behavior!=null&&Object.hasOwnProperty.call(u,"behavior")&&$.uint32(64).int32(u.behavior),u.channelCache!=null&&Object.hasOwnProperty.call(u,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(u.channelCache,$.uint32(74).fork()).ldelim(),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.User;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.id=u.string();break}case 2:{F.callAction=u.int32();break}case 3:{F.callState=u.int32();break}case 4:{F.joinTime=u.int64();break}case 5:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 6:{F.permissions=u.int32();break}case 7:{F.isPublished=u.bool();break}case 8:{F.behavior=u.int32();break}case 9:{F.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(u,u.uint32());break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.id!=null&&u.hasOwnProperty("id")&&!$util.isString(u.id))return"id: string expected";if(u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction))return"callAction: integer expected";if(u.callState!=null&&u.hasOwnProperty("callState")&&!$util.isInteger(u.callState))return"callState: integer expected";if(u.joinTime!=null&&u.hasOwnProperty("joinTime")&&!$util.isInteger(u.joinTime)&&!(u.joinTime&&$util.isInteger(u.joinTime.low)&&$util.isInteger(u.joinTime.high)))return"joinTime: integer|Long expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let $=0;$<u.tracks.length;++$){let B=$root.com.quick.voice.proto.Track.verify(u.tracks[$]);if(B)return"tracks."+B}}if(u.permissions!=null&&u.hasOwnProperty("permissions")&&!$util.isInteger(u.permissions))return"permissions: integer expected";if(u.isPublished!=null&&u.hasOwnProperty("isPublished")&&typeof u.isPublished!="boolean")return"isPublished: boolean expected";if(u.behavior!=null&&u.hasOwnProperty("behavior")&&!$util.isInteger(u.behavior))return"behavior: integer expected";if(u.channelCache!=null&&u.hasOwnProperty("channelCache")){let $=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(u.channelCache);if($)return"channelCache."+$}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.User)return u;let $=new $root.com.quick.voice.proto.User;if(u.id!=null&&($.id=String(u.id)),u.callAction!=null&&($.callAction=u.callAction|0),u.callState!=null&&($.callState=u.callState|0),u.joinTime!=null&&($util.Long?($.joinTime=$util.Long.fromValue(u.joinTime)).unsigned=!1:typeof u.joinTime=="string"?$.joinTime=parseInt(u.joinTime,10):typeof u.joinTime=="number"?$.joinTime=u.joinTime:typeof u.joinTime=="object"&&($.joinTime=new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber())),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");$.tracks=[];for(let B=0;B<u.tracks.length;++B){if(typeof u.tracks[B]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");$.tracks[B]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[B])}}if(u.permissions!=null&&($.permissions=u.permissions|0),u.isPublished!=null&&($.isPublished=!!u.isPublished),u.behavior!=null&&($.behavior=u.behavior|0),u.channelCache!=null){if(typeof u.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");$.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(u.channelCache)}return $},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.tracks=[]),$.defaults&&(B.id=""),u.id!=null&&u.hasOwnProperty("id")&&(B.id=u.id),u.callAction!=null&&u.hasOwnProperty("callAction")&&(B.callAction=u.callAction,$.oneofs&&(B._callAction="callAction")),u.callState!=null&&u.hasOwnProperty("callState")&&(B.callState=u.callState,$.oneofs&&(B._callState="callState")),u.joinTime!=null&&u.hasOwnProperty("joinTime")&&(typeof u.joinTime=="number"?B.joinTime=$.longs===String?String(u.joinTime):u.joinTime:B.joinTime=$.longs===String?$util.Long.prototype.toString.call(u.joinTime):$.longs===Number?new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber():u.joinTime,$.oneofs&&(B._joinTime="joinTime")),u.tracks&&u.tracks.length){B.tracks=[];for(let F=0;F<u.tracks.length;++F)B.tracks[F]=$root.com.quick.voice.proto.Track.toObject(u.tracks[F],$)}return u.permissions!=null&&u.hasOwnProperty("permissions")&&(B.permissions=u.permissions,$.oneofs&&(B._permissions="permissions")),u.isPublished!=null&&u.hasOwnProperty("isPublished")&&(B.isPublished=u.isPublished,$.oneofs&&(B._isPublished="isPublished")),u.behavior!=null&&u.hasOwnProperty("behavior")&&(B.behavior=u.behavior,$.oneofs&&(B._behavior="behavior")),u.channelCache!=null&&u.hasOwnProperty("channelCache")&&(B.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(u.channelCache,$),$.oneofs&&(B._channelCache="channelCache")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.User"},O}(),N.DataChannelCacheInfo=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.channels&&B.channels.length||(B.channels=[]),B.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let B=0;B<i.channels.length;++B)$.channels[B]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},O}(),N.DataChannel=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.dataChannelName="",O.prototype.id=null;let C;return Object.defineProperty(O.prototype,"_id",{get:$util.oneOfGetter(C=["id"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.dataChannelName!=null&&Object.hasOwnProperty.call(u,"dataChannelName")&&$.uint32(10).string(u.dataChannelName),u.id!=null&&Object.hasOwnProperty.call(u,"id")&&$.uint32(16).int32(u.id),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.DataChannel;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.dataChannelName=u.string();break}case 2:{F.id=u.int32();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){return typeof u!="object"||u===null?"object expected":u.dataChannelName!=null&&u.hasOwnProperty("dataChannelName")&&!$util.isString(u.dataChannelName)?"dataChannelName: string expected":u.id!=null&&u.hasOwnProperty("id")&&!$util.isInteger(u.id)?"id: integer expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.DataChannel)return u;let $=new $root.com.quick.voice.proto.DataChannel;return u.dataChannelName!=null&&($.dataChannelName=String(u.dataChannelName)),u.id!=null&&($.id=u.id|0),$},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&(B.dataChannelName=""),u.dataChannelName!=null&&u.hasOwnProperty("dataChannelName")&&(B.dataChannelName=u.dataChannelName),u.id!=null&&u.hasOwnProperty("id")&&(B.id=u.id,$.oneofs&&(B._id="id")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.DataChannel"},O}(),N.Login=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.appid="",O.prototype.userId="",O.prototype.sdkToken="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&u.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&u.uint32(26).string(i.sdkToken),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.Login;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.appid=i.string();break}case 2:{B.userId=i.string();break}case 3:{B.sdkToken=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let u=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(u.appid=String(i.appid)),i.userId!=null&&(u.userId=String(i.userId)),i.sdkToken!=null&&(u.sdkToken=String(i.sdkToken)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.appid="",$.userId="",$.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&($.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&($.sdkToken=i.sdkToken),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},O}(),N.Track=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.mid="",O.prototype.trackName=null,O.prototype.location=null,O.prototype.userId=null,O.prototype.code=null,O.prototype.desc=null,O.prototype.type=null,O.prototype.isValid=null,O.prototype.simulcast=null,O.prototype.lastRetry=null;let C;return Object.defineProperty(O.prototype,"_trackName",{get:$util.oneOfGetter(C=["trackName"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_location",{get:$util.oneOfGetter(C=["location"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_userId",{get:$util.oneOfGetter(C=["userId"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_code",{get:$util.oneOfGetter(C=["code"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_desc",{get:$util.oneOfGetter(C=["desc"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_type",{get:$util.oneOfGetter(C=["type"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_isValid",{get:$util.oneOfGetter(C=["isValid"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_simulcast",{get:$util.oneOfGetter(C=["simulcast"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_lastRetry",{get:$util.oneOfGetter(C=["lastRetry"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.mid!=null&&Object.hasOwnProperty.call(u,"mid")&&$.uint32(10).string(u.mid),u.trackName!=null&&Object.hasOwnProperty.call(u,"trackName")&&$.uint32(18).string(u.trackName),u.location!=null&&Object.hasOwnProperty.call(u,"location")&&$.uint32(26).string(u.location),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&$.uint32(34).string(u.userId),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&$.uint32(40).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&$.uint32(50).string(u.desc),u.type!=null&&Object.hasOwnProperty.call(u,"type")&&$.uint32(56).int32(u.type),u.isValid!=null&&Object.hasOwnProperty.call(u,"isValid")&&$.uint32(64).bool(u.isValid),u.simulcast!=null&&Object.hasOwnProperty.call(u,"simulcast")&&$.uint32(74).string(u.simulcast),u.lastRetry!=null&&Object.hasOwnProperty.call(u,"lastRetry")&&$.uint32(80).bool(u.lastRetry),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.Track;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.mid=u.string();break}case 2:{F.trackName=u.string();break}case 3:{F.location=u.string();break}case 4:{F.userId=u.string();break}case 5:{F.code=u.int32();break}case 6:{F.desc=u.string();break}case 7:{F.type=u.int32();break}case 8:{F.isValid=u.bool();break}case 9:{F.simulcast=u.string();break}case 10:{F.lastRetry=u.bool();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.mid!=null&&u.hasOwnProperty("mid")&&!$util.isString(u.mid))return"mid: string expected";if(u.trackName!=null&&u.hasOwnProperty("trackName")&&!$util.isString(u.trackName))return"trackName: string expected";if(u.location!=null&&u.hasOwnProperty("location")&&!$util.isString(u.location))return"location: string expected";if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code))return"code: integer expected";if(u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc))return"desc: string expected";if(u.type!=null&&u.hasOwnProperty("type"))switch(u.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return u.isValid!=null&&u.hasOwnProperty("isValid")&&typeof u.isValid!="boolean"?"isValid: boolean expected":u.simulcast!=null&&u.hasOwnProperty("simulcast")&&!$util.isString(u.simulcast)?"simulcast: string expected":u.lastRetry!=null&&u.hasOwnProperty("lastRetry")&&typeof u.lastRetry!="boolean"?"lastRetry: boolean expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.Track)return u;let $=new $root.com.quick.voice.proto.Track;switch(u.mid!=null&&($.mid=String(u.mid)),u.trackName!=null&&($.trackName=String(u.trackName)),u.location!=null&&($.location=String(u.location)),u.userId!=null&&($.userId=String(u.userId)),u.code!=null&&($.code=u.code|0),u.desc!=null&&($.desc=String(u.desc)),u.type){default:if(typeof u.type=="number"){$.type=u.type;break}break;case"Microphone":case 0:$.type=0;break;case"Camera":case 1:$.type=1;break;case"Screen":case 2:$.type=2;break;case"SystemVoice":case 3:$.type=3;break}return u.isValid!=null&&($.isValid=!!u.isValid),u.simulcast!=null&&($.simulcast=String(u.simulcast)),u.lastRetry!=null&&($.lastRetry=!!u.lastRetry),$},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&(B.mid=""),u.mid!=null&&u.hasOwnProperty("mid")&&(B.mid=u.mid),u.trackName!=null&&u.hasOwnProperty("trackName")&&(B.trackName=u.trackName,$.oneofs&&(B._trackName="trackName")),u.location!=null&&u.hasOwnProperty("location")&&(B.location=u.location,$.oneofs&&(B._location="location")),u.userId!=null&&u.hasOwnProperty("userId")&&(B.userId=u.userId,$.oneofs&&(B._userId="userId")),u.code!=null&&u.hasOwnProperty("code")&&(B.code=u.code,$.oneofs&&(B._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(B.desc=u.desc,$.oneofs&&(B._desc="desc")),u.type!=null&&u.hasOwnProperty("type")&&(B.type=$.enums===String?$root.com.quick.voice.proto.TrackType[u.type]===void 0?u.type:$root.com.quick.voice.proto.TrackType[u.type]:u.type,$.oneofs&&(B._type="type")),u.isValid!=null&&u.hasOwnProperty("isValid")&&(B.isValid=u.isValid,$.oneofs&&(B._isValid="isValid")),u.simulcast!=null&&u.hasOwnProperty("simulcast")&&(B.simulcast=u.simulcast,$.oneofs&&(B._simulcast="simulcast")),u.lastRetry!=null&&u.hasOwnProperty("lastRetry")&&(B.lastRetry=u.lastRetry,$.oneofs&&(B._lastRetry="lastRetry")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.Track"},O}(),N.JoinReq=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.callType=0,O.prototype.token=null;let C;return Object.defineProperty(O.prototype,"_token",{get:$util.oneOfGetter(C=["token"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,$.uint32(18).fork()).ldelim(),u.callType!=null&&Object.hasOwnProperty.call(u,"callType")&&$.uint32(24).int32(u.callType),u.token!=null&&Object.hasOwnProperty.call(u,"token")&&$.uint32(34).string(u.token),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.JoinReq;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.callType=u.int32();break}case 4:{F.token=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(u.user);if($)return"user."+$}if(u.callType!=null&&u.hasOwnProperty("callType"))switch(u.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return u.token!=null&&u.hasOwnProperty("token")&&!$util.isString(u.token)?"token: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.JoinReq)return u;let $=new $root.com.quick.voice.proto.JoinReq;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(u.user)}switch(u.callType){default:if(typeof u.callType=="number"){$.callType=u.callType;break}break;case"Normal":case 0:$.callType=0;break;case"Meeting":case 1:$.callType=1;break;case"Live":case 2:$.callType=2;break}return u.token!=null&&($.token=String(u.token)),$},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&(B.roomId="",B.user=null,B.callType=$.enums===String?"Normal":0),u.roomId!=null&&u.hasOwnProperty("roomId")&&(B.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(B.user=$root.com.quick.voice.proto.User.toObject(u.user,$)),u.callType!=null&&u.hasOwnProperty("callType")&&(B.callType=$.enums===String?$root.com.quick.voice.proto.CallType[u.callType]===void 0?u.callType:$root.com.quick.voice.proto.CallType[u.callType]:u.callType),u.token!=null&&u.hasOwnProperty("token")&&(B.token=u.token,$.oneofs&&(B._token="token")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.JoinReq"},O}(),N.JoinRsp=function(){function O(C){if(this.roomUsers=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.roomUsers=$util.emptyArray,O.prototype.callType=0,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let $=0;$<i.roomUsers.length;++$)$root.com.quick.voice.proto.User.encode(i.roomUsers[$],u.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&u.uint32(24).int32(i.callType),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.roomUsers&&B.roomUsers.length||(B.roomUsers=[]),B.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{B.callType=i.int32();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.roomUsers.length;++u){let $=$root.com.quick.voice.proto.User.verify(i.roomUsers[u]);if($)return"roomUsers."+$}}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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let u=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");u.roomUsers=[];for(let $=0;$<i.roomUsers.length;++$){if(typeof i.roomUsers[$]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");u.roomUsers[$]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[$])}}switch(i.callType){default:if(typeof i.callType=="number"){u.callType=i.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.roomUsers=[]),u.defaults&&($.roomId="",$.callType=u.enums===String?"Normal":0),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){$.roomUsers=[];for(let B=0;B<i.roomUsers.length;++B)$.roomUsers[B]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[B],u)}return i.callType!=null&&i.hasOwnProperty("callType")&&($.callType=u.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},O}(),N.JoinNotify=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let u=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},O}(),N.ConnectCFReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sdp="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(10).string(i.sdp),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.sdp=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let u=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(u.sdp=String(i.sdp)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},O}(),N.ConnectCFRsp=function(){function O(i){if(this.subscribeUsers=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.remoteSdp="",O.prototype.subscribeUsers=$util.emptyArray,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.remoteSdp!=null&&Object.hasOwnProperty.call(u,"remoteSdp")&&$.uint32(10).string(u.remoteSdp),u.subscribeUsers!=null&&u.subscribeUsers.length)for(let B=0;B<u.subscribeUsers.length;++B)$root.com.quick.voice.proto.User.encode(u.subscribeUsers[B],$.uint32(18).fork()).ldelim();return u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(26).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.ConnectCFRsp;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.remoteSdp=u.string();break}case 2:{F.subscribeUsers&&F.subscribeUsers.length||(F.subscribeUsers=[]),F.subscribeUsers.push($root.com.quick.voice.proto.User.decode(u,u.uint32()));break}case 3:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&!$util.isString(u.remoteSdp))return"remoteSdp: string expected";if(u.subscribeUsers!=null&&u.hasOwnProperty("subscribeUsers")){if(!Array.isArray(u.subscribeUsers))return"subscribeUsers: array expected";for(let $=0;$<u.subscribeUsers.length;++$){let B=$root.com.quick.voice.proto.User.verify(u.subscribeUsers[$]);if(B)return"subscribeUsers."+B}}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.ConnectCFRsp)return u;let $=new $root.com.quick.voice.proto.ConnectCFRsp;if(u.remoteSdp!=null&&($.remoteSdp=String(u.remoteSdp)),u.subscribeUsers){if(!Array.isArray(u.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");$.subscribeUsers=[];for(let B=0;B<u.subscribeUsers.length;++B){if(typeof u.subscribeUsers[B]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");$.subscribeUsers[B]=$root.com.quick.voice.proto.User.fromObject(u.subscribeUsers[B])}}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.subscribeUsers=[]),$.defaults&&(B.remoteSdp=""),u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&(B.remoteSdp=u.remoteSdp),u.subscribeUsers&&u.subscribeUsers.length){B.subscribeUsers=[];for(let F=0;F<u.subscribeUsers.length;++F)B.subscribeUsers[F]=$root.com.quick.voice.proto.User.toObject(u.subscribeUsers[F],$)}return u.session!=null&&u.hasOwnProperty("session")&&(B.session=u.session,$.oneofs&&(B._session="session")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.ConnectCFRsp"},O}(),N.PublishReq=function(){function O(i){if(this.tracks=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.sdp="",O.prototype.tracks=$util.emptyArray,O.prototype.callAction=0,O.prototype.recreate=null,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_recreate",{get:$util.oneOfGetter(C=["recreate"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.sdp!=null&&Object.hasOwnProperty.call(u,"sdp")&&$.uint32(10).string(u.sdp),u.tracks!=null&&u.tracks.length)for(let B=0;B<u.tracks.length;++B)$root.com.quick.voice.proto.Track.encode(u.tracks[B],$.uint32(18).fork()).ldelim();return u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&$.uint32(24).int32(u.callAction),u.recreate!=null&&Object.hasOwnProperty.call(u,"recreate")&&$.uint32(32).bool(u.recreate),u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(42).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.PublishReq;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.sdp=u.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 3:{F.callAction=u.int32();break}case 4:{F.recreate=u.bool();break}case 5:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.sdp!=null&&u.hasOwnProperty("sdp")&&!$util.isString(u.sdp))return"sdp: string expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let $=0;$<u.tracks.length;++$){let B=$root.com.quick.voice.proto.Track.verify(u.tracks[$]);if(B)return"tracks."+B}}return u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction)?"callAction: integer expected":u.recreate!=null&&u.hasOwnProperty("recreate")&&typeof u.recreate!="boolean"?"recreate: boolean expected":u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishReq)return u;let $=new $root.com.quick.voice.proto.PublishReq;if(u.sdp!=null&&($.sdp=String(u.sdp)),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");$.tracks=[];for(let B=0;B<u.tracks.length;++B){if(typeof u.tracks[B]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");$.tracks[B]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[B])}}return u.callAction!=null&&($.callAction=u.callAction|0),u.recreate!=null&&($.recreate=!!u.recreate),u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.tracks=[]),$.defaults&&(B.sdp="",B.callAction=0),u.sdp!=null&&u.hasOwnProperty("sdp")&&(B.sdp=u.sdp),u.tracks&&u.tracks.length){B.tracks=[];for(let F=0;F<u.tracks.length;++F)B.tracks[F]=$root.com.quick.voice.proto.Track.toObject(u.tracks[F],$)}return u.callAction!=null&&u.hasOwnProperty("callAction")&&(B.callAction=u.callAction),u.recreate!=null&&u.hasOwnProperty("recreate")&&(B.recreate=u.recreate,$.oneofs&&(B._recreate="recreate")),u.session!=null&&u.hasOwnProperty("session")&&(B.session=u.session,$.oneofs&&(B._session="session")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishReq"},O}(),N.PublishRsp=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.remoteSdp="",O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.remoteSdp!=null&&Object.hasOwnProperty.call(u,"remoteSdp")&&$.uint32(10).string(u.remoteSdp),u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(18).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.PublishRsp;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.remoteSdp=u.string();break}case 2:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){return typeof u!="object"||u===null?"object expected":u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&!$util.isString(u.remoteSdp)?"remoteSdp: string expected":u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishRsp)return u;let $=new $root.com.quick.voice.proto.PublishRsp;return u.remoteSdp!=null&&($.remoteSdp=String(u.remoteSdp)),u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&(B.remoteSdp=""),u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&(B.remoteSdp=u.remoteSdp),u.session!=null&&u.hasOwnProperty("session")&&(B.session=u.session,$.oneofs&&(B._session="session")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishRsp"},O}(),N.PublishNotify=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,$.uint32(18).fork()).ldelim(),u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(26).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.PublishNotify;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(u.user);if($)return"user."+$}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishNotify)return u;let $=new $root.com.quick.voice.proto.PublishNotify;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(u.user)}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&(B.roomId="",B.user=null),u.roomId!=null&&u.hasOwnProperty("roomId")&&(B.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(B.user=$root.com.quick.voice.proto.User.toObject(u.user,$)),u.session!=null&&u.hasOwnProperty("session")&&(B.session=u.session,$.oneofs&&(B._session="session")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishNotify"},O}(),N.SubscribeReq=function(){function O(i){if(this.users=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.users=$util.emptyArray,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.users!=null&&u.users.length)for(let B=0;B<u.users.length;++B)$root.com.quick.voice.proto.User.encode(u.users[B],$.uint32(10).fork()).ldelim();return u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(18).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.SubscribeReq;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(u,u.uint32()));break}case 2:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.users!=null&&u.hasOwnProperty("users")){if(!Array.isArray(u.users))return"users: array expected";for(let $=0;$<u.users.length;++$){let B=$root.com.quick.voice.proto.User.verify(u.users[$]);if(B)return"users."+B}}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.SubscribeReq)return u;let $=new $root.com.quick.voice.proto.SubscribeReq;if(u.users){if(!Array.isArray(u.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");$.users=[];for(let B=0;B<u.users.length;++B){if(typeof u.users[B]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");$.users[B]=$root.com.quick.voice.proto.User.fromObject(u.users[B])}}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.users=[]),u.users&&u.users.length){B.users=[];for(let F=0;F<u.users.length;++F)B.users[F]=$root.com.quick.voice.proto.User.toObject(u.users[F],$)}return u.session!=null&&u.hasOwnProperty("session")&&(B.session=u.session,$.oneofs&&(B._session="session")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.SubscribeReq"},O}(),N.SubscribeRsp=function(){function O(i){if(this.users=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.remoteSdp="",O.prototype.users=$util.emptyArray,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.remoteSdp!=null&&Object.hasOwnProperty.call(u,"remoteSdp")&&$.uint32(10).string(u.remoteSdp),u.users!=null&&u.users.length)for(let B=0;B<u.users.length;++B)$root.com.quick.voice.proto.User.encode(u.users[B],$.uint32(18).fork()).ldelim();return u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(26).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.SubscribeRsp;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.remoteSdp=u.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(u,u.uint32()));break}case 3:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&!$util.isString(u.remoteSdp))return"remoteSdp: string expected";if(u.users!=null&&u.hasOwnProperty("users")){if(!Array.isArray(u.users))return"users: array expected";for(let $=0;$<u.users.length;++$){let B=$root.com.quick.voice.proto.User.verify(u.users[$]);if(B)return"users."+B}}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.SubscribeRsp)return u;let $=new $root.com.quick.voice.proto.SubscribeRsp;if(u.remoteSdp!=null&&($.remoteSdp=String(u.remoteSdp)),u.users){if(!Array.isArray(u.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");$.users=[];for(let B=0;B<u.users.length;++B){if(typeof u.users[B]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");$.users[B]=$root.com.quick.voice.proto.User.fromObject(u.users[B])}}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.users=[]),$.defaults&&(B.remoteSdp=""),u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&(B.remoteSdp=u.remoteSdp),u.users&&u.users.length){B.users=[];for(let F=0;F<u.users.length;++F)B.users[F]=$root.com.quick.voice.proto.User.toObject(u.users[F],$)}return u.session!=null&&u.hasOwnProperty("session")&&(B.session=u.session,$.oneofs&&(B._session="session")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.SubscribeRsp"},O}(),N.RenegotiateReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.sdp="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(18).string(i.sdp),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.userId=i.string();break}case 2:{B.sdp=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let u=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(u.userId=String(i.userId)),i.sdp!=null&&(u.sdp=String(i.sdp)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},O}(),N.QuitReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(18).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.userId=i.string();break}case 2:{B.roomId=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let u=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(u.userId=String(i.userId)),i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},O}(),N.QuitNotify=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.code=null,O.prototype.desc=null;let C;return Object.defineProperty(O.prototype,"_code",{get:$util.oneOfGetter(C=["code"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_desc",{get:$util.oneOfGetter(C=["desc"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,$.uint32(18).fork()).ldelim(),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&$.uint32(24).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&$.uint32(34).string(u.desc),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.QuitNotify;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.code=u.int32();break}case 4:{F.desc=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(u.user);if($)return"user."+$}return u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code)?"code: integer expected":u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc)?"desc: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.QuitNotify)return u;let $=new $root.com.quick.voice.proto.QuitNotify;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(u.user)}return u.code!=null&&($.code=u.code|0),u.desc!=null&&($.desc=String(u.desc)),$},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&(B.roomId="",B.user=null),u.roomId!=null&&u.hasOwnProperty("roomId")&&(B.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(B.user=$root.com.quick.voice.proto.User.toObject(u.user,$)),u.code!=null&&u.hasOwnProperty("code")&&(B.code=u.code,$.oneofs&&(B._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(B.desc=u.desc,$.oneofs&&(B._desc="desc")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.QuitNotify"},O}(),N.TokenExpireNotify=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let u=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},O}(),N.UpdateTokenReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.sdkToken="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&u.uint32(18).string(i.sdkToken),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.sdkToken=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let u=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(u.roomId=String(i.roomId)),i.sdkToken!=null&&(u.sdkToken=String(i.sdkToken)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&($.sdkToken=i.sdkToken),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},O}(),N.NetQualityChange=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.roomId="",O.prototype.egress=0,O.prototype.ingress=0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&u.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&u.uint32(32).int32(i.ingress),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.userId=i.string();break}case 2:{B.roomId=i.string();break}case 3:{B.egress=i.int32();break}case 4:{B.ingress=i.int32();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let u=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(u.userId=String(i.userId)),i.roomId!=null&&(u.roomId=String(i.roomId)),i.egress!=null&&(u.egress=i.egress|0),i.ingress!=null&&(u.ingress=i.ingress|0),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.roomId="",$.egress=0,$.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&($.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&($.ingress=i.ingress),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},O}(),N.NetQualityNotify=function(){function O(C){if(this.qualities=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.qualities=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let $=0;$<i.qualities.length;++$)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.qualities&&B.qualities.length||(B.qualities=[]),B.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.qualities.length;++u){let $=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[u]);if($)return"qualities."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let u=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");u.qualities=[];for(let $=0;$<i.qualities.length;++$){if(typeof i.qualities[$]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");u.qualities[$]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.qualities=[]),i.qualities&&i.qualities.length){$.qualities=[];for(let B=0;B<i.qualities.length;++B)$.qualities[B]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},O}(),N.UpdateCall=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let u=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},O}(),N.SyncRoomInfoReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let u=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},O}(),N.SyncRoomInfoRsp=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.isValid=!1,O.prototype.users=$util.emptyArray,O.prototype.isActive=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&u.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],u.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&u.uint32(32).bool(i.isActive),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.isValid=i.bool();break}case 3:{B.users&&B.users.length||(B.users=[]),B.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{B.isActive=i.bool();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.User.verify(i.users[u]);if($)return"users."+$}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let u=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.isValid!=null&&(u.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");u.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return i.isActive!=null&&(u.isActive=!!i.isActive),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),u.defaults&&($.roomId="",$.isValid=!1,$.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&($.isValid=i.isValid),i.users&&i.users.length){$.users=[];for(let B=0;B<i.users.length;++B)$.users[B]=$root.com.quick.voice.proto.User.toObject(i.users[B],u)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&($.isActive=i.isActive),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},O}(),N.UpdateTime=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&u.uint32(8).int64(i.time),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.time=i.int64();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let u=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(u.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?u.time=parseInt(i.time,10):typeof i.time=="number"?u.time=i.time:typeof i.time=="object"&&(u.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults)if($util.Long){let B=new $util.Long(0,0,!1);$.time=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.time=u.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?$.time=u.longs===String?String(i.time):i.time:$.time=u.longs===String?$util.Long.prototype.toString.call(i.time):u.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},O}(),N.CloseTrackReq=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sdp="",O.prototype.tracks=$util.emptyArray,O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(26).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.sdp=i.string();break}case 2:{B.tracks&&B.tracks.length||(B.tracks=[]),B.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{B.roomId=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let u=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(u.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.sdp="",$.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),i.tracks&&i.tracks.length){$.tracks=[];for(let B=0;B<i.tracks.length;++B)$.tracks[B]=$root.com.quick.voice.proto.Track.toObject(i.tracks[B],u)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},O}(),N.CloseTrackRsp=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.remoteSdp="",O.prototype.tracks=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&u.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.remoteSdp=i.string();break}case 2:{B.tracks&&B.tracks.length||(B.tracks=[]),B.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let u=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(u.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&($.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){$.tracks=[];for(let B=0;B<i.tracks.length;++B)$.tracks[B]=$root.com.quick.voice.proto.Track.toObject(i.tracks[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},O}(),N.CloseTrackNotify=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(10).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let u=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");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.user=null),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},O}(),N.TrackType=function(){const O={},C=Object.create(O);return C[O[0]="Microphone"]=0,C[O[1]="Camera"]=1,C[O[2]="Screen"]=2,C[O[3]="SystemVoice"]=3,C}(),N.UpdatePermissions=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let u=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},O}(),N.CallType=function(){const O={},C=Object.create(O);return C[O[0]="Normal"]=0,C[O[1]="Meeting"]=1,C[O[2]="Live"]=2,C}(),N.QuitNotifyCode=function(){const O={},C=Object.create(O);return C[O[0]="NormalQuit"]=0,C[O[2021]="Timeout"]=2021,C[O[2011]="TokenExpired"]=2011,C[O[2022]="KickOut"]=2022,C[O[2023]="EndPk"]=2023,C[O[2024]="EndLive"]=2024,C}(),N.UserBehavior=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.type=0,O.prototype.behavior=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&u.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&u.uint32(16).bool(i.behavior),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.type=i.int32();break}case 2:{B.behavior=i.bool();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let u=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){u.type=i.type;break}break;case"Microphone":case 0:u.type=0;break;case"Camera":case 1:u.type=1;break;case"Screen":case 2:u.type=2;break;case"SystemVoice":case 3:u.type=3;break}return i.behavior!=null&&(u.behavior=!!i.behavior),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.type=u.enums===String?"Microphone":0,$.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&($.type=u.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")&&($.behavior=i.behavior),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},O}(),N.PreventUser=function(){function O(C){if(this.behaviors=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.id="",O.prototype.behaviors=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&u.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let $=0;$<i.behaviors.length;++$)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.id=i.string();break}case 2:{B.behaviors&&B.behaviors.length||(B.behaviors=[]),B.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.behaviors.length;++u){let $=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[u]);if($)return"behaviors."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let u=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(u.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");u.behaviors=[];for(let $=0;$<i.behaviors.length;++$){if(typeof i.behaviors[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");u.behaviors[$]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.behaviors=[]),u.defaults&&($.id=""),i.id!=null&&i.hasOwnProperty("id")&&($.id=i.id),i.behaviors&&i.behaviors.length){$.behaviors=[];for(let B=0;B<i.behaviors.length;++B)$.behaviors[B]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},O}(),N.PreventUsersBehaviorReq=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.users=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.PreventUser.encode(i.users[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.users&&B.users.length||(B.users=[]),B.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.PreventUser.verify(i.users[u]);if($)return"users."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");u.users[$]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),u.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.users&&i.users.length){$.users=[];for(let B=0;B<i.users.length;++B)$.users[B]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},O}(),N.PreventUsersBehaviorNotify=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.users=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.users&&B.users.length||(B.users=[]),B.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.User.verify(i.users[u]);if($)return"users."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");u.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),u.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.users&&i.users.length){$.users=[];for(let B=0;B<i.users.length;++B)$.users[B]=$root.com.quick.voice.proto.User.toObject(i.users[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},O}(),N.AccelerationAreas=function(){const O={},C=Object.create(O);return C[O[0]="chinaMainland"]=0,C[O[1]="global"]=1,C[O[2]="overseas"]=2,C}(),N.CountMethods=function(){const O={},C=Object.create(O);return C[O[0]="flow"]=0,C[O[1]="minutes"]=1,C}(),N.BaseCDNAddress=function(){function O(C){if(this.urlMap={},C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.area=0,O.prototype.countType=0,O.prototype.urlMap=$util.emptyObject,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&u.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&u.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let $=Object.keys(i.urlMap),B=0;B<$.length;++B)u.uint32(26).fork().uint32(10).string($[B]).uint32(18).string(i.urlMap[$[B]]).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.BaseCDNAddress,F,Z;for(;i.pos<$;){let K=i.uint32();switch(K>>>3){case 1:{B.area=i.int32();break}case 2:{B.countType=i.int32();break}case 3:{B.urlMap===$util.emptyObject&&(B.urlMap={});let J=i.uint32()+i.pos;for(F="",Z="";i.pos<J;){let Y=i.uint32();switch(Y>>>3){case 1:F=i.string();break;case 2:Z=i.string();break;default:i.skipType(Y&7);break}}B.urlMap[F]=Z;break}default:i.skipType(K&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=Object.keys(i.urlMap);for(let $=0;$<u.length;++$)if(!$util.isString(i.urlMap[u[$]]))return"urlMap: string{k:string} expected"}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let u=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){u.area=i.area;break}break;case"chinaMainland":case 0:u.area=0;break;case"global":case 1:u.area=1;break;case"overseas":case 2:u.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){u.countType=i.countType;break}break;case"flow":case 0:u.countType=0;break;case"minutes":case 1:u.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");u.urlMap={};for(let $=Object.keys(i.urlMap),B=0;B<$.length;++B)u.urlMap[$[B]]=String(i.urlMap[$[B]])}return u},O.toObject=function(i,u){u||(u={});let $={};(u.objects||u.defaults)&&($.urlMap={}),u.defaults&&($.area=u.enums===String?"chinaMainland":0,$.countType=u.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&($.area=u.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")&&($.countType=u.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 B;if(i.urlMap&&(B=Object.keys(i.urlMap)).length){$.urlMap={};for(let F=0;F<B.length;++F)$.urlMap[B[F]]=i.urlMap[B[F]]}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},O}(),N.CDNPlayAddressNotify=function(){function O(i){if(this.standLines=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.m3u8=null,O.prototype.rtmp=null,O.prototype.flv=null,O.prototype.rtmps=null,O.prototype.mainLine=null,O.prototype.standLines=$util.emptyArray;let C;return Object.defineProperty(O.prototype,"_m3u8",{get:$util.oneOfGetter(C=["m3u8"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_rtmp",{get:$util.oneOfGetter(C=["rtmp"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_flv",{get:$util.oneOfGetter(C=["flv"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_rtmps",{get:$util.oneOfGetter(C=["rtmps"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_mainLine",{get:$util.oneOfGetter(C=["mainLine"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.m3u8!=null&&Object.hasOwnProperty.call(u,"m3u8")&&$.uint32(18).string(u.m3u8),u.rtmp!=null&&Object.hasOwnProperty.call(u,"rtmp")&&$.uint32(26).string(u.rtmp),u.flv!=null&&Object.hasOwnProperty.call(u,"flv")&&$.uint32(34).string(u.flv),u.rtmps!=null&&Object.hasOwnProperty.call(u,"rtmps")&&$.uint32(42).string(u.rtmps),u.mainLine!=null&&Object.hasOwnProperty.call(u,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(u.mainLine,$.uint32(50).fork()).ldelim(),u.standLines!=null&&u.standLines.length)for(let B=0;B<u.standLines.length;++B)$root.com.quick.voice.proto.BaseCDNAddress.encode(u.standLines[B],$.uint32(58).fork()).ldelim();return $},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.m3u8=u.string();break}case 3:{F.rtmp=u.string();break}case 4:{F.flv=u.string();break}case 5:{F.rtmps=u.string();break}case 6:{F.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32());break}case 7:{F.standLines&&F.standLines.length||(F.standLines=[]),F.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32()));break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.m3u8!=null&&u.hasOwnProperty("m3u8")&&!$util.isString(u.m3u8))return"m3u8: string expected";if(u.rtmp!=null&&u.hasOwnProperty("rtmp")&&!$util.isString(u.rtmp))return"rtmp: string expected";if(u.flv!=null&&u.hasOwnProperty("flv")&&!$util.isString(u.flv))return"flv: string expected";if(u.rtmps!=null&&u.hasOwnProperty("rtmps")&&!$util.isString(u.rtmps))return"rtmps: string expected";if(u.mainLine!=null&&u.hasOwnProperty("mainLine")){let $=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.mainLine);if($)return"mainLine."+$}if(u.standLines!=null&&u.hasOwnProperty("standLines")){if(!Array.isArray(u.standLines))return"standLines: array expected";for(let $=0;$<u.standLines.length;++$){let B=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.standLines[$]);if(B)return"standLines."+B}}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return u;let $=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.m3u8!=null&&($.m3u8=String(u.m3u8)),u.rtmp!=null&&($.rtmp=String(u.rtmp)),u.flv!=null&&($.flv=String(u.flv)),u.rtmps!=null&&($.rtmps=String(u.rtmps)),u.mainLine!=null){if(typeof u.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");$.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.mainLine)}if(u.standLines){if(!Array.isArray(u.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");$.standLines=[];for(let B=0;B<u.standLines.length;++B){if(typeof u.standLines[B]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");$.standLines[B]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.standLines[B])}}return $},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.standLines=[]),$.defaults&&(B.roomId=""),u.roomId!=null&&u.hasOwnProperty("roomId")&&(B.roomId=u.roomId),u.m3u8!=null&&u.hasOwnProperty("m3u8")&&(B.m3u8=u.m3u8,$.oneofs&&(B._m3u8="m3u8")),u.rtmp!=null&&u.hasOwnProperty("rtmp")&&(B.rtmp=u.rtmp,$.oneofs&&(B._rtmp="rtmp")),u.flv!=null&&u.hasOwnProperty("flv")&&(B.flv=u.flv,$.oneofs&&(B._flv="flv")),u.rtmps!=null&&u.hasOwnProperty("rtmps")&&(B.rtmps=u.rtmps,$.oneofs&&(B._rtmps="rtmps")),u.mainLine!=null&&u.hasOwnProperty("mainLine")&&(B.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.mainLine,$),$.oneofs&&(B._mainLine="mainLine")),u.standLines&&u.standLines.length){B.standLines=[];for(let F=0;F<u.standLines.length;++F)B.standLines[F]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.standLines[F],$)}return B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.CDNPlayAddressNotify"},O}(),N.UserChannel=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.userId=i.string();break}case 2:{B.channels&&B.channels.length||(B.channels=[]),B.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let u=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(u.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),u.defaults&&($.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.channels&&i.channels.length){$.channels=[];for(let B=0;B<i.channels.length;++B)$.channels[B]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},O}(),N.ChannelPublishReq=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.channels&&B.channels.length||(B.channels=[]),B.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let B=0;B<i.channels.length;++B)$.channels[B]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},O}(),N.ChannelPublishRsq=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.channels&&B.channels.length||(B.channels=[]),B.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.UserChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let B=0;B<i.channels.length;++B)$.channels[B]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},O}(),N.ChannelSubscribeReq=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.users=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.users[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.users&&B.users.length||(B.users=[]),B.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.UserChannel.verify(i.users[u]);if($)return"users."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let u=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");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");u.users[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),i.users&&i.users.length){$.users=[];for(let B=0;B<i.users.length;++B)$.users[B]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},O}(),N.ChannelSubscribeRsq=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.channels&&B.channels.length||(B.channels=[]),B.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.UserChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let B=0;B<i.channels.length;++B)$.channels[B]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},O}(),N.DataChannelData=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.userId="",O.prototype.type=0,O.prototype.audioData=null;let C;return Object.defineProperty(O.prototype,"_audioData",{get:$util.oneOfGetter(C=["audioData"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&$.uint32(10).string(u.userId),u.type!=null&&Object.hasOwnProperty.call(u,"type")&&$.uint32(16).int32(u.type),u.audioData!=null&&Object.hasOwnProperty.call(u,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(u.audioData,$.uint32(26).fork()).ldelim(),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.DataChannelData;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.userId=u.string();break}case 2:{F.type=u.int32();break}case 3:{F.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(u,u.uint32());break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.type!=null&&u.hasOwnProperty("type"))switch(u.type){default:return"type: enum value expected";case 0:break}if(u.audioData!=null&&u.hasOwnProperty("audioData")){let $=$root.com.quick.voice.proto.DataChannelAudioData.verify(u.audioData);if($)return"audioData."+$}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.DataChannelData)return u;let $=new $root.com.quick.voice.proto.DataChannelData;switch(u.userId!=null&&($.userId=String(u.userId)),u.type){default:if(typeof u.type=="number"){$.type=u.type;break}break;case"backAuido":case 0:$.type=0;break}if(u.audioData!=null){if(typeof u.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");$.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(u.audioData)}return $},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&(B.userId="",B.type=$.enums===String?"backAuido":0),u.userId!=null&&u.hasOwnProperty("userId")&&(B.userId=u.userId),u.type!=null&&u.hasOwnProperty("type")&&(B.type=$.enums===String?$root.com.quick.voice.proto.DataChannelType[u.type]===void 0?u.type:$root.com.quick.voice.proto.DataChannelType[u.type]:u.type),u.audioData!=null&&u.hasOwnProperty("audioData")&&(B.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(u.audioData,$),$.oneofs&&(B._audioData="audioData")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.DataChannelData"},O}(),N.DataChannelType=function(){const O={},C=Object.create(O);return C[O[0]="backAuido"]=0,C}(),N.DataChannelAudioData=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.data=$util.newBuffer([]),O.prototype.format=null,O.prototype.time=null;let C;return Object.defineProperty(O.prototype,"_time",{get:$util.oneOfGetter(C=["time"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.data!=null&&Object.hasOwnProperty.call(u,"data")&&$.uint32(10).bytes(u.data),u.format!=null&&Object.hasOwnProperty.call(u,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(u.format,$.uint32(18).fork()).ldelim(),u.time!=null&&Object.hasOwnProperty.call(u,"time")&&$.uint32(24).int64(u.time),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.DataChannelAudioData;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.data=u.bytes();break}case 2:{F.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(u,u.uint32());break}case 3:{F.time=u.int64();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.data!=null&&u.hasOwnProperty("data")&&!(u.data&&typeof u.data.length=="number"||$util.isString(u.data)))return"data: buffer expected";if(u.format!=null&&u.hasOwnProperty("format")){let $=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(u.format);if($)return"format."+$}return u.time!=null&&u.hasOwnProperty("time")&&!$util.isInteger(u.time)&&!(u.time&&$util.isInteger(u.time.low)&&$util.isInteger(u.time.high))?"time: integer|Long expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.DataChannelAudioData)return u;let $=new $root.com.quick.voice.proto.DataChannelAudioData;if(u.data!=null&&(typeof u.data=="string"?$util.base64.decode(u.data,$.data=$util.newBuffer($util.base64.length(u.data)),0):u.data.length>=0&&($.data=u.data)),u.format!=null){if(typeof u.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");$.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(u.format)}return u.time!=null&&($util.Long?($.time=$util.Long.fromValue(u.time)).unsigned=!1:typeof u.time=="string"?$.time=parseInt(u.time,10):typeof u.time=="number"?$.time=u.time:typeof u.time=="object"&&($.time=new $util.LongBits(u.time.low>>>0,u.time.high>>>0).toNumber())),$},O.toObject=function(u,$){$||($={});let B={};return $.defaults&&($.bytes===String?B.data="":(B.data=[],$.bytes!==Array&&(B.data=$util.newBuffer(B.data))),B.format=null),u.data!=null&&u.hasOwnProperty("data")&&(B.data=$.bytes===String?$util.base64.encode(u.data,0,u.data.length):$.bytes===Array?Array.prototype.slice.call(u.data):u.data),u.format!=null&&u.hasOwnProperty("format")&&(B.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(u.format,$)),u.time!=null&&u.hasOwnProperty("time")&&(typeof u.time=="number"?B.time=$.longs===String?String(u.time):u.time:B.time=$.longs===String?$util.Long.prototype.toString.call(u.time):$.longs===Number?new $util.LongBits(u.time.low>>>0,u.time.high>>>0).toNumber():u.time,$.oneofs&&(B._time="time")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.DataChannelAudioData"},O}(),N.DataChannelAudioFormat=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sampleRate=0,O.prototype.channels=0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.sampleRate!=null&&Object.hasOwnProperty.call(i,"sampleRate")&&u.uint32(9).double(i.sampleRate),i.channels!=null&&Object.hasOwnProperty.call(i,"channels")&&u.uint32(16).int32(i.channels),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.sampleRate=i.double();break}case 2:{B.channels=i.int32();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return i;let u=new $root.com.quick.voice.proto.DataChannelAudioFormat;return i.sampleRate!=null&&(u.sampleRate=Number(i.sampleRate)),i.channels!=null&&(u.channels=i.channels|0),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.sampleRate=0,$.channels=0),i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&($.sampleRate=u.json&&!isFinite(i.sampleRate)?String(i.sampleRate):i.sampleRate),i.channels!=null&&i.hasOwnProperty("channels")&&($.channels=i.channels),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelAudioFormat"},O}(),N.AckMsgReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.msgId!=null&&Object.hasOwnProperty.call(i,"msgId")&&u.uint32(8).int64(i.msgId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.AckMsgReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.msgId=i.int64();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AckMsgReq)return i;let u=new $root.com.quick.voice.proto.AckMsgReq;return i.msgId!=null&&($util.Long?(u.msgId=$util.Long.fromValue(i.msgId)).unsigned=!1:typeof i.msgId=="string"?u.msgId=parseInt(i.msgId,10):typeof i.msgId=="number"?u.msgId=i.msgId:typeof i.msgId=="object"&&(u.msgId=new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber())),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults)if($util.Long){let B=new $util.Long(0,0,!1);$.msgId=u.longs===String?B.toString():u.longs===Number?B.toNumber():B}else $.msgId=u.longs===String?"0":0;return i.msgId!=null&&i.hasOwnProperty("msgId")&&(typeof i.msgId=="number"?$.msgId=u.longs===String?String(i.msgId):i.msgId:$.msgId=u.longs===String?$util.Long.prototype.toString.call(i.msgId):u.longs===Number?new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber():i.msgId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AckMsgReq"},O}(),N.SdpConsult=function(){function O(i){if(this.tracks=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.sender=null,O.prototype.receiverId="",O.prototype.sdp="",O.prototype.tracks=$util.emptyArray;let C;return Object.defineProperty(O.prototype,"_sender",{get:$util.oneOfGetter(C=["sender"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.sender!=null&&Object.hasOwnProperty.call(u,"sender")&&$root.com.quick.voice.proto.User.encode(u.sender,$.uint32(18).fork()).ldelim(),u.receiverId!=null&&Object.hasOwnProperty.call(u,"receiverId")&&$.uint32(26).string(u.receiverId),u.sdp!=null&&Object.hasOwnProperty.call(u,"sdp")&&$.uint32(34).string(u.sdp),u.tracks!=null&&u.tracks.length)for(let B=0;B<u.tracks.length;++B)$root.com.quick.voice.proto.Track.encode(u.tracks[B],$.uint32(42).fork()).ldelim();return $},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.SdpConsult;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.sender=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.receiverId=u.string();break}case 4:{F.sdp=u.string();break}case 5:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.sender!=null&&u.hasOwnProperty("sender")){let $=$root.com.quick.voice.proto.User.verify(u.sender);if($)return"sender."+$}if(u.receiverId!=null&&u.hasOwnProperty("receiverId")&&!$util.isString(u.receiverId))return"receiverId: string expected";if(u.sdp!=null&&u.hasOwnProperty("sdp")&&!$util.isString(u.sdp))return"sdp: string expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let $=0;$<u.tracks.length;++$){let B=$root.com.quick.voice.proto.Track.verify(u.tracks[$]);if(B)return"tracks."+B}}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.SdpConsult)return u;let $=new $root.com.quick.voice.proto.SdpConsult;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.sender!=null){if(typeof u.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");$.sender=$root.com.quick.voice.proto.User.fromObject(u.sender)}if(u.receiverId!=null&&($.receiverId=String(u.receiverId)),u.sdp!=null&&($.sdp=String(u.sdp)),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");$.tracks=[];for(let B=0;B<u.tracks.length;++B){if(typeof u.tracks[B]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");$.tracks[B]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[B])}}return $},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.tracks=[]),$.defaults&&(B.roomId="",B.receiverId="",B.sdp=""),u.roomId!=null&&u.hasOwnProperty("roomId")&&(B.roomId=u.roomId),u.sender!=null&&u.hasOwnProperty("sender")&&(B.sender=$root.com.quick.voice.proto.User.toObject(u.sender,$),$.oneofs&&(B._sender="sender")),u.receiverId!=null&&u.hasOwnProperty("receiverId")&&(B.receiverId=u.receiverId),u.sdp!=null&&u.hasOwnProperty("sdp")&&(B.sdp=u.sdp),u.tracks&&u.tracks.length){B.tracks=[];for(let F=0;F<u.tracks.length;++F)B.tracks[F]=$root.com.quick.voice.proto.Track.toObject(u.tracks[F],$)}return B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.SdpConsult"},O}(),N.Candidate=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sdpMid="",O.prototype.sdpMLineIndex=0,O.prototype.sdp="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.sdpMid!=null&&Object.hasOwnProperty.call(i,"sdpMid")&&u.uint32(10).string(i.sdpMid),i.sdpMLineIndex!=null&&Object.hasOwnProperty.call(i,"sdpMLineIndex")&&u.uint32(16).int32(i.sdpMLineIndex),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(26).string(i.sdp),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.Candidate;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.sdpMid=i.string();break}case 2:{B.sdpMLineIndex=i.int32();break}case 3:{B.sdp=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidate)return i;let u=new $root.com.quick.voice.proto.Candidate;return i.sdpMid!=null&&(u.sdpMid=String(i.sdpMid)),i.sdpMLineIndex!=null&&(u.sdpMLineIndex=i.sdpMLineIndex|0),i.sdp!=null&&(u.sdp=String(i.sdp)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.sdpMid="",$.sdpMLineIndex=0,$.sdp=""),i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&($.sdpMid=i.sdpMid),i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&($.sdpMLineIndex=i.sdpMLineIndex),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidate"},O}(),N.Candidates=function(){function O(C){if(this.candidates=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.senderId="",O.prototype.receiverId="",O.prototype.candidates=$util.emptyArray,O.prototype.isSubscribeReceiver=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.senderId!=null&&Object.hasOwnProperty.call(i,"senderId")&&u.uint32(18).string(i.senderId),i.receiverId!=null&&Object.hasOwnProperty.call(i,"receiverId")&&u.uint32(26).string(i.receiverId),i.candidates!=null&&i.candidates.length)for(let $=0;$<i.candidates.length;++$)$root.com.quick.voice.proto.Candidate.encode(i.candidates[$],u.uint32(34).fork()).ldelim();return i.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(i,"isSubscribeReceiver")&&u.uint32(40).bool(i.isSubscribeReceiver),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.Candidates;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.roomId=i.string();break}case 2:{B.senderId=i.string();break}case 3:{B.receiverId=i.string();break}case 4:{B.candidates&&B.candidates.length||(B.candidates=[]),B.candidates.push($root.com.quick.voice.proto.Candidate.decode(i,i.uint32()));break}case 5:{B.isSubscribeReceiver=i.bool();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.candidates.length;++u){let $=$root.com.quick.voice.proto.Candidate.verify(i.candidates[u]);if($)return"candidates."+$}}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&typeof i.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidates)return i;let u=new $root.com.quick.voice.proto.Candidates;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.senderId!=null&&(u.senderId=String(i.senderId)),i.receiverId!=null&&(u.receiverId=String(i.receiverId)),i.candidates){if(!Array.isArray(i.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");u.candidates=[];for(let $=0;$<i.candidates.length;++$){if(typeof i.candidates[$]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");u.candidates[$]=$root.com.quick.voice.proto.Candidate.fromObject(i.candidates[$])}}return i.isSubscribeReceiver!=null&&(u.isSubscribeReceiver=!!i.isSubscribeReceiver),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.candidates=[]),u.defaults&&($.roomId="",$.senderId="",$.receiverId="",$.isSubscribeReceiver=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.senderId!=null&&i.hasOwnProperty("senderId")&&($.senderId=i.senderId),i.receiverId!=null&&i.hasOwnProperty("receiverId")&&($.receiverId=i.receiverId),i.candidates&&i.candidates.length){$.candidates=[];for(let B=0;B<i.candidates.length;++B)$.candidates[B]=$root.com.quick.voice.proto.Candidate.toObject(i.candidates[B],u)}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&($.isSubscribeReceiver=i.isSubscribeReceiver),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidates"},O}(),N.NatType=function(){const O={},C=Object.create(O);return C[O[0]="Symmetric"]=0,C[O[1]="Cone"]=1,C[O[2]="Port"]=2,C[O[3]="IP"]=3,C[O[4]="UnKnown"]=4,C}(),N.NetworkType=function(){const O={},C=Object.create(O);return C[O[0]="Wifi"]=0,C[O[1]="Wired"]=1,C[O[2]="Mobile"]=2,C}(),N.ReportNetInfo=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.nat=0,O.prototype.type=0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.nat!=null&&Object.hasOwnProperty.call(i,"nat")&&u.uint32(8).int32(i.nat),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&u.uint32(16).int32(i.type),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.ReportNetInfo;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.nat=i.int32();break}case 2:{B.type=i.int32();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportNetInfo)return i;let u=new $root.com.quick.voice.proto.ReportNetInfo;switch(i.nat){default:if(typeof i.nat=="number"){u.nat=i.nat;break}break;case"Symmetric":case 0:u.nat=0;break;case"Cone":case 1:u.nat=1;break;case"Port":case 2:u.nat=2;break;case"IP":case 3:u.nat=3;break;case"UnKnown":case 4:u.nat=4;break}switch(i.type){default:if(typeof i.type=="number"){u.type=i.type;break}break;case"Wifi":case 0:u.type=0;break;case"Wired":case 1:u.type=1;break;case"Mobile":case 2:u.type=2;break}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.nat=u.enums===String?"Symmetric":0,$.type=u.enums===String?"Wifi":0),i.nat!=null&&i.hasOwnProperty("nat")&&($.nat=u.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")&&($.type=u.enums===String?$root.com.quick.voice.proto.NetworkType[i.type]===void 0?i.type:$root.com.quick.voice.proto.NetworkType[i.type]:i.type),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportNetInfo"},O}(),N.P2PCode=function(){const O={},C=Object.create(O);return C[O[0]="Success"]=0,C[O[1]="Failed"]=1,C[O[2]="Ignore"]=2,C[O[3]="Disconnected"]=3,C[O[4]="LowQuality"]=4,C}(),N.ReportP2PReq=function(){function O(i){if(this.pushUserIds=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.code=0,O.prototype.userId="",O.prototype.reason=null,O.prototype.pushUserIds=$util.emptyArray,O.prototype.origin="",O.prototype.connectedTime=null;let C;return Object.defineProperty(O.prototype,"_reason",{get:$util.oneOfGetter(C=["reason"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_connectedTime",{get:$util.oneOfGetter(C=["connectedTime"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&$.uint32(8).int32(u.code),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&$.uint32(18).string(u.userId),u.reason!=null&&Object.hasOwnProperty.call(u,"reason")&&$.uint32(26).string(u.reason),u.pushUserIds!=null&&u.pushUserIds.length)for(let B=0;B<u.pushUserIds.length;++B)$.uint32(34).string(u.pushUserIds[B]);return u.origin!=null&&Object.hasOwnProperty.call(u,"origin")&&$.uint32(42).string(u.origin),u.connectedTime!=null&&Object.hasOwnProperty.call(u,"connectedTime")&&$.uint32(50).string(u.connectedTime),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.ReportP2PReq;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.code=u.int32();break}case 2:{F.userId=u.string();break}case 3:{F.reason=u.string();break}case 4:{F.pushUserIds&&F.pushUserIds.length||(F.pushUserIds=[]),F.pushUserIds.push(u.string());break}case 5:{F.origin=u.string();break}case 6:{F.connectedTime=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.code!=null&&u.hasOwnProperty("code"))switch(u.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.reason!=null&&u.hasOwnProperty("reason")&&!$util.isString(u.reason))return"reason: string expected";if(u.pushUserIds!=null&&u.hasOwnProperty("pushUserIds")){if(!Array.isArray(u.pushUserIds))return"pushUserIds: array expected";for(let $=0;$<u.pushUserIds.length;++$)if(!$util.isString(u.pushUserIds[$]))return"pushUserIds: string[] expected"}return u.origin!=null&&u.hasOwnProperty("origin")&&!$util.isString(u.origin)?"origin: string expected":u.connectedTime!=null&&u.hasOwnProperty("connectedTime")&&!$util.isString(u.connectedTime)?"connectedTime: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.ReportP2PReq)return u;let $=new $root.com.quick.voice.proto.ReportP2PReq;switch(u.code){default:if(typeof u.code=="number"){$.code=u.code;break}break;case"Success":case 0:$.code=0;break;case"Failed":case 1:$.code=1;break;case"Ignore":case 2:$.code=2;break;case"Disconnected":case 3:$.code=3;break;case"LowQuality":case 4:$.code=4;break}if(u.userId!=null&&($.userId=String(u.userId)),u.reason!=null&&($.reason=String(u.reason)),u.pushUserIds){if(!Array.isArray(u.pushUserIds))throw TypeError(".com.quick.voice.proto.ReportP2PReq.pushUserIds: array expected");$.pushUserIds=[];for(let B=0;B<u.pushUserIds.length;++B)$.pushUserIds[B]=String(u.pushUserIds[B])}return u.origin!=null&&($.origin=String(u.origin)),u.connectedTime!=null&&($.connectedTime=String(u.connectedTime)),$},O.toObject=function(u,$){$||($={});let B={};if(($.arrays||$.defaults)&&(B.pushUserIds=[]),$.defaults&&(B.code=$.enums===String?"Success":0,B.userId="",B.origin=""),u.code!=null&&u.hasOwnProperty("code")&&(B.code=$.enums===String?$root.com.quick.voice.proto.P2PCode[u.code]===void 0?u.code:$root.com.quick.voice.proto.P2PCode[u.code]:u.code),u.userId!=null&&u.hasOwnProperty("userId")&&(B.userId=u.userId),u.reason!=null&&u.hasOwnProperty("reason")&&(B.reason=u.reason,$.oneofs&&(B._reason="reason")),u.pushUserIds&&u.pushUserIds.length){B.pushUserIds=[];for(let F=0;F<u.pushUserIds.length;++F)B.pushUserIds[F]=u.pushUserIds[F]}return u.origin!=null&&u.hasOwnProperty("origin")&&(B.origin=u.origin),u.connectedTime!=null&&u.hasOwnProperty("connectedTime")&&(B.connectedTime=u.connectedTime,$.oneofs&&(B._connectedTime="connectedTime")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.ReportP2PReq"},O}(),N.ReportTrafficUsage=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.p2pPush=null,O.prototype.p2pPull=null,O.prototype.sfuPush=null,O.prototype.sfuPull=null;let C;return Object.defineProperty(O.prototype,"_p2pPush",{get:$util.oneOfGetter(C=["p2pPush"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_p2pPull",{get:$util.oneOfGetter(C=["p2pPull"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_sfuPush",{get:$util.oneOfGetter(C=["sfuPush"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_sfuPull",{get:$util.oneOfGetter(C=["sfuPull"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.p2pPush!=null&&Object.hasOwnProperty.call(u,"p2pPush")&&$.uint32(8).int64(u.p2pPush),u.p2pPull!=null&&Object.hasOwnProperty.call(u,"p2pPull")&&$.uint32(16).int64(u.p2pPull),u.sfuPush!=null&&Object.hasOwnProperty.call(u,"sfuPush")&&$.uint32(24).int64(u.sfuPush),u.sfuPull!=null&&Object.hasOwnProperty.call(u,"sfuPull")&&$.uint32(32).int64(u.sfuPull),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let B=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;u.pos<B;){let Z=u.uint32();switch(Z>>>3){case 1:{F.p2pPush=u.int64();break}case 2:{F.p2pPull=u.int64();break}case 3:{F.sfuPush=u.int64();break}case 4:{F.sfuPull=u.int64();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){return typeof u!="object"||u===null?"object expected":u.p2pPush!=null&&u.hasOwnProperty("p2pPush")&&!$util.isInteger(u.p2pPush)&&!(u.p2pPush&&$util.isInteger(u.p2pPush.low)&&$util.isInteger(u.p2pPush.high))?"p2pPush: integer|Long expected":u.p2pPull!=null&&u.hasOwnProperty("p2pPull")&&!$util.isInteger(u.p2pPull)&&!(u.p2pPull&&$util.isInteger(u.p2pPull.low)&&$util.isInteger(u.p2pPull.high))?"p2pPull: integer|Long expected":u.sfuPush!=null&&u.hasOwnProperty("sfuPush")&&!$util.isInteger(u.sfuPush)&&!(u.sfuPush&&$util.isInteger(u.sfuPush.low)&&$util.isInteger(u.sfuPush.high))?"sfuPush: integer|Long expected":u.sfuPull!=null&&u.hasOwnProperty("sfuPull")&&!$util.isInteger(u.sfuPull)&&!(u.sfuPull&&$util.isInteger(u.sfuPull.low)&&$util.isInteger(u.sfuPull.high))?"sfuPull: integer|Long expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return u;let $=new $root.com.quick.voice.proto.ReportTrafficUsage;return u.p2pPush!=null&&($util.Long?($.p2pPush=$util.Long.fromValue(u.p2pPush)).unsigned=!1:typeof u.p2pPush=="string"?$.p2pPush=parseInt(u.p2pPush,10):typeof u.p2pPush=="number"?$.p2pPush=u.p2pPush:typeof u.p2pPush=="object"&&($.p2pPush=new $util.LongBits(u.p2pPush.low>>>0,u.p2pPush.high>>>0).toNumber())),u.p2pPull!=null&&($util.Long?($.p2pPull=$util.Long.fromValue(u.p2pPull)).unsigned=!1:typeof u.p2pPull=="string"?$.p2pPull=parseInt(u.p2pPull,10):typeof u.p2pPull=="number"?$.p2pPull=u.p2pPull:typeof u.p2pPull=="object"&&($.p2pPull=new $util.LongBits(u.p2pPull.low>>>0,u.p2pPull.high>>>0).toNumber())),u.sfuPush!=null&&($util.Long?($.sfuPush=$util.Long.fromValue(u.sfuPush)).unsigned=!1:typeof u.sfuPush=="string"?$.sfuPush=parseInt(u.sfuPush,10):typeof u.sfuPush=="number"?$.sfuPush=u.sfuPush:typeof u.sfuPush=="object"&&($.sfuPush=new $util.LongBits(u.sfuPush.low>>>0,u.sfuPush.high>>>0).toNumber())),u.sfuPull!=null&&($util.Long?($.sfuPull=$util.Long.fromValue(u.sfuPull)).unsigned=!1:typeof u.sfuPull=="string"?$.sfuPull=parseInt(u.sfuPull,10):typeof u.sfuPull=="number"?$.sfuPull=u.sfuPull:typeof u.sfuPull=="object"&&($.sfuPull=new $util.LongBits(u.sfuPull.low>>>0,u.sfuPull.high>>>0).toNumber())),$},O.toObject=function(u,$){$||($={});let B={};return u.p2pPush!=null&&u.hasOwnProperty("p2pPush")&&(typeof u.p2pPush=="number"?B.p2pPush=$.longs===String?String(u.p2pPush):u.p2pPush:B.p2pPush=$.longs===String?$util.Long.prototype.toString.call(u.p2pPush):$.longs===Number?new $util.LongBits(u.p2pPush.low>>>0,u.p2pPush.high>>>0).toNumber():u.p2pPush,$.oneofs&&(B._p2pPush="p2pPush")),u.p2pPull!=null&&u.hasOwnProperty("p2pPull")&&(typeof u.p2pPull=="number"?B.p2pPull=$.longs===String?String(u.p2pPull):u.p2pPull:B.p2pPull=$.longs===String?$util.Long.prototype.toString.call(u.p2pPull):$.longs===Number?new $util.LongBits(u.p2pPull.low>>>0,u.p2pPull.high>>>0).toNumber():u.p2pPull,$.oneofs&&(B._p2pPull="p2pPull")),u.sfuPush!=null&&u.hasOwnProperty("sfuPush")&&(typeof u.sfuPush=="number"?B.sfuPush=$.longs===String?String(u.sfuPush):u.sfuPush:B.sfuPush=$.longs===String?$util.Long.prototype.toString.call(u.sfuPush):$.longs===Number?new $util.LongBits(u.sfuPush.low>>>0,u.sfuPush.high>>>0).toNumber():u.sfuPush,$.oneofs&&(B._sfuPush="sfuPush")),u.sfuPull!=null&&u.hasOwnProperty("sfuPull")&&(typeof u.sfuPull=="number"?B.sfuPull=$.longs===String?String(u.sfuPull):u.sfuPull:B.sfuPull=$.longs===String?$util.Long.prototype.toString.call(u.sfuPull):$.longs===Number?new $util.LongBits(u.sfuPull.low>>>0,u.sfuPull.high>>>0).toNumber():u.sfuPull,$.oneofs&&(B._sfuPull="sfuPull")),B},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.ReportTrafficUsage"},O}(),N.P2PAttemptConnectReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(18).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.P2PAttemptConnectReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.userId=i.string();break}case 2:{B.roomId=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PAttemptConnectReq)return i;let u=new $root.com.quick.voice.proto.P2PAttemptConnectReq;return i.userId!=null&&(u.userId=String(i.userId)),i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PAttemptConnectReq"},O}(),N.CheckSessionReq=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.session="",O.prototype.tracks=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.session!=null&&Object.hasOwnProperty.call(i,"session")&&u.uint32(10).string(i.session),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.CheckSessionReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.session=i.string();break}case 2:{B.tracks&&B.tracks.length||(B.tracks=[]),B.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionReq)return i;let u=new $root.com.quick.voice.proto.CheckSessionReq;if(i.session!=null&&(u.session=String(i.session)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.session=""),i.session!=null&&i.hasOwnProperty("session")&&($.session=i.session),i.tracks&&i.tracks.length){$.tracks=[];for(let B=0;B<i.tracks.length;++B)$.tracks[B]=$root.com.quick.voice.proto.Track.toObject(i.tracks[B],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionReq"},O}(),N.CheckSessionRsq=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sessionIsValid=!1,O.prototype.tracks=$util.emptyArray,O.prototype.session="",O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.sessionIsValid!=null&&Object.hasOwnProperty.call(i,"sessionIsValid")&&u.uint32(8).bool(i.sessionIsValid),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return i.session!=null&&Object.hasOwnProperty.call(i,"session")&&u.uint32(26).string(i.session),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,B=new $root.com.quick.voice.proto.CheckSessionRsq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{B.sessionIsValid=i.bool();break}case 2:{B.tracks&&B.tracks.length||(B.tracks=[]),B.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{B.session=i.string();break}default:i.skipType(F&7);break}}return B},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session)?"session: string expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionRsq)return i;let u=new $root.com.quick.voice.proto.CheckSessionRsq;if(i.sessionIsValid!=null&&(u.sessionIsValid=!!i.sessionIsValid),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return i.session!=null&&(u.session=String(i.session)),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.sessionIsValid=!1,$.session=""),i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&($.sessionIsValid=i.sessionIsValid),i.tracks&&i.tracks.length){$.tracks=[];for(let B=0;B<i.tracks.length;++B)$.tracks[B]=$root.com.quick.voice.proto.Track.toObject(i.tracks[B],u)}return i.session!=null&&i.hasOwnProperty("session")&&($.session=i.session),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionRsq"},O}(),N}(),A}(),M}(),D})(),enum_notifyName={onChangeNetwork:"网络情况变更",onRoomNetwork:"房间实时网络数据",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",onDisconnectP2P:"监听关闭P2P",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(D){let M=D.length;for(;--M>=0;)D[M]=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,M,A,N,O){this.static_tree=D,this.extra_bits=M,this.extra_base=A,this.elems=N,this.max_length=O,this.has_stree=D&&D.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(D,M){this.dyn_tree=D,this.max_code=0,this.stat_desc=M}const d_code=D=>D<256?_dist_code[D]:_dist_code[256+(D>>>7)],put_short=(D,M)=>{D.pending_buf[D.pending++]=M&255,D.pending_buf[D.pending++]=M>>>8&255},send_bits=(D,M,A)=>{D.bi_valid>Buf_size-A?(D.bi_buf|=M<<D.bi_valid&65535,put_short(D,D.bi_buf),D.bi_buf=M>>Buf_size-D.bi_valid,D.bi_valid+=A-Buf_size):(D.bi_buf|=M<<D.bi_valid&65535,D.bi_valid+=A)},send_code=(D,M,A)=>{send_bits(D,A[M*2],A[M*2+1])},bi_reverse=(D,M)=>{let A=0;do A|=D&1,D>>>=1,A<<=1;while(--M>0);return A>>>1},bi_flush=D=>{D.bi_valid===16?(put_short(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):D.bi_valid>=8&&(D.pending_buf[D.pending++]=D.bi_buf&255,D.bi_buf>>=8,D.bi_valid-=8)},gen_bitlen=(D,M)=>{const A=M.dyn_tree,N=M.max_code,O=M.stat_desc.static_tree,C=M.stat_desc.has_stree,i=M.stat_desc.extra_bits,u=M.stat_desc.extra_base,$=M.stat_desc.max_length;let B,F,Z,K,J,Y,ae=0;for(K=0;K<=MAX_BITS$1;K++)D.bl_count[K]=0;for(A[D.heap[D.heap_max]*2+1]=0,B=D.heap_max+1;B<HEAP_SIZE$1;B++)F=D.heap[B],K=A[A[F*2+1]*2+1]+1,K>$&&(K=$,ae++),A[F*2+1]=K,!(F>N)&&(D.bl_count[K]++,J=0,F>=u&&(J=i[F-u]),Y=A[F*2],D.opt_len+=Y*(K+J),C&&(D.static_len+=Y*(O[F*2+1]+J)));if(ae!==0){do{for(K=$-1;D.bl_count[K]===0;)K--;D.bl_count[K]--,D.bl_count[K+1]+=2,D.bl_count[$]--,ae-=2}while(ae>0);for(K=$;K!==0;K--)for(F=D.bl_count[K];F!==0;)Z=D.heap[--B],!(Z>N)&&(A[Z*2+1]!==K&&(D.opt_len+=(K-A[Z*2+1])*A[Z*2],A[Z*2+1]=K),F--)}},gen_codes=(D,M,A)=>{const N=new Array(MAX_BITS$1+1);let O=0,C,i;for(C=1;C<=MAX_BITS$1;C++)O=O+A[C-1]<<1,N[C]=O;for(i=0;i<=M;i++){let u=D[i*2+1];u!==0&&(D[i*2]=bi_reverse(N[u]++,u))}},tr_static_init=()=>{let D,M,A,N,O;const C=new Array(MAX_BITS$1+1);for(A=0,N=0;N<LENGTH_CODES$1-1;N++)for(base_length[N]=A,D=0;D<1<<extra_lbits[N];D++)_length_code[A++]=N;for(_length_code[A-1]=N,O=0,N=0;N<16;N++)for(base_dist[N]=O,D=0;D<1<<extra_dbits[N];D++)_dist_code[O++]=N;for(O>>=7;N<D_CODES$1;N++)for(base_dist[N]=O<<7,D=0;D<1<<extra_dbits[N]-7;D++)_dist_code[256+O++]=N;for(M=0;M<=MAX_BITS$1;M++)C[M]=0;for(D=0;D<=143;)static_ltree[D*2+1]=8,D++,C[8]++;for(;D<=255;)static_ltree[D*2+1]=9,D++,C[9]++;for(;D<=279;)static_ltree[D*2+1]=7,D++,C[7]++;for(;D<=287;)static_ltree[D*2+1]=8,D++,C[8]++;for(gen_codes(static_ltree,L_CODES$1+1,C),D=0;D<D_CODES$1;D++)static_dtree[D*2+1]=5,static_dtree[D*2]=bi_reverse(D,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=D=>{let M;for(M=0;M<L_CODES$1;M++)D.dyn_ltree[M*2]=0;for(M=0;M<D_CODES$1;M++)D.dyn_dtree[M*2]=0;for(M=0;M<BL_CODES$1;M++)D.bl_tree[M*2]=0;D.dyn_ltree[END_BLOCK*2]=1,D.opt_len=D.static_len=0,D.sym_next=D.matches=0},bi_windup=D=>{D.bi_valid>8?put_short(D,D.bi_buf):D.bi_valid>0&&(D.pending_buf[D.pending++]=D.bi_buf),D.bi_buf=0,D.bi_valid=0},smaller=(D,M,A,N)=>{const O=M*2,C=A*2;return D[O]<D[C]||D[O]===D[C]&&N[M]<=N[A]},pqdownheap=(D,M,A)=>{const N=D.heap[A];let O=A<<1;for(;O<=D.heap_len&&(O<D.heap_len&&smaller(M,D.heap[O+1],D.heap[O],D.depth)&&O++,!smaller(M,N,D.heap[O],D.depth));)D.heap[A]=D.heap[O],A=O,O<<=1;D.heap[A]=N},compress_block=(D,M,A)=>{let N,O,C=0,i,u;if(D.sym_next!==0)do N=D.pending_buf[D.sym_buf+C++]&255,N+=(D.pending_buf[D.sym_buf+C++]&255)<<8,O=D.pending_buf[D.sym_buf+C++],N===0?send_code(D,O,M):(i=_length_code[O],send_code(D,i+LITERALS$1+1,M),u=extra_lbits[i],u!==0&&(O-=base_length[i],send_bits(D,O,u)),N--,i=d_code(N),send_code(D,i,A),u=extra_dbits[i],u!==0&&(N-=base_dist[i],send_bits(D,N,u)));while(C<D.sym_next);send_code(D,END_BLOCK,M)},build_tree=(D,M)=>{const A=M.dyn_tree,N=M.stat_desc.static_tree,O=M.stat_desc.has_stree,C=M.stat_desc.elems;let i,u,$=-1,B;for(D.heap_len=0,D.heap_max=HEAP_SIZE$1,i=0;i<C;i++)A[i*2]!==0?(D.heap[++D.heap_len]=$=i,D.depth[i]=0):A[i*2+1]=0;for(;D.heap_len<2;)B=D.heap[++D.heap_len]=$<2?++$:0,A[B*2]=1,D.depth[B]=0,D.opt_len--,O&&(D.static_len-=N[B*2+1]);for(M.max_code=$,i=D.heap_len>>1;i>=1;i--)pqdownheap(D,A,i);B=C;do i=D.heap[1],D.heap[1]=D.heap[D.heap_len--],pqdownheap(D,A,1),u=D.heap[1],D.heap[--D.heap_max]=i,D.heap[--D.heap_max]=u,A[B*2]=A[i*2]+A[u*2],D.depth[B]=(D.depth[i]>=D.depth[u]?D.depth[i]:D.depth[u])+1,A[i*2+1]=A[u*2+1]=B,D.heap[1]=B++,pqdownheap(D,A,1);while(D.heap_len>=2);D.heap[--D.heap_max]=D.heap[1],gen_bitlen(D,M),gen_codes(A,$,D.bl_count)},scan_tree=(D,M,A)=>{let N,O=-1,C,i=M[1],u=0,$=7,B=4;for(i===0&&($=138,B=3),M[(A+1)*2+1]=65535,N=0;N<=A;N++)C=i,i=M[(N+1)*2+1],!(++u<$&&C===i)&&(u<B?D.bl_tree[C*2]+=u:C!==0?(C!==O&&D.bl_tree[C*2]++,D.bl_tree[REP_3_6*2]++):u<=10?D.bl_tree[REPZ_3_10*2]++:D.bl_tree[REPZ_11_138*2]++,u=0,O=C,i===0?($=138,B=3):C===i?($=6,B=3):($=7,B=4))},send_tree=(D,M,A)=>{let N,O=-1,C,i=M[1],u=0,$=7,B=4;for(i===0&&($=138,B=3),N=0;N<=A;N++)if(C=i,i=M[(N+1)*2+1],!(++u<$&&C===i)){if(u<B)do send_code(D,C,D.bl_tree);while(--u!==0);else C!==0?(C!==O&&(send_code(D,C,D.bl_tree),u--),send_code(D,REP_3_6,D.bl_tree),send_bits(D,u-3,2)):u<=10?(send_code(D,REPZ_3_10,D.bl_tree),send_bits(D,u-3,3)):(send_code(D,REPZ_11_138,D.bl_tree),send_bits(D,u-11,7));u=0,O=C,i===0?($=138,B=3):C===i?($=6,B=3):($=7,B=4)}},build_bl_tree=D=>{let M;for(scan_tree(D,D.dyn_ltree,D.l_desc.max_code),scan_tree(D,D.dyn_dtree,D.d_desc.max_code),build_tree(D,D.bl_desc),M=BL_CODES$1-1;M>=3&&D.bl_tree[bl_order[M]*2+1]===0;M--);return D.opt_len+=3*(M+1)+5+5+4,M},send_all_trees=(D,M,A,N)=>{let O;for(send_bits(D,M-257,5),send_bits(D,A-1,5),send_bits(D,N-4,4),O=0;O<N;O++)send_bits(D,D.bl_tree[bl_order[O]*2+1],3);send_tree(D,D.dyn_ltree,M-1),send_tree(D,D.dyn_dtree,A-1)},detect_data_type=D=>{let M=4093624447,A;for(A=0;A<=31;A++,M>>>=1)if(M&1&&D.dyn_ltree[A*2]!==0)return Z_BINARY;if(D.dyn_ltree[18]!==0||D.dyn_ltree[20]!==0||D.dyn_ltree[26]!==0)return Z_TEXT;for(A=32;A<LITERALS$1;A++)if(D.dyn_ltree[A*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=D=>{static_init_done||(tr_static_init(),static_init_done=!0),D.l_desc=new TreeDesc(D.dyn_ltree,static_l_desc),D.d_desc=new TreeDesc(D.dyn_dtree,static_d_desc),D.bl_desc=new TreeDesc(D.bl_tree,static_bl_desc),D.bi_buf=0,D.bi_valid=0,init_block(D)},_tr_stored_block$1=(D,M,A,N)=>{send_bits(D,(STORED_BLOCK<<1)+(N?1:0),3),bi_windup(D),put_short(D,A),put_short(D,~A),A&&D.pending_buf.set(D.window.subarray(M,M+A),D.pending),D.pending+=A},_tr_align$1=D=>{send_bits(D,STATIC_TREES<<1,3),send_code(D,END_BLOCK,static_ltree),bi_flush(D)},_tr_flush_block$1=(D,M,A,N)=>{let O,C,i=0;D.level>0?(D.strm.data_type===Z_UNKNOWN$1&&(D.strm.data_type=detect_data_type(D)),build_tree(D,D.l_desc),build_tree(D,D.d_desc),i=build_bl_tree(D),O=D.opt_len+3+7>>>3,C=D.static_len+3+7>>>3,C<=O&&(O=C)):O=C=A+5,A+4<=O&&M!==-1?_tr_stored_block$1(D,M,A,N):D.strategy===Z_FIXED$1||C===O?(send_bits(D,(STATIC_TREES<<1)+(N?1:0),3),compress_block(D,static_ltree,static_dtree)):(send_bits(D,(DYN_TREES<<1)+(N?1:0),3),send_all_trees(D,D.l_desc.max_code+1,D.d_desc.max_code+1,i+1),compress_block(D,D.dyn_ltree,D.dyn_dtree)),init_block(D),N&&bi_windup(D)},_tr_tally$1=(D,M,A)=>(D.pending_buf[D.sym_buf+D.sym_next++]=M,D.pending_buf[D.sym_buf+D.sym_next++]=M>>8,D.pending_buf[D.sym_buf+D.sym_next++]=A,M===0?D.dyn_ltree[A*2]++:(D.matches++,M--,D.dyn_ltree[(_length_code[A]+LITERALS$1+1)*2]++,D.dyn_dtree[d_code(M)*2]++),D.sym_next===D.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,M,A,N)=>{let O=D&65535|0,C=D>>>16&65535|0,i=0;for(;A!==0;){i=A>2e3?2e3:A,A-=i;do O=O+M[N++]|0,C=C+O|0;while(--i);O%=65521,C%=65521}return O|C<<16|0};var adler32_1=adler32;const makeTable=()=>{let D,M=[];for(var A=0;A<256;A++){D=A;for(var N=0;N<8;N++)D=D&1?3988292384^D>>>1:D>>>1;M[A]=D}return M},crcTable=new Uint32Array(makeTable()),crc32=(D,M,A,N)=>{const O=crcTable,C=N+A;D^=-1;for(let i=N;i<C;i++)D=D>>>8^O[(D^M[i])&255];return D^-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,M)=>(D.msg=messages[M],M),rank=D=>D*2-(D>4?9:0),zero=D=>{let M=D.length;for(;--M>=0;)D[M]=0},slide_hash=D=>{let M,A,N,O=D.w_size;M=D.hash_size,N=M;do A=D.head[--N],D.head[N]=A>=O?A-O:0;while(--M);M=O,N=M;do A=D.prev[--N],D.prev[N]=A>=O?A-O:0;while(--M)};let HASH_ZLIB=(D,M,A)=>(M<<D.hash_shift^A)&D.hash_mask,HASH=HASH_ZLIB;const flush_pending=D=>{const M=D.state;let A=M.pending;A>D.avail_out&&(A=D.avail_out),A!==0&&(D.output.set(M.pending_buf.subarray(M.pending_out,M.pending_out+A),D.next_out),D.next_out+=A,M.pending_out+=A,D.total_out+=A,D.avail_out-=A,M.pending-=A,M.pending===0&&(M.pending_out=0))},flush_block_only=(D,M)=>{_tr_flush_block(D,D.block_start>=0?D.block_start:-1,D.strstart-D.block_start,M),D.block_start=D.strstart,flush_pending(D.strm)},put_byte=(D,M)=>{D.pending_buf[D.pending++]=M},putShortMSB=(D,M)=>{D.pending_buf[D.pending++]=M>>>8&255,D.pending_buf[D.pending++]=M&255},read_buf=(D,M,A,N)=>{let O=D.avail_in;return O>N&&(O=N),O===0?0:(D.avail_in-=O,M.set(D.input.subarray(D.next_in,D.next_in+O),A),D.state.wrap===1?D.adler=adler32_1(D.adler,M,O,A):D.state.wrap===2&&(D.adler=crc32_1(D.adler,M,O,A)),D.next_in+=O,D.total_in+=O,O)},longest_match=(D,M)=>{let A=D.max_chain_length,N=D.strstart,O,C,i=D.prev_length,u=D.nice_match;const $=D.strstart>D.w_size-MIN_LOOKAHEAD?D.strstart-(D.w_size-MIN_LOOKAHEAD):0,B=D.window,F=D.w_mask,Z=D.prev,K=D.strstart+MAX_MATCH;let J=B[N+i-1],Y=B[N+i];D.prev_length>=D.good_match&&(A>>=2),u>D.lookahead&&(u=D.lookahead);do if(O=M,!(B[O+i]!==Y||B[O+i-1]!==J||B[O]!==B[N]||B[++O]!==B[N+1])){N+=2,O++;do;while(B[++N]===B[++O]&&B[++N]===B[++O]&&B[++N]===B[++O]&&B[++N]===B[++O]&&B[++N]===B[++O]&&B[++N]===B[++O]&&B[++N]===B[++O]&&B[++N]===B[++O]&&N<K);if(C=MAX_MATCH-(K-N),N=K-MAX_MATCH,C>i){if(D.match_start=M,i=C,C>=u)break;J=B[N+i-1],Y=B[N+i]}}while((M=Z[M&F])>$&&--A!==0);return i<=D.lookahead?i:D.lookahead},fill_window=D=>{const M=D.w_size;let A,N,O;do{if(N=D.window_size-D.lookahead-D.strstart,D.strstart>=M+(M-MIN_LOOKAHEAD)&&(D.window.set(D.window.subarray(M,M+M-N),0),D.match_start-=M,D.strstart-=M,D.block_start-=M,D.insert>D.strstart&&(D.insert=D.strstart),slide_hash(D),N+=M),D.strm.avail_in===0)break;if(A=read_buf(D.strm,D.window,D.strstart+D.lookahead,N),D.lookahead+=A,D.lookahead+D.insert>=MIN_MATCH)for(O=D.strstart-D.insert,D.ins_h=D.window[O],D.ins_h=HASH(D,D.ins_h,D.window[O+1]);D.insert&&(D.ins_h=HASH(D,D.ins_h,D.window[O+MIN_MATCH-1]),D.prev[O&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=O,O++,D.insert--,!(D.lookahead+D.insert<MIN_MATCH)););}while(D.lookahead<MIN_LOOKAHEAD&&D.strm.avail_in!==0)},deflate_stored=(D,M)=>{let A=D.pending_buf_size-5>D.w_size?D.w_size:D.pending_buf_size-5,N,O,C,i=0,u=D.strm.avail_in;do{if(N=65535,C=D.bi_valid+42>>3,D.strm.avail_out<C||(C=D.strm.avail_out-C,O=D.strstart-D.block_start,N>O+D.strm.avail_in&&(N=O+D.strm.avail_in),N>C&&(N=C),N<A&&(N===0&&M!==Z_FINISH$3||M===Z_NO_FLUSH$2||N!==O+D.strm.avail_in)))break;i=M===Z_FINISH$3&&N===O+D.strm.avail_in?1:0,_tr_stored_block(D,0,0,i),D.pending_buf[D.pending-4]=N,D.pending_buf[D.pending-3]=N>>8,D.pending_buf[D.pending-2]=~N,D.pending_buf[D.pending-1]=~N>>8,flush_pending(D.strm),O&&(O>N&&(O=N),D.strm.output.set(D.window.subarray(D.block_start,D.block_start+O),D.strm.next_out),D.strm.next_out+=O,D.strm.avail_out-=O,D.strm.total_out+=O,D.block_start+=O,N-=O),N&&(read_buf(D.strm,D.strm.output,D.strm.next_out,N),D.strm.next_out+=N,D.strm.avail_out-=N,D.strm.total_out+=N)}while(i===0);return u-=D.strm.avail_in,u&&(u>=D.w_size?(D.matches=2,D.window.set(D.strm.input.subarray(D.strm.next_in-D.w_size,D.strm.next_in),0),D.strstart=D.w_size,D.insert=D.strstart):(D.window_size-D.strstart<=u&&(D.strstart-=D.w_size,D.window.set(D.window.subarray(D.w_size,D.w_size+D.strstart),0),D.matches<2&&D.matches++,D.insert>D.strstart&&(D.insert=D.strstart)),D.window.set(D.strm.input.subarray(D.strm.next_in-u,D.strm.next_in),D.strstart),D.strstart+=u,D.insert+=u>D.w_size-D.insert?D.w_size-D.insert:u),D.block_start=D.strstart),D.high_water<D.strstart&&(D.high_water=D.strstart),i?BS_FINISH_DONE:M!==Z_NO_FLUSH$2&&M!==Z_FINISH$3&&D.strm.avail_in===0&&D.strstart===D.block_start?BS_BLOCK_DONE:(C=D.window_size-D.strstart,D.strm.avail_in>C&&D.block_start>=D.w_size&&(D.block_start-=D.w_size,D.strstart-=D.w_size,D.window.set(D.window.subarray(D.w_size,D.w_size+D.strstart),0),D.matches<2&&D.matches++,C+=D.w_size,D.insert>D.strstart&&(D.insert=D.strstart)),C>D.strm.avail_in&&(C=D.strm.avail_in),C&&(read_buf(D.strm,D.window,D.strstart,C),D.strstart+=C,D.insert+=C>D.w_size-D.insert?D.w_size-D.insert:C),D.high_water<D.strstart&&(D.high_water=D.strstart),C=D.bi_valid+42>>3,C=D.pending_buf_size-C>65535?65535:D.pending_buf_size-C,A=C>D.w_size?D.w_size:C,O=D.strstart-D.block_start,(O>=A||(O||M===Z_FINISH$3)&&M!==Z_NO_FLUSH$2&&D.strm.avail_in===0&&O<=C)&&(N=O>C?C:O,i=M===Z_FINISH$3&&D.strm.avail_in===0&&N===O?1:0,_tr_stored_block(D,D.block_start,N,i),D.block_start+=N,flush_pending(D.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(D,M)=>{let A,N;for(;;){if(D.lookahead<MIN_LOOKAHEAD){if(fill_window(D),D.lookahead<MIN_LOOKAHEAD&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(D.lookahead===0)break}if(A=0,D.lookahead>=MIN_MATCH&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),A=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart),A!==0&&D.strstart-A<=D.w_size-MIN_LOOKAHEAD&&(D.match_length=longest_match(D,A)),D.match_length>=MIN_MATCH)if(N=_tr_tally(D,D.strstart-D.match_start,D.match_length-MIN_MATCH),D.lookahead-=D.match_length,D.match_length<=D.max_lazy_match&&D.lookahead>=MIN_MATCH){D.match_length--;do D.strstart++,D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),A=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart;while(--D.match_length!==0);D.strstart++}else D.strstart+=D.match_length,D.match_length=0,D.ins_h=D.window[D.strstart],D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+1]);else N=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++;if(N&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}return D.insert=D.strstart<MIN_MATCH-1?D.strstart:MIN_MATCH-1,M===Z_FINISH$3?(flush_block_only(D,!0),D.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):D.sym_next&&(flush_block_only(D,!1),D.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(D,M)=>{let A,N,O;for(;;){if(D.lookahead<MIN_LOOKAHEAD){if(fill_window(D),D.lookahead<MIN_LOOKAHEAD&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(D.lookahead===0)break}if(A=0,D.lookahead>=MIN_MATCH&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),A=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart),D.prev_length=D.match_length,D.prev_match=D.match_start,D.match_length=MIN_MATCH-1,A!==0&&D.prev_length<D.max_lazy_match&&D.strstart-A<=D.w_size-MIN_LOOKAHEAD&&(D.match_length=longest_match(D,A),D.match_length<=5&&(D.strategy===Z_FILTERED||D.match_length===MIN_MATCH&&D.strstart-D.match_start>4096)&&(D.match_length=MIN_MATCH-1)),D.prev_length>=MIN_MATCH&&D.match_length<=D.prev_length){O=D.strstart+D.lookahead-MIN_MATCH,N=_tr_tally(D,D.strstart-1-D.prev_match,D.prev_length-MIN_MATCH),D.lookahead-=D.prev_length-1,D.prev_length-=2;do++D.strstart<=O&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),A=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart);while(--D.prev_length!==0);if(D.match_available=0,D.match_length=MIN_MATCH-1,D.strstart++,N&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}else if(D.match_available){if(N=_tr_tally(D,0,D.window[D.strstart-1]),N&&flush_block_only(D,!1),D.strstart++,D.lookahead--,D.strm.avail_out===0)return BS_NEED_MORE}else D.match_available=1,D.strstart++,D.lookahead--}return D.match_available&&(N=_tr_tally(D,0,D.window[D.strstart-1]),D.match_available=0),D.insert=D.strstart<MIN_MATCH-1?D.strstart:MIN_MATCH-1,M===Z_FINISH$3?(flush_block_only(D,!0),D.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):D.sym_next&&(flush_block_only(D,!1),D.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(D,M)=>{let A,N,O,C;const i=D.window;for(;;){if(D.lookahead<=MAX_MATCH){if(fill_window(D),D.lookahead<=MAX_MATCH&&M===Z_NO_FLUSH$2)return BS_NEED_MORE;if(D.lookahead===0)break}if(D.match_length=0,D.lookahead>=MIN_MATCH&&D.strstart>0&&(O=D.strstart-1,N=i[O],N===i[++O]&&N===i[++O]&&N===i[++O])){C=D.strstart+MAX_MATCH;do;while(N===i[++O]&&N===i[++O]&&N===i[++O]&&N===i[++O]&&N===i[++O]&&N===i[++O]&&N===i[++O]&&N===i[++O]&&O<C);D.match_length=MAX_MATCH-(C-O),D.match_length>D.lookahead&&(D.match_length=D.lookahead)}if(D.match_length>=MIN_MATCH?(A=_tr_tally(D,1,D.match_length-MIN_MATCH),D.lookahead-=D.match_length,D.strstart+=D.match_length,D.match_length=0):(A=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++),A&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}return D.insert=0,M===Z_FINISH$3?(flush_block_only(D,!0),D.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):D.sym_next&&(flush_block_only(D,!1),D.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(D,M)=>{let A;for(;;){if(D.lookahead===0&&(fill_window(D),D.lookahead===0)){if(M===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(D.match_length=0,A=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++,A&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}return D.insert=0,M===Z_FINISH$3?(flush_block_only(D,!0),D.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):D.sym_next&&(flush_block_only(D,!1),D.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(D,M,A,N,O){this.good_length=D,this.max_lazy=M,this.nice_length=A,this.max_chain=N,this.func=O}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=D=>{D.window_size=2*D.w_size,zero(D.head),D.max_lazy_match=configuration_table[D.level].max_lazy,D.good_match=configuration_table[D.level].good_length,D.nice_match=configuration_table[D.level].nice_length,D.max_chain_length=configuration_table[D.level].max_chain,D.strstart=0,D.block_start=0,D.lookahead=0,D.insert=0,D.match_length=D.prev_length=MIN_MATCH-1,D.match_available=0,D.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=D=>{if(!D)return 1;const M=D.state;return!M||M.strm!==D||M.status!==INIT_STATE&&M.status!==GZIP_STATE&&M.status!==EXTRA_STATE&&M.status!==NAME_STATE&&M.status!==COMMENT_STATE&&M.status!==HCRC_STATE&&M.status!==BUSY_STATE&&M.status!==FINISH_STATE?1:0},deflateResetKeep=D=>{if(deflateStateCheck(D))return err(D,Z_STREAM_ERROR$2);D.total_in=D.total_out=0,D.data_type=Z_UNKNOWN;const M=D.state;return M.pending=0,M.pending_out=0,M.wrap<0&&(M.wrap=-M.wrap),M.status=M.wrap===2?GZIP_STATE:M.wrap?INIT_STATE:BUSY_STATE,D.adler=M.wrap===2?0:1,M.last_flush=-2,_tr_init(M),Z_OK$3},deflateReset=D=>{const M=deflateResetKeep(D);return M===Z_OK$3&&lm_init(D.state),M},deflateSetHeader=(D,M)=>deflateStateCheck(D)||D.state.wrap!==2?Z_STREAM_ERROR$2:(D.state.gzhead=M,Z_OK$3),deflateInit2=(D,M,A,N,O,C)=>{if(!D)return Z_STREAM_ERROR$2;let i=1;if(M===Z_DEFAULT_COMPRESSION$1&&(M=6),N<0?(i=0,N=-N):N>15&&(i=2,N-=16),O<1||O>MAX_MEM_LEVEL||A!==Z_DEFLATED$2||N<8||N>15||M<0||M>9||C<0||C>Z_FIXED||N===8&&i!==1)return err(D,Z_STREAM_ERROR$2);N===8&&(N=9);const u=new DeflateState;return D.state=u,u.strm=D,u.status=INIT_STATE,u.wrap=i,u.gzhead=null,u.w_bits=N,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=O+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+MIN_MATCH-1)/MIN_MATCH),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<O+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=M,u.strategy=C,u.method=A,deflateReset(D)},deflateInit=(D,M)=>deflateInit2(D,M,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(D,M)=>{if(deflateStateCheck(D)||M>Z_BLOCK$1||M<0)return D?err(D,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const A=D.state;if(!D.output||D.avail_in!==0&&!D.input||A.status===FINISH_STATE&&M!==Z_FINISH$3)return err(D,D.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const N=A.last_flush;if(A.last_flush=M,A.pending!==0){if(flush_pending(D),D.avail_out===0)return A.last_flush=-1,Z_OK$3}else if(D.avail_in===0&&rank(M)<=rank(N)&&M!==Z_FINISH$3)return err(D,Z_BUF_ERROR$1);if(A.status===FINISH_STATE&&D.avail_in!==0)return err(D,Z_BUF_ERROR$1);if(A.status===INIT_STATE&&A.wrap===0&&(A.status=BUSY_STATE),A.status===INIT_STATE){let O=Z_DEFLATED$2+(A.w_bits-8<<4)<<8,C=-1;if(A.strategy>=Z_HUFFMAN_ONLY||A.level<2?C=0:A.level<6?C=1:A.level===6?C=2:C=3,O|=C<<6,A.strstart!==0&&(O|=PRESET_DICT),O+=31-O%31,putShortMSB(A,O),A.strstart!==0&&(putShortMSB(A,D.adler>>>16),putShortMSB(A,D.adler&65535)),D.adler=1,A.status=BUSY_STATE,flush_pending(D),A.pending!==0)return A.last_flush=-1,Z_OK$3}if(A.status===GZIP_STATE){if(D.adler=0,put_byte(A,31),put_byte(A,139),put_byte(A,8),A.gzhead)put_byte(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),put_byte(A,A.gzhead.time&255),put_byte(A,A.gzhead.time>>8&255),put_byte(A,A.gzhead.time>>16&255),put_byte(A,A.gzhead.time>>24&255),put_byte(A,A.level===9?2:A.strategy>=Z_HUFFMAN_ONLY||A.level<2?4:0),put_byte(A,A.gzhead.os&255),A.gzhead.extra&&A.gzhead.extra.length&&(put_byte(A,A.gzhead.extra.length&255),put_byte(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(D.adler=crc32_1(D.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=EXTRA_STATE;else if(put_byte(A,0),put_byte(A,0),put_byte(A,0),put_byte(A,0),put_byte(A,0),put_byte(A,A.level===9?2:A.strategy>=Z_HUFFMAN_ONLY||A.level<2?4:0),put_byte(A,OS_CODE),A.status=BUSY_STATE,flush_pending(D),A.pending!==0)return A.last_flush=-1,Z_OK$3}if(A.status===EXTRA_STATE){if(A.gzhead.extra){let O=A.pending,C=(A.gzhead.extra.length&65535)-A.gzindex;for(;A.pending+C>A.pending_buf_size;){let u=A.pending_buf_size-A.pending;if(A.pending_buf.set(A.gzhead.extra.subarray(A.gzindex,A.gzindex+u),A.pending),A.pending=A.pending_buf_size,A.gzhead.hcrc&&A.pending>O&&(D.adler=crc32_1(D.adler,A.pending_buf,A.pending-O,O)),A.gzindex+=u,flush_pending(D),A.pending!==0)return A.last_flush=-1,Z_OK$3;O=0,C-=u}let i=new Uint8Array(A.gzhead.extra);A.pending_buf.set(i.subarray(A.gzindex,A.gzindex+C),A.pending),A.pending+=C,A.gzhead.hcrc&&A.pending>O&&(D.adler=crc32_1(D.adler,A.pending_buf,A.pending-O,O)),A.gzindex=0}A.status=NAME_STATE}if(A.status===NAME_STATE){if(A.gzhead.name){let O=A.pending,C;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>O&&(D.adler=crc32_1(D.adler,A.pending_buf,A.pending-O,O)),flush_pending(D),A.pending!==0)return A.last_flush=-1,Z_OK$3;O=0}A.gzindex<A.gzhead.name.length?C=A.gzhead.name.charCodeAt(A.gzindex++)&255:C=0,put_byte(A,C)}while(C!==0);A.gzhead.hcrc&&A.pending>O&&(D.adler=crc32_1(D.adler,A.pending_buf,A.pending-O,O)),A.gzindex=0}A.status=COMMENT_STATE}if(A.status===COMMENT_STATE){if(A.gzhead.comment){let O=A.pending,C;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>O&&(D.adler=crc32_1(D.adler,A.pending_buf,A.pending-O,O)),flush_pending(D),A.pending!==0)return A.last_flush=-1,Z_OK$3;O=0}A.gzindex<A.gzhead.comment.length?C=A.gzhead.comment.charCodeAt(A.gzindex++)&255:C=0,put_byte(A,C)}while(C!==0);A.gzhead.hcrc&&A.pending>O&&(D.adler=crc32_1(D.adler,A.pending_buf,A.pending-O,O))}A.status=HCRC_STATE}if(A.status===HCRC_STATE){if(A.gzhead.hcrc){if(A.pending+2>A.pending_buf_size&&(flush_pending(D),A.pending!==0))return A.last_flush=-1,Z_OK$3;put_byte(A,D.adler&255),put_byte(A,D.adler>>8&255),D.adler=0}if(A.status=BUSY_STATE,flush_pending(D),A.pending!==0)return A.last_flush=-1,Z_OK$3}if(D.avail_in!==0||A.lookahead!==0||M!==Z_NO_FLUSH$2&&A.status!==FINISH_STATE){let O=A.level===0?deflate_stored(A,M):A.strategy===Z_HUFFMAN_ONLY?deflate_huff(A,M):A.strategy===Z_RLE?deflate_rle(A,M):configuration_table[A.level].func(A,M);if((O===BS_FINISH_STARTED||O===BS_FINISH_DONE)&&(A.status=FINISH_STATE),O===BS_NEED_MORE||O===BS_FINISH_STARTED)return D.avail_out===0&&(A.last_flush=-1),Z_OK$3;if(O===BS_BLOCK_DONE&&(M===Z_PARTIAL_FLUSH?_tr_align(A):M!==Z_BLOCK$1&&(_tr_stored_block(A,0,0,!1),M===Z_FULL_FLUSH$1&&(zero(A.head),A.lookahead===0&&(A.strstart=0,A.block_start=0,A.insert=0))),flush_pending(D),D.avail_out===0))return A.last_flush=-1,Z_OK$3}return M!==Z_FINISH$3?Z_OK$3:A.wrap<=0?Z_STREAM_END$3:(A.wrap===2?(put_byte(A,D.adler&255),put_byte(A,D.adler>>8&255),put_byte(A,D.adler>>16&255),put_byte(A,D.adler>>24&255),put_byte(A,D.total_in&255),put_byte(A,D.total_in>>8&255),put_byte(A,D.total_in>>16&255),put_byte(A,D.total_in>>24&255)):(putShortMSB(A,D.adler>>>16),putShortMSB(A,D.adler&65535)),flush_pending(D),A.wrap>0&&(A.wrap=-A.wrap),A.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=D=>{if(deflateStateCheck(D))return Z_STREAM_ERROR$2;const M=D.state.status;return D.state=null,M===BUSY_STATE?err(D,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(D,M)=>{let A=M.length;if(deflateStateCheck(D))return Z_STREAM_ERROR$2;const N=D.state,O=N.wrap;if(O===2||O===1&&N.status!==INIT_STATE||N.lookahead)return Z_STREAM_ERROR$2;if(O===1&&(D.adler=adler32_1(D.adler,M,A,0)),N.wrap=0,A>=N.w_size){O===0&&(zero(N.head),N.strstart=0,N.block_start=0,N.insert=0);let $=new Uint8Array(N.w_size);$.set(M.subarray(A-N.w_size,A),0),M=$,A=N.w_size}const C=D.avail_in,i=D.next_in,u=D.input;for(D.avail_in=A,D.next_in=0,D.input=M,fill_window(N);N.lookahead>=MIN_MATCH;){let $=N.strstart,B=N.lookahead-(MIN_MATCH-1);do N.ins_h=HASH(N,N.ins_h,N.window[$+MIN_MATCH-1]),N.prev[$&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=$,$++;while(--B);N.strstart=$,N.lookahead=MIN_MATCH-1,fill_window(N)}return N.strstart+=N.lookahead,N.block_start=N.strstart,N.insert=N.lookahead,N.lookahead=0,N.match_length=N.prev_length=MIN_MATCH-1,N.match_available=0,D.next_in=i,D.input=u,D.avail_in=C,N.wrap=O,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,M)=>Object.prototype.hasOwnProperty.call(D,M);var assign=function(D){const M=Array.prototype.slice.call(arguments,1);for(;M.length;){const A=M.shift();if(A){if(typeof A!="object")throw new TypeError(A+"must be non-object");for(const N in A)_has(A,N)&&(D[N]=A[N])}}return D},flattenChunks=D=>{let M=0;for(let N=0,O=D.length;N<O;N++)M+=D[N].length;const A=new Uint8Array(M);for(let N=0,O=0,C=D.length;N<C;N++){let i=D[N];A.set(i,O),O+=i.length}return A},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(D){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let D=0;D<256;D++)_utf8len[D]=D>=252?6:D>=248?5:D>=240?4:D>=224?3:D>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=D=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(D);let M,A,N,O,C,i=D.length,u=0;for(O=0;O<i;O++)A=D.charCodeAt(O),(A&64512)===55296&&O+1<i&&(N=D.charCodeAt(O+1),(N&64512)===56320&&(A=65536+(A-55296<<10)+(N-56320),O++)),u+=A<128?1:A<2048?2:A<65536?3:4;for(M=new Uint8Array(u),C=0,O=0;C<u;O++)A=D.charCodeAt(O),(A&64512)===55296&&O+1<i&&(N=D.charCodeAt(O+1),(N&64512)===56320&&(A=65536+(A-55296<<10)+(N-56320),O++)),A<128?M[C++]=A:A<2048?(M[C++]=192|A>>>6,M[C++]=128|A&63):A<65536?(M[C++]=224|A>>>12,M[C++]=128|A>>>6&63,M[C++]=128|A&63):(M[C++]=240|A>>>18,M[C++]=128|A>>>12&63,M[C++]=128|A>>>6&63,M[C++]=128|A&63);return M};const buf2binstring=(D,M)=>{if(M<65534&&D.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,D.length===M?D:D.subarray(0,M));let A="";for(let N=0;N<M;N++)A+=String.fromCharCode(D[N]);return A};var buf2string=(D,M)=>{const A=M||D.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(D.subarray(0,M));let N,O;const C=new Array(A*2);for(O=0,N=0;N<A;){let i=D[N++];if(i<128){C[O++]=i;continue}let u=_utf8len[i];if(u>4){C[O++]=65533,N+=u-1;continue}for(i&=u===2?31:u===3?15:7;u>1&&N<A;)i=i<<6|D[N++]&63,u--;if(u>1){C[O++]=65533;continue}i<65536?C[O++]=i:(i-=65536,C[O++]=55296|i>>10&1023,C[O++]=56320|i&1023)}return buf2binstring(C,O)},utf8border=(D,M)=>{M=M||D.length,M>D.length&&(M=D.length);let A=M-1;for(;A>=0&&(D[A]&192)===128;)A--;return A<0||A===0?M:A+_utf8len[D[A]]>M?A:M},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(D){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},D||{});let M=this.options;M.raw&&M.windowBits>0?M.windowBits=-M.windowBits:M.gzip&&M.windowBits>0&&M.windowBits<16&&(M.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let A=deflate_1$2.deflateInit2(this.strm,M.level,M.method,M.windowBits,M.memLevel,M.strategy);if(A!==Z_OK$2)throw new Error(messages[A]);if(M.header&&deflate_1$2.deflateSetHeader(this.strm,M.header),M.dictionary){let N;if(typeof M.dictionary=="string"?N=strings.string2buf(M.dictionary):toString$1.call(M.dictionary)==="[object ArrayBuffer]"?N=new Uint8Array(M.dictionary):N=M.dictionary,A=deflate_1$2.deflateSetDictionary(this.strm,N),A!==Z_OK$2)throw new Error(messages[A]);this._dict_set=!0}}Deflate$1.prototype.push=function(D,M){const A=this.strm,N=this.options.chunkSize;let O,C;if(this.ended)return!1;for(M===~~M?C=M:C=M===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof D=="string"?A.input=strings.string2buf(D):toString$1.call(D)==="[object ArrayBuffer]"?A.input=new Uint8Array(D):A.input=D,A.next_in=0,A.avail_in=A.input.length;;){if(A.avail_out===0&&(A.output=new Uint8Array(N),A.next_out=0,A.avail_out=N),(C===Z_SYNC_FLUSH||C===Z_FULL_FLUSH)&&A.avail_out<=6){this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;continue}if(O=deflate_1$2.deflate(A,C),O===Z_STREAM_END$2)return A.next_out>0&&this.onData(A.output.subarray(0,A.next_out)),O=deflate_1$2.deflateEnd(this.strm),this.onEnd(O),this.ended=!0,O===Z_OK$2;if(A.avail_out===0){this.onData(A.output);continue}if(C>0&&A.next_out>0){this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;continue}if(A.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(D){this.chunks.push(D)},Deflate$1.prototype.onEnd=function(D){D===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=D,this.msg=this.strm.msg};function deflate$1(D,M){const A=new Deflate$1(M);if(A.push(D,!0),A.err)throw A.msg||messages[A.err];return A.result}function deflateRaw$1(D,M){return M=M||{},M.raw=!0,deflate$1(D,M)}function gzip$1(D,M){return M=M||{},M.gzip=!0,deflate$1(D,M)}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(M,A){let N,O,C,i,u,$,B,F,Z,K,J,Y,ae,oe,ne,ue,ye,te,re,le,ce,de,me,ie;const he=M.state;N=M.next_in,me=M.input,O=N+(M.avail_in-5),C=M.next_out,ie=M.output,i=C-(A-M.avail_out),u=C+(M.avail_out-257),$=he.dmax,B=he.wsize,F=he.whave,Z=he.wnext,K=he.window,J=he.hold,Y=he.bits,ae=he.lencode,oe=he.distcode,ne=(1<<he.lenbits)-1,ue=(1<<he.distbits)-1;e:do{Y<15&&(J+=me[N++]<<Y,Y+=8,J+=me[N++]<<Y,Y+=8),ye=ae[J&ne];t:for(;;){if(te=ye>>>24,J>>>=te,Y-=te,te=ye>>>16&255,te===0)ie[C++]=ye&65535;else if(te&16){re=ye&65535,te&=15,te&&(Y<te&&(J+=me[N++]<<Y,Y+=8),re+=J&(1<<te)-1,J>>>=te,Y-=te),Y<15&&(J+=me[N++]<<Y,Y+=8,J+=me[N++]<<Y,Y+=8),ye=oe[J&ue];n:for(;;){if(te=ye>>>24,J>>>=te,Y-=te,te=ye>>>16&255,te&16){if(le=ye&65535,te&=15,Y<te&&(J+=me[N++]<<Y,Y+=8,Y<te&&(J+=me[N++]<<Y,Y+=8)),le+=J&(1<<te)-1,le>$){M.msg="invalid distance too far back",he.mode=BAD$1;break e}if(J>>>=te,Y-=te,te=C-i,le>te){if(te=le-te,te>F&&he.sane){M.msg="invalid distance too far back",he.mode=BAD$1;break e}if(ce=0,de=K,Z===0){if(ce+=B-te,te<re){re-=te;do ie[C++]=K[ce++];while(--te);ce=C-le,de=ie}}else if(Z<te){if(ce+=B+Z-te,te-=Z,te<re){re-=te;do ie[C++]=K[ce++];while(--te);if(ce=0,Z<re){te=Z,re-=te;do ie[C++]=K[ce++];while(--te);ce=C-le,de=ie}}}else if(ce+=Z-te,te<re){re-=te;do ie[C++]=K[ce++];while(--te);ce=C-le,de=ie}for(;re>2;)ie[C++]=de[ce++],ie[C++]=de[ce++],ie[C++]=de[ce++],re-=3;re&&(ie[C++]=de[ce++],re>1&&(ie[C++]=de[ce++]))}else{ce=C-le;do ie[C++]=ie[ce++],ie[C++]=ie[ce++],ie[C++]=ie[ce++],re-=3;while(re>2);re&&(ie[C++]=ie[ce++],re>1&&(ie[C++]=ie[ce++]))}}else if((te&64)===0){ye=oe[(ye&65535)+(J&(1<<te)-1)];continue n}else{M.msg="invalid distance code",he.mode=BAD$1;break e}break}}else if((te&64)===0){ye=ae[(ye&65535)+(J&(1<<te)-1)];continue t}else if(te&32){he.mode=TYPE$1;break e}else{M.msg="invalid literal/length code",he.mode=BAD$1;break e}break}}while(N<O&&C<u);re=Y>>3,N-=re,Y-=re<<3,J&=(1<<Y)-1,M.next_in=N,M.next_out=C,M.avail_in=N<O?5+(O-N):5-(N-O),M.avail_out=C<u?257+(u-C):257-(C-u),he.hold=J,he.bits=Y};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,M,A,N,O,C,i,u)=>{const $=u.bits;let B=0,F=0,Z=0,K=0,J=0,Y=0,ae=0,oe=0,ne=0,ue=0,ye,te,re,le,ce,de=null,me;const ie=new Uint16Array(MAXBITS+1),he=new Uint16Array(MAXBITS+1);let ke=null,be,we,Te;for(B=0;B<=MAXBITS;B++)ie[B]=0;for(F=0;F<N;F++)ie[M[A+F]]++;for(J=$,K=MAXBITS;K>=1&&ie[K]===0;K--);if(J>K&&(J=K),K===0)return O[C++]=1<<24|64<<16|0,O[C++]=1<<24|64<<16|0,u.bits=1,0;for(Z=1;Z<K&&ie[Z]===0;Z++);for(J<Z&&(J=Z),oe=1,B=1;B<=MAXBITS;B++)if(oe<<=1,oe-=ie[B],oe<0)return-1;if(oe>0&&(D===CODES$1||K!==1))return-1;for(he[1]=0,B=1;B<MAXBITS;B++)he[B+1]=he[B]+ie[B];for(F=0;F<N;F++)M[A+F]!==0&&(i[he[M[A+F]]++]=F);if(D===CODES$1?(de=ke=i,me=20):D===LENS$1?(de=lbase,ke=lext,me=257):(de=dbase,ke=dext,me=0),ue=0,F=0,B=Z,ce=C,Y=J,ae=0,re=-1,ne=1<<J,le=ne-1,D===LENS$1&&ne>ENOUGH_LENS$1||D===DISTS$1&&ne>ENOUGH_DISTS$1)return 1;for(;;){be=B-ae,i[F]+1<me?(we=0,Te=i[F]):i[F]>=me?(we=ke[i[F]-me],Te=de[i[F]-me]):(we=96,Te=0),ye=1<<B-ae,te=1<<Y,Z=te;do te-=ye,O[ce+(ue>>ae)+te]=be<<24|we<<16|Te|0;while(te!==0);for(ye=1<<B-1;ue&ye;)ye>>=1;if(ye!==0?(ue&=ye-1,ue+=ye):ue=0,F++,--ie[B]===0){if(B===K)break;B=M[A+i[F]]}if(B>J&&(ue&le)!==re){for(ae===0&&(ae=J),ce+=Z,Y=B-ae,oe=1<<Y;Y+ae<K&&(oe-=ie[Y+ae],!(oe<=0));)Y++,oe<<=1;if(ne+=1<<Y,D===LENS$1&&ne>ENOUGH_LENS$1||D===DISTS$1&&ne>ENOUGH_DISTS$1)return 1;re=ue&le,O[re]=J<<24|Y<<16|ce-C|0}}return ue!==0&&(O[ce+ue]=B-ae<<24|64<<16|0),u.bits=J,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=D=>(D>>>24&255)+(D>>>8&65280)+((D&65280)<<8)+((D&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=D=>{if(!D)return 1;const M=D.state;return!M||M.strm!==D||M.mode<HEAD||M.mode>SYNC?1:0},inflateResetKeep=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const M=D.state;return D.total_in=D.total_out=M.total=0,D.msg="",M.wrap&&(D.adler=M.wrap&1),M.mode=HEAD,M.last=0,M.havedict=0,M.flags=-1,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new Int32Array(ENOUGH_LENS),M.distcode=M.distdyn=new Int32Array(ENOUGH_DISTS),M.sane=1,M.back=-1,Z_OK$1},inflateReset=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const M=D.state;return M.wsize=0,M.whave=0,M.wnext=0,inflateResetKeep(D)},inflateReset2=(D,M)=>{let A;if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const N=D.state;return M<0?(A=0,M=-M):(A=(M>>4)+5,M<48&&(M&=15)),M&&(M<8||M>15)?Z_STREAM_ERROR$1:(N.window!==null&&N.wbits!==M&&(N.window=null),N.wrap=A,N.wbits=M,inflateReset(D))},inflateInit2=(D,M)=>{if(!D)return Z_STREAM_ERROR$1;const A=new InflateState;D.state=A,A.strm=D,A.window=null,A.mode=HEAD;const N=inflateReset2(D,M);return N!==Z_OK$1&&(D.state=null),N},inflateInit=D=>inflateInit2(D,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=D=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let M=0;for(;M<144;)D.lens[M++]=8;for(;M<256;)D.lens[M++]=9;for(;M<280;)D.lens[M++]=7;for(;M<288;)D.lens[M++]=8;for(inftrees(LENS,D.lens,0,288,lenfix,0,D.work,{bits:9}),M=0;M<32;)D.lens[M++]=5;inftrees(DISTS,D.lens,0,32,distfix,0,D.work,{bits:5}),virgin=!1}D.lencode=lenfix,D.lenbits=9,D.distcode=distfix,D.distbits=5},updatewindow=(D,M,A,N)=>{let O;const C=D.state;return C.window===null&&(C.wsize=1<<C.wbits,C.wnext=0,C.whave=0,C.window=new Uint8Array(C.wsize)),N>=C.wsize?(C.window.set(M.subarray(A-C.wsize,A),0),C.wnext=0,C.whave=C.wsize):(O=C.wsize-C.wnext,O>N&&(O=N),C.window.set(M.subarray(A-N,A-N+O),C.wnext),N-=O,N?(C.window.set(M.subarray(A-N,A),0),C.wnext=N,C.whave=C.wsize):(C.wnext+=O,C.wnext===C.wsize&&(C.wnext=0),C.whave<C.wsize&&(C.whave+=O))),0},inflate$2=(D,M)=>{let A,N,O,C,i,u,$,B,F,Z,K,J,Y,ae,oe=0,ne,ue,ye,te,re,le,ce,de;const me=new Uint8Array(4);let ie,he;const ke=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(D)||!D.output||!D.input&&D.avail_in!==0)return Z_STREAM_ERROR$1;A=D.state,A.mode===TYPE&&(A.mode=TYPEDO),i=D.next_out,O=D.output,$=D.avail_out,C=D.next_in,N=D.input,u=D.avail_in,B=A.hold,F=A.bits,Z=u,K=$,de=Z_OK$1;e:for(;;)switch(A.mode){case HEAD:if(A.wrap===0){A.mode=TYPEDO;break}for(;F<16;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(A.wrap&2&&B===35615){A.wbits===0&&(A.wbits=15),A.check=0,me[0]=B&255,me[1]=B>>>8&255,A.check=crc32_1(A.check,me,2,0),B=0,F=0,A.mode=FLAGS;break}if(A.head&&(A.head.done=!1),!(A.wrap&1)||(((B&255)<<8)+(B>>8))%31){D.msg="incorrect header check",A.mode=BAD;break}if((B&15)!==Z_DEFLATED){D.msg="unknown compression method",A.mode=BAD;break}if(B>>>=4,F-=4,ce=(B&15)+8,A.wbits===0&&(A.wbits=ce),ce>15||ce>A.wbits){D.msg="invalid window size",A.mode=BAD;break}A.dmax=1<<A.wbits,A.flags=0,D.adler=A.check=1,A.mode=B&512?DICTID:TYPE,B=0,F=0;break;case FLAGS:for(;F<16;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(A.flags=B,(A.flags&255)!==Z_DEFLATED){D.msg="unknown compression method",A.mode=BAD;break}if(A.flags&57344){D.msg="unknown header flags set",A.mode=BAD;break}A.head&&(A.head.text=B>>8&1),A.flags&512&&A.wrap&4&&(me[0]=B&255,me[1]=B>>>8&255,A.check=crc32_1(A.check,me,2,0)),B=0,F=0,A.mode=TIME;case TIME:for(;F<32;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}A.head&&(A.head.time=B),A.flags&512&&A.wrap&4&&(me[0]=B&255,me[1]=B>>>8&255,me[2]=B>>>16&255,me[3]=B>>>24&255,A.check=crc32_1(A.check,me,4,0)),B=0,F=0,A.mode=OS;case OS:for(;F<16;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}A.head&&(A.head.xflags=B&255,A.head.os=B>>8),A.flags&512&&A.wrap&4&&(me[0]=B&255,me[1]=B>>>8&255,A.check=crc32_1(A.check,me,2,0)),B=0,F=0,A.mode=EXLEN;case EXLEN:if(A.flags&1024){for(;F<16;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}A.length=B,A.head&&(A.head.extra_len=B),A.flags&512&&A.wrap&4&&(me[0]=B&255,me[1]=B>>>8&255,A.check=crc32_1(A.check,me,2,0)),B=0,F=0}else A.head&&(A.head.extra=null);A.mode=EXTRA;case EXTRA:if(A.flags&1024&&(J=A.length,J>u&&(J=u),J&&(A.head&&(ce=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Uint8Array(A.head.extra_len)),A.head.extra.set(N.subarray(C,C+J),ce)),A.flags&512&&A.wrap&4&&(A.check=crc32_1(A.check,N,J,C)),u-=J,C+=J,A.length-=J),A.length))break e;A.length=0,A.mode=NAME;case NAME:if(A.flags&2048){if(u===0)break e;J=0;do ce=N[C+J++],A.head&&ce&&A.length<65536&&(A.head.name+=String.fromCharCode(ce));while(ce&&J<u);if(A.flags&512&&A.wrap&4&&(A.check=crc32_1(A.check,N,J,C)),u-=J,C+=J,ce)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=COMMENT;case COMMENT:if(A.flags&4096){if(u===0)break e;J=0;do ce=N[C+J++],A.head&&ce&&A.length<65536&&(A.head.comment+=String.fromCharCode(ce));while(ce&&J<u);if(A.flags&512&&A.wrap&4&&(A.check=crc32_1(A.check,N,J,C)),u-=J,C+=J,ce)break e}else A.head&&(A.head.comment=null);A.mode=HCRC;case HCRC:if(A.flags&512){for(;F<16;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(A.wrap&4&&B!==(A.check&65535)){D.msg="header crc mismatch",A.mode=BAD;break}B=0,F=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),D.adler=A.check=0,A.mode=TYPE;break;case DICTID:for(;F<32;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}D.adler=A.check=zswap32(B),B=0,F=0,A.mode=DICT;case DICT:if(A.havedict===0)return D.next_out=i,D.avail_out=$,D.next_in=C,D.avail_in=u,A.hold=B,A.bits=F,Z_NEED_DICT$1;D.adler=A.check=1,A.mode=TYPE;case TYPE:if(M===Z_BLOCK||M===Z_TREES)break e;case TYPEDO:if(A.last){B>>>=F&7,F-=F&7,A.mode=CHECK;break}for(;F<3;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}switch(A.last=B&1,B>>>=1,F-=1,B&3){case 0:A.mode=STORED;break;case 1:if(fixedtables(A),A.mode=LEN_,M===Z_TREES){B>>>=2,F-=2;break e}break;case 2:A.mode=TABLE;break;case 3:D.msg="invalid block type",A.mode=BAD}B>>>=2,F-=2;break;case STORED:for(B>>>=F&7,F-=F&7;F<32;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if((B&65535)!==(B>>>16^65535)){D.msg="invalid stored block lengths",A.mode=BAD;break}if(A.length=B&65535,B=0,F=0,A.mode=COPY_,M===Z_TREES)break e;case COPY_:A.mode=COPY;case COPY:if(J=A.length,J){if(J>u&&(J=u),J>$&&(J=$),J===0)break e;O.set(N.subarray(C,C+J),i),u-=J,C+=J,$-=J,i+=J,A.length-=J;break}A.mode=TYPE;break;case TABLE:for(;F<14;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(A.nlen=(B&31)+257,B>>>=5,F-=5,A.ndist=(B&31)+1,B>>>=5,F-=5,A.ncode=(B&15)+4,B>>>=4,F-=4,A.nlen>286||A.ndist>30){D.msg="too many length or distance symbols",A.mode=BAD;break}A.have=0,A.mode=LENLENS;case LENLENS:for(;A.have<A.ncode;){for(;F<3;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}A.lens[ke[A.have++]]=B&7,B>>>=3,F-=3}for(;A.have<19;)A.lens[ke[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,ie={bits:A.lenbits},de=inftrees(CODES,A.lens,0,19,A.lencode,0,A.work,ie),A.lenbits=ie.bits,de){D.msg="invalid code lengths set",A.mode=BAD;break}A.have=0,A.mode=CODELENS;case CODELENS:for(;A.have<A.nlen+A.ndist;){for(;oe=A.lencode[B&(1<<A.lenbits)-1],ne=oe>>>24,ue=oe>>>16&255,ye=oe&65535,!(ne<=F);){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(ye<16)B>>>=ne,F-=ne,A.lens[A.have++]=ye;else{if(ye===16){for(he=ne+2;F<he;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(B>>>=ne,F-=ne,A.have===0){D.msg="invalid bit length repeat",A.mode=BAD;break}ce=A.lens[A.have-1],J=3+(B&3),B>>>=2,F-=2}else if(ye===17){for(he=ne+3;F<he;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}B>>>=ne,F-=ne,ce=0,J=3+(B&7),B>>>=3,F-=3}else{for(he=ne+7;F<he;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}B>>>=ne,F-=ne,ce=0,J=11+(B&127),B>>>=7,F-=7}if(A.have+J>A.nlen+A.ndist){D.msg="invalid bit length repeat",A.mode=BAD;break}for(;J--;)A.lens[A.have++]=ce}}if(A.mode===BAD)break;if(A.lens[256]===0){D.msg="invalid code -- missing end-of-block",A.mode=BAD;break}if(A.lenbits=9,ie={bits:A.lenbits},de=inftrees(LENS,A.lens,0,A.nlen,A.lencode,0,A.work,ie),A.lenbits=ie.bits,de){D.msg="invalid literal/lengths set",A.mode=BAD;break}if(A.distbits=6,A.distcode=A.distdyn,ie={bits:A.distbits},de=inftrees(DISTS,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,ie),A.distbits=ie.bits,de){D.msg="invalid distances set",A.mode=BAD;break}if(A.mode=LEN_,M===Z_TREES)break e;case LEN_:A.mode=LEN;case LEN:if(u>=6&&$>=258){D.next_out=i,D.avail_out=$,D.next_in=C,D.avail_in=u,A.hold=B,A.bits=F,inffast(D,K),i=D.next_out,O=D.output,$=D.avail_out,C=D.next_in,N=D.input,u=D.avail_in,B=A.hold,F=A.bits,A.mode===TYPE&&(A.back=-1);break}for(A.back=0;oe=A.lencode[B&(1<<A.lenbits)-1],ne=oe>>>24,ue=oe>>>16&255,ye=oe&65535,!(ne<=F);){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(ue&&(ue&240)===0){for(te=ne,re=ue,le=ye;oe=A.lencode[le+((B&(1<<te+re)-1)>>te)],ne=oe>>>24,ue=oe>>>16&255,ye=oe&65535,!(te+ne<=F);){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}B>>>=te,F-=te,A.back+=te}if(B>>>=ne,F-=ne,A.back+=ne,A.length=ye,ue===0){A.mode=LIT;break}if(ue&32){A.back=-1,A.mode=TYPE;break}if(ue&64){D.msg="invalid literal/length code",A.mode=BAD;break}A.extra=ue&15,A.mode=LENEXT;case LENEXT:if(A.extra){for(he=A.extra;F<he;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}A.length+=B&(1<<A.extra)-1,B>>>=A.extra,F-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=DIST;case DIST:for(;oe=A.distcode[B&(1<<A.distbits)-1],ne=oe>>>24,ue=oe>>>16&255,ye=oe&65535,!(ne<=F);){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if((ue&240)===0){for(te=ne,re=ue,le=ye;oe=A.distcode[le+((B&(1<<te+re)-1)>>te)],ne=oe>>>24,ue=oe>>>16&255,ye=oe&65535,!(te+ne<=F);){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}B>>>=te,F-=te,A.back+=te}if(B>>>=ne,F-=ne,A.back+=ne,ue&64){D.msg="invalid distance code",A.mode=BAD;break}A.offset=ye,A.extra=ue&15,A.mode=DISTEXT;case DISTEXT:if(A.extra){for(he=A.extra;F<he;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}A.offset+=B&(1<<A.extra)-1,B>>>=A.extra,F-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){D.msg="invalid distance too far back",A.mode=BAD;break}A.mode=MATCH;case MATCH:if($===0)break e;if(J=K-$,A.offset>J){if(J=A.offset-J,J>A.whave&&A.sane){D.msg="invalid distance too far back",A.mode=BAD;break}J>A.wnext?(J-=A.wnext,Y=A.wsize-J):Y=A.wnext-J,J>A.length&&(J=A.length),ae=A.window}else ae=O,Y=i-A.offset,J=A.length;J>$&&(J=$),$-=J,A.length-=J;do O[i++]=ae[Y++];while(--J);A.length===0&&(A.mode=LEN);break;case LIT:if($===0)break e;O[i++]=A.length,$--,A.mode=LEN;break;case CHECK:if(A.wrap){for(;F<32;){if(u===0)break e;u--,B|=N[C++]<<F,F+=8}if(K-=$,D.total_out+=K,A.total+=K,A.wrap&4&&K&&(D.adler=A.check=A.flags?crc32_1(A.check,O,K,i-K):adler32_1(A.check,O,K,i-K)),K=$,A.wrap&4&&(A.flags?B:zswap32(B))!==A.check){D.msg="incorrect data check",A.mode=BAD;break}B=0,F=0}A.mode=LENGTH;case LENGTH:if(A.wrap&&A.flags){for(;F<32;){if(u===0)break e;u--,B+=N[C++]<<F,F+=8}if(A.wrap&4&&B!==(A.total&4294967295)){D.msg="incorrect length check",A.mode=BAD;break}B=0,F=0}A.mode=DONE;case DONE:de=Z_STREAM_END$1;break e;case BAD:de=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return D.next_out=i,D.avail_out=$,D.next_in=C,D.avail_in=u,A.hold=B,A.bits=F,(A.wsize||K!==D.avail_out&&A.mode<BAD&&(A.mode<CHECK||M!==Z_FINISH$1))&&updatewindow(D,D.output,D.next_out,K-D.avail_out),Z-=D.avail_in,K-=D.avail_out,D.total_in+=Z,D.total_out+=K,A.total+=K,A.wrap&4&&K&&(D.adler=A.check=A.flags?crc32_1(A.check,O,K,D.next_out-K):adler32_1(A.check,O,K,D.next_out-K)),D.data_type=A.bits+(A.last?64:0)+(A.mode===TYPE?128:0)+(A.mode===LEN_||A.mode===COPY_?256:0),(Z===0&&K===0||M===Z_FINISH$1)&&de===Z_OK$1&&(de=Z_BUF_ERROR),de},inflateEnd=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;let M=D.state;return M.window&&(M.window=null),D.state=null,Z_OK$1},inflateGetHeader=(D,M)=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const A=D.state;return(A.wrap&2)===0?Z_STREAM_ERROR$1:(A.head=M,M.done=!1,Z_OK$1)},inflateSetDictionary=(D,M)=>{const A=M.length;let N,O,C;return inflateStateCheck(D)||(N=D.state,N.wrap!==0&&N.mode!==DICT)?Z_STREAM_ERROR$1:N.mode===DICT&&(O=1,O=adler32_1(O,M,A,0),O!==N.check)?Z_DATA_ERROR$1:(C=updatewindow(D,M,A,A),C?(N.mode=MEM,Z_MEM_ERROR$1):(N.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(D){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},D||{});const M=this.options;M.raw&&M.windowBits>=0&&M.windowBits<16&&(M.windowBits=-M.windowBits,M.windowBits===0&&(M.windowBits=-15)),M.windowBits>=0&&M.windowBits<16&&!(D&&D.windowBits)&&(M.windowBits+=32),M.windowBits>15&&M.windowBits<48&&(M.windowBits&15)===0&&(M.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let A=inflate_1$2.inflateInit2(this.strm,M.windowBits);if(A!==Z_OK)throw new Error(messages[A]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),M.dictionary&&(typeof M.dictionary=="string"?M.dictionary=strings.string2buf(M.dictionary):toString.call(M.dictionary)==="[object ArrayBuffer]"&&(M.dictionary=new Uint8Array(M.dictionary)),M.raw&&(A=inflate_1$2.inflateSetDictionary(this.strm,M.dictionary),A!==Z_OK)))throw new Error(messages[A])}Inflate$1.prototype.push=function(D,M){const A=this.strm,N=this.options.chunkSize,O=this.options.dictionary;let C,i,u;if(this.ended)return!1;for(M===~~M?i=M:i=M===!0?Z_FINISH:Z_NO_FLUSH,toString.call(D)==="[object ArrayBuffer]"?A.input=new Uint8Array(D):A.input=D,A.next_in=0,A.avail_in=A.input.length;;){for(A.avail_out===0&&(A.output=new Uint8Array(N),A.next_out=0,A.avail_out=N),C=inflate_1$2.inflate(A,i),C===Z_NEED_DICT&&O&&(C=inflate_1$2.inflateSetDictionary(A,O),C===Z_OK?C=inflate_1$2.inflate(A,i):C===Z_DATA_ERROR&&(C=Z_NEED_DICT));A.avail_in>0&&C===Z_STREAM_END&&A.state.wrap>0&&D[A.next_in]!==0;)inflate_1$2.inflateReset(A),C=inflate_1$2.inflate(A,i);switch(C){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(C),this.ended=!0,!1}if(u=A.avail_out,A.next_out&&(A.avail_out===0||C===Z_STREAM_END))if(this.options.to==="string"){let $=strings.utf8border(A.output,A.next_out),B=A.next_out-$,F=strings.buf2string(A.output,$);A.next_out=B,A.avail_out=N-B,B&&A.output.set(A.output.subarray($,$+B),0),this.onData(F)}else this.onData(A.output.length===A.next_out?A.output:A.output.subarray(0,A.next_out));if(!(C===Z_OK&&u===0)){if(C===Z_STREAM_END)return C=inflate_1$2.inflateEnd(this.strm),this.onEnd(C),this.ended=!0,!0;if(A.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(D){this.chunks.push(D)},Inflate$1.prototype.onEnd=function(D){D===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=D,this.msg=this.strm.msg};function inflate$1(D,M){const A=new Inflate$1(M);if(A.push(D),A.err)throw A.msg||messages[A.err];return A.result}function inflateRaw$1(D,M){return M=M||{},M.raw=!0,inflate$1(D,M)}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("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=D=>{const M=new Uint8Array(D),A=pako.deflate(M,{gzip:!0});return new Uint8Array(A==null?void 0:A.buffer)},decompressArrayBuffer=D=>{const M=new Uint8Array(D),A=pako.inflate(M,{gzip:!0});return new Uint8Array(A==null?void 0:A.buffer)},sendMessageFormat=D=>{const{event:M}=D;switch(D.data_original=D.data,D.time&&(D.timeStr=E$1(D.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),M){case"login":D.data=com.quick.voice.proto.Login.encode(D.data).finish();break;case"joinRoom":case"joinRoomEx":D.data=com.quick.voice.proto.JoinReq.encode(D.data).finish();break;case"quitRoom":D.data=com.quick.voice.proto.QuitReq.encode(D.data).finish();break;case"connectCF":D.data=com.quick.voice.proto.ConnectCFReq.encode(D.data).finish(),D.data=compressArrayBuffer(D.data),D.compress=!0;break;case"publish":D.data=com.quick.voice.proto.PublishReq.encode(D.data).finish(),D.data=compressArrayBuffer(D.data),D.compress=!0;break;case"pubChannel":D.data=com.quick.voice.proto.ChannelPublishReq.encode(D.data).finish();break;case"subscribe":D.data=com.quick.voice.proto.SubscribeReq.encode(D.data).finish();break;case"offer":D.data=com.quick.voice.proto.SdpConsult.encode(D.data).finish();break;case"answer":D.data=com.quick.voice.proto.SdpConsult.encode(D.data).finish();break;case"candidate":D.data=com.quick.voice.proto.Candidates.encode(D.data).finish();break;case"subChannel":D.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(D.data).finish();break;case"closeTrack":D.data=com.quick.voice.proto.CloseTrackReq.encode(D.data).finish(),D.data=compressArrayBuffer(D.data),D.compress=!0;break;case"renegotiate":D.data=com.quick.voice.proto.RenegotiateReq.encode(D.data).finish(),D.data=compressArrayBuffer(D.data),D.compress=!0;break;case"reportNetwork":D.data=com.quick.voice.proto.ReportNetInfo.encode(D.data).finish();break;case"reportP2PConnect":D.data=com.quick.voice.proto.ReportP2PReq.encode(D.data).finish();break;case"syncRoomInfo":D.data=com.quick.voice.proto.SyncRoomInfoReq.encode(D.data).finish();break;case"updateCall":D.data=com.quick.voice.proto.UpdateCall.encode(D.data).finish();break;case"networkQualityChange":D.data=com.quick.voice.proto.NetQualityChange.encode(D.data).finish();break;case"pubNotify":D.data=com.quick.voice.proto.PublishNotify.encode(D.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":D.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(D.data).finish();break;case"heartbeat":{D.data=com.quick.voice.proto.ReportTrafficUsage.encode(D.data).finish();break}case"ackMsg":{D.data=com.quick.voice.proto.AckMsgReq.encode(D.data).finish();break}default:D.data=new Uint8Array;break}return D},onMessageFormat=D=>{const{event:M,compress:A=!1}=D;if(D.data_remote=D.data,D.time&&(D.timeStr=E$1(D.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),A)try{D.data=decompressArrayBuffer(D.data)}catch(N){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",N)}switch(M){case"login":D.data=com.quick.voice.proto.Login.decode(D.data);break;case"joinRoom":case"joinRoomEx":D.data=com.quick.voice.proto.JoinRsp.decode(D.data);break;case"onJoinRoom":D.data=com.quick.voice.proto.JoinNotify.decode(D.data);break;case"onQuitRoom":D.data=com.quick.voice.proto.QuitNotify.decode(D.data);break;case"connectCF":D.data=com.quick.voice.proto.ConnectCFRsp.decode(D.data);break;case"publish":D.data=com.quick.voice.proto.PublishRsp.decode(D.data);break;case"pubChannel":D.data=com.quick.voice.proto.ChannelPublishRsq.decode(D.data);break;case"onPublish":D.data=com.quick.voice.proto.PublishNotify.decode(D.data);break;case"subscribe":D.data=com.quick.voice.proto.SubscribeRsp.decode(D.data);break;case"onAttemptP2PReq":D.data=com.quick.voice.proto.P2PAttemptConnectReq.decode(D.data);break;case"onOffer":D.data=com.quick.voice.proto.SdpConsult.decode(D.data);break;case"onAnswer":D.data=com.quick.voice.proto.SdpConsult.decode(D.data);break;case"onCandidate":D.data=com.quick.voice.proto.Candidates.decode(D.data);break;case"subChannel":D.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(D.data);break;case"closeTrack":D.data=com.quick.voice.proto.CloseTrackRsp.decode(D.data);break;case"onCloseTrack":D.data=com.quick.voice.proto.CloseTrackNotify.decode(D.data);break;case"onTrackInactive":D.data=com.quick.voice.proto.CheckSessionRsq.decode(D.data);break;case"onUpdateCall":D.data=com.quick.voice.proto.UpdateCall.decode(D.data);break;case"onDataChannelPublish":D.data=com.quick.voice.proto.UserChannel.decode(D.data);break;case"onDestroyRoom":D.data=com.quick.voice.proto.QuitNotify.decode(D.data);break;case"onUpdatePermissions":D.data=com.quick.voice.proto.UpdatePermissions.decode(D.data);break;case"onNetQuality":D.data=com.quick.voice.proto.NetQualityNotify.decode(D.data);break;case"syncRoomInfo":D.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(D.data);break;case"onCDNPlayUrlAdd":D.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(D.data);break;case"onUpdateBehavior":D.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(D.data);break;case"debugger":D.data=JSON.parse(new TextDecoder().decode(D.data));break}return D};class CallsWebSocket{constructor(M){_e(this,Oe,{url:"wss://putplay.cqrjz.com/websocket",debug:!1,timeout:30*1e3});ee(this,"prws",new H({url:"",binaryType:"arraybuffer",reconnectCount:8,timeout:10*1e3,reconnectTime:40*1e3}));ee(this,"activeTimeStamp",0);_e(this,xe,{});_e(this,Ae,{});ee(this,"getUrl",async(M="prod")=>{try{const O=(await(await fetch(`https://address.putplay.cc/?env=${M}`)).json()).domain;fe(this,Oe).url=O,this.prws.setOptions({url:O})}catch(A){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: get serve url is error.",A)}});ee(this,"afreshSends",()=>{const M=Object.keys(fe(this,xe));for(const A of M){const N=fe(this,xe)[A];N&&N.send()}});_e(this,ct,(M,A={})=>{try{const{time:N,event:O,data:C={},data_original:i={},data_remote:u,...$}=A,B=E$1(N,"YYYY-MM-DD hh:mm:ss",{offset:480});let F={};const Z=(ye={})=>{const te=JSON.parse(JSON.stringify(ye)),re=Object.keys(te);for(const le of re)(le.includes("sdp")||le.includes("Sdp"))&&(te[le]="");return te};let K="res ↓";switch(M){case"res":K="res ↓",F=Z(C);break;case"req":K="req ↑",F=Z(i);break}let J="#quickvo.logs";(reqIgnoreEvents.includes(O)||resIgnoreEvents.includes(O))&&(J="#quickvo.ignoreEvents");const Y={"#action":K,timeStr:B,event:O,data:F,time:N,...$},ae=localStorage.getItem(J)||JSON.stringify([]),oe=JSON.parse(ae);let ne=O==="heartbeat"||O==="heartbeatEx";const ue=[Y];for(const ye of oe){const{event:te}=ye;if(te==="heartbeat"||te==="heartbeatEx"){if(ne)continue;ne=!0}if(ue.length===200)break;ue.push(ye)}localStorage.setItem(J,JSON.stringify(ue))}catch(N){fe(this,Oe).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",N)}});_e(this,Ht,(M,{resolve:A,reject:N},O)=>{const{sn:C=""}=M,i={message:M,resolve:A,reject:N,send:()=>{},destruction:()=>{},destructionTimer:0};return i.send=()=>{var $;clearTimeout(i.destructionTimer),O&&(i.destruction=()=>{const B=fe(this,xe)[C];clearTimeout(B.destructionTimer),delete fe(this,xe)[C]},i.destructionTimer=window.setTimeout(()=>{const B=fe(this,xe)[C];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: event is timeout",B),B.destruction(),N("event is timeout")},fe(this,Oe).timeout));const u=com.quick.voice.proto.CommonReq.encode(M).finish();($=this.prws)==null||$.sendMessage(u),O||A(!0)},fe(this,xe)[C]=i,i});_e(this,Zt,M=>fe(this,xe)[M]);_e(this,Jt,async M=>{const A=new Uint8Array(M),N=com.quick.voice.proto.CommonRsp.decode(A),{sn:O,event:C}=N,i=onMessageFormat(N);if(fe(this,ct).call(this,"res",i),fe(this,Oe).debug&&!resIgnoreEvents.includes(C)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i),["heartbeat","heartbeatEx"].includes(C)&&(this.activeTimeStamp=new Date().getTime()),notifyName_keys.includes(C))return this.emitNotify(C,V(i,["code","data","desc"]));const $=fe(this,Zt).call(this,O);if($){const{resolve:B=Z=>{},destruction:F=()=>{}}=$;B(V(i,["code","data","desc","sn"])),F()}});ee(this,"clearEvents",(M=[])=>{const A=Object.keys(fe(this,xe));M.length===0&&(M=A);for(const N of A){if(!M.includes(N))continue;const O=fe(this,xe)[N];if(O){const{destruction:C}=O;C()}}});ee(this,"connect",async()=>new Promise(async(M,A)=>{try{const N=new Date().getTime();await this.prws.connect();const O=new Date().getTime();if(this.activeTimeStamp=O,fe(this,Oe).debug){const C=O-N;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${C}ms-广播事件`,fe(this,Ae))}M(this.prws)}catch(N){A(N)}}));ee(this,"close",async()=>{var M;this.clearEvents(),await((M=this.prws)==null?void 0:M.close()),fe(this,Oe).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.")});ee(this,"sendMessage",(M,A=!0)=>new Promise(async(N,O)=>{const{event:C,...i}=M,u=Date.now(),$=sendMessageFormat({event:C,sn:+`${u}${v$1(1e3,9999)}`,time:u,valid:fe(this,Oe).timeout,version:3,compress:!1,...i});fe(this,ct).call(this,"req",$),fe(this,Oe).debug&&!reqIgnoreEvents.includes(C)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",$),fe(this,Ht).call(this,$,{resolve:N,reject:O},A).send()}));ee(this,"emitNotify",async(M,A)=>{const N=fe(this,Ae)[M]||[];for(const O of N){const{callback:C=async()=>{}}=O;await C(A)}});ee(this,"addNotify",(M,A=!1)=>{const{event:N,sn:O=wt(32)}=M;fe(this,Ae)[N]||(fe(this,Ae)[N]=[]);const C=fe(this,Ae)[N],i=C.findIndex(u=>u.sn===O);return i!==-1&&C.splice(i,1),A?C.unshift(M):C.push(M),O});ee(this,"removeNotify",(M=[])=>{if(M.length===0)Be(this,Ae,{});else{const A=Object.keys(fe(this,Ae));for(const N of A)fe(this,Ae)[N]=fe(this,Ae)[N].filter(O=>!M.includes(O.sn||""))}fe(this,Oe).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",fe(this,Ae))});Be(this,Oe,{...fe(this,Oe),...M}),this.prws.setOptions(fe(this,Oe)),this.prws.onMessage=fe(this,Jt),this.prws.getHeartbeatMsg=()=>""}}Oe=new WeakMap,xe=new WeakMap,Ae=new WeakMap,ct=new WeakMap,Ht=new WeakMap,Zt=new WeakMap,Jt=new WeakMap;const createMutedAudioStream=D=>{const M=D.createOscillator();M.type="sine",M.frequency.setValueAtTime(0,D.currentTime);const A=D.createGain();A.gain.value=0,M.connect(A),A.connect(D.destination),M.start();const N=D.createMediaStreamDestination();return A.disconnect(),M.connect(N),N.stream},createFakeVideoStream=(D=10,M=10,A=30)=>{const N=document.createElement("canvas"),O=N.getContext("2d");N.width=D,N.height=M;let C=0;return setInterval(()=>{O.clearRect(0,0,N.width,N.height);const $=O.createLinearGradient(0,0,N.width,N.height);$.addColorStop(0,`hsla(${C}, 100%, 50%, 0)`),$.addColorStop(1,`hsla(${C+120}, 100%, 50%, 0)`),O.fillStyle=$,O.fillRect(0,0,N.width,N.height),C=(C+1)%360},100),N.captureStream(A)};class NetworkQualityTester{constructor(M=[]){ee(this,"targetUrls",[]);ee(this,"results",[]);M.length===0&&M.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=M,this.results=[]}async testAll(){const M=this.targetUrls.map(A=>this.testUrl(A));return await Promise.all(M),this.analyzeResults()}async testUrl(M){const A=performance.now();let N=0,O=!1;try{await fetch(M,{method:"HEAD",cache:"no-store"});const C=performance.now()-A,i=performance.now(),$=await(await fetch(M,{cache:"no-store"})).blob(),B=performance.now()-i;N=$.size,O=!0,this.results.push({url:M,success:O,headTime:C,getTime:B,size:N,downloadSpeed:N>0?(N/1024/(B/1e3)).toFixed(2):0,totalTime:performance.now()-A})}catch(C){this.results.push({url:M,success:!1,error:C.message,totalTime:performance.now()-A})}}analyzeResults(){const M=this.results.filter(C=>C.success);if(M.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const A=M.reduce((C,i)=>C+i.size,0),N=M.reduce((C,i)=>C+i.totalTime,0),O=M.reduce((C,i)=>C+parseFloat(i.downloadSpeed),0)/M.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:M.length,averageDownloadSpeed:`${O.toFixed(2)} KB/s`,averageResponseTime:`${(N/M.length).toFixed(2)}ms`,totalDataTransferred:`${(A/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(D){(function(M){var A="undefined",N=A!==typeof Buffer&&Buffer,O=A!==typeof Uint8Array&&Uint8Array,C=A!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],u=Array.isArray||le,$=4294967296,B=16777216,F;Z("Uint64BE",!0,!0),Z("Int64BE",!0,!1),Z("Uint64LE",!1,!0),Z("Int64LE",!1,!1);function Z(ce,de,me){var ie=de?0:4,he=de?4:0,ke=de?0:3,be=de?1:2,we=de?2:1,Te=de?3:0,qe=de?ue:te,Fe=de?ye:re,je=Ce.prototype,Ke="is"+ce,vt="_"+Ke;return je.buffer=void 0,je.offset=0,je[vt]=!0,je.toNumber=Qe,je.toString=at,je.toJSON=Qe,je.toArray=K,N&&(je.toBuffer=J),O&&(je.toArrayBuffer=Y),Ce[Ke]=Re,M[ce]=Ce,Ce;function Ce(Se,ge,Ie,$e){return this instanceof Ce?ot(this,Se,ge,Ie,$e):new Ce(Se,ge,Ie,$e)}function Re(Se){return!!(Se&&Se[vt])}function ot(Se,ge,Ie,$e,Pe){if(O&&C&&(ge instanceof C&&(ge=new O(ge)),$e instanceof C&&($e=new O($e))),!ge&&!Ie&&!$e&&!F){Se.buffer=ne(i,0);return}if(!ae(ge,Ie)){var ze=F||Array;Pe=Ie,$e=ge,Ie=0,ge=F===N?N.alloc(8):new ze(8)}Se.buffer=ge,Se.offset=Ie|=0,A!==typeof $e&&(typeof $e=="string"?Le(ge,Ie,$e,Pe||10):ae($e,Pe)?oe(ge,Ie,$e,Pe):typeof Pe=="number"?(Ye(ge,Ie+ie,$e),Ye(ge,Ie+he,Pe)):$e>0?qe(ge,Ie,$e):$e<0?Fe(ge,Ie,$e):oe(ge,Ie,i,0))}function Le(Se,ge,Ie,$e){var Pe=0,ze=Ie.length,Ve=0,Je=0;Ie[0]==="-"&&Pe++;for(var st=Pe;Pe<ze;){var kt=parseInt(Ie[Pe++],$e);if(!(kt>=0))break;Je=Je*$e+kt,Ve=Ve*$e+Math.floor(Je/$),Je%=$}st&&(Ve=~Ve,Je?Je=$-Je:Ve++),Ye(Se,ge+ie,Ve),Ye(Se,ge+he,Je)}function Qe(){var Se=this.buffer,ge=this.offset,Ie=Ze(Se,ge+ie),$e=Ze(Se,ge+he);return me||(Ie|=0),Ie?Ie*$+$e:$e}function at(Se){var ge=this.buffer,Ie=this.offset,$e=Ze(ge,Ie+ie),Pe=Ze(ge,Ie+he),ze="",Ve=!me&&$e&2147483648;for(Ve&&($e=~$e,Pe=$-Pe),Se=Se||10;;){var Je=$e%Se*$+Pe;if($e=Math.floor($e/Se),Pe=Math.floor(Je/Se),ze=(Je%Se).toString(Se)+ze,!$e&&!Pe)break}return Ve&&(ze="-"+ze),ze}function Ye(Se,ge,Ie){Se[ge+Te]=Ie&255,Ie=Ie>>8,Se[ge+we]=Ie&255,Ie=Ie>>8,Se[ge+be]=Ie&255,Ie=Ie>>8,Se[ge+ke]=Ie&255}function Ze(Se,ge){return Se[ge+ke]*B+(Se[ge+be]<<16)+(Se[ge+we]<<8)+Se[ge+Te]}}function K(ce){var de=this.buffer,me=this.offset;return F=null,ce!==!1&&u(de)?de.length===8?de:de.slice(me,me+8):ne(de,me)}function J(ce){var de=this.buffer,me=this.offset;return F=N,ce!==!1&&N.isBuffer(de)?de.length===8?de:de.slice(me,me+8):N.from(Y.call(this,ce))}function Y(ce){var de=this.buffer,me=this.offset,ie=de.buffer;if(F=O,ce!==!1&&!de.offset&&ie instanceof C)return ie.byteLength===8?ie:ie.slice(me,me+8);var he=new O(8);return oe(he,0,de,me),he.buffer}function ae(ce,de){var me=ce&&ce.length;return de|=0,me&&de+8<=me&&typeof ce[de]!="string"}function oe(ce,de,me,ie){de|=0,ie|=0;for(var he=0;he<8;he++)ce[de++]=me[ie++]&255}function ne(ce,de){return Array.prototype.slice.call(ce,de,de+8)}function ue(ce,de,me){for(var ie=de+8;ie>de;)ce[--ie]=me&255,me/=256}function ye(ce,de,me){var ie=de+8;for(me++;ie>de;)ce[--ie]=-me&255^255,me/=256}function te(ce,de,me){for(var ie=de+8;de<ie;)ce[de++]=me&255,me/=256}function re(ce,de,me){var ie=de+8;for(me++;de<ie;)ce[de++]=-me&255^255,me/=256}function le(ce){return!!ce&&Object.prototype.toString.call(ce)=="[object Array]"}})(typeof D.nodeName!="string"?D: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 D=requireTools(),M=requireTools(),A=requireEbmlID(),N=function(){function O(){this._schema=A.byEbmlID,this._buffers=[],this._stack=[]}return O.prototype.encode=function(C){var i=this;return D.concat(C.reduce(function(u,$){return u.concat(i.encodeChunk($))},[])).buffer},O.prototype.encodeChunk=function(C){return C.type==="m"?C.isEnd?this.endTag(C):this.startTag(C):(C.data=M.Buffer.from(C.data),this.writeTag(C)),this.flush()},O.prototype.flush=function(){var C=this._buffers;return this._buffers=[],C},O.prototype.getSchemaInfo=function(C){for(var i=Object.keys(this._schema).map(Number),u=0;u<i.length;u++){var $=i[u];if(this._schema[$].name===C)return new M.Buffer($.toString(16),"hex")}return null},O.prototype.writeTag=function(C){var i=C.name,u=this.getSchemaInfo(i),$=C.data;if(u==null)throw new Error("No schema entry found for "+i);var B=D.encodeTag(u,$);if(this._stack.length>0){var F=this._stack[this._stack.length-1];F.children.push({tagId:u,elm:C,children:[],data:B});return}this._buffers=this._buffers.concat(B)},O.prototype.startTag=function(C){var i=C.name,u=this.getSchemaInfo(i);if(u==null)throw new Error("No schema entry found for "+i);if(C.unknownSize){var $=D.encodeTag(u,new M.Buffer(0),C.unknownSize);this._buffers=this._buffers.concat($);return}var B={tagId:u,elm:C,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(B),this._stack.push(B)},O.prototype.endTag=function(C){C.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==C.name)throw new Error("EBML structure is broken");var u=i.children.reduce(function(B,F){if(F.data===null)throw new Error("EBML structure is broken");return B.concat(F.data)},[]),$=D.concat(u);i.elm.type==="m"?i.data=D.encodeTag(i.tagId,$,i.elm.unknownSize):i.data=D.encodeTag(i.tagId,$),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},O}();return EBMLEncoder.default=N,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=u,base64Js.toByteArray=B,base64Js.fromByteArray=K;for(var D=[],M=[],A=typeof Uint8Array<"u"?Uint8Array:Array,N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=0,C=N.length;O<C;++O)D[O]=N[O],M[N.charCodeAt(O)]=O;M[45]=62,M[95]=63;function i(J){var Y=J.length;if(Y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ae=J.indexOf("=");ae===-1&&(ae=Y);var oe=ae===Y?0:4-ae%4;return[ae,oe]}function u(J){var Y=i(J),ae=Y[0],oe=Y[1];return(ae+oe)*3/4-oe}function $(J,Y,ae){return(Y+ae)*3/4-ae}function B(J){var Y,ae=i(J),oe=ae[0],ne=ae[1],ue=new A($(J,oe,ne)),ye=0,te=ne>0?oe-4:oe,re;for(re=0;re<te;re+=4)Y=M[J.charCodeAt(re)]<<18|M[J.charCodeAt(re+1)]<<12|M[J.charCodeAt(re+2)]<<6|M[J.charCodeAt(re+3)],ue[ye++]=Y>>16&255,ue[ye++]=Y>>8&255,ue[ye++]=Y&255;return ne===2&&(Y=M[J.charCodeAt(re)]<<2|M[J.charCodeAt(re+1)]>>4,ue[ye++]=Y&255),ne===1&&(Y=M[J.charCodeAt(re)]<<10|M[J.charCodeAt(re+1)]<<4|M[J.charCodeAt(re+2)]>>2,ue[ye++]=Y>>8&255,ue[ye++]=Y&255),ue}function F(J){return D[J>>18&63]+D[J>>12&63]+D[J>>6&63]+D[J&63]}function Z(J,Y,ae){for(var oe,ne=[],ue=Y;ue<ae;ue+=3)oe=(J[ue]<<16&16711680)+(J[ue+1]<<8&65280)+(J[ue+2]&255),ne.push(F(oe));return ne.join("")}function K(J){for(var Y,ae=J.length,oe=ae%3,ne=[],ue=16383,ye=0,te=ae-oe;ye<te;ye+=ue)ne.push(Z(J,ye,ye+ue>te?te:ye+ue));return oe===1?(Y=J[ae-1],ne.push(D[Y>>2]+D[Y<<4&63]+"==")):oe===2&&(Y=(J[ae-2]<<8)+J[ae-1],ne.push(D[Y>>10]+D[Y>>4&63]+D[Y<<2&63]+"=")),ne.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,M,A,N,O){var C,i,u=O*8-N-1,$=(1<<u)-1,B=$>>1,F=-7,Z=A?O-1:0,K=A?-1:1,J=D[M+Z];for(Z+=K,C=J&(1<<-F)-1,J>>=-F,F+=u;F>0;C=C*256+D[M+Z],Z+=K,F-=8);for(i=C&(1<<-F)-1,C>>=-F,F+=N;F>0;i=i*256+D[M+Z],Z+=K,F-=8);if(C===0)C=1-B;else{if(C===$)return i?NaN:(J?-1:1)*(1/0);i=i+Math.pow(2,N),C=C-B}return(J?-1:1)*i*Math.pow(2,C-N)},ieee754.write=function(D,M,A,N,O,C){var i,u,$,B=C*8-O-1,F=(1<<B)-1,Z=F>>1,K=O===23?Math.pow(2,-24)-Math.pow(2,-77):0,J=N?0:C-1,Y=N?1:-1,ae=M<0||M===0&&1/M<0?1:0;for(M=Math.abs(M),isNaN(M)||M===1/0?(u=isNaN(M)?1:0,i=F):(i=Math.floor(Math.log(M)/Math.LN2),M*($=Math.pow(2,-i))<1&&(i--,$*=2),i+Z>=1?M+=K/$:M+=K*Math.pow(2,1-Z),M*$>=2&&(i++,$/=2),i+Z>=F?(u=0,i=F):i+Z>=1?(u=(M*$-1)*Math.pow(2,O),i=i+Z):(u=M*Math.pow(2,Z-1)*Math.pow(2,O),i=0));O>=8;D[A+J]=u&255,J+=Y,u/=256,O-=8);for(i=i<<O|u,B+=O;B>0;D[A+J]=i&255,J+=Y,i/=256,B-=8);D[A+J-Y]|=ae*128}),ieee754}/*!
3
+ `},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var A=requireParser(),B=requireWriter$1(),D=requireGrammar();return lib$1.grammar=D,lib$1.write=B,lib$1.parse=A.parse,lib$1.parseParams=A.parseParams,lib$1.parseFmtpConfig=A.parseFmtpConfig,lib$1.parsePayloads=A.parsePayloads,lib$1.parseRemoteCandidates=A.parseRemoteCandidates,lib$1.parseImageAttributes=A.parseImageAttributes,lib$1.parseSimulcastStreamList=A.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{kind="video";stream=new MediaStream;constructor(B){this.stream.addTrack(B)}stop=()=>{const B=this.stream.getTracks();for(const D of B)D.stop(),this.stream.removeTrack(D)};replaceStream=B=>{const D=this.stream,M=D.getTracks();for(const C of M)D.removeTrack(C);const[O]=B.getVideoTracks();O&&D.addTrack(O)};getStream=()=>this.stream;getTrack=()=>this.stream.getTracks()[0]}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var I=Object.defineProperty,k=A=>{throw TypeError(A)},S=(A,B,D)=>B in A?I(A,B,{enumerable:!0,configurable:!0,writable:!0,value:D}):A[B]=D,a$1=(A,B,D)=>S(A,typeof B!="symbol"?B+"":B,D),R=(A,B,D)=>B.has(A)||k("Cannot "+D),t=(A,B,D)=>(R(A,B,"read from private field"),D?D.call(A):B.get(A)),h$1=(A,B,D)=>B.has(A)?k("Cannot add the same private member more than once"):B instanceof WeakSet?B.add(A):B.set(A,D),r=(A,B,D,M)=>(R(A,B,"write to private field"),B.set(A,D),D);const E=(A=0,B=1)=>{const D=Math.max(0,A),M=Math.max(1,B),O=Math.random()*(M-D+1)+D;return parseInt(`${O}`,10)},L=(A=16,B=16)=>{const D="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),M=Math.min(D.length,B),O=Date.now().toString(M),C=O.split(""),i=Math.max(4,A-O.length);for(let u=0;u<i;u++){const $=E(0,M-1),N=D[$];C.push(N)}return C.join("").toUpperCase()};var s$1,c,l$1,m$1,p$1,f,w,g$2,b,y$1,x;class H{constructor(B){h$1(this,s$1,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,autoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4}),a$1(this,"ws"),h$1(this,c,""),h$1(this,l$1,-1),h$1(this,m$1,-1),h$1(this,p$1,0),h$1(this,f,0),h$1(this,w,!1),a$1(this,"checkReconnect",async D=>!0),a$1(this,"onReconnectSuccess",async D=>{}),a$1(this,"onReconnectStop",async D=>{}),a$1(this,"getHeartbeatMsg",()=>JSON.stringify({event:"heartbeat"})),a$1(this,"onMessage",D=>{}),a$1(this,"setOptions",D=>{r(this,s$1,{...t(this,s$1),...D})}),a$1(this,"connect",()=>new Promise(async(D,M)=>{r(this,c,L()),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;padding:16px 0;","------->pr-ws: connecting.",{key:t(this,c),url:t(this,s$1).url}),this.ws=new WebSocket(t(this,s$1).url),this.ws.binaryType=t(this,s$1).binaryType,this.ws.addEventListener("message",t(this,b)),this.ws.addEventListener("open",O=>{clearTimeout(t(this,p$1)),r(this,l$1,t(this,s$1).reconnectCount),r(this,w,!1),r(this,m$1,-1),t(this,y$1).call(this),t(this,s$1).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;padding:16px 0;","------->pr-ws: connected.",{key:t(this,c),url:t(this,s$1).url}),D(O)}),this.ws.addEventListener("error",O=>{clearTimeout(t(this,p$1)),t(this,s$1).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is error.",{key:t(this,c),url:t(this,s$1).url,e:O}),M(O)}),this.ws.addEventListener("close",O=>{if(t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;padding:16px 0;","------->pr-ws: connect is close.",{key:t(this,c),url:t(this,s$1).url,e:O}),t(this,w)===!1)return this.reconnect(O);t(this,x).call(this),this.ws=void 0}),r(this,p$1,window.setTimeout(()=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is timeout.",{key:t(this,c),url:t(this,s$1).url}),M("connect is timeout.")},t(this,s$1).timeout))})),a$1(this,"reconnect",async D=>new Promise(async(M,O)=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.",{key:t(this,c),url:t(this,s$1).url});const C=i=>{t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: reconnect is stop. ",{key:t(this,c),url:t(this,s$1).url,msg:i}),this.onReconnectStop({msg:i}),O(i)};if(t(this,g$2).call(this)===!1)return C("stop reconnect. exceed maxReconnectionTime.");if(t(this,l$1)!==-1&&t(this,l$1)===0)return C("stop reconnect. surplusReconnectCount is 0.");if(!await this.checkReconnect(D))return C("stop reconnect. checkReconnect is false.");t(this,s$1).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t(this,s$1).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t(this,l$1)}`,{key:t(this,c)}),await new Promise(i=>setTimeout(()=>i(!0),t(this,s$1).reconnectIntervalTime)),r(this,l$1,Math.max(-1,t(this,l$1)-1)),await this.connect().then(this.onReconnectSuccess),M(this.ws)})),a$1(this,"sendMessage",async D=>{var M;(!this.ws||this.ws.readyState!==1)&&(t(this,s$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.",{key:t(this,c),url:t(this,s$1).url}),t(this,s$1).autoConnect&&(t(this,s$1).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws auto connect.",{key:t(this,c),url:t(this,s$1).url}),await this.connect())),(M=this.ws)==null||M.send(D)}),a$1(this,"close",async(D=1e3,M="correctly close.")=>{var O;this.ws&&(r(this,w,!0),t(this,x).call(this),(O=this.ws)==null||O.close(D,M))}),h$1(this,g$2,()=>{const D=Date.now();return t(this,m$1)===-1&&r(this,m$1,D+t(this,s$1).reconnectTime),!(D>t(this,m$1))}),h$1(this,b,D=>{const{data:M}=D;this.onMessage(M)}),h$1(this,y$1,()=>{r(this,f,window.setInterval(()=>{const D=this.getHeartbeatMsg();D&&this.sendMessage(D)},t(this,s$1).heartbeatIntervalTime))}),h$1(this,x,()=>{clearInterval(t(this,f))}),r(this,s$1,{...t(this,s$1),...B}),r(this,l$1,t(this,s$1).reconnectCount)}}s$1=new WeakMap,c=new WeakMap,l$1=new WeakMap,m$1=new WeakMap,p$1=new WeakMap,f=new WeakMap,w=new WeakMap,g$2=new WeakMap,b=new WeakMap,y$1=new WeakMap,x=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=A;function A(B,D){for(var M=new Array(arguments.length-1),O=0,C=2,i=!0;C<arguments.length;)M[O++]=arguments[C++];return new Promise(function($,N){M[O]=function(Z){if(i)if(i=!1,Z)N(Z);else{for(var K=new Array(arguments.length-1),J=0;J<K.length;)K[J++]=arguments[J];$.apply(null,K)}};try{B.apply(D||null,M)}catch(F){i&&(i=!1,N(F))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(A){var B=A;B.length=function(u){var $=u.length;if(!$)return 0;for(var N=0;--$%4>1&&u.charAt($)==="=";)++N;return Math.ceil(u.length*3)/4-N};for(var D=new Array(64),M=new Array(123),O=0;O<64;)M[D[O]=O<26?O+65:O<52?O+71:O<62?O-4:O-59|43]=O++;B.encode=function(u,$,N){for(var F=null,Z=[],K=0,J=0,Y;$<N;){var oe=u[$++];switch(J){case 0:Z[K++]=D[oe>>2],Y=(oe&3)<<4,J=1;break;case 1:Z[K++]=D[Y|oe>>4],Y=(oe&15)<<2,J=2;break;case 2:Z[K++]=D[Y|oe>>6],Z[K++]=D[oe&63],J=0;break}K>8191&&((F||(F=[])).push(String.fromCharCode.apply(String,Z)),K=0)}return J&&(Z[K++]=D[Y],Z[K++]=61,J===1&&(Z[K++]=61)),F?(K&&F.push(String.fromCharCode.apply(String,Z.slice(0,K))),F.join("")):String.fromCharCode.apply(String,Z.slice(0,K))};var C="invalid encoding";B.decode=function(u,$,N){for(var F=N,Z=0,K,J=0;J<u.length;){var Y=u.charCodeAt(J++);if(Y===61&&Z>1)break;if((Y=M[Y])===void 0)throw Error(C);switch(Z){case 0:K=Y,Z=1;break;case 1:$[N++]=K<<2|(Y&48)>>4,K=Y,Z=2;break;case 2:$[N++]=(K&15)<<4|(Y&60)>>2,K=Y,Z=3;break;case 3:$[N++]=(K&3)<<6|Y,Z=0;break}}if(Z===1)throw Error(C);return N-F},B.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=A;function A(){this._listeners={}}return A.prototype.on=function(D,M,O){return(this._listeners[D]||(this._listeners[D]=[])).push({fn:M,ctx:O||this}),this},A.prototype.off=function(D,M){if(D===void 0)this._listeners={};else if(M===void 0)this._listeners[D]=[];else for(var O=this._listeners[D],C=0;C<O.length;)O[C].fn===M?O.splice(C,1):++C;return this},A.prototype.emit=function(D){var M=this._listeners[D];if(M){for(var O=[],C=1;C<arguments.length;)O.push(arguments[C++]);for(C=0;C<M.length;)M[C].fn.apply(M[C++].ctx,O)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=A(A);function A(C){return typeof Float32Array<"u"?function(){var i=new Float32Array([-0]),u=new Uint8Array(i.buffer),$=u[3]===128;function N(J,Y,oe){i[0]=J,Y[oe]=u[0],Y[oe+1]=u[1],Y[oe+2]=u[2],Y[oe+3]=u[3]}function F(J,Y,oe){i[0]=J,Y[oe]=u[3],Y[oe+1]=u[2],Y[oe+2]=u[1],Y[oe+3]=u[0]}C.writeFloatLE=$?N:F,C.writeFloatBE=$?F:N;function Z(J,Y){return u[0]=J[Y],u[1]=J[Y+1],u[2]=J[Y+2],u[3]=J[Y+3],i[0]}function K(J,Y){return u[3]=J[Y],u[2]=J[Y+1],u[1]=J[Y+2],u[0]=J[Y+3],i[0]}C.readFloatLE=$?Z:K,C.readFloatBE=$?K:Z}():function(){function i($,N,F,Z){var K=N<0?1:0;if(K&&(N=-N),N===0)$(1/N>0?0:2147483648,F,Z);else if(isNaN(N))$(2143289344,F,Z);else if(N>34028234663852886e22)$((K<<31|2139095040)>>>0,F,Z);else if(N<11754943508222875e-54)$((K<<31|Math.round(N/1401298464324817e-60))>>>0,F,Z);else{var J=Math.floor(Math.log(N)/Math.LN2),Y=Math.round(N*Math.pow(2,-J)*8388608)&8388607;$((K<<31|J+127<<23|Y)>>>0,F,Z)}}C.writeFloatLE=i.bind(null,B),C.writeFloatBE=i.bind(null,D);function u($,N,F){var Z=$(N,F),K=(Z>>31)*2+1,J=Z>>>23&255,Y=Z&8388607;return J===255?Y?NaN:K*(1/0):J===0?K*1401298464324817e-60*Y:K*Math.pow(2,J-150)*(Y+8388608)}C.readFloatLE=u.bind(null,M),C.readFloatBE=u.bind(null,O)}(),typeof Float64Array<"u"?function(){var i=new Float64Array([-0]),u=new Uint8Array(i.buffer),$=u[7]===128;function N(J,Y,oe){i[0]=J,Y[oe]=u[0],Y[oe+1]=u[1],Y[oe+2]=u[2],Y[oe+3]=u[3],Y[oe+4]=u[4],Y[oe+5]=u[5],Y[oe+6]=u[6],Y[oe+7]=u[7]}function F(J,Y,oe){i[0]=J,Y[oe]=u[7],Y[oe+1]=u[6],Y[oe+2]=u[5],Y[oe+3]=u[4],Y[oe+4]=u[3],Y[oe+5]=u[2],Y[oe+6]=u[1],Y[oe+7]=u[0]}C.writeDoubleLE=$?N:F,C.writeDoubleBE=$?F:N;function Z(J,Y){return u[0]=J[Y],u[1]=J[Y+1],u[2]=J[Y+2],u[3]=J[Y+3],u[4]=J[Y+4],u[5]=J[Y+5],u[6]=J[Y+6],u[7]=J[Y+7],i[0]}function K(J,Y){return u[7]=J[Y],u[6]=J[Y+1],u[5]=J[Y+2],u[4]=J[Y+3],u[3]=J[Y+4],u[2]=J[Y+5],u[1]=J[Y+6],u[0]=J[Y+7],i[0]}C.readDoubleLE=$?Z:K,C.readDoubleBE=$?K:Z}():function(){function i($,N,F,Z,K,J){var Y=Z<0?1:0;if(Y&&(Z=-Z),Z===0)$(0,K,J+N),$(1/Z>0?0:2147483648,K,J+F);else if(isNaN(Z))$(0,K,J+N),$(2146959360,K,J+F);else if(Z>17976931348623157e292)$(0,K,J+N),$((Y<<31|2146435072)>>>0,K,J+F);else{var oe;if(Z<22250738585072014e-324)oe=Z/5e-324,$(oe>>>0,K,J+N),$((Y<<31|oe/4294967296)>>>0,K,J+F);else{var re=Math.floor(Math.log(Z)/Math.LN2);re===1024&&(re=1023),oe=Z*Math.pow(2,-re),$(oe*4503599627370496>>>0,K,J+N),$((Y<<31|re+1023<<20|oe*1048576&1048575)>>>0,K,J+F)}}}C.writeDoubleLE=i.bind(null,B,0,4),C.writeDoubleBE=i.bind(null,D,4,0);function u($,N,F,Z,K){var J=$(Z,K+N),Y=$(Z,K+F),oe=(Y>>31)*2+1,re=Y>>>20&2047,te=4294967296*(Y&1048575)+J;return re===2047?te?NaN:oe*(1/0):re===0?oe*5e-324*te:oe*Math.pow(2,re-1075)*(te+4503599627370496)}C.readDoubleLE=u.bind(null,M,0,4),C.readDoubleBE=u.bind(null,O,4,0)}(),C}function B(C,i,u){i[u]=C&255,i[u+1]=C>>>8&255,i[u+2]=C>>>16&255,i[u+3]=C>>>24}function D(C,i,u){i[u]=C>>>24,i[u+1]=C>>>16&255,i[u+2]=C>>>8&255,i[u+3]=C&255}function M(C,i){return(C[i]|C[i+1]<<8|C[i+2]<<16|C[i+3]<<24)>>>0}function O(C,i){return(C[i]<<24|C[i+1]<<16|C[i+2]<<8|C[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(A){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(A){var B=A;B.length=function(M){for(var O=0,C=0,i=0;i<M.length;++i)C=M.charCodeAt(i),C<128?O+=1:C<2048?O+=2:(C&64512)===55296&&(M.charCodeAt(i+1)&64512)===56320?(++i,O+=4):O+=3;return O},B.read=function(M,O,C){var i=C-O;if(i<1)return"";for(var u=null,$=[],N=0,F;O<C;)F=M[O++],F<128?$[N++]=F:F>191&&F<224?$[N++]=(F&31)<<6|M[O++]&63:F>239&&F<365?(F=((F&7)<<18|(M[O++]&63)<<12|(M[O++]&63)<<6|M[O++]&63)-65536,$[N++]=55296+(F>>10),$[N++]=56320+(F&1023)):$[N++]=(F&15)<<12|(M[O++]&63)<<6|M[O++]&63,N>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,$)),N=0);return u?(N&&u.push(String.fromCharCode.apply(String,$.slice(0,N))),u.join("")):String.fromCharCode.apply(String,$.slice(0,N))},B.write=function(M,O,C){for(var i=C,u,$,N=0;N<M.length;++N)u=M.charCodeAt(N),u<128?O[C++]=u:u<2048?(O[C++]=u>>6|192,O[C++]=u&63|128):(u&64512)===55296&&(($=M.charCodeAt(N+1))&64512)===56320?(u=65536+((u&1023)<<10)+($&1023),++N,O[C++]=u>>18|240,O[C++]=u>>12&63|128,O[C++]=u>>6&63|128,O[C++]=u&63|128):(O[C++]=u>>12|224,O[C++]=u>>6&63|128,O[C++]=u&63|128);return C-i}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=A;function A(B,D,M){var O=M||8192,C=O>>>1,i=null,u=O;return function(N){if(N<1||N>C)return B(N);u+N>O&&(i=B(O),u=0);var F=D.call(i,u,u+=N);return u&7&&(u=(u|7)+1),F}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=B;var A=requireMinimal$1();function B(C,i){this.lo=C>>>0,this.hi=i>>>0}var D=B.zero=new B(0,0);D.toNumber=function(){return 0},D.zzEncode=D.zzDecode=function(){return this},D.length=function(){return 1};var M=B.zeroHash="\0\0\0\0\0\0\0\0";B.fromNumber=function(i){if(i===0)return D;var u=i<0;u&&(i=-i);var $=i>>>0,N=(i-$)/4294967296>>>0;return u&&(N=~N>>>0,$=~$>>>0,++$>4294967295&&($=0,++N>4294967295&&(N=0))),new B($,N)},B.from=function(i){if(typeof i=="number")return B.fromNumber(i);if(A.isString(i))if(A.Long)i=A.Long.fromString(i);else return B.fromNumber(parseInt(i,10));return i.low||i.high?new B(i.low>>>0,i.high>>>0):D},B.prototype.toNumber=function(i){if(!i&&this.hi>>>31){var u=~this.lo+1>>>0,$=~this.hi>>>0;return u||($=$+1>>>0),-(u+$*4294967296)}return this.lo+this.hi*4294967296},B.prototype.toLong=function(i){return A.Long?new A.Long(this.lo|0,this.hi|0,!!i):{low:this.lo|0,high:this.hi|0,unsigned:!!i}};var O=String.prototype.charCodeAt;return B.fromHash=function(i){return i===M?D:new B((O.call(i,0)|O.call(i,1)<<8|O.call(i,2)<<16|O.call(i,3)<<24)>>>0,(O.call(i,4)|O.call(i,5)<<8|O.call(i,6)<<16|O.call(i,7)<<24)>>>0)},B.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},B.prototype.zzEncode=function(){var i=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^i)>>>0,this.lo=(this.lo<<1^i)>>>0,this},B.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},B.prototype.length=function(){var i=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,$=this.hi>>>24;return $===0?u===0?i<16384?i<128?1:2:i<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:$<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(A){var B=A;B.asPromise=requireAspromise(),B.base64=requireBase64(),B.EventEmitter=requireEventemitter(),B.float=requireFloat(),B.inquire=requireInquire(),B.utf8=requireUtf8(),B.pool=requirePool(),B.LongBits=requireLongbits(),B.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),B.global=B.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,B.emptyArray=Object.freeze?Object.freeze([]):[],B.emptyObject=Object.freeze?Object.freeze({}):{},B.isInteger=Number.isInteger||function(C){return typeof C=="number"&&isFinite(C)&&Math.floor(C)===C},B.isString=function(C){return typeof C=="string"||C instanceof String},B.isObject=function(C){return C&&typeof C=="object"},B.isset=B.isSet=function(C,i){var u=C[i];return u!=null&&C.hasOwnProperty(i)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},B.Buffer=function(){try{var O=B.inquire("buffer").Buffer;return O.prototype.utf8Write?O:null}catch{return null}}(),B._Buffer_from=null,B._Buffer_allocUnsafe=null,B.newBuffer=function(C){return typeof C=="number"?B.Buffer?B._Buffer_allocUnsafe(C):new B.Array(C):B.Buffer?B._Buffer_from(C):typeof Uint8Array>"u"?C:new Uint8Array(C)},B.Array=typeof Uint8Array<"u"?Uint8Array:Array,B.Long=B.global.dcodeIO&&B.global.dcodeIO.Long||B.global.Long||B.inquire("long"),B.key2Re=/^true|false|0|1$/,B.key32Re=/^-?(?:0|[1-9][0-9]*)$/,B.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,B.longToHash=function(C){return C?B.LongBits.from(C).toHash():B.LongBits.zeroHash},B.longFromHash=function(C,i){var u=B.LongBits.fromHash(C);return B.Long?B.Long.fromBits(u.lo,u.hi,i):u.toNumber(!!i)};function D(O,C,i){for(var u=Object.keys(C),$=0;$<u.length;++$)(O[u[$]]===void 0||!i)&&(O[u[$]]=C[u[$]]);return O}B.merge=D,B.lcFirst=function(C){return C.charAt(0).toLowerCase()+C.substring(1)};function M(O){function C(i,u){if(!(this instanceof C))return new C(i,u);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,C):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&D(this,u)}return C.prototype=Object.create(Error.prototype,{constructor:{value:C,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return O},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),C}B.newError=M,B.ProtocolError=M("ProtocolError"),B.oneOfGetter=function(C){for(var i={},u=0;u<C.length;++u)i[C[u]]=1;return function(){for(var $=Object.keys(this),N=$.length-1;N>-1;--N)if(i[$[N]]===1&&this[$[N]]!==void 0&&this[$[N]]!==null)return $[N]}},B.oneOfSetter=function(C){return function(i){for(var u=0;u<C.length;++u)C[u]!==i&&delete this[C[u]]}},B.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},B._configure=function(){var O=B.Buffer;if(!O){B._Buffer_from=B._Buffer_allocUnsafe=null;return}B._Buffer_from=O.from!==Uint8Array.from&&O.from||function(i,u){return new O(i,u)},B._Buffer_allocUnsafe=O.allocUnsafe||function(i){return new O(i)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=$;var A=requireMinimal$1(),B,D=A.LongBits,M=A.base64,O=A.utf8;function C(re,te,ue){this.fn=re,this.len=te,this.next=void 0,this.val=ue}function i(){}function u(re){this.head=re.head,this.tail=re.tail,this.len=re.len,this.next=re.states}function $(){this.len=0,this.head=new C(i,0,0),this.tail=this.head,this.states=null}var N=function(){return A.Buffer?function(){return($.create=function(){return new B})()}:function(){return new $}};$.create=N(),$.alloc=function(te){return new A.Array(te)},A.Array!==Array&&($.alloc=A.pool($.alloc,A.Array.prototype.subarray)),$.prototype._push=function(te,ue,pe){return this.tail=this.tail.next=new C(te,ue,pe),this.len+=ue,this};function F(re,te,ue){te[ue]=re&255}function Z(re,te,ue){for(;re>127;)te[ue++]=re&127|128,re>>>=7;te[ue]=re}function K(re,te){this.len=re,this.next=void 0,this.val=te}K.prototype=Object.create(C.prototype),K.prototype.fn=Z,$.prototype.uint32=function(te){return this.len+=(this.tail=this.tail.next=new K((te=te>>>0)<128?1:te<16384?2:te<2097152?3:te<268435456?4:5,te)).len,this},$.prototype.int32=function(te){return te<0?this._push(J,10,D.fromNumber(te)):this.uint32(te)},$.prototype.sint32=function(te){return this.uint32((te<<1^te>>31)>>>0)};function J(re,te,ue){for(;re.hi;)te[ue++]=re.lo&127|128,re.lo=(re.lo>>>7|re.hi<<25)>>>0,re.hi>>>=7;for(;re.lo>127;)te[ue++]=re.lo&127|128,re.lo=re.lo>>>7;te[ue++]=re.lo}$.prototype.uint64=function(te){var ue=D.from(te);return this._push(J,ue.length(),ue)},$.prototype.int64=$.prototype.uint64,$.prototype.sint64=function(te){var ue=D.from(te).zzEncode();return this._push(J,ue.length(),ue)},$.prototype.bool=function(te){return this._push(F,1,te?1:0)};function Y(re,te,ue){te[ue]=re&255,te[ue+1]=re>>>8&255,te[ue+2]=re>>>16&255,te[ue+3]=re>>>24}$.prototype.fixed32=function(te){return this._push(Y,4,te>>>0)},$.prototype.sfixed32=$.prototype.fixed32,$.prototype.fixed64=function(te){var ue=D.from(te);return this._push(Y,4,ue.lo)._push(Y,4,ue.hi)},$.prototype.sfixed64=$.prototype.fixed64,$.prototype.float=function(te){return this._push(A.float.writeFloatLE,4,te)},$.prototype.double=function(te){return this._push(A.float.writeDoubleLE,8,te)};var oe=A.Array.prototype.set?function(te,ue,pe){ue.set(te,pe)}:function(te,ue,pe){for(var ee=0;ee<te.length;++ee)ue[pe+ee]=te[ee]};return $.prototype.bytes=function(te){var ue=te.length>>>0;if(!ue)return this._push(F,1,0);if(A.isString(te)){var pe=$.alloc(ue=M.length(te));M.decode(te,pe,0),te=pe}return this.uint32(ue)._push(oe,ue,te)},$.prototype.string=function(te){var ue=O.length(te);return ue?this.uint32(ue)._push(O.write,ue,te):this._push(F,1,0)},$.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new C(i,0,0),this.len=0,this},$.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new C(i,0,0),this.len=0),this},$.prototype.ldelim=function(){var te=this.head,ue=this.tail,pe=this.len;return this.reset().uint32(pe),pe&&(this.tail.next=te.next,this.tail=ue,this.len+=pe),this},$.prototype.finish=function(){for(var te=this.head.next,ue=this.constructor.alloc(this.len),pe=0;te;)te.fn(te.val,ue,pe),pe+=te.len,te=te.next;return ue},$._configure=function(re){B=re,$.create=N(),B._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=D;var A=requireWriter();(D.prototype=Object.create(A.prototype)).constructor=D;var B=requireMinimal$1();function D(){A.call(this)}D._configure=function(){D.alloc=B._Buffer_allocUnsafe,D.writeBytesBuffer=B.Buffer&&B.Buffer.prototype instanceof Uint8Array&&B.Buffer.prototype.set.name==="set"?function(C,i,u){i.set(C,u)}:function(C,i,u){if(C.copy)C.copy(i,u,0,C.length);else for(var $=0;$<C.length;)i[u++]=C[$++]}},D.prototype.bytes=function(C){B.isString(C)&&(C=B._Buffer_from(C,"base64"));var i=C.length>>>0;return this.uint32(i),i&&this._push(D.writeBytesBuffer,i,C),this};function M(O,C,i){O.length<40?B.utf8.write(O,C,i):C.utf8Write?C.utf8Write(O,i):C.write(O,i)}return D.prototype.string=function(C){var i=B.Buffer.byteLength(C);return this.uint32(i),i&&this._push(M,i,C),this},D._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=C;var A=requireMinimal$1(),B,D=A.LongBits,M=A.utf8;function O(Z,K){return RangeError("index out of range: "+Z.pos+" + "+(K||1)+" > "+Z.len)}function C(Z){this.buf=Z,this.pos=0,this.len=Z.length}var i=typeof Uint8Array<"u"?function(K){if(K instanceof Uint8Array||Array.isArray(K))return new C(K);throw Error("illegal buffer")}:function(K){if(Array.isArray(K))return new C(K);throw Error("illegal buffer")},u=function(){return A.Buffer?function(J){return(C.create=function(oe){return A.Buffer.isBuffer(oe)?new B(oe):i(oe)})(J)}:i};C.create=u(),C.prototype._slice=A.Array.prototype.subarray||A.Array.prototype.slice,C.prototype.uint32=function(){var K=4294967295;return function(){if(K=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(K=(K|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(K=(K|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return K;if((this.pos+=5)>this.len)throw this.pos=this.len,O(this,10);return K}}(),C.prototype.int32=function(){return this.uint32()|0},C.prototype.sint32=function(){var K=this.uint32();return K>>>1^-(K&1)|0};function $(){var Z=new D(0,0),K=0;if(this.len-this.pos>4){for(;K<4;++K)if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return Z;if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<28)>>>0,Z.hi=(Z.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return Z;K=0}else{for(;K<3;++K){if(this.pos>=this.len)throw O(this);if(Z.lo=(Z.lo|(this.buf[this.pos]&127)<<K*7)>>>0,this.buf[this.pos++]<128)return Z}return Z.lo=(Z.lo|(this.buf[this.pos++]&127)<<K*7)>>>0,Z}if(this.len-this.pos>4){for(;K<5;++K)if(Z.hi=(Z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return Z}else for(;K<5;++K){if(this.pos>=this.len)throw O(this);if(Z.hi=(Z.hi|(this.buf[this.pos]&127)<<K*7+3)>>>0,this.buf[this.pos++]<128)return Z}throw Error("invalid varint encoding")}C.prototype.bool=function(){return this.uint32()!==0};function N(Z,K){return(Z[K-4]|Z[K-3]<<8|Z[K-2]<<16|Z[K-1]<<24)>>>0}C.prototype.fixed32=function(){if(this.pos+4>this.len)throw O(this,4);return N(this.buf,this.pos+=4)},C.prototype.sfixed32=function(){if(this.pos+4>this.len)throw O(this,4);return N(this.buf,this.pos+=4)|0};function F(){if(this.pos+8>this.len)throw O(this,8);return new D(N(this.buf,this.pos+=4),N(this.buf,this.pos+=4))}return C.prototype.float=function(){if(this.pos+4>this.len)throw O(this,4);var K=A.float.readFloatLE(this.buf,this.pos);return this.pos+=4,K},C.prototype.double=function(){if(this.pos+8>this.len)throw O(this,4);var K=A.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,K},C.prototype.bytes=function(){var K=this.uint32(),J=this.pos,Y=this.pos+K;if(Y>this.len)throw O(this,K);if(this.pos+=K,Array.isArray(this.buf))return this.buf.slice(J,Y);if(J===Y){var oe=A.Buffer;return oe?oe.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,J,Y)},C.prototype.string=function(){var K=this.bytes();return M.read(K,0,K.length)},C.prototype.skip=function(K){if(typeof K=="number"){if(this.pos+K>this.len)throw O(this,K);this.pos+=K}else do if(this.pos>=this.len)throw O(this);while(this.buf[this.pos++]&128);return this},C.prototype.skipType=function(Z){switch(Z){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(Z=this.uint32()&7)!==4;)this.skipType(Z);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+Z+" at offset "+this.pos)}return this},C._configure=function(Z){B=Z,C.create=u(),B._configure();var K=A.Long?"toLong":"toNumber";A.merge(C.prototype,{int64:function(){return $.call(this)[K](!1)},uint64:function(){return $.call(this)[K](!0)},sint64:function(){return $.call(this).zzDecode()[K](!1)},fixed64:function(){return F.call(this)[K](!0)},sfixed64:function(){return F.call(this)[K](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=D;var A=requireReader();(D.prototype=Object.create(A.prototype)).constructor=D;var B=requireMinimal$1();function D(M){A.call(this,M)}return D._configure=function(){B.Buffer&&(D.prototype._slice=B.Buffer.prototype.slice)},D.prototype.string=function(){var O=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+O,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+O,this.len))},D._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=B;var A=requireMinimal$1();(B.prototype=Object.create(A.EventEmitter.prototype)).constructor=B;function B(D,M,O){if(typeof D!="function")throw TypeError("rpcImpl must be a function");A.EventEmitter.call(this),this.rpcImpl=D,this.requestDelimited=!!M,this.responseDelimited=!!O}return B.prototype.rpcCall=function D(M,O,C,i,u){if(!i)throw TypeError("request must be specified");var $=this;if(!u)return A.asPromise(D,$,M,O,C,i);if(!$.rpcImpl){setTimeout(function(){u(Error("already ended"))},0);return}try{return $.rpcImpl(M,O[$.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(F,Z){if(F)return $.emit("error",F,M),u(F);if(Z===null){$.end(!0);return}if(!(Z instanceof C))try{Z=C[$.responseDelimited?"decodeDelimited":"decode"](Z)}catch(K){return $.emit("error",K,M),u(K)}return $.emit("data",Z,M),u(null,Z)})}catch(N){$.emit("error",N,M),setTimeout(function(){u(N)},0);return}},B.prototype.end=function(M){return this.rpcImpl&&(M||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this},service}var hasRequiredRpc;function requireRpc(){return hasRequiredRpc||(hasRequiredRpc=1,function(A){var B=A;B.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(A){var B=A;B.build="minimal",B.Writer=requireWriter(),B.BufferWriter=requireWriter_buffer(),B.Reader=requireReader(),B.BufferReader=requireReader_buffer(),B.util=requireMinimal$1(),B.rpc=requireRpc(),B.roots=requireRoots(),B.configure=D;function D(){B.util._configure(),B.Writer._configure(B.BufferWriter),B.Reader._configure(B.BufferReader)}D()}(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 A={};return A.quick=function(){const B={};return B.voice=function(){const D={};return D.proto=function(){const M={};return M.CommonReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.event="",O.prototype.data=$util.newBuffer([]),O.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.version=0,O.prototype.compress=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&u.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&u.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&u.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&u.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&u.uint32(40).int64(i.valid),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&u.uint32(48).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&u.uint32(56).bool(i.compress),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.CommonReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.event=i.string();break}case 2:{N.data=i.bytes();break}case 3:{N.sn=i.int64();break}case 4:{N.time=i.int64();break}case 5:{N.valid=i.int64();break}case 6:{N.version=i.int32();break}case 7:{N.compress=i.bool();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonReq)return i;let u=new $root.com.quick.voice.proto.CommonReq;return i.event!=null&&(u.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,u.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(u.data=i.data)),i.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?u.sn=parseInt(i.sn,10):typeof i.sn=="number"?u.sn=i.sn:typeof i.sn=="object"&&(u.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(u.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?u.time=parseInt(i.time,10):typeof i.time=="number"?u.time=i.time:typeof i.time=="object"&&(u.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?u.valid=parseInt(i.valid,10):typeof i.valid=="number"?u.valid=i.valid:typeof i.valid=="object"&&(u.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.version!=null&&(u.version=i.version|0),i.compress!=null&&(u.compress=!!i.compress),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults){if($.event="",u.bytes===String?$.data="":($.data=[],u.bytes!==Array&&($.data=$util.newBuffer($.data))),$util.Long){let N=new $util.Long(0,0,!1);$.sn=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.sn=u.longs===String?"0":0;if($util.Long){let N=new $util.Long(0,0,!1);$.time=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.time=u.longs===String?"0":0;if($util.Long){let N=new $util.Long(0,0,!1);$.valid=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.valid=u.longs===String?"0":0;$.version=0,$.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&($.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&($.data=u.bytes===String?$util.base64.encode(i.data,0,i.data.length):u.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?$.sn=u.longs===String?String(i.sn):i.sn:$.sn=u.longs===String?$util.Long.prototype.toString.call(i.sn):u.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"?$.time=u.longs===String?String(i.time):i.time:$.time=u.longs===String?$util.Long.prototype.toString.call(i.time):u.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"?$.valid=u.longs===String?String(i.valid):i.valid:$.valid=u.longs===String?$util.Long.prototype.toString.call(i.valid):u.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.version!=null&&i.hasOwnProperty("version")&&($.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&($.compress=i.compress),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonReq"},O}(),M.CommonRsp=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.event="",O.prototype.data=$util.newBuffer([]),O.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,O.prototype.code=0,O.prototype.desc="",O.prototype.version=0,O.prototype.compress=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.event!=null&&Object.hasOwnProperty.call(i,"event")&&u.uint32(10).string(i.event),i.data!=null&&Object.hasOwnProperty.call(i,"data")&&u.uint32(18).bytes(i.data),i.sn!=null&&Object.hasOwnProperty.call(i,"sn")&&u.uint32(24).int64(i.sn),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&u.uint32(32).int64(i.time),i.valid!=null&&Object.hasOwnProperty.call(i,"valid")&&u.uint32(40).int64(i.valid),i.code!=null&&Object.hasOwnProperty.call(i,"code")&&u.uint32(48).int32(i.code),i.desc!=null&&Object.hasOwnProperty.call(i,"desc")&&u.uint32(58).string(i.desc),i.version!=null&&Object.hasOwnProperty.call(i,"version")&&u.uint32(64).int32(i.version),i.compress!=null&&Object.hasOwnProperty.call(i,"compress")&&u.uint32(72).bool(i.compress),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.CommonRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.event=i.string();break}case 2:{N.data=i.bytes();break}case 3:{N.sn=i.int64();break}case 4:{N.time=i.int64();break}case 5:{N.valid=i.int64();break}case 6:{N.code=i.int32();break}case 7:{N.desc=i.string();break}case 8:{N.version=i.int32();break}case 9:{N.compress=i.bool();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CommonRsp)return i;let u=new $root.com.quick.voice.proto.CommonRsp;return i.event!=null&&(u.event=String(i.event)),i.data!=null&&(typeof i.data=="string"?$util.base64.decode(i.data,u.data=$util.newBuffer($util.base64.length(i.data)),0):i.data.length>=0&&(u.data=i.data)),i.sn!=null&&($util.Long?(u.sn=$util.Long.fromValue(i.sn)).unsigned=!1:typeof i.sn=="string"?u.sn=parseInt(i.sn,10):typeof i.sn=="number"?u.sn=i.sn:typeof i.sn=="object"&&(u.sn=new $util.LongBits(i.sn.low>>>0,i.sn.high>>>0).toNumber())),i.time!=null&&($util.Long?(u.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?u.time=parseInt(i.time,10):typeof i.time=="number"?u.time=i.time:typeof i.time=="object"&&(u.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),i.valid!=null&&($util.Long?(u.valid=$util.Long.fromValue(i.valid)).unsigned=!1:typeof i.valid=="string"?u.valid=parseInt(i.valid,10):typeof i.valid=="number"?u.valid=i.valid:typeof i.valid=="object"&&(u.valid=new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber())),i.code!=null&&(u.code=i.code|0),i.desc!=null&&(u.desc=String(i.desc)),i.version!=null&&(u.version=i.version|0),i.compress!=null&&(u.compress=!!i.compress),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults){if($.event="",u.bytes===String?$.data="":($.data=[],u.bytes!==Array&&($.data=$util.newBuffer($.data))),$util.Long){let N=new $util.Long(0,0,!1);$.sn=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.sn=u.longs===String?"0":0;if($util.Long){let N=new $util.Long(0,0,!1);$.time=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.time=u.longs===String?"0":0;if($util.Long){let N=new $util.Long(0,0,!1);$.valid=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.valid=u.longs===String?"0":0;$.code=0,$.desc="",$.version=0,$.compress=!1}return i.event!=null&&i.hasOwnProperty("event")&&($.event=i.event),i.data!=null&&i.hasOwnProperty("data")&&($.data=u.bytes===String?$util.base64.encode(i.data,0,i.data.length):u.bytes===Array?Array.prototype.slice.call(i.data):i.data),i.sn!=null&&i.hasOwnProperty("sn")&&(typeof i.sn=="number"?$.sn=u.longs===String?String(i.sn):i.sn:$.sn=u.longs===String?$util.Long.prototype.toString.call(i.sn):u.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"?$.time=u.longs===String?String(i.time):i.time:$.time=u.longs===String?$util.Long.prototype.toString.call(i.time):u.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"?$.valid=u.longs===String?String(i.valid):i.valid:$.valid=u.longs===String?$util.Long.prototype.toString.call(i.valid):u.longs===Number?new $util.LongBits(i.valid.low>>>0,i.valid.high>>>0).toNumber():i.valid),i.code!=null&&i.hasOwnProperty("code")&&($.code=i.code),i.desc!=null&&i.hasOwnProperty("desc")&&($.desc=i.desc),i.version!=null&&i.hasOwnProperty("version")&&($.version=i.version),i.compress!=null&&i.hasOwnProperty("compress")&&($.compress=i.compress),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CommonRsp"},O}(),M.User=function(){function O(i){if(this.tracks=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.id="",O.prototype.callAction=null,O.prototype.callState=null,O.prototype.joinTime=null,O.prototype.tracks=$util.emptyArray,O.prototype.permissions=null,O.prototype.isPublished=null,O.prototype.behavior=null,O.prototype.channelCache=null;let C;return Object.defineProperty(O.prototype,"_callAction",{get:$util.oneOfGetter(C=["callAction"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_callState",{get:$util.oneOfGetter(C=["callState"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_joinTime",{get:$util.oneOfGetter(C=["joinTime"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_permissions",{get:$util.oneOfGetter(C=["permissions"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_isPublished",{get:$util.oneOfGetter(C=["isPublished"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_behavior",{get:$util.oneOfGetter(C=["behavior"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_channelCache",{get:$util.oneOfGetter(C=["channelCache"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.id!=null&&Object.hasOwnProperty.call(u,"id")&&$.uint32(10).string(u.id),u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&$.uint32(16).int32(u.callAction),u.callState!=null&&Object.hasOwnProperty.call(u,"callState")&&$.uint32(24).int32(u.callState),u.joinTime!=null&&Object.hasOwnProperty.call(u,"joinTime")&&$.uint32(32).int64(u.joinTime),u.tracks!=null&&u.tracks.length)for(let N=0;N<u.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(u.tracks[N],$.uint32(42).fork()).ldelim();return u.permissions!=null&&Object.hasOwnProperty.call(u,"permissions")&&$.uint32(48).int32(u.permissions),u.isPublished!=null&&Object.hasOwnProperty.call(u,"isPublished")&&$.uint32(56).bool(u.isPublished),u.behavior!=null&&Object.hasOwnProperty.call(u,"behavior")&&$.uint32(64).int32(u.behavior),u.channelCache!=null&&Object.hasOwnProperty.call(u,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(u.channelCache,$.uint32(74).fork()).ldelim(),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.User;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.id=u.string();break}case 2:{F.callAction=u.int32();break}case 3:{F.callState=u.int32();break}case 4:{F.joinTime=u.int64();break}case 5:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 6:{F.permissions=u.int32();break}case 7:{F.isPublished=u.bool();break}case 8:{F.behavior=u.int32();break}case 9:{F.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(u,u.uint32());break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.id!=null&&u.hasOwnProperty("id")&&!$util.isString(u.id))return"id: string expected";if(u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction))return"callAction: integer expected";if(u.callState!=null&&u.hasOwnProperty("callState")&&!$util.isInteger(u.callState))return"callState: integer expected";if(u.joinTime!=null&&u.hasOwnProperty("joinTime")&&!$util.isInteger(u.joinTime)&&!(u.joinTime&&$util.isInteger(u.joinTime.low)&&$util.isInteger(u.joinTime.high)))return"joinTime: integer|Long expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let $=0;$<u.tracks.length;++$){let N=$root.com.quick.voice.proto.Track.verify(u.tracks[$]);if(N)return"tracks."+N}}if(u.permissions!=null&&u.hasOwnProperty("permissions")&&!$util.isInteger(u.permissions))return"permissions: integer expected";if(u.isPublished!=null&&u.hasOwnProperty("isPublished")&&typeof u.isPublished!="boolean")return"isPublished: boolean expected";if(u.behavior!=null&&u.hasOwnProperty("behavior")&&!$util.isInteger(u.behavior))return"behavior: integer expected";if(u.channelCache!=null&&u.hasOwnProperty("channelCache")){let $=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(u.channelCache);if($)return"channelCache."+$}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.User)return u;let $=new $root.com.quick.voice.proto.User;if(u.id!=null&&($.id=String(u.id)),u.callAction!=null&&($.callAction=u.callAction|0),u.callState!=null&&($.callState=u.callState|0),u.joinTime!=null&&($util.Long?($.joinTime=$util.Long.fromValue(u.joinTime)).unsigned=!1:typeof u.joinTime=="string"?$.joinTime=parseInt(u.joinTime,10):typeof u.joinTime=="number"?$.joinTime=u.joinTime:typeof u.joinTime=="object"&&($.joinTime=new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber())),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");$.tracks=[];for(let N=0;N<u.tracks.length;++N){if(typeof u.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");$.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[N])}}if(u.permissions!=null&&($.permissions=u.permissions|0),u.isPublished!=null&&($.isPublished=!!u.isPublished),u.behavior!=null&&($.behavior=u.behavior|0),u.channelCache!=null){if(typeof u.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");$.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(u.channelCache)}return $},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.tracks=[]),$.defaults&&(N.id=""),u.id!=null&&u.hasOwnProperty("id")&&(N.id=u.id),u.callAction!=null&&u.hasOwnProperty("callAction")&&(N.callAction=u.callAction,$.oneofs&&(N._callAction="callAction")),u.callState!=null&&u.hasOwnProperty("callState")&&(N.callState=u.callState,$.oneofs&&(N._callState="callState")),u.joinTime!=null&&u.hasOwnProperty("joinTime")&&(typeof u.joinTime=="number"?N.joinTime=$.longs===String?String(u.joinTime):u.joinTime:N.joinTime=$.longs===String?$util.Long.prototype.toString.call(u.joinTime):$.longs===Number?new $util.LongBits(u.joinTime.low>>>0,u.joinTime.high>>>0).toNumber():u.joinTime,$.oneofs&&(N._joinTime="joinTime")),u.tracks&&u.tracks.length){N.tracks=[];for(let F=0;F<u.tracks.length;++F)N.tracks[F]=$root.com.quick.voice.proto.Track.toObject(u.tracks[F],$)}return u.permissions!=null&&u.hasOwnProperty("permissions")&&(N.permissions=u.permissions,$.oneofs&&(N._permissions="permissions")),u.isPublished!=null&&u.hasOwnProperty("isPublished")&&(N.isPublished=u.isPublished,$.oneofs&&(N._isPublished="isPublished")),u.behavior!=null&&u.hasOwnProperty("behavior")&&(N.behavior=u.behavior,$.oneofs&&(N._behavior="behavior")),u.channelCache!=null&&u.hasOwnProperty("channelCache")&&(N.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(u.channelCache,$),$.oneofs&&(N._channelCache="channelCache")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.User"},O}(),M.DataChannelCacheInfo=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.channels&&N.channels.length||(N.channels=[]),N.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let N=0;N<i.channels.length;++N)$.channels[N]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelCacheInfo"},O}(),M.DataChannel=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.dataChannelName="",O.prototype.id=null;let C;return Object.defineProperty(O.prototype,"_id",{get:$util.oneOfGetter(C=["id"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.dataChannelName!=null&&Object.hasOwnProperty.call(u,"dataChannelName")&&$.uint32(10).string(u.dataChannelName),u.id!=null&&Object.hasOwnProperty.call(u,"id")&&$.uint32(16).int32(u.id),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.DataChannel;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.dataChannelName=u.string();break}case 2:{F.id=u.int32();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){return typeof u!="object"||u===null?"object expected":u.dataChannelName!=null&&u.hasOwnProperty("dataChannelName")&&!$util.isString(u.dataChannelName)?"dataChannelName: string expected":u.id!=null&&u.hasOwnProperty("id")&&!$util.isInteger(u.id)?"id: integer expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.DataChannel)return u;let $=new $root.com.quick.voice.proto.DataChannel;return u.dataChannelName!=null&&($.dataChannelName=String(u.dataChannelName)),u.id!=null&&($.id=u.id|0),$},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&(N.dataChannelName=""),u.dataChannelName!=null&&u.hasOwnProperty("dataChannelName")&&(N.dataChannelName=u.dataChannelName),u.id!=null&&u.hasOwnProperty("id")&&(N.id=u.id,$.oneofs&&(N._id="id")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.DataChannel"},O}(),M.Login=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.appid="",O.prototype.userId="",O.prototype.sdkToken="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.appid!=null&&Object.hasOwnProperty.call(i,"appid")&&u.uint32(10).string(i.appid),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(18).string(i.userId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&u.uint32(26).string(i.sdkToken),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.Login;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.appid=i.string();break}case 2:{N.userId=i.string();break}case 3:{N.sdkToken=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Login)return i;let u=new $root.com.quick.voice.proto.Login;return i.appid!=null&&(u.appid=String(i.appid)),i.userId!=null&&(u.userId=String(i.userId)),i.sdkToken!=null&&(u.sdkToken=String(i.sdkToken)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.appid="",$.userId="",$.sdkToken=""),i.appid!=null&&i.hasOwnProperty("appid")&&($.appid=i.appid),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&($.sdkToken=i.sdkToken),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Login"},O}(),M.Track=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.mid="",O.prototype.trackName=null,O.prototype.location=null,O.prototype.userId=null,O.prototype.code=null,O.prototype.desc=null,O.prototype.type=null,O.prototype.isValid=null,O.prototype.simulcast=null,O.prototype.lastRetry=null;let C;return Object.defineProperty(O.prototype,"_trackName",{get:$util.oneOfGetter(C=["trackName"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_location",{get:$util.oneOfGetter(C=["location"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_userId",{get:$util.oneOfGetter(C=["userId"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_code",{get:$util.oneOfGetter(C=["code"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_desc",{get:$util.oneOfGetter(C=["desc"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_type",{get:$util.oneOfGetter(C=["type"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_isValid",{get:$util.oneOfGetter(C=["isValid"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_simulcast",{get:$util.oneOfGetter(C=["simulcast"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_lastRetry",{get:$util.oneOfGetter(C=["lastRetry"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.mid!=null&&Object.hasOwnProperty.call(u,"mid")&&$.uint32(10).string(u.mid),u.trackName!=null&&Object.hasOwnProperty.call(u,"trackName")&&$.uint32(18).string(u.trackName),u.location!=null&&Object.hasOwnProperty.call(u,"location")&&$.uint32(26).string(u.location),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&$.uint32(34).string(u.userId),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&$.uint32(40).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&$.uint32(50).string(u.desc),u.type!=null&&Object.hasOwnProperty.call(u,"type")&&$.uint32(56).int32(u.type),u.isValid!=null&&Object.hasOwnProperty.call(u,"isValid")&&$.uint32(64).bool(u.isValid),u.simulcast!=null&&Object.hasOwnProperty.call(u,"simulcast")&&$.uint32(74).string(u.simulcast),u.lastRetry!=null&&Object.hasOwnProperty.call(u,"lastRetry")&&$.uint32(80).bool(u.lastRetry),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.Track;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.mid=u.string();break}case 2:{F.trackName=u.string();break}case 3:{F.location=u.string();break}case 4:{F.userId=u.string();break}case 5:{F.code=u.int32();break}case 6:{F.desc=u.string();break}case 7:{F.type=u.int32();break}case 8:{F.isValid=u.bool();break}case 9:{F.simulcast=u.string();break}case 10:{F.lastRetry=u.bool();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.mid!=null&&u.hasOwnProperty("mid")&&!$util.isString(u.mid))return"mid: string expected";if(u.trackName!=null&&u.hasOwnProperty("trackName")&&!$util.isString(u.trackName))return"trackName: string expected";if(u.location!=null&&u.hasOwnProperty("location")&&!$util.isString(u.location))return"location: string expected";if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code))return"code: integer expected";if(u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc))return"desc: string expected";if(u.type!=null&&u.hasOwnProperty("type"))switch(u.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return u.isValid!=null&&u.hasOwnProperty("isValid")&&typeof u.isValid!="boolean"?"isValid: boolean expected":u.simulcast!=null&&u.hasOwnProperty("simulcast")&&!$util.isString(u.simulcast)?"simulcast: string expected":u.lastRetry!=null&&u.hasOwnProperty("lastRetry")&&typeof u.lastRetry!="boolean"?"lastRetry: boolean expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.Track)return u;let $=new $root.com.quick.voice.proto.Track;switch(u.mid!=null&&($.mid=String(u.mid)),u.trackName!=null&&($.trackName=String(u.trackName)),u.location!=null&&($.location=String(u.location)),u.userId!=null&&($.userId=String(u.userId)),u.code!=null&&($.code=u.code|0),u.desc!=null&&($.desc=String(u.desc)),u.type){default:if(typeof u.type=="number"){$.type=u.type;break}break;case"Microphone":case 0:$.type=0;break;case"Camera":case 1:$.type=1;break;case"Screen":case 2:$.type=2;break;case"SystemVoice":case 3:$.type=3;break}return u.isValid!=null&&($.isValid=!!u.isValid),u.simulcast!=null&&($.simulcast=String(u.simulcast)),u.lastRetry!=null&&($.lastRetry=!!u.lastRetry),$},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&(N.mid=""),u.mid!=null&&u.hasOwnProperty("mid")&&(N.mid=u.mid),u.trackName!=null&&u.hasOwnProperty("trackName")&&(N.trackName=u.trackName,$.oneofs&&(N._trackName="trackName")),u.location!=null&&u.hasOwnProperty("location")&&(N.location=u.location,$.oneofs&&(N._location="location")),u.userId!=null&&u.hasOwnProperty("userId")&&(N.userId=u.userId,$.oneofs&&(N._userId="userId")),u.code!=null&&u.hasOwnProperty("code")&&(N.code=u.code,$.oneofs&&(N._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(N.desc=u.desc,$.oneofs&&(N._desc="desc")),u.type!=null&&u.hasOwnProperty("type")&&(N.type=$.enums===String?$root.com.quick.voice.proto.TrackType[u.type]===void 0?u.type:$root.com.quick.voice.proto.TrackType[u.type]:u.type,$.oneofs&&(N._type="type")),u.isValid!=null&&u.hasOwnProperty("isValid")&&(N.isValid=u.isValid,$.oneofs&&(N._isValid="isValid")),u.simulcast!=null&&u.hasOwnProperty("simulcast")&&(N.simulcast=u.simulcast,$.oneofs&&(N._simulcast="simulcast")),u.lastRetry!=null&&u.hasOwnProperty("lastRetry")&&(N.lastRetry=u.lastRetry,$.oneofs&&(N._lastRetry="lastRetry")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.Track"},O}(),M.JoinReq=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.callType=0,O.prototype.token=null;let C;return Object.defineProperty(O.prototype,"_token",{get:$util.oneOfGetter(C=["token"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,$.uint32(18).fork()).ldelim(),u.callType!=null&&Object.hasOwnProperty.call(u,"callType")&&$.uint32(24).int32(u.callType),u.token!=null&&Object.hasOwnProperty.call(u,"token")&&$.uint32(34).string(u.token),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.JoinReq;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.callType=u.int32();break}case 4:{F.token=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(u.user);if($)return"user."+$}if(u.callType!=null&&u.hasOwnProperty("callType"))switch(u.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return u.token!=null&&u.hasOwnProperty("token")&&!$util.isString(u.token)?"token: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.JoinReq)return u;let $=new $root.com.quick.voice.proto.JoinReq;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(u.user)}switch(u.callType){default:if(typeof u.callType=="number"){$.callType=u.callType;break}break;case"Normal":case 0:$.callType=0;break;case"Meeting":case 1:$.callType=1;break;case"Live":case 2:$.callType=2;break}return u.token!=null&&($.token=String(u.token)),$},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&(N.roomId="",N.user=null,N.callType=$.enums===String?"Normal":0),u.roomId!=null&&u.hasOwnProperty("roomId")&&(N.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(u.user,$)),u.callType!=null&&u.hasOwnProperty("callType")&&(N.callType=$.enums===String?$root.com.quick.voice.proto.CallType[u.callType]===void 0?u.callType:$root.com.quick.voice.proto.CallType[u.callType]:u.callType),u.token!=null&&u.hasOwnProperty("token")&&(N.token=u.token,$.oneofs&&(N._token="token")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.JoinReq"},O}(),M.JoinRsp=function(){function O(C){if(this.roomUsers=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.roomUsers=$util.emptyArray,O.prototype.callType=0,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.roomUsers!=null&&i.roomUsers.length)for(let $=0;$<i.roomUsers.length;++$)$root.com.quick.voice.proto.User.encode(i.roomUsers[$],u.uint32(18).fork()).ldelim();return i.callType!=null&&Object.hasOwnProperty.call(i,"callType")&&u.uint32(24).int32(i.callType),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.JoinRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.roomUsers&&N.roomUsers.length||(N.roomUsers=[]),N.roomUsers.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 3:{N.callType=i.int32();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.roomUsers.length;++u){let $=$root.com.quick.voice.proto.User.verify(i.roomUsers[u]);if($)return"roomUsers."+$}}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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinRsp)return i;let u=new $root.com.quick.voice.proto.JoinRsp;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.roomUsers){if(!Array.isArray(i.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");u.roomUsers=[];for(let $=0;$<i.roomUsers.length;++$){if(typeof i.roomUsers[$]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");u.roomUsers[$]=$root.com.quick.voice.proto.User.fromObject(i.roomUsers[$])}}switch(i.callType){default:if(typeof i.callType=="number"){u.callType=i.callType;break}break;case"Normal":case 0:u.callType=0;break;case"Meeting":case 1:u.callType=1;break;case"Live":case 2:u.callType=2;break}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.roomUsers=[]),u.defaults&&($.roomId="",$.callType=u.enums===String?"Normal":0),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.roomUsers&&i.roomUsers.length){$.roomUsers=[];for(let N=0;N<i.roomUsers.length;++N)$.roomUsers[N]=$root.com.quick.voice.proto.User.toObject(i.roomUsers[N],u)}return i.callType!=null&&i.hasOwnProperty("callType")&&($.callType=u.enums===String?$root.com.quick.voice.proto.CallType[i.callType]===void 0?i.callType:$root.com.quick.voice.proto.CallType[i.callType]:i.callType),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinRsp"},O}(),M.JoinNotify=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.JoinNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.JoinNotify)return i;let u=new $root.com.quick.voice.proto.JoinNotify;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.JoinNotify"},O}(),M.ConnectCFReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sdp="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(10).string(i.sdp),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.ConnectCFReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.sdp=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ConnectCFReq)return i;let u=new $root.com.quick.voice.proto.ConnectCFReq;return i.sdp!=null&&(u.sdp=String(i.sdp)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.sdp=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ConnectCFReq"},O}(),M.ConnectCFRsp=function(){function O(i){if(this.subscribeUsers=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.remoteSdp="",O.prototype.subscribeUsers=$util.emptyArray,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.remoteSdp!=null&&Object.hasOwnProperty.call(u,"remoteSdp")&&$.uint32(10).string(u.remoteSdp),u.subscribeUsers!=null&&u.subscribeUsers.length)for(let N=0;N<u.subscribeUsers.length;++N)$root.com.quick.voice.proto.User.encode(u.subscribeUsers[N],$.uint32(18).fork()).ldelim();return u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(26).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.ConnectCFRsp;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.remoteSdp=u.string();break}case 2:{F.subscribeUsers&&F.subscribeUsers.length||(F.subscribeUsers=[]),F.subscribeUsers.push($root.com.quick.voice.proto.User.decode(u,u.uint32()));break}case 3:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&!$util.isString(u.remoteSdp))return"remoteSdp: string expected";if(u.subscribeUsers!=null&&u.hasOwnProperty("subscribeUsers")){if(!Array.isArray(u.subscribeUsers))return"subscribeUsers: array expected";for(let $=0;$<u.subscribeUsers.length;++$){let N=$root.com.quick.voice.proto.User.verify(u.subscribeUsers[$]);if(N)return"subscribeUsers."+N}}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.ConnectCFRsp)return u;let $=new $root.com.quick.voice.proto.ConnectCFRsp;if(u.remoteSdp!=null&&($.remoteSdp=String(u.remoteSdp)),u.subscribeUsers){if(!Array.isArray(u.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");$.subscribeUsers=[];for(let N=0;N<u.subscribeUsers.length;++N){if(typeof u.subscribeUsers[N]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");$.subscribeUsers[N]=$root.com.quick.voice.proto.User.fromObject(u.subscribeUsers[N])}}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.subscribeUsers=[]),$.defaults&&(N.remoteSdp=""),u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&(N.remoteSdp=u.remoteSdp),u.subscribeUsers&&u.subscribeUsers.length){N.subscribeUsers=[];for(let F=0;F<u.subscribeUsers.length;++F)N.subscribeUsers[F]=$root.com.quick.voice.proto.User.toObject(u.subscribeUsers[F],$)}return u.session!=null&&u.hasOwnProperty("session")&&(N.session=u.session,$.oneofs&&(N._session="session")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.ConnectCFRsp"},O}(),M.PublishReq=function(){function O(i){if(this.tracks=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.sdp="",O.prototype.tracks=$util.emptyArray,O.prototype.callAction=0,O.prototype.recreate=null,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_recreate",{get:$util.oneOfGetter(C=["recreate"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.sdp!=null&&Object.hasOwnProperty.call(u,"sdp")&&$.uint32(10).string(u.sdp),u.tracks!=null&&u.tracks.length)for(let N=0;N<u.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(u.tracks[N],$.uint32(18).fork()).ldelim();return u.callAction!=null&&Object.hasOwnProperty.call(u,"callAction")&&$.uint32(24).int32(u.callAction),u.recreate!=null&&Object.hasOwnProperty.call(u,"recreate")&&$.uint32(32).bool(u.recreate),u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(42).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.PublishReq;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.sdp=u.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}case 3:{F.callAction=u.int32();break}case 4:{F.recreate=u.bool();break}case 5:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.sdp!=null&&u.hasOwnProperty("sdp")&&!$util.isString(u.sdp))return"sdp: string expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let $=0;$<u.tracks.length;++$){let N=$root.com.quick.voice.proto.Track.verify(u.tracks[$]);if(N)return"tracks."+N}}return u.callAction!=null&&u.hasOwnProperty("callAction")&&!$util.isInteger(u.callAction)?"callAction: integer expected":u.recreate!=null&&u.hasOwnProperty("recreate")&&typeof u.recreate!="boolean"?"recreate: boolean expected":u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishReq)return u;let $=new $root.com.quick.voice.proto.PublishReq;if(u.sdp!=null&&($.sdp=String(u.sdp)),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");$.tracks=[];for(let N=0;N<u.tracks.length;++N){if(typeof u.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");$.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[N])}}return u.callAction!=null&&($.callAction=u.callAction|0),u.recreate!=null&&($.recreate=!!u.recreate),u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.tracks=[]),$.defaults&&(N.sdp="",N.callAction=0),u.sdp!=null&&u.hasOwnProperty("sdp")&&(N.sdp=u.sdp),u.tracks&&u.tracks.length){N.tracks=[];for(let F=0;F<u.tracks.length;++F)N.tracks[F]=$root.com.quick.voice.proto.Track.toObject(u.tracks[F],$)}return u.callAction!=null&&u.hasOwnProperty("callAction")&&(N.callAction=u.callAction),u.recreate!=null&&u.hasOwnProperty("recreate")&&(N.recreate=u.recreate,$.oneofs&&(N._recreate="recreate")),u.session!=null&&u.hasOwnProperty("session")&&(N.session=u.session,$.oneofs&&(N._session="session")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishReq"},O}(),M.PublishRsp=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.remoteSdp="",O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.remoteSdp!=null&&Object.hasOwnProperty.call(u,"remoteSdp")&&$.uint32(10).string(u.remoteSdp),u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(18).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.PublishRsp;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.remoteSdp=u.string();break}case 2:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){return typeof u!="object"||u===null?"object expected":u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&!$util.isString(u.remoteSdp)?"remoteSdp: string expected":u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishRsp)return u;let $=new $root.com.quick.voice.proto.PublishRsp;return u.remoteSdp!=null&&($.remoteSdp=String(u.remoteSdp)),u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&(N.remoteSdp=""),u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&(N.remoteSdp=u.remoteSdp),u.session!=null&&u.hasOwnProperty("session")&&(N.session=u.session,$.oneofs&&(N._session="session")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishRsp"},O}(),M.PublishNotify=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,$.uint32(18).fork()).ldelim(),u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(26).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.PublishNotify;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(u.user);if($)return"user."+$}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.PublishNotify)return u;let $=new $root.com.quick.voice.proto.PublishNotify;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(u.user)}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&(N.roomId="",N.user=null),u.roomId!=null&&u.hasOwnProperty("roomId")&&(N.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(u.user,$)),u.session!=null&&u.hasOwnProperty("session")&&(N.session=u.session,$.oneofs&&(N._session="session")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.PublishNotify"},O}(),M.SubscribeReq=function(){function O(i){if(this.users=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.users=$util.emptyArray,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.users!=null&&u.users.length)for(let N=0;N<u.users.length;++N)$root.com.quick.voice.proto.User.encode(u.users[N],$.uint32(10).fork()).ldelim();return u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(18).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.SubscribeReq;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(u,u.uint32()));break}case 2:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.users!=null&&u.hasOwnProperty("users")){if(!Array.isArray(u.users))return"users: array expected";for(let $=0;$<u.users.length;++$){let N=$root.com.quick.voice.proto.User.verify(u.users[$]);if(N)return"users."+N}}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.SubscribeReq)return u;let $=new $root.com.quick.voice.proto.SubscribeReq;if(u.users){if(!Array.isArray(u.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");$.users=[];for(let N=0;N<u.users.length;++N){if(typeof u.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");$.users[N]=$root.com.quick.voice.proto.User.fromObject(u.users[N])}}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.users=[]),u.users&&u.users.length){N.users=[];for(let F=0;F<u.users.length;++F)N.users[F]=$root.com.quick.voice.proto.User.toObject(u.users[F],$)}return u.session!=null&&u.hasOwnProperty("session")&&(N.session=u.session,$.oneofs&&(N._session="session")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.SubscribeReq"},O}(),M.SubscribeRsp=function(){function O(i){if(this.users=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.remoteSdp="",O.prototype.users=$util.emptyArray,O.prototype.session=null;let C;return Object.defineProperty(O.prototype,"_session",{get:$util.oneOfGetter(C=["session"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.remoteSdp!=null&&Object.hasOwnProperty.call(u,"remoteSdp")&&$.uint32(10).string(u.remoteSdp),u.users!=null&&u.users.length)for(let N=0;N<u.users.length;++N)$root.com.quick.voice.proto.User.encode(u.users[N],$.uint32(18).fork()).ldelim();return u.session!=null&&Object.hasOwnProperty.call(u,"session")&&$.uint32(26).string(u.session),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.SubscribeRsp;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.remoteSdp=u.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(u,u.uint32()));break}case 3:{F.session=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&!$util.isString(u.remoteSdp))return"remoteSdp: string expected";if(u.users!=null&&u.hasOwnProperty("users")){if(!Array.isArray(u.users))return"users: array expected";for(let $=0;$<u.users.length;++$){let N=$root.com.quick.voice.proto.User.verify(u.users[$]);if(N)return"users."+N}}return u.session!=null&&u.hasOwnProperty("session")&&!$util.isString(u.session)?"session: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.SubscribeRsp)return u;let $=new $root.com.quick.voice.proto.SubscribeRsp;if(u.remoteSdp!=null&&($.remoteSdp=String(u.remoteSdp)),u.users){if(!Array.isArray(u.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");$.users=[];for(let N=0;N<u.users.length;++N){if(typeof u.users[N]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");$.users[N]=$root.com.quick.voice.proto.User.fromObject(u.users[N])}}return u.session!=null&&($.session=String(u.session)),$},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.users=[]),$.defaults&&(N.remoteSdp=""),u.remoteSdp!=null&&u.hasOwnProperty("remoteSdp")&&(N.remoteSdp=u.remoteSdp),u.users&&u.users.length){N.users=[];for(let F=0;F<u.users.length;++F)N.users[F]=$root.com.quick.voice.proto.User.toObject(u.users[F],$)}return u.session!=null&&u.hasOwnProperty("session")&&(N.session=u.session,$.oneofs&&(N._session="session")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.SubscribeRsp"},O}(),M.RenegotiateReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.sdp="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(18).string(i.sdp),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.RenegotiateReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.userId=i.string();break}case 2:{N.sdp=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.RenegotiateReq)return i;let u=new $root.com.quick.voice.proto.RenegotiateReq;return i.userId!=null&&(u.userId=String(i.userId)),i.sdp!=null&&(u.sdp=String(i.sdp)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.sdp=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.RenegotiateReq"},O}(),M.QuitReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(18).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.QuitReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.userId=i.string();break}case 2:{N.roomId=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.QuitReq)return i;let u=new $root.com.quick.voice.proto.QuitReq;return i.userId!=null&&(u.userId=String(i.userId)),i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.QuitReq"},O}(),M.QuitNotify=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.user=null,O.prototype.code=null,O.prototype.desc=null;let C;return Object.defineProperty(O.prototype,"_code",{get:$util.oneOfGetter(C=["code"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_desc",{get:$util.oneOfGetter(C=["desc"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.user!=null&&Object.hasOwnProperty.call(u,"user")&&$root.com.quick.voice.proto.User.encode(u.user,$.uint32(18).fork()).ldelim(),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&$.uint32(24).int32(u.code),u.desc!=null&&Object.hasOwnProperty.call(u,"desc")&&$.uint32(34).string(u.desc),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.QuitNotify;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.code=u.int32();break}case 4:{F.desc=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.user!=null&&u.hasOwnProperty("user")){let $=$root.com.quick.voice.proto.User.verify(u.user);if($)return"user."+$}return u.code!=null&&u.hasOwnProperty("code")&&!$util.isInteger(u.code)?"code: integer expected":u.desc!=null&&u.hasOwnProperty("desc")&&!$util.isString(u.desc)?"desc: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.QuitNotify)return u;let $=new $root.com.quick.voice.proto.QuitNotify;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.user!=null){if(typeof u.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");$.user=$root.com.quick.voice.proto.User.fromObject(u.user)}return u.code!=null&&($.code=u.code|0),u.desc!=null&&($.desc=String(u.desc)),$},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&(N.roomId="",N.user=null),u.roomId!=null&&u.hasOwnProperty("roomId")&&(N.roomId=u.roomId),u.user!=null&&u.hasOwnProperty("user")&&(N.user=$root.com.quick.voice.proto.User.toObject(u.user,$)),u.code!=null&&u.hasOwnProperty("code")&&(N.code=u.code,$.oneofs&&(N._code="code")),u.desc!=null&&u.hasOwnProperty("desc")&&(N.desc=u.desc,$.oneofs&&(N._desc="desc")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.QuitNotify"},O}(),M.TokenExpireNotify=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.TokenExpireNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.TokenExpireNotify)return i;let u=new $root.com.quick.voice.proto.TokenExpireNotify;return i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.TokenExpireNotify"},O}(),M.UpdateTokenReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.sdkToken="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.sdkToken!=null&&Object.hasOwnProperty.call(i,"sdkToken")&&u.uint32(18).string(i.sdkToken),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.UpdateTokenReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.sdkToken=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTokenReq)return i;let u=new $root.com.quick.voice.proto.UpdateTokenReq;return i.roomId!=null&&(u.roomId=String(i.roomId)),i.sdkToken!=null&&(u.sdkToken=String(i.sdkToken)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.sdkToken=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.sdkToken!=null&&i.hasOwnProperty("sdkToken")&&($.sdkToken=i.sdkToken),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTokenReq"},O}(),M.NetQualityChange=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.roomId="",O.prototype.egress=0,O.prototype.ingress=0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(18).string(i.roomId),i.egress!=null&&Object.hasOwnProperty.call(i,"egress")&&u.uint32(24).int32(i.egress),i.ingress!=null&&Object.hasOwnProperty.call(i,"ingress")&&u.uint32(32).int32(i.ingress),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.NetQualityChange;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.userId=i.string();break}case 2:{N.roomId=i.string();break}case 3:{N.egress=i.int32();break}case 4:{N.ingress=i.int32();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityChange)return i;let u=new $root.com.quick.voice.proto.NetQualityChange;return i.userId!=null&&(u.userId=String(i.userId)),i.roomId!=null&&(u.roomId=String(i.roomId)),i.egress!=null&&(u.egress=i.egress|0),i.ingress!=null&&(u.ingress=i.ingress|0),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.roomId="",$.egress=0,$.ingress=0),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.egress!=null&&i.hasOwnProperty("egress")&&($.egress=i.egress),i.ingress!=null&&i.hasOwnProperty("ingress")&&($.ingress=i.ingress),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityChange"},O}(),M.NetQualityNotify=function(){function O(C){if(this.qualities=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.qualities=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.qualities!=null&&i.qualities.length)for(let $=0;$<i.qualities.length;++$)$root.com.quick.voice.proto.NetQualityChange.encode(i.qualities[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.NetQualityNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.qualities&&N.qualities.length||(N.qualities=[]),N.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.qualities.length;++u){let $=$root.com.quick.voice.proto.NetQualityChange.verify(i.qualities[u]);if($)return"qualities."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.NetQualityNotify)return i;let u=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");u.qualities=[];for(let $=0;$<i.qualities.length;++$){if(typeof i.qualities[$]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");u.qualities[$]=$root.com.quick.voice.proto.NetQualityChange.fromObject(i.qualities[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.qualities=[]),i.qualities&&i.qualities.length){$.qualities=[];for(let N=0;N<i.qualities.length;++N)$.qualities[N]=$root.com.quick.voice.proto.NetQualityChange.toObject(i.qualities[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.NetQualityNotify"},O}(),M.UpdateCall=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.UpdateCall;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateCall)return i;let u=new $root.com.quick.voice.proto.UpdateCall;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateCall"},O}(),M.SyncRoomInfoReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return i;let u=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoReq"},O}(),M.SyncRoomInfoRsp=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.isValid=!1,O.prototype.users=$util.emptyArray,O.prototype.isActive=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.isValid!=null&&Object.hasOwnProperty.call(i,"isValid")&&u.uint32(16).bool(i.isValid),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],u.uint32(26).fork()).ldelim();return i.isActive!=null&&Object.hasOwnProperty.call(i,"isActive")&&u.uint32(32).bool(i.isActive),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.isValid=i.bool();break}case 3:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}case 4:{N.isActive=i.bool();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.User.verify(i.users[u]);if($)return"users."+$}}return i.isActive!=null&&i.hasOwnProperty("isActive")&&typeof i.isActive!="boolean"?"isActive: boolean expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return i;let u=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.isValid!=null&&(u.isValid=!!i.isValid),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");u.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return i.isActive!=null&&(u.isActive=!!i.isActive),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),u.defaults&&($.roomId="",$.isValid=!1,$.isActive=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.isValid!=null&&i.hasOwnProperty("isValid")&&($.isValid=i.isValid),i.users&&i.users.length){$.users=[];for(let N=0;N<i.users.length;++N)$.users[N]=$root.com.quick.voice.proto.User.toObject(i.users[N],u)}return i.isActive!=null&&i.hasOwnProperty("isActive")&&($.isActive=i.isActive),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.SyncRoomInfoRsp"},O}(),M.UpdateTime=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.time!=null&&Object.hasOwnProperty.call(i,"time")&&u.uint32(8).int64(i.time),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.UpdateTime;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.time=i.int64();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdateTime)return i;let u=new $root.com.quick.voice.proto.UpdateTime;return i.time!=null&&($util.Long?(u.time=$util.Long.fromValue(i.time)).unsigned=!1:typeof i.time=="string"?u.time=parseInt(i.time,10):typeof i.time=="number"?u.time=i.time:typeof i.time=="object"&&(u.time=new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber())),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults)if($util.Long){let N=new $util.Long(0,0,!1);$.time=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.time=u.longs===String?"0":0;return i.time!=null&&i.hasOwnProperty("time")&&(typeof i.time=="number"?$.time=u.longs===String?String(i.time):i.time:$.time=u.longs===String?$util.Long.prototype.toString.call(i.time):u.longs===Number?new $util.LongBits(i.time.low>>>0,i.time.high>>>0).toNumber():i.time),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdateTime"},O}(),M.CloseTrackReq=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sdp="",O.prototype.tracks=$util.emptyArray,O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(10).string(i.sdp),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(26).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.CloseTrackReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.sdp=i.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{N.roomId=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return i.roomId!=null&&i.hasOwnProperty("roomId")&&!$util.isString(i.roomId)?"roomId: string expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackReq)return i;let u=new $root.com.quick.voice.proto.CloseTrackReq;if(i.sdp!=null&&(u.sdp=String(i.sdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.sdp="",$.roomId=""),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),i.tracks&&i.tracks.length){$.tracks=[];for(let N=0;N<i.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(i.tracks[N],u)}return i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackReq"},O}(),M.CloseTrackRsp=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.remoteSdp="",O.prototype.tracks=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.remoteSdp!=null&&Object.hasOwnProperty.call(i,"remoteSdp")&&u.uint32(10).string(i.remoteSdp),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.CloseTrackRsp;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.remoteSdp=i.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackRsp)return i;let u=new $root.com.quick.voice.proto.CloseTrackRsp;if(i.remoteSdp!=null&&(u.remoteSdp=String(i.remoteSdp)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.remoteSdp=""),i.remoteSdp!=null&&i.hasOwnProperty("remoteSdp")&&($.remoteSdp=i.remoteSdp),i.tracks&&i.tracks.length){$.tracks=[];for(let N=0;N<i.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(i.tracks[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackRsp"},O}(),M.CloseTrackNotify=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(10).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.CloseTrackNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.user!=null&&i.hasOwnProperty("user")){let u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CloseTrackNotify)return i;let u=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");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.user=null),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CloseTrackNotify"},O}(),M.TrackType=function(){const O={},C=Object.create(O);return C[O[0]="Microphone"]=0,C[O[1]="Camera"]=1,C[O[2]="Screen"]=2,C[O[3]="SystemVoice"]=3,C}(),M.UpdatePermissions=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.user=null,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.user!=null&&Object.hasOwnProperty.call(i,"user")&&$root.com.quick.voice.proto.User.encode(i.user,u.uint32(18).fork()).ldelim(),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.UpdatePermissions;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.user=$root.com.quick.voice.proto.User.decode(i,i.uint32());break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=$root.com.quick.voice.proto.User.verify(i.user);if(u)return"user."+u}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UpdatePermissions)return i;let u=new $root.com.quick.voice.proto.UpdatePermissions;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.user!=null){if(typeof i.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");u.user=$root.com.quick.voice.proto.User.fromObject(i.user)}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.roomId="",$.user=null),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.user!=null&&i.hasOwnProperty("user")&&($.user=$root.com.quick.voice.proto.User.toObject(i.user,u)),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UpdatePermissions"},O}(),M.CallType=function(){const O={},C=Object.create(O);return C[O[0]="Normal"]=0,C[O[1]="Meeting"]=1,C[O[2]="Live"]=2,C}(),M.QuitNotifyCode=function(){const O={},C=Object.create(O);return C[O[0]="NormalQuit"]=0,C[O[2021]="Timeout"]=2021,C[O[2011]="TokenExpired"]=2011,C[O[2022]="KickOut"]=2022,C[O[2023]="EndPk"]=2023,C[O[2024]="EndLive"]=2024,C}(),M.UserBehavior=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.type=0,O.prototype.behavior=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&u.uint32(8).int32(i.type),i.behavior!=null&&Object.hasOwnProperty.call(i,"behavior")&&u.uint32(16).bool(i.behavior),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.UserBehavior;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.type=i.int32();break}case 2:{N.behavior=i.bool();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserBehavior)return i;let u=new $root.com.quick.voice.proto.UserBehavior;switch(i.type){default:if(typeof i.type=="number"){u.type=i.type;break}break;case"Microphone":case 0:u.type=0;break;case"Camera":case 1:u.type=1;break;case"Screen":case 2:u.type=2;break;case"SystemVoice":case 3:u.type=3;break}return i.behavior!=null&&(u.behavior=!!i.behavior),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.type=u.enums===String?"Microphone":0,$.behavior=!1),i.type!=null&&i.hasOwnProperty("type")&&($.type=u.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")&&($.behavior=i.behavior),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserBehavior"},O}(),M.PreventUser=function(){function O(C){if(this.behaviors=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.id="",O.prototype.behaviors=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.id!=null&&Object.hasOwnProperty.call(i,"id")&&u.uint32(10).string(i.id),i.behaviors!=null&&i.behaviors.length)for(let $=0;$<i.behaviors.length;++$)$root.com.quick.voice.proto.UserBehavior.encode(i.behaviors[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.PreventUser;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.id=i.string();break}case 2:{N.behaviors&&N.behaviors.length||(N.behaviors=[]),N.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.behaviors.length;++u){let $=$root.com.quick.voice.proto.UserBehavior.verify(i.behaviors[u]);if($)return"behaviors."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUser)return i;let u=new $root.com.quick.voice.proto.PreventUser;if(i.id!=null&&(u.id=String(i.id)),i.behaviors){if(!Array.isArray(i.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");u.behaviors=[];for(let $=0;$<i.behaviors.length;++$){if(typeof i.behaviors[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");u.behaviors[$]=$root.com.quick.voice.proto.UserBehavior.fromObject(i.behaviors[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.behaviors=[]),u.defaults&&($.id=""),i.id!=null&&i.hasOwnProperty("id")&&($.id=i.id),i.behaviors&&i.behaviors.length){$.behaviors=[];for(let N=0;N<i.behaviors.length;++N)$.behaviors[N]=$root.com.quick.voice.proto.UserBehavior.toObject(i.behaviors[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUser"},O}(),M.PreventUsersBehaviorReq=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.users=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.PreventUser.encode(i.users[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.PreventUser.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.PreventUser.verify(i.users[u]);if($)return"users."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return i;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");u.users[$]=$root.com.quick.voice.proto.PreventUser.fromObject(i.users[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),u.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.users&&i.users.length){$.users=[];for(let N=0;N<i.users.length;++N)$.users[N]=$root.com.quick.voice.proto.PreventUser.toObject(i.users[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorReq"},O}(),M.PreventUsersBehaviorNotify=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.users=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.User.encode(i.users[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.User.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.User.verify(i.users[u]);if($)return"users."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return i;let u=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.users){if(!Array.isArray(i.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");u.users[$]=$root.com.quick.voice.proto.User.fromObject(i.users[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),u.defaults&&($.roomId=""),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.users&&i.users.length){$.users=[];for(let N=0;N<i.users.length;++N)$.users[N]=$root.com.quick.voice.proto.User.toObject(i.users[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},O}(),M.AccelerationAreas=function(){const O={},C=Object.create(O);return C[O[0]="chinaMainland"]=0,C[O[1]="global"]=1,C[O[2]="overseas"]=2,C}(),M.CountMethods=function(){const O={},C=Object.create(O);return C[O[0]="flow"]=0,C[O[1]="minutes"]=1,C}(),M.BaseCDNAddress=function(){function O(C){if(this.urlMap={},C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.area=0,O.prototype.countType=0,O.prototype.urlMap=$util.emptyObject,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.area!=null&&Object.hasOwnProperty.call(i,"area")&&u.uint32(8).int32(i.area),i.countType!=null&&Object.hasOwnProperty.call(i,"countType")&&u.uint32(16).int32(i.countType),i.urlMap!=null&&Object.hasOwnProperty.call(i,"urlMap"))for(let $=Object.keys(i.urlMap),N=0;N<$.length;++N)u.uint32(26).fork().uint32(10).string($[N]).uint32(18).string(i.urlMap[$[N]]).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.BaseCDNAddress,F,Z;for(;i.pos<$;){let K=i.uint32();switch(K>>>3){case 1:{N.area=i.int32();break}case 2:{N.countType=i.int32();break}case 3:{N.urlMap===$util.emptyObject&&(N.urlMap={});let J=i.uint32()+i.pos;for(F="",Z="";i.pos<J;){let Y=i.uint32();switch(Y>>>3){case 1:F=i.string();break;case 2:Z=i.string();break;default:i.skipType(Y&7);break}}N.urlMap[F]=Z;break}default:i.skipType(K&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=Object.keys(i.urlMap);for(let $=0;$<u.length;++$)if(!$util.isString(i.urlMap[u[$]]))return"urlMap: string{k:string} expected"}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.BaseCDNAddress)return i;let u=new $root.com.quick.voice.proto.BaseCDNAddress;switch(i.area){default:if(typeof i.area=="number"){u.area=i.area;break}break;case"chinaMainland":case 0:u.area=0;break;case"global":case 1:u.area=1;break;case"overseas":case 2:u.area=2;break}switch(i.countType){default:if(typeof i.countType=="number"){u.countType=i.countType;break}break;case"flow":case 0:u.countType=0;break;case"minutes":case 1:u.countType=1;break}if(i.urlMap){if(typeof i.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");u.urlMap={};for(let $=Object.keys(i.urlMap),N=0;N<$.length;++N)u.urlMap[$[N]]=String(i.urlMap[$[N]])}return u},O.toObject=function(i,u){u||(u={});let $={};(u.objects||u.defaults)&&($.urlMap={}),u.defaults&&($.area=u.enums===String?"chinaMainland":0,$.countType=u.enums===String?"flow":0),i.area!=null&&i.hasOwnProperty("area")&&($.area=u.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")&&($.countType=u.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 N;if(i.urlMap&&(N=Object.keys(i.urlMap)).length){$.urlMap={};for(let F=0;F<N.length;++F)$.urlMap[N[F]]=i.urlMap[N[F]]}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.BaseCDNAddress"},O}(),M.CDNPlayAddressNotify=function(){function O(i){if(this.standLines=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.m3u8=null,O.prototype.rtmp=null,O.prototype.flv=null,O.prototype.rtmps=null,O.prototype.mainLine=null,O.prototype.standLines=$util.emptyArray;let C;return Object.defineProperty(O.prototype,"_m3u8",{get:$util.oneOfGetter(C=["m3u8"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_rtmp",{get:$util.oneOfGetter(C=["rtmp"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_flv",{get:$util.oneOfGetter(C=["flv"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_rtmps",{get:$util.oneOfGetter(C=["rtmps"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_mainLine",{get:$util.oneOfGetter(C=["mainLine"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.m3u8!=null&&Object.hasOwnProperty.call(u,"m3u8")&&$.uint32(18).string(u.m3u8),u.rtmp!=null&&Object.hasOwnProperty.call(u,"rtmp")&&$.uint32(26).string(u.rtmp),u.flv!=null&&Object.hasOwnProperty.call(u,"flv")&&$.uint32(34).string(u.flv),u.rtmps!=null&&Object.hasOwnProperty.call(u,"rtmps")&&$.uint32(42).string(u.rtmps),u.mainLine!=null&&Object.hasOwnProperty.call(u,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(u.mainLine,$.uint32(50).fork()).ldelim(),u.standLines!=null&&u.standLines.length)for(let N=0;N<u.standLines.length;++N)$root.com.quick.voice.proto.BaseCDNAddress.encode(u.standLines[N],$.uint32(58).fork()).ldelim();return $},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.m3u8=u.string();break}case 3:{F.rtmp=u.string();break}case 4:{F.flv=u.string();break}case 5:{F.rtmps=u.string();break}case 6:{F.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32());break}case 7:{F.standLines&&F.standLines.length||(F.standLines=[]),F.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(u,u.uint32()));break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.m3u8!=null&&u.hasOwnProperty("m3u8")&&!$util.isString(u.m3u8))return"m3u8: string expected";if(u.rtmp!=null&&u.hasOwnProperty("rtmp")&&!$util.isString(u.rtmp))return"rtmp: string expected";if(u.flv!=null&&u.hasOwnProperty("flv")&&!$util.isString(u.flv))return"flv: string expected";if(u.rtmps!=null&&u.hasOwnProperty("rtmps")&&!$util.isString(u.rtmps))return"rtmps: string expected";if(u.mainLine!=null&&u.hasOwnProperty("mainLine")){let $=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.mainLine);if($)return"mainLine."+$}if(u.standLines!=null&&u.hasOwnProperty("standLines")){if(!Array.isArray(u.standLines))return"standLines: array expected";for(let $=0;$<u.standLines.length;++$){let N=$root.com.quick.voice.proto.BaseCDNAddress.verify(u.standLines[$]);if(N)return"standLines."+N}}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return u;let $=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.m3u8!=null&&($.m3u8=String(u.m3u8)),u.rtmp!=null&&($.rtmp=String(u.rtmp)),u.flv!=null&&($.flv=String(u.flv)),u.rtmps!=null&&($.rtmps=String(u.rtmps)),u.mainLine!=null){if(typeof u.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");$.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.mainLine)}if(u.standLines){if(!Array.isArray(u.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");$.standLines=[];for(let N=0;N<u.standLines.length;++N){if(typeof u.standLines[N]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");$.standLines[N]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(u.standLines[N])}}return $},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.standLines=[]),$.defaults&&(N.roomId=""),u.roomId!=null&&u.hasOwnProperty("roomId")&&(N.roomId=u.roomId),u.m3u8!=null&&u.hasOwnProperty("m3u8")&&(N.m3u8=u.m3u8,$.oneofs&&(N._m3u8="m3u8")),u.rtmp!=null&&u.hasOwnProperty("rtmp")&&(N.rtmp=u.rtmp,$.oneofs&&(N._rtmp="rtmp")),u.flv!=null&&u.hasOwnProperty("flv")&&(N.flv=u.flv,$.oneofs&&(N._flv="flv")),u.rtmps!=null&&u.hasOwnProperty("rtmps")&&(N.rtmps=u.rtmps,$.oneofs&&(N._rtmps="rtmps")),u.mainLine!=null&&u.hasOwnProperty("mainLine")&&(N.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.mainLine,$),$.oneofs&&(N._mainLine="mainLine")),u.standLines&&u.standLines.length){N.standLines=[];for(let F=0;F<u.standLines.length;++F)N.standLines[F]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(u.standLines[F],$)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.CDNPlayAddressNotify"},O}(),M.UserChannel=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.UserChannel;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.userId=i.string();break}case 2:{N.channels&&N.channels.length||(N.channels=[]),N.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.UserChannel)return i;let u=new $root.com.quick.voice.proto.UserChannel;if(i.userId!=null&&(u.userId=String(i.userId)),i.channels){if(!Array.isArray(i.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),u.defaults&&($.userId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.channels&&i.channels.length){$.channels=[];for(let N=0;N<i.channels.length;++N)$.channels[N]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.UserChannel"},O}(),M.ChannelPublishReq=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.DataChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.ChannelPublishReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.channels&&N.channels.length||(N.channels=[]),N.channels.push($root.com.quick.voice.proto.DataChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.DataChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishReq)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.DataChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let N=0;N<i.channels.length;++N)$.channels[N]=$root.com.quick.voice.proto.DataChannel.toObject(i.channels[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishReq"},O}(),M.ChannelPublishRsq=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.channels&&N.channels.length||(N.channels=[]),N.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.UserChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let N=0;N<i.channels.length;++N)$.channels[N]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelPublishRsq"},O}(),M.ChannelSubscribeReq=function(){function O(C){if(this.users=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.users=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.users!=null&&i.users.length)for(let $=0;$<i.users.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.users[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.users&&N.users.length||(N.users=[]),N.users.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.users.length;++u){let $=$root.com.quick.voice.proto.UserChannel.verify(i.users[u]);if($)return"users."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return i;let u=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");u.users=[];for(let $=0;$<i.users.length;++$){if(typeof i.users[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");u.users[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.users[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.users=[]),i.users&&i.users.length){$.users=[];for(let N=0;N<i.users.length;++N)$.users[N]=$root.com.quick.voice.proto.UserChannel.toObject(i.users[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeReq"},O}(),M.ChannelSubscribeRsq=function(){function O(C){if(this.channels=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.channels=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.channels!=null&&i.channels.length)for(let $=0;$<i.channels.length;++$)$root.com.quick.voice.proto.UserChannel.encode(i.channels[$],u.uint32(10).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.channels&&N.channels.length||(N.channels=[]),N.channels.push($root.com.quick.voice.proto.UserChannel.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.channels.length;++u){let $=$root.com.quick.voice.proto.UserChannel.verify(i.channels[u]);if($)return"channels."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return i;let u=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");u.channels=[];for(let $=0;$<i.channels.length;++$){if(typeof i.channels[$]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");u.channels[$]=$root.com.quick.voice.proto.UserChannel.fromObject(i.channels[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.channels=[]),i.channels&&i.channels.length){$.channels=[];for(let N=0;N<i.channels.length;++N)$.channels[N]=$root.com.quick.voice.proto.UserChannel.toObject(i.channels[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ChannelSubscribeRsq"},O}(),M.DataChannelData=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.userId="",O.prototype.type=0,O.prototype.audioData=null;let C;return Object.defineProperty(O.prototype,"_audioData",{get:$util.oneOfGetter(C=["audioData"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&$.uint32(10).string(u.userId),u.type!=null&&Object.hasOwnProperty.call(u,"type")&&$.uint32(16).int32(u.type),u.audioData!=null&&Object.hasOwnProperty.call(u,"audioData")&&$root.com.quick.voice.proto.DataChannelAudioData.encode(u.audioData,$.uint32(26).fork()).ldelim(),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.DataChannelData;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.userId=u.string();break}case 2:{F.type=u.int32();break}case 3:{F.audioData=$root.com.quick.voice.proto.DataChannelAudioData.decode(u,u.uint32());break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.type!=null&&u.hasOwnProperty("type"))switch(u.type){default:return"type: enum value expected";case 0:break}if(u.audioData!=null&&u.hasOwnProperty("audioData")){let $=$root.com.quick.voice.proto.DataChannelAudioData.verify(u.audioData);if($)return"audioData."+$}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.DataChannelData)return u;let $=new $root.com.quick.voice.proto.DataChannelData;switch(u.userId!=null&&($.userId=String(u.userId)),u.type){default:if(typeof u.type=="number"){$.type=u.type;break}break;case"backAuido":case 0:$.type=0;break}if(u.audioData!=null){if(typeof u.audioData!="object")throw TypeError(".com.quick.voice.proto.DataChannelData.audioData: object expected");$.audioData=$root.com.quick.voice.proto.DataChannelAudioData.fromObject(u.audioData)}return $},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&(N.userId="",N.type=$.enums===String?"backAuido":0),u.userId!=null&&u.hasOwnProperty("userId")&&(N.userId=u.userId),u.type!=null&&u.hasOwnProperty("type")&&(N.type=$.enums===String?$root.com.quick.voice.proto.DataChannelType[u.type]===void 0?u.type:$root.com.quick.voice.proto.DataChannelType[u.type]:u.type),u.audioData!=null&&u.hasOwnProperty("audioData")&&(N.audioData=$root.com.quick.voice.proto.DataChannelAudioData.toObject(u.audioData,$),$.oneofs&&(N._audioData="audioData")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.DataChannelData"},O}(),M.DataChannelType=function(){const O={},C=Object.create(O);return C[O[0]="backAuido"]=0,C}(),M.DataChannelAudioData=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.data=$util.newBuffer([]),O.prototype.format=null,O.prototype.time=null;let C;return Object.defineProperty(O.prototype,"_time",{get:$util.oneOfGetter(C=["time"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.data!=null&&Object.hasOwnProperty.call(u,"data")&&$.uint32(10).bytes(u.data),u.format!=null&&Object.hasOwnProperty.call(u,"format")&&$root.com.quick.voice.proto.DataChannelAudioFormat.encode(u.format,$.uint32(18).fork()).ldelim(),u.time!=null&&Object.hasOwnProperty.call(u,"time")&&$.uint32(24).int64(u.time),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.DataChannelAudioData;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.data=u.bytes();break}case 2:{F.format=$root.com.quick.voice.proto.DataChannelAudioFormat.decode(u,u.uint32());break}case 3:{F.time=u.int64();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.data!=null&&u.hasOwnProperty("data")&&!(u.data&&typeof u.data.length=="number"||$util.isString(u.data)))return"data: buffer expected";if(u.format!=null&&u.hasOwnProperty("format")){let $=$root.com.quick.voice.proto.DataChannelAudioFormat.verify(u.format);if($)return"format."+$}return u.time!=null&&u.hasOwnProperty("time")&&!$util.isInteger(u.time)&&!(u.time&&$util.isInteger(u.time.low)&&$util.isInteger(u.time.high))?"time: integer|Long expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.DataChannelAudioData)return u;let $=new $root.com.quick.voice.proto.DataChannelAudioData;if(u.data!=null&&(typeof u.data=="string"?$util.base64.decode(u.data,$.data=$util.newBuffer($util.base64.length(u.data)),0):u.data.length>=0&&($.data=u.data)),u.format!=null){if(typeof u.format!="object")throw TypeError(".com.quick.voice.proto.DataChannelAudioData.format: object expected");$.format=$root.com.quick.voice.proto.DataChannelAudioFormat.fromObject(u.format)}return u.time!=null&&($util.Long?($.time=$util.Long.fromValue(u.time)).unsigned=!1:typeof u.time=="string"?$.time=parseInt(u.time,10):typeof u.time=="number"?$.time=u.time:typeof u.time=="object"&&($.time=new $util.LongBits(u.time.low>>>0,u.time.high>>>0).toNumber())),$},O.toObject=function(u,$){$||($={});let N={};return $.defaults&&($.bytes===String?N.data="":(N.data=[],$.bytes!==Array&&(N.data=$util.newBuffer(N.data))),N.format=null),u.data!=null&&u.hasOwnProperty("data")&&(N.data=$.bytes===String?$util.base64.encode(u.data,0,u.data.length):$.bytes===Array?Array.prototype.slice.call(u.data):u.data),u.format!=null&&u.hasOwnProperty("format")&&(N.format=$root.com.quick.voice.proto.DataChannelAudioFormat.toObject(u.format,$)),u.time!=null&&u.hasOwnProperty("time")&&(typeof u.time=="number"?N.time=$.longs===String?String(u.time):u.time:N.time=$.longs===String?$util.Long.prototype.toString.call(u.time):$.longs===Number?new $util.LongBits(u.time.low>>>0,u.time.high>>>0).toNumber():u.time,$.oneofs&&(N._time="time")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.DataChannelAudioData"},O}(),M.DataChannelAudioFormat=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sampleRate=0,O.prototype.channels=0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.sampleRate!=null&&Object.hasOwnProperty.call(i,"sampleRate")&&u.uint32(9).double(i.sampleRate),i.channels!=null&&Object.hasOwnProperty.call(i,"channels")&&u.uint32(16).int32(i.channels),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.DataChannelAudioFormat;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.sampleRate=i.double();break}case 2:{N.channels=i.int32();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.DataChannelAudioFormat)return i;let u=new $root.com.quick.voice.proto.DataChannelAudioFormat;return i.sampleRate!=null&&(u.sampleRate=Number(i.sampleRate)),i.channels!=null&&(u.channels=i.channels|0),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.sampleRate=0,$.channels=0),i.sampleRate!=null&&i.hasOwnProperty("sampleRate")&&($.sampleRate=u.json&&!isFinite(i.sampleRate)?String(i.sampleRate):i.sampleRate),i.channels!=null&&i.hasOwnProperty("channels")&&($.channels=i.channels),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.DataChannelAudioFormat"},O}(),M.AckMsgReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.msgId=$util.Long?$util.Long.fromBits(0,0,!1):0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.msgId!=null&&Object.hasOwnProperty.call(i,"msgId")&&u.uint32(8).int64(i.msgId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.AckMsgReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.msgId=i.int64();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.AckMsgReq)return i;let u=new $root.com.quick.voice.proto.AckMsgReq;return i.msgId!=null&&($util.Long?(u.msgId=$util.Long.fromValue(i.msgId)).unsigned=!1:typeof i.msgId=="string"?u.msgId=parseInt(i.msgId,10):typeof i.msgId=="number"?u.msgId=i.msgId:typeof i.msgId=="object"&&(u.msgId=new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber())),u},O.toObject=function(i,u){u||(u={});let $={};if(u.defaults)if($util.Long){let N=new $util.Long(0,0,!1);$.msgId=u.longs===String?N.toString():u.longs===Number?N.toNumber():N}else $.msgId=u.longs===String?"0":0;return i.msgId!=null&&i.hasOwnProperty("msgId")&&(typeof i.msgId=="number"?$.msgId=u.longs===String?String(i.msgId):i.msgId:$.msgId=u.longs===String?$util.Long.prototype.toString.call(i.msgId):u.longs===Number?new $util.LongBits(i.msgId.low>>>0,i.msgId.high>>>0).toNumber():i.msgId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.AckMsgReq"},O}(),M.SdpConsult=function(){function O(i){if(this.tracks=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.roomId="",O.prototype.sender=null,O.prototype.receiverId="",O.prototype.sdp="",O.prototype.tracks=$util.emptyArray;let C;return Object.defineProperty(O.prototype,"_sender",{get:$util.oneOfGetter(C=["sender"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.roomId!=null&&Object.hasOwnProperty.call(u,"roomId")&&$.uint32(10).string(u.roomId),u.sender!=null&&Object.hasOwnProperty.call(u,"sender")&&$root.com.quick.voice.proto.User.encode(u.sender,$.uint32(18).fork()).ldelim(),u.receiverId!=null&&Object.hasOwnProperty.call(u,"receiverId")&&$.uint32(26).string(u.receiverId),u.sdp!=null&&Object.hasOwnProperty.call(u,"sdp")&&$.uint32(34).string(u.sdp),u.tracks!=null&&u.tracks.length)for(let N=0;N<u.tracks.length;++N)$root.com.quick.voice.proto.Track.encode(u.tracks[N],$.uint32(42).fork()).ldelim();return $},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.SdpConsult;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.roomId=u.string();break}case 2:{F.sender=$root.com.quick.voice.proto.User.decode(u,u.uint32());break}case 3:{F.receiverId=u.string();break}case 4:{F.sdp=u.string();break}case 5:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(u,u.uint32()));break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.roomId!=null&&u.hasOwnProperty("roomId")&&!$util.isString(u.roomId))return"roomId: string expected";if(u.sender!=null&&u.hasOwnProperty("sender")){let $=$root.com.quick.voice.proto.User.verify(u.sender);if($)return"sender."+$}if(u.receiverId!=null&&u.hasOwnProperty("receiverId")&&!$util.isString(u.receiverId))return"receiverId: string expected";if(u.sdp!=null&&u.hasOwnProperty("sdp")&&!$util.isString(u.sdp))return"sdp: string expected";if(u.tracks!=null&&u.hasOwnProperty("tracks")){if(!Array.isArray(u.tracks))return"tracks: array expected";for(let $=0;$<u.tracks.length;++$){let N=$root.com.quick.voice.proto.Track.verify(u.tracks[$]);if(N)return"tracks."+N}}return null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.SdpConsult)return u;let $=new $root.com.quick.voice.proto.SdpConsult;if(u.roomId!=null&&($.roomId=String(u.roomId)),u.sender!=null){if(typeof u.sender!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.sender: object expected");$.sender=$root.com.quick.voice.proto.User.fromObject(u.sender)}if(u.receiverId!=null&&($.receiverId=String(u.receiverId)),u.sdp!=null&&($.sdp=String(u.sdp)),u.tracks){if(!Array.isArray(u.tracks))throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: array expected");$.tracks=[];for(let N=0;N<u.tracks.length;++N){if(typeof u.tracks[N]!="object")throw TypeError(".com.quick.voice.proto.SdpConsult.tracks: object expected");$.tracks[N]=$root.com.quick.voice.proto.Track.fromObject(u.tracks[N])}}return $},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.tracks=[]),$.defaults&&(N.roomId="",N.receiverId="",N.sdp=""),u.roomId!=null&&u.hasOwnProperty("roomId")&&(N.roomId=u.roomId),u.sender!=null&&u.hasOwnProperty("sender")&&(N.sender=$root.com.quick.voice.proto.User.toObject(u.sender,$),$.oneofs&&(N._sender="sender")),u.receiverId!=null&&u.hasOwnProperty("receiverId")&&(N.receiverId=u.receiverId),u.sdp!=null&&u.hasOwnProperty("sdp")&&(N.sdp=u.sdp),u.tracks&&u.tracks.length){N.tracks=[];for(let F=0;F<u.tracks.length;++F)N.tracks[F]=$root.com.quick.voice.proto.Track.toObject(u.tracks[F],$)}return N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.SdpConsult"},O}(),M.Candidate=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sdpMid="",O.prototype.sdpMLineIndex=0,O.prototype.sdp="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.sdpMid!=null&&Object.hasOwnProperty.call(i,"sdpMid")&&u.uint32(10).string(i.sdpMid),i.sdpMLineIndex!=null&&Object.hasOwnProperty.call(i,"sdpMLineIndex")&&u.uint32(16).int32(i.sdpMLineIndex),i.sdp!=null&&Object.hasOwnProperty.call(i,"sdp")&&u.uint32(26).string(i.sdp),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.Candidate;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.sdpMid=i.string();break}case 2:{N.sdpMLineIndex=i.int32();break}case 3:{N.sdp=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidate)return i;let u=new $root.com.quick.voice.proto.Candidate;return i.sdpMid!=null&&(u.sdpMid=String(i.sdpMid)),i.sdpMLineIndex!=null&&(u.sdpMLineIndex=i.sdpMLineIndex|0),i.sdp!=null&&(u.sdp=String(i.sdp)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.sdpMid="",$.sdpMLineIndex=0,$.sdp=""),i.sdpMid!=null&&i.hasOwnProperty("sdpMid")&&($.sdpMid=i.sdpMid),i.sdpMLineIndex!=null&&i.hasOwnProperty("sdpMLineIndex")&&($.sdpMLineIndex=i.sdpMLineIndex),i.sdp!=null&&i.hasOwnProperty("sdp")&&($.sdp=i.sdp),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidate"},O}(),M.Candidates=function(){function O(C){if(this.candidates=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.roomId="",O.prototype.senderId="",O.prototype.receiverId="",O.prototype.candidates=$util.emptyArray,O.prototype.isSubscribeReceiver=!1,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(10).string(i.roomId),i.senderId!=null&&Object.hasOwnProperty.call(i,"senderId")&&u.uint32(18).string(i.senderId),i.receiverId!=null&&Object.hasOwnProperty.call(i,"receiverId")&&u.uint32(26).string(i.receiverId),i.candidates!=null&&i.candidates.length)for(let $=0;$<i.candidates.length;++$)$root.com.quick.voice.proto.Candidate.encode(i.candidates[$],u.uint32(34).fork()).ldelim();return i.isSubscribeReceiver!=null&&Object.hasOwnProperty.call(i,"isSubscribeReceiver")&&u.uint32(40).bool(i.isSubscribeReceiver),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.Candidates;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.roomId=i.string();break}case 2:{N.senderId=i.string();break}case 3:{N.receiverId=i.string();break}case 4:{N.candidates&&N.candidates.length||(N.candidates=[]),N.candidates.push($root.com.quick.voice.proto.Candidate.decode(i,i.uint32()));break}case 5:{N.isSubscribeReceiver=i.bool();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.candidates.length;++u){let $=$root.com.quick.voice.proto.Candidate.verify(i.candidates[u]);if($)return"candidates."+$}}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&typeof i.isSubscribeReceiver!="boolean"?"isSubscribeReceiver: boolean expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.Candidates)return i;let u=new $root.com.quick.voice.proto.Candidates;if(i.roomId!=null&&(u.roomId=String(i.roomId)),i.senderId!=null&&(u.senderId=String(i.senderId)),i.receiverId!=null&&(u.receiverId=String(i.receiverId)),i.candidates){if(!Array.isArray(i.candidates))throw TypeError(".com.quick.voice.proto.Candidates.candidates: array expected");u.candidates=[];for(let $=0;$<i.candidates.length;++$){if(typeof i.candidates[$]!="object")throw TypeError(".com.quick.voice.proto.Candidates.candidates: object expected");u.candidates[$]=$root.com.quick.voice.proto.Candidate.fromObject(i.candidates[$])}}return i.isSubscribeReceiver!=null&&(u.isSubscribeReceiver=!!i.isSubscribeReceiver),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.candidates=[]),u.defaults&&($.roomId="",$.senderId="",$.receiverId="",$.isSubscribeReceiver=!1),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),i.senderId!=null&&i.hasOwnProperty("senderId")&&($.senderId=i.senderId),i.receiverId!=null&&i.hasOwnProperty("receiverId")&&($.receiverId=i.receiverId),i.candidates&&i.candidates.length){$.candidates=[];for(let N=0;N<i.candidates.length;++N)$.candidates[N]=$root.com.quick.voice.proto.Candidate.toObject(i.candidates[N],u)}return i.isSubscribeReceiver!=null&&i.hasOwnProperty("isSubscribeReceiver")&&($.isSubscribeReceiver=i.isSubscribeReceiver),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.Candidates"},O}(),M.NatType=function(){const O={},C=Object.create(O);return C[O[0]="Symmetric"]=0,C[O[1]="Cone"]=1,C[O[2]="Port"]=2,C[O[3]="IP"]=3,C[O[4]="UnKnown"]=4,C}(),M.NetworkType=function(){const O={},C=Object.create(O);return C[O[0]="Wifi"]=0,C[O[1]="Wired"]=1,C[O[2]="Mobile"]=2,C}(),M.ReportNetInfo=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.nat=0,O.prototype.type=0,O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.nat!=null&&Object.hasOwnProperty.call(i,"nat")&&u.uint32(8).int32(i.nat),i.type!=null&&Object.hasOwnProperty.call(i,"type")&&u.uint32(16).int32(i.type),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.ReportNetInfo;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.nat=i.int32();break}case 2:{N.type=i.int32();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.ReportNetInfo)return i;let u=new $root.com.quick.voice.proto.ReportNetInfo;switch(i.nat){default:if(typeof i.nat=="number"){u.nat=i.nat;break}break;case"Symmetric":case 0:u.nat=0;break;case"Cone":case 1:u.nat=1;break;case"Port":case 2:u.nat=2;break;case"IP":case 3:u.nat=3;break;case"UnKnown":case 4:u.nat=4;break}switch(i.type){default:if(typeof i.type=="number"){u.type=i.type;break}break;case"Wifi":case 0:u.type=0;break;case"Wired":case 1:u.type=1;break;case"Mobile":case 2:u.type=2;break}return u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.nat=u.enums===String?"Symmetric":0,$.type=u.enums===String?"Wifi":0),i.nat!=null&&i.hasOwnProperty("nat")&&($.nat=u.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")&&($.type=u.enums===String?$root.com.quick.voice.proto.NetworkType[i.type]===void 0?i.type:$root.com.quick.voice.proto.NetworkType[i.type]:i.type),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.ReportNetInfo"},O}(),M.P2PCode=function(){const O={},C=Object.create(O);return C[O[0]="Success"]=0,C[O[1]="Failed"]=1,C[O[2]="Ignore"]=2,C[O[3]="Disconnected"]=3,C[O[4]="LowQuality"]=4,C}(),M.ReportP2PReq=function(){function O(i){if(this.pushUserIds=[],i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.code=0,O.prototype.userId="",O.prototype.reason=null,O.prototype.pushUserIds=$util.emptyArray,O.prototype.origin="",O.prototype.connectedTime=null;let C;return Object.defineProperty(O.prototype,"_reason",{get:$util.oneOfGetter(C=["reason"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_connectedTime",{get:$util.oneOfGetter(C=["connectedTime"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){if($||($=$Writer.create()),u.code!=null&&Object.hasOwnProperty.call(u,"code")&&$.uint32(8).int32(u.code),u.userId!=null&&Object.hasOwnProperty.call(u,"userId")&&$.uint32(18).string(u.userId),u.reason!=null&&Object.hasOwnProperty.call(u,"reason")&&$.uint32(26).string(u.reason),u.pushUserIds!=null&&u.pushUserIds.length)for(let N=0;N<u.pushUserIds.length;++N)$.uint32(34).string(u.pushUserIds[N]);return u.origin!=null&&Object.hasOwnProperty.call(u,"origin")&&$.uint32(42).string(u.origin),u.connectedTime!=null&&Object.hasOwnProperty.call(u,"connectedTime")&&$.uint32(50).string(u.connectedTime),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.ReportP2PReq;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.code=u.int32();break}case 2:{F.userId=u.string();break}case 3:{F.reason=u.string();break}case 4:{F.pushUserIds&&F.pushUserIds.length||(F.pushUserIds=[]),F.pushUserIds.push(u.string());break}case 5:{F.origin=u.string();break}case 6:{F.connectedTime=u.string();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){if(typeof u!="object"||u===null)return"object expected";if(u.code!=null&&u.hasOwnProperty("code"))switch(u.code){default:return"code: enum value expected";case 0:case 1:case 2:case 3:case 4:break}if(u.userId!=null&&u.hasOwnProperty("userId")&&!$util.isString(u.userId))return"userId: string expected";if(u.reason!=null&&u.hasOwnProperty("reason")&&!$util.isString(u.reason))return"reason: string expected";if(u.pushUserIds!=null&&u.hasOwnProperty("pushUserIds")){if(!Array.isArray(u.pushUserIds))return"pushUserIds: array expected";for(let $=0;$<u.pushUserIds.length;++$)if(!$util.isString(u.pushUserIds[$]))return"pushUserIds: string[] expected"}return u.origin!=null&&u.hasOwnProperty("origin")&&!$util.isString(u.origin)?"origin: string expected":u.connectedTime!=null&&u.hasOwnProperty("connectedTime")&&!$util.isString(u.connectedTime)?"connectedTime: string expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.ReportP2PReq)return u;let $=new $root.com.quick.voice.proto.ReportP2PReq;switch(u.code){default:if(typeof u.code=="number"){$.code=u.code;break}break;case"Success":case 0:$.code=0;break;case"Failed":case 1:$.code=1;break;case"Ignore":case 2:$.code=2;break;case"Disconnected":case 3:$.code=3;break;case"LowQuality":case 4:$.code=4;break}if(u.userId!=null&&($.userId=String(u.userId)),u.reason!=null&&($.reason=String(u.reason)),u.pushUserIds){if(!Array.isArray(u.pushUserIds))throw TypeError(".com.quick.voice.proto.ReportP2PReq.pushUserIds: array expected");$.pushUserIds=[];for(let N=0;N<u.pushUserIds.length;++N)$.pushUserIds[N]=String(u.pushUserIds[N])}return u.origin!=null&&($.origin=String(u.origin)),u.connectedTime!=null&&($.connectedTime=String(u.connectedTime)),$},O.toObject=function(u,$){$||($={});let N={};if(($.arrays||$.defaults)&&(N.pushUserIds=[]),$.defaults&&(N.code=$.enums===String?"Success":0,N.userId="",N.origin=""),u.code!=null&&u.hasOwnProperty("code")&&(N.code=$.enums===String?$root.com.quick.voice.proto.P2PCode[u.code]===void 0?u.code:$root.com.quick.voice.proto.P2PCode[u.code]:u.code),u.userId!=null&&u.hasOwnProperty("userId")&&(N.userId=u.userId),u.reason!=null&&u.hasOwnProperty("reason")&&(N.reason=u.reason,$.oneofs&&(N._reason="reason")),u.pushUserIds&&u.pushUserIds.length){N.pushUserIds=[];for(let F=0;F<u.pushUserIds.length;++F)N.pushUserIds[F]=u.pushUserIds[F]}return u.origin!=null&&u.hasOwnProperty("origin")&&(N.origin=u.origin),u.connectedTime!=null&&u.hasOwnProperty("connectedTime")&&(N.connectedTime=u.connectedTime,$.oneofs&&(N._connectedTime="connectedTime")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.ReportP2PReq"},O}(),M.ReportTrafficUsage=function(){function O(i){if(i)for(let u=Object.keys(i),$=0;$<u.length;++$)i[u[$]]!=null&&(this[u[$]]=i[u[$]])}O.prototype.p2pPush=null,O.prototype.p2pPull=null,O.prototype.sfuPush=null,O.prototype.sfuPull=null;let C;return Object.defineProperty(O.prototype,"_p2pPush",{get:$util.oneOfGetter(C=["p2pPush"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_p2pPull",{get:$util.oneOfGetter(C=["p2pPull"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_sfuPush",{get:$util.oneOfGetter(C=["sfuPush"]),set:$util.oneOfSetter(C)}),Object.defineProperty(O.prototype,"_sfuPull",{get:$util.oneOfGetter(C=["sfuPull"]),set:$util.oneOfSetter(C)}),O.create=function(u){return new O(u)},O.encode=function(u,$){return $||($=$Writer.create()),u.p2pPush!=null&&Object.hasOwnProperty.call(u,"p2pPush")&&$.uint32(8).int64(u.p2pPush),u.p2pPull!=null&&Object.hasOwnProperty.call(u,"p2pPull")&&$.uint32(16).int64(u.p2pPull),u.sfuPush!=null&&Object.hasOwnProperty.call(u,"sfuPush")&&$.uint32(24).int64(u.sfuPush),u.sfuPull!=null&&Object.hasOwnProperty.call(u,"sfuPull")&&$.uint32(32).int64(u.sfuPull),$},O.encodeDelimited=function(u,$){return this.encode(u,$).ldelim()},O.decode=function(u,$){u instanceof $Reader||(u=$Reader.create(u));let N=$===void 0?u.len:u.pos+$,F=new $root.com.quick.voice.proto.ReportTrafficUsage;for(;u.pos<N;){let Z=u.uint32();switch(Z>>>3){case 1:{F.p2pPush=u.int64();break}case 2:{F.p2pPull=u.int64();break}case 3:{F.sfuPush=u.int64();break}case 4:{F.sfuPull=u.int64();break}default:u.skipType(Z&7);break}}return F},O.decodeDelimited=function(u){return u instanceof $Reader||(u=new $Reader(u)),this.decode(u,u.uint32())},O.verify=function(u){return typeof u!="object"||u===null?"object expected":u.p2pPush!=null&&u.hasOwnProperty("p2pPush")&&!$util.isInteger(u.p2pPush)&&!(u.p2pPush&&$util.isInteger(u.p2pPush.low)&&$util.isInteger(u.p2pPush.high))?"p2pPush: integer|Long expected":u.p2pPull!=null&&u.hasOwnProperty("p2pPull")&&!$util.isInteger(u.p2pPull)&&!(u.p2pPull&&$util.isInteger(u.p2pPull.low)&&$util.isInteger(u.p2pPull.high))?"p2pPull: integer|Long expected":u.sfuPush!=null&&u.hasOwnProperty("sfuPush")&&!$util.isInteger(u.sfuPush)&&!(u.sfuPush&&$util.isInteger(u.sfuPush.low)&&$util.isInteger(u.sfuPush.high))?"sfuPush: integer|Long expected":u.sfuPull!=null&&u.hasOwnProperty("sfuPull")&&!$util.isInteger(u.sfuPull)&&!(u.sfuPull&&$util.isInteger(u.sfuPull.low)&&$util.isInteger(u.sfuPull.high))?"sfuPull: integer|Long expected":null},O.fromObject=function(u){if(u instanceof $root.com.quick.voice.proto.ReportTrafficUsage)return u;let $=new $root.com.quick.voice.proto.ReportTrafficUsage;return u.p2pPush!=null&&($util.Long?($.p2pPush=$util.Long.fromValue(u.p2pPush)).unsigned=!1:typeof u.p2pPush=="string"?$.p2pPush=parseInt(u.p2pPush,10):typeof u.p2pPush=="number"?$.p2pPush=u.p2pPush:typeof u.p2pPush=="object"&&($.p2pPush=new $util.LongBits(u.p2pPush.low>>>0,u.p2pPush.high>>>0).toNumber())),u.p2pPull!=null&&($util.Long?($.p2pPull=$util.Long.fromValue(u.p2pPull)).unsigned=!1:typeof u.p2pPull=="string"?$.p2pPull=parseInt(u.p2pPull,10):typeof u.p2pPull=="number"?$.p2pPull=u.p2pPull:typeof u.p2pPull=="object"&&($.p2pPull=new $util.LongBits(u.p2pPull.low>>>0,u.p2pPull.high>>>0).toNumber())),u.sfuPush!=null&&($util.Long?($.sfuPush=$util.Long.fromValue(u.sfuPush)).unsigned=!1:typeof u.sfuPush=="string"?$.sfuPush=parseInt(u.sfuPush,10):typeof u.sfuPush=="number"?$.sfuPush=u.sfuPush:typeof u.sfuPush=="object"&&($.sfuPush=new $util.LongBits(u.sfuPush.low>>>0,u.sfuPush.high>>>0).toNumber())),u.sfuPull!=null&&($util.Long?($.sfuPull=$util.Long.fromValue(u.sfuPull)).unsigned=!1:typeof u.sfuPull=="string"?$.sfuPull=parseInt(u.sfuPull,10):typeof u.sfuPull=="number"?$.sfuPull=u.sfuPull:typeof u.sfuPull=="object"&&($.sfuPull=new $util.LongBits(u.sfuPull.low>>>0,u.sfuPull.high>>>0).toNumber())),$},O.toObject=function(u,$){$||($={});let N={};return u.p2pPush!=null&&u.hasOwnProperty("p2pPush")&&(typeof u.p2pPush=="number"?N.p2pPush=$.longs===String?String(u.p2pPush):u.p2pPush:N.p2pPush=$.longs===String?$util.Long.prototype.toString.call(u.p2pPush):$.longs===Number?new $util.LongBits(u.p2pPush.low>>>0,u.p2pPush.high>>>0).toNumber():u.p2pPush,$.oneofs&&(N._p2pPush="p2pPush")),u.p2pPull!=null&&u.hasOwnProperty("p2pPull")&&(typeof u.p2pPull=="number"?N.p2pPull=$.longs===String?String(u.p2pPull):u.p2pPull:N.p2pPull=$.longs===String?$util.Long.prototype.toString.call(u.p2pPull):$.longs===Number?new $util.LongBits(u.p2pPull.low>>>0,u.p2pPull.high>>>0).toNumber():u.p2pPull,$.oneofs&&(N._p2pPull="p2pPull")),u.sfuPush!=null&&u.hasOwnProperty("sfuPush")&&(typeof u.sfuPush=="number"?N.sfuPush=$.longs===String?String(u.sfuPush):u.sfuPush:N.sfuPush=$.longs===String?$util.Long.prototype.toString.call(u.sfuPush):$.longs===Number?new $util.LongBits(u.sfuPush.low>>>0,u.sfuPush.high>>>0).toNumber():u.sfuPush,$.oneofs&&(N._sfuPush="sfuPush")),u.sfuPull!=null&&u.hasOwnProperty("sfuPull")&&(typeof u.sfuPull=="number"?N.sfuPull=$.longs===String?String(u.sfuPull):u.sfuPull:N.sfuPull=$.longs===String?$util.Long.prototype.toString.call(u.sfuPull):$.longs===Number?new $util.LongBits(u.sfuPull.low>>>0,u.sfuPull.high>>>0).toNumber():u.sfuPull,$.oneofs&&(N._sfuPull="sfuPull")),N},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(u){return u===void 0&&(u="type.googleapis.com"),u+"/com.quick.voice.proto.ReportTrafficUsage"},O}(),M.P2PAttemptConnectReq=function(){function O(C){if(C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.userId="",O.prototype.roomId="",O.create=function(i){return new O(i)},O.encode=function(i,u){return u||(u=$Writer.create()),i.userId!=null&&Object.hasOwnProperty.call(i,"userId")&&u.uint32(10).string(i.userId),i.roomId!=null&&Object.hasOwnProperty.call(i,"roomId")&&u.uint32(18).string(i.roomId),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.P2PAttemptConnectReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.userId=i.string();break}case 2:{N.roomId=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.P2PAttemptConnectReq)return i;let u=new $root.com.quick.voice.proto.P2PAttemptConnectReq;return i.userId!=null&&(u.userId=String(i.userId)),i.roomId!=null&&(u.roomId=String(i.roomId)),u},O.toObject=function(i,u){u||(u={});let $={};return u.defaults&&($.userId="",$.roomId=""),i.userId!=null&&i.hasOwnProperty("userId")&&($.userId=i.userId),i.roomId!=null&&i.hasOwnProperty("roomId")&&($.roomId=i.roomId),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.P2PAttemptConnectReq"},O}(),M.CheckSessionReq=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.session="",O.prototype.tracks=$util.emptyArray,O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.session!=null&&Object.hasOwnProperty.call(i,"session")&&u.uint32(10).string(i.session),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.CheckSessionReq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.session=i.string();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionReq)return i;let u=new $root.com.quick.voice.proto.CheckSessionReq;if(i.session!=null&&(u.session=String(i.session)),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionReq.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.session=""),i.session!=null&&i.hasOwnProperty("session")&&($.session=i.session),i.tracks&&i.tracks.length){$.tracks=[];for(let N=0;N<i.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(i.tracks[N],u)}return $},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionReq"},O}(),M.CheckSessionRsq=function(){function O(C){if(this.tracks=[],C)for(let i=Object.keys(C),u=0;u<i.length;++u)C[i[u]]!=null&&(this[i[u]]=C[i[u]])}return O.prototype.sessionIsValid=!1,O.prototype.tracks=$util.emptyArray,O.prototype.session="",O.create=function(i){return new O(i)},O.encode=function(i,u){if(u||(u=$Writer.create()),i.sessionIsValid!=null&&Object.hasOwnProperty.call(i,"sessionIsValid")&&u.uint32(8).bool(i.sessionIsValid),i.tracks!=null&&i.tracks.length)for(let $=0;$<i.tracks.length;++$)$root.com.quick.voice.proto.Track.encode(i.tracks[$],u.uint32(18).fork()).ldelim();return i.session!=null&&Object.hasOwnProperty.call(i,"session")&&u.uint32(26).string(i.session),u},O.encodeDelimited=function(i,u){return this.encode(i,u).ldelim()},O.decode=function(i,u){i instanceof $Reader||(i=$Reader.create(i));let $=u===void 0?i.len:i.pos+u,N=new $root.com.quick.voice.proto.CheckSessionRsq;for(;i.pos<$;){let F=i.uint32();switch(F>>>3){case 1:{N.sessionIsValid=i.bool();break}case 2:{N.tracks&&N.tracks.length||(N.tracks=[]),N.tracks.push($root.com.quick.voice.proto.Track.decode(i,i.uint32()));break}case 3:{N.session=i.string();break}default:i.skipType(F&7);break}}return N},O.decodeDelimited=function(i){return i instanceof $Reader||(i=new $Reader(i)),this.decode(i,i.uint32())},O.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 u=0;u<i.tracks.length;++u){let $=$root.com.quick.voice.proto.Track.verify(i.tracks[u]);if($)return"tracks."+$}}return i.session!=null&&i.hasOwnProperty("session")&&!$util.isString(i.session)?"session: string expected":null},O.fromObject=function(i){if(i instanceof $root.com.quick.voice.proto.CheckSessionRsq)return i;let u=new $root.com.quick.voice.proto.CheckSessionRsq;if(i.sessionIsValid!=null&&(u.sessionIsValid=!!i.sessionIsValid),i.tracks){if(!Array.isArray(i.tracks))throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: array expected");u.tracks=[];for(let $=0;$<i.tracks.length;++$){if(typeof i.tracks[$]!="object")throw TypeError(".com.quick.voice.proto.CheckSessionRsq.tracks: object expected");u.tracks[$]=$root.com.quick.voice.proto.Track.fromObject(i.tracks[$])}}return i.session!=null&&(u.session=String(i.session)),u},O.toObject=function(i,u){u||(u={});let $={};if((u.arrays||u.defaults)&&($.tracks=[]),u.defaults&&($.sessionIsValid=!1,$.session=""),i.sessionIsValid!=null&&i.hasOwnProperty("sessionIsValid")&&($.sessionIsValid=i.sessionIsValid),i.tracks&&i.tracks.length){$.tracks=[];for(let N=0;N<i.tracks.length;++N)$.tracks[N]=$root.com.quick.voice.proto.Track.toObject(i.tracks[N],u)}return i.session!=null&&i.hasOwnProperty("session")&&($.session=i.session),$},O.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},O.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/com.quick.voice.proto.CheckSessionRsq"},O}(),M}(),D}(),B}(),A})(),enum_notifyName={onChangeNetwork:"网络情况变更",onRoomNetwork:"房间实时网络数据",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",onDisconnectP2P:"监听关闭P2P",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(A){let B=A.length;for(;--B>=0;)A[B]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(A,B,D,M,O){this.static_tree=A,this.extra_bits=B,this.extra_base=D,this.elems=M,this.max_length=O,this.has_stree=A&&A.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(A,B){this.dyn_tree=A,this.max_code=0,this.stat_desc=B}const d_code=A=>A<256?_dist_code[A]:_dist_code[256+(A>>>7)],put_short=(A,B)=>{A.pending_buf[A.pending++]=B&255,A.pending_buf[A.pending++]=B>>>8&255},send_bits=(A,B,D)=>{A.bi_valid>Buf_size-D?(A.bi_buf|=B<<A.bi_valid&65535,put_short(A,A.bi_buf),A.bi_buf=B>>Buf_size-A.bi_valid,A.bi_valid+=D-Buf_size):(A.bi_buf|=B<<A.bi_valid&65535,A.bi_valid+=D)},send_code=(A,B,D)=>{send_bits(A,D[B*2],D[B*2+1])},bi_reverse=(A,B)=>{let D=0;do D|=A&1,A>>>=1,D<<=1;while(--B>0);return D>>>1},bi_flush=A=>{A.bi_valid===16?(put_short(A,A.bi_buf),A.bi_buf=0,A.bi_valid=0):A.bi_valid>=8&&(A.pending_buf[A.pending++]=A.bi_buf&255,A.bi_buf>>=8,A.bi_valid-=8)},gen_bitlen=(A,B)=>{const D=B.dyn_tree,M=B.max_code,O=B.stat_desc.static_tree,C=B.stat_desc.has_stree,i=B.stat_desc.extra_bits,u=B.stat_desc.extra_base,$=B.stat_desc.max_length;let N,F,Z,K,J,Y,oe=0;for(K=0;K<=MAX_BITS$1;K++)A.bl_count[K]=0;for(D[A.heap[A.heap_max]*2+1]=0,N=A.heap_max+1;N<HEAP_SIZE$1;N++)F=A.heap[N],K=D[D[F*2+1]*2+1]+1,K>$&&(K=$,oe++),D[F*2+1]=K,!(F>M)&&(A.bl_count[K]++,J=0,F>=u&&(J=i[F-u]),Y=D[F*2],A.opt_len+=Y*(K+J),C&&(A.static_len+=Y*(O[F*2+1]+J)));if(oe!==0){do{for(K=$-1;A.bl_count[K]===0;)K--;A.bl_count[K]--,A.bl_count[K+1]+=2,A.bl_count[$]--,oe-=2}while(oe>0);for(K=$;K!==0;K--)for(F=A.bl_count[K];F!==0;)Z=A.heap[--N],!(Z>M)&&(D[Z*2+1]!==K&&(A.opt_len+=(K-D[Z*2+1])*D[Z*2],D[Z*2+1]=K),F--)}},gen_codes=(A,B,D)=>{const M=new Array(MAX_BITS$1+1);let O=0,C,i;for(C=1;C<=MAX_BITS$1;C++)O=O+D[C-1]<<1,M[C]=O;for(i=0;i<=B;i++){let u=A[i*2+1];u!==0&&(A[i*2]=bi_reverse(M[u]++,u))}},tr_static_init=()=>{let A,B,D,M,O;const C=new Array(MAX_BITS$1+1);for(D=0,M=0;M<LENGTH_CODES$1-1;M++)for(base_length[M]=D,A=0;A<1<<extra_lbits[M];A++)_length_code[D++]=M;for(_length_code[D-1]=M,O=0,M=0;M<16;M++)for(base_dist[M]=O,A=0;A<1<<extra_dbits[M];A++)_dist_code[O++]=M;for(O>>=7;M<D_CODES$1;M++)for(base_dist[M]=O<<7,A=0;A<1<<extra_dbits[M]-7;A++)_dist_code[256+O++]=M;for(B=0;B<=MAX_BITS$1;B++)C[B]=0;for(A=0;A<=143;)static_ltree[A*2+1]=8,A++,C[8]++;for(;A<=255;)static_ltree[A*2+1]=9,A++,C[9]++;for(;A<=279;)static_ltree[A*2+1]=7,A++,C[7]++;for(;A<=287;)static_ltree[A*2+1]=8,A++,C[8]++;for(gen_codes(static_ltree,L_CODES$1+1,C),A=0;A<D_CODES$1;A++)static_dtree[A*2+1]=5,static_dtree[A*2]=bi_reverse(A,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=A=>{let B;for(B=0;B<L_CODES$1;B++)A.dyn_ltree[B*2]=0;for(B=0;B<D_CODES$1;B++)A.dyn_dtree[B*2]=0;for(B=0;B<BL_CODES$1;B++)A.bl_tree[B*2]=0;A.dyn_ltree[END_BLOCK*2]=1,A.opt_len=A.static_len=0,A.sym_next=A.matches=0},bi_windup=A=>{A.bi_valid>8?put_short(A,A.bi_buf):A.bi_valid>0&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0},smaller=(A,B,D,M)=>{const O=B*2,C=D*2;return A[O]<A[C]||A[O]===A[C]&&M[B]<=M[D]},pqdownheap=(A,B,D)=>{const M=A.heap[D];let O=D<<1;for(;O<=A.heap_len&&(O<A.heap_len&&smaller(B,A.heap[O+1],A.heap[O],A.depth)&&O++,!smaller(B,M,A.heap[O],A.depth));)A.heap[D]=A.heap[O],D=O,O<<=1;A.heap[D]=M},compress_block=(A,B,D)=>{let M,O,C=0,i,u;if(A.sym_next!==0)do M=A.pending_buf[A.sym_buf+C++]&255,M+=(A.pending_buf[A.sym_buf+C++]&255)<<8,O=A.pending_buf[A.sym_buf+C++],M===0?send_code(A,O,B):(i=_length_code[O],send_code(A,i+LITERALS$1+1,B),u=extra_lbits[i],u!==0&&(O-=base_length[i],send_bits(A,O,u)),M--,i=d_code(M),send_code(A,i,D),u=extra_dbits[i],u!==0&&(M-=base_dist[i],send_bits(A,M,u)));while(C<A.sym_next);send_code(A,END_BLOCK,B)},build_tree=(A,B)=>{const D=B.dyn_tree,M=B.stat_desc.static_tree,O=B.stat_desc.has_stree,C=B.stat_desc.elems;let i,u,$=-1,N;for(A.heap_len=0,A.heap_max=HEAP_SIZE$1,i=0;i<C;i++)D[i*2]!==0?(A.heap[++A.heap_len]=$=i,A.depth[i]=0):D[i*2+1]=0;for(;A.heap_len<2;)N=A.heap[++A.heap_len]=$<2?++$:0,D[N*2]=1,A.depth[N]=0,A.opt_len--,O&&(A.static_len-=M[N*2+1]);for(B.max_code=$,i=A.heap_len>>1;i>=1;i--)pqdownheap(A,D,i);N=C;do i=A.heap[1],A.heap[1]=A.heap[A.heap_len--],pqdownheap(A,D,1),u=A.heap[1],A.heap[--A.heap_max]=i,A.heap[--A.heap_max]=u,D[N*2]=D[i*2]+D[u*2],A.depth[N]=(A.depth[i]>=A.depth[u]?A.depth[i]:A.depth[u])+1,D[i*2+1]=D[u*2+1]=N,A.heap[1]=N++,pqdownheap(A,D,1);while(A.heap_len>=2);A.heap[--A.heap_max]=A.heap[1],gen_bitlen(A,B),gen_codes(D,$,A.bl_count)},scan_tree=(A,B,D)=>{let M,O=-1,C,i=B[1],u=0,$=7,N=4;for(i===0&&($=138,N=3),B[(D+1)*2+1]=65535,M=0;M<=D;M++)C=i,i=B[(M+1)*2+1],!(++u<$&&C===i)&&(u<N?A.bl_tree[C*2]+=u:C!==0?(C!==O&&A.bl_tree[C*2]++,A.bl_tree[REP_3_6*2]++):u<=10?A.bl_tree[REPZ_3_10*2]++:A.bl_tree[REPZ_11_138*2]++,u=0,O=C,i===0?($=138,N=3):C===i?($=6,N=3):($=7,N=4))},send_tree=(A,B,D)=>{let M,O=-1,C,i=B[1],u=0,$=7,N=4;for(i===0&&($=138,N=3),M=0;M<=D;M++)if(C=i,i=B[(M+1)*2+1],!(++u<$&&C===i)){if(u<N)do send_code(A,C,A.bl_tree);while(--u!==0);else C!==0?(C!==O&&(send_code(A,C,A.bl_tree),u--),send_code(A,REP_3_6,A.bl_tree),send_bits(A,u-3,2)):u<=10?(send_code(A,REPZ_3_10,A.bl_tree),send_bits(A,u-3,3)):(send_code(A,REPZ_11_138,A.bl_tree),send_bits(A,u-11,7));u=0,O=C,i===0?($=138,N=3):C===i?($=6,N=3):($=7,N=4)}},build_bl_tree=A=>{let B;for(scan_tree(A,A.dyn_ltree,A.l_desc.max_code),scan_tree(A,A.dyn_dtree,A.d_desc.max_code),build_tree(A,A.bl_desc),B=BL_CODES$1-1;B>=3&&A.bl_tree[bl_order[B]*2+1]===0;B--);return A.opt_len+=3*(B+1)+5+5+4,B},send_all_trees=(A,B,D,M)=>{let O;for(send_bits(A,B-257,5),send_bits(A,D-1,5),send_bits(A,M-4,4),O=0;O<M;O++)send_bits(A,A.bl_tree[bl_order[O]*2+1],3);send_tree(A,A.dyn_ltree,B-1),send_tree(A,A.dyn_dtree,D-1)},detect_data_type=A=>{let B=4093624447,D;for(D=0;D<=31;D++,B>>>=1)if(B&1&&A.dyn_ltree[D*2]!==0)return Z_BINARY;if(A.dyn_ltree[18]!==0||A.dyn_ltree[20]!==0||A.dyn_ltree[26]!==0)return Z_TEXT;for(D=32;D<LITERALS$1;D++)if(A.dyn_ltree[D*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=A=>{static_init_done||(tr_static_init(),static_init_done=!0),A.l_desc=new TreeDesc(A.dyn_ltree,static_l_desc),A.d_desc=new TreeDesc(A.dyn_dtree,static_d_desc),A.bl_desc=new TreeDesc(A.bl_tree,static_bl_desc),A.bi_buf=0,A.bi_valid=0,init_block(A)},_tr_stored_block$1=(A,B,D,M)=>{send_bits(A,(STORED_BLOCK<<1)+(M?1:0),3),bi_windup(A),put_short(A,D),put_short(A,~D),D&&A.pending_buf.set(A.window.subarray(B,B+D),A.pending),A.pending+=D},_tr_align$1=A=>{send_bits(A,STATIC_TREES<<1,3),send_code(A,END_BLOCK,static_ltree),bi_flush(A)},_tr_flush_block$1=(A,B,D,M)=>{let O,C,i=0;A.level>0?(A.strm.data_type===Z_UNKNOWN$1&&(A.strm.data_type=detect_data_type(A)),build_tree(A,A.l_desc),build_tree(A,A.d_desc),i=build_bl_tree(A),O=A.opt_len+3+7>>>3,C=A.static_len+3+7>>>3,C<=O&&(O=C)):O=C=D+5,D+4<=O&&B!==-1?_tr_stored_block$1(A,B,D,M):A.strategy===Z_FIXED$1||C===O?(send_bits(A,(STATIC_TREES<<1)+(M?1:0),3),compress_block(A,static_ltree,static_dtree)):(send_bits(A,(DYN_TREES<<1)+(M?1:0),3),send_all_trees(A,A.l_desc.max_code+1,A.d_desc.max_code+1,i+1),compress_block(A,A.dyn_ltree,A.dyn_dtree)),init_block(A),M&&bi_windup(A)},_tr_tally$1=(A,B,D)=>(A.pending_buf[A.sym_buf+A.sym_next++]=B,A.pending_buf[A.sym_buf+A.sym_next++]=B>>8,A.pending_buf[A.sym_buf+A.sym_next++]=D,B===0?A.dyn_ltree[D*2]++:(A.matches++,B--,A.dyn_ltree[(_length_code[D]+LITERALS$1+1)*2]++,A.dyn_dtree[d_code(B)*2]++),A.sym_next===A.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=(A,B,D,M)=>{let O=A&65535|0,C=A>>>16&65535|0,i=0;for(;D!==0;){i=D>2e3?2e3:D,D-=i;do O=O+B[M++]|0,C=C+O|0;while(--i);O%=65521,C%=65521}return O|C<<16|0};var adler32_1=adler32;const makeTable=()=>{let A,B=[];for(var D=0;D<256;D++){A=D;for(var M=0;M<8;M++)A=A&1?3988292384^A>>>1:A>>>1;B[D]=A}return B},crcTable=new Uint32Array(makeTable()),crc32=(A,B,D,M)=>{const O=crcTable,C=M+D;A^=-1;for(let i=M;i<C;i++)A=A>>>8^O[(A^B[i])&255];return A^-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=(A,B)=>(A.msg=messages[B],B),rank=A=>A*2-(A>4?9:0),zero=A=>{let B=A.length;for(;--B>=0;)A[B]=0},slide_hash=A=>{let B,D,M,O=A.w_size;B=A.hash_size,M=B;do D=A.head[--M],A.head[M]=D>=O?D-O:0;while(--B);B=O,M=B;do D=A.prev[--M],A.prev[M]=D>=O?D-O:0;while(--B)};let HASH_ZLIB=(A,B,D)=>(B<<A.hash_shift^D)&A.hash_mask,HASH=HASH_ZLIB;const flush_pending=A=>{const B=A.state;let D=B.pending;D>A.avail_out&&(D=A.avail_out),D!==0&&(A.output.set(B.pending_buf.subarray(B.pending_out,B.pending_out+D),A.next_out),A.next_out+=D,B.pending_out+=D,A.total_out+=D,A.avail_out-=D,B.pending-=D,B.pending===0&&(B.pending_out=0))},flush_block_only=(A,B)=>{_tr_flush_block(A,A.block_start>=0?A.block_start:-1,A.strstart-A.block_start,B),A.block_start=A.strstart,flush_pending(A.strm)},put_byte=(A,B)=>{A.pending_buf[A.pending++]=B},putShortMSB=(A,B)=>{A.pending_buf[A.pending++]=B>>>8&255,A.pending_buf[A.pending++]=B&255},read_buf=(A,B,D,M)=>{let O=A.avail_in;return O>M&&(O=M),O===0?0:(A.avail_in-=O,B.set(A.input.subarray(A.next_in,A.next_in+O),D),A.state.wrap===1?A.adler=adler32_1(A.adler,B,O,D):A.state.wrap===2&&(A.adler=crc32_1(A.adler,B,O,D)),A.next_in+=O,A.total_in+=O,O)},longest_match=(A,B)=>{let D=A.max_chain_length,M=A.strstart,O,C,i=A.prev_length,u=A.nice_match;const $=A.strstart>A.w_size-MIN_LOOKAHEAD?A.strstart-(A.w_size-MIN_LOOKAHEAD):0,N=A.window,F=A.w_mask,Z=A.prev,K=A.strstart+MAX_MATCH;let J=N[M+i-1],Y=N[M+i];A.prev_length>=A.good_match&&(D>>=2),u>A.lookahead&&(u=A.lookahead);do if(O=B,!(N[O+i]!==Y||N[O+i-1]!==J||N[O]!==N[M]||N[++O]!==N[M+1])){M+=2,O++;do;while(N[++M]===N[++O]&&N[++M]===N[++O]&&N[++M]===N[++O]&&N[++M]===N[++O]&&N[++M]===N[++O]&&N[++M]===N[++O]&&N[++M]===N[++O]&&N[++M]===N[++O]&&M<K);if(C=MAX_MATCH-(K-M),M=K-MAX_MATCH,C>i){if(A.match_start=B,i=C,C>=u)break;J=N[M+i-1],Y=N[M+i]}}while((B=Z[B&F])>$&&--D!==0);return i<=A.lookahead?i:A.lookahead},fill_window=A=>{const B=A.w_size;let D,M,O;do{if(M=A.window_size-A.lookahead-A.strstart,A.strstart>=B+(B-MIN_LOOKAHEAD)&&(A.window.set(A.window.subarray(B,B+B-M),0),A.match_start-=B,A.strstart-=B,A.block_start-=B,A.insert>A.strstart&&(A.insert=A.strstart),slide_hash(A),M+=B),A.strm.avail_in===0)break;if(D=read_buf(A.strm,A.window,A.strstart+A.lookahead,M),A.lookahead+=D,A.lookahead+A.insert>=MIN_MATCH)for(O=A.strstart-A.insert,A.ins_h=A.window[O],A.ins_h=HASH(A,A.ins_h,A.window[O+1]);A.insert&&(A.ins_h=HASH(A,A.ins_h,A.window[O+MIN_MATCH-1]),A.prev[O&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=O,O++,A.insert--,!(A.lookahead+A.insert<MIN_MATCH)););}while(A.lookahead<MIN_LOOKAHEAD&&A.strm.avail_in!==0)},deflate_stored=(A,B)=>{let D=A.pending_buf_size-5>A.w_size?A.w_size:A.pending_buf_size-5,M,O,C,i=0,u=A.strm.avail_in;do{if(M=65535,C=A.bi_valid+42>>3,A.strm.avail_out<C||(C=A.strm.avail_out-C,O=A.strstart-A.block_start,M>O+A.strm.avail_in&&(M=O+A.strm.avail_in),M>C&&(M=C),M<D&&(M===0&&B!==Z_FINISH$3||B===Z_NO_FLUSH$2||M!==O+A.strm.avail_in)))break;i=B===Z_FINISH$3&&M===O+A.strm.avail_in?1:0,_tr_stored_block(A,0,0,i),A.pending_buf[A.pending-4]=M,A.pending_buf[A.pending-3]=M>>8,A.pending_buf[A.pending-2]=~M,A.pending_buf[A.pending-1]=~M>>8,flush_pending(A.strm),O&&(O>M&&(O=M),A.strm.output.set(A.window.subarray(A.block_start,A.block_start+O),A.strm.next_out),A.strm.next_out+=O,A.strm.avail_out-=O,A.strm.total_out+=O,A.block_start+=O,M-=O),M&&(read_buf(A.strm,A.strm.output,A.strm.next_out,M),A.strm.next_out+=M,A.strm.avail_out-=M,A.strm.total_out+=M)}while(i===0);return u-=A.strm.avail_in,u&&(u>=A.w_size?(A.matches=2,A.window.set(A.strm.input.subarray(A.strm.next_in-A.w_size,A.strm.next_in),0),A.strstart=A.w_size,A.insert=A.strstart):(A.window_size-A.strstart<=u&&(A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,A.insert>A.strstart&&(A.insert=A.strstart)),A.window.set(A.strm.input.subarray(A.strm.next_in-u,A.strm.next_in),A.strstart),A.strstart+=u,A.insert+=u>A.w_size-A.insert?A.w_size-A.insert:u),A.block_start=A.strstart),A.high_water<A.strstart&&(A.high_water=A.strstart),i?BS_FINISH_DONE:B!==Z_NO_FLUSH$2&&B!==Z_FINISH$3&&A.strm.avail_in===0&&A.strstart===A.block_start?BS_BLOCK_DONE:(C=A.window_size-A.strstart,A.strm.avail_in>C&&A.block_start>=A.w_size&&(A.block_start-=A.w_size,A.strstart-=A.w_size,A.window.set(A.window.subarray(A.w_size,A.w_size+A.strstart),0),A.matches<2&&A.matches++,C+=A.w_size,A.insert>A.strstart&&(A.insert=A.strstart)),C>A.strm.avail_in&&(C=A.strm.avail_in),C&&(read_buf(A.strm,A.window,A.strstart,C),A.strstart+=C,A.insert+=C>A.w_size-A.insert?A.w_size-A.insert:C),A.high_water<A.strstart&&(A.high_water=A.strstart),C=A.bi_valid+42>>3,C=A.pending_buf_size-C>65535?65535:A.pending_buf_size-C,D=C>A.w_size?A.w_size:C,O=A.strstart-A.block_start,(O>=D||(O||B===Z_FINISH$3)&&B!==Z_NO_FLUSH$2&&A.strm.avail_in===0&&O<=C)&&(M=O>C?C:O,i=B===Z_FINISH$3&&A.strm.avail_in===0&&M===O?1:0,_tr_stored_block(A,A.block_start,M,i),A.block_start+=M,flush_pending(A.strm)),i?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(A,B)=>{let D,M;for(;;){if(A.lookahead<MIN_LOOKAHEAD){if(fill_window(A),A.lookahead<MIN_LOOKAHEAD&&B===Z_NO_FLUSH$2)return BS_NEED_MORE;if(A.lookahead===0)break}if(D=0,A.lookahead>=MIN_MATCH&&(A.ins_h=HASH(A,A.ins_h,A.window[A.strstart+MIN_MATCH-1]),D=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),D!==0&&A.strstart-D<=A.w_size-MIN_LOOKAHEAD&&(A.match_length=longest_match(A,D)),A.match_length>=MIN_MATCH)if(M=_tr_tally(A,A.strstart-A.match_start,A.match_length-MIN_MATCH),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=MIN_MATCH){A.match_length--;do A.strstart++,A.ins_h=HASH(A,A.ins_h,A.window[A.strstart+MIN_MATCH-1]),D=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart;while(--A.match_length!==0);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=HASH(A,A.ins_h,A.window[A.strstart+1]);else M=_tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(M&&(flush_block_only(A,!1),A.strm.avail_out===0))return BS_NEED_MORE}return A.insert=A.strstart<MIN_MATCH-1?A.strstart:MIN_MATCH-1,B===Z_FINISH$3?(flush_block_only(A,!0),A.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):A.sym_next&&(flush_block_only(A,!1),A.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(A,B)=>{let D,M,O;for(;;){if(A.lookahead<MIN_LOOKAHEAD){if(fill_window(A),A.lookahead<MIN_LOOKAHEAD&&B===Z_NO_FLUSH$2)return BS_NEED_MORE;if(A.lookahead===0)break}if(D=0,A.lookahead>=MIN_MATCH&&(A.ins_h=HASH(A,A.ins_h,A.window[A.strstart+MIN_MATCH-1]),D=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=MIN_MATCH-1,D!==0&&A.prev_length<A.max_lazy_match&&A.strstart-D<=A.w_size-MIN_LOOKAHEAD&&(A.match_length=longest_match(A,D),A.match_length<=5&&(A.strategy===Z_FILTERED||A.match_length===MIN_MATCH&&A.strstart-A.match_start>4096)&&(A.match_length=MIN_MATCH-1)),A.prev_length>=MIN_MATCH&&A.match_length<=A.prev_length){O=A.strstart+A.lookahead-MIN_MATCH,M=_tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-MIN_MATCH),A.lookahead-=A.prev_length-1,A.prev_length-=2;do++A.strstart<=O&&(A.ins_h=HASH(A,A.ins_h,A.window[A.strstart+MIN_MATCH-1]),D=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart);while(--A.prev_length!==0);if(A.match_available=0,A.match_length=MIN_MATCH-1,A.strstart++,M&&(flush_block_only(A,!1),A.strm.avail_out===0))return BS_NEED_MORE}else if(A.match_available){if(M=_tr_tally(A,0,A.window[A.strstart-1]),M&&flush_block_only(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return BS_NEED_MORE}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(M=_tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<MIN_MATCH-1?A.strstart:MIN_MATCH-1,B===Z_FINISH$3?(flush_block_only(A,!0),A.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):A.sym_next&&(flush_block_only(A,!1),A.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(A,B)=>{let D,M,O,C;const i=A.window;for(;;){if(A.lookahead<=MAX_MATCH){if(fill_window(A),A.lookahead<=MAX_MATCH&&B===Z_NO_FLUSH$2)return BS_NEED_MORE;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=MIN_MATCH&&A.strstart>0&&(O=A.strstart-1,M=i[O],M===i[++O]&&M===i[++O]&&M===i[++O])){C=A.strstart+MAX_MATCH;do;while(M===i[++O]&&M===i[++O]&&M===i[++O]&&M===i[++O]&&M===i[++O]&&M===i[++O]&&M===i[++O]&&M===i[++O]&&O<C);A.match_length=MAX_MATCH-(C-O),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=MIN_MATCH?(D=_tr_tally(A,1,A.match_length-MIN_MATCH),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(D=_tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),D&&(flush_block_only(A,!1),A.strm.avail_out===0))return BS_NEED_MORE}return A.insert=0,B===Z_FINISH$3?(flush_block_only(A,!0),A.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):A.sym_next&&(flush_block_only(A,!1),A.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(A,B)=>{let D;for(;;){if(A.lookahead===0&&(fill_window(A),A.lookahead===0)){if(B===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(A.match_length=0,D=_tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,D&&(flush_block_only(A,!1),A.strm.avail_out===0))return BS_NEED_MORE}return A.insert=0,B===Z_FINISH$3?(flush_block_only(A,!0),A.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):A.sym_next&&(flush_block_only(A,!1),A.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(A,B,D,M,O){this.good_length=A,this.max_lazy=B,this.nice_length=D,this.max_chain=M,this.func=O}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=A=>{A.window_size=2*A.w_size,zero(A.head),A.max_lazy_match=configuration_table[A.level].max_lazy,A.good_match=configuration_table[A.level].good_length,A.nice_match=configuration_table[A.level].nice_length,A.max_chain_length=configuration_table[A.level].max_chain,A.strstart=0,A.block_start=0,A.lookahead=0,A.insert=0,A.match_length=A.prev_length=MIN_MATCH-1,A.match_available=0,A.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=A=>{if(!A)return 1;const B=A.state;return!B||B.strm!==A||B.status!==INIT_STATE&&B.status!==GZIP_STATE&&B.status!==EXTRA_STATE&&B.status!==NAME_STATE&&B.status!==COMMENT_STATE&&B.status!==HCRC_STATE&&B.status!==BUSY_STATE&&B.status!==FINISH_STATE?1:0},deflateResetKeep=A=>{if(deflateStateCheck(A))return err(A,Z_STREAM_ERROR$2);A.total_in=A.total_out=0,A.data_type=Z_UNKNOWN;const B=A.state;return B.pending=0,B.pending_out=0,B.wrap<0&&(B.wrap=-B.wrap),B.status=B.wrap===2?GZIP_STATE:B.wrap?INIT_STATE:BUSY_STATE,A.adler=B.wrap===2?0:1,B.last_flush=-2,_tr_init(B),Z_OK$3},deflateReset=A=>{const B=deflateResetKeep(A);return B===Z_OK$3&&lm_init(A.state),B},deflateSetHeader=(A,B)=>deflateStateCheck(A)||A.state.wrap!==2?Z_STREAM_ERROR$2:(A.state.gzhead=B,Z_OK$3),deflateInit2=(A,B,D,M,O,C)=>{if(!A)return Z_STREAM_ERROR$2;let i=1;if(B===Z_DEFAULT_COMPRESSION$1&&(B=6),M<0?(i=0,M=-M):M>15&&(i=2,M-=16),O<1||O>MAX_MEM_LEVEL||D!==Z_DEFLATED$2||M<8||M>15||B<0||B>9||C<0||C>Z_FIXED||M===8&&i!==1)return err(A,Z_STREAM_ERROR$2);M===8&&(M=9);const u=new DeflateState;return A.state=u,u.strm=A,u.status=INIT_STATE,u.wrap=i,u.gzhead=null,u.w_bits=M,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=O+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+MIN_MATCH-1)/MIN_MATCH),u.window=new Uint8Array(u.w_size*2),u.head=new Uint16Array(u.hash_size),u.prev=new Uint16Array(u.w_size),u.lit_bufsize=1<<O+6,u.pending_buf_size=u.lit_bufsize*4,u.pending_buf=new Uint8Array(u.pending_buf_size),u.sym_buf=u.lit_bufsize,u.sym_end=(u.lit_bufsize-1)*3,u.level=B,u.strategy=C,u.method=D,deflateReset(A)},deflateInit=(A,B)=>deflateInit2(A,B,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(A,B)=>{if(deflateStateCheck(A)||B>Z_BLOCK$1||B<0)return A?err(A,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const D=A.state;if(!A.output||A.avail_in!==0&&!A.input||D.status===FINISH_STATE&&B!==Z_FINISH$3)return err(A,A.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const M=D.last_flush;if(D.last_flush=B,D.pending!==0){if(flush_pending(A),A.avail_out===0)return D.last_flush=-1,Z_OK$3}else if(A.avail_in===0&&rank(B)<=rank(M)&&B!==Z_FINISH$3)return err(A,Z_BUF_ERROR$1);if(D.status===FINISH_STATE&&A.avail_in!==0)return err(A,Z_BUF_ERROR$1);if(D.status===INIT_STATE&&D.wrap===0&&(D.status=BUSY_STATE),D.status===INIT_STATE){let O=Z_DEFLATED$2+(D.w_bits-8<<4)<<8,C=-1;if(D.strategy>=Z_HUFFMAN_ONLY||D.level<2?C=0:D.level<6?C=1:D.level===6?C=2:C=3,O|=C<<6,D.strstart!==0&&(O|=PRESET_DICT),O+=31-O%31,putShortMSB(D,O),D.strstart!==0&&(putShortMSB(D,A.adler>>>16),putShortMSB(D,A.adler&65535)),A.adler=1,D.status=BUSY_STATE,flush_pending(A),D.pending!==0)return D.last_flush=-1,Z_OK$3}if(D.status===GZIP_STATE){if(A.adler=0,put_byte(D,31),put_byte(D,139),put_byte(D,8),D.gzhead)put_byte(D,(D.gzhead.text?1:0)+(D.gzhead.hcrc?2:0)+(D.gzhead.extra?4:0)+(D.gzhead.name?8:0)+(D.gzhead.comment?16:0)),put_byte(D,D.gzhead.time&255),put_byte(D,D.gzhead.time>>8&255),put_byte(D,D.gzhead.time>>16&255),put_byte(D,D.gzhead.time>>24&255),put_byte(D,D.level===9?2:D.strategy>=Z_HUFFMAN_ONLY||D.level<2?4:0),put_byte(D,D.gzhead.os&255),D.gzhead.extra&&D.gzhead.extra.length&&(put_byte(D,D.gzhead.extra.length&255),put_byte(D,D.gzhead.extra.length>>8&255)),D.gzhead.hcrc&&(A.adler=crc32_1(A.adler,D.pending_buf,D.pending,0)),D.gzindex=0,D.status=EXTRA_STATE;else if(put_byte(D,0),put_byte(D,0),put_byte(D,0),put_byte(D,0),put_byte(D,0),put_byte(D,D.level===9?2:D.strategy>=Z_HUFFMAN_ONLY||D.level<2?4:0),put_byte(D,OS_CODE),D.status=BUSY_STATE,flush_pending(A),D.pending!==0)return D.last_flush=-1,Z_OK$3}if(D.status===EXTRA_STATE){if(D.gzhead.extra){let O=D.pending,C=(D.gzhead.extra.length&65535)-D.gzindex;for(;D.pending+C>D.pending_buf_size;){let u=D.pending_buf_size-D.pending;if(D.pending_buf.set(D.gzhead.extra.subarray(D.gzindex,D.gzindex+u),D.pending),D.pending=D.pending_buf_size,D.gzhead.hcrc&&D.pending>O&&(A.adler=crc32_1(A.adler,D.pending_buf,D.pending-O,O)),D.gzindex+=u,flush_pending(A),D.pending!==0)return D.last_flush=-1,Z_OK$3;O=0,C-=u}let i=new Uint8Array(D.gzhead.extra);D.pending_buf.set(i.subarray(D.gzindex,D.gzindex+C),D.pending),D.pending+=C,D.gzhead.hcrc&&D.pending>O&&(A.adler=crc32_1(A.adler,D.pending_buf,D.pending-O,O)),D.gzindex=0}D.status=NAME_STATE}if(D.status===NAME_STATE){if(D.gzhead.name){let O=D.pending,C;do{if(D.pending===D.pending_buf_size){if(D.gzhead.hcrc&&D.pending>O&&(A.adler=crc32_1(A.adler,D.pending_buf,D.pending-O,O)),flush_pending(A),D.pending!==0)return D.last_flush=-1,Z_OK$3;O=0}D.gzindex<D.gzhead.name.length?C=D.gzhead.name.charCodeAt(D.gzindex++)&255:C=0,put_byte(D,C)}while(C!==0);D.gzhead.hcrc&&D.pending>O&&(A.adler=crc32_1(A.adler,D.pending_buf,D.pending-O,O)),D.gzindex=0}D.status=COMMENT_STATE}if(D.status===COMMENT_STATE){if(D.gzhead.comment){let O=D.pending,C;do{if(D.pending===D.pending_buf_size){if(D.gzhead.hcrc&&D.pending>O&&(A.adler=crc32_1(A.adler,D.pending_buf,D.pending-O,O)),flush_pending(A),D.pending!==0)return D.last_flush=-1,Z_OK$3;O=0}D.gzindex<D.gzhead.comment.length?C=D.gzhead.comment.charCodeAt(D.gzindex++)&255:C=0,put_byte(D,C)}while(C!==0);D.gzhead.hcrc&&D.pending>O&&(A.adler=crc32_1(A.adler,D.pending_buf,D.pending-O,O))}D.status=HCRC_STATE}if(D.status===HCRC_STATE){if(D.gzhead.hcrc){if(D.pending+2>D.pending_buf_size&&(flush_pending(A),D.pending!==0))return D.last_flush=-1,Z_OK$3;put_byte(D,A.adler&255),put_byte(D,A.adler>>8&255),A.adler=0}if(D.status=BUSY_STATE,flush_pending(A),D.pending!==0)return D.last_flush=-1,Z_OK$3}if(A.avail_in!==0||D.lookahead!==0||B!==Z_NO_FLUSH$2&&D.status!==FINISH_STATE){let O=D.level===0?deflate_stored(D,B):D.strategy===Z_HUFFMAN_ONLY?deflate_huff(D,B):D.strategy===Z_RLE?deflate_rle(D,B):configuration_table[D.level].func(D,B);if((O===BS_FINISH_STARTED||O===BS_FINISH_DONE)&&(D.status=FINISH_STATE),O===BS_NEED_MORE||O===BS_FINISH_STARTED)return A.avail_out===0&&(D.last_flush=-1),Z_OK$3;if(O===BS_BLOCK_DONE&&(B===Z_PARTIAL_FLUSH?_tr_align(D):B!==Z_BLOCK$1&&(_tr_stored_block(D,0,0,!1),B===Z_FULL_FLUSH$1&&(zero(D.head),D.lookahead===0&&(D.strstart=0,D.block_start=0,D.insert=0))),flush_pending(A),A.avail_out===0))return D.last_flush=-1,Z_OK$3}return B!==Z_FINISH$3?Z_OK$3:D.wrap<=0?Z_STREAM_END$3:(D.wrap===2?(put_byte(D,A.adler&255),put_byte(D,A.adler>>8&255),put_byte(D,A.adler>>16&255),put_byte(D,A.adler>>24&255),put_byte(D,A.total_in&255),put_byte(D,A.total_in>>8&255),put_byte(D,A.total_in>>16&255),put_byte(D,A.total_in>>24&255)):(putShortMSB(D,A.adler>>>16),putShortMSB(D,A.adler&65535)),flush_pending(A),D.wrap>0&&(D.wrap=-D.wrap),D.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=A=>{if(deflateStateCheck(A))return Z_STREAM_ERROR$2;const B=A.state.status;return A.state=null,B===BUSY_STATE?err(A,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(A,B)=>{let D=B.length;if(deflateStateCheck(A))return Z_STREAM_ERROR$2;const M=A.state,O=M.wrap;if(O===2||O===1&&M.status!==INIT_STATE||M.lookahead)return Z_STREAM_ERROR$2;if(O===1&&(A.adler=adler32_1(A.adler,B,D,0)),M.wrap=0,D>=M.w_size){O===0&&(zero(M.head),M.strstart=0,M.block_start=0,M.insert=0);let $=new Uint8Array(M.w_size);$.set(B.subarray(D-M.w_size,D),0),B=$,D=M.w_size}const C=A.avail_in,i=A.next_in,u=A.input;for(A.avail_in=D,A.next_in=0,A.input=B,fill_window(M);M.lookahead>=MIN_MATCH;){let $=M.strstart,N=M.lookahead-(MIN_MATCH-1);do M.ins_h=HASH(M,M.ins_h,M.window[$+MIN_MATCH-1]),M.prev[$&M.w_mask]=M.head[M.ins_h],M.head[M.ins_h]=$,$++;while(--N);M.strstart=$,M.lookahead=MIN_MATCH-1,fill_window(M)}return M.strstart+=M.lookahead,M.block_start=M.strstart,M.insert=M.lookahead,M.lookahead=0,M.match_length=M.prev_length=MIN_MATCH-1,M.match_available=0,A.next_in=i,A.input=u,A.avail_in=C,M.wrap=O,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=(A,B)=>Object.prototype.hasOwnProperty.call(A,B);var assign=function(A){const B=Array.prototype.slice.call(arguments,1);for(;B.length;){const D=B.shift();if(D){if(typeof D!="object")throw new TypeError(D+"must be non-object");for(const M in D)_has(D,M)&&(A[M]=D[M])}}return A},flattenChunks=A=>{let B=0;for(let M=0,O=A.length;M<O;M++)B+=A[M].length;const D=new Uint8Array(B);for(let M=0,O=0,C=A.length;M<C;M++){let i=A[M];D.set(i,O),O+=i.length}return D},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(A){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let A=0;A<256;A++)_utf8len[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=A=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(A);let B,D,M,O,C,i=A.length,u=0;for(O=0;O<i;O++)D=A.charCodeAt(O),(D&64512)===55296&&O+1<i&&(M=A.charCodeAt(O+1),(M&64512)===56320&&(D=65536+(D-55296<<10)+(M-56320),O++)),u+=D<128?1:D<2048?2:D<65536?3:4;for(B=new Uint8Array(u),C=0,O=0;C<u;O++)D=A.charCodeAt(O),(D&64512)===55296&&O+1<i&&(M=A.charCodeAt(O+1),(M&64512)===56320&&(D=65536+(D-55296<<10)+(M-56320),O++)),D<128?B[C++]=D:D<2048?(B[C++]=192|D>>>6,B[C++]=128|D&63):D<65536?(B[C++]=224|D>>>12,B[C++]=128|D>>>6&63,B[C++]=128|D&63):(B[C++]=240|D>>>18,B[C++]=128|D>>>12&63,B[C++]=128|D>>>6&63,B[C++]=128|D&63);return B};const buf2binstring=(A,B)=>{if(B<65534&&A.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,A.length===B?A:A.subarray(0,B));let D="";for(let M=0;M<B;M++)D+=String.fromCharCode(A[M]);return D};var buf2string=(A,B)=>{const D=B||A.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(A.subarray(0,B));let M,O;const C=new Array(D*2);for(O=0,M=0;M<D;){let i=A[M++];if(i<128){C[O++]=i;continue}let u=_utf8len[i];if(u>4){C[O++]=65533,M+=u-1;continue}for(i&=u===2?31:u===3?15:7;u>1&&M<D;)i=i<<6|A[M++]&63,u--;if(u>1){C[O++]=65533;continue}i<65536?C[O++]=i:(i-=65536,C[O++]=55296|i>>10&1023,C[O++]=56320|i&1023)}return buf2binstring(C,O)},utf8border=(A,B)=>{B=B||A.length,B>A.length&&(B=A.length);let D=B-1;for(;D>=0&&(A[D]&192)===128;)D--;return D<0||D===0?B:D+_utf8len[A[D]]>B?D:B},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(A){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},A||{});let B=this.options;B.raw&&B.windowBits>0?B.windowBits=-B.windowBits:B.gzip&&B.windowBits>0&&B.windowBits<16&&(B.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let D=deflate_1$2.deflateInit2(this.strm,B.level,B.method,B.windowBits,B.memLevel,B.strategy);if(D!==Z_OK$2)throw new Error(messages[D]);if(B.header&&deflate_1$2.deflateSetHeader(this.strm,B.header),B.dictionary){let M;if(typeof B.dictionary=="string"?M=strings.string2buf(B.dictionary):toString$1.call(B.dictionary)==="[object ArrayBuffer]"?M=new Uint8Array(B.dictionary):M=B.dictionary,D=deflate_1$2.deflateSetDictionary(this.strm,M),D!==Z_OK$2)throw new Error(messages[D]);this._dict_set=!0}}Deflate$1.prototype.push=function(A,B){const D=this.strm,M=this.options.chunkSize;let O,C;if(this.ended)return!1;for(B===~~B?C=B:C=B===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof A=="string"?D.input=strings.string2buf(A):toString$1.call(A)==="[object ArrayBuffer]"?D.input=new Uint8Array(A):D.input=A,D.next_in=0,D.avail_in=D.input.length;;){if(D.avail_out===0&&(D.output=new Uint8Array(M),D.next_out=0,D.avail_out=M),(C===Z_SYNC_FLUSH||C===Z_FULL_FLUSH)&&D.avail_out<=6){this.onData(D.output.subarray(0,D.next_out)),D.avail_out=0;continue}if(O=deflate_1$2.deflate(D,C),O===Z_STREAM_END$2)return D.next_out>0&&this.onData(D.output.subarray(0,D.next_out)),O=deflate_1$2.deflateEnd(this.strm),this.onEnd(O),this.ended=!0,O===Z_OK$2;if(D.avail_out===0){this.onData(D.output);continue}if(C>0&&D.next_out>0){this.onData(D.output.subarray(0,D.next_out)),D.avail_out=0;continue}if(D.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(A){this.chunks.push(A)},Deflate$1.prototype.onEnd=function(A){A===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function deflate$1(A,B){const D=new Deflate$1(B);if(D.push(A,!0),D.err)throw D.msg||messages[D.err];return D.result}function deflateRaw$1(A,B){return B=B||{},B.raw=!0,deflate$1(A,B)}function gzip$1(A,B){return B=B||{},B.gzip=!0,deflate$1(A,B)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1};const BAD$1=16209,TYPE$1=16191;var inffast=function A(B,D){let M,O,C,i,u,$,N,F,Z,K,J,Y,oe,re,te,ue,pe,ee,ne,le,se,ce,he,ie;const fe=B.state;M=B.next_in,he=B.input,O=M+(B.avail_in-5),C=B.next_out,ie=B.output,i=C-(D-B.avail_out),u=C+(B.avail_out-257),$=fe.dmax,N=fe.wsize,F=fe.whave,Z=fe.wnext,K=fe.window,J=fe.hold,Y=fe.bits,oe=fe.lencode,re=fe.distcode,te=(1<<fe.lenbits)-1,ue=(1<<fe.distbits)-1;e:do{Y<15&&(J+=he[M++]<<Y,Y+=8,J+=he[M++]<<Y,Y+=8),pe=oe[J&te];t:for(;;){if(ee=pe>>>24,J>>>=ee,Y-=ee,ee=pe>>>16&255,ee===0)ie[C++]=pe&65535;else if(ee&16){ne=pe&65535,ee&=15,ee&&(Y<ee&&(J+=he[M++]<<Y,Y+=8),ne+=J&(1<<ee)-1,J>>>=ee,Y-=ee),Y<15&&(J+=he[M++]<<Y,Y+=8,J+=he[M++]<<Y,Y+=8),pe=re[J&ue];n:for(;;){if(ee=pe>>>24,J>>>=ee,Y-=ee,ee=pe>>>16&255,ee&16){if(le=pe&65535,ee&=15,Y<ee&&(J+=he[M++]<<Y,Y+=8,Y<ee&&(J+=he[M++]<<Y,Y+=8)),le+=J&(1<<ee)-1,le>$){B.msg="invalid distance too far back",fe.mode=BAD$1;break e}if(J>>>=ee,Y-=ee,ee=C-i,le>ee){if(ee=le-ee,ee>F&&fe.sane){B.msg="invalid distance too far back",fe.mode=BAD$1;break e}if(se=0,ce=K,Z===0){if(se+=N-ee,ee<ne){ne-=ee;do ie[C++]=K[se++];while(--ee);se=C-le,ce=ie}}else if(Z<ee){if(se+=N+Z-ee,ee-=Z,ee<ne){ne-=ee;do ie[C++]=K[se++];while(--ee);if(se=0,Z<ne){ee=Z,ne-=ee;do ie[C++]=K[se++];while(--ee);se=C-le,ce=ie}}}else if(se+=Z-ee,ee<ne){ne-=ee;do ie[C++]=K[se++];while(--ee);se=C-le,ce=ie}for(;ne>2;)ie[C++]=ce[se++],ie[C++]=ce[se++],ie[C++]=ce[se++],ne-=3;ne&&(ie[C++]=ce[se++],ne>1&&(ie[C++]=ce[se++]))}else{se=C-le;do ie[C++]=ie[se++],ie[C++]=ie[se++],ie[C++]=ie[se++],ne-=3;while(ne>2);ne&&(ie[C++]=ie[se++],ne>1&&(ie[C++]=ie[se++]))}}else if((ee&64)===0){pe=re[(pe&65535)+(J&(1<<ee)-1)];continue n}else{B.msg="invalid distance code",fe.mode=BAD$1;break e}break}}else if((ee&64)===0){pe=oe[(pe&65535)+(J&(1<<ee)-1)];continue t}else if(ee&32){fe.mode=TYPE$1;break e}else{B.msg="invalid literal/length code",fe.mode=BAD$1;break e}break}}while(M<O&&C<u);ne=Y>>3,M-=ne,Y-=ne<<3,J&=(1<<Y)-1,B.next_in=M,B.next_out=C,B.avail_in=M<O?5+(O-M):5-(M-O),B.avail_out=C<u?257+(u-C):257-(C-u),fe.hold=J,fe.bits=Y};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=(A,B,D,M,O,C,i,u)=>{const $=u.bits;let N=0,F=0,Z=0,K=0,J=0,Y=0,oe=0,re=0,te=0,ue=0,pe,ee,ne,le,se,ce=null,he;const ie=new Uint16Array(MAXBITS+1),fe=new Uint16Array(MAXBITS+1);let ye=null,ve,ke,Ie;for(N=0;N<=MAXBITS;N++)ie[N]=0;for(F=0;F<M;F++)ie[B[D+F]]++;for(J=$,K=MAXBITS;K>=1&&ie[K]===0;K--);if(J>K&&(J=K),K===0)return O[C++]=1<<24|64<<16|0,O[C++]=1<<24|64<<16|0,u.bits=1,0;for(Z=1;Z<K&&ie[Z]===0;Z++);for(J<Z&&(J=Z),re=1,N=1;N<=MAXBITS;N++)if(re<<=1,re-=ie[N],re<0)return-1;if(re>0&&(A===CODES$1||K!==1))return-1;for(fe[1]=0,N=1;N<MAXBITS;N++)fe[N+1]=fe[N]+ie[N];for(F=0;F<M;F++)B[D+F]!==0&&(i[fe[B[D+F]]++]=F);if(A===CODES$1?(ce=ye=i,he=20):A===LENS$1?(ce=lbase,ye=lext,he=257):(ce=dbase,ye=dext,he=0),ue=0,F=0,N=Z,se=C,Y=J,oe=0,ne=-1,te=1<<J,le=te-1,A===LENS$1&&te>ENOUGH_LENS$1||A===DISTS$1&&te>ENOUGH_DISTS$1)return 1;for(;;){ve=N-oe,i[F]+1<he?(ke=0,Ie=i[F]):i[F]>=he?(ke=ye[i[F]-he],Ie=ce[i[F]-he]):(ke=96,Ie=0),pe=1<<N-oe,ee=1<<Y,Z=ee;do ee-=pe,O[se+(ue>>oe)+ee]=ve<<24|ke<<16|Ie|0;while(ee!==0);for(pe=1<<N-1;ue&pe;)pe>>=1;if(pe!==0?(ue&=pe-1,ue+=pe):ue=0,F++,--ie[N]===0){if(N===K)break;N=B[D+i[F]]}if(N>J&&(ue&le)!==ne){for(oe===0&&(oe=J),se+=Z,Y=N-oe,re=1<<Y;Y+oe<K&&(re-=ie[Y+oe],!(re<=0));)Y++,re<<=1;if(te+=1<<Y,A===LENS$1&&te>ENOUGH_LENS$1||A===DISTS$1&&te>ENOUGH_DISTS$1)return 1;ne=ue&le,O[ne]=J<<24|Y<<16|se-C|0}}return ue!==0&&(O[se+ue]=N-oe<<24|64<<16|0),u.bits=J,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=16180,FLAGS=16181,TIME=16182,OS=16183,EXLEN=16184,EXTRA=16185,NAME=16186,COMMENT=16187,HCRC=16188,DICTID=16189,DICT=16190,TYPE=16191,TYPEDO=16192,STORED=16193,COPY_=16194,COPY=16195,TABLE=16196,LENLENS=16197,CODELENS=16198,LEN_=16199,LEN=16200,LENEXT=16201,DIST=16202,DISTEXT=16203,MATCH=16204,LIT=16205,CHECK=16206,LENGTH=16207,DONE=16208,BAD=16209,MEM=16210,SYNC=16211,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=A=>(A>>>24&255)+(A>>>8&65280)+((A&65280)<<8)+((A&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=A=>{if(!A)return 1;const B=A.state;return!B||B.strm!==A||B.mode<HEAD||B.mode>SYNC?1:0},inflateResetKeep=A=>{if(inflateStateCheck(A))return Z_STREAM_ERROR$1;const B=A.state;return A.total_in=A.total_out=B.total=0,A.msg="",B.wrap&&(A.adler=B.wrap&1),B.mode=HEAD,B.last=0,B.havedict=0,B.flags=-1,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new Int32Array(ENOUGH_LENS),B.distcode=B.distdyn=new Int32Array(ENOUGH_DISTS),B.sane=1,B.back=-1,Z_OK$1},inflateReset=A=>{if(inflateStateCheck(A))return Z_STREAM_ERROR$1;const B=A.state;return B.wsize=0,B.whave=0,B.wnext=0,inflateResetKeep(A)},inflateReset2=(A,B)=>{let D;if(inflateStateCheck(A))return Z_STREAM_ERROR$1;const M=A.state;return B<0?(D=0,B=-B):(D=(B>>4)+5,B<48&&(B&=15)),B&&(B<8||B>15)?Z_STREAM_ERROR$1:(M.window!==null&&M.wbits!==B&&(M.window=null),M.wrap=D,M.wbits=B,inflateReset(A))},inflateInit2=(A,B)=>{if(!A)return Z_STREAM_ERROR$1;const D=new InflateState;A.state=D,D.strm=A,D.window=null,D.mode=HEAD;const M=inflateReset2(A,B);return M!==Z_OK$1&&(A.state=null),M},inflateInit=A=>inflateInit2(A,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=A=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let B=0;for(;B<144;)A.lens[B++]=8;for(;B<256;)A.lens[B++]=9;for(;B<280;)A.lens[B++]=7;for(;B<288;)A.lens[B++]=8;for(inftrees(LENS,A.lens,0,288,lenfix,0,A.work,{bits:9}),B=0;B<32;)A.lens[B++]=5;inftrees(DISTS,A.lens,0,32,distfix,0,A.work,{bits:5}),virgin=!1}A.lencode=lenfix,A.lenbits=9,A.distcode=distfix,A.distbits=5},updatewindow=(A,B,D,M)=>{let O;const C=A.state;return C.window===null&&(C.wsize=1<<C.wbits,C.wnext=0,C.whave=0,C.window=new Uint8Array(C.wsize)),M>=C.wsize?(C.window.set(B.subarray(D-C.wsize,D),0),C.wnext=0,C.whave=C.wsize):(O=C.wsize-C.wnext,O>M&&(O=M),C.window.set(B.subarray(D-M,D-M+O),C.wnext),M-=O,M?(C.window.set(B.subarray(D-M,D),0),C.wnext=M,C.whave=C.wsize):(C.wnext+=O,C.wnext===C.wsize&&(C.wnext=0),C.whave<C.wsize&&(C.whave+=O))),0},inflate$2=(A,B)=>{let D,M,O,C,i,u,$,N,F,Z,K,J,Y,oe,re=0,te,ue,pe,ee,ne,le,se,ce;const he=new Uint8Array(4);let ie,fe;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(A)||!A.output||!A.input&&A.avail_in!==0)return Z_STREAM_ERROR$1;D=A.state,D.mode===TYPE&&(D.mode=TYPEDO),i=A.next_out,O=A.output,$=A.avail_out,C=A.next_in,M=A.input,u=A.avail_in,N=D.hold,F=D.bits,Z=u,K=$,ce=Z_OK$1;e:for(;;)switch(D.mode){case HEAD:if(D.wrap===0){D.mode=TYPEDO;break}for(;F<16;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(D.wrap&2&&N===35615){D.wbits===0&&(D.wbits=15),D.check=0,he[0]=N&255,he[1]=N>>>8&255,D.check=crc32_1(D.check,he,2,0),N=0,F=0,D.mode=FLAGS;break}if(D.head&&(D.head.done=!1),!(D.wrap&1)||(((N&255)<<8)+(N>>8))%31){A.msg="incorrect header check",D.mode=BAD;break}if((N&15)!==Z_DEFLATED){A.msg="unknown compression method",D.mode=BAD;break}if(N>>>=4,F-=4,se=(N&15)+8,D.wbits===0&&(D.wbits=se),se>15||se>D.wbits){A.msg="invalid window size",D.mode=BAD;break}D.dmax=1<<D.wbits,D.flags=0,A.adler=D.check=1,D.mode=N&512?DICTID:TYPE,N=0,F=0;break;case FLAGS:for(;F<16;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(D.flags=N,(D.flags&255)!==Z_DEFLATED){A.msg="unknown compression method",D.mode=BAD;break}if(D.flags&57344){A.msg="unknown header flags set",D.mode=BAD;break}D.head&&(D.head.text=N>>8&1),D.flags&512&&D.wrap&4&&(he[0]=N&255,he[1]=N>>>8&255,D.check=crc32_1(D.check,he,2,0)),N=0,F=0,D.mode=TIME;case TIME:for(;F<32;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}D.head&&(D.head.time=N),D.flags&512&&D.wrap&4&&(he[0]=N&255,he[1]=N>>>8&255,he[2]=N>>>16&255,he[3]=N>>>24&255,D.check=crc32_1(D.check,he,4,0)),N=0,F=0,D.mode=OS;case OS:for(;F<16;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}D.head&&(D.head.xflags=N&255,D.head.os=N>>8),D.flags&512&&D.wrap&4&&(he[0]=N&255,he[1]=N>>>8&255,D.check=crc32_1(D.check,he,2,0)),N=0,F=0,D.mode=EXLEN;case EXLEN:if(D.flags&1024){for(;F<16;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}D.length=N,D.head&&(D.head.extra_len=N),D.flags&512&&D.wrap&4&&(he[0]=N&255,he[1]=N>>>8&255,D.check=crc32_1(D.check,he,2,0)),N=0,F=0}else D.head&&(D.head.extra=null);D.mode=EXTRA;case EXTRA:if(D.flags&1024&&(J=D.length,J>u&&(J=u),J&&(D.head&&(se=D.head.extra_len-D.length,D.head.extra||(D.head.extra=new Uint8Array(D.head.extra_len)),D.head.extra.set(M.subarray(C,C+J),se)),D.flags&512&&D.wrap&4&&(D.check=crc32_1(D.check,M,J,C)),u-=J,C+=J,D.length-=J),D.length))break e;D.length=0,D.mode=NAME;case NAME:if(D.flags&2048){if(u===0)break e;J=0;do se=M[C+J++],D.head&&se&&D.length<65536&&(D.head.name+=String.fromCharCode(se));while(se&&J<u);if(D.flags&512&&D.wrap&4&&(D.check=crc32_1(D.check,M,J,C)),u-=J,C+=J,se)break e}else D.head&&(D.head.name=null);D.length=0,D.mode=COMMENT;case COMMENT:if(D.flags&4096){if(u===0)break e;J=0;do se=M[C+J++],D.head&&se&&D.length<65536&&(D.head.comment+=String.fromCharCode(se));while(se&&J<u);if(D.flags&512&&D.wrap&4&&(D.check=crc32_1(D.check,M,J,C)),u-=J,C+=J,se)break e}else D.head&&(D.head.comment=null);D.mode=HCRC;case HCRC:if(D.flags&512){for(;F<16;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(D.wrap&4&&N!==(D.check&65535)){A.msg="header crc mismatch",D.mode=BAD;break}N=0,F=0}D.head&&(D.head.hcrc=D.flags>>9&1,D.head.done=!0),A.adler=D.check=0,D.mode=TYPE;break;case DICTID:for(;F<32;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}A.adler=D.check=zswap32(N),N=0,F=0,D.mode=DICT;case DICT:if(D.havedict===0)return A.next_out=i,A.avail_out=$,A.next_in=C,A.avail_in=u,D.hold=N,D.bits=F,Z_NEED_DICT$1;A.adler=D.check=1,D.mode=TYPE;case TYPE:if(B===Z_BLOCK||B===Z_TREES)break e;case TYPEDO:if(D.last){N>>>=F&7,F-=F&7,D.mode=CHECK;break}for(;F<3;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}switch(D.last=N&1,N>>>=1,F-=1,N&3){case 0:D.mode=STORED;break;case 1:if(fixedtables(D),D.mode=LEN_,B===Z_TREES){N>>>=2,F-=2;break e}break;case 2:D.mode=TABLE;break;case 3:A.msg="invalid block type",D.mode=BAD}N>>>=2,F-=2;break;case STORED:for(N>>>=F&7,F-=F&7;F<32;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if((N&65535)!==(N>>>16^65535)){A.msg="invalid stored block lengths",D.mode=BAD;break}if(D.length=N&65535,N=0,F=0,D.mode=COPY_,B===Z_TREES)break e;case COPY_:D.mode=COPY;case COPY:if(J=D.length,J){if(J>u&&(J=u),J>$&&(J=$),J===0)break e;O.set(M.subarray(C,C+J),i),u-=J,C+=J,$-=J,i+=J,D.length-=J;break}D.mode=TYPE;break;case TABLE:for(;F<14;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(D.nlen=(N&31)+257,N>>>=5,F-=5,D.ndist=(N&31)+1,N>>>=5,F-=5,D.ncode=(N&15)+4,N>>>=4,F-=4,D.nlen>286||D.ndist>30){A.msg="too many length or distance symbols",D.mode=BAD;break}D.have=0,D.mode=LENLENS;case LENLENS:for(;D.have<D.ncode;){for(;F<3;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}D.lens[ye[D.have++]]=N&7,N>>>=3,F-=3}for(;D.have<19;)D.lens[ye[D.have++]]=0;if(D.lencode=D.lendyn,D.lenbits=7,ie={bits:D.lenbits},ce=inftrees(CODES,D.lens,0,19,D.lencode,0,D.work,ie),D.lenbits=ie.bits,ce){A.msg="invalid code lengths set",D.mode=BAD;break}D.have=0,D.mode=CODELENS;case CODELENS:for(;D.have<D.nlen+D.ndist;){for(;re=D.lencode[N&(1<<D.lenbits)-1],te=re>>>24,ue=re>>>16&255,pe=re&65535,!(te<=F);){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(pe<16)N>>>=te,F-=te,D.lens[D.have++]=pe;else{if(pe===16){for(fe=te+2;F<fe;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(N>>>=te,F-=te,D.have===0){A.msg="invalid bit length repeat",D.mode=BAD;break}se=D.lens[D.have-1],J=3+(N&3),N>>>=2,F-=2}else if(pe===17){for(fe=te+3;F<fe;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}N>>>=te,F-=te,se=0,J=3+(N&7),N>>>=3,F-=3}else{for(fe=te+7;F<fe;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}N>>>=te,F-=te,se=0,J=11+(N&127),N>>>=7,F-=7}if(D.have+J>D.nlen+D.ndist){A.msg="invalid bit length repeat",D.mode=BAD;break}for(;J--;)D.lens[D.have++]=se}}if(D.mode===BAD)break;if(D.lens[256]===0){A.msg="invalid code -- missing end-of-block",D.mode=BAD;break}if(D.lenbits=9,ie={bits:D.lenbits},ce=inftrees(LENS,D.lens,0,D.nlen,D.lencode,0,D.work,ie),D.lenbits=ie.bits,ce){A.msg="invalid literal/lengths set",D.mode=BAD;break}if(D.distbits=6,D.distcode=D.distdyn,ie={bits:D.distbits},ce=inftrees(DISTS,D.lens,D.nlen,D.ndist,D.distcode,0,D.work,ie),D.distbits=ie.bits,ce){A.msg="invalid distances set",D.mode=BAD;break}if(D.mode=LEN_,B===Z_TREES)break e;case LEN_:D.mode=LEN;case LEN:if(u>=6&&$>=258){A.next_out=i,A.avail_out=$,A.next_in=C,A.avail_in=u,D.hold=N,D.bits=F,inffast(A,K),i=A.next_out,O=A.output,$=A.avail_out,C=A.next_in,M=A.input,u=A.avail_in,N=D.hold,F=D.bits,D.mode===TYPE&&(D.back=-1);break}for(D.back=0;re=D.lencode[N&(1<<D.lenbits)-1],te=re>>>24,ue=re>>>16&255,pe=re&65535,!(te<=F);){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(ue&&(ue&240)===0){for(ee=te,ne=ue,le=pe;re=D.lencode[le+((N&(1<<ee+ne)-1)>>ee)],te=re>>>24,ue=re>>>16&255,pe=re&65535,!(ee+te<=F);){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}N>>>=ee,F-=ee,D.back+=ee}if(N>>>=te,F-=te,D.back+=te,D.length=pe,ue===0){D.mode=LIT;break}if(ue&32){D.back=-1,D.mode=TYPE;break}if(ue&64){A.msg="invalid literal/length code",D.mode=BAD;break}D.extra=ue&15,D.mode=LENEXT;case LENEXT:if(D.extra){for(fe=D.extra;F<fe;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}D.length+=N&(1<<D.extra)-1,N>>>=D.extra,F-=D.extra,D.back+=D.extra}D.was=D.length,D.mode=DIST;case DIST:for(;re=D.distcode[N&(1<<D.distbits)-1],te=re>>>24,ue=re>>>16&255,pe=re&65535,!(te<=F);){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if((ue&240)===0){for(ee=te,ne=ue,le=pe;re=D.distcode[le+((N&(1<<ee+ne)-1)>>ee)],te=re>>>24,ue=re>>>16&255,pe=re&65535,!(ee+te<=F);){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}N>>>=ee,F-=ee,D.back+=ee}if(N>>>=te,F-=te,D.back+=te,ue&64){A.msg="invalid distance code",D.mode=BAD;break}D.offset=pe,D.extra=ue&15,D.mode=DISTEXT;case DISTEXT:if(D.extra){for(fe=D.extra;F<fe;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}D.offset+=N&(1<<D.extra)-1,N>>>=D.extra,F-=D.extra,D.back+=D.extra}if(D.offset>D.dmax){A.msg="invalid distance too far back",D.mode=BAD;break}D.mode=MATCH;case MATCH:if($===0)break e;if(J=K-$,D.offset>J){if(J=D.offset-J,J>D.whave&&D.sane){A.msg="invalid distance too far back",D.mode=BAD;break}J>D.wnext?(J-=D.wnext,Y=D.wsize-J):Y=D.wnext-J,J>D.length&&(J=D.length),oe=D.window}else oe=O,Y=i-D.offset,J=D.length;J>$&&(J=$),$-=J,D.length-=J;do O[i++]=oe[Y++];while(--J);D.length===0&&(D.mode=LEN);break;case LIT:if($===0)break e;O[i++]=D.length,$--,D.mode=LEN;break;case CHECK:if(D.wrap){for(;F<32;){if(u===0)break e;u--,N|=M[C++]<<F,F+=8}if(K-=$,A.total_out+=K,D.total+=K,D.wrap&4&&K&&(A.adler=D.check=D.flags?crc32_1(D.check,O,K,i-K):adler32_1(D.check,O,K,i-K)),K=$,D.wrap&4&&(D.flags?N:zswap32(N))!==D.check){A.msg="incorrect data check",D.mode=BAD;break}N=0,F=0}D.mode=LENGTH;case LENGTH:if(D.wrap&&D.flags){for(;F<32;){if(u===0)break e;u--,N+=M[C++]<<F,F+=8}if(D.wrap&4&&N!==(D.total&4294967295)){A.msg="incorrect length check",D.mode=BAD;break}N=0,F=0}D.mode=DONE;case DONE:ce=Z_STREAM_END$1;break e;case BAD:ce=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return A.next_out=i,A.avail_out=$,A.next_in=C,A.avail_in=u,D.hold=N,D.bits=F,(D.wsize||K!==A.avail_out&&D.mode<BAD&&(D.mode<CHECK||B!==Z_FINISH$1))&&updatewindow(A,A.output,A.next_out,K-A.avail_out),Z-=A.avail_in,K-=A.avail_out,A.total_in+=Z,A.total_out+=K,D.total+=K,D.wrap&4&&K&&(A.adler=D.check=D.flags?crc32_1(D.check,O,K,A.next_out-K):adler32_1(D.check,O,K,A.next_out-K)),A.data_type=D.bits+(D.last?64:0)+(D.mode===TYPE?128:0)+(D.mode===LEN_||D.mode===COPY_?256:0),(Z===0&&K===0||B===Z_FINISH$1)&&ce===Z_OK$1&&(ce=Z_BUF_ERROR),ce},inflateEnd=A=>{if(inflateStateCheck(A))return Z_STREAM_ERROR$1;let B=A.state;return B.window&&(B.window=null),A.state=null,Z_OK$1},inflateGetHeader=(A,B)=>{if(inflateStateCheck(A))return Z_STREAM_ERROR$1;const D=A.state;return(D.wrap&2)===0?Z_STREAM_ERROR$1:(D.head=B,B.done=!1,Z_OK$1)},inflateSetDictionary=(A,B)=>{const D=B.length;let M,O,C;return inflateStateCheck(A)||(M=A.state,M.wrap!==0&&M.mode!==DICT)?Z_STREAM_ERROR$1:M.mode===DICT&&(O=1,O=adler32_1(O,B,D,0),O!==M.check)?Z_DATA_ERROR$1:(C=updatewindow(A,B,D,D),C?(M.mode=MEM,Z_MEM_ERROR$1):(M.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(A){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},A||{});const B=this.options;B.raw&&B.windowBits>=0&&B.windowBits<16&&(B.windowBits=-B.windowBits,B.windowBits===0&&(B.windowBits=-15)),B.windowBits>=0&&B.windowBits<16&&!(A&&A.windowBits)&&(B.windowBits+=32),B.windowBits>15&&B.windowBits<48&&(B.windowBits&15)===0&&(B.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let D=inflate_1$2.inflateInit2(this.strm,B.windowBits);if(D!==Z_OK)throw new Error(messages[D]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),B.dictionary&&(typeof B.dictionary=="string"?B.dictionary=strings.string2buf(B.dictionary):toString.call(B.dictionary)==="[object ArrayBuffer]"&&(B.dictionary=new Uint8Array(B.dictionary)),B.raw&&(D=inflate_1$2.inflateSetDictionary(this.strm,B.dictionary),D!==Z_OK)))throw new Error(messages[D])}Inflate$1.prototype.push=function(A,B){const D=this.strm,M=this.options.chunkSize,O=this.options.dictionary;let C,i,u;if(this.ended)return!1;for(B===~~B?i=B:i=B===!0?Z_FINISH:Z_NO_FLUSH,toString.call(A)==="[object ArrayBuffer]"?D.input=new Uint8Array(A):D.input=A,D.next_in=0,D.avail_in=D.input.length;;){for(D.avail_out===0&&(D.output=new Uint8Array(M),D.next_out=0,D.avail_out=M),C=inflate_1$2.inflate(D,i),C===Z_NEED_DICT&&O&&(C=inflate_1$2.inflateSetDictionary(D,O),C===Z_OK?C=inflate_1$2.inflate(D,i):C===Z_DATA_ERROR&&(C=Z_NEED_DICT));D.avail_in>0&&C===Z_STREAM_END&&D.state.wrap>0&&A[D.next_in]!==0;)inflate_1$2.inflateReset(D),C=inflate_1$2.inflate(D,i);switch(C){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(C),this.ended=!0,!1}if(u=D.avail_out,D.next_out&&(D.avail_out===0||C===Z_STREAM_END))if(this.options.to==="string"){let $=strings.utf8border(D.output,D.next_out),N=D.next_out-$,F=strings.buf2string(D.output,$);D.next_out=N,D.avail_out=M-N,N&&D.output.set(D.output.subarray($,$+N),0),this.onData(F)}else this.onData(D.output.length===D.next_out?D.output:D.output.subarray(0,D.next_out));if(!(C===Z_OK&&u===0)){if(C===Z_STREAM_END)return C=inflate_1$2.inflateEnd(this.strm),this.onEnd(C),this.ended=!0,!0;if(D.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(A){this.chunks.push(A)},Inflate$1.prototype.onEnd=function(A){A===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};function inflate$1(A,B){const D=new Inflate$1(B);if(D.push(A),D.err)throw D.msg||messages[D.err];return D.result}function inflateRaw$1(A,B){return B=B||{},B.raw=!0,inflate$1(A,B)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var Deflate_1=Deflate,deflate_1=deflate,deflateRaw_1=deflateRaw,gzip_1=gzip,Inflate_1=Inflate,inflate_1=inflate,inflateRaw_1=inflateRaw,ungzip_1=ungzip,constants_1=constants$2,pako={Deflate:Deflate_1,deflate:deflate_1,deflateRaw:deflateRaw_1,gzip:gzip_1,Inflate:Inflate_1,inflate:inflate_1,inflateRaw:inflateRaw_1,ungzip:ungzip_1,constants:constants_1};const reqIgnoreEvents=["updateSeverTime"];reqIgnoreEvents.push("heartbeat"),reqIgnoreEvents.push("heartbeatEx"),reqIgnoreEvents.push("networkQualityChange"),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=A=>{const B=new Uint8Array(A),D=pako.deflate(B,{gzip:!0});return new Uint8Array(D?.buffer)},decompressArrayBuffer=A=>{const B=new Uint8Array(A),D=pako.inflate(B,{gzip:!0});return new Uint8Array(D?.buffer)},sendMessageFormat=A=>{const{event:B}=A;switch(A.data_original=A.data,A.time&&(A.timeStr=E$1(A.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),B){case"login":A.data=com.quick.voice.proto.Login.encode(A.data).finish();break;case"joinRoom":case"joinRoomEx":A.data=com.quick.voice.proto.JoinReq.encode(A.data).finish();break;case"quitRoom":A.data=com.quick.voice.proto.QuitReq.encode(A.data).finish();break;case"connectCF":A.data=com.quick.voice.proto.ConnectCFReq.encode(A.data).finish(),A.data=compressArrayBuffer(A.data),A.compress=!0;break;case"publish":A.data=com.quick.voice.proto.PublishReq.encode(A.data).finish(),A.data=compressArrayBuffer(A.data),A.compress=!0;break;case"pubChannel":A.data=com.quick.voice.proto.ChannelPublishReq.encode(A.data).finish();break;case"subscribe":A.data=com.quick.voice.proto.SubscribeReq.encode(A.data).finish();break;case"offer":A.data=com.quick.voice.proto.SdpConsult.encode(A.data).finish();break;case"answer":A.data=com.quick.voice.proto.SdpConsult.encode(A.data).finish();break;case"candidate":A.data=com.quick.voice.proto.Candidates.encode(A.data).finish();break;case"subChannel":A.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(A.data).finish();break;case"closeTrack":A.data=com.quick.voice.proto.CloseTrackReq.encode(A.data).finish(),A.data=compressArrayBuffer(A.data),A.compress=!0;break;case"renegotiate":A.data=com.quick.voice.proto.RenegotiateReq.encode(A.data).finish(),A.data=compressArrayBuffer(A.data),A.compress=!0;break;case"reportNetwork":A.data=com.quick.voice.proto.ReportNetInfo.encode(A.data).finish();break;case"reportP2PConnect":A.data=com.quick.voice.proto.ReportP2PReq.encode(A.data).finish();break;case"syncRoomInfo":A.data=com.quick.voice.proto.SyncRoomInfoReq.encode(A.data).finish();break;case"updateCall":A.data=com.quick.voice.proto.UpdateCall.encode(A.data).finish();break;case"networkQualityChange":A.data=com.quick.voice.proto.NetQualityChange.encode(A.data).finish();break;case"pubNotify":A.data=com.quick.voice.proto.PublishNotify.encode(A.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":A.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(A.data).finish();break;case"heartbeat":{A.data=com.quick.voice.proto.ReportTrafficUsage.encode(A.data).finish();break}case"ackMsg":{A.data=com.quick.voice.proto.AckMsgReq.encode(A.data).finish();break}default:A.data=new Uint8Array;break}return A},onMessageFormat=A=>{const{event:B,compress:D=!1}=A;if(A.data_remote=A.data,A.time&&(A.timeStr=E$1(A.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),D)try{A.data=decompressArrayBuffer(A.data)}catch(M){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",M)}switch(B){case"login":A.data=com.quick.voice.proto.Login.decode(A.data);break;case"joinRoom":case"joinRoomEx":A.data=com.quick.voice.proto.JoinRsp.decode(A.data);break;case"onJoinRoom":A.data=com.quick.voice.proto.JoinNotify.decode(A.data);break;case"onQuitRoom":A.data=com.quick.voice.proto.QuitNotify.decode(A.data);break;case"connectCF":A.data=com.quick.voice.proto.ConnectCFRsp.decode(A.data);break;case"publish":A.data=com.quick.voice.proto.PublishRsp.decode(A.data);break;case"pubChannel":A.data=com.quick.voice.proto.ChannelPublishRsq.decode(A.data);break;case"onPublish":A.data=com.quick.voice.proto.PublishNotify.decode(A.data);break;case"subscribe":A.data=com.quick.voice.proto.SubscribeRsp.decode(A.data);break;case"onAttemptP2PReq":A.data=com.quick.voice.proto.P2PAttemptConnectReq.decode(A.data);break;case"onOffer":A.data=com.quick.voice.proto.SdpConsult.decode(A.data);break;case"onAnswer":A.data=com.quick.voice.proto.SdpConsult.decode(A.data);break;case"onCandidate":A.data=com.quick.voice.proto.Candidates.decode(A.data);break;case"subChannel":A.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(A.data);break;case"closeTrack":A.data=com.quick.voice.proto.CloseTrackRsp.decode(A.data);break;case"onCloseTrack":A.data=com.quick.voice.proto.CloseTrackNotify.decode(A.data);break;case"onTrackInactive":A.data=com.quick.voice.proto.CheckSessionRsq.decode(A.data);break;case"onUpdateCall":A.data=com.quick.voice.proto.UpdateCall.decode(A.data);break;case"onDataChannelPublish":A.data=com.quick.voice.proto.UserChannel.decode(A.data);break;case"onDestroyRoom":A.data=com.quick.voice.proto.QuitNotify.decode(A.data);break;case"onUpdatePermissions":A.data=com.quick.voice.proto.UpdatePermissions.decode(A.data);break;case"onNetQuality":A.data=com.quick.voice.proto.NetQualityNotify.decode(A.data);break;case"syncRoomInfo":A.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(A.data);break;case"onCDNPlayUrlAdd":A.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(A.data);break;case"onUpdateBehavior":A.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(A.data);break;case"debugger":A.data=JSON.parse(new TextDecoder().decode(A.data));break}return A};class CallsWebSocket{#e={url:"wss://putplay.cqrjz.com/websocket",debug:!1,timeout:30*1e3};prws=new H({url:"",binaryType:"arraybuffer",reconnectCount:8,timeout:10*1e3,reconnectTime:40*1e3});activeTimeStamp=0;#n={};#t={};constructor(B){this.#e={...this.#e,...B},this.prws.setOptions(this.#e),this.prws.onMessage=this.#a,this.prws.getHeartbeatMsg=()=>""}getUrl=async(B="prod")=>{try{const O=(await(await fetch(`https://address.putplay.cc/?env=${B}`)).json()).domain;this.#e.url=O,this.prws.setOptions({url:O})}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: get serve url is error.",D)}};afreshSends=()=>{const B=Object.keys(this.#n);for(const D of B){const M=this.#n[D];M&&M.send()}};#r=(B,D={})=>{try{const{time:M,event:O,data:C={},data_original:i={},data_remote:u,...$}=D,N=E$1(M,"YYYY-MM-DD hh:mm:ss",{offset:480});let F={};const Z=(pe={})=>{const ee=JSON.parse(JSON.stringify(pe)),ne=Object.keys(ee);for(const le of ne)(le.includes("sdp")||le.includes("Sdp"))&&(ee[le]="");return ee};let K="res ↓";switch(B){case"res":K="res ↓",F=Z(C);break;case"req":K="req ↑",F=Z(i);break}let J="#quickvo.logs";(reqIgnoreEvents.includes(O)||resIgnoreEvents.includes(O))&&(J="#quickvo.ignoreEvents");const Y={"#action":K,timeStr:N,event:O,data:F,time:M,...$},oe=localStorage.getItem(J)||JSON.stringify([]),re=JSON.parse(oe);let te=O==="heartbeat"||O==="heartbeatEx";const ue=[Y];for(const pe of re){const{event:ee}=pe;if(ee==="heartbeat"||ee==="heartbeatEx"){if(te)continue;te=!0}if(ue.length===200)break;ue.push(pe)}localStorage.setItem(J,JSON.stringify(ue))}catch(M){this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",M)}};#o=(B,{resolve:D,reject:M},O)=>{const{sn:C=""}=B,i={message:B,resolve:D,reject:M,send:()=>{},destruction:()=>{},destructionTimer:0};return i.send=()=>{clearTimeout(i.destructionTimer),O&&(i.destruction=()=>{const $=this.#n[C];clearTimeout($.destructionTimer),delete this.#n[C]},i.destructionTimer=window.setTimeout(()=>{const $=this.#n[C];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: event is timeout",$),$.destruction(),M("event is timeout")},this.#e.timeout));const u=com.quick.voice.proto.CommonReq.encode(B).finish();this.prws?.sendMessage(u),O||D(!0)},this.#n[C]=i,i};#i=B=>this.#n[B];#a=async B=>{const D=new Uint8Array(B),M=com.quick.voice.proto.CommonRsp.decode(D),{sn:O,event:C}=M,i=onMessageFormat(M);if(this.#r("res",i),this.#e.debug&&!resIgnoreEvents.includes(C)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",i),["heartbeat","heartbeatEx"].includes(C)&&(this.activeTimeStamp=new Date().getTime()),notifyName_keys.includes(C))return this.emitNotify(C,V(i,["code","data","desc"]));const $=this.#i(O);if($){const{resolve:N=Z=>{},destruction:F=()=>{}}=$;N(V(i,["code","data","desc","sn"])),F()}};clearEvents=(B=[])=>{const D=Object.keys(this.#n);B.length===0&&(B=D);for(const M of D){if(!B.includes(M))continue;const O=this.#n[M];if(O){const{destruction:C}=O;C()}}};connect=async()=>new Promise(async(B,D)=>{try{const M=new Date().getTime();await this.prws.connect();const O=new Date().getTime();if(this.activeTimeStamp=O,this.#e.debug){const C=O-M;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${C}ms-广播事件`,this.#t)}B(this.prws)}catch(M){D(M)}});close=async()=>{this.clearEvents(),await this.prws?.close(),this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.")};sendMessage=(B,D=!0)=>new Promise(async(M,O)=>{const{event:C,...i}=B,u=Date.now(),$=sendMessageFormat({event:C,sn:+`${u}${v$1(1e3,9999)}`,time:u,valid:this.#e.timeout,version:3,compress:!1,...i});this.#r("req",$),this.#e.debug&&!reqIgnoreEvents.includes(C)&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",$),this.#o($,{resolve:M,reject:O},D).send()});emitNotify=async(B,D)=>{const M=this.#t[B]||[];for(const O of M){const{callback:C=async()=>{}}=O;await C(D)}};addNotify=(B,D=!1)=>{const{event:M,sn:O=wt(32)}=B;this.#t[M]||(this.#t[M]=[]);const C=this.#t[M],i=C.findIndex(u=>u.sn===O);return i!==-1&&C.splice(i,1),D?C.unshift(B):C.push(B),O};removeNotify=(B=[])=>{if(B.length===0)this.#t={};else{const D=Object.keys(this.#t);for(const M of D)this.#t[M]=this.#t[M].filter(O=>!B.includes(O.sn||""))}this.#e.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",this.#t)}}const createMutedAudioStream=A=>{const B=A.createOscillator();B.type="sine",B.frequency.setValueAtTime(0,A.currentTime);const D=A.createGain();D.gain.value=0,B.connect(D),D.connect(A.destination),B.start();const M=A.createMediaStreamDestination();return D.disconnect(),B.connect(M),M.stream},createFakeVideoStream=(A=10,B=10,D=30)=>{const M=document.createElement("canvas"),O=M.getContext("2d");M.width=A,M.height=B;let C=0;return setInterval(()=>{O.clearRect(0,0,M.width,M.height);const $=O.createLinearGradient(0,0,M.width,M.height);$.addColorStop(0,`hsla(${C}, 100%, 50%, 0)`),$.addColorStop(1,`hsla(${C+120}, 100%, 50%, 0)`),O.fillStyle=$,O.fillRect(0,0,M.width,M.height),C=(C+1)%360},100),M.captureStream(D)};class NetworkQualityTester{targetUrls=[];results=[];constructor(B=[]){B.length===0&&B.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=B,this.results=[]}async testAll(){const B=this.targetUrls.map(D=>this.testUrl(D));return await Promise.all(B),this.analyzeResults()}async testUrl(B){const D=performance.now();let M=0,O=!1;try{await fetch(B,{method:"HEAD",cache:"no-store"});const C=performance.now()-D,i=performance.now(),$=await(await fetch(B,{cache:"no-store"})).blob(),N=performance.now()-i;M=$.size,O=!0,this.results.push({url:B,success:O,headTime:C,getTime:N,size:M,downloadSpeed:M>0?(M/1024/(N/1e3)).toFixed(2):0,totalTime:performance.now()-D})}catch(C){this.results.push({url:B,success:!1,error:C.message,totalTime:performance.now()-D})}}analyzeResults(){const B=this.results.filter(C=>C.success);if(B.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const D=B.reduce((C,i)=>C+i.size,0),M=B.reduce((C,i)=>C+i.totalTime,0),O=B.reduce((C,i)=>C+parseFloat(i.downloadSpeed),0)/B.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:B.length,averageDownloadSpeed:`${O.toFixed(2)} KB/s`,averageResponseTime:`${(M/B.length).toFixed(2)}ms`,totalDataTransferred:`${(D/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(A){(function(B){var D="undefined",M=D!==typeof Buffer&&Buffer,O=D!==typeof Uint8Array&&Uint8Array,C=D!==typeof ArrayBuffer&&ArrayBuffer,i=[0,0,0,0,0,0,0,0],u=Array.isArray||le,$=4294967296,N=16777216,F;Z("Uint64BE",!0,!0),Z("Int64BE",!0,!1),Z("Uint64LE",!1,!0),Z("Int64LE",!1,!1);function Z(se,ce,he){var ie=ce?0:4,fe=ce?4:0,ye=ce?0:3,ve=ce?1:2,ke=ce?2:1,Ie=ce?3:0,Re=ce?ue:ee,De=ce?pe:ne,Be=Te.prototype,Le="is"+se,Ve="_"+Le;return Be.buffer=void 0,Be.offset=0,Be[Ve]=!0,Be.toNumber=Fe,Be.toString=Ze,Be.toJSON=Fe,Be.toArray=K,M&&(Be.toBuffer=J),O&&(Be.toArrayBuffer=Y),Te[Le]=Oe,B[se]=Te,Te;function Te(_e,be,we,ge){return this instanceof Te?He(this,_e,be,we,ge):new Te(_e,be,we,ge)}function Oe(_e){return!!(_e&&_e[Ve])}function He(_e,be,we,ge,$e){if(O&&C&&(be instanceof C&&(be=new O(be)),ge instanceof C&&(ge=new O(ge))),!be&&!we&&!ge&&!F){_e.buffer=te(i,0);return}if(!oe(be,we)){var qe=F||Array;$e=we,ge=be,we=0,be=F===M?M.alloc(8):new qe(8)}_e.buffer=be,_e.offset=we|=0,D!==typeof ge&&(typeof ge=="string"?Pe(be,we,ge,$e||10):oe(ge,$e)?re(be,we,ge,$e):typeof $e=="number"?(je(be,we+ie,ge),je(be,we+fe,$e)):ge>0?Re(be,we,ge):ge<0?De(be,we,ge):re(be,we,i,0))}function Pe(_e,be,we,ge){var $e=0,qe=we.length,Ue=0,Me=0;we[0]==="-"&&$e++;for(var Je=$e;$e<qe;){var Ge=parseInt(we[$e++],ge);if(!(Ge>=0))break;Me=Me*ge+Ge,Ue=Ue*ge+Math.floor(Me/$),Me%=$}Je&&(Ue=~Ue,Me?Me=$-Me:Ue++),je(_e,be+ie,Ue),je(_e,be+fe,Me)}function Fe(){var _e=this.buffer,be=this.offset,we=Ne(_e,be+ie),ge=Ne(_e,be+fe);return he||(we|=0),we?we*$+ge:ge}function Ze(_e){var be=this.buffer,we=this.offset,ge=Ne(be,we+ie),$e=Ne(be,we+fe),qe="",Ue=!he&&ge&2147483648;for(Ue&&(ge=~ge,$e=$-$e),_e=_e||10;;){var Me=ge%_e*$+$e;if(ge=Math.floor(ge/_e),$e=Math.floor(Me/_e),qe=(Me%_e).toString(_e)+qe,!ge&&!$e)break}return Ue&&(qe="-"+qe),qe}function je(_e,be,we){_e[be+Ie]=we&255,we=we>>8,_e[be+ke]=we&255,we=we>>8,_e[be+ve]=we&255,we=we>>8,_e[be+ye]=we&255}function Ne(_e,be){return _e[be+ye]*N+(_e[be+ve]<<16)+(_e[be+ke]<<8)+_e[be+Ie]}}function K(se){var ce=this.buffer,he=this.offset;return F=null,se!==!1&&u(ce)?ce.length===8?ce:ce.slice(he,he+8):te(ce,he)}function J(se){var ce=this.buffer,he=this.offset;return F=M,se!==!1&&M.isBuffer(ce)?ce.length===8?ce:ce.slice(he,he+8):M.from(Y.call(this,se))}function Y(se){var ce=this.buffer,he=this.offset,ie=ce.buffer;if(F=O,se!==!1&&!ce.offset&&ie instanceof C)return ie.byteLength===8?ie:ie.slice(he,he+8);var fe=new O(8);return re(fe,0,ce,he),fe.buffer}function oe(se,ce){var he=se&&se.length;return ce|=0,he&&ce+8<=he&&typeof se[ce]!="string"}function re(se,ce,he,ie){ce|=0,ie|=0;for(var fe=0;fe<8;fe++)se[ce++]=he[ie++]&255}function te(se,ce){return Array.prototype.slice.call(se,ce,ce+8)}function ue(se,ce,he){for(var ie=ce+8;ie>ce;)se[--ie]=he&255,he/=256}function pe(se,ce,he){var ie=ce+8;for(he++;ie>ce;)se[--ie]=-he&255^255,he/=256}function ee(se,ce,he){for(var ie=ce+8;ce<ie;)se[ce++]=he&255,he/=256}function ne(se,ce,he){var ie=ce+8;for(he++;ce<ie;)se[ce++]=-he&255^255,he/=256}function le(se){return!!se&&Object.prototype.toString.call(se)=="[object Array]"}})(typeof A.nodeName!="string"?A: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 A=requireTools(),B=requireTools(),D=requireEbmlID(),M=function(){function O(){this._schema=D.byEbmlID,this._buffers=[],this._stack=[]}return O.prototype.encode=function(C){var i=this;return A.concat(C.reduce(function(u,$){return u.concat(i.encodeChunk($))},[])).buffer},O.prototype.encodeChunk=function(C){return C.type==="m"?C.isEnd?this.endTag(C):this.startTag(C):(C.data=B.Buffer.from(C.data),this.writeTag(C)),this.flush()},O.prototype.flush=function(){var C=this._buffers;return this._buffers=[],C},O.prototype.getSchemaInfo=function(C){for(var i=Object.keys(this._schema).map(Number),u=0;u<i.length;u++){var $=i[u];if(this._schema[$].name===C)return new B.Buffer($.toString(16),"hex")}return null},O.prototype.writeTag=function(C){var i=C.name,u=this.getSchemaInfo(i),$=C.data;if(u==null)throw new Error("No schema entry found for "+i);var N=A.encodeTag(u,$);if(this._stack.length>0){var F=this._stack[this._stack.length-1];F.children.push({tagId:u,elm:C,children:[],data:N});return}this._buffers=this._buffers.concat(N)},O.prototype.startTag=function(C){var i=C.name,u=this.getSchemaInfo(i);if(u==null)throw new Error("No schema entry found for "+i);if(C.unknownSize){var $=A.encodeTag(u,new B.Buffer(0),C.unknownSize);this._buffers=this._buffers.concat($);return}var N={tagId:u,elm:C,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(N),this._stack.push(N)},O.prototype.endTag=function(C){C.name;var i=this._stack.pop();if(i==null)throw new Error("EBML structure is broken");if(i.elm.name!==C.name)throw new Error("EBML structure is broken");var u=i.children.reduce(function(N,F){if(F.data===null)throw new Error("EBML structure is broken");return N.concat(F.data)},[]),$=A.concat(u);i.elm.type==="m"?i.data=A.encodeTag(i.tagId,$,i.elm.unknownSize):i.data=A.encodeTag(i.tagId,$),this._stack.length<1&&(this._buffers=this._buffers.concat(i.data))},O}();return EBMLEncoder.default=M,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=u,base64Js.toByteArray=N,base64Js.fromByteArray=K;for(var A=[],B=[],D=typeof Uint8Array<"u"?Uint8Array:Array,M="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=0,C=M.length;O<C;++O)A[O]=M[O],B[M.charCodeAt(O)]=O;B[45]=62,B[95]=63;function i(J){var Y=J.length;if(Y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var oe=J.indexOf("=");oe===-1&&(oe=Y);var re=oe===Y?0:4-oe%4;return[oe,re]}function u(J){var Y=i(J),oe=Y[0],re=Y[1];return(oe+re)*3/4-re}function $(J,Y,oe){return(Y+oe)*3/4-oe}function N(J){var Y,oe=i(J),re=oe[0],te=oe[1],ue=new D($(J,re,te)),pe=0,ee=te>0?re-4:re,ne;for(ne=0;ne<ee;ne+=4)Y=B[J.charCodeAt(ne)]<<18|B[J.charCodeAt(ne+1)]<<12|B[J.charCodeAt(ne+2)]<<6|B[J.charCodeAt(ne+3)],ue[pe++]=Y>>16&255,ue[pe++]=Y>>8&255,ue[pe++]=Y&255;return te===2&&(Y=B[J.charCodeAt(ne)]<<2|B[J.charCodeAt(ne+1)]>>4,ue[pe++]=Y&255),te===1&&(Y=B[J.charCodeAt(ne)]<<10|B[J.charCodeAt(ne+1)]<<4|B[J.charCodeAt(ne+2)]>>2,ue[pe++]=Y>>8&255,ue[pe++]=Y&255),ue}function F(J){return A[J>>18&63]+A[J>>12&63]+A[J>>6&63]+A[J&63]}function Z(J,Y,oe){for(var re,te=[],ue=Y;ue<oe;ue+=3)re=(J[ue]<<16&16711680)+(J[ue+1]<<8&65280)+(J[ue+2]&255),te.push(F(re));return te.join("")}function K(J){for(var Y,oe=J.length,re=oe%3,te=[],ue=16383,pe=0,ee=oe-re;pe<ee;pe+=ue)te.push(Z(J,pe,pe+ue>ee?ee:pe+ue));return re===1?(Y=J[oe-1],te.push(A[Y>>2]+A[Y<<4&63]+"==")):re===2&&(Y=(J[oe-2]<<8)+J[oe-1],te.push(A[Y>>10]+A[Y>>4&63]+A[Y<<2&63]+"=")),te.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(A,B,D,M,O){var C,i,u=O*8-M-1,$=(1<<u)-1,N=$>>1,F=-7,Z=D?O-1:0,K=D?-1:1,J=A[B+Z];for(Z+=K,C=J&(1<<-F)-1,J>>=-F,F+=u;F>0;C=C*256+A[B+Z],Z+=K,F-=8);for(i=C&(1<<-F)-1,C>>=-F,F+=M;F>0;i=i*256+A[B+Z],Z+=K,F-=8);if(C===0)C=1-N;else{if(C===$)return i?NaN:(J?-1:1)*(1/0);i=i+Math.pow(2,M),C=C-N}return(J?-1:1)*i*Math.pow(2,C-M)},ieee754.write=function(A,B,D,M,O,C){var i,u,$,N=C*8-O-1,F=(1<<N)-1,Z=F>>1,K=O===23?Math.pow(2,-24)-Math.pow(2,-77):0,J=M?0:C-1,Y=M?1:-1,oe=B<0||B===0&&1/B<0?1:0;for(B=Math.abs(B),isNaN(B)||B===1/0?(u=isNaN(B)?1:0,i=F):(i=Math.floor(Math.log(B)/Math.LN2),B*($=Math.pow(2,-i))<1&&(i--,$*=2),i+Z>=1?B+=K/$:B+=K*Math.pow(2,1-Z),B*$>=2&&(i++,$/=2),i+Z>=F?(u=0,i=F):i+Z>=1?(u=(B*$-1)*Math.pow(2,O),i=i+Z):(u=B*Math.pow(2,Z-1)*Math.pow(2,O),i=0));O>=8;A[D+J]=u&255,J+=Y,u/=256,O-=8);for(i=i<<O|u,N+=O;N>0;A[D+J]=i&255,J+=Y,i/=256,N-=8);A[D+J-Y]|=oe*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(D){const M=requireBase64Js(),A=requireIeee754(),N=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;D.Buffer=u,D.SlowBuffer=ue,D.INSPECT_MAX_BYTES=50;const O=2147483647;D.kMaxLength=O,u.TYPED_ARRAY_SUPPORT=C(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function C(){try{const Q=new Uint8Array(1),j={foo:function(){return 42}};return Object.setPrototypeOf(j,Uint8Array.prototype),Object.setPrototypeOf(Q,j),Q.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function i(Q){if(Q>O)throw new RangeError('The value "'+Q+'" is invalid for option "size"');const j=new Uint8Array(Q);return Object.setPrototypeOf(j,u.prototype),j}function u(Q,j,z){if(typeof Q=="number"){if(typeof j=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Z(Q)}return $(Q,j,z)}u.poolSize=8192;function $(Q,j,z){if(typeof Q=="string")return K(Q,j);if(ArrayBuffer.isView(Q))return Y(Q);if(Q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(tt(Q,ArrayBuffer)||Q&&tt(Q.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tt(Q,SharedArrayBuffer)||Q&&tt(Q.buffer,SharedArrayBuffer)))return ae(Q,j,z);if(typeof Q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const X=Q.valueOf&&Q.valueOf();if(X!=null&&X!==Q)return u.from(X,j,z);const se=oe(Q);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]=="function")return u.from(Q[Symbol.toPrimitive]("string"),j,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}u.from=function(Q,j,z){return $(Q,j,z)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function B(Q){if(typeof Q!="number")throw new TypeError('"size" argument must be of type number');if(Q<0)throw new RangeError('The value "'+Q+'" is invalid for option "size"')}function F(Q,j,z){return B(Q),Q<=0?i(Q):j!==void 0?typeof z=="string"?i(Q).fill(j,z):i(Q).fill(j):i(Q)}u.alloc=function(Q,j,z){return F(Q,j,z)};function Z(Q){return B(Q),i(Q<0?0:ne(Q)|0)}u.allocUnsafe=function(Q){return Z(Q)},u.allocUnsafeSlow=function(Q){return Z(Q)};function K(Q,j){if((typeof j!="string"||j==="")&&(j="utf8"),!u.isEncoding(j))throw new TypeError("Unknown encoding: "+j);const z=ye(Q,j)|0;let X=i(z);const se=X.write(Q,j);return se!==z&&(X=X.slice(0,se)),X}function J(Q){const j=Q.length<0?0:ne(Q.length)|0,z=i(j);for(let X=0;X<j;X+=1)z[X]=Q[X]&255;return z}function Y(Q){if(tt(Q,Uint8Array)){const j=new Uint8Array(Q);return ae(j.buffer,j.byteOffset,j.byteLength)}return J(Q)}function ae(Q,j,z){if(j<0||Q.byteLength<j)throw new RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<j+(z||0))throw new RangeError('"length" is outside of buffer bounds');let X;return j===void 0&&z===void 0?X=new Uint8Array(Q):z===void 0?X=new Uint8Array(Q,j):X=new Uint8Array(Q,j,z),Object.setPrototypeOf(X,u.prototype),X}function oe(Q){if(u.isBuffer(Q)){const j=ne(Q.length)|0,z=i(j);return z.length===0||Q.copy(z,0,0,j),z}if(Q.length!==void 0)return typeof Q.length!="number"||on(Q.length)?i(0):J(Q);if(Q.type==="Buffer"&&Array.isArray(Q.data))return J(Q.data)}function ne(Q){if(Q>=O)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O.toString(16)+" bytes");return Q|0}function ue(Q){return+Q!=Q&&(Q=0),u.alloc(+Q)}u.isBuffer=function(j){return j!=null&&j._isBuffer===!0&&j!==u.prototype},u.compare=function(j,z){if(tt(j,Uint8Array)&&(j=u.from(j,j.offset,j.byteLength)),tt(z,Uint8Array)&&(z=u.from(z,z.offset,z.byteLength)),!u.isBuffer(j)||!u.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(j===z)return 0;let X=j.length,se=z.length;for(let pe=0,ve=Math.min(X,se);pe<ve;++pe)if(j[pe]!==z[pe]){X=j[pe],se=z[pe];break}return X<se?-1:se<X?1:0},u.isEncoding=function(j){switch(String(j).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}},u.concat=function(j,z){if(!Array.isArray(j))throw new TypeError('"list" argument must be an Array of Buffers');if(j.length===0)return u.alloc(0);let X;if(z===void 0)for(z=0,X=0;X<j.length;++X)z+=j[X].length;const se=u.allocUnsafe(z);let pe=0;for(X=0;X<j.length;++X){let ve=j[X];if(tt(ve,Uint8Array))pe+ve.length>se.length?(u.isBuffer(ve)||(ve=u.from(ve)),ve.copy(se,pe)):Uint8Array.prototype.set.call(se,ve,pe);else if(u.isBuffer(ve))ve.copy(se,pe);else throw new TypeError('"list" argument must be an Array of Buffers');pe+=ve.length}return se};function ye(Q,j){if(u.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||tt(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);const z=Q.length,X=arguments.length>2&&arguments[2]===!0;if(!X&&z===0)return 0;let se=!1;for(;;)switch(j){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return st(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return Dt(Q).length;default:if(se)return X?-1:st(Q).length;j=(""+j).toLowerCase(),se=!0}}u.byteLength=ye;function te(Q,j,z){let X=!1;if((j===void 0||j<0)&&(j=0),j>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,j>>>=0,z<=j))return"";for(Q||(Q="utf8");;)switch(Q){case"hex":return Ke(this,j,z);case"utf8":case"utf-8":return we(this,j,z);case"ascii":return Fe(this,j,z);case"latin1":case"binary":return je(this,j,z);case"base64":return be(this,j,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vt(this,j,z);default:if(X)throw new TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),X=!0}}u.prototype._isBuffer=!0;function re(Q,j,z){const X=Q[j];Q[j]=Q[z],Q[z]=X}u.prototype.swap16=function(){const j=this.length;if(j%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let z=0;z<j;z+=2)re(this,z,z+1);return this},u.prototype.swap32=function(){const j=this.length;if(j%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let z=0;z<j;z+=4)re(this,z,z+3),re(this,z+1,z+2);return this},u.prototype.swap64=function(){const j=this.length;if(j%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let z=0;z<j;z+=8)re(this,z,z+7),re(this,z+1,z+6),re(this,z+2,z+5),re(this,z+3,z+4);return this},u.prototype.toString=function(){const j=this.length;return j===0?"":arguments.length===0?we(this,0,j):te.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(j){if(!u.isBuffer(j))throw new TypeError("Argument must be a Buffer");return this===j?!0:u.compare(this,j)===0},u.prototype.inspect=function(){let j="";const z=D.INSPECT_MAX_BYTES;return j=this.toString("hex",0,z).replace(/(.{2})/g,"$1 ").trim(),this.length>z&&(j+=" ... "),"<Buffer "+j+">"},N&&(u.prototype[N]=u.prototype.inspect),u.prototype.compare=function(j,z,X,se,pe){if(tt(j,Uint8Array)&&(j=u.from(j,j.offset,j.byteLength)),!u.isBuffer(j))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof j);if(z===void 0&&(z=0),X===void 0&&(X=j?j.length:0),se===void 0&&(se=0),pe===void 0&&(pe=this.length),z<0||X>j.length||se<0||pe>this.length)throw new RangeError("out of range index");if(se>=pe&&z>=X)return 0;if(se>=pe)return-1;if(z>=X)return 1;if(z>>>=0,X>>>=0,se>>>=0,pe>>>=0,this===j)return 0;let ve=pe-se,Ee=X-z;const Me=Math.min(ve,Ee),Ne=this.slice(se,pe),Ue=j.slice(z,X);for(let De=0;De<Me;++De)if(Ne[De]!==Ue[De]){ve=Ne[De],Ee=Ue[De];break}return ve<Ee?-1:Ee<ve?1:0};function le(Q,j,z,X,se){if(Q.length===0)return-1;if(typeof z=="string"?(X=z,z=0):z>2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,on(z)&&(z=se?0:Q.length-1),z<0&&(z=Q.length+z),z>=Q.length){if(se)return-1;z=Q.length-1}else if(z<0)if(se)z=0;else return-1;if(typeof j=="string"&&(j=u.from(j,X)),u.isBuffer(j))return j.length===0?-1:ce(Q,j,z,X,se);if(typeof j=="number")return j=j&255,typeof Uint8Array.prototype.indexOf=="function"?se?Uint8Array.prototype.indexOf.call(Q,j,z):Uint8Array.prototype.lastIndexOf.call(Q,j,z):ce(Q,[j],z,X,se);throw new TypeError("val must be string, number or Buffer")}function ce(Q,j,z,X,se){let pe=1,ve=Q.length,Ee=j.length;if(X!==void 0&&(X=String(X).toLowerCase(),X==="ucs2"||X==="ucs-2"||X==="utf16le"||X==="utf-16le")){if(Q.length<2||j.length<2)return-1;pe=2,ve/=2,Ee/=2,z/=2}function Me(Ue,De){return pe===1?Ue[De]:Ue.readUInt16BE(De*pe)}let Ne;if(se){let Ue=-1;for(Ne=z;Ne<ve;Ne++)if(Me(Q,Ne)===Me(j,Ue===-1?0:Ne-Ue)){if(Ue===-1&&(Ue=Ne),Ne-Ue+1===Ee)return Ue*pe}else Ue!==-1&&(Ne-=Ne-Ue),Ue=-1}else for(z+Ee>ve&&(z=ve-Ee),Ne=z;Ne>=0;Ne--){let Ue=!0;for(let De=0;De<Ee;De++)if(Me(Q,Ne+De)!==Me(j,De)){Ue=!1;break}if(Ue)return Ne}return-1}u.prototype.includes=function(j,z,X){return this.indexOf(j,z,X)!==-1},u.prototype.indexOf=function(j,z,X){return le(this,j,z,X,!0)},u.prototype.lastIndexOf=function(j,z,X){return le(this,j,z,X,!1)};function de(Q,j,z,X){z=Number(z)||0;const se=Q.length-z;X?(X=Number(X),X>se&&(X=se)):X=se;const pe=j.length;X>pe/2&&(X=pe/2);let ve;for(ve=0;ve<X;++ve){const Ee=parseInt(j.substr(ve*2,2),16);if(on(Ee))return ve;Q[z+ve]=Ee}return ve}function me(Q,j,z,X){return Bt(st(j,Q.length-z),Q,z,X)}function ie(Q,j,z,X){return Bt(kt(j),Q,z,X)}function he(Q,j,z,X){return Bt(Dt(j),Q,z,X)}function ke(Q,j,z,X){return Bt(rn(j,Q.length-z),Q,z,X)}u.prototype.write=function(j,z,X,se){if(z===void 0)se="utf8",X=this.length,z=0;else if(X===void 0&&typeof z=="string")se=z,X=this.length,z=0;else if(isFinite(z))z=z>>>0,isFinite(X)?(X=X>>>0,se===void 0&&(se="utf8")):(se=X,X=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const pe=this.length-z;if((X===void 0||X>pe)&&(X=pe),j.length>0&&(X<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let ve=!1;for(;;)switch(se){case"hex":return de(this,j,z,X);case"utf8":case"utf-8":return me(this,j,z,X);case"ascii":case"latin1":case"binary":return ie(this,j,z,X);case"base64":return he(this,j,z,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,j,z,X);default:if(ve)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),ve=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function be(Q,j,z){return j===0&&z===Q.length?M.fromByteArray(Q):M.fromByteArray(Q.slice(j,z))}function we(Q,j,z){z=Math.min(Q.length,z);const X=[];let se=j;for(;se<z;){const pe=Q[se];let ve=null,Ee=pe>239?4:pe>223?3:pe>191?2:1;if(se+Ee<=z){let Me,Ne,Ue,De;switch(Ee){case 1:pe<128&&(ve=pe);break;case 2:Me=Q[se+1],(Me&192)===128&&(De=(pe&31)<<6|Me&63,De>127&&(ve=De));break;case 3:Me=Q[se+1],Ne=Q[se+2],(Me&192)===128&&(Ne&192)===128&&(De=(pe&15)<<12|(Me&63)<<6|Ne&63,De>2047&&(De<55296||De>57343)&&(ve=De));break;case 4:Me=Q[se+1],Ne=Q[se+2],Ue=Q[se+3],(Me&192)===128&&(Ne&192)===128&&(Ue&192)===128&&(De=(pe&15)<<18|(Me&63)<<12|(Ne&63)<<6|Ue&63,De>65535&&De<1114112&&(ve=De))}}ve===null?(ve=65533,Ee=1):ve>65535&&(ve-=65536,X.push(ve>>>10&1023|55296),ve=56320|ve&1023),X.push(ve),se+=Ee}return qe(X)}const Te=4096;function qe(Q){const j=Q.length;if(j<=Te)return String.fromCharCode.apply(String,Q);let z="",X=0;for(;X<j;)z+=String.fromCharCode.apply(String,Q.slice(X,X+=Te));return z}function Fe(Q,j,z){let X="";z=Math.min(Q.length,z);for(let se=j;se<z;++se)X+=String.fromCharCode(Q[se]&127);return X}function je(Q,j,z){let X="";z=Math.min(Q.length,z);for(let se=j;se<z;++se)X+=String.fromCharCode(Q[se]);return X}function Ke(Q,j,z){const X=Q.length;(!j||j<0)&&(j=0),(!z||z<0||z>X)&&(z=X);let se="";for(let pe=j;pe<z;++pe)se+=cn[Q[pe]];return se}function vt(Q,j,z){const X=Q.slice(j,z);let se="";for(let pe=0;pe<X.length-1;pe+=2)se+=String.fromCharCode(X[pe]+X[pe+1]*256);return se}u.prototype.slice=function(j,z){const X=this.length;j=~~j,z=z===void 0?X:~~z,j<0?(j+=X,j<0&&(j=0)):j>X&&(j=X),z<0?(z+=X,z<0&&(z=0)):z>X&&(z=X),z<j&&(z=j);const se=this.subarray(j,z);return Object.setPrototypeOf(se,u.prototype),se};function Ce(Q,j,z){if(Q%1!==0||Q<0)throw new RangeError("offset is not uint");if(Q+j>z)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(j,z,X){j=j>>>0,z=z>>>0,X||Ce(j,z,this.length);let se=this[j],pe=1,ve=0;for(;++ve<z&&(pe*=256);)se+=this[j+ve]*pe;return se},u.prototype.readUintBE=u.prototype.readUIntBE=function(j,z,X){j=j>>>0,z=z>>>0,X||Ce(j,z,this.length);let se=this[j+--z],pe=1;for(;z>0&&(pe*=256);)se+=this[j+--z]*pe;return se},u.prototype.readUint8=u.prototype.readUInt8=function(j,z){return j=j>>>0,z||Ce(j,1,this.length),this[j]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(j,z){return j=j>>>0,z||Ce(j,2,this.length),this[j]|this[j+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(j,z){return j=j>>>0,z||Ce(j,2,this.length),this[j]<<8|this[j+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(j,z){return j=j>>>0,z||Ce(j,4,this.length),(this[j]|this[j+1]<<8|this[j+2]<<16)+this[j+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(j,z){return j=j>>>0,z||Ce(j,4,this.length),this[j]*16777216+(this[j+1]<<16|this[j+2]<<8|this[j+3])},u.prototype.readBigUInt64LE=bt(function(j){j=j>>>0,Pe(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&ze(j,this.length-8);const se=z+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24,pe=this[++j]+this[++j]*2**8+this[++j]*2**16+X*2**24;return BigInt(se)+(BigInt(pe)<<BigInt(32))}),u.prototype.readBigUInt64BE=bt(function(j){j=j>>>0,Pe(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&ze(j,this.length-8);const se=z*2**24+this[++j]*2**16+this[++j]*2**8+this[++j],pe=this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+X;return(BigInt(se)<<BigInt(32))+BigInt(pe)}),u.prototype.readIntLE=function(j,z,X){j=j>>>0,z=z>>>0,X||Ce(j,z,this.length);let se=this[j],pe=1,ve=0;for(;++ve<z&&(pe*=256);)se+=this[j+ve]*pe;return pe*=128,se>=pe&&(se-=Math.pow(2,8*z)),se},u.prototype.readIntBE=function(j,z,X){j=j>>>0,z=z>>>0,X||Ce(j,z,this.length);let se=z,pe=1,ve=this[j+--se];for(;se>0&&(pe*=256);)ve+=this[j+--se]*pe;return pe*=128,ve>=pe&&(ve-=Math.pow(2,8*z)),ve},u.prototype.readInt8=function(j,z){return j=j>>>0,z||Ce(j,1,this.length),this[j]&128?(255-this[j]+1)*-1:this[j]},u.prototype.readInt16LE=function(j,z){j=j>>>0,z||Ce(j,2,this.length);const X=this[j]|this[j+1]<<8;return X&32768?X|4294901760:X},u.prototype.readInt16BE=function(j,z){j=j>>>0,z||Ce(j,2,this.length);const X=this[j+1]|this[j]<<8;return X&32768?X|4294901760:X},u.prototype.readInt32LE=function(j,z){return j=j>>>0,z||Ce(j,4,this.length),this[j]|this[j+1]<<8|this[j+2]<<16|this[j+3]<<24},u.prototype.readInt32BE=function(j,z){return j=j>>>0,z||Ce(j,4,this.length),this[j]<<24|this[j+1]<<16|this[j+2]<<8|this[j+3]},u.prototype.readBigInt64LE=bt(function(j){j=j>>>0,Pe(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&ze(j,this.length-8);const se=this[j+4]+this[j+5]*2**8+this[j+6]*2**16+(X<<24);return(BigInt(se)<<BigInt(32))+BigInt(z+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24)}),u.prototype.readBigInt64BE=bt(function(j){j=j>>>0,Pe(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&ze(j,this.length-8);const se=(z<<24)+this[++j]*2**16+this[++j]*2**8+this[++j];return(BigInt(se)<<BigInt(32))+BigInt(this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+X)}),u.prototype.readFloatLE=function(j,z){return j=j>>>0,z||Ce(j,4,this.length),A.read(this,j,!0,23,4)},u.prototype.readFloatBE=function(j,z){return j=j>>>0,z||Ce(j,4,this.length),A.read(this,j,!1,23,4)},u.prototype.readDoubleLE=function(j,z){return j=j>>>0,z||Ce(j,8,this.length),A.read(this,j,!0,52,8)},u.prototype.readDoubleBE=function(j,z){return j=j>>>0,z||Ce(j,8,this.length),A.read(this,j,!1,52,8)};function Re(Q,j,z,X,se,pe){if(!u.isBuffer(Q))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>se||j<pe)throw new RangeError('"value" argument is out of bounds');if(z+X>Q.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(j,z,X,se){if(j=+j,z=z>>>0,X=X>>>0,!se){const Ee=Math.pow(2,8*X)-1;Re(this,j,z,X,Ee,0)}let pe=1,ve=0;for(this[z]=j&255;++ve<X&&(pe*=256);)this[z+ve]=j/pe&255;return z+X},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(j,z,X,se){if(j=+j,z=z>>>0,X=X>>>0,!se){const Ee=Math.pow(2,8*X)-1;Re(this,j,z,X,Ee,0)}let pe=X-1,ve=1;for(this[z+pe]=j&255;--pe>=0&&(ve*=256);)this[z+pe]=j/ve&255;return z+X},u.prototype.writeUint8=u.prototype.writeUInt8=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,1,255,0),this[z]=j&255,z+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,2,65535,0),this[z]=j&255,this[z+1]=j>>>8,z+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,2,65535,0),this[z]=j>>>8,this[z+1]=j&255,z+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,4,4294967295,0),this[z+3]=j>>>24,this[z+2]=j>>>16,this[z+1]=j>>>8,this[z]=j&255,z+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,4,4294967295,0),this[z]=j>>>24,this[z+1]=j>>>16,this[z+2]=j>>>8,this[z+3]=j&255,z+4};function ot(Q,j,z,X,se){$e(j,X,se,Q,z,7);let pe=Number(j&BigInt(4294967295));Q[z++]=pe,pe=pe>>8,Q[z++]=pe,pe=pe>>8,Q[z++]=pe,pe=pe>>8,Q[z++]=pe;let ve=Number(j>>BigInt(32)&BigInt(4294967295));return Q[z++]=ve,ve=ve>>8,Q[z++]=ve,ve=ve>>8,Q[z++]=ve,ve=ve>>8,Q[z++]=ve,z}function Le(Q,j,z,X,se){$e(j,X,se,Q,z,7);let pe=Number(j&BigInt(4294967295));Q[z+7]=pe,pe=pe>>8,Q[z+6]=pe,pe=pe>>8,Q[z+5]=pe,pe=pe>>8,Q[z+4]=pe;let ve=Number(j>>BigInt(32)&BigInt(4294967295));return Q[z+3]=ve,ve=ve>>8,Q[z+2]=ve,ve=ve>>8,Q[z+1]=ve,ve=ve>>8,Q[z]=ve,z+8}u.prototype.writeBigUInt64LE=bt(function(j,z=0){return ot(this,j,z,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=bt(function(j,z=0){return Le(this,j,z,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(j,z,X,se){if(j=+j,z=z>>>0,!se){const Me=Math.pow(2,8*X-1);Re(this,j,z,X,Me-1,-Me)}let pe=0,ve=1,Ee=0;for(this[z]=j&255;++pe<X&&(ve*=256);)j<0&&Ee===0&&this[z+pe-1]!==0&&(Ee=1),this[z+pe]=(j/ve>>0)-Ee&255;return z+X},u.prototype.writeIntBE=function(j,z,X,se){if(j=+j,z=z>>>0,!se){const Me=Math.pow(2,8*X-1);Re(this,j,z,X,Me-1,-Me)}let pe=X-1,ve=1,Ee=0;for(this[z+pe]=j&255;--pe>=0&&(ve*=256);)j<0&&Ee===0&&this[z+pe+1]!==0&&(Ee=1),this[z+pe]=(j/ve>>0)-Ee&255;return z+X},u.prototype.writeInt8=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,1,127,-128),j<0&&(j=255+j+1),this[z]=j&255,z+1},u.prototype.writeInt16LE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,2,32767,-32768),this[z]=j&255,this[z+1]=j>>>8,z+2},u.prototype.writeInt16BE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,2,32767,-32768),this[z]=j>>>8,this[z+1]=j&255,z+2},u.prototype.writeInt32LE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,4,2147483647,-2147483648),this[z]=j&255,this[z+1]=j>>>8,this[z+2]=j>>>16,this[z+3]=j>>>24,z+4},u.prototype.writeInt32BE=function(j,z,X){return j=+j,z=z>>>0,X||Re(this,j,z,4,2147483647,-2147483648),j<0&&(j=4294967295+j+1),this[z]=j>>>24,this[z+1]=j>>>16,this[z+2]=j>>>8,this[z+3]=j&255,z+4},u.prototype.writeBigInt64LE=bt(function(j,z=0){return ot(this,j,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=bt(function(j,z=0){return Le(this,j,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Qe(Q,j,z,X,se,pe){if(z+X>Q.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function at(Q,j,z,X,se){return j=+j,z=z>>>0,se||Qe(Q,j,z,4),A.write(Q,j,z,X,23,4),z+4}u.prototype.writeFloatLE=function(j,z,X){return at(this,j,z,!0,X)},u.prototype.writeFloatBE=function(j,z,X){return at(this,j,z,!1,X)};function Ye(Q,j,z,X,se){return j=+j,z=z>>>0,se||Qe(Q,j,z,8),A.write(Q,j,z,X,52,8),z+8}u.prototype.writeDoubleLE=function(j,z,X){return Ye(this,j,z,!0,X)},u.prototype.writeDoubleBE=function(j,z,X){return Ye(this,j,z,!1,X)},u.prototype.copy=function(j,z,X,se){if(!u.isBuffer(j))throw new TypeError("argument should be a Buffer");if(X||(X=0),!se&&se!==0&&(se=this.length),z>=j.length&&(z=j.length),z||(z=0),se>0&&se<X&&(se=X),se===X||j.length===0||this.length===0)return 0;if(z<0)throw new RangeError("targetStart out of bounds");if(X<0||X>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),j.length-z<se-X&&(se=j.length-z+X);const pe=se-X;return this===j&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(z,X,se):Uint8Array.prototype.set.call(j,this.subarray(X,se),z),pe},u.prototype.fill=function(j,z,X,se){if(typeof j=="string"){if(typeof z=="string"?(se=z,z=0,X=this.length):typeof X=="string"&&(se=X,X=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!u.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(j.length===1){const ve=j.charCodeAt(0);(se==="utf8"&&ve<128||se==="latin1")&&(j=ve)}}else typeof j=="number"?j=j&255:typeof j=="boolean"&&(j=Number(j));if(z<0||this.length<z||this.length<X)throw new RangeError("Out of range index");if(X<=z)return this;z=z>>>0,X=X===void 0?this.length:X>>>0,j||(j=0);let pe;if(typeof j=="number")for(pe=z;pe<X;++pe)this[pe]=j;else{const ve=u.isBuffer(j)?j:u.from(j,se),Ee=ve.length;if(Ee===0)throw new TypeError('The value "'+j+'" is invalid for argument "value"');for(pe=0;pe<X-z;++pe)this[pe+z]=ve[pe%Ee]}return this};const Ze={};function Se(Q,j,z){Ze[Q]=class extends z{constructor(){super(),Object.defineProperty(this,"message",{value:j.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}Se("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){return Q?`${Q} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Se("ERR_INVALID_ARG_TYPE",function(Q,j){return`The "${Q}" argument must be of type number. Received type ${typeof j}`},TypeError),Se("ERR_OUT_OF_RANGE",function(Q,j,z){let X=`The value of "${Q}" is out of range.`,se=z;return Number.isInteger(z)&&Math.abs(z)>2**32?se=ge(String(z)):typeof z=="bigint"&&(se=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(se=ge(se)),se+="n"),X+=` It must be ${j}. Received ${se}`,X},RangeError);function ge(Q){let j="",z=Q.length;const X=Q[0]==="-"?1:0;for(;z>=X+4;z-=3)j=`_${Q.slice(z-3,z)}${j}`;return`${Q.slice(0,z)}${j}`}function Ie(Q,j,z){Pe(j,"offset"),(Q[j]===void 0||Q[j+z]===void 0)&&ze(j,Q.length-(z+1))}function $e(Q,j,z,X,se,pe){if(Q>z||Q<j){const ve=typeof j=="bigint"?"n":"";let Ee;throw j===0||j===BigInt(0)?Ee=`>= 0${ve} and < 2${ve} ** ${(pe+1)*8}${ve}`:Ee=`>= -(2${ve} ** ${(pe+1)*8-1}${ve}) and < 2 ** ${(pe+1)*8-1}${ve}`,new Ze.ERR_OUT_OF_RANGE("value",Ee,Q)}Ie(X,se,pe)}function Pe(Q,j){if(typeof Q!="number")throw new Ze.ERR_INVALID_ARG_TYPE(j,"number",Q)}function ze(Q,j,z){throw Math.floor(Q)!==Q?(Pe(Q,z),new Ze.ERR_OUT_OF_RANGE("offset","an integer",Q)):j<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${j}`,Q)}const Ve=/[^+/0-9A-Za-z-_]/g;function Je(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(Ve,""),Q.length<2)return"";for(;Q.length%4!==0;)Q=Q+"=";return Q}function st(Q,j){j=j||1/0;let z;const X=Q.length;let se=null;const pe=[];for(let ve=0;ve<X;++ve){if(z=Q.charCodeAt(ve),z>55295&&z<57344){if(!se){if(z>56319){(j-=3)>-1&&pe.push(239,191,189);continue}else if(ve+1===X){(j-=3)>-1&&pe.push(239,191,189);continue}se=z;continue}if(z<56320){(j-=3)>-1&&pe.push(239,191,189),se=z;continue}z=(se-55296<<10|z-56320)+65536}else se&&(j-=3)>-1&&pe.push(239,191,189);if(se=null,z<128){if((j-=1)<0)break;pe.push(z)}else if(z<2048){if((j-=2)<0)break;pe.push(z>>6|192,z&63|128)}else if(z<65536){if((j-=3)<0)break;pe.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((j-=4)<0)break;pe.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return pe}function kt(Q){const j=[];for(let z=0;z<Q.length;++z)j.push(Q.charCodeAt(z)&255);return j}function rn(Q,j){let z,X,se;const pe=[];for(let ve=0;ve<Q.length&&!((j-=2)<0);++ve)z=Q.charCodeAt(ve),X=z>>8,se=z%256,pe.push(se),pe.push(X);return pe}function Dt(Q){return M.toByteArray(Je(Q))}function Bt(Q,j,z,X){let se;for(se=0;se<X&&!(se+z>=j.length||se>=Q.length);++se)j[se+z]=Q[se];return se}function tt(Q,j){return Q instanceof j||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===j.name}function on(Q){return Q!==Q}const cn=function(){const Q="0123456789abcdef",j=new Array(256);for(let z=0;z<16;++z){const X=z*16;for(let se=0;se<16;++se)j[X+se]=Q[z]+Q[se]}return j}();function bt(Q){return typeof BigInt>"u"?ln:Q}function ln(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var D=toolsEbml&&toolsEbml.__assign||function(){return D=Object.assign||function(O){for(var C,i=1,u=arguments.length;i<u;i++){C=arguments[i];for(var $ in C)Object.prototype.hasOwnProperty.call(C,$)&&(O[$]=C[$])}return O},D.apply(this,arguments)},M=toolsEbml&&toolsEbml.__spreadArray||function(O,C,i){if(i||arguments.length===2)for(var u=0,$=C.length,B;u<$;u++)(B||!(u in C))&&(B||(B=Array.prototype.slice.call(C,0,u)),B[u]=C[u]);return O.concat(B||Array.prototype.slice.call(C))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var A=requireTools(),N=function(){function O(){}return O.readVint=function(C,i){i===void 0&&(i=0);var u=8-Math.floor(Math.log2(C[i]));if(u>8){var $=O.readHexString(C,i,i+u);throw new Error("Unrepresentable length: ".concat(u," ").concat($))}if(i+u>C.length)return null;for(var B=C[i]&(1<<8-u)-1,F=1;F<u;F+=1){if(F===7&&B>=Math.pow(2,8)&&C[i+7]>0)return{length:u,value:-1};B*=Math.pow(2,8),B+=C[i+F]}return{length:u,value:B}},O.writeVint=function(C){if(C<0||C>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(C));var i=1;for(i=1;i<=8&&!(C<Math.pow(2,7*i)-1);i+=1);for(var u=A.Buffer.alloc(i),$=C,B=1;B<=i;B+=1){var F=$&255;u[i-B]=F,$-=F,$/=Math.pow(2,8)}return u[0]|=1<<8-i,u},O.concatenate=function(C,i){return!C&&!i?A.Buffer.from([]):!C||C.byteLength===0?i:!i||i.byteLength===0?C:A.Buffer.from(M(M([],C,!0),i,!0))},O.readHexString=function(C,i,u){return i===void 0&&(i=0),u===void 0&&(u=C.byteLength),Array.from(C.slice(i,u)).map(function($){return Number($).toString(16)}).reduce(function($,B){return"".concat($).concat(B.padStart(2,"0"))},"")},O.readUtf8=function(C){try{return A.Buffer.from(C).toString("utf8")}catch{return null}},O.readUnsigned=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return C.byteLength<=6?C.reduce(function(u,$){return u*256+$},0):O.readHexString(C,0,C.byteLength)},O.readSigned=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},O.readFloat=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},O.readDate=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.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(O.readHexString(C),16));default:return new Date(0)}},O.readDataFromTag=function(C,i){var u=C.type,$=C.name,B=C.track,F=C.discardable||!1,Z=C.keyframe||!1,K=null,J;switch(u){case"u":J=O.readUnsigned(i);break;case"f":J=O.readFloat(i);break;case"i":J=O.readSigned(i);break;case"s":J=String.fromCharCode.apply(String,i);break;case"8":J=O.readUtf8(i);break;case"d":J=O.readDate(i);break}if($==="SimpleBlock"||$==="Block"){var Y=0,ae=O.readVint(i,Y),oe=ae.length,ne=ae.value;Y+=oe,B=ne,J=O.readSigned(i.subarray(Y,Y+2)),Y+=2,$==="SimpleBlock"&&(Z=!!(i[oe+2]&128),F=!!(i[oe+2]&1)),Y+=1,K=i.subarray(Y)}return D(D({},C),{data:i,discardable:F,keyframe:Z,payload:K,track:B,value:J})},O}();return toolsEbml.default=N,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(D,M,A){M=M||0;for(var N=1;N<=8&&!(D[M]>=Math.pow(2,8-N));N++);if(N>8)throw new Error("Unrepresentable length: "+N+" "+D.toString("hex",M,M+N));if(M+N>D.length)return null;var O,C=D[M]&(1<<8-N)-1;for(O=1;O<N;O++){if(O===7&&C>=Math.pow(2,45)&&D[M+7]>0)return{length:N,value:-1};C*=Math.pow(2,8),C+=D[M+O]}return A&&(C-=Math.pow(2,N*7-1)-1),{length:N,value:C}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var D=requireVint();function M(A){this.buffer=A,this.offset=0}return M.prototype.nextInt16BE=function(){var A=this.buffer.readInt16BE(this.offset);return this.offset+=2,A},M.prototype.nextUInt8=function(){var A=this.buffer.readUInt8(this.offset);return this.offset+=1,A},M.prototype.nextUIntV=function(){var A=D(this.buffer,this.offset);return this.offset+=A.length,A.value},M.prototype.nextIntV=function(){var A=D(this.buffer,this.offset,!0);return this.offset+=A.length,A.value},M.prototype.nextBuffer=function(A){var N=A?this.buffer.slice(this.offset,this.offset+A):this.buffer.slice(this.offset);return this.offset+=A||this.length,N},Object.defineProperty(M.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=M,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var D=requireBufferReader(),M=1,A=3,N=2;ebmlBlock=function(C){var i={},u=new D(C);i.trackNumber=u.nextUIntV(),i.timecode=u.nextInt16BE();var $=u.nextUInt8();i.invisible=!!($&8),i.keyframe=!!($&128),i.discardable=!!($&1);var B=($&6)>>1;return i.frames=O(u,B),i};function O(C,i){if(!i)return[C.nextBuffer()];var u,$,B=[],F=C.nextUInt8()+1;if(i===N){if(C.length%F!==0)throw new Error("Fixed-Size Lacing Error");for($=C.length/F,u=0;u<F;u++)B.push(C.nextBuffer($));return B}var Z=[];if(i===M)for(u=0;u<F-1;u++){var K;$=0;do K=C.nextUInt8(),$+=K;while(K===255);Z.push($)}else if(i===A)for($=C.nextUIntV(),Z.push($),u=1;u<F-1;u++)$+=C.nextIntV(),Z.push($);for(u=0;u<F-1;u++)B.push(C.nextBuffer(Z[u]));return B.push(C.nextBuffer()),B}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.convertEBMLDateToJSDate=D.createFloatBuffer=D.createIntBuffer=D.createUIntBuffer=D.encodeValueToBuffer=D.concat=D.putRefinedMetaData=D.extractElement=D.removeElement=D.makeMetadataSeekable=D.createRIFFChunk=D.VP8BitStreamToRiffWebPBuffer=D.WebPBlockFilter=D.encodeTag=D.readBlock=D.ebmlBlock=D.writeVint=D.readVint=D.Buffer=void 0;var M=requireInt64Buffer(),A=requireEBMLEncoder(),N=requireBuffer(),O=requireToolsEbml(),C=requireEbmlBlock();D.Buffer=N.Buffer,D.readVint=O.default.readVint,D.writeVint=O.default.writeVint,D.ebmlBlock=C;function i(ie){return(0,D.ebmlBlock)(new D.Buffer(ie))}D.readBlock=i;function u(ie,he,ke){return ke===void 0&&(ke=!1),te([ie,ke?new D.Buffer("01ffffffffffffff","hex"):(0,D.writeVint)(he.length),he])}D.encodeTag=u;function $(ie){return ie.reduce(function(he,ke){if(ke.type!=="b"||ke.name!=="SimpleBlock")return he;var be=(0,D.ebmlBlock)(ke.data),we=be.frames.some(function(Te){var qe=Te.slice(3,6).toString("hex");return qe==="9d012a"});return we?he.concat(ke):he},[])}D.WebPBlockFilter=$;function B(ie){var he=F("VP8 ",ie),ke=te([new D.Buffer("WEBP","ascii"),he]);return F("RIFF",ke)}D.VP8BitStreamToRiffWebPBuffer=B;function F(ie,he){var ke=new D.Buffer(4);return ke.writeUInt32LE(he.byteLength,0),te([new D.Buffer(ie.substr(0,4),"ascii"),ke,he,new D.Buffer(he.byteLength%2===0?0:1)])}D.createRIFFChunk=F;function Z(ie,he,ke){var be=J("EBML",ie),we=ae(be),Te=we+12,qe=ie[ie.length-1].dataEnd-Te,Fe=J("Info",ie);K("Duration",Fe),Fe.splice(1,0,{name:"Duration",type:"f",data:de(he,8)});for(var je=ae(Fe),Ke=J("Tracks",ie),vt=ae(Ke),Ce=47,Re=[],ot=5+ke.length*15,Le=[],Qe=-1,at=10,Ye=function($e){var Pe=Ce,ze=Pe+je,Ve=ze+vt,Je=Ve+ot,st=Je-qe;if(Re=[],Re.push({name:"SeekHead",type:"m",isEnd:!1}),Re.push({name:"Seek",type:"m",isEnd:!1}),Re.push({name:"SeekID",type:"b",data:new D.Buffer([21,73,169,102])}),Re.push({name:"SeekPosition",type:"u",data:le(Pe)}),Re.push({name:"Seek",type:"m",isEnd:!0}),Re.push({name:"Seek",type:"m",isEnd:!1}),Re.push({name:"SeekID",type:"b",data:new D.Buffer([22,84,174,107])}),Re.push({name:"SeekPosition",type:"u",data:le(ze)}),Re.push({name:"Seek",type:"m",isEnd:!0}),Re.push({name:"Seek",type:"m",isEnd:!1}),Re.push({name:"SeekID",type:"b",data:new D.Buffer([28,83,187,107])}),Re.push({name:"SeekPosition",type:"u",data:le(Ve)}),Re.push({name:"Seek",type:"m",isEnd:!0}),Re.push({name:"SeekHead",type:"m",isEnd:!0}),Ce=ae(Re),Le=[],Le.push({name:"Cues",type:"m",isEnd:!1}),ke.forEach(function(kt){var rn=kt.CueTrack,Dt=kt.CueClusterPosition,Bt=kt.CueTime;Le.push({name:"CuePoint",type:"m",isEnd:!1}),Le.push({name:"CueTime",type:"u",data:le(Bt)}),Le.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Le.push({name:"CueTrack",type:"u",data:le(rn)}),Dt-=Te,Dt+=st,Le.push({name:"CueClusterPosition",type:"u",data:le(Dt)}),Le.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Le.push({name:"CuePoint",type:"m",isEnd:!0})}),Le.push({name:"Cues",type:"m",isEnd:!0}),ot=ae(Le),Qe!==st){if(Qe=st,$e===at-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Ze=0;Ze<at;Ze++){var Se=Ye(Ze);if(Se==="break")break}var ge=[].concat.apply([],[be,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},Re,Fe,Ke,Le]),Ie=new A.default().encode(ge);return Ie}D.makeMetadataSeekable=Z;function K(ie,he){for(var ke=-1,be=0;be<he.length;be++){var we=he[be];if(we.name===ie)if(we.type==="m")if(!we.isEnd)ke=be;else{if(ke==-1)throw new Error("Detected ".concat(ie," closing element before finding the start"));he.splice(ke,be-ke+1);return}else{he.splice(be,1);return}}}D.removeElement=K;function J(ie,he){for(var ke=[],be=-1,we=0;we<he.length;we++){var Te=he[we];if(Te.name===ie)if(Te.type==="m")if(!Te.isEnd)be=we;else{if(be==-1)throw new Error("Detected ".concat(ie," closing element before finding the start"));ke=he.slice(be,we+1);break}else{ke.push(he[we]);break}}return ke}D.extractElement=J;function Y(ie,he){Array.isArray(he.cueInfos)&&!Array.isArray(he.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),he.cues=he.cueInfos);for(var ke=[],be=[],we=0;we<ie.length;we++){var Te=ie[we];if(Te.type==="m"&&Te.name==="Segment"){if(ke=ie.slice(0,we),be=ie.slice(we),Te.unknownSize){be.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(be[be.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var qe=be[be.length-1].dataEnd,Fe=ke[ke.length-1].dataEnd,je=new A.default().encode(ke).byteLength,Ke=je-Fe,vt=qe-be[0].tagStart;be[0].tagStart-Fe,be[0].tagStart;var Ce=new D.Buffer([24,83,128,103]),Re=new D.Buffer("01ffffffffffffff","hex"),ot=Ce.byteLength+Re.byteLength,Le=vt,Qe;for(Qe=1;Qe<20;Qe++){var at=Fe+ot+Le,Ye=at-qe,Ze=Ke+Ye,Se=oe(be,Ze,he),ge=new A.default().encode(Se).byteLength;if(ge===Le)return new A.default().encode([].concat(ke,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],Se));Le=ge}throw new Error("unable to refine metadata, stable size could not be found in "+Qe+" iterations!")}D.putRefinedMetaData=Y;function ae(ie){var he=new A.default;return ie.reduce(function(ke,be){return ke.concat(he.encode([be]))},[]).reduce(function(ke,be){return ke+be.byteLength},0)}function oe(ie,he,ke){var be=ke.duration,we=ke.clusterPtrs,Te=ke.cues,qe=ie.slice(0);if(typeof be=="number"){var Fe=!1;qe.forEach(function(Ke){Ke.type==="f"&&Ke.name==="Duration"&&(Fe=!0,Ke.data=de(be,8))}),Fe||ye(qe,"Info",[{name:"Duration",type:"f",data:de(be,8)}])}Array.isArray(Te)&&ye(qe,"Cues",ue(Te,he));var je=[];return Array.isArray(we)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),je=ne(we,he)),ye(qe,"SeekHead",je,!0),qe}function ne(ie,he){var ke=[];return ie.forEach(function(be){ke.push({name:"Seek",type:"m",isEnd:!1}),ke.push({name:"SeekID",type:"b",data:new D.Buffer([31,67,182,117])}),ke.push({name:"SeekPosition",type:"u",data:le(be+he)}),ke.push({name:"Seek",type:"m",isEnd:!0})}),ke}function ue(ie,he){var ke=[];return ie.forEach(function(be){var we=be.CueTrack,Te=be.CueClusterPosition,qe=be.CueTime;ke.push({name:"CuePoint",type:"m",isEnd:!1}),ke.push({name:"CueTime",type:"u",data:le(qe)}),ke.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ke.push({name:"CueTrack",type:"u",data:le(we)}),ke.push({name:"CueClusterPosition",type:"u",data:le(Te+he)}),ke.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ke.push({name:"CuePoint",type:"m",isEnd:!0})}),ke}function ye(ie,he,ke,be){be===void 0&&(be=!1);for(var we=-1,Te=0;Te<ie.length;Te++){var qe=ie[Te];if(qe.type==="m"&&qe.name===he&&qe.isEnd===!1){we=Te;break}}we>=0?Array.prototype.splice.apply(ie,[we+1,0].concat(ke)):be?[].concat([{name:he,type:"m",isEnd:!1}],ke,[{name:he,type:"m",isEnd:!0}]).reverse().forEach(function(Fe){ie.unshift(Fe)}):(ie.push({name:he,type:"m",isEnd:!1}),ke.forEach(function(Fe){ie.push(Fe)}),ie.push({name:he,type:"m",isEnd:!0}))}function te(ie){return D.Buffer.concat(ie)}D.concat=te;function re(ie){var he=new D.Buffer(0);if(ie.type==="m")return ie;switch(ie.type){case"u":he=le(ie.value);break;case"i":he=ce(ie.value);break;case"f":he=de(ie.value);break;case"s":he=new D.Buffer(ie.value,"ascii");break;case"8":he=new D.Buffer(ie.value,"utf8");break;case"b":he=ie.value;break;case"d":he=new M.Int64BE(ie.value.getTime().toString()).toBuffer();break}return Object.assign({},ie,{data:he})}D.encodeValueToBuffer=re;function le(ie){for(var he=1;ie>=Math.pow(2,8*he);he++);if(he>=7)return console.warn("7bit or more bigger uint not supported."),new M.Uint64BE(ie).toBuffer();var ke=new D.Buffer(he);return ke.writeUIntBE(ie,0,he),ke}D.createUIntBuffer=le;function ce(ie){for(var he=1;ie>=Math.pow(2,8*he);he++);if(he>=7)return console.warn("7bit or more bigger uint not supported."),new M.Int64BE(ie).toBuffer();var ke=new D.Buffer(he);return ke.writeIntBE(ie,0,he),ke}D.createIntBuffer=ce;function de(ie,he){if(he===void 0&&(he=8),he===8){var ke=new D.Buffer(8);return ke.writeDoubleBE(ie,0),ke}else if(he===4){var ke=new D.Buffer(4);return ke.writeFloatBE(ie,0),ke}else throw new Error("float type bits must 4bytes or 8bytes")}D.createFloatBuffer=de;function me(ie){return ie instanceof Date?ie:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(ie)/1e3/1e3)}D.convertEBMLDateToJSDate=me}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var D=requireInt64Buffer(),M=requireTools(),A=requireTools(),N=requireEbmlID(),O;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(O||(O={}));var C=function(){function i(){this._buffer=new M.Buffer(0),this._tag_stack=[],this._state=O.STATE_TAG,this._cursor=0,this._total=0,this._schema=N.byEbmlID,this._result=[]}return i.prototype.decode=function(u){this.readChunk(u);var $=this._result;return this._result=[],$},i.prototype.readChunk=function(u){for(this._buffer=A.concat([this._buffer,new M.Buffer(u)]);this._cursor<this._buffer.length&&!(this._state===O.STATE_TAG&&!this.readTag()||this._state===O.STATE_SIZE&&!this.readSize()||this._state===O.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(u){return this._schema[u]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var u=(0,M.readVint)(this._buffer,this._cursor);if(u==null)return!1;var $=this._buffer.slice(this._cursor,this._cursor+u.length),B=$.reduce(function(K,J,Y,ae){return K+J*Math.pow(16,2*(ae.length-1-Y))},0),F=this.getSchemaInfo(B),Z={EBML_ID:B.toString(16),schema:F,type:F.type,name:F.name,level:F.level,tagStart:this._total,tagEnd:this._total+u.length,sizeStart:this._total+u.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(Z),this._cursor+=u.length,this._total+=u.length,this._state=O.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var u=(0,M.readVint)(this._buffer,this._cursor);if(u==null)return!1;var $=this._tag_stack[this._tag_stack.length-1];return $.sizeEnd=$.sizeStart+u.length,$.dataStart=$.sizeEnd,$.dataSize=u.value,u.value===-1?($.dataEnd=-1,$.type==="m"&&($.unknownSize=!0)):$.dataEnd=$.sizeEnd+u.value,this._cursor+=u.length,this._total+=u.length,this._state=O.STATE_CONTENT,!0},i.prototype.readContent=function(){var u=this._tag_stack[this._tag_stack.length-1];if(u.type==="m"){if(u.isEnd=!1,this._result.push(u),this._state=O.STATE_TAG,u.dataSize===0){var $=Object.assign({},u,{isEnd:!0});this._result.push($),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+u.dataSize)return!1;var B=this._buffer.slice(this._cursor,this._cursor+u.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+u.dataSize),u.data=B,u.type){case"u":u.value=B.readUIntBE(0,B.length);break;case"i":u.value=B.readIntBE(0,B.length);break;case"f":u.value=u.dataSize===4?B.readFloatBE(0):u.dataSize===8?B.readDoubleBE(0):(console.warn("cannot read ".concat(u.dataSize," octets float. failback to 0")),0);break;case"s":u.value=B.toString("ascii");break;case"8":u.value=B.toString("utf8");break;case"b":u.value=B;break;case"d":u.value=(0,M.convertEBMLDateToJSDate)(new D.Int64BE(B).toNumber());break}if(u.value===null)throw new Error("unknown tag type:"+u.type);for(this._result.push(u),this._total+=u.dataSize,this._state=O.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var F=this._tag_stack[this._tag_stack.length-1];if(F.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<F.dataEnd)break;if(F.type!=="m")throw new Error("parent element is not master element");var $=Object.assign({},F,{isEnd:!0});this._result.push($),this._tag_stack.pop()}return!0},i}();return EBMLDecoder.default=C,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var D=typeof Reflect=="object"?Reflect:null,M=D&&typeof D.apply=="function"?D.apply:function(re,le,ce){return Function.prototype.apply.call(re,le,ce)},A;D&&typeof D.ownKeys=="function"?A=D.ownKeys:Object.getOwnPropertySymbols?A=function(re){return Object.getOwnPropertyNames(re).concat(Object.getOwnPropertySymbols(re))}:A=function(re){return Object.getOwnPropertyNames(re)};function N(te){console&&console.warn&&console.warn(te)}var O=Number.isNaN||function(re){return re!==re};function C(){C.init.call(this)}events.exports=C,events.exports.once=ne,C.EventEmitter=C,C.prototype._events=void 0,C.prototype._eventsCount=0,C.prototype._maxListeners=void 0;var i=10;function u(te){if(typeof te!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof te)}Object.defineProperty(C,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(te){if(typeof te!="number"||te<0||O(te))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+te+".");i=te}}),C.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},C.prototype.setMaxListeners=function(re){if(typeof re!="number"||re<0||O(re))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+re+".");return this._maxListeners=re,this};function $(te){return te._maxListeners===void 0?C.defaultMaxListeners:te._maxListeners}C.prototype.getMaxListeners=function(){return $(this)},C.prototype.emit=function(re){for(var le=[],ce=1;ce<arguments.length;ce++)le.push(arguments[ce]);var de=re==="error",me=this._events;if(me!==void 0)de=de&&me.error===void 0;else if(!de)return!1;if(de){var ie;if(le.length>0&&(ie=le[0]),ie instanceof Error)throw ie;var he=new Error("Unhandled error."+(ie?" ("+ie.message+")":""));throw he.context=ie,he}var ke=me[re];if(ke===void 0)return!1;if(typeof ke=="function")M(ke,this,le);else for(var be=ke.length,we=Y(ke,be),ce=0;ce<be;++ce)M(we[ce],this,le);return!0};function B(te,re,le,ce){var de,me,ie;if(u(le),me=te._events,me===void 0?(me=te._events=Object.create(null),te._eventsCount=0):(me.newListener!==void 0&&(te.emit("newListener",re,le.listener?le.listener:le),me=te._events),ie=me[re]),ie===void 0)ie=me[re]=le,++te._eventsCount;else if(typeof ie=="function"?ie=me[re]=ce?[le,ie]:[ie,le]:ce?ie.unshift(le):ie.push(le),de=$(te),de>0&&ie.length>de&&!ie.warned){ie.warned=!0;var he=new Error("Possible EventEmitter memory leak detected. "+ie.length+" "+String(re)+" listeners added. Use emitter.setMaxListeners() to increase limit");he.name="MaxListenersExceededWarning",he.emitter=te,he.type=re,he.count=ie.length,N(he)}return te}C.prototype.addListener=function(re,le){return B(this,re,le,!1)},C.prototype.on=C.prototype.addListener,C.prototype.prependListener=function(re,le){return B(this,re,le,!0)};function F(){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 Z(te,re,le){var ce={fired:!1,wrapFn:void 0,target:te,type:re,listener:le},de=F.bind(ce);return de.listener=le,ce.wrapFn=de,de}C.prototype.once=function(re,le){return u(le),this.on(re,Z(this,re,le)),this},C.prototype.prependOnceListener=function(re,le){return u(le),this.prependListener(re,Z(this,re,le)),this},C.prototype.removeListener=function(re,le){var ce,de,me,ie,he;if(u(le),de=this._events,de===void 0)return this;if(ce=de[re],ce===void 0)return this;if(ce===le||ce.listener===le)--this._eventsCount===0?this._events=Object.create(null):(delete de[re],de.removeListener&&this.emit("removeListener",re,ce.listener||le));else if(typeof ce!="function"){for(me=-1,ie=ce.length-1;ie>=0;ie--)if(ce[ie]===le||ce[ie].listener===le){he=ce[ie].listener,me=ie;break}if(me<0)return this;me===0?ce.shift():ae(ce,me),ce.length===1&&(de[re]=ce[0]),de.removeListener!==void 0&&this.emit("removeListener",re,he||le)}return this},C.prototype.off=C.prototype.removeListener,C.prototype.removeAllListeners=function(re){var le,ce,de;if(ce=this._events,ce===void 0)return this;if(ce.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ce[re]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ce[re]),this;if(arguments.length===0){var me=Object.keys(ce),ie;for(de=0;de<me.length;++de)ie=me[de],ie!=="removeListener"&&this.removeAllListeners(ie);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(le=ce[re],typeof le=="function")this.removeListener(re,le);else if(le!==void 0)for(de=le.length-1;de>=0;de--)this.removeListener(re,le[de]);return this};function K(te,re,le){var ce=te._events;if(ce===void 0)return[];var de=ce[re];return de===void 0?[]:typeof de=="function"?le?[de.listener||de]:[de]:le?oe(de):Y(de,de.length)}C.prototype.listeners=function(re){return K(this,re,!0)},C.prototype.rawListeners=function(re){return K(this,re,!1)},C.listenerCount=function(te,re){return typeof te.listenerCount=="function"?te.listenerCount(re):J.call(te,re)},C.prototype.listenerCount=J;function J(te){var re=this._events;if(re!==void 0){var le=re[te];if(typeof le=="function")return 1;if(le!==void 0)return le.length}return 0}C.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function Y(te,re){for(var le=new Array(re),ce=0;ce<re;++ce)le[ce]=te[ce];return le}function ae(te,re){for(;re+1<te.length;re++)te[re]=te[re+1];te.pop()}function oe(te){for(var re=new Array(te.length),le=0;le<re.length;++le)re[le]=te[le].listener||te[le];return re}function ne(te,re){return new Promise(function(le,ce){function de(ie){te.removeListener(re,me),ce(ie)}function me(){typeof te.removeListener=="function"&&te.removeListener("error",de),le([].slice.call(arguments))}ye(te,re,me,{once:!0}),re!=="error"&&ue(te,de,{once:!0})})}function ue(te,re,le){typeof te.on=="function"&&ye(te,"error",re,le)}function ye(te,re,le,ce){if(typeof te.on=="function")ce.once?te.once(re,le):te.on(re,le);else if(typeof te.addEventListener=="function")te.addEventListener(re,function de(me){ce.once&&te.removeEventListener(re,de),le(me)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof te)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var D=EBMLReader&&EBMLReader.__extends||function(){var O=function(C,i){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,$){u.__proto__=$}||function(u,$){for(var B in $)Object.prototype.hasOwnProperty.call($,B)&&(u[B]=$[B])},O(C,i)};return function(C,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");O(C,i);function u(){this.constructor=C}C.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var M=requireEvents(),A=requireTools(),N=function(O){D(C,O);function C(){var i=O.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 C.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},C.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var B=this.lastClusterTimecode,F=this.duration,Z=this.timecodeScale;this.emit("cluster",{timecode:B,data:i}),this.emit("duration",{timecodeScale:Z,duration:F})}else{this.metadataloaded=!0,this.metadatas=i;var u=this.trackTypes.indexOf(1),$=this.trackTypes.indexOf(2);if(this.trackInfo=u>=0&&$>=0?{type:"both",trackNumber:u}:u>=0?{type:"video",trackNumber:u}:$>=0?{type:"audio",trackNumber:$}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},C.prototype.read=function(i){var u=this,$=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var B=this.stack[this.stack.length-1];if(B!=null&&B.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),B.dataEnd=i.dataEnd,B.dataSize=i.dataEnd-B.dataStart,B.unknownSize=!1;var F=Object.assign({},B,{name:B.name,type:B.type,isEnd:!0});this.chunks.push(F)}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 Z=A.ebmlBlock(i.data),K=Z.timecode,J=Z.trackNumber,Y=Z.frames;if(this.trackTypes[J]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ae=this.lastClusterTimecode+K;this.cues.push({CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:ae}),this.emit("cue_info",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:ae})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],K]}else if(this.trackTypes[J]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ae=this.lastClusterTimecode+K;this.cues.push({CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:ae}),this.emit("cue_info",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:ae})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],K]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&Y.forEach(function(oe){var ne=oe.slice(3,6).toString("hex");if(ne==="9d012a"){var ue=A.VP8BitStreamToRiffWebPBuffer(oe),ye=new Blob([ue],{type:"image/webp"}),te=u.duration;u.emit("webp",{currentTime:te,webp:ye})}})}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"),$=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),$||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(C.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,u=0,$=0,B=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof B=="number")i=B;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof F=="number"&&(u=F),$=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof F=="number"&&(u=F),$=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackInfo.trackNumber];typeof F=="number"&&(u=F),$=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackInfo.trackNumber];typeof F=="number"&&(u=F),$=this.last2SimpleBlockAudioTrackTimecode[1]}var Z=(this.lastClusterTimecode+$)*this.timecodeScale+i-u,K=Z/this.timecodeScale;return Math.floor(K)},enumerable:!1,configurable:!0}),C.prototype.addListener=function(i,u){return O.prototype.addListener.call(this,i,u)},C.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)},C}(M.EventEmitter);return EBMLReader.default=N,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(D){var M=ebml&&ebml.__createBinding||(Object.create?function(u,$,B,F){F===void 0&&(F=B),Object.defineProperty(u,F,{enumerable:!0,get:function(){return $[B]}})}:function(u,$,B,F){F===void 0&&(F=B),u[F]=$[B]}),A=ebml&&ebml.__exportStar||function(u,$){for(var B in u)B!=="default"&&!Object.prototype.hasOwnProperty.call($,B)&&M($,u,B)};Object.defineProperty(D,"__esModule",{value:!0}),D.tools=D.Reader=D.Encoder=D.Decoder=void 0,A(requireEBML(),D);var N=requireEBMLDecoder();D.Decoder=N.default;var O=requireEBMLEncoder();D.Encoder=O.default;var C=requireEBMLReader();D.Reader=C.default;var i=requireTools();D.tools=i}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var D=lib&&lib.__awaiter||function(O,C,i,u){function $(B){return B instanceof i?B:new i(function(F){F(B)})}return new(i||(i=Promise))(function(B,F){function Z(Y){try{J(u.next(Y))}catch(ae){F(ae)}}function K(Y){try{J(u.throw(Y))}catch(ae){F(ae)}}function J(Y){Y.done?B(Y.value):$(Y.value).then(Z,K)}J((u=u.apply(O,C||[])).next())})},M=lib&&lib.__generator||function(O,C){var i={label:0,sent:function(){if(B[0]&1)throw B[1];return B[1]},trys:[],ops:[]},u,$,B,F;return F={next:Z(0),throw:Z(1),return:Z(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Z(J){return function(Y){return K([J,Y])}}function K(J){if(u)throw new TypeError("Generator is already executing.");for(;i;)try{if(u=1,$&&(B=J[0]&2?$.return:J[0]?$.throw||((B=$.return)&&B.call($),0):$.next)&&!(B=B.call($,J[1])).done)return B;switch($=0,B&&(J=[J[0]&2,B.value]),J[0]){case 0:case 1:B=J;break;case 4:return i.label++,{value:J[1],done:!1};case 5:i.label++,$=J[1],J=[0];continue;case 7:J=i.ops.pop(),i.trys.pop();continue;default:if(B=i.trys,!(B=B.length>0&&B[B.length-1])&&(J[0]===6||J[0]===2)){i=0;continue}if(J[0]===3&&(!B||J[1]>B[0]&&J[1]<B[3])){i.label=J[1];break}if(J[0]===6&&i.label<B[1]){i.label=B[1],B=J;break}if(B&&i.label<B[2]){i.label=B[2],i.ops.push(J);break}B[2]&&i.ops.pop(),i.trys.pop();continue}J=C.call(O,i)}catch(Y){J=[6,Y],$=0}finally{u=B=0}if(J[0]&5)throw J[1];return{value:J[0]?J[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var A=requireEbml();function N(O){return D(this,void 0,void 0,function(){var C,i,u,$,B,F,Z,K,J,Y,ae,oe;return M(this,function(ne){switch(ne.label){case 0:if(!O)throw Error("call to fixWebmDuration requires a blob");C=new A.Decoder,i=new A.Reader,u=O.stream(),$=u.getReader(),ne.label=1;case 1:return[4,$.read()];case 2:return B=ne.sent(),F=B.done,Z=B.value,F?(i.stop(),[3,3]):(K=C.decode(Z),K=K==null?void 0:K.filter(function(ue){return ue.type!=="unknown"}),K.forEach(function(ue){i.read(ue)}),Z=null,[3,1]);case 3:return J=A.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),Y=new Blob([J],{type:O.type}),ae=O.slice(i.metadataSize),oe=new Blob([Y,ae],{type:O.type}),[2,oe]}})})}return lib.default=N,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){_e(this,Ge);_e(this,_t,!1);_e(this,lt,!1);_e(this,qt,0);_e(this,Nt,0);_e(this,Xe,0);_e(this,nt,0);_e(this,gt,0);ee(this,"onchange",M=>{});ee(this,"onDurationChange",M=>{});ee(this,"start",async(M="")=>{M||(M=`video_Record_${E$1(Date.now())}`);let A=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(N=>{const O=N.getTracks();for(const i of O)i.onended=()=>this.stop();Be(this,_t,!0),Be(this,lt,!1),Be(this,Ge,new MediaRecorder(N)),fe(this,Ge).start();const C=new Date().getTime();Be(this,qt,C),Be(this,Xe,C),fe(this,St).call(this),fe(this,Mt).call(this),fe(this,Ge).addEventListener("dataavailable",i=>{A.push(i.data)}),fe(this,Ge).addEventListener("stop",async()=>{Be(this,_t,!1);const i=new Date().getTime();Be(this,Nt,i),Be(this,nt,fe(this,nt)+(i-fe(this,Xe))),fe(this,St).call(this),clearInterval(fe(this,gt));const u=N.getTracks();for(const K of u)K.stop();if(fe(this,Ge)===null)return;const $=new Blob(A,{type:fe(this,Ge).mimeType}),B=await fixWebmDuration($),F=URL.createObjectURL(B),Z=document.createElement("a");Z.href=F,Z.download=`${M}.mp4`,Z.click(),URL.revokeObjectURL(F),A=[],Be(this,Ge,null)})})});ee(this,"pause",async()=>{var A;await new Promise(N=>setTimeout(()=>N(!0),300)),(A=fe(this,Ge))==null||A.pause(),Be(this,lt,!0);const M=new Date().getTime();Be(this,nt,fe(this,nt)+(M-fe(this,Xe))),fe(this,St).call(this),clearInterval(fe(this,gt))});ee(this,"resume",async()=>{var A;(A=fe(this,Ge))==null||A.resume(),Be(this,lt,!1);const M=new Date().getTime();Be(this,Xe,M),fe(this,St).call(this),fe(this,Mt).call(this)});ee(this,"stop",async()=>{var M;(M=fe(this,Ge))==null||M.stop()});ee(this,"getDuration",()=>{if(fe(this,Xe)===0)return 0;let M=fe(this,nt);const A=new Date().getTime();if(fe(this,_t)&&fe(this,lt)===!1){const N=A-fe(this,Xe);Be(this,Xe,A),M=M+N}return M});ee(this,"getInfo",()=>({active:fe(this,_t),pause:fe(this,lt),startTime:fe(this,qt),endTime:fe(this,Nt),duration:fe(this,nt)}));_e(this,St,()=>{const M=this.getInfo();this.onchange(M)});_e(this,Mt,()=>{clearInterval(fe(this,gt)),Be(this,gt,window.setInterval(()=>{Be(this,nt,this.getDuration()),this.onDurationChange(fe(this,nt))},500))})}}Ge=new WeakMap,_t=new WeakMap,lt=new WeakMap,qt=new WeakMap,Nt=new WeakMap,Xe=new WeakMap,nt=new WeakMap,gt=new WeakMap,St=new WeakMap,Mt=new WeakMap;var l=Object.defineProperty,y=D=>{throw TypeError(D)},q=(D,M,A)=>M in D?l(D,M,{enumerable:!0,configurable:!0,writable:!0,value:A}):D[M]=A,s=(D,M,A)=>q(D,typeof M!="symbol"?M+"":M,A),P=(D,M,A)=>M.has(D)||y("Cannot "+A),n=(D,M,A)=>(P(D,M,"read from private field"),A?A.call(D):M.get(D)),a=(D,M,A)=>M.has(D)?y("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(D):M.set(D,A),d,v,o;class p{constructor(M={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(A,N={})=>new Promise(async(O,C)=>{const i=N.timeout||this.options.timeout,u=N.key||n(this,d).call(this),$=N.describe||"";if(this.queue.findIndex(F=>F.key===u)!==-1)return C(`${u} is exist.`);const B={key:u,func:A,describe:$,timeout:i,resolve:O,reject:C};this.queue.unshift(B),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,A=>{const N=this.queue.findIndex(O=>O.key===A);this.queue.splice(N,1)}),a(this,o,async()=>{const A=this.queue.length;if(A===0)return;const N=A-1,O=this.queue[N];this.activePromise=O;const{key:C,func:i,resolve:u,reject:$,timeout:B}=this.activePromise;B&&(this.timer=window.setTimeout(()=>{$(`pr-async-queue: ${C} is timeout.`),n(this,o).call(this)},B)),await i().then(u).catch($).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,C),n(this,o).call(this)})}),this.options={timeout:0,...M}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;const enum_iceState={connecting:"连接中",connected:"已连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_iceState);class PrResolves{constructor(){ee(this,"resolvesMap",new Map);ee(this,"index",0);ee(this,"add",(M,A=()=>!1,N=5e3)=>new Promise(O=>{var B;if(A())return O(!0);this.resolvesMap.has(M)||this.resolvesMap.set(M,new Map),this.index++;const u=`${this.index}`;N=Math.max(1e3,N);const $=window.setTimeout(()=>{this.emit(M)},N);(B=this.resolvesMap.get(M))==null||B.set(u,{resolve:O,timer:$})}));ee(this,"emit",async M=>{const A=this.resolvesMap.get(M);if(!A)return;const N=[...A.keys()];for(const O of N){const C=A.get(O);C&&(clearTimeout(C.timer),C.resolve(),A.delete(O))}})}}class RoomBase{constructor(M){ee(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:wt(),callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0});ee(this,"sfuPush",0);ee(this,"sfuPull",0);ee(this,"p2pPush",0);ee(this,"p2pPull",0);ee(this,"prResolves",new PrResolves);ee(this,"sdk_service_version","1.0.8");ee(this,"sdk_session","");ee(this,"isEarly",!1);ee(this,"isInRoom",!1);ee(this,"asyncQueue");ee(this,"await_remote_publish_users",[]);ee(this,"roomState","ready");ee(this,"iceState","closed");ee(this,"createAt",Date.now());ee(this,"cwsIns");ee(this,"peerIns");ee(this,"sfuOffsetAverageQuality",0);ee(this,"transceiverMap",new Map);ee(this,"transceiverTrackMap",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,"hasAsyncTask",M=>{var N;let A=!1;return((N=this.asyncQueue.activePromise)==null?void 0:N.describe)===M&&(A=!0),A===!1&&this.asyncQueue.queue.find(C=>C.describe===M)&&(A=!0),A});ee(this,"createUserUpdateStreams",(M=[])=>{const A={};for(const N of M)A[N]=wt();return A});ee(this,"reportLogs",(M,A="未知错误")=>{const N=this.getOptions(),{appid:O,userId:C,earlyId:i="",logUrl:u,reportErr:$}=N;if(!$)return;const B="web",F=Z=>({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})[Z].toString();{const Z=F(M),K={origin:B,type:Z,app_id:O,user_id:C,ins_id:i,desc:A},J=btoa(encodeURI(JSON.stringify(K))),Y=`${u}/upload/log?log_key=${J}`;{const ae=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),ne=new TextEncoder().encode(ae),ue=pako.deflate(ne,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:K,url:Y,size:it(ue.byteLength)}),fetch(Y,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:ue})}}});ee(this,"initPhoneyStreams",(M,A=[])=>{A.length===0&&(A=mediaType_keys);for(const N of A){const O=this.phoneyStreams.get(N);if(O){const C=O.getTracks();for(const i of C)i.stop()}switch(N){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(M));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(M));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});ee(this,"getPhoneyStreams",M=>this.phoneyStreams.get(M));ee(this,"getRoomInfo",()=>{const{options:M,roomState:A,createAt:N}=this;return{...M,roomState:A,createAt:N}});ee(this,"setRoomState",M=>{if(this.roomState===M)return;this.roomState=M;const A=enum_roomState[M],N={state:M,stateStr:A};this.cwsIns.emitNotify("onRoomState",{code:200,data:N,desc:"room state is change."})});ee(this,"setIceState",M=>{if(this.iceState===M)return;this.iceState=M;const A=enum_iceState[M],N={state:M,stateStr:A};this.cwsIns.emitNotify("onIceState",{code:200,data:N,desc:"ice state is change."})});ee(this,"setOptions",M=>(this.options={...this.options,...M},this.options));ee(this,"getOptions",()=>this.options);ee(this,"stopStream",async M=>{const A=M.getTracks();for(const N of A)N.stop()});ee(this,"getMediaDevicesErrInfo",async()=>{try{const M=await navigator.mediaDevices.enumerateDevices();M.find(N=>N.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),M.find(N=>N.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(M){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",M)}return this.mediaDevicesErrInfo});ee(this,"getUserMediaKey",(M,A)=>`${M}-${A}`);ee(this,"getCallAction",async M=>{let A="";const N=C=>M.findIndex(({type:u,enabled:$=!0})=>u===C&&$)===-1?"0":"1";return A=`${N(0)}${A}`,A=`${N(1)}${A}`,A=`${N(2)}${A}`,A=`${N(3)}${A}`,parseInt(A,2)});ee(this,"getCallActionMap",(M=0)=>{const N=Number(M).toString(2).padStart(4,"0").split(""),[O,C,i,u]=N;return{microphoneCamera_audio:!!Number(u),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(C),screenSharing_audio:!!Number(O)}});ee(this,"getBanBehaviorMap",(M=0)=>{const N=Number(M).toString(2).padStart(4,"0").split(""),[O,C,i,u]=N;return{microphoneCamera_audio:!!Number(u),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(C),screenSharing_audio:!!Number(O)}});ee(this,"getAverageVolume",(M,A)=>{M.getByteFrequencyData(A);let N=0;for(let C=0;C<A.length;C++)N+=A[C];return Math.ceil(N/A.length)});ee(this,"getTrackNamesFormTracks",(M,A=[],N="trackName")=>{const O=[];for(const C of M){const{type:i}=C;if(A.length===0||A.includes(i)){const u=C[N];u&&O.push(`${u}`)}}return O});ee(this,"usersFilter",M=>dt(M,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap","useP2P"]).sort((O,C)=>O.id.localeCompare(C.id,"en")));this.setOptions(M),this.cwsIns=new CallsWebSocket({...M}),this.asyncQueue=new p}}var m=Object.defineProperty,G=(D,M,A)=>M in D?m(D,M,{enumerable:!0,configurable:!0,writable:!0,value:A}):D[M]=A,e=(D,M,A)=>G(D,typeof M!="symbol"?M+"":M,A);let g$1=class{constructor(M,A){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",N=>N),e(this,"stop",()=>{{const N=this.inputStream.getTracks();for(const O of N)O.stop(),this.inputStream.removeTrack(O)}}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(N=!0)=>{N?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",N=>{this.inputGain=N,this.inputGainNode.gain.setValueAtTime(N,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async N=>{this.enhanceGain=N+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",N=>{this.bgsGain=N,this.bgsGainNode.gain.setValueAtTime(N,this.audioContext.currentTime)}),e(this,"setBgmGain",N=>{this.bgmGain=N,this.bgmGainNode.gain.setValueAtTime(N,this.audioContext.currentTime)}),e(this,"setOutputGain",N=>{this.outputGain=N,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:N,analyserArrayData:O}=this;N.getByteFrequencyData(O);let C=0;for(let i=0;i<O.length;i++)C+=O[i];return Math.ceil(C/O.length)}),e(this,"mixAudio",(N,O="bgm")=>new Promise(async(C,i)=>{try{{const B=this.mixAudioMap.get(O);B&&B.stop()}const u=O==="bgs"?this.bgsGainNode:this.bgmGainNode,$=this.audioContext.createBufferSource();this.mixAudioMap.set(O,$),$.buffer=N,$.connect(u),$.onended=()=>{$.disconnect(u),this.mixAudioMap.delete(O),C(!0)},$.start(0)}catch(u){i(u)}})),e(this,"mixAudioStop",N=>{const O=this.mixAudioMap.get(N);O==null||O.stop()}),e(this,"changeMix",(N,O)=>{const C=N==="bgs"?this.bgsGainNode:this.bgmGainNode;O?C.connect(this.destinationNode):C.disconnect(this.destinationNode)}),A&&(this.audioContext=A),this.inputStream=M,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:N,inputGainNode:O,enhanceGainNode:C,bgsGainNode:i,bgmGainNode:u,analyserNode:$,outputGainNode:B,destinationNode:F}=this;N.connect(O),O.connect(C),C.connect($),i.connect($),u.connect($),C.connect(F),i.connect(F),u.connect(F),$.connect(B),B.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}};class RoomMedias extends RoomBase{constructor(A){super(A);_e(this,$t,[]);_e(this,We,new Map);_e(this,He,new Map);_e(this,et,new Map);_e(this,rt,new Map);_e(this,ut,new Map);ee(this,"localStreamsActionMap",new Map);_e(this,xt,new Map);ee(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));ee(this,"initMediaPhoneyStreams",(A=[])=>this.initPhoneyStreams(this.audioContext,A));ee(this,"initLocalStreamsFilter",()=>{for(const A of mediaType_keys){const N=async O=>O;fe(this,xt).set(A,N)}});ee(this,"setLocalFilterStream",(A,N)=>{fe(this,xt).set(A,N)});_e(this,Vt,()=>{fe(this,He).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),fe(this,He).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),fe(this,He).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),fe(this,He).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});_e(this,Gt,()=>{fe(this,We).set("audioinput","default"),fe(this,We).set("videoinput","default"),fe(this,We).set("audiooutput","default")});ee(this,"emitNotifyUpdateUsersStreams",async A=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:A,desc:"users streams is change."})});ee(this,"initUserMediaStreamContext",async(A,N,O,C)=>{const[i]=O.getTracks();if(O.active===!1||!i)return;C&&this.removeUserMediaStreamContext(A,N);const u=this.getUserMediaKey(A,N),{kind:$}=i;switch($){case"audio":{const B=new MediaStream;B.addTrack(i);const F=new g$1(B,this.audioContext);fe(this,et).set(u,F)}break;case"video":{const B=new VideoMediaContext(i);fe(this,rt).set(u,B)}break}});ee(this,"getUserMediaStreamContext",(A,N)=>{const O=this.getUserMediaKey(A,N);if(["microphoneCamera_audio","screenSharing_audio"].includes(N))return fe(this,et).get(O);if(["microphoneCamera_video","screenSharing_video"].includes(N))return fe(this,rt).get(O)});ee(this,"getUserAudioMediaStreamContext",(A,N)=>{const O=this.getUserMediaKey(A,N);return fe(this,et).get(O)});ee(this,"removeUserMediaStreamContext",(A,N)=>{const O=this.getUserMediaKey(A,N);if(["microphoneCamera_audio","screenSharing_audio"].includes(N)){const C=fe(this,et).get(O);return C==null||C.stop(),fe(this,et).delete(O)}if(["microphoneCamera_video","screenSharing_video"].includes(N)){const C=fe(this,rt).get(O);return C==null||C.stop(),fe(this,rt).get(O)}});ee(this,"getUserStream",(A,N)=>{const O=this.getUserMediaStreamContext(A,N);return(O==null?void 0:O.getStream())||new MediaStream});ee(this,"getUserStreams",(A,N=[])=>{N.length===0&&(N=mediaType_keys);const O={};for(const C of N){const i=this.getUserStream(A,C);O[C]=i}return O});ee(this,"removeUserStreams",async(A,N=[])=>{N.length===0&&(N=mediaType_keys);for(const O of N)this.removeUserMediaStreamContext(A,O)});ee(this,"clearUserStreams",()=>{{const A=fe(this,et).values();for(const N of A)N.stop();Be(this,et,new Map)}{const A=fe(this,rt).values();for(const N of A)N.stop();Be(this,rt,new Map)}});ee(this,"setMediaTrackConstraints",async(A,N)=>{fe(this,He).set(A,N);const O=await this.getLocalStream(A);if(!O)return;const C=O.getTracks();if(C.length!==0)for(const i of C){const u=i.getConstraints(),B={...fe(this,He).get(A),...u,...N};await i.applyConstraints(B)}});ee(this,"stopLocalStreams",async(A=[])=>{A.length===0&&(A=mediaType_keys);for(const N of A){const O=fe(this,ut).get(N);O&&await this.stopStream(O),fe(this,ut).delete(N)}});ee(this,"addLocalStream",(A,N)=>{const O=fe(this,ut).get(A);O&&this.stopStream(O),fe(this,ut).set(A,N)});ee(this,"initLocalStream",async A=>{switch(A){case"microphoneCamera_audio":{const N=fe(this,We).get("audioinput"),O=fe(this,He).get("microphoneCamera_audio"),C=await navigator.mediaDevices.getUserMedia({audio:{deviceId:N,...O},video:!1});this.addLocalStream("microphoneCamera_audio",C)}break;case"microphoneCamera_video":{const N=fe(this,We).get("videoinput"),O=fe(this,He).get("microphoneCamera_video"),C=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:N,...O}});this.addLocalStream("microphoneCamera_video",C)}break;case"microphoneCamera":{const N=fe(this,We).get("audioinput"),O=fe(this,We).get("videoinput"),C=fe(this,He).get("microphoneCamera_audio"),i=fe(this,He).get("microphoneCamera_video"),$=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:N,...C},video:{deviceId:O,...i}})).getTracks();for(const B of $){const{kind:F}=B;if(F==="audio"){const Z=new MediaStream;Z.addTrack(B),this.addLocalStream("microphoneCamera_audio",Z)}if(F==="video"){const Z=new MediaStream;Z.addTrack(B),this.addLocalStream("microphoneCamera_video",Z)}}}break;case"screenSharing_audio":{const N=fe(this,He).get("screenSharing_audio"),C=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...N})).getTracks();for(const i of C){const{kind:u}=i;if(u==="audio"){const $=new MediaStream;$.addTrack(i),this.addLocalStream("screenSharing_audio",$)}}}break;case"screenSharing_video":{const N=fe(this,He).get(A),C=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...N})).getTracks();for(const i of C){const{kind:u}=i;if(u==="video"){const $=new MediaStream;$.addTrack(i),this.addLocalStream("screenSharing_video",$)}}}break;case"screenSharing":{const N=fe(this,He).get("screenSharing_audio"),O=fe(this,He).get("screenSharing_video"),i=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...N,...O})).getTracks();for(const u of i){const{kind:$}=u;if($==="audio"){const B=new MediaStream;B.addTrack(u),this.addLocalStream("screenSharing_audio",B)}if($==="video"){const B=new MediaStream;B.addTrack(u),this.addLocalStream("screenSharing_video",B)}}}break}});ee(this,"getLocalStream",async A=>{const N=fe(this,ut).get(A),O=fe(this,xt).get(A);let C=N;return N&&O&&(C=await O(N)),C});ee(this,"getLocalStreams",async(A=[])=>{A.length===0&&(A=mediaType_keys);const N={};for(const O of A)N[O]=await this.getLocalStream(O);return N});_e(this,Et,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(A=>{const N=A.filter(O=>!["communications"].includes(O.deviceId));Be(this,$t,N.sort((O,C)=>O.label.localeCompare(C.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(A){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",A)}),fe(this,$t)));_e(this,Wt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await fe(this,Et).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),fe(this,Et).call(this)});ee(this,"getMediaDeviceKind",A=>fe(this,We).get(A));ee(this,"changeAudiooutput",async()=>{try{const A=fe(this,We).get("audiooutput");await this.audioContext.setSinkId(A)}catch(A){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",A)}});ee(this,"setDeviceKind",(A,N)=>{fe(this,We).set(A,N)});ee(this,"setAudioOutputDevice",A=>this.setDeviceKind("audiooutput",A));ee(this,"getEnumerateDevices",async A=>(await fe(this,Et).call(this),fe(this,$t).filter(O=>O.kind===A)));ee(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));ee(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));ee(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));fe(this,Wt).call(this),fe(this,Gt).call(this),fe(this,Vt).call(this),document.addEventListener("click",()=>{var N;((N=this.audioContext)==null?void 0:N.state)==="suspended"&&this.audioContext.resume()})}}$t=new WeakMap,We=new WeakMap,He=new WeakMap,et=new WeakMap,rt=new WeakMap,ut=new WeakMap,xt=new WeakMap,Vt=new WeakMap,Gt=new WeakMap,Et=new WeakMap,Wt=new WeakMap;const getNetworkQuality=(D,M,A)=>{const N=Number(D),O=Number(M),C=Number(A);let i=0;return N<.03&&O<100&&C<.05?i=5:N<.06&&O<160&&C<.1?i=4:N<.1&&O<250&&C<.15?i=3:N<.15&&O<400&&C<.2?i=2:i=1,Number(i)};class PeerAnalyzeStats{constructor(){ee(this,"pc");ee(this,"network",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0});ee(this,"reports",[]);ee(this,"averageQualitys",[]);ee(this,"timer",0);ee(this,"onNetwork",M=>{});ee(this,"getNetwork",()=>this.network);ee(this,"getAverageQuality",()=>this.network.averageQuality);ee(this,"start",M=>{this.stop(),this.network={inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0},this.reports=[],this.averageQualitys=[],this.pc=M,clearInterval(this.timer);const A=async()=>{var N;((N=this.pc)==null?void 0:N.connectionState)==="connected"&&this.analyzeStats()};this.timer=window.setInterval(A,1*1e3)});ee(this,"analyzeStats",async()=>{try{if(!this.pc)return;const M=await this.pc.getStats(),A=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],O=[...M.values()].filter(re=>A.includes(re.type));let C=0,i=0,u=0,$=0,B=0,F=0,Z=[],K=[];for(const re of this.reports){const{packetsSent:le,packetsLost:ce}=re;le&&(u+=le),ce&&($+=ce)}this.reports=O;for(const re of this.reports){const{bytesSent:le,bytesReceived:ce,packetsSent:de,packetsLost:me,roundTripTime:ie,jitter:he}=re;le&&(i=le),ce&&(C=ce),de&&(B+=de),me&&(F+=me),ie&&Z.push((ie*100).toFixed(2)),he&&K.push(he.toFixed(2))}K.sort().reverse(),Z.sort().reverse();const J=B-u,Y=F-$,ae=J===0?"0.00":Math.max(0,Y/J).toFixed(2),[oe="0"]=Z,[ne="0"]=K,ue=getNetworkQuality(ae,oe,ne);this.averageQualitys.unshift(ue),this.averageQualitys=this.averageQualitys.slice(0,10);const ye=this.averageQualitys.length===10?Math.round(this.averageQualitys.reduce((re,le)=>re+le)/this.averageQualitys.length):0,te={outboundBytes:i,inboundBytes:C,lostRate:ae,roundTripTime:oe,jitter:ne,quality:ue,averageQuality:ye};this.network=te,this.onNetwork(this.network)}catch(M){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: analyzeStats is err.",M)}});ee(this,"getReports",async(M=[])=>M.length===0?this.reports:this.reports.filter(A=>M.includes(A.mid)));ee(this,"stop",()=>{clearInterval(this.timer)})}}class P2P{constructor(M){ee(this,"prResolves",new PrResolves);ee(this,"phoneyStreams",new Map);ee(this,"recv_peer_ins");ee(this,"recv_icecandidates",[]);ee(this,"recv_candidate_collected",!1);ee(this,"recv_transceiverMap",new Map);ee(this,"recvPeerAnalyzeStatsIns",new PeerAnalyzeStats);ee(this,"send_peer_ins");ee(this,"send_icecandidates",[]);ee(this,"send_candidate_collected",!1);ee(this,"send_transceiverMap",new Map);ee(this,"sendPeerAnalyzeStatsIns",new PeerAnalyzeStats);ee(this,"tracks",[]);ee(this,"reports",[]);ee(this,"getPeerStatsTimer",0);ee(this,"onSendPeerNetwork",M=>{});ee(this,"onRecvPeerNetwork",M=>{});ee(this,"getPhoneyStreams",M=>this.phoneyStreams.get(M));ee(this,"sendIceConnected",()=>{const M=()=>this.send_peer_ins.iceConnectionState==="connected";return this.prResolves.add("sendIceConnected",M)});ee(this,"recvIceConnected",()=>{const M=()=>this.recv_peer_ins.iceConnectionState==="connected";return this.prResolves.add("recvIceConnected",M)});ee(this,"sendCandidateCollected",()=>{const M=()=>this.send_candidate_collected;return this.prResolves.add("sendCandidateCollected",M)});ee(this,"recvCandidateCollected",()=>{const M=()=>this.recv_candidate_collected;return this.prResolves.add("recvCandidateCollected",M)});ee(this,"getSendIcecandidates",async()=>(await this.sendCandidateCollected(),this.send_icecandidates));ee(this,"getRecvIcecandidates",async()=>(await this.recvCandidateCollected(),this.recv_icecandidates));ee(this,"setOffered",()=>{const M=()=>{var A;return(A=this.send_peer_ins)==null?void 0:A.remoteDescription};return this.prResolves.add("setOffered",M)});ee(this,"initSenderPc",async()=>{var N;await this.clearSenderPc(),this.send_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]});const M=O=>{O.candidate?this.send_icecandidates.push(O.candidate):(this.send_candidate_collected=!0,this.prResolves.emit("sendCandidateCollected"))};this.send_peer_ins.addEventListener("icecandidate",M);const A=O=>{const C=O.target.connectionState;switch(C){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: send_peer_ins: ${C}`),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: ${C}`),this.send_peer_ins.removeEventListener("icecandidate",M),this.send_peer_ins.removeEventListener("connectionstatechange",A);break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: send_peer_ins: ${C}`);break}};this.send_peer_ins.addEventListener("connectionstatechange",A),(N=this.sendPeerAnalyzeStatsIns)==null||N.start(this.send_peer_ins)});ee(this,"clearSenderPc",async()=>{this.sendPeerAnalyzeStatsIns.stop(),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)});ee(this,"initRecvPc",async()=>{var N;await this.clearRecvPc(),this.recv_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]});const M=O=>{O.candidate?this.recv_icecandidates.push(O.candidate):(this.recv_candidate_collected=!0,this.prResolves.emit("recvCandidateCollected"))};this.recv_peer_ins.addEventListener("icecandidate",M);const A=O=>{const C=O.target.connectionState;switch(C){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: recv_peer_ins: ${C}`),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: ${C}`),this.recv_peer_ins.removeEventListener("icecandidate",M),this.recv_peer_ins.removeEventListener("connectionstatechange",A);break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: recv_peer_ins: ${C}`);break}};this.recv_peer_ins.addEventListener("connectionstatechange",A),(N=this.recvPeerAnalyzeStatsIns)==null||N.start(this.recv_peer_ins)});ee(this,"clearRecvPc",async()=>{this.recvPeerAnalyzeStatsIns.stop(),this.recv_icecandidates=[],this.recv_candidate_collected=!1,this.recv_transceiverMap=new Map,this.recv_peer_ins&&this.recv_peer_ins.close()});ee(this,"initSenders",async(M=[])=>{const A=this.send_peer_ins.getTransceivers();for(const N of A){const{mid:O}=N,C=M.find($=>$.mid===O);if(!C)continue;const{type:i}=C;if(i===void 0)continue;const u=mediaType_keys[i];N.direction="sendonly",this.send_transceiverMap.set(u,N)}});ee(this,"addSenders",async(M=[])=>{const A=[];for(const N of M){if(this.send_transceiverMap.get(N))continue;const C=this.getPhoneyStreams(N),[i]=C.getTracks(),u=this.send_peer_ins.addTransceiver(i,{direction:"sendonly"});this.send_transceiverMap.set(N,u),A.push(N)}return A});ee(this,"addRecvs",async(M=[])=>{const A=[];for(const N of M)if(!this.recv_transceiverMap.get(N))switch(N){case"microphoneCamera_audio":case"screenSharing_audio":{const C=this.recv_peer_ins.addTransceiver("audio",{direction:"recvonly"});this.recv_transceiverMap.set(N,C),A.push(N)}break;case"microphoneCamera_video":case"screenSharing_video":{const C=this.recv_peer_ins.addTransceiver("video",{direction:"recvonly"});this.recv_transceiverMap.set(N,C),A.push(N)}break}return A});ee(this,"getSenderTracks",async(M=[])=>{const A=[];for(const N of M){const O=this.send_transceiverMap.get(N);if(!O)continue;const{mid:C,sender:i}=O,{track:u}=i;if(!u)continue;const{id:$,enabled:B}=u,F=mediaType_keys.findIndex(J=>J===N),Z=wt(),K={type:F,enabled:B,trackName:`web-${F}-${$}`,location:"local",mid:C,key:Z,origin:"p2p",mediaType:N};A.push(K)}return A});ee(this,"getRecvTracks",async(M=[])=>{const A=[];for(const N of M){const O=this.recv_transceiverMap.get(N);if(!O)continue;const{mid:C,receiver:i}=O,{track:u}=i;if(!u)continue;const{id:$,enabled:B}=u,F=mediaType_keys.findIndex(J=>J===N),Z=wt(),K={type:F,enabled:B,trackName:`web-${F}-${$}`,location:"local",mid:C,key:Z};A.push(K)}return A});ee(this,"createOffer",()=>new Promise(async(M,A)=>{try{const N=await this.recv_peer_ins.createOffer();await this.recv_peer_ins.setLocalDescription(N),M(N)}catch(N){A(N)}}));ee(this,"setOffer",async M=>{await this.send_peer_ins.setRemoteDescription(M),await this.prResolves.emit("setOffered")});ee(this,"createAnswer",()=>new Promise(async M=>{const A=await this.send_peer_ins.createAnswer();await this.send_peer_ins.setLocalDescription(A),M(A)}));ee(this,"addCandidates",async M=>{await this.setOffered();for(const A of M)await this.send_peer_ins.addIceCandidate(A)});ee(this,"setAnswer",async(M,A)=>{await this.recv_peer_ins.setRemoteDescription(M);for(const N of A)await this.recv_peer_ins.addIceCandidate(N)});ee(this,"getTrack",M=>{var N;const A=this.recv_transceiverMap.get(M);return(N=A==null?void 0:A.receiver)==null?void 0:N.track});ee(this,"getSendPeerNetwork",()=>this.sendPeerAnalyzeStatsIns.getNetwork());ee(this,"getRecvPeerNetwork",()=>this.recvPeerAnalyzeStatsIns.getNetwork());this.phoneyStreams=M}}class RoomUsers extends RoomMedias{constructor(A){super(A);ee(this,"getP2PIns",async A=>this.p2pMap.get(A));ee(this,"getMaxVolumeUser",()=>{const A=Array.from(this.userMap.values(),({id:O})=>O);if(A.length===0)return;let N=[];for(const O of A){const C=this.getUserAudioMediaStreamContext(O,"microphoneCamera_audio");if(!C)continue;const i=C.getVolume();N.push({id:O,volume:i})}return N=N.sort((O,C)=>O.volume-C.volume>0?-1:1),N[0]});ee(this,"setVolume",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);C==null||C.setInputGain(O)});ee(this,"setEnhanceGain",async(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);C==null||C.setEnhanceGain(O)});ee(this,"setSpeaker",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);C==null||C.setOutputGain(O);const i=O===0;try{C==null||C.setMute(i)}catch{}});ee(this,"playBgs",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);return C==null?void 0:C.mixAudio(O,"bgs")});ee(this,"setBgsGain",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);C==null||C.setBgsGain(O)});ee(this,"stopBgs",(A,N)=>{const O=this.getUserAudioMediaStreamContext(A,N);O==null||O.mixAudioStop("bgs")});ee(this,"playBgm",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);return C==null?void 0:C.mixAudio(O,"bgm")});ee(this,"setBgmGain",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);C==null||C.setBgmGain(O)});ee(this,"stopBgm",(A,N)=>{const O=this.getUserAudioMediaStreamContext(A,N);O==null||O.mixAudioStop("bgm")});ee(this,"changBgsMix",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);C==null||C.changeMix("bgs",O)});ee(this,"changBgmMix",(A,N,O)=>{const C=this.getUserAudioMediaStreamContext(A,N);C==null||C.changeMix("bgm",O)});ee(this,"getVolume",(A,N)=>{const O=this.getUserAudioMediaStreamContext(A,N);return O==null?void 0:O.getVolume()});ee(this,"clearUsers",()=>{this.userMap=new Map});ee(this,"removeUsers",async A=>{for(const N of A)this.userMap.delete(N),await this.removeUserStreams(N)});ee(this,"createUser",async A=>{const N=Date.now(),O=this.getOptions(),C={id:A,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:A===O.userId,isPublished:!1,useP2P:!1,joinTime:N,updateAt:N,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(A,C);{const i=new P2P(this.phoneyStreams);this.p2pMap.set(A,i)}});ee(this,"getUser",async A=>(this.userMap.has(A)||await this.createUser(A),this.userMap.get(A)));ee(this,"getUsers",async(A=[])=>{A.length===0&&(A=[...this.userMap.keys()]);const N=[];for(const O of A){const C=await this.getUser(O);N.push(C)}return N});ee(this,"getAllUserTrackMids",async()=>{const A=await this.getUsers(),N=[];for(const O of A){const{tracks:C=[]}=O;for(const i of C)N.push(i.mid)}return N});ee(this,"getUserTrackByTrackName",async A=>{const N=await this.getUsers(),O=[];for(const C of N){const{tracks:i=[]}=C;for(const u of i){const{trackName:$}=u;A.includes($)&&O.push(u)}}return O});ee(this,"getUserTrackByMid",async A=>{const N=await this.getUsers();let O;for(const C of N){const{tracks:i=[]}=C;for(const u of i)if(u.mid===A){O=u;break}}return O});ee(this,"getUsersMediaTypeBytrackNames",async A=>{if(A.length===0)return[];const N=[],O=await this.getUsers();for(const C of O){const{id:i,tracks:u=[]}=C,$=[];for(const F of u){const{trackName:Z,mediaType:K}=F;!A.includes(Z)||!K||$.push(K)}if($.length===0)continue;const B={userId:i,mediaTypes:$};N.push(B)}return N});ee(this,"getUserTrackByUserMediaTypes",async(A=[],N)=>{const O=[],C=await this.getUsers();for(const i of C){const{id:u,tracks:$=[]}=i;let B=[];const F=A.find(Z=>Z.userId===u);if(F&&(B=$.filter(Z=>F.mediaTypes.includes(Z.mediaType)),B.length!==0)){if(N!==void 0)for(const Z of B)Z.lastRetry=N;O.push({id:u,tracks:B})}}return O});ee(this,"getAllUserMediaTypes",async()=>{const A=[],N=await this.getUsers();for(const O of N){const{id:C,tracks:i=[],isSelf:u}=O;if(u)continue;const $=Array.from(i,B=>B.mediaType);A.push({userId:C,mediaTypes:$})}return A});ee(this,"checkUserInRoom",A=>this.userMap.has(A));ee(this,"getUsersId",async()=>[...this.userMap.keys()]);ee(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));ee(this,"updateIsPublished",async(A,N=!1)=>{const O=await this.getUser(A);O.isPublished=N});ee(this,"setUserUpdateStreams",async(A,N,O=!0)=>{const C=await this.getUser(A),i={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};i[N]=O,C.updateStreams=i});ee(this,"updateUsertracks",async(A,N=[],O)=>{const C=await this.getUser(A);O&&(N=[...C.tracks,...N]),N=N.filter(({mid:$=""})=>$!==""),N=pt(N,["type"]),N=N.sort(($,B)=>$.type-B.type<0?-1:1);for(const $ of N)$.userId=A,$.mediaType=mediaType_keys[$.type],$.enabled===void 0&&($.enabled=!0),$.origin===void 0&&($.origin="sfu");C.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const i=dt(C.tracks,["mediaType","enabled","mid","msid","trackName","key"]),u=dt(N,["mediaType","enabled","mid","msid","trackName","key"]);for(const $ of mediaType_keys){const B=u.find(K=>K.mediaType===$),F=i.find(K=>K.mediaType===$),Z=JSON.stringify(B)!==JSON.stringify(F);C.updateStreams[$]=Z}C.tracks=N});ee(this,"updateUserCallAction",async(A,N=0)=>{const O=await this.getUser(A);O.callAction=N,O.callActionStr=N.toString(2).padStart(4,"0"),O.callActionMap=this.getCallActionMap(N)});ee(this,"updateUserBehaviors",async(A,N=0)=>{const O=await this.getUser(A);O.banBehavior=N,O.banBehaviorStr=N.toString(2).padStart(4,"0"),O.banBehaviorMap=this.getBanBehaviorMap(N)});ee(this,"updateUserNetwork",async(A,N={egress:5,ingress:5})=>{const O=await this.getUser(A);O.network=N});ee(this,"updateUserPermissions",async(A,N)=>{if(N){const O=await this.getUser(A);O.permissions=N}});ee(this,"updateUserUseP2P",async(A,N)=>{const O=await this.getUser(A);O.useP2P=N});ee(this,"updateUserBase",async A=>{const N=this.getOptions(),O=await this.getUser(A);O.isSelf=A===N.userId,O.updateAt=Date.now()});ee(this,"updateUsers",async A=>{for(const N of A){const{id:O,tracks:C,callAction:i,permissions:u,isPublished:$,useP2P:B}=N;await this.updateUserBase(O),await this.updateIsPublished(O,$),await this.updateUserPermissions(O,u),await this.updateUsertracks(O,C,!0),await this.updateUserCallAction(O,i),await this.updateUserNetwork(O),await this.updateUserUseP2P(O,B)}});ee(this,"emitNotifyUpdateUser",async A=>{const N=await this.getUsers([A]),[O]=this.usersFilter(N);this.cwsIns.emitNotify("onRoomUser",{code:200,data:O,desc:"user info is change."})});ee(this,"emitNotifyUpdateUsers",async()=>{const A=await this.getUsers(),N=this.usersFilter(A);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:N,desc:"all users info is change."})})}}class RoomPeer extends RoomUsers{constructor(A){super(A);_e(this,ft,0);ee(this,"peerAnalyzeStatsIns",new PeerAnalyzeStats);ee(this,"offset_inboundBytes",0);ee(this,"offset_outboundBytes",0);ee(this,"saveBoundBytes",A=>{var O;const N=(O=this.peerAnalyzeStatsIns)==null?void 0:O.getNetwork();N&&(A==="superfluous"&&(this.offset_inboundBytes=-N.inboundBytes,this.offset_outboundBytes=-N.outboundBytes),A==="missing"&&(this.offset_inboundBytes=this.offset_inboundBytes+N.inboundBytes,this.offset_outboundBytes=this.offset_outboundBytes+N.outboundBytes))});ee(this,"getTrafficUse",()=>{const{sfuPush:A,sfuPull:N,p2pPush:O,p2pPull:C}=this;return{sfuPush:A,sfuPull:N,p2pPush:O,p2pPull:C}});ee(this,"initPeer",()=>{var A;clearTimeout(fe(this,ft)),this.saveBoundBytes("missing"),this.transceiverMap=new Map,(A=this.peerIns)==null||A.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),fe(this,Kt).call(this),this.initMediaPhoneyStreams(),this.startGetPeerStats()});ee(this,"replaceSenderStream",async(A=[],N)=>{const O=this.getOptions(),{userId:C}=O;A.length===0&&(A=mediaType_keys);for(const i of A){const u=this.transceiverMap.get(i);let $;if(u){const{sender:B}=u;N?$=this.getUserStream(C,i):$=this.getPhoneyStreams(i);const[F]=$.getTracks();await B.replaceTrack(F)}}});ee(this,"getSenderTracks",async(A=[])=>{const N=[];for(const O of A){const C=this.transceiverTrackMap.get(O);C&&N.push(C)}return N});ee(this,"addSenders",async(A=[])=>{A.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const N=[];for(const O of A){if(this.transceiverMap.get(O))continue;const i=this.getPhoneyStreams(O),[u]=i.getTracks(),$=this.peerIns.addTransceiver(u,{direction:"sendonly"});this.transceiverMap.set(O,$),N.push(O)}if(A.length===0||N.length!==0){const O=await this.peerIns.createOffer();if(this.options.debug){const C=libExports$1.parse(O.sdp),i=dt(C.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:i,sdpJson:C,description:O})}await this.peerIns.setLocalDescription(O);for(const C of A){const i=this.transceiverMap.get(C);if(!i)continue;const{mid:u,sender:$}=i,{track:B}=$;if(!B)continue;const{enabled:F}=B,Z=mediaType_keys.findIndex(Y=>Y===C),K=`WEB-${Z}-${wt()}`,J={type:Z,mediaType:C,enabled:F,trackName:K,location:"local",mid:u,key:"",origin:"sfu"};this.transceiverTrackMap.set(C,J)}}return N});ee(this,"removeSenders",async(A=[])=>{A.length===0&&(A=mediaType_keys);for(const N of A)this.transceiverMap.has(N)&&(this.transceiverMap.delete(N),this.transceiverTrackMap.delete(N))});ee(this,"stopSenders",(A=[])=>{var N;A.length===0&&(A=mediaType_keys);for(const O of A){if(!this.transceiverMap.has(O))continue;const C=this.transceiverMap.get(O);(N=C==null?void 0:C.sender.track)==null||N.stop(),C==null||C.stop()}});_e(this,Kt,()=>{const A=()=>{clearTimeout(fe(this,ft)),this.setIceState("failed")};this.peerIns.onconnectionstatechange=async N=>{const O=N.target.connectionState;switch(O){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${O}`),clearTimeout(fe(this,ft)),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:${O}`),this.setIceState("disconnected"),Be(this,ft,window.setTimeout(A,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:${O}`),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:${O}`),clearTimeout(fe(this,ft)),this.setIceState("closed");break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`);break}}});ee(this,"iceConnected",()=>{const A=()=>this.peerIns.connectionState==="connected";return this.prResolves.add("iceConnected",A)});ee(this,"stopTransceivers",async A=>{const N=this.peerIns.getTransceivers();for(const O of N){const{mid:C}=O;C&&A.includes(C)&&(O.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver: ${C} is stop.`,O))}});ee(this,"createOffer",async()=>{const A=await this.peerIns.createOffer();if(this.options.debug){const N=libExports$1.parse(A.sdp),O=dt(N.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:O,sdpJson:N,description:A})}await this.peerIns.setLocalDescription(A)});ee(this,"createAnswer",async()=>{const A=await this.peerIns.createAnswer();if(this.options.debug){const N=libExports$1.parse(A.sdp),O=dt(N.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:O,sdpJson:N,description:A})}await this.peerIns.setLocalDescription(A)});ee(this,"getSdp",()=>{var A;return(A=this.peerIns.localDescription)==null?void 0:A.sdp});ee(this,"setRemoteDescription",async A=>{if(this.options.debug){const N=libExports$1.parse(A.sdp),O=dt(N.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:O,sdpJson:N,description:A})}return await this.peerIns.setRemoteDescription(A),A});ee(this,"setCallStrategy",async(A,N=[])=>{N.length===0&&(N=mediaType_keys);let O="balanced";switch(A){case"qualityPriority":O="maintain-resolution";break;case"fluencyPriority":O="maintain-framerate";break;case"balancedDowngrade":O="balanced";break}const C=await this.getSelfInfo(),i=Array.from(C.tracks,({trackName:$})=>$),u=this.peerIns.getSenders();for(const $ of u){const{track:B}=$;if(!B||!i.includes(B.id))continue;const F=$.getParameters();$.setParameters({...F,degradationPreference:O})}});ee(this,"setRTCRtpSenderParameters",A=>{try{const N=this.peerIns.getSenders();for(const O of N){const C=O.getParameters();O.setParameters({...C,...A})}}catch(N){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",N)}});ee(this,"getPeerNetwork",()=>{var O;const A=(O=this.peerAnalyzeStatsIns)==null?void 0:O.getNetwork();return JSON.parse(JSON.stringify(A))});ee(this,"getRoomNetwork",()=>{var O;const A=(O=this.peerAnalyzeStatsIns)==null?void 0:O.getNetwork(),N=JSON.parse(JSON.stringify(A));return N.inboundBytes=Math.max(0,N.inboundBytes+this.offset_inboundBytes),N.outboundBytes=Math.max(0,N.outboundBytes+this.offset_outboundBytes),N});_e(this,Qt,()=>{const A=this.getRoomNetwork();{const{outboundBytes:N,inboundBytes:O}=A;this.sfuPush=Math.ceil(N/1024),this.sfuPull=Math.ceil(O/1024)}this.cwsIns.emitNotify("onRoomNetwork",{code:200,data:A,desc:"room network is change."})});_e(this,Yt,async A=>{try{const{quality:N}=A;N>=2&&this.prResolves.emit("senderActived"),fe(this,Qt).call(this);const O=await this.getSelfInfo(),{network:C}=O,i={egress:N,ingress:N};Ct("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,i),JSON.stringify(C)!==JSON.stringify(i)){this.emitNotifyUpdateUsers();const B=this.getOptions(),{userId:F,roomId:Z}=B,K={...i,userId:F,roomId:Z};this.cwsIns.sendMessage({event:"networkQualityChange",data:K},!1)}},3*1e3)}catch(N){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",N)}});ee(this,"getReportsByMid",async(A=[])=>{var O;return(O=this.peerAnalyzeStatsIns)==null?void 0:O.getReports(A)});ee(this,"startGetPeerStats",()=>{this.peerAnalyzeStatsIns.start(this.peerIns);const A=[...this.p2pMap.values()];for(const N of A)N.sendPeerAnalyzeStatsIns.start(N.send_peer_ins),N.recvPeerAnalyzeStatsIns.start(N.recv_peer_ins)});ee(this,"stopGetPeerStats",()=>{this.peerAnalyzeStatsIns.stop();const A=[...this.p2pMap.values()];for(const N of A)N.sendPeerAnalyzeStatsIns.stop(),N.recvPeerAnalyzeStatsIns.stop()});this.initPeer(),this.peerAnalyzeStatsIns.onNetwork=fe(this,Yt)}}ft=new WeakMap,Kt=new WeakMap,Qt=new WeakMap,Yt=new WeakMap;const g=(D,M)=>{if(!(D!=null&&D.ip)||!(D!=null&&D.port)||!(D!=null&&D.serve_ip)||!(D!=null&&D.serve_port)||!(M!=null&&M.ip)||!(M!=null&&M.port)||!(M!=null&&M.serve_ip)||!(M!=null&&M.serve_port))return"Unknown";const[A,N]=[D.ip,D.port],[O,C]=[D.serve_ip,D.serve_port],[i,u]=[M.ip,M.port],[$,B]=[M.serve_ip,M.serve_port];return A===i&&N===u?"Full Cone":A===O&&(i!==O||u!==N)||i===$&&(A!==$||N!==u)?"Restricted Cone":A===O&&N===C&&(i!==O||u!==C)||i===$&&u===B&&(A!==$||N!==B)?"Port Restricted Cone":"Symmetric"},h=async()=>{const D="stun.cloudflare.com:3478",M="stun.l.google.com:19302",A=async N=>new Promise(O=>{const C=new RTCPeerConnection({iceServers:[{urls:`stun:${N}`}]});C.createDataChannel("ice-channel");let i=null;C.onicecandidate=u=>{var $,B;if((($=u.candidate)==null?void 0:$.type)==="srflx"){const[F,Z]=N.split(":").map(K=>K.trim());i={ip:u.candidate.address||"",port:(B=u.candidate.port)==null?void 0:B.toString(),serve_ip:F,serve_port:Z},C.close(),O(i)}},setTimeout(()=>{C.close(),O(null)},5e3),C.createOffer().then(u=>C.setLocalDescription(u)).catch(()=>O(null))});try{const N=await A(D),O=await A(M);if(!N||!O)return{address:"",natType:"Unknown"};const C=g(N,O);return{address:N.ip||"",natType:C}}catch(N){return console.error("获取NAT类型失败:",N),{address:"",natType:"Unknown"}}};class RoomCalls extends RoomPeer{constructor(A){super(A);_e(this,Ut,0);_e(this,Ot);ee(this,"setLocalStream",(A,N)=>new Promise(async(O,C)=>{try{const i=[];typeof A=="string"?i.push(A):i.push(...A);for(const $ of i)this.localStreamsActionMap.set($,N);if(N){if(A.includes("microphoneCamera_audio")&&A.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):A.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):A.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):A.includes("screenSharing_audio")&&A.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):A.includes("screenSharing_audio")&&!A.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):A.includes("screenSharing_video")&&!A.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),A.includes("screenSharing_audio")){const $=await this.getLocalStream("screenSharing_audio");if($){const B=$.getTracks();for(const F of B)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(A.includes("screenSharing_video")){const $=await this.getLocalStream("screenSharing_video");if($){const B=$.getTracks();for(const F of B)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(i);const u=await this.getLocalStreams(i);if(await this.cwsIns.emitNotify("onLocalStream",{code:200,data:u,desc:"local stream is change."}),this.isInRoom){const $=()=>new Promise(async B=>{const F=this.getOptions(),{userId:Z}=F,K={};for(const J of i){const Y=await this.getLocalStream(J);Y&&(K[J]=wt(),await this.initUserMediaStreamContext(Z,J,Y,!1))}await this.replaceSenderStream(i,N),await this.emitNotifyUpdateUsersStreams([{userId:Z,updateStreams:K}]),B(!0)});this.asyncQueue.add($,{describe:"setLocalStream"})}O(u)}catch(i){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",i),C(i)}}));ee(this,"setMediaDeviceKind",(A,N)=>{const O=()=>new Promise(async(C,i)=>{this.setDeviceKind(A,N);const u=await this.getSelfInfo(),{id:$,tracks:B=[],callActionMap:F}=u,Z=[],K=async J=>{const Y=this.localStreamsActionMap.get(J),ae=B.find(ne=>ne.mediaType===J),oe=F[J];if(Y){Z.push(J),await this.stopLocalStreams([J]);try{await this.initLocalStream(J)}catch(ne){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",ne),await this.inactiveTracks([J],!1),i(ne)}}if(ae){const ne=await this.getLocalStream(J);if(ne&&(await this.initUserMediaStreamContext($,J,ne,!0),oe)){await this.replaceSenderStream([J],!0);const ue=await this.getUsersId();await this.p2p.replaceSenderStreams(ue,Z,!0)}}{if(Z.length!==0){const ne=await this.getLocalStreams(Z);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:ne,desc:"local stream is change."});const ue=this.createUserUpdateStreams(Z);await this.emitNotifyUpdateUsersStreams([{userId:this.options.userId,updateStreams:ue}]),await this.emitNotifyUpdateUsers()}C(!0)}};A==="audioinput"&&await K("microphoneCamera_audio"),A==="videoinput"&&await K("microphoneCamera_video"),A==="audiooutput"&&(await this.changeAudiooutput(),C(!0))});return this.asyncQueue.add(O,{describe:"publish"})});ee(this,"changeScreenSharing",async A=>{const N=await this.getSelfInfo(),{tracks:O=[],callActionMap:C}=N;try{await this.setLocalStream(A,!0);for(const i of A)O.find($=>$.mediaType===i&&C[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",(A=[])=>new Promise(async(N,O)=>{try{this.isEarly=!0,await fe(this,Ft).call(this),await fe(this,It).call(this),A.length===0&&(A=["microphoneCamera_audio","microphoneCamera_video"]),await fe(this,jt).call(this,A),N(!0)}catch(C){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",C),O(C)}}));ee(this,"joinRoom",async A=>(this.isInRoom=!0,this.setOptions(A),await fe(this,Ft).call(this),await this.cwsConnected(),new Promise(async(N,O)=>{Be(this,Ot,async()=>{try{const{userId:C,callType:i,sdkToken:u,roomId:$}=this.getOptions();this.clearUsers(),await this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:i,roomId:$,user:{id:C,tracks:[],callAction:0},token:u},version:2}).then(async B=>{const{code:F=0,desc:Z="服务器繁忙",data:K}=B;if(F!==200)throw new Error(Z);const{roomId:J="",roomUsers:Y=[]}=K;if(J!==$)return O("加入的房间不匹配");this.sfuPush=0,this.sfuPull=0,this.p2pPush=0,this.p2pPull=0,this.saveBoundBytes("superfluous"),this.initHeartbeat(),this.startGetPeerStats(),this.isEarly===!1&&await fe(this,It).call(this),await this.updateUsers(Y);for(const oe of Y){const{id:ne}=oe;await this.updateUserBehaviors(ne,oe.behavior)}await this.emitNotifyUpdateUsers();const ae=await this.getUsers();N(ae)})}catch(C){O(C)}}),fe(this,Ot).call(this)})));ee(this,"quitRoom",()=>new Promise(async A=>{const N=this.getOptions(),{roomId:O,userId:C}=N;try{if(this.isInRoom===!1)return A(!0);const i=async $=>{var Z;clearTimeout($),this.isInRoom=!1,this.stopHeartbeat(),this.transceiverMap=new Map,(Z=this.peerAnalyzeStatsIns)==null||Z.stop();const B=()=>this.stopSubscribe(),F=()=>this.cwsIns.sendMessage({event:"quitRoom",data:{roomId:O,user:{id:C}}});Promise.all([B(),F()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.clearUsers(),this.setRoomState("ready")},u=window.setTimeout(()=>i(u),2*1e3);try{await this.stopPublish(),i(u)}catch{}A(!0)}catch(i){this.reportLogs("quit_room_error",i.message||i)}}));ee(this,"quitRoomEx",()=>new Promise(async A=>{const N=this.getOptions(),{roomId:O,userId:C}=N;try{if(this.isInRoom===!1)return A(!0);const i=async $=>{var Z;clearTimeout($),this.isInRoom=!1,this.initHeartbeat(),(Z=this.peerAnalyzeStatsIns)==null||Z.stop();const B=()=>this.stopSubscribe(),F=()=>this.cwsIns.sendMessage({event:"quitRoomEx",data:{roomId:O,user:{id:C}}});Promise.all([B(),F()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.clearUsers()},u=window.setTimeout(()=>i(u),2*1e3);try{await this.stopLocalStreams(),i(u)}catch{this.restoreICE()}A(!0)}catch(i){this.reportLogs("quit_room_error",i.message||i)}}));ee(this,"syncRoomInfo",()=>new Promise(async(A,N)=>{try{const O=this.getOptions(),{userId:C}=O,i=await this.getUser(C),{id:u=C,callAction:$=0}=i;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:u,callAction:$}}}).then(async B=>{const{code:F=0,desc:Z,data:K={}}=B;if(F!==200)throw new Error(Z);const{isActive:J=!1,users:Y=[]}=K;if(J===!1)throw new Error("Do not stay in this room.");if(Y.find(oe=>oe.id===C)===!1)throw new Error("Need to rejoin the room.");this.clearUsers(),await this.updateUsers(Y),await this.updateUsertracks(i.id,i.tracks,!1);{const oe=await this.getUsers();A(oe)}})}catch(O){N(O)}}));ee(this,"checkInRoom",()=>new Promise(async A=>{const N=this.getOptions(),{userId:O}=N,C=await this.getUser(O),{id:i=O,callAction:u=0}=C;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:u}}}).then(async $=>{var J;const{code:B=0,desc:F}=$;if(B!==200)throw new Error(F);const Z=$.data.users;return(J=$.data)!=null&&J.isActive||Z.find(Y=>Y.id===O)?A(!0):A(!1)}).catch(()=>A(!1))}));ee(this,"senderActived",async A=>{const N=()=>{var C;const{quality:O}=(C=this.peerAnalyzeStatsIns)==null?void 0:C.getNetwork();return O>=2};await this.prResolves.add("senderActived",N,A)});ee(this,"publish",A=>new Promise(async(N,O)=>{try{{const B=await this.getSelfInfo(),{banBehaviorMap:F}=B;let Z=!0;for(const K of A)if(F[K]){Z=!1;break}if(Z===!1)return O("publish is error: prohibited by administrator.")}const C=await this.getSelfInfo();for(const B of A){const F=this.getPhoneyStreams(B);await this.initUserMediaStreamContext(C.id,B,F,!0)}await this.replaceSenderStream(A,!1),await fe(this,jt).call(this,A);const i=setTimeout(async()=>{await this.replaceSenderStream(A,!0),await this.inactiveTracks(A,!1)},5*1e3);this.setLocalStream(A,!0).then(()=>clearTimeout(i));const u=await this.getSenderTracks(A);await this.updateUsertracks(C.id,u,!0);const $=await this.getCallAction(C.tracks);await fe(this,At).call(this,$),await this.senderActived(3e3),fe(this,Xt).call(this,A);{await this.emitNotifyUpdateUsers();const B=this.createUserUpdateStreams(A);await this.emitNotifyUpdateUsersStreams([{userId:C.id,updateStreams:B}]),N(!0)}}catch(C){this.reportLogs("publish_error",C.message||C),O(C)}}));ee(this,"stopPublish",(A=[])=>new Promise(async(N,O)=>{try{const C=await this.getSelfInfo();A.length===0&&(A=mediaType_keys),await this.replaceSenderStream(A,!0),await this.removeSenders(A),await fe(this,mt).call(this,[{userId:C.id,mediaTypes:A}],!0);const i=await this.getCallAction(C.tracks);await fe(this,At).call(this,i),await this.setLocalStream(A,!1),await this.emitNotifyUpdateUsers(),N(!0)}catch(C){this.reportLogs("close_track_error",C.message||C),O(C)}}));ee(this,"inactiveTracks",async(A,N)=>new Promise(async O=>{const C=await this.getSelfInfo();if(!C||!C.id)return O(!0);const{tracks:i=[]}=C,u=[...i];for(let B of u){const{mediaType:F}=B;if(F&&A.includes(F)){B.enabled=N;const Z=await this.getLocalStream(F);if(!Z)continue;const K=Z.getTracks();for(const J of K)J.enabled=N}}await this.replaceSenderStream(A,N);const $=await this.getCallAction(u);await fe(this,At).call(this,$),await this.emitNotifyUpdateUsers(),O(!0)}));ee(this,"subscribe",(A=[])=>{const N=()=>new Promise(async(O,C)=>{try{A.length===0&&(A=await this.getAllUserMediaTypes()),await this.iceConnected();const i=(B,F=!1)=>new Promise(async Z=>{const K=async Y=>{const ae=[],oe=[],ne=[];let ue=0,ye=0;for(const te of Y){const{id:re,tracks:le=[]}=te;ue=ue+le.length;const ce=await this.getUser(re);if(!ce)continue;const de=[],me=[],ie=[];for(const he of le){const{code:ke=0,mid:be,type:we}=he,Te=ce.tracks.find(qe=>qe.type===we);if(Te)switch(ke){case 200:de.push({...Te,mid:be});break;case 2026:ie.push({...Te,mid:be});break;default:me.push({...Te});break}}de.length!==0&&(ae.push({id:re,tracks:de}),ye=ye+de.length),me.length!==0&&oe.push({id:re,tracks:me}),ie.length!==0&&ne.push({id:re,tracks:ie})}return{expectation_num:ue,success_num:ye,success_users:ae,fail_users:oe,retry_users:ne}},J=async(Y,ae="成功",oe=[])=>{const{expectation_num:ne,success_num:ue,success_users:ye,fail_users:te,retry_users:re}=await K(oe);Z({code:Y,msg:ae,expectation_num:ne,success_num:ue,success_users:ye,fail_users:te,retry_users:re})};try{const Y=await this.getUserTrackByUserMediaTypes(B,F);if(Y.length===0)return J(200,"成功",[]);const ae=await this.cwsIns.sendMessage({event:"subscribe",data:{session:this.sdk_session,users:Y}}),{code:oe=0,desc:ne,sn:ue="",data:ye={}}=ae;if(fe(this,Rt).call(this,ue),oe===2017&&ne.includes("renegotiation is expected before pulling or pushing tracks")&&await fe(this,Lt).call(this),oe===2026){const le=[];for(const ce of Y)le.push({...ce,code:2026});return await J(oe,ne,le)}if(oe!==200)return await J(oe,ne);const{remoteSdp:te,users:re=[]}=ye;if(te){const le=new RTCSessionDescription({type:"offer",sdp:te});await this.setRemoteDescription(le),await fe(this,Lt).call(this)}await J(200,"成功",re)}catch(Y){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",Y),await J(0,Y.message||Y)}}),u=(B=[])=>new Promise(F=>{this.await_remote_publish_users=B;let Z=0;for(const ne of B)Z=Z+ne.tracks.length;const K=[],J=wt(),Y=async()=>{this.cwsIns.removeNotify([J]);const ne=await i(K);this.await_remote_publish_users=[],F(ne)},ae=setTimeout(()=>Y(),30*1e3),oe=async ne=>{const{user:ue}=ne.data,{id:ye,tracks:te=[],callAction:re=0}=ue;await this.updateUserCallAction(ye,re),await this.updateUserPermissions(ye,3),await this.updateUsertracks(ye,te,!0);const le=[],ce=B.find(ie=>ie.id===ye);if(!ce)return;for(const ie of ce.tracks)for(const he of te)he.type===ie.type&&le.push(ie.mediaType);const de=[...new Set(le)];de.length!==0&&K.push({userId:ye,mediaTypes:de});let me=0;for(const ie of K)me=me+ie.mediaTypes.length;me===Z&&(clearTimeout(ae),Y())};this.cwsIns.addNotify({sn:J,event:"onPublish",callback:oe},!0)}),$=async(B=[])=>{let F=0;const Z=new Map,K=this.peerIns.getTransceivers(),J=[],Y=[];for(const oe of B){const{id:ne,tracks:ue=[]}=oe;if(this.checkUserInRoom(ne)){await this.updateUsertracks(ne,ue,!0);for(const te of ue){const{mid:re,mediaType:le}=te,ce=K.find(me=>me.mid===re);if(!ce)continue;const{receiver:de}=ce;if(de.track){{te.msid=de.track.id;const me=new MediaStream;me.addTrack(de.track),await new Promise(ke=>setTimeout(()=>ke(!0),1e3));const{current_origin:ie,suggest_origin:he}=await fe(this,zt).call(this,ne,le);if(await fe(this,Pt).call(this,ne,[le],he),["microphoneCamera_audio","screenSharing_audio"].includes(le)){const ke=new Audio;if(ke.srcObject=me,le==="microphoneCamera_audio"||le==="screenSharing_audio"){const be=this.getUserAudioMediaStreamContext(ne,le);be==null||be.setMute(!1)}}he==="p2p"&&Y.push({userId:ne,mediaTypes:[le]}),ie==="p2p"&&he==="sfu"&&(J.push(ne),this.p2p.reportP2PConnect(this.options.userId,ne,"poor_network","poor network quality."));{Z.has(ne)||Z.set(ne,{userId:ne,tracks:[],updateStreams:{}});const be=Z.get(ne);be.tracks.push(te),be.updateStreams[le]=wt()}}F=F+1}}}}const ae=[...Z.values()];return await this.emitNotifyUpdateUsersStreams(ae),J.length!==0&&this.p2p.closeRecv(J),Y.length!==0&&fe(this,mt).call(this,Y,!1),await this.emitNotifyUpdateUsers(),F};{let B=await i(A,!1),{expectation_num:F,success_num:Z,success_users:K=[],fail_users:J=[]}=B;if(K.length!==0){const Y=await $(K);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${Y}/${Z}/${F}`,{actual_num:Y,success_num:Z,expectation_num:F})}if(J.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ","The first subscription attempt failed completely. It will attempt to subscribe again in 4 seconds."),await new Promise(te=>setTimeout(()=>te(!0),4e3));const Y=[];for(const te of J){const re=Array.from(te.tracks,le=>le.mediaType);Y.push({userId:te.id,mediaTypes:re})}const ae=await i(Y,!0);let{expectation_num:oe,success_num:ne,success_users:ue=[],retry_users:ye=[]}=ae;if(ue.length!==0){const te=await $(ue);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${te}/${ne}/${oe}`,{actual_num:te,success_num:ne,expectation_num:oe})}if(ye.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;","------->quickvo: waiting for the other party to republish before subscribing.");const re=await yt(()=>u(ye),{message:"Wait for a timeout before publishing. No re-published track received from the other party within 40 seconds.",timeout:40*1e3});let{expectation_num:le,success_num:ce,success_users:de=[]}=re;if(de.length!==0){const me=await $(de);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${me}/${ce}/${le}`,{actual_num:me,success_num:ce,expectation_num:le})}}}O(!0)}}catch(i){this.reportLogs("subscribe_error",i.message||i),C(i)}});return this.asyncQueue.add(N,{describe:"subscribe"})});_e(this,Lt,()=>new Promise(async(A,N)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(async O=>{const{code:C=0,desc:i,sn:u=""}=O;if(await fe(this,Rt).call(this,u),C!==200)throw new Error(i);A(O)})}catch(O){N(O)}}));ee(this,"stopSubscribe",(A=[])=>new Promise(async(N,O)=>{try{A.length===0&&(A=await this.getAllUserMediaTypes());const C=await this.getUserTrackByUserMediaTypes(A);if(C.length===0)return N(!0);const i=[],u=[];for(const $ of C){const{id:B,tracks:F=[]}=$;for(const Z of F){const{type:K,mid:J,mediaType:Y,msid:ae,origin:oe="sfu",userId:ne}=Z;if(Y){if(oe==="sfu"){if(!ae||!J)continue;const ue={type:K,mid:J,trackName:ae,userId:ne};i.push(ue),u.push(J)}oe==="p2p"&&(await this.p2p.closeRecv([B],[Y]),Z.origin="sfu",this.p2p.reportP2PConnect(this.options.userId,B,"disconnect","p2p is close."))}}}if(i.length===0)return N(!0);await this.stopTransceivers(u),await fe(this,mt).call(this,A,!1);for(const $ of A){const{userId:B,mediaTypes:F=[]}=$,Z=await this.getUser(B);for(const K of Z.tracks)F.includes(K.mediaType)&&(K.msid="")}await this.emitNotifyUpdateUsers(),N(!0)}catch(C){this.reportLogs("close_track_error",C.message||C),O(C)}}));ee(this,"setBanBehaviors",A=>new Promise(async(N,O)=>{try{const C=this.getOptions(),{roomId:i}=C,u=[];for(const $ of A){const{id:B,banBehaviors:F}=$,Z=Object.keys(F);if(Z.length===0)continue;const K=[];for(const Y of Z){const ae=mediaType_keys.findIndex(ue=>ue===Y),oe=F[Y],ne={type:ae,behavior:oe};K.push(ne)}const J={id:B,behaviors:K};u.push(J)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:i,users:u}}).then(async $=>{const{code:B=0,desc:F}=$;if(B!==200)return O(F);N($)})}catch(C){O(C)}}));ee(this,"debugger",()=>this.cwsIns.sendMessage({event:"debugger"},!1));ee(this,"shutdown",()=>this.cwsIns.sendMessage({event:"shutdown"},!1));ee(this,"restoreRoom",async()=>{if(this.isInRoom===!1)return;await this.checkInRoom()===!1&&fe(this,Ot)&&await fe(this,Ot).call(this),this.cwsIns.afreshSends()});ee(this,"restoreICE",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: restore ice."),await this.cwsConnected(),this.initPeer(),this.isEarly?this.earlyConnect():await fe(this,It).call(this);const A=[],N=[],O=await this.getUsers();for(const C of O){const{id:i,isSelf:u,callActionMap:$,tracks:B=[]}=C;if(u){for(const Z of mediaType_keys)$[Z]&&A.push(Z);continue}const F=[];for(const Z of B)(Z.msid||Z.origin==="p2p")&&F.push(Z.mediaType);F.length!==0&&N.push({userId:i,mediaTypes:F})}await this.syncRoomInfo(),await this.publish(A),N.length!==0&&await this.subscribe(N)});ee(this,"initHeartbeat",()=>{this.stopHeartbeat();const A=async()=>{if(this.isInRoom){const O=this.getTrafficUse();this.cwsIns.sendMessage({event:"heartbeat",data:O},!1)}else this.cwsIns.sendMessage({event:"heartbeatEx",data:{}},!1)},N=this.isInRoom?10*1e3:30*1e3;Be(this,Ut,window.setInterval(A,N)),A()});ee(this,"stopHeartbeat",()=>{clearInterval(fe(this,Ut))});_e(this,Xt,async A=>new Promise(async(N,O)=>{try{const C=this.getOptions(),{roomId:i}=C;if(!i)return;const{id:u,tracks:$=[]}=await this.getSelfInfo(),B=$.filter(Z=>Z.mediaType&&A.includes(Z.mediaType));if(B.length===0)return;const F=dt(B,["type","trackName","mid"]);await this.cwsIns.sendMessage({event:"pubNotify",data:{session:this.sdk_session,roomId:i,user:{id:u,tracks:F}}}),N(!0)}catch(C){O(C)}}));_e(this,Rt,A=>new Promise(N=>{this.cwsIns.sendMessage({event:"ackMsg",data:{msgId:A}},!1),N(!0)}));_e(this,At,async A=>new Promise(async(N,O)=>{const C=this.getOptions(),{roomId:i,userId:u}=C,$={roomId:i,user:{id:u,callAction:A}};await this.cwsIns.sendMessage({event:"updateCall",data:$}).then(async B=>{const{code:F=0}=B;if(F!==200)return O(B);await this.updateUserCallAction(u,A),N(A)}).catch(B=>O(B))}));ee(this,"setSession",()=>{const A=this.getOptions(),{appid:N,roomId:O,userId:C,earlyId:i}=A;if(!N)throw new Error("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const u={c:N,r:O,p:"web",h:location.hostname,v:this.sdk_service_version};this.isEarly?u.i=i:u.b=C;const $=btoa(encodeURI(JSON.stringify(u)));this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: session",u);const B=`${this.options.url}?s=${$}&t=${Date.now()}`;this.cwsIns.prws.setOptions({url:B})});_e(this,Ft,()=>new Promise(async(A,N)=>{try{if(["connecting","connected"].includes(this.roomState))return A(!0);this.setRoomState("connecting"),this.cwsIns.clearEvents(),this.setSession(),await this.cwsIns.connect(),this.initHeartbeat(),this.setRoomState("connected"),await this.prResolves.emit("cwsConnected"),A(this.cwsIns)}catch(O){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",O),this.reportLogs("ws_c_timeout",O.message||O),N(O)}}));ee(this,"cwsConnected",()=>{const A=()=>this.roomState==="connected";return this.prResolves.add("cwsConnected",A)});_e(this,It,async()=>new Promise(async A=>{try{await this.cwsConnected(),await this.addSenders();const N=await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}),{code:O=0,desc:C,data:i}=N;if(O!==200)throw new Error(C);const{remoteSdp:u,session:$=""}=i;if(this.sdk_session=$,this.options.debug){const B=libExports$1.parse(u),F=dt(B.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:F,sdpJson:B})}await this.setRemoteDescription({type:"answer",sdp:u}),await yt(this.iceConnected,{message:"ice connect is timeout.",timeout:10*1e3}),A(!0),this.p2p.reportNetwork()}catch(N){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ice connect is error. recreate in 5 seconds.",N),await new Promise(O=>setTimeout(()=>O(!0),5*1e3)),fe(this,It).call(this)}}));_e(this,jt,async A=>{const N=()=>new Promise(async(O,C)=>{try{await this.iceConnected();const i=await this.addSenders(A),u=await this.getSenderTracks(i);if(u.length===0)return O(!0);const $=await this.cwsIns.sendMessage({event:"publish",data:{session:this.sdk_session,sdp:this.getSdp(),tracks:u,callAction:0}}),{code:B=0,desc:F,sn:Z="",data:K={}}=$;if(await fe(this,Rt).call(this,Z),B!==200)throw new Error(F);const{remoteSdp:J}=K;await this.setRemoteDescription({type:"answer",sdp:J}),O(!0)}catch(i){this.reportLogs("publish_error",i.message||i),await this.removeSenders(A),C(i)}});return this.asyncQueue.add(N,{describe:"createTrack"})});_e(this,mt,(A=[],N)=>{const O=()=>new Promise(async(C,i)=>{try{A.length===0&&(A=await this.getAllUserMediaTypes());const u=await this.getUserTrackByUserMediaTypes(A);if(u.length===0)return C(!0);const $=[];for(const B of u){const{id:F,tracks:Z=[]}=B,K=Array.from(Z,J=>J.trackName);for(const J of Z){const{type:Y,mid:ae,mediaType:oe,msid:ne,userId:ue,trackName:ye}=J;if(!oe||ae===null)continue;const te={type:Y,mid:ae,trackName:ne||ye,userId:ue};$.push(te)}{const J=await this.getUser(F);for(const Y of J.tracks)K.includes(Y.trackName)&&(Y.msid="");if(N){const Y=J.tracks.filter(ae=>!K.includes(ae.trackName));await this.updateUsertracks(J.id,Y,!1)}}}if($.length===0)return C(!0);await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:$}}).then(async B=>{const{code:F=0,desc:Z,data:K={}}=B;if(F!==200)throw new Error(Z);const{remoteSdp:J}=K;await this.setRemoteDescription({type:"answer",sdp:J})}),C(!0)}catch(u){this.reportLogs("close_track_error",u.message||u),i(u)}});return this.asyncQueue.add(O,{describe:"closeTrack"})});_e(this,Pt,async(A,N,O)=>{for(const C of N){let i;const u=await this.getUser(A),{tracks:$=[]}=u,B=$.find(Z=>Z.mediaType===C);if(!B)continue;if(O==="sfu"){const{mid:Z}=B,J=this.peerIns.getTransceivers().find(Y=>Y.mid===Z);i=J==null?void 0:J.receiver.track,B.origin="sfu"}if(O==="p2p"){const Z=await this.getP2PIns(A);i=Z==null?void 0:Z.getTrack(C),B.origin="p2p"}if(!i)continue;const F=new MediaStream;F.addTrack(i),await this.initUserMediaStreamContext(A,C,F,!1),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;","------->quickvo: switching to",O,{userId:A,mediaType:C,origin:O,stream:F})}});_e(this,zt,async(A,N)=>{var $,B;let O="sfu";const C=await this.getP2PIns(A);if(C&&(($=C==null?void 0:C.recv_peer_ins)==null?void 0:$.connectionState)==="connected"){const Z=C==null?void 0:C.recvPeerAnalyzeStatsIns.getAverageQuality();if(Z!==0){const{averageQuality:K}=this.getPeerNetwork();Z-K>=this.sfuOffsetAverageQuality&&(O="p2p")}}return{current_origin:(B=(await this.getUser(A)).tracks.find(F=>F.mediaType===N))==null?void 0:B.origin,suggest_origin:O}});_e(this,en,()=>{{const A=async N=>{let O="";const C=await this.getSelfInfo(),{code:i,data:u}=N;if(i!==200)return;const{sdp:$,sender:B={},tracks:F=[]}=u,{id:Z}=B;O=Z;{const J=await this.getUsersId();let Y=0;for(const ae of J){const oe=await this.getP2PIns(ae);oe!=null&&oe.send_peer_ins&&oe.send_peer_ins.iceConnectionState==="connected"&&(Y+=1)}if(Y>=3)return this.p2p.reportP2PConnect(O,C.id,"ignore","P2P connections have reached the maximum limit.")}const K=await this.getP2PIns(O);if(K){await K.initSenderPc(),K.sendPeerAnalyzeStatsIns.onNetwork=J=>{this.p2pPush+=Math.ceil(J.outboundBytes/1024)};try{const J=[];for(const re of F){const{type:le}=re;le!==void 0&&J.push(mediaType_keys[re.type])}const Y=new RTCSessionDescription({type:"offer",sdp:$});await K.setOffer(Y),await K.initSenders(F),await this.p2p.replaceSenderStreams([O],J,!0);const ae=await K.createAnswer();if(this.options.debug){const re=libExports$1.parse(ae.sdp),le=dt(re.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:le,sdpJson:re})}const oe=await K.getSenderTracks(J),ne=this.getOptions(),{roomId:ue}=ne,ye=()=>new Promise(async(re,le)=>{try{const ce=await this.cwsIns.sendMessage({event:"answer",data:{roomId:ue,tracks:oe,sender:{id:C.id,callAction:C.callAction,tracks:[]},receiverId:O,sdp:ae.sdp}}),{code:de=0,desc:me}=ce;if(de!==200)throw new Error(me);re(!0)}catch(ce){le(ce)}}),te=()=>new Promise(async(re,le)=>{try{const ce=await yt(K.getSendIcecandidates,{message:"await get send candidates is timeout.",timeout:1e4}),de=Array.from(ce,({sdpMid:ke,sdpMLineIndex:be,candidate:we})=>({sdpMid:ke,sdpMLineIndex:be,sdp:we})),me=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:ue,senderId:C.id,receiverId:O,candidates:de,isSubscribeReceiver:!1}}),{code:ie=0,desc:he}=me;if(ie!==200)throw new Error(he);re(!0)}catch(ce){le(ce)}});await ye(),await te(),await yt(K.sendIceConnected,{message:"await send ice connect is timeout.",timeout:1e4})}catch{}}};this.cwsIns.addNotify({event:"onOffer",callback:A},!0)}{const A=async N=>{const{code:O,data:C}=N;if(O!==200)return;const{senderId:i,candidates:u=[],receiverId:$,isSubscribeReceiver:B=!1}=C,F=this.getOptions(),{userId:Z}=F;if(B===!1||$!==Z)return;const K=await this.getP2PIns(i);if(!K)return;const J=Array.from(u,({sdpMid:Y,sdpMLineIndex:ae,sdp:oe})=>({sdpMid:Y,sdpMLineIndex:ae,candidate:oe}));await K.addCandidates(J)};this.cwsIns.addNotify({event:"onCandidate",callback:A},!0)}});ee(this,"p2p",{open:(A,N=["microphoneCamera_video"])=>new Promise(async(O,C)=>{const i=this.getOptions(),{roomId:u,userId:$}=i,B=await this.getSelfInfo(),F=wt(),Z=new Date().getTime();let K=!1;try{const J=await this.getP2PIns(A);if(!J)return C("illegal user object.");{const ue=await this.getUser(A),{tracks:ye=[]}=ue;let te=!0;for(const re of N)ye.find(ce=>ce.mediaType===re&&ce.msid||ce.origin==="p2p")||(te=!1);if(te===!1)return this.p2p.reportP2PConnect($,A,"ignore","P2P connections without a subscription relationship are not allowed."),C("P2P connections without a subscription relationship are not allowed.")}const Y=()=>new Promise(async(ue,ye)=>{try{await J.initRecvPc();const te=()=>{const ie=J.recv_peer_ins.connectionState;ie==="disconnected"&&this.subscribe([{userId:A,mediaTypes:N}]),ie==="failed"&&this.p2p.reportP2PConnect(this.options.userId,A,"disconnect","p2p is failed.")};J.recv_peer_ins.addEventListener("connectionstatechange",te),await J.addRecvs(N);const re=await J.createOffer();if(this.options.debug){const ie=libExports$1.parse(re.sdp),he=dt(ie.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:he,sdpJson:ie})}const le=await J.getRecvTracks(N),ce=await this.cwsIns.sendMessage({event:"offer",data:{roomId:u,tracks:le,sender:{id:B.id,callAction:B.callAction,tracks:[]},receiverId:A,sdp:re.sdp}}),{code:de=0,desc:me}=ce;if(de!==200)throw new Error(me);ue(!0)}catch(te){ye(te)}}),ae=()=>yt(()=>new Promise(ye=>{const te=async re=>{const{code:le,data:ce}=re;if(le!==200)return;const{sender:de,sdp:me,tracks:ie=[]}=ce,{id:he}=de;A===he&&ye({answer:{type:"answer",sdp:me},tracks:ie})};this.cwsIns.addNotify({event:"onAnswer",callback:te,sn:`onAnswer: ${F}`},!0)}),{message:"await_answer is timeout.",timeout:20*1e3}),oe=()=>new Promise(async(ue,ye)=>{try{const te=await yt(J.getRecvIcecandidates,{message:"await get recv candidates is timeout.",timeout:1e4}),re=Array.from(te,({sdpMid:me,sdpMLineIndex:ie,candidate:he})=>({sdpMid:me,sdpMLineIndex:ie,sdp:he})),le=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:u,senderId:B.id,receiverId:A,candidates:re,isSubscribeReceiver:!0}}),{code:ce=0,desc:de}=le;if(ce!==200)throw new Error(de);ue(!0)}catch(te){ye(te)}}),ne=()=>yt(()=>new Promise(ye=>{const te=async re=>{const{code:le,data:ce}=re;if(le!==200)return;const{candidates:de=[],isSubscribeReceiver:me=!1}=ce;if(me===!1){const ie=Array.from(de,({sdpMid:he,sdpMLineIndex:ke,sdp:be})=>({sdpMid:he,sdpMLineIndex:ke,candidate:be}));ye(ie)}};this.cwsIns.addNotify({event:"onCandidate",callback:te,sn:`onCandidate: ${F}`},!0)}),{message:"await_answer_candidates is timeout.",timeout:20*1e3});Promise.all([ae(),ne()]).then(async ue=>{const[{answer:ye},te]=ue;if(this.options.debug){const le=libExports$1.parse(ye.sdp),ce=dt(le.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setAnswer",{msidArr:ce,sdpJson:le})}await J.setAnswer(ye,te),await yt(J.recvIceConnected,{message:"recv ice connect is timeout.",timeout:10*1e3});const re=new Date().getTime()-Z;this.p2p.reportP2PConnect($,A,"success","连接成功",[],re),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: will compare the quality of P2P and SFU networks in 10 seconds."),J.recvPeerAnalyzeStatsIns.onNetwork=async le=>{const{inboundBytes:ce,averageQuality:de}=le;if(this.p2pPull+=Math.ceil(ce/1024),de===0)return;const{current_origin:me,suggest_origin:ie}=await fe(this,zt).call(this,A,"microphoneCamera_video");if(K===!1){if(await fe(this,Pt).call(this,A,N,ie),ie==="sfu")return this.p2p.reportP2PConnect($,A,"poor_network",`P2P quality is ${de}.`),await J.clearRecvPc(),O(!0);if(ie==="p2p"){K=!0,await this.emitNotifyUpdateUsers();const he=this.createUserUpdateStreams(N);await this.emitNotifyUpdateUsersStreams([{userId:A,updateStreams:he}]),me==="sfu"&&fe(this,mt).call(this,[{userId:A,mediaTypes:N}],!1)}return O(!0)}if(me!==ie)if(ie==="p2p"){await fe(this,Pt).call(this,A,N,"p2p"),me==="sfu"&&fe(this,mt).call(this,[{userId:A,mediaTypes:N}],!1),await this.emitNotifyUpdateUsers();const he=this.createUserUpdateStreams(N);await this.emitNotifyUpdateUsersStreams([{userId:A,updateStreams:he}])}else{if(this.hasAsyncTask("subscribe"))return;this.p2p.reportP2PConnect($,A,"poor_network",`P2P quality is ${de}.`),this.subscribe([{userId:A,mediaTypes:N}])}}}).catch(ue=>{C(ue),this.p2p.reportP2PConnect($,A,"fail",ue.message||ue)}).finally(()=>{this.cwsIns.removeNotify([`onAnswer: ${F}`,`onCandidate: ${F}`])}),await Y(),await oe()}catch(J){this.p2p.reportP2PConnect($,A,"fail",J.message||J),C(J)}}),replaceSenderStreams:async(A,N=[],O)=>{const C=this.getOptions();for(const i of A){const{userId:u}=C,$=await this.getP2PIns(i);if(!(!$||!$.send_peer_ins))for(const B of N){const F=$.send_transceiverMap.get(B);let Z;if(F){const{sender:K}=F;O?Z=this.getUserStream(u,B):Z=this.getPhoneyStreams(B);const[J]=Z.getTracks();J&&await K.replaceTrack(J)}}}},reportNetwork:()=>new Promise(async(A,N)=>{try{let O=0;switch((await h()).natType){case"Symmetric":O=0;break;case"Full Cone":O=1;break;case"Port Restricted Cone":O=2;break;case"Restricted Cone":O=3;break}let C=0;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"wifi":C=0;break;case"4g":case"3g":case"2g":case"slow-2g":C=2;break;default:C=1;break}await this.cwsIns.sendMessage({event:"reportNetwork",data:{nat:O,type:C}}),A(!0)}catch(O){N(O)}}),reportP2PConnect:(A,N,O,C="",i=[],u=0)=>{let $;switch(O){case"success":$=0;break;case"fail":$=1;break;case"ignore":$=2;break;case"disconnect":$=3;break;case"poor_network":$=4;break}return this.cwsIns.sendMessage({event:"reportP2PConnect",data:{userId:A,origin:N,code:$,reason:C,pushUserIds:i,connectedTime:u}})},closeSend:async(A=[],N=[])=>{A.length===0&&(A=[...this.p2pMap.keys()]);for(const O of A){const C=await this.getP2PIns(O);if(!C||!C.recv_peer_ins)return;C.sendPeerAnalyzeStatsIns.stop(),await C.clearSenderPc(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: close closeSend: ${O}`,O,N)}},closeRecv:async(A=[],N=[])=>{A.length===0&&(A=[...this.p2pMap.keys()]);for(const O of A){const C=await this.getP2PIns(O);if(!C||!C.recv_peer_ins)return;C.recvPeerAnalyzeStatsIns.stop(),await C.clearRecvPc(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: close closeRecv: ${O}`,O,N)}}});fe(this,en).call(this)}}Ut=new WeakMap,Ot=new WeakMap,Lt=new WeakMap,Xt=new WeakMap,Rt=new WeakMap,At=new WeakMap,Ft=new WeakMap,It=new WeakMap,jt=new WeakMap,mt=new WeakMap,Pt=new WeakMap,zt=new WeakMap,en=new WeakMap;class Room extends RoomCalls{constructor(M){super(M)}}class QuickVO extends Room{constructor(A){super(A);_e(this,Tt,new Map);_e(this,tn,()=>{{const A=async N=>{const{state:O}=N.data;if(O==="closed"){const{roomId:C,userId:i}=this.getOptions(),u={roomId:C,user:{id:i}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:u}),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:A},!0)}{const A=async N=>{const{state:O}=N.data;["closed","failed"].includes(O)&&this.restoreICE()};this.cwsIns.addNotify({event:"onIceState",callback:A},!0)}{const A=async N=>{const{qualities:O=[]}=N.data,[C]=O,{userId:i}=this.getOptions();if(!(C&&C.userId===i&&O.length===1)){for(const u of O){const{userId:$,egress:B,ingress:F}=u;this.checkUserInRoom($)&&await this.updateUserNetwork($,{egress:B,ingress:F})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:A},!0)}{const A=async N=>{const O=N.data.user;await this.removeUsers([O.id]),await this.updateUsers([O]),await this.updateUsertracks(O.id,O.track,!1),await this.updateUserBehaviors(O.id,O.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:A},!0)}{const A=N=>{const O=async()=>{await this.removeUsers([N.data.user.id]),await this.emitNotifyUpdateUsers()};return this.asyncQueue.add(O,{describe:"removeUsers"})};this.cwsIns.addNotify({event:"onQuitRoom",callback:A},!0)}{const A=async N=>{const{user:O}=N.data,{id:C,tracks:i=[],callAction:u=0}=O;if(await this.updateUserCallAction(C,u),await this.updateUserPermissions(C,3),await this.updateUsertracks(C,i,!0),this.await_remote_publish_users.length!==0&&this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ignore some user track releases.",this.await_remote_publish_users),this.options.newPublishAutoSubscribe){const $=[],B=(J,Y)=>{const ae=this.await_remote_publish_users.find(ne=>ne.id===J);return!(!ae||!ae.tracks.find(ne=>ne.type===Y))},F=[],Z=await this.getUser(C);for(const J of Z.tracks)for(const Y of i)J.type===Y.type&&B(C,Y.type)===!1&&F.push(Y.mediaType);const K=[...new Set(F)];$.push({userId:C,mediaTypes:K}),await this.subscribe($)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:A},!0)}{const A=async N=>{const{id:O,tracks:C}=N.data.user,{userId:i}=this.getOptions();if(O===i)return;const u=Array.from(C,Z=>Z.trackName),$=await this.getUser(O),B=[];for(const Z of $.tracks)u.includes(Z.trackName)&&B.push(Z.mediaType);await this.stopSubscribe([{userId:O,mediaTypes:B}]);const F=$.tracks.filter(Z=>!u.includes(Z.trackName));await this.updateUsertracks(O,F,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onCloseTrack",callback:A},!0)}{const A=async N=>{const{id:O,callAction:C}=N.data.user;this.checkUserInRoom(O)&&(await this.updateUserCallAction(O,C),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:A},!0)}{const A=async N=>{const{roomId:O,remoteUserId:C}=N.data,i=this.getOptions();this.checkUserInRoom(C)&&O===i.roomId&&this.p2p.closeSend([C])};this.cwsIns.addNotify({event:"onDisconnectP2P",callback:A},!0)}{const A=async N=>{const{user:O}=N.data,{id:C,permissions:i=1}=O;i===1?await this.removeUsers([C]):i===3&&await this.updateUsers([O]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:A},!0)}{const A=async N=>{const{users:O}=N.data;for(const C of O){const{id:i,behavior:u}=C;await this.updateUserBehaviors(i,u)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:A},!0)}{const A=async N=>{const{roomId:O,userId:C}=N.data;this.options.roomId===O&&(await new Promise(i=>setTimeout(()=>i(!0),1e3)),this.p2p.open(C))};this.cwsIns.addNotify({event:"onAttemptP2PReq",callback:A},!0)}{const A=async N=>{const{session:O,sessionIsValid:C=!0,tracks:i=[]}=N.data;if(O!==this.sdk_session||C===!1)return this.restoreICE();const u=[],$=Array.from(i,F=>F.trackName),B=await this.getUserTrackByTrackName($);for(const F of B)F&&F.mediaType&&u.push(F.mediaType);await this.stopPublish(u),await this.publish(u)};this.cwsIns.addNotify({event:"onTrackInactive",callback:A},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async A=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});ee(this,"addNotify",A=>this.cwsIns.addNotify(A));_e(this,nn,()=>{this.cwsIns.prws.checkReconnect=async A=>A.code===1e3?(this.setRoomState("closed"),!1):A.code===4001?(this.setRoomState("closed"),!1):A.code===4002?(this.setRoomState("closed"),!1):A.code===4003?(this.setRoomState("closed"),!1):(this.setSession(),A.code===4010?(this.setRoomState("connecting"),!0):(this.setRoomState("connecting"),!0)),this.cwsIns.prws.onReconnectSuccess=async A=>{this.setRoomState("connected"),await this.restoreRoom(),await this.prResolves.emit("cwsConnected")},this.cwsIns.prws.onReconnectStop=async A=>{this.setRoomState("closed")}});ee(this,"addRequestAnimationFrame",async(A,N)=>{{const C=fe(this,Tt).get(A);C&&cancelAnimationFrame(C)}const O=(C=Date.now())=>{N(C);const i=requestAnimationFrame(O);fe(this,Tt).set(A,i)};O()});ee(this,"clearRequestAnimationFrame",async(A=[])=>{A.length===0&&(A=[...fe(this,Tt).keys()]);const N=[];for(const O of A){const C=fe(this,Tt).get(O);C&&(cancelAnimationFrame(C),N.push(C))}return N});ee(this,"destroy",async()=>{this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise(A=>setTimeout(()=>A(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.close(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK")});fe(this,nn).call(this),fe(this,tn).call(this)}}Tt=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(A){const B=requireBase64Js(),D=requireIeee754(),M=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;A.Buffer=u,A.SlowBuffer=ue,A.INSPECT_MAX_BYTES=50;const O=2147483647;A.kMaxLength=O,u.TYPED_ARRAY_SUPPORT=C(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function C(){try{const Q=new Uint8Array(1),j={foo:function(){return 42}};return Object.setPrototypeOf(j,Uint8Array.prototype),Object.setPrototypeOf(Q,j),Q.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function i(Q){if(Q>O)throw new RangeError('The value "'+Q+'" is invalid for option "size"');const j=new Uint8Array(Q);return Object.setPrototypeOf(j,u.prototype),j}function u(Q,j,z){if(typeof Q=="number"){if(typeof j=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Z(Q)}return $(Q,j,z)}u.poolSize=8192;function $(Q,j,z){if(typeof Q=="string")return K(Q,j);if(ArrayBuffer.isView(Q))return Y(Q);if(Q==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(ze(Q,ArrayBuffer)||Q&&ze(Q.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ze(Q,SharedArrayBuffer)||Q&&ze(Q.buffer,SharedArrayBuffer)))return oe(Q,j,z);if(typeof Q=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const X=Q.valueOf&&Q.valueOf();if(X!=null&&X!==Q)return u.from(X,j,z);const ae=re(Q);if(ae)return ae;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]=="function")return u.from(Q[Symbol.toPrimitive]("string"),j,z);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}u.from=function(Q,j,z){return $(Q,j,z)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function N(Q){if(typeof Q!="number")throw new TypeError('"size" argument must be of type number');if(Q<0)throw new RangeError('The value "'+Q+'" is invalid for option "size"')}function F(Q,j,z){return N(Q),Q<=0?i(Q):j!==void 0?typeof z=="string"?i(Q).fill(j,z):i(Q).fill(j):i(Q)}u.alloc=function(Q,j,z){return F(Q,j,z)};function Z(Q){return N(Q),i(Q<0?0:te(Q)|0)}u.allocUnsafe=function(Q){return Z(Q)},u.allocUnsafeSlow=function(Q){return Z(Q)};function K(Q,j){if((typeof j!="string"||j==="")&&(j="utf8"),!u.isEncoding(j))throw new TypeError("Unknown encoding: "+j);const z=pe(Q,j)|0;let X=i(z);const ae=X.write(Q,j);return ae!==z&&(X=X.slice(0,ae)),X}function J(Q){const j=Q.length<0?0:te(Q.length)|0,z=i(j);for(let X=0;X<j;X+=1)z[X]=Q[X]&255;return z}function Y(Q){if(ze(Q,Uint8Array)){const j=new Uint8Array(Q);return oe(j.buffer,j.byteOffset,j.byteLength)}return J(Q)}function oe(Q,j,z){if(j<0||Q.byteLength<j)throw new RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<j+(z||0))throw new RangeError('"length" is outside of buffer bounds');let X;return j===void 0&&z===void 0?X=new Uint8Array(Q):z===void 0?X=new Uint8Array(Q,j):X=new Uint8Array(Q,j,z),Object.setPrototypeOf(X,u.prototype),X}function re(Q){if(u.isBuffer(Q)){const j=te(Q.length)|0,z=i(j);return z.length===0||Q.copy(z,0,0,j),z}if(Q.length!==void 0)return typeof Q.length!="number"||Xe(Q.length)?i(0):J(Q);if(Q.type==="Buffer"&&Array.isArray(Q.data))return J(Q.data)}function te(Q){if(Q>=O)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+O.toString(16)+" bytes");return Q|0}function ue(Q){return+Q!=Q&&(Q=0),u.alloc(+Q)}u.isBuffer=function(j){return j!=null&&j._isBuffer===!0&&j!==u.prototype},u.compare=function(j,z){if(ze(j,Uint8Array)&&(j=u.from(j,j.offset,j.byteLength)),ze(z,Uint8Array)&&(z=u.from(z,z.offset,z.byteLength)),!u.isBuffer(j)||!u.isBuffer(z))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(j===z)return 0;let X=j.length,ae=z.length;for(let de=0,me=Math.min(X,ae);de<me;++de)if(j[de]!==z[de]){X=j[de],ae=z[de];break}return X<ae?-1:ae<X?1:0},u.isEncoding=function(j){switch(String(j).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}},u.concat=function(j,z){if(!Array.isArray(j))throw new TypeError('"list" argument must be an Array of Buffers');if(j.length===0)return u.alloc(0);let X;if(z===void 0)for(z=0,X=0;X<j.length;++X)z+=j[X].length;const ae=u.allocUnsafe(z);let de=0;for(X=0;X<j.length;++X){let me=j[X];if(ze(me,Uint8Array))de+me.length>ae.length?(u.isBuffer(me)||(me=u.from(me)),me.copy(ae,de)):Uint8Array.prototype.set.call(ae,me,de);else if(u.isBuffer(me))me.copy(ae,de);else throw new TypeError('"list" argument must be an Array of Buffers');de+=me.length}return ae};function pe(Q,j){if(u.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||ze(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);const z=Q.length,X=arguments.length>2&&arguments[2]===!0;if(!X&&z===0)return 0;let ae=!1;for(;;)switch(j){case"ascii":case"latin1":case"binary":return z;case"utf8":case"utf-8":return Je(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z*2;case"hex":return z>>>1;case"base64":return Ke(Q).length;default:if(ae)return X?-1:Je(Q).length;j=(""+j).toLowerCase(),ae=!0}}u.byteLength=pe;function ee(Q,j,z){let X=!1;if((j===void 0||j<0)&&(j=0),j>this.length||((z===void 0||z>this.length)&&(z=this.length),z<=0)||(z>>>=0,j>>>=0,z<=j))return"";for(Q||(Q="utf8");;)switch(Q){case"hex":return Le(this,j,z);case"utf8":case"utf-8":return ke(this,j,z);case"ascii":return De(this,j,z);case"latin1":case"binary":return Be(this,j,z);case"base64":return ve(this,j,z);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ve(this,j,z);default:if(X)throw new TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),X=!0}}u.prototype._isBuffer=!0;function ne(Q,j,z){const X=Q[j];Q[j]=Q[z],Q[z]=X}u.prototype.swap16=function(){const j=this.length;if(j%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let z=0;z<j;z+=2)ne(this,z,z+1);return this},u.prototype.swap32=function(){const j=this.length;if(j%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let z=0;z<j;z+=4)ne(this,z,z+3),ne(this,z+1,z+2);return this},u.prototype.swap64=function(){const j=this.length;if(j%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let z=0;z<j;z+=8)ne(this,z,z+7),ne(this,z+1,z+6),ne(this,z+2,z+5),ne(this,z+3,z+4);return this},u.prototype.toString=function(){const j=this.length;return j===0?"":arguments.length===0?ke(this,0,j):ee.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(j){if(!u.isBuffer(j))throw new TypeError("Argument must be a Buffer");return this===j?!0:u.compare(this,j)===0},u.prototype.inspect=function(){let j="";const z=A.INSPECT_MAX_BYTES;return j=this.toString("hex",0,z).replace(/(.{2})/g,"$1 ").trim(),this.length>z&&(j+=" ... "),"<Buffer "+j+">"},M&&(u.prototype[M]=u.prototype.inspect),u.prototype.compare=function(j,z,X,ae,de){if(ze(j,Uint8Array)&&(j=u.from(j,j.offset,j.byteLength)),!u.isBuffer(j))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof j);if(z===void 0&&(z=0),X===void 0&&(X=j?j.length:0),ae===void 0&&(ae=0),de===void 0&&(de=this.length),z<0||X>j.length||ae<0||de>this.length)throw new RangeError("out of range index");if(ae>=de&&z>=X)return 0;if(ae>=de)return-1;if(z>=X)return 1;if(z>>>=0,X>>>=0,ae>>>=0,de>>>=0,this===j)return 0;let me=de-ae,Se=X-z;const Ce=Math.min(me,Se),Ee=this.slice(ae,de),Ae=j.slice(z,X);for(let xe=0;xe<Ce;++xe)if(Ee[xe]!==Ae[xe]){me=Ee[xe],Se=Ae[xe];break}return me<Se?-1:Se<me?1:0};function le(Q,j,z,X,ae){if(Q.length===0)return-1;if(typeof z=="string"?(X=z,z=0):z>2147483647?z=2147483647:z<-2147483648&&(z=-2147483648),z=+z,Xe(z)&&(z=ae?0:Q.length-1),z<0&&(z=Q.length+z),z>=Q.length){if(ae)return-1;z=Q.length-1}else if(z<0)if(ae)z=0;else return-1;if(typeof j=="string"&&(j=u.from(j,X)),u.isBuffer(j))return j.length===0?-1:se(Q,j,z,X,ae);if(typeof j=="number")return j=j&255,typeof Uint8Array.prototype.indexOf=="function"?ae?Uint8Array.prototype.indexOf.call(Q,j,z):Uint8Array.prototype.lastIndexOf.call(Q,j,z):se(Q,[j],z,X,ae);throw new TypeError("val must be string, number or Buffer")}function se(Q,j,z,X,ae){let de=1,me=Q.length,Se=j.length;if(X!==void 0&&(X=String(X).toLowerCase(),X==="ucs2"||X==="ucs-2"||X==="utf16le"||X==="utf-16le")){if(Q.length<2||j.length<2)return-1;de=2,me/=2,Se/=2,z/=2}function Ce(Ae,xe){return de===1?Ae[xe]:Ae.readUInt16BE(xe*de)}let Ee;if(ae){let Ae=-1;for(Ee=z;Ee<me;Ee++)if(Ce(Q,Ee)===Ce(j,Ae===-1?0:Ee-Ae)){if(Ae===-1&&(Ae=Ee),Ee-Ae+1===Se)return Ae*de}else Ae!==-1&&(Ee-=Ee-Ae),Ae=-1}else for(z+Se>me&&(z=me-Se),Ee=z;Ee>=0;Ee--){let Ae=!0;for(let xe=0;xe<Se;xe++)if(Ce(Q,Ee+xe)!==Ce(j,xe)){Ae=!1;break}if(Ae)return Ee}return-1}u.prototype.includes=function(j,z,X){return this.indexOf(j,z,X)!==-1},u.prototype.indexOf=function(j,z,X){return le(this,j,z,X,!0)},u.prototype.lastIndexOf=function(j,z,X){return le(this,j,z,X,!1)};function ce(Q,j,z,X){z=Number(z)||0;const ae=Q.length-z;X?(X=Number(X),X>ae&&(X=ae)):X=ae;const de=j.length;X>de/2&&(X=de/2);let me;for(me=0;me<X;++me){const Se=parseInt(j.substr(me*2,2),16);if(Xe(Se))return me;Q[z+me]=Se}return me}function he(Q,j,z,X){return Qe(Je(j,Q.length-z),Q,z,X)}function ie(Q,j,z,X){return Qe(Ge(j),Q,z,X)}function fe(Q,j,z,X){return Qe(Ke(j),Q,z,X)}function ye(Q,j,z,X){return Qe(Ye(j,Q.length-z),Q,z,X)}u.prototype.write=function(j,z,X,ae){if(z===void 0)ae="utf8",X=this.length,z=0;else if(X===void 0&&typeof z=="string")ae=z,X=this.length,z=0;else if(isFinite(z))z=z>>>0,isFinite(X)?(X=X>>>0,ae===void 0&&(ae="utf8")):(ae=X,X=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const de=this.length-z;if((X===void 0||X>de)&&(X=de),j.length>0&&(X<0||z<0)||z>this.length)throw new RangeError("Attempt to write outside buffer bounds");ae||(ae="utf8");let me=!1;for(;;)switch(ae){case"hex":return ce(this,j,z,X);case"utf8":case"utf-8":return he(this,j,z,X);case"ascii":case"latin1":case"binary":return ie(this,j,z,X);case"base64":return fe(this,j,z,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ye(this,j,z,X);default:if(me)throw new TypeError("Unknown encoding: "+ae);ae=(""+ae).toLowerCase(),me=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ve(Q,j,z){return j===0&&z===Q.length?B.fromByteArray(Q):B.fromByteArray(Q.slice(j,z))}function ke(Q,j,z){z=Math.min(Q.length,z);const X=[];let ae=j;for(;ae<z;){const de=Q[ae];let me=null,Se=de>239?4:de>223?3:de>191?2:1;if(ae+Se<=z){let Ce,Ee,Ae,xe;switch(Se){case 1:de<128&&(me=de);break;case 2:Ce=Q[ae+1],(Ce&192)===128&&(xe=(de&31)<<6|Ce&63,xe>127&&(me=xe));break;case 3:Ce=Q[ae+1],Ee=Q[ae+2],(Ce&192)===128&&(Ee&192)===128&&(xe=(de&15)<<12|(Ce&63)<<6|Ee&63,xe>2047&&(xe<55296||xe>57343)&&(me=xe));break;case 4:Ce=Q[ae+1],Ee=Q[ae+2],Ae=Q[ae+3],(Ce&192)===128&&(Ee&192)===128&&(Ae&192)===128&&(xe=(de&15)<<18|(Ce&63)<<12|(Ee&63)<<6|Ae&63,xe>65535&&xe<1114112&&(me=xe))}}me===null?(me=65533,Se=1):me>65535&&(me-=65536,X.push(me>>>10&1023|55296),me=56320|me&1023),X.push(me),ae+=Se}return Re(X)}const Ie=4096;function Re(Q){const j=Q.length;if(j<=Ie)return String.fromCharCode.apply(String,Q);let z="",X=0;for(;X<j;)z+=String.fromCharCode.apply(String,Q.slice(X,X+=Ie));return z}function De(Q,j,z){let X="";z=Math.min(Q.length,z);for(let ae=j;ae<z;++ae)X+=String.fromCharCode(Q[ae]&127);return X}function Be(Q,j,z){let X="";z=Math.min(Q.length,z);for(let ae=j;ae<z;++ae)X+=String.fromCharCode(Q[ae]);return X}function Le(Q,j,z){const X=Q.length;(!j||j<0)&&(j=0),(!z||z<0||z>X)&&(z=X);let ae="";for(let de=j;de<z;++de)ae+=et[Q[de]];return ae}function Ve(Q,j,z){const X=Q.slice(j,z);let ae="";for(let de=0;de<X.length-1;de+=2)ae+=String.fromCharCode(X[de]+X[de+1]*256);return ae}u.prototype.slice=function(j,z){const X=this.length;j=~~j,z=z===void 0?X:~~z,j<0?(j+=X,j<0&&(j=0)):j>X&&(j=X),z<0?(z+=X,z<0&&(z=0)):z>X&&(z=X),z<j&&(z=j);const ae=this.subarray(j,z);return Object.setPrototypeOf(ae,u.prototype),ae};function Te(Q,j,z){if(Q%1!==0||Q<0)throw new RangeError("offset is not uint");if(Q+j>z)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(j,z,X){j=j>>>0,z=z>>>0,X||Te(j,z,this.length);let ae=this[j],de=1,me=0;for(;++me<z&&(de*=256);)ae+=this[j+me]*de;return ae},u.prototype.readUintBE=u.prototype.readUIntBE=function(j,z,X){j=j>>>0,z=z>>>0,X||Te(j,z,this.length);let ae=this[j+--z],de=1;for(;z>0&&(de*=256);)ae+=this[j+--z]*de;return ae},u.prototype.readUint8=u.prototype.readUInt8=function(j,z){return j=j>>>0,z||Te(j,1,this.length),this[j]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(j,z){return j=j>>>0,z||Te(j,2,this.length),this[j]|this[j+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(j,z){return j=j>>>0,z||Te(j,2,this.length),this[j]<<8|this[j+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(j,z){return j=j>>>0,z||Te(j,4,this.length),(this[j]|this[j+1]<<8|this[j+2]<<16)+this[j+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(j,z){return j=j>>>0,z||Te(j,4,this.length),this[j]*16777216+(this[j+1]<<16|this[j+2]<<8|this[j+3])},u.prototype.readBigUInt64LE=We(function(j){j=j>>>0,$e(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&qe(j,this.length-8);const ae=z+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24,de=this[++j]+this[++j]*2**8+this[++j]*2**16+X*2**24;return BigInt(ae)+(BigInt(de)<<BigInt(32))}),u.prototype.readBigUInt64BE=We(function(j){j=j>>>0,$e(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&qe(j,this.length-8);const ae=z*2**24+this[++j]*2**16+this[++j]*2**8+this[++j],de=this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+X;return(BigInt(ae)<<BigInt(32))+BigInt(de)}),u.prototype.readIntLE=function(j,z,X){j=j>>>0,z=z>>>0,X||Te(j,z,this.length);let ae=this[j],de=1,me=0;for(;++me<z&&(de*=256);)ae+=this[j+me]*de;return de*=128,ae>=de&&(ae-=Math.pow(2,8*z)),ae},u.prototype.readIntBE=function(j,z,X){j=j>>>0,z=z>>>0,X||Te(j,z,this.length);let ae=z,de=1,me=this[j+--ae];for(;ae>0&&(de*=256);)me+=this[j+--ae]*de;return de*=128,me>=de&&(me-=Math.pow(2,8*z)),me},u.prototype.readInt8=function(j,z){return j=j>>>0,z||Te(j,1,this.length),this[j]&128?(255-this[j]+1)*-1:this[j]},u.prototype.readInt16LE=function(j,z){j=j>>>0,z||Te(j,2,this.length);const X=this[j]|this[j+1]<<8;return X&32768?X|4294901760:X},u.prototype.readInt16BE=function(j,z){j=j>>>0,z||Te(j,2,this.length);const X=this[j+1]|this[j]<<8;return X&32768?X|4294901760:X},u.prototype.readInt32LE=function(j,z){return j=j>>>0,z||Te(j,4,this.length),this[j]|this[j+1]<<8|this[j+2]<<16|this[j+3]<<24},u.prototype.readInt32BE=function(j,z){return j=j>>>0,z||Te(j,4,this.length),this[j]<<24|this[j+1]<<16|this[j+2]<<8|this[j+3]},u.prototype.readBigInt64LE=We(function(j){j=j>>>0,$e(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&qe(j,this.length-8);const ae=this[j+4]+this[j+5]*2**8+this[j+6]*2**16+(X<<24);return(BigInt(ae)<<BigInt(32))+BigInt(z+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24)}),u.prototype.readBigInt64BE=We(function(j){j=j>>>0,$e(j,"offset");const z=this[j],X=this[j+7];(z===void 0||X===void 0)&&qe(j,this.length-8);const ae=(z<<24)+this[++j]*2**16+this[++j]*2**8+this[++j];return(BigInt(ae)<<BigInt(32))+BigInt(this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+X)}),u.prototype.readFloatLE=function(j,z){return j=j>>>0,z||Te(j,4,this.length),D.read(this,j,!0,23,4)},u.prototype.readFloatBE=function(j,z){return j=j>>>0,z||Te(j,4,this.length),D.read(this,j,!1,23,4)},u.prototype.readDoubleLE=function(j,z){return j=j>>>0,z||Te(j,8,this.length),D.read(this,j,!0,52,8)},u.prototype.readDoubleBE=function(j,z){return j=j>>>0,z||Te(j,8,this.length),D.read(this,j,!1,52,8)};function Oe(Q,j,z,X,ae,de){if(!u.isBuffer(Q))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>ae||j<de)throw new RangeError('"value" argument is out of bounds');if(z+X>Q.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(j,z,X,ae){if(j=+j,z=z>>>0,X=X>>>0,!ae){const Se=Math.pow(2,8*X)-1;Oe(this,j,z,X,Se,0)}let de=1,me=0;for(this[z]=j&255;++me<X&&(de*=256);)this[z+me]=j/de&255;return z+X},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(j,z,X,ae){if(j=+j,z=z>>>0,X=X>>>0,!ae){const Se=Math.pow(2,8*X)-1;Oe(this,j,z,X,Se,0)}let de=X-1,me=1;for(this[z+de]=j&255;--de>=0&&(me*=256);)this[z+de]=j/me&255;return z+X},u.prototype.writeUint8=u.prototype.writeUInt8=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,1,255,0),this[z]=j&255,z+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,2,65535,0),this[z]=j&255,this[z+1]=j>>>8,z+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,2,65535,0),this[z]=j>>>8,this[z+1]=j&255,z+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,4,4294967295,0),this[z+3]=j>>>24,this[z+2]=j>>>16,this[z+1]=j>>>8,this[z]=j&255,z+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,4,4294967295,0),this[z]=j>>>24,this[z+1]=j>>>16,this[z+2]=j>>>8,this[z+3]=j&255,z+4};function He(Q,j,z,X,ae){ge(j,X,ae,Q,z,7);let de=Number(j&BigInt(4294967295));Q[z++]=de,de=de>>8,Q[z++]=de,de=de>>8,Q[z++]=de,de=de>>8,Q[z++]=de;let me=Number(j>>BigInt(32)&BigInt(4294967295));return Q[z++]=me,me=me>>8,Q[z++]=me,me=me>>8,Q[z++]=me,me=me>>8,Q[z++]=me,z}function Pe(Q,j,z,X,ae){ge(j,X,ae,Q,z,7);let de=Number(j&BigInt(4294967295));Q[z+7]=de,de=de>>8,Q[z+6]=de,de=de>>8,Q[z+5]=de,de=de>>8,Q[z+4]=de;let me=Number(j>>BigInt(32)&BigInt(4294967295));return Q[z+3]=me,me=me>>8,Q[z+2]=me,me=me>>8,Q[z+1]=me,me=me>>8,Q[z]=me,z+8}u.prototype.writeBigUInt64LE=We(function(j,z=0){return He(this,j,z,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=We(function(j,z=0){return Pe(this,j,z,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(j,z,X,ae){if(j=+j,z=z>>>0,!ae){const Ce=Math.pow(2,8*X-1);Oe(this,j,z,X,Ce-1,-Ce)}let de=0,me=1,Se=0;for(this[z]=j&255;++de<X&&(me*=256);)j<0&&Se===0&&this[z+de-1]!==0&&(Se=1),this[z+de]=(j/me>>0)-Se&255;return z+X},u.prototype.writeIntBE=function(j,z,X,ae){if(j=+j,z=z>>>0,!ae){const Ce=Math.pow(2,8*X-1);Oe(this,j,z,X,Ce-1,-Ce)}let de=X-1,me=1,Se=0;for(this[z+de]=j&255;--de>=0&&(me*=256);)j<0&&Se===0&&this[z+de+1]!==0&&(Se=1),this[z+de]=(j/me>>0)-Se&255;return z+X},u.prototype.writeInt8=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,1,127,-128),j<0&&(j=255+j+1),this[z]=j&255,z+1},u.prototype.writeInt16LE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,2,32767,-32768),this[z]=j&255,this[z+1]=j>>>8,z+2},u.prototype.writeInt16BE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,2,32767,-32768),this[z]=j>>>8,this[z+1]=j&255,z+2},u.prototype.writeInt32LE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,4,2147483647,-2147483648),this[z]=j&255,this[z+1]=j>>>8,this[z+2]=j>>>16,this[z+3]=j>>>24,z+4},u.prototype.writeInt32BE=function(j,z,X){return j=+j,z=z>>>0,X||Oe(this,j,z,4,2147483647,-2147483648),j<0&&(j=4294967295+j+1),this[z]=j>>>24,this[z+1]=j>>>16,this[z+2]=j>>>8,this[z+3]=j&255,z+4},u.prototype.writeBigInt64LE=We(function(j,z=0){return He(this,j,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=We(function(j,z=0){return Pe(this,j,z,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Fe(Q,j,z,X,ae,de){if(z+X>Q.length)throw new RangeError("Index out of range");if(z<0)throw new RangeError("Index out of range")}function Ze(Q,j,z,X,ae){return j=+j,z=z>>>0,ae||Fe(Q,j,z,4),D.write(Q,j,z,X,23,4),z+4}u.prototype.writeFloatLE=function(j,z,X){return Ze(this,j,z,!0,X)},u.prototype.writeFloatBE=function(j,z,X){return Ze(this,j,z,!1,X)};function je(Q,j,z,X,ae){return j=+j,z=z>>>0,ae||Fe(Q,j,z,8),D.write(Q,j,z,X,52,8),z+8}u.prototype.writeDoubleLE=function(j,z,X){return je(this,j,z,!0,X)},u.prototype.writeDoubleBE=function(j,z,X){return je(this,j,z,!1,X)},u.prototype.copy=function(j,z,X,ae){if(!u.isBuffer(j))throw new TypeError("argument should be a Buffer");if(X||(X=0),!ae&&ae!==0&&(ae=this.length),z>=j.length&&(z=j.length),z||(z=0),ae>0&&ae<X&&(ae=X),ae===X||j.length===0||this.length===0)return 0;if(z<0)throw new RangeError("targetStart out of bounds");if(X<0||X>=this.length)throw new RangeError("Index out of range");if(ae<0)throw new RangeError("sourceEnd out of bounds");ae>this.length&&(ae=this.length),j.length-z<ae-X&&(ae=j.length-z+X);const de=ae-X;return this===j&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(z,X,ae):Uint8Array.prototype.set.call(j,this.subarray(X,ae),z),de},u.prototype.fill=function(j,z,X,ae){if(typeof j=="string"){if(typeof z=="string"?(ae=z,z=0,X=this.length):typeof X=="string"&&(ae=X,X=this.length),ae!==void 0&&typeof ae!="string")throw new TypeError("encoding must be a string");if(typeof ae=="string"&&!u.isEncoding(ae))throw new TypeError("Unknown encoding: "+ae);if(j.length===1){const me=j.charCodeAt(0);(ae==="utf8"&&me<128||ae==="latin1")&&(j=me)}}else typeof j=="number"?j=j&255:typeof j=="boolean"&&(j=Number(j));if(z<0||this.length<z||this.length<X)throw new RangeError("Out of range index");if(X<=z)return this;z=z>>>0,X=X===void 0?this.length:X>>>0,j||(j=0);let de;if(typeof j=="number")for(de=z;de<X;++de)this[de]=j;else{const me=u.isBuffer(j)?j:u.from(j,ae),Se=me.length;if(Se===0)throw new TypeError('The value "'+j+'" is invalid for argument "value"');for(de=0;de<X-z;++de)this[de+z]=me[de%Se]}return this};const Ne={};function _e(Q,j,z){Ne[Q]=class extends z{constructor(){super(),Object.defineProperty(this,"message",{value:j.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(ae){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ae,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}_e("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){return Q?`${Q} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_e("ERR_INVALID_ARG_TYPE",function(Q,j){return`The "${Q}" argument must be of type number. Received type ${typeof j}`},TypeError),_e("ERR_OUT_OF_RANGE",function(Q,j,z){let X=`The value of "${Q}" is out of range.`,ae=z;return Number.isInteger(z)&&Math.abs(z)>2**32?ae=be(String(z)):typeof z=="bigint"&&(ae=String(z),(z>BigInt(2)**BigInt(32)||z<-(BigInt(2)**BigInt(32)))&&(ae=be(ae)),ae+="n"),X+=` It must be ${j}. Received ${ae}`,X},RangeError);function be(Q){let j="",z=Q.length;const X=Q[0]==="-"?1:0;for(;z>=X+4;z-=3)j=`_${Q.slice(z-3,z)}${j}`;return`${Q.slice(0,z)}${j}`}function we(Q,j,z){$e(j,"offset"),(Q[j]===void 0||Q[j+z]===void 0)&&qe(j,Q.length-(z+1))}function ge(Q,j,z,X,ae,de){if(Q>z||Q<j){const me=typeof j=="bigint"?"n":"";let Se;throw j===0||j===BigInt(0)?Se=`>= 0${me} and < 2${me} ** ${(de+1)*8}${me}`:Se=`>= -(2${me} ** ${(de+1)*8-1}${me}) and < 2 ** ${(de+1)*8-1}${me}`,new Ne.ERR_OUT_OF_RANGE("value",Se,Q)}we(X,ae,de)}function $e(Q,j){if(typeof Q!="number")throw new Ne.ERR_INVALID_ARG_TYPE(j,"number",Q)}function qe(Q,j,z){throw Math.floor(Q)!==Q?($e(Q,z),new Ne.ERR_OUT_OF_RANGE("offset","an integer",Q)):j<0?new Ne.ERR_BUFFER_OUT_OF_BOUNDS:new Ne.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${j}`,Q)}const Ue=/[^+/0-9A-Za-z-_]/g;function Me(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(Ue,""),Q.length<2)return"";for(;Q.length%4!==0;)Q=Q+"=";return Q}function Je(Q,j){j=j||1/0;let z;const X=Q.length;let ae=null;const de=[];for(let me=0;me<X;++me){if(z=Q.charCodeAt(me),z>55295&&z<57344){if(!ae){if(z>56319){(j-=3)>-1&&de.push(239,191,189);continue}else if(me+1===X){(j-=3)>-1&&de.push(239,191,189);continue}ae=z;continue}if(z<56320){(j-=3)>-1&&de.push(239,191,189),ae=z;continue}z=(ae-55296<<10|z-56320)+65536}else ae&&(j-=3)>-1&&de.push(239,191,189);if(ae=null,z<128){if((j-=1)<0)break;de.push(z)}else if(z<2048){if((j-=2)<0)break;de.push(z>>6|192,z&63|128)}else if(z<65536){if((j-=3)<0)break;de.push(z>>12|224,z>>6&63|128,z&63|128)}else if(z<1114112){if((j-=4)<0)break;de.push(z>>18|240,z>>12&63|128,z>>6&63|128,z&63|128)}else throw new Error("Invalid code point")}return de}function Ge(Q){const j=[];for(let z=0;z<Q.length;++z)j.push(Q.charCodeAt(z)&255);return j}function Ye(Q,j){let z,X,ae;const de=[];for(let me=0;me<Q.length&&!((j-=2)<0);++me)z=Q.charCodeAt(me),X=z>>8,ae=z%256,de.push(ae),de.push(X);return de}function Ke(Q){return B.toByteArray(Me(Q))}function Qe(Q,j,z,X){let ae;for(ae=0;ae<X&&!(ae+z>=j.length||ae>=Q.length);++ae)j[ae+z]=Q[ae];return ae}function ze(Q,j){return Q instanceof j||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===j.name}function Xe(Q){return Q!==Q}const et=function(){const Q="0123456789abcdef",j=new Array(256);for(let z=0;z<16;++z){const X=z*16;for(let ae=0;ae<16;++ae)j[X+ae]=Q[z]+Q[ae]}return j}();function We(Q){return typeof BigInt>"u"?tt:Q}function tt(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var A=toolsEbml&&toolsEbml.__assign||function(){return A=Object.assign||function(O){for(var C,i=1,u=arguments.length;i<u;i++){C=arguments[i];for(var $ in C)Object.prototype.hasOwnProperty.call(C,$)&&(O[$]=C[$])}return O},A.apply(this,arguments)},B=toolsEbml&&toolsEbml.__spreadArray||function(O,C,i){if(i||arguments.length===2)for(var u=0,$=C.length,N;u<$;u++)(N||!(u in C))&&(N||(N=Array.prototype.slice.call(C,0,u)),N[u]=C[u]);return O.concat(N||Array.prototype.slice.call(C))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var D=requireTools(),M=function(){function O(){}return O.readVint=function(C,i){i===void 0&&(i=0);var u=8-Math.floor(Math.log2(C[i]));if(u>8){var $=O.readHexString(C,i,i+u);throw new Error("Unrepresentable length: ".concat(u," ").concat($))}if(i+u>C.length)return null;for(var N=C[i]&(1<<8-u)-1,F=1;F<u;F+=1){if(F===7&&N>=Math.pow(2,8)&&C[i+7]>0)return{length:u,value:-1};N*=Math.pow(2,8),N+=C[i+F]}return{length:u,value:N}},O.writeVint=function(C){if(C<0||C>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(C));var i=1;for(i=1;i<=8&&!(C<Math.pow(2,7*i)-1);i+=1);for(var u=D.Buffer.alloc(i),$=C,N=1;N<=i;N+=1){var F=$&255;u[i-N]=F,$-=F,$/=Math.pow(2,8)}return u[0]|=1<<8-i,u},O.concatenate=function(C,i){return!C&&!i?D.Buffer.from([]):!C||C.byteLength===0?i:!i||i.byteLength===0?C:D.Buffer.from(B(B([],C,!0),i,!0))},O.readHexString=function(C,i,u){return i===void 0&&(i=0),u===void 0&&(u=C.byteLength),Array.from(C.slice(i,u)).map(function($){return Number($).toString(16)}).reduce(function($,N){return"".concat($).concat(N.padStart(2,"0"))},"")},O.readUtf8=function(C){try{return D.Buffer.from(C).toString("utf8")}catch{return null}},O.readUnsigned=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.byteLength){case 1:return i.getUint8(0);case 2:return i.getUint16(0);case 4:return i.getUint32(0)}return C.byteLength<=6?C.reduce(function(u,$){return u*256+$},0):O.readHexString(C,0,C.byteLength)},O.readSigned=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.byteLength){case 1:return i.getInt8(0);case 2:return i.getInt16(0);case 4:return i.getInt32(0);default:return NaN}},O.readFloat=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.byteLength){case 4:return i.getFloat32(0);case 8:return i.getFloat64(0);default:return NaN}},O.readDate=function(C){var i=new DataView(C.buffer,C.byteOffset,C.byteLength);switch(C.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(O.readHexString(C),16));default:return new Date(0)}},O.readDataFromTag=function(C,i){var u=C.type,$=C.name,N=C.track,F=C.discardable||!1,Z=C.keyframe||!1,K=null,J;switch(u){case"u":J=O.readUnsigned(i);break;case"f":J=O.readFloat(i);break;case"i":J=O.readSigned(i);break;case"s":J=String.fromCharCode.apply(String,i);break;case"8":J=O.readUtf8(i);break;case"d":J=O.readDate(i);break}if($==="SimpleBlock"||$==="Block"){var Y=0,oe=O.readVint(i,Y),re=oe.length,te=oe.value;Y+=re,N=te,J=O.readSigned(i.subarray(Y,Y+2)),Y+=2,$==="SimpleBlock"&&(Z=!!(i[re+2]&128),F=!!(i[re+2]&1)),Y+=1,K=i.subarray(Y)}return A(A({},C),{data:i,discardable:F,keyframe:Z,payload:K,track:N,value:J})},O}();return toolsEbml.default=M,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(A,B,D){B=B||0;for(var M=1;M<=8&&!(A[B]>=Math.pow(2,8-M));M++);if(M>8)throw new Error("Unrepresentable length: "+M+" "+A.toString("hex",B,B+M));if(B+M>A.length)return null;var O,C=A[B]&(1<<8-M)-1;for(O=1;O<M;O++){if(O===7&&C>=Math.pow(2,45)&&A[B+7]>0)return{length:M,value:-1};C*=Math.pow(2,8),C+=A[B+O]}return D&&(C-=Math.pow(2,M*7-1)-1),{length:M,value:C}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var A=requireVint();function B(D){this.buffer=D,this.offset=0}return B.prototype.nextInt16BE=function(){var D=this.buffer.readInt16BE(this.offset);return this.offset+=2,D},B.prototype.nextUInt8=function(){var D=this.buffer.readUInt8(this.offset);return this.offset+=1,D},B.prototype.nextUIntV=function(){var D=A(this.buffer,this.offset);return this.offset+=D.length,D.value},B.prototype.nextIntV=function(){var D=A(this.buffer,this.offset,!0);return this.offset+=D.length,D.value},B.prototype.nextBuffer=function(D){var M=D?this.buffer.slice(this.offset,this.offset+D):this.buffer.slice(this.offset);return this.offset+=D||this.length,M},Object.defineProperty(B.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=B,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var A=requireBufferReader(),B=1,D=3,M=2;ebmlBlock=function(C){var i={},u=new A(C);i.trackNumber=u.nextUIntV(),i.timecode=u.nextInt16BE();var $=u.nextUInt8();i.invisible=!!($&8),i.keyframe=!!($&128),i.discardable=!!($&1);var N=($&6)>>1;return i.frames=O(u,N),i};function O(C,i){if(!i)return[C.nextBuffer()];var u,$,N=[],F=C.nextUInt8()+1;if(i===M){if(C.length%F!==0)throw new Error("Fixed-Size Lacing Error");for($=C.length/F,u=0;u<F;u++)N.push(C.nextBuffer($));return N}var Z=[];if(i===B)for(u=0;u<F-1;u++){var K;$=0;do K=C.nextUInt8(),$+=K;while(K===255);Z.push($)}else if(i===D)for($=C.nextUIntV(),Z.push($),u=1;u<F-1;u++)$+=C.nextIntV(),Z.push($);for(u=0;u<F-1;u++)N.push(C.nextBuffer(Z[u]));return N.push(C.nextBuffer()),N}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function(A){Object.defineProperty(A,"__esModule",{value:!0}),A.convertEBMLDateToJSDate=A.createFloatBuffer=A.createIntBuffer=A.createUIntBuffer=A.encodeValueToBuffer=A.concat=A.putRefinedMetaData=A.extractElement=A.removeElement=A.makeMetadataSeekable=A.createRIFFChunk=A.VP8BitStreamToRiffWebPBuffer=A.WebPBlockFilter=A.encodeTag=A.readBlock=A.ebmlBlock=A.writeVint=A.readVint=A.Buffer=void 0;var B=requireInt64Buffer(),D=requireEBMLEncoder(),M=requireBuffer(),O=requireToolsEbml(),C=requireEbmlBlock();A.Buffer=M.Buffer,A.readVint=O.default.readVint,A.writeVint=O.default.writeVint,A.ebmlBlock=C;function i(ie){return(0,A.ebmlBlock)(new A.Buffer(ie))}A.readBlock=i;function u(ie,fe,ye){return ye===void 0&&(ye=!1),ee([ie,ye?new A.Buffer("01ffffffffffffff","hex"):(0,A.writeVint)(fe.length),fe])}A.encodeTag=u;function $(ie){return ie.reduce(function(fe,ye){if(ye.type!=="b"||ye.name!=="SimpleBlock")return fe;var ve=(0,A.ebmlBlock)(ye.data),ke=ve.frames.some(function(Ie){var Re=Ie.slice(3,6).toString("hex");return Re==="9d012a"});return ke?fe.concat(ye):fe},[])}A.WebPBlockFilter=$;function N(ie){var fe=F("VP8 ",ie),ye=ee([new A.Buffer("WEBP","ascii"),fe]);return F("RIFF",ye)}A.VP8BitStreamToRiffWebPBuffer=N;function F(ie,fe){var ye=new A.Buffer(4);return ye.writeUInt32LE(fe.byteLength,0),ee([new A.Buffer(ie.substr(0,4),"ascii"),ye,fe,new A.Buffer(fe.byteLength%2===0?0:1)])}A.createRIFFChunk=F;function Z(ie,fe,ye){var ve=J("EBML",ie),ke=oe(ve),Ie=ke+12,Re=ie[ie.length-1].dataEnd-Ie,De=J("Info",ie);K("Duration",De),De.splice(1,0,{name:"Duration",type:"f",data:ce(fe,8)});for(var Be=oe(De),Le=J("Tracks",ie),Ve=oe(Le),Te=47,Oe=[],He=5+ye.length*15,Pe=[],Fe=-1,Ze=10,je=function(ge){var $e=Te,qe=$e+Be,Ue=qe+Ve,Me=Ue+He,Je=Me-Re;if(Oe=[],Oe.push({name:"SeekHead",type:"m",isEnd:!1}),Oe.push({name:"Seek",type:"m",isEnd:!1}),Oe.push({name:"SeekID",type:"b",data:new A.Buffer([21,73,169,102])}),Oe.push({name:"SeekPosition",type:"u",data:le($e)}),Oe.push({name:"Seek",type:"m",isEnd:!0}),Oe.push({name:"Seek",type:"m",isEnd:!1}),Oe.push({name:"SeekID",type:"b",data:new A.Buffer([22,84,174,107])}),Oe.push({name:"SeekPosition",type:"u",data:le(qe)}),Oe.push({name:"Seek",type:"m",isEnd:!0}),Oe.push({name:"Seek",type:"m",isEnd:!1}),Oe.push({name:"SeekID",type:"b",data:new A.Buffer([28,83,187,107])}),Oe.push({name:"SeekPosition",type:"u",data:le(Ue)}),Oe.push({name:"Seek",type:"m",isEnd:!0}),Oe.push({name:"SeekHead",type:"m",isEnd:!0}),Te=oe(Oe),Pe=[],Pe.push({name:"Cues",type:"m",isEnd:!1}),ye.forEach(function(Ge){var Ye=Ge.CueTrack,Ke=Ge.CueClusterPosition,Qe=Ge.CueTime;Pe.push({name:"CuePoint",type:"m",isEnd:!1}),Pe.push({name:"CueTime",type:"u",data:le(Qe)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Pe.push({name:"CueTrack",type:"u",data:le(Ye)}),Ke-=Ie,Ke+=Je,Pe.push({name:"CueClusterPosition",type:"u",data:le(Ke)}),Pe.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Pe.push({name:"CuePoint",type:"m",isEnd:!0})}),Pe.push({name:"Cues",type:"m",isEnd:!0}),He=oe(Pe),Fe!==Je){if(Fe=Je,ge===Ze-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Ne=0;Ne<Ze;Ne++){var _e=je(Ne);if(_e==="break")break}var be=[].concat.apply([],[ve,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},Oe,De,Le,Pe]),we=new D.default().encode(be);return we}A.makeMetadataSeekable=Z;function K(ie,fe){for(var ye=-1,ve=0;ve<fe.length;ve++){var ke=fe[ve];if(ke.name===ie)if(ke.type==="m")if(!ke.isEnd)ye=ve;else{if(ye==-1)throw new Error("Detected ".concat(ie," closing element before finding the start"));fe.splice(ye,ve-ye+1);return}else{fe.splice(ve,1);return}}}A.removeElement=K;function J(ie,fe){for(var ye=[],ve=-1,ke=0;ke<fe.length;ke++){var Ie=fe[ke];if(Ie.name===ie)if(Ie.type==="m")if(!Ie.isEnd)ve=ke;else{if(ve==-1)throw new Error("Detected ".concat(ie," closing element before finding the start"));ye=fe.slice(ve,ke+1);break}else{ye.push(fe[ke]);break}}return ye}A.extractElement=J;function Y(ie,fe){Array.isArray(fe.cueInfos)&&!Array.isArray(fe.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),fe.cues=fe.cueInfos);for(var ye=[],ve=[],ke=0;ke<ie.length;ke++){var Ie=ie[ke];if(Ie.type==="m"&&Ie.name==="Segment"){if(ye=ie.slice(0,ke),ve=ie.slice(ke),Ie.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 Re=ve[ve.length-1].dataEnd,De=ye[ye.length-1].dataEnd,Be=new D.default().encode(ye).byteLength,Le=Be-De,Ve=Re-ve[0].tagStart;ve[0].tagStart-De,ve[0].tagStart;var Te=new A.Buffer([24,83,128,103]),Oe=new A.Buffer("01ffffffffffffff","hex"),He=Te.byteLength+Oe.byteLength,Pe=Ve,Fe;for(Fe=1;Fe<20;Fe++){var Ze=De+He+Pe,je=Ze-Re,Ne=Le+je,_e=re(ve,Ne,fe),be=new D.default().encode(_e).byteLength;if(be===Pe)return new D.default().encode([].concat(ye,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],_e));Pe=be}throw new Error("unable to refine metadata, stable size could not be found in "+Fe+" iterations!")}A.putRefinedMetaData=Y;function oe(ie){var fe=new D.default;return ie.reduce(function(ye,ve){return ye.concat(fe.encode([ve]))},[]).reduce(function(ye,ve){return ye+ve.byteLength},0)}function re(ie,fe,ye){var ve=ye.duration,ke=ye.clusterPtrs,Ie=ye.cues,Re=ie.slice(0);if(typeof ve=="number"){var De=!1;Re.forEach(function(Le){Le.type==="f"&&Le.name==="Duration"&&(De=!0,Le.data=ce(ve,8))}),De||pe(Re,"Info",[{name:"Duration",type:"f",data:ce(ve,8)}])}Array.isArray(Ie)&&pe(Re,"Cues",ue(Ie,fe));var Be=[];return Array.isArray(ke)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Be=te(ke,fe)),pe(Re,"SeekHead",Be,!0),Re}function te(ie,fe){var ye=[];return ie.forEach(function(ve){ye.push({name:"Seek",type:"m",isEnd:!1}),ye.push({name:"SeekID",type:"b",data:new A.Buffer([31,67,182,117])}),ye.push({name:"SeekPosition",type:"u",data:le(ve+fe)}),ye.push({name:"Seek",type:"m",isEnd:!0})}),ye}function ue(ie,fe){var ye=[];return ie.forEach(function(ve){var ke=ve.CueTrack,Ie=ve.CueClusterPosition,Re=ve.CueTime;ye.push({name:"CuePoint",type:"m",isEnd:!1}),ye.push({name:"CueTime",type:"u",data:le(Re)}),ye.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ye.push({name:"CueTrack",type:"u",data:le(ke)}),ye.push({name:"CueClusterPosition",type:"u",data:le(Ie+fe)}),ye.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ye.push({name:"CuePoint",type:"m",isEnd:!0})}),ye}function pe(ie,fe,ye,ve){ve===void 0&&(ve=!1);for(var ke=-1,Ie=0;Ie<ie.length;Ie++){var Re=ie[Ie];if(Re.type==="m"&&Re.name===fe&&Re.isEnd===!1){ke=Ie;break}}ke>=0?Array.prototype.splice.apply(ie,[ke+1,0].concat(ye)):ve?[].concat([{name:fe,type:"m",isEnd:!1}],ye,[{name:fe,type:"m",isEnd:!0}]).reverse().forEach(function(De){ie.unshift(De)}):(ie.push({name:fe,type:"m",isEnd:!1}),ye.forEach(function(De){ie.push(De)}),ie.push({name:fe,type:"m",isEnd:!0}))}function ee(ie){return A.Buffer.concat(ie)}A.concat=ee;function ne(ie){var fe=new A.Buffer(0);if(ie.type==="m")return ie;switch(ie.type){case"u":fe=le(ie.value);break;case"i":fe=se(ie.value);break;case"f":fe=ce(ie.value);break;case"s":fe=new A.Buffer(ie.value,"ascii");break;case"8":fe=new A.Buffer(ie.value,"utf8");break;case"b":fe=ie.value;break;case"d":fe=new B.Int64BE(ie.value.getTime().toString()).toBuffer();break}return Object.assign({},ie,{data:fe})}A.encodeValueToBuffer=ne;function le(ie){for(var fe=1;ie>=Math.pow(2,8*fe);fe++);if(fe>=7)return console.warn("7bit or more bigger uint not supported."),new B.Uint64BE(ie).toBuffer();var ye=new A.Buffer(fe);return ye.writeUIntBE(ie,0,fe),ye}A.createUIntBuffer=le;function se(ie){for(var fe=1;ie>=Math.pow(2,8*fe);fe++);if(fe>=7)return console.warn("7bit or more bigger uint not supported."),new B.Int64BE(ie).toBuffer();var ye=new A.Buffer(fe);return ye.writeIntBE(ie,0,fe),ye}A.createIntBuffer=se;function ce(ie,fe){if(fe===void 0&&(fe=8),fe===8){var ye=new A.Buffer(8);return ye.writeDoubleBE(ie,0),ye}else if(fe===4){var ye=new A.Buffer(4);return ye.writeFloatBE(ie,0),ye}else throw new Error("float type bits must 4bytes or 8bytes")}A.createFloatBuffer=ce;function he(ie){return ie instanceof Date?ie:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(ie)/1e3/1e3)}A.convertEBMLDateToJSDate=he}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var A=requireInt64Buffer(),B=requireTools(),D=requireTools(),M=requireEbmlID(),O;(function(i){i[i.STATE_TAG=1]="STATE_TAG",i[i.STATE_SIZE=2]="STATE_SIZE",i[i.STATE_CONTENT=3]="STATE_CONTENT"})(O||(O={}));var C=function(){function i(){this._buffer=new B.Buffer(0),this._tag_stack=[],this._state=O.STATE_TAG,this._cursor=0,this._total=0,this._schema=M.byEbmlID,this._result=[]}return i.prototype.decode=function(u){this.readChunk(u);var $=this._result;return this._result=[],$},i.prototype.readChunk=function(u){for(this._buffer=D.concat([this._buffer,new B.Buffer(u)]);this._cursor<this._buffer.length&&!(this._state===O.STATE_TAG&&!this.readTag()||this._state===O.STATE_SIZE&&!this.readSize()||this._state===O.STATE_CONTENT&&!this.readContent()););},i.prototype.getSchemaInfo=function(u){return this._schema[u]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},i.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var u=(0,B.readVint)(this._buffer,this._cursor);if(u==null)return!1;var $=this._buffer.slice(this._cursor,this._cursor+u.length),N=$.reduce(function(K,J,Y,oe){return K+J*Math.pow(16,2*(oe.length-1-Y))},0),F=this.getSchemaInfo(N),Z={EBML_ID:N.toString(16),schema:F,type:F.type,name:F.name,level:F.level,tagStart:this._total,tagEnd:this._total+u.length,sizeStart:this._total+u.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(Z),this._cursor+=u.length,this._total+=u.length,this._state=O.STATE_SIZE,!0},i.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var u=(0,B.readVint)(this._buffer,this._cursor);if(u==null)return!1;var $=this._tag_stack[this._tag_stack.length-1];return $.sizeEnd=$.sizeStart+u.length,$.dataStart=$.sizeEnd,$.dataSize=u.value,u.value===-1?($.dataEnd=-1,$.type==="m"&&($.unknownSize=!0)):$.dataEnd=$.sizeEnd+u.value,this._cursor+=u.length,this._total+=u.length,this._state=O.STATE_CONTENT,!0},i.prototype.readContent=function(){var u=this._tag_stack[this._tag_stack.length-1];if(u.type==="m"){if(u.isEnd=!1,this._result.push(u),this._state=O.STATE_TAG,u.dataSize===0){var $=Object.assign({},u,{isEnd:!0});this._result.push($),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+u.dataSize)return!1;var N=this._buffer.slice(this._cursor,this._cursor+u.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+u.dataSize),u.data=N,u.type){case"u":u.value=N.readUIntBE(0,N.length);break;case"i":u.value=N.readIntBE(0,N.length);break;case"f":u.value=u.dataSize===4?N.readFloatBE(0):u.dataSize===8?N.readDoubleBE(0):(console.warn("cannot read ".concat(u.dataSize," octets float. failback to 0")),0);break;case"s":u.value=N.toString("ascii");break;case"8":u.value=N.toString("utf8");break;case"b":u.value=N;break;case"d":u.value=(0,B.convertEBMLDateToJSDate)(new A.Int64BE(N).toNumber());break}if(u.value===null)throw new Error("unknown tag type:"+u.type);for(this._result.push(u),this._total+=u.dataSize,this._state=O.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var F=this._tag_stack[this._tag_stack.length-1];if(F.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<F.dataEnd)break;if(F.type!=="m")throw new Error("parent element is not master element");var $=Object.assign({},F,{isEnd:!0});this._result.push($),this._tag_stack.pop()}return!0},i}();return EBMLDecoder.default=C,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var A=typeof Reflect=="object"?Reflect:null,B=A&&typeof A.apply=="function"?A.apply:function(ne,le,se){return Function.prototype.apply.call(ne,le,se)},D;A&&typeof A.ownKeys=="function"?D=A.ownKeys:Object.getOwnPropertySymbols?D=function(ne){return Object.getOwnPropertyNames(ne).concat(Object.getOwnPropertySymbols(ne))}:D=function(ne){return Object.getOwnPropertyNames(ne)};function M(ee){console&&console.warn&&console.warn(ee)}var O=Number.isNaN||function(ne){return ne!==ne};function C(){C.init.call(this)}events.exports=C,events.exports.once=te,C.EventEmitter=C,C.prototype._events=void 0,C.prototype._eventsCount=0,C.prototype._maxListeners=void 0;var i=10;function u(ee){if(typeof ee!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ee)}Object.defineProperty(C,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(ee){if(typeof ee!="number"||ee<0||O(ee))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ee+".");i=ee}}),C.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},C.prototype.setMaxListeners=function(ne){if(typeof ne!="number"||ne<0||O(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 $(ee){return ee._maxListeners===void 0?C.defaultMaxListeners:ee._maxListeners}C.prototype.getMaxListeners=function(){return $(this)},C.prototype.emit=function(ne){for(var le=[],se=1;se<arguments.length;se++)le.push(arguments[se]);var ce=ne==="error",he=this._events;if(he!==void 0)ce=ce&&he.error===void 0;else if(!ce)return!1;if(ce){var ie;if(le.length>0&&(ie=le[0]),ie instanceof Error)throw ie;var fe=new Error("Unhandled error."+(ie?" ("+ie.message+")":""));throw fe.context=ie,fe}var ye=he[ne];if(ye===void 0)return!1;if(typeof ye=="function")B(ye,this,le);else for(var ve=ye.length,ke=Y(ye,ve),se=0;se<ve;++se)B(ke[se],this,le);return!0};function N(ee,ne,le,se){var ce,he,ie;if(u(le),he=ee._events,he===void 0?(he=ee._events=Object.create(null),ee._eventsCount=0):(he.newListener!==void 0&&(ee.emit("newListener",ne,le.listener?le.listener:le),he=ee._events),ie=he[ne]),ie===void 0)ie=he[ne]=le,++ee._eventsCount;else if(typeof ie=="function"?ie=he[ne]=se?[le,ie]:[ie,le]:se?ie.unshift(le):ie.push(le),ce=$(ee),ce>0&&ie.length>ce&&!ie.warned){ie.warned=!0;var fe=new Error("Possible EventEmitter memory leak detected. "+ie.length+" "+String(ne)+" listeners added. Use emitter.setMaxListeners() to increase limit");fe.name="MaxListenersExceededWarning",fe.emitter=ee,fe.type=ne,fe.count=ie.length,M(fe)}return ee}C.prototype.addListener=function(ne,le){return N(this,ne,le,!1)},C.prototype.on=C.prototype.addListener,C.prototype.prependListener=function(ne,le){return N(this,ne,le,!0)};function F(){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 Z(ee,ne,le){var se={fired:!1,wrapFn:void 0,target:ee,type:ne,listener:le},ce=F.bind(se);return ce.listener=le,se.wrapFn=ce,ce}C.prototype.once=function(ne,le){return u(le),this.on(ne,Z(this,ne,le)),this},C.prototype.prependOnceListener=function(ne,le){return u(le),this.prependListener(ne,Z(this,ne,le)),this},C.prototype.removeListener=function(ne,le){var se,ce,he,ie,fe;if(u(le),ce=this._events,ce===void 0)return this;if(se=ce[ne],se===void 0)return this;if(se===le||se.listener===le)--this._eventsCount===0?this._events=Object.create(null):(delete ce[ne],ce.removeListener&&this.emit("removeListener",ne,se.listener||le));else if(typeof se!="function"){for(he=-1,ie=se.length-1;ie>=0;ie--)if(se[ie]===le||se[ie].listener===le){fe=se[ie].listener,he=ie;break}if(he<0)return this;he===0?se.shift():oe(se,he),se.length===1&&(ce[ne]=se[0]),ce.removeListener!==void 0&&this.emit("removeListener",ne,fe||le)}return this},C.prototype.off=C.prototype.removeListener,C.prototype.removeAllListeners=function(ne){var le,se,ce;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 he=Object.keys(se),ie;for(ce=0;ce<he.length;++ce)ie=he[ce],ie!=="removeListener"&&this.removeAllListeners(ie);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(le=se[ne],typeof le=="function")this.removeListener(ne,le);else if(le!==void 0)for(ce=le.length-1;ce>=0;ce--)this.removeListener(ne,le[ce]);return this};function K(ee,ne,le){var se=ee._events;if(se===void 0)return[];var ce=se[ne];return ce===void 0?[]:typeof ce=="function"?le?[ce.listener||ce]:[ce]:le?re(ce):Y(ce,ce.length)}C.prototype.listeners=function(ne){return K(this,ne,!0)},C.prototype.rawListeners=function(ne){return K(this,ne,!1)},C.listenerCount=function(ee,ne){return typeof ee.listenerCount=="function"?ee.listenerCount(ne):J.call(ee,ne)},C.prototype.listenerCount=J;function J(ee){var ne=this._events;if(ne!==void 0){var le=ne[ee];if(typeof le=="function")return 1;if(le!==void 0)return le.length}return 0}C.prototype.eventNames=function(){return this._eventsCount>0?D(this._events):[]};function Y(ee,ne){for(var le=new Array(ne),se=0;se<ne;++se)le[se]=ee[se];return le}function oe(ee,ne){for(;ne+1<ee.length;ne++)ee[ne]=ee[ne+1];ee.pop()}function re(ee){for(var ne=new Array(ee.length),le=0;le<ne.length;++le)ne[le]=ee[le].listener||ee[le];return ne}function te(ee,ne){return new Promise(function(le,se){function ce(ie){ee.removeListener(ne,he),se(ie)}function he(){typeof ee.removeListener=="function"&&ee.removeListener("error",ce),le([].slice.call(arguments))}pe(ee,ne,he,{once:!0}),ne!=="error"&&ue(ee,ce,{once:!0})})}function ue(ee,ne,le){typeof ee.on=="function"&&pe(ee,"error",ne,le)}function pe(ee,ne,le,se){if(typeof ee.on=="function")se.once?ee.once(ne,le):ee.on(ne,le);else if(typeof ee.addEventListener=="function")ee.addEventListener(ne,function ce(he){se.once&&ee.removeEventListener(ne,ce),le(he)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ee)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var A=EBMLReader&&EBMLReader.__extends||function(){var O=function(C,i){return O=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,$){u.__proto__=$}||function(u,$){for(var N in $)Object.prototype.hasOwnProperty.call($,N)&&(u[N]=$[N])},O(C,i)};return function(C,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");O(C,i);function u(){this.constructor=C}C.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var B=requireEvents(),D=requireTools(),M=function(O){A(C,O);function C(){var i=O.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 C.prototype.stop=function(){for(this.ended=!0,this.emit_segment_info();this.stack.length;)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},C.prototype.emit_segment_info=function(){var i=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var N=this.lastClusterTimecode,F=this.duration,Z=this.timecodeScale;this.emit("cluster",{timecode:N,data:i}),this.emit("duration",{timecodeScale:Z,duration:F})}else{this.metadataloaded=!0,this.metadatas=i;var u=this.trackTypes.indexOf(1),$=this.trackTypes.indexOf(2);if(this.trackInfo=u>=0&&$>=0?{type:"both",trackNumber:u}:u>=0?{type:"video",trackNumber:u}:$>=0?{type:"audio",trackNumber:$}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:i,metadataSize:this.metadataSize})}},C.prototype.read=function(i){var u=this,$=!1;if(!this.ended){if(i.type==="m")if(i.isEnd)this.stack.pop();else{var N=this.stack[this.stack.length-1];if(N!=null&&N.level>=i.level){this.stack.pop(),this.logging&&console.groupEnd(),N.dataEnd=i.dataEnd,N.dataSize=i.dataEnd-N.dataStart,N.unknownSize=!1;var F=Object.assign({},N,{name:N.name,type:N.type,isEnd:!0});this.chunks.push(F)}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 Z=D.ebmlBlock(i.data),K=Z.timecode,J=Z.trackNumber,Y=Z.frames;if(this.trackTypes[J]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var oe=this.lastClusterTimecode+K;this.cues.push({CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:oe}),this.emit("cue_info",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:oe})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],K]}else if(this.trackTypes[J]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var oe=this.lastClusterTimecode+K;this.cues.push({CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:oe}),this.emit("cue_info",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:J,CueClusterPosition:this.lastClusterPosition,CueTime:oe})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],K]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&Y.forEach(function(re){var te=re.slice(3,6).toString("hex");if(te==="9d012a"){var ue=D.VP8BitStreamToRiffWebPBuffer(re),pe=new Blob([ue],{type:"image/webp"}),ee=u.duration;u.emit("webp",{currentTime:ee,webp:pe})}})}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"),$=!0):this.currentTrack.DefaultDuration=i.value:i.name==="unknown"&&console.warn(i);!this.metadataloaded&&i.dataEnd>0&&(this.metadataSize=i.dataEnd),$||this.chunks.push(i),this.logging&&this.put(i)}},Object.defineProperty(C.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var i=0,u=0,$=0,N=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof N=="number")i=N;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof F=="number"&&(u=F),$=this.last2SimpleBlockAudioTrackTimecode[1]}else{i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof F=="number"&&(u=F),$=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){i=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackInfo.trackNumber];typeof F=="number"&&(u=F),$=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){i=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var F=this.trackCodecDelay[this.trackInfo.trackNumber];typeof F=="number"&&(u=F),$=this.last2SimpleBlockAudioTrackTimecode[1]}var Z=(this.lastClusterTimecode+$)*this.timecodeScale+i-u,K=Z/this.timecodeScale;return Math.floor(K)},enumerable:!1,configurable:!0}),C.prototype.addListener=function(i,u){return O.prototype.addListener.call(this,i,u)},C.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)},C}(B.EventEmitter);return EBMLReader.default=M,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(A){var B=ebml&&ebml.__createBinding||(Object.create?function(u,$,N,F){F===void 0&&(F=N),Object.defineProperty(u,F,{enumerable:!0,get:function(){return $[N]}})}:function(u,$,N,F){F===void 0&&(F=N),u[F]=$[N]}),D=ebml&&ebml.__exportStar||function(u,$){for(var N in u)N!=="default"&&!Object.prototype.hasOwnProperty.call($,N)&&B($,u,N)};Object.defineProperty(A,"__esModule",{value:!0}),A.tools=A.Reader=A.Encoder=A.Decoder=void 0,D(requireEBML(),A);var M=requireEBMLDecoder();A.Decoder=M.default;var O=requireEBMLEncoder();A.Encoder=O.default;var C=requireEBMLReader();A.Reader=C.default;var i=requireTools();A.tools=i}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var A=lib&&lib.__awaiter||function(O,C,i,u){function $(N){return N instanceof i?N:new i(function(F){F(N)})}return new(i||(i=Promise))(function(N,F){function Z(Y){try{J(u.next(Y))}catch(oe){F(oe)}}function K(Y){try{J(u.throw(Y))}catch(oe){F(oe)}}function J(Y){Y.done?N(Y.value):$(Y.value).then(Z,K)}J((u=u.apply(O,C||[])).next())})},B=lib&&lib.__generator||function(O,C){var i={label:0,sent:function(){if(N[0]&1)throw N[1];return N[1]},trys:[],ops:[]},u,$,N,F;return F={next:Z(0),throw:Z(1),return:Z(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Z(J){return function(Y){return K([J,Y])}}function K(J){if(u)throw new TypeError("Generator is already executing.");for(;i;)try{if(u=1,$&&(N=J[0]&2?$.return:J[0]?$.throw||((N=$.return)&&N.call($),0):$.next)&&!(N=N.call($,J[1])).done)return N;switch($=0,N&&(J=[J[0]&2,N.value]),J[0]){case 0:case 1:N=J;break;case 4:return i.label++,{value:J[1],done:!1};case 5:i.label++,$=J[1],J=[0];continue;case 7:J=i.ops.pop(),i.trys.pop();continue;default:if(N=i.trys,!(N=N.length>0&&N[N.length-1])&&(J[0]===6||J[0]===2)){i=0;continue}if(J[0]===3&&(!N||J[1]>N[0]&&J[1]<N[3])){i.label=J[1];break}if(J[0]===6&&i.label<N[1]){i.label=N[1],N=J;break}if(N&&i.label<N[2]){i.label=N[2],i.ops.push(J);break}N[2]&&i.ops.pop(),i.trys.pop();continue}J=C.call(O,i)}catch(Y){J=[6,Y],$=0}finally{u=N=0}if(J[0]&5)throw J[1];return{value:J[0]?J[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var D=requireEbml();function M(O){return A(this,void 0,void 0,function(){var C,i,u,$,N,F,Z,K,J,Y,oe,re;return B(this,function(te){switch(te.label){case 0:if(!O)throw Error("call to fixWebmDuration requires a blob");C=new D.Decoder,i=new D.Reader,u=O.stream(),$=u.getReader(),te.label=1;case 1:return[4,$.read()];case 2:return N=te.sent(),F=N.done,Z=N.value,F?(i.stop(),[3,3]):(K=C.decode(Z),K=K?.filter(function(ue){return ue.type!=="unknown"}),K.forEach(function(ue){i.read(ue)}),Z=null,[3,1]);case 3:return J=D.tools.makeMetadataSeekable(i.metadatas,i.duration,i.cues),Y=new Blob([J],{type:O.type}),oe=O.slice(i.metadataSize),re=new Blob([Y,oe],{type:O.type}),[2,re]}})})}return lib.default=M,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{#e;#n=!1;#t=!1;#r=0;#o=0;#i=0;#a=0;#c=0;onchange=B=>{};onDurationChange=B=>{};constructor(){}start=async(B="")=>{B||(B=`video_Record_${E$1(Date.now())}`);let D=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(M=>{const O=M.getTracks();for(const i of O)i.onended=()=>this.stop();this.#n=!0,this.#t=!1,this.#e=new MediaRecorder(M),this.#e.start();const C=new Date().getTime();this.#r=C,this.#i=C,this.#l(),this.#s(),this.#e.addEventListener("dataavailable",i=>{D.push(i.data)}),this.#e.addEventListener("stop",async()=>{this.#n=!1;const i=new Date().getTime();this.#o=i,this.#a+=i-this.#i,this.#l(),clearInterval(this.#c);const u=M.getTracks();for(const K of u)K.stop();if(this.#e===null)return;const $=new Blob(D,{type:this.#e.mimeType}),N=await fixWebmDuration($),F=URL.createObjectURL(N),Z=document.createElement("a");Z.href=F,Z.download=`${B}.mp4`,Z.click(),URL.revokeObjectURL(F),D=[],this.#e=null})})};pause=async()=>{await new Promise(D=>setTimeout(()=>D(!0),300)),this.#e?.pause(),this.#t=!0;const B=new Date().getTime();this.#a+=B-this.#i,this.#l(),clearInterval(this.#c)};resume=async()=>{this.#e?.resume(),this.#t=!1;const B=new Date().getTime();this.#i=B,this.#l(),this.#s()};stop=async()=>{this.#e?.stop()};getDuration=()=>{if(this.#i===0)return 0;let B=this.#a;const D=new Date().getTime();if(this.#n&&this.#t===!1){const M=D-this.#i;this.#i=D,B=B+M}return B};getInfo=()=>({active:this.#n,pause:this.#t,startTime:this.#r,endTime:this.#o,duration:this.#a});#l=()=>{const B=this.getInfo();this.onchange(B)};#s=()=>{clearInterval(this.#c),this.#c=window.setInterval(()=>{this.#a=this.getDuration(),this.onDurationChange(this.#a)},500)}}var l=Object.defineProperty,y=A=>{throw TypeError(A)},q=(A,B,D)=>B in A?l(A,B,{enumerable:!0,configurable:!0,writable:!0,value:D}):A[B]=D,s=(A,B,D)=>q(A,typeof B!="symbol"?B+"":B,D),P=(A,B,D)=>B.has(A)||y("Cannot "+D),n=(A,B,D)=>(P(A,B,"read from private field"),D?D.call(A):B.get(A)),a=(A,B,D)=>B.has(A)?y("Cannot add the same private member more than once"):B instanceof WeakSet?B.add(A):B.set(A,D),d,v,o;class p{constructor(B={}){s(this,"queue",[]),s(this,"timer",0),s(this,"activeIndex",0),s(this,"activePromise"),s(this,"options",{timeout:0}),s(this,"add",(D,M={})=>new Promise(async(O,C)=>{const i=M.timeout||this.options.timeout,u=M.key||n(this,d).call(this),$=M.describe||"";if(this.queue.findIndex(F=>F.key===u)!==-1)return C(`${u} is exist.`);const N={key:u,func:D,describe:$,timeout:i,resolve:O,reject:C};this.queue.unshift(N),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,D=>{const M=this.queue.findIndex(O=>O.key===D);this.queue.splice(M,1)}),a(this,o,async()=>{const D=this.queue.length;if(D===0)return;const M=D-1,O=this.queue[M];this.activePromise=O;const{key:C,func:i,resolve:u,reject:$,timeout:N}=this.activePromise;N&&(this.timer=window.setTimeout(()=>{$(`pr-async-queue: ${C} is timeout.`),n(this,o).call(this)},N)),await i().then(u).catch($).finally(()=>{clearTimeout(this.timer),this.activePromise=void 0,n(this,v).call(this,C),n(this,o).call(this)})}),this.options={timeout:0,...B}}}d=new WeakMap,v=new WeakMap,o=new WeakMap;const enum_iceState={connecting:"连接中",connected:"已连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_iceState);class PrResolves{resolvesMap=new Map;index=0;constructor(){}add=(B,D=()=>!1,M=5e3)=>new Promise(O=>{if(D())return O(!0);this.resolvesMap.has(B)||this.resolvesMap.set(B,new Map),this.index++;const u=`${this.index}`;M=Math.max(1e3,M);const $=window.setTimeout(()=>{this.emit(B)},M);this.resolvesMap.get(B)?.set(u,{resolve:O,timer:$})});emit=async B=>{const D=this.resolvesMap.get(B);if(!D)return;const M=[...D.keys()];for(const O of M){const C=D.get(O);C&&(clearTimeout(C.timer),C.resolve(),D.delete(O))}}}class RoomBase{options={appid:"",sdkToken:"",roomId:"",userId:"",earlyId:wt(),callType:0,debug:!1,reportErr:!0,logUrl:"https://logs1.quickvo.org",newPublishAutoSubscribe:!0};sfuPush=0;sfuPull=0;p2pPush=0;p2pPull=0;prResolves=new PrResolves;sdk_service_version="1.0.8";sdk_session="";isEarly=!1;isInRoom=!1;asyncQueue;await_remote_publish_users=[];roomState="ready";iceState="closed";createAt=Date.now();cwsIns;peerIns;sfuOffsetAverageQuality=0;transceiverMap=new Map;transceiverTrackMap=new Map;sendChannel;receiveChannel;userMap=new Map;p2pMap=new Map;setLocalStreamActiveMap=new Map;phoneyStreams=new Map;recorder=new StreamRecorder;networkQualityTester=new NetworkQualityTester;mediaDevicesErrInfo={microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""};constructor(B){this.setOptions(B),this.cwsIns=new CallsWebSocket({...B}),this.asyncQueue=new p}hasAsyncTask=B=>{let D=!1;return this.asyncQueue.activePromise?.describe===B&&(D=!0),D===!1&&this.asyncQueue.queue.find(O=>O.describe===B)&&(D=!0),D};createUserUpdateStreams=(B=[])=>{const D={};for(const M of B)D[M]=wt();return D};reportLogs=(B,D="未知错误")=>{const M=this.getOptions(),{appid:O,userId:C,earlyId:i="",logUrl:u,reportErr:$}=M;if(!$)return;const N="web",F=Z=>({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})[Z].toString();{const Z=F(B),K={origin:N,type:Z,app_id:O,user_id:C,ins_id:i,desc:D},J=btoa(encodeURI(JSON.stringify(K))),Y=`${u}/upload/log?log_key=${J}`;{const oe=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),te=new TextEncoder().encode(oe),ue=pako.deflate(te,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:K,url:Y,size:it(ue.byteLength)}),fetch(Y,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:ue})}}};initPhoneyStreams=(B,D=[])=>{D.length===0&&(D=mediaType_keys);for(const M of D){const O=this.phoneyStreams.get(M);if(O){const C=O.getTracks();for(const i of C)i.stop()}switch(M){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(B));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(B));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}};getPhoneyStreams=B=>this.phoneyStreams.get(B);getRoomInfo=()=>{const{options:B,roomState:D,createAt:M}=this;return{...B,roomState:D,createAt:M}};setRoomState=B=>{if(this.roomState===B)return;this.roomState=B;const D=enum_roomState[B],M={state:B,stateStr:D};this.cwsIns.emitNotify("onRoomState",{code:200,data:M,desc:"room state is change."})};setIceState=B=>{if(this.iceState===B)return;this.iceState=B;const D=enum_iceState[B],M={state:B,stateStr:D};this.cwsIns.emitNotify("onIceState",{code:200,data:M,desc:"ice state is change."})};setOptions=B=>(this.options={...this.options,...B},this.options);getOptions=()=>this.options;stopStream=async B=>{const D=B.getTracks();for(const M of D)M.stop()};getMediaDevicesErrInfo=async()=>{try{const B=await navigator.mediaDevices.enumerateDevices();B.find(M=>M.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),B.find(M=>M.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(B){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",B)}return this.mediaDevicesErrInfo};getUserMediaKey=(B,D)=>`${B}-${D}`;getCallAction=async B=>{let D="";const M=C=>B.findIndex(({type:u,enabled:$=!0})=>u===C&&$)===-1?"0":"1";return D=`${M(0)}${D}`,D=`${M(1)}${D}`,D=`${M(2)}${D}`,D=`${M(3)}${D}`,parseInt(D,2)};getCallActionMap=(B=0)=>{const M=Number(B).toString(2).padStart(4,"0").split(""),[O,C,i,u]=M;return{microphoneCamera_audio:!!Number(u),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(C),screenSharing_audio:!!Number(O)}};getBanBehaviorMap=(B=0)=>{const M=Number(B).toString(2).padStart(4,"0").split(""),[O,C,i,u]=M;return{microphoneCamera_audio:!!Number(u),microphoneCamera_video:!!Number(i),screenSharing_video:!!Number(C),screenSharing_audio:!!Number(O)}};getAverageVolume=(B,D)=>{B.getByteFrequencyData(D);let M=0;for(let C=0;C<D.length;C++)M+=D[C];return Math.ceil(M/D.length)};getTrackNamesFormTracks=(B,D=[],M="trackName")=>{const O=[];for(const C of B){const{type:i}=C;if(D.length===0||D.includes(i)){const u=C[M];u&&O.push(`${u}`)}}return O};usersFilter=B=>dt(B,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap","useP2P"]).sort((O,C)=>O.id.localeCompare(C.id,"en"))}var m=Object.defineProperty,G=(A,B,D)=>B in A?m(A,B,{enumerable:!0,configurable:!0,writable:!0,value:D}):A[B]=D,e=(A,B,D)=>G(A,typeof B!="symbol"?B+"":B,D);let g$1=class{constructor(B,D){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",M=>M),e(this,"stop",()=>{{const M=this.inputStream.getTracks();for(const O of M)O.stop(),this.inputStream.removeTrack(O)}}),e(this,"getStream",()=>this.filterStream(this.outputStream)),e(this,"setMute",(M=!0)=>{M?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e(this,"setInputGain",M=>{this.inputGain=M,this.inputGainNode.gain.setValueAtTime(M,this.audioContext.currentTime)}),e(this,"setEnhanceGain",async M=>{this.enhanceGain=M+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e(this,"setBgsGain",M=>{this.bgsGain=M,this.bgsGainNode.gain.setValueAtTime(M,this.audioContext.currentTime)}),e(this,"setBgmGain",M=>{this.bgmGain=M,this.bgmGainNode.gain.setValueAtTime(M,this.audioContext.currentTime)}),e(this,"setOutputGain",M=>{this.outputGain=M,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e(this,"getVolume",()=>{const{analyserNode:M,analyserArrayData:O}=this;M.getByteFrequencyData(O);let C=0;for(let i=0;i<O.length;i++)C+=O[i];return Math.ceil(C/O.length)}),e(this,"mixAudio",(M,O="bgm")=>new Promise(async(C,i)=>{try{{const N=this.mixAudioMap.get(O);N&&N.stop()}const u=O==="bgs"?this.bgsGainNode:this.bgmGainNode,$=this.audioContext.createBufferSource();this.mixAudioMap.set(O,$),$.buffer=M,$.connect(u),$.onended=()=>{$.disconnect(u),this.mixAudioMap.delete(O),C(!0)},$.start(0)}catch(u){i(u)}})),e(this,"mixAudioStop",M=>{const O=this.mixAudioMap.get(M);O?.stop()}),e(this,"changeMix",(M,O)=>{const C=M==="bgs"?this.bgsGainNode:this.bgmGainNode;O?C.connect(this.destinationNode):C.disconnect(this.destinationNode)}),D&&(this.audioContext=D),this.inputStream=B,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:M,inputGainNode:O,enhanceGainNode:C,bgsGainNode:i,bgmGainNode:u,analyserNode:$,outputGainNode:N,destinationNode:F}=this;M.connect(O),O.connect(C),C.connect($),i.connect($),u.connect($),C.connect(F),i.connect(F),u.connect(F),$.connect(N),N.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}};class RoomMedias extends RoomBase{#e=[];#n=new Map;#t=new Map;#r=new Map;#o=new Map;#i=new Map;localStreamsActionMap=new Map;#a=new Map;audioContext=new(window.AudioContext||window.webkitAudioContext);constructor(B){super(B),this.#u(),this.#l(),this.#c(),document.addEventListener("click",()=>{this.audioContext?.state==="suspended"&&this.audioContext.resume()})}initMediaPhoneyStreams=(B=[])=>this.initPhoneyStreams(this.audioContext,B);initLocalStreamsFilter=()=>{for(const B of mediaType_keys){const D=async M=>M;this.#a.set(B,D)}};setLocalFilterStream=(B,D)=>{this.#a.set(B,D)};#c=()=>{this.#t.set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),this.#t.set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),this.#t.set("screenSharing_video",{frameRate:{min:10,ideal:30}}),this.#t.set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})};#l=()=>{this.#n.set("audioinput","default"),this.#n.set("videoinput","default"),this.#n.set("audiooutput","default")};emitNotifyUpdateUsersStreams=async B=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:B,desc:"users streams is change."})};initUserMediaStreamContext=async(B,D,M,O)=>{const[C]=M.getTracks();if(M.active===!1||!C)return;O&&this.removeUserMediaStreamContext(B,D);const i=this.getUserMediaKey(B,D),{kind:u}=C;switch(u){case"audio":{const $=new MediaStream;$.addTrack(C);const N=new g$1($,this.audioContext);this.#r.set(i,N)}break;case"video":{const $=new VideoMediaContext(C);this.#o.set(i,$)}break}};getUserMediaStreamContext=(B,D)=>{const M=this.getUserMediaKey(B,D);if(["microphoneCamera_audio","screenSharing_audio"].includes(D))return this.#r.get(M);if(["microphoneCamera_video","screenSharing_video"].includes(D))return this.#o.get(M)};getUserAudioMediaStreamContext=(B,D)=>{const M=this.getUserMediaKey(B,D);return this.#r.get(M)};removeUserMediaStreamContext=(B,D)=>{const M=this.getUserMediaKey(B,D);if(["microphoneCamera_audio","screenSharing_audio"].includes(D))return this.#r.get(M)?.stop(),this.#r.delete(M);if(["microphoneCamera_video","screenSharing_video"].includes(D))return this.#o.get(M)?.stop(),this.#o.get(M)};getUserStream=(B,D)=>this.getUserMediaStreamContext(B,D)?.getStream()||new MediaStream;getUserStreams=(B,D=[])=>{D.length===0&&(D=mediaType_keys);const M={};for(const O of D){const C=this.getUserStream(B,O);M[O]=C}return M};removeUserStreams=async(B,D=[])=>{D.length===0&&(D=mediaType_keys);for(const M of D)this.removeUserMediaStreamContext(B,M)};clearUserStreams=()=>{{const B=this.#r.values();for(const D of B)D.stop();this.#r=new Map}{const B=this.#o.values();for(const D of B)D.stop();this.#o=new Map}};setMediaTrackConstraints=async(B,D)=>{this.#t.set(B,D);const M=await this.getLocalStream(B);if(!M)return;const O=M.getTracks();if(O.length!==0)for(const C of O){const i=C.getConstraints(),$={...this.#t.get(B),...i,...D};await C.applyConstraints($)}};stopLocalStreams=async(B=[])=>{B.length===0&&(B=mediaType_keys);for(const D of B){const M=this.#i.get(D);M&&await this.stopStream(M),this.#i.delete(D)}};addLocalStream=(B,D)=>{const M=this.#i.get(B);M&&this.stopStream(M),this.#i.set(B,D)};initLocalStream=async B=>{switch(B){case"microphoneCamera_audio":{const D=this.#n.get("audioinput"),M=this.#t.get("microphoneCamera_audio"),O=await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...M},video:!1});this.addLocalStream("microphoneCamera_audio",O)}break;case"microphoneCamera_video":{const D=this.#n.get("videoinput"),M=this.#t.get("microphoneCamera_video"),O=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:D,...M}});this.addLocalStream("microphoneCamera_video",O)}break;case"microphoneCamera":{const D=this.#n.get("audioinput"),M=this.#n.get("videoinput"),O=this.#t.get("microphoneCamera_audio"),C=this.#t.get("microphoneCamera_video"),u=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:D,...O},video:{deviceId:M,...C}})).getTracks();for(const $ of u){const{kind:N}=$;if(N==="audio"){const F=new MediaStream;F.addTrack($),this.addLocalStream("microphoneCamera_audio",F)}if(N==="video"){const F=new MediaStream;F.addTrack($),this.addLocalStream("microphoneCamera_video",F)}}}break;case"screenSharing_audio":{const D=this.#t.get("screenSharing_audio"),O=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D})).getTracks();for(const C of O){const{kind:i}=C;if(i==="audio"){const u=new MediaStream;u.addTrack(C),this.addLocalStream("screenSharing_audio",u)}}}break;case"screenSharing_video":{const D=this.#t.get(B),O=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...D})).getTracks();for(const C of O){const{kind:i}=C;if(i==="video"){const u=new MediaStream;u.addTrack(C),this.addLocalStream("screenSharing_video",u)}}}break;case"screenSharing":{const D=this.#t.get("screenSharing_audio"),M=this.#t.get("screenSharing_video"),C=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...D,...M})).getTracks();for(const i of C){const{kind:u}=i;if(u==="audio"){const $=new MediaStream;$.addTrack(i),this.addLocalStream("screenSharing_audio",$)}if(u==="video"){const $=new MediaStream;$.addTrack(i),this.addLocalStream("screenSharing_video",$)}}}break}};getLocalStream=async B=>{const D=this.#i.get(B),M=this.#a.get(B);let O=D;return D&&M&&(O=await M(D)),O};getLocalStreams=async(B=[])=>{B.length===0&&(B=mediaType_keys);const D={};for(const M of B)D[M]=await this.getLocalStream(M);return D};#s=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(B=>{const D=B.filter(M=>!["communications"].includes(M.deviceId));this.#e=D.sort((M,O)=>M.label.localeCompare(O.label,"zh-Hans-CN",{sensitivity:"accent"}))}).catch(function(B){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",B)}),this.#e);#u=()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await this.#s(),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),this.#s()};getMediaDeviceKind=B=>this.#n.get(B);changeAudiooutput=async()=>{try{const B=this.#n.get("audiooutput");await this.audioContext.setSinkId(B)}catch(B){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",B)}};setDeviceKind=(B,D)=>{this.#n.set(B,D)};setAudioOutputDevice=B=>this.setDeviceKind("audiooutput",B);getEnumerateDevices=async B=>(await this.#s(),this.#e.filter(M=>M.kind===B));getEnumerateAudioinputDevices=()=>this.getEnumerateDevices("audioinput");getEnumerateAudioOutputDevices=()=>this.getEnumerateDevices("audiooutput");getEnumerateVideoinputDevices=()=>this.getEnumerateDevices("videoinput")}const getNetworkQuality=(A,B,D)=>{const M=Number(A),O=Number(B),C=Number(D);let i=0;return M<.03&&O<100&&C<.05?i=5:M<.06&&O<160&&C<.1?i=4:M<.1&&O<250&&C<.15?i=3:M<.15&&O<400&&C<.2?i=2:i=1,Number(i)};class PeerAnalyzeStats{pc;network={inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0};reports=[];averageQualitys=[];timer=0;constructor(){}onNetwork=B=>{};getNetwork=()=>this.network;getAverageQuality=()=>this.network.averageQuality;start=B=>{this.stop(),this.network={inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0",quality:0,averageQuality:0},this.reports=[],this.averageQualitys=[],this.pc=B,clearInterval(this.timer);const D=async()=>{this.pc?.connectionState==="connected"&&this.analyzeStats()};this.timer=window.setInterval(D,1*1e3)};analyzeStats=async()=>{try{if(!this.pc)return;const B=await this.pc.getStats(),D=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],O=[...B.values()].filter(ne=>D.includes(ne.type));let C=0,i=0,u=0,$=0,N=0,F=0,Z=[],K=[];for(const ne of this.reports){const{packetsSent:le,packetsLost:se}=ne;le&&(u+=le),se&&($+=se)}this.reports=O;for(const ne of this.reports){const{bytesSent:le,bytesReceived:se,packetsSent:ce,packetsLost:he,roundTripTime:ie,jitter:fe}=ne;le&&(i=le),se&&(C=se),ce&&(N+=ce),he&&(F+=he),ie&&Z.push((ie*100).toFixed(2)),fe&&K.push(fe.toFixed(2))}K.sort().reverse(),Z.sort().reverse();const J=N-u,Y=F-$,oe=J===0?"0.00":Math.max(0,Y/J).toFixed(2),[re="0"]=Z,[te="0"]=K,ue=getNetworkQuality(oe,re,te);this.averageQualitys.unshift(ue),this.averageQualitys=this.averageQualitys.slice(0,10);const pe=this.averageQualitys.length===10?Math.round(this.averageQualitys.reduce((ne,le)=>ne+le)/this.averageQualitys.length):0,ee={outboundBytes:i,inboundBytes:C,lostRate:oe,roundTripTime:re,jitter:te,quality:ue,averageQuality:pe};this.network=ee,this.onNetwork(this.network)}catch(B){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: analyzeStats is err.",B)}};getReports=async(B=[])=>B.length===0?this.reports:this.reports.filter(D=>B.includes(D.mid));stop=()=>{clearInterval(this.timer)}}class P2P{prResolves=new PrResolves;phoneyStreams=new Map;recv_peer_ins;recv_icecandidates=[];recv_candidate_collected=!1;recv_transceiverMap=new Map;recvPeerAnalyzeStatsIns=new PeerAnalyzeStats;send_peer_ins;send_icecandidates=[];send_candidate_collected=!1;send_transceiverMap=new Map;sendPeerAnalyzeStatsIns=new PeerAnalyzeStats;tracks=[];reports=[];getPeerStatsTimer=0;constructor(B){this.phoneyStreams=B}onSendPeerNetwork=B=>{};onRecvPeerNetwork=B=>{};getPhoneyStreams=B=>this.phoneyStreams.get(B);sendIceConnected=()=>{const B=()=>this.send_peer_ins.iceConnectionState==="connected";return this.prResolves.add("sendIceConnected",B)};recvIceConnected=()=>{const B=()=>this.recv_peer_ins.iceConnectionState==="connected";return this.prResolves.add("recvIceConnected",B)};sendCandidateCollected=()=>{const B=()=>this.send_candidate_collected;return this.prResolves.add("sendCandidateCollected",B)};recvCandidateCollected=()=>{const B=()=>this.recv_candidate_collected;return this.prResolves.add("recvCandidateCollected",B)};getSendIcecandidates=async()=>(await this.sendCandidateCollected(),this.send_icecandidates);getRecvIcecandidates=async()=>(await this.recvCandidateCollected(),this.recv_icecandidates);setOffered=()=>{const B=()=>this.send_peer_ins?.remoteDescription;return this.prResolves.add("setOffered",B)};initSenderPc=async()=>{await this.clearSenderPc(),this.send_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]});const B=M=>{M.candidate?this.send_icecandidates.push(M.candidate):(this.send_candidate_collected=!0,this.prResolves.emit("sendCandidateCollected"))};this.send_peer_ins.addEventListener("icecandidate",B);const D=M=>{const O=M.target.connectionState;switch(O){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: send_peer_ins: ${O}`),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: ${O}`),this.send_peer_ins.removeEventListener("icecandidate",B),this.send_peer_ins.removeEventListener("connectionstatechange",D);break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: send_peer_ins: ${O}`);break}};this.send_peer_ins.addEventListener("connectionstatechange",D),this.sendPeerAnalyzeStatsIns?.start(this.send_peer_ins)};clearSenderPc=async()=>{this.sendPeerAnalyzeStatsIns.stop(),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)};initRecvPc=async()=>{await this.clearRecvPc(),this.recv_peer_ins=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}]});const B=M=>{M.candidate?this.recv_icecandidates.push(M.candidate):(this.recv_candidate_collected=!0,this.prResolves.emit("recvCandidateCollected"))};this.recv_peer_ins.addEventListener("icecandidate",B);const D=M=>{const O=M.target.connectionState;switch(O){case"connected":console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: recv_peer_ins: ${O}`),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: ${O}`),this.recv_peer_ins.removeEventListener("icecandidate",B),this.recv_peer_ins.removeEventListener("connectionstatechange",D);break;default:console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: recv_peer_ins: ${O}`);break}};this.recv_peer_ins.addEventListener("connectionstatechange",D),this.recvPeerAnalyzeStatsIns?.start(this.recv_peer_ins)};clearRecvPc=async()=>{this.recvPeerAnalyzeStatsIns.stop(),this.recv_icecandidates=[],this.recv_candidate_collected=!1,this.recv_transceiverMap=new Map,this.recv_peer_ins&&this.recv_peer_ins.close()};initSenders=async(B=[])=>{const D=this.send_peer_ins.getTransceivers();for(const M of D){const{mid:O}=M,C=B.find($=>$.mid===O);if(!C)continue;const{type:i}=C;if(i===void 0)continue;const u=mediaType_keys[i];M.direction="sendonly",this.send_transceiverMap.set(u,M)}};addSenders=async(B=[])=>{const D=[];for(const M of B){if(this.send_transceiverMap.get(M))continue;const C=this.getPhoneyStreams(M),[i]=C.getTracks(),u=this.send_peer_ins.addTransceiver(i,{direction:"sendonly"});this.send_transceiverMap.set(M,u),D.push(M)}return D};addRecvs=async(B=[])=>{const D=[];for(const M of B)if(!this.recv_transceiverMap.get(M))switch(M){case"microphoneCamera_audio":case"screenSharing_audio":{const C=this.recv_peer_ins.addTransceiver("audio",{direction:"recvonly"});this.recv_transceiverMap.set(M,C),D.push(M)}break;case"microphoneCamera_video":case"screenSharing_video":{const C=this.recv_peer_ins.addTransceiver("video",{direction:"recvonly"});this.recv_transceiverMap.set(M,C),D.push(M)}break}return D};getSenderTracks=async(B=[])=>{const D=[];for(const M of B){const O=this.send_transceiverMap.get(M);if(!O)continue;const{mid:C,sender:i}=O,{track:u}=i;if(!u)continue;const{id:$,enabled:N}=u,F=mediaType_keys.findIndex(J=>J===M),Z=wt(),K={type:F,enabled:N,trackName:`web-${F}-${$}`,location:"local",mid:C,key:Z,origin:"p2p",mediaType:M};D.push(K)}return D};getRecvTracks=async(B=[])=>{const D=[];for(const M of B){const O=this.recv_transceiverMap.get(M);if(!O)continue;const{mid:C,receiver:i}=O,{track:u}=i;if(!u)continue;const{id:$,enabled:N}=u,F=mediaType_keys.findIndex(J=>J===M),Z=wt(),K={type:F,enabled:N,trackName:`web-${F}-${$}`,location:"local",mid:C,key:Z};D.push(K)}return D};createOffer=()=>new Promise(async(B,D)=>{try{const M=await this.recv_peer_ins.createOffer();await this.recv_peer_ins.setLocalDescription(M),B(M)}catch(M){D(M)}});setOffer=async B=>{await this.send_peer_ins.setRemoteDescription(B),await this.prResolves.emit("setOffered")};createAnswer=()=>new Promise(async B=>{const D=await this.send_peer_ins.createAnswer();await this.send_peer_ins.setLocalDescription(D),B(D)});addCandidates=async B=>{await this.setOffered();for(const D of B)await this.send_peer_ins.addIceCandidate(D)};setAnswer=async(B,D)=>{await this.recv_peer_ins.setRemoteDescription(B);for(const M of D)await this.recv_peer_ins.addIceCandidate(M)};getTrack=B=>this.recv_transceiverMap.get(B)?.receiver?.track;getSendPeerNetwork=()=>this.sendPeerAnalyzeStatsIns.getNetwork();getRecvPeerNetwork=()=>this.recvPeerAnalyzeStatsIns.getNetwork()}class RoomUsers extends RoomMedias{constructor(B){super(B)}getP2PIns=async B=>this.p2pMap.get(B);getMaxVolumeUser=()=>{const B=Array.from(this.userMap.values(),({id:M})=>M);if(B.length===0)return;let D=[];for(const M of B){const O=this.getUserAudioMediaStreamContext(M,"microphoneCamera_audio");if(!O)continue;const C=O.getVolume();D.push({id:M,volume:C})}return D=D.sort((M,O)=>M.volume-O.volume>0?-1:1),D[0]};setVolume=(B,D,M)=>{this.getUserAudioMediaStreamContext(B,D)?.setInputGain(M)};setEnhanceGain=async(B,D,M)=>{this.getUserAudioMediaStreamContext(B,D)?.setEnhanceGain(M)};setSpeaker=(B,D,M)=>{const O=this.getUserAudioMediaStreamContext(B,D);O?.setOutputGain(M);const C=M===0;try{O?.setMute(C)}catch{}};playBgs=(B,D,M)=>this.getUserAudioMediaStreamContext(B,D)?.mixAudio(M,"bgs");setBgsGain=(B,D,M)=>{this.getUserAudioMediaStreamContext(B,D)?.setBgsGain(M)};stopBgs=(B,D)=>{this.getUserAudioMediaStreamContext(B,D)?.mixAudioStop("bgs")};playBgm=(B,D,M)=>this.getUserAudioMediaStreamContext(B,D)?.mixAudio(M,"bgm");setBgmGain=(B,D,M)=>{this.getUserAudioMediaStreamContext(B,D)?.setBgmGain(M)};stopBgm=(B,D)=>{this.getUserAudioMediaStreamContext(B,D)?.mixAudioStop("bgm")};changBgsMix=(B,D,M)=>{this.getUserAudioMediaStreamContext(B,D)?.changeMix("bgs",M)};changBgmMix=(B,D,M)=>{this.getUserAudioMediaStreamContext(B,D)?.changeMix("bgm",M)};getVolume=(B,D)=>this.getUserAudioMediaStreamContext(B,D)?.getVolume();clearUsers=()=>{this.userMap=new Map};removeUsers=async B=>{for(const D of B)this.userMap.delete(D),await this.removeUserStreams(D)};createUser=async B=>{const D=Date.now(),M=this.getOptions(),O={id:B,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:B===M.userId,isPublished:!1,useP2P:!1,joinTime:D,updateAt:D,network:{egress:0,ingress:0},tracks:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(B,O);{const C=new P2P(this.phoneyStreams);this.p2pMap.set(B,C)}};getUser=async B=>(this.userMap.has(B)||await this.createUser(B),this.userMap.get(B));getUsers=async(B=[])=>{B.length===0&&(B=[...this.userMap.keys()]);const D=[];for(const M of B){const O=await this.getUser(M);D.push(O)}return D};getAllUserTrackMids=async()=>{const B=await this.getUsers(),D=[];for(const M of B){const{tracks:O=[]}=M;for(const C of O)D.push(C.mid)}return D};getUserTrackByTrackName=async B=>{const D=await this.getUsers(),M=[];for(const O of D){const{tracks:C=[]}=O;for(const i of C){const{trackName:u}=i;B.includes(u)&&M.push(i)}}return M};getUserTrackByMid=async B=>{const D=await this.getUsers();let M;for(const O of D){const{tracks:C=[]}=O;for(const i of C)if(i.mid===B){M=i;break}}return M};getUsersMediaTypeBytrackNames=async B=>{if(B.length===0)return[];const D=[],M=await this.getUsers();for(const O of M){const{id:C,tracks:i=[]}=O,u=[];for(const N of i){const{trackName:F,mediaType:Z}=N;!B.includes(F)||!Z||u.push(Z)}if(u.length===0)continue;const $={userId:C,mediaTypes:u};D.push($)}return D};getUserTrackByUserMediaTypes=async(B=[],D)=>{const M=[],O=await this.getUsers();for(const C of O){const{id:i,tracks:u=[]}=C;let $=[];const N=B.find(F=>F.userId===i);if(N&&($=u.filter(F=>N.mediaTypes.includes(F.mediaType)),$.length!==0)){if(D!==void 0)for(const F of $)F.lastRetry=D;M.push({id:i,tracks:$})}}return M};getAllUserMediaTypes=async()=>{const B=[],D=await this.getUsers();for(const M of D){const{id:O,tracks:C=[],isSelf:i}=M;if(i)continue;const u=Array.from(C,$=>$.mediaType);B.push({userId:O,mediaTypes:u})}return B};checkUserInRoom=B=>this.userMap.has(B);getUsersId=async()=>[...this.userMap.keys()];getSelfInfo=async()=>await this.getUser(this.options.userId);updateIsPublished=async(B,D=!1)=>{const M=await this.getUser(B);M.isPublished=D};setUserUpdateStreams=async(B,D,M=!0)=>{const O=await this.getUser(B),C={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};C[D]=M,O.updateStreams=C};updateUsertracks=async(B,D=[],M)=>{const O=await this.getUser(B);M&&(D=[...O.tracks,...D]),D=D.filter(({mid:u=""})=>u!==""),D=pt(D,["type"]),D=D.sort((u,$)=>u.type-$.type<0?-1:1);for(const u of D)u.userId=B,u.mediaType=mediaType_keys[u.type],u.enabled===void 0&&(u.enabled=!0),u.origin===void 0&&(u.origin="sfu");O.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const C=dt(O.tracks,["mediaType","enabled","mid","msid","trackName","key"]),i=dt(D,["mediaType","enabled","mid","msid","trackName","key"]);for(const u of mediaType_keys){const $=i.find(Z=>Z.mediaType===u),N=C.find(Z=>Z.mediaType===u),F=JSON.stringify($)!==JSON.stringify(N);O.updateStreams[u]=F}O.tracks=D};updateUserCallAction=async(B,D=0)=>{const M=await this.getUser(B);M.callAction=D,M.callActionStr=D.toString(2).padStart(4,"0"),M.callActionMap=this.getCallActionMap(D)};updateUserBehaviors=async(B,D=0)=>{const M=await this.getUser(B);M.banBehavior=D,M.banBehaviorStr=D.toString(2).padStart(4,"0"),M.banBehaviorMap=this.getBanBehaviorMap(D)};updateUserNetwork=async(B,D={egress:5,ingress:5})=>{const M=await this.getUser(B);M.network=D};updateUserPermissions=async(B,D)=>{if(D){const M=await this.getUser(B);M.permissions=D}};updateUserUseP2P=async(B,D)=>{const M=await this.getUser(B);M.useP2P=D};updateUserBase=async B=>{const D=this.getOptions(),M=await this.getUser(B);M.isSelf=B===D.userId,M.updateAt=Date.now()};updateUsers=async B=>{for(const D of B){const{id:M,tracks:O,callAction:C,permissions:i,isPublished:u,useP2P:$}=D;await this.updateUserBase(M),await this.updateIsPublished(M,u),await this.updateUserPermissions(M,i),await this.updateUsertracks(M,O,!0),await this.updateUserCallAction(M,C),await this.updateUserNetwork(M),await this.updateUserUseP2P(M,$)}};emitNotifyUpdateUser=async B=>{const D=await this.getUsers([B]),[M]=this.usersFilter(D);this.cwsIns.emitNotify("onRoomUser",{code:200,data:M,desc:"user info is change."})};emitNotifyUpdateUsers=async()=>{const B=await this.getUsers(),D=this.usersFilter(B);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:D,desc:"all users info is change."})}}class RoomPeer extends RoomUsers{#e=0;peerAnalyzeStatsIns=new PeerAnalyzeStats;offset_inboundBytes=0;offset_outboundBytes=0;constructor(B){super(B),this.initPeer(),this.peerAnalyzeStatsIns.onNetwork=this.#r}saveBoundBytes=B=>{const D=this.peerAnalyzeStatsIns?.getNetwork();D&&(B==="superfluous"&&(this.offset_inboundBytes=-D.inboundBytes,this.offset_outboundBytes=-D.outboundBytes),B==="missing"&&(this.offset_inboundBytes=this.offset_inboundBytes+D.inboundBytes,this.offset_outboundBytes=this.offset_outboundBytes+D.outboundBytes))};getTrafficUse=()=>{const{sfuPush:B,sfuPull:D,p2pPush:M,p2pPull:O}=this;return{sfuPush:B,sfuPull:D,p2pPush:M,p2pPull:O}};initPeer=()=>{clearTimeout(this.#e),this.saveBoundBytes("missing"),this.transceiverMap=new Map,this.peerIns?.close(),this.peerIns=void 0,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.#n(),this.initMediaPhoneyStreams(),this.startGetPeerStats()};replaceSenderStream=async(B=[],D)=>{const M=this.getOptions(),{userId:O}=M;B.length===0&&(B=mediaType_keys);for(const C of B){const i=this.transceiverMap.get(C);let u;if(i){const{sender:$}=i;D?u=this.getUserStream(O,C):u=this.getPhoneyStreams(C);const[N]=u.getTracks();await $.replaceTrack(N)}}};getSenderTracks=async(B=[])=>{const D=[];for(const M of B){const O=this.transceiverTrackMap.get(M);O&&D.push(O)}return D};addSenders=async(B=[])=>{B.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const D=[];for(const M of B){if(this.transceiverMap.get(M))continue;const C=this.getPhoneyStreams(M),[i]=C.getTracks(),u=this.peerIns.addTransceiver(i,{direction:"sendonly"});this.transceiverMap.set(M,u),D.push(M)}if(B.length===0||D.length!==0){const M=await this.peerIns.createOffer();if(this.options.debug){const O=libExports$1.parse(M.sdp),C=dt(O.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:C,sdpJson:O,description:M})}await this.peerIns.setLocalDescription(M);for(const O of B){const C=this.transceiverMap.get(O);if(!C)continue;const{mid:i,sender:u}=C,{track:$}=u;if(!$)continue;const{enabled:N}=$,F=mediaType_keys.findIndex(J=>J===O),Z=`WEB-${F}-${wt()}`,K={type:F,mediaType:O,enabled:N,trackName:Z,location:"local",mid:i,key:"",origin:"sfu"};this.transceiverTrackMap.set(O,K)}}return D};removeSenders=async(B=[])=>{B.length===0&&(B=mediaType_keys);for(const D of B)this.transceiverMap.has(D)&&(this.transceiverMap.delete(D),this.transceiverTrackMap.delete(D))};stopSenders=(B=[])=>{B.length===0&&(B=mediaType_keys);for(const D of B){if(!this.transceiverMap.has(D))continue;const M=this.transceiverMap.get(D);M?.sender.track?.stop(),M?.stop()}};#n=()=>{const B=()=>{clearTimeout(this.#e),this.setIceState("failed")};this.peerIns.onconnectionstatechange=async D=>{const M=D.target.connectionState;switch(M){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${M}`),clearTimeout(this.#e),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:${M}`),this.setIceState("disconnected"),this.#e=window.setTimeout(B,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:${M}`),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:${M}`),clearTimeout(this.#e),this.setIceState("closed");break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${M}`);break}}};iceConnected=()=>{const B=()=>this.peerIns.connectionState==="connected";return this.prResolves.add("iceConnected",B)};stopTransceivers=async B=>{const D=this.peerIns.getTransceivers();for(const M of D){const{mid:O}=M;O&&B.includes(O)&&(M.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver: ${O} is stop.`,M))}};createOffer=async()=>{const B=await this.peerIns.createOffer();if(this.options.debug){const D=libExports$1.parse(B.sdp),M=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:M,sdpJson:D,description:B})}await this.peerIns.setLocalDescription(B)};createAnswer=async()=>{const B=await this.peerIns.createAnswer();if(this.options.debug){const D=libExports$1.parse(B.sdp),M=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:M,sdpJson:D,description:B})}await this.peerIns.setLocalDescription(B)};getSdp=()=>this.peerIns.localDescription?.sdp;setRemoteDescription=async B=>{if(this.options.debug){const D=libExports$1.parse(B.sdp),M=dt(D.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:M,sdpJson:D,description:B})}return await this.peerIns.setRemoteDescription(B),B};setCallStrategy=async(B,D=[])=>{D.length===0&&(D=mediaType_keys);let M="balanced";switch(B){case"qualityPriority":M="maintain-resolution";break;case"fluencyPriority":M="maintain-framerate";break;case"balancedDowngrade":M="balanced";break}const O=await this.getSelfInfo(),C=Array.from(O.tracks,({trackName:u})=>u),i=this.peerIns.getSenders();for(const u of i){const{track:$}=u;if(!$||!C.includes($.id))continue;const N=u.getParameters();u.setParameters({...N,degradationPreference:M})}};setRTCRtpSenderParameters=B=>{try{const D=this.peerIns.getSenders();for(const M of D){const O=M.getParameters();M.setParameters({...O,...B})}}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",D)}};getPeerNetwork=()=>{const B=this.peerAnalyzeStatsIns?.getNetwork();return JSON.parse(JSON.stringify(B))};getRoomNetwork=()=>{const B=this.peerAnalyzeStatsIns?.getNetwork(),D=JSON.parse(JSON.stringify(B));return D.inboundBytes=Math.max(0,D.inboundBytes+this.offset_inboundBytes),D.outboundBytes=Math.max(0,D.outboundBytes+this.offset_outboundBytes),D};#t=()=>{const B=this.getRoomNetwork();{const{outboundBytes:D,inboundBytes:M}=B;this.sfuPush=Math.ceil(D/1024),this.sfuPull=Math.ceil(M/1024)}this.cwsIns.emitNotify("onRoomNetwork",{code:200,data:B,desc:"room network is change."})};#r=async B=>{try{const{quality:D}=B;D>=2&&this.prResolves.emit("senderActived"),this.#t();const M=await this.getSelfInfo(),{network:O}=M,C={egress:D,ingress:D};Ct("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,C),JSON.stringify(O)!==JSON.stringify(C)){this.emitNotifyUpdateUsers();const $=this.getOptions(),{userId:N,roomId:F}=$,Z={...C,userId:N,roomId:F};this.cwsIns.sendMessage({event:"networkQualityChange",data:Z},!1)}},3*1e3)}catch(D){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",D)}};getReportsByMid=async(B=[])=>this.peerAnalyzeStatsIns?.getReports(B);startGetPeerStats=()=>{this.peerAnalyzeStatsIns.start(this.peerIns);const B=[...this.p2pMap.values()];for(const D of B)D.sendPeerAnalyzeStatsIns.start(D.send_peer_ins),D.recvPeerAnalyzeStatsIns.start(D.recv_peer_ins)};stopGetPeerStats=()=>{this.peerAnalyzeStatsIns.stop();const B=[...this.p2pMap.values()];for(const D of B)D.sendPeerAnalyzeStatsIns.stop(),D.recvPeerAnalyzeStatsIns.stop()}}const g=(A,B)=>{if(!(A!=null&&A.ip)||!(A!=null&&A.port)||!(A!=null&&A.serve_ip)||!(A!=null&&A.serve_port)||!(B!=null&&B.ip)||!(B!=null&&B.port)||!(B!=null&&B.serve_ip)||!(B!=null&&B.serve_port))return"Unknown";const[D,M]=[A.ip,A.port],[O,C]=[A.serve_ip,A.serve_port],[i,u]=[B.ip,B.port],[$,N]=[B.serve_ip,B.serve_port];return D===i&&M===u?"Full Cone":D===O&&(i!==O||u!==M)||i===$&&(D!==$||M!==u)?"Restricted Cone":D===O&&M===C&&(i!==O||u!==C)||i===$&&u===N&&(D!==$||M!==N)?"Port Restricted Cone":"Symmetric"},h=async()=>{const A="stun.cloudflare.com:3478",B="stun.l.google.com:19302",D=async M=>new Promise(O=>{const C=new RTCPeerConnection({iceServers:[{urls:`stun:${M}`}]});C.createDataChannel("ice-channel");let i=null;C.onicecandidate=u=>{var $,N;if((($=u.candidate)==null?void 0:$.type)==="srflx"){const[F,Z]=M.split(":").map(K=>K.trim());i={ip:u.candidate.address||"",port:(N=u.candidate.port)==null?void 0:N.toString(),serve_ip:F,serve_port:Z},C.close(),O(i)}},setTimeout(()=>{C.close(),O(null)},5e3),C.createOffer().then(u=>C.setLocalDescription(u)).catch(()=>O(null))});try{const M=await D(A),O=await D(B);if(!M||!O)return{address:"",natType:"Unknown"};const C=g(M,O);return{address:M.ip||"",natType:C}}catch(M){return console.error("获取NAT类型失败:",M),{address:"",natType:"Unknown"}}};class RoomCalls extends RoomPeer{#e=0;#n;constructor(B){super(B),this.#d()}setLocalStream=(B,D)=>new Promise(async(M,O)=>{try{const C=[];typeof B=="string"?C.push(B):C.push(...B);for(const u of C)this.localStreamsActionMap.set(u,D);if(D){if(B.includes("microphoneCamera_audio")&&B.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):B.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):B.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):B.includes("screenSharing_audio")&&B.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):B.includes("screenSharing_audio")&&!B.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):B.includes("screenSharing_video")&&!B.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),B.includes("screenSharing_audio")){const u=await this.getLocalStream("screenSharing_audio");if(u){const $=u.getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(B.includes("screenSharing_video")){const u=await this.getLocalStream("screenSharing_video");if(u){const $=u.getTracks();for(const N of $)N.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(C);const i=await this.getLocalStreams(C);if(await this.cwsIns.emitNotify("onLocalStream",{code:200,data:i,desc:"local stream is change."}),this.isInRoom){const u=()=>new Promise(async $=>{const N=this.getOptions(),{userId:F}=N,Z={};for(const K of C){const J=await this.getLocalStream(K);J&&(Z[K]=wt(),await this.initUserMediaStreamContext(F,K,J,!1))}await this.replaceSenderStream(C,D),await this.emitNotifyUpdateUsersStreams([{userId:F,updateStreams:Z}]),$(!0)});this.asyncQueue.add(u,{describe:"setLocalStream"})}M(i)}catch(C){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",C),O(C)}});setMediaDeviceKind=(B,D)=>{const M=()=>new Promise(async(O,C)=>{this.setDeviceKind(B,D);const i=await this.getSelfInfo(),{id:u,tracks:$=[],callActionMap:N}=i,F=[],Z=async K=>{const J=this.localStreamsActionMap.get(K),Y=$.find(re=>re.mediaType===K),oe=N[K];if(J){F.push(K),await this.stopLocalStreams([K]);try{await this.initLocalStream(K)}catch(re){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",re),await this.inactiveTracks([K],!1),C(re)}}if(Y){const re=await this.getLocalStream(K);if(re&&(await this.initUserMediaStreamContext(u,K,re,!0),oe)){await this.replaceSenderStream([K],!0);const te=await this.getUsersId();await this.p2p.replaceSenderStreams(te,F,!0)}}{if(F.length!==0){const re=await this.getLocalStreams(F);await this.cwsIns.emitNotify("onLocalStream",{code:200,data:re,desc:"local stream is change."});const te=this.createUserUpdateStreams(F);await this.emitNotifyUpdateUsersStreams([{userId:this.options.userId,updateStreams:te}]),await this.emitNotifyUpdateUsers()}O(!0)}};B==="audioinput"&&await Z("microphoneCamera_audio"),B==="videoinput"&&await Z("microphoneCamera_video"),B==="audiooutput"&&(await this.changeAudiooutput(),O(!0))});return this.asyncQueue.add(M,{describe:"publish"})};changeScreenSharing=async B=>{const D=await this.getSelfInfo(),{tracks:M=[],callActionMap:O}=D;try{await this.setLocalStream(B,!0);for(const C of B)M.find(u=>u.mediaType===C&&O[C])&&await this.replaceSenderStream([C],!0)}catch(C){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",C)}};earlyConnect=(B=[])=>new Promise(async(D,M)=>{try{this.isEarly=!0,await this.#a(),await this.#c(),B.length===0&&(B=["microphoneCamera_audio","microphoneCamera_video"]),await this.#l(B),D(!0)}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: error",O),M(O)}});joinRoom=async B=>(this.isInRoom=!0,this.setOptions(B),await this.#a(),await this.cwsConnected(),new Promise(async(D,M)=>{this.#n=async()=>{try{const{userId:O,callType:C,sdkToken:i,roomId:u}=this.getOptions();this.clearUsers(),await this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:C,roomId:u,user:{id:O,tracks:[],callAction:0},token:i},version:2}).then(async $=>{const{code:N=0,desc:F="服务器繁忙",data:Z}=$;if(N!==200)throw new Error(F);const{roomId:K="",roomUsers:J=[]}=Z;if(K!==u)return M("加入的房间不匹配");this.sfuPush=0,this.sfuPull=0,this.p2pPush=0,this.p2pPull=0,this.saveBoundBytes("superfluous"),this.initHeartbeat(),this.startGetPeerStats(),this.isEarly===!1&&await this.#c(),await this.updateUsers(J);for(const oe of J){const{id:re}=oe;await this.updateUserBehaviors(re,oe.behavior)}await this.emitNotifyUpdateUsers();const Y=await this.getUsers();D(Y)})}catch(O){M(O)}},this.#n()}));quitRoom=()=>new Promise(async B=>{const D=this.getOptions(),{roomId:M,userId:O}=D;try{if(this.isInRoom===!1)return B(!0);const C=async u=>{clearTimeout(u),this.isInRoom=!1,this.stopHeartbeat(),this.transceiverMap=new Map,this.peerAnalyzeStatsIns?.stop();const $=()=>this.stopSubscribe(),N=()=>this.cwsIns.sendMessage({event:"quitRoom",data:{roomId:M,user:{id:O}}});Promise.all([$(),N()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.clearUsers(),this.setRoomState("ready")},i=window.setTimeout(()=>C(i),2*1e3);try{await this.stopPublish(),C(i)}catch{}B(!0)}catch(C){this.reportLogs("quit_room_error",C.message||C)}});quitRoomEx=()=>new Promise(async B=>{const D=this.getOptions(),{roomId:M,userId:O}=D;try{if(this.isInRoom===!1)return B(!0);const C=async u=>{clearTimeout(u),this.isInRoom=!1,this.initHeartbeat(),this.peerAnalyzeStatsIns?.stop();const $=()=>this.stopSubscribe(),N=()=>this.cwsIns.sendMessage({event:"quitRoomEx",data:{roomId:M,user:{id:O}}});Promise.all([$(),N()]).finally(()=>()=>this.cwsIns.clearEvents()),this.asyncQueue.clear(),this.clearUserStreams(),this.clearUsers()},i=window.setTimeout(()=>C(i),2*1e3);try{await this.stopLocalStreams(),C(i)}catch{this.restoreICE()}B(!0)}catch(C){this.reportLogs("quit_room_error",C.message||C)}});syncRoomInfo=()=>new Promise(async(B,D)=>{try{const M=this.getOptions(),{userId:O}=M,C=await this.getUser(O),{id:i=O,callAction:u=0}=C;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:i,callAction:u}}}).then(async $=>{const{code:N=0,desc:F,data:Z={}}=$;if(N!==200)throw new Error(F);const{isActive:K=!1,users:J=[]}=Z;if(K===!1)throw new Error("Do not stay in this room.");if(J.find(oe=>oe.id===O)===!1)throw new Error("Need to rejoin the room.");this.clearUsers(),await this.updateUsers(J),await this.updateUsertracks(C.id,C.tracks,!1);{const oe=await this.getUsers();B(oe)}})}catch(M){D(M)}});checkInRoom=()=>new Promise(async B=>{const D=this.getOptions(),{userId:M}=D,O=await this.getUser(M),{id:C=M,callAction:i=0}=O;await this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:C,callAction:i}}}).then(async u=>{const{code:$=0,desc:N}=u;if($!==200)throw new Error(N);const F=u.data.users;return u.data?.isActive||F.find(K=>K.id===M)?B(!0):B(!1)}).catch(()=>B(!1))});senderActived=async B=>{const D=()=>{const{quality:M}=this.peerAnalyzeStatsIns?.getNetwork();return M>=2};await this.prResolves.add("senderActived",D,B)};publish=B=>new Promise(async(D,M)=>{try{{const $=await this.getSelfInfo(),{banBehaviorMap:N}=$;let F=!0;for(const Z of B)if(N[Z]){F=!1;break}if(F===!1)return M("publish is error: prohibited by administrator.")}const O=await this.getSelfInfo();for(const $ of B){const N=this.getPhoneyStreams($);await this.initUserMediaStreamContext(O.id,$,N,!0)}await this.replaceSenderStream(B,!1),await this.#l(B);const C=setTimeout(async()=>{await this.replaceSenderStream(B,!0),await this.inactiveTracks(B,!1)},5*1e3);this.setLocalStream(B,!0).then(()=>clearTimeout(C));const i=await this.getSenderTracks(B);await this.updateUsertracks(O.id,i,!0);const u=await this.getCallAction(O.tracks);await this.#i(u),await this.senderActived(3e3),this.#r(B);{await this.emitNotifyUpdateUsers();const $=this.createUserUpdateStreams(B);await this.emitNotifyUpdateUsersStreams([{userId:O.id,updateStreams:$}]),D(!0)}}catch(O){this.reportLogs("publish_error",O.message||O),M(O)}});stopPublish=(B=[])=>new Promise(async(D,M)=>{try{const O=await this.getSelfInfo();B.length===0&&(B=mediaType_keys),await this.replaceSenderStream(B,!0),await this.removeSenders(B),await this.#s([{userId:O.id,mediaTypes:B}],!0);const C=await this.getCallAction(O.tracks);await this.#i(C),await this.setLocalStream(B,!1),await this.emitNotifyUpdateUsers(),D(!0)}catch(O){this.reportLogs("close_track_error",O.message||O),M(O)}});inactiveTracks=async(B,D)=>new Promise(async M=>{const O=await this.getSelfInfo();if(!O||!O.id)return M(!0);const{tracks:C=[]}=O,i=[...C];for(let $ of i){const{mediaType:N}=$;if(N&&B.includes(N)){$.enabled=D;const F=await this.getLocalStream(N);if(!F)continue;const Z=F.getTracks();for(const K of Z)K.enabled=D}}await this.replaceSenderStream(B,D);const u=await this.getCallAction(i);await this.#i(u),await this.emitNotifyUpdateUsers(),M(!0)});subscribe=(B=[])=>{const D=()=>new Promise(async(M,O)=>{try{B.length===0&&(B=await this.getAllUserMediaTypes()),await this.iceConnected();const C=($,N=!1)=>new Promise(async F=>{const Z=async J=>{const Y=[],oe=[],re=[];let te=0,ue=0;for(const pe of J){const{id:ee,tracks:ne=[]}=pe;te=te+ne.length;const le=await this.getUser(ee);if(!le)continue;const se=[],ce=[],he=[];for(const ie of ne){const{code:fe=0,mid:ye,type:ve}=ie,ke=le.tracks.find(Ie=>Ie.type===ve);if(ke)switch(fe){case 200:se.push({...ke,mid:ye});break;case 2026:he.push({...ke,mid:ye});break;default:ce.push({...ke});break}}se.length!==0&&(Y.push({id:ee,tracks:se}),ue=ue+se.length),ce.length!==0&&oe.push({id:ee,tracks:ce}),he.length!==0&&re.push({id:ee,tracks:he})}return{expectation_num:te,success_num:ue,success_users:Y,fail_users:oe,retry_users:re}},K=async(J,Y="成功",oe=[])=>{const{expectation_num:re,success_num:te,success_users:ue,fail_users:pe,retry_users:ee}=await Z(oe);F({code:J,msg:Y,expectation_num:re,success_num:te,success_users:ue,fail_users:pe,retry_users:ee})};try{const J=await this.getUserTrackByUserMediaTypes($,N);if(J.length===0)return K(200,"成功",[]);const Y=await this.cwsIns.sendMessage({event:"subscribe",data:{session:this.sdk_session,users:J}}),{code:oe=0,desc:re,sn:te="",data:ue={}}=Y;if(this.#o(te),oe===2017&&re.includes("renegotiation is expected before pulling or pushing tracks")&&await this.#t(),oe===2026){const ne=[];for(const le of J)ne.push({...le,code:2026});return await K(oe,re,ne)}if(oe!==200)return await K(oe,re);const{remoteSdp:pe,users:ee=[]}=ue;if(pe){const ne=new RTCSessionDescription({type:"offer",sdp:pe});await this.setRemoteDescription(ne),await this.#t()}await K(200,"成功",ee)}catch(J){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: error",J),await K(0,J.message||J)}}),i=($=[])=>new Promise(N=>{this.await_remote_publish_users=$;let F=0;for(const re of $)F=F+re.tracks.length;const Z=[],K=wt(),J=async()=>{this.cwsIns.removeNotify([K]);const re=await C(Z);this.await_remote_publish_users=[],N(re)},Y=setTimeout(()=>J(),30*1e3),oe=async re=>{const{user:te}=re.data,{id:ue,tracks:pe=[],callAction:ee=0}=te;await this.updateUserCallAction(ue,ee),await this.updateUserPermissions(ue,3),await this.updateUsertracks(ue,pe,!0);const ne=[],le=$.find(he=>he.id===ue);if(!le)return;for(const he of le.tracks)for(const ie of pe)ie.type===he.type&&ne.push(he.mediaType);const se=[...new Set(ne)];se.length!==0&&Z.push({userId:ue,mediaTypes:se});let ce=0;for(const he of Z)ce=ce+he.mediaTypes.length;ce===F&&(clearTimeout(Y),J())};this.cwsIns.addNotify({sn:K,event:"onPublish",callback:oe},!0)}),u=async($=[])=>{let N=0;const F=new Map,Z=this.peerIns.getTransceivers(),K=[],J=[];for(const oe of $){const{id:re,tracks:te=[]}=oe;if(this.checkUserInRoom(re)){await this.updateUsertracks(re,te,!0);for(const pe of te){const{mid:ee,mediaType:ne}=pe,le=Z.find(ce=>ce.mid===ee);if(!le)continue;const{receiver:se}=le;if(se.track){{pe.msid=se.track.id;const ce=new MediaStream;ce.addTrack(se.track),await new Promise(fe=>setTimeout(()=>fe(!0),1e3));const{current_origin:he,suggest_origin:ie}=await this.#f(re,ne);if(await this.#u(re,[ne],ie),["microphoneCamera_audio","screenSharing_audio"].includes(ne)){const fe=new Audio;fe.srcObject=ce,(ne==="microphoneCamera_audio"||ne==="screenSharing_audio")&&this.getUserAudioMediaStreamContext(re,ne)?.setMute(!1)}ie==="p2p"&&J.push({userId:re,mediaTypes:[ne]}),he==="p2p"&&ie==="sfu"&&(K.push(re),this.p2p.reportP2PConnect(this.options.userId,re,"poor_network","poor network quality."));{F.has(re)||F.set(re,{userId:re,tracks:[],updateStreams:{}});const ye=F.get(re);ye.tracks.push(pe),ye.updateStreams[ne]=wt()}}N=N+1}}}}const Y=[...F.values()];return await this.emitNotifyUpdateUsersStreams(Y),K.length!==0&&this.p2p.closeRecv(K),J.length!==0&&this.#s(J,!1),await this.emitNotifyUpdateUsers(),N};{let $=await C(B,!1),{expectation_num:N,success_num:F,success_users:Z=[],fail_users:K=[]}=$;if(Z.length!==0){const J=await u(Z);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${J}/${F}/${N}`,{actual_num:J,success_num:F,expectation_num:N})}if(K.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ","The first subscription attempt failed completely. It will attempt to subscribe again in 4 seconds."),await new Promise(pe=>setTimeout(()=>pe(!0),4e3));const J=[];for(const pe of K){const ee=Array.from(pe.tracks,ne=>ne.mediaType);J.push({userId:pe.id,mediaTypes:ee})}const Y=await C(J,!0);let{expectation_num:oe,success_num:re,success_users:te=[],retry_users:ue=[]}=Y;if(te.length!==0){const pe=await u(te);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${pe}/${re}/${oe}`,{actual_num:pe,success_num:re,expectation_num:oe})}if(ue.length!==0){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;","------->quickvo: waiting for the other party to republish before subscribing.");const ee=await yt(()=>i(ue),{message:"Wait for a timeout before publishing. No re-published track received from the other party within 40 seconds.",timeout:40*1e3});let{expectation_num:ne,success_num:le,success_users:se=[]}=ee;if(se.length!==0){const ce=await u(se);this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: subscription results is: ${ce}/${le}/${ne}`,{actual_num:ce,success_num:le,expectation_num:ne})}}}M(!0)}}catch(C){this.reportLogs("subscribe_error",C.message||C),O(C)}});return this.asyncQueue.add(D,{describe:"subscribe"})};#t=()=>new Promise(async(B,D)=>{try{await this.createAnswer(),await this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(async M=>{const{code:O=0,desc:C,sn:i=""}=M;if(await this.#o(i),O!==200)throw new Error(C);B(M)})}catch(M){D(M)}});stopSubscribe=(B=[])=>new Promise(async(D,M)=>{try{B.length===0&&(B=await this.getAllUserMediaTypes());const O=await this.getUserTrackByUserMediaTypes(B);if(O.length===0)return D(!0);const C=[],i=[];for(const u of O){const{id:$,tracks:N=[]}=u;for(const F of N){const{type:Z,mid:K,mediaType:J,msid:Y,origin:oe="sfu",userId:re}=F;if(J){if(oe==="sfu"){if(!Y||!K)continue;const te={type:Z,mid:K,trackName:Y,userId:re};C.push(te),i.push(K)}oe==="p2p"&&(await this.p2p.closeRecv([$],[J]),F.origin="sfu",this.p2p.reportP2PConnect(this.options.userId,$,"disconnect","p2p is close."))}}}if(C.length===0)return D(!0);await this.stopTransceivers(i),await this.#s(B,!1);for(const u of B){const{userId:$,mediaTypes:N=[]}=u,F=await this.getUser($);for(const Z of F.tracks)N.includes(Z.mediaType)&&(Z.msid="")}await this.emitNotifyUpdateUsers(),D(!0)}catch(O){this.reportLogs("close_track_error",O.message||O),M(O)}});setBanBehaviors=B=>new Promise(async(D,M)=>{try{const O=this.getOptions(),{roomId:C}=O,i=[];for(const u of B){const{id:$,banBehaviors:N}=u,F=Object.keys(N);if(F.length===0)continue;const Z=[];for(const J of F){const Y=mediaType_keys.findIndex(te=>te===J),oe=N[J],re={type:Y,behavior:oe};Z.push(re)}const K={id:$,behaviors:Z};i.push(K)}await this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:C,users:i}}).then(async u=>{const{code:$=0,desc:N}=u;if($!==200)return M(N);D(u)})}catch(O){M(O)}});debugger=()=>this.cwsIns.sendMessage({event:"debugger"},!1);shutdown=()=>this.cwsIns.sendMessage({event:"shutdown"},!1);restoreRoom=async()=>{if(this.isInRoom===!1)return;await this.checkInRoom()===!1&&this.#n&&await this.#n(),this.cwsIns.afreshSends()};restoreICE=async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: restore ice."),await this.cwsConnected(),this.initPeer(),this.isEarly?this.earlyConnect():await this.#c();const B=[],D=[],M=await this.getUsers();for(const O of M){const{id:C,isSelf:i,callActionMap:u,tracks:$=[]}=O;if(i){for(const F of mediaType_keys)u[F]&&B.push(F);continue}const N=[];for(const F of $)(F.msid||F.origin==="p2p")&&N.push(F.mediaType);N.length!==0&&D.push({userId:C,mediaTypes:N})}await this.syncRoomInfo(),await this.publish(B),D.length!==0&&await this.subscribe(D)};initHeartbeat=()=>{this.stopHeartbeat();const B=async()=>{if(this.isInRoom){const M=this.getTrafficUse();this.cwsIns.sendMessage({event:"heartbeat",data:M},!1)}else this.cwsIns.sendMessage({event:"heartbeatEx",data:{}},!1)},D=this.isInRoom?10*1e3:30*1e3;this.#e=window.setInterval(B,D),B()};stopHeartbeat=()=>{clearInterval(this.#e)};#r=async B=>new Promise(async(D,M)=>{try{const O=this.getOptions(),{roomId:C}=O;if(!C)return;const{id:i,tracks:u=[]}=await this.getSelfInfo(),$=u.filter(F=>F.mediaType&&B.includes(F.mediaType));if($.length===0)return;const N=dt($,["type","trackName","mid"]);await this.cwsIns.sendMessage({event:"pubNotify",data:{session:this.sdk_session,roomId:C,user:{id:i,tracks:N}}}),D(!0)}catch(O){M(O)}});#o=B=>new Promise(D=>{this.cwsIns.sendMessage({event:"ackMsg",data:{msgId:B}},!1),D(!0)});#i=async B=>new Promise(async(D,M)=>{const O=this.getOptions(),{roomId:C,userId:i}=O,u={roomId:C,user:{id:i,callAction:B}};await this.cwsIns.sendMessage({event:"updateCall",data:u}).then(async $=>{const{code:N=0}=$;if(N!==200)return M($);await this.updateUserCallAction(i,B),D(B)}).catch($=>M($))});setSession=()=>{const B=this.getOptions(),{appid:D,roomId:M,userId:O,earlyId:C}=B;if(!D)throw new Error("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const i={c:D,r:M,p:"web",h:location.hostname,v:this.sdk_service_version};this.isEarly?i.i=C:i.b=O;const u=btoa(encodeURI(JSON.stringify(i)));this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: session",i);const $=`${this.options.url}?s=${u}&t=${Date.now()}`;this.cwsIns.prws.setOptions({url:$})};#a=()=>new Promise(async(B,D)=>{try{if(["connecting","connected"].includes(this.roomState))return B(!0);this.setRoomState("connecting"),this.cwsIns.clearEvents(),this.setSession(),await this.cwsIns.connect(),this.initHeartbeat(),this.setRoomState("connected"),await this.prResolves.emit("cwsConnected"),B(this.cwsIns)}catch(M){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",M),this.reportLogs("ws_c_timeout",M.message||M),D(M)}});cwsConnected=()=>{const B=()=>this.roomState==="connected";return this.prResolves.add("cwsConnected",B)};#c=async()=>new Promise(async B=>{try{await this.cwsConnected(),await this.addSenders();const D=await this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}),{code:M=0,desc:O,data:C}=D;if(M!==200)throw new Error(O);const{remoteSdp:i,session:u=""}=C;if(this.sdk_session=u,this.options.debug){const $=libExports$1.parse(i),N=dt($.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:N,sdpJson:$})}await this.setRemoteDescription({type:"answer",sdp:i}),await yt(this.iceConnected,{message:"ice connect is timeout.",timeout:10*1e3}),B(!0),this.p2p.reportNetwork()}catch(D){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ice connect is error. recreate in 5 seconds.",D),await new Promise(M=>setTimeout(()=>M(!0),5*1e3)),this.#c()}});#l=async B=>{const D=()=>new Promise(async(M,O)=>{try{await this.iceConnected();const C=await this.addSenders(B),i=await this.getSenderTracks(C);if(i.length===0)return M(!0);const u=await this.cwsIns.sendMessage({event:"publish",data:{session:this.sdk_session,sdp:this.getSdp(),tracks:i,callAction:0}}),{code:$=0,desc:N,sn:F="",data:Z={}}=u;if(await this.#o(F),$!==200)throw new Error(N);const{remoteSdp:K}=Z;await this.setRemoteDescription({type:"answer",sdp:K}),M(!0)}catch(C){this.reportLogs("publish_error",C.message||C),await this.removeSenders(B),O(C)}});return this.asyncQueue.add(D,{describe:"createTrack"})};#s=(B=[],D)=>{const M=()=>new Promise(async(O,C)=>{try{B.length===0&&(B=await this.getAllUserMediaTypes());const i=await this.getUserTrackByUserMediaTypes(B);if(i.length===0)return O(!0);const u=[];for(const $ of i){const{id:N,tracks:F=[]}=$,Z=Array.from(F,K=>K.trackName);for(const K of F){const{type:J,mid:Y,mediaType:oe,msid:re,userId:te,trackName:ue}=K;if(!oe||Y===null)continue;const pe={type:J,mid:Y,trackName:re||ue,userId:te};u.push(pe)}{const K=await this.getUser(N);for(const J of K.tracks)Z.includes(J.trackName)&&(J.msid="");if(D){const J=K.tracks.filter(Y=>!Z.includes(Y.trackName));await this.updateUsertracks(K.id,J,!1)}}}if(u.length===0)return O(!0);await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:u}}).then(async $=>{const{code:N=0,desc:F,data:Z={}}=$;if(N!==200)throw new Error(F);const{remoteSdp:K}=Z;await this.setRemoteDescription({type:"answer",sdp:K})}),O(!0)}catch(i){this.reportLogs("close_track_error",i.message||i),C(i)}});return this.asyncQueue.add(M,{describe:"closeTrack"})};#u=async(B,D,M)=>{for(const O of D){let C;const i=await this.getUser(B),{tracks:u=[]}=i,$=u.find(F=>F.mediaType===O);if(!$)continue;if(M==="sfu"){const{mid:F}=$;C=this.peerIns.getTransceivers().find(J=>J.mid===F)?.receiver.track,$.origin="sfu"}if(M==="p2p"&&(C=(await this.getP2PIns(B))?.getTrack(O),$.origin="p2p"),!C)continue;const N=new MediaStream;N.addTrack(C),await this.initUserMediaStreamContext(B,O,N,!1),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;","------->quickvo: switching to",M,{userId:B,mediaType:O,origin:M,stream:N})}};#f=async(B,D)=>{let M="sfu";const O=await this.getP2PIns(B);if(O&&O?.recv_peer_ins?.connectionState==="connected"){const $=O?.recvPeerAnalyzeStatsIns.getAverageQuality();if($!==0){const{averageQuality:N}=this.getPeerNetwork();$-N>=this.sfuOffsetAverageQuality&&(M="p2p")}}return{current_origin:(await this.getUser(B)).tracks.find(u=>u.mediaType===D)?.origin,suggest_origin:M}};#d=()=>{{const B=async D=>{let M="";const O=await this.getSelfInfo(),{code:C,data:i}=D;if(C!==200)return;const{sdp:u,sender:$={},tracks:N=[]}=i,{id:F}=$;M=F;{const K=await this.getUsersId();let J=0;for(const Y of K){const oe=await this.getP2PIns(Y);oe?.send_peer_ins&&oe.send_peer_ins.iceConnectionState==="connected"&&(J+=1)}if(J>=3)return this.p2p.reportP2PConnect(M,O.id,"ignore","P2P connections have reached the maximum limit.")}const Z=await this.getP2PIns(M);if(Z){await Z.initSenderPc(),Z.sendPeerAnalyzeStatsIns.onNetwork=K=>{this.p2pPush+=Math.ceil(K.outboundBytes/1024)};try{const K=[];for(const ee of N){const{type:ne}=ee;ne!==void 0&&K.push(mediaType_keys[ee.type])}const J=new RTCSessionDescription({type:"offer",sdp:u});await Z.setOffer(J),await Z.initSenders(N),await this.p2p.replaceSenderStreams([M],K,!0);const Y=await Z.createAnswer();if(this.options.debug){const ee=libExports$1.parse(Y.sdp),ne=dt(ee.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:ne,sdpJson:ee})}const oe=await Z.getSenderTracks(K),re=this.getOptions(),{roomId:te}=re,ue=()=>new Promise(async(ee,ne)=>{try{const le=await this.cwsIns.sendMessage({event:"answer",data:{roomId:te,tracks:oe,sender:{id:O.id,callAction:O.callAction,tracks:[]},receiverId:M,sdp:Y.sdp}}),{code:se=0,desc:ce}=le;if(se!==200)throw new Error(ce);ee(!0)}catch(le){ne(le)}}),pe=()=>new Promise(async(ee,ne)=>{try{const le=await yt(Z.getSendIcecandidates,{message:"await get send candidates is timeout.",timeout:1e4}),se=Array.from(le,({sdpMid:fe,sdpMLineIndex:ye,candidate:ve})=>({sdpMid:fe,sdpMLineIndex:ye,sdp:ve})),ce=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:te,senderId:O.id,receiverId:M,candidates:se,isSubscribeReceiver:!1}}),{code:he=0,desc:ie}=ce;if(he!==200)throw new Error(ie);ee(!0)}catch(le){ne(le)}});await ue(),await pe(),await yt(Z.sendIceConnected,{message:"await send ice connect is timeout.",timeout:1e4})}catch{}}};this.cwsIns.addNotify({event:"onOffer",callback:B},!0)}{const B=async D=>{const{code:M,data:O}=D;if(M!==200)return;const{senderId:C,candidates:i=[],receiverId:u,isSubscribeReceiver:$=!1}=O,N=this.getOptions(),{userId:F}=N;if($===!1||u!==F)return;const Z=await this.getP2PIns(C);if(!Z)return;const K=Array.from(i,({sdpMid:J,sdpMLineIndex:Y,sdp:oe})=>({sdpMid:J,sdpMLineIndex:Y,candidate:oe}));await Z.addCandidates(K)};this.cwsIns.addNotify({event:"onCandidate",callback:B},!0)}};p2p={open:(B,D=["microphoneCamera_video"])=>new Promise(async(M,O)=>{const C=this.getOptions(),{roomId:i,userId:u}=C,$=await this.getSelfInfo(),N=wt(),F=new Date().getTime();let Z=!1;try{const K=await this.getP2PIns(B);if(!K)return O("illegal user object.");{const te=await this.getUser(B),{tracks:ue=[]}=te;let pe=!0;for(const ee of D)ue.find(le=>le.mediaType===ee&&le.msid||le.origin==="p2p")||(pe=!1);if(pe===!1)return this.p2p.reportP2PConnect(u,B,"ignore","P2P connections without a subscription relationship are not allowed."),O("P2P connections without a subscription relationship are not allowed.")}const J=()=>new Promise(async(te,ue)=>{try{await K.initRecvPc();const pe=()=>{const he=K.recv_peer_ins.connectionState;he==="disconnected"&&this.subscribe([{userId:B,mediaTypes:D}]),he==="failed"&&this.p2p.reportP2PConnect(this.options.userId,B,"disconnect","p2p is failed.")};K.recv_peer_ins.addEventListener("connectionstatechange",pe),await K.addRecvs(D);const ee=await K.createOffer();if(this.options.debug){const he=libExports$1.parse(ee.sdp),ie=dt(he.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:ie,sdpJson:he})}const ne=await K.getRecvTracks(D),le=await this.cwsIns.sendMessage({event:"offer",data:{roomId:i,tracks:ne,sender:{id:$.id,callAction:$.callAction,tracks:[]},receiverId:B,sdp:ee.sdp}}),{code:se=0,desc:ce}=le;if(se!==200)throw new Error(ce);te(!0)}catch(pe){ue(pe)}}),Y=()=>yt(()=>new Promise(ue=>{const pe=async ee=>{const{code:ne,data:le}=ee;if(ne!==200)return;const{sender:se,sdp:ce,tracks:he=[]}=le,{id:ie}=se;B===ie&&ue({answer:{type:"answer",sdp:ce},tracks:he})};this.cwsIns.addNotify({event:"onAnswer",callback:pe,sn:`onAnswer: ${N}`},!0)}),{message:"await_answer is timeout.",timeout:20*1e3}),oe=()=>new Promise(async(te,ue)=>{try{const pe=await yt(K.getRecvIcecandidates,{message:"await get recv candidates is timeout.",timeout:1e4}),ee=Array.from(pe,({sdpMid:ce,sdpMLineIndex:he,candidate:ie})=>({sdpMid:ce,sdpMLineIndex:he,sdp:ie})),ne=await this.cwsIns.sendMessage({event:"candidate",data:{roomId:i,senderId:$.id,receiverId:B,candidates:ee,isSubscribeReceiver:!0}}),{code:le=0,desc:se}=ne;if(le!==200)throw new Error(se);te(!0)}catch(pe){ue(pe)}}),re=()=>yt(()=>new Promise(ue=>{const pe=async ee=>{const{code:ne,data:le}=ee;if(ne!==200)return;const{candidates:se=[],isSubscribeReceiver:ce=!1}=le;if(ce===!1){const he=Array.from(se,({sdpMid:ie,sdpMLineIndex:fe,sdp:ye})=>({sdpMid:ie,sdpMLineIndex:fe,candidate:ye}));ue(he)}};this.cwsIns.addNotify({event:"onCandidate",callback:pe,sn:`onCandidate: ${N}`},!0)}),{message:"await_answer_candidates is timeout.",timeout:20*1e3});Promise.all([Y(),re()]).then(async te=>{const[{answer:ue},pe]=te;if(this.options.debug){const ne=libExports$1.parse(ue.sdp),le=dt(ne.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setAnswer",{msidArr:le,sdpJson:ne})}await K.setAnswer(ue,pe),await yt(K.recvIceConnected,{message:"recv ice connect is timeout.",timeout:10*1e3});const ee=new Date().getTime()-F;this.p2p.reportP2PConnect(u,B,"success","连接成功",[],ee),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: will compare the quality of P2P and SFU networks in 10 seconds."),K.recvPeerAnalyzeStatsIns.onNetwork=async ne=>{const{inboundBytes:le,averageQuality:se}=ne;if(this.p2pPull+=Math.ceil(le/1024),se===0)return;const{current_origin:ce,suggest_origin:he}=await this.#f(B,"microphoneCamera_video");if(Z===!1){if(await this.#u(B,D,he),he==="sfu")return this.p2p.reportP2PConnect(u,B,"poor_network",`P2P quality is ${se}.`),await K.clearRecvPc(),M(!0);if(he==="p2p"){Z=!0,await this.emitNotifyUpdateUsers();const ie=this.createUserUpdateStreams(D);await this.emitNotifyUpdateUsersStreams([{userId:B,updateStreams:ie}]),ce==="sfu"&&this.#s([{userId:B,mediaTypes:D}],!1)}return M(!0)}if(ce!==he)if(he==="p2p"){await this.#u(B,D,"p2p"),ce==="sfu"&&this.#s([{userId:B,mediaTypes:D}],!1),await this.emitNotifyUpdateUsers();const ie=this.createUserUpdateStreams(D);await this.emitNotifyUpdateUsersStreams([{userId:B,updateStreams:ie}])}else{if(this.hasAsyncTask("subscribe"))return;this.p2p.reportP2PConnect(u,B,"poor_network",`P2P quality is ${se}.`),this.subscribe([{userId:B,mediaTypes:D}])}}}).catch(te=>{O(te),this.p2p.reportP2PConnect(u,B,"fail",te.message||te)}).finally(()=>{this.cwsIns.removeNotify([`onAnswer: ${N}`,`onCandidate: ${N}`])}),await J(),await oe()}catch(K){this.p2p.reportP2PConnect(u,B,"fail",K.message||K),O(K)}}),replaceSenderStreams:async(B,D=[],M)=>{const O=this.getOptions();for(const C of B){const{userId:i}=O,u=await this.getP2PIns(C);if(!(!u||!u.send_peer_ins))for(const $ of D){const N=u.send_transceiverMap.get($);let F;if(N){const{sender:Z}=N;M?F=this.getUserStream(i,$):F=this.getPhoneyStreams($);const[K]=F.getTracks();K&&await Z.replaceTrack(K)}}}},reportNetwork:()=>new Promise(async(B,D)=>{try{let M=0;switch((await h()).natType){case"Symmetric":M=0;break;case"Full Cone":M=1;break;case"Port Restricted Cone":M=2;break;case"Restricted Cone":M=3;break}let O=0;switch((navigator.connection||navigator.mozConnection||navigator.webkitConnection).effectiveType){case"wifi":O=0;break;case"4g":case"3g":case"2g":case"slow-2g":O=2;break;default:O=1;break}await this.cwsIns.sendMessage({event:"reportNetwork",data:{nat:M,type:O}}),B(!0)}catch(M){D(M)}}),reportP2PConnect:(B,D,M,O="",C=[],i=0)=>{let u;switch(M){case"success":u=0;break;case"fail":u=1;break;case"ignore":u=2;break;case"disconnect":u=3;break;case"poor_network":u=4;break}return this.cwsIns.sendMessage({event:"reportP2PConnect",data:{userId:B,origin:D,code:u,reason:O,pushUserIds:C,connectedTime:i}})},closeSend:async(B=[],D=[])=>{B.length===0&&(B=[...this.p2pMap.keys()]);for(const M of B){const O=await this.getP2PIns(M);if(!O||!O.recv_peer_ins)return;O.sendPeerAnalyzeStatsIns.stop(),await O.clearSenderPc(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: close closeSend: ${M}`,M,D)}},closeRecv:async(B=[],D=[])=>{B.length===0&&(B=[...this.p2pMap.keys()]);for(const M of B){const O=await this.getP2PIns(M);if(!O||!O.recv_peer_ins)return;O.recvPeerAnalyzeStatsIns.stop(),await O.clearRecvPc(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: close closeRecv: ${M}`,M,D)}}}}class Room extends RoomCalls{constructor(B){super(B)}}class QuickVO extends Room{#e=new Map;constructor(B){super(B),this.#t(),this.#n()}#n=()=>{{const B=async D=>{const{state:M}=D.data;if(M==="closed"){const{roomId:O,userId:C}=this.getOptions(),i={roomId:O,user:{id:C}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:i}),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}};this.cwsIns.addNotify({event:"onRoomState",callback:B},!0)}{const B=async D=>{const{state:M}=D.data;["closed","failed"].includes(M)&&this.restoreICE()};this.cwsIns.addNotify({event:"onIceState",callback:B},!0)}{const B=async D=>{const{qualities:M=[]}=D.data,[O]=M,{userId:C}=this.getOptions();if(!(O&&O.userId===C&&M.length===1)){for(const i of M){const{userId:u,egress:$,ingress:N}=i;this.checkUserInRoom(u)&&await this.updateUserNetwork(u,{egress:$,ingress:N})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:B},!0)}{const B=async D=>{const M=D.data.user;await this.removeUsers([M.id]),await this.updateUsers([M]),await this.updateUsertracks(M.id,M.track,!1),await this.updateUserBehaviors(M.id,M.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:B},!0)}{const B=D=>{const M=async()=>{await this.removeUsers([D.data.user.id]),await this.emitNotifyUpdateUsers()};return this.asyncQueue.add(M,{describe:"removeUsers"})};this.cwsIns.addNotify({event:"onQuitRoom",callback:B},!0)}{const B=async D=>{const{user:M}=D.data,{id:O,tracks:C=[],callAction:i=0}=M;if(await this.updateUserCallAction(O,i),await this.updateUserPermissions(O,3),await this.updateUsertracks(O,C,!0),this.await_remote_publish_users.length!==0&&this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: ignore some user track releases.",this.await_remote_publish_users),this.options.newPublishAutoSubscribe){const u=[],$=(K,J)=>{const Y=this.await_remote_publish_users.find(re=>re.id===K);return!(!Y||!Y.tracks.find(re=>re.type===J))},N=[],F=await this.getUser(O);for(const K of F.tracks)for(const J of C)K.type===J.type&&$(O,J.type)===!1&&N.push(J.mediaType);const Z=[...new Set(N)];u.push({userId:O,mediaTypes:Z}),await this.subscribe(u)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:B},!0)}{const B=async D=>{const{id:M,tracks:O}=D.data.user,{userId:C}=this.getOptions();if(M===C)return;const i=Array.from(O,F=>F.trackName),u=await this.getUser(M),$=[];for(const F of u.tracks)i.includes(F.trackName)&&$.push(F.mediaType);await this.stopSubscribe([{userId:M,mediaTypes:$}]);const N=u.tracks.filter(F=>!i.includes(F.trackName));await this.updateUsertracks(M,N,!1),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onCloseTrack",callback:B},!0)}{const B=async D=>{const{id:M,callAction:O}=D.data.user;this.checkUserInRoom(M)&&(await this.updateUserCallAction(M,O),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:B},!0)}{const B=async D=>{const{roomId:M,remoteUserId:O}=D.data,C=this.getOptions();this.checkUserInRoom(O)&&M===C.roomId&&this.p2p.closeSend([O])};this.cwsIns.addNotify({event:"onDisconnectP2P",callback:B},!0)}{const B=async D=>{const{user:M}=D.data,{id:O,permissions:C=1}=M;C===1?await this.removeUsers([O]):C===3&&await this.updateUsers([M]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:B},!0)}{const B=async D=>{const{users:M}=D.data;for(const O of M){const{id:C,behavior:i}=O;await this.updateUserBehaviors(C,i)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:B},!0)}{const B=async D=>{const{roomId:M,userId:O}=D.data;this.options.roomId===M&&(await new Promise(C=>setTimeout(()=>C(!0),1e3)),this.p2p.open(O))};this.cwsIns.addNotify({event:"onAttemptP2PReq",callback:B},!0)}{const B=async D=>{const{session:M,sessionIsValid:O=!0,tracks:C=[]}=D.data;if(M!==this.sdk_session||O===!1)return this.restoreICE();const i=[],u=Array.from(C,N=>N.trackName),$=await this.getUserTrackByTrackName(u);for(const N of $)N&&N.mediaType&&i.push(N.mediaType);await this.stopPublish(i),await this.publish(i)};this.cwsIns.addNotify({event:"onTrackInactive",callback:B},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async B=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)};addNotify=B=>this.cwsIns.addNotify(B);#t=()=>{this.cwsIns.prws.checkReconnect=async B=>B.code===1e3?(this.setRoomState("closed"),!1):B.code===4001?(this.setRoomState("closed"),!1):B.code===4002?(this.setRoomState("closed"),!1):B.code===4003?(this.setRoomState("closed"),!1):(this.setSession(),B.code===4010?(this.setRoomState("connecting"),!0):(this.setRoomState("connecting"),!0)),this.cwsIns.prws.onReconnectSuccess=async B=>{this.setRoomState("connected"),await this.restoreRoom(),await this.prResolves.emit("cwsConnected")},this.cwsIns.prws.onReconnectStop=async B=>{this.setRoomState("closed")}};addRequestAnimationFrame=async(B,D)=>{{const O=this.#e.get(B);O&&cancelAnimationFrame(O)}const M=(O=Date.now())=>{D(O);const C=requestAnimationFrame(M);this.#e.set(B,C)};M()};clearRequestAnimationFrame=async(B=[])=>{B.length===0&&(B=[...this.#e.keys()]);const D=[];for(const M of B){const O=this.#e.get(M);O&&(cancelAnimationFrame(O),D.push(O))}return D};destroy=async()=>{this.stopLocalStreams(),this.stopGetPeerStats(),this.quitRoom(),this.clearUsers(),this.clearUserStreams(),this.stopHeartbeat(),await new Promise(B=>setTimeout(()=>B(!0),300)),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.cwsIns.close(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK")}}exports.QuickVO=QuickVO,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});