quickvo-sdk-js 0.9.4 → 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +17875 -17492
- package/dist/index.umd.cjs +7 -7
- package/dist/room/RoomMedias.d.ts +5 -5
- package/dist/room/RoomUsers.d.ts +41 -7
- package/dist/types.d.ts +6 -0
- package/package.json +2 -1
- package/dist/room/mediaStreams/AudioMediaContext.d.ts +0 -55
- /package/dist/room/{mediaStreams/VideoMediaContext.d.ts → VideoMediaContext.d.ts} +0 -0
package/dist/index.umd.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(Ce,Ie){typeof exports=="object"&&typeof module<"u"?Ie(exports):typeof define=="function"&&define.amd?define(["exports"],Ie):(Ce=typeof globalThis<"u"?globalThis:Ce||self,Ie(Ce["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var un=Object.defineProperty;var an=Ce=>{throw TypeError(Ce)};var fn=(Ce,Ie,je)=>Ie in Ce?un(Ce,Ie,{enumerable:!0,configurable:!0,writable:!0,value:je}):Ce[Ie]=je;var ce=(Ce,Ie,je)=>fn(Ce,typeof Ie!="symbol"?Ie+"":Ie,je),sn=(Ce,Ie,je)=>Ie.has(Ce)||an("Cannot "+je);var pe=(Ce,Ie,je)=>(sn(Ce,Ie,"read from private field"),je?je.call(Ce):Ie.get(Ce)),Te=(Ce,Ie,je)=>Ie.has(Ce)?an("Cannot add the same private member more than once"):Ie instanceof WeakSet?Ie.add(Ce):Ie.set(Ce,je),Pe=(Ce,Ie,je,Ke)=>(sn(Ce,Ie,"write to private field"),Ke?Ke.call(Ce,je):Ie.set(Ce,je),je);var Ce,Ie,je,Ke,et,Lt,Ht,Ft,Bt,jt,zt,Jt,tt,wt,yt,Mt,Nt,at,ct,gt,St,qt,Ot,Ye,Ge,rt,vt,It,Wt,Zt,Et,Vt,Kt,Gt,Qt,Rt,Yt,Ct,Pt,Ut,Tt,Xt,en,tn,nn;const lt=(D,z={})=>{const N={unit:"B",splitStr:" ",...z};let{unit:J,splitStr:I}=N;const O=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=O.findIndex(F=>F===J),a=O.slice(n+1,O.length);let q=D;for(const F of a)if(J=F,q=q/1024,q<1024)break;return`${q.toFixed(2)}${I}${J}`},P=(D,z=[])=>{const N={...D},J=Object.keys(N);for(const I of J)z.findIndex(O=>String(O)===I)===-1&&delete N[I];return N},pt=(D,z=[],N=!0)=>{const J=new Map;for(const O of D){const n=[];for(const q of z)n.push(O[q]);const a=`map-${n.join("-")}`;if(!J.has(a)){J.set(a,O);continue}N&&J.set(a,O)}const I=J.entries();return Array.from(I,([O,n])=>n)},dt=(D,z=[])=>{const N=[];for(const J of D){const I=P(J,z);N.push(I)}return N},ht=(D,z="value",N="label")=>{const J=[],I=Object.entries(D);for(const[O,n]of I){const a={[N]:n,[z]:O};J.push(a)}return J},v$1=(D=0,z=1)=>{const N=Math.max(0,D),J=Math.max(1,z),I=Math.random()*(J-N+1)+N;return parseInt(`${I}`,10)},xt=(D=16,z=16)=>{const N="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),J=Math.min(N.length,z),I=Date.now().toString(J),O=I.split(""),n=Math.max(4,D-I.length);for(let a=0;a<n;a++){const q=v$1(0,J-1),F=N[q];O.push(F)}return O.join("").toUpperCase()},W=(D,z)=>{try{let N=Number(D);if(isNaN(N)){const J=new Date(`${D}`);if(`${J}`=="Invalid Date")return 0;N=J.getTime()}if(z!==void 0){const J=new Date().getTimezoneOffset();N+=(J+z)*60*1e3}return N}catch(N){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:D,_offset:z,error:N}),0}},H=1e3,R$1=6e4,U=36e5,A=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L=D=>W(D),E$1=(D,z="YYYY-MM-DD hh:mm:ss",N={})=>{const J={empty_str:"-",...N},{empty_str:I,offset:O}=J,n=W(D,O);if(Number(D)!==0&&n===0)return I;const a=new Date(n),q=`${a.getFullYear()}`,F=`${a.getMonth()+1}`,Z=`${a.getDate()}`,X=`${a.getDay()===0?7:a.getDay()}`,ee=`${a.getHours()}`,Q=`${a.getMinutes()}`,ne=`${a.getSeconds()}`,se=`${Math.ceil((n-L(`${q}/01/01 00:00:00`)+1)/864e5)}`,re=`${Math.ceil(((n-L(`${q}/01/01 00:00:00`))/864e5-Number(X))/7)+1}`,oe=[{k:"Y+",v:q},{k:"M+",v:F},{k:"D+",v:Z},{k:"W+",v:X},{k:"h+",v:ee},{k:"m+",v:Q},{k:"s+",v:ne},{k:"d+",v:se},{k:"w+",v:re}];let me;for(let{k:_e,v:ae}of oe)if(me=new RegExp(`(${_e})`).exec(z),me){const fe=me[1];let be=ae.padStart(fe.length,"0");fe.includes("W")&&(be=_[be.slice(0,2)]),z=z.replace(fe,be)}return z},V=new Map,$t=(D,z,N)=>{const J=new Date().getTime(),I=V.get(D)||0;J-N>I&&(z(),V.set(D,J))},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(z){return z.encoding?"rtpmap:%d %s/%s/%s":z.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(z){return z.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(z){return z.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(z){return"extmap:%d"+(z.direction?"/%s":"%v")+(z["encrypt-uri"]?" %s":"%v")+" %s"+(z.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(z){return z.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(z){var N="candidate:%s %d %s %d %s %d typ %s";return N+=z.raddr!=null?" raddr %s rport %d":"%v%v",N+=z.tcptype!=null?" tcptype %s":"%v",z.generation!=null&&(N+=" generation %d"),N+=z["network-id"]!=null?" network-id %d":"%v",N+=z["network-cost"]!=null?" network-cost %d":"%v",N}},{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(z){var N="ssrc:%d";return z.attribute!=null&&(N+=" %s",z.value!=null&&(N+=":%s")),N}},{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(z){return z.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(z){return z.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(z){return"imageattr:%s %s %s"+(z.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(z){return"simulcast:%s %s"+(z.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(z){return"ts-refclk:%s"+(z.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(z){var N="mediaclk:";return N+=z.id!=null?"id=%s %s":"%v%s",N+=z.mediaClockValue!=null?"=%s":"",N+=z.rateNumerator!=null?" rate=%s":"",N+=z.rateDenominator!=null?"/%s":"",N}},{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(z){var N=D[z];N.forEach(function(J){J.reg||(J.reg=/(.*)/),J.format||(J.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(D){var z=function(a){return String(Number(a))===a?Number(a):a},N=function(a,q,F,Z){if(Z&&!F)q[Z]=z(a[1]);else for(var X=0;X<F.length;X+=1)a[X+1]!=null&&(q[F[X]]=z(a[X+1]))},J=function(a,q,F){var Z=a.name&&a.names;a.push&&!q[a.push]?q[a.push]=[]:Z&&!q[a.name]&&(q[a.name]={});var X=a.push?{}:Z?q[a.name]:q;N(F.match(a.reg),X,a.names,a.name),a.push&&q[a.push].push(X)},I=requireGrammar(),O=RegExp.prototype.test.bind(/^([a-z])=(.*)/);D.parse=function(a){var q={},F=[],Z=q;return a.split(/(\r\n|\r|\n)/).filter(O).forEach(function(X){var ee=X[0],Q=X.slice(2);ee==="m"&&(F.push({rtp:[],fmtp:[]}),Z=F[F.length-1]);for(var ne=0;ne<(I[ee]||[]).length;ne+=1){var se=I[ee][ne];if(se.reg.test(Q))return J(se,Z,Q)}}),q.media=F,q};var n=function(a,q){var F=q.split(/=(.+)/,2);return F.length===2?a[F[0]]=z(F[1]):F.length===1&&q.length>1&&(a[F[0]]=void 0),a};D.parseParams=function(a){return a.split(/;\s?/).reduce(n,{})},D.parseFmtpConfig=D.parseParams,D.parsePayloads=function(a){return a.toString().split(" ").map(Number)},D.parseRemoteCandidates=function(a){for(var q=[],F=a.split(" ").map(z),Z=0;Z<F.length;Z+=3)q.push({component:F[Z],ip:F[Z+1],port:F[Z+2]});return q},D.parseImageAttributes=function(a){return a.split(" ").map(function(q){return q.substring(1,q.length-1).split(",").reduce(n,{})})},D.parseSimulcastStreamList=function(a){return a.split(";").map(function(q){return q.split(",").map(function(F){var Z,X=!1;return F[0]!=="~"?Z=z(F):(Z=z(F.substring(1,F.length)),X=!0),{scid:Z,paused:X}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var D=requireGrammar(),z=/%[sdv%]/g,N=function(n){var a=1,q=arguments,F=q.length;return n.replace(z,function(Z){if(a>=F)return Z;var X=q[a];switch(a+=1,Z){case"%%":return"%";case"%s":return String(X);case"%d":return Number(X);case"%v":return""}})},J=function(n,a,q){var F=a.format instanceof Function?a.format(a.push?q:q[a.name]):a.format,Z=[n+"="+F];if(a.names)for(var X=0;X<a.names.length;X+=1){var ee=a.names[X];a.name?Z.push(q[a.name][ee]):Z.push(q[a.names[X]])}else Z.push(q[a.name]);return N.apply(null,Z)},I=["v","o","s","i","u","e","p","c","b","t","r","z","a"],O=["i","c","b","a"];return writer$1=function(n,a){a=a||{},n.version==null&&(n.version=0),n.name==null&&(n.name=" "),n.media.forEach(function(X){X.payloads==null&&(X.payloads="")});var q=a.outerOrder||I,F=a.innerOrder||O,Z=[];return q.forEach(function(X){D[X].forEach(function(ee){ee.name in n&&n[ee.name]!=null?Z.push(J(X,ee,n)):ee.push in n&&n[ee.push]!=null&&n[ee.push].forEach(function(Q){Z.push(J(X,ee,Q))})})}),n.media.forEach(function(X){Z.push(J("m",D.m[0],X)),F.forEach(function(ee){D[ee].forEach(function(Q){Q.name in X&&X[Q.name]!=null?Z.push(J(ee,Q,X)):Q.push in X&&X[Q.push]!=null&&X[Q.push].forEach(function(ne){Z.push(J(ee,Q,ne))})})})}),Z.join(`\r
|
|
1
|
+
(function(Ae,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(Ae=typeof globalThis<"u"?globalThis:Ae||self,Ee(Ae["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var fi=Object.defineProperty;var si=Ae=>{throw TypeError(Ae)};var di=(Ae,Ee,ze)=>Ee in Ae?fi(Ae,Ee,{enumerable:!0,configurable:!0,writable:!0,value:ze}):Ae[Ee]=ze;var he=(Ae,Ee,ze)=>di(Ae,typeof Ee!="symbol"?Ee+"":Ee,ze),ci=(Ae,Ee,ze)=>Ee.has(Ae)||si("Cannot "+ze);var pe=(Ae,Ee,ze)=>(ci(Ae,Ee,"read from private field"),ze?ze.call(Ae):Ee.get(Ae)),Oe=(Ae,Ee,ze)=>Ee.has(Ae)?si("Cannot add the same private member more than once"):Ee instanceof WeakSet?Ee.add(Ae):Ee.set(Ae,ze),Ue=(Ae,Ee,ze,Qe)=>(ci(Ae,Ee,"write to private field"),Qe?Qe.call(Ae,ze):Ee.set(Ae,ze),ze);var Ae,Ee,ze,Qe,tt,Ft,jt,zt,Nt,Jt,Wt,Zt,it,St,bt,qt,Pt,st,ut,Tt,Ot,Ut,Et,Xe,Ke,ot,ft,_t,Rt,Vt,Kt,Ct,Gt,Qt,Yt,Xt,At,ei,Dt,Lt,Ht,It,ti,ii,ni,ri;const lt=(D,J={})=>{const N={unit:"B",splitStr:" ",...J};let{unit:z,splitStr:I}=N;const O=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=O.findIndex(F=>F===z),a=O.slice(n+1,O.length);let q=D;for(const F of a)if(z=F,q=q/1024,q<1024)break;return`${q.toFixed(2)}${I}${z}`},P=(D,J=[])=>{const N={...D},z=Object.keys(N);for(const I of z)J.findIndex(O=>String(O)===I)===-1&&delete N[I];return N},pt=(D,J=[],N=!0)=>{const z=new Map;for(const O of D){const n=[];for(const q of J)n.push(O[q]);const a=`map-${n.join("-")}`;if(!z.has(a)){z.set(a,O);continue}N&&z.set(a,O)}const I=z.entries();return Array.from(I,([O,n])=>n)},dt=(D,J=[])=>{const N=[];for(const z of D){const I=P(z,J);N.push(I)}return N},ht=(D,J="value",N="label")=>{const z=[],I=Object.entries(D);for(const[O,n]of I){const a={[N]:n,[J]:O};z.push(a)}return z},v$1=(D=0,J=1)=>{const N=Math.max(0,D),z=Math.max(1,J),I=Math.random()*(z-N+1)+N;return parseInt(`${I}`,10)},xt=(D=16,J=16)=>{const N="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),z=Math.min(N.length,J),I=Date.now().toString(z),O=I.split(""),n=Math.max(4,D-I.length);for(let a=0;a<n;a++){const q=v$1(0,z-1),F=N[q];O.push(F)}return O.join("").toUpperCase()},W=(D,J)=>{try{let N=Number(D);if(isNaN(N)){const z=new Date(`${D}`);if(`${z}`=="Invalid Date")return 0;N=z.getTime()}if(J!==void 0){const z=new Date().getTimezoneOffset();N+=(z+J)*60*1e3}return N}catch(N){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:D,_offset:J,error:N}),0}},H=1e3,R$1=6e4,U=36e5,A=864e5,_={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7","01":"一","02":"二","03":"三","04":"四","05":"五","06":"六","07":"日"},L=D=>W(D),E$1=(D,J="YYYY-MM-DD hh:mm:ss",N={})=>{const z={empty_str:"-",...N},{empty_str:I,offset:O}=z,n=W(D,O);if(Number(D)!==0&&n===0)return I;const a=new Date(n),q=`${a.getFullYear()}`,F=`${a.getMonth()+1}`,Z=`${a.getDate()}`,ee=`${a.getDay()===0?7:a.getDay()}`,te=`${a.getHours()}`,X=`${a.getMinutes()}`,ne=`${a.getSeconds()}`,ce=`${Math.ceil((n-L(`${q}/01/01 00:00:00`)+1)/864e5)}`,oe=`${Math.ceil(((n-L(`${q}/01/01 00:00:00`))/864e5-Number(ee))/7)+1}`,se=[{k:"Y+",v:q},{k:"M+",v:F},{k:"D+",v:Z},{k:"W+",v:ee},{k:"h+",v:te},{k:"m+",v:X},{k:"s+",v:ne},{k:"d+",v:ce},{k:"w+",v:oe}];let ye;for(let{k:ke,v:ae}of se)if(ye=new RegExp(`(${ke})`).exec(J),ye){const de=ye[1];let _e=ae.padStart(de.length,"0");de.includes("W")&&(_e=_[_e.slice(0,2)]),J=J.replace(de,_e)}return J},V=new Map,$t=(D,J,N)=>{const z=new Date().getTime(),I=V.get(D)||0;z-N>I&&(J(),V.set(D,z))},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(J){return J.encoding?"rtpmap:%d %s/%s/%s":J.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(J){return J.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(J){return J.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(J){return"extmap:%d"+(J.direction?"/%s":"%v")+(J["encrypt-uri"]?" %s":"%v")+" %s"+(J.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(J){return J.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(J){var N="candidate:%s %d %s %d %s %d typ %s";return N+=J.raddr!=null?" raddr %s rport %d":"%v%v",N+=J.tcptype!=null?" tcptype %s":"%v",J.generation!=null&&(N+=" generation %d"),N+=J["network-id"]!=null?" network-id %d":"%v",N+=J["network-cost"]!=null?" network-cost %d":"%v",N}},{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(J){var N="ssrc:%d";return J.attribute!=null&&(N+=" %s",J.value!=null&&(N+=":%s")),N}},{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(J){return J.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(J){return J.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(J){return"imageattr:%s %s %s"+(J.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(J){return"simulcast:%s %s"+(J.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(J){return"ts-refclk:%s"+(J.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(J){var N="mediaclk:";return N+=J.id!=null?"id=%s %s":"%v%s",N+=J.mediaClockValue!=null?"=%s":"",N+=J.rateNumerator!=null?" rate=%s":"",N+=J.rateDenominator!=null?"/%s":"",N}},{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(J){var N=D[J];N.forEach(function(z){z.reg||(z.reg=/(.*)/),z.format||(z.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(D){var J=function(a){return String(Number(a))===a?Number(a):a},N=function(a,q,F,Z){if(Z&&!F)q[Z]=J(a[1]);else for(var ee=0;ee<F.length;ee+=1)a[ee+1]!=null&&(q[F[ee]]=J(a[ee+1]))},z=function(a,q,F){var Z=a.name&&a.names;a.push&&!q[a.push]?q[a.push]=[]:Z&&!q[a.name]&&(q[a.name]={});var ee=a.push?{}:Z?q[a.name]:q;N(F.match(a.reg),ee,a.names,a.name),a.push&&q[a.push].push(ee)},I=requireGrammar(),O=RegExp.prototype.test.bind(/^([a-z])=(.*)/);D.parse=function(a){var q={},F=[],Z=q;return a.split(/(\r\n|\r|\n)/).filter(O).forEach(function(ee){var te=ee[0],X=ee.slice(2);te==="m"&&(F.push({rtp:[],fmtp:[]}),Z=F[F.length-1]);for(var ne=0;ne<(I[te]||[]).length;ne+=1){var ce=I[te][ne];if(ce.reg.test(X))return z(ce,Z,X)}}),q.media=F,q};var n=function(a,q){var F=q.split(/=(.+)/,2);return F.length===2?a[F[0]]=J(F[1]):F.length===1&&q.length>1&&(a[F[0]]=void 0),a};D.parseParams=function(a){return a.split(/;\s?/).reduce(n,{})},D.parseFmtpConfig=D.parseParams,D.parsePayloads=function(a){return a.toString().split(" ").map(Number)},D.parseRemoteCandidates=function(a){for(var q=[],F=a.split(" ").map(J),Z=0;Z<F.length;Z+=3)q.push({component:F[Z],ip:F[Z+1],port:F[Z+2]});return q},D.parseImageAttributes=function(a){return a.split(" ").map(function(q){return q.substring(1,q.length-1).split(",").reduce(n,{})})},D.parseSimulcastStreamList=function(a){return a.split(";").map(function(q){return q.split(",").map(function(F){var Z,ee=!1;return F[0]!=="~"?Z=J(F):(Z=J(F.substring(1,F.length)),ee=!0),{scid:Z,paused:ee}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var D=requireGrammar(),J=/%[sdv%]/g,N=function(n){var a=1,q=arguments,F=q.length;return n.replace(J,function(Z){if(a>=F)return Z;var ee=q[a];switch(a+=1,Z){case"%%":return"%";case"%s":return String(ee);case"%d":return Number(ee);case"%v":return""}})},z=function(n,a,q){var F=a.format instanceof Function?a.format(a.push?q:q[a.name]):a.format,Z=[n+"="+F];if(a.names)for(var ee=0;ee<a.names.length;ee+=1){var te=a.names[ee];a.name?Z.push(q[a.name][te]):Z.push(q[a.names[ee]])}else Z.push(q[a.name]);return N.apply(null,Z)},I=["v","o","s","i","u","e","p","c","b","t","r","z","a"],O=["i","c","b","a"];return writer$1=function(n,a){a=a||{},n.version==null&&(n.version=0),n.name==null&&(n.name=" "),n.media.forEach(function(ee){ee.payloads==null&&(ee.payloads="")});var q=a.outerOrder||I,F=a.innerOrder||O,Z=[];return q.forEach(function(ee){D[ee].forEach(function(te){te.name in n&&n[te.name]!=null?Z.push(z(ee,te,n)):te.push in n&&n[te.push]!=null&&n[te.push].forEach(function(X){Z.push(z(ee,te,X))})})}),n.media.forEach(function(ee){Z.push(z("m",D.m[0],ee)),F.forEach(function(te){D[te].forEach(function(X){X.name in ee&&ee[X.name]!=null?Z.push(z(te,X,ee)):X.push in ee&&ee[X.push]!=null&&ee[X.push].forEach(function(ne){Z.push(z(te,X,ne))})})})}),Z.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(),z=requireWriter$1(),N=requireGrammar();return lib$1.grammar=N,lib$1.write=z,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 AudioMediaContext{constructor(z,N){ce(this,"options",{autoGainControl:!1,noiseSuppression:!1,echoCancellation:!1});ce(this,"kind","audio");ce(this,"original_stream",new MediaStream);ce(this,"filterStream",z=>z);ce(this,"inputGain",1);ce(this,"outputGain",1);ce(this,"enhanceGain",0);ce(this,"audio",new Audio);ce(this,"audioContext");ce(this,"sourceNode");ce(this,"inputGainNode");ce(this,"analyserNode");ce(this,"analyserArrayData");ce(this,"outputGainNode");ce(this,"initNodes",()=>{{const z=new Audio;z.srcObject=this.original_stream}this.sourceNode=this.audioContext.createMediaStreamSource(this.original_stream),this.inputGainNode=this.audioContext.createGain(),this.inputGainNode.gain.setValueAtTime(this.inputGain,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);{const{sourceNode:z,inputGainNode:N,analyserNode:J,outputGainNode:I}=this;z.connect(N),N.connect(J),J.connect(I),I.connect(this.audioContext.destination)}this.setMute(!0)});ce(this,"stop",()=>{{const z=this.original_stream.getTracks();for(const N of z)N.stop(),this.original_stream.removeTrack(N)}});ce(this,"replaceStream",z=>{const N=this.original_stream.getTracks();for(const I of N)this.original_stream.removeTrack(I);const[J]=z.getAudioTracks();J&&this.original_stream.addTrack(J),this.initNodes()});ce(this,"getStream",()=>{const z=this.filterStream(this.sourceNode.mediaStream),N=z.getTracks();return console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->Breathe: tracks:${N.length}`,N[0]),z});ce(this,"setMute",(z=!0)=>{z?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)});ce(this,"setEnhanceGain",async z=>{this.enhanceGain=z;const N=this.inputGain+this.enhanceGain;this.inputGainNode.gain.setValueAtTime(N,this.audioContext.currentTime)});ce(this,"setVolumeGain",z=>{this.outputGain=z,this.outputGainNode.gain.setValueAtTime(z,this.audioContext.currentTime);const N=z===0;this.setMute(N)});ce(this,"getVolume",()=>{const{analyserNode:z,analyserArrayData:N}=this;z.getByteFrequencyData(N);let J=0;for(let O=0;O<N.length;O++)J+=N[O];return Math.ceil(J/N.length)});ce(this,"setFilter",(z={})=>(this.options={...this.options,...z},z));this.audioContext=N,this.original_stream.addTrack(z),this.initNodes(),this.audioContext.resume()}}class VideoMediaContext{constructor(z){ce(this,"kind","video");ce(this,"stream",new MediaStream);ce(this,"stop",()=>{const z=this.stream.getTracks();for(const N of z)N.stop(),this.stream.removeTrack(N)});ce(this,"replaceStream",z=>{const N=this.stream,J=N.getTracks();for(const O of J)N.removeTrack(O);const[I]=z.getVideoTracks();I&&N.addTrack(I)});ce(this,"getStream",()=>this.stream);ce(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(z)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C$1=Object.defineProperty,R=D=>{throw TypeError(D)},S=(D,z,N)=>z in D?C$1(D,z,{enumerable:!0,configurable:!0,writable:!0,value:N}):D[z]=N,l=(D,z,N)=>S(D,typeof z!="symbol"?z+"":z,N),v=(D,z,N)=>z.has(D)||R("Cannot "+N),t$1=(D,z,N)=>(v(D,z,"read from private field"),N?N.call(D):z.get(D)),c$1=(D,z,N)=>z.has(D)?R("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(D):z.set(D,N),i=(D,z,N,J)=>(v(D,z,"write to private field"),z.set(D,N),N),s,r$1,h,p,m$1,f,w,x,g$1,b,B$1,y,T,d$1;class M{constructor(z){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:N=>!0,onReconnectSuccess:async N=>{},onReconnectStop:async N=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:N=>{}}),l(this,"ws"),c$1(this,r$1,-1),c$1(this,h,-1),c$1(this,p,0),c$1(this,m$1,0),c$1(this,f,!1),c$1(this,w,N=>{}),l(this,"close",async(N=1e3,J="correctly close.")=>{var I;this.ws&&(i(this,f,!0),t$1(this,d$1).call(this),(I=this.ws)==null||I.close(N,J))}),l(this,"connect",()=>new Promise(async N=>{i(this,w,N),this.ws=new WebSocket(t$1(this,s).url),this.ws.binaryType=t$1(this,s).binaryType,this.ws.onopen=t$1(this,b),this.ws.onmessage=t$1(this,g$1),this.ws.onerror=t$1(this,B$1),this.ws.onclose=t$1(this,y)})),l(this,"reconnect",async N=>new Promise(J=>{t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const I=O=>{t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${O}`),t$1(this,s).onReconnectStop({msg:O}),J(O)};if(t$1(this,x).call(this)===!1)return I("stop reconnect. exceed maxReconnectionTime.");if(t$1(this,r$1)!==-1&&t$1(this,r$1)===0)return I("stop reconnect. surplusReconnectCount is 0.");if(!t$1(this,s).checkReconnect(N))return I("stop reconnect. checkReconnect is false.");t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t$1(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t$1(this,r$1)}`,N),i(this,p,setTimeout(async()=>{i(this,r$1,Math.max(-1,t$1(this,r$1)-1)),await this.connect();try{await t$1(this,s).onReconnectSuccess(this.ws)}catch(O){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",O)}J(!0)},t$1(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async N=>{var J;(!this.ws||this.ws.readyState!==1)&&(t$1(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t$1(this,s).sendBeforAutoConnect&&(t$1(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(J=this.ws)==null||J.send(N)}),c$1(this,x,()=>{const N=Date.now();return t$1(this,h)===-1&&i(this,h,N+t$1(this,s).reconnectTime),!(N>t$1(this,h))}),c$1(this,g$1,N=>{const{data:J}=N;t$1(this,s).onMessage(J)}),c$1(this,b,()=>{t$1(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r$1,t$1(this,s).reconnectCount),i(this,h,-1),t$1(this,T).call(this),t$1(this,w).call(this,this.ws)}),c$1(this,B$1,N=>{t$1(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",N)}),c$1(this,y,N=>{if(t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${N.code}, permanentClosed is ${t$1(this,f)}.`,N),t$1(this,d$1).call(this),!t$1(this,f))return this.reconnect(N);this.ws=void 0}),c$1(this,T,()=>{i(this,m$1,setInterval(()=>{const N=t$1(this,s).getHeartbeatMsg();N&&this.sendMessage(N)},t$1(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t$1(this,p)),clearInterval(t$1(this,m$1))}),i(this,s,{...t$1(this,s),...z}),i(this,r$1,t$1(this,s).reconnectCount)}}s=new WeakMap,r$1=new WeakMap,h=new WeakMap,p=new WeakMap,m$1=new WeakMap,f=new WeakMap,w=new WeakMap,x=new WeakMap,g$1=new WeakMap,b=new WeakMap,B$1=new WeakMap,y=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=D;function D(z,N){for(var J=new Array(arguments.length-1),I=0,O=2,n=!0;O<arguments.length;)J[I++]=arguments[O++];return new Promise(function(q,F){J[I]=function(X){if(n)if(n=!1,X)F(X);else{for(var ee=new Array(arguments.length-1),Q=0;Q<ee.length;)ee[Q++]=arguments[Q];q.apply(null,ee)}};try{z.apply(N||null,J)}catch(Z){n&&(n=!1,F(Z))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(D){var z=D;z.length=function(a){var q=a.length;if(!q)return 0;for(var F=0;--q%4>1&&a.charAt(q)==="=";)++F;return Math.ceil(a.length*3)/4-F};for(var N=new Array(64),J=new Array(123),I=0;I<64;)J[N[I]=I<26?I+65:I<52?I+71:I<62?I-4:I-59|43]=I++;z.encode=function(a,q,F){for(var Z=null,X=[],ee=0,Q=0,ne;q<F;){var se=a[q++];switch(Q){case 0:X[ee++]=N[se>>2],ne=(se&3)<<4,Q=1;break;case 1:X[ee++]=N[ne|se>>4],ne=(se&15)<<2,Q=2;break;case 2:X[ee++]=N[ne|se>>6],X[ee++]=N[se&63],Q=0;break}ee>8191&&((Z||(Z=[])).push(String.fromCharCode.apply(String,X)),ee=0)}return Q&&(X[ee++]=N[ne],X[ee++]=61,Q===1&&(X[ee++]=61)),Z?(ee&&Z.push(String.fromCharCode.apply(String,X.slice(0,ee))),Z.join("")):String.fromCharCode.apply(String,X.slice(0,ee))};var O="invalid encoding";z.decode=function(a,q,F){for(var Z=F,X=0,ee,Q=0;Q<a.length;){var ne=a.charCodeAt(Q++);if(ne===61&&X>1)break;if((ne=J[ne])===void 0)throw Error(O);switch(X){case 0:ee=ne,X=1;break;case 1:q[F++]=ee<<2|(ne&48)>>4,ee=ne,X=2;break;case 2:q[F++]=(ee&15)<<4|(ne&60)>>2,ee=ne,X=3;break;case 3:q[F++]=(ee&3)<<6|ne,X=0;break}}if(X===1)throw Error(O);return F-Z},z.test=function(a){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(a)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=D;function D(){this._listeners={}}return D.prototype.on=function(N,J,I){return(this._listeners[N]||(this._listeners[N]=[])).push({fn:J,ctx:I||this}),this},D.prototype.off=function(N,J){if(N===void 0)this._listeners={};else if(J===void 0)this._listeners[N]=[];else for(var I=this._listeners[N],O=0;O<I.length;)I[O].fn===J?I.splice(O,1):++O;return this},D.prototype.emit=function(N){var J=this._listeners[N];if(J){for(var I=[],O=1;O<arguments.length;)I.push(arguments[O++]);for(O=0;O<J.length;)J[O].fn.apply(J[O++].ctx,I)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=D(D);function D(O){return typeof Float32Array<"u"?function(){var n=new Float32Array([-0]),a=new Uint8Array(n.buffer),q=a[3]===128;function F(Q,ne,se){n[0]=Q,ne[se]=a[0],ne[se+1]=a[1],ne[se+2]=a[2],ne[se+3]=a[3]}function Z(Q,ne,se){n[0]=Q,ne[se]=a[3],ne[se+1]=a[2],ne[se+2]=a[1],ne[se+3]=a[0]}O.writeFloatLE=q?F:Z,O.writeFloatBE=q?Z:F;function X(Q,ne){return a[0]=Q[ne],a[1]=Q[ne+1],a[2]=Q[ne+2],a[3]=Q[ne+3],n[0]}function ee(Q,ne){return a[3]=Q[ne],a[2]=Q[ne+1],a[1]=Q[ne+2],a[0]=Q[ne+3],n[0]}O.readFloatLE=q?X:ee,O.readFloatBE=q?ee:X}():function(){function n(q,F,Z,X){var ee=F<0?1:0;if(ee&&(F=-F),F===0)q(1/F>0?0:2147483648,Z,X);else if(isNaN(F))q(2143289344,Z,X);else if(F>34028234663852886e22)q((ee<<31|2139095040)>>>0,Z,X);else if(F<11754943508222875e-54)q((ee<<31|Math.round(F/1401298464324817e-60))>>>0,Z,X);else{var Q=Math.floor(Math.log(F)/Math.LN2),ne=Math.round(F*Math.pow(2,-Q)*8388608)&8388607;q((ee<<31|Q+127<<23|ne)>>>0,Z,X)}}O.writeFloatLE=n.bind(null,z),O.writeFloatBE=n.bind(null,N);function a(q,F,Z){var X=q(F,Z),ee=(X>>31)*2+1,Q=X>>>23&255,ne=X&8388607;return Q===255?ne?NaN:ee*(1/0):Q===0?ee*1401298464324817e-60*ne:ee*Math.pow(2,Q-150)*(ne+8388608)}O.readFloatLE=a.bind(null,J),O.readFloatBE=a.bind(null,I)}(),typeof Float64Array<"u"?function(){var n=new Float64Array([-0]),a=new Uint8Array(n.buffer),q=a[7]===128;function F(Q,ne,se){n[0]=Q,ne[se]=a[0],ne[se+1]=a[1],ne[se+2]=a[2],ne[se+3]=a[3],ne[se+4]=a[4],ne[se+5]=a[5],ne[se+6]=a[6],ne[se+7]=a[7]}function Z(Q,ne,se){n[0]=Q,ne[se]=a[7],ne[se+1]=a[6],ne[se+2]=a[5],ne[se+3]=a[4],ne[se+4]=a[3],ne[se+5]=a[2],ne[se+6]=a[1],ne[se+7]=a[0]}O.writeDoubleLE=q?F:Z,O.writeDoubleBE=q?Z:F;function X(Q,ne){return a[0]=Q[ne],a[1]=Q[ne+1],a[2]=Q[ne+2],a[3]=Q[ne+3],a[4]=Q[ne+4],a[5]=Q[ne+5],a[6]=Q[ne+6],a[7]=Q[ne+7],n[0]}function ee(Q,ne){return a[7]=Q[ne],a[6]=Q[ne+1],a[5]=Q[ne+2],a[4]=Q[ne+3],a[3]=Q[ne+4],a[2]=Q[ne+5],a[1]=Q[ne+6],a[0]=Q[ne+7],n[0]}O.readDoubleLE=q?X:ee,O.readDoubleBE=q?ee:X}():function(){function n(q,F,Z,X,ee,Q){var ne=X<0?1:0;if(ne&&(X=-X),X===0)q(0,ee,Q+F),q(1/X>0?0:2147483648,ee,Q+Z);else if(isNaN(X))q(0,ee,Q+F),q(2146959360,ee,Q+Z);else if(X>17976931348623157e292)q(0,ee,Q+F),q((ne<<31|2146435072)>>>0,ee,Q+Z);else{var se;if(X<22250738585072014e-324)se=X/5e-324,q(se>>>0,ee,Q+F),q((ne<<31|se/4294967296)>>>0,ee,Q+Z);else{var re=Math.floor(Math.log(X)/Math.LN2);re===1024&&(re=1023),se=X*Math.pow(2,-re),q(se*4503599627370496>>>0,ee,Q+F),q((ne<<31|re+1023<<20|se*1048576&1048575)>>>0,ee,Q+Z)}}}O.writeDoubleLE=n.bind(null,z,0,4),O.writeDoubleBE=n.bind(null,N,4,0);function a(q,F,Z,X,ee){var Q=q(X,ee+F),ne=q(X,ee+Z),se=(ne>>31)*2+1,re=ne>>>20&2047,oe=4294967296*(ne&1048575)+Q;return re===2047?oe?NaN:se*(1/0):re===0?se*5e-324*oe:se*Math.pow(2,re-1075)*(oe+4503599627370496)}O.readDoubleLE=a.bind(null,J,0,4),O.readDoubleBE=a.bind(null,I,4,0)}(),O}function z(O,n,a){n[a]=O&255,n[a+1]=O>>>8&255,n[a+2]=O>>>16&255,n[a+3]=O>>>24}function N(O,n,a){n[a]=O>>>24,n[a+1]=O>>>16&255,n[a+2]=O>>>8&255,n[a+3]=O&255}function J(O,n){return(O[n]|O[n+1]<<8|O[n+2]<<16|O[n+3]<<24)>>>0}function I(O,n){return(O[n]<<24|O[n+1]<<16|O[n+2]<<8|O[n+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 z=D;z.length=function(J){for(var I=0,O=0,n=0;n<J.length;++n)O=J.charCodeAt(n),O<128?I+=1:O<2048?I+=2:(O&64512)===55296&&(J.charCodeAt(n+1)&64512)===56320?(++n,I+=4):I+=3;return I},z.read=function(J,I,O){var n=O-I;if(n<1)return"";for(var a=null,q=[],F=0,Z;I<O;)Z=J[I++],Z<128?q[F++]=Z:Z>191&&Z<224?q[F++]=(Z&31)<<6|J[I++]&63:Z>239&&Z<365?(Z=((Z&7)<<18|(J[I++]&63)<<12|(J[I++]&63)<<6|J[I++]&63)-65536,q[F++]=55296+(Z>>10),q[F++]=56320+(Z&1023)):q[F++]=(Z&15)<<12|(J[I++]&63)<<6|J[I++]&63,F>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,q)),F=0);return a?(F&&a.push(String.fromCharCode.apply(String,q.slice(0,F))),a.join("")):String.fromCharCode.apply(String,q.slice(0,F))},z.write=function(J,I,O){for(var n=O,a,q,F=0;F<J.length;++F)a=J.charCodeAt(F),a<128?I[O++]=a:a<2048?(I[O++]=a>>6|192,I[O++]=a&63|128):(a&64512)===55296&&((q=J.charCodeAt(F+1))&64512)===56320?(a=65536+((a&1023)<<10)+(q&1023),++F,I[O++]=a>>18|240,I[O++]=a>>12&63|128,I[O++]=a>>6&63|128,I[O++]=a&63|128):(I[O++]=a>>12|224,I[O++]=a>>6&63|128,I[O++]=a&63|128);return O-n}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=D;function D(z,N,J){var I=J||8192,O=I>>>1,n=null,a=I;return function(F){if(F<1||F>O)return z(F);a+F>I&&(n=z(I),a=0);var Z=N.call(n,a,a+=F);return a&7&&(a=(a|7)+1),Z}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=z;var D=requireMinimal$1();function z(O,n){this.lo=O>>>0,this.hi=n>>>0}var N=z.zero=new z(0,0);N.toNumber=function(){return 0},N.zzEncode=N.zzDecode=function(){return this},N.length=function(){return 1};var J=z.zeroHash="\0\0\0\0\0\0\0\0";z.fromNumber=function(n){if(n===0)return N;var a=n<0;a&&(n=-n);var q=n>>>0,F=(n-q)/4294967296>>>0;return a&&(F=~F>>>0,q=~q>>>0,++q>4294967295&&(q=0,++F>4294967295&&(F=0))),new z(q,F)},z.from=function(n){if(typeof n=="number")return z.fromNumber(n);if(D.isString(n))if(D.Long)n=D.Long.fromString(n);else return z.fromNumber(parseInt(n,10));return n.low||n.high?new z(n.low>>>0,n.high>>>0):N},z.prototype.toNumber=function(n){if(!n&&this.hi>>>31){var a=~this.lo+1>>>0,q=~this.hi>>>0;return a||(q=q+1>>>0),-(a+q*4294967296)}return this.lo+this.hi*4294967296},z.prototype.toLong=function(n){return D.Long?new D.Long(this.lo|0,this.hi|0,!!n):{low:this.lo|0,high:this.hi|0,unsigned:!!n}};var I=String.prototype.charCodeAt;return z.fromHash=function(n){return n===J?N:new z((I.call(n,0)|I.call(n,1)<<8|I.call(n,2)<<16|I.call(n,3)<<24)>>>0,(I.call(n,4)|I.call(n,5)<<8|I.call(n,6)<<16|I.call(n,7)<<24)>>>0)},z.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)},z.prototype.zzEncode=function(){var n=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^n)>>>0,this.lo=(this.lo<<1^n)>>>0,this},z.prototype.zzDecode=function(){var n=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^n)>>>0,this.hi=(this.hi>>>1^n)>>>0,this},z.prototype.length=function(){var n=this.lo,a=(this.lo>>>28|this.hi<<4)>>>0,q=this.hi>>>24;return q===0?a===0?n<16384?n<128?1:2:n<2097152?3:4:a<16384?a<128?5:6:a<2097152?7:8:q<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(D){var z=D;z.asPromise=requireAspromise(),z.base64=requireBase64(),z.EventEmitter=requireEventemitter(),z.float=requireFloat(),z.inquire=requireInquire(),z.utf8=requireUtf8(),z.pool=requirePool(),z.LongBits=requireLongbits(),z.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),z.global=z.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,z.emptyArray=Object.freeze?Object.freeze([]):[],z.emptyObject=Object.freeze?Object.freeze({}):{},z.isInteger=Number.isInteger||function(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O},z.isString=function(O){return typeof O=="string"||O instanceof String},z.isObject=function(O){return O&&typeof O=="object"},z.isset=z.isSet=function(O,n){var a=O[n];return a!=null&&O.hasOwnProperty(n)?typeof a!="object"||(Array.isArray(a)?a.length:Object.keys(a).length)>0:!1},z.Buffer=function(){try{var I=z.inquire("buffer").Buffer;return I.prototype.utf8Write?I:null}catch{return null}}(),z._Buffer_from=null,z._Buffer_allocUnsafe=null,z.newBuffer=function(O){return typeof O=="number"?z.Buffer?z._Buffer_allocUnsafe(O):new z.Array(O):z.Buffer?z._Buffer_from(O):typeof Uint8Array>"u"?O:new Uint8Array(O)},z.Array=typeof Uint8Array<"u"?Uint8Array:Array,z.Long=z.global.dcodeIO&&z.global.dcodeIO.Long||z.global.Long||z.inquire("long"),z.key2Re=/^true|false|0|1$/,z.key32Re=/^-?(?:0|[1-9][0-9]*)$/,z.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,z.longToHash=function(O){return O?z.LongBits.from(O).toHash():z.LongBits.zeroHash},z.longFromHash=function(O,n){var a=z.LongBits.fromHash(O);return z.Long?z.Long.fromBits(a.lo,a.hi,n):a.toNumber(!!n)};function N(I,O,n){for(var a=Object.keys(O),q=0;q<a.length;++q)(I[a[q]]===void 0||!n)&&(I[a[q]]=O[a[q]]);return I}z.merge=N,z.lcFirst=function(O){return O.charAt(0).toLowerCase()+O.substring(1)};function J(I){function O(n,a){if(!(this instanceof O))return new O(n,a);Object.defineProperty(this,"message",{get:function(){return n}}),Error.captureStackTrace?Error.captureStackTrace(this,O):Object.defineProperty(this,"stack",{value:new Error().stack||""}),a&&N(this,a)}return O.prototype=Object.create(Error.prototype,{constructor:{value:O,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return I},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),O}z.newError=J,z.ProtocolError=J("ProtocolError"),z.oneOfGetter=function(O){for(var n={},a=0;a<O.length;++a)n[O[a]]=1;return function(){for(var q=Object.keys(this),F=q.length-1;F>-1;--F)if(n[q[F]]===1&&this[q[F]]!==void 0&&this[q[F]]!==null)return q[F]}},z.oneOfSetter=function(O){return function(n){for(var a=0;a<O.length;++a)O[a]!==n&&delete this[O[a]]}},z.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},z._configure=function(){var I=z.Buffer;if(!I){z._Buffer_from=z._Buffer_allocUnsafe=null;return}z._Buffer_from=I.from!==Uint8Array.from&&I.from||function(n,a){return new I(n,a)},z._Buffer_allocUnsafe=I.allocUnsafe||function(n){return new I(n)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=q;var D=requireMinimal$1(),z,N=D.LongBits,J=D.base64,I=D.utf8;function O(re,oe,me){this.fn=re,this.len=oe,this.next=void 0,this.val=me}function n(){}function a(re){this.head=re.head,this.tail=re.tail,this.len=re.len,this.next=re.states}function q(){this.len=0,this.head=new O(n,0,0),this.tail=this.head,this.states=null}var F=function(){return D.Buffer?function(){return(q.create=function(){return new z})()}:function(){return new q}};q.create=F(),q.alloc=function(oe){return new D.Array(oe)},D.Array!==Array&&(q.alloc=D.pool(q.alloc,D.Array.prototype.subarray)),q.prototype._push=function(oe,me,_e){return this.tail=this.tail.next=new O(oe,me,_e),this.len+=me,this};function Z(re,oe,me){oe[me]=re&255}function X(re,oe,me){for(;re>127;)oe[me++]=re&127|128,re>>>=7;oe[me]=re}function ee(re,oe){this.len=re,this.next=void 0,this.val=oe}ee.prototype=Object.create(O.prototype),ee.prototype.fn=X,q.prototype.uint32=function(oe){return this.len+=(this.tail=this.tail.next=new ee((oe=oe>>>0)<128?1:oe<16384?2:oe<2097152?3:oe<268435456?4:5,oe)).len,this},q.prototype.int32=function(oe){return oe<0?this._push(Q,10,N.fromNumber(oe)):this.uint32(oe)},q.prototype.sint32=function(oe){return this.uint32((oe<<1^oe>>31)>>>0)};function Q(re,oe,me){for(;re.hi;)oe[me++]=re.lo&127|128,re.lo=(re.lo>>>7|re.hi<<25)>>>0,re.hi>>>=7;for(;re.lo>127;)oe[me++]=re.lo&127|128,re.lo=re.lo>>>7;oe[me++]=re.lo}q.prototype.uint64=function(oe){var me=N.from(oe);return this._push(Q,me.length(),me)},q.prototype.int64=q.prototype.uint64,q.prototype.sint64=function(oe){var me=N.from(oe).zzEncode();return this._push(Q,me.length(),me)},q.prototype.bool=function(oe){return this._push(Z,1,oe?1:0)};function ne(re,oe,me){oe[me]=re&255,oe[me+1]=re>>>8&255,oe[me+2]=re>>>16&255,oe[me+3]=re>>>24}q.prototype.fixed32=function(oe){return this._push(ne,4,oe>>>0)},q.prototype.sfixed32=q.prototype.fixed32,q.prototype.fixed64=function(oe){var me=N.from(oe);return this._push(ne,4,me.lo)._push(ne,4,me.hi)},q.prototype.sfixed64=q.prototype.fixed64,q.prototype.float=function(oe){return this._push(D.float.writeFloatLE,4,oe)},q.prototype.double=function(oe){return this._push(D.float.writeDoubleLE,8,oe)};var se=D.Array.prototype.set?function(oe,me,_e){me.set(oe,_e)}:function(oe,me,_e){for(var ae=0;ae<oe.length;++ae)me[_e+ae]=oe[ae]};return q.prototype.bytes=function(oe){var me=oe.length>>>0;if(!me)return this._push(Z,1,0);if(D.isString(oe)){var _e=q.alloc(me=J.length(oe));J.decode(oe,_e,0),oe=_e}return this.uint32(me)._push(se,me,oe)},q.prototype.string=function(oe){var me=I.length(oe);return me?this.uint32(me)._push(I.write,me,oe):this._push(Z,1,0)},q.prototype.fork=function(){return this.states=new a(this),this.head=this.tail=new O(n,0,0),this.len=0,this},q.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 O(n,0,0),this.len=0),this},q.prototype.ldelim=function(){var oe=this.head,me=this.tail,_e=this.len;return this.reset().uint32(_e),_e&&(this.tail.next=oe.next,this.tail=me,this.len+=_e),this},q.prototype.finish=function(){for(var oe=this.head.next,me=this.constructor.alloc(this.len),_e=0;oe;)oe.fn(oe.val,me,_e),_e+=oe.len,oe=oe.next;return me},q._configure=function(re){z=re,q.create=F(),z._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=N;var D=requireWriter();(N.prototype=Object.create(D.prototype)).constructor=N;var z=requireMinimal$1();function N(){D.call(this)}N._configure=function(){N.alloc=z._Buffer_allocUnsafe,N.writeBytesBuffer=z.Buffer&&z.Buffer.prototype instanceof Uint8Array&&z.Buffer.prototype.set.name==="set"?function(O,n,a){n.set(O,a)}:function(O,n,a){if(O.copy)O.copy(n,a,0,O.length);else for(var q=0;q<O.length;)n[a++]=O[q++]}},N.prototype.bytes=function(O){z.isString(O)&&(O=z._Buffer_from(O,"base64"));var n=O.length>>>0;return this.uint32(n),n&&this._push(N.writeBytesBuffer,n,O),this};function J(I,O,n){I.length<40?z.utf8.write(I,O,n):O.utf8Write?O.utf8Write(I,n):O.write(I,n)}return N.prototype.string=function(O){var n=z.Buffer.byteLength(O);return this.uint32(n),n&&this._push(J,n,O),this},N._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=O;var D=requireMinimal$1(),z,N=D.LongBits,J=D.utf8;function I(X,ee){return RangeError("index out of range: "+X.pos+" + "+(ee||1)+" > "+X.len)}function O(X){this.buf=X,this.pos=0,this.len=X.length}var n=typeof Uint8Array<"u"?function(ee){if(ee instanceof Uint8Array||Array.isArray(ee))return new O(ee);throw Error("illegal buffer")}:function(ee){if(Array.isArray(ee))return new O(ee);throw Error("illegal buffer")},a=function(){return D.Buffer?function(Q){return(O.create=function(se){return D.Buffer.isBuffer(se)?new z(se):n(se)})(Q)}:n};O.create=a(),O.prototype._slice=D.Array.prototype.subarray||D.Array.prototype.slice,O.prototype.uint32=function(){var ee=4294967295;return function(){if(ee=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(ee=(ee|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(ee=(ee|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(ee=(ee|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(ee=(ee|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return ee;if((this.pos+=5)>this.len)throw this.pos=this.len,I(this,10);return ee}}(),O.prototype.int32=function(){return this.uint32()|0},O.prototype.sint32=function(){var ee=this.uint32();return ee>>>1^-(ee&1)|0};function q(){var X=new N(0,0),ee=0;if(this.len-this.pos>4){for(;ee<4;++ee)if(X.lo=(X.lo|(this.buf[this.pos]&127)<<ee*7)>>>0,this.buf[this.pos++]<128)return X;if(X.lo=(X.lo|(this.buf[this.pos]&127)<<28)>>>0,X.hi=(X.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return X;ee=0}else{for(;ee<3;++ee){if(this.pos>=this.len)throw I(this);if(X.lo=(X.lo|(this.buf[this.pos]&127)<<ee*7)>>>0,this.buf[this.pos++]<128)return X}return X.lo=(X.lo|(this.buf[this.pos++]&127)<<ee*7)>>>0,X}if(this.len-this.pos>4){for(;ee<5;++ee)if(X.hi=(X.hi|(this.buf[this.pos]&127)<<ee*7+3)>>>0,this.buf[this.pos++]<128)return X}else for(;ee<5;++ee){if(this.pos>=this.len)throw I(this);if(X.hi=(X.hi|(this.buf[this.pos]&127)<<ee*7+3)>>>0,this.buf[this.pos++]<128)return X}throw Error("invalid varint encoding")}O.prototype.bool=function(){return this.uint32()!==0};function F(X,ee){return(X[ee-4]|X[ee-3]<<8|X[ee-2]<<16|X[ee-1]<<24)>>>0}O.prototype.fixed32=function(){if(this.pos+4>this.len)throw I(this,4);return F(this.buf,this.pos+=4)},O.prototype.sfixed32=function(){if(this.pos+4>this.len)throw I(this,4);return F(this.buf,this.pos+=4)|0};function Z(){if(this.pos+8>this.len)throw I(this,8);return new N(F(this.buf,this.pos+=4),F(this.buf,this.pos+=4))}return O.prototype.float=function(){if(this.pos+4>this.len)throw I(this,4);var ee=D.float.readFloatLE(this.buf,this.pos);return this.pos+=4,ee},O.prototype.double=function(){if(this.pos+8>this.len)throw I(this,4);var ee=D.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,ee},O.prototype.bytes=function(){var ee=this.uint32(),Q=this.pos,ne=this.pos+ee;if(ne>this.len)throw I(this,ee);if(this.pos+=ee,Array.isArray(this.buf))return this.buf.slice(Q,ne);if(Q===ne){var se=D.Buffer;return se?se.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,Q,ne)},O.prototype.string=function(){var ee=this.bytes();return J.read(ee,0,ee.length)},O.prototype.skip=function(ee){if(typeof ee=="number"){if(this.pos+ee>this.len)throw I(this,ee);this.pos+=ee}else do if(this.pos>=this.len)throw I(this);while(this.buf[this.pos++]&128);return this},O.prototype.skipType=function(X){switch(X){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(X=this.uint32()&7)!==4;)this.skipType(X);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+X+" at offset "+this.pos)}return this},O._configure=function(X){z=X,O.create=a(),z._configure();var ee=D.Long?"toLong":"toNumber";D.merge(O.prototype,{int64:function(){return q.call(this)[ee](!1)},uint64:function(){return q.call(this)[ee](!0)},sint64:function(){return q.call(this).zzDecode()[ee](!1)},fixed64:function(){return Z.call(this)[ee](!0)},sfixed64:function(){return Z.call(this)[ee](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=N;var D=requireReader();(N.prototype=Object.create(D.prototype)).constructor=N;var z=requireMinimal$1();function N(J){D.call(this,J)}return N._configure=function(){z.Buffer&&(N.prototype._slice=z.Buffer.prototype.slice)},N.prototype.string=function(){var I=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+I,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+I,this.len))},N._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=z;var D=requireMinimal$1();(z.prototype=Object.create(D.EventEmitter.prototype)).constructor=z;function z(N,J,I){if(typeof N!="function")throw TypeError("rpcImpl must be a function");D.EventEmitter.call(this),this.rpcImpl=N,this.requestDelimited=!!J,this.responseDelimited=!!I}return z.prototype.rpcCall=function N(J,I,O,n,a){if(!n)throw TypeError("request must be specified");var q=this;if(!a)return D.asPromise(N,q,J,I,O,n);if(!q.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return q.rpcImpl(J,I[q.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(Z,X){if(Z)return q.emit("error",Z,J),a(Z);if(X===null){q.end(!0);return}if(!(X instanceof O))try{X=O[q.responseDelimited?"decodeDelimited":"decode"](X)}catch(ee){return q.emit("error",ee,J),a(ee)}return q.emit("data",X,J),a(null,X)})}catch(F){q.emit("error",F,J),setTimeout(function(){a(F)},0);return}},z.prototype.end=function(J){return this.rpcImpl&&(J||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 z=D;z.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 z=D;z.build="minimal",z.Writer=requireWriter(),z.BufferWriter=requireWriter_buffer(),z.Reader=requireReader(),z.BufferReader=requireReader_buffer(),z.util=requireMinimal$1(),z.rpc=requireRpc(),z.roots=requireRoots(),z.configure=N;function N(){z.util._configure(),z.Writer._configure(z.BufferWriter),z.Reader._configure(z.BufferReader)}N()}(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 z={};return z.voice=function(){const N={};return N.proto=function(){const J={};return J.CommonReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.event="",I.prototype.data=$util.newBuffer([]),I.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.version=0,I.prototype.compress=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.event!=null&&Object.hasOwnProperty.call(n,"event")&&a.uint32(10).string(n.event),n.data!=null&&Object.hasOwnProperty.call(n,"data")&&a.uint32(18).bytes(n.data),n.sn!=null&&Object.hasOwnProperty.call(n,"sn")&&a.uint32(24).int64(n.sn),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(32).int64(n.time),n.valid!=null&&Object.hasOwnProperty.call(n,"valid")&&a.uint32(40).int64(n.valid),n.version!=null&&Object.hasOwnProperty.call(n,"version")&&a.uint32(48).int32(n.version),n.compress!=null&&Object.hasOwnProperty.call(n,"compress")&&a.uint32(56).bool(n.compress),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CommonReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.event=n.string();break}case 2:{F.data=n.bytes();break}case 3:{F.sn=n.int64();break}case 4:{F.time=n.int64();break}case 5:{F.valid=n.int64();break}case 6:{F.version=n.int32();break}case 7:{F.compress=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.event!=null&&n.hasOwnProperty("event")&&!$util.isString(n.event)?"event: string expected":n.data!=null&&n.hasOwnProperty("data")&&!(n.data&&typeof n.data.length=="number"||$util.isString(n.data))?"data: buffer expected":n.sn!=null&&n.hasOwnProperty("sn")&&!$util.isInteger(n.sn)&&!(n.sn&&$util.isInteger(n.sn.low)&&$util.isInteger(n.sn.high))?"sn: integer|Long expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":n.valid!=null&&n.hasOwnProperty("valid")&&!$util.isInteger(n.valid)&&!(n.valid&&$util.isInteger(n.valid.low)&&$util.isInteger(n.valid.high))?"valid: integer|Long expected":n.version!=null&&n.hasOwnProperty("version")&&!$util.isInteger(n.version)?"version: integer expected":n.compress!=null&&n.hasOwnProperty("compress")&&typeof n.compress!="boolean"?"compress: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CommonReq)return n;let a=new $root.com.quick.voice.proto.CommonReq;return n.event!=null&&(a.event=String(n.event)),n.data!=null&&(typeof n.data=="string"?$util.base64.decode(n.data,a.data=$util.newBuffer($util.base64.length(n.data)),0):n.data.length>=0&&(a.data=n.data)),n.sn!=null&&($util.Long?(a.sn=$util.Long.fromValue(n.sn)).unsigned=!1:typeof n.sn=="string"?a.sn=parseInt(n.sn,10):typeof n.sn=="number"?a.sn=n.sn:typeof n.sn=="object"&&(a.sn=new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber())),n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),n.valid!=null&&($util.Long?(a.valid=$util.Long.fromValue(n.valid)).unsigned=!1:typeof n.valid=="string"?a.valid=parseInt(n.valid,10):typeof n.valid=="number"?a.valid=n.valid:typeof n.valid=="object"&&(a.valid=new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber())),n.version!=null&&(a.version=n.version|0),n.compress!=null&&(a.compress=!!n.compress),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults){if(q.event="",a.bytes===String?q.data="":(q.data=[],a.bytes!==Array&&(q.data=$util.newBuffer(q.data))),$util.Long){let F=new $util.Long(0,0,!1);q.sn=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.sn=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.valid=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.valid=a.longs===String?"0":0;q.version=0,q.compress=!1}return n.event!=null&&n.hasOwnProperty("event")&&(q.event=n.event),n.data!=null&&n.hasOwnProperty("data")&&(q.data=a.bytes===String?$util.base64.encode(n.data,0,n.data.length):a.bytes===Array?Array.prototype.slice.call(n.data):n.data),n.sn!=null&&n.hasOwnProperty("sn")&&(typeof n.sn=="number"?q.sn=a.longs===String?String(n.sn):n.sn:q.sn=a.longs===String?$util.Long.prototype.toString.call(n.sn):a.longs===Number?new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber():n.sn),n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),n.valid!=null&&n.hasOwnProperty("valid")&&(typeof n.valid=="number"?q.valid=a.longs===String?String(n.valid):n.valid:q.valid=a.longs===String?$util.Long.prototype.toString.call(n.valid):a.longs===Number?new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber():n.valid),n.version!=null&&n.hasOwnProperty("version")&&(q.version=n.version),n.compress!=null&&n.hasOwnProperty("compress")&&(q.compress=n.compress),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CommonReq"},I}(),J.CommonRsp=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.event="",I.prototype.data=$util.newBuffer([]),I.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.code=0,I.prototype.desc="",I.prototype.version=0,I.prototype.compress=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.event!=null&&Object.hasOwnProperty.call(n,"event")&&a.uint32(10).string(n.event),n.data!=null&&Object.hasOwnProperty.call(n,"data")&&a.uint32(18).bytes(n.data),n.sn!=null&&Object.hasOwnProperty.call(n,"sn")&&a.uint32(24).int64(n.sn),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(32).int64(n.time),n.valid!=null&&Object.hasOwnProperty.call(n,"valid")&&a.uint32(40).int64(n.valid),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&a.uint32(48).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&a.uint32(58).string(n.desc),n.version!=null&&Object.hasOwnProperty.call(n,"version")&&a.uint32(64).int32(n.version),n.compress!=null&&Object.hasOwnProperty.call(n,"compress")&&a.uint32(72).bool(n.compress),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CommonRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.event=n.string();break}case 2:{F.data=n.bytes();break}case 3:{F.sn=n.int64();break}case 4:{F.time=n.int64();break}case 5:{F.valid=n.int64();break}case 6:{F.code=n.int32();break}case 7:{F.desc=n.string();break}case 8:{F.version=n.int32();break}case 9:{F.compress=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.event!=null&&n.hasOwnProperty("event")&&!$util.isString(n.event)?"event: string expected":n.data!=null&&n.hasOwnProperty("data")&&!(n.data&&typeof n.data.length=="number"||$util.isString(n.data))?"data: buffer expected":n.sn!=null&&n.hasOwnProperty("sn")&&!$util.isInteger(n.sn)&&!(n.sn&&$util.isInteger(n.sn.low)&&$util.isInteger(n.sn.high))?"sn: integer|Long expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":n.valid!=null&&n.hasOwnProperty("valid")&&!$util.isInteger(n.valid)&&!(n.valid&&$util.isInteger(n.valid.low)&&$util.isInteger(n.valid.high))?"valid: integer|Long expected":n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code)?"code: integer expected":n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc)?"desc: string expected":n.version!=null&&n.hasOwnProperty("version")&&!$util.isInteger(n.version)?"version: integer expected":n.compress!=null&&n.hasOwnProperty("compress")&&typeof n.compress!="boolean"?"compress: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CommonRsp)return n;let a=new $root.com.quick.voice.proto.CommonRsp;return n.event!=null&&(a.event=String(n.event)),n.data!=null&&(typeof n.data=="string"?$util.base64.decode(n.data,a.data=$util.newBuffer($util.base64.length(n.data)),0):n.data.length>=0&&(a.data=n.data)),n.sn!=null&&($util.Long?(a.sn=$util.Long.fromValue(n.sn)).unsigned=!1:typeof n.sn=="string"?a.sn=parseInt(n.sn,10):typeof n.sn=="number"?a.sn=n.sn:typeof n.sn=="object"&&(a.sn=new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber())),n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),n.valid!=null&&($util.Long?(a.valid=$util.Long.fromValue(n.valid)).unsigned=!1:typeof n.valid=="string"?a.valid=parseInt(n.valid,10):typeof n.valid=="number"?a.valid=n.valid:typeof n.valid=="object"&&(a.valid=new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber())),n.code!=null&&(a.code=n.code|0),n.desc!=null&&(a.desc=String(n.desc)),n.version!=null&&(a.version=n.version|0),n.compress!=null&&(a.compress=!!n.compress),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults){if(q.event="",a.bytes===String?q.data="":(q.data=[],a.bytes!==Array&&(q.data=$util.newBuffer(q.data))),$util.Long){let F=new $util.Long(0,0,!1);q.sn=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.sn=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.valid=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.valid=a.longs===String?"0":0;q.code=0,q.desc="",q.version=0,q.compress=!1}return n.event!=null&&n.hasOwnProperty("event")&&(q.event=n.event),n.data!=null&&n.hasOwnProperty("data")&&(q.data=a.bytes===String?$util.base64.encode(n.data,0,n.data.length):a.bytes===Array?Array.prototype.slice.call(n.data):n.data),n.sn!=null&&n.hasOwnProperty("sn")&&(typeof n.sn=="number"?q.sn=a.longs===String?String(n.sn):n.sn:q.sn=a.longs===String?$util.Long.prototype.toString.call(n.sn):a.longs===Number?new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber():n.sn),n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),n.valid!=null&&n.hasOwnProperty("valid")&&(typeof n.valid=="number"?q.valid=a.longs===String?String(n.valid):n.valid:q.valid=a.longs===String?$util.Long.prototype.toString.call(n.valid):a.longs===Number?new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber():n.valid),n.code!=null&&n.hasOwnProperty("code")&&(q.code=n.code),n.desc!=null&&n.hasOwnProperty("desc")&&(q.desc=n.desc),n.version!=null&&n.hasOwnProperty("version")&&(q.version=n.version),n.compress!=null&&n.hasOwnProperty("compress")&&(q.compress=n.compress),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CommonRsp"},I}(),J.User=function(){function I(n){if(this.tracks=[],n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.id="",I.prototype.callAction=null,I.prototype.callState=null,I.prototype.joinTime=null,I.prototype.tracks=$util.emptyArray,I.prototype.permissions=null,I.prototype.isPublished=null,I.prototype.behavior=null,I.prototype.channelCache=null;let O;return Object.defineProperty(I.prototype,"_callAction",{get:$util.oneOfGetter(O=["callAction"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_callState",{get:$util.oneOfGetter(O=["callState"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_joinTime",{get:$util.oneOfGetter(O=["joinTime"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_permissions",{get:$util.oneOfGetter(O=["permissions"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_isPublished",{get:$util.oneOfGetter(O=["isPublished"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_behavior",{get:$util.oneOfGetter(O=["behavior"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_channelCache",{get:$util.oneOfGetter(O=["channelCache"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){if(q||(q=$Writer.create()),a.id!=null&&Object.hasOwnProperty.call(a,"id")&&q.uint32(10).string(a.id),a.callAction!=null&&Object.hasOwnProperty.call(a,"callAction")&&q.uint32(16).int32(a.callAction),a.callState!=null&&Object.hasOwnProperty.call(a,"callState")&&q.uint32(24).int32(a.callState),a.joinTime!=null&&Object.hasOwnProperty.call(a,"joinTime")&&q.uint32(32).int64(a.joinTime),a.tracks!=null&&a.tracks.length)for(let F=0;F<a.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(a.tracks[F],q.uint32(42).fork()).ldelim();return a.permissions!=null&&Object.hasOwnProperty.call(a,"permissions")&&q.uint32(48).int32(a.permissions),a.isPublished!=null&&Object.hasOwnProperty.call(a,"isPublished")&&q.uint32(56).bool(a.isPublished),a.behavior!=null&&Object.hasOwnProperty.call(a,"behavior")&&q.uint32(64).int32(a.behavior),a.channelCache!=null&&Object.hasOwnProperty.call(a,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(a.channelCache,q.uint32(74).fork()).ldelim(),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.User;for(;a.pos<F;){let X=a.uint32();switch(X>>>3){case 1:{Z.id=a.string();break}case 2:{Z.callAction=a.int32();break}case 3:{Z.callState=a.int32();break}case 4:{Z.joinTime=a.int64();break}case 5:{Z.tracks&&Z.tracks.length||(Z.tracks=[]),Z.tracks.push($root.com.quick.voice.proto.Track.decode(a,a.uint32()));break}case 6:{Z.permissions=a.int32();break}case 7:{Z.isPublished=a.bool();break}case 8:{Z.behavior=a.int32();break}case 9:{Z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(a,a.uint32());break}default:a.skipType(X&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.id!=null&&a.hasOwnProperty("id")&&!$util.isString(a.id))return"id: string expected";if(a.callAction!=null&&a.hasOwnProperty("callAction")&&!$util.isInteger(a.callAction))return"callAction: integer expected";if(a.callState!=null&&a.hasOwnProperty("callState")&&!$util.isInteger(a.callState))return"callState: integer expected";if(a.joinTime!=null&&a.hasOwnProperty("joinTime")&&!$util.isInteger(a.joinTime)&&!(a.joinTime&&$util.isInteger(a.joinTime.low)&&$util.isInteger(a.joinTime.high)))return"joinTime: integer|Long expected";if(a.tracks!=null&&a.hasOwnProperty("tracks")){if(!Array.isArray(a.tracks))return"tracks: array expected";for(let q=0;q<a.tracks.length;++q){let F=$root.com.quick.voice.proto.Track.verify(a.tracks[q]);if(F)return"tracks."+F}}if(a.permissions!=null&&a.hasOwnProperty("permissions")&&!$util.isInteger(a.permissions))return"permissions: integer expected";if(a.isPublished!=null&&a.hasOwnProperty("isPublished")&&typeof a.isPublished!="boolean")return"isPublished: boolean expected";if(a.behavior!=null&&a.hasOwnProperty("behavior")&&!$util.isInteger(a.behavior))return"behavior: integer expected";if(a.channelCache!=null&&a.hasOwnProperty("channelCache")){let q=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(a.channelCache);if(q)return"channelCache."+q}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.User)return a;let q=new $root.com.quick.voice.proto.User;if(a.id!=null&&(q.id=String(a.id)),a.callAction!=null&&(q.callAction=a.callAction|0),a.callState!=null&&(q.callState=a.callState|0),a.joinTime!=null&&($util.Long?(q.joinTime=$util.Long.fromValue(a.joinTime)).unsigned=!1:typeof a.joinTime=="string"?q.joinTime=parseInt(a.joinTime,10):typeof a.joinTime=="number"?q.joinTime=a.joinTime:typeof a.joinTime=="object"&&(q.joinTime=new $util.LongBits(a.joinTime.low>>>0,a.joinTime.high>>>0).toNumber())),a.tracks){if(!Array.isArray(a.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");q.tracks=[];for(let F=0;F<a.tracks.length;++F){if(typeof a.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");q.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(a.tracks[F])}}if(a.permissions!=null&&(q.permissions=a.permissions|0),a.isPublished!=null&&(q.isPublished=!!a.isPublished),a.behavior!=null&&(q.behavior=a.behavior|0),a.channelCache!=null){if(typeof a.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");q.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(a.channelCache)}return q},I.toObject=function(a,q){q||(q={});let F={};if((q.arrays||q.defaults)&&(F.tracks=[]),q.defaults&&(F.id=""),a.id!=null&&a.hasOwnProperty("id")&&(F.id=a.id),a.callAction!=null&&a.hasOwnProperty("callAction")&&(F.callAction=a.callAction,q.oneofs&&(F._callAction="callAction")),a.callState!=null&&a.hasOwnProperty("callState")&&(F.callState=a.callState,q.oneofs&&(F._callState="callState")),a.joinTime!=null&&a.hasOwnProperty("joinTime")&&(typeof a.joinTime=="number"?F.joinTime=q.longs===String?String(a.joinTime):a.joinTime:F.joinTime=q.longs===String?$util.Long.prototype.toString.call(a.joinTime):q.longs===Number?new $util.LongBits(a.joinTime.low>>>0,a.joinTime.high>>>0).toNumber():a.joinTime,q.oneofs&&(F._joinTime="joinTime")),a.tracks&&a.tracks.length){F.tracks=[];for(let Z=0;Z<a.tracks.length;++Z)F.tracks[Z]=$root.com.quick.voice.proto.Track.toObject(a.tracks[Z],q)}return a.permissions!=null&&a.hasOwnProperty("permissions")&&(F.permissions=a.permissions,q.oneofs&&(F._permissions="permissions")),a.isPublished!=null&&a.hasOwnProperty("isPublished")&&(F.isPublished=a.isPublished,q.oneofs&&(F._isPublished="isPublished")),a.behavior!=null&&a.hasOwnProperty("behavior")&&(F.behavior=a.behavior,q.oneofs&&(F._behavior="behavior")),a.channelCache!=null&&a.hasOwnProperty("channelCache")&&(F.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(a.channelCache,q),q.oneofs&&(F._channelCache="channelCache")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.User"},I}(),J.DataChannelCacheInfo=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.DataChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return n;let a=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.DataChannelCacheInfo"},I}(),J.DataChannel=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.dataChannelName="",I.prototype.id=null;let O;return Object.defineProperty(I.prototype,"_id",{get:$util.oneOfGetter(O=["id"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.dataChannelName!=null&&Object.hasOwnProperty.call(a,"dataChannelName")&&q.uint32(10).string(a.dataChannelName),a.id!=null&&Object.hasOwnProperty.call(a,"id")&&q.uint32(16).int32(a.id),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.DataChannel;for(;a.pos<F;){let X=a.uint32();switch(X>>>3){case 1:{Z.dataChannelName=a.string();break}case 2:{Z.id=a.int32();break}default:a.skipType(X&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.dataChannelName!=null&&a.hasOwnProperty("dataChannelName")&&!$util.isString(a.dataChannelName)?"dataChannelName: string expected":a.id!=null&&a.hasOwnProperty("id")&&!$util.isInteger(a.id)?"id: integer expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.DataChannel)return a;let q=new $root.com.quick.voice.proto.DataChannel;return a.dataChannelName!=null&&(q.dataChannelName=String(a.dataChannelName)),a.id!=null&&(q.id=a.id|0),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.dataChannelName=""),a.dataChannelName!=null&&a.hasOwnProperty("dataChannelName")&&(F.dataChannelName=a.dataChannelName),a.id!=null&&a.hasOwnProperty("id")&&(F.id=a.id,q.oneofs&&(F._id="id")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.DataChannel"},I}(),J.Login=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.appid="",I.prototype.userId="",I.prototype.sdkToken="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.appid!=null&&Object.hasOwnProperty.call(n,"appid")&&a.uint32(10).string(n.appid),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(18).string(n.userId),n.sdkToken!=null&&Object.hasOwnProperty.call(n,"sdkToken")&&a.uint32(26).string(n.sdkToken),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.Login;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.appid=n.string();break}case 2:{F.userId=n.string();break}case 3:{F.sdkToken=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.appid!=null&&n.hasOwnProperty("appid")&&!$util.isString(n.appid)?"appid: string expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&!$util.isString(n.sdkToken)?"sdkToken: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.Login)return n;let a=new $root.com.quick.voice.proto.Login;return n.appid!=null&&(a.appid=String(n.appid)),n.userId!=null&&(a.userId=String(n.userId)),n.sdkToken!=null&&(a.sdkToken=String(n.sdkToken)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.appid="",q.userId="",q.sdkToken=""),n.appid!=null&&n.hasOwnProperty("appid")&&(q.appid=n.appid),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&(q.sdkToken=n.sdkToken),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.Login"},I}(),J.Track=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.mid="",I.prototype.trackName=null,I.prototype.location=null,I.prototype.userId=null,I.prototype.code=null,I.prototype.desc=null,I.prototype.type=null,I.prototype.isValid=null,I.prototype.simulcast=null;let O;return Object.defineProperty(I.prototype,"_trackName",{get:$util.oneOfGetter(O=["trackName"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_location",{get:$util.oneOfGetter(O=["location"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_userId",{get:$util.oneOfGetter(O=["userId"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_code",{get:$util.oneOfGetter(O=["code"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_desc",{get:$util.oneOfGetter(O=["desc"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_type",{get:$util.oneOfGetter(O=["type"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_isValid",{get:$util.oneOfGetter(O=["isValid"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_simulcast",{get:$util.oneOfGetter(O=["simulcast"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.mid!=null&&Object.hasOwnProperty.call(a,"mid")&&q.uint32(10).string(a.mid),a.trackName!=null&&Object.hasOwnProperty.call(a,"trackName")&&q.uint32(18).string(a.trackName),a.location!=null&&Object.hasOwnProperty.call(a,"location")&&q.uint32(26).string(a.location),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&q.uint32(34).string(a.userId),a.code!=null&&Object.hasOwnProperty.call(a,"code")&&q.uint32(40).int32(a.code),a.desc!=null&&Object.hasOwnProperty.call(a,"desc")&&q.uint32(50).string(a.desc),a.type!=null&&Object.hasOwnProperty.call(a,"type")&&q.uint32(56).int32(a.type),a.isValid!=null&&Object.hasOwnProperty.call(a,"isValid")&&q.uint32(64).bool(a.isValid),a.simulcast!=null&&Object.hasOwnProperty.call(a,"simulcast")&&q.uint32(74).string(a.simulcast),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.Track;for(;a.pos<F;){let X=a.uint32();switch(X>>>3){case 1:{Z.mid=a.string();break}case 2:{Z.trackName=a.string();break}case 3:{Z.location=a.string();break}case 4:{Z.userId=a.string();break}case 5:{Z.code=a.int32();break}case 6:{Z.desc=a.string();break}case 7:{Z.type=a.int32();break}case 8:{Z.isValid=a.bool();break}case 9:{Z.simulcast=a.string();break}default:a.skipType(X&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.mid!=null&&a.hasOwnProperty("mid")&&!$util.isString(a.mid))return"mid: string expected";if(a.trackName!=null&&a.hasOwnProperty("trackName")&&!$util.isString(a.trackName))return"trackName: string expected";if(a.location!=null&&a.hasOwnProperty("location")&&!$util.isString(a.location))return"location: string expected";if(a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId))return"userId: string expected";if(a.code!=null&&a.hasOwnProperty("code")&&!$util.isInteger(a.code))return"code: integer expected";if(a.desc!=null&&a.hasOwnProperty("desc")&&!$util.isString(a.desc))return"desc: string expected";if(a.type!=null&&a.hasOwnProperty("type"))switch(a.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return a.isValid!=null&&a.hasOwnProperty("isValid")&&typeof a.isValid!="boolean"?"isValid: boolean expected":a.simulcast!=null&&a.hasOwnProperty("simulcast")&&!$util.isString(a.simulcast)?"simulcast: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.Track)return a;let q=new $root.com.quick.voice.proto.Track;switch(a.mid!=null&&(q.mid=String(a.mid)),a.trackName!=null&&(q.trackName=String(a.trackName)),a.location!=null&&(q.location=String(a.location)),a.userId!=null&&(q.userId=String(a.userId)),a.code!=null&&(q.code=a.code|0),a.desc!=null&&(q.desc=String(a.desc)),a.type){default:if(typeof a.type=="number"){q.type=a.type;break}break;case"Microphone":case 0:q.type=0;break;case"Camera":case 1:q.type=1;break;case"Screen":case 2:q.type=2;break;case"SystemVoice":case 3:q.type=3;break}return a.isValid!=null&&(q.isValid=!!a.isValid),a.simulcast!=null&&(q.simulcast=String(a.simulcast)),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.mid=""),a.mid!=null&&a.hasOwnProperty("mid")&&(F.mid=a.mid),a.trackName!=null&&a.hasOwnProperty("trackName")&&(F.trackName=a.trackName,q.oneofs&&(F._trackName="trackName")),a.location!=null&&a.hasOwnProperty("location")&&(F.location=a.location,q.oneofs&&(F._location="location")),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId,q.oneofs&&(F._userId="userId")),a.code!=null&&a.hasOwnProperty("code")&&(F.code=a.code,q.oneofs&&(F._code="code")),a.desc!=null&&a.hasOwnProperty("desc")&&(F.desc=a.desc,q.oneofs&&(F._desc="desc")),a.type!=null&&a.hasOwnProperty("type")&&(F.type=q.enums===String?$root.com.quick.voice.proto.TrackType[a.type]===void 0?a.type:$root.com.quick.voice.proto.TrackType[a.type]:a.type,q.oneofs&&(F._type="type")),a.isValid!=null&&a.hasOwnProperty("isValid")&&(F.isValid=a.isValid,q.oneofs&&(F._isValid="isValid")),a.simulcast!=null&&a.hasOwnProperty("simulcast")&&(F.simulcast=a.simulcast,q.oneofs&&(F._simulcast="simulcast")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.Track"},I}(),J.JoinReq=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.roomId="",I.prototype.user=null,I.prototype.callType=0,I.prototype.token=null;let O;return Object.defineProperty(I.prototype,"_token",{get:$util.oneOfGetter(O=["token"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&q.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,q.uint32(18).fork()).ldelim(),a.callType!=null&&Object.hasOwnProperty.call(a,"callType")&&q.uint32(24).int32(a.callType),a.token!=null&&Object.hasOwnProperty.call(a,"token")&&q.uint32(34).string(a.token),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.JoinReq;for(;a.pos<F;){let X=a.uint32();switch(X>>>3){case 1:{Z.roomId=a.string();break}case 2:{Z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}case 3:{Z.callType=a.int32();break}case 4:{Z.token=a.string();break}default:a.skipType(X&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let q=$root.com.quick.voice.proto.User.verify(a.user);if(q)return"user."+q}if(a.callType!=null&&a.hasOwnProperty("callType"))switch(a.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return a.token!=null&&a.hasOwnProperty("token")&&!$util.isString(a.token)?"token: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.JoinReq)return a;let q=new $root.com.quick.voice.proto.JoinReq;if(a.roomId!=null&&(q.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");q.user=$root.com.quick.voice.proto.User.fromObject(a.user)}switch(a.callType){default:if(typeof a.callType=="number"){q.callType=a.callType;break}break;case"Normal":case 0:q.callType=0;break;case"Meeting":case 1:q.callType=1;break;case"Live":case 2:q.callType=2;break}return a.token!=null&&(q.token=String(a.token)),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.roomId="",F.user=null,F.callType=q.enums===String?"Normal":0),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,q)),a.callType!=null&&a.hasOwnProperty("callType")&&(F.callType=q.enums===String?$root.com.quick.voice.proto.CallType[a.callType]===void 0?a.callType:$root.com.quick.voice.proto.CallType[a.callType]:a.callType),a.token!=null&&a.hasOwnProperty("token")&&(F.token=a.token,q.oneofs&&(F._token="token")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.JoinReq"},I}(),J.JoinRsp=function(){function I(O){if(this.roomUsers=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.roomUsers=$util.emptyArray,I.prototype.callType=0,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.roomUsers!=null&&n.roomUsers.length)for(let q=0;q<n.roomUsers.length;++q)$root.com.quick.voice.proto.User.encode(n.roomUsers[q],a.uint32(18).fork()).ldelim();return n.callType!=null&&Object.hasOwnProperty.call(n,"callType")&&a.uint32(24).int32(n.callType),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.JoinRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.roomUsers&&F.roomUsers.length||(F.roomUsers=[]),F.roomUsers.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}case 3:{F.callType=n.int32();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.roomUsers!=null&&n.hasOwnProperty("roomUsers")){if(!Array.isArray(n.roomUsers))return"roomUsers: array expected";for(let a=0;a<n.roomUsers.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.roomUsers[a]);if(q)return"roomUsers."+q}}if(n.callType!=null&&n.hasOwnProperty("callType"))switch(n.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.JoinRsp)return n;let a=new $root.com.quick.voice.proto.JoinRsp;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.roomUsers){if(!Array.isArray(n.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");a.roomUsers=[];for(let q=0;q<n.roomUsers.length;++q){if(typeof n.roomUsers[q]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");a.roomUsers[q]=$root.com.quick.voice.proto.User.fromObject(n.roomUsers[q])}}switch(n.callType){default:if(typeof n.callType=="number"){a.callType=n.callType;break}break;case"Normal":case 0:a.callType=0;break;case"Meeting":case 1:a.callType=1;break;case"Live":case 2:a.callType=2;break}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.roomUsers=[]),a.defaults&&(q.roomId="",q.callType=a.enums===String?"Normal":0),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.roomUsers&&n.roomUsers.length){q.roomUsers=[];for(let F=0;F<n.roomUsers.length;++F)q.roomUsers[F]=$root.com.quick.voice.proto.User.toObject(n.roomUsers[F],a)}return n.callType!=null&&n.hasOwnProperty("callType")&&(q.callType=a.enums===String?$root.com.quick.voice.proto.CallType[n.callType]===void 0?n.callType:$root.com.quick.voice.proto.CallType[n.callType]:n.callType),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.JoinRsp"},I}(),J.JoinNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.JoinNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.JoinNotify)return n;let a=new $root.com.quick.voice.proto.JoinNotify;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.JoinNotify"},I}(),J.ConnectCFReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.sdp="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&a.uint32(10).string(n.sdp),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ConnectCFReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.sdp=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp)?"sdp: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ConnectCFReq)return n;let a=new $root.com.quick.voice.proto.ConnectCFReq;return n.sdp!=null&&(a.sdp=String(n.sdp)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.sdp=""),n.sdp!=null&&n.hasOwnProperty("sdp")&&(q.sdp=n.sdp),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ConnectCFReq"},I}(),J.ConnectCFRsp=function(){function I(O){if(this.subscribeUsers=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.prototype.subscribeUsers=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),n.subscribeUsers!=null&&n.subscribeUsers.length)for(let q=0;q<n.subscribeUsers.length;++q)$root.com.quick.voice.proto.User.encode(n.subscribeUsers[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ConnectCFRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}case 2:{F.subscribeUsers&&F.subscribeUsers.length||(F.subscribeUsers=[]),F.subscribeUsers.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp))return"remoteSdp: string expected";if(n.subscribeUsers!=null&&n.hasOwnProperty("subscribeUsers")){if(!Array.isArray(n.subscribeUsers))return"subscribeUsers: array expected";for(let a=0;a<n.subscribeUsers.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.subscribeUsers[a]);if(q)return"subscribeUsers."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ConnectCFRsp)return n;let a=new $root.com.quick.voice.proto.ConnectCFRsp;if(n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),n.subscribeUsers){if(!Array.isArray(n.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");a.subscribeUsers=[];for(let q=0;q<n.subscribeUsers.length;++q){if(typeof n.subscribeUsers[q]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");a.subscribeUsers[q]=$root.com.quick.voice.proto.User.fromObject(n.subscribeUsers[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.subscribeUsers=[]),a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),n.subscribeUsers&&n.subscribeUsers.length){q.subscribeUsers=[];for(let F=0;F<n.subscribeUsers.length;++F)q.subscribeUsers[F]=$root.com.quick.voice.proto.User.toObject(n.subscribeUsers[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ConnectCFRsp"},I}(),J.PublishReq=function(){function I(n){if(this.tracks=[],n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.sdp="",I.prototype.tracks=$util.emptyArray,I.prototype.callAction=0,I.prototype.recreate=null;let O;return Object.defineProperty(I.prototype,"_recreate",{get:$util.oneOfGetter(O=["recreate"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){if(q||(q=$Writer.create()),a.sdp!=null&&Object.hasOwnProperty.call(a,"sdp")&&q.uint32(10).string(a.sdp),a.tracks!=null&&a.tracks.length)for(let F=0;F<a.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(a.tracks[F],q.uint32(18).fork()).ldelim();return a.callAction!=null&&Object.hasOwnProperty.call(a,"callAction")&&q.uint32(24).int32(a.callAction),a.recreate!=null&&Object.hasOwnProperty.call(a,"recreate")&&q.uint32(32).bool(a.recreate),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.PublishReq;for(;a.pos<F;){let X=a.uint32();switch(X>>>3){case 1:{Z.sdp=a.string();break}case 2:{Z.tracks&&Z.tracks.length||(Z.tracks=[]),Z.tracks.push($root.com.quick.voice.proto.Track.decode(a,a.uint32()));break}case 3:{Z.callAction=a.int32();break}case 4:{Z.recreate=a.bool();break}default:a.skipType(X&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.sdp!=null&&a.hasOwnProperty("sdp")&&!$util.isString(a.sdp))return"sdp: string expected";if(a.tracks!=null&&a.hasOwnProperty("tracks")){if(!Array.isArray(a.tracks))return"tracks: array expected";for(let q=0;q<a.tracks.length;++q){let F=$root.com.quick.voice.proto.Track.verify(a.tracks[q]);if(F)return"tracks."+F}}return a.callAction!=null&&a.hasOwnProperty("callAction")&&!$util.isInteger(a.callAction)?"callAction: integer expected":a.recreate!=null&&a.hasOwnProperty("recreate")&&typeof a.recreate!="boolean"?"recreate: boolean expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.PublishReq)return a;let q=new $root.com.quick.voice.proto.PublishReq;if(a.sdp!=null&&(q.sdp=String(a.sdp)),a.tracks){if(!Array.isArray(a.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");q.tracks=[];for(let F=0;F<a.tracks.length;++F){if(typeof a.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");q.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(a.tracks[F])}}return a.callAction!=null&&(q.callAction=a.callAction|0),a.recreate!=null&&(q.recreate=!!a.recreate),q},I.toObject=function(a,q){q||(q={});let F={};if((q.arrays||q.defaults)&&(F.tracks=[]),q.defaults&&(F.sdp="",F.callAction=0),a.sdp!=null&&a.hasOwnProperty("sdp")&&(F.sdp=a.sdp),a.tracks&&a.tracks.length){F.tracks=[];for(let Z=0;Z<a.tracks.length;++Z)F.tracks[Z]=$root.com.quick.voice.proto.Track.toObject(a.tracks[Z],q)}return a.callAction!=null&&a.hasOwnProperty("callAction")&&(F.callAction=a.callAction),a.recreate!=null&&a.hasOwnProperty("recreate")&&(F.recreate=a.recreate,q.oneofs&&(F._recreate="recreate")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.PublishReq"},I}(),J.PublishRsp=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PublishRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp)?"remoteSdp: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishRsp)return n;let a=new $root.com.quick.voice.proto.PublishRsp;return n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishRsp"},I}(),J.PublishNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PublishNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishNotify)return n;let a=new $root.com.quick.voice.proto.PublishNotify;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishNotify"},I}(),J.SubscribeReq=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SubscribeReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SubscribeReq)return n;let a=new $root.com.quick.voice.proto.SubscribeReq;if(n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SubscribeReq"},I}(),J.SubscribeRsp=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SubscribeRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp))return"remoteSdp: string expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SubscribeRsp)return n;let a=new $root.com.quick.voice.proto.SubscribeRsp;if(n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SubscribeRsp"},I}(),J.RenegotiateReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.sdp="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&a.uint32(18).string(n.sdp),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.RenegotiateReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.sdp=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp)?"sdp: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.RenegotiateReq)return n;let a=new $root.com.quick.voice.proto.RenegotiateReq;return n.userId!=null&&(a.userId=String(n.userId)),n.sdp!=null&&(a.sdp=String(n.sdp)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.userId="",q.sdp=""),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.sdp!=null&&n.hasOwnProperty("sdp")&&(q.sdp=n.sdp),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.RenegotiateReq"},I}(),J.QuitReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(18).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.QuitReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.QuitReq)return n;let a=new $root.com.quick.voice.proto.QuitReq;return n.userId!=null&&(a.userId=String(n.userId)),n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.userId="",q.roomId=""),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.QuitReq"},I}(),J.QuitNotify=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.roomId="",I.prototype.user=null,I.prototype.code=null,I.prototype.desc=null;let O;return Object.defineProperty(I.prototype,"_code",{get:$util.oneOfGetter(O=["code"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_desc",{get:$util.oneOfGetter(O=["desc"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&q.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,q.uint32(18).fork()).ldelim(),a.code!=null&&Object.hasOwnProperty.call(a,"code")&&q.uint32(24).int32(a.code),a.desc!=null&&Object.hasOwnProperty.call(a,"desc")&&q.uint32(34).string(a.desc),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.QuitNotify;for(;a.pos<F;){let X=a.uint32();switch(X>>>3){case 1:{Z.roomId=a.string();break}case 2:{Z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}case 3:{Z.code=a.int32();break}case 4:{Z.desc=a.string();break}default:a.skipType(X&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let q=$root.com.quick.voice.proto.User.verify(a.user);if(q)return"user."+q}return a.code!=null&&a.hasOwnProperty("code")&&!$util.isInteger(a.code)?"code: integer expected":a.desc!=null&&a.hasOwnProperty("desc")&&!$util.isString(a.desc)?"desc: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.QuitNotify)return a;let q=new $root.com.quick.voice.proto.QuitNotify;if(a.roomId!=null&&(q.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");q.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return a.code!=null&&(q.code=a.code|0),a.desc!=null&&(q.desc=String(a.desc)),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.roomId="",F.user=null),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,q)),a.code!=null&&a.hasOwnProperty("code")&&(F.code=a.code,q.oneofs&&(F._code="code")),a.desc!=null&&a.hasOwnProperty("desc")&&(F.desc=a.desc,q.oneofs&&(F._desc="desc")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.QuitNotify"},I}(),J.TokenExpireNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.TokenExpireNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.TokenExpireNotify)return n;let a=new $root.com.quick.voice.proto.TokenExpireNotify;return n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.TokenExpireNotify"},I}(),J.UpdateTokenReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.sdkToken="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.sdkToken!=null&&Object.hasOwnProperty.call(n,"sdkToken")&&a.uint32(18).string(n.sdkToken),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdateTokenReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.sdkToken=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&!$util.isString(n.sdkToken)?"sdkToken: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdateTokenReq)return n;let a=new $root.com.quick.voice.proto.UpdateTokenReq;return n.roomId!=null&&(a.roomId=String(n.roomId)),n.sdkToken!=null&&(a.sdkToken=String(n.sdkToken)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.sdkToken=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&(q.sdkToken=n.sdkToken),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdateTokenReq"},I}(),J.NetQualityChange=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.roomId="",I.prototype.egress=0,I.prototype.ingress=0,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(18).string(n.roomId),n.egress!=null&&Object.hasOwnProperty.call(n,"egress")&&a.uint32(24).int32(n.egress),n.ingress!=null&&Object.hasOwnProperty.call(n,"ingress")&&a.uint32(32).int32(n.ingress),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.NetQualityChange;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.roomId=n.string();break}case 3:{F.egress=n.int32();break}case 4:{F.ingress=n.int32();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":n.egress!=null&&n.hasOwnProperty("egress")&&!$util.isInteger(n.egress)?"egress: integer expected":n.ingress!=null&&n.hasOwnProperty("ingress")&&!$util.isInteger(n.ingress)?"ingress: integer expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.NetQualityChange)return n;let a=new $root.com.quick.voice.proto.NetQualityChange;return n.userId!=null&&(a.userId=String(n.userId)),n.roomId!=null&&(a.roomId=String(n.roomId)),n.egress!=null&&(a.egress=n.egress|0),n.ingress!=null&&(a.ingress=n.ingress|0),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.userId="",q.roomId="",q.egress=0,q.ingress=0),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.egress!=null&&n.hasOwnProperty("egress")&&(q.egress=n.egress),n.ingress!=null&&n.hasOwnProperty("ingress")&&(q.ingress=n.ingress),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.NetQualityChange"},I}(),J.NetQualityNotify=function(){function I(O){if(this.qualities=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.qualities=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.qualities!=null&&n.qualities.length)for(let q=0;q<n.qualities.length;++q)$root.com.quick.voice.proto.NetQualityChange.encode(n.qualities[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.NetQualityNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.qualities&&F.qualities.length||(F.qualities=[]),F.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.qualities!=null&&n.hasOwnProperty("qualities")){if(!Array.isArray(n.qualities))return"qualities: array expected";for(let a=0;a<n.qualities.length;++a){let q=$root.com.quick.voice.proto.NetQualityChange.verify(n.qualities[a]);if(q)return"qualities."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.NetQualityNotify)return n;let a=new $root.com.quick.voice.proto.NetQualityNotify;if(n.qualities){if(!Array.isArray(n.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");a.qualities=[];for(let q=0;q<n.qualities.length;++q){if(typeof n.qualities[q]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");a.qualities[q]=$root.com.quick.voice.proto.NetQualityChange.fromObject(n.qualities[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.qualities=[]),n.qualities&&n.qualities.length){q.qualities=[];for(let F=0;F<n.qualities.length;++F)q.qualities[F]=$root.com.quick.voice.proto.NetQualityChange.toObject(n.qualities[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.NetQualityNotify"},I}(),J.UpdateCall=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdateCall;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdateCall)return n;let a=new $root.com.quick.voice.proto.UpdateCall;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdateCall"},I}(),J.SyncRoomInfoReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return n;let a=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SyncRoomInfoReq"},I}(),J.SyncRoomInfoRsp=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.isValid=!1,I.prototype.users=$util.emptyArray,I.prototype.isActive=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.isValid!=null&&Object.hasOwnProperty.call(n,"isValid")&&a.uint32(16).bool(n.isValid),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(26).fork()).ldelim();return n.isActive!=null&&Object.hasOwnProperty.call(n,"isActive")&&a.uint32(32).bool(n.isActive),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.isValid=n.bool();break}case 3:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}case 4:{F.isActive=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.isValid!=null&&n.hasOwnProperty("isValid")&&typeof n.isValid!="boolean")return"isValid: boolean expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return n.isActive!=null&&n.hasOwnProperty("isActive")&&typeof n.isActive!="boolean"?"isActive: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return n;let a=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.isValid!=null&&(a.isValid=!!n.isValid),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return n.isActive!=null&&(a.isActive=!!n.isActive),a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.roomId="",q.isValid=!1,q.isActive=!1),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.isValid!=null&&n.hasOwnProperty("isValid")&&(q.isValid=n.isValid),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return n.isActive!=null&&n.hasOwnProperty("isActive")&&(q.isActive=n.isActive),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SyncRoomInfoRsp"},I}(),J.UpdateTime=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(8).int64(n.time),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdateTime;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.time=n.int64();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdateTime)return n;let a=new $root.com.quick.voice.proto.UpdateTime;return n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults)if($util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;return n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdateTime"},I}(),J.CloseTrackReq=function(){function I(O){if(this.tracks=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.sdp="",I.prototype.tracks=$util.emptyArray,I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&a.uint32(10).string(n.sdp),n.tracks!=null&&n.tracks.length)for(let q=0;q<n.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(n.tracks[q],a.uint32(18).fork()).ldelim();return n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(26).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CloseTrackReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.sdp=n.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 3:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp))return"sdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let a=0;a<n.tracks.length;++a){let q=$root.com.quick.voice.proto.Track.verify(n.tracks[a]);if(q)return"tracks."+q}}return n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CloseTrackReq)return n;let a=new $root.com.quick.voice.proto.CloseTrackReq;if(n.sdp!=null&&(a.sdp=String(n.sdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");a.tracks=[];for(let q=0;q<n.tracks.length;++q){if(typeof n.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");a.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[q])}}return n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.tracks=[]),a.defaults&&(q.sdp="",q.roomId=""),n.sdp!=null&&n.hasOwnProperty("sdp")&&(q.sdp=n.sdp),n.tracks&&n.tracks.length){q.tracks=[];for(let F=0;F<n.tracks.length;++F)q.tracks[F]=$root.com.quick.voice.proto.Track.toObject(n.tracks[F],a)}return n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CloseTrackReq"},I}(),J.CloseTrackRsp=function(){function I(O){if(this.tracks=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.prototype.tracks=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),n.tracks!=null&&n.tracks.length)for(let q=0;q<n.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(n.tracks[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CloseTrackRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp))return"remoteSdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let a=0;a<n.tracks.length;++a){let q=$root.com.quick.voice.proto.Track.verify(n.tracks[a]);if(q)return"tracks."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CloseTrackRsp)return n;let a=new $root.com.quick.voice.proto.CloseTrackRsp;if(n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");a.tracks=[];for(let q=0;q<n.tracks.length;++q){if(typeof n.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");a.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.tracks=[]),a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),n.tracks&&n.tracks.length){q.tracks=[];for(let F=0;F<n.tracks.length;++F)q.tracks[F]=$root.com.quick.voice.proto.Track.toObject(n.tracks[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CloseTrackRsp"},I}(),J.CloseTrackNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(10).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CloseTrackNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CloseTrackNotify)return n;let a=new $root.com.quick.voice.proto.CloseTrackNotify;if(n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.user=null),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CloseTrackNotify"},I}(),J.ToggleLiveRoomReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return n;let a=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ToggleLiveRoomReq"},I}(),J.ToggleLiveRoomRsq=function(){function I(O){if(this.roomUsers=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.hash="",I.prototype.roomUsers=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.hash!=null&&Object.hasOwnProperty.call(n,"hash")&&a.uint32(18).string(n.hash),n.roomUsers!=null&&n.roomUsers.length)for(let q=0;q<n.roomUsers.length;++q)$root.com.quick.voice.proto.User.encode(n.roomUsers[q],a.uint32(26).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.hash=n.string();break}case 3:{F.roomUsers&&F.roomUsers.length||(F.roomUsers=[]),F.roomUsers.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.hash!=null&&n.hasOwnProperty("hash")&&!$util.isString(n.hash))return"hash: string expected";if(n.roomUsers!=null&&n.hasOwnProperty("roomUsers")){if(!Array.isArray(n.roomUsers))return"roomUsers: array expected";for(let a=0;a<n.roomUsers.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.roomUsers[a]);if(q)return"roomUsers."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return n;let a=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.hash!=null&&(a.hash=String(n.hash)),n.roomUsers){if(!Array.isArray(n.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");a.roomUsers=[];for(let q=0;q<n.roomUsers.length;++q){if(typeof n.roomUsers[q]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");a.roomUsers[q]=$root.com.quick.voice.proto.User.fromObject(n.roomUsers[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.roomUsers=[]),a.defaults&&(q.roomId="",q.hash=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.hash!=null&&n.hasOwnProperty("hash")&&(q.hash=n.hash),n.roomUsers&&n.roomUsers.length){q.roomUsers=[];for(let F=0;F<n.roomUsers.length;++F)q.roomUsers[F]=$root.com.quick.voice.proto.User.toObject(n.roomUsers[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ToggleLiveRoomRsq"},I}(),J.TrackType=function(){const I={},O=Object.create(I);return O[I[0]="Microphone"]=0,O[I[1]="Camera"]=1,O[I[2]="Screen"]=2,O[I[3]="SystemVoice"]=3,O}(),J.ReportInfoReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.actionEvent="",I.prototype.userId="",I.prototype.platform="",I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.actionData="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.actionEvent!=null&&Object.hasOwnProperty.call(n,"actionEvent")&&a.uint32(10).string(n.actionEvent),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(18).string(n.userId),n.platform!=null&&Object.hasOwnProperty.call(n,"platform")&&a.uint32(26).string(n.platform),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(32).int64(n.time),n.actionData!=null&&Object.hasOwnProperty.call(n,"actionData")&&a.uint32(42).string(n.actionData),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ReportInfoReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.actionEvent=n.string();break}case 2:{F.userId=n.string();break}case 3:{F.platform=n.string();break}case 4:{F.time=n.int64();break}case 5:{F.actionData=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.actionEvent!=null&&n.hasOwnProperty("actionEvent")&&!$util.isString(n.actionEvent)?"actionEvent: string expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.platform!=null&&n.hasOwnProperty("platform")&&!$util.isString(n.platform)?"platform: string expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":n.actionData!=null&&n.hasOwnProperty("actionData")&&!$util.isString(n.actionData)?"actionData: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ReportInfoReq)return n;let a=new $root.com.quick.voice.proto.ReportInfoReq;return n.actionEvent!=null&&(a.actionEvent=String(n.actionEvent)),n.userId!=null&&(a.userId=String(n.userId)),n.platform!=null&&(a.platform=String(n.platform)),n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),n.actionData!=null&&(a.actionData=String(n.actionData)),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults){if(q.actionEvent="",q.userId="",q.platform="",$util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;q.actionData=""}return n.actionEvent!=null&&n.hasOwnProperty("actionEvent")&&(q.actionEvent=n.actionEvent),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.platform!=null&&n.hasOwnProperty("platform")&&(q.platform=n.platform),n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),n.actionData!=null&&n.hasOwnProperty("actionData")&&(q.actionData=n.actionData),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ReportInfoReq"},I}(),J.UpdatePermissions=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdatePermissions;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdatePermissions)return n;let a=new $root.com.quick.voice.proto.UpdatePermissions;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdatePermissions"},I}(),J.CallType=function(){const I={},O=Object.create(I);return O[I[0]="Normal"]=0,O[I[1]="Meeting"]=1,O[I[2]="Live"]=2,O}(),J.QuitNotifyCode=function(){const I={},O=Object.create(I);return O[I[0]="NormalQuit"]=0,O[I[2021]="Timeout"]=2021,O[I[2011]="TokenExpired"]=2011,O[I[2022]="KickOut"]=2022,O[I[2023]="EndPk"]=2023,O[I[2024]="EndLive"]=2024,O}(),J.UserBehavior=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.type=0,I.prototype.behavior=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.type!=null&&Object.hasOwnProperty.call(n,"type")&&a.uint32(8).int32(n.type),n.behavior!=null&&Object.hasOwnProperty.call(n,"behavior")&&a.uint32(16).bool(n.behavior),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UserBehavior;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.type=n.int32();break}case 2:{F.behavior=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.type!=null&&n.hasOwnProperty("type"))switch(n.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return n.behavior!=null&&n.hasOwnProperty("behavior")&&typeof n.behavior!="boolean"?"behavior: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UserBehavior)return n;let a=new $root.com.quick.voice.proto.UserBehavior;switch(n.type){default:if(typeof n.type=="number"){a.type=n.type;break}break;case"Microphone":case 0:a.type=0;break;case"Camera":case 1:a.type=1;break;case"Screen":case 2:a.type=2;break;case"SystemVoice":case 3:a.type=3;break}return n.behavior!=null&&(a.behavior=!!n.behavior),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.type=a.enums===String?"Microphone":0,q.behavior=!1),n.type!=null&&n.hasOwnProperty("type")&&(q.type=a.enums===String?$root.com.quick.voice.proto.TrackType[n.type]===void 0?n.type:$root.com.quick.voice.proto.TrackType[n.type]:n.type),n.behavior!=null&&n.hasOwnProperty("behavior")&&(q.behavior=n.behavior),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UserBehavior"},I}(),J.PreventUser=function(){function I(O){if(this.behaviors=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.id="",I.prototype.behaviors=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&a.uint32(10).string(n.id),n.behaviors!=null&&n.behaviors.length)for(let q=0;q<n.behaviors.length;++q)$root.com.quick.voice.proto.UserBehavior.encode(n.behaviors[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PreventUser;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.id=n.string();break}case 2:{F.behaviors&&F.behaviors.length||(F.behaviors=[]),F.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.id!=null&&n.hasOwnProperty("id")&&!$util.isString(n.id))return"id: string expected";if(n.behaviors!=null&&n.hasOwnProperty("behaviors")){if(!Array.isArray(n.behaviors))return"behaviors: array expected";for(let a=0;a<n.behaviors.length;++a){let q=$root.com.quick.voice.proto.UserBehavior.verify(n.behaviors[a]);if(q)return"behaviors."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PreventUser)return n;let a=new $root.com.quick.voice.proto.PreventUser;if(n.id!=null&&(a.id=String(n.id)),n.behaviors){if(!Array.isArray(n.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");a.behaviors=[];for(let q=0;q<n.behaviors.length;++q){if(typeof n.behaviors[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");a.behaviors[q]=$root.com.quick.voice.proto.UserBehavior.fromObject(n.behaviors[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.behaviors=[]),a.defaults&&(q.id=""),n.id!=null&&n.hasOwnProperty("id")&&(q.id=n.id),n.behaviors&&n.behaviors.length){q.behaviors=[];for(let F=0;F<n.behaviors.length;++F)q.behaviors[F]=$root.com.quick.voice.proto.UserBehavior.toObject(n.behaviors[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PreventUser"},I}(),J.PreventUsersBehaviorReq=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.PreventUser.encode(n.users[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.PreventUser.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.PreventUser.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return n;let a=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");a.users[q]=$root.com.quick.voice.proto.PreventUser.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.PreventUser.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PreventUsersBehaviorReq"},I}(),J.PreventUsersBehaviorNotify=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return n;let a=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},I}(),J.AccelerationAreas=function(){const I={},O=Object.create(I);return O[I[0]="chinaMainland"]=0,O[I[1]="global"]=1,O[I[2]="overseas"]=2,O}(),J.CountMethods=function(){const I={},O=Object.create(I);return O[I[0]="flow"]=0,O[I[1]="minutes"]=1,O}(),J.BaseCDNAddress=function(){function I(O){if(this.urlMap={},O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.area=0,I.prototype.countType=0,I.prototype.urlMap=$util.emptyObject,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.area!=null&&Object.hasOwnProperty.call(n,"area")&&a.uint32(8).int32(n.area),n.countType!=null&&Object.hasOwnProperty.call(n,"countType")&&a.uint32(16).int32(n.countType),n.urlMap!=null&&Object.hasOwnProperty.call(n,"urlMap"))for(let q=Object.keys(n.urlMap),F=0;F<q.length;++F)a.uint32(26).fork().uint32(10).string(q[F]).uint32(18).string(n.urlMap[q[F]]).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.BaseCDNAddress,Z,X;for(;n.pos<q;){let ee=n.uint32();switch(ee>>>3){case 1:{F.area=n.int32();break}case 2:{F.countType=n.int32();break}case 3:{F.urlMap===$util.emptyObject&&(F.urlMap={});let Q=n.uint32()+n.pos;for(Z="",X="";n.pos<Q;){let ne=n.uint32();switch(ne>>>3){case 1:Z=n.string();break;case 2:X=n.string();break;default:n.skipType(ne&7);break}}F.urlMap[Z]=X;break}default:n.skipType(ee&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.area!=null&&n.hasOwnProperty("area"))switch(n.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(n.countType!=null&&n.hasOwnProperty("countType"))switch(n.countType){default:return"countType: enum value expected";case 0:case 1:break}if(n.urlMap!=null&&n.hasOwnProperty("urlMap")){if(!$util.isObject(n.urlMap))return"urlMap: object expected";let a=Object.keys(n.urlMap);for(let q=0;q<a.length;++q)if(!$util.isString(n.urlMap[a[q]]))return"urlMap: string{k:string} expected"}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.BaseCDNAddress)return n;let a=new $root.com.quick.voice.proto.BaseCDNAddress;switch(n.area){default:if(typeof n.area=="number"){a.area=n.area;break}break;case"chinaMainland":case 0:a.area=0;break;case"global":case 1:a.area=1;break;case"overseas":case 2:a.area=2;break}switch(n.countType){default:if(typeof n.countType=="number"){a.countType=n.countType;break}break;case"flow":case 0:a.countType=0;break;case"minutes":case 1:a.countType=1;break}if(n.urlMap){if(typeof n.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");a.urlMap={};for(let q=Object.keys(n.urlMap),F=0;F<q.length;++F)a.urlMap[q[F]]=String(n.urlMap[q[F]])}return a},I.toObject=function(n,a){a||(a={});let q={};(a.objects||a.defaults)&&(q.urlMap={}),a.defaults&&(q.area=a.enums===String?"chinaMainland":0,q.countType=a.enums===String?"flow":0),n.area!=null&&n.hasOwnProperty("area")&&(q.area=a.enums===String?$root.com.quick.voice.proto.AccelerationAreas[n.area]===void 0?n.area:$root.com.quick.voice.proto.AccelerationAreas[n.area]:n.area),n.countType!=null&&n.hasOwnProperty("countType")&&(q.countType=a.enums===String?$root.com.quick.voice.proto.CountMethods[n.countType]===void 0?n.countType:$root.com.quick.voice.proto.CountMethods[n.countType]:n.countType);let F;if(n.urlMap&&(F=Object.keys(n.urlMap)).length){q.urlMap={};for(let Z=0;Z<F.length;++Z)q.urlMap[F[Z]]=n.urlMap[F[Z]]}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.BaseCDNAddress"},I}(),J.CDNPlayAddressNotify=function(){function I(n){if(this.standLines=[],n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.roomId="",I.prototype.m3u8=null,I.prototype.rtmp=null,I.prototype.flv=null,I.prototype.rtmps=null,I.prototype.mainLine=null,I.prototype.standLines=$util.emptyArray;let O;return Object.defineProperty(I.prototype,"_m3u8",{get:$util.oneOfGetter(O=["m3u8"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_rtmp",{get:$util.oneOfGetter(O=["rtmp"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_flv",{get:$util.oneOfGetter(O=["flv"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_rtmps",{get:$util.oneOfGetter(O=["rtmps"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_mainLine",{get:$util.oneOfGetter(O=["mainLine"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){if(q||(q=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&q.uint32(10).string(a.roomId),a.m3u8!=null&&Object.hasOwnProperty.call(a,"m3u8")&&q.uint32(18).string(a.m3u8),a.rtmp!=null&&Object.hasOwnProperty.call(a,"rtmp")&&q.uint32(26).string(a.rtmp),a.flv!=null&&Object.hasOwnProperty.call(a,"flv")&&q.uint32(34).string(a.flv),a.rtmps!=null&&Object.hasOwnProperty.call(a,"rtmps")&&q.uint32(42).string(a.rtmps),a.mainLine!=null&&Object.hasOwnProperty.call(a,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(a.mainLine,q.uint32(50).fork()).ldelim(),a.standLines!=null&&a.standLines.length)for(let F=0;F<a.standLines.length;++F)$root.com.quick.voice.proto.BaseCDNAddress.encode(a.standLines[F],q.uint32(58).fork()).ldelim();return q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;a.pos<F;){let X=a.uint32();switch(X>>>3){case 1:{Z.roomId=a.string();break}case 2:{Z.m3u8=a.string();break}case 3:{Z.rtmp=a.string();break}case 4:{Z.flv=a.string();break}case 5:{Z.rtmps=a.string();break}case 6:{Z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(a,a.uint32());break}case 7:{Z.standLines&&Z.standLines.length||(Z.standLines=[]),Z.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(a,a.uint32()));break}default:a.skipType(X&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.m3u8!=null&&a.hasOwnProperty("m3u8")&&!$util.isString(a.m3u8))return"m3u8: string expected";if(a.rtmp!=null&&a.hasOwnProperty("rtmp")&&!$util.isString(a.rtmp))return"rtmp: string expected";if(a.flv!=null&&a.hasOwnProperty("flv")&&!$util.isString(a.flv))return"flv: string expected";if(a.rtmps!=null&&a.hasOwnProperty("rtmps")&&!$util.isString(a.rtmps))return"rtmps: string expected";if(a.mainLine!=null&&a.hasOwnProperty("mainLine")){let q=$root.com.quick.voice.proto.BaseCDNAddress.verify(a.mainLine);if(q)return"mainLine."+q}if(a.standLines!=null&&a.hasOwnProperty("standLines")){if(!Array.isArray(a.standLines))return"standLines: array expected";for(let q=0;q<a.standLines.length;++q){let F=$root.com.quick.voice.proto.BaseCDNAddress.verify(a.standLines[q]);if(F)return"standLines."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return a;let q=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(a.roomId!=null&&(q.roomId=String(a.roomId)),a.m3u8!=null&&(q.m3u8=String(a.m3u8)),a.rtmp!=null&&(q.rtmp=String(a.rtmp)),a.flv!=null&&(q.flv=String(a.flv)),a.rtmps!=null&&(q.rtmps=String(a.rtmps)),a.mainLine!=null){if(typeof a.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");q.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(a.mainLine)}if(a.standLines){if(!Array.isArray(a.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");q.standLines=[];for(let F=0;F<a.standLines.length;++F){if(typeof a.standLines[F]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");q.standLines[F]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(a.standLines[F])}}return q},I.toObject=function(a,q){q||(q={});let F={};if((q.arrays||q.defaults)&&(F.standLines=[]),q.defaults&&(F.roomId=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.m3u8!=null&&a.hasOwnProperty("m3u8")&&(F.m3u8=a.m3u8,q.oneofs&&(F._m3u8="m3u8")),a.rtmp!=null&&a.hasOwnProperty("rtmp")&&(F.rtmp=a.rtmp,q.oneofs&&(F._rtmp="rtmp")),a.flv!=null&&a.hasOwnProperty("flv")&&(F.flv=a.flv,q.oneofs&&(F._flv="flv")),a.rtmps!=null&&a.hasOwnProperty("rtmps")&&(F.rtmps=a.rtmps,q.oneofs&&(F._rtmps="rtmps")),a.mainLine!=null&&a.hasOwnProperty("mainLine")&&(F.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(a.mainLine,q),q.oneofs&&(F._mainLine="mainLine")),a.standLines&&a.standLines.length){F.standLines=[];for(let Z=0;Z<a.standLines.length;++Z)F.standLines[Z]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(a.standLines[Z],q)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.CDNPlayAddressNotify"},I}(),J.UserChannel=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(n.channels[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UserChannel;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId))return"userId: string expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.DataChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UserChannel)return n;let a=new $root.com.quick.voice.proto.UserChannel;if(n.userId!=null&&(a.userId=String(n.userId)),n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),a.defaults&&(q.userId=""),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UserChannel"},I}(),J.ChannelPublishReq=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelPublishReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.DataChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelPublishReq)return n;let a=new $root.com.quick.voice.proto.ChannelPublishReq;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelPublishReq"},I}(),J.ChannelPublishRsq=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.UserChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.UserChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.UserChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return n;let a=new $root.com.quick.voice.proto.ChannelPublishRsq;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.UserChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.UserChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelPublishRsq"},I}(),J.ChannelSubscribeReq=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.UserChannel.encode(n.users[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.UserChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.UserChannel.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return n;let a=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");a.users[q]=$root.com.quick.voice.proto.UserChannel.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.UserChannel.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelSubscribeReq"},I}(),J.ChannelSubscribeRsq=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.UserChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.UserChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.UserChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return n;let a=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.UserChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.UserChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelSubscribeRsq"},I}(),J}(),N}(),z}(),D})(),ignoreEvent=["networkQualityChange","onNetQuality"],enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",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 z=D.length;for(;--z>=0;)D[z]=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,z,N,J,I){this.static_tree=D,this.extra_bits=z,this.extra_base=N,this.elems=J,this.max_length=I,this.has_stree=D&&D.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(D,z){this.dyn_tree=D,this.max_code=0,this.stat_desc=z}const d_code=D=>D<256?_dist_code[D]:_dist_code[256+(D>>>7)],put_short=(D,z)=>{D.pending_buf[D.pending++]=z&255,D.pending_buf[D.pending++]=z>>>8&255},send_bits=(D,z,N)=>{D.bi_valid>Buf_size-N?(D.bi_buf|=z<<D.bi_valid&65535,put_short(D,D.bi_buf),D.bi_buf=z>>Buf_size-D.bi_valid,D.bi_valid+=N-Buf_size):(D.bi_buf|=z<<D.bi_valid&65535,D.bi_valid+=N)},send_code=(D,z,N)=>{send_bits(D,N[z*2],N[z*2+1])},bi_reverse=(D,z)=>{let N=0;do N|=D&1,D>>>=1,N<<=1;while(--z>0);return N>>>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,z)=>{const N=z.dyn_tree,J=z.max_code,I=z.stat_desc.static_tree,O=z.stat_desc.has_stree,n=z.stat_desc.extra_bits,a=z.stat_desc.extra_base,q=z.stat_desc.max_length;let F,Z,X,ee,Q,ne,se=0;for(ee=0;ee<=MAX_BITS$1;ee++)D.bl_count[ee]=0;for(N[D.heap[D.heap_max]*2+1]=0,F=D.heap_max+1;F<HEAP_SIZE$1;F++)Z=D.heap[F],ee=N[N[Z*2+1]*2+1]+1,ee>q&&(ee=q,se++),N[Z*2+1]=ee,!(Z>J)&&(D.bl_count[ee]++,Q=0,Z>=a&&(Q=n[Z-a]),ne=N[Z*2],D.opt_len+=ne*(ee+Q),O&&(D.static_len+=ne*(I[Z*2+1]+Q)));if(se!==0){do{for(ee=q-1;D.bl_count[ee]===0;)ee--;D.bl_count[ee]--,D.bl_count[ee+1]+=2,D.bl_count[q]--,se-=2}while(se>0);for(ee=q;ee!==0;ee--)for(Z=D.bl_count[ee];Z!==0;)X=D.heap[--F],!(X>J)&&(N[X*2+1]!==ee&&(D.opt_len+=(ee-N[X*2+1])*N[X*2],N[X*2+1]=ee),Z--)}},gen_codes=(D,z,N)=>{const J=new Array(MAX_BITS$1+1);let I=0,O,n;for(O=1;O<=MAX_BITS$1;O++)I=I+N[O-1]<<1,J[O]=I;for(n=0;n<=z;n++){let a=D[n*2+1];a!==0&&(D[n*2]=bi_reverse(J[a]++,a))}},tr_static_init=()=>{let D,z,N,J,I;const O=new Array(MAX_BITS$1+1);for(N=0,J=0;J<LENGTH_CODES$1-1;J++)for(base_length[J]=N,D=0;D<1<<extra_lbits[J];D++)_length_code[N++]=J;for(_length_code[N-1]=J,I=0,J=0;J<16;J++)for(base_dist[J]=I,D=0;D<1<<extra_dbits[J];D++)_dist_code[I++]=J;for(I>>=7;J<D_CODES$1;J++)for(base_dist[J]=I<<7,D=0;D<1<<extra_dbits[J]-7;D++)_dist_code[256+I++]=J;for(z=0;z<=MAX_BITS$1;z++)O[z]=0;for(D=0;D<=143;)static_ltree[D*2+1]=8,D++,O[8]++;for(;D<=255;)static_ltree[D*2+1]=9,D++,O[9]++;for(;D<=279;)static_ltree[D*2+1]=7,D++,O[7]++;for(;D<=287;)static_ltree[D*2+1]=8,D++,O[8]++;for(gen_codes(static_ltree,L_CODES$1+1,O),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 z;for(z=0;z<L_CODES$1;z++)D.dyn_ltree[z*2]=0;for(z=0;z<D_CODES$1;z++)D.dyn_dtree[z*2]=0;for(z=0;z<BL_CODES$1;z++)D.bl_tree[z*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,z,N,J)=>{const I=z*2,O=N*2;return D[I]<D[O]||D[I]===D[O]&&J[z]<=J[N]},pqdownheap=(D,z,N)=>{const J=D.heap[N];let I=N<<1;for(;I<=D.heap_len&&(I<D.heap_len&&smaller(z,D.heap[I+1],D.heap[I],D.depth)&&I++,!smaller(z,J,D.heap[I],D.depth));)D.heap[N]=D.heap[I],N=I,I<<=1;D.heap[N]=J},compress_block=(D,z,N)=>{let J,I,O=0,n,a;if(D.sym_next!==0)do J=D.pending_buf[D.sym_buf+O++]&255,J+=(D.pending_buf[D.sym_buf+O++]&255)<<8,I=D.pending_buf[D.sym_buf+O++],J===0?send_code(D,I,z):(n=_length_code[I],send_code(D,n+LITERALS$1+1,z),a=extra_lbits[n],a!==0&&(I-=base_length[n],send_bits(D,I,a)),J--,n=d_code(J),send_code(D,n,N),a=extra_dbits[n],a!==0&&(J-=base_dist[n],send_bits(D,J,a)));while(O<D.sym_next);send_code(D,END_BLOCK,z)},build_tree=(D,z)=>{const N=z.dyn_tree,J=z.stat_desc.static_tree,I=z.stat_desc.has_stree,O=z.stat_desc.elems;let n,a,q=-1,F;for(D.heap_len=0,D.heap_max=HEAP_SIZE$1,n=0;n<O;n++)N[n*2]!==0?(D.heap[++D.heap_len]=q=n,D.depth[n]=0):N[n*2+1]=0;for(;D.heap_len<2;)F=D.heap[++D.heap_len]=q<2?++q:0,N[F*2]=1,D.depth[F]=0,D.opt_len--,I&&(D.static_len-=J[F*2+1]);for(z.max_code=q,n=D.heap_len>>1;n>=1;n--)pqdownheap(D,N,n);F=O;do n=D.heap[1],D.heap[1]=D.heap[D.heap_len--],pqdownheap(D,N,1),a=D.heap[1],D.heap[--D.heap_max]=n,D.heap[--D.heap_max]=a,N[F*2]=N[n*2]+N[a*2],D.depth[F]=(D.depth[n]>=D.depth[a]?D.depth[n]:D.depth[a])+1,N[n*2+1]=N[a*2+1]=F,D.heap[1]=F++,pqdownheap(D,N,1);while(D.heap_len>=2);D.heap[--D.heap_max]=D.heap[1],gen_bitlen(D,z),gen_codes(N,q,D.bl_count)},scan_tree=(D,z,N)=>{let J,I=-1,O,n=z[0*2+1],a=0,q=7,F=4;for(n===0&&(q=138,F=3),z[(N+1)*2+1]=65535,J=0;J<=N;J++)O=n,n=z[(J+1)*2+1],!(++a<q&&O===n)&&(a<F?D.bl_tree[O*2]+=a:O!==0?(O!==I&&D.bl_tree[O*2]++,D.bl_tree[REP_3_6*2]++):a<=10?D.bl_tree[REPZ_3_10*2]++:D.bl_tree[REPZ_11_138*2]++,a=0,I=O,n===0?(q=138,F=3):O===n?(q=6,F=3):(q=7,F=4))},send_tree=(D,z,N)=>{let J,I=-1,O,n=z[0*2+1],a=0,q=7,F=4;for(n===0&&(q=138,F=3),J=0;J<=N;J++)if(O=n,n=z[(J+1)*2+1],!(++a<q&&O===n)){if(a<F)do send_code(D,O,D.bl_tree);while(--a!==0);else O!==0?(O!==I&&(send_code(D,O,D.bl_tree),a--),send_code(D,REP_3_6,D.bl_tree),send_bits(D,a-3,2)):a<=10?(send_code(D,REPZ_3_10,D.bl_tree),send_bits(D,a-3,3)):(send_code(D,REPZ_11_138,D.bl_tree),send_bits(D,a-11,7));a=0,I=O,n===0?(q=138,F=3):O===n?(q=6,F=3):(q=7,F=4)}},build_bl_tree=D=>{let z;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),z=BL_CODES$1-1;z>=3&&D.bl_tree[bl_order[z]*2+1]===0;z--);return D.opt_len+=3*(z+1)+5+5+4,z},send_all_trees=(D,z,N,J)=>{let I;for(send_bits(D,z-257,5),send_bits(D,N-1,5),send_bits(D,J-4,4),I=0;I<J;I++)send_bits(D,D.bl_tree[bl_order[I]*2+1],3);send_tree(D,D.dyn_ltree,z-1),send_tree(D,D.dyn_dtree,N-1)},detect_data_type=D=>{let z=4093624447,N;for(N=0;N<=31;N++,z>>>=1)if(z&1&&D.dyn_ltree[N*2]!==0)return Z_BINARY;if(D.dyn_ltree[9*2]!==0||D.dyn_ltree[10*2]!==0||D.dyn_ltree[13*2]!==0)return Z_TEXT;for(N=32;N<LITERALS$1;N++)if(D.dyn_ltree[N*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,z,N,J)=>{send_bits(D,(STORED_BLOCK<<1)+(J?1:0),3),bi_windup(D),put_short(D,N),put_short(D,~N),N&&D.pending_buf.set(D.window.subarray(z,z+N),D.pending),D.pending+=N},_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,z,N,J)=>{let I,O,n=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),n=build_bl_tree(D),I=D.opt_len+3+7>>>3,O=D.static_len+3+7>>>3,O<=I&&(I=O)):I=O=N+5,N+4<=I&&z!==-1?_tr_stored_block$1(D,z,N,J):D.strategy===Z_FIXED$1||O===I?(send_bits(D,(STATIC_TREES<<1)+(J?1:0),3),compress_block(D,static_ltree,static_dtree)):(send_bits(D,(DYN_TREES<<1)+(J?1:0),3),send_all_trees(D,D.l_desc.max_code+1,D.d_desc.max_code+1,n+1),compress_block(D,D.dyn_ltree,D.dyn_dtree)),init_block(D),J&&bi_windup(D)},_tr_tally$1=(D,z,N)=>(D.pending_buf[D.sym_buf+D.sym_next++]=z,D.pending_buf[D.sym_buf+D.sym_next++]=z>>8,D.pending_buf[D.sym_buf+D.sym_next++]=N,z===0?D.dyn_ltree[N*2]++:(D.matches++,z--,D.dyn_ltree[(_length_code[N]+LITERALS$1+1)*2]++,D.dyn_dtree[d_code(z)*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,z,N,J)=>{let I=D&65535|0,O=D>>>16&65535|0,n=0;for(;N!==0;){n=N>2e3?2e3:N,N-=n;do I=I+z[J++]|0,O=O+I|0;while(--n);I%=65521,O%=65521}return I|O<<16|0};var adler32_1=adler32;const makeTable=()=>{let D,z=[];for(var N=0;N<256;N++){D=N;for(var J=0;J<8;J++)D=D&1?3988292384^D>>>1:D>>>1;z[N]=D}return z},crcTable=new Uint32Array(makeTable()),crc32=(D,z,N,J)=>{const I=crcTable,O=J+N;D^=-1;for(let n=J;n<O;n++)D=D>>>8^I[(D^z[n])&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,z)=>(D.msg=messages[z],z),rank=D=>D*2-(D>4?9:0),zero=D=>{let z=D.length;for(;--z>=0;)D[z]=0},slide_hash=D=>{let z,N,J,I=D.w_size;z=D.hash_size,J=z;do N=D.head[--J],D.head[J]=N>=I?N-I:0;while(--z);z=I,J=z;do N=D.prev[--J],D.prev[J]=N>=I?N-I:0;while(--z)};let HASH_ZLIB=(D,z,N)=>(z<<D.hash_shift^N)&D.hash_mask,HASH=HASH_ZLIB;const flush_pending=D=>{const z=D.state;let N=z.pending;N>D.avail_out&&(N=D.avail_out),N!==0&&(D.output.set(z.pending_buf.subarray(z.pending_out,z.pending_out+N),D.next_out),D.next_out+=N,z.pending_out+=N,D.total_out+=N,D.avail_out-=N,z.pending-=N,z.pending===0&&(z.pending_out=0))},flush_block_only=(D,z)=>{_tr_flush_block(D,D.block_start>=0?D.block_start:-1,D.strstart-D.block_start,z),D.block_start=D.strstart,flush_pending(D.strm)},put_byte=(D,z)=>{D.pending_buf[D.pending++]=z},putShortMSB=(D,z)=>{D.pending_buf[D.pending++]=z>>>8&255,D.pending_buf[D.pending++]=z&255},read_buf=(D,z,N,J)=>{let I=D.avail_in;return I>J&&(I=J),I===0?0:(D.avail_in-=I,z.set(D.input.subarray(D.next_in,D.next_in+I),N),D.state.wrap===1?D.adler=adler32_1(D.adler,z,I,N):D.state.wrap===2&&(D.adler=crc32_1(D.adler,z,I,N)),D.next_in+=I,D.total_in+=I,I)},longest_match=(D,z)=>{let N=D.max_chain_length,J=D.strstart,I,O,n=D.prev_length,a=D.nice_match;const q=D.strstart>D.w_size-MIN_LOOKAHEAD?D.strstart-(D.w_size-MIN_LOOKAHEAD):0,F=D.window,Z=D.w_mask,X=D.prev,ee=D.strstart+MAX_MATCH;let Q=F[J+n-1],ne=F[J+n];D.prev_length>=D.good_match&&(N>>=2),a>D.lookahead&&(a=D.lookahead);do if(I=z,!(F[I+n]!==ne||F[I+n-1]!==Q||F[I]!==F[J]||F[++I]!==F[J+1])){J+=2,I++;do;while(F[++J]===F[++I]&&F[++J]===F[++I]&&F[++J]===F[++I]&&F[++J]===F[++I]&&F[++J]===F[++I]&&F[++J]===F[++I]&&F[++J]===F[++I]&&F[++J]===F[++I]&&J<ee);if(O=MAX_MATCH-(ee-J),J=ee-MAX_MATCH,O>n){if(D.match_start=z,n=O,O>=a)break;Q=F[J+n-1],ne=F[J+n]}}while((z=X[z&Z])>q&&--N!==0);return n<=D.lookahead?n:D.lookahead},fill_window=D=>{const z=D.w_size;let N,J,I;do{if(J=D.window_size-D.lookahead-D.strstart,D.strstart>=z+(z-MIN_LOOKAHEAD)&&(D.window.set(D.window.subarray(z,z+z-J),0),D.match_start-=z,D.strstart-=z,D.block_start-=z,D.insert>D.strstart&&(D.insert=D.strstart),slide_hash(D),J+=z),D.strm.avail_in===0)break;if(N=read_buf(D.strm,D.window,D.strstart+D.lookahead,J),D.lookahead+=N,D.lookahead+D.insert>=MIN_MATCH)for(I=D.strstart-D.insert,D.ins_h=D.window[I],D.ins_h=HASH(D,D.ins_h,D.window[I+1]);D.insert&&(D.ins_h=HASH(D,D.ins_h,D.window[I+MIN_MATCH-1]),D.prev[I&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=I,I++,D.insert--,!(D.lookahead+D.insert<MIN_MATCH)););}while(D.lookahead<MIN_LOOKAHEAD&&D.strm.avail_in!==0)},deflate_stored=(D,z)=>{let N=D.pending_buf_size-5>D.w_size?D.w_size:D.pending_buf_size-5,J,I,O,n=0,a=D.strm.avail_in;do{if(J=65535,O=D.bi_valid+42>>3,D.strm.avail_out<O||(O=D.strm.avail_out-O,I=D.strstart-D.block_start,J>I+D.strm.avail_in&&(J=I+D.strm.avail_in),J>O&&(J=O),J<N&&(J===0&&z!==Z_FINISH$3||z===Z_NO_FLUSH$2||J!==I+D.strm.avail_in)))break;n=z===Z_FINISH$3&&J===I+D.strm.avail_in?1:0,_tr_stored_block(D,0,0,n),D.pending_buf[D.pending-4]=J,D.pending_buf[D.pending-3]=J>>8,D.pending_buf[D.pending-2]=~J,D.pending_buf[D.pending-1]=~J>>8,flush_pending(D.strm),I&&(I>J&&(I=J),D.strm.output.set(D.window.subarray(D.block_start,D.block_start+I),D.strm.next_out),D.strm.next_out+=I,D.strm.avail_out-=I,D.strm.total_out+=I,D.block_start+=I,J-=I),J&&(read_buf(D.strm,D.strm.output,D.strm.next_out,J),D.strm.next_out+=J,D.strm.avail_out-=J,D.strm.total_out+=J)}while(n===0);return a-=D.strm.avail_in,a&&(a>=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<=a&&(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-a,D.strm.next_in),D.strstart),D.strstart+=a,D.insert+=a>D.w_size-D.insert?D.w_size-D.insert:a),D.block_start=D.strstart),D.high_water<D.strstart&&(D.high_water=D.strstart),n?BS_FINISH_DONE:z!==Z_NO_FLUSH$2&&z!==Z_FINISH$3&&D.strm.avail_in===0&&D.strstart===D.block_start?BS_BLOCK_DONE:(O=D.window_size-D.strstart,D.strm.avail_in>O&&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++,O+=D.w_size,D.insert>D.strstart&&(D.insert=D.strstart)),O>D.strm.avail_in&&(O=D.strm.avail_in),O&&(read_buf(D.strm,D.window,D.strstart,O),D.strstart+=O,D.insert+=O>D.w_size-D.insert?D.w_size-D.insert:O),D.high_water<D.strstart&&(D.high_water=D.strstart),O=D.bi_valid+42>>3,O=D.pending_buf_size-O>65535?65535:D.pending_buf_size-O,N=O>D.w_size?D.w_size:O,I=D.strstart-D.block_start,(I>=N||(I||z===Z_FINISH$3)&&z!==Z_NO_FLUSH$2&&D.strm.avail_in===0&&I<=O)&&(J=I>O?O:I,n=z===Z_FINISH$3&&D.strm.avail_in===0&&J===I?1:0,_tr_stored_block(D,D.block_start,J,n),D.block_start+=J,flush_pending(D.strm)),n?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(D,z)=>{let N,J;for(;;){if(D.lookahead<MIN_LOOKAHEAD){if(fill_window(D),D.lookahead<MIN_LOOKAHEAD&&z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(D.lookahead===0)break}if(N=0,D.lookahead>=MIN_MATCH&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),N=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart),N!==0&&D.strstart-N<=D.w_size-MIN_LOOKAHEAD&&(D.match_length=longest_match(D,N)),D.match_length>=MIN_MATCH)if(J=_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]),N=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 J=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++;if(J&&(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,z===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,z)=>{let N,J,I;for(;;){if(D.lookahead<MIN_LOOKAHEAD){if(fill_window(D),D.lookahead<MIN_LOOKAHEAD&&z===Z_NO_FLUSH$2)return BS_NEED_MORE;if(D.lookahead===0)break}if(N=0,D.lookahead>=MIN_MATCH&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),N=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,N!==0&&D.prev_length<D.max_lazy_match&&D.strstart-N<=D.w_size-MIN_LOOKAHEAD&&(D.match_length=longest_match(D,N),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){I=D.strstart+D.lookahead-MIN_MATCH,J=_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<=I&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),N=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++,J&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}else if(D.match_available){if(J=_tr_tally(D,0,D.window[D.strstart-1]),J&&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&&(J=_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,z===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,z)=>{let N,J,I,O;const n=D.window;for(;;){if(D.lookahead<=MAX_MATCH){if(fill_window(D),D.lookahead<=MAX_MATCH&&z===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&&(I=D.strstart-1,J=n[I],J===n[++I]&&J===n[++I]&&J===n[++I])){O=D.strstart+MAX_MATCH;do;while(J===n[++I]&&J===n[++I]&&J===n[++I]&&J===n[++I]&&J===n[++I]&&J===n[++I]&&J===n[++I]&&J===n[++I]&&I<O);D.match_length=MAX_MATCH-(O-I),D.match_length>D.lookahead&&(D.match_length=D.lookahead)}if(D.match_length>=MIN_MATCH?(N=_tr_tally(D,1,D.match_length-MIN_MATCH),D.lookahead-=D.match_length,D.strstart+=D.match_length,D.match_length=0):(N=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++),N&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}return D.insert=0,z===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,z)=>{let N;for(;;){if(D.lookahead===0&&(fill_window(D),D.lookahead===0)){if(z===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(D.match_length=0,N=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++,N&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}return D.insert=0,z===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,z,N,J,I){this.good_length=D,this.max_lazy=z,this.nice_length=N,this.max_chain=J,this.func=I}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 z=D.state;return!z||z.strm!==D||z.status!==INIT_STATE&&z.status!==GZIP_STATE&&z.status!==EXTRA_STATE&&z.status!==NAME_STATE&&z.status!==COMMENT_STATE&&z.status!==HCRC_STATE&&z.status!==BUSY_STATE&&z.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 z=D.state;return z.pending=0,z.pending_out=0,z.wrap<0&&(z.wrap=-z.wrap),z.status=z.wrap===2?GZIP_STATE:z.wrap?INIT_STATE:BUSY_STATE,D.adler=z.wrap===2?0:1,z.last_flush=-2,_tr_init(z),Z_OK$3},deflateReset=D=>{const z=deflateResetKeep(D);return z===Z_OK$3&&lm_init(D.state),z},deflateSetHeader=(D,z)=>deflateStateCheck(D)||D.state.wrap!==2?Z_STREAM_ERROR$2:(D.state.gzhead=z,Z_OK$3),deflateInit2=(D,z,N,J,I,O)=>{if(!D)return Z_STREAM_ERROR$2;let n=1;if(z===Z_DEFAULT_COMPRESSION$1&&(z=6),J<0?(n=0,J=-J):J>15&&(n=2,J-=16),I<1||I>MAX_MEM_LEVEL||N!==Z_DEFLATED$2||J<8||J>15||z<0||z>9||O<0||O>Z_FIXED||J===8&&n!==1)return err(D,Z_STREAM_ERROR$2);J===8&&(J=9);const a=new DeflateState;return D.state=a,a.strm=D,a.status=INIT_STATE,a.wrap=n,a.gzhead=null,a.w_bits=J,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=I+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+MIN_MATCH-1)/MIN_MATCH),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<I+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=(a.lit_bufsize-1)*3,a.level=z,a.strategy=O,a.method=N,deflateReset(D)},deflateInit=(D,z)=>deflateInit2(D,z,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(D,z)=>{if(deflateStateCheck(D)||z>Z_BLOCK$1||z<0)return D?err(D,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const N=D.state;if(!D.output||D.avail_in!==0&&!D.input||N.status===FINISH_STATE&&z!==Z_FINISH$3)return err(D,D.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const J=N.last_flush;if(N.last_flush=z,N.pending!==0){if(flush_pending(D),D.avail_out===0)return N.last_flush=-1,Z_OK$3}else if(D.avail_in===0&&rank(z)<=rank(J)&&z!==Z_FINISH$3)return err(D,Z_BUF_ERROR$1);if(N.status===FINISH_STATE&&D.avail_in!==0)return err(D,Z_BUF_ERROR$1);if(N.status===INIT_STATE&&N.wrap===0&&(N.status=BUSY_STATE),N.status===INIT_STATE){let I=Z_DEFLATED$2+(N.w_bits-8<<4)<<8,O=-1;if(N.strategy>=Z_HUFFMAN_ONLY||N.level<2?O=0:N.level<6?O=1:N.level===6?O=2:O=3,I|=O<<6,N.strstart!==0&&(I|=PRESET_DICT),I+=31-I%31,putShortMSB(N,I),N.strstart!==0&&(putShortMSB(N,D.adler>>>16),putShortMSB(N,D.adler&65535)),D.adler=1,N.status=BUSY_STATE,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3}if(N.status===GZIP_STATE){if(D.adler=0,put_byte(N,31),put_byte(N,139),put_byte(N,8),N.gzhead)put_byte(N,(N.gzhead.text?1:0)+(N.gzhead.hcrc?2:0)+(N.gzhead.extra?4:0)+(N.gzhead.name?8:0)+(N.gzhead.comment?16:0)),put_byte(N,N.gzhead.time&255),put_byte(N,N.gzhead.time>>8&255),put_byte(N,N.gzhead.time>>16&255),put_byte(N,N.gzhead.time>>24&255),put_byte(N,N.level===9?2:N.strategy>=Z_HUFFMAN_ONLY||N.level<2?4:0),put_byte(N,N.gzhead.os&255),N.gzhead.extra&&N.gzhead.extra.length&&(put_byte(N,N.gzhead.extra.length&255),put_byte(N,N.gzhead.extra.length>>8&255)),N.gzhead.hcrc&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending,0)),N.gzindex=0,N.status=EXTRA_STATE;else if(put_byte(N,0),put_byte(N,0),put_byte(N,0),put_byte(N,0),put_byte(N,0),put_byte(N,N.level===9?2:N.strategy>=Z_HUFFMAN_ONLY||N.level<2?4:0),put_byte(N,OS_CODE),N.status=BUSY_STATE,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3}if(N.status===EXTRA_STATE){if(N.gzhead.extra){let I=N.pending,O=(N.gzhead.extra.length&65535)-N.gzindex;for(;N.pending+O>N.pending_buf_size;){let a=N.pending_buf_size-N.pending;if(N.pending_buf.set(N.gzhead.extra.subarray(N.gzindex,N.gzindex+a),N.pending),N.pending=N.pending_buf_size,N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),N.gzindex+=a,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3;I=0,O-=a}let n=new Uint8Array(N.gzhead.extra);N.pending_buf.set(n.subarray(N.gzindex,N.gzindex+O),N.pending),N.pending+=O,N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),N.gzindex=0}N.status=NAME_STATE}if(N.status===NAME_STATE){if(N.gzhead.name){let I=N.pending,O;do{if(N.pending===N.pending_buf_size){if(N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3;I=0}N.gzindex<N.gzhead.name.length?O=N.gzhead.name.charCodeAt(N.gzindex++)&255:O=0,put_byte(N,O)}while(O!==0);N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),N.gzindex=0}N.status=COMMENT_STATE}if(N.status===COMMENT_STATE){if(N.gzhead.comment){let I=N.pending,O;do{if(N.pending===N.pending_buf_size){if(N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3;I=0}N.gzindex<N.gzhead.comment.length?O=N.gzhead.comment.charCodeAt(N.gzindex++)&255:O=0,put_byte(N,O)}while(O!==0);N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I))}N.status=HCRC_STATE}if(N.status===HCRC_STATE){if(N.gzhead.hcrc){if(N.pending+2>N.pending_buf_size&&(flush_pending(D),N.pending!==0))return N.last_flush=-1,Z_OK$3;put_byte(N,D.adler&255),put_byte(N,D.adler>>8&255),D.adler=0}if(N.status=BUSY_STATE,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3}if(D.avail_in!==0||N.lookahead!==0||z!==Z_NO_FLUSH$2&&N.status!==FINISH_STATE){let I=N.level===0?deflate_stored(N,z):N.strategy===Z_HUFFMAN_ONLY?deflate_huff(N,z):N.strategy===Z_RLE?deflate_rle(N,z):configuration_table[N.level].func(N,z);if((I===BS_FINISH_STARTED||I===BS_FINISH_DONE)&&(N.status=FINISH_STATE),I===BS_NEED_MORE||I===BS_FINISH_STARTED)return D.avail_out===0&&(N.last_flush=-1),Z_OK$3;if(I===BS_BLOCK_DONE&&(z===Z_PARTIAL_FLUSH?_tr_align(N):z!==Z_BLOCK$1&&(_tr_stored_block(N,0,0,!1),z===Z_FULL_FLUSH$1&&(zero(N.head),N.lookahead===0&&(N.strstart=0,N.block_start=0,N.insert=0))),flush_pending(D),D.avail_out===0))return N.last_flush=-1,Z_OK$3}return z!==Z_FINISH$3?Z_OK$3:N.wrap<=0?Z_STREAM_END$3:(N.wrap===2?(put_byte(N,D.adler&255),put_byte(N,D.adler>>8&255),put_byte(N,D.adler>>16&255),put_byte(N,D.adler>>24&255),put_byte(N,D.total_in&255),put_byte(N,D.total_in>>8&255),put_byte(N,D.total_in>>16&255),put_byte(N,D.total_in>>24&255)):(putShortMSB(N,D.adler>>>16),putShortMSB(N,D.adler&65535)),flush_pending(D),N.wrap>0&&(N.wrap=-N.wrap),N.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=D=>{if(deflateStateCheck(D))return Z_STREAM_ERROR$2;const z=D.state.status;return D.state=null,z===BUSY_STATE?err(D,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(D,z)=>{let N=z.length;if(deflateStateCheck(D))return Z_STREAM_ERROR$2;const J=D.state,I=J.wrap;if(I===2||I===1&&J.status!==INIT_STATE||J.lookahead)return Z_STREAM_ERROR$2;if(I===1&&(D.adler=adler32_1(D.adler,z,N,0)),J.wrap=0,N>=J.w_size){I===0&&(zero(J.head),J.strstart=0,J.block_start=0,J.insert=0);let q=new Uint8Array(J.w_size);q.set(z.subarray(N-J.w_size,N),0),z=q,N=J.w_size}const O=D.avail_in,n=D.next_in,a=D.input;for(D.avail_in=N,D.next_in=0,D.input=z,fill_window(J);J.lookahead>=MIN_MATCH;){let q=J.strstart,F=J.lookahead-(MIN_MATCH-1);do J.ins_h=HASH(J,J.ins_h,J.window[q+MIN_MATCH-1]),J.prev[q&J.w_mask]=J.head[J.ins_h],J.head[J.ins_h]=q,q++;while(--F);J.strstart=q,J.lookahead=MIN_MATCH-1,fill_window(J)}return J.strstart+=J.lookahead,J.block_start=J.strstart,J.insert=J.lookahead,J.lookahead=0,J.match_length=J.prev_length=MIN_MATCH-1,J.match_available=0,D.next_in=n,D.input=a,D.avail_in=O,J.wrap=I,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,z)=>Object.prototype.hasOwnProperty.call(D,z);var assign=function(D){const z=Array.prototype.slice.call(arguments,1);for(;z.length;){const N=z.shift();if(N){if(typeof N!="object")throw new TypeError(N+"must be non-object");for(const J in N)_has(N,J)&&(D[J]=N[J])}}return D},flattenChunks=D=>{let z=0;for(let J=0,I=D.length;J<I;J++)z+=D[J].length;const N=new Uint8Array(z);for(let J=0,I=0,O=D.length;J<O;J++){let n=D[J];N.set(n,I),I+=n.length}return N},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 z,N,J,I,O,n=D.length,a=0;for(I=0;I<n;I++)N=D.charCodeAt(I),(N&64512)===55296&&I+1<n&&(J=D.charCodeAt(I+1),(J&64512)===56320&&(N=65536+(N-55296<<10)+(J-56320),I++)),a+=N<128?1:N<2048?2:N<65536?3:4;for(z=new Uint8Array(a),O=0,I=0;O<a;I++)N=D.charCodeAt(I),(N&64512)===55296&&I+1<n&&(J=D.charCodeAt(I+1),(J&64512)===56320&&(N=65536+(N-55296<<10)+(J-56320),I++)),N<128?z[O++]=N:N<2048?(z[O++]=192|N>>>6,z[O++]=128|N&63):N<65536?(z[O++]=224|N>>>12,z[O++]=128|N>>>6&63,z[O++]=128|N&63):(z[O++]=240|N>>>18,z[O++]=128|N>>>12&63,z[O++]=128|N>>>6&63,z[O++]=128|N&63);return z};const buf2binstring=(D,z)=>{if(z<65534&&D.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,D.length===z?D:D.subarray(0,z));let N="";for(let J=0;J<z;J++)N+=String.fromCharCode(D[J]);return N};var buf2string=(D,z)=>{const N=z||D.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(D.subarray(0,z));let J,I;const O=new Array(N*2);for(I=0,J=0;J<N;){let n=D[J++];if(n<128){O[I++]=n;continue}let a=_utf8len[n];if(a>4){O[I++]=65533,J+=a-1;continue}for(n&=a===2?31:a===3?15:7;a>1&&J<N;)n=n<<6|D[J++]&63,a--;if(a>1){O[I++]=65533;continue}n<65536?O[I++]=n:(n-=65536,O[I++]=55296|n>>10&1023,O[I++]=56320|n&1023)}return buf2binstring(O,I)},utf8border=(D,z)=>{z=z||D.length,z>D.length&&(z=D.length);let N=z-1;for(;N>=0&&(D[N]&192)===128;)N--;return N<0||N===0?z:N+_utf8len[D[N]]>z?N:z},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 z=this.options;z.raw&&z.windowBits>0?z.windowBits=-z.windowBits:z.gzip&&z.windowBits>0&&z.windowBits<16&&(z.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let N=deflate_1$2.deflateInit2(this.strm,z.level,z.method,z.windowBits,z.memLevel,z.strategy);if(N!==Z_OK$2)throw new Error(messages[N]);if(z.header&&deflate_1$2.deflateSetHeader(this.strm,z.header),z.dictionary){let J;if(typeof z.dictionary=="string"?J=strings.string2buf(z.dictionary):toString$1.call(z.dictionary)==="[object ArrayBuffer]"?J=new Uint8Array(z.dictionary):J=z.dictionary,N=deflate_1$2.deflateSetDictionary(this.strm,J),N!==Z_OK$2)throw new Error(messages[N]);this._dict_set=!0}}Deflate$1.prototype.push=function(D,z){const N=this.strm,J=this.options.chunkSize;let I,O;if(this.ended)return!1;for(z===~~z?O=z:O=z===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof D=="string"?N.input=strings.string2buf(D):toString$1.call(D)==="[object ArrayBuffer]"?N.input=new Uint8Array(D):N.input=D,N.next_in=0,N.avail_in=N.input.length;;){if(N.avail_out===0&&(N.output=new Uint8Array(J),N.next_out=0,N.avail_out=J),(O===Z_SYNC_FLUSH||O===Z_FULL_FLUSH)&&N.avail_out<=6){this.onData(N.output.subarray(0,N.next_out)),N.avail_out=0;continue}if(I=deflate_1$2.deflate(N,O),I===Z_STREAM_END$2)return N.next_out>0&&this.onData(N.output.subarray(0,N.next_out)),I=deflate_1$2.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===Z_OK$2;if(N.avail_out===0){this.onData(N.output);continue}if(O>0&&N.next_out>0){this.onData(N.output.subarray(0,N.next_out)),N.avail_out=0;continue}if(N.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,z){const N=new Deflate$1(z);if(N.push(D,!0),N.err)throw N.msg||messages[N.err];return N.result}function deflateRaw$1(D,z){return z=z||{},z.raw=!0,deflate$1(D,z)}function gzip$1(D,z){return z=z||{},z.gzip=!0,deflate$1(D,z)}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(z,N){let J,I,O,n,a,q,F,Z,X,ee,Q,ne,se,re,oe,me,_e,ae,fe,be,he,ye,we,le;const de=z.state;J=z.next_in,we=z.input,I=J+(z.avail_in-5),O=z.next_out,le=z.output,n=O-(N-z.avail_out),a=O+(z.avail_out-257),q=de.dmax,F=de.wsize,Z=de.whave,X=de.wnext,ee=de.window,Q=de.hold,ne=de.bits,se=de.lencode,re=de.distcode,oe=(1<<de.lenbits)-1,me=(1<<de.distbits)-1;e:do{ne<15&&(Q+=we[J++]<<ne,ne+=8,Q+=we[J++]<<ne,ne+=8),_e=se[Q&oe];t:for(;;){if(ae=_e>>>24,Q>>>=ae,ne-=ae,ae=_e>>>16&255,ae===0)le[O++]=_e&65535;else if(ae&16){fe=_e&65535,ae&=15,ae&&(ne<ae&&(Q+=we[J++]<<ne,ne+=8),fe+=Q&(1<<ae)-1,Q>>>=ae,ne-=ae),ne<15&&(Q+=we[J++]<<ne,ne+=8,Q+=we[J++]<<ne,ne+=8),_e=re[Q&me];n:for(;;){if(ae=_e>>>24,Q>>>=ae,ne-=ae,ae=_e>>>16&255,ae&16){if(be=_e&65535,ae&=15,ne<ae&&(Q+=we[J++]<<ne,ne+=8,ne<ae&&(Q+=we[J++]<<ne,ne+=8)),be+=Q&(1<<ae)-1,be>q){z.msg="invalid distance too far back",de.mode=BAD$1;break e}if(Q>>>=ae,ne-=ae,ae=O-n,be>ae){if(ae=be-ae,ae>Z&&de.sane){z.msg="invalid distance too far back",de.mode=BAD$1;break e}if(he=0,ye=ee,X===0){if(he+=F-ae,ae<fe){fe-=ae;do le[O++]=ee[he++];while(--ae);he=O-be,ye=le}}else if(X<ae){if(he+=F+X-ae,ae-=X,ae<fe){fe-=ae;do le[O++]=ee[he++];while(--ae);if(he=0,X<fe){ae=X,fe-=ae;do le[O++]=ee[he++];while(--ae);he=O-be,ye=le}}}else if(he+=X-ae,ae<fe){fe-=ae;do le[O++]=ee[he++];while(--ae);he=O-be,ye=le}for(;fe>2;)le[O++]=ye[he++],le[O++]=ye[he++],le[O++]=ye[he++],fe-=3;fe&&(le[O++]=ye[he++],fe>1&&(le[O++]=ye[he++]))}else{he=O-be;do le[O++]=le[he++],le[O++]=le[he++],le[O++]=le[he++],fe-=3;while(fe>2);fe&&(le[O++]=le[he++],fe>1&&(le[O++]=le[he++]))}}else if((ae&64)===0){_e=re[(_e&65535)+(Q&(1<<ae)-1)];continue n}else{z.msg="invalid distance code",de.mode=BAD$1;break e}break}}else if((ae&64)===0){_e=se[(_e&65535)+(Q&(1<<ae)-1)];continue t}else if(ae&32){de.mode=TYPE$1;break e}else{z.msg="invalid literal/length code",de.mode=BAD$1;break e}break}}while(J<I&&O<a);fe=ne>>3,J-=fe,ne-=fe<<3,Q&=(1<<ne)-1,z.next_in=J,z.next_out=O,z.avail_in=J<I?5+(I-J):5-(J-I),z.avail_out=O<a?257+(a-O):257-(O-a),de.hold=Q,de.bits=ne};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,z,N,J,I,O,n,a)=>{const q=a.bits;let F=0,Z=0,X=0,ee=0,Q=0,ne=0,se=0,re=0,oe=0,me=0,_e,ae,fe,be,he,ye=null,we;const le=new Uint16Array(MAXBITS+1),de=new Uint16Array(MAXBITS+1);let ge=null,Se,Ee,Be;for(F=0;F<=MAXBITS;F++)le[F]=0;for(Z=0;Z<J;Z++)le[z[N+Z]]++;for(Q=q,ee=MAXBITS;ee>=1&&le[ee]===0;ee--);if(Q>ee&&(Q=ee),ee===0)return I[O++]=1<<24|64<<16|0,I[O++]=1<<24|64<<16|0,a.bits=1,0;for(X=1;X<ee&&le[X]===0;X++);for(Q<X&&(Q=X),re=1,F=1;F<=MAXBITS;F++)if(re<<=1,re-=le[F],re<0)return-1;if(re>0&&(D===CODES$1||ee!==1))return-1;for(de[1]=0,F=1;F<MAXBITS;F++)de[F+1]=de[F]+le[F];for(Z=0;Z<J;Z++)z[N+Z]!==0&&(n[de[z[N+Z]]++]=Z);if(D===CODES$1?(ye=ge=n,we=20):D===LENS$1?(ye=lbase,ge=lext,we=257):(ye=dbase,ge=dext,we=0),me=0,Z=0,F=X,he=O,ne=Q,se=0,fe=-1,oe=1<<Q,be=oe-1,D===LENS$1&&oe>ENOUGH_LENS$1||D===DISTS$1&&oe>ENOUGH_DISTS$1)return 1;for(;;){Se=F-se,n[Z]+1<we?(Ee=0,Be=n[Z]):n[Z]>=we?(Ee=ge[n[Z]-we],Be=ye[n[Z]-we]):(Ee=96,Be=0),_e=1<<F-se,ae=1<<ne,X=ae;do ae-=_e,I[he+(me>>se)+ae]=Se<<24|Ee<<16|Be|0;while(ae!==0);for(_e=1<<F-1;me&_e;)_e>>=1;if(_e!==0?(me&=_e-1,me+=_e):me=0,Z++,--le[F]===0){if(F===ee)break;F=z[N+n[Z]]}if(F>Q&&(me&be)!==fe){for(se===0&&(se=Q),he+=X,ne=F-se,re=1<<ne;ne+se<ee&&(re-=le[ne+se],!(re<=0));)ne++,re<<=1;if(oe+=1<<ne,D===LENS$1&&oe>ENOUGH_LENS$1||D===DISTS$1&&oe>ENOUGH_DISTS$1)return 1;fe=me&be,I[fe]=Q<<24|ne<<16|he-O|0}}return me!==0&&(I[he+me]=F-se<<24|64<<16|0),a.bits=Q,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 z=D.state;return!z||z.strm!==D||z.mode<HEAD||z.mode>SYNC?1:0},inflateResetKeep=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const z=D.state;return D.total_in=D.total_out=z.total=0,D.msg="",z.wrap&&(D.adler=z.wrap&1),z.mode=HEAD,z.last=0,z.havedict=0,z.flags=-1,z.dmax=32768,z.head=null,z.hold=0,z.bits=0,z.lencode=z.lendyn=new Int32Array(ENOUGH_LENS),z.distcode=z.distdyn=new Int32Array(ENOUGH_DISTS),z.sane=1,z.back=-1,Z_OK$1},inflateReset=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const z=D.state;return z.wsize=0,z.whave=0,z.wnext=0,inflateResetKeep(D)},inflateReset2=(D,z)=>{let N;if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const J=D.state;return z<0?(N=0,z=-z):(N=(z>>4)+5,z<48&&(z&=15)),z&&(z<8||z>15)?Z_STREAM_ERROR$1:(J.window!==null&&J.wbits!==z&&(J.window=null),J.wrap=N,J.wbits=z,inflateReset(D))},inflateInit2=(D,z)=>{if(!D)return Z_STREAM_ERROR$1;const N=new InflateState;D.state=N,N.strm=D,N.window=null,N.mode=HEAD;const J=inflateReset2(D,z);return J!==Z_OK$1&&(D.state=null),J},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 z=0;for(;z<144;)D.lens[z++]=8;for(;z<256;)D.lens[z++]=9;for(;z<280;)D.lens[z++]=7;for(;z<288;)D.lens[z++]=8;for(inftrees(LENS,D.lens,0,288,lenfix,0,D.work,{bits:9}),z=0;z<32;)D.lens[z++]=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,z,N,J)=>{let I;const O=D.state;return O.window===null&&(O.wsize=1<<O.wbits,O.wnext=0,O.whave=0,O.window=new Uint8Array(O.wsize)),J>=O.wsize?(O.window.set(z.subarray(N-O.wsize,N),0),O.wnext=0,O.whave=O.wsize):(I=O.wsize-O.wnext,I>J&&(I=J),O.window.set(z.subarray(N-J,N-J+I),O.wnext),J-=I,J?(O.window.set(z.subarray(N-J,N),0),O.wnext=J,O.whave=O.wsize):(O.wnext+=I,O.wnext===O.wsize&&(O.wnext=0),O.whave<O.wsize&&(O.whave+=I))),0},inflate$2=(D,z)=>{let N,J,I,O,n,a,q,F,Z,X,ee,Q,ne,se,re=0,oe,me,_e,ae,fe,be,he,ye;const we=new Uint8Array(4);let le,de;const ge=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;N=D.state,N.mode===TYPE&&(N.mode=TYPEDO),n=D.next_out,I=D.output,q=D.avail_out,O=D.next_in,J=D.input,a=D.avail_in,F=N.hold,Z=N.bits,X=a,ee=q,ye=Z_OK$1;e:for(;;)switch(N.mode){case HEAD:if(N.wrap===0){N.mode=TYPEDO;break}for(;Z<16;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(N.wrap&2&&F===35615){N.wbits===0&&(N.wbits=15),N.check=0,we[0]=F&255,we[1]=F>>>8&255,N.check=crc32_1(N.check,we,2,0),F=0,Z=0,N.mode=FLAGS;break}if(N.head&&(N.head.done=!1),!(N.wrap&1)||(((F&255)<<8)+(F>>8))%31){D.msg="incorrect header check",N.mode=BAD;break}if((F&15)!==Z_DEFLATED){D.msg="unknown compression method",N.mode=BAD;break}if(F>>>=4,Z-=4,he=(F&15)+8,N.wbits===0&&(N.wbits=he),he>15||he>N.wbits){D.msg="invalid window size",N.mode=BAD;break}N.dmax=1<<N.wbits,N.flags=0,D.adler=N.check=1,N.mode=F&512?DICTID:TYPE,F=0,Z=0;break;case FLAGS:for(;Z<16;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(N.flags=F,(N.flags&255)!==Z_DEFLATED){D.msg="unknown compression method",N.mode=BAD;break}if(N.flags&57344){D.msg="unknown header flags set",N.mode=BAD;break}N.head&&(N.head.text=F>>8&1),N.flags&512&&N.wrap&4&&(we[0]=F&255,we[1]=F>>>8&255,N.check=crc32_1(N.check,we,2,0)),F=0,Z=0,N.mode=TIME;case TIME:for(;Z<32;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}N.head&&(N.head.time=F),N.flags&512&&N.wrap&4&&(we[0]=F&255,we[1]=F>>>8&255,we[2]=F>>>16&255,we[3]=F>>>24&255,N.check=crc32_1(N.check,we,4,0)),F=0,Z=0,N.mode=OS;case OS:for(;Z<16;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}N.head&&(N.head.xflags=F&255,N.head.os=F>>8),N.flags&512&&N.wrap&4&&(we[0]=F&255,we[1]=F>>>8&255,N.check=crc32_1(N.check,we,2,0)),F=0,Z=0,N.mode=EXLEN;case EXLEN:if(N.flags&1024){for(;Z<16;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}N.length=F,N.head&&(N.head.extra_len=F),N.flags&512&&N.wrap&4&&(we[0]=F&255,we[1]=F>>>8&255,N.check=crc32_1(N.check,we,2,0)),F=0,Z=0}else N.head&&(N.head.extra=null);N.mode=EXTRA;case EXTRA:if(N.flags&1024&&(Q=N.length,Q>a&&(Q=a),Q&&(N.head&&(he=N.head.extra_len-N.length,N.head.extra||(N.head.extra=new Uint8Array(N.head.extra_len)),N.head.extra.set(J.subarray(O,O+Q),he)),N.flags&512&&N.wrap&4&&(N.check=crc32_1(N.check,J,Q,O)),a-=Q,O+=Q,N.length-=Q),N.length))break e;N.length=0,N.mode=NAME;case NAME:if(N.flags&2048){if(a===0)break e;Q=0;do he=J[O+Q++],N.head&&he&&N.length<65536&&(N.head.name+=String.fromCharCode(he));while(he&&Q<a);if(N.flags&512&&N.wrap&4&&(N.check=crc32_1(N.check,J,Q,O)),a-=Q,O+=Q,he)break e}else N.head&&(N.head.name=null);N.length=0,N.mode=COMMENT;case COMMENT:if(N.flags&4096){if(a===0)break e;Q=0;do he=J[O+Q++],N.head&&he&&N.length<65536&&(N.head.comment+=String.fromCharCode(he));while(he&&Q<a);if(N.flags&512&&N.wrap&4&&(N.check=crc32_1(N.check,J,Q,O)),a-=Q,O+=Q,he)break e}else N.head&&(N.head.comment=null);N.mode=HCRC;case HCRC:if(N.flags&512){for(;Z<16;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(N.wrap&4&&F!==(N.check&65535)){D.msg="header crc mismatch",N.mode=BAD;break}F=0,Z=0}N.head&&(N.head.hcrc=N.flags>>9&1,N.head.done=!0),D.adler=N.check=0,N.mode=TYPE;break;case DICTID:for(;Z<32;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}D.adler=N.check=zswap32(F),F=0,Z=0,N.mode=DICT;case DICT:if(N.havedict===0)return D.next_out=n,D.avail_out=q,D.next_in=O,D.avail_in=a,N.hold=F,N.bits=Z,Z_NEED_DICT$1;D.adler=N.check=1,N.mode=TYPE;case TYPE:if(z===Z_BLOCK||z===Z_TREES)break e;case TYPEDO:if(N.last){F>>>=Z&7,Z-=Z&7,N.mode=CHECK;break}for(;Z<3;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}switch(N.last=F&1,F>>>=1,Z-=1,F&3){case 0:N.mode=STORED;break;case 1:if(fixedtables(N),N.mode=LEN_,z===Z_TREES){F>>>=2,Z-=2;break e}break;case 2:N.mode=TABLE;break;case 3:D.msg="invalid block type",N.mode=BAD}F>>>=2,Z-=2;break;case STORED:for(F>>>=Z&7,Z-=Z&7;Z<32;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if((F&65535)!==(F>>>16^65535)){D.msg="invalid stored block lengths",N.mode=BAD;break}if(N.length=F&65535,F=0,Z=0,N.mode=COPY_,z===Z_TREES)break e;case COPY_:N.mode=COPY;case COPY:if(Q=N.length,Q){if(Q>a&&(Q=a),Q>q&&(Q=q),Q===0)break e;I.set(J.subarray(O,O+Q),n),a-=Q,O+=Q,q-=Q,n+=Q,N.length-=Q;break}N.mode=TYPE;break;case TABLE:for(;Z<14;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(N.nlen=(F&31)+257,F>>>=5,Z-=5,N.ndist=(F&31)+1,F>>>=5,Z-=5,N.ncode=(F&15)+4,F>>>=4,Z-=4,N.nlen>286||N.ndist>30){D.msg="too many length or distance symbols",N.mode=BAD;break}N.have=0,N.mode=LENLENS;case LENLENS:for(;N.have<N.ncode;){for(;Z<3;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}N.lens[ge[N.have++]]=F&7,F>>>=3,Z-=3}for(;N.have<19;)N.lens[ge[N.have++]]=0;if(N.lencode=N.lendyn,N.lenbits=7,le={bits:N.lenbits},ye=inftrees(CODES,N.lens,0,19,N.lencode,0,N.work,le),N.lenbits=le.bits,ye){D.msg="invalid code lengths set",N.mode=BAD;break}N.have=0,N.mode=CODELENS;case CODELENS:for(;N.have<N.nlen+N.ndist;){for(;re=N.lencode[F&(1<<N.lenbits)-1],oe=re>>>24,me=re>>>16&255,_e=re&65535,!(oe<=Z);){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(_e<16)F>>>=oe,Z-=oe,N.lens[N.have++]=_e;else{if(_e===16){for(de=oe+2;Z<de;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(F>>>=oe,Z-=oe,N.have===0){D.msg="invalid bit length repeat",N.mode=BAD;break}he=N.lens[N.have-1],Q=3+(F&3),F>>>=2,Z-=2}else if(_e===17){for(de=oe+3;Z<de;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}F>>>=oe,Z-=oe,he=0,Q=3+(F&7),F>>>=3,Z-=3}else{for(de=oe+7;Z<de;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}F>>>=oe,Z-=oe,he=0,Q=11+(F&127),F>>>=7,Z-=7}if(N.have+Q>N.nlen+N.ndist){D.msg="invalid bit length repeat",N.mode=BAD;break}for(;Q--;)N.lens[N.have++]=he}}if(N.mode===BAD)break;if(N.lens[256]===0){D.msg="invalid code -- missing end-of-block",N.mode=BAD;break}if(N.lenbits=9,le={bits:N.lenbits},ye=inftrees(LENS,N.lens,0,N.nlen,N.lencode,0,N.work,le),N.lenbits=le.bits,ye){D.msg="invalid literal/lengths set",N.mode=BAD;break}if(N.distbits=6,N.distcode=N.distdyn,le={bits:N.distbits},ye=inftrees(DISTS,N.lens,N.nlen,N.ndist,N.distcode,0,N.work,le),N.distbits=le.bits,ye){D.msg="invalid distances set",N.mode=BAD;break}if(N.mode=LEN_,z===Z_TREES)break e;case LEN_:N.mode=LEN;case LEN:if(a>=6&&q>=258){D.next_out=n,D.avail_out=q,D.next_in=O,D.avail_in=a,N.hold=F,N.bits=Z,inffast(D,ee),n=D.next_out,I=D.output,q=D.avail_out,O=D.next_in,J=D.input,a=D.avail_in,F=N.hold,Z=N.bits,N.mode===TYPE&&(N.back=-1);break}for(N.back=0;re=N.lencode[F&(1<<N.lenbits)-1],oe=re>>>24,me=re>>>16&255,_e=re&65535,!(oe<=Z);){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(me&&(me&240)===0){for(ae=oe,fe=me,be=_e;re=N.lencode[be+((F&(1<<ae+fe)-1)>>ae)],oe=re>>>24,me=re>>>16&255,_e=re&65535,!(ae+oe<=Z);){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}F>>>=ae,Z-=ae,N.back+=ae}if(F>>>=oe,Z-=oe,N.back+=oe,N.length=_e,me===0){N.mode=LIT;break}if(me&32){N.back=-1,N.mode=TYPE;break}if(me&64){D.msg="invalid literal/length code",N.mode=BAD;break}N.extra=me&15,N.mode=LENEXT;case LENEXT:if(N.extra){for(de=N.extra;Z<de;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}N.length+=F&(1<<N.extra)-1,F>>>=N.extra,Z-=N.extra,N.back+=N.extra}N.was=N.length,N.mode=DIST;case DIST:for(;re=N.distcode[F&(1<<N.distbits)-1],oe=re>>>24,me=re>>>16&255,_e=re&65535,!(oe<=Z);){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if((me&240)===0){for(ae=oe,fe=me,be=_e;re=N.distcode[be+((F&(1<<ae+fe)-1)>>ae)],oe=re>>>24,me=re>>>16&255,_e=re&65535,!(ae+oe<=Z);){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}F>>>=ae,Z-=ae,N.back+=ae}if(F>>>=oe,Z-=oe,N.back+=oe,me&64){D.msg="invalid distance code",N.mode=BAD;break}N.offset=_e,N.extra=me&15,N.mode=DISTEXT;case DISTEXT:if(N.extra){for(de=N.extra;Z<de;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}N.offset+=F&(1<<N.extra)-1,F>>>=N.extra,Z-=N.extra,N.back+=N.extra}if(N.offset>N.dmax){D.msg="invalid distance too far back",N.mode=BAD;break}N.mode=MATCH;case MATCH:if(q===0)break e;if(Q=ee-q,N.offset>Q){if(Q=N.offset-Q,Q>N.whave&&N.sane){D.msg="invalid distance too far back",N.mode=BAD;break}Q>N.wnext?(Q-=N.wnext,ne=N.wsize-Q):ne=N.wnext-Q,Q>N.length&&(Q=N.length),se=N.window}else se=I,ne=n-N.offset,Q=N.length;Q>q&&(Q=q),q-=Q,N.length-=Q;do I[n++]=se[ne++];while(--Q);N.length===0&&(N.mode=LEN);break;case LIT:if(q===0)break e;I[n++]=N.length,q--,N.mode=LEN;break;case CHECK:if(N.wrap){for(;Z<32;){if(a===0)break e;a--,F|=J[O++]<<Z,Z+=8}if(ee-=q,D.total_out+=ee,N.total+=ee,N.wrap&4&&ee&&(D.adler=N.check=N.flags?crc32_1(N.check,I,ee,n-ee):adler32_1(N.check,I,ee,n-ee)),ee=q,N.wrap&4&&(N.flags?F:zswap32(F))!==N.check){D.msg="incorrect data check",N.mode=BAD;break}F=0,Z=0}N.mode=LENGTH;case LENGTH:if(N.wrap&&N.flags){for(;Z<32;){if(a===0)break e;a--,F+=J[O++]<<Z,Z+=8}if(N.wrap&4&&F!==(N.total&4294967295)){D.msg="incorrect length check",N.mode=BAD;break}F=0,Z=0}N.mode=DONE;case DONE:ye=Z_STREAM_END$1;break e;case BAD:ye=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=n,D.avail_out=q,D.next_in=O,D.avail_in=a,N.hold=F,N.bits=Z,(N.wsize||ee!==D.avail_out&&N.mode<BAD&&(N.mode<CHECK||z!==Z_FINISH$1))&&updatewindow(D,D.output,D.next_out,ee-D.avail_out),X-=D.avail_in,ee-=D.avail_out,D.total_in+=X,D.total_out+=ee,N.total+=ee,N.wrap&4&&ee&&(D.adler=N.check=N.flags?crc32_1(N.check,I,ee,D.next_out-ee):adler32_1(N.check,I,ee,D.next_out-ee)),D.data_type=N.bits+(N.last?64:0)+(N.mode===TYPE?128:0)+(N.mode===LEN_||N.mode===COPY_?256:0),(X===0&&ee===0||z===Z_FINISH$1)&&ye===Z_OK$1&&(ye=Z_BUF_ERROR),ye},inflateEnd=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;let z=D.state;return z.window&&(z.window=null),D.state=null,Z_OK$1},inflateGetHeader=(D,z)=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const N=D.state;return(N.wrap&2)===0?Z_STREAM_ERROR$1:(N.head=z,z.done=!1,Z_OK$1)},inflateSetDictionary=(D,z)=>{const N=z.length;let J,I,O;return inflateStateCheck(D)||(J=D.state,J.wrap!==0&&J.mode!==DICT)?Z_STREAM_ERROR$1:J.mode===DICT&&(I=1,I=adler32_1(I,z,N,0),I!==J.check)?Z_DATA_ERROR$1:(O=updatewindow(D,z,N,N),O?(J.mode=MEM,Z_MEM_ERROR$1):(J.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 z=this.options;z.raw&&z.windowBits>=0&&z.windowBits<16&&(z.windowBits=-z.windowBits,z.windowBits===0&&(z.windowBits=-15)),z.windowBits>=0&&z.windowBits<16&&!(D&&D.windowBits)&&(z.windowBits+=32),z.windowBits>15&&z.windowBits<48&&(z.windowBits&15)===0&&(z.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let N=inflate_1$2.inflateInit2(this.strm,z.windowBits);if(N!==Z_OK)throw new Error(messages[N]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),z.dictionary&&(typeof z.dictionary=="string"?z.dictionary=strings.string2buf(z.dictionary):toString.call(z.dictionary)==="[object ArrayBuffer]"&&(z.dictionary=new Uint8Array(z.dictionary)),z.raw&&(N=inflate_1$2.inflateSetDictionary(this.strm,z.dictionary),N!==Z_OK)))throw new Error(messages[N])}Inflate$1.prototype.push=function(D,z){const N=this.strm,J=this.options.chunkSize,I=this.options.dictionary;let O,n,a;if(this.ended)return!1;for(z===~~z?n=z:n=z===!0?Z_FINISH:Z_NO_FLUSH,toString.call(D)==="[object ArrayBuffer]"?N.input=new Uint8Array(D):N.input=D,N.next_in=0,N.avail_in=N.input.length;;){for(N.avail_out===0&&(N.output=new Uint8Array(J),N.next_out=0,N.avail_out=J),O=inflate_1$2.inflate(N,n),O===Z_NEED_DICT&&I&&(O=inflate_1$2.inflateSetDictionary(N,I),O===Z_OK?O=inflate_1$2.inflate(N,n):O===Z_DATA_ERROR&&(O=Z_NEED_DICT));N.avail_in>0&&O===Z_STREAM_END&&N.state.wrap>0&&D[N.next_in]!==0;)inflate_1$2.inflateReset(N),O=inflate_1$2.inflate(N,n);switch(O){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(O),this.ended=!0,!1}if(a=N.avail_out,N.next_out&&(N.avail_out===0||O===Z_STREAM_END))if(this.options.to==="string"){let q=strings.utf8border(N.output,N.next_out),F=N.next_out-q,Z=strings.buf2string(N.output,q);N.next_out=F,N.avail_out=J-F,F&&N.output.set(N.output.subarray(q,q+F),0),this.onData(Z)}else this.onData(N.output.length===N.next_out?N.output:N.output.subarray(0,N.next_out));if(!(O===Z_OK&&a===0)){if(O===Z_STREAM_END)return O=inflate_1$2.inflateEnd(this.strm),this.onEnd(O),this.ended=!0,!0;if(N.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,z){const N=new Inflate$1(z);if(N.push(D),N.err)throw N.msg||messages[N.err];return N.result}function inflateRaw$1(D,z){return z=z||{},z.raw=!0,inflate$1(D,z)}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 noLogEvents=["updateSeverTime"];noLogEvents.push("heartbeat"),noLogEvents.push("heartbeatEx"),noLogEvents.push("networkQualityChange"),noLogEvents.push("onNetQuality"),noLogEvents.push("updateCall"),noLogEvents.push("pubNotify");const compressArrayBuffer=D=>{const z=new Uint8Array(D),N=pako.deflate(z,{gzip:!0});return new Uint8Array(N==null?void 0:N.buffer)},decompressArrayBuffer=D=>{const z=new Uint8Array(D),N=pako.inflate(z,{gzip:!0});return new Uint8Array(N==null?void 0:N.buffer)},sendMessageFormat=D=>{const{event:z}=D;switch(D.data_original=D.data,D.time&&(D.timeStr=E$1(D.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),z){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"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"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;default:D.data=new Uint8Array;break}return D},onMessageFormat=D=>{const{event:z,compress:N=!1}=D;if(D.data_remote=D.data,D.time&&(D.timeStr=E$1(D.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),N)try{D.data=decompressArrayBuffer(D.data)}catch(J){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",J)}switch(z){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"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"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(z){Te(this,Ce);Te(this,Ie,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:20*1e3});Te(this,je,"");Te(this,Ke,{});Te(this,et,{});ce(this,"state","closed");ce(this,"sendMessageBefore",async()=>{});ce(this,"onReconnectSuccess",z=>{});ce(this,"onReconnectStop",z=>{});Te(this,Lt,z=>{let N=!0;const{code:J=1e3}=z;return J===1e3&&(N=!1),this.state="connecting",N});Te(this,Ht,async z=>{pe(this,Ie).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",z),this.state="connected",this.onReconnectSuccess(z)});Te(this,Ft,async z=>{pe(this,Ie).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",z),this.close(),this.state="closed",this.onReconnectStop(z)});Te(this,Bt,(z,N={})=>{try{const{time:J,event:I,data:O={},data_original:n={},data_remote:a,...q}=N,F=E$1(J,"YYYY-MM-DD hh:mm:ss",{offset:480});let Z={};const X=(_e={})=>{const ae=JSON.parse(JSON.stringify(_e)),fe=Object.keys(ae);for(const be of fe)(be.includes("sdp")||be.includes("Sdp"))&&(ae[be]="");return ae};let ee="res ↓";switch(z){case"res":ee="res ↓",Z=X(O);break;case"req":ee="req ↑",Z=X(n);break}let Q="#quickvo.logs";ignoreEvent.includes(I)&&(Q="#quickvo.ignoreEvents");const ne={"#action":ee,timeStr:F,event:I,data:Z,time:J,...q},se=localStorage.getItem(Q)||JSON.stringify([]),re=JSON.parse(se);let oe=I==="heartbeat";const me=[ne];for(const _e of re){const{event:ae}=_e;if(ae==="heartbeat"){if(oe)continue;oe=!0}if(me.length===200)break;me.push(_e)}localStorage.setItem(Q,JSON.stringify(me))}catch(J){pe(this,Ie).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",J)}});Te(this,jt,(z,{resolve:N,reject:J})=>{const{sn:I}=z,O=()=>{const a=pe(this,Ke)[I];clearTimeout(a.destructionTimer),delete pe(this,Ke)[I]},n=setTimeout(()=>{const a=pe(this,Ke)[I];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",a.message),O(),J("event is timeout")},pe(this,Ie).timeout);pe(this,Ke)[I]={message:z,resolve:N,reject:J,destruction:O,destructionTimer:n}});Te(this,zt,z=>pe(this,Ke)[z]);Te(this,Jt,async z=>{const N=new Uint8Array(z),J=com.quick.voice.proto.CommonRsp.decode(N),{sn:I,event:O}=J,n=onMessageFormat(J);if(pe(this,Ie).debug&&(noLogEvents.includes(O)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",n),ignoreEvent.includes(O)||pe(this,Bt).call(this,"res",n)),notifyName_keys.includes(O))return this.emitNotify(O,P(n,["code","data","desc"]));const q=pe(this,zt).call(this,I);if(q){const{resolve:F=X=>{},destruction:Z=()=>{}}=q;F(P(n,["code","data","desc"])),Z()}});ce(this,"clearEvents",(z=[])=>{const N=Object.keys(pe(this,Ke));z.length===0&&(z=N);for(const J of N){if(!z.includes(J))continue;const I=pe(this,Ke)[J];if(I){const{destruction:O}=I;O()}}});ce(this,"connect",async(z="")=>new Promise(async N=>{z&&Pe(this,je,z),pe(this,Ce)&&(await pe(this,Ce).close(),this.state="closed");const J=`${pe(this,Ie).url}?s=${pe(this,je)}&t=${Date.now()}`,I=new Date().getTime();if(Pe(this,Ce,new M({...pe(this,Ie),debug:!1,url:J,binaryType:"arraybuffer",onMessage:pe(this,Jt),checkReconnect:pe(this,Lt),getHeartbeatMsg:()=>"",onReconnectSuccess:pe(this,Ht),onReconnectStop:pe(this,Ft)})),this.state="connecting",await pe(this,Ce).connect(),this.state="connected",pe(this,Ie).debug){const n=new Date().getTime()-I;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${n}ms-广播事件`,pe(this,et))}N(pe(this,Ce))}));ce(this,"close",async()=>{var N;pe(this,Ie).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const z=Object.keys(pe(this,Ke));for(const J of z){const{destructionTimer:I}=pe(this,Ke)[J];clearTimeout(I)}Pe(this,Ke,{}),await((N=pe(this,Ce))==null?void 0:N.close()),Pe(this,Ce,void 0),this.state="closed"});ce(this,"sendMessage",(z,N=!0)=>new Promise(async(J,I)=>{var Z;await this.sendMessageBefore();const{event:O,...n}=z,a=Date.now(),q=sendMessageFormat({event:O,sn:+`${a}${v$1(1e3,9999)}`,time:a,valid:pe(this,Ie).timeout,version:1,compress:!1,...n});pe(this,Ie).debug&&(noLogEvents.includes(O)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",q),ignoreEvent.includes(O)||pe(this,Bt).call(this,"req",q)),N&&pe(this,jt).call(this,q,{resolve:J,reject:I});const F=com.quick.voice.proto.CommonReq.encode(q).finish();(Z=pe(this,Ce))==null||Z.sendMessage(F)}));ce(this,"emitNotify",async(z,N)=>{const J=pe(this,et)[z]||[];for(const I of J){const{callback:O=async()=>{}}=I;await O(N)}});ce(this,"addNotify",(z,N=!1)=>{const{event:J,sn:I=xt(32)}=z;pe(this,et)[J]||(pe(this,et)[J]=[]);const O=pe(this,et)[J],n=O.findIndex(a=>a.sn===I);return n!==-1&&O.splice(n,1),N?O.unshift(z):O.push(z),I});ce(this,"removeNotify",(z=[])=>{if(z.length===0)Pe(this,et,{});else{const N=Object.keys(pe(this,et));for(const J of N)pe(this,et)[J]=pe(this,et)[J].filter(I=>!z.includes(I.sn||""))}pe(this,Ie).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",pe(this,et))});Pe(this,Ie,{...pe(this,Ie),...z})}}Ce=new WeakMap,Ie=new WeakMap,je=new WeakMap,Ke=new WeakMap,et=new WeakMap,Lt=new WeakMap,Ht=new WeakMap,Ft=new WeakMap,Bt=new WeakMap,jt=new WeakMap,zt=new WeakMap,Jt=new WeakMap;const createMutedAudioStream=D=>{const z=D.createOscillator();z.type="sine",z.frequency.setValueAtTime(0,D.currentTime);const N=D.createGain();N.gain.value=0,z.connect(N),N.connect(D.destination),z.start();const J=D.createMediaStreamDestination();return N.disconnect(),z.connect(J),J.stream},createFakeVideoStream=(D=10,z=10,N=30)=>{const J=document.createElement("canvas"),I=J.getContext("2d");J.width=D,J.height=z;let O=0;return setInterval(()=>{I.clearRect(0,0,J.width,J.height);const q=I.createLinearGradient(0,0,J.width,J.height);q.addColorStop(0,`hsla(${O}, 100%, 50%, 0)`),q.addColorStop(1,`hsla(${O+120}, 100%, 50%, 0)`),I.fillStyle=q,I.fillRect(0,0,J.width,J.height),O=(O+1)%360},100),J.captureStream(N)};var E=Object.defineProperty,$=D=>{throw TypeError(D)},j=(D,z,N)=>z in D?E(D,z,{enumerable:!0,configurable:!0,writable:!0,value:N}):D[z]=N,u=(D,z,N)=>j(D,typeof z!="symbol"?z+"":z,N),B=(D,z,N)=>z.has(D)||$("Cannot "+N),o=(D,z,N)=>(B(D,z,"read from private field"),N?N.call(D):z.get(D)),k=(D,z,N)=>z.has(D)?$("Cannot add the same private member more than once"):z instanceof WeakSet?z.add(D):z.set(D,N),g=(D,z,N,J)=>(B(D,z,"write to private field"),z.set(D,N),N),C=(D,z,N,J)=>({set _(I){g(D,z,I)},get _(){return o(D,z,J)}}),d,r,c,m;class Y{constructor(z,N={}){k(this,d,{debug:!1}),k(this,r,new Map),k(this,c,new Map),k(this,m,0),u(this,"setCondition",async(J,I)=>{if(!o(this,r).has(J))throw new Error("You have set an incorrect condition. If this is necessary, you need to define it first during instantiation.");const O=o(this,r).get(J);o(this,r).set(J,I),O===!1&&I&&await this.executeTasks()}),u(this,"createTask",async J=>{const I={describe:"",strict:!1,timeout:0,success:async ae=>{},fail:async ae=>{},complete:async()=>{},...J},{describe:O,strict:n,timeout:a,conditionKeys:q,changeConditionKeys:F=[],func:Z,success:X,fail:ee,complete:Q}=I,ne=`${C(this,m)._++}`,se=()=>{let ae=!0;for(const fe of q)if(!o(this,r).get(fe)){ae=!1;break}return ae};let re=0;const oe=()=>{o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${O} (${ne}) end`),o(this,c).delete(ne)},me=async()=>{if(!o(this,c).get(ne)||_e.runing)return;_e.runing=!0;for(const be of F)this.setCondition(be,!1);o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${O} (${ne}) run`);const ae=_e.func(),fe=new Promise((be,he)=>{a&&(re=setTimeout(()=>{he(`task: ${ne} (${O}) is timeout.`)},a))});return Promise.race([ae,fe]).finally(()=>{_e.strict===!1&&_e.clear(),clearTimeout(re),_e.runing=!1,Q()}).then(be=>{X(be)}).catch(be=>{ee(be)})},_e={key:ne,describe:O,strict:n,conditionKeys:q,runing:!1,func:Z,checkAccord:se,success:X,fail:ee,complete:Q,run:me,retry:()=>(_e.runing=!1,me()),clear:oe};return o(this,c).set(ne,_e),_e.checkAccord()&&setTimeout(()=>_e.run(),0),_e}),u(this,"executeTasks",async()=>{const J=[...o(this,c).values()];for(const I of J)I.checkAccord()&&I.run()}),u(this,"clear",(J=[])=>{if(J.length===0){g(this,c,new Map);return}for(const I of J)o(this,c).delete(I)}),u(this,"getConditions",()=>Object.fromEntries(o(this,r))),u(this,"getTasks",()=>o(this,c));for(const J of z)o(this,r).set(J,!0);g(this,d,{debug:!1,...N})}}d=new WeakMap,r=new WeakMap,c=new WeakMap,m=new WeakMap;class NetworkQualityTester{constructor(z=[]){ce(this,"targetUrls",[]);ce(this,"results",[]);z.length===0&&z.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=z,this.results=[]}async testAll(){const z=this.targetUrls.map(N=>this.testUrl(N));return await Promise.all(z),this.analyzeResults()}async testUrl(z){const N=performance.now();let J=0,I=!1;try{await fetch(z,{method:"HEAD",cache:"no-store"});const O=performance.now()-N,n=performance.now(),q=await(await fetch(z,{cache:"no-store"})).blob(),F=performance.now()-n;J=q.size,I=!0,this.results.push({url:z,success:I,headTime:O,getTime:F,size:J,downloadSpeed:J>0?(J/1024/(F/1e3)).toFixed(2):0,totalTime:performance.now()-N})}catch(O){this.results.push({url:z,success:!1,error:O.message,totalTime:performance.now()-N})}}analyzeResults(){const z=this.results.filter(O=>O.success);if(z.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const N=z.reduce((O,n)=>O+n.size,0),J=z.reduce((O,n)=>O+n.totalTime,0),I=z.reduce((O,n)=>O+parseFloat(n.downloadSpeed),0)/z.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:z.length,averageDownloadSpeed:`${I.toFixed(2)} KB/s`,averageResponseTime:`${(J/z.length).toFixed(2)}ms`,totalDataTransferred:`${(N/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(z){var N="undefined",J=N!==typeof Buffer&&Buffer,I=N!==typeof Uint8Array&&Uint8Array,O=N!==typeof ArrayBuffer&&ArrayBuffer,n=[0,0,0,0,0,0,0,0],a=Array.isArray||be,q=4294967296,F=16777216,Z;X("Uint64BE",!0,!0),X("Int64BE",!0,!1),X("Uint64LE",!1,!0),X("Int64LE",!1,!1);function X(he,ye,we){var le=ye?0:4,de=ye?4:0,ge=ye?0:3,Se=ye?1:2,Ee=ye?2:1,Be=ye?3:0,Le=ye?me:ae,Je=ye?_e:fe,We=Me.prototype,nt="is"+he,bt="_"+nt;return We.buffer=void 0,We.offset=0,We[bt]=!0,We.toNumber=it,We.toString=ft,We.toJSON=it,We.toArray=ee,J&&(We.toBuffer=Q),I&&(We.toArrayBuffer=ne),Me[nt]=De,z[he]=Me,Me;function Me($e,Oe,xe,Re){return this instanceof Me?ut(this,$e,Oe,xe,Re):new Me($e,Oe,xe,Re)}function De($e){return!!($e&&$e[bt])}function ut($e,Oe,xe,Re,Ne){if(I&&O&&(Oe instanceof O&&(Oe=new I(Oe)),Re instanceof O&&(Re=new I(Re))),!Oe&&!xe&&!Re&&!Z){$e.buffer=oe(n,0);return}if(!se(Oe,xe)){var Ze=Z||Array;Ne=xe,Re=Oe,xe=0,Oe=Z===J?J.alloc(8):new Ze(8)}$e.buffer=Oe,$e.offset=xe|=0,N!==typeof Re&&(typeof Re=="string"?ze(Oe,xe,Re,Ne||10):se(Re,Ne)?re(Oe,xe,Re,Ne):typeof Ne=="number"?(ot(Oe,xe+le,Re),ot(Oe,xe+de,Ne)):Re>0?Le(Oe,xe,Re):Re<0?Je(Oe,xe,Re):re(Oe,xe,n,0))}function ze($e,Oe,xe,Re){var Ne=0,Ze=xe.length,Xe=0,Qe=0;xe[0]==="-"&&Ne++;for(var mt=Ne;Ne<Ze;){var _t=parseInt(xe[Ne++],Re);if(!(_t>=0))break;Qe=Qe*Re+_t,Xe=Xe*Re+Math.floor(Qe/q),Qe%=q}mt&&(Xe=~Xe,Qe?Qe=q-Qe:Xe++),ot($e,Oe+le,Xe),ot($e,Oe+de,Qe)}function it(){var $e=this.buffer,Oe=this.offset,xe=Ve($e,Oe+le),Re=Ve($e,Oe+de);return we||(xe|=0),xe?xe*q+Re:Re}function ft($e){var Oe=this.buffer,xe=this.offset,Re=Ve(Oe,xe+le),Ne=Ve(Oe,xe+de),Ze="",Xe=!we&&Re&2147483648;for(Xe&&(Re=~Re,Ne=q-Ne),$e=$e||10;;){var Qe=Re%$e*q+Ne;if(Re=Math.floor(Re/$e),Ne=Math.floor(Qe/$e),Ze=(Qe%$e).toString($e)+Ze,!Re&&!Ne)break}return Xe&&(Ze="-"+Ze),Ze}function ot($e,Oe,xe){$e[Oe+Be]=xe&255,xe=xe>>8,$e[Oe+Ee]=xe&255,xe=xe>>8,$e[Oe+Se]=xe&255,xe=xe>>8,$e[Oe+ge]=xe&255}function Ve($e,Oe){return $e[Oe+ge]*F+($e[Oe+Se]<<16)+($e[Oe+Ee]<<8)+$e[Oe+Be]}}function ee(he){var ye=this.buffer,we=this.offset;return Z=null,he!==!1&&a(ye)?ye.length===8?ye:ye.slice(we,we+8):oe(ye,we)}function Q(he){var ye=this.buffer,we=this.offset;return Z=J,he!==!1&&J.isBuffer(ye)?ye.length===8?ye:ye.slice(we,we+8):J.from(ne.call(this,he))}function ne(he){var ye=this.buffer,we=this.offset,le=ye.buffer;if(Z=I,he!==!1&&!ye.offset&&le instanceof O)return le.byteLength===8?le:le.slice(we,we+8);var de=new I(8);return re(de,0,ye,we),de.buffer}function se(he,ye){var we=he&&he.length;return ye|=0,we&&ye+8<=we&&typeof he[ye]!="string"}function re(he,ye,we,le){ye|=0,le|=0;for(var de=0;de<8;de++)he[ye++]=we[le++]&255}function oe(he,ye){return Array.prototype.slice.call(he,ye,ye+8)}function me(he,ye,we){for(var le=ye+8;le>ye;)he[--le]=we&255,we/=256}function _e(he,ye,we){var le=ye+8;for(we++;le>ye;)he[--le]=-we&255^255,we/=256}function ae(he,ye,we){for(var le=ye+8;ye<le;)he[ye++]=we&255,we/=256}function fe(he,ye,we){var le=ye+8;for(we++;ye<le;)he[ye++]=-we&255^255,we/=256}function be(he){return!!he&&Object.prototype.toString.call(he)=="[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(),z=requireTools(),N=requireEbmlID(),J=function(){function I(){this._schema=N.byEbmlID,this._buffers=[],this._stack=[]}return I.prototype.encode=function(O){var n=this;return D.concat(O.reduce(function(a,q){return a.concat(n.encodeChunk(q))},[])).buffer},I.prototype.encodeChunk=function(O){return O.type==="m"?O.isEnd?this.endTag(O):this.startTag(O):(O.data=z.Buffer.from(O.data),this.writeTag(O)),this.flush()},I.prototype.flush=function(){var O=this._buffers;return this._buffers=[],O},I.prototype.getSchemaInfo=function(O){for(var n=Object.keys(this._schema).map(Number),a=0;a<n.length;a++){var q=n[a];if(this._schema[q].name===O)return new z.Buffer(q.toString(16),"hex")}return null},I.prototype.writeTag=function(O){var n=O.name,a=this.getSchemaInfo(n),q=O.data;if(a==null)throw new Error("No schema entry found for "+n);var F=D.encodeTag(a,q);if(this._stack.length>0){var Z=this._stack[this._stack.length-1];Z.children.push({tagId:a,elm:O,children:[],data:F});return}this._buffers=this._buffers.concat(F)},I.prototype.startTag=function(O){var n=O.name,a=this.getSchemaInfo(n);if(a==null)throw new Error("No schema entry found for "+n);if(O.unknownSize){var q=D.encodeTag(a,new z.Buffer(0),O.unknownSize);this._buffers=this._buffers.concat(q);return}var F={tagId:a,elm:O,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(F),this._stack.push(F)},I.prototype.endTag=function(O){O.name;var n=this._stack.pop();if(n==null)throw new Error("EBML structure is broken");if(n.elm.name!==O.name)throw new Error("EBML structure is broken");var a=n.children.reduce(function(F,Z){if(Z.data===null)throw new Error("EBML structure is broken");return F.concat(Z.data)},[]),q=D.concat(a);n.elm.type==="m"?n.data=D.encodeTag(n.tagId,q,n.elm.unknownSize):n.data=D.encodeTag(n.tagId,q),this._stack.length<1&&(this._buffers=this._buffers.concat(n.data))},I}();return EBMLEncoder.default=J,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=a,base64Js.toByteArray=F,base64Js.fromByteArray=ee;for(var D=[],z=[],N=typeof Uint8Array<"u"?Uint8Array:Array,J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=0,O=J.length;I<O;++I)D[I]=J[I],z[J.charCodeAt(I)]=I;z[45]=62,z[95]=63;function n(Q){var ne=Q.length;if(ne%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var se=Q.indexOf("=");se===-1&&(se=ne);var re=se===ne?0:4-se%4;return[se,re]}function a(Q){var ne=n(Q),se=ne[0],re=ne[1];return(se+re)*3/4-re}function q(Q,ne,se){return(ne+se)*3/4-se}function F(Q){var ne,se=n(Q),re=se[0],oe=se[1],me=new N(q(Q,re,oe)),_e=0,ae=oe>0?re-4:re,fe;for(fe=0;fe<ae;fe+=4)ne=z[Q.charCodeAt(fe)]<<18|z[Q.charCodeAt(fe+1)]<<12|z[Q.charCodeAt(fe+2)]<<6|z[Q.charCodeAt(fe+3)],me[_e++]=ne>>16&255,me[_e++]=ne>>8&255,me[_e++]=ne&255;return oe===2&&(ne=z[Q.charCodeAt(fe)]<<2|z[Q.charCodeAt(fe+1)]>>4,me[_e++]=ne&255),oe===1&&(ne=z[Q.charCodeAt(fe)]<<10|z[Q.charCodeAt(fe+1)]<<4|z[Q.charCodeAt(fe+2)]>>2,me[_e++]=ne>>8&255,me[_e++]=ne&255),me}function Z(Q){return D[Q>>18&63]+D[Q>>12&63]+D[Q>>6&63]+D[Q&63]}function X(Q,ne,se){for(var re,oe=[],me=ne;me<se;me+=3)re=(Q[me]<<16&16711680)+(Q[me+1]<<8&65280)+(Q[me+2]&255),oe.push(Z(re));return oe.join("")}function ee(Q){for(var ne,se=Q.length,re=se%3,oe=[],me=16383,_e=0,ae=se-re;_e<ae;_e+=me)oe.push(X(Q,_e,_e+me>ae?ae:_e+me));return re===1?(ne=Q[se-1],oe.push(D[ne>>2]+D[ne<<4&63]+"==")):re===2&&(ne=(Q[se-2]<<8)+Q[se-1],oe.push(D[ne>>10]+D[ne>>4&63]+D[ne<<2&63]+"=")),oe.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,z,N,J,I){var O,n,a=I*8-J-1,q=(1<<a)-1,F=q>>1,Z=-7,X=N?I-1:0,ee=N?-1:1,Q=D[z+X];for(X+=ee,O=Q&(1<<-Z)-1,Q>>=-Z,Z+=a;Z>0;O=O*256+D[z+X],X+=ee,Z-=8);for(n=O&(1<<-Z)-1,O>>=-Z,Z+=J;Z>0;n=n*256+D[z+X],X+=ee,Z-=8);if(O===0)O=1-F;else{if(O===q)return n?NaN:(Q?-1:1)*(1/0);n=n+Math.pow(2,J),O=O-F}return(Q?-1:1)*n*Math.pow(2,O-J)},ieee754.write=function(D,z,N,J,I,O){var n,a,q,F=O*8-I-1,Z=(1<<F)-1,X=Z>>1,ee=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,Q=J?0:O-1,ne=J?1:-1,se=z<0||z===0&&1/z<0?1:0;for(z=Math.abs(z),isNaN(z)||z===1/0?(a=isNaN(z)?1:0,n=Z):(n=Math.floor(Math.log(z)/Math.LN2),z*(q=Math.pow(2,-n))<1&&(n--,q*=2),n+X>=1?z+=ee/q:z+=ee*Math.pow(2,1-X),z*q>=2&&(n++,q/=2),n+X>=Z?(a=0,n=Z):n+X>=1?(a=(z*q-1)*Math.pow(2,I),n=n+X):(a=z*Math.pow(2,X-1)*Math.pow(2,I),n=0));I>=8;D[N+Q]=a&255,Q+=ne,a/=256,I-=8);for(n=n<<I|a,F+=I;F>0;D[N+Q]=n&255,Q+=ne,n/=256,F-=8);D[N+Q-ne]|=se*128}),ieee754}/*!
|
|
3
|
+
`},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var D=requireParser(),J=requireWriter$1(),N=requireGrammar();return lib$1.grammar=N,lib$1.write=J,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(J){he(this,"kind","video");he(this,"stream",new MediaStream);he(this,"stop",()=>{const J=this.stream.getTracks();for(const N of J)N.stop(),this.stream.removeTrack(N)});he(this,"replaceStream",J=>{const N=this.stream,z=N.getTracks();for(const O of z)N.removeTrack(O);const[I]=J.getVideoTracks();I&&N.addTrack(I)});he(this,"getStream",()=>this.stream);he(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(J)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C$1=Object.defineProperty,R=D=>{throw TypeError(D)},S=(D,J,N)=>J in D?C$1(D,J,{enumerable:!0,configurable:!0,writable:!0,value:N}):D[J]=N,l=(D,J,N)=>S(D,typeof J!="symbol"?J+"":J,N),v=(D,J,N)=>J.has(D)||R("Cannot "+N),t$1=(D,J,N)=>(v(D,J,"read from private field"),N?N.call(D):J.get(D)),c$1=(D,J,N)=>J.has(D)?R("Cannot add the same private member more than once"):J instanceof WeakSet?J.add(D):J.set(D,N),i=(D,J,N,z)=>(v(D,J,"write to private field"),J.set(D,N),N),s,r$1,h,p,m$2,f,w,x,g$2,b,B$1,y,T,d$1;class M{constructor(J){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:N=>!0,onReconnectSuccess:async N=>{},onReconnectStop:async N=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:N=>{}}),l(this,"ws"),c$1(this,r$1,-1),c$1(this,h,-1),c$1(this,p,0),c$1(this,m$2,0),c$1(this,f,!1),c$1(this,w,N=>{}),l(this,"close",async(N=1e3,z="correctly close.")=>{var I;this.ws&&(i(this,f,!0),t$1(this,d$1).call(this),(I=this.ws)==null||I.close(N,z))}),l(this,"connect",()=>new Promise(async N=>{i(this,w,N),this.ws=new WebSocket(t$1(this,s).url),this.ws.binaryType=t$1(this,s).binaryType,this.ws.onopen=t$1(this,b),this.ws.onmessage=t$1(this,g$2),this.ws.onerror=t$1(this,B$1),this.ws.onclose=t$1(this,y)})),l(this,"reconnect",async N=>new Promise(z=>{t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await reconnect.");const I=O=>{t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${O}`),t$1(this,s).onReconnectStop({msg:O}),z(O)};if(t$1(this,x).call(this)===!1)return I("stop reconnect. exceed maxReconnectionTime.");if(t$1(this,r$1)!==-1&&t$1(this,r$1)===0)return I("stop reconnect. surplusReconnectCount is 0.");if(!t$1(this,s).checkReconnect(N))return I("stop reconnect. checkReconnect is false.");t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t$1(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t$1(this,r$1)}`,N),i(this,p,setTimeout(async()=>{i(this,r$1,Math.max(-1,t$1(this,r$1)-1)),await this.connect();try{await t$1(this,s).onReconnectSuccess(this.ws)}catch(O){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",O)}z(!0)},t$1(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async N=>{var z;(!this.ws||this.ws.readyState!==1)&&(t$1(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: ws is not ready."),t$1(this,s).sendBeforAutoConnect&&(t$1(this,s).debug&&console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: await ws connect."),await this.connect())),(z=this.ws)==null||z.send(N)}),c$1(this,x,()=>{const N=Date.now();return t$1(this,h)===-1&&i(this,h,N+t$1(this,s).reconnectTime),!(N>t$1(this,h))}),c$1(this,g$2,N=>{const{data:z}=N;t$1(this,s).onMessage(z)}),c$1(this,b,()=>{t$1(this,s).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is success.",this.ws),i(this,r$1,t$1(this,s).reconnectCount),i(this,h,-1),t$1(this,T).call(this),t$1(this,w).call(this,this.ws)}),c$1(this,B$1,N=>{t$1(this,s).debug&&console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->pr-ws: connect is error.",N)}),c$1(this,y,N=>{if(t$1(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: connect is close. code: ${N.code}, permanentClosed is ${t$1(this,f)}.`,N),t$1(this,d$1).call(this),!t$1(this,f))return this.reconnect(N);this.ws=void 0}),c$1(this,T,()=>{i(this,m$2,setInterval(()=>{const N=t$1(this,s).getHeartbeatMsg();N&&this.sendMessage(N)},t$1(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t$1(this,p)),clearInterval(t$1(this,m$2))}),i(this,s,{...t$1(this,s),...J}),i(this,r$1,t$1(this,s).reconnectCount)}}s=new WeakMap,r$1=new WeakMap,h=new WeakMap,p=new WeakMap,m$2=new WeakMap,f=new WeakMap,w=new WeakMap,x=new WeakMap,g$2=new WeakMap,b=new WeakMap,B$1=new WeakMap,y=new WeakMap,T=new WeakMap,d$1=new WeakMap;var indexMinimal={},minimal$1={},aspromise,hasRequiredAspromise;function requireAspromise(){if(hasRequiredAspromise)return aspromise;hasRequiredAspromise=1,aspromise=D;function D(J,N){for(var z=new Array(arguments.length-1),I=0,O=2,n=!0;O<arguments.length;)z[I++]=arguments[O++];return new Promise(function(q,F){z[I]=function(ee){if(n)if(n=!1,ee)F(ee);else{for(var te=new Array(arguments.length-1),X=0;X<te.length;)te[X++]=arguments[X];q.apply(null,te)}};try{J.apply(N||null,z)}catch(Z){n&&(n=!1,F(Z))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(D){var J=D;J.length=function(a){var q=a.length;if(!q)return 0;for(var F=0;--q%4>1&&a.charAt(q)==="=";)++F;return Math.ceil(a.length*3)/4-F};for(var N=new Array(64),z=new Array(123),I=0;I<64;)z[N[I]=I<26?I+65:I<52?I+71:I<62?I-4:I-59|43]=I++;J.encode=function(a,q,F){for(var Z=null,ee=[],te=0,X=0,ne;q<F;){var ce=a[q++];switch(X){case 0:ee[te++]=N[ce>>2],ne=(ce&3)<<4,X=1;break;case 1:ee[te++]=N[ne|ce>>4],ne=(ce&15)<<2,X=2;break;case 2:ee[te++]=N[ne|ce>>6],ee[te++]=N[ce&63],X=0;break}te>8191&&((Z||(Z=[])).push(String.fromCharCode.apply(String,ee)),te=0)}return X&&(ee[te++]=N[ne],ee[te++]=61,X===1&&(ee[te++]=61)),Z?(te&&Z.push(String.fromCharCode.apply(String,ee.slice(0,te))),Z.join("")):String.fromCharCode.apply(String,ee.slice(0,te))};var O="invalid encoding";J.decode=function(a,q,F){for(var Z=F,ee=0,te,X=0;X<a.length;){var ne=a.charCodeAt(X++);if(ne===61&&ee>1)break;if((ne=z[ne])===void 0)throw Error(O);switch(ee){case 0:te=ne,ee=1;break;case 1:q[F++]=te<<2|(ne&48)>>4,te=ne,ee=2;break;case 2:q[F++]=(te&15)<<4|(ne&60)>>2,te=ne,ee=3;break;case 3:q[F++]=(te&3)<<6|ne,ee=0;break}}if(ee===1)throw Error(O);return F-Z},J.test=function(a){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(a)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=D;function D(){this._listeners={}}return D.prototype.on=function(N,z,I){return(this._listeners[N]||(this._listeners[N]=[])).push({fn:z,ctx:I||this}),this},D.prototype.off=function(N,z){if(N===void 0)this._listeners={};else if(z===void 0)this._listeners[N]=[];else for(var I=this._listeners[N],O=0;O<I.length;)I[O].fn===z?I.splice(O,1):++O;return this},D.prototype.emit=function(N){var z=this._listeners[N];if(z){for(var I=[],O=1;O<arguments.length;)I.push(arguments[O++]);for(O=0;O<z.length;)z[O].fn.apply(z[O++].ctx,I)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=D(D);function D(O){return typeof Float32Array<"u"?function(){var n=new Float32Array([-0]),a=new Uint8Array(n.buffer),q=a[3]===128;function F(X,ne,ce){n[0]=X,ne[ce]=a[0],ne[ce+1]=a[1],ne[ce+2]=a[2],ne[ce+3]=a[3]}function Z(X,ne,ce){n[0]=X,ne[ce]=a[3],ne[ce+1]=a[2],ne[ce+2]=a[1],ne[ce+3]=a[0]}O.writeFloatLE=q?F:Z,O.writeFloatBE=q?Z:F;function ee(X,ne){return a[0]=X[ne],a[1]=X[ne+1],a[2]=X[ne+2],a[3]=X[ne+3],n[0]}function te(X,ne){return a[3]=X[ne],a[2]=X[ne+1],a[1]=X[ne+2],a[0]=X[ne+3],n[0]}O.readFloatLE=q?ee:te,O.readFloatBE=q?te:ee}():function(){function n(q,F,Z,ee){var te=F<0?1:0;if(te&&(F=-F),F===0)q(1/F>0?0:2147483648,Z,ee);else if(isNaN(F))q(2143289344,Z,ee);else if(F>34028234663852886e22)q((te<<31|2139095040)>>>0,Z,ee);else if(F<11754943508222875e-54)q((te<<31|Math.round(F/1401298464324817e-60))>>>0,Z,ee);else{var X=Math.floor(Math.log(F)/Math.LN2),ne=Math.round(F*Math.pow(2,-X)*8388608)&8388607;q((te<<31|X+127<<23|ne)>>>0,Z,ee)}}O.writeFloatLE=n.bind(null,J),O.writeFloatBE=n.bind(null,N);function a(q,F,Z){var ee=q(F,Z),te=(ee>>31)*2+1,X=ee>>>23&255,ne=ee&8388607;return X===255?ne?NaN:te*(1/0):X===0?te*1401298464324817e-60*ne:te*Math.pow(2,X-150)*(ne+8388608)}O.readFloatLE=a.bind(null,z),O.readFloatBE=a.bind(null,I)}(),typeof Float64Array<"u"?function(){var n=new Float64Array([-0]),a=new Uint8Array(n.buffer),q=a[7]===128;function F(X,ne,ce){n[0]=X,ne[ce]=a[0],ne[ce+1]=a[1],ne[ce+2]=a[2],ne[ce+3]=a[3],ne[ce+4]=a[4],ne[ce+5]=a[5],ne[ce+6]=a[6],ne[ce+7]=a[7]}function Z(X,ne,ce){n[0]=X,ne[ce]=a[7],ne[ce+1]=a[6],ne[ce+2]=a[5],ne[ce+3]=a[4],ne[ce+4]=a[3],ne[ce+5]=a[2],ne[ce+6]=a[1],ne[ce+7]=a[0]}O.writeDoubleLE=q?F:Z,O.writeDoubleBE=q?Z:F;function ee(X,ne){return a[0]=X[ne],a[1]=X[ne+1],a[2]=X[ne+2],a[3]=X[ne+3],a[4]=X[ne+4],a[5]=X[ne+5],a[6]=X[ne+6],a[7]=X[ne+7],n[0]}function te(X,ne){return a[7]=X[ne],a[6]=X[ne+1],a[5]=X[ne+2],a[4]=X[ne+3],a[3]=X[ne+4],a[2]=X[ne+5],a[1]=X[ne+6],a[0]=X[ne+7],n[0]}O.readDoubleLE=q?ee:te,O.readDoubleBE=q?te:ee}():function(){function n(q,F,Z,ee,te,X){var ne=ee<0?1:0;if(ne&&(ee=-ee),ee===0)q(0,te,X+F),q(1/ee>0?0:2147483648,te,X+Z);else if(isNaN(ee))q(0,te,X+F),q(2146959360,te,X+Z);else if(ee>17976931348623157e292)q(0,te,X+F),q((ne<<31|2146435072)>>>0,te,X+Z);else{var ce;if(ee<22250738585072014e-324)ce=ee/5e-324,q(ce>>>0,te,X+F),q((ne<<31|ce/4294967296)>>>0,te,X+Z);else{var oe=Math.floor(Math.log(ee)/Math.LN2);oe===1024&&(oe=1023),ce=ee*Math.pow(2,-oe),q(ce*4503599627370496>>>0,te,X+F),q((ne<<31|oe+1023<<20|ce*1048576&1048575)>>>0,te,X+Z)}}}O.writeDoubleLE=n.bind(null,J,0,4),O.writeDoubleBE=n.bind(null,N,4,0);function a(q,F,Z,ee,te){var X=q(ee,te+F),ne=q(ee,te+Z),ce=(ne>>31)*2+1,oe=ne>>>20&2047,se=4294967296*(ne&1048575)+X;return oe===2047?se?NaN:ce*(1/0):oe===0?ce*5e-324*se:ce*Math.pow(2,oe-1075)*(se+4503599627370496)}O.readDoubleLE=a.bind(null,z,0,4),O.readDoubleBE=a.bind(null,I,4,0)}(),O}function J(O,n,a){n[a]=O&255,n[a+1]=O>>>8&255,n[a+2]=O>>>16&255,n[a+3]=O>>>24}function N(O,n,a){n[a]=O>>>24,n[a+1]=O>>>16&255,n[a+2]=O>>>8&255,n[a+3]=O&255}function z(O,n){return(O[n]|O[n+1]<<8|O[n+2]<<16|O[n+3]<<24)>>>0}function I(O,n){return(O[n]<<24|O[n+1]<<16|O[n+2]<<8|O[n+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 J=D;J.length=function(z){for(var I=0,O=0,n=0;n<z.length;++n)O=z.charCodeAt(n),O<128?I+=1:O<2048?I+=2:(O&64512)===55296&&(z.charCodeAt(n+1)&64512)===56320?(++n,I+=4):I+=3;return I},J.read=function(z,I,O){var n=O-I;if(n<1)return"";for(var a=null,q=[],F=0,Z;I<O;)Z=z[I++],Z<128?q[F++]=Z:Z>191&&Z<224?q[F++]=(Z&31)<<6|z[I++]&63:Z>239&&Z<365?(Z=((Z&7)<<18|(z[I++]&63)<<12|(z[I++]&63)<<6|z[I++]&63)-65536,q[F++]=55296+(Z>>10),q[F++]=56320+(Z&1023)):q[F++]=(Z&15)<<12|(z[I++]&63)<<6|z[I++]&63,F>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,q)),F=0);return a?(F&&a.push(String.fromCharCode.apply(String,q.slice(0,F))),a.join("")):String.fromCharCode.apply(String,q.slice(0,F))},J.write=function(z,I,O){for(var n=O,a,q,F=0;F<z.length;++F)a=z.charCodeAt(F),a<128?I[O++]=a:a<2048?(I[O++]=a>>6|192,I[O++]=a&63|128):(a&64512)===55296&&((q=z.charCodeAt(F+1))&64512)===56320?(a=65536+((a&1023)<<10)+(q&1023),++F,I[O++]=a>>18|240,I[O++]=a>>12&63|128,I[O++]=a>>6&63|128,I[O++]=a&63|128):(I[O++]=a>>12|224,I[O++]=a>>6&63|128,I[O++]=a&63|128);return O-n}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=D;function D(J,N,z){var I=z||8192,O=I>>>1,n=null,a=I;return function(F){if(F<1||F>O)return J(F);a+F>I&&(n=J(I),a=0);var Z=N.call(n,a,a+=F);return a&7&&(a=(a|7)+1),Z}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=J;var D=requireMinimal$1();function J(O,n){this.lo=O>>>0,this.hi=n>>>0}var N=J.zero=new J(0,0);N.toNumber=function(){return 0},N.zzEncode=N.zzDecode=function(){return this},N.length=function(){return 1};var z=J.zeroHash="\0\0\0\0\0\0\0\0";J.fromNumber=function(n){if(n===0)return N;var a=n<0;a&&(n=-n);var q=n>>>0,F=(n-q)/4294967296>>>0;return a&&(F=~F>>>0,q=~q>>>0,++q>4294967295&&(q=0,++F>4294967295&&(F=0))),new J(q,F)},J.from=function(n){if(typeof n=="number")return J.fromNumber(n);if(D.isString(n))if(D.Long)n=D.Long.fromString(n);else return J.fromNumber(parseInt(n,10));return n.low||n.high?new J(n.low>>>0,n.high>>>0):N},J.prototype.toNumber=function(n){if(!n&&this.hi>>>31){var a=~this.lo+1>>>0,q=~this.hi>>>0;return a||(q=q+1>>>0),-(a+q*4294967296)}return this.lo+this.hi*4294967296},J.prototype.toLong=function(n){return D.Long?new D.Long(this.lo|0,this.hi|0,!!n):{low:this.lo|0,high:this.hi|0,unsigned:!!n}};var I=String.prototype.charCodeAt;return J.fromHash=function(n){return n===z?N:new J((I.call(n,0)|I.call(n,1)<<8|I.call(n,2)<<16|I.call(n,3)<<24)>>>0,(I.call(n,4)|I.call(n,5)<<8|I.call(n,6)<<16|I.call(n,7)<<24)>>>0)},J.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)},J.prototype.zzEncode=function(){var n=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^n)>>>0,this.lo=(this.lo<<1^n)>>>0,this},J.prototype.zzDecode=function(){var n=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^n)>>>0,this.hi=(this.hi>>>1^n)>>>0,this},J.prototype.length=function(){var n=this.lo,a=(this.lo>>>28|this.hi<<4)>>>0,q=this.hi>>>24;return q===0?a===0?n<16384?n<128?1:2:n<2097152?3:4:a<16384?a<128?5:6:a<2097152?7:8:q<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(D){var J=D;J.asPromise=requireAspromise(),J.base64=requireBase64(),J.EventEmitter=requireEventemitter(),J.float=requireFloat(),J.inquire=requireInquire(),J.utf8=requireUtf8(),J.pool=requirePool(),J.LongBits=requireLongbits(),J.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),J.global=J.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,J.emptyArray=Object.freeze?Object.freeze([]):[],J.emptyObject=Object.freeze?Object.freeze({}):{},J.isInteger=Number.isInteger||function(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O},J.isString=function(O){return typeof O=="string"||O instanceof String},J.isObject=function(O){return O&&typeof O=="object"},J.isset=J.isSet=function(O,n){var a=O[n];return a!=null&&O.hasOwnProperty(n)?typeof a!="object"||(Array.isArray(a)?a.length:Object.keys(a).length)>0:!1},J.Buffer=function(){try{var I=J.inquire("buffer").Buffer;return I.prototype.utf8Write?I:null}catch{return null}}(),J._Buffer_from=null,J._Buffer_allocUnsafe=null,J.newBuffer=function(O){return typeof O=="number"?J.Buffer?J._Buffer_allocUnsafe(O):new J.Array(O):J.Buffer?J._Buffer_from(O):typeof Uint8Array>"u"?O:new Uint8Array(O)},J.Array=typeof Uint8Array<"u"?Uint8Array:Array,J.Long=J.global.dcodeIO&&J.global.dcodeIO.Long||J.global.Long||J.inquire("long"),J.key2Re=/^true|false|0|1$/,J.key32Re=/^-?(?:0|[1-9][0-9]*)$/,J.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,J.longToHash=function(O){return O?J.LongBits.from(O).toHash():J.LongBits.zeroHash},J.longFromHash=function(O,n){var a=J.LongBits.fromHash(O);return J.Long?J.Long.fromBits(a.lo,a.hi,n):a.toNumber(!!n)};function N(I,O,n){for(var a=Object.keys(O),q=0;q<a.length;++q)(I[a[q]]===void 0||!n)&&(I[a[q]]=O[a[q]]);return I}J.merge=N,J.lcFirst=function(O){return O.charAt(0).toLowerCase()+O.substring(1)};function z(I){function O(n,a){if(!(this instanceof O))return new O(n,a);Object.defineProperty(this,"message",{get:function(){return n}}),Error.captureStackTrace?Error.captureStackTrace(this,O):Object.defineProperty(this,"stack",{value:new Error().stack||""}),a&&N(this,a)}return O.prototype=Object.create(Error.prototype,{constructor:{value:O,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return I},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),O}J.newError=z,J.ProtocolError=z("ProtocolError"),J.oneOfGetter=function(O){for(var n={},a=0;a<O.length;++a)n[O[a]]=1;return function(){for(var q=Object.keys(this),F=q.length-1;F>-1;--F)if(n[q[F]]===1&&this[q[F]]!==void 0&&this[q[F]]!==null)return q[F]}},J.oneOfSetter=function(O){return function(n){for(var a=0;a<O.length;++a)O[a]!==n&&delete this[O[a]]}},J.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},J._configure=function(){var I=J.Buffer;if(!I){J._Buffer_from=J._Buffer_allocUnsafe=null;return}J._Buffer_from=I.from!==Uint8Array.from&&I.from||function(n,a){return new I(n,a)},J._Buffer_allocUnsafe=I.allocUnsafe||function(n){return new I(n)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=q;var D=requireMinimal$1(),J,N=D.LongBits,z=D.base64,I=D.utf8;function O(oe,se,ye){this.fn=oe,this.len=se,this.next=void 0,this.val=ye}function n(){}function a(oe){this.head=oe.head,this.tail=oe.tail,this.len=oe.len,this.next=oe.states}function q(){this.len=0,this.head=new O(n,0,0),this.tail=this.head,this.states=null}var F=function(){return D.Buffer?function(){return(q.create=function(){return new J})()}:function(){return new q}};q.create=F(),q.alloc=function(se){return new D.Array(se)},D.Array!==Array&&(q.alloc=D.pool(q.alloc,D.Array.prototype.subarray)),q.prototype._push=function(se,ye,ke){return this.tail=this.tail.next=new O(se,ye,ke),this.len+=ye,this};function Z(oe,se,ye){se[ye]=oe&255}function ee(oe,se,ye){for(;oe>127;)se[ye++]=oe&127|128,oe>>>=7;se[ye]=oe}function te(oe,se){this.len=oe,this.next=void 0,this.val=se}te.prototype=Object.create(O.prototype),te.prototype.fn=ee,q.prototype.uint32=function(se){return this.len+=(this.tail=this.tail.next=new te((se=se>>>0)<128?1:se<16384?2:se<2097152?3:se<268435456?4:5,se)).len,this},q.prototype.int32=function(se){return se<0?this._push(X,10,N.fromNumber(se)):this.uint32(se)},q.prototype.sint32=function(se){return this.uint32((se<<1^se>>31)>>>0)};function X(oe,se,ye){for(;oe.hi;)se[ye++]=oe.lo&127|128,oe.lo=(oe.lo>>>7|oe.hi<<25)>>>0,oe.hi>>>=7;for(;oe.lo>127;)se[ye++]=oe.lo&127|128,oe.lo=oe.lo>>>7;se[ye++]=oe.lo}q.prototype.uint64=function(se){var ye=N.from(se);return this._push(X,ye.length(),ye)},q.prototype.int64=q.prototype.uint64,q.prototype.sint64=function(se){var ye=N.from(se).zzEncode();return this._push(X,ye.length(),ye)},q.prototype.bool=function(se){return this._push(Z,1,se?1:0)};function ne(oe,se,ye){se[ye]=oe&255,se[ye+1]=oe>>>8&255,se[ye+2]=oe>>>16&255,se[ye+3]=oe>>>24}q.prototype.fixed32=function(se){return this._push(ne,4,se>>>0)},q.prototype.sfixed32=q.prototype.fixed32,q.prototype.fixed64=function(se){var ye=N.from(se);return this._push(ne,4,ye.lo)._push(ne,4,ye.hi)},q.prototype.sfixed64=q.prototype.fixed64,q.prototype.float=function(se){return this._push(D.float.writeFloatLE,4,se)},q.prototype.double=function(se){return this._push(D.float.writeDoubleLE,8,se)};var ce=D.Array.prototype.set?function(se,ye,ke){ye.set(se,ke)}:function(se,ye,ke){for(var ae=0;ae<se.length;++ae)ye[ke+ae]=se[ae]};return q.prototype.bytes=function(se){var ye=se.length>>>0;if(!ye)return this._push(Z,1,0);if(D.isString(se)){var ke=q.alloc(ye=z.length(se));z.decode(se,ke,0),se=ke}return this.uint32(ye)._push(ce,ye,se)},q.prototype.string=function(se){var ye=I.length(se);return ye?this.uint32(ye)._push(I.write,ye,se):this._push(Z,1,0)},q.prototype.fork=function(){return this.states=new a(this),this.head=this.tail=new O(n,0,0),this.len=0,this},q.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 O(n,0,0),this.len=0),this},q.prototype.ldelim=function(){var se=this.head,ye=this.tail,ke=this.len;return this.reset().uint32(ke),ke&&(this.tail.next=se.next,this.tail=ye,this.len+=ke),this},q.prototype.finish=function(){for(var se=this.head.next,ye=this.constructor.alloc(this.len),ke=0;se;)se.fn(se.val,ye,ke),ke+=se.len,se=se.next;return ye},q._configure=function(oe){J=oe,q.create=F(),J._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=N;var D=requireWriter();(N.prototype=Object.create(D.prototype)).constructor=N;var J=requireMinimal$1();function N(){D.call(this)}N._configure=function(){N.alloc=J._Buffer_allocUnsafe,N.writeBytesBuffer=J.Buffer&&J.Buffer.prototype instanceof Uint8Array&&J.Buffer.prototype.set.name==="set"?function(O,n,a){n.set(O,a)}:function(O,n,a){if(O.copy)O.copy(n,a,0,O.length);else for(var q=0;q<O.length;)n[a++]=O[q++]}},N.prototype.bytes=function(O){J.isString(O)&&(O=J._Buffer_from(O,"base64"));var n=O.length>>>0;return this.uint32(n),n&&this._push(N.writeBytesBuffer,n,O),this};function z(I,O,n){I.length<40?J.utf8.write(I,O,n):O.utf8Write?O.utf8Write(I,n):O.write(I,n)}return N.prototype.string=function(O){var n=J.Buffer.byteLength(O);return this.uint32(n),n&&this._push(z,n,O),this},N._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=O;var D=requireMinimal$1(),J,N=D.LongBits,z=D.utf8;function I(ee,te){return RangeError("index out of range: "+ee.pos+" + "+(te||1)+" > "+ee.len)}function O(ee){this.buf=ee,this.pos=0,this.len=ee.length}var n=typeof Uint8Array<"u"?function(te){if(te instanceof Uint8Array||Array.isArray(te))return new O(te);throw Error("illegal buffer")}:function(te){if(Array.isArray(te))return new O(te);throw Error("illegal buffer")},a=function(){return D.Buffer?function(X){return(O.create=function(ce){return D.Buffer.isBuffer(ce)?new J(ce):n(ce)})(X)}:n};O.create=a(),O.prototype._slice=D.Array.prototype.subarray||D.Array.prototype.slice,O.prototype.uint32=function(){var te=4294967295;return function(){if(te=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(te=(te|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(te=(te|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(te=(te|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(te=(te|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return te;if((this.pos+=5)>this.len)throw this.pos=this.len,I(this,10);return te}}(),O.prototype.int32=function(){return this.uint32()|0},O.prototype.sint32=function(){var te=this.uint32();return te>>>1^-(te&1)|0};function q(){var ee=new N(0,0),te=0;if(this.len-this.pos>4){for(;te<4;++te)if(ee.lo=(ee.lo|(this.buf[this.pos]&127)<<te*7)>>>0,this.buf[this.pos++]<128)return ee;if(ee.lo=(ee.lo|(this.buf[this.pos]&127)<<28)>>>0,ee.hi=(ee.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return ee;te=0}else{for(;te<3;++te){if(this.pos>=this.len)throw I(this);if(ee.lo=(ee.lo|(this.buf[this.pos]&127)<<te*7)>>>0,this.buf[this.pos++]<128)return ee}return ee.lo=(ee.lo|(this.buf[this.pos++]&127)<<te*7)>>>0,ee}if(this.len-this.pos>4){for(;te<5;++te)if(ee.hi=(ee.hi|(this.buf[this.pos]&127)<<te*7+3)>>>0,this.buf[this.pos++]<128)return ee}else for(;te<5;++te){if(this.pos>=this.len)throw I(this);if(ee.hi=(ee.hi|(this.buf[this.pos]&127)<<te*7+3)>>>0,this.buf[this.pos++]<128)return ee}throw Error("invalid varint encoding")}O.prototype.bool=function(){return this.uint32()!==0};function F(ee,te){return(ee[te-4]|ee[te-3]<<8|ee[te-2]<<16|ee[te-1]<<24)>>>0}O.prototype.fixed32=function(){if(this.pos+4>this.len)throw I(this,4);return F(this.buf,this.pos+=4)},O.prototype.sfixed32=function(){if(this.pos+4>this.len)throw I(this,4);return F(this.buf,this.pos+=4)|0};function Z(){if(this.pos+8>this.len)throw I(this,8);return new N(F(this.buf,this.pos+=4),F(this.buf,this.pos+=4))}return O.prototype.float=function(){if(this.pos+4>this.len)throw I(this,4);var te=D.float.readFloatLE(this.buf,this.pos);return this.pos+=4,te},O.prototype.double=function(){if(this.pos+8>this.len)throw I(this,4);var te=D.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,te},O.prototype.bytes=function(){var te=this.uint32(),X=this.pos,ne=this.pos+te;if(ne>this.len)throw I(this,te);if(this.pos+=te,Array.isArray(this.buf))return this.buf.slice(X,ne);if(X===ne){var ce=D.Buffer;return ce?ce.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,X,ne)},O.prototype.string=function(){var te=this.bytes();return z.read(te,0,te.length)},O.prototype.skip=function(te){if(typeof te=="number"){if(this.pos+te>this.len)throw I(this,te);this.pos+=te}else do if(this.pos>=this.len)throw I(this);while(this.buf[this.pos++]&128);return this},O.prototype.skipType=function(ee){switch(ee){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(ee=this.uint32()&7)!==4;)this.skipType(ee);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+ee+" at offset "+this.pos)}return this},O._configure=function(ee){J=ee,O.create=a(),J._configure();var te=D.Long?"toLong":"toNumber";D.merge(O.prototype,{int64:function(){return q.call(this)[te](!1)},uint64:function(){return q.call(this)[te](!0)},sint64:function(){return q.call(this).zzDecode()[te](!1)},fixed64:function(){return Z.call(this)[te](!0)},sfixed64:function(){return Z.call(this)[te](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=N;var D=requireReader();(N.prototype=Object.create(D.prototype)).constructor=N;var J=requireMinimal$1();function N(z){D.call(this,z)}return N._configure=function(){J.Buffer&&(N.prototype._slice=J.Buffer.prototype.slice)},N.prototype.string=function(){var I=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+I,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+I,this.len))},N._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=J;var D=requireMinimal$1();(J.prototype=Object.create(D.EventEmitter.prototype)).constructor=J;function J(N,z,I){if(typeof N!="function")throw TypeError("rpcImpl must be a function");D.EventEmitter.call(this),this.rpcImpl=N,this.requestDelimited=!!z,this.responseDelimited=!!I}return J.prototype.rpcCall=function N(z,I,O,n,a){if(!n)throw TypeError("request must be specified");var q=this;if(!a)return D.asPromise(N,q,z,I,O,n);if(!q.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return q.rpcImpl(z,I[q.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(Z,ee){if(Z)return q.emit("error",Z,z),a(Z);if(ee===null){q.end(!0);return}if(!(ee instanceof O))try{ee=O[q.responseDelimited?"decodeDelimited":"decode"](ee)}catch(te){return q.emit("error",te,z),a(te)}return q.emit("data",ee,z),a(null,ee)})}catch(F){q.emit("error",F,z),setTimeout(function(){a(F)},0);return}},J.prototype.end=function(z){return this.rpcImpl&&(z||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 J=D;J.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 J=D;J.build="minimal",J.Writer=requireWriter(),J.BufferWriter=requireWriter_buffer(),J.Reader=requireReader(),J.BufferReader=requireReader_buffer(),J.util=requireMinimal$1(),J.rpc=requireRpc(),J.roots=requireRoots(),J.configure=N;function N(){J.util._configure(),J.Writer._configure(J.BufferWriter),J.Reader._configure(J.BufferReader)}N()}(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 J={};return J.voice=function(){const N={};return N.proto=function(){const z={};return z.CommonReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.event="",I.prototype.data=$util.newBuffer([]),I.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.version=0,I.prototype.compress=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.event!=null&&Object.hasOwnProperty.call(n,"event")&&a.uint32(10).string(n.event),n.data!=null&&Object.hasOwnProperty.call(n,"data")&&a.uint32(18).bytes(n.data),n.sn!=null&&Object.hasOwnProperty.call(n,"sn")&&a.uint32(24).int64(n.sn),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(32).int64(n.time),n.valid!=null&&Object.hasOwnProperty.call(n,"valid")&&a.uint32(40).int64(n.valid),n.version!=null&&Object.hasOwnProperty.call(n,"version")&&a.uint32(48).int32(n.version),n.compress!=null&&Object.hasOwnProperty.call(n,"compress")&&a.uint32(56).bool(n.compress),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CommonReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.event=n.string();break}case 2:{F.data=n.bytes();break}case 3:{F.sn=n.int64();break}case 4:{F.time=n.int64();break}case 5:{F.valid=n.int64();break}case 6:{F.version=n.int32();break}case 7:{F.compress=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.event!=null&&n.hasOwnProperty("event")&&!$util.isString(n.event)?"event: string expected":n.data!=null&&n.hasOwnProperty("data")&&!(n.data&&typeof n.data.length=="number"||$util.isString(n.data))?"data: buffer expected":n.sn!=null&&n.hasOwnProperty("sn")&&!$util.isInteger(n.sn)&&!(n.sn&&$util.isInteger(n.sn.low)&&$util.isInteger(n.sn.high))?"sn: integer|Long expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":n.valid!=null&&n.hasOwnProperty("valid")&&!$util.isInteger(n.valid)&&!(n.valid&&$util.isInteger(n.valid.low)&&$util.isInteger(n.valid.high))?"valid: integer|Long expected":n.version!=null&&n.hasOwnProperty("version")&&!$util.isInteger(n.version)?"version: integer expected":n.compress!=null&&n.hasOwnProperty("compress")&&typeof n.compress!="boolean"?"compress: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CommonReq)return n;let a=new $root.com.quick.voice.proto.CommonReq;return n.event!=null&&(a.event=String(n.event)),n.data!=null&&(typeof n.data=="string"?$util.base64.decode(n.data,a.data=$util.newBuffer($util.base64.length(n.data)),0):n.data.length>=0&&(a.data=n.data)),n.sn!=null&&($util.Long?(a.sn=$util.Long.fromValue(n.sn)).unsigned=!1:typeof n.sn=="string"?a.sn=parseInt(n.sn,10):typeof n.sn=="number"?a.sn=n.sn:typeof n.sn=="object"&&(a.sn=new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber())),n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),n.valid!=null&&($util.Long?(a.valid=$util.Long.fromValue(n.valid)).unsigned=!1:typeof n.valid=="string"?a.valid=parseInt(n.valid,10):typeof n.valid=="number"?a.valid=n.valid:typeof n.valid=="object"&&(a.valid=new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber())),n.version!=null&&(a.version=n.version|0),n.compress!=null&&(a.compress=!!n.compress),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults){if(q.event="",a.bytes===String?q.data="":(q.data=[],a.bytes!==Array&&(q.data=$util.newBuffer(q.data))),$util.Long){let F=new $util.Long(0,0,!1);q.sn=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.sn=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.valid=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.valid=a.longs===String?"0":0;q.version=0,q.compress=!1}return n.event!=null&&n.hasOwnProperty("event")&&(q.event=n.event),n.data!=null&&n.hasOwnProperty("data")&&(q.data=a.bytes===String?$util.base64.encode(n.data,0,n.data.length):a.bytes===Array?Array.prototype.slice.call(n.data):n.data),n.sn!=null&&n.hasOwnProperty("sn")&&(typeof n.sn=="number"?q.sn=a.longs===String?String(n.sn):n.sn:q.sn=a.longs===String?$util.Long.prototype.toString.call(n.sn):a.longs===Number?new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber():n.sn),n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),n.valid!=null&&n.hasOwnProperty("valid")&&(typeof n.valid=="number"?q.valid=a.longs===String?String(n.valid):n.valid:q.valid=a.longs===String?$util.Long.prototype.toString.call(n.valid):a.longs===Number?new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber():n.valid),n.version!=null&&n.hasOwnProperty("version")&&(q.version=n.version),n.compress!=null&&n.hasOwnProperty("compress")&&(q.compress=n.compress),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CommonReq"},I}(),z.CommonRsp=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.event="",I.prototype.data=$util.newBuffer([]),I.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.code=0,I.prototype.desc="",I.prototype.version=0,I.prototype.compress=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.event!=null&&Object.hasOwnProperty.call(n,"event")&&a.uint32(10).string(n.event),n.data!=null&&Object.hasOwnProperty.call(n,"data")&&a.uint32(18).bytes(n.data),n.sn!=null&&Object.hasOwnProperty.call(n,"sn")&&a.uint32(24).int64(n.sn),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(32).int64(n.time),n.valid!=null&&Object.hasOwnProperty.call(n,"valid")&&a.uint32(40).int64(n.valid),n.code!=null&&Object.hasOwnProperty.call(n,"code")&&a.uint32(48).int32(n.code),n.desc!=null&&Object.hasOwnProperty.call(n,"desc")&&a.uint32(58).string(n.desc),n.version!=null&&Object.hasOwnProperty.call(n,"version")&&a.uint32(64).int32(n.version),n.compress!=null&&Object.hasOwnProperty.call(n,"compress")&&a.uint32(72).bool(n.compress),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CommonRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.event=n.string();break}case 2:{F.data=n.bytes();break}case 3:{F.sn=n.int64();break}case 4:{F.time=n.int64();break}case 5:{F.valid=n.int64();break}case 6:{F.code=n.int32();break}case 7:{F.desc=n.string();break}case 8:{F.version=n.int32();break}case 9:{F.compress=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.event!=null&&n.hasOwnProperty("event")&&!$util.isString(n.event)?"event: string expected":n.data!=null&&n.hasOwnProperty("data")&&!(n.data&&typeof n.data.length=="number"||$util.isString(n.data))?"data: buffer expected":n.sn!=null&&n.hasOwnProperty("sn")&&!$util.isInteger(n.sn)&&!(n.sn&&$util.isInteger(n.sn.low)&&$util.isInteger(n.sn.high))?"sn: integer|Long expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":n.valid!=null&&n.hasOwnProperty("valid")&&!$util.isInteger(n.valid)&&!(n.valid&&$util.isInteger(n.valid.low)&&$util.isInteger(n.valid.high))?"valid: integer|Long expected":n.code!=null&&n.hasOwnProperty("code")&&!$util.isInteger(n.code)?"code: integer expected":n.desc!=null&&n.hasOwnProperty("desc")&&!$util.isString(n.desc)?"desc: string expected":n.version!=null&&n.hasOwnProperty("version")&&!$util.isInteger(n.version)?"version: integer expected":n.compress!=null&&n.hasOwnProperty("compress")&&typeof n.compress!="boolean"?"compress: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CommonRsp)return n;let a=new $root.com.quick.voice.proto.CommonRsp;return n.event!=null&&(a.event=String(n.event)),n.data!=null&&(typeof n.data=="string"?$util.base64.decode(n.data,a.data=$util.newBuffer($util.base64.length(n.data)),0):n.data.length>=0&&(a.data=n.data)),n.sn!=null&&($util.Long?(a.sn=$util.Long.fromValue(n.sn)).unsigned=!1:typeof n.sn=="string"?a.sn=parseInt(n.sn,10):typeof n.sn=="number"?a.sn=n.sn:typeof n.sn=="object"&&(a.sn=new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber())),n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),n.valid!=null&&($util.Long?(a.valid=$util.Long.fromValue(n.valid)).unsigned=!1:typeof n.valid=="string"?a.valid=parseInt(n.valid,10):typeof n.valid=="number"?a.valid=n.valid:typeof n.valid=="object"&&(a.valid=new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber())),n.code!=null&&(a.code=n.code|0),n.desc!=null&&(a.desc=String(n.desc)),n.version!=null&&(a.version=n.version|0),n.compress!=null&&(a.compress=!!n.compress),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults){if(q.event="",a.bytes===String?q.data="":(q.data=[],a.bytes!==Array&&(q.data=$util.newBuffer(q.data))),$util.Long){let F=new $util.Long(0,0,!1);q.sn=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.sn=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;if($util.Long){let F=new $util.Long(0,0,!1);q.valid=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.valid=a.longs===String?"0":0;q.code=0,q.desc="",q.version=0,q.compress=!1}return n.event!=null&&n.hasOwnProperty("event")&&(q.event=n.event),n.data!=null&&n.hasOwnProperty("data")&&(q.data=a.bytes===String?$util.base64.encode(n.data,0,n.data.length):a.bytes===Array?Array.prototype.slice.call(n.data):n.data),n.sn!=null&&n.hasOwnProperty("sn")&&(typeof n.sn=="number"?q.sn=a.longs===String?String(n.sn):n.sn:q.sn=a.longs===String?$util.Long.prototype.toString.call(n.sn):a.longs===Number?new $util.LongBits(n.sn.low>>>0,n.sn.high>>>0).toNumber():n.sn),n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),n.valid!=null&&n.hasOwnProperty("valid")&&(typeof n.valid=="number"?q.valid=a.longs===String?String(n.valid):n.valid:q.valid=a.longs===String?$util.Long.prototype.toString.call(n.valid):a.longs===Number?new $util.LongBits(n.valid.low>>>0,n.valid.high>>>0).toNumber():n.valid),n.code!=null&&n.hasOwnProperty("code")&&(q.code=n.code),n.desc!=null&&n.hasOwnProperty("desc")&&(q.desc=n.desc),n.version!=null&&n.hasOwnProperty("version")&&(q.version=n.version),n.compress!=null&&n.hasOwnProperty("compress")&&(q.compress=n.compress),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CommonRsp"},I}(),z.User=function(){function I(n){if(this.tracks=[],n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.id="",I.prototype.callAction=null,I.prototype.callState=null,I.prototype.joinTime=null,I.prototype.tracks=$util.emptyArray,I.prototype.permissions=null,I.prototype.isPublished=null,I.prototype.behavior=null,I.prototype.channelCache=null;let O;return Object.defineProperty(I.prototype,"_callAction",{get:$util.oneOfGetter(O=["callAction"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_callState",{get:$util.oneOfGetter(O=["callState"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_joinTime",{get:$util.oneOfGetter(O=["joinTime"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_permissions",{get:$util.oneOfGetter(O=["permissions"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_isPublished",{get:$util.oneOfGetter(O=["isPublished"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_behavior",{get:$util.oneOfGetter(O=["behavior"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_channelCache",{get:$util.oneOfGetter(O=["channelCache"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){if(q||(q=$Writer.create()),a.id!=null&&Object.hasOwnProperty.call(a,"id")&&q.uint32(10).string(a.id),a.callAction!=null&&Object.hasOwnProperty.call(a,"callAction")&&q.uint32(16).int32(a.callAction),a.callState!=null&&Object.hasOwnProperty.call(a,"callState")&&q.uint32(24).int32(a.callState),a.joinTime!=null&&Object.hasOwnProperty.call(a,"joinTime")&&q.uint32(32).int64(a.joinTime),a.tracks!=null&&a.tracks.length)for(let F=0;F<a.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(a.tracks[F],q.uint32(42).fork()).ldelim();return a.permissions!=null&&Object.hasOwnProperty.call(a,"permissions")&&q.uint32(48).int32(a.permissions),a.isPublished!=null&&Object.hasOwnProperty.call(a,"isPublished")&&q.uint32(56).bool(a.isPublished),a.behavior!=null&&Object.hasOwnProperty.call(a,"behavior")&&q.uint32(64).int32(a.behavior),a.channelCache!=null&&Object.hasOwnProperty.call(a,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(a.channelCache,q.uint32(74).fork()).ldelim(),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.User;for(;a.pos<F;){let ee=a.uint32();switch(ee>>>3){case 1:{Z.id=a.string();break}case 2:{Z.callAction=a.int32();break}case 3:{Z.callState=a.int32();break}case 4:{Z.joinTime=a.int64();break}case 5:{Z.tracks&&Z.tracks.length||(Z.tracks=[]),Z.tracks.push($root.com.quick.voice.proto.Track.decode(a,a.uint32()));break}case 6:{Z.permissions=a.int32();break}case 7:{Z.isPublished=a.bool();break}case 8:{Z.behavior=a.int32();break}case 9:{Z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(a,a.uint32());break}default:a.skipType(ee&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.id!=null&&a.hasOwnProperty("id")&&!$util.isString(a.id))return"id: string expected";if(a.callAction!=null&&a.hasOwnProperty("callAction")&&!$util.isInteger(a.callAction))return"callAction: integer expected";if(a.callState!=null&&a.hasOwnProperty("callState")&&!$util.isInteger(a.callState))return"callState: integer expected";if(a.joinTime!=null&&a.hasOwnProperty("joinTime")&&!$util.isInteger(a.joinTime)&&!(a.joinTime&&$util.isInteger(a.joinTime.low)&&$util.isInteger(a.joinTime.high)))return"joinTime: integer|Long expected";if(a.tracks!=null&&a.hasOwnProperty("tracks")){if(!Array.isArray(a.tracks))return"tracks: array expected";for(let q=0;q<a.tracks.length;++q){let F=$root.com.quick.voice.proto.Track.verify(a.tracks[q]);if(F)return"tracks."+F}}if(a.permissions!=null&&a.hasOwnProperty("permissions")&&!$util.isInteger(a.permissions))return"permissions: integer expected";if(a.isPublished!=null&&a.hasOwnProperty("isPublished")&&typeof a.isPublished!="boolean")return"isPublished: boolean expected";if(a.behavior!=null&&a.hasOwnProperty("behavior")&&!$util.isInteger(a.behavior))return"behavior: integer expected";if(a.channelCache!=null&&a.hasOwnProperty("channelCache")){let q=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(a.channelCache);if(q)return"channelCache."+q}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.User)return a;let q=new $root.com.quick.voice.proto.User;if(a.id!=null&&(q.id=String(a.id)),a.callAction!=null&&(q.callAction=a.callAction|0),a.callState!=null&&(q.callState=a.callState|0),a.joinTime!=null&&($util.Long?(q.joinTime=$util.Long.fromValue(a.joinTime)).unsigned=!1:typeof a.joinTime=="string"?q.joinTime=parseInt(a.joinTime,10):typeof a.joinTime=="number"?q.joinTime=a.joinTime:typeof a.joinTime=="object"&&(q.joinTime=new $util.LongBits(a.joinTime.low>>>0,a.joinTime.high>>>0).toNumber())),a.tracks){if(!Array.isArray(a.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");q.tracks=[];for(let F=0;F<a.tracks.length;++F){if(typeof a.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");q.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(a.tracks[F])}}if(a.permissions!=null&&(q.permissions=a.permissions|0),a.isPublished!=null&&(q.isPublished=!!a.isPublished),a.behavior!=null&&(q.behavior=a.behavior|0),a.channelCache!=null){if(typeof a.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");q.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(a.channelCache)}return q},I.toObject=function(a,q){q||(q={});let F={};if((q.arrays||q.defaults)&&(F.tracks=[]),q.defaults&&(F.id=""),a.id!=null&&a.hasOwnProperty("id")&&(F.id=a.id),a.callAction!=null&&a.hasOwnProperty("callAction")&&(F.callAction=a.callAction,q.oneofs&&(F._callAction="callAction")),a.callState!=null&&a.hasOwnProperty("callState")&&(F.callState=a.callState,q.oneofs&&(F._callState="callState")),a.joinTime!=null&&a.hasOwnProperty("joinTime")&&(typeof a.joinTime=="number"?F.joinTime=q.longs===String?String(a.joinTime):a.joinTime:F.joinTime=q.longs===String?$util.Long.prototype.toString.call(a.joinTime):q.longs===Number?new $util.LongBits(a.joinTime.low>>>0,a.joinTime.high>>>0).toNumber():a.joinTime,q.oneofs&&(F._joinTime="joinTime")),a.tracks&&a.tracks.length){F.tracks=[];for(let Z=0;Z<a.tracks.length;++Z)F.tracks[Z]=$root.com.quick.voice.proto.Track.toObject(a.tracks[Z],q)}return a.permissions!=null&&a.hasOwnProperty("permissions")&&(F.permissions=a.permissions,q.oneofs&&(F._permissions="permissions")),a.isPublished!=null&&a.hasOwnProperty("isPublished")&&(F.isPublished=a.isPublished,q.oneofs&&(F._isPublished="isPublished")),a.behavior!=null&&a.hasOwnProperty("behavior")&&(F.behavior=a.behavior,q.oneofs&&(F._behavior="behavior")),a.channelCache!=null&&a.hasOwnProperty("channelCache")&&(F.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(a.channelCache,q),q.oneofs&&(F._channelCache="channelCache")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.User"},I}(),z.DataChannelCacheInfo=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.DataChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return n;let a=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.DataChannelCacheInfo"},I}(),z.DataChannel=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.dataChannelName="",I.prototype.id=null;let O;return Object.defineProperty(I.prototype,"_id",{get:$util.oneOfGetter(O=["id"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.dataChannelName!=null&&Object.hasOwnProperty.call(a,"dataChannelName")&&q.uint32(10).string(a.dataChannelName),a.id!=null&&Object.hasOwnProperty.call(a,"id")&&q.uint32(16).int32(a.id),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.DataChannel;for(;a.pos<F;){let ee=a.uint32();switch(ee>>>3){case 1:{Z.dataChannelName=a.string();break}case 2:{Z.id=a.int32();break}default:a.skipType(ee&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){return typeof a!="object"||a===null?"object expected":a.dataChannelName!=null&&a.hasOwnProperty("dataChannelName")&&!$util.isString(a.dataChannelName)?"dataChannelName: string expected":a.id!=null&&a.hasOwnProperty("id")&&!$util.isInteger(a.id)?"id: integer expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.DataChannel)return a;let q=new $root.com.quick.voice.proto.DataChannel;return a.dataChannelName!=null&&(q.dataChannelName=String(a.dataChannelName)),a.id!=null&&(q.id=a.id|0),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.dataChannelName=""),a.dataChannelName!=null&&a.hasOwnProperty("dataChannelName")&&(F.dataChannelName=a.dataChannelName),a.id!=null&&a.hasOwnProperty("id")&&(F.id=a.id,q.oneofs&&(F._id="id")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.DataChannel"},I}(),z.Login=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.appid="",I.prototype.userId="",I.prototype.sdkToken="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.appid!=null&&Object.hasOwnProperty.call(n,"appid")&&a.uint32(10).string(n.appid),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(18).string(n.userId),n.sdkToken!=null&&Object.hasOwnProperty.call(n,"sdkToken")&&a.uint32(26).string(n.sdkToken),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.Login;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.appid=n.string();break}case 2:{F.userId=n.string();break}case 3:{F.sdkToken=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.appid!=null&&n.hasOwnProperty("appid")&&!$util.isString(n.appid)?"appid: string expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&!$util.isString(n.sdkToken)?"sdkToken: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.Login)return n;let a=new $root.com.quick.voice.proto.Login;return n.appid!=null&&(a.appid=String(n.appid)),n.userId!=null&&(a.userId=String(n.userId)),n.sdkToken!=null&&(a.sdkToken=String(n.sdkToken)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.appid="",q.userId="",q.sdkToken=""),n.appid!=null&&n.hasOwnProperty("appid")&&(q.appid=n.appid),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&(q.sdkToken=n.sdkToken),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.Login"},I}(),z.Track=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.mid="",I.prototype.trackName=null,I.prototype.location=null,I.prototype.userId=null,I.prototype.code=null,I.prototype.desc=null,I.prototype.type=null,I.prototype.isValid=null,I.prototype.simulcast=null;let O;return Object.defineProperty(I.prototype,"_trackName",{get:$util.oneOfGetter(O=["trackName"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_location",{get:$util.oneOfGetter(O=["location"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_userId",{get:$util.oneOfGetter(O=["userId"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_code",{get:$util.oneOfGetter(O=["code"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_desc",{get:$util.oneOfGetter(O=["desc"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_type",{get:$util.oneOfGetter(O=["type"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_isValid",{get:$util.oneOfGetter(O=["isValid"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_simulcast",{get:$util.oneOfGetter(O=["simulcast"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.mid!=null&&Object.hasOwnProperty.call(a,"mid")&&q.uint32(10).string(a.mid),a.trackName!=null&&Object.hasOwnProperty.call(a,"trackName")&&q.uint32(18).string(a.trackName),a.location!=null&&Object.hasOwnProperty.call(a,"location")&&q.uint32(26).string(a.location),a.userId!=null&&Object.hasOwnProperty.call(a,"userId")&&q.uint32(34).string(a.userId),a.code!=null&&Object.hasOwnProperty.call(a,"code")&&q.uint32(40).int32(a.code),a.desc!=null&&Object.hasOwnProperty.call(a,"desc")&&q.uint32(50).string(a.desc),a.type!=null&&Object.hasOwnProperty.call(a,"type")&&q.uint32(56).int32(a.type),a.isValid!=null&&Object.hasOwnProperty.call(a,"isValid")&&q.uint32(64).bool(a.isValid),a.simulcast!=null&&Object.hasOwnProperty.call(a,"simulcast")&&q.uint32(74).string(a.simulcast),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.Track;for(;a.pos<F;){let ee=a.uint32();switch(ee>>>3){case 1:{Z.mid=a.string();break}case 2:{Z.trackName=a.string();break}case 3:{Z.location=a.string();break}case 4:{Z.userId=a.string();break}case 5:{Z.code=a.int32();break}case 6:{Z.desc=a.string();break}case 7:{Z.type=a.int32();break}case 8:{Z.isValid=a.bool();break}case 9:{Z.simulcast=a.string();break}default:a.skipType(ee&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.mid!=null&&a.hasOwnProperty("mid")&&!$util.isString(a.mid))return"mid: string expected";if(a.trackName!=null&&a.hasOwnProperty("trackName")&&!$util.isString(a.trackName))return"trackName: string expected";if(a.location!=null&&a.hasOwnProperty("location")&&!$util.isString(a.location))return"location: string expected";if(a.userId!=null&&a.hasOwnProperty("userId")&&!$util.isString(a.userId))return"userId: string expected";if(a.code!=null&&a.hasOwnProperty("code")&&!$util.isInteger(a.code))return"code: integer expected";if(a.desc!=null&&a.hasOwnProperty("desc")&&!$util.isString(a.desc))return"desc: string expected";if(a.type!=null&&a.hasOwnProperty("type"))switch(a.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return a.isValid!=null&&a.hasOwnProperty("isValid")&&typeof a.isValid!="boolean"?"isValid: boolean expected":a.simulcast!=null&&a.hasOwnProperty("simulcast")&&!$util.isString(a.simulcast)?"simulcast: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.Track)return a;let q=new $root.com.quick.voice.proto.Track;switch(a.mid!=null&&(q.mid=String(a.mid)),a.trackName!=null&&(q.trackName=String(a.trackName)),a.location!=null&&(q.location=String(a.location)),a.userId!=null&&(q.userId=String(a.userId)),a.code!=null&&(q.code=a.code|0),a.desc!=null&&(q.desc=String(a.desc)),a.type){default:if(typeof a.type=="number"){q.type=a.type;break}break;case"Microphone":case 0:q.type=0;break;case"Camera":case 1:q.type=1;break;case"Screen":case 2:q.type=2;break;case"SystemVoice":case 3:q.type=3;break}return a.isValid!=null&&(q.isValid=!!a.isValid),a.simulcast!=null&&(q.simulcast=String(a.simulcast)),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.mid=""),a.mid!=null&&a.hasOwnProperty("mid")&&(F.mid=a.mid),a.trackName!=null&&a.hasOwnProperty("trackName")&&(F.trackName=a.trackName,q.oneofs&&(F._trackName="trackName")),a.location!=null&&a.hasOwnProperty("location")&&(F.location=a.location,q.oneofs&&(F._location="location")),a.userId!=null&&a.hasOwnProperty("userId")&&(F.userId=a.userId,q.oneofs&&(F._userId="userId")),a.code!=null&&a.hasOwnProperty("code")&&(F.code=a.code,q.oneofs&&(F._code="code")),a.desc!=null&&a.hasOwnProperty("desc")&&(F.desc=a.desc,q.oneofs&&(F._desc="desc")),a.type!=null&&a.hasOwnProperty("type")&&(F.type=q.enums===String?$root.com.quick.voice.proto.TrackType[a.type]===void 0?a.type:$root.com.quick.voice.proto.TrackType[a.type]:a.type,q.oneofs&&(F._type="type")),a.isValid!=null&&a.hasOwnProperty("isValid")&&(F.isValid=a.isValid,q.oneofs&&(F._isValid="isValid")),a.simulcast!=null&&a.hasOwnProperty("simulcast")&&(F.simulcast=a.simulcast,q.oneofs&&(F._simulcast="simulcast")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.Track"},I}(),z.JoinReq=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.roomId="",I.prototype.user=null,I.prototype.callType=0,I.prototype.token=null;let O;return Object.defineProperty(I.prototype,"_token",{get:$util.oneOfGetter(O=["token"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&q.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,q.uint32(18).fork()).ldelim(),a.callType!=null&&Object.hasOwnProperty.call(a,"callType")&&q.uint32(24).int32(a.callType),a.token!=null&&Object.hasOwnProperty.call(a,"token")&&q.uint32(34).string(a.token),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.JoinReq;for(;a.pos<F;){let ee=a.uint32();switch(ee>>>3){case 1:{Z.roomId=a.string();break}case 2:{Z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}case 3:{Z.callType=a.int32();break}case 4:{Z.token=a.string();break}default:a.skipType(ee&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let q=$root.com.quick.voice.proto.User.verify(a.user);if(q)return"user."+q}if(a.callType!=null&&a.hasOwnProperty("callType"))switch(a.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return a.token!=null&&a.hasOwnProperty("token")&&!$util.isString(a.token)?"token: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.JoinReq)return a;let q=new $root.com.quick.voice.proto.JoinReq;if(a.roomId!=null&&(q.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");q.user=$root.com.quick.voice.proto.User.fromObject(a.user)}switch(a.callType){default:if(typeof a.callType=="number"){q.callType=a.callType;break}break;case"Normal":case 0:q.callType=0;break;case"Meeting":case 1:q.callType=1;break;case"Live":case 2:q.callType=2;break}return a.token!=null&&(q.token=String(a.token)),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.roomId="",F.user=null,F.callType=q.enums===String?"Normal":0),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,q)),a.callType!=null&&a.hasOwnProperty("callType")&&(F.callType=q.enums===String?$root.com.quick.voice.proto.CallType[a.callType]===void 0?a.callType:$root.com.quick.voice.proto.CallType[a.callType]:a.callType),a.token!=null&&a.hasOwnProperty("token")&&(F.token=a.token,q.oneofs&&(F._token="token")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.JoinReq"},I}(),z.JoinRsp=function(){function I(O){if(this.roomUsers=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.roomUsers=$util.emptyArray,I.prototype.callType=0,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.roomUsers!=null&&n.roomUsers.length)for(let q=0;q<n.roomUsers.length;++q)$root.com.quick.voice.proto.User.encode(n.roomUsers[q],a.uint32(18).fork()).ldelim();return n.callType!=null&&Object.hasOwnProperty.call(n,"callType")&&a.uint32(24).int32(n.callType),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.JoinRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.roomUsers&&F.roomUsers.length||(F.roomUsers=[]),F.roomUsers.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}case 3:{F.callType=n.int32();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.roomUsers!=null&&n.hasOwnProperty("roomUsers")){if(!Array.isArray(n.roomUsers))return"roomUsers: array expected";for(let a=0;a<n.roomUsers.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.roomUsers[a]);if(q)return"roomUsers."+q}}if(n.callType!=null&&n.hasOwnProperty("callType"))switch(n.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.JoinRsp)return n;let a=new $root.com.quick.voice.proto.JoinRsp;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.roomUsers){if(!Array.isArray(n.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");a.roomUsers=[];for(let q=0;q<n.roomUsers.length;++q){if(typeof n.roomUsers[q]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");a.roomUsers[q]=$root.com.quick.voice.proto.User.fromObject(n.roomUsers[q])}}switch(n.callType){default:if(typeof n.callType=="number"){a.callType=n.callType;break}break;case"Normal":case 0:a.callType=0;break;case"Meeting":case 1:a.callType=1;break;case"Live":case 2:a.callType=2;break}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.roomUsers=[]),a.defaults&&(q.roomId="",q.callType=a.enums===String?"Normal":0),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.roomUsers&&n.roomUsers.length){q.roomUsers=[];for(let F=0;F<n.roomUsers.length;++F)q.roomUsers[F]=$root.com.quick.voice.proto.User.toObject(n.roomUsers[F],a)}return n.callType!=null&&n.hasOwnProperty("callType")&&(q.callType=a.enums===String?$root.com.quick.voice.proto.CallType[n.callType]===void 0?n.callType:$root.com.quick.voice.proto.CallType[n.callType]:n.callType),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.JoinRsp"},I}(),z.JoinNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.JoinNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.JoinNotify)return n;let a=new $root.com.quick.voice.proto.JoinNotify;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.JoinNotify"},I}(),z.ConnectCFReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.sdp="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&a.uint32(10).string(n.sdp),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ConnectCFReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.sdp=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp)?"sdp: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ConnectCFReq)return n;let a=new $root.com.quick.voice.proto.ConnectCFReq;return n.sdp!=null&&(a.sdp=String(n.sdp)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.sdp=""),n.sdp!=null&&n.hasOwnProperty("sdp")&&(q.sdp=n.sdp),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ConnectCFReq"},I}(),z.ConnectCFRsp=function(){function I(O){if(this.subscribeUsers=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.prototype.subscribeUsers=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),n.subscribeUsers!=null&&n.subscribeUsers.length)for(let q=0;q<n.subscribeUsers.length;++q)$root.com.quick.voice.proto.User.encode(n.subscribeUsers[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ConnectCFRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}case 2:{F.subscribeUsers&&F.subscribeUsers.length||(F.subscribeUsers=[]),F.subscribeUsers.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp))return"remoteSdp: string expected";if(n.subscribeUsers!=null&&n.hasOwnProperty("subscribeUsers")){if(!Array.isArray(n.subscribeUsers))return"subscribeUsers: array expected";for(let a=0;a<n.subscribeUsers.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.subscribeUsers[a]);if(q)return"subscribeUsers."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ConnectCFRsp)return n;let a=new $root.com.quick.voice.proto.ConnectCFRsp;if(n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),n.subscribeUsers){if(!Array.isArray(n.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");a.subscribeUsers=[];for(let q=0;q<n.subscribeUsers.length;++q){if(typeof n.subscribeUsers[q]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");a.subscribeUsers[q]=$root.com.quick.voice.proto.User.fromObject(n.subscribeUsers[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.subscribeUsers=[]),a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),n.subscribeUsers&&n.subscribeUsers.length){q.subscribeUsers=[];for(let F=0;F<n.subscribeUsers.length;++F)q.subscribeUsers[F]=$root.com.quick.voice.proto.User.toObject(n.subscribeUsers[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ConnectCFRsp"},I}(),z.PublishReq=function(){function I(n){if(this.tracks=[],n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.sdp="",I.prototype.tracks=$util.emptyArray,I.prototype.callAction=0,I.prototype.recreate=null;let O;return Object.defineProperty(I.prototype,"_recreate",{get:$util.oneOfGetter(O=["recreate"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){if(q||(q=$Writer.create()),a.sdp!=null&&Object.hasOwnProperty.call(a,"sdp")&&q.uint32(10).string(a.sdp),a.tracks!=null&&a.tracks.length)for(let F=0;F<a.tracks.length;++F)$root.com.quick.voice.proto.Track.encode(a.tracks[F],q.uint32(18).fork()).ldelim();return a.callAction!=null&&Object.hasOwnProperty.call(a,"callAction")&&q.uint32(24).int32(a.callAction),a.recreate!=null&&Object.hasOwnProperty.call(a,"recreate")&&q.uint32(32).bool(a.recreate),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.PublishReq;for(;a.pos<F;){let ee=a.uint32();switch(ee>>>3){case 1:{Z.sdp=a.string();break}case 2:{Z.tracks&&Z.tracks.length||(Z.tracks=[]),Z.tracks.push($root.com.quick.voice.proto.Track.decode(a,a.uint32()));break}case 3:{Z.callAction=a.int32();break}case 4:{Z.recreate=a.bool();break}default:a.skipType(ee&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.sdp!=null&&a.hasOwnProperty("sdp")&&!$util.isString(a.sdp))return"sdp: string expected";if(a.tracks!=null&&a.hasOwnProperty("tracks")){if(!Array.isArray(a.tracks))return"tracks: array expected";for(let q=0;q<a.tracks.length;++q){let F=$root.com.quick.voice.proto.Track.verify(a.tracks[q]);if(F)return"tracks."+F}}return a.callAction!=null&&a.hasOwnProperty("callAction")&&!$util.isInteger(a.callAction)?"callAction: integer expected":a.recreate!=null&&a.hasOwnProperty("recreate")&&typeof a.recreate!="boolean"?"recreate: boolean expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.PublishReq)return a;let q=new $root.com.quick.voice.proto.PublishReq;if(a.sdp!=null&&(q.sdp=String(a.sdp)),a.tracks){if(!Array.isArray(a.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");q.tracks=[];for(let F=0;F<a.tracks.length;++F){if(typeof a.tracks[F]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");q.tracks[F]=$root.com.quick.voice.proto.Track.fromObject(a.tracks[F])}}return a.callAction!=null&&(q.callAction=a.callAction|0),a.recreate!=null&&(q.recreate=!!a.recreate),q},I.toObject=function(a,q){q||(q={});let F={};if((q.arrays||q.defaults)&&(F.tracks=[]),q.defaults&&(F.sdp="",F.callAction=0),a.sdp!=null&&a.hasOwnProperty("sdp")&&(F.sdp=a.sdp),a.tracks&&a.tracks.length){F.tracks=[];for(let Z=0;Z<a.tracks.length;++Z)F.tracks[Z]=$root.com.quick.voice.proto.Track.toObject(a.tracks[Z],q)}return a.callAction!=null&&a.hasOwnProperty("callAction")&&(F.callAction=a.callAction),a.recreate!=null&&a.hasOwnProperty("recreate")&&(F.recreate=a.recreate,q.oneofs&&(F._recreate="recreate")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.PublishReq"},I}(),z.PublishRsp=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PublishRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp)?"remoteSdp: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishRsp)return n;let a=new $root.com.quick.voice.proto.PublishRsp;return n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishRsp"},I}(),z.PublishNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PublishNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PublishNotify)return n;let a=new $root.com.quick.voice.proto.PublishNotify;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PublishNotify"},I}(),z.SubscribeReq=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SubscribeReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SubscribeReq)return n;let a=new $root.com.quick.voice.proto.SubscribeReq;if(n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SubscribeReq"},I}(),z.SubscribeRsp=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SubscribeRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp))return"remoteSdp: string expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SubscribeRsp)return n;let a=new $root.com.quick.voice.proto.SubscribeRsp;if(n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SubscribeRsp"},I}(),z.RenegotiateReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.sdp="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&a.uint32(18).string(n.sdp),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.RenegotiateReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.sdp=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp)?"sdp: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.RenegotiateReq)return n;let a=new $root.com.quick.voice.proto.RenegotiateReq;return n.userId!=null&&(a.userId=String(n.userId)),n.sdp!=null&&(a.sdp=String(n.sdp)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.userId="",q.sdp=""),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.sdp!=null&&n.hasOwnProperty("sdp")&&(q.sdp=n.sdp),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.RenegotiateReq"},I}(),z.QuitReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(18).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.QuitReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.QuitReq)return n;let a=new $root.com.quick.voice.proto.QuitReq;return n.userId!=null&&(a.userId=String(n.userId)),n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.userId="",q.roomId=""),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.QuitReq"},I}(),z.QuitNotify=function(){function I(n){if(n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.roomId="",I.prototype.user=null,I.prototype.code=null,I.prototype.desc=null;let O;return Object.defineProperty(I.prototype,"_code",{get:$util.oneOfGetter(O=["code"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_desc",{get:$util.oneOfGetter(O=["desc"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){return q||(q=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&q.uint32(10).string(a.roomId),a.user!=null&&Object.hasOwnProperty.call(a,"user")&&$root.com.quick.voice.proto.User.encode(a.user,q.uint32(18).fork()).ldelim(),a.code!=null&&Object.hasOwnProperty.call(a,"code")&&q.uint32(24).int32(a.code),a.desc!=null&&Object.hasOwnProperty.call(a,"desc")&&q.uint32(34).string(a.desc),q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.QuitNotify;for(;a.pos<F;){let ee=a.uint32();switch(ee>>>3){case 1:{Z.roomId=a.string();break}case 2:{Z.user=$root.com.quick.voice.proto.User.decode(a,a.uint32());break}case 3:{Z.code=a.int32();break}case 4:{Z.desc=a.string();break}default:a.skipType(ee&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.user!=null&&a.hasOwnProperty("user")){let q=$root.com.quick.voice.proto.User.verify(a.user);if(q)return"user."+q}return a.code!=null&&a.hasOwnProperty("code")&&!$util.isInteger(a.code)?"code: integer expected":a.desc!=null&&a.hasOwnProperty("desc")&&!$util.isString(a.desc)?"desc: string expected":null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.QuitNotify)return a;let q=new $root.com.quick.voice.proto.QuitNotify;if(a.roomId!=null&&(q.roomId=String(a.roomId)),a.user!=null){if(typeof a.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");q.user=$root.com.quick.voice.proto.User.fromObject(a.user)}return a.code!=null&&(q.code=a.code|0),a.desc!=null&&(q.desc=String(a.desc)),q},I.toObject=function(a,q){q||(q={});let F={};return q.defaults&&(F.roomId="",F.user=null),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.user!=null&&a.hasOwnProperty("user")&&(F.user=$root.com.quick.voice.proto.User.toObject(a.user,q)),a.code!=null&&a.hasOwnProperty("code")&&(F.code=a.code,q.oneofs&&(F._code="code")),a.desc!=null&&a.hasOwnProperty("desc")&&(F.desc=a.desc,q.oneofs&&(F._desc="desc")),F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.QuitNotify"},I}(),z.TokenExpireNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.TokenExpireNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.TokenExpireNotify)return n;let a=new $root.com.quick.voice.proto.TokenExpireNotify;return n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.TokenExpireNotify"},I}(),z.UpdateTokenReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.sdkToken="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.sdkToken!=null&&Object.hasOwnProperty.call(n,"sdkToken")&&a.uint32(18).string(n.sdkToken),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdateTokenReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.sdkToken=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&!$util.isString(n.sdkToken)?"sdkToken: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdateTokenReq)return n;let a=new $root.com.quick.voice.proto.UpdateTokenReq;return n.roomId!=null&&(a.roomId=String(n.roomId)),n.sdkToken!=null&&(a.sdkToken=String(n.sdkToken)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.sdkToken=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.sdkToken!=null&&n.hasOwnProperty("sdkToken")&&(q.sdkToken=n.sdkToken),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdateTokenReq"},I}(),z.NetQualityChange=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.roomId="",I.prototype.egress=0,I.prototype.ingress=0,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(18).string(n.roomId),n.egress!=null&&Object.hasOwnProperty.call(n,"egress")&&a.uint32(24).int32(n.egress),n.ingress!=null&&Object.hasOwnProperty.call(n,"ingress")&&a.uint32(32).int32(n.ingress),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.NetQualityChange;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.roomId=n.string();break}case 3:{F.egress=n.int32();break}case 4:{F.ingress=n.int32();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":n.egress!=null&&n.hasOwnProperty("egress")&&!$util.isInteger(n.egress)?"egress: integer expected":n.ingress!=null&&n.hasOwnProperty("ingress")&&!$util.isInteger(n.ingress)?"ingress: integer expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.NetQualityChange)return n;let a=new $root.com.quick.voice.proto.NetQualityChange;return n.userId!=null&&(a.userId=String(n.userId)),n.roomId!=null&&(a.roomId=String(n.roomId)),n.egress!=null&&(a.egress=n.egress|0),n.ingress!=null&&(a.ingress=n.ingress|0),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.userId="",q.roomId="",q.egress=0,q.ingress=0),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.egress!=null&&n.hasOwnProperty("egress")&&(q.egress=n.egress),n.ingress!=null&&n.hasOwnProperty("ingress")&&(q.ingress=n.ingress),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.NetQualityChange"},I}(),z.NetQualityNotify=function(){function I(O){if(this.qualities=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.qualities=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.qualities!=null&&n.qualities.length)for(let q=0;q<n.qualities.length;++q)$root.com.quick.voice.proto.NetQualityChange.encode(n.qualities[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.NetQualityNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.qualities&&F.qualities.length||(F.qualities=[]),F.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.qualities!=null&&n.hasOwnProperty("qualities")){if(!Array.isArray(n.qualities))return"qualities: array expected";for(let a=0;a<n.qualities.length;++a){let q=$root.com.quick.voice.proto.NetQualityChange.verify(n.qualities[a]);if(q)return"qualities."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.NetQualityNotify)return n;let a=new $root.com.quick.voice.proto.NetQualityNotify;if(n.qualities){if(!Array.isArray(n.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");a.qualities=[];for(let q=0;q<n.qualities.length;++q){if(typeof n.qualities[q]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");a.qualities[q]=$root.com.quick.voice.proto.NetQualityChange.fromObject(n.qualities[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.qualities=[]),n.qualities&&n.qualities.length){q.qualities=[];for(let F=0;F<n.qualities.length;++F)q.qualities[F]=$root.com.quick.voice.proto.NetQualityChange.toObject(n.qualities[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.NetQualityNotify"},I}(),z.UpdateCall=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdateCall;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdateCall)return n;let a=new $root.com.quick.voice.proto.UpdateCall;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdateCall"},I}(),z.SyncRoomInfoReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return n;let a=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SyncRoomInfoReq"},I}(),z.SyncRoomInfoRsp=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.isValid=!1,I.prototype.users=$util.emptyArray,I.prototype.isActive=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.isValid!=null&&Object.hasOwnProperty.call(n,"isValid")&&a.uint32(16).bool(n.isValid),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(26).fork()).ldelim();return n.isActive!=null&&Object.hasOwnProperty.call(n,"isActive")&&a.uint32(32).bool(n.isActive),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.isValid=n.bool();break}case 3:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}case 4:{F.isActive=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.isValid!=null&&n.hasOwnProperty("isValid")&&typeof n.isValid!="boolean")return"isValid: boolean expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return n.isActive!=null&&n.hasOwnProperty("isActive")&&typeof n.isActive!="boolean"?"isActive: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return n;let a=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.isValid!=null&&(a.isValid=!!n.isValid),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return n.isActive!=null&&(a.isActive=!!n.isActive),a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.roomId="",q.isValid=!1,q.isActive=!1),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.isValid!=null&&n.hasOwnProperty("isValid")&&(q.isValid=n.isValid),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return n.isActive!=null&&n.hasOwnProperty("isActive")&&(q.isActive=n.isActive),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.SyncRoomInfoRsp"},I}(),z.UpdateTime=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(8).int64(n.time),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdateTime;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.time=n.int64();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdateTime)return n;let a=new $root.com.quick.voice.proto.UpdateTime;return n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults)if($util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;return n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdateTime"},I}(),z.CloseTrackReq=function(){function I(O){if(this.tracks=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.sdp="",I.prototype.tracks=$util.emptyArray,I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.sdp!=null&&Object.hasOwnProperty.call(n,"sdp")&&a.uint32(10).string(n.sdp),n.tracks!=null&&n.tracks.length)for(let q=0;q<n.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(n.tracks[q],a.uint32(18).fork()).ldelim();return n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(26).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CloseTrackReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.sdp=n.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}case 3:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.sdp!=null&&n.hasOwnProperty("sdp")&&!$util.isString(n.sdp))return"sdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let a=0;a<n.tracks.length;++a){let q=$root.com.quick.voice.proto.Track.verify(n.tracks[a]);if(q)return"tracks."+q}}return n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CloseTrackReq)return n;let a=new $root.com.quick.voice.proto.CloseTrackReq;if(n.sdp!=null&&(a.sdp=String(n.sdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");a.tracks=[];for(let q=0;q<n.tracks.length;++q){if(typeof n.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");a.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[q])}}return n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.tracks=[]),a.defaults&&(q.sdp="",q.roomId=""),n.sdp!=null&&n.hasOwnProperty("sdp")&&(q.sdp=n.sdp),n.tracks&&n.tracks.length){q.tracks=[];for(let F=0;F<n.tracks.length;++F)q.tracks[F]=$root.com.quick.voice.proto.Track.toObject(n.tracks[F],a)}return n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CloseTrackReq"},I}(),z.CloseTrackRsp=function(){function I(O){if(this.tracks=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.remoteSdp="",I.prototype.tracks=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.remoteSdp!=null&&Object.hasOwnProperty.call(n,"remoteSdp")&&a.uint32(10).string(n.remoteSdp),n.tracks!=null&&n.tracks.length)for(let q=0;q<n.tracks.length;++q)$root.com.quick.voice.proto.Track.encode(n.tracks[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CloseTrackRsp;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.remoteSdp=n.string();break}case 2:{F.tracks&&F.tracks.length||(F.tracks=[]),F.tracks.push($root.com.quick.voice.proto.Track.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&!$util.isString(n.remoteSdp))return"remoteSdp: string expected";if(n.tracks!=null&&n.hasOwnProperty("tracks")){if(!Array.isArray(n.tracks))return"tracks: array expected";for(let a=0;a<n.tracks.length;++a){let q=$root.com.quick.voice.proto.Track.verify(n.tracks[a]);if(q)return"tracks."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CloseTrackRsp)return n;let a=new $root.com.quick.voice.proto.CloseTrackRsp;if(n.remoteSdp!=null&&(a.remoteSdp=String(n.remoteSdp)),n.tracks){if(!Array.isArray(n.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");a.tracks=[];for(let q=0;q<n.tracks.length;++q){if(typeof n.tracks[q]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");a.tracks[q]=$root.com.quick.voice.proto.Track.fromObject(n.tracks[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.tracks=[]),a.defaults&&(q.remoteSdp=""),n.remoteSdp!=null&&n.hasOwnProperty("remoteSdp")&&(q.remoteSdp=n.remoteSdp),n.tracks&&n.tracks.length){q.tracks=[];for(let F=0;F<n.tracks.length;++F)q.tracks[F]=$root.com.quick.voice.proto.Track.toObject(n.tracks[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CloseTrackRsp"},I}(),z.CloseTrackNotify=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(10).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.CloseTrackNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.CloseTrackNotify)return n;let a=new $root.com.quick.voice.proto.CloseTrackNotify;if(n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.user=null),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.CloseTrackNotify"},I}(),z.ToggleLiveRoomReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId)?"roomId: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return n;let a=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return n.roomId!=null&&(a.roomId=String(n.roomId)),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ToggleLiveRoomReq"},I}(),z.ToggleLiveRoomRsq=function(){function I(O){if(this.roomUsers=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.hash="",I.prototype.roomUsers=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.hash!=null&&Object.hasOwnProperty.call(n,"hash")&&a.uint32(18).string(n.hash),n.roomUsers!=null&&n.roomUsers.length)for(let q=0;q<n.roomUsers.length;++q)$root.com.quick.voice.proto.User.encode(n.roomUsers[q],a.uint32(26).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.hash=n.string();break}case 3:{F.roomUsers&&F.roomUsers.length||(F.roomUsers=[]),F.roomUsers.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.hash!=null&&n.hasOwnProperty("hash")&&!$util.isString(n.hash))return"hash: string expected";if(n.roomUsers!=null&&n.hasOwnProperty("roomUsers")){if(!Array.isArray(n.roomUsers))return"roomUsers: array expected";for(let a=0;a<n.roomUsers.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.roomUsers[a]);if(q)return"roomUsers."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return n;let a=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.hash!=null&&(a.hash=String(n.hash)),n.roomUsers){if(!Array.isArray(n.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");a.roomUsers=[];for(let q=0;q<n.roomUsers.length;++q){if(typeof n.roomUsers[q]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");a.roomUsers[q]=$root.com.quick.voice.proto.User.fromObject(n.roomUsers[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.roomUsers=[]),a.defaults&&(q.roomId="",q.hash=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.hash!=null&&n.hasOwnProperty("hash")&&(q.hash=n.hash),n.roomUsers&&n.roomUsers.length){q.roomUsers=[];for(let F=0;F<n.roomUsers.length;++F)q.roomUsers[F]=$root.com.quick.voice.proto.User.toObject(n.roomUsers[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ToggleLiveRoomRsq"},I}(),z.TrackType=function(){const I={},O=Object.create(I);return O[I[0]="Microphone"]=0,O[I[1]="Camera"]=1,O[I[2]="Screen"]=2,O[I[3]="SystemVoice"]=3,O}(),z.ReportInfoReq=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.actionEvent="",I.prototype.userId="",I.prototype.platform="",I.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,I.prototype.actionData="",I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.actionEvent!=null&&Object.hasOwnProperty.call(n,"actionEvent")&&a.uint32(10).string(n.actionEvent),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(18).string(n.userId),n.platform!=null&&Object.hasOwnProperty.call(n,"platform")&&a.uint32(26).string(n.platform),n.time!=null&&Object.hasOwnProperty.call(n,"time")&&a.uint32(32).int64(n.time),n.actionData!=null&&Object.hasOwnProperty.call(n,"actionData")&&a.uint32(42).string(n.actionData),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ReportInfoReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.actionEvent=n.string();break}case 2:{F.userId=n.string();break}case 3:{F.platform=n.string();break}case 4:{F.time=n.int64();break}case 5:{F.actionData=n.string();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){return typeof n!="object"||n===null?"object expected":n.actionEvent!=null&&n.hasOwnProperty("actionEvent")&&!$util.isString(n.actionEvent)?"actionEvent: string expected":n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId)?"userId: string expected":n.platform!=null&&n.hasOwnProperty("platform")&&!$util.isString(n.platform)?"platform: string expected":n.time!=null&&n.hasOwnProperty("time")&&!$util.isInteger(n.time)&&!(n.time&&$util.isInteger(n.time.low)&&$util.isInteger(n.time.high))?"time: integer|Long expected":n.actionData!=null&&n.hasOwnProperty("actionData")&&!$util.isString(n.actionData)?"actionData: string expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ReportInfoReq)return n;let a=new $root.com.quick.voice.proto.ReportInfoReq;return n.actionEvent!=null&&(a.actionEvent=String(n.actionEvent)),n.userId!=null&&(a.userId=String(n.userId)),n.platform!=null&&(a.platform=String(n.platform)),n.time!=null&&($util.Long?(a.time=$util.Long.fromValue(n.time)).unsigned=!1:typeof n.time=="string"?a.time=parseInt(n.time,10):typeof n.time=="number"?a.time=n.time:typeof n.time=="object"&&(a.time=new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber())),n.actionData!=null&&(a.actionData=String(n.actionData)),a},I.toObject=function(n,a){a||(a={});let q={};if(a.defaults){if(q.actionEvent="",q.userId="",q.platform="",$util.Long){let F=new $util.Long(0,0,!1);q.time=a.longs===String?F.toString():a.longs===Number?F.toNumber():F}else q.time=a.longs===String?"0":0;q.actionData=""}return n.actionEvent!=null&&n.hasOwnProperty("actionEvent")&&(q.actionEvent=n.actionEvent),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.platform!=null&&n.hasOwnProperty("platform")&&(q.platform=n.platform),n.time!=null&&n.hasOwnProperty("time")&&(typeof n.time=="number"?q.time=a.longs===String?String(n.time):n.time:q.time=a.longs===String?$util.Long.prototype.toString.call(n.time):a.longs===Number?new $util.LongBits(n.time.low>>>0,n.time.high>>>0).toNumber():n.time),n.actionData!=null&&n.hasOwnProperty("actionData")&&(q.actionData=n.actionData),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ReportInfoReq"},I}(),z.UpdatePermissions=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.user=null,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.user!=null&&Object.hasOwnProperty.call(n,"user")&&$root.com.quick.voice.proto.User.encode(n.user,a.uint32(18).fork()).ldelim(),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UpdatePermissions;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.user=$root.com.quick.voice.proto.User.decode(n,n.uint32());break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.user!=null&&n.hasOwnProperty("user")){let a=$root.com.quick.voice.proto.User.verify(n.user);if(a)return"user."+a}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UpdatePermissions)return n;let a=new $root.com.quick.voice.proto.UpdatePermissions;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.user!=null){if(typeof n.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");a.user=$root.com.quick.voice.proto.User.fromObject(n.user)}return a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.roomId="",q.user=null),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.user!=null&&n.hasOwnProperty("user")&&(q.user=$root.com.quick.voice.proto.User.toObject(n.user,a)),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UpdatePermissions"},I}(),z.CallType=function(){const I={},O=Object.create(I);return O[I[0]="Normal"]=0,O[I[1]="Meeting"]=1,O[I[2]="Live"]=2,O}(),z.QuitNotifyCode=function(){const I={},O=Object.create(I);return O[I[0]="NormalQuit"]=0,O[I[2021]="Timeout"]=2021,O[I[2011]="TokenExpired"]=2011,O[I[2022]="KickOut"]=2022,O[I[2023]="EndPk"]=2023,O[I[2024]="EndLive"]=2024,O}(),z.UserBehavior=function(){function I(O){if(O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.type=0,I.prototype.behavior=!1,I.create=function(n){return new I(n)},I.encode=function(n,a){return a||(a=$Writer.create()),n.type!=null&&Object.hasOwnProperty.call(n,"type")&&a.uint32(8).int32(n.type),n.behavior!=null&&Object.hasOwnProperty.call(n,"behavior")&&a.uint32(16).bool(n.behavior),a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UserBehavior;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.type=n.int32();break}case 2:{F.behavior=n.bool();break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.type!=null&&n.hasOwnProperty("type"))switch(n.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return n.behavior!=null&&n.hasOwnProperty("behavior")&&typeof n.behavior!="boolean"?"behavior: boolean expected":null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UserBehavior)return n;let a=new $root.com.quick.voice.proto.UserBehavior;switch(n.type){default:if(typeof n.type=="number"){a.type=n.type;break}break;case"Microphone":case 0:a.type=0;break;case"Camera":case 1:a.type=1;break;case"Screen":case 2:a.type=2;break;case"SystemVoice":case 3:a.type=3;break}return n.behavior!=null&&(a.behavior=!!n.behavior),a},I.toObject=function(n,a){a||(a={});let q={};return a.defaults&&(q.type=a.enums===String?"Microphone":0,q.behavior=!1),n.type!=null&&n.hasOwnProperty("type")&&(q.type=a.enums===String?$root.com.quick.voice.proto.TrackType[n.type]===void 0?n.type:$root.com.quick.voice.proto.TrackType[n.type]:n.type),n.behavior!=null&&n.hasOwnProperty("behavior")&&(q.behavior=n.behavior),q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UserBehavior"},I}(),z.PreventUser=function(){function I(O){if(this.behaviors=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.id="",I.prototype.behaviors=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.id!=null&&Object.hasOwnProperty.call(n,"id")&&a.uint32(10).string(n.id),n.behaviors!=null&&n.behaviors.length)for(let q=0;q<n.behaviors.length;++q)$root.com.quick.voice.proto.UserBehavior.encode(n.behaviors[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PreventUser;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.id=n.string();break}case 2:{F.behaviors&&F.behaviors.length||(F.behaviors=[]),F.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.id!=null&&n.hasOwnProperty("id")&&!$util.isString(n.id))return"id: string expected";if(n.behaviors!=null&&n.hasOwnProperty("behaviors")){if(!Array.isArray(n.behaviors))return"behaviors: array expected";for(let a=0;a<n.behaviors.length;++a){let q=$root.com.quick.voice.proto.UserBehavior.verify(n.behaviors[a]);if(q)return"behaviors."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PreventUser)return n;let a=new $root.com.quick.voice.proto.PreventUser;if(n.id!=null&&(a.id=String(n.id)),n.behaviors){if(!Array.isArray(n.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");a.behaviors=[];for(let q=0;q<n.behaviors.length;++q){if(typeof n.behaviors[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");a.behaviors[q]=$root.com.quick.voice.proto.UserBehavior.fromObject(n.behaviors[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.behaviors=[]),a.defaults&&(q.id=""),n.id!=null&&n.hasOwnProperty("id")&&(q.id=n.id),n.behaviors&&n.behaviors.length){q.behaviors=[];for(let F=0;F<n.behaviors.length;++F)q.behaviors[F]=$root.com.quick.voice.proto.UserBehavior.toObject(n.behaviors[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PreventUser"},I}(),z.PreventUsersBehaviorReq=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.PreventUser.encode(n.users[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.PreventUser.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.PreventUser.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return n;let a=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");a.users[q]=$root.com.quick.voice.proto.PreventUser.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.PreventUser.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PreventUsersBehaviorReq"},I}(),z.PreventUsersBehaviorNotify=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.roomId="",I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.roomId!=null&&Object.hasOwnProperty.call(n,"roomId")&&a.uint32(10).string(n.roomId),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.User.encode(n.users[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.roomId=n.string();break}case 2:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.User.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.roomId!=null&&n.hasOwnProperty("roomId")&&!$util.isString(n.roomId))return"roomId: string expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.User.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return n;let a=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(n.roomId!=null&&(a.roomId=String(n.roomId)),n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");a.users[q]=$root.com.quick.voice.proto.User.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),a.defaults&&(q.roomId=""),n.roomId!=null&&n.hasOwnProperty("roomId")&&(q.roomId=n.roomId),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.User.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},I}(),z.AccelerationAreas=function(){const I={},O=Object.create(I);return O[I[0]="chinaMainland"]=0,O[I[1]="global"]=1,O[I[2]="overseas"]=2,O}(),z.CountMethods=function(){const I={},O=Object.create(I);return O[I[0]="flow"]=0,O[I[1]="minutes"]=1,O}(),z.BaseCDNAddress=function(){function I(O){if(this.urlMap={},O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.area=0,I.prototype.countType=0,I.prototype.urlMap=$util.emptyObject,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.area!=null&&Object.hasOwnProperty.call(n,"area")&&a.uint32(8).int32(n.area),n.countType!=null&&Object.hasOwnProperty.call(n,"countType")&&a.uint32(16).int32(n.countType),n.urlMap!=null&&Object.hasOwnProperty.call(n,"urlMap"))for(let q=Object.keys(n.urlMap),F=0;F<q.length;++F)a.uint32(26).fork().uint32(10).string(q[F]).uint32(18).string(n.urlMap[q[F]]).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.BaseCDNAddress,Z,ee;for(;n.pos<q;){let te=n.uint32();switch(te>>>3){case 1:{F.area=n.int32();break}case 2:{F.countType=n.int32();break}case 3:{F.urlMap===$util.emptyObject&&(F.urlMap={});let X=n.uint32()+n.pos;for(Z="",ee="";n.pos<X;){let ne=n.uint32();switch(ne>>>3){case 1:Z=n.string();break;case 2:ee=n.string();break;default:n.skipType(ne&7);break}}F.urlMap[Z]=ee;break}default:n.skipType(te&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.area!=null&&n.hasOwnProperty("area"))switch(n.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(n.countType!=null&&n.hasOwnProperty("countType"))switch(n.countType){default:return"countType: enum value expected";case 0:case 1:break}if(n.urlMap!=null&&n.hasOwnProperty("urlMap")){if(!$util.isObject(n.urlMap))return"urlMap: object expected";let a=Object.keys(n.urlMap);for(let q=0;q<a.length;++q)if(!$util.isString(n.urlMap[a[q]]))return"urlMap: string{k:string} expected"}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.BaseCDNAddress)return n;let a=new $root.com.quick.voice.proto.BaseCDNAddress;switch(n.area){default:if(typeof n.area=="number"){a.area=n.area;break}break;case"chinaMainland":case 0:a.area=0;break;case"global":case 1:a.area=1;break;case"overseas":case 2:a.area=2;break}switch(n.countType){default:if(typeof n.countType=="number"){a.countType=n.countType;break}break;case"flow":case 0:a.countType=0;break;case"minutes":case 1:a.countType=1;break}if(n.urlMap){if(typeof n.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");a.urlMap={};for(let q=Object.keys(n.urlMap),F=0;F<q.length;++F)a.urlMap[q[F]]=String(n.urlMap[q[F]])}return a},I.toObject=function(n,a){a||(a={});let q={};(a.objects||a.defaults)&&(q.urlMap={}),a.defaults&&(q.area=a.enums===String?"chinaMainland":0,q.countType=a.enums===String?"flow":0),n.area!=null&&n.hasOwnProperty("area")&&(q.area=a.enums===String?$root.com.quick.voice.proto.AccelerationAreas[n.area]===void 0?n.area:$root.com.quick.voice.proto.AccelerationAreas[n.area]:n.area),n.countType!=null&&n.hasOwnProperty("countType")&&(q.countType=a.enums===String?$root.com.quick.voice.proto.CountMethods[n.countType]===void 0?n.countType:$root.com.quick.voice.proto.CountMethods[n.countType]:n.countType);let F;if(n.urlMap&&(F=Object.keys(n.urlMap)).length){q.urlMap={};for(let Z=0;Z<F.length;++Z)q.urlMap[F[Z]]=n.urlMap[F[Z]]}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.BaseCDNAddress"},I}(),z.CDNPlayAddressNotify=function(){function I(n){if(this.standLines=[],n)for(let a=Object.keys(n),q=0;q<a.length;++q)n[a[q]]!=null&&(this[a[q]]=n[a[q]])}I.prototype.roomId="",I.prototype.m3u8=null,I.prototype.rtmp=null,I.prototype.flv=null,I.prototype.rtmps=null,I.prototype.mainLine=null,I.prototype.standLines=$util.emptyArray;let O;return Object.defineProperty(I.prototype,"_m3u8",{get:$util.oneOfGetter(O=["m3u8"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_rtmp",{get:$util.oneOfGetter(O=["rtmp"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_flv",{get:$util.oneOfGetter(O=["flv"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_rtmps",{get:$util.oneOfGetter(O=["rtmps"]),set:$util.oneOfSetter(O)}),Object.defineProperty(I.prototype,"_mainLine",{get:$util.oneOfGetter(O=["mainLine"]),set:$util.oneOfSetter(O)}),I.create=function(a){return new I(a)},I.encode=function(a,q){if(q||(q=$Writer.create()),a.roomId!=null&&Object.hasOwnProperty.call(a,"roomId")&&q.uint32(10).string(a.roomId),a.m3u8!=null&&Object.hasOwnProperty.call(a,"m3u8")&&q.uint32(18).string(a.m3u8),a.rtmp!=null&&Object.hasOwnProperty.call(a,"rtmp")&&q.uint32(26).string(a.rtmp),a.flv!=null&&Object.hasOwnProperty.call(a,"flv")&&q.uint32(34).string(a.flv),a.rtmps!=null&&Object.hasOwnProperty.call(a,"rtmps")&&q.uint32(42).string(a.rtmps),a.mainLine!=null&&Object.hasOwnProperty.call(a,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(a.mainLine,q.uint32(50).fork()).ldelim(),a.standLines!=null&&a.standLines.length)for(let F=0;F<a.standLines.length;++F)$root.com.quick.voice.proto.BaseCDNAddress.encode(a.standLines[F],q.uint32(58).fork()).ldelim();return q},I.encodeDelimited=function(a,q){return this.encode(a,q).ldelim()},I.decode=function(a,q){a instanceof $Reader||(a=$Reader.create(a));let F=q===void 0?a.len:a.pos+q,Z=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;a.pos<F;){let ee=a.uint32();switch(ee>>>3){case 1:{Z.roomId=a.string();break}case 2:{Z.m3u8=a.string();break}case 3:{Z.rtmp=a.string();break}case 4:{Z.flv=a.string();break}case 5:{Z.rtmps=a.string();break}case 6:{Z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(a,a.uint32());break}case 7:{Z.standLines&&Z.standLines.length||(Z.standLines=[]),Z.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(a,a.uint32()));break}default:a.skipType(ee&7);break}}return Z},I.decodeDelimited=function(a){return a instanceof $Reader||(a=new $Reader(a)),this.decode(a,a.uint32())},I.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.roomId!=null&&a.hasOwnProperty("roomId")&&!$util.isString(a.roomId))return"roomId: string expected";if(a.m3u8!=null&&a.hasOwnProperty("m3u8")&&!$util.isString(a.m3u8))return"m3u8: string expected";if(a.rtmp!=null&&a.hasOwnProperty("rtmp")&&!$util.isString(a.rtmp))return"rtmp: string expected";if(a.flv!=null&&a.hasOwnProperty("flv")&&!$util.isString(a.flv))return"flv: string expected";if(a.rtmps!=null&&a.hasOwnProperty("rtmps")&&!$util.isString(a.rtmps))return"rtmps: string expected";if(a.mainLine!=null&&a.hasOwnProperty("mainLine")){let q=$root.com.quick.voice.proto.BaseCDNAddress.verify(a.mainLine);if(q)return"mainLine."+q}if(a.standLines!=null&&a.hasOwnProperty("standLines")){if(!Array.isArray(a.standLines))return"standLines: array expected";for(let q=0;q<a.standLines.length;++q){let F=$root.com.quick.voice.proto.BaseCDNAddress.verify(a.standLines[q]);if(F)return"standLines."+F}}return null},I.fromObject=function(a){if(a instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return a;let q=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(a.roomId!=null&&(q.roomId=String(a.roomId)),a.m3u8!=null&&(q.m3u8=String(a.m3u8)),a.rtmp!=null&&(q.rtmp=String(a.rtmp)),a.flv!=null&&(q.flv=String(a.flv)),a.rtmps!=null&&(q.rtmps=String(a.rtmps)),a.mainLine!=null){if(typeof a.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");q.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(a.mainLine)}if(a.standLines){if(!Array.isArray(a.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");q.standLines=[];for(let F=0;F<a.standLines.length;++F){if(typeof a.standLines[F]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");q.standLines[F]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(a.standLines[F])}}return q},I.toObject=function(a,q){q||(q={});let F={};if((q.arrays||q.defaults)&&(F.standLines=[]),q.defaults&&(F.roomId=""),a.roomId!=null&&a.hasOwnProperty("roomId")&&(F.roomId=a.roomId),a.m3u8!=null&&a.hasOwnProperty("m3u8")&&(F.m3u8=a.m3u8,q.oneofs&&(F._m3u8="m3u8")),a.rtmp!=null&&a.hasOwnProperty("rtmp")&&(F.rtmp=a.rtmp,q.oneofs&&(F._rtmp="rtmp")),a.flv!=null&&a.hasOwnProperty("flv")&&(F.flv=a.flv,q.oneofs&&(F._flv="flv")),a.rtmps!=null&&a.hasOwnProperty("rtmps")&&(F.rtmps=a.rtmps,q.oneofs&&(F._rtmps="rtmps")),a.mainLine!=null&&a.hasOwnProperty("mainLine")&&(F.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(a.mainLine,q),q.oneofs&&(F._mainLine="mainLine")),a.standLines&&a.standLines.length){F.standLines=[];for(let Z=0;Z<a.standLines.length;++Z)F.standLines[Z]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(a.standLines[Z],q)}return F},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/com.quick.voice.proto.CDNPlayAddressNotify"},I}(),z.UserChannel=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.userId="",I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.userId!=null&&Object.hasOwnProperty.call(n,"userId")&&a.uint32(10).string(n.userId),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(n.channels[q],a.uint32(18).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.UserChannel;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.userId=n.string();break}case 2:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.userId!=null&&n.hasOwnProperty("userId")&&!$util.isString(n.userId))return"userId: string expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.DataChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.UserChannel)return n;let a=new $root.com.quick.voice.proto.UserChannel;if(n.userId!=null&&(a.userId=String(n.userId)),n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),a.defaults&&(q.userId=""),n.userId!=null&&n.hasOwnProperty("userId")&&(q.userId=n.userId),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.UserChannel"},I}(),z.ChannelPublishReq=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.DataChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelPublishReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.DataChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.DataChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelPublishReq)return n;let a=new $root.com.quick.voice.proto.ChannelPublishReq;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.DataChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.DataChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelPublishReq"},I}(),z.ChannelPublishRsq=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.UserChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.UserChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.UserChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return n;let a=new $root.com.quick.voice.proto.ChannelPublishRsq;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.UserChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.UserChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelPublishRsq"},I}(),z.ChannelSubscribeReq=function(){function I(O){if(this.users=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.users=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.users!=null&&n.users.length)for(let q=0;q<n.users.length;++q)$root.com.quick.voice.proto.UserChannel.encode(n.users[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.users&&F.users.length||(F.users=[]),F.users.push($root.com.quick.voice.proto.UserChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.users!=null&&n.hasOwnProperty("users")){if(!Array.isArray(n.users))return"users: array expected";for(let a=0;a<n.users.length;++a){let q=$root.com.quick.voice.proto.UserChannel.verify(n.users[a]);if(q)return"users."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return n;let a=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(n.users){if(!Array.isArray(n.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");a.users=[];for(let q=0;q<n.users.length;++q){if(typeof n.users[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");a.users[q]=$root.com.quick.voice.proto.UserChannel.fromObject(n.users[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.users=[]),n.users&&n.users.length){q.users=[];for(let F=0;F<n.users.length;++F)q.users[F]=$root.com.quick.voice.proto.UserChannel.toObject(n.users[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelSubscribeReq"},I}(),z.ChannelSubscribeRsq=function(){function I(O){if(this.channels=[],O)for(let n=Object.keys(O),a=0;a<n.length;++a)O[n[a]]!=null&&(this[n[a]]=O[n[a]])}return I.prototype.channels=$util.emptyArray,I.create=function(n){return new I(n)},I.encode=function(n,a){if(a||(a=$Writer.create()),n.channels!=null&&n.channels.length)for(let q=0;q<n.channels.length;++q)$root.com.quick.voice.proto.UserChannel.encode(n.channels[q],a.uint32(10).fork()).ldelim();return a},I.encodeDelimited=function(n,a){return this.encode(n,a).ldelim()},I.decode=function(n,a){n instanceof $Reader||(n=$Reader.create(n));let q=a===void 0?n.len:n.pos+a,F=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;n.pos<q;){let Z=n.uint32();switch(Z>>>3){case 1:{F.channels&&F.channels.length||(F.channels=[]),F.channels.push($root.com.quick.voice.proto.UserChannel.decode(n,n.uint32()));break}default:n.skipType(Z&7);break}}return F},I.decodeDelimited=function(n){return n instanceof $Reader||(n=new $Reader(n)),this.decode(n,n.uint32())},I.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.channels!=null&&n.hasOwnProperty("channels")){if(!Array.isArray(n.channels))return"channels: array expected";for(let a=0;a<n.channels.length;++a){let q=$root.com.quick.voice.proto.UserChannel.verify(n.channels[a]);if(q)return"channels."+q}}return null},I.fromObject=function(n){if(n instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return n;let a=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(n.channels){if(!Array.isArray(n.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");a.channels=[];for(let q=0;q<n.channels.length;++q){if(typeof n.channels[q]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");a.channels[q]=$root.com.quick.voice.proto.UserChannel.fromObject(n.channels[q])}}return a},I.toObject=function(n,a){a||(a={});let q={};if((a.arrays||a.defaults)&&(q.channels=[]),n.channels&&n.channels.length){q.channels=[];for(let F=0;F<n.channels.length;++F)q.channels[F]=$root.com.quick.voice.proto.UserChannel.toObject(n.channels[F],a)}return q},I.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},I.getTypeUrl=function(n){return n===void 0&&(n="type.googleapis.com"),n+"/com.quick.voice.proto.ChannelSubscribeRsq"},I}(),z}(),N}(),J}(),D})(),ignoreEvent=["networkQualityChange","onNetQuality"],enum_notifyName={onChangeNetwork:"网络情况变更",healthCheck:"心跳检测",onNetQuality:"网络质量回调",onLogin:"登录回调",onLocalStream:"本地媒体流发生变化",onDevicechange:"媒体设备发生变化",onRoomUser:"房间用户变化",onRoomUsers:"房间所有用户所有变化",onRoomUsersStreams:"房间某些用户媒体流变化",onRoomState:"房间状态变化",onJoinRoom:"加入房间回调",onQuitRoom:"退出房间回调",onPublish:"监听到流发布",onDataChannelPublish:"监听数据通道发布",onCloseTrack:"关闭轨道",onUpdateCall:"更新通讯状态",onUpdateStreams:"更新媒体流",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 J=D.length;for(;--J>=0;)D[J]=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,J,N,z,I){this.static_tree=D,this.extra_bits=J,this.extra_base=N,this.elems=z,this.max_length=I,this.has_stree=D&&D.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(D,J){this.dyn_tree=D,this.max_code=0,this.stat_desc=J}const d_code=D=>D<256?_dist_code[D]:_dist_code[256+(D>>>7)],put_short=(D,J)=>{D.pending_buf[D.pending++]=J&255,D.pending_buf[D.pending++]=J>>>8&255},send_bits=(D,J,N)=>{D.bi_valid>Buf_size-N?(D.bi_buf|=J<<D.bi_valid&65535,put_short(D,D.bi_buf),D.bi_buf=J>>Buf_size-D.bi_valid,D.bi_valid+=N-Buf_size):(D.bi_buf|=J<<D.bi_valid&65535,D.bi_valid+=N)},send_code=(D,J,N)=>{send_bits(D,N[J*2],N[J*2+1])},bi_reverse=(D,J)=>{let N=0;do N|=D&1,D>>>=1,N<<=1;while(--J>0);return N>>>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,J)=>{const N=J.dyn_tree,z=J.max_code,I=J.stat_desc.static_tree,O=J.stat_desc.has_stree,n=J.stat_desc.extra_bits,a=J.stat_desc.extra_base,q=J.stat_desc.max_length;let F,Z,ee,te,X,ne,ce=0;for(te=0;te<=MAX_BITS$1;te++)D.bl_count[te]=0;for(N[D.heap[D.heap_max]*2+1]=0,F=D.heap_max+1;F<HEAP_SIZE$1;F++)Z=D.heap[F],te=N[N[Z*2+1]*2+1]+1,te>q&&(te=q,ce++),N[Z*2+1]=te,!(Z>z)&&(D.bl_count[te]++,X=0,Z>=a&&(X=n[Z-a]),ne=N[Z*2],D.opt_len+=ne*(te+X),O&&(D.static_len+=ne*(I[Z*2+1]+X)));if(ce!==0){do{for(te=q-1;D.bl_count[te]===0;)te--;D.bl_count[te]--,D.bl_count[te+1]+=2,D.bl_count[q]--,ce-=2}while(ce>0);for(te=q;te!==0;te--)for(Z=D.bl_count[te];Z!==0;)ee=D.heap[--F],!(ee>z)&&(N[ee*2+1]!==te&&(D.opt_len+=(te-N[ee*2+1])*N[ee*2],N[ee*2+1]=te),Z--)}},gen_codes=(D,J,N)=>{const z=new Array(MAX_BITS$1+1);let I=0,O,n;for(O=1;O<=MAX_BITS$1;O++)I=I+N[O-1]<<1,z[O]=I;for(n=0;n<=J;n++){let a=D[n*2+1];a!==0&&(D[n*2]=bi_reverse(z[a]++,a))}},tr_static_init=()=>{let D,J,N,z,I;const O=new Array(MAX_BITS$1+1);for(N=0,z=0;z<LENGTH_CODES$1-1;z++)for(base_length[z]=N,D=0;D<1<<extra_lbits[z];D++)_length_code[N++]=z;for(_length_code[N-1]=z,I=0,z=0;z<16;z++)for(base_dist[z]=I,D=0;D<1<<extra_dbits[z];D++)_dist_code[I++]=z;for(I>>=7;z<D_CODES$1;z++)for(base_dist[z]=I<<7,D=0;D<1<<extra_dbits[z]-7;D++)_dist_code[256+I++]=z;for(J=0;J<=MAX_BITS$1;J++)O[J]=0;for(D=0;D<=143;)static_ltree[D*2+1]=8,D++,O[8]++;for(;D<=255;)static_ltree[D*2+1]=9,D++,O[9]++;for(;D<=279;)static_ltree[D*2+1]=7,D++,O[7]++;for(;D<=287;)static_ltree[D*2+1]=8,D++,O[8]++;for(gen_codes(static_ltree,L_CODES$1+1,O),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 J;for(J=0;J<L_CODES$1;J++)D.dyn_ltree[J*2]=0;for(J=0;J<D_CODES$1;J++)D.dyn_dtree[J*2]=0;for(J=0;J<BL_CODES$1;J++)D.bl_tree[J*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,J,N,z)=>{const I=J*2,O=N*2;return D[I]<D[O]||D[I]===D[O]&&z[J]<=z[N]},pqdownheap=(D,J,N)=>{const z=D.heap[N];let I=N<<1;for(;I<=D.heap_len&&(I<D.heap_len&&smaller(J,D.heap[I+1],D.heap[I],D.depth)&&I++,!smaller(J,z,D.heap[I],D.depth));)D.heap[N]=D.heap[I],N=I,I<<=1;D.heap[N]=z},compress_block=(D,J,N)=>{let z,I,O=0,n,a;if(D.sym_next!==0)do z=D.pending_buf[D.sym_buf+O++]&255,z+=(D.pending_buf[D.sym_buf+O++]&255)<<8,I=D.pending_buf[D.sym_buf+O++],z===0?send_code(D,I,J):(n=_length_code[I],send_code(D,n+LITERALS$1+1,J),a=extra_lbits[n],a!==0&&(I-=base_length[n],send_bits(D,I,a)),z--,n=d_code(z),send_code(D,n,N),a=extra_dbits[n],a!==0&&(z-=base_dist[n],send_bits(D,z,a)));while(O<D.sym_next);send_code(D,END_BLOCK,J)},build_tree=(D,J)=>{const N=J.dyn_tree,z=J.stat_desc.static_tree,I=J.stat_desc.has_stree,O=J.stat_desc.elems;let n,a,q=-1,F;for(D.heap_len=0,D.heap_max=HEAP_SIZE$1,n=0;n<O;n++)N[n*2]!==0?(D.heap[++D.heap_len]=q=n,D.depth[n]=0):N[n*2+1]=0;for(;D.heap_len<2;)F=D.heap[++D.heap_len]=q<2?++q:0,N[F*2]=1,D.depth[F]=0,D.opt_len--,I&&(D.static_len-=z[F*2+1]);for(J.max_code=q,n=D.heap_len>>1;n>=1;n--)pqdownheap(D,N,n);F=O;do n=D.heap[1],D.heap[1]=D.heap[D.heap_len--],pqdownheap(D,N,1),a=D.heap[1],D.heap[--D.heap_max]=n,D.heap[--D.heap_max]=a,N[F*2]=N[n*2]+N[a*2],D.depth[F]=(D.depth[n]>=D.depth[a]?D.depth[n]:D.depth[a])+1,N[n*2+1]=N[a*2+1]=F,D.heap[1]=F++,pqdownheap(D,N,1);while(D.heap_len>=2);D.heap[--D.heap_max]=D.heap[1],gen_bitlen(D,J),gen_codes(N,q,D.bl_count)},scan_tree=(D,J,N)=>{let z,I=-1,O,n=J[0*2+1],a=0,q=7,F=4;for(n===0&&(q=138,F=3),J[(N+1)*2+1]=65535,z=0;z<=N;z++)O=n,n=J[(z+1)*2+1],!(++a<q&&O===n)&&(a<F?D.bl_tree[O*2]+=a:O!==0?(O!==I&&D.bl_tree[O*2]++,D.bl_tree[REP_3_6*2]++):a<=10?D.bl_tree[REPZ_3_10*2]++:D.bl_tree[REPZ_11_138*2]++,a=0,I=O,n===0?(q=138,F=3):O===n?(q=6,F=3):(q=7,F=4))},send_tree=(D,J,N)=>{let z,I=-1,O,n=J[0*2+1],a=0,q=7,F=4;for(n===0&&(q=138,F=3),z=0;z<=N;z++)if(O=n,n=J[(z+1)*2+1],!(++a<q&&O===n)){if(a<F)do send_code(D,O,D.bl_tree);while(--a!==0);else O!==0?(O!==I&&(send_code(D,O,D.bl_tree),a--),send_code(D,REP_3_6,D.bl_tree),send_bits(D,a-3,2)):a<=10?(send_code(D,REPZ_3_10,D.bl_tree),send_bits(D,a-3,3)):(send_code(D,REPZ_11_138,D.bl_tree),send_bits(D,a-11,7));a=0,I=O,n===0?(q=138,F=3):O===n?(q=6,F=3):(q=7,F=4)}},build_bl_tree=D=>{let J;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),J=BL_CODES$1-1;J>=3&&D.bl_tree[bl_order[J]*2+1]===0;J--);return D.opt_len+=3*(J+1)+5+5+4,J},send_all_trees=(D,J,N,z)=>{let I;for(send_bits(D,J-257,5),send_bits(D,N-1,5),send_bits(D,z-4,4),I=0;I<z;I++)send_bits(D,D.bl_tree[bl_order[I]*2+1],3);send_tree(D,D.dyn_ltree,J-1),send_tree(D,D.dyn_dtree,N-1)},detect_data_type=D=>{let J=4093624447,N;for(N=0;N<=31;N++,J>>>=1)if(J&1&&D.dyn_ltree[N*2]!==0)return Z_BINARY;if(D.dyn_ltree[9*2]!==0||D.dyn_ltree[10*2]!==0||D.dyn_ltree[13*2]!==0)return Z_TEXT;for(N=32;N<LITERALS$1;N++)if(D.dyn_ltree[N*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,J,N,z)=>{send_bits(D,(STORED_BLOCK<<1)+(z?1:0),3),bi_windup(D),put_short(D,N),put_short(D,~N),N&&D.pending_buf.set(D.window.subarray(J,J+N),D.pending),D.pending+=N},_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,J,N,z)=>{let I,O,n=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),n=build_bl_tree(D),I=D.opt_len+3+7>>>3,O=D.static_len+3+7>>>3,O<=I&&(I=O)):I=O=N+5,N+4<=I&&J!==-1?_tr_stored_block$1(D,J,N,z):D.strategy===Z_FIXED$1||O===I?(send_bits(D,(STATIC_TREES<<1)+(z?1:0),3),compress_block(D,static_ltree,static_dtree)):(send_bits(D,(DYN_TREES<<1)+(z?1:0),3),send_all_trees(D,D.l_desc.max_code+1,D.d_desc.max_code+1,n+1),compress_block(D,D.dyn_ltree,D.dyn_dtree)),init_block(D),z&&bi_windup(D)},_tr_tally$1=(D,J,N)=>(D.pending_buf[D.sym_buf+D.sym_next++]=J,D.pending_buf[D.sym_buf+D.sym_next++]=J>>8,D.pending_buf[D.sym_buf+D.sym_next++]=N,J===0?D.dyn_ltree[N*2]++:(D.matches++,J--,D.dyn_ltree[(_length_code[N]+LITERALS$1+1)*2]++,D.dyn_dtree[d_code(J)*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,J,N,z)=>{let I=D&65535|0,O=D>>>16&65535|0,n=0;for(;N!==0;){n=N>2e3?2e3:N,N-=n;do I=I+J[z++]|0,O=O+I|0;while(--n);I%=65521,O%=65521}return I|O<<16|0};var adler32_1=adler32;const makeTable=()=>{let D,J=[];for(var N=0;N<256;N++){D=N;for(var z=0;z<8;z++)D=D&1?3988292384^D>>>1:D>>>1;J[N]=D}return J},crcTable=new Uint32Array(makeTable()),crc32=(D,J,N,z)=>{const I=crcTable,O=z+N;D^=-1;for(let n=z;n<O;n++)D=D>>>8^I[(D^J[n])&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,J)=>(D.msg=messages[J],J),rank=D=>D*2-(D>4?9:0),zero=D=>{let J=D.length;for(;--J>=0;)D[J]=0},slide_hash=D=>{let J,N,z,I=D.w_size;J=D.hash_size,z=J;do N=D.head[--z],D.head[z]=N>=I?N-I:0;while(--J);J=I,z=J;do N=D.prev[--z],D.prev[z]=N>=I?N-I:0;while(--J)};let HASH_ZLIB=(D,J,N)=>(J<<D.hash_shift^N)&D.hash_mask,HASH=HASH_ZLIB;const flush_pending=D=>{const J=D.state;let N=J.pending;N>D.avail_out&&(N=D.avail_out),N!==0&&(D.output.set(J.pending_buf.subarray(J.pending_out,J.pending_out+N),D.next_out),D.next_out+=N,J.pending_out+=N,D.total_out+=N,D.avail_out-=N,J.pending-=N,J.pending===0&&(J.pending_out=0))},flush_block_only=(D,J)=>{_tr_flush_block(D,D.block_start>=0?D.block_start:-1,D.strstart-D.block_start,J),D.block_start=D.strstart,flush_pending(D.strm)},put_byte=(D,J)=>{D.pending_buf[D.pending++]=J},putShortMSB=(D,J)=>{D.pending_buf[D.pending++]=J>>>8&255,D.pending_buf[D.pending++]=J&255},read_buf=(D,J,N,z)=>{let I=D.avail_in;return I>z&&(I=z),I===0?0:(D.avail_in-=I,J.set(D.input.subarray(D.next_in,D.next_in+I),N),D.state.wrap===1?D.adler=adler32_1(D.adler,J,I,N):D.state.wrap===2&&(D.adler=crc32_1(D.adler,J,I,N)),D.next_in+=I,D.total_in+=I,I)},longest_match=(D,J)=>{let N=D.max_chain_length,z=D.strstart,I,O,n=D.prev_length,a=D.nice_match;const q=D.strstart>D.w_size-MIN_LOOKAHEAD?D.strstart-(D.w_size-MIN_LOOKAHEAD):0,F=D.window,Z=D.w_mask,ee=D.prev,te=D.strstart+MAX_MATCH;let X=F[z+n-1],ne=F[z+n];D.prev_length>=D.good_match&&(N>>=2),a>D.lookahead&&(a=D.lookahead);do if(I=J,!(F[I+n]!==ne||F[I+n-1]!==X||F[I]!==F[z]||F[++I]!==F[z+1])){z+=2,I++;do;while(F[++z]===F[++I]&&F[++z]===F[++I]&&F[++z]===F[++I]&&F[++z]===F[++I]&&F[++z]===F[++I]&&F[++z]===F[++I]&&F[++z]===F[++I]&&F[++z]===F[++I]&&z<te);if(O=MAX_MATCH-(te-z),z=te-MAX_MATCH,O>n){if(D.match_start=J,n=O,O>=a)break;X=F[z+n-1],ne=F[z+n]}}while((J=ee[J&Z])>q&&--N!==0);return n<=D.lookahead?n:D.lookahead},fill_window=D=>{const J=D.w_size;let N,z,I;do{if(z=D.window_size-D.lookahead-D.strstart,D.strstart>=J+(J-MIN_LOOKAHEAD)&&(D.window.set(D.window.subarray(J,J+J-z),0),D.match_start-=J,D.strstart-=J,D.block_start-=J,D.insert>D.strstart&&(D.insert=D.strstart),slide_hash(D),z+=J),D.strm.avail_in===0)break;if(N=read_buf(D.strm,D.window,D.strstart+D.lookahead,z),D.lookahead+=N,D.lookahead+D.insert>=MIN_MATCH)for(I=D.strstart-D.insert,D.ins_h=D.window[I],D.ins_h=HASH(D,D.ins_h,D.window[I+1]);D.insert&&(D.ins_h=HASH(D,D.ins_h,D.window[I+MIN_MATCH-1]),D.prev[I&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=I,I++,D.insert--,!(D.lookahead+D.insert<MIN_MATCH)););}while(D.lookahead<MIN_LOOKAHEAD&&D.strm.avail_in!==0)},deflate_stored=(D,J)=>{let N=D.pending_buf_size-5>D.w_size?D.w_size:D.pending_buf_size-5,z,I,O,n=0,a=D.strm.avail_in;do{if(z=65535,O=D.bi_valid+42>>3,D.strm.avail_out<O||(O=D.strm.avail_out-O,I=D.strstart-D.block_start,z>I+D.strm.avail_in&&(z=I+D.strm.avail_in),z>O&&(z=O),z<N&&(z===0&&J!==Z_FINISH$3||J===Z_NO_FLUSH$2||z!==I+D.strm.avail_in)))break;n=J===Z_FINISH$3&&z===I+D.strm.avail_in?1:0,_tr_stored_block(D,0,0,n),D.pending_buf[D.pending-4]=z,D.pending_buf[D.pending-3]=z>>8,D.pending_buf[D.pending-2]=~z,D.pending_buf[D.pending-1]=~z>>8,flush_pending(D.strm),I&&(I>z&&(I=z),D.strm.output.set(D.window.subarray(D.block_start,D.block_start+I),D.strm.next_out),D.strm.next_out+=I,D.strm.avail_out-=I,D.strm.total_out+=I,D.block_start+=I,z-=I),z&&(read_buf(D.strm,D.strm.output,D.strm.next_out,z),D.strm.next_out+=z,D.strm.avail_out-=z,D.strm.total_out+=z)}while(n===0);return a-=D.strm.avail_in,a&&(a>=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<=a&&(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-a,D.strm.next_in),D.strstart),D.strstart+=a,D.insert+=a>D.w_size-D.insert?D.w_size-D.insert:a),D.block_start=D.strstart),D.high_water<D.strstart&&(D.high_water=D.strstart),n?BS_FINISH_DONE:J!==Z_NO_FLUSH$2&&J!==Z_FINISH$3&&D.strm.avail_in===0&&D.strstart===D.block_start?BS_BLOCK_DONE:(O=D.window_size-D.strstart,D.strm.avail_in>O&&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++,O+=D.w_size,D.insert>D.strstart&&(D.insert=D.strstart)),O>D.strm.avail_in&&(O=D.strm.avail_in),O&&(read_buf(D.strm,D.window,D.strstart,O),D.strstart+=O,D.insert+=O>D.w_size-D.insert?D.w_size-D.insert:O),D.high_water<D.strstart&&(D.high_water=D.strstart),O=D.bi_valid+42>>3,O=D.pending_buf_size-O>65535?65535:D.pending_buf_size-O,N=O>D.w_size?D.w_size:O,I=D.strstart-D.block_start,(I>=N||(I||J===Z_FINISH$3)&&J!==Z_NO_FLUSH$2&&D.strm.avail_in===0&&I<=O)&&(z=I>O?O:I,n=J===Z_FINISH$3&&D.strm.avail_in===0&&z===I?1:0,_tr_stored_block(D,D.block_start,z,n),D.block_start+=z,flush_pending(D.strm)),n?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(D,J)=>{let N,z;for(;;){if(D.lookahead<MIN_LOOKAHEAD){if(fill_window(D),D.lookahead<MIN_LOOKAHEAD&&J===Z_NO_FLUSH$2)return BS_NEED_MORE;if(D.lookahead===0)break}if(N=0,D.lookahead>=MIN_MATCH&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),N=D.prev[D.strstart&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=D.strstart),N!==0&&D.strstart-N<=D.w_size-MIN_LOOKAHEAD&&(D.match_length=longest_match(D,N)),D.match_length>=MIN_MATCH)if(z=_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]),N=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 z=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++;if(z&&(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,J===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,J)=>{let N,z,I;for(;;){if(D.lookahead<MIN_LOOKAHEAD){if(fill_window(D),D.lookahead<MIN_LOOKAHEAD&&J===Z_NO_FLUSH$2)return BS_NEED_MORE;if(D.lookahead===0)break}if(N=0,D.lookahead>=MIN_MATCH&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),N=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,N!==0&&D.prev_length<D.max_lazy_match&&D.strstart-N<=D.w_size-MIN_LOOKAHEAD&&(D.match_length=longest_match(D,N),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){I=D.strstart+D.lookahead-MIN_MATCH,z=_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<=I&&(D.ins_h=HASH(D,D.ins_h,D.window[D.strstart+MIN_MATCH-1]),N=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++,z&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}else if(D.match_available){if(z=_tr_tally(D,0,D.window[D.strstart-1]),z&&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&&(z=_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,J===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,J)=>{let N,z,I,O;const n=D.window;for(;;){if(D.lookahead<=MAX_MATCH){if(fill_window(D),D.lookahead<=MAX_MATCH&&J===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&&(I=D.strstart-1,z=n[I],z===n[++I]&&z===n[++I]&&z===n[++I])){O=D.strstart+MAX_MATCH;do;while(z===n[++I]&&z===n[++I]&&z===n[++I]&&z===n[++I]&&z===n[++I]&&z===n[++I]&&z===n[++I]&&z===n[++I]&&I<O);D.match_length=MAX_MATCH-(O-I),D.match_length>D.lookahead&&(D.match_length=D.lookahead)}if(D.match_length>=MIN_MATCH?(N=_tr_tally(D,1,D.match_length-MIN_MATCH),D.lookahead-=D.match_length,D.strstart+=D.match_length,D.match_length=0):(N=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++),N&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}return D.insert=0,J===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,J)=>{let N;for(;;){if(D.lookahead===0&&(fill_window(D),D.lookahead===0)){if(J===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(D.match_length=0,N=_tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++,N&&(flush_block_only(D,!1),D.strm.avail_out===0))return BS_NEED_MORE}return D.insert=0,J===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,J,N,z,I){this.good_length=D,this.max_lazy=J,this.nice_length=N,this.max_chain=z,this.func=I}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 J=D.state;return!J||J.strm!==D||J.status!==INIT_STATE&&J.status!==GZIP_STATE&&J.status!==EXTRA_STATE&&J.status!==NAME_STATE&&J.status!==COMMENT_STATE&&J.status!==HCRC_STATE&&J.status!==BUSY_STATE&&J.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 J=D.state;return J.pending=0,J.pending_out=0,J.wrap<0&&(J.wrap=-J.wrap),J.status=J.wrap===2?GZIP_STATE:J.wrap?INIT_STATE:BUSY_STATE,D.adler=J.wrap===2?0:1,J.last_flush=-2,_tr_init(J),Z_OK$3},deflateReset=D=>{const J=deflateResetKeep(D);return J===Z_OK$3&&lm_init(D.state),J},deflateSetHeader=(D,J)=>deflateStateCheck(D)||D.state.wrap!==2?Z_STREAM_ERROR$2:(D.state.gzhead=J,Z_OK$3),deflateInit2=(D,J,N,z,I,O)=>{if(!D)return Z_STREAM_ERROR$2;let n=1;if(J===Z_DEFAULT_COMPRESSION$1&&(J=6),z<0?(n=0,z=-z):z>15&&(n=2,z-=16),I<1||I>MAX_MEM_LEVEL||N!==Z_DEFLATED$2||z<8||z>15||J<0||J>9||O<0||O>Z_FIXED||z===8&&n!==1)return err(D,Z_STREAM_ERROR$2);z===8&&(z=9);const a=new DeflateState;return D.state=a,a.strm=D,a.status=INIT_STATE,a.wrap=n,a.gzhead=null,a.w_bits=z,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=I+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+MIN_MATCH-1)/MIN_MATCH),a.window=new Uint8Array(a.w_size*2),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<I+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=(a.lit_bufsize-1)*3,a.level=J,a.strategy=O,a.method=N,deflateReset(D)},deflateInit=(D,J)=>deflateInit2(D,J,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(D,J)=>{if(deflateStateCheck(D)||J>Z_BLOCK$1||J<0)return D?err(D,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const N=D.state;if(!D.output||D.avail_in!==0&&!D.input||N.status===FINISH_STATE&&J!==Z_FINISH$3)return err(D,D.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const z=N.last_flush;if(N.last_flush=J,N.pending!==0){if(flush_pending(D),D.avail_out===0)return N.last_flush=-1,Z_OK$3}else if(D.avail_in===0&&rank(J)<=rank(z)&&J!==Z_FINISH$3)return err(D,Z_BUF_ERROR$1);if(N.status===FINISH_STATE&&D.avail_in!==0)return err(D,Z_BUF_ERROR$1);if(N.status===INIT_STATE&&N.wrap===0&&(N.status=BUSY_STATE),N.status===INIT_STATE){let I=Z_DEFLATED$2+(N.w_bits-8<<4)<<8,O=-1;if(N.strategy>=Z_HUFFMAN_ONLY||N.level<2?O=0:N.level<6?O=1:N.level===6?O=2:O=3,I|=O<<6,N.strstart!==0&&(I|=PRESET_DICT),I+=31-I%31,putShortMSB(N,I),N.strstart!==0&&(putShortMSB(N,D.adler>>>16),putShortMSB(N,D.adler&65535)),D.adler=1,N.status=BUSY_STATE,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3}if(N.status===GZIP_STATE){if(D.adler=0,put_byte(N,31),put_byte(N,139),put_byte(N,8),N.gzhead)put_byte(N,(N.gzhead.text?1:0)+(N.gzhead.hcrc?2:0)+(N.gzhead.extra?4:0)+(N.gzhead.name?8:0)+(N.gzhead.comment?16:0)),put_byte(N,N.gzhead.time&255),put_byte(N,N.gzhead.time>>8&255),put_byte(N,N.gzhead.time>>16&255),put_byte(N,N.gzhead.time>>24&255),put_byte(N,N.level===9?2:N.strategy>=Z_HUFFMAN_ONLY||N.level<2?4:0),put_byte(N,N.gzhead.os&255),N.gzhead.extra&&N.gzhead.extra.length&&(put_byte(N,N.gzhead.extra.length&255),put_byte(N,N.gzhead.extra.length>>8&255)),N.gzhead.hcrc&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending,0)),N.gzindex=0,N.status=EXTRA_STATE;else if(put_byte(N,0),put_byte(N,0),put_byte(N,0),put_byte(N,0),put_byte(N,0),put_byte(N,N.level===9?2:N.strategy>=Z_HUFFMAN_ONLY||N.level<2?4:0),put_byte(N,OS_CODE),N.status=BUSY_STATE,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3}if(N.status===EXTRA_STATE){if(N.gzhead.extra){let I=N.pending,O=(N.gzhead.extra.length&65535)-N.gzindex;for(;N.pending+O>N.pending_buf_size;){let a=N.pending_buf_size-N.pending;if(N.pending_buf.set(N.gzhead.extra.subarray(N.gzindex,N.gzindex+a),N.pending),N.pending=N.pending_buf_size,N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),N.gzindex+=a,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3;I=0,O-=a}let n=new Uint8Array(N.gzhead.extra);N.pending_buf.set(n.subarray(N.gzindex,N.gzindex+O),N.pending),N.pending+=O,N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),N.gzindex=0}N.status=NAME_STATE}if(N.status===NAME_STATE){if(N.gzhead.name){let I=N.pending,O;do{if(N.pending===N.pending_buf_size){if(N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3;I=0}N.gzindex<N.gzhead.name.length?O=N.gzhead.name.charCodeAt(N.gzindex++)&255:O=0,put_byte(N,O)}while(O!==0);N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),N.gzindex=0}N.status=COMMENT_STATE}if(N.status===COMMENT_STATE){if(N.gzhead.comment){let I=N.pending,O;do{if(N.pending===N.pending_buf_size){if(N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I)),flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3;I=0}N.gzindex<N.gzhead.comment.length?O=N.gzhead.comment.charCodeAt(N.gzindex++)&255:O=0,put_byte(N,O)}while(O!==0);N.gzhead.hcrc&&N.pending>I&&(D.adler=crc32_1(D.adler,N.pending_buf,N.pending-I,I))}N.status=HCRC_STATE}if(N.status===HCRC_STATE){if(N.gzhead.hcrc){if(N.pending+2>N.pending_buf_size&&(flush_pending(D),N.pending!==0))return N.last_flush=-1,Z_OK$3;put_byte(N,D.adler&255),put_byte(N,D.adler>>8&255),D.adler=0}if(N.status=BUSY_STATE,flush_pending(D),N.pending!==0)return N.last_flush=-1,Z_OK$3}if(D.avail_in!==0||N.lookahead!==0||J!==Z_NO_FLUSH$2&&N.status!==FINISH_STATE){let I=N.level===0?deflate_stored(N,J):N.strategy===Z_HUFFMAN_ONLY?deflate_huff(N,J):N.strategy===Z_RLE?deflate_rle(N,J):configuration_table[N.level].func(N,J);if((I===BS_FINISH_STARTED||I===BS_FINISH_DONE)&&(N.status=FINISH_STATE),I===BS_NEED_MORE||I===BS_FINISH_STARTED)return D.avail_out===0&&(N.last_flush=-1),Z_OK$3;if(I===BS_BLOCK_DONE&&(J===Z_PARTIAL_FLUSH?_tr_align(N):J!==Z_BLOCK$1&&(_tr_stored_block(N,0,0,!1),J===Z_FULL_FLUSH$1&&(zero(N.head),N.lookahead===0&&(N.strstart=0,N.block_start=0,N.insert=0))),flush_pending(D),D.avail_out===0))return N.last_flush=-1,Z_OK$3}return J!==Z_FINISH$3?Z_OK$3:N.wrap<=0?Z_STREAM_END$3:(N.wrap===2?(put_byte(N,D.adler&255),put_byte(N,D.adler>>8&255),put_byte(N,D.adler>>16&255),put_byte(N,D.adler>>24&255),put_byte(N,D.total_in&255),put_byte(N,D.total_in>>8&255),put_byte(N,D.total_in>>16&255),put_byte(N,D.total_in>>24&255)):(putShortMSB(N,D.adler>>>16),putShortMSB(N,D.adler&65535)),flush_pending(D),N.wrap>0&&(N.wrap=-N.wrap),N.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=D=>{if(deflateStateCheck(D))return Z_STREAM_ERROR$2;const J=D.state.status;return D.state=null,J===BUSY_STATE?err(D,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(D,J)=>{let N=J.length;if(deflateStateCheck(D))return Z_STREAM_ERROR$2;const z=D.state,I=z.wrap;if(I===2||I===1&&z.status!==INIT_STATE||z.lookahead)return Z_STREAM_ERROR$2;if(I===1&&(D.adler=adler32_1(D.adler,J,N,0)),z.wrap=0,N>=z.w_size){I===0&&(zero(z.head),z.strstart=0,z.block_start=0,z.insert=0);let q=new Uint8Array(z.w_size);q.set(J.subarray(N-z.w_size,N),0),J=q,N=z.w_size}const O=D.avail_in,n=D.next_in,a=D.input;for(D.avail_in=N,D.next_in=0,D.input=J,fill_window(z);z.lookahead>=MIN_MATCH;){let q=z.strstart,F=z.lookahead-(MIN_MATCH-1);do z.ins_h=HASH(z,z.ins_h,z.window[q+MIN_MATCH-1]),z.prev[q&z.w_mask]=z.head[z.ins_h],z.head[z.ins_h]=q,q++;while(--F);z.strstart=q,z.lookahead=MIN_MATCH-1,fill_window(z)}return z.strstart+=z.lookahead,z.block_start=z.strstart,z.insert=z.lookahead,z.lookahead=0,z.match_length=z.prev_length=MIN_MATCH-1,z.match_available=0,D.next_in=n,D.input=a,D.avail_in=O,z.wrap=I,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,J)=>Object.prototype.hasOwnProperty.call(D,J);var assign=function(D){const J=Array.prototype.slice.call(arguments,1);for(;J.length;){const N=J.shift();if(N){if(typeof N!="object")throw new TypeError(N+"must be non-object");for(const z in N)_has(N,z)&&(D[z]=N[z])}}return D},flattenChunks=D=>{let J=0;for(let z=0,I=D.length;z<I;z++)J+=D[z].length;const N=new Uint8Array(J);for(let z=0,I=0,O=D.length;z<O;z++){let n=D[z];N.set(n,I),I+=n.length}return N},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 J,N,z,I,O,n=D.length,a=0;for(I=0;I<n;I++)N=D.charCodeAt(I),(N&64512)===55296&&I+1<n&&(z=D.charCodeAt(I+1),(z&64512)===56320&&(N=65536+(N-55296<<10)+(z-56320),I++)),a+=N<128?1:N<2048?2:N<65536?3:4;for(J=new Uint8Array(a),O=0,I=0;O<a;I++)N=D.charCodeAt(I),(N&64512)===55296&&I+1<n&&(z=D.charCodeAt(I+1),(z&64512)===56320&&(N=65536+(N-55296<<10)+(z-56320),I++)),N<128?J[O++]=N:N<2048?(J[O++]=192|N>>>6,J[O++]=128|N&63):N<65536?(J[O++]=224|N>>>12,J[O++]=128|N>>>6&63,J[O++]=128|N&63):(J[O++]=240|N>>>18,J[O++]=128|N>>>12&63,J[O++]=128|N>>>6&63,J[O++]=128|N&63);return J};const buf2binstring=(D,J)=>{if(J<65534&&D.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,D.length===J?D:D.subarray(0,J));let N="";for(let z=0;z<J;z++)N+=String.fromCharCode(D[z]);return N};var buf2string=(D,J)=>{const N=J||D.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(D.subarray(0,J));let z,I;const O=new Array(N*2);for(I=0,z=0;z<N;){let n=D[z++];if(n<128){O[I++]=n;continue}let a=_utf8len[n];if(a>4){O[I++]=65533,z+=a-1;continue}for(n&=a===2?31:a===3?15:7;a>1&&z<N;)n=n<<6|D[z++]&63,a--;if(a>1){O[I++]=65533;continue}n<65536?O[I++]=n:(n-=65536,O[I++]=55296|n>>10&1023,O[I++]=56320|n&1023)}return buf2binstring(O,I)},utf8border=(D,J)=>{J=J||D.length,J>D.length&&(J=D.length);let N=J-1;for(;N>=0&&(D[N]&192)===128;)N--;return N<0||N===0?J:N+_utf8len[D[N]]>J?N:J},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 J=this.options;J.raw&&J.windowBits>0?J.windowBits=-J.windowBits:J.gzip&&J.windowBits>0&&J.windowBits<16&&(J.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let N=deflate_1$2.deflateInit2(this.strm,J.level,J.method,J.windowBits,J.memLevel,J.strategy);if(N!==Z_OK$2)throw new Error(messages[N]);if(J.header&&deflate_1$2.deflateSetHeader(this.strm,J.header),J.dictionary){let z;if(typeof J.dictionary=="string"?z=strings.string2buf(J.dictionary):toString$1.call(J.dictionary)==="[object ArrayBuffer]"?z=new Uint8Array(J.dictionary):z=J.dictionary,N=deflate_1$2.deflateSetDictionary(this.strm,z),N!==Z_OK$2)throw new Error(messages[N]);this._dict_set=!0}}Deflate$1.prototype.push=function(D,J){const N=this.strm,z=this.options.chunkSize;let I,O;if(this.ended)return!1;for(J===~~J?O=J:O=J===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof D=="string"?N.input=strings.string2buf(D):toString$1.call(D)==="[object ArrayBuffer]"?N.input=new Uint8Array(D):N.input=D,N.next_in=0,N.avail_in=N.input.length;;){if(N.avail_out===0&&(N.output=new Uint8Array(z),N.next_out=0,N.avail_out=z),(O===Z_SYNC_FLUSH||O===Z_FULL_FLUSH)&&N.avail_out<=6){this.onData(N.output.subarray(0,N.next_out)),N.avail_out=0;continue}if(I=deflate_1$2.deflate(N,O),I===Z_STREAM_END$2)return N.next_out>0&&this.onData(N.output.subarray(0,N.next_out)),I=deflate_1$2.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===Z_OK$2;if(N.avail_out===0){this.onData(N.output);continue}if(O>0&&N.next_out>0){this.onData(N.output.subarray(0,N.next_out)),N.avail_out=0;continue}if(N.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,J){const N=new Deflate$1(J);if(N.push(D,!0),N.err)throw N.msg||messages[N.err];return N.result}function deflateRaw$1(D,J){return J=J||{},J.raw=!0,deflate$1(D,J)}function gzip$1(D,J){return J=J||{},J.gzip=!0,deflate$1(D,J)}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(J,N){let z,I,O,n,a,q,F,Z,ee,te,X,ne,ce,oe,se,ye,ke,ae,de,_e,me,ve,ge,le;const fe=J.state;z=J.next_in,ge=J.input,I=z+(J.avail_in-5),O=J.next_out,le=J.output,n=O-(N-J.avail_out),a=O+(J.avail_out-257),q=fe.dmax,F=fe.wsize,Z=fe.whave,ee=fe.wnext,te=fe.window,X=fe.hold,ne=fe.bits,ce=fe.lencode,oe=fe.distcode,se=(1<<fe.lenbits)-1,ye=(1<<fe.distbits)-1;e:do{ne<15&&(X+=ge[z++]<<ne,ne+=8,X+=ge[z++]<<ne,ne+=8),ke=ce[X&se];t:for(;;){if(ae=ke>>>24,X>>>=ae,ne-=ae,ae=ke>>>16&255,ae===0)le[O++]=ke&65535;else if(ae&16){de=ke&65535,ae&=15,ae&&(ne<ae&&(X+=ge[z++]<<ne,ne+=8),de+=X&(1<<ae)-1,X>>>=ae,ne-=ae),ne<15&&(X+=ge[z++]<<ne,ne+=8,X+=ge[z++]<<ne,ne+=8),ke=oe[X&ye];i:for(;;){if(ae=ke>>>24,X>>>=ae,ne-=ae,ae=ke>>>16&255,ae&16){if(_e=ke&65535,ae&=15,ne<ae&&(X+=ge[z++]<<ne,ne+=8,ne<ae&&(X+=ge[z++]<<ne,ne+=8)),_e+=X&(1<<ae)-1,_e>q){J.msg="invalid distance too far back",fe.mode=BAD$1;break e}if(X>>>=ae,ne-=ae,ae=O-n,_e>ae){if(ae=_e-ae,ae>Z&&fe.sane){J.msg="invalid distance too far back",fe.mode=BAD$1;break e}if(me=0,ve=te,ee===0){if(me+=F-ae,ae<de){de-=ae;do le[O++]=te[me++];while(--ae);me=O-_e,ve=le}}else if(ee<ae){if(me+=F+ee-ae,ae-=ee,ae<de){de-=ae;do le[O++]=te[me++];while(--ae);if(me=0,ee<de){ae=ee,de-=ae;do le[O++]=te[me++];while(--ae);me=O-_e,ve=le}}}else if(me+=ee-ae,ae<de){de-=ae;do le[O++]=te[me++];while(--ae);me=O-_e,ve=le}for(;de>2;)le[O++]=ve[me++],le[O++]=ve[me++],le[O++]=ve[me++],de-=3;de&&(le[O++]=ve[me++],de>1&&(le[O++]=ve[me++]))}else{me=O-_e;do le[O++]=le[me++],le[O++]=le[me++],le[O++]=le[me++],de-=3;while(de>2);de&&(le[O++]=le[me++],de>1&&(le[O++]=le[me++]))}}else if((ae&64)===0){ke=oe[(ke&65535)+(X&(1<<ae)-1)];continue i}else{J.msg="invalid distance code",fe.mode=BAD$1;break e}break}}else if((ae&64)===0){ke=ce[(ke&65535)+(X&(1<<ae)-1)];continue t}else if(ae&32){fe.mode=TYPE$1;break e}else{J.msg="invalid literal/length code",fe.mode=BAD$1;break e}break}}while(z<I&&O<a);de=ne>>3,z-=de,ne-=de<<3,X&=(1<<ne)-1,J.next_in=z,J.next_out=O,J.avail_in=z<I?5+(I-z):5-(z-I),J.avail_out=O<a?257+(a-O):257-(O-a),fe.hold=X,fe.bits=ne};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,J,N,z,I,O,n,a)=>{const q=a.bits;let F=0,Z=0,ee=0,te=0,X=0,ne=0,ce=0,oe=0,se=0,ye=0,ke,ae,de,_e,me,ve=null,ge;const le=new Uint16Array(MAXBITS+1),fe=new Uint16Array(MAXBITS+1);let Se=null,Te,$e,Me;for(F=0;F<=MAXBITS;F++)le[F]=0;for(Z=0;Z<z;Z++)le[J[N+Z]]++;for(X=q,te=MAXBITS;te>=1&&le[te]===0;te--);if(X>te&&(X=te),te===0)return I[O++]=1<<24|64<<16|0,I[O++]=1<<24|64<<16|0,a.bits=1,0;for(ee=1;ee<te&&le[ee]===0;ee++);for(X<ee&&(X=ee),oe=1,F=1;F<=MAXBITS;F++)if(oe<<=1,oe-=le[F],oe<0)return-1;if(oe>0&&(D===CODES$1||te!==1))return-1;for(fe[1]=0,F=1;F<MAXBITS;F++)fe[F+1]=fe[F]+le[F];for(Z=0;Z<z;Z++)J[N+Z]!==0&&(n[fe[J[N+Z]]++]=Z);if(D===CODES$1?(ve=Se=n,ge=20):D===LENS$1?(ve=lbase,Se=lext,ge=257):(ve=dbase,Se=dext,ge=0),ye=0,Z=0,F=ee,me=O,ne=X,ce=0,de=-1,se=1<<X,_e=se-1,D===LENS$1&&se>ENOUGH_LENS$1||D===DISTS$1&&se>ENOUGH_DISTS$1)return 1;for(;;){Te=F-ce,n[Z]+1<ge?($e=0,Me=n[Z]):n[Z]>=ge?($e=Se[n[Z]-ge],Me=ve[n[Z]-ge]):($e=96,Me=0),ke=1<<F-ce,ae=1<<ne,ee=ae;do ae-=ke,I[me+(ye>>ce)+ae]=Te<<24|$e<<16|Me|0;while(ae!==0);for(ke=1<<F-1;ye&ke;)ke>>=1;if(ke!==0?(ye&=ke-1,ye+=ke):ye=0,Z++,--le[F]===0){if(F===te)break;F=J[N+n[Z]]}if(F>X&&(ye&_e)!==de){for(ce===0&&(ce=X),me+=ee,ne=F-ce,oe=1<<ne;ne+ce<te&&(oe-=le[ne+ce],!(oe<=0));)ne++,oe<<=1;if(se+=1<<ne,D===LENS$1&&se>ENOUGH_LENS$1||D===DISTS$1&&se>ENOUGH_DISTS$1)return 1;de=ye&_e,I[de]=X<<24|ne<<16|me-O|0}}return ye!==0&&(I[me+ye]=F-ce<<24|64<<16|0),a.bits=X,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 J=D.state;return!J||J.strm!==D||J.mode<HEAD||J.mode>SYNC?1:0},inflateResetKeep=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const J=D.state;return D.total_in=D.total_out=J.total=0,D.msg="",J.wrap&&(D.adler=J.wrap&1),J.mode=HEAD,J.last=0,J.havedict=0,J.flags=-1,J.dmax=32768,J.head=null,J.hold=0,J.bits=0,J.lencode=J.lendyn=new Int32Array(ENOUGH_LENS),J.distcode=J.distdyn=new Int32Array(ENOUGH_DISTS),J.sane=1,J.back=-1,Z_OK$1},inflateReset=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const J=D.state;return J.wsize=0,J.whave=0,J.wnext=0,inflateResetKeep(D)},inflateReset2=(D,J)=>{let N;if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const z=D.state;return J<0?(N=0,J=-J):(N=(J>>4)+5,J<48&&(J&=15)),J&&(J<8||J>15)?Z_STREAM_ERROR$1:(z.window!==null&&z.wbits!==J&&(z.window=null),z.wrap=N,z.wbits=J,inflateReset(D))},inflateInit2=(D,J)=>{if(!D)return Z_STREAM_ERROR$1;const N=new InflateState;D.state=N,N.strm=D,N.window=null,N.mode=HEAD;const z=inflateReset2(D,J);return z!==Z_OK$1&&(D.state=null),z},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 J=0;for(;J<144;)D.lens[J++]=8;for(;J<256;)D.lens[J++]=9;for(;J<280;)D.lens[J++]=7;for(;J<288;)D.lens[J++]=8;for(inftrees(LENS,D.lens,0,288,lenfix,0,D.work,{bits:9}),J=0;J<32;)D.lens[J++]=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,J,N,z)=>{let I;const O=D.state;return O.window===null&&(O.wsize=1<<O.wbits,O.wnext=0,O.whave=0,O.window=new Uint8Array(O.wsize)),z>=O.wsize?(O.window.set(J.subarray(N-O.wsize,N),0),O.wnext=0,O.whave=O.wsize):(I=O.wsize-O.wnext,I>z&&(I=z),O.window.set(J.subarray(N-z,N-z+I),O.wnext),z-=I,z?(O.window.set(J.subarray(N-z,N),0),O.wnext=z,O.whave=O.wsize):(O.wnext+=I,O.wnext===O.wsize&&(O.wnext=0),O.whave<O.wsize&&(O.whave+=I))),0},inflate$2=(D,J)=>{let N,z,I,O,n,a,q,F,Z,ee,te,X,ne,ce,oe=0,se,ye,ke,ae,de,_e,me,ve;const ge=new Uint8Array(4);let le,fe;const Se=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;N=D.state,N.mode===TYPE&&(N.mode=TYPEDO),n=D.next_out,I=D.output,q=D.avail_out,O=D.next_in,z=D.input,a=D.avail_in,F=N.hold,Z=N.bits,ee=a,te=q,ve=Z_OK$1;e:for(;;)switch(N.mode){case HEAD:if(N.wrap===0){N.mode=TYPEDO;break}for(;Z<16;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(N.wrap&2&&F===35615){N.wbits===0&&(N.wbits=15),N.check=0,ge[0]=F&255,ge[1]=F>>>8&255,N.check=crc32_1(N.check,ge,2,0),F=0,Z=0,N.mode=FLAGS;break}if(N.head&&(N.head.done=!1),!(N.wrap&1)||(((F&255)<<8)+(F>>8))%31){D.msg="incorrect header check",N.mode=BAD;break}if((F&15)!==Z_DEFLATED){D.msg="unknown compression method",N.mode=BAD;break}if(F>>>=4,Z-=4,me=(F&15)+8,N.wbits===0&&(N.wbits=me),me>15||me>N.wbits){D.msg="invalid window size",N.mode=BAD;break}N.dmax=1<<N.wbits,N.flags=0,D.adler=N.check=1,N.mode=F&512?DICTID:TYPE,F=0,Z=0;break;case FLAGS:for(;Z<16;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(N.flags=F,(N.flags&255)!==Z_DEFLATED){D.msg="unknown compression method",N.mode=BAD;break}if(N.flags&57344){D.msg="unknown header flags set",N.mode=BAD;break}N.head&&(N.head.text=F>>8&1),N.flags&512&&N.wrap&4&&(ge[0]=F&255,ge[1]=F>>>8&255,N.check=crc32_1(N.check,ge,2,0)),F=0,Z=0,N.mode=TIME;case TIME:for(;Z<32;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}N.head&&(N.head.time=F),N.flags&512&&N.wrap&4&&(ge[0]=F&255,ge[1]=F>>>8&255,ge[2]=F>>>16&255,ge[3]=F>>>24&255,N.check=crc32_1(N.check,ge,4,0)),F=0,Z=0,N.mode=OS;case OS:for(;Z<16;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}N.head&&(N.head.xflags=F&255,N.head.os=F>>8),N.flags&512&&N.wrap&4&&(ge[0]=F&255,ge[1]=F>>>8&255,N.check=crc32_1(N.check,ge,2,0)),F=0,Z=0,N.mode=EXLEN;case EXLEN:if(N.flags&1024){for(;Z<16;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}N.length=F,N.head&&(N.head.extra_len=F),N.flags&512&&N.wrap&4&&(ge[0]=F&255,ge[1]=F>>>8&255,N.check=crc32_1(N.check,ge,2,0)),F=0,Z=0}else N.head&&(N.head.extra=null);N.mode=EXTRA;case EXTRA:if(N.flags&1024&&(X=N.length,X>a&&(X=a),X&&(N.head&&(me=N.head.extra_len-N.length,N.head.extra||(N.head.extra=new Uint8Array(N.head.extra_len)),N.head.extra.set(z.subarray(O,O+X),me)),N.flags&512&&N.wrap&4&&(N.check=crc32_1(N.check,z,X,O)),a-=X,O+=X,N.length-=X),N.length))break e;N.length=0,N.mode=NAME;case NAME:if(N.flags&2048){if(a===0)break e;X=0;do me=z[O+X++],N.head&&me&&N.length<65536&&(N.head.name+=String.fromCharCode(me));while(me&&X<a);if(N.flags&512&&N.wrap&4&&(N.check=crc32_1(N.check,z,X,O)),a-=X,O+=X,me)break e}else N.head&&(N.head.name=null);N.length=0,N.mode=COMMENT;case COMMENT:if(N.flags&4096){if(a===0)break e;X=0;do me=z[O+X++],N.head&&me&&N.length<65536&&(N.head.comment+=String.fromCharCode(me));while(me&&X<a);if(N.flags&512&&N.wrap&4&&(N.check=crc32_1(N.check,z,X,O)),a-=X,O+=X,me)break e}else N.head&&(N.head.comment=null);N.mode=HCRC;case HCRC:if(N.flags&512){for(;Z<16;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(N.wrap&4&&F!==(N.check&65535)){D.msg="header crc mismatch",N.mode=BAD;break}F=0,Z=0}N.head&&(N.head.hcrc=N.flags>>9&1,N.head.done=!0),D.adler=N.check=0,N.mode=TYPE;break;case DICTID:for(;Z<32;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}D.adler=N.check=zswap32(F),F=0,Z=0,N.mode=DICT;case DICT:if(N.havedict===0)return D.next_out=n,D.avail_out=q,D.next_in=O,D.avail_in=a,N.hold=F,N.bits=Z,Z_NEED_DICT$1;D.adler=N.check=1,N.mode=TYPE;case TYPE:if(J===Z_BLOCK||J===Z_TREES)break e;case TYPEDO:if(N.last){F>>>=Z&7,Z-=Z&7,N.mode=CHECK;break}for(;Z<3;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}switch(N.last=F&1,F>>>=1,Z-=1,F&3){case 0:N.mode=STORED;break;case 1:if(fixedtables(N),N.mode=LEN_,J===Z_TREES){F>>>=2,Z-=2;break e}break;case 2:N.mode=TABLE;break;case 3:D.msg="invalid block type",N.mode=BAD}F>>>=2,Z-=2;break;case STORED:for(F>>>=Z&7,Z-=Z&7;Z<32;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if((F&65535)!==(F>>>16^65535)){D.msg="invalid stored block lengths",N.mode=BAD;break}if(N.length=F&65535,F=0,Z=0,N.mode=COPY_,J===Z_TREES)break e;case COPY_:N.mode=COPY;case COPY:if(X=N.length,X){if(X>a&&(X=a),X>q&&(X=q),X===0)break e;I.set(z.subarray(O,O+X),n),a-=X,O+=X,q-=X,n+=X,N.length-=X;break}N.mode=TYPE;break;case TABLE:for(;Z<14;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(N.nlen=(F&31)+257,F>>>=5,Z-=5,N.ndist=(F&31)+1,F>>>=5,Z-=5,N.ncode=(F&15)+4,F>>>=4,Z-=4,N.nlen>286||N.ndist>30){D.msg="too many length or distance symbols",N.mode=BAD;break}N.have=0,N.mode=LENLENS;case LENLENS:for(;N.have<N.ncode;){for(;Z<3;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}N.lens[Se[N.have++]]=F&7,F>>>=3,Z-=3}for(;N.have<19;)N.lens[Se[N.have++]]=0;if(N.lencode=N.lendyn,N.lenbits=7,le={bits:N.lenbits},ve=inftrees(CODES,N.lens,0,19,N.lencode,0,N.work,le),N.lenbits=le.bits,ve){D.msg="invalid code lengths set",N.mode=BAD;break}N.have=0,N.mode=CODELENS;case CODELENS:for(;N.have<N.nlen+N.ndist;){for(;oe=N.lencode[F&(1<<N.lenbits)-1],se=oe>>>24,ye=oe>>>16&255,ke=oe&65535,!(se<=Z);){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(ke<16)F>>>=se,Z-=se,N.lens[N.have++]=ke;else{if(ke===16){for(fe=se+2;Z<fe;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(F>>>=se,Z-=se,N.have===0){D.msg="invalid bit length repeat",N.mode=BAD;break}me=N.lens[N.have-1],X=3+(F&3),F>>>=2,Z-=2}else if(ke===17){for(fe=se+3;Z<fe;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}F>>>=se,Z-=se,me=0,X=3+(F&7),F>>>=3,Z-=3}else{for(fe=se+7;Z<fe;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}F>>>=se,Z-=se,me=0,X=11+(F&127),F>>>=7,Z-=7}if(N.have+X>N.nlen+N.ndist){D.msg="invalid bit length repeat",N.mode=BAD;break}for(;X--;)N.lens[N.have++]=me}}if(N.mode===BAD)break;if(N.lens[256]===0){D.msg="invalid code -- missing end-of-block",N.mode=BAD;break}if(N.lenbits=9,le={bits:N.lenbits},ve=inftrees(LENS,N.lens,0,N.nlen,N.lencode,0,N.work,le),N.lenbits=le.bits,ve){D.msg="invalid literal/lengths set",N.mode=BAD;break}if(N.distbits=6,N.distcode=N.distdyn,le={bits:N.distbits},ve=inftrees(DISTS,N.lens,N.nlen,N.ndist,N.distcode,0,N.work,le),N.distbits=le.bits,ve){D.msg="invalid distances set",N.mode=BAD;break}if(N.mode=LEN_,J===Z_TREES)break e;case LEN_:N.mode=LEN;case LEN:if(a>=6&&q>=258){D.next_out=n,D.avail_out=q,D.next_in=O,D.avail_in=a,N.hold=F,N.bits=Z,inffast(D,te),n=D.next_out,I=D.output,q=D.avail_out,O=D.next_in,z=D.input,a=D.avail_in,F=N.hold,Z=N.bits,N.mode===TYPE&&(N.back=-1);break}for(N.back=0;oe=N.lencode[F&(1<<N.lenbits)-1],se=oe>>>24,ye=oe>>>16&255,ke=oe&65535,!(se<=Z);){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(ye&&(ye&240)===0){for(ae=se,de=ye,_e=ke;oe=N.lencode[_e+((F&(1<<ae+de)-1)>>ae)],se=oe>>>24,ye=oe>>>16&255,ke=oe&65535,!(ae+se<=Z);){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}F>>>=ae,Z-=ae,N.back+=ae}if(F>>>=se,Z-=se,N.back+=se,N.length=ke,ye===0){N.mode=LIT;break}if(ye&32){N.back=-1,N.mode=TYPE;break}if(ye&64){D.msg="invalid literal/length code",N.mode=BAD;break}N.extra=ye&15,N.mode=LENEXT;case LENEXT:if(N.extra){for(fe=N.extra;Z<fe;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}N.length+=F&(1<<N.extra)-1,F>>>=N.extra,Z-=N.extra,N.back+=N.extra}N.was=N.length,N.mode=DIST;case DIST:for(;oe=N.distcode[F&(1<<N.distbits)-1],se=oe>>>24,ye=oe>>>16&255,ke=oe&65535,!(se<=Z);){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if((ye&240)===0){for(ae=se,de=ye,_e=ke;oe=N.distcode[_e+((F&(1<<ae+de)-1)>>ae)],se=oe>>>24,ye=oe>>>16&255,ke=oe&65535,!(ae+se<=Z);){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}F>>>=ae,Z-=ae,N.back+=ae}if(F>>>=se,Z-=se,N.back+=se,ye&64){D.msg="invalid distance code",N.mode=BAD;break}N.offset=ke,N.extra=ye&15,N.mode=DISTEXT;case DISTEXT:if(N.extra){for(fe=N.extra;Z<fe;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}N.offset+=F&(1<<N.extra)-1,F>>>=N.extra,Z-=N.extra,N.back+=N.extra}if(N.offset>N.dmax){D.msg="invalid distance too far back",N.mode=BAD;break}N.mode=MATCH;case MATCH:if(q===0)break e;if(X=te-q,N.offset>X){if(X=N.offset-X,X>N.whave&&N.sane){D.msg="invalid distance too far back",N.mode=BAD;break}X>N.wnext?(X-=N.wnext,ne=N.wsize-X):ne=N.wnext-X,X>N.length&&(X=N.length),ce=N.window}else ce=I,ne=n-N.offset,X=N.length;X>q&&(X=q),q-=X,N.length-=X;do I[n++]=ce[ne++];while(--X);N.length===0&&(N.mode=LEN);break;case LIT:if(q===0)break e;I[n++]=N.length,q--,N.mode=LEN;break;case CHECK:if(N.wrap){for(;Z<32;){if(a===0)break e;a--,F|=z[O++]<<Z,Z+=8}if(te-=q,D.total_out+=te,N.total+=te,N.wrap&4&&te&&(D.adler=N.check=N.flags?crc32_1(N.check,I,te,n-te):adler32_1(N.check,I,te,n-te)),te=q,N.wrap&4&&(N.flags?F:zswap32(F))!==N.check){D.msg="incorrect data check",N.mode=BAD;break}F=0,Z=0}N.mode=LENGTH;case LENGTH:if(N.wrap&&N.flags){for(;Z<32;){if(a===0)break e;a--,F+=z[O++]<<Z,Z+=8}if(N.wrap&4&&F!==(N.total&4294967295)){D.msg="incorrect length check",N.mode=BAD;break}F=0,Z=0}N.mode=DONE;case DONE:ve=Z_STREAM_END$1;break e;case BAD:ve=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=n,D.avail_out=q,D.next_in=O,D.avail_in=a,N.hold=F,N.bits=Z,(N.wsize||te!==D.avail_out&&N.mode<BAD&&(N.mode<CHECK||J!==Z_FINISH$1))&&updatewindow(D,D.output,D.next_out,te-D.avail_out),ee-=D.avail_in,te-=D.avail_out,D.total_in+=ee,D.total_out+=te,N.total+=te,N.wrap&4&&te&&(D.adler=N.check=N.flags?crc32_1(N.check,I,te,D.next_out-te):adler32_1(N.check,I,te,D.next_out-te)),D.data_type=N.bits+(N.last?64:0)+(N.mode===TYPE?128:0)+(N.mode===LEN_||N.mode===COPY_?256:0),(ee===0&&te===0||J===Z_FINISH$1)&&ve===Z_OK$1&&(ve=Z_BUF_ERROR),ve},inflateEnd=D=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;let J=D.state;return J.window&&(J.window=null),D.state=null,Z_OK$1},inflateGetHeader=(D,J)=>{if(inflateStateCheck(D))return Z_STREAM_ERROR$1;const N=D.state;return(N.wrap&2)===0?Z_STREAM_ERROR$1:(N.head=J,J.done=!1,Z_OK$1)},inflateSetDictionary=(D,J)=>{const N=J.length;let z,I,O;return inflateStateCheck(D)||(z=D.state,z.wrap!==0&&z.mode!==DICT)?Z_STREAM_ERROR$1:z.mode===DICT&&(I=1,I=adler32_1(I,J,N,0),I!==z.check)?Z_DATA_ERROR$1:(O=updatewindow(D,J,N,N),O?(z.mode=MEM,Z_MEM_ERROR$1):(z.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 J=this.options;J.raw&&J.windowBits>=0&&J.windowBits<16&&(J.windowBits=-J.windowBits,J.windowBits===0&&(J.windowBits=-15)),J.windowBits>=0&&J.windowBits<16&&!(D&&D.windowBits)&&(J.windowBits+=32),J.windowBits>15&&J.windowBits<48&&(J.windowBits&15)===0&&(J.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let N=inflate_1$2.inflateInit2(this.strm,J.windowBits);if(N!==Z_OK)throw new Error(messages[N]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),J.dictionary&&(typeof J.dictionary=="string"?J.dictionary=strings.string2buf(J.dictionary):toString.call(J.dictionary)==="[object ArrayBuffer]"&&(J.dictionary=new Uint8Array(J.dictionary)),J.raw&&(N=inflate_1$2.inflateSetDictionary(this.strm,J.dictionary),N!==Z_OK)))throw new Error(messages[N])}Inflate$1.prototype.push=function(D,J){const N=this.strm,z=this.options.chunkSize,I=this.options.dictionary;let O,n,a;if(this.ended)return!1;for(J===~~J?n=J:n=J===!0?Z_FINISH:Z_NO_FLUSH,toString.call(D)==="[object ArrayBuffer]"?N.input=new Uint8Array(D):N.input=D,N.next_in=0,N.avail_in=N.input.length;;){for(N.avail_out===0&&(N.output=new Uint8Array(z),N.next_out=0,N.avail_out=z),O=inflate_1$2.inflate(N,n),O===Z_NEED_DICT&&I&&(O=inflate_1$2.inflateSetDictionary(N,I),O===Z_OK?O=inflate_1$2.inflate(N,n):O===Z_DATA_ERROR&&(O=Z_NEED_DICT));N.avail_in>0&&O===Z_STREAM_END&&N.state.wrap>0&&D[N.next_in]!==0;)inflate_1$2.inflateReset(N),O=inflate_1$2.inflate(N,n);switch(O){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(O),this.ended=!0,!1}if(a=N.avail_out,N.next_out&&(N.avail_out===0||O===Z_STREAM_END))if(this.options.to==="string"){let q=strings.utf8border(N.output,N.next_out),F=N.next_out-q,Z=strings.buf2string(N.output,q);N.next_out=F,N.avail_out=z-F,F&&N.output.set(N.output.subarray(q,q+F),0),this.onData(Z)}else this.onData(N.output.length===N.next_out?N.output:N.output.subarray(0,N.next_out));if(!(O===Z_OK&&a===0)){if(O===Z_STREAM_END)return O=inflate_1$2.inflateEnd(this.strm),this.onEnd(O),this.ended=!0,!0;if(N.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,J){const N=new Inflate$1(J);if(N.push(D),N.err)throw N.msg||messages[N.err];return N.result}function inflateRaw$1(D,J){return J=J||{},J.raw=!0,inflate$1(D,J)}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 noLogEvents=["updateSeverTime"];noLogEvents.push("heartbeat"),noLogEvents.push("heartbeatEx"),noLogEvents.push("networkQualityChange"),noLogEvents.push("onNetQuality"),noLogEvents.push("updateCall"),noLogEvents.push("pubNotify");const compressArrayBuffer=D=>{const J=new Uint8Array(D),N=pako.deflate(J,{gzip:!0});return new Uint8Array(N==null?void 0:N.buffer)},decompressArrayBuffer=D=>{const J=new Uint8Array(D),N=pako.inflate(J,{gzip:!0});return new Uint8Array(N==null?void 0:N.buffer)},sendMessageFormat=D=>{const{event:J}=D;switch(D.data_original=D.data,D.time&&(D.timeStr=E$1(D.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),J){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"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"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;default:D.data=new Uint8Array;break}return D},onMessageFormat=D=>{const{event:J,compress:N=!1}=D;if(D.data_remote=D.data,D.time&&(D.timeStr=E$1(D.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),N)try{D.data=decompressArrayBuffer(D.data)}catch(z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",z)}switch(J){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"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"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(J){Oe(this,Ae);Oe(this,Ee,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:20*1e3});Oe(this,ze,"");Oe(this,Qe,{});Oe(this,tt,{});he(this,"state","closed");he(this,"sendMessageBefore",async()=>{});he(this,"onReconnectSuccess",J=>{});he(this,"onReconnectStop",J=>{});Oe(this,Ft,J=>{let N=!0;const{code:z=1e3}=J;return z===1e3&&(N=!1),this.state="connecting",N});Oe(this,jt,async J=>{pe(this,Ee).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",J),this.state="connected",this.onReconnectSuccess(J)});Oe(this,zt,async J=>{pe(this,Ee).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",J),this.close(),this.state="closed",this.onReconnectStop(J)});Oe(this,Nt,(J,N={})=>{try{const{time:z,event:I,data:O={},data_original:n={},data_remote:a,...q}=N,F=E$1(z,"YYYY-MM-DD hh:mm:ss",{offset:480});let Z={};const ee=(ke={})=>{const ae=JSON.parse(JSON.stringify(ke)),de=Object.keys(ae);for(const _e of de)(_e.includes("sdp")||_e.includes("Sdp"))&&(ae[_e]="");return ae};let te="res ↓";switch(J){case"res":te="res ↓",Z=ee(O);break;case"req":te="req ↑",Z=ee(n);break}let X="#quickvo.logs";ignoreEvent.includes(I)&&(X="#quickvo.ignoreEvents");const ne={"#action":te,timeStr:F,event:I,data:Z,time:z,...q},ce=localStorage.getItem(X)||JSON.stringify([]),oe=JSON.parse(ce);let se=I==="heartbeat";const ye=[ne];for(const ke of oe){const{event:ae}=ke;if(ae==="heartbeat"){if(se)continue;se=!0}if(ye.length===200)break;ye.push(ke)}localStorage.setItem(X,JSON.stringify(ye))}catch(z){pe(this,Ee).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",z)}});Oe(this,Jt,(J,{resolve:N,reject:z})=>{const{sn:I=""}=J,O=()=>{const a=pe(this,Qe)[I];clearTimeout(a.destructionTimer),delete pe(this,Qe)[I]},n=window.setTimeout(()=>{const a=pe(this,Qe)[I];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",a.message),O(),z("event is timeout")},pe(this,Ee).timeout);pe(this,Qe)[I]={message:J,resolve:N,reject:z,destruction:O,destructionTimer:n}});Oe(this,Wt,J=>pe(this,Qe)[J]);Oe(this,Zt,async J=>{const N=new Uint8Array(J),z=com.quick.voice.proto.CommonRsp.decode(N),{sn:I,event:O}=z,n=onMessageFormat(z);if(pe(this,Ee).debug&&(noLogEvents.includes(O)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",n),ignoreEvent.includes(O)||pe(this,Nt).call(this,"res",n)),notifyName_keys.includes(O))return this.emitNotify(O,P(n,["code","data","desc"]));const q=pe(this,Wt).call(this,I);if(q){const{resolve:F=ee=>{},destruction:Z=()=>{}}=q;F(P(n,["code","data","desc"])),Z()}});he(this,"clearEvents",(J=[])=>{const N=Object.keys(pe(this,Qe));J.length===0&&(J=N);for(const z of N){if(!J.includes(z))continue;const I=pe(this,Qe)[z];if(I){const{destruction:O}=I;O()}}});he(this,"connect",async(J="")=>new Promise(async N=>{J&&Ue(this,ze,J),pe(this,Ae)&&(await pe(this,Ae).close(),this.state="closed");const z=`${pe(this,Ee).url}?s=${pe(this,ze)}&t=${Date.now()}`,I=new Date().getTime();if(Ue(this,Ae,new M({...pe(this,Ee),debug:!1,url:z,binaryType:"arraybuffer",onMessage:pe(this,Zt),checkReconnect:pe(this,Ft),getHeartbeatMsg:()=>"",onReconnectSuccess:pe(this,jt),onReconnectStop:pe(this,zt)})),this.state="connecting",await pe(this,Ae).connect(),this.state="connected",pe(this,Ee).debug){const n=new Date().getTime()-I;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${n}ms-广播事件`,pe(this,tt))}N(pe(this,Ae))}));he(this,"close",async()=>{var N;pe(this,Ee).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const J=Object.keys(pe(this,Qe));for(const z of J){const{destructionTimer:I}=pe(this,Qe)[z];clearTimeout(I)}Ue(this,Qe,{}),await((N=pe(this,Ae))==null?void 0:N.close()),Ue(this,Ae,void 0),this.state="closed"});he(this,"sendMessage",(J,N=!0)=>new Promise(async(z,I)=>{var Z;await this.sendMessageBefore();const{event:O,...n}=J,a=Date.now(),q=sendMessageFormat({event:O,sn:+`${a}${v$1(1e3,9999)}`,time:a,valid:pe(this,Ee).timeout,version:1,compress:!1,...n});pe(this,Ee).debug&&(noLogEvents.includes(O)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",q),ignoreEvent.includes(O)||pe(this,Nt).call(this,"req",q)),N&&pe(this,Jt).call(this,q,{resolve:z,reject:I});const F=com.quick.voice.proto.CommonReq.encode(q).finish();(Z=pe(this,Ae))==null||Z.sendMessage(F)}));he(this,"emitNotify",async(J,N)=>{const z=pe(this,tt)[J]||[];for(const I of z){const{callback:O=async()=>{}}=I;await O(N)}});he(this,"addNotify",(J,N=!1)=>{const{event:z,sn:I=xt(32)}=J;pe(this,tt)[z]||(pe(this,tt)[z]=[]);const O=pe(this,tt)[z],n=O.findIndex(a=>a.sn===I);return n!==-1&&O.splice(n,1),N?O.unshift(J):O.push(J),I});he(this,"removeNotify",(J=[])=>{if(J.length===0)Ue(this,tt,{});else{const N=Object.keys(pe(this,tt));for(const z of N)pe(this,tt)[z]=pe(this,tt)[z].filter(I=>!J.includes(I.sn||""))}pe(this,Ee).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",pe(this,tt))});Ue(this,Ee,{...pe(this,Ee),...J})}}Ae=new WeakMap,Ee=new WeakMap,ze=new WeakMap,Qe=new WeakMap,tt=new WeakMap,Ft=new WeakMap,jt=new WeakMap,zt=new WeakMap,Nt=new WeakMap,Jt=new WeakMap,Wt=new WeakMap,Zt=new WeakMap;const createMutedAudioStream=D=>{const J=D.createOscillator();J.type="sine",J.frequency.setValueAtTime(0,D.currentTime);const N=D.createGain();N.gain.value=0,J.connect(N),N.connect(D.destination),J.start();const z=D.createMediaStreamDestination();return N.disconnect(),J.connect(z),z.stream},createFakeVideoStream=(D=10,J=10,N=30)=>{const z=document.createElement("canvas"),I=z.getContext("2d");z.width=D,z.height=J;let O=0;return setInterval(()=>{I.clearRect(0,0,z.width,z.height);const q=I.createLinearGradient(0,0,z.width,z.height);q.addColorStop(0,`hsla(${O}, 100%, 50%, 0)`),q.addColorStop(1,`hsla(${O+120}, 100%, 50%, 0)`),I.fillStyle=q,I.fillRect(0,0,z.width,z.height),O=(O+1)%360},100),z.captureStream(N)};var E=Object.defineProperty,$=D=>{throw TypeError(D)},j=(D,J,N)=>J in D?E(D,J,{enumerable:!0,configurable:!0,writable:!0,value:N}):D[J]=N,u=(D,J,N)=>j(D,typeof J!="symbol"?J+"":J,N),B=(D,J,N)=>J.has(D)||$("Cannot "+N),o=(D,J,N)=>(B(D,J,"read from private field"),N?N.call(D):J.get(D)),k=(D,J,N)=>J.has(D)?$("Cannot add the same private member more than once"):J instanceof WeakSet?J.add(D):J.set(D,N),g$1=(D,J,N,z)=>(B(D,J,"write to private field"),J.set(D,N),N),C=(D,J,N,z)=>({set _(I){g$1(D,J,I)},get _(){return o(D,J,z)}}),d,r,c,m$1;class Y{constructor(J,N={}){k(this,d,{debug:!1}),k(this,r,new Map),k(this,c,new Map),k(this,m$1,0),u(this,"setCondition",async(z,I)=>{if(!o(this,r).has(z))throw new Error("You have set an incorrect condition. If this is necessary, you need to define it first during instantiation.");const O=o(this,r).get(z);o(this,r).set(z,I),O===!1&&I&&await this.executeTasks()}),u(this,"createTask",async z=>{const I={describe:"",strict:!1,timeout:0,success:async ae=>{},fail:async ae=>{},complete:async()=>{},...z},{describe:O,strict:n,timeout:a,conditionKeys:q,changeConditionKeys:F=[],func:Z,success:ee,fail:te,complete:X}=I,ne=`${C(this,m$1)._++}`,ce=()=>{let ae=!0;for(const de of q)if(!o(this,r).get(de)){ae=!1;break}return ae};let oe=0;const se=()=>{o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${O} (${ne}) end`),o(this,c).delete(ne)},ye=async()=>{if(!o(this,c).get(ne)||ke.runing)return;ke.runing=!0;for(const _e of F)this.setCondition(_e,!1);o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${O} (${ne}) run`);const ae=ke.func(),de=new Promise((_e,me)=>{a&&(oe=setTimeout(()=>{me(`task: ${ne} (${O}) is timeout.`)},a))});return Promise.race([ae,de]).finally(()=>{ke.strict===!1&&ke.clear(),clearTimeout(oe),ke.runing=!1,X()}).then(_e=>{ee(_e)}).catch(_e=>{te(_e)})},ke={key:ne,describe:O,strict:n,conditionKeys:q,runing:!1,func:Z,checkAccord:ce,success:ee,fail:te,complete:X,run:ye,retry:()=>(ke.runing=!1,ye()),clear:se};return o(this,c).set(ne,ke),ke.checkAccord()&&setTimeout(()=>ke.run(),0),ke}),u(this,"executeTasks",async()=>{const z=[...o(this,c).values()];for(const I of z)I.checkAccord()&&I.run()}),u(this,"clear",(z=[])=>{if(z.length===0){g$1(this,c,new Map);return}for(const I of z)o(this,c).delete(I)}),u(this,"getConditions",()=>Object.fromEntries(o(this,r))),u(this,"getTasks",()=>o(this,c));for(const z of J)o(this,r).set(z,!0);g$1(this,d,{debug:!1,...N})}}d=new WeakMap,r=new WeakMap,c=new WeakMap,m$1=new WeakMap;class NetworkQualityTester{constructor(J=[]){he(this,"targetUrls",[]);he(this,"results",[]);J.length===0&&J.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=J,this.results=[]}async testAll(){const J=this.targetUrls.map(N=>this.testUrl(N));return await Promise.all(J),this.analyzeResults()}async testUrl(J){const N=performance.now();let z=0,I=!1;try{await fetch(J,{method:"HEAD",cache:"no-store"});const O=performance.now()-N,n=performance.now(),q=await(await fetch(J,{cache:"no-store"})).blob(),F=performance.now()-n;z=q.size,I=!0,this.results.push({url:J,success:I,headTime:O,getTime:F,size:z,downloadSpeed:z>0?(z/1024/(F/1e3)).toFixed(2):0,totalTime:performance.now()-N})}catch(O){this.results.push({url:J,success:!1,error:O.message,totalTime:performance.now()-N})}}analyzeResults(){const J=this.results.filter(O=>O.success);if(J.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const N=J.reduce((O,n)=>O+n.size,0),z=J.reduce((O,n)=>O+n.totalTime,0),I=J.reduce((O,n)=>O+parseFloat(n.downloadSpeed),0)/J.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:J.length,averageDownloadSpeed:`${I.toFixed(2)} KB/s`,averageResponseTime:`${(z/J.length).toFixed(2)}ms`,totalDataTransferred:`${(N/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(J){var N="undefined",z=N!==typeof Buffer&&Buffer,I=N!==typeof Uint8Array&&Uint8Array,O=N!==typeof ArrayBuffer&&ArrayBuffer,n=[0,0,0,0,0,0,0,0],a=Array.isArray||_e,q=4294967296,F=16777216,Z;ee("Uint64BE",!0,!0),ee("Int64BE",!0,!1),ee("Uint64LE",!1,!0),ee("Int64LE",!1,!1);function ee(me,ve,ge){var le=ve?0:4,fe=ve?4:0,Se=ve?0:3,Te=ve?1:2,$e=ve?2:1,Me=ve?3:0,He=ve?ye:ae,We=ve?ke:de,Ze=Ne.prototype,nt="is"+me,kt="_"+nt;return Ze.buffer=void 0,Ze.offset=0,Ze[kt]=!0,Ze.toNumber=rt,Ze.toString=yt,Ze.toJSON=rt,Ze.toArray=te,z&&(Ze.toBuffer=X),I&&(Ze.toArrayBuffer=ne),Ne[nt]=Be,J[me]=Ne,Ne;function Ne(xe,Ie,Re,Ce){return this instanceof Ne?mt(this,xe,Ie,Re,Ce):new Ne(xe,Ie,Re,Ce)}function Be(xe){return!!(xe&&xe[kt])}function mt(xe,Ie,Re,Ce,qe){if(I&&O&&(Ie instanceof O&&(Ie=new I(Ie)),Ce instanceof O&&(Ce=new I(Ce))),!Ie&&!Re&&!Ce&&!Z){xe.buffer=se(n,0);return}if(!ce(Ie,Re)){var Ve=Z||Array;qe=Re,Ce=Ie,Re=0,Ie=Z===z?z.alloc(8):new Ve(8)}xe.buffer=Ie,xe.offset=Re|=0,N!==typeof Ce&&(typeof Ce=="string"?Je(Ie,Re,Ce,qe||10):ce(Ce,qe)?oe(Ie,Re,Ce,qe):typeof qe=="number"?(at(Ie,Re+le,Ce),at(Ie,Re+fe,qe)):Ce>0?He(Ie,Re,Ce):Ce<0?We(Ie,Re,Ce):oe(Ie,Re,n,0))}function Je(xe,Ie,Re,Ce){var qe=0,Ve=Re.length,et=0,Ye=0;Re[0]==="-"&&qe++;for(var vt=qe;qe<Ve;){var wt=parseInt(Re[qe++],Ce);if(!(wt>=0))break;Ye=Ye*Ce+wt,et=et*Ce+Math.floor(Ye/q),Ye%=q}vt&&(et=~et,Ye?Ye=q-Ye:et++),at(xe,Ie+le,et),at(xe,Ie+fe,Ye)}function rt(){var xe=this.buffer,Ie=this.offset,Re=Ge(xe,Ie+le),Ce=Ge(xe,Ie+fe);return ge||(Re|=0),Re?Re*q+Ce:Ce}function yt(xe){var Ie=this.buffer,Re=this.offset,Ce=Ge(Ie,Re+le),qe=Ge(Ie,Re+fe),Ve="",et=!ge&&Ce&2147483648;for(et&&(Ce=~Ce,qe=q-qe),xe=xe||10;;){var Ye=Ce%xe*q+qe;if(Ce=Math.floor(Ce/xe),qe=Math.floor(Ye/xe),Ve=(Ye%xe).toString(xe)+Ve,!Ce&&!qe)break}return et&&(Ve="-"+Ve),Ve}function at(xe,Ie,Re){xe[Ie+Me]=Re&255,Re=Re>>8,xe[Ie+$e]=Re&255,Re=Re>>8,xe[Ie+Te]=Re&255,Re=Re>>8,xe[Ie+Se]=Re&255}function Ge(xe,Ie){return xe[Ie+Se]*F+(xe[Ie+Te]<<16)+(xe[Ie+$e]<<8)+xe[Ie+Me]}}function te(me){var ve=this.buffer,ge=this.offset;return Z=null,me!==!1&&a(ve)?ve.length===8?ve:ve.slice(ge,ge+8):se(ve,ge)}function X(me){var ve=this.buffer,ge=this.offset;return Z=z,me!==!1&&z.isBuffer(ve)?ve.length===8?ve:ve.slice(ge,ge+8):z.from(ne.call(this,me))}function ne(me){var ve=this.buffer,ge=this.offset,le=ve.buffer;if(Z=I,me!==!1&&!ve.offset&&le instanceof O)return le.byteLength===8?le:le.slice(ge,ge+8);var fe=new I(8);return oe(fe,0,ve,ge),fe.buffer}function ce(me,ve){var ge=me&&me.length;return ve|=0,ge&&ve+8<=ge&&typeof me[ve]!="string"}function oe(me,ve,ge,le){ve|=0,le|=0;for(var fe=0;fe<8;fe++)me[ve++]=ge[le++]&255}function se(me,ve){return Array.prototype.slice.call(me,ve,ve+8)}function ye(me,ve,ge){for(var le=ve+8;le>ve;)me[--le]=ge&255,ge/=256}function ke(me,ve,ge){var le=ve+8;for(ge++;le>ve;)me[--le]=-ge&255^255,ge/=256}function ae(me,ve,ge){for(var le=ve+8;ve<le;)me[ve++]=ge&255,ge/=256}function de(me,ve,ge){var le=ve+8;for(ge++;ve<le;)me[ve++]=-ge&255^255,ge/=256}function _e(me){return!!me&&Object.prototype.toString.call(me)=="[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(),J=requireTools(),N=requireEbmlID(),z=function(){function I(){this._schema=N.byEbmlID,this._buffers=[],this._stack=[]}return I.prototype.encode=function(O){var n=this;return D.concat(O.reduce(function(a,q){return a.concat(n.encodeChunk(q))},[])).buffer},I.prototype.encodeChunk=function(O){return O.type==="m"?O.isEnd?this.endTag(O):this.startTag(O):(O.data=J.Buffer.from(O.data),this.writeTag(O)),this.flush()},I.prototype.flush=function(){var O=this._buffers;return this._buffers=[],O},I.prototype.getSchemaInfo=function(O){for(var n=Object.keys(this._schema).map(Number),a=0;a<n.length;a++){var q=n[a];if(this._schema[q].name===O)return new J.Buffer(q.toString(16),"hex")}return null},I.prototype.writeTag=function(O){var n=O.name,a=this.getSchemaInfo(n),q=O.data;if(a==null)throw new Error("No schema entry found for "+n);var F=D.encodeTag(a,q);if(this._stack.length>0){var Z=this._stack[this._stack.length-1];Z.children.push({tagId:a,elm:O,children:[],data:F});return}this._buffers=this._buffers.concat(F)},I.prototype.startTag=function(O){var n=O.name,a=this.getSchemaInfo(n);if(a==null)throw new Error("No schema entry found for "+n);if(O.unknownSize){var q=D.encodeTag(a,new J.Buffer(0),O.unknownSize);this._buffers=this._buffers.concat(q);return}var F={tagId:a,elm:O,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(F),this._stack.push(F)},I.prototype.endTag=function(O){O.name;var n=this._stack.pop();if(n==null)throw new Error("EBML structure is broken");if(n.elm.name!==O.name)throw new Error("EBML structure is broken");var a=n.children.reduce(function(F,Z){if(Z.data===null)throw new Error("EBML structure is broken");return F.concat(Z.data)},[]),q=D.concat(a);n.elm.type==="m"?n.data=D.encodeTag(n.tagId,q,n.elm.unknownSize):n.data=D.encodeTag(n.tagId,q),this._stack.length<1&&(this._buffers=this._buffers.concat(n.data))},I}();return EBMLEncoder.default=z,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=a,base64Js.toByteArray=F,base64Js.fromByteArray=te;for(var D=[],J=[],N=typeof Uint8Array<"u"?Uint8Array:Array,z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=0,O=z.length;I<O;++I)D[I]=z[I],J[z.charCodeAt(I)]=I;J[45]=62,J[95]=63;function n(X){var ne=X.length;if(ne%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var ce=X.indexOf("=");ce===-1&&(ce=ne);var oe=ce===ne?0:4-ce%4;return[ce,oe]}function a(X){var ne=n(X),ce=ne[0],oe=ne[1];return(ce+oe)*3/4-oe}function q(X,ne,ce){return(ne+ce)*3/4-ce}function F(X){var ne,ce=n(X),oe=ce[0],se=ce[1],ye=new N(q(X,oe,se)),ke=0,ae=se>0?oe-4:oe,de;for(de=0;de<ae;de+=4)ne=J[X.charCodeAt(de)]<<18|J[X.charCodeAt(de+1)]<<12|J[X.charCodeAt(de+2)]<<6|J[X.charCodeAt(de+3)],ye[ke++]=ne>>16&255,ye[ke++]=ne>>8&255,ye[ke++]=ne&255;return se===2&&(ne=J[X.charCodeAt(de)]<<2|J[X.charCodeAt(de+1)]>>4,ye[ke++]=ne&255),se===1&&(ne=J[X.charCodeAt(de)]<<10|J[X.charCodeAt(de+1)]<<4|J[X.charCodeAt(de+2)]>>2,ye[ke++]=ne>>8&255,ye[ke++]=ne&255),ye}function Z(X){return D[X>>18&63]+D[X>>12&63]+D[X>>6&63]+D[X&63]}function ee(X,ne,ce){for(var oe,se=[],ye=ne;ye<ce;ye+=3)oe=(X[ye]<<16&16711680)+(X[ye+1]<<8&65280)+(X[ye+2]&255),se.push(Z(oe));return se.join("")}function te(X){for(var ne,ce=X.length,oe=ce%3,se=[],ye=16383,ke=0,ae=ce-oe;ke<ae;ke+=ye)se.push(ee(X,ke,ke+ye>ae?ae:ke+ye));return oe===1?(ne=X[ce-1],se.push(D[ne>>2]+D[ne<<4&63]+"==")):oe===2&&(ne=(X[ce-2]<<8)+X[ce-1],se.push(D[ne>>10]+D[ne>>4&63]+D[ne<<2&63]+"=")),se.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,J,N,z,I){var O,n,a=I*8-z-1,q=(1<<a)-1,F=q>>1,Z=-7,ee=N?I-1:0,te=N?-1:1,X=D[J+ee];for(ee+=te,O=X&(1<<-Z)-1,X>>=-Z,Z+=a;Z>0;O=O*256+D[J+ee],ee+=te,Z-=8);for(n=O&(1<<-Z)-1,O>>=-Z,Z+=z;Z>0;n=n*256+D[J+ee],ee+=te,Z-=8);if(O===0)O=1-F;else{if(O===q)return n?NaN:(X?-1:1)*(1/0);n=n+Math.pow(2,z),O=O-F}return(X?-1:1)*n*Math.pow(2,O-z)},ieee754.write=function(D,J,N,z,I,O){var n,a,q,F=O*8-I-1,Z=(1<<F)-1,ee=Z>>1,te=I===23?Math.pow(2,-24)-Math.pow(2,-77):0,X=z?0:O-1,ne=z?1:-1,ce=J<0||J===0&&1/J<0?1:0;for(J=Math.abs(J),isNaN(J)||J===1/0?(a=isNaN(J)?1:0,n=Z):(n=Math.floor(Math.log(J)/Math.LN2),J*(q=Math.pow(2,-n))<1&&(n--,q*=2),n+ee>=1?J+=te/q:J+=te*Math.pow(2,1-ee),J*q>=2&&(n++,q/=2),n+ee>=Z?(a=0,n=Z):n+ee>=1?(a=(J*q-1)*Math.pow(2,I),n=n+ee):(a=J*Math.pow(2,ee-1)*Math.pow(2,I),n=0));I>=8;D[N+X]=a&255,X+=ne,a/=256,I-=8);for(n=n<<I|a,F+=I;F>0;D[N+X]=n&255,X+=ne,n/=256,F-=8);D[N+X-ne]|=ce*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 z=requireBase64Js(),N=requireIeee754(),J=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;D.Buffer=a,D.SlowBuffer=me,D.INSPECT_MAX_BYTES=50;const I=2147483647;D.kMaxLength=I,a.TYPED_ARRAY_SUPPORT=O(),!a.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 O(){try{const te=new Uint8Array(1),K={foo:function(){return 42}};return Object.setPrototypeOf(K,Uint8Array.prototype),Object.setPrototypeOf(te,K),te.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function n(te){if(te>I)throw new RangeError('The value "'+te+'" is invalid for option "size"');const K=new Uint8Array(te);return Object.setPrototypeOf(K,a.prototype),K}function a(te,K,G){if(typeof te=="number"){if(typeof K=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return X(te)}return q(te,K,G)}a.poolSize=8192;function q(te,K,G){if(typeof te=="string")return ee(te,K);if(ArrayBuffer.isView(te))return ne(te);if(te==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof te);if(st(te,ArrayBuffer)||te&&st(te.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(st(te,SharedArrayBuffer)||te&&st(te.buffer,SharedArrayBuffer)))return se(te,K,G);if(typeof te=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=te.valueOf&&te.valueOf();if(ie!=null&&ie!==te)return a.from(ie,K,G);const ue=re(te);if(ue)return ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof te[Symbol.toPrimitive]=="function")return a.from(te[Symbol.toPrimitive]("string"),K,G);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof te)}a.from=function(te,K,G){return q(te,K,G)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function F(te){if(typeof te!="number")throw new TypeError('"size" argument must be of type number');if(te<0)throw new RangeError('The value "'+te+'" is invalid for option "size"')}function Z(te,K,G){return F(te),te<=0?n(te):K!==void 0?typeof G=="string"?n(te).fill(K,G):n(te).fill(K):n(te)}a.alloc=function(te,K,G){return Z(te,K,G)};function X(te){return F(te),n(te<0?0:oe(te)|0)}a.allocUnsafe=function(te){return X(te)},a.allocUnsafeSlow=function(te){return X(te)};function ee(te,K){if((typeof K!="string"||K==="")&&(K="utf8"),!a.isEncoding(K))throw new TypeError("Unknown encoding: "+K);const G=_e(te,K)|0;let ie=n(G);const ue=ie.write(te,K);return ue!==G&&(ie=ie.slice(0,ue)),ie}function Q(te){const K=te.length<0?0:oe(te.length)|0,G=n(K);for(let ie=0;ie<K;ie+=1)G[ie]=te[ie]&255;return G}function ne(te){if(st(te,Uint8Array)){const K=new Uint8Array(te);return se(K.buffer,K.byteOffset,K.byteLength)}return Q(te)}function se(te,K,G){if(K<0||te.byteLength<K)throw new RangeError('"offset" is outside of buffer bounds');if(te.byteLength<K+(G||0))throw new RangeError('"length" is outside of buffer bounds');let ie;return K===void 0&&G===void 0?ie=new Uint8Array(te):G===void 0?ie=new Uint8Array(te,K):ie=new Uint8Array(te,K,G),Object.setPrototypeOf(ie,a.prototype),ie}function re(te){if(a.isBuffer(te)){const K=oe(te.length)|0,G=n(K);return G.length===0||te.copy(G,0,0,K),G}if(te.length!==void 0)return typeof te.length!="number"||on(te.length)?n(0):Q(te);if(te.type==="Buffer"&&Array.isArray(te.data))return Q(te.data)}function oe(te){if(te>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return te|0}function me(te){return+te!=te&&(te=0),a.alloc(+te)}a.isBuffer=function(K){return K!=null&&K._isBuffer===!0&&K!==a.prototype},a.compare=function(K,G){if(st(K,Uint8Array)&&(K=a.from(K,K.offset,K.byteLength)),st(G,Uint8Array)&&(G=a.from(G,G.offset,G.byteLength)),!a.isBuffer(K)||!a.isBuffer(G))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(K===G)return 0;let ie=K.length,ue=G.length;for(let ve=0,ke=Math.min(ie,ue);ve<ke;++ve)if(K[ve]!==G[ve]){ie=K[ve],ue=G[ve];break}return ie<ue?-1:ue<ie?1:0},a.isEncoding=function(K){switch(String(K).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}},a.concat=function(K,G){if(!Array.isArray(K))throw new TypeError('"list" argument must be an Array of Buffers');if(K.length===0)return a.alloc(0);let ie;if(G===void 0)for(G=0,ie=0;ie<K.length;++ie)G+=K[ie].length;const ue=a.allocUnsafe(G);let ve=0;for(ie=0;ie<K.length;++ie){let ke=K[ie];if(st(ke,Uint8Array))ve+ke.length>ue.length?(a.isBuffer(ke)||(ke=a.from(ke)),ke.copy(ue,ve)):Uint8Array.prototype.set.call(ue,ke,ve);else if(a.isBuffer(ke))ke.copy(ue,ve);else throw new TypeError('"list" argument must be an Array of Buffers');ve+=ke.length}return ue};function _e(te,K){if(a.isBuffer(te))return te.length;if(ArrayBuffer.isView(te)||st(te,ArrayBuffer))return te.byteLength;if(typeof te!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof te);const G=te.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&G===0)return 0;let ue=!1;for(;;)switch(K){case"ascii":case"latin1":case"binary":return G;case"utf8":case"utf-8":return mt(te).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G*2;case"hex":return G>>>1;case"base64":return At(te).length;default:if(ue)return ie?-1:mt(te).length;K=(""+K).toLowerCase(),ue=!0}}a.byteLength=_e;function ae(te,K,G){let ie=!1;if((K===void 0||K<0)&&(K=0),K>this.length||((G===void 0||G>this.length)&&(G=this.length),G<=0)||(G>>>=0,K>>>=0,G<=K))return"";for(te||(te="utf8");;)switch(te){case"hex":return nt(this,K,G);case"utf8":case"utf-8":return Ee(this,K,G);case"ascii":return Je(this,K,G);case"latin1":case"binary":return We(this,K,G);case"base64":return Se(this,K,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bt(this,K,G);default:if(ie)throw new TypeError("Unknown encoding: "+te);te=(te+"").toLowerCase(),ie=!0}}a.prototype._isBuffer=!0;function fe(te,K,G){const ie=te[K];te[K]=te[G],te[G]=ie}a.prototype.swap16=function(){const K=this.length;if(K%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let G=0;G<K;G+=2)fe(this,G,G+1);return this},a.prototype.swap32=function(){const K=this.length;if(K%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let G=0;G<K;G+=4)fe(this,G,G+3),fe(this,G+1,G+2);return this},a.prototype.swap64=function(){const K=this.length;if(K%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let G=0;G<K;G+=8)fe(this,G,G+7),fe(this,G+1,G+6),fe(this,G+2,G+5),fe(this,G+3,G+4);return this},a.prototype.toString=function(){const K=this.length;return K===0?"":arguments.length===0?Ee(this,0,K):ae.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(K){if(!a.isBuffer(K))throw new TypeError("Argument must be a Buffer");return this===K?!0:a.compare(this,K)===0},a.prototype.inspect=function(){let K="";const G=D.INSPECT_MAX_BYTES;return K=this.toString("hex",0,G).replace(/(.{2})/g,"$1 ").trim(),this.length>G&&(K+=" ... "),"<Buffer "+K+">"},J&&(a.prototype[J]=a.prototype.inspect),a.prototype.compare=function(K,G,ie,ue,ve){if(st(K,Uint8Array)&&(K=a.from(K,K.offset,K.byteLength)),!a.isBuffer(K))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof K);if(G===void 0&&(G=0),ie===void 0&&(ie=K?K.length:0),ue===void 0&&(ue=0),ve===void 0&&(ve=this.length),G<0||ie>K.length||ue<0||ve>this.length)throw new RangeError("out of range index");if(ue>=ve&&G>=ie)return 0;if(ue>=ve)return-1;if(G>=ie)return 1;if(G>>>=0,ie>>>=0,ue>>>=0,ve>>>=0,this===K)return 0;let ke=ve-ue,Ae=ie-G;const He=Math.min(ke,Ae),Ue=this.slice(ue,ve),Fe=K.slice(G,ie);for(let qe=0;qe<He;++qe)if(Ue[qe]!==Fe[qe]){ke=Ue[qe],Ae=Fe[qe];break}return ke<Ae?-1:Ae<ke?1:0};function be(te,K,G,ie,ue){if(te.length===0)return-1;if(typeof G=="string"?(ie=G,G=0):G>2147483647?G=2147483647:G<-2147483648&&(G=-2147483648),G=+G,on(G)&&(G=ue?0:te.length-1),G<0&&(G=te.length+G),G>=te.length){if(ue)return-1;G=te.length-1}else if(G<0)if(ue)G=0;else return-1;if(typeof K=="string"&&(K=a.from(K,ie)),a.isBuffer(K))return K.length===0?-1:he(te,K,G,ie,ue);if(typeof K=="number")return K=K&255,typeof Uint8Array.prototype.indexOf=="function"?ue?Uint8Array.prototype.indexOf.call(te,K,G):Uint8Array.prototype.lastIndexOf.call(te,K,G):he(te,[K],G,ie,ue);throw new TypeError("val must be string, number or Buffer")}function he(te,K,G,ie,ue){let ve=1,ke=te.length,Ae=K.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(te.length<2||K.length<2)return-1;ve=2,ke/=2,Ae/=2,G/=2}function He(Fe,qe){return ve===1?Fe[qe]:Fe.readUInt16BE(qe*ve)}let Ue;if(ue){let Fe=-1;for(Ue=G;Ue<ke;Ue++)if(He(te,Ue)===He(K,Fe===-1?0:Ue-Fe)){if(Fe===-1&&(Fe=Ue),Ue-Fe+1===Ae)return Fe*ve}else Fe!==-1&&(Ue-=Ue-Fe),Fe=-1}else for(G+Ae>ke&&(G=ke-Ae),Ue=G;Ue>=0;Ue--){let Fe=!0;for(let qe=0;qe<Ae;qe++)if(He(te,Ue+qe)!==He(K,qe)){Fe=!1;break}if(Fe)return Ue}return-1}a.prototype.includes=function(K,G,ie){return this.indexOf(K,G,ie)!==-1},a.prototype.indexOf=function(K,G,ie){return be(this,K,G,ie,!0)},a.prototype.lastIndexOf=function(K,G,ie){return be(this,K,G,ie,!1)};function ye(te,K,G,ie){G=Number(G)||0;const ue=te.length-G;ie?(ie=Number(ie),ie>ue&&(ie=ue)):ie=ue;const ve=K.length;ie>ve/2&&(ie=ve/2);let ke;for(ke=0;ke<ie;++ke){const Ae=parseInt(K.substr(ke*2,2),16);if(on(Ae))return ke;te[G+ke]=Ae}return ke}function we(te,K,G,ie){return Dt(mt(K,te.length-G),te,G,ie)}function le(te,K,G,ie){return Dt(_t(K),te,G,ie)}function de(te,K,G,ie){return Dt(At(K),te,G,ie)}function ge(te,K,G,ie){return Dt(rn(K,te.length-G),te,G,ie)}a.prototype.write=function(K,G,ie,ue){if(G===void 0)ue="utf8",ie=this.length,G=0;else if(ie===void 0&&typeof G=="string")ue=G,ie=this.length,G=0;else if(isFinite(G))G=G>>>0,isFinite(ie)?(ie=ie>>>0,ue===void 0&&(ue="utf8")):(ue=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ve=this.length-G;if((ie===void 0||ie>ve)&&(ie=ve),K.length>0&&(ie<0||G<0)||G>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");let ke=!1;for(;;)switch(ue){case"hex":return ye(this,K,G,ie);case"utf8":case"utf-8":return we(this,K,G,ie);case"ascii":case"latin1":case"binary":return le(this,K,G,ie);case"base64":return de(this,K,G,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ge(this,K,G,ie);default:if(ke)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),ke=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Se(te,K,G){return K===0&&G===te.length?z.fromByteArray(te):z.fromByteArray(te.slice(K,G))}function Ee(te,K,G){G=Math.min(te.length,G);const ie=[];let ue=K;for(;ue<G;){const ve=te[ue];let ke=null,Ae=ve>239?4:ve>223?3:ve>191?2:1;if(ue+Ae<=G){let He,Ue,Fe,qe;switch(Ae){case 1:ve<128&&(ke=ve);break;case 2:He=te[ue+1],(He&192)===128&&(qe=(ve&31)<<6|He&63,qe>127&&(ke=qe));break;case 3:He=te[ue+1],Ue=te[ue+2],(He&192)===128&&(Ue&192)===128&&(qe=(ve&15)<<12|(He&63)<<6|Ue&63,qe>2047&&(qe<55296||qe>57343)&&(ke=qe));break;case 4:He=te[ue+1],Ue=te[ue+2],Fe=te[ue+3],(He&192)===128&&(Ue&192)===128&&(Fe&192)===128&&(qe=(ve&15)<<18|(He&63)<<12|(Ue&63)<<6|Fe&63,qe>65535&&qe<1114112&&(ke=qe))}}ke===null?(ke=65533,Ae=1):ke>65535&&(ke-=65536,ie.push(ke>>>10&1023|55296),ke=56320|ke&1023),ie.push(ke),ue+=Ae}return Le(ie)}const Be=4096;function Le(te){const K=te.length;if(K<=Be)return String.fromCharCode.apply(String,te);let G="",ie=0;for(;ie<K;)G+=String.fromCharCode.apply(String,te.slice(ie,ie+=Be));return G}function Je(te,K,G){let ie="";G=Math.min(te.length,G);for(let ue=K;ue<G;++ue)ie+=String.fromCharCode(te[ue]&127);return ie}function We(te,K,G){let ie="";G=Math.min(te.length,G);for(let ue=K;ue<G;++ue)ie+=String.fromCharCode(te[ue]);return ie}function nt(te,K,G){const ie=te.length;(!K||K<0)&&(K=0),(!G||G<0||G>ie)&&(G=ie);let ue="";for(let ve=K;ve<G;++ve)ue+=cn[te[ve]];return ue}function bt(te,K,G){const ie=te.slice(K,G);let ue="";for(let ve=0;ve<ie.length-1;ve+=2)ue+=String.fromCharCode(ie[ve]+ie[ve+1]*256);return ue}a.prototype.slice=function(K,G){const ie=this.length;K=~~K,G=G===void 0?ie:~~G,K<0?(K+=ie,K<0&&(K=0)):K>ie&&(K=ie),G<0?(G+=ie,G<0&&(G=0)):G>ie&&(G=ie),G<K&&(G=K);const ue=this.subarray(K,G);return Object.setPrototypeOf(ue,a.prototype),ue};function Me(te,K,G){if(te%1!==0||te<0)throw new RangeError("offset is not uint");if(te+K>G)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(K,G,ie){K=K>>>0,G=G>>>0,ie||Me(K,G,this.length);let ue=this[K],ve=1,ke=0;for(;++ke<G&&(ve*=256);)ue+=this[K+ke]*ve;return ue},a.prototype.readUintBE=a.prototype.readUIntBE=function(K,G,ie){K=K>>>0,G=G>>>0,ie||Me(K,G,this.length);let ue=this[K+--G],ve=1;for(;G>0&&(ve*=256);)ue+=this[K+--G]*ve;return ue},a.prototype.readUint8=a.prototype.readUInt8=function(K,G){return K=K>>>0,G||Me(K,1,this.length),this[K]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(K,G){return K=K>>>0,G||Me(K,2,this.length),this[K]|this[K+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(K,G){return K=K>>>0,G||Me(K,2,this.length),this[K]<<8|this[K+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(K,G){return K=K>>>0,G||Me(K,4,this.length),(this[K]|this[K+1]<<8|this[K+2]<<16)+this[K+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(K,G){return K=K>>>0,G||Me(K,4,this.length),this[K]*16777216+(this[K+1]<<16|this[K+2]<<8|this[K+3])},a.prototype.readBigUInt64LE=kt(function(K){K=K>>>0,Ne(K,"offset");const G=this[K],ie=this[K+7];(G===void 0||ie===void 0)&&Ze(K,this.length-8);const ue=G+this[++K]*2**8+this[++K]*2**16+this[++K]*2**24,ve=this[++K]+this[++K]*2**8+this[++K]*2**16+ie*2**24;return BigInt(ue)+(BigInt(ve)<<BigInt(32))}),a.prototype.readBigUInt64BE=kt(function(K){K=K>>>0,Ne(K,"offset");const G=this[K],ie=this[K+7];(G===void 0||ie===void 0)&&Ze(K,this.length-8);const ue=G*2**24+this[++K]*2**16+this[++K]*2**8+this[++K],ve=this[++K]*2**24+this[++K]*2**16+this[++K]*2**8+ie;return(BigInt(ue)<<BigInt(32))+BigInt(ve)}),a.prototype.readIntLE=function(K,G,ie){K=K>>>0,G=G>>>0,ie||Me(K,G,this.length);let ue=this[K],ve=1,ke=0;for(;++ke<G&&(ve*=256);)ue+=this[K+ke]*ve;return ve*=128,ue>=ve&&(ue-=Math.pow(2,8*G)),ue},a.prototype.readIntBE=function(K,G,ie){K=K>>>0,G=G>>>0,ie||Me(K,G,this.length);let ue=G,ve=1,ke=this[K+--ue];for(;ue>0&&(ve*=256);)ke+=this[K+--ue]*ve;return ve*=128,ke>=ve&&(ke-=Math.pow(2,8*G)),ke},a.prototype.readInt8=function(K,G){return K=K>>>0,G||Me(K,1,this.length),this[K]&128?(255-this[K]+1)*-1:this[K]},a.prototype.readInt16LE=function(K,G){K=K>>>0,G||Me(K,2,this.length);const ie=this[K]|this[K+1]<<8;return ie&32768?ie|4294901760:ie},a.prototype.readInt16BE=function(K,G){K=K>>>0,G||Me(K,2,this.length);const ie=this[K+1]|this[K]<<8;return ie&32768?ie|4294901760:ie},a.prototype.readInt32LE=function(K,G){return K=K>>>0,G||Me(K,4,this.length),this[K]|this[K+1]<<8|this[K+2]<<16|this[K+3]<<24},a.prototype.readInt32BE=function(K,G){return K=K>>>0,G||Me(K,4,this.length),this[K]<<24|this[K+1]<<16|this[K+2]<<8|this[K+3]},a.prototype.readBigInt64LE=kt(function(K){K=K>>>0,Ne(K,"offset");const G=this[K],ie=this[K+7];(G===void 0||ie===void 0)&&Ze(K,this.length-8);const ue=this[K+4]+this[K+5]*2**8+this[K+6]*2**16+(ie<<24);return(BigInt(ue)<<BigInt(32))+BigInt(G+this[++K]*2**8+this[++K]*2**16+this[++K]*2**24)}),a.prototype.readBigInt64BE=kt(function(K){K=K>>>0,Ne(K,"offset");const G=this[K],ie=this[K+7];(G===void 0||ie===void 0)&&Ze(K,this.length-8);const ue=(G<<24)+this[++K]*2**16+this[++K]*2**8+this[++K];return(BigInt(ue)<<BigInt(32))+BigInt(this[++K]*2**24+this[++K]*2**16+this[++K]*2**8+ie)}),a.prototype.readFloatLE=function(K,G){return K=K>>>0,G||Me(K,4,this.length),N.read(this,K,!0,23,4)},a.prototype.readFloatBE=function(K,G){return K=K>>>0,G||Me(K,4,this.length),N.read(this,K,!1,23,4)},a.prototype.readDoubleLE=function(K,G){return K=K>>>0,G||Me(K,8,this.length),N.read(this,K,!0,52,8)},a.prototype.readDoubleBE=function(K,G){return K=K>>>0,G||Me(K,8,this.length),N.read(this,K,!1,52,8)};function De(te,K,G,ie,ue,ve){if(!a.isBuffer(te))throw new TypeError('"buffer" argument must be a Buffer instance');if(K>ue||K<ve)throw new RangeError('"value" argument is out of bounds');if(G+ie>te.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(K,G,ie,ue){if(K=+K,G=G>>>0,ie=ie>>>0,!ue){const Ae=Math.pow(2,8*ie)-1;De(this,K,G,ie,Ae,0)}let ve=1,ke=0;for(this[G]=K&255;++ke<ie&&(ve*=256);)this[G+ke]=K/ve&255;return G+ie},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(K,G,ie,ue){if(K=+K,G=G>>>0,ie=ie>>>0,!ue){const Ae=Math.pow(2,8*ie)-1;De(this,K,G,ie,Ae,0)}let ve=ie-1,ke=1;for(this[G+ve]=K&255;--ve>=0&&(ke*=256);)this[G+ve]=K/ke&255;return G+ie},a.prototype.writeUint8=a.prototype.writeUInt8=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,1,255,0),this[G]=K&255,G+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,2,65535,0),this[G]=K&255,this[G+1]=K>>>8,G+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,2,65535,0),this[G]=K>>>8,this[G+1]=K&255,G+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,4,4294967295,0),this[G+3]=K>>>24,this[G+2]=K>>>16,this[G+1]=K>>>8,this[G]=K&255,G+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,4,4294967295,0),this[G]=K>>>24,this[G+1]=K>>>16,this[G+2]=K>>>8,this[G+3]=K&255,G+4};function ut(te,K,G,ie,ue){Re(K,ie,ue,te,G,7);let ve=Number(K&BigInt(4294967295));te[G++]=ve,ve=ve>>8,te[G++]=ve,ve=ve>>8,te[G++]=ve,ve=ve>>8,te[G++]=ve;let ke=Number(K>>BigInt(32)&BigInt(4294967295));return te[G++]=ke,ke=ke>>8,te[G++]=ke,ke=ke>>8,te[G++]=ke,ke=ke>>8,te[G++]=ke,G}function ze(te,K,G,ie,ue){Re(K,ie,ue,te,G,7);let ve=Number(K&BigInt(4294967295));te[G+7]=ve,ve=ve>>8,te[G+6]=ve,ve=ve>>8,te[G+5]=ve,ve=ve>>8,te[G+4]=ve;let ke=Number(K>>BigInt(32)&BigInt(4294967295));return te[G+3]=ke,ke=ke>>8,te[G+2]=ke,ke=ke>>8,te[G+1]=ke,ke=ke>>8,te[G]=ke,G+8}a.prototype.writeBigUInt64LE=kt(function(K,G=0){return ut(this,K,G,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=kt(function(K,G=0){return ze(this,K,G,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(K,G,ie,ue){if(K=+K,G=G>>>0,!ue){const He=Math.pow(2,8*ie-1);De(this,K,G,ie,He-1,-He)}let ve=0,ke=1,Ae=0;for(this[G]=K&255;++ve<ie&&(ke*=256);)K<0&&Ae===0&&this[G+ve-1]!==0&&(Ae=1),this[G+ve]=(K/ke>>0)-Ae&255;return G+ie},a.prototype.writeIntBE=function(K,G,ie,ue){if(K=+K,G=G>>>0,!ue){const He=Math.pow(2,8*ie-1);De(this,K,G,ie,He-1,-He)}let ve=ie-1,ke=1,Ae=0;for(this[G+ve]=K&255;--ve>=0&&(ke*=256);)K<0&&Ae===0&&this[G+ve+1]!==0&&(Ae=1),this[G+ve]=(K/ke>>0)-Ae&255;return G+ie},a.prototype.writeInt8=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,1,127,-128),K<0&&(K=255+K+1),this[G]=K&255,G+1},a.prototype.writeInt16LE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,2,32767,-32768),this[G]=K&255,this[G+1]=K>>>8,G+2},a.prototype.writeInt16BE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,2,32767,-32768),this[G]=K>>>8,this[G+1]=K&255,G+2},a.prototype.writeInt32LE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,4,2147483647,-2147483648),this[G]=K&255,this[G+1]=K>>>8,this[G+2]=K>>>16,this[G+3]=K>>>24,G+4},a.prototype.writeInt32BE=function(K,G,ie){return K=+K,G=G>>>0,ie||De(this,K,G,4,2147483647,-2147483648),K<0&&(K=4294967295+K+1),this[G]=K>>>24,this[G+1]=K>>>16,this[G+2]=K>>>8,this[G+3]=K&255,G+4},a.prototype.writeBigInt64LE=kt(function(K,G=0){return ut(this,K,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=kt(function(K,G=0){return ze(this,K,G,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function it(te,K,G,ie,ue,ve){if(G+ie>te.length)throw new RangeError("Index out of range");if(G<0)throw new RangeError("Index out of range")}function ft(te,K,G,ie,ue){return K=+K,G=G>>>0,ue||it(te,K,G,4),N.write(te,K,G,ie,23,4),G+4}a.prototype.writeFloatLE=function(K,G,ie){return ft(this,K,G,!0,ie)},a.prototype.writeFloatBE=function(K,G,ie){return ft(this,K,G,!1,ie)};function ot(te,K,G,ie,ue){return K=+K,G=G>>>0,ue||it(te,K,G,8),N.write(te,K,G,ie,52,8),G+8}a.prototype.writeDoubleLE=function(K,G,ie){return ot(this,K,G,!0,ie)},a.prototype.writeDoubleBE=function(K,G,ie){return ot(this,K,G,!1,ie)},a.prototype.copy=function(K,G,ie,ue){if(!a.isBuffer(K))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!ue&&ue!==0&&(ue=this.length),G>=K.length&&(G=K.length),G||(G=0),ue>0&&ue<ie&&(ue=ie),ue===ie||K.length===0||this.length===0)return 0;if(G<0)throw new RangeError("targetStart out of bounds");if(ie<0||ie>=this.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),K.length-G<ue-ie&&(ue=K.length-G+ie);const ve=ue-ie;return this===K&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(G,ie,ue):Uint8Array.prototype.set.call(K,this.subarray(ie,ue),G),ve},a.prototype.fill=function(K,G,ie,ue){if(typeof K=="string"){if(typeof G=="string"?(ue=G,G=0,ie=this.length):typeof ie=="string"&&(ue=ie,ie=this.length),ue!==void 0&&typeof ue!="string")throw new TypeError("encoding must be a string");if(typeof ue=="string"&&!a.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);if(K.length===1){const ke=K.charCodeAt(0);(ue==="utf8"&&ke<128||ue==="latin1")&&(K=ke)}}else typeof K=="number"?K=K&255:typeof K=="boolean"&&(K=Number(K));if(G<0||this.length<G||this.length<ie)throw new RangeError("Out of range index");if(ie<=G)return this;G=G>>>0,ie=ie===void 0?this.length:ie>>>0,K||(K=0);let ve;if(typeof K=="number")for(ve=G;ve<ie;++ve)this[ve]=K;else{const ke=a.isBuffer(K)?K:a.from(K,ue),Ae=ke.length;if(Ae===0)throw new TypeError('The value "'+K+'" is invalid for argument "value"');for(ve=0;ve<ie-G;++ve)this[ve+G]=ke[ve%Ae]}return this};const Ve={};function $e(te,K,G){Ve[te]=class extends G{constructor(){super(),Object.defineProperty(this,"message",{value:K.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${te}]`,this.stack,delete this.name}get code(){return te}set code(ue){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ue,writable:!0})}toString(){return`${this.name} [${te}]: ${this.message}`}}}$e("ERR_BUFFER_OUT_OF_BOUNDS",function(te){return te?`${te} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),$e("ERR_INVALID_ARG_TYPE",function(te,K){return`The "${te}" argument must be of type number. Received type ${typeof K}`},TypeError),$e("ERR_OUT_OF_RANGE",function(te,K,G){let ie=`The value of "${te}" is out of range.`,ue=G;return Number.isInteger(G)&&Math.abs(G)>2**32?ue=Oe(String(G)):typeof G=="bigint"&&(ue=String(G),(G>BigInt(2)**BigInt(32)||G<-(BigInt(2)**BigInt(32)))&&(ue=Oe(ue)),ue+="n"),ie+=` It must be ${K}. Received ${ue}`,ie},RangeError);function Oe(te){let K="",G=te.length;const ie=te[0]==="-"?1:0;for(;G>=ie+4;G-=3)K=`_${te.slice(G-3,G)}${K}`;return`${te.slice(0,G)}${K}`}function xe(te,K,G){Ne(K,"offset"),(te[K]===void 0||te[K+G]===void 0)&&Ze(K,te.length-(G+1))}function Re(te,K,G,ie,ue,ve){if(te>G||te<K){const ke=typeof K=="bigint"?"n":"";let Ae;throw K===0||K===BigInt(0)?Ae=`>= 0${ke} and < 2${ke} ** ${(ve+1)*8}${ke}`:Ae=`>= -(2${ke} ** ${(ve+1)*8-1}${ke}) and < 2 ** ${(ve+1)*8-1}${ke}`,new Ve.ERR_OUT_OF_RANGE("value",Ae,te)}xe(ie,ue,ve)}function Ne(te,K){if(typeof te!="number")throw new Ve.ERR_INVALID_ARG_TYPE(K,"number",te)}function Ze(te,K,G){throw Math.floor(te)!==te?(Ne(te,G),new Ve.ERR_OUT_OF_RANGE("offset","an integer",te)):K<0?new Ve.ERR_BUFFER_OUT_OF_BOUNDS:new Ve.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${K}`,te)}const Xe=/[^+/0-9A-Za-z-_]/g;function Qe(te){if(te=te.split("=")[0],te=te.trim().replace(Xe,""),te.length<2)return"";for(;te.length%4!==0;)te=te+"=";return te}function mt(te,K){K=K||1/0;let G;const ie=te.length;let ue=null;const ve=[];for(let ke=0;ke<ie;++ke){if(G=te.charCodeAt(ke),G>55295&&G<57344){if(!ue){if(G>56319){(K-=3)>-1&&ve.push(239,191,189);continue}else if(ke+1===ie){(K-=3)>-1&&ve.push(239,191,189);continue}ue=G;continue}if(G<56320){(K-=3)>-1&&ve.push(239,191,189),ue=G;continue}G=(ue-55296<<10|G-56320)+65536}else ue&&(K-=3)>-1&&ve.push(239,191,189);if(ue=null,G<128){if((K-=1)<0)break;ve.push(G)}else if(G<2048){if((K-=2)<0)break;ve.push(G>>6|192,G&63|128)}else if(G<65536){if((K-=3)<0)break;ve.push(G>>12|224,G>>6&63|128,G&63|128)}else if(G<1114112){if((K-=4)<0)break;ve.push(G>>18|240,G>>12&63|128,G>>6&63|128,G&63|128)}else throw new Error("Invalid code point")}return ve}function _t(te){const K=[];for(let G=0;G<te.length;++G)K.push(te.charCodeAt(G)&255);return K}function rn(te,K){let G,ie,ue;const ve=[];for(let ke=0;ke<te.length&&!((K-=2)<0);++ke)G=te.charCodeAt(ke),ie=G>>8,ue=G%256,ve.push(ue),ve.push(ie);return ve}function At(te){return z.toByteArray(Qe(te))}function Dt(te,K,G,ie){let ue;for(ue=0;ue<ie&&!(ue+G>=K.length||ue>=te.length);++ue)K[ue+G]=te[ue];return ue}function st(te,K){return te instanceof K||te!=null&&te.constructor!=null&&te.constructor.name!=null&&te.constructor.name===K.name}function on(te){return te!==te}const cn=function(){const te="0123456789abcdef",K=new Array(256);for(let G=0;G<16;++G){const ie=G*16;for(let ue=0;ue<16;++ue)K[ie+ue]=te[G]+te[ue]}return K}();function kt(te){return typeof BigInt>"u"?ln:te}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(I){for(var O,n=1,a=arguments.length;n<a;n++){O=arguments[n];for(var q in O)Object.prototype.hasOwnProperty.call(O,q)&&(I[q]=O[q])}return I},D.apply(this,arguments)},z=toolsEbml&&toolsEbml.__spreadArray||function(I,O,n){if(n||arguments.length===2)for(var a=0,q=O.length,F;a<q;a++)(F||!(a in O))&&(F||(F=Array.prototype.slice.call(O,0,a)),F[a]=O[a]);return I.concat(F||Array.prototype.slice.call(O))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var N=requireTools(),J=function(){function I(){}return I.readVint=function(O,n){n===void 0&&(n=0);var a=8-Math.floor(Math.log2(O[n]));if(a>8){var q=I.readHexString(O,n,n+a);throw new Error("Unrepresentable length: ".concat(a," ").concat(q))}if(n+a>O.length)return null;for(var F=O[n]&(1<<8-a)-1,Z=1;Z<a;Z+=1){if(Z===7&&F>=Math.pow(2,8)&&O[n+7]>0)return{length:a,value:-1};F*=Math.pow(2,8),F+=O[n+Z]}return{length:a,value:F}},I.writeVint=function(O){if(O<0||O>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(O));var n=1;for(n=1;n<=8&&!(O<Math.pow(2,7*n)-1);n+=1);for(var a=N.Buffer.alloc(n),q=O,F=1;F<=n;F+=1){var Z=q&255;a[n-F]=Z,q-=Z,q/=Math.pow(2,8)}return a[0]|=1<<8-n,a},I.concatenate=function(O,n){return!O&&!n?N.Buffer.from([]):!O||O.byteLength===0?n:!n||n.byteLength===0?O:N.Buffer.from(z(z([],O,!0),n,!0))},I.readHexString=function(O,n,a){return n===void 0&&(n=0),a===void 0&&(a=O.byteLength),Array.from(O.slice(n,a)).map(function(q){return Number(q).toString(16)}).reduce(function(q,F){return"".concat(q).concat(F.padStart(2,"0"))},"")},I.readUtf8=function(O){try{return N.Buffer.from(O).toString("utf8")}catch{return null}},I.readUnsigned=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 1:return n.getUint8(0);case 2:return n.getUint16(0);case 4:return n.getUint32(0)}return O.byteLength<=6?O.reduce(function(a,q){return a*256+q},0):I.readHexString(O,0,O.byteLength)},I.readSigned=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 1:return n.getInt8(0);case 2:return n.getInt16(0);case 4:return n.getInt32(0);default:return NaN}},I.readFloat=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 4:return n.getFloat32(0);case 8:return n.getFloat64(0);default:return NaN}},I.readDate=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 1:return new Date(n.getUint8(0));case 2:return new Date(n.getUint16(0));case 4:return new Date(n.getUint32(0));case 8:return new Date(Number.parseInt(I.readHexString(O),16));default:return new Date(0)}},I.readDataFromTag=function(O,n){var a=O.type,q=O.name,F=O.track,Z=O.discardable||!1,X=O.keyframe||!1,ee=null,Q;switch(a){case"u":Q=I.readUnsigned(n);break;case"f":Q=I.readFloat(n);break;case"i":Q=I.readSigned(n);break;case"s":Q=String.fromCharCode.apply(String,n);break;case"8":Q=I.readUtf8(n);break;case"d":Q=I.readDate(n);break}if(q==="SimpleBlock"||q==="Block"){var ne=0,se=I.readVint(n,ne),re=se.length,oe=se.value;ne+=re,F=oe,Q=I.readSigned(n.subarray(ne,ne+2)),ne+=2,q==="SimpleBlock"&&(X=!!(n[re+2]&128),Z=!!(n[re+2]&1)),ne+=1,ee=n.subarray(ne)}return D(D({},O),{data:n,discardable:Z,keyframe:X,payload:ee,track:F,value:Q})},I}();return toolsEbml.default=J,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(D,z,N){z=z||0;for(var J=1;J<=8&&!(D[z]>=Math.pow(2,8-J));J++);if(J>8)throw new Error("Unrepresentable length: "+J+" "+D.toString("hex",z,z+J));if(z+J>D.length)return null;var I,O=D[z]&(1<<8-J)-1;for(I=1;I<J;I++){if(I===7&&O>=Math.pow(2,45)&&D[z+7]>0)return{length:J,value:-1};O*=Math.pow(2,8),O+=D[z+I]}return N&&(O-=Math.pow(2,J*7-1)-1),{length:J,value:O}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var D=requireVint();function z(N){this.buffer=N,this.offset=0}return z.prototype.nextInt16BE=function(){var N=this.buffer.readInt16BE(this.offset);return this.offset+=2,N},z.prototype.nextUInt8=function(){var N=this.buffer.readUInt8(this.offset);return this.offset+=1,N},z.prototype.nextUIntV=function(){var N=D(this.buffer,this.offset);return this.offset+=N.length,N.value},z.prototype.nextIntV=function(){var N=D(this.buffer,this.offset,!0);return this.offset+=N.length,N.value},z.prototype.nextBuffer=function(N){var J=N?this.buffer.slice(this.offset,this.offset+N):this.buffer.slice(this.offset);return this.offset+=N||this.length,J},Object.defineProperty(z.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=z,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var D=requireBufferReader(),z=1,N=3,J=2;ebmlBlock=function(O){var n={},a=new D(O);n.trackNumber=a.nextUIntV(),n.timecode=a.nextInt16BE();var q=a.nextUInt8();n.invisible=!!(q&8),n.keyframe=!!(q&128),n.discardable=!!(q&1);var F=(q&6)>>1;return n.frames=I(a,F),n};function I(O,n){if(!n)return[O.nextBuffer()];var a,q,F=[],Z=O.nextUInt8()+1;if(n===J){if(O.length%Z!==0)throw new Error("Fixed-Size Lacing Error");for(q=O.length/Z,a=0;a<Z;a++)F.push(O.nextBuffer(q));return F}var X=[];if(n===z)for(a=0;a<Z-1;a++){var ee;q=0;do ee=O.nextUInt8(),q+=ee;while(ee===255);X.push(q)}else if(n===N)for(q=O.nextUIntV(),X.push(q),a=1;a<Z-1;a++)q+=O.nextIntV(),X.push(q);for(a=0;a<Z-1;a++)F.push(O.nextBuffer(X[a]));return F.push(O.nextBuffer()),F}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 z=requireInt64Buffer(),N=requireEBMLEncoder(),J=requireBuffer(),I=requireToolsEbml(),O=requireEbmlBlock();D.Buffer=J.Buffer,D.readVint=I.default.readVint,D.writeVint=I.default.writeVint,D.ebmlBlock=O;function n(le){return(0,D.ebmlBlock)(new D.Buffer(le))}D.readBlock=n;function a(le,de,ge){return ge===void 0&&(ge=!1),ae([le,ge?new D.Buffer("01ffffffffffffff","hex"):(0,D.writeVint)(de.length),de])}D.encodeTag=a;function q(le){return le.reduce(function(de,ge){if(ge.type!=="b"||ge.name!=="SimpleBlock")return de;var Se=(0,D.ebmlBlock)(ge.data),Ee=Se.frames.some(function(Be){var Le=Be.slice(3,6).toString("hex");return Le==="9d012a"});return Ee?de.concat(ge):de},[])}D.WebPBlockFilter=q;function F(le){var de=Z("VP8 ",le),ge=ae([new D.Buffer("WEBP","ascii"),de]);return Z("RIFF",ge)}D.VP8BitStreamToRiffWebPBuffer=F;function Z(le,de){var ge=new D.Buffer(4);return ge.writeUInt32LE(de.byteLength,0),ae([new D.Buffer(le.substr(0,4),"ascii"),ge,de,new D.Buffer(de.byteLength%2===0?0:1)])}D.createRIFFChunk=Z;function X(le,de,ge){var Se=Q("EBML",le),Ee=se(Se),Be=Ee+12,Le=le[le.length-1].dataEnd-Be,Je=Q("Info",le);ee("Duration",Je),Je.splice(1,0,{name:"Duration",type:"f",data:ye(de,8)});for(var We=se(Je),nt=Q("Tracks",le),bt=se(nt),Me=47,De=[],ut=5+ge.length*15,ze=[],it=-1,ft=10,ot=function(Re){var Ne=Me,Ze=Ne+We,Xe=Ze+bt,Qe=Xe+ut,mt=Qe-Le;if(De=[],De.push({name:"SeekHead",type:"m",isEnd:!1}),De.push({name:"Seek",type:"m",isEnd:!1}),De.push({name:"SeekID",type:"b",data:new D.Buffer([21,73,169,102])}),De.push({name:"SeekPosition",type:"u",data:be(Ne)}),De.push({name:"Seek",type:"m",isEnd:!0}),De.push({name:"Seek",type:"m",isEnd:!1}),De.push({name:"SeekID",type:"b",data:new D.Buffer([22,84,174,107])}),De.push({name:"SeekPosition",type:"u",data:be(Ze)}),De.push({name:"Seek",type:"m",isEnd:!0}),De.push({name:"Seek",type:"m",isEnd:!1}),De.push({name:"SeekID",type:"b",data:new D.Buffer([28,83,187,107])}),De.push({name:"SeekPosition",type:"u",data:be(Xe)}),De.push({name:"Seek",type:"m",isEnd:!0}),De.push({name:"SeekHead",type:"m",isEnd:!0}),Me=se(De),ze=[],ze.push({name:"Cues",type:"m",isEnd:!1}),ge.forEach(function(_t){var rn=_t.CueTrack,At=_t.CueClusterPosition,Dt=_t.CueTime;ze.push({name:"CuePoint",type:"m",isEnd:!1}),ze.push({name:"CueTime",type:"u",data:be(Dt)}),ze.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ze.push({name:"CueTrack",type:"u",data:be(rn)}),At-=Be,At+=mt,ze.push({name:"CueClusterPosition",type:"u",data:be(At)}),ze.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ze.push({name:"CuePoint",type:"m",isEnd:!0})}),ze.push({name:"Cues",type:"m",isEnd:!0}),ut=se(ze),it!==mt){if(it=mt,Re===ft-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Ve=0;Ve<ft;Ve++){var $e=ot(Ve);if($e==="break")break}var Oe=[].concat.apply([],[Se,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},De,Je,nt,ze]),xe=new N.default().encode(Oe);return xe}D.makeMetadataSeekable=X;function ee(le,de){for(var ge=-1,Se=0;Se<de.length;Se++){var Ee=de[Se];if(Ee.name===le)if(Ee.type==="m")if(!Ee.isEnd)ge=Se;else{if(ge==-1)throw new Error("Detected ".concat(le," closing element before finding the start"));de.splice(ge,Se-ge+1);return}else{de.splice(Se,1);return}}}D.removeElement=ee;function Q(le,de){for(var ge=[],Se=-1,Ee=0;Ee<de.length;Ee++){var Be=de[Ee];if(Be.name===le)if(Be.type==="m")if(!Be.isEnd)Se=Ee;else{if(Se==-1)throw new Error("Detected ".concat(le," closing element before finding the start"));ge=de.slice(Se,Ee+1);break}else{ge.push(de[Ee]);break}}return ge}D.extractElement=Q;function ne(le,de){Array.isArray(de.cueInfos)&&!Array.isArray(de.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),de.cues=de.cueInfos);for(var ge=[],Se=[],Ee=0;Ee<le.length;Ee++){var Be=le[Ee];if(Be.type==="m"&&Be.name==="Segment"){if(ge=le.slice(0,Ee),Se=le.slice(Ee),Be.unknownSize){Se.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(Se[Se.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Le=Se[Se.length-1].dataEnd,Je=ge[ge.length-1].dataEnd,We=new N.default().encode(ge).byteLength,nt=We-Je,bt=Le-Se[0].tagStart;Se[0].tagStart-Je,Se[0].tagStart;var Me=new D.Buffer([24,83,128,103]),De=new D.Buffer("01ffffffffffffff","hex"),ut=Me.byteLength+De.byteLength,ze=bt,it;for(it=1;it<20;it++){var ft=Je+ut+ze,ot=ft-Le,Ve=nt+ot,$e=re(Se,Ve,de),Oe=new N.default().encode($e).byteLength;if(Oe===ze)return new N.default().encode([].concat(ge,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],$e));ze=Oe}throw new Error("unable to refine metadata, stable size could not be found in "+it+" iterations!")}D.putRefinedMetaData=ne;function se(le){var de=new N.default;return le.reduce(function(ge,Se){return ge.concat(de.encode([Se]))},[]).reduce(function(ge,Se){return ge+Se.byteLength},0)}function re(le,de,ge){var Se=ge.duration,Ee=ge.clusterPtrs,Be=ge.cues,Le=le.slice(0);if(typeof Se=="number"){var Je=!1;Le.forEach(function(nt){nt.type==="f"&&nt.name==="Duration"&&(Je=!0,nt.data=ye(Se,8))}),Je||_e(Le,"Info",[{name:"Duration",type:"f",data:ye(Se,8)}])}Array.isArray(Be)&&_e(Le,"Cues",me(Be,de));var We=[];return Array.isArray(Ee)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),We=oe(Ee,de)),_e(Le,"SeekHead",We,!0),Le}function oe(le,de){var ge=[];return le.forEach(function(Se){ge.push({name:"Seek",type:"m",isEnd:!1}),ge.push({name:"SeekID",type:"b",data:new D.Buffer([31,67,182,117])}),ge.push({name:"SeekPosition",type:"u",data:be(Se+de)}),ge.push({name:"Seek",type:"m",isEnd:!0})}),ge}function me(le,de){var ge=[];return le.forEach(function(Se){var Ee=Se.CueTrack,Be=Se.CueClusterPosition,Le=Se.CueTime;ge.push({name:"CuePoint",type:"m",isEnd:!1}),ge.push({name:"CueTime",type:"u",data:be(Le)}),ge.push({name:"CueTrackPositions",type:"m",isEnd:!1}),ge.push({name:"CueTrack",type:"u",data:be(Ee)}),ge.push({name:"CueClusterPosition",type:"u",data:be(Be+de)}),ge.push({name:"CueTrackPositions",type:"m",isEnd:!0}),ge.push({name:"CuePoint",type:"m",isEnd:!0})}),ge}function _e(le,de,ge,Se){Se===void 0&&(Se=!1);for(var Ee=-1,Be=0;Be<le.length;Be++){var Le=le[Be];if(Le.type==="m"&&Le.name===de&&Le.isEnd===!1){Ee=Be;break}}Ee>=0?Array.prototype.splice.apply(le,[Ee+1,0].concat(ge)):Se?[].concat([{name:de,type:"m",isEnd:!1}],ge,[{name:de,type:"m",isEnd:!0}]).reverse().forEach(function(Je){le.unshift(Je)}):(le.push({name:de,type:"m",isEnd:!1}),ge.forEach(function(Je){le.push(Je)}),le.push({name:de,type:"m",isEnd:!0}))}function ae(le){return D.Buffer.concat(le)}D.concat=ae;function fe(le){var de=new D.Buffer(0);if(le.type==="m")return le;switch(le.type){case"u":de=be(le.value);break;case"i":de=he(le.value);break;case"f":de=ye(le.value);break;case"s":de=new D.Buffer(le.value,"ascii");break;case"8":de=new D.Buffer(le.value,"utf8");break;case"b":de=le.value;break;case"d":de=new z.Int64BE(le.value.getTime().toString()).toBuffer();break}return Object.assign({},le,{data:de})}D.encodeValueToBuffer=fe;function be(le){for(var de=1;le>=Math.pow(2,8*de);de++);if(de>=7)return console.warn("7bit or more bigger uint not supported."),new z.Uint64BE(le).toBuffer();var ge=new D.Buffer(de);return ge.writeUIntBE(le,0,de),ge}D.createUIntBuffer=be;function he(le){for(var de=1;le>=Math.pow(2,8*de);de++);if(de>=7)return console.warn("7bit or more bigger uint not supported."),new z.Int64BE(le).toBuffer();var ge=new D.Buffer(de);return ge.writeIntBE(le,0,de),ge}D.createIntBuffer=he;function ye(le,de){if(de===void 0&&(de=8),de===8){var ge=new D.Buffer(8);return ge.writeDoubleBE(le,0),ge}else if(de===4){var ge=new D.Buffer(4);return ge.writeFloatBE(le,0),ge}else throw new Error("float type bits must 4bytes or 8bytes")}D.createFloatBuffer=ye;function we(le){return le instanceof Date?le:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(le)/1e3/1e3)}D.convertEBMLDateToJSDate=we}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var D=requireInt64Buffer(),z=requireTools(),N=requireTools(),J=requireEbmlID(),I;(function(n){n[n.STATE_TAG=1]="STATE_TAG",n[n.STATE_SIZE=2]="STATE_SIZE",n[n.STATE_CONTENT=3]="STATE_CONTENT"})(I||(I={}));var O=function(){function n(){this._buffer=new z.Buffer(0),this._tag_stack=[],this._state=I.STATE_TAG,this._cursor=0,this._total=0,this._schema=J.byEbmlID,this._result=[]}return n.prototype.decode=function(a){this.readChunk(a);var q=this._result;return this._result=[],q},n.prototype.readChunk=function(a){for(this._buffer=N.concat([this._buffer,new z.Buffer(a)]);this._cursor<this._buffer.length&&!(this._state===I.STATE_TAG&&!this.readTag()||this._state===I.STATE_SIZE&&!this.readSize()||this._state===I.STATE_CONTENT&&!this.readContent()););},n.prototype.getSchemaInfo=function(a){return this._schema[a]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},n.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var a=(0,z.readVint)(this._buffer,this._cursor);if(a==null)return!1;var q=this._buffer.slice(this._cursor,this._cursor+a.length),F=q.reduce(function(ee,Q,ne,se){return ee+Q*Math.pow(16,2*(se.length-1-ne))},0),Z=this.getSchemaInfo(F),X={EBML_ID:F.toString(16),schema:Z,type:Z.type,name:Z.name,level:Z.level,tagStart:this._total,tagEnd:this._total+a.length,sizeStart:this._total+a.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(X),this._cursor+=a.length,this._total+=a.length,this._state=I.STATE_SIZE,!0},n.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var a=(0,z.readVint)(this._buffer,this._cursor);if(a==null)return!1;var q=this._tag_stack[this._tag_stack.length-1];return q.sizeEnd=q.sizeStart+a.length,q.dataStart=q.sizeEnd,q.dataSize=a.value,a.value===-1?(q.dataEnd=-1,q.type==="m"&&(q.unknownSize=!0)):q.dataEnd=q.sizeEnd+a.value,this._cursor+=a.length,this._total+=a.length,this._state=I.STATE_CONTENT,!0},n.prototype.readContent=function(){var a=this._tag_stack[this._tag_stack.length-1];if(a.type==="m"){if(a.isEnd=!1,this._result.push(a),this._state=I.STATE_TAG,a.dataSize===0){var q=Object.assign({},a,{isEnd:!0});this._result.push(q),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+a.dataSize)return!1;var F=this._buffer.slice(this._cursor,this._cursor+a.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+a.dataSize),a.data=F,a.type){case"u":a.value=F.readUIntBE(0,F.length);break;case"i":a.value=F.readIntBE(0,F.length);break;case"f":a.value=a.dataSize===4?F.readFloatBE(0):a.dataSize===8?F.readDoubleBE(0):(console.warn("cannot read ".concat(a.dataSize," octets float. failback to 0")),0);break;case"s":a.value=F.toString("ascii");break;case"8":a.value=F.toString("utf8");break;case"b":a.value=F;break;case"d":a.value=(0,z.convertEBMLDateToJSDate)(new D.Int64BE(F).toNumber());break}if(a.value===null)throw new Error("unknown tag type:"+a.type);for(this._result.push(a),this._total+=a.dataSize,this._state=I.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var Z=this._tag_stack[this._tag_stack.length-1];if(Z.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<Z.dataEnd)break;if(Z.type!=="m")throw new Error("parent element is not master element");var q=Object.assign({},Z,{isEnd:!0});this._result.push(q),this._tag_stack.pop()}return!0},n}();return EBMLDecoder.default=O,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var D=typeof Reflect=="object"?Reflect:null,z=D&&typeof D.apply=="function"?D.apply:function(fe,be,he){return Function.prototype.apply.call(fe,be,he)},N;D&&typeof D.ownKeys=="function"?N=D.ownKeys:Object.getOwnPropertySymbols?N=function(fe){return Object.getOwnPropertyNames(fe).concat(Object.getOwnPropertySymbols(fe))}:N=function(fe){return Object.getOwnPropertyNames(fe)};function J(ae){console&&console.warn&&console.warn(ae)}var I=Number.isNaN||function(fe){return fe!==fe};function O(){O.init.call(this)}events.exports=O,events.exports.once=oe,O.EventEmitter=O,O.prototype._events=void 0,O.prototype._eventsCount=0,O.prototype._maxListeners=void 0;var n=10;function a(ae){if(typeof ae!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ae)}Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(ae){if(typeof ae!="number"||ae<0||I(ae))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ae+".");n=ae}}),O.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},O.prototype.setMaxListeners=function(fe){if(typeof fe!="number"||fe<0||I(fe))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+fe+".");return this._maxListeners=fe,this};function q(ae){return ae._maxListeners===void 0?O.defaultMaxListeners:ae._maxListeners}O.prototype.getMaxListeners=function(){return q(this)},O.prototype.emit=function(fe){for(var be=[],he=1;he<arguments.length;he++)be.push(arguments[he]);var ye=fe==="error",we=this._events;if(we!==void 0)ye=ye&&we.error===void 0;else if(!ye)return!1;if(ye){var le;if(be.length>0&&(le=be[0]),le instanceof Error)throw le;var de=new Error("Unhandled error."+(le?" ("+le.message+")":""));throw de.context=le,de}var ge=we[fe];if(ge===void 0)return!1;if(typeof ge=="function")z(ge,this,be);else for(var Se=ge.length,Ee=ne(ge,Se),he=0;he<Se;++he)z(Ee[he],this,be);return!0};function F(ae,fe,be,he){var ye,we,le;if(a(be),we=ae._events,we===void 0?(we=ae._events=Object.create(null),ae._eventsCount=0):(we.newListener!==void 0&&(ae.emit("newListener",fe,be.listener?be.listener:be),we=ae._events),le=we[fe]),le===void 0)le=we[fe]=be,++ae._eventsCount;else if(typeof le=="function"?le=we[fe]=he?[be,le]:[le,be]:he?le.unshift(be):le.push(be),ye=q(ae),ye>0&&le.length>ye&&!le.warned){le.warned=!0;var de=new Error("Possible EventEmitter memory leak detected. "+le.length+" "+String(fe)+" listeners added. Use emitter.setMaxListeners() to increase limit");de.name="MaxListenersExceededWarning",de.emitter=ae,de.type=fe,de.count=le.length,J(de)}return ae}O.prototype.addListener=function(fe,be){return F(this,fe,be,!1)},O.prototype.on=O.prototype.addListener,O.prototype.prependListener=function(fe,be){return F(this,fe,be,!0)};function Z(){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 X(ae,fe,be){var he={fired:!1,wrapFn:void 0,target:ae,type:fe,listener:be},ye=Z.bind(he);return ye.listener=be,he.wrapFn=ye,ye}O.prototype.once=function(fe,be){return a(be),this.on(fe,X(this,fe,be)),this},O.prototype.prependOnceListener=function(fe,be){return a(be),this.prependListener(fe,X(this,fe,be)),this},O.prototype.removeListener=function(fe,be){var he,ye,we,le,de;if(a(be),ye=this._events,ye===void 0)return this;if(he=ye[fe],he===void 0)return this;if(he===be||he.listener===be)--this._eventsCount===0?this._events=Object.create(null):(delete ye[fe],ye.removeListener&&this.emit("removeListener",fe,he.listener||be));else if(typeof he!="function"){for(we=-1,le=he.length-1;le>=0;le--)if(he[le]===be||he[le].listener===be){de=he[le].listener,we=le;break}if(we<0)return this;we===0?he.shift():se(he,we),he.length===1&&(ye[fe]=he[0]),ye.removeListener!==void 0&&this.emit("removeListener",fe,de||be)}return this},O.prototype.off=O.prototype.removeListener,O.prototype.removeAllListeners=function(fe){var be,he,ye;if(he=this._events,he===void 0)return this;if(he.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):he[fe]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete he[fe]),this;if(arguments.length===0){var we=Object.keys(he),le;for(ye=0;ye<we.length;++ye)le=we[ye],le!=="removeListener"&&this.removeAllListeners(le);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(be=he[fe],typeof be=="function")this.removeListener(fe,be);else if(be!==void 0)for(ye=be.length-1;ye>=0;ye--)this.removeListener(fe,be[ye]);return this};function ee(ae,fe,be){var he=ae._events;if(he===void 0)return[];var ye=he[fe];return ye===void 0?[]:typeof ye=="function"?be?[ye.listener||ye]:[ye]:be?re(ye):ne(ye,ye.length)}O.prototype.listeners=function(fe){return ee(this,fe,!0)},O.prototype.rawListeners=function(fe){return ee(this,fe,!1)},O.listenerCount=function(ae,fe){return typeof ae.listenerCount=="function"?ae.listenerCount(fe):Q.call(ae,fe)},O.prototype.listenerCount=Q;function Q(ae){var fe=this._events;if(fe!==void 0){var be=fe[ae];if(typeof be=="function")return 1;if(be!==void 0)return be.length}return 0}O.prototype.eventNames=function(){return this._eventsCount>0?N(this._events):[]};function ne(ae,fe){for(var be=new Array(fe),he=0;he<fe;++he)be[he]=ae[he];return be}function se(ae,fe){for(;fe+1<ae.length;fe++)ae[fe]=ae[fe+1];ae.pop()}function re(ae){for(var fe=new Array(ae.length),be=0;be<fe.length;++be)fe[be]=ae[be].listener||ae[be];return fe}function oe(ae,fe){return new Promise(function(be,he){function ye(le){ae.removeListener(fe,we),he(le)}function we(){typeof ae.removeListener=="function"&&ae.removeListener("error",ye),be([].slice.call(arguments))}_e(ae,fe,we,{once:!0}),fe!=="error"&&me(ae,ye,{once:!0})})}function me(ae,fe,be){typeof ae.on=="function"&&_e(ae,"error",fe,be)}function _e(ae,fe,be,he){if(typeof ae.on=="function")he.once?ae.once(fe,be):ae.on(fe,be);else if(typeof ae.addEventListener=="function")ae.addEventListener(fe,function ye(we){he.once&&ae.removeEventListener(fe,ye),be(we)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ae)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var D=EBMLReader&&EBMLReader.__extends||function(){var I=function(O,n){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,q){a.__proto__=q}||function(a,q){for(var F in q)Object.prototype.hasOwnProperty.call(q,F)&&(a[F]=q[F])},I(O,n)};return function(O,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");I(O,n);function a(){this.constructor=O}O.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var z=requireEvents(),N=requireTools(),J=function(I){D(O,I);function O(){var n=I.call(this)||this;return n.logGroup="",n.hasLoggingStarted=!1,n.metadataloaded=!1,n.chunks=[],n.stack=[],n.segmentOffset=0,n.last2SimpleBlockVideoTrackTimecode=[0,0],n.last2SimpleBlockAudioTrackTimecode=[0,0],n.lastClusterTimecode=0,n.lastClusterPosition=0,n.timecodeScale=1e6,n.metadataSize=0,n.metadatas=[],n.cues=[],n.firstVideoBlockRead=!1,n.firstAudioBlockRead=!1,n.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},n.trackTypes=[],n.trackDefaultDuration=[],n.trackCodecDelay=[],n.trackInfo={type:"nothing"},n.ended=!1,n.logging=!1,n.use_duration_every_simpleblock=!1,n.use_webp=!1,n.use_segment_info=!0,n.drop_default_duration=!0,n}return O.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()},O.prototype.emit_segment_info=function(){var n=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var F=this.lastClusterTimecode,Z=this.duration,X=this.timecodeScale;this.emit("cluster",{timecode:F,data:n}),this.emit("duration",{timecodeScale:X,duration:Z})}else{this.metadataloaded=!0,this.metadatas=n;var a=this.trackTypes.indexOf(1),q=this.trackTypes.indexOf(2);if(this.trackInfo=a>=0&&q>=0?{type:"both",trackNumber:a}:a>=0?{type:"video",trackNumber:a}:q>=0?{type:"audio",trackNumber:q}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:n,metadataSize:this.metadataSize})}},O.prototype.read=function(n){var a=this,q=!1;if(!this.ended){if(n.type==="m")if(n.isEnd)this.stack.pop();else{var F=this.stack[this.stack.length-1];if(F!=null&&F.level>=n.level){this.stack.pop(),this.logging&&console.groupEnd(),F.dataEnd=n.dataEnd,F.dataSize=n.dataEnd-F.dataStart,F.unknownSize=!1;var Z=Object.assign({},F,{name:F.name,type:F.type,isEnd:!0});this.chunks.push(Z)}this.stack.push(n)}if(n.type==="m"&&n.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=n.dataStart,this.emit("segment_offset",this.segmentOffset);else if(n.type==="b"&&n.name==="SimpleBlock"){var X=N.ebmlBlock(n.data),ee=X.timecode,Q=X.trackNumber,ne=X.frames;if(this.trackTypes[Q]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var se=this.lastClusterTimecode+ee;this.cues.push({CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:se}),this.emit("cue_info",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:se})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],ee]}else if(this.trackTypes[Q]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var se=this.lastClusterTimecode+ee;this.cues.push({CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:se}),this.emit("cue_info",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:Q,CueClusterPosition:this.lastClusterPosition,CueTime:se})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],ee]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&ne.forEach(function(re){var oe=re.slice(3,6).toString("hex");if(oe==="9d012a"){var me=N.VP8BitStreamToRiffWebPBuffer(re),_e=new Blob([me],{type:"image/webp"}),ae=a.duration;a.emit("webp",{currentTime:ae,webp:_e})}})}else n.type==="m"&&n.name==="Cluster"&&n.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",n.tagStart),this.lastClusterPosition=n.tagStart):n.type==="u"&&n.name==="Timecode"?this.lastClusterTimecode=n.value:n.type==="u"&&n.name==="TimecodeScale"?this.timecodeScale=n.value:n.type==="m"&&n.name==="TrackEntry"?n.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}:n.type==="u"&&n.name==="TrackType"?this.currentTrack.TrackType=n.value:n.type==="u"&&n.name==="TrackNumber"?this.currentTrack.TrackNumber=n.value:n.type==="u"&&n.name==="CodecDelay"?this.currentTrack.CodecDelay=n.value:n.type==="u"&&n.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),q=!0):this.currentTrack.DefaultDuration=n.value:n.name==="unknown"&&console.warn(n);!this.metadataloaded&&n.dataEnd>0&&(this.metadataSize=n.dataEnd),q||this.chunks.push(n),this.logging&&this.put(n)}},Object.defineProperty(O.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var n=0,a=0,q=0,F=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof F=="number")n=F;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){n=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockAudioTrackTimecode[1]}else{n=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){n=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){n=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockAudioTrackTimecode[1]}var X=(this.lastClusterTimecode+q)*this.timecodeScale+n-a,ee=X/this.timecodeScale;return Math.floor(ee)},enumerable:!1,configurable:!0}),O.prototype.addListener=function(n,a){return I.prototype.addListener.call(this,n,a)},O.prototype.put=function(n){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),n.type==="m"?n.isEnd?console.groupEnd():console.group(n.name+":"+n.tagStart):n.type==="b"?console.log(n.name,n.type):console.log(n.name,n.tagStart,n.type,n.value)},O}(z.EventEmitter);return EBMLReader.default=J,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(D){var z=ebml&&ebml.__createBinding||(Object.create?function(a,q,F,Z){Z===void 0&&(Z=F),Object.defineProperty(a,Z,{enumerable:!0,get:function(){return q[F]}})}:function(a,q,F,Z){Z===void 0&&(Z=F),a[Z]=q[F]}),N=ebml&&ebml.__exportStar||function(a,q){for(var F in a)F!=="default"&&!Object.prototype.hasOwnProperty.call(q,F)&&z(q,a,F)};Object.defineProperty(D,"__esModule",{value:!0}),D.tools=D.Reader=D.Encoder=D.Decoder=void 0,N(requireEBML(),D);var J=requireEBMLDecoder();D.Decoder=J.default;var I=requireEBMLEncoder();D.Encoder=I.default;var O=requireEBMLReader();D.Reader=O.default;var n=requireTools();D.tools=n}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var D=lib&&lib.__awaiter||function(I,O,n,a){function q(F){return F instanceof n?F:new n(function(Z){Z(F)})}return new(n||(n=Promise))(function(F,Z){function X(ne){try{Q(a.next(ne))}catch(se){Z(se)}}function ee(ne){try{Q(a.throw(ne))}catch(se){Z(se)}}function Q(ne){ne.done?F(ne.value):q(ne.value).then(X,ee)}Q((a=a.apply(I,O||[])).next())})},z=lib&&lib.__generator||function(I,O){var n={label:0,sent:function(){if(F[0]&1)throw F[1];return F[1]},trys:[],ops:[]},a,q,F,Z;return Z={next:X(0),throw:X(1),return:X(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function X(Q){return function(ne){return ee([Q,ne])}}function ee(Q){if(a)throw new TypeError("Generator is already executing.");for(;n;)try{if(a=1,q&&(F=Q[0]&2?q.return:Q[0]?q.throw||((F=q.return)&&F.call(q),0):q.next)&&!(F=F.call(q,Q[1])).done)return F;switch(q=0,F&&(Q=[Q[0]&2,F.value]),Q[0]){case 0:case 1:F=Q;break;case 4:return n.label++,{value:Q[1],done:!1};case 5:n.label++,q=Q[1],Q=[0];continue;case 7:Q=n.ops.pop(),n.trys.pop();continue;default:if(F=n.trys,!(F=F.length>0&&F[F.length-1])&&(Q[0]===6||Q[0]===2)){n=0;continue}if(Q[0]===3&&(!F||Q[1]>F[0]&&Q[1]<F[3])){n.label=Q[1];break}if(Q[0]===6&&n.label<F[1]){n.label=F[1],F=Q;break}if(F&&n.label<F[2]){n.label=F[2],n.ops.push(Q);break}F[2]&&n.ops.pop(),n.trys.pop();continue}Q=O.call(I,n)}catch(ne){Q=[6,ne],q=0}finally{a=F=0}if(Q[0]&5)throw Q[1];return{value:Q[0]?Q[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var N=requireEbml();function J(I){return D(this,void 0,void 0,function(){var O,n,a,q,F,Z,X,ee,Q,ne,se,re;return z(this,function(oe){switch(oe.label){case 0:if(!I)throw Error("call to fixWebmDuration requires a blob");O=new N.Decoder,n=new N.Reader,a=I.stream(),q=a.getReader(),oe.label=1;case 1:return[4,q.read()];case 2:return F=oe.sent(),Z=F.done,X=F.value,Z?(n.stop(),[3,3]):(ee=O.decode(X),ee=ee==null?void 0:ee.filter(function(me){return me.type!=="unknown"}),ee.forEach(function(me){n.read(me)}),X=null,[3,1]);case 3:return Q=N.tools.makeMetadataSeekable(n.metadatas,n.duration,n.cues),ne=new Blob([Q],{type:I.type}),se=I.slice(n.metadataSize),re=new Blob([ne,se],{type:I.type}),[2,re]}})})}return lib.default=J,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){Te(this,tt);Te(this,wt,!1);Te(this,yt,!1);Te(this,Mt,0);Te(this,Nt,0);Te(this,at,0);Te(this,ct,0);Te(this,gt,0);ce(this,"onchange",z=>{});ce(this,"onDurationChange",z=>{});ce(this,"start",async(z="")=>{z||(z=`video_Record_${E$1(Date.now())}`);let N=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(J=>{const I=J.getTracks();for(const n of I)n.onended=()=>this.stop();Pe(this,wt,!0),Pe(this,yt,!1),Pe(this,tt,new MediaRecorder(J)),pe(this,tt).start();const O=new Date().getTime();Pe(this,Mt,O),Pe(this,at,O),pe(this,St).call(this),pe(this,qt).call(this),pe(this,tt).addEventListener("dataavailable",n=>{N.push(n.data)}),pe(this,tt).addEventListener("stop",async()=>{Pe(this,wt,!1);const n=new Date().getTime();Pe(this,Nt,n),Pe(this,ct,pe(this,ct)+(n-pe(this,at))),pe(this,St).call(this),clearInterval(pe(this,gt));const a=J.getTracks();for(const ee of a)ee.stop();if(pe(this,tt)===null)return;const q=new Blob(N,{type:pe(this,tt).mimeType}),F=await fixWebmDuration(q),Z=URL.createObjectURL(F),X=document.createElement("a");X.href=Z,X.download=`${z}.mp4`,X.click(),URL.revokeObjectURL(Z),N=[],Pe(this,tt,null)})})});ce(this,"pause",async()=>{var N;await new Promise(J=>setTimeout(()=>J(!0),300)),(N=pe(this,tt))==null||N.pause(),Pe(this,yt,!0);const z=new Date().getTime();Pe(this,ct,pe(this,ct)+(z-pe(this,at))),pe(this,St).call(this),clearInterval(pe(this,gt))});ce(this,"resume",async()=>{var N;(N=pe(this,tt))==null||N.resume(),Pe(this,yt,!1);const z=new Date().getTime();Pe(this,at,z),pe(this,St).call(this),pe(this,qt).call(this)});ce(this,"stop",async()=>{var z;(z=pe(this,tt))==null||z.stop()});ce(this,"getDuration",()=>{if(pe(this,at)===0)return 0;let z=pe(this,ct);const N=new Date().getTime();if(pe(this,wt)&&pe(this,yt)===!1){const J=N-pe(this,at);Pe(this,at,N),z=z+J}return z});ce(this,"getInfo",()=>({active:pe(this,wt),pause:pe(this,yt),startTime:pe(this,Mt),endTime:pe(this,Nt),duration:pe(this,ct)}));Te(this,St,()=>{const z=this.getInfo();this.onchange(z)});Te(this,qt,()=>{clearInterval(pe(this,gt)),Pe(this,gt,setInterval(()=>{Pe(this,ct,this.getDuration()),this.onDurationChange(pe(this,ct))},500))})}}tt=new WeakMap,wt=new WeakMap,yt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,at=new WeakMap,ct=new WeakMap,gt=new WeakMap,St=new WeakMap,qt=new WeakMap;class RoomBase{constructor(z){ce(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!0,logUrl:"https://logs.putplay.cc",newPublishAutoSubscribe:!0});ce(this,"sdk_service_version","1.0.6");ce(this,"prohibitNotify",!1);ce(this,"isEarly",!1);ce(this,"isInRoom",!1);ce(this,"taskQueue");ce(this,"roomState","ready");ce(this,"createAt",Date.now());ce(this,"cwsIns");ce(this,"peerIns");ce(this,"transceiverMap",new Map);ce(this,"sendChannel");ce(this,"receiveChannel");ce(this,"userMap",new Map);ce(this,"setLocalStreamActiveMap",new Map);ce(this,"phoneyStreams",new Map);ce(this,"recorder",new StreamRecorder);ce(this,"networkQualityTester",new NetworkQualityTester);ce(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});ce(this,"reportLogs",(z,N="未知错误")=>{const{appid:J,userId:I,earlyId:O="",logUrl:n,reportErr:a}=this.options;if(!a)return;const q="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(z),X={origin:q,type:Z,app_id:J,user_id:I,ins_id:O,desc:N},ee=btoa(encodeURI(JSON.stringify(X))),Q=`${n}/upload/log?log_key=${ee}`;{const ne=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),re=new TextEncoder().encode(ne),oe=pako.deflate(re,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:X,url:Q,size:lt(oe.byteLength)}),fetch(Q,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:oe})}}});ce(this,"initPhoneyStreams",(z,N=[])=>{N.length===0&&(N=mediaType_keys);for(const J of N){const I=this.phoneyStreams.get(J);if(I){const O=I.getTracks();for(const n of O)n.stop()}switch(J){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(z));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(z));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});ce(this,"getPhoneyStreams",z=>this.phoneyStreams.get(z));ce(this,"getRoomInfo",()=>{const{options:z,roomState:N,createAt:J}=this;return{...z,roomState:N,createAt:J}});ce(this,"setRoomState",z=>{this.roomState=z;const N=enum_roomState[z],J={state:z,stateStr:N};this.cwsIns.emitNotify("onRoomState",{code:200,data:J,desc:"room state is change."})});ce(this,"setOptions",async z=>{const N={...this.options,...z};this.options=N});ce(this,"stopStream",async z=>{const N=z.getTracks();for(const J of N)J.stop()});ce(this,"getMediaDevicesErrInfo",async()=>{try{const z=await navigator.mediaDevices.enumerateDevices();z.find(J=>J.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),z.find(J=>J.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(z){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",z)}return this.mediaDevicesErrInfo});ce(this,"getUserMediaKey",(z,N)=>`${z}-${N}`);ce(this,"getCallAction",async z=>{let N="";const J=O=>z.findIndex(({type:a,enabled:q=!0})=>a===O&&q)===-1?"0":"1";return N=`${J(0)}${N}`,N=`${J(1)}${N}`,N=`${J(2)}${N}`,N=`${J(3)}${N}`,parseInt(N,2)});ce(this,"getCallActionMap",(z=0)=>{const J=Number(z).toString(2).padStart(4,"0").split(""),[I,O,n,a]=J;return{microphoneCamera_audio:!!Number(a),microphoneCamera_video:!!Number(n),screenSharing_video:!!Number(O),screenSharing_audio:!!Number(I)}});ce(this,"getBanBehaviorMap",(z=0)=>{const J=Number(z).toString(2).padStart(4,"0").split(""),[I,O,n,a]=J;return{microphoneCamera_audio:!!Number(a),microphoneCamera_video:!!Number(n),screenSharing_video:!!Number(O),screenSharing_audio:!!Number(I)}});ce(this,"getAverageVolume",(z,N)=>{z.getByteFrequencyData(N);let J=0;for(let O=0;O<N.length;O++)J+=N[O];return Math.ceil(J/N.length)});ce(this,"getTrackNamesFormTracks",(z,N=[],J="trackName")=>{const I=[];for(const O of z){const{type:n}=O;if(N.length===0||N.includes(n)){const a=O[J];a&&I.push(`${a}`)}}return I});ce(this,"usersFilter",z=>dt(z,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((I,O)=>I.id.localeCompare(O.id,"en")));this.setOptions(z),this.cwsIns=new CallsWebSocket({...z}),this.taskQueue=new Y(["createWs","createSession","ice","joinRoom","createTrack","publish","subscribe","renegotiate","closeTrack"],{debug:z.debug}),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1),this.options.debug&&this.networkQualityTester.testAll().then(N=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: networkQualityTester",N)})}}class RoomMedias extends RoomBase{constructor(N){super(N);Te(this,Ot,[]);Te(this,Ye,new Map);Te(this,Ge,new Map);Te(this,rt,new Map);Te(this,vt,new Map);ce(this,"localStreamsActionMap",new Map);Te(this,It,new Map);ce(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));ce(this,"initMediaPhoneyStreams",(N=[])=>this.initPhoneyStreams(this.audioContext,N));ce(this,"initLocalStreamsFilter",()=>{for(const N of mediaType_keys){const J=async I=>I;pe(this,It).set(N,J)}});ce(this,"setLocalFilterStream",(N,J)=>{pe(this,It).set(N,J)});Te(this,Wt,()=>{pe(this,Ge).set("microphoneCamera_audio",{autoGainControl:!1,echoCancellation:!1,noiseSuppression:!1}),pe(this,Ge).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),pe(this,Ge).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),pe(this,Ge).set("screenSharing_audio",{autoGainControl:!1,echoCancellation:!1,noiseSuppression:!1})});Te(this,Zt,()=>{pe(this,Ye).set("audioinput","default"),pe(this,Ye).set("videoinput","default"),pe(this,Ye).set("audiooutput","default")});ce(this,"emitNotifyUpdateUsersStreams",async N=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:N,desc:"users streams is change."})});ce(this,"initUserMediaStreamContext",async(N,J,I)=>{var q;const[O]=I.getTracks();if(!O){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:N,mediaType:J,stream:I});return}this.removeUserMediaStreamContext(N,J);const n=this.getUserMediaKey(N,J),{kind:a}=O;switch(a){case"audio":{const F=new AudioMediaContext(O,this.audioContext);pe(this,rt).set(n,F)}break;case"video":{const F=new VideoMediaContext(O);pe(this,rt).set(n,F)}break}{const F=this.getUserMediaStreamContext(N,J);if(F&&F.kind==="audio")try{const Z=pe(this,Ye).get("audiooutput");(q=F.audioContext)==null||q.setSinkId(Z)}catch(Z){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",Z)}}});ce(this,"getUserMediaStreamContext",(N,J)=>{const I=this.getUserMediaKey(N,J);return pe(this,rt).get(I)});ce(this,"getUserAudioMediaStreamContext",(N,J)=>{const I=this.getUserMediaKey(N,J);return pe(this,rt).get(I)});ce(this,"removeUserMediaStreamContext",(N,J)=>{const I=this.getUserMediaKey(N,J),O=pe(this,rt).get(I);O==null||O.stop(),pe(this,rt).delete(I)});ce(this,"getUserStream",(N,J)=>{const I=this.getUserMediaStreamContext(N,J);return(I==null?void 0:I.getStream())||new MediaStream});ce(this,"getUserStreams",(N,J=[])=>{J.length===0&&(J=mediaType_keys);const I={};for(const O of J){const n=this.getUserStream(N,O);I[O]=n}return I});ce(this,"removeUserStreams",async(N,J=[])=>{J.length===0&&(J=mediaType_keys);for(const I of J)this.removeUserMediaStreamContext(N,I)});ce(this,"clearUserStreams",()=>{const N=pe(this,rt).values();for(const J of N)J.stop();Pe(this,rt,new Map)});ce(this,"setMediaTrackConstraints",async(N,J)=>{pe(this,Ge).set(N,J);const O=this.getUserStream(this.options.userId,N).getTracks();if(O.length!==0)for(const n of O){const q={echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1,...n.getConstraints(),...J};await n.applyConstraints(q)}});ce(this,"stopLocalStreams",async(N=[])=>{N.length===0&&(N=mediaType_keys);for(const J of N){const I=pe(this,vt).get(J);I&&await this.stopStream(I),pe(this,vt).delete(J)}});ce(this,"addLocalStream",(N,J)=>{const I=pe(this,vt).get(N);I&&this.stopStream(I),pe(this,vt).set(N,J)});ce(this,"initLocalStream",async N=>{switch(N){case"microphoneCamera_audio":{const J=pe(this,Ye).get("audioinput"),I=pe(this,Ge).get("microphoneCamera_audio"),O=await navigator.mediaDevices.getUserMedia({audio:{deviceId:J,...I},video:!1});this.addLocalStream("microphoneCamera_audio",O)}break;case"microphoneCamera_video":{const J=pe(this,Ye).get("videoinput"),I=pe(this,Ge).get("microphoneCamera_video"),O=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:J,...I}});this.addLocalStream("microphoneCamera_video",O)}break;case"microphoneCamera":{const J=pe(this,Ye).get("audioinput"),I=pe(this,Ye).get("videoinput"),O=pe(this,Ge).get("microphoneCamera_audio"),n=pe(this,Ge).get("microphoneCamera_video"),q=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:J,...O},video:{deviceId:I,...n}})).getTracks();for(const F of q){const{kind:Z}=F;if(Z==="audio"){const X=new MediaStream;X.addTrack(F),this.addLocalStream("microphoneCamera_audio",X)}if(Z==="video"){const X=new MediaStream;X.addTrack(F),this.addLocalStream("microphoneCamera_video",X)}}}break;case"screenSharing_audio":{const J=pe(this,Ge).get("screenSharing_audio"),O=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...J})).getTracks();for(const n of O){const{kind:a}=n;if(a==="audio"){const q=new MediaStream;q.addTrack(n),this.addLocalStream("screenSharing_audio",q)}}}break;case"screenSharing_video":{const J=pe(this,Ge).get(N),O=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...J})).getTracks();for(const n of O){const{kind:a}=n;if(a==="video"){const q=new MediaStream;q.addTrack(n),this.addLocalStream("screenSharing_video",q)}}}break;case"screenSharing":{const J=pe(this,Ge).get("screenSharing_audio"),I=pe(this,Ge).get("screenSharing_video"),n=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...J,...I})).getTracks();for(const a of n){const{kind:q}=a;if(q==="audio"){const F=new MediaStream;F.addTrack(a),this.addLocalStream("screenSharing_audio",F)}if(q==="video"){const F=new MediaStream;F.addTrack(a),this.addLocalStream("screenSharing_video",F)}}}break}});ce(this,"getLocalStream",async N=>{const J=pe(this,vt).get(N),I=pe(this,It).get(N);let O=J;return J&&I&&(O=await I(J)),O});ce(this,"getLocalStreams",async(N=[])=>{N.length===0&&(N=mediaType_keys);const J={};for(const I of N)J[I]=await this.getLocalStream(I);return J});Te(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(N=>{Pe(this,Ot,N.sort((J,I)=>J.label.localeCompare(I.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(N){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",N)}),pe(this,Ot)));Te(this,Vt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await pe(this,Et).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),pe(this,Et).call(this)});ce(this,"getMediaDeviceKind",N=>pe(this,Ye).get(N));ce(this,"changeAudiooutput",()=>{const N=pe(this,Ye).get("audiooutput"),J=pe(this,rt).values();for(const I of J)if(I.kind==="audio"&&"setSinkId"in HTMLMediaElement.prototype)try{I.audioContext.setSinkId(N)}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",O)}});ce(this,"setDeviceKind",(N,J)=>{pe(this,Ye).set(N,J)});ce(this,"setAudioOutputDevice",N=>this.setDeviceKind("audiooutput",N));ce(this,"getEnumerateDevices",async N=>(await pe(this,Et).call(this),pe(this,Ot).filter(I=>I.kind===N)));ce(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));ce(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));ce(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));pe(this,Vt).call(this),pe(this,Zt).call(this),pe(this,Wt).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var J;((J=this.audioContext)==null?void 0:J.state)==="suspended"&&this.audioContext.resume()})}}Ot=new WeakMap,Ye=new WeakMap,Ge=new WeakMap,rt=new WeakMap,vt=new WeakMap,It=new WeakMap,Wt=new WeakMap,Zt=new WeakMap,Et=new WeakMap,Vt=new WeakMap;class RoomUsers extends RoomMedias{constructor(N){super(N);ce(this,"getMaxVolumeUser",()=>{const N=Array.from(this.userMap.values(),({id:I})=>I);if(N.length===0)return;let J=[];for(const I of N){const O=this.getUserMediaStreamContext(I,"microphoneCamera_audio");if(!O||O.kind!=="audio")continue;const n=O.getVolume();J.push({id:I,volume:n})}return J=J.sort((I,O)=>I.volume-O.volume>0?-1:1),J[0]});ce(this,"setAudioFilter",async(N={})=>{const J=await this.getUsersId();for(const I of J){{const O=this.getUserMediaStreamContext(I,"microphoneCamera_audio");(O==null?void 0:O.kind)==="audio"&&(O==null||O.setFilter(N))}{const O=this.getUserMediaStreamContext(I,"screenSharing_audio");(O==null?void 0:O.kind)==="audio"&&(O==null||O.setFilter(N))}}});ce(this,"setEnhanceGain",async(N,J,I)=>{const O=this.getUserMediaStreamContext(N,J);(O==null?void 0:O.kind)==="audio"&&(O==null||O.setEnhanceGain(I))});ce(this,"setVolume",(N,J,I)=>{const O=this.getUserMediaStreamContext(N,J);(O==null?void 0:O.kind)==="audio"&&(O==null||O.setVolumeGain(I))});ce(this,"getVolume",(N,J)=>{const I=this.getUserMediaStreamContext(N,J);let O=0;return(I==null?void 0:I.kind)==="audio"&&(O=I==null?void 0:I.getVolume()),O});ce(this,"clearUsers",()=>{this.userMap=new Map});ce(this,"removeUsers",async N=>{for(const J of N)this.userMap.delete(J),await this.removeUserStreams(J)});ce(this,"createUser",async N=>{const J=Date.now(),I={id:N,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:N===this.options.userId,isPublished:!1,joinTime:J,updateAt:J,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(N,I)});ce(this,"getUser",async N=>(this.userMap.has(N)||await this.createUser(N),this.userMap.get(N)));ce(this,"getUsers",async(N=[])=>{N.length===0&&(N=[...this.userMap.keys()]);const J=[];for(const I of N){const O=await this.getUser(I);J.push(O)}return J});ce(this,"getAllUserTrackMids",async()=>{const N=await this.getUsers(),J=[];for(const I of N){const{tracks:O=[]}=I;for(const n of O)J.push(n.mid)}return J});ce(this,"getUserTrackByTrackName",async N=>{const J=await this.getUsers(),I=[];for(const O of J){const{tracks:n=[]}=O;for(const a of n){const{trackName:q}=a;N.includes(q)&&I.push(a)}}return I});ce(this,"getUserTrackFromMid",async N=>{const J=await this.getUsers();let I;for(const O of J){const{tracks:n=[]}=O;for(const a of n)if(a.mid===N){I=a;break}}return I});ce(this,"checkUserInRoom",N=>this.userMap.has(N));ce(this,"getUsersId",async()=>[...this.userMap.keys()]);ce(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));ce(this,"updateIsPublished",async(N,J=!1)=>{const I=await this.getUser(N);I.isPublished=J});ce(this,"setUserUpdateStreams",async(N,J,I=!0)=>{const O=await this.getUser(N),n={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};n[J]=I,O.updateStreams=n});ce(this,"updateUserChannels",async(N,J=[],I)=>{const O=await this.getUser(N);I&&(J=[...O.channels,...J]),O.channels=J});ce(this,"updateUsertracks",async(N,J=[],I)=>{const O=await this.getUser(N);I&&(J=[...O.tracks,...J]),J=J.filter(({mid:q=""})=>q!==""),J=pt(J,["type"]),J=J.sort((q,F)=>q.type-F.type<0?-1:1);for(const q of J)q.userId=N,q.mediaType=mediaType_keys[q.type],q.enabled===void 0&&(q.enabled=!0);O.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const n=dt(O.tracks,["mediaType","enabled","mid","msid","trackName"]),a=dt(J,["mediaType","enabled","mid","msid","trackName"]);{const q="microphoneCamera_audio",F=a.find(ee=>ee.mediaType===q),Z=n.find(ee=>ee.mediaType===q),X=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=X}{const q="microphoneCamera_video",F=a.find(ee=>ee.mediaType===q),Z=n.find(ee=>ee.mediaType===q),X=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=X}{const q="screenSharing_audio",F=a.find(ee=>ee.mediaType===q),Z=n.find(ee=>ee.mediaType===q),X=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=X}{const q="screenSharing_video",F=a.find(ee=>ee.mediaType===q),Z=n.find(ee=>ee.mediaType===q),X=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=X}O.tracks=J});ce(this,"updateUserCallAction",async(N,J=0)=>{const I=await this.getUser(N);I.callAction=J,I.callActionStr=J.toString(2).padStart(4,"0"),I.callActionMap=this.getCallActionMap(J)});ce(this,"updateUserBehaviors",async(N,J=0)=>{const I=await this.getUser(N);I.banBehavior=J,I.banBehaviorStr=J.toString(2).padStart(4,"0"),I.banBehaviorMap=this.getBanBehaviorMap(J)});ce(this,"updateUserNetwork",async(N,J={egress:5,ingress:5})=>{const I=await this.getUser(N);I.network=J});ce(this,"updateUserPermissions",async(N,J)=>{if(J){const I=await this.getUser(N);I.permissions=J}});ce(this,"updateUserBase",async N=>{const J=await this.getUser(N);J.isSelf=N===this.options.userId,J.updateAt=Date.now()});ce(this,"updateUsers",async N=>{for(const J of N){const{id:I,tracks:O,callAction:n,permissions:a,isPublished:q}=J;await this.updateUserBase(I),await this.updateIsPublished(I,q),await this.updateUserPermissions(I,a),await this.updateUsertracks(I,O,!0),await this.updateUserCallAction(I,n),await this.updateUserNetwork(I)}});ce(this,"emitNotifyUpdateUser",async N=>{const J=await this.getUsers([N]),[I]=this.usersFilter(J);this.cwsIns.emitNotify("onRoomUser",{code:200,data:I,desc:"user info is change."})});ce(this,"emitNotifyUpdateUsers",async()=>{const N=await this.getUsers(),J=this.usersFilter(N);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:J,desc:"all users info is change."})})}}const t=(D,z=4294967295,N=79764919)=>{const J=new Int32Array(256);let I,O,n,a=z;for(I=0;I<256;I++){for(n=I<<24,O=8;O>0;--O)n=2147483648&n?n<<1^N:n<<1;J[I]=n}for(I=0;I<D.length;I++)a=a<<8^J[255&(a>>24^D[I])];return a},e=(D,z=t)=>{const N=re=>new Uint8Array(re.length/2).map((oe,me)=>parseInt(re.substring(2*me,2*(me+1)),16)),J=re=>N(re)[0],I=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach((re,oe)=>I.set(re,oe));const O=new Uint8Array(D.length);let n,a,q,F=!1,Z=0,X=42,ee=D.length>13&&D.substring(0,9)==="dynEncode",Q=0;ee&&(Q=11,a=J(D.substring(9,Q)),a<=1&&(Q+=2,X=J(D.substring(11,Q))),a===1&&(Q+=8,q=(re=>new DataView(N(re).buffer).getInt32(0,!0))(D.substring(13,Q))));const ne=256-X;for(let re=Q;re<D.length;re++)if(n=D.charCodeAt(re),n!==61||F){if(n===92&&re<D.length-5&&ee){const oe=D.charCodeAt(re+1);oe!==117&&oe!==85||(n=parseInt(D.substring(re+2,re+6),16),re+=5)}if(n>255){const oe=I.get(n);oe&&(n=oe+127)}F&&(F=!1,n-=64),O[Z++]=n<X&&n>0?n+ne:n-X}else F=!0;const se=O.subarray(0,Z);if(ee&&a===1){const re=z(se);if(re!==q){const oe="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",oe+`
|
|
10
|
-
`,"Expected: "+q+"; Got: "+
|
|
11
|
-
`,"Visit https://github.com/eshaz/simple-yenc for more information"),Error(
|
|
9
|
+
*/var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function(D){const J=requireBase64Js(),N=requireIeee754(),z=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;D.Buffer=a,D.SlowBuffer=ye,D.INSPECT_MAX_BYTES=50;const I=2147483647;D.kMaxLength=I,a.TYPED_ARRAY_SUPPORT=O(),!a.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 O(){try{const ie=new Uint8Array(1),K={foo:function(){return 42}};return Object.setPrototypeOf(K,Uint8Array.prototype),Object.setPrototypeOf(ie,K),ie.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function n(ie){if(ie>I)throw new RangeError('The value "'+ie+'" is invalid for option "size"');const K=new Uint8Array(ie);return Object.setPrototypeOf(K,a.prototype),K}function a(ie,K,Q){if(typeof ie=="number"){if(typeof K=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ee(ie)}return q(ie,K,Q)}a.poolSize=8192;function q(ie,K,Q){if(typeof ie=="string")return te(ie,K);if(ArrayBuffer.isView(ie))return ne(ie);if(ie==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ie);if(ct(ie,ArrayBuffer)||ie&&ct(ie.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ct(ie,SharedArrayBuffer)||ie&&ct(ie.buffer,SharedArrayBuffer)))return ce(ie,K,Q);if(typeof ie=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const re=ie.valueOf&&ie.valueOf();if(re!=null&&re!==ie)return a.from(re,K,Q);const ue=oe(ie);if(ue)return ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ie[Symbol.toPrimitive]=="function")return a.from(ie[Symbol.toPrimitive]("string"),K,Q);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ie)}a.from=function(ie,K,Q){return q(ie,K,Q)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function F(ie){if(typeof ie!="number")throw new TypeError('"size" argument must be of type number');if(ie<0)throw new RangeError('The value "'+ie+'" is invalid for option "size"')}function Z(ie,K,Q){return F(ie),ie<=0?n(ie):K!==void 0?typeof Q=="string"?n(ie).fill(K,Q):n(ie).fill(K):n(ie)}a.alloc=function(ie,K,Q){return Z(ie,K,Q)};function ee(ie){return F(ie),n(ie<0?0:se(ie)|0)}a.allocUnsafe=function(ie){return ee(ie)},a.allocUnsafeSlow=function(ie){return ee(ie)};function te(ie,K){if((typeof K!="string"||K==="")&&(K="utf8"),!a.isEncoding(K))throw new TypeError("Unknown encoding: "+K);const Q=ke(ie,K)|0;let re=n(Q);const ue=re.write(ie,K);return ue!==Q&&(re=re.slice(0,ue)),re}function X(ie){const K=ie.length<0?0:se(ie.length)|0,Q=n(K);for(let re=0;re<K;re+=1)Q[re]=ie[re]&255;return Q}function ne(ie){if(ct(ie,Uint8Array)){const K=new Uint8Array(ie);return ce(K.buffer,K.byteOffset,K.byteLength)}return X(ie)}function ce(ie,K,Q){if(K<0||ie.byteLength<K)throw new RangeError('"offset" is outside of buffer bounds');if(ie.byteLength<K+(Q||0))throw new RangeError('"length" is outside of buffer bounds');let re;return K===void 0&&Q===void 0?re=new Uint8Array(ie):Q===void 0?re=new Uint8Array(ie,K):re=new Uint8Array(ie,K,Q),Object.setPrototypeOf(re,a.prototype),re}function oe(ie){if(a.isBuffer(ie)){const K=se(ie.length)|0,Q=n(K);return Q.length===0||ie.copy(Q,0,0,K),Q}if(ie.length!==void 0)return typeof ie.length!="number"||ai(ie.length)?n(0):X(ie);if(ie.type==="Buffer"&&Array.isArray(ie.data))return X(ie.data)}function se(ie){if(ie>=I)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I.toString(16)+" bytes");return ie|0}function ye(ie){return+ie!=ie&&(ie=0),a.alloc(+ie)}a.isBuffer=function(K){return K!=null&&K._isBuffer===!0&&K!==a.prototype},a.compare=function(K,Q){if(ct(K,Uint8Array)&&(K=a.from(K,K.offset,K.byteLength)),ct(Q,Uint8Array)&&(Q=a.from(Q,Q.offset,Q.byteLength)),!a.isBuffer(K)||!a.isBuffer(Q))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(K===Q)return 0;let re=K.length,ue=Q.length;for(let be=0,we=Math.min(re,ue);be<we;++be)if(K[be]!==Q[be]){re=K[be],ue=Q[be];break}return re<ue?-1:ue<re?1:0},a.isEncoding=function(K){switch(String(K).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}},a.concat=function(K,Q){if(!Array.isArray(K))throw new TypeError('"list" argument must be an Array of Buffers');if(K.length===0)return a.alloc(0);let re;if(Q===void 0)for(Q=0,re=0;re<K.length;++re)Q+=K[re].length;const ue=a.allocUnsafe(Q);let be=0;for(re=0;re<K.length;++re){let we=K[re];if(ct(we,Uint8Array))be+we.length>ue.length?(a.isBuffer(we)||(we=a.from(we)),we.copy(ue,be)):Uint8Array.prototype.set.call(ue,we,be);else if(a.isBuffer(we))we.copy(ue,be);else throw new TypeError('"list" argument must be an Array of Buffers');be+=we.length}return ue};function ke(ie,K){if(a.isBuffer(ie))return ie.length;if(ArrayBuffer.isView(ie)||ct(ie,ArrayBuffer))return ie.byteLength;if(typeof ie!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ie);const Q=ie.length,re=arguments.length>2&&arguments[2]===!0;if(!re&&Q===0)return 0;let ue=!1;for(;;)switch(K){case"ascii":case"latin1":case"binary":return Q;case"utf8":case"utf-8":return vt(ie).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q*2;case"hex":return Q>>>1;case"base64":return Bt(ie).length;default:if(ue)return re?-1:vt(ie).length;K=(""+K).toLowerCase(),ue=!0}}a.byteLength=ke;function ae(ie,K,Q){let re=!1;if((K===void 0||K<0)&&(K=0),K>this.length||((Q===void 0||Q>this.length)&&(Q=this.length),Q<=0)||(Q>>>=0,K>>>=0,Q<=K))return"";for(ie||(ie="utf8");;)switch(ie){case"hex":return nt(this,K,Q);case"utf8":case"utf-8":return $e(this,K,Q);case"ascii":return We(this,K,Q);case"latin1":case"binary":return Ze(this,K,Q);case"base64":return Te(this,K,Q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,K,Q);default:if(re)throw new TypeError("Unknown encoding: "+ie);ie=(ie+"").toLowerCase(),re=!0}}a.prototype._isBuffer=!0;function de(ie,K,Q){const re=ie[K];ie[K]=ie[Q],ie[Q]=re}a.prototype.swap16=function(){const K=this.length;if(K%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Q=0;Q<K;Q+=2)de(this,Q,Q+1);return this},a.prototype.swap32=function(){const K=this.length;if(K%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Q=0;Q<K;Q+=4)de(this,Q,Q+3),de(this,Q+1,Q+2);return this},a.prototype.swap64=function(){const K=this.length;if(K%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Q=0;Q<K;Q+=8)de(this,Q,Q+7),de(this,Q+1,Q+6),de(this,Q+2,Q+5),de(this,Q+3,Q+4);return this},a.prototype.toString=function(){const K=this.length;return K===0?"":arguments.length===0?$e(this,0,K):ae.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(K){if(!a.isBuffer(K))throw new TypeError("Argument must be a Buffer");return this===K?!0:a.compare(this,K)===0},a.prototype.inspect=function(){let K="";const Q=D.INSPECT_MAX_BYTES;return K=this.toString("hex",0,Q).replace(/(.{2})/g,"$1 ").trim(),this.length>Q&&(K+=" ... "),"<Buffer "+K+">"},z&&(a.prototype[z]=a.prototype.inspect),a.prototype.compare=function(K,Q,re,ue,be){if(ct(K,Uint8Array)&&(K=a.from(K,K.offset,K.byteLength)),!a.isBuffer(K))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof K);if(Q===void 0&&(Q=0),re===void 0&&(re=K?K.length:0),ue===void 0&&(ue=0),be===void 0&&(be=this.length),Q<0||re>K.length||ue<0||be>this.length)throw new RangeError("out of range index");if(ue>=be&&Q>=re)return 0;if(ue>=be)return-1;if(Q>=re)return 1;if(Q>>>=0,re>>>=0,ue>>>=0,be>>>=0,this===K)return 0;let we=be-ue,De=re-Q;const Fe=Math.min(we,De),Le=this.slice(ue,be),je=K.slice(Q,re);for(let Pe=0;Pe<Fe;++Pe)if(Le[Pe]!==je[Pe]){we=Le[Pe],De=je[Pe];break}return we<De?-1:De<we?1:0};function _e(ie,K,Q,re,ue){if(ie.length===0)return-1;if(typeof Q=="string"?(re=Q,Q=0):Q>2147483647?Q=2147483647:Q<-2147483648&&(Q=-2147483648),Q=+Q,ai(Q)&&(Q=ue?0:ie.length-1),Q<0&&(Q=ie.length+Q),Q>=ie.length){if(ue)return-1;Q=ie.length-1}else if(Q<0)if(ue)Q=0;else return-1;if(typeof K=="string"&&(K=a.from(K,re)),a.isBuffer(K))return K.length===0?-1:me(ie,K,Q,re,ue);if(typeof K=="number")return K=K&255,typeof Uint8Array.prototype.indexOf=="function"?ue?Uint8Array.prototype.indexOf.call(ie,K,Q):Uint8Array.prototype.lastIndexOf.call(ie,K,Q):me(ie,[K],Q,re,ue);throw new TypeError("val must be string, number or Buffer")}function me(ie,K,Q,re,ue){let be=1,we=ie.length,De=K.length;if(re!==void 0&&(re=String(re).toLowerCase(),re==="ucs2"||re==="ucs-2"||re==="utf16le"||re==="utf-16le")){if(ie.length<2||K.length<2)return-1;be=2,we/=2,De/=2,Q/=2}function Fe(je,Pe){return be===1?je[Pe]:je.readUInt16BE(Pe*be)}let Le;if(ue){let je=-1;for(Le=Q;Le<we;Le++)if(Fe(ie,Le)===Fe(K,je===-1?0:Le-je)){if(je===-1&&(je=Le),Le-je+1===De)return je*be}else je!==-1&&(Le-=Le-je),je=-1}else for(Q+De>we&&(Q=we-De),Le=Q;Le>=0;Le--){let je=!0;for(let Pe=0;Pe<De;Pe++)if(Fe(ie,Le+Pe)!==Fe(K,Pe)){je=!1;break}if(je)return Le}return-1}a.prototype.includes=function(K,Q,re){return this.indexOf(K,Q,re)!==-1},a.prototype.indexOf=function(K,Q,re){return _e(this,K,Q,re,!0)},a.prototype.lastIndexOf=function(K,Q,re){return _e(this,K,Q,re,!1)};function ve(ie,K,Q,re){Q=Number(Q)||0;const ue=ie.length-Q;re?(re=Number(re),re>ue&&(re=ue)):re=ue;const be=K.length;re>be/2&&(re=be/2);let we;for(we=0;we<re;++we){const De=parseInt(K.substr(we*2,2),16);if(ai(De))return we;ie[Q+we]=De}return we}function ge(ie,K,Q,re){return Mt(vt(K,ie.length-Q),ie,Q,re)}function le(ie,K,Q,re){return Mt(wt(K),ie,Q,re)}function fe(ie,K,Q,re){return Mt(Bt(K),ie,Q,re)}function Se(ie,K,Q,re){return Mt(oi(K,ie.length-Q),ie,Q,re)}a.prototype.write=function(K,Q,re,ue){if(Q===void 0)ue="utf8",re=this.length,Q=0;else if(re===void 0&&typeof Q=="string")ue=Q,re=this.length,Q=0;else if(isFinite(Q))Q=Q>>>0,isFinite(re)?(re=re>>>0,ue===void 0&&(ue="utf8")):(ue=re,re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const be=this.length-Q;if((re===void 0||re>be)&&(re=be),K.length>0&&(re<0||Q<0)||Q>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");let we=!1;for(;;)switch(ue){case"hex":return ve(this,K,Q,re);case"utf8":case"utf-8":return ge(this,K,Q,re);case"ascii":case"latin1":case"binary":return le(this,K,Q,re);case"base64":return fe(this,K,Q,re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,K,Q,re);default:if(we)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),we=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Te(ie,K,Q){return K===0&&Q===ie.length?J.fromByteArray(ie):J.fromByteArray(ie.slice(K,Q))}function $e(ie,K,Q){Q=Math.min(ie.length,Q);const re=[];let ue=K;for(;ue<Q;){const be=ie[ue];let we=null,De=be>239?4:be>223?3:be>191?2:1;if(ue+De<=Q){let Fe,Le,je,Pe;switch(De){case 1:be<128&&(we=be);break;case 2:Fe=ie[ue+1],(Fe&192)===128&&(Pe=(be&31)<<6|Fe&63,Pe>127&&(we=Pe));break;case 3:Fe=ie[ue+1],Le=ie[ue+2],(Fe&192)===128&&(Le&192)===128&&(Pe=(be&15)<<12|(Fe&63)<<6|Le&63,Pe>2047&&(Pe<55296||Pe>57343)&&(we=Pe));break;case 4:Fe=ie[ue+1],Le=ie[ue+2],je=ie[ue+3],(Fe&192)===128&&(Le&192)===128&&(je&192)===128&&(Pe=(be&15)<<18|(Fe&63)<<12|(Le&63)<<6|je&63,Pe>65535&&Pe<1114112&&(we=Pe))}}we===null?(we=65533,De=1):we>65535&&(we-=65536,re.push(we>>>10&1023|55296),we=56320|we&1023),re.push(we),ue+=De}return He(re)}const Me=4096;function He(ie){const K=ie.length;if(K<=Me)return String.fromCharCode.apply(String,ie);let Q="",re=0;for(;re<K;)Q+=String.fromCharCode.apply(String,ie.slice(re,re+=Me));return Q}function We(ie,K,Q){let re="";Q=Math.min(ie.length,Q);for(let ue=K;ue<Q;++ue)re+=String.fromCharCode(ie[ue]&127);return re}function Ze(ie,K,Q){let re="";Q=Math.min(ie.length,Q);for(let ue=K;ue<Q;++ue)re+=String.fromCharCode(ie[ue]);return re}function nt(ie,K,Q){const re=ie.length;(!K||K<0)&&(K=0),(!Q||Q<0||Q>re)&&(Q=re);let ue="";for(let be=K;be<Q;++be)ue+=li[ie[be]];return ue}function kt(ie,K,Q){const re=ie.slice(K,Q);let ue="";for(let be=0;be<re.length-1;be+=2)ue+=String.fromCharCode(re[be]+re[be+1]*256);return ue}a.prototype.slice=function(K,Q){const re=this.length;K=~~K,Q=Q===void 0?re:~~Q,K<0?(K+=re,K<0&&(K=0)):K>re&&(K=re),Q<0?(Q+=re,Q<0&&(Q=0)):Q>re&&(Q=re),Q<K&&(Q=K);const ue=this.subarray(K,Q);return Object.setPrototypeOf(ue,a.prototype),ue};function Ne(ie,K,Q){if(ie%1!==0||ie<0)throw new RangeError("offset is not uint");if(ie+K>Q)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(K,Q,re){K=K>>>0,Q=Q>>>0,re||Ne(K,Q,this.length);let ue=this[K],be=1,we=0;for(;++we<Q&&(be*=256);)ue+=this[K+we]*be;return ue},a.prototype.readUintBE=a.prototype.readUIntBE=function(K,Q,re){K=K>>>0,Q=Q>>>0,re||Ne(K,Q,this.length);let ue=this[K+--Q],be=1;for(;Q>0&&(be*=256);)ue+=this[K+--Q]*be;return ue},a.prototype.readUint8=a.prototype.readUInt8=function(K,Q){return K=K>>>0,Q||Ne(K,1,this.length),this[K]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(K,Q){return K=K>>>0,Q||Ne(K,2,this.length),this[K]|this[K+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(K,Q){return K=K>>>0,Q||Ne(K,2,this.length),this[K]<<8|this[K+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(K,Q){return K=K>>>0,Q||Ne(K,4,this.length),(this[K]|this[K+1]<<8|this[K+2]<<16)+this[K+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(K,Q){return K=K>>>0,Q||Ne(K,4,this.length),this[K]*16777216+(this[K+1]<<16|this[K+2]<<8|this[K+3])},a.prototype.readBigUInt64LE=gt(function(K){K=K>>>0,qe(K,"offset");const Q=this[K],re=this[K+7];(Q===void 0||re===void 0)&&Ve(K,this.length-8);const ue=Q+this[++K]*2**8+this[++K]*2**16+this[++K]*2**24,be=this[++K]+this[++K]*2**8+this[++K]*2**16+re*2**24;return BigInt(ue)+(BigInt(be)<<BigInt(32))}),a.prototype.readBigUInt64BE=gt(function(K){K=K>>>0,qe(K,"offset");const Q=this[K],re=this[K+7];(Q===void 0||re===void 0)&&Ve(K,this.length-8);const ue=Q*2**24+this[++K]*2**16+this[++K]*2**8+this[++K],be=this[++K]*2**24+this[++K]*2**16+this[++K]*2**8+re;return(BigInt(ue)<<BigInt(32))+BigInt(be)}),a.prototype.readIntLE=function(K,Q,re){K=K>>>0,Q=Q>>>0,re||Ne(K,Q,this.length);let ue=this[K],be=1,we=0;for(;++we<Q&&(be*=256);)ue+=this[K+we]*be;return be*=128,ue>=be&&(ue-=Math.pow(2,8*Q)),ue},a.prototype.readIntBE=function(K,Q,re){K=K>>>0,Q=Q>>>0,re||Ne(K,Q,this.length);let ue=Q,be=1,we=this[K+--ue];for(;ue>0&&(be*=256);)we+=this[K+--ue]*be;return be*=128,we>=be&&(we-=Math.pow(2,8*Q)),we},a.prototype.readInt8=function(K,Q){return K=K>>>0,Q||Ne(K,1,this.length),this[K]&128?(255-this[K]+1)*-1:this[K]},a.prototype.readInt16LE=function(K,Q){K=K>>>0,Q||Ne(K,2,this.length);const re=this[K]|this[K+1]<<8;return re&32768?re|4294901760:re},a.prototype.readInt16BE=function(K,Q){K=K>>>0,Q||Ne(K,2,this.length);const re=this[K+1]|this[K]<<8;return re&32768?re|4294901760:re},a.prototype.readInt32LE=function(K,Q){return K=K>>>0,Q||Ne(K,4,this.length),this[K]|this[K+1]<<8|this[K+2]<<16|this[K+3]<<24},a.prototype.readInt32BE=function(K,Q){return K=K>>>0,Q||Ne(K,4,this.length),this[K]<<24|this[K+1]<<16|this[K+2]<<8|this[K+3]},a.prototype.readBigInt64LE=gt(function(K){K=K>>>0,qe(K,"offset");const Q=this[K],re=this[K+7];(Q===void 0||re===void 0)&&Ve(K,this.length-8);const ue=this[K+4]+this[K+5]*2**8+this[K+6]*2**16+(re<<24);return(BigInt(ue)<<BigInt(32))+BigInt(Q+this[++K]*2**8+this[++K]*2**16+this[++K]*2**24)}),a.prototype.readBigInt64BE=gt(function(K){K=K>>>0,qe(K,"offset");const Q=this[K],re=this[K+7];(Q===void 0||re===void 0)&&Ve(K,this.length-8);const ue=(Q<<24)+this[++K]*2**16+this[++K]*2**8+this[++K];return(BigInt(ue)<<BigInt(32))+BigInt(this[++K]*2**24+this[++K]*2**16+this[++K]*2**8+re)}),a.prototype.readFloatLE=function(K,Q){return K=K>>>0,Q||Ne(K,4,this.length),N.read(this,K,!0,23,4)},a.prototype.readFloatBE=function(K,Q){return K=K>>>0,Q||Ne(K,4,this.length),N.read(this,K,!1,23,4)},a.prototype.readDoubleLE=function(K,Q){return K=K>>>0,Q||Ne(K,8,this.length),N.read(this,K,!0,52,8)},a.prototype.readDoubleBE=function(K,Q){return K=K>>>0,Q||Ne(K,8,this.length),N.read(this,K,!1,52,8)};function Be(ie,K,Q,re,ue,be){if(!a.isBuffer(ie))throw new TypeError('"buffer" argument must be a Buffer instance');if(K>ue||K<be)throw new RangeError('"value" argument is out of bounds');if(Q+re>ie.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(K,Q,re,ue){if(K=+K,Q=Q>>>0,re=re>>>0,!ue){const De=Math.pow(2,8*re)-1;Be(this,K,Q,re,De,0)}let be=1,we=0;for(this[Q]=K&255;++we<re&&(be*=256);)this[Q+we]=K/be&255;return Q+re},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(K,Q,re,ue){if(K=+K,Q=Q>>>0,re=re>>>0,!ue){const De=Math.pow(2,8*re)-1;Be(this,K,Q,re,De,0)}let be=re-1,we=1;for(this[Q+be]=K&255;--be>=0&&(we*=256);)this[Q+be]=K/we&255;return Q+re},a.prototype.writeUint8=a.prototype.writeUInt8=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,1,255,0),this[Q]=K&255,Q+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,2,65535,0),this[Q]=K&255,this[Q+1]=K>>>8,Q+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,2,65535,0),this[Q]=K>>>8,this[Q+1]=K&255,Q+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,4,4294967295,0),this[Q+3]=K>>>24,this[Q+2]=K>>>16,this[Q+1]=K>>>8,this[Q]=K&255,Q+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,4,4294967295,0),this[Q]=K>>>24,this[Q+1]=K>>>16,this[Q+2]=K>>>8,this[Q+3]=K&255,Q+4};function mt(ie,K,Q,re,ue){Ce(K,re,ue,ie,Q,7);let be=Number(K&BigInt(4294967295));ie[Q++]=be,be=be>>8,ie[Q++]=be,be=be>>8,ie[Q++]=be,be=be>>8,ie[Q++]=be;let we=Number(K>>BigInt(32)&BigInt(4294967295));return ie[Q++]=we,we=we>>8,ie[Q++]=we,we=we>>8,ie[Q++]=we,we=we>>8,ie[Q++]=we,Q}function Je(ie,K,Q,re,ue){Ce(K,re,ue,ie,Q,7);let be=Number(K&BigInt(4294967295));ie[Q+7]=be,be=be>>8,ie[Q+6]=be,be=be>>8,ie[Q+5]=be,be=be>>8,ie[Q+4]=be;let we=Number(K>>BigInt(32)&BigInt(4294967295));return ie[Q+3]=we,we=we>>8,ie[Q+2]=we,we=we>>8,ie[Q+1]=we,we=we>>8,ie[Q]=we,Q+8}a.prototype.writeBigUInt64LE=gt(function(K,Q=0){return mt(this,K,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=gt(function(K,Q=0){return Je(this,K,Q,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(K,Q,re,ue){if(K=+K,Q=Q>>>0,!ue){const Fe=Math.pow(2,8*re-1);Be(this,K,Q,re,Fe-1,-Fe)}let be=0,we=1,De=0;for(this[Q]=K&255;++be<re&&(we*=256);)K<0&&De===0&&this[Q+be-1]!==0&&(De=1),this[Q+be]=(K/we>>0)-De&255;return Q+re},a.prototype.writeIntBE=function(K,Q,re,ue){if(K=+K,Q=Q>>>0,!ue){const Fe=Math.pow(2,8*re-1);Be(this,K,Q,re,Fe-1,-Fe)}let be=re-1,we=1,De=0;for(this[Q+be]=K&255;--be>=0&&(we*=256);)K<0&&De===0&&this[Q+be+1]!==0&&(De=1),this[Q+be]=(K/we>>0)-De&255;return Q+re},a.prototype.writeInt8=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,1,127,-128),K<0&&(K=255+K+1),this[Q]=K&255,Q+1},a.prototype.writeInt16LE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,2,32767,-32768),this[Q]=K&255,this[Q+1]=K>>>8,Q+2},a.prototype.writeInt16BE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,2,32767,-32768),this[Q]=K>>>8,this[Q+1]=K&255,Q+2},a.prototype.writeInt32LE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,4,2147483647,-2147483648),this[Q]=K&255,this[Q+1]=K>>>8,this[Q+2]=K>>>16,this[Q+3]=K>>>24,Q+4},a.prototype.writeInt32BE=function(K,Q,re){return K=+K,Q=Q>>>0,re||Be(this,K,Q,4,2147483647,-2147483648),K<0&&(K=4294967295+K+1),this[Q]=K>>>24,this[Q+1]=K>>>16,this[Q+2]=K>>>8,this[Q+3]=K&255,Q+4},a.prototype.writeBigInt64LE=gt(function(K,Q=0){return mt(this,K,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=gt(function(K,Q=0){return Je(this,K,Q,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rt(ie,K,Q,re,ue,be){if(Q+re>ie.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("Index out of range")}function yt(ie,K,Q,re,ue){return K=+K,Q=Q>>>0,ue||rt(ie,K,Q,4),N.write(ie,K,Q,re,23,4),Q+4}a.prototype.writeFloatLE=function(K,Q,re){return yt(this,K,Q,!0,re)},a.prototype.writeFloatBE=function(K,Q,re){return yt(this,K,Q,!1,re)};function at(ie,K,Q,re,ue){return K=+K,Q=Q>>>0,ue||rt(ie,K,Q,8),N.write(ie,K,Q,re,52,8),Q+8}a.prototype.writeDoubleLE=function(K,Q,re){return at(this,K,Q,!0,re)},a.prototype.writeDoubleBE=function(K,Q,re){return at(this,K,Q,!1,re)},a.prototype.copy=function(K,Q,re,ue){if(!a.isBuffer(K))throw new TypeError("argument should be a Buffer");if(re||(re=0),!ue&&ue!==0&&(ue=this.length),Q>=K.length&&(Q=K.length),Q||(Q=0),ue>0&&ue<re&&(ue=re),ue===re||K.length===0||this.length===0)return 0;if(Q<0)throw new RangeError("targetStart out of bounds");if(re<0||re>=this.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),K.length-Q<ue-re&&(ue=K.length-Q+re);const be=ue-re;return this===K&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(Q,re,ue):Uint8Array.prototype.set.call(K,this.subarray(re,ue),Q),be},a.prototype.fill=function(K,Q,re,ue){if(typeof K=="string"){if(typeof Q=="string"?(ue=Q,Q=0,re=this.length):typeof re=="string"&&(ue=re,re=this.length),ue!==void 0&&typeof ue!="string")throw new TypeError("encoding must be a string");if(typeof ue=="string"&&!a.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);if(K.length===1){const we=K.charCodeAt(0);(ue==="utf8"&&we<128||ue==="latin1")&&(K=we)}}else typeof K=="number"?K=K&255:typeof K=="boolean"&&(K=Number(K));if(Q<0||this.length<Q||this.length<re)throw new RangeError("Out of range index");if(re<=Q)return this;Q=Q>>>0,re=re===void 0?this.length:re>>>0,K||(K=0);let be;if(typeof K=="number")for(be=Q;be<re;++be)this[be]=K;else{const we=a.isBuffer(K)?K:a.from(K,ue),De=we.length;if(De===0)throw new TypeError('The value "'+K+'" is invalid for argument "value"');for(be=0;be<re-Q;++be)this[be+Q]=we[be%De]}return this};const Ge={};function xe(ie,K,Q){Ge[ie]=class extends Q{constructor(){super(),Object.defineProperty(this,"message",{value:K.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ie}]`,this.stack,delete this.name}get code(){return ie}set code(ue){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ue,writable:!0})}toString(){return`${this.name} [${ie}]: ${this.message}`}}}xe("ERR_BUFFER_OUT_OF_BOUNDS",function(ie){return ie?`${ie} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),xe("ERR_INVALID_ARG_TYPE",function(ie,K){return`The "${ie}" argument must be of type number. Received type ${typeof K}`},TypeError),xe("ERR_OUT_OF_RANGE",function(ie,K,Q){let re=`The value of "${ie}" is out of range.`,ue=Q;return Number.isInteger(Q)&&Math.abs(Q)>2**32?ue=Ie(String(Q)):typeof Q=="bigint"&&(ue=String(Q),(Q>BigInt(2)**BigInt(32)||Q<-(BigInt(2)**BigInt(32)))&&(ue=Ie(ue)),ue+="n"),re+=` It must be ${K}. Received ${ue}`,re},RangeError);function Ie(ie){let K="",Q=ie.length;const re=ie[0]==="-"?1:0;for(;Q>=re+4;Q-=3)K=`_${ie.slice(Q-3,Q)}${K}`;return`${ie.slice(0,Q)}${K}`}function Re(ie,K,Q){qe(K,"offset"),(ie[K]===void 0||ie[K+Q]===void 0)&&Ve(K,ie.length-(Q+1))}function Ce(ie,K,Q,re,ue,be){if(ie>Q||ie<K){const we=typeof K=="bigint"?"n":"";let De;throw K===0||K===BigInt(0)?De=`>= 0${we} and < 2${we} ** ${(be+1)*8}${we}`:De=`>= -(2${we} ** ${(be+1)*8-1}${we}) and < 2 ** ${(be+1)*8-1}${we}`,new Ge.ERR_OUT_OF_RANGE("value",De,ie)}Re(re,ue,be)}function qe(ie,K){if(typeof ie!="number")throw new Ge.ERR_INVALID_ARG_TYPE(K,"number",ie)}function Ve(ie,K,Q){throw Math.floor(ie)!==ie?(qe(ie,Q),new Ge.ERR_OUT_OF_RANGE("offset","an integer",ie)):K<0?new Ge.ERR_BUFFER_OUT_OF_BOUNDS:new Ge.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${K}`,ie)}const et=/[^+/0-9A-Za-z-_]/g;function Ye(ie){if(ie=ie.split("=")[0],ie=ie.trim().replace(et,""),ie.length<2)return"";for(;ie.length%4!==0;)ie=ie+"=";return ie}function vt(ie,K){K=K||1/0;let Q;const re=ie.length;let ue=null;const be=[];for(let we=0;we<re;++we){if(Q=ie.charCodeAt(we),Q>55295&&Q<57344){if(!ue){if(Q>56319){(K-=3)>-1&&be.push(239,191,189);continue}else if(we+1===re){(K-=3)>-1&&be.push(239,191,189);continue}ue=Q;continue}if(Q<56320){(K-=3)>-1&&be.push(239,191,189),ue=Q;continue}Q=(ue-55296<<10|Q-56320)+65536}else ue&&(K-=3)>-1&&be.push(239,191,189);if(ue=null,Q<128){if((K-=1)<0)break;be.push(Q)}else if(Q<2048){if((K-=2)<0)break;be.push(Q>>6|192,Q&63|128)}else if(Q<65536){if((K-=3)<0)break;be.push(Q>>12|224,Q>>6&63|128,Q&63|128)}else if(Q<1114112){if((K-=4)<0)break;be.push(Q>>18|240,Q>>12&63|128,Q>>6&63|128,Q&63|128)}else throw new Error("Invalid code point")}return be}function wt(ie){const K=[];for(let Q=0;Q<ie.length;++Q)K.push(ie.charCodeAt(Q)&255);return K}function oi(ie,K){let Q,re,ue;const be=[];for(let we=0;we<ie.length&&!((K-=2)<0);++we)Q=ie.charCodeAt(we),re=Q>>8,ue=Q%256,be.push(ue),be.push(re);return be}function Bt(ie){return J.toByteArray(Ye(ie))}function Mt(ie,K,Q,re){let ue;for(ue=0;ue<re&&!(ue+Q>=K.length||ue>=ie.length);++ue)K[ue+Q]=ie[ue];return ue}function ct(ie,K){return ie instanceof K||ie!=null&&ie.constructor!=null&&ie.constructor.name!=null&&ie.constructor.name===K.name}function ai(ie){return ie!==ie}const li=function(){const ie="0123456789abcdef",K=new Array(256);for(let Q=0;Q<16;++Q){const re=Q*16;for(let ue=0;ue<16;++ue)K[re+ue]=ie[Q]+ie[ue]}return K}();function gt(ie){return typeof BigInt>"u"?ui:ie}function ui(){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(I){for(var O,n=1,a=arguments.length;n<a;n++){O=arguments[n];for(var q in O)Object.prototype.hasOwnProperty.call(O,q)&&(I[q]=O[q])}return I},D.apply(this,arguments)},J=toolsEbml&&toolsEbml.__spreadArray||function(I,O,n){if(n||arguments.length===2)for(var a=0,q=O.length,F;a<q;a++)(F||!(a in O))&&(F||(F=Array.prototype.slice.call(O,0,a)),F[a]=O[a]);return I.concat(F||Array.prototype.slice.call(O))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var N=requireTools(),z=function(){function I(){}return I.readVint=function(O,n){n===void 0&&(n=0);var a=8-Math.floor(Math.log2(O[n]));if(a>8){var q=I.readHexString(O,n,n+a);throw new Error("Unrepresentable length: ".concat(a," ").concat(q))}if(n+a>O.length)return null;for(var F=O[n]&(1<<8-a)-1,Z=1;Z<a;Z+=1){if(Z===7&&F>=Math.pow(2,8)&&O[n+7]>0)return{length:a,value:-1};F*=Math.pow(2,8),F+=O[n+Z]}return{length:a,value:F}},I.writeVint=function(O){if(O<0||O>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(O));var n=1;for(n=1;n<=8&&!(O<Math.pow(2,7*n)-1);n+=1);for(var a=N.Buffer.alloc(n),q=O,F=1;F<=n;F+=1){var Z=q&255;a[n-F]=Z,q-=Z,q/=Math.pow(2,8)}return a[0]|=1<<8-n,a},I.concatenate=function(O,n){return!O&&!n?N.Buffer.from([]):!O||O.byteLength===0?n:!n||n.byteLength===0?O:N.Buffer.from(J(J([],O,!0),n,!0))},I.readHexString=function(O,n,a){return n===void 0&&(n=0),a===void 0&&(a=O.byteLength),Array.from(O.slice(n,a)).map(function(q){return Number(q).toString(16)}).reduce(function(q,F){return"".concat(q).concat(F.padStart(2,"0"))},"")},I.readUtf8=function(O){try{return N.Buffer.from(O).toString("utf8")}catch{return null}},I.readUnsigned=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 1:return n.getUint8(0);case 2:return n.getUint16(0);case 4:return n.getUint32(0)}return O.byteLength<=6?O.reduce(function(a,q){return a*256+q},0):I.readHexString(O,0,O.byteLength)},I.readSigned=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 1:return n.getInt8(0);case 2:return n.getInt16(0);case 4:return n.getInt32(0);default:return NaN}},I.readFloat=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 4:return n.getFloat32(0);case 8:return n.getFloat64(0);default:return NaN}},I.readDate=function(O){var n=new DataView(O.buffer,O.byteOffset,O.byteLength);switch(O.byteLength){case 1:return new Date(n.getUint8(0));case 2:return new Date(n.getUint16(0));case 4:return new Date(n.getUint32(0));case 8:return new Date(Number.parseInt(I.readHexString(O),16));default:return new Date(0)}},I.readDataFromTag=function(O,n){var a=O.type,q=O.name,F=O.track,Z=O.discardable||!1,ee=O.keyframe||!1,te=null,X;switch(a){case"u":X=I.readUnsigned(n);break;case"f":X=I.readFloat(n);break;case"i":X=I.readSigned(n);break;case"s":X=String.fromCharCode.apply(String,n);break;case"8":X=I.readUtf8(n);break;case"d":X=I.readDate(n);break}if(q==="SimpleBlock"||q==="Block"){var ne=0,ce=I.readVint(n,ne),oe=ce.length,se=ce.value;ne+=oe,F=se,X=I.readSigned(n.subarray(ne,ne+2)),ne+=2,q==="SimpleBlock"&&(ee=!!(n[oe+2]&128),Z=!!(n[oe+2]&1)),ne+=1,te=n.subarray(ne)}return D(D({},O),{data:n,discardable:Z,keyframe:ee,payload:te,track:F,value:X})},I}();return toolsEbml.default=z,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(D,J,N){J=J||0;for(var z=1;z<=8&&!(D[J]>=Math.pow(2,8-z));z++);if(z>8)throw new Error("Unrepresentable length: "+z+" "+D.toString("hex",J,J+z));if(J+z>D.length)return null;var I,O=D[J]&(1<<8-z)-1;for(I=1;I<z;I++){if(I===7&&O>=Math.pow(2,45)&&D[J+7]>0)return{length:z,value:-1};O*=Math.pow(2,8),O+=D[J+I]}return N&&(O-=Math.pow(2,z*7-1)-1),{length:z,value:O}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var D=requireVint();function J(N){this.buffer=N,this.offset=0}return J.prototype.nextInt16BE=function(){var N=this.buffer.readInt16BE(this.offset);return this.offset+=2,N},J.prototype.nextUInt8=function(){var N=this.buffer.readUInt8(this.offset);return this.offset+=1,N},J.prototype.nextUIntV=function(){var N=D(this.buffer,this.offset);return this.offset+=N.length,N.value},J.prototype.nextIntV=function(){var N=D(this.buffer,this.offset,!0);return this.offset+=N.length,N.value},J.prototype.nextBuffer=function(N){var z=N?this.buffer.slice(this.offset,this.offset+N):this.buffer.slice(this.offset);return this.offset+=N||this.length,z},Object.defineProperty(J.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=J,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var D=requireBufferReader(),J=1,N=3,z=2;ebmlBlock=function(O){var n={},a=new D(O);n.trackNumber=a.nextUIntV(),n.timecode=a.nextInt16BE();var q=a.nextUInt8();n.invisible=!!(q&8),n.keyframe=!!(q&128),n.discardable=!!(q&1);var F=(q&6)>>1;return n.frames=I(a,F),n};function I(O,n){if(!n)return[O.nextBuffer()];var a,q,F=[],Z=O.nextUInt8()+1;if(n===z){if(O.length%Z!==0)throw new Error("Fixed-Size Lacing Error");for(q=O.length/Z,a=0;a<Z;a++)F.push(O.nextBuffer(q));return F}var ee=[];if(n===J)for(a=0;a<Z-1;a++){var te;q=0;do te=O.nextUInt8(),q+=te;while(te===255);ee.push(q)}else if(n===N)for(q=O.nextUIntV(),ee.push(q),a=1;a<Z-1;a++)q+=O.nextIntV(),ee.push(q);for(a=0;a<Z-1;a++)F.push(O.nextBuffer(ee[a]));return F.push(O.nextBuffer()),F}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 J=requireInt64Buffer(),N=requireEBMLEncoder(),z=requireBuffer(),I=requireToolsEbml(),O=requireEbmlBlock();D.Buffer=z.Buffer,D.readVint=I.default.readVint,D.writeVint=I.default.writeVint,D.ebmlBlock=O;function n(le){return(0,D.ebmlBlock)(new D.Buffer(le))}D.readBlock=n;function a(le,fe,Se){return Se===void 0&&(Se=!1),ae([le,Se?new D.Buffer("01ffffffffffffff","hex"):(0,D.writeVint)(fe.length),fe])}D.encodeTag=a;function q(le){return le.reduce(function(fe,Se){if(Se.type!=="b"||Se.name!=="SimpleBlock")return fe;var Te=(0,D.ebmlBlock)(Se.data),$e=Te.frames.some(function(Me){var He=Me.slice(3,6).toString("hex");return He==="9d012a"});return $e?fe.concat(Se):fe},[])}D.WebPBlockFilter=q;function F(le){var fe=Z("VP8 ",le),Se=ae([new D.Buffer("WEBP","ascii"),fe]);return Z("RIFF",Se)}D.VP8BitStreamToRiffWebPBuffer=F;function Z(le,fe){var Se=new D.Buffer(4);return Se.writeUInt32LE(fe.byteLength,0),ae([new D.Buffer(le.substr(0,4),"ascii"),Se,fe,new D.Buffer(fe.byteLength%2===0?0:1)])}D.createRIFFChunk=Z;function ee(le,fe,Se){var Te=X("EBML",le),$e=ce(Te),Me=$e+12,He=le[le.length-1].dataEnd-Me,We=X("Info",le);te("Duration",We),We.splice(1,0,{name:"Duration",type:"f",data:ve(fe,8)});for(var Ze=ce(We),nt=X("Tracks",le),kt=ce(nt),Ne=47,Be=[],mt=5+Se.length*15,Je=[],rt=-1,yt=10,at=function(Ce){var qe=Ne,Ve=qe+Ze,et=Ve+kt,Ye=et+mt,vt=Ye-He;if(Be=[],Be.push({name:"SeekHead",type:"m",isEnd:!1}),Be.push({name:"Seek",type:"m",isEnd:!1}),Be.push({name:"SeekID",type:"b",data:new D.Buffer([21,73,169,102])}),Be.push({name:"SeekPosition",type:"u",data:_e(qe)}),Be.push({name:"Seek",type:"m",isEnd:!0}),Be.push({name:"Seek",type:"m",isEnd:!1}),Be.push({name:"SeekID",type:"b",data:new D.Buffer([22,84,174,107])}),Be.push({name:"SeekPosition",type:"u",data:_e(Ve)}),Be.push({name:"Seek",type:"m",isEnd:!0}),Be.push({name:"Seek",type:"m",isEnd:!1}),Be.push({name:"SeekID",type:"b",data:new D.Buffer([28,83,187,107])}),Be.push({name:"SeekPosition",type:"u",data:_e(et)}),Be.push({name:"Seek",type:"m",isEnd:!0}),Be.push({name:"SeekHead",type:"m",isEnd:!0}),Ne=ce(Be),Je=[],Je.push({name:"Cues",type:"m",isEnd:!1}),Se.forEach(function(wt){var oi=wt.CueTrack,Bt=wt.CueClusterPosition,Mt=wt.CueTime;Je.push({name:"CuePoint",type:"m",isEnd:!1}),Je.push({name:"CueTime",type:"u",data:_e(Mt)}),Je.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Je.push({name:"CueTrack",type:"u",data:_e(oi)}),Bt-=Me,Bt+=vt,Je.push({name:"CueClusterPosition",type:"u",data:_e(Bt)}),Je.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Je.push({name:"CuePoint",type:"m",isEnd:!0})}),Je.push({name:"Cues",type:"m",isEnd:!0}),mt=ce(Je),rt!==vt){if(rt=vt,Ce===yt-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Ge=0;Ge<yt;Ge++){var xe=at(Ge);if(xe==="break")break}var Ie=[].concat.apply([],[Te,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},Be,We,nt,Je]),Re=new N.default().encode(Ie);return Re}D.makeMetadataSeekable=ee;function te(le,fe){for(var Se=-1,Te=0;Te<fe.length;Te++){var $e=fe[Te];if($e.name===le)if($e.type==="m")if(!$e.isEnd)Se=Te;else{if(Se==-1)throw new Error("Detected ".concat(le," closing element before finding the start"));fe.splice(Se,Te-Se+1);return}else{fe.splice(Te,1);return}}}D.removeElement=te;function X(le,fe){for(var Se=[],Te=-1,$e=0;$e<fe.length;$e++){var Me=fe[$e];if(Me.name===le)if(Me.type==="m")if(!Me.isEnd)Te=$e;else{if(Te==-1)throw new Error("Detected ".concat(le," closing element before finding the start"));Se=fe.slice(Te,$e+1);break}else{Se.push(fe[$e]);break}}return Se}D.extractElement=X;function ne(le,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 Se=[],Te=[],$e=0;$e<le.length;$e++){var Me=le[$e];if(Me.type==="m"&&Me.name==="Segment"){if(Se=le.slice(0,$e),Te=le.slice($e),Me.unknownSize){Te.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(Te[Te.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var He=Te[Te.length-1].dataEnd,We=Se[Se.length-1].dataEnd,Ze=new N.default().encode(Se).byteLength,nt=Ze-We,kt=He-Te[0].tagStart;Te[0].tagStart-We,Te[0].tagStart;var Ne=new D.Buffer([24,83,128,103]),Be=new D.Buffer("01ffffffffffffff","hex"),mt=Ne.byteLength+Be.byteLength,Je=kt,rt;for(rt=1;rt<20;rt++){var yt=We+mt+Je,at=yt-He,Ge=nt+at,xe=oe(Te,Ge,fe),Ie=new N.default().encode(xe).byteLength;if(Ie===Je)return new N.default().encode([].concat(Se,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],xe));Je=Ie}throw new Error("unable to refine metadata, stable size could not be found in "+rt+" iterations!")}D.putRefinedMetaData=ne;function ce(le){var fe=new N.default;return le.reduce(function(Se,Te){return Se.concat(fe.encode([Te]))},[]).reduce(function(Se,Te){return Se+Te.byteLength},0)}function oe(le,fe,Se){var Te=Se.duration,$e=Se.clusterPtrs,Me=Se.cues,He=le.slice(0);if(typeof Te=="number"){var We=!1;He.forEach(function(nt){nt.type==="f"&&nt.name==="Duration"&&(We=!0,nt.data=ve(Te,8))}),We||ke(He,"Info",[{name:"Duration",type:"f",data:ve(Te,8)}])}Array.isArray(Me)&&ke(He,"Cues",ye(Me,fe));var Ze=[];return Array.isArray($e)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Ze=se($e,fe)),ke(He,"SeekHead",Ze,!0),He}function se(le,fe){var Se=[];return le.forEach(function(Te){Se.push({name:"Seek",type:"m",isEnd:!1}),Se.push({name:"SeekID",type:"b",data:new D.Buffer([31,67,182,117])}),Se.push({name:"SeekPosition",type:"u",data:_e(Te+fe)}),Se.push({name:"Seek",type:"m",isEnd:!0})}),Se}function ye(le,fe){var Se=[];return le.forEach(function(Te){var $e=Te.CueTrack,Me=Te.CueClusterPosition,He=Te.CueTime;Se.push({name:"CuePoint",type:"m",isEnd:!1}),Se.push({name:"CueTime",type:"u",data:_e(He)}),Se.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Se.push({name:"CueTrack",type:"u",data:_e($e)}),Se.push({name:"CueClusterPosition",type:"u",data:_e(Me+fe)}),Se.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Se.push({name:"CuePoint",type:"m",isEnd:!0})}),Se}function ke(le,fe,Se,Te){Te===void 0&&(Te=!1);for(var $e=-1,Me=0;Me<le.length;Me++){var He=le[Me];if(He.type==="m"&&He.name===fe&&He.isEnd===!1){$e=Me;break}}$e>=0?Array.prototype.splice.apply(le,[$e+1,0].concat(Se)):Te?[].concat([{name:fe,type:"m",isEnd:!1}],Se,[{name:fe,type:"m",isEnd:!0}]).reverse().forEach(function(We){le.unshift(We)}):(le.push({name:fe,type:"m",isEnd:!1}),Se.forEach(function(We){le.push(We)}),le.push({name:fe,type:"m",isEnd:!0}))}function ae(le){return D.Buffer.concat(le)}D.concat=ae;function de(le){var fe=new D.Buffer(0);if(le.type==="m")return le;switch(le.type){case"u":fe=_e(le.value);break;case"i":fe=me(le.value);break;case"f":fe=ve(le.value);break;case"s":fe=new D.Buffer(le.value,"ascii");break;case"8":fe=new D.Buffer(le.value,"utf8");break;case"b":fe=le.value;break;case"d":fe=new J.Int64BE(le.value.getTime().toString()).toBuffer();break}return Object.assign({},le,{data:fe})}D.encodeValueToBuffer=de;function _e(le){for(var fe=1;le>=Math.pow(2,8*fe);fe++);if(fe>=7)return console.warn("7bit or more bigger uint not supported."),new J.Uint64BE(le).toBuffer();var Se=new D.Buffer(fe);return Se.writeUIntBE(le,0,fe),Se}D.createUIntBuffer=_e;function me(le){for(var fe=1;le>=Math.pow(2,8*fe);fe++);if(fe>=7)return console.warn("7bit or more bigger uint not supported."),new J.Int64BE(le).toBuffer();var Se=new D.Buffer(fe);return Se.writeIntBE(le,0,fe),Se}D.createIntBuffer=me;function ve(le,fe){if(fe===void 0&&(fe=8),fe===8){var Se=new D.Buffer(8);return Se.writeDoubleBE(le,0),Se}else if(fe===4){var Se=new D.Buffer(4);return Se.writeFloatBE(le,0),Se}else throw new Error("float type bits must 4bytes or 8bytes")}D.createFloatBuffer=ve;function ge(le){return le instanceof Date?le:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(le)/1e3/1e3)}D.convertEBMLDateToJSDate=ge}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var D=requireInt64Buffer(),J=requireTools(),N=requireTools(),z=requireEbmlID(),I;(function(n){n[n.STATE_TAG=1]="STATE_TAG",n[n.STATE_SIZE=2]="STATE_SIZE",n[n.STATE_CONTENT=3]="STATE_CONTENT"})(I||(I={}));var O=function(){function n(){this._buffer=new J.Buffer(0),this._tag_stack=[],this._state=I.STATE_TAG,this._cursor=0,this._total=0,this._schema=z.byEbmlID,this._result=[]}return n.prototype.decode=function(a){this.readChunk(a);var q=this._result;return this._result=[],q},n.prototype.readChunk=function(a){for(this._buffer=N.concat([this._buffer,new J.Buffer(a)]);this._cursor<this._buffer.length&&!(this._state===I.STATE_TAG&&!this.readTag()||this._state===I.STATE_SIZE&&!this.readSize()||this._state===I.STATE_CONTENT&&!this.readContent()););},n.prototype.getSchemaInfo=function(a){return this._schema[a]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},n.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var a=(0,J.readVint)(this._buffer,this._cursor);if(a==null)return!1;var q=this._buffer.slice(this._cursor,this._cursor+a.length),F=q.reduce(function(te,X,ne,ce){return te+X*Math.pow(16,2*(ce.length-1-ne))},0),Z=this.getSchemaInfo(F),ee={EBML_ID:F.toString(16),schema:Z,type:Z.type,name:Z.name,level:Z.level,tagStart:this._total,tagEnd:this._total+a.length,sizeStart:this._total+a.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(ee),this._cursor+=a.length,this._total+=a.length,this._state=I.STATE_SIZE,!0},n.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var a=(0,J.readVint)(this._buffer,this._cursor);if(a==null)return!1;var q=this._tag_stack[this._tag_stack.length-1];return q.sizeEnd=q.sizeStart+a.length,q.dataStart=q.sizeEnd,q.dataSize=a.value,a.value===-1?(q.dataEnd=-1,q.type==="m"&&(q.unknownSize=!0)):q.dataEnd=q.sizeEnd+a.value,this._cursor+=a.length,this._total+=a.length,this._state=I.STATE_CONTENT,!0},n.prototype.readContent=function(){var a=this._tag_stack[this._tag_stack.length-1];if(a.type==="m"){if(a.isEnd=!1,this._result.push(a),this._state=I.STATE_TAG,a.dataSize===0){var q=Object.assign({},a,{isEnd:!0});this._result.push(q),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+a.dataSize)return!1;var F=this._buffer.slice(this._cursor,this._cursor+a.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+a.dataSize),a.data=F,a.type){case"u":a.value=F.readUIntBE(0,F.length);break;case"i":a.value=F.readIntBE(0,F.length);break;case"f":a.value=a.dataSize===4?F.readFloatBE(0):a.dataSize===8?F.readDoubleBE(0):(console.warn("cannot read ".concat(a.dataSize," octets float. failback to 0")),0);break;case"s":a.value=F.toString("ascii");break;case"8":a.value=F.toString("utf8");break;case"b":a.value=F;break;case"d":a.value=(0,J.convertEBMLDateToJSDate)(new D.Int64BE(F).toNumber());break}if(a.value===null)throw new Error("unknown tag type:"+a.type);for(this._result.push(a),this._total+=a.dataSize,this._state=I.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var Z=this._tag_stack[this._tag_stack.length-1];if(Z.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<Z.dataEnd)break;if(Z.type!=="m")throw new Error("parent element is not master element");var q=Object.assign({},Z,{isEnd:!0});this._result.push(q),this._tag_stack.pop()}return!0},n}();return EBMLDecoder.default=O,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var D=typeof Reflect=="object"?Reflect:null,J=D&&typeof D.apply=="function"?D.apply:function(de,_e,me){return Function.prototype.apply.call(de,_e,me)},N;D&&typeof D.ownKeys=="function"?N=D.ownKeys:Object.getOwnPropertySymbols?N=function(de){return Object.getOwnPropertyNames(de).concat(Object.getOwnPropertySymbols(de))}:N=function(de){return Object.getOwnPropertyNames(de)};function z(ae){console&&console.warn&&console.warn(ae)}var I=Number.isNaN||function(de){return de!==de};function O(){O.init.call(this)}events.exports=O,events.exports.once=se,O.EventEmitter=O,O.prototype._events=void 0,O.prototype._eventsCount=0,O.prototype._maxListeners=void 0;var n=10;function a(ae){if(typeof ae!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof ae)}Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:function(){return n},set:function(ae){if(typeof ae!="number"||ae<0||I(ae))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+ae+".");n=ae}}),O.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},O.prototype.setMaxListeners=function(de){if(typeof de!="number"||de<0||I(de))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+de+".");return this._maxListeners=de,this};function q(ae){return ae._maxListeners===void 0?O.defaultMaxListeners:ae._maxListeners}O.prototype.getMaxListeners=function(){return q(this)},O.prototype.emit=function(de){for(var _e=[],me=1;me<arguments.length;me++)_e.push(arguments[me]);var ve=de==="error",ge=this._events;if(ge!==void 0)ve=ve&&ge.error===void 0;else if(!ve)return!1;if(ve){var le;if(_e.length>0&&(le=_e[0]),le instanceof Error)throw le;var fe=new Error("Unhandled error."+(le?" ("+le.message+")":""));throw fe.context=le,fe}var Se=ge[de];if(Se===void 0)return!1;if(typeof Se=="function")J(Se,this,_e);else for(var Te=Se.length,$e=ne(Se,Te),me=0;me<Te;++me)J($e[me],this,_e);return!0};function F(ae,de,_e,me){var ve,ge,le;if(a(_e),ge=ae._events,ge===void 0?(ge=ae._events=Object.create(null),ae._eventsCount=0):(ge.newListener!==void 0&&(ae.emit("newListener",de,_e.listener?_e.listener:_e),ge=ae._events),le=ge[de]),le===void 0)le=ge[de]=_e,++ae._eventsCount;else if(typeof le=="function"?le=ge[de]=me?[_e,le]:[le,_e]:me?le.unshift(_e):le.push(_e),ve=q(ae),ve>0&&le.length>ve&&!le.warned){le.warned=!0;var fe=new Error("Possible EventEmitter memory leak detected. "+le.length+" "+String(de)+" listeners added. Use emitter.setMaxListeners() to increase limit");fe.name="MaxListenersExceededWarning",fe.emitter=ae,fe.type=de,fe.count=le.length,z(fe)}return ae}O.prototype.addListener=function(de,_e){return F(this,de,_e,!1)},O.prototype.on=O.prototype.addListener,O.prototype.prependListener=function(de,_e){return F(this,de,_e,!0)};function Z(){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 ee(ae,de,_e){var me={fired:!1,wrapFn:void 0,target:ae,type:de,listener:_e},ve=Z.bind(me);return ve.listener=_e,me.wrapFn=ve,ve}O.prototype.once=function(de,_e){return a(_e),this.on(de,ee(this,de,_e)),this},O.prototype.prependOnceListener=function(de,_e){return a(_e),this.prependListener(de,ee(this,de,_e)),this},O.prototype.removeListener=function(de,_e){var me,ve,ge,le,fe;if(a(_e),ve=this._events,ve===void 0)return this;if(me=ve[de],me===void 0)return this;if(me===_e||me.listener===_e)--this._eventsCount===0?this._events=Object.create(null):(delete ve[de],ve.removeListener&&this.emit("removeListener",de,me.listener||_e));else if(typeof me!="function"){for(ge=-1,le=me.length-1;le>=0;le--)if(me[le]===_e||me[le].listener===_e){fe=me[le].listener,ge=le;break}if(ge<0)return this;ge===0?me.shift():ce(me,ge),me.length===1&&(ve[de]=me[0]),ve.removeListener!==void 0&&this.emit("removeListener",de,fe||_e)}return this},O.prototype.off=O.prototype.removeListener,O.prototype.removeAllListeners=function(de){var _e,me,ve;if(me=this._events,me===void 0)return this;if(me.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):me[de]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete me[de]),this;if(arguments.length===0){var ge=Object.keys(me),le;for(ve=0;ve<ge.length;++ve)le=ge[ve],le!=="removeListener"&&this.removeAllListeners(le);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(_e=me[de],typeof _e=="function")this.removeListener(de,_e);else if(_e!==void 0)for(ve=_e.length-1;ve>=0;ve--)this.removeListener(de,_e[ve]);return this};function te(ae,de,_e){var me=ae._events;if(me===void 0)return[];var ve=me[de];return ve===void 0?[]:typeof ve=="function"?_e?[ve.listener||ve]:[ve]:_e?oe(ve):ne(ve,ve.length)}O.prototype.listeners=function(de){return te(this,de,!0)},O.prototype.rawListeners=function(de){return te(this,de,!1)},O.listenerCount=function(ae,de){return typeof ae.listenerCount=="function"?ae.listenerCount(de):X.call(ae,de)},O.prototype.listenerCount=X;function X(ae){var de=this._events;if(de!==void 0){var _e=de[ae];if(typeof _e=="function")return 1;if(_e!==void 0)return _e.length}return 0}O.prototype.eventNames=function(){return this._eventsCount>0?N(this._events):[]};function ne(ae,de){for(var _e=new Array(de),me=0;me<de;++me)_e[me]=ae[me];return _e}function ce(ae,de){for(;de+1<ae.length;de++)ae[de]=ae[de+1];ae.pop()}function oe(ae){for(var de=new Array(ae.length),_e=0;_e<de.length;++_e)de[_e]=ae[_e].listener||ae[_e];return de}function se(ae,de){return new Promise(function(_e,me){function ve(le){ae.removeListener(de,ge),me(le)}function ge(){typeof ae.removeListener=="function"&&ae.removeListener("error",ve),_e([].slice.call(arguments))}ke(ae,de,ge,{once:!0}),de!=="error"&&ye(ae,ve,{once:!0})})}function ye(ae,de,_e){typeof ae.on=="function"&&ke(ae,"error",de,_e)}function ke(ae,de,_e,me){if(typeof ae.on=="function")me.once?ae.once(de,_e):ae.on(de,_e);else if(typeof ae.addEventListener=="function")ae.addEventListener(de,function ve(ge){me.once&&ae.removeEventListener(de,ve),_e(ge)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof ae)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var D=EBMLReader&&EBMLReader.__extends||function(){var I=function(O,n){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,q){a.__proto__=q}||function(a,q){for(var F in q)Object.prototype.hasOwnProperty.call(q,F)&&(a[F]=q[F])},I(O,n)};return function(O,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");I(O,n);function a(){this.constructor=O}O.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var J=requireEvents(),N=requireTools(),z=function(I){D(O,I);function O(){var n=I.call(this)||this;return n.logGroup="",n.hasLoggingStarted=!1,n.metadataloaded=!1,n.chunks=[],n.stack=[],n.segmentOffset=0,n.last2SimpleBlockVideoTrackTimecode=[0,0],n.last2SimpleBlockAudioTrackTimecode=[0,0],n.lastClusterTimecode=0,n.lastClusterPosition=0,n.timecodeScale=1e6,n.metadataSize=0,n.metadatas=[],n.cues=[],n.firstVideoBlockRead=!1,n.firstAudioBlockRead=!1,n.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},n.trackTypes=[],n.trackDefaultDuration=[],n.trackCodecDelay=[],n.trackInfo={type:"nothing"},n.ended=!1,n.logging=!1,n.use_duration_every_simpleblock=!1,n.use_webp=!1,n.use_segment_info=!0,n.drop_default_duration=!0,n}return O.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()},O.prototype.emit_segment_info=function(){var n=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var F=this.lastClusterTimecode,Z=this.duration,ee=this.timecodeScale;this.emit("cluster",{timecode:F,data:n}),this.emit("duration",{timecodeScale:ee,duration:Z})}else{this.metadataloaded=!0,this.metadatas=n;var a=this.trackTypes.indexOf(1),q=this.trackTypes.indexOf(2);if(this.trackInfo=a>=0&&q>=0?{type:"both",trackNumber:a}:a>=0?{type:"video",trackNumber:a}:q>=0?{type:"audio",trackNumber:q}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:n,metadataSize:this.metadataSize})}},O.prototype.read=function(n){var a=this,q=!1;if(!this.ended){if(n.type==="m")if(n.isEnd)this.stack.pop();else{var F=this.stack[this.stack.length-1];if(F!=null&&F.level>=n.level){this.stack.pop(),this.logging&&console.groupEnd(),F.dataEnd=n.dataEnd,F.dataSize=n.dataEnd-F.dataStart,F.unknownSize=!1;var Z=Object.assign({},F,{name:F.name,type:F.type,isEnd:!0});this.chunks.push(Z)}this.stack.push(n)}if(n.type==="m"&&n.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=n.dataStart,this.emit("segment_offset",this.segmentOffset);else if(n.type==="b"&&n.name==="SimpleBlock"){var ee=N.ebmlBlock(n.data),te=ee.timecode,X=ee.trackNumber,ne=ee.frames;if(this.trackTypes[X]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var ce=this.lastClusterTimecode+te;this.cues.push({CueTrack:X,CueClusterPosition:this.lastClusterPosition,CueTime:ce}),this.emit("cue_info",{CueTrack:X,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:X,CueClusterPosition:this.lastClusterPosition,CueTime:ce})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],te]}else if(this.trackTypes[X]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var ce=this.lastClusterTimecode+te;this.cues.push({CueTrack:X,CueClusterPosition:this.lastClusterPosition,CueTime:ce}),this.emit("cue_info",{CueTrack:X,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:X,CueClusterPosition:this.lastClusterPosition,CueTime:ce})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],te]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&ne.forEach(function(oe){var se=oe.slice(3,6).toString("hex");if(se==="9d012a"){var ye=N.VP8BitStreamToRiffWebPBuffer(oe),ke=new Blob([ye],{type:"image/webp"}),ae=a.duration;a.emit("webp",{currentTime:ae,webp:ke})}})}else n.type==="m"&&n.name==="Cluster"&&n.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",n.tagStart),this.lastClusterPosition=n.tagStart):n.type==="u"&&n.name==="Timecode"?this.lastClusterTimecode=n.value:n.type==="u"&&n.name==="TimecodeScale"?this.timecodeScale=n.value:n.type==="m"&&n.name==="TrackEntry"?n.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}:n.type==="u"&&n.name==="TrackType"?this.currentTrack.TrackType=n.value:n.type==="u"&&n.name==="TrackNumber"?this.currentTrack.TrackNumber=n.value:n.type==="u"&&n.name==="CodecDelay"?this.currentTrack.CodecDelay=n.value:n.type==="u"&&n.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),q=!0):this.currentTrack.DefaultDuration=n.value:n.name==="unknown"&&console.warn(n);!this.metadataloaded&&n.dataEnd>0&&(this.metadataSize=n.dataEnd),q||this.chunks.push(n),this.logging&&this.put(n)}},Object.defineProperty(O.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var n=0,a=0,q=0,F=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof F=="number")n=F;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){n=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockAudioTrackTimecode[1]}else{n=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){n=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){n=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Z=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Z=="number"&&(a=Z),q=this.last2SimpleBlockAudioTrackTimecode[1]}var ee=(this.lastClusterTimecode+q)*this.timecodeScale+n-a,te=ee/this.timecodeScale;return Math.floor(te)},enumerable:!1,configurable:!0}),O.prototype.addListener=function(n,a){return I.prototype.addListener.call(this,n,a)},O.prototype.put=function(n){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),n.type==="m"?n.isEnd?console.groupEnd():console.group(n.name+":"+n.tagStart):n.type==="b"?console.log(n.name,n.type):console.log(n.name,n.tagStart,n.type,n.value)},O}(J.EventEmitter);return EBMLReader.default=z,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(D){var J=ebml&&ebml.__createBinding||(Object.create?function(a,q,F,Z){Z===void 0&&(Z=F),Object.defineProperty(a,Z,{enumerable:!0,get:function(){return q[F]}})}:function(a,q,F,Z){Z===void 0&&(Z=F),a[Z]=q[F]}),N=ebml&&ebml.__exportStar||function(a,q){for(var F in a)F!=="default"&&!Object.prototype.hasOwnProperty.call(q,F)&&J(q,a,F)};Object.defineProperty(D,"__esModule",{value:!0}),D.tools=D.Reader=D.Encoder=D.Decoder=void 0,N(requireEBML(),D);var z=requireEBMLDecoder();D.Decoder=z.default;var I=requireEBMLEncoder();D.Encoder=I.default;var O=requireEBMLReader();D.Reader=O.default;var n=requireTools();D.tools=n}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var D=lib&&lib.__awaiter||function(I,O,n,a){function q(F){return F instanceof n?F:new n(function(Z){Z(F)})}return new(n||(n=Promise))(function(F,Z){function ee(ne){try{X(a.next(ne))}catch(ce){Z(ce)}}function te(ne){try{X(a.throw(ne))}catch(ce){Z(ce)}}function X(ne){ne.done?F(ne.value):q(ne.value).then(ee,te)}X((a=a.apply(I,O||[])).next())})},J=lib&&lib.__generator||function(I,O){var n={label:0,sent:function(){if(F[0]&1)throw F[1];return F[1]},trys:[],ops:[]},a,q,F,Z;return Z={next:ee(0),throw:ee(1),return:ee(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function ee(X){return function(ne){return te([X,ne])}}function te(X){if(a)throw new TypeError("Generator is already executing.");for(;n;)try{if(a=1,q&&(F=X[0]&2?q.return:X[0]?q.throw||((F=q.return)&&F.call(q),0):q.next)&&!(F=F.call(q,X[1])).done)return F;switch(q=0,F&&(X=[X[0]&2,F.value]),X[0]){case 0:case 1:F=X;break;case 4:return n.label++,{value:X[1],done:!1};case 5:n.label++,q=X[1],X=[0];continue;case 7:X=n.ops.pop(),n.trys.pop();continue;default:if(F=n.trys,!(F=F.length>0&&F[F.length-1])&&(X[0]===6||X[0]===2)){n=0;continue}if(X[0]===3&&(!F||X[1]>F[0]&&X[1]<F[3])){n.label=X[1];break}if(X[0]===6&&n.label<F[1]){n.label=F[1],F=X;break}if(F&&n.label<F[2]){n.label=F[2],n.ops.push(X);break}F[2]&&n.ops.pop(),n.trys.pop();continue}X=O.call(I,n)}catch(ne){X=[6,ne],q=0}finally{a=F=0}if(X[0]&5)throw X[1];return{value:X[0]?X[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var N=requireEbml();function z(I){return D(this,void 0,void 0,function(){var O,n,a,q,F,Z,ee,te,X,ne,ce,oe;return J(this,function(se){switch(se.label){case 0:if(!I)throw Error("call to fixWebmDuration requires a blob");O=new N.Decoder,n=new N.Reader,a=I.stream(),q=a.getReader(),se.label=1;case 1:return[4,q.read()];case 2:return F=se.sent(),Z=F.done,ee=F.value,Z?(n.stop(),[3,3]):(te=O.decode(ee),te=te==null?void 0:te.filter(function(ye){return ye.type!=="unknown"}),te.forEach(function(ye){n.read(ye)}),ee=null,[3,1]);case 3:return X=N.tools.makeMetadataSeekable(n.metadatas,n.duration,n.cues),ne=new Blob([X],{type:I.type}),ce=I.slice(n.metadataSize),oe=new Blob([ne,ce],{type:I.type}),[2,oe]}})})}return lib.default=z,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){Oe(this,it);Oe(this,St,!1);Oe(this,bt,!1);Oe(this,qt,0);Oe(this,Pt,0);Oe(this,st,0);Oe(this,ut,0);Oe(this,Tt,0);he(this,"onchange",J=>{});he(this,"onDurationChange",J=>{});he(this,"start",async(J="")=>{J||(J=`video_Record_${E$1(Date.now())}`);let N=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(z=>{const I=z.getTracks();for(const n of I)n.onended=()=>this.stop();Ue(this,St,!0),Ue(this,bt,!1),Ue(this,it,new MediaRecorder(z)),pe(this,it).start();const O=new Date().getTime();Ue(this,qt,O),Ue(this,st,O),pe(this,Ot).call(this),pe(this,Ut).call(this),pe(this,it).addEventListener("dataavailable",n=>{N.push(n.data)}),pe(this,it).addEventListener("stop",async()=>{Ue(this,St,!1);const n=new Date().getTime();Ue(this,Pt,n),Ue(this,ut,pe(this,ut)+(n-pe(this,st))),pe(this,Ot).call(this),clearInterval(pe(this,Tt));const a=z.getTracks();for(const te of a)te.stop();if(pe(this,it)===null)return;const q=new Blob(N,{type:pe(this,it).mimeType}),F=await fixWebmDuration(q),Z=URL.createObjectURL(F),ee=document.createElement("a");ee.href=Z,ee.download=`${J}.mp4`,ee.click(),URL.revokeObjectURL(Z),N=[],Ue(this,it,null)})})});he(this,"pause",async()=>{var N;await new Promise(z=>setTimeout(()=>z(!0),300)),(N=pe(this,it))==null||N.pause(),Ue(this,bt,!0);const J=new Date().getTime();Ue(this,ut,pe(this,ut)+(J-pe(this,st))),pe(this,Ot).call(this),clearInterval(pe(this,Tt))});he(this,"resume",async()=>{var N;(N=pe(this,it))==null||N.resume(),Ue(this,bt,!1);const J=new Date().getTime();Ue(this,st,J),pe(this,Ot).call(this),pe(this,Ut).call(this)});he(this,"stop",async()=>{var J;(J=pe(this,it))==null||J.stop()});he(this,"getDuration",()=>{if(pe(this,st)===0)return 0;let J=pe(this,ut);const N=new Date().getTime();if(pe(this,St)&&pe(this,bt)===!1){const z=N-pe(this,st);Ue(this,st,N),J=J+z}return J});he(this,"getInfo",()=>({active:pe(this,St),pause:pe(this,bt),startTime:pe(this,qt),endTime:pe(this,Pt),duration:pe(this,ut)}));Oe(this,Ot,()=>{const J=this.getInfo();this.onchange(J)});Oe(this,Ut,()=>{clearInterval(pe(this,Tt)),Ue(this,Tt,window.setInterval(()=>{Ue(this,ut,this.getDuration()),this.onDurationChange(pe(this,ut))},500))})}}it=new WeakMap,St=new WeakMap,bt=new WeakMap,qt=new WeakMap,Pt=new WeakMap,st=new WeakMap,ut=new WeakMap,Tt=new WeakMap,Ot=new WeakMap,Ut=new WeakMap;class RoomBase{constructor(J){he(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!0,logUrl:"https://logs.putplay.cc",newPublishAutoSubscribe:!0});he(this,"sdk_service_version","1.0.6");he(this,"prohibitNotify",!1);he(this,"isEarly",!1);he(this,"isInRoom",!1);he(this,"taskQueue");he(this,"roomState","ready");he(this,"createAt",Date.now());he(this,"cwsIns");he(this,"peerIns");he(this,"transceiverMap",new Map);he(this,"sendChannel");he(this,"receiveChannel");he(this,"userMap",new Map);he(this,"setLocalStreamActiveMap",new Map);he(this,"phoneyStreams",new Map);he(this,"recorder",new StreamRecorder);he(this,"networkQualityTester",new NetworkQualityTester);he(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});he(this,"reportLogs",(J,N="未知错误")=>{const{appid:z,userId:I,earlyId:O="",logUrl:n,reportErr:a}=this.options;if(!a)return;const q="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(J),ee={origin:q,type:Z,app_id:z,user_id:I,ins_id:O,desc:N},te=btoa(encodeURI(JSON.stringify(ee))),X=`${n}/upload/log?log_key=${te}`;{const ne=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),oe=new TextEncoder().encode(ne),se=pako.deflate(oe,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:ee,url:X,size:lt(se.byteLength)}),fetch(X,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:se})}}});he(this,"initPhoneyStreams",(J,N=[])=>{N.length===0&&(N=mediaType_keys);for(const z of N){const I=this.phoneyStreams.get(z);if(I){const O=I.getTracks();for(const n of O)n.stop()}switch(z){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(J));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(J));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});he(this,"getPhoneyStreams",J=>this.phoneyStreams.get(J));he(this,"getRoomInfo",()=>{const{options:J,roomState:N,createAt:z}=this;return{...J,roomState:N,createAt:z}});he(this,"setRoomState",J=>{this.roomState=J;const N=enum_roomState[J],z={state:J,stateStr:N};this.cwsIns.emitNotify("onRoomState",{code:200,data:z,desc:"room state is change."})});he(this,"setOptions",async J=>{const N={...this.options,...J};this.options=N});he(this,"stopStream",async J=>{const N=J.getTracks();for(const z of N)z.stop()});he(this,"getMediaDevicesErrInfo",async()=>{try{const J=await navigator.mediaDevices.enumerateDevices();J.find(z=>z.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),J.find(z=>z.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(J){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",J)}return this.mediaDevicesErrInfo});he(this,"getUserMediaKey",(J,N)=>`${J}-${N}`);he(this,"getCallAction",async J=>{let N="";const z=O=>J.findIndex(({type:a,enabled:q=!0})=>a===O&&q)===-1?"0":"1";return N=`${z(0)}${N}`,N=`${z(1)}${N}`,N=`${z(2)}${N}`,N=`${z(3)}${N}`,parseInt(N,2)});he(this,"getCallActionMap",(J=0)=>{const z=Number(J).toString(2).padStart(4,"0").split(""),[I,O,n,a]=z;return{microphoneCamera_audio:!!Number(a),microphoneCamera_video:!!Number(n),screenSharing_video:!!Number(O),screenSharing_audio:!!Number(I)}});he(this,"getBanBehaviorMap",(J=0)=>{const z=Number(J).toString(2).padStart(4,"0").split(""),[I,O,n,a]=z;return{microphoneCamera_audio:!!Number(a),microphoneCamera_video:!!Number(n),screenSharing_video:!!Number(O),screenSharing_audio:!!Number(I)}});he(this,"getAverageVolume",(J,N)=>{J.getByteFrequencyData(N);let z=0;for(let O=0;O<N.length;O++)z+=N[O];return Math.ceil(z/N.length)});he(this,"getTrackNamesFormTracks",(J,N=[],z="trackName")=>{const I=[];for(const O of J){const{type:n}=O;if(N.length===0||N.includes(n)){const a=O[z];a&&I.push(`${a}`)}}return I});he(this,"usersFilter",J=>dt(J,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((I,O)=>I.id.localeCompare(O.id,"en")));this.setOptions(J),this.cwsIns=new CallsWebSocket({...J}),this.taskQueue=new Y(["createWs","createSession","ice","joinRoom","createTrack","publish","subscribe","renegotiate","closeTrack"],{debug:J.debug}),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1),this.options.debug&&this.networkQualityTester.testAll().then(N=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: networkQualityTester",N)})}}var m=Object.defineProperty,G=(D,J,N)=>J in D?m(D,J,{enumerable:!0,configurable:!0,writable:!0,value:N}):D[J]=N,e$1=(D,J,N)=>G(D,typeof J!="symbol"?J+"":J,N);class g{constructor(J,N){e$1(this,"inputStream",new MediaStream),e$1(this,"outputStream",new MediaStream),e$1(this,"inputGain",1),e$1(this,"enhanceGain",1),e$1(this,"bgsGain",1),e$1(this,"bgmGain",1),e$1(this,"outputGain",1),e$1(this,"mixAudioMap",new Map),e$1(this,"audioContext",new AudioContext),e$1(this,"sourceNode"),e$1(this,"inputGainNode"),e$1(this,"enhanceGainNode"),e$1(this,"bgsGainNode"),e$1(this,"bgmGainNode"),e$1(this,"analyserNode"),e$1(this,"analyserArrayData"),e$1(this,"outputGainNode"),e$1(this,"destinationNode"),e$1(this,"filterStream",z=>z),e$1(this,"stop",()=>{{const z=this.inputStream.getTracks();for(const I of z)I.stop(),this.inputStream.removeTrack(I)}}),e$1(this,"getStream",()=>{const z=this.filterStream(this.outputStream);{const I=z.getTracks();console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: getStream",I)}return z}),e$1(this,"setMute",(z=!0)=>{z?this.analyserNode.disconnect(this.outputGainNode):this.analyserNode.connect(this.outputGainNode)}),e$1(this,"setInputGain",z=>{this.inputGain=z,this.inputGainNode.gain.setValueAtTime(z,this.audioContext.currentTime)}),e$1(this,"setEnhanceGain",async z=>{this.enhanceGain=z+1,this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain,this.audioContext.currentTime)}),e$1(this,"setBgsGain",z=>{this.bgsGain=z,this.bgsGainNode.gain.setValueAtTime(z,this.audioContext.currentTime)}),e$1(this,"setBgmGain",z=>{this.bgmGain=z,this.bgmGainNode.gain.setValueAtTime(z,this.audioContext.currentTime)}),e$1(this,"setOutputGain",z=>{this.outputGain=z,this.outputGainNode.gain.setValueAtTime(this.outputGain,this.audioContext.currentTime)}),e$1(this,"getVolume",()=>{const{analyserNode:z,analyserArrayData:I}=this;z.getByteFrequencyData(I);let O=0;for(let n=0;n<I.length;n++)O+=I[n];return Math.ceil(O/I.length)}),e$1(this,"mixAudio",(z,I="bgm")=>new Promise(async(O,n)=>{try{{const F=this.mixAudioMap.get(I);F&&F.stop()}const a=I==="bgs"?this.bgsGainNode:this.bgmGainNode,q=this.audioContext.createBufferSource();this.mixAudioMap.set(I,q),q.buffer=z,q.connect(a),q.onended=()=>{q.disconnect(a),this.mixAudioMap.delete(I),O(!0)},q.start(0)}catch(a){n(a)}})),e$1(this,"mixAudioStop",z=>{const I=this.mixAudioMap.get(z);I==null||I.stop()}),e$1(this,"changeMix",(z,I)=>{const O=z==="bgs"?this.bgsGainNode:this.bgmGainNode;I?O.connect(this.destinationNode):O.disconnect(this.destinationNode)}),N&&(this.audioContext=N),this.inputStream=J,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:z,inputGainNode:I,enhanceGainNode:O,bgsGainNode:n,bgmGainNode:a,analyserNode:q,outputGainNode:F,destinationNode:Z}=this;z.connect(I),I.connect(O),O.connect(q),n.connect(q),a.connect(q),O.connect(Z),n.connect(Z),a.connect(Z),q.connect(F),F.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}}class RoomMedias extends RoomBase{constructor(N){super(N);Oe(this,Et,[]);Oe(this,Xe,new Map);Oe(this,Ke,new Map);Oe(this,ot,new Map);Oe(this,ft,new Map);Oe(this,_t,new Map);he(this,"localStreamsActionMap",new Map);Oe(this,Rt,new Map);he(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));he(this,"initMediaPhoneyStreams",(N=[])=>this.initPhoneyStreams(this.audioContext,N));he(this,"initLocalStreamsFilter",()=>{for(const N of mediaType_keys){const z=async I=>I;pe(this,Rt).set(N,z)}});he(this,"setLocalFilterStream",(N,z)=>{pe(this,Rt).set(N,z)});Oe(this,Vt,()=>{pe(this,Ke).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),pe(this,Ke).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),pe(this,Ke).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),pe(this,Ke).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});Oe(this,Kt,()=>{pe(this,Xe).set("audioinput","default"),pe(this,Xe).set("videoinput","default"),pe(this,Xe).set("audiooutput","default")});he(this,"emitNotifyUpdateUsersStreams",async N=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:N,desc:"users streams is change."})});he(this,"initUserMediaStreamContext",async(N,z,I)=>{var q;const[O]=I.getTracks();if(!O){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:N,mediaType:z,stream:I});return}this.removeUserMediaStreamContext(N,z);const n=this.getUserMediaKey(N,z),{kind:a}=O;switch(a){case"audio":{const F=new MediaStream;F.addTrack(O);const Z=new g(F,this.audioContext);pe(this,ot).set(n,Z)}break;case"video":{const F=new VideoMediaContext(O);pe(this,ft).set(n,F)}break}{const F=this.getUserMediaStreamContext(N,z);if(["microphoneCamera_audio"].includes(z))try{const Z=pe(this,Xe).get("audiooutput");(q=F.audioContext)==null||q.setSinkId(Z)}catch(Z){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error",Z)}}});he(this,"getUserMediaStreamContext",(N,z)=>{const I=this.getUserMediaKey(N,z);if(["microphoneCamera_audio","screenSharing_audio"].includes(z))return pe(this,ot).get(I);if(["microphoneCamera_video","screenSharing_video"].includes(z))return pe(this,ft).get(I)});he(this,"getUserAudioMediaStreamContext",(N,z)=>{const I=this.getUserMediaKey(N,z);return pe(this,ot).get(I)});he(this,"removeUserMediaStreamContext",(N,z)=>{const I=this.getUserMediaKey(N,z);if(["microphoneCamera_audio","screenSharing_audio"].includes(z)){const O=pe(this,ot).get(I);return O==null||O.stop(),pe(this,ot).delete(I)}if(["microphoneCamera_video","screenSharing_video"].includes(z)){const O=pe(this,ft).get(I);return O==null||O.stop(),pe(this,ft).get(I)}});he(this,"getUserStream",(N,z)=>{const I=this.getUserMediaStreamContext(N,z);return(I==null?void 0:I.getStream())||new MediaStream});he(this,"getUserStreams",(N,z=[])=>{z.length===0&&(z=mediaType_keys);const I={};for(const O of z){const n=this.getUserStream(N,O);I[O]=n}return I});he(this,"removeUserStreams",async(N,z=[])=>{z.length===0&&(z=mediaType_keys);for(const I of z)this.removeUserMediaStreamContext(N,I)});he(this,"clearUserStreams",()=>{{const N=pe(this,ot).values();for(const z of N)z.stop();Ue(this,ot,new Map)}{const N=pe(this,ft).values();for(const z of N)z.stop();Ue(this,ft,new Map)}});he(this,"setMediaTrackConstraints",async(N,z)=>{pe(this,Ke).set(N,z);const I=await this.getLocalStream(N);if(!I)return;const O=I.getTracks();if(O.length!==0)for(const n of O){const a=n.getConstraints(),F={...pe(this,Ke).get(N),...a,...z};await n.applyConstraints(F)}});he(this,"stopLocalStreams",async(N=[])=>{N.length===0&&(N=mediaType_keys);for(const z of N){const I=pe(this,_t).get(z);I&&await this.stopStream(I),pe(this,_t).delete(z)}});he(this,"addLocalStream",(N,z)=>{const I=pe(this,_t).get(N);I&&this.stopStream(I),pe(this,_t).set(N,z)});he(this,"initLocalStream",async N=>{switch(N){case"microphoneCamera_audio":{const z=pe(this,Xe).get("audioinput"),I=pe(this,Ke).get("microphoneCamera_audio"),O=await navigator.mediaDevices.getUserMedia({audio:{deviceId:z,...I},video:!1});this.addLocalStream("microphoneCamera_audio",O)}break;case"microphoneCamera_video":{const z=pe(this,Xe).get("videoinput"),I=pe(this,Ke).get("microphoneCamera_video"),O=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:z,...I}});this.addLocalStream("microphoneCamera_video",O)}break;case"microphoneCamera":{const z=pe(this,Xe).get("audioinput"),I=pe(this,Xe).get("videoinput"),O=pe(this,Ke).get("microphoneCamera_audio"),n=pe(this,Ke).get("microphoneCamera_video"),q=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:z,...O},video:{deviceId:I,...n}})).getTracks();for(const F of q){const{kind:Z}=F;if(Z==="audio"){const ee=new MediaStream;ee.addTrack(F),this.addLocalStream("microphoneCamera_audio",ee)}if(Z==="video"){const ee=new MediaStream;ee.addTrack(F),this.addLocalStream("microphoneCamera_video",ee)}}}break;case"screenSharing_audio":{const z=pe(this,Ke).get("screenSharing_audio"),O=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...z})).getTracks();for(const n of O){const{kind:a}=n;if(a==="audio"){const q=new MediaStream;q.addTrack(n),this.addLocalStream("screenSharing_audio",q)}}}break;case"screenSharing_video":{const z=pe(this,Ke).get(N),O=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...z})).getTracks();for(const n of O){const{kind:a}=n;if(a==="video"){const q=new MediaStream;q.addTrack(n),this.addLocalStream("screenSharing_video",q)}}}break;case"screenSharing":{const z=pe(this,Ke).get("screenSharing_audio"),I=pe(this,Ke).get("screenSharing_video"),n=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...z,...I})).getTracks();for(const a of n){const{kind:q}=a;if(q==="audio"){const F=new MediaStream;F.addTrack(a),this.addLocalStream("screenSharing_audio",F)}if(q==="video"){const F=new MediaStream;F.addTrack(a),this.addLocalStream("screenSharing_video",F)}}}break}});he(this,"getLocalStream",async N=>{const z=pe(this,_t).get(N),I=pe(this,Rt).get(N);let O=z;return z&&I&&(O=await I(z)),O});he(this,"getLocalStreams",async(N=[])=>{N.length===0&&(N=mediaType_keys);const z={};for(const I of N)z[I]=await this.getLocalStream(I);return z});Oe(this,Ct,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(N=>{Ue(this,Et,N.sort((z,I)=>z.label.localeCompare(I.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(N){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",N)}),pe(this,Et)));Oe(this,Gt,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await pe(this,Ct).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),pe(this,Ct).call(this)});he(this,"getMediaDeviceKind",N=>pe(this,Xe).get(N));he(this,"changeAudiooutput",()=>{const N=pe(this,Xe).get("audiooutput"),z=pe(this,ot).values();for(const I of z)if("setSinkId"in HTMLMediaElement.prototype)try{I.audioContext.setSinkId(N)}catch(O){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",O)}});he(this,"setDeviceKind",(N,z)=>{pe(this,Xe).set(N,z)});he(this,"setAudioOutputDevice",N=>this.setDeviceKind("audiooutput",N));he(this,"getEnumerateDevices",async N=>(await pe(this,Ct).call(this),pe(this,Et).filter(I=>I.kind===N)));he(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));he(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));he(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));pe(this,Gt).call(this),pe(this,Kt).call(this),pe(this,Vt).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var z;((z=this.audioContext)==null?void 0:z.state)==="suspended"&&this.audioContext.resume()})}}Et=new WeakMap,Xe=new WeakMap,Ke=new WeakMap,ot=new WeakMap,ft=new WeakMap,_t=new WeakMap,Rt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Ct=new WeakMap,Gt=new WeakMap;class RoomUsers extends RoomMedias{constructor(N){super(N);he(this,"getMaxVolumeUser",()=>{const N=Array.from(this.userMap.values(),({id:I})=>I);if(N.length===0)return;let z=[];for(const I of N){const O=this.getUserAudioMediaStreamContext(I,"microphoneCamera_audio");if(!O)continue;const n=O.getVolume();z.push({id:I,volume:n})}return z=z.sort((I,O)=>I.volume-O.volume>0?-1:1),z[0]});he(this,"setVolume",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);O==null||O.setInputGain(I)});he(this,"setEnhanceGain",async(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);O==null||O.setEnhanceGain(I)});he(this,"setSpeaker",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);O==null||O.setOutputGain(I)});he(this,"playBgs",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);return O==null?void 0:O.mixAudio(I,"bgs")});he(this,"setBgsGain",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);O==null||O.setBgsGain(I)});he(this,"stopBgs",(N,z)=>{const I=this.getUserAudioMediaStreamContext(N,z);I==null||I.mixAudioStop("bgs")});he(this,"playBgm",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);return O==null?void 0:O.mixAudio(I,"bgm")});he(this,"setBgmGain",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);O==null||O.setBgmGain(I)});he(this,"stopBgm",(N,z)=>{const I=this.getUserAudioMediaStreamContext(N,z);I==null||I.mixAudioStop("bgm")});he(this,"changBgsMix",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);O==null||O.changeMix("bgs",I)});he(this,"changBgmMix",(N,z,I)=>{const O=this.getUserAudioMediaStreamContext(N,z);O==null||O.changeMix("bgm",I)});he(this,"getVolume",(N,z)=>{const I=this.getUserAudioMediaStreamContext(N,z);return I==null?void 0:I.getVolume()});he(this,"clearUsers",()=>{this.userMap=new Map});he(this,"removeUsers",async N=>{for(const z of N)this.userMap.delete(z),await this.removeUserStreams(z)});he(this,"createUser",async N=>{const z=Date.now(),I={id:N,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:N===this.options.userId,isPublished:!1,joinTime:z,updateAt:z,network:{egress:0,ingress:0},tracks:[],channels:[],updateStreams:{microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1}};this.userMap.set(N,I)});he(this,"getUser",async N=>(this.userMap.has(N)||await this.createUser(N),this.userMap.get(N)));he(this,"getUsers",async(N=[])=>{N.length===0&&(N=[...this.userMap.keys()]);const z=[];for(const I of N){const O=await this.getUser(I);z.push(O)}return z});he(this,"getAllUserTrackMids",async()=>{const N=await this.getUsers(),z=[];for(const I of N){const{tracks:O=[]}=I;for(const n of O)z.push(n.mid)}return z});he(this,"getUserTrackByTrackName",async N=>{const z=await this.getUsers(),I=[];for(const O of z){const{tracks:n=[]}=O;for(const a of n){const{trackName:q}=a;N.includes(q)&&I.push(a)}}return I});he(this,"getUserTrackFromMid",async N=>{const z=await this.getUsers();let I;for(const O of z){const{tracks:n=[]}=O;for(const a of n)if(a.mid===N){I=a;break}}return I});he(this,"checkUserInRoom",N=>this.userMap.has(N));he(this,"getUsersId",async()=>[...this.userMap.keys()]);he(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));he(this,"updateIsPublished",async(N,z=!1)=>{const I=await this.getUser(N);I.isPublished=z});he(this,"setUserUpdateStreams",async(N,z,I=!0)=>{const O=await this.getUser(N),n={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};n[z]=I,O.updateStreams=n});he(this,"updateUserChannels",async(N,z=[],I)=>{const O=await this.getUser(N);I&&(z=[...O.channels,...z]),O.channels=z});he(this,"updateUsertracks",async(N,z=[],I)=>{const O=await this.getUser(N);I&&(z=[...O.tracks,...z]),z=z.filter(({mid:q=""})=>q!==""),z=pt(z,["type"]),z=z.sort((q,F)=>q.type-F.type<0?-1:1);for(const q of z)q.userId=N,q.mediaType=mediaType_keys[q.type],q.enabled===void 0&&(q.enabled=!0);O.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const n=dt(O.tracks,["mediaType","enabled","mid","msid","trackName"]),a=dt(z,["mediaType","enabled","mid","msid","trackName"]);{const q="microphoneCamera_audio",F=a.find(te=>te.mediaType===q),Z=n.find(te=>te.mediaType===q),ee=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=ee}{const q="microphoneCamera_video",F=a.find(te=>te.mediaType===q),Z=n.find(te=>te.mediaType===q),ee=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=ee}{const q="screenSharing_audio",F=a.find(te=>te.mediaType===q),Z=n.find(te=>te.mediaType===q),ee=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=ee}{const q="screenSharing_video",F=a.find(te=>te.mediaType===q),Z=n.find(te=>te.mediaType===q),ee=JSON.stringify(F)!==JSON.stringify(Z);O.updateStreams[q]=ee}O.tracks=z});he(this,"updateUserCallAction",async(N,z=0)=>{const I=await this.getUser(N);I.callAction=z,I.callActionStr=z.toString(2).padStart(4,"0"),I.callActionMap=this.getCallActionMap(z)});he(this,"updateUserBehaviors",async(N,z=0)=>{const I=await this.getUser(N);I.banBehavior=z,I.banBehaviorStr=z.toString(2).padStart(4,"0"),I.banBehaviorMap=this.getBanBehaviorMap(z)});he(this,"updateUserNetwork",async(N,z={egress:5,ingress:5})=>{const I=await this.getUser(N);I.network=z});he(this,"updateUserPermissions",async(N,z)=>{if(z){const I=await this.getUser(N);I.permissions=z}});he(this,"updateUserBase",async N=>{const z=await this.getUser(N);z.isSelf=N===this.options.userId,z.updateAt=Date.now()});he(this,"updateUsers",async N=>{for(const z of N){const{id:I,tracks:O,callAction:n,permissions:a,isPublished:q}=z;await this.updateUserBase(I),await this.updateIsPublished(I,q),await this.updateUserPermissions(I,a),await this.updateUsertracks(I,O,!0),await this.updateUserCallAction(I,n),await this.updateUserNetwork(I)}});he(this,"emitNotifyUpdateUser",async N=>{const z=await this.getUsers([N]),[I]=this.usersFilter(z);this.cwsIns.emitNotify("onRoomUser",{code:200,data:I,desc:"user info is change."})});he(this,"emitNotifyUpdateUsers",async()=>{const N=await this.getUsers(),z=this.usersFilter(N);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:z,desc:"all users info is change."})})}}const t=(D,J=4294967295,N=79764919)=>{const z=new Int32Array(256);let I,O,n,a=J;for(I=0;I<256;I++){for(n=I<<24,O=8;O>0;--O)n=2147483648&n?n<<1^N:n<<1;z[I]=n}for(I=0;I<D.length;I++)a=a<<8^z[255&(a>>24^D[I])];return a},e=(D,J=t)=>{const N=oe=>new Uint8Array(oe.length/2).map((se,ye)=>parseInt(oe.substring(2*ye,2*(ye+1)),16)),z=oe=>N(oe)[0],I=new Map;[,8364,,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,,381,,,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,,382,376].forEach((oe,se)=>I.set(oe,se));const O=new Uint8Array(D.length);let n,a,q,F=!1,Z=0,ee=42,te=D.length>13&&D.substring(0,9)==="dynEncode",X=0;te&&(X=11,a=z(D.substring(9,X)),a<=1&&(X+=2,ee=z(D.substring(11,X))),a===1&&(X+=8,q=(oe=>new DataView(N(oe).buffer).getInt32(0,!0))(D.substring(13,X))));const ne=256-ee;for(let oe=X;oe<D.length;oe++)if(n=D.charCodeAt(oe),n!==61||F){if(n===92&&oe<D.length-5&&te){const se=D.charCodeAt(oe+1);se!==117&&se!==85||(n=parseInt(D.substring(oe+2,oe+6),16),oe+=5)}if(n>255){const se=I.get(n);se&&(n=se+127)}F&&(F=!1,n-=64),O[Z++]=n<ee&&n>0?n+ne:n-ee}else F=!0;const ce=O.subarray(0,Z);if(te&&a===1){const oe=J(ce);if(oe!==q){const se="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",se+`
|
|
10
|
+
`,"Expected: "+q+"; Got: "+oe+`
|
|
11
|
+
`,"Visit https://github.com/eshaz/simple-yenc for more information"),Error(se)}}return ce};function WASMAudioDecoderCommon(){const D=Uint8Array,J=Float32Array;WASMAudioDecoderCommon.modules||Object.defineProperties(WASMAudioDecoderCommon,{modules:{value:new WeakMap},setModule:{value(N,z){WASMAudioDecoderCommon.modules.set(N,Promise.resolve(z))}},getModule:{value(N,z){let I=WASMAudioDecoderCommon.modules.get(N);return I||(z?I=WebAssembly.compile(e(z)):(z=N.wasm,I=WASMAudioDecoderCommon.inflateDynEncodeString(z).then(O=>WebAssembly.compile(O))),WASMAudioDecoderCommon.modules.set(N,I)),I}},concatFloat32:{value(N,z){let I=new J(z),O=0,n=0;for(;O<N.length;)I.set(N[O],n),n+=N[O++].length;return I}},getDecodedAudio:{value:(N,z,I,O,n)=>({errors:N,channelData:z,samplesDecoded:I,sampleRate:O,bitDepth:n})},getDecodedAudioMultiChannel:{value(N,z,I,O,n,a){let q=[],F,Z;for(F=0;F<I;F++){const ee=[];for(Z=0;Z<z.length;)ee.push(z[Z++][F]||[]);q.push(WASMAudioDecoderCommon.concatFloat32(ee,O))}return WASMAudioDecoderCommon.getDecodedAudio(N,q,O,n,a)}},inflateDynEncodeString:{value(N){return N=e(N),new Promise(z=>{const I=String.raw`dynEncode012804c7886d()((()>+*§§)§,§§§§)§+§§§)§+.-()(*)-+)(.7*§)i¸¸,3§(i¸¸,3/G+.¡*(,(,3+)2å:-),§H(P*DI*H(P*@I++hH)H*r,hH(H(P*<J,i)^*<H,H(P*4U((I-H(H*i0J,^*DH+H-H*I+H,I*4)33H(H*H)^*DH(H+H)^*@H+i§H)i§3æ*).§K(iHI/+§H,iHn,§H+i(H+i(rCJ0I,H*I-+hH,,hH(H-V)(i)J.H.W)(i)c)(H,i)I,H-i*I-4)33i(I.*hH(V)(H+n5(H(i*I-i(I,i)I.+hH,i*J+iHn,hi(I-i*I,+hH,H/H-c)(H,iFn,hi(I,+hH,H0n5-H*V)(J(,hH/H(i)J(H(V)(J(i)c)(H)H(i)H,c)(3H*i*I*H,i)I,4(3(-H(H,W)(H-I-H,i*I,4)3(3(3H,H-I1H+I,H.i)H1V)(J.i(v5(33H.-H(H,i(c)(H,i*I,4)333)-§i*I*+§H*iHn,hi73H,H(i)8(H+J+H)P*(H*V)(J-r,§H)P*,H.i)H+H,i)V)(-H*i*I*H+i)I+H-H.I.H,H-i)I,4)333Ã+)-§iø7i(^*(iü7I,*h+hH+iDn,h*hilI+i)I,+hH+,hH+iô7H,c)(i)H+i´8W)(H,I,H+i*I+4)-+hH(H)8*J-i(p5.*h*h*hH-i')u,hH(P*(J+,hH(P*0J,H(P*,n50H+H,H-b((3H(P*0i)I.4)3H-i¨*n5*H-iÅ*s,hi73H-i)J+V)&+I,H(H+V)æ,8(I.H(H*8*J-i(p51H-i)J+i¸7V)(H(H+iø7V)(8(J/H(P*0J+s,hi73H+H,H.J,I.H(P*(m5(H.H(P*,s5.+hH,m5*H(P*(J.H+H.H+H/U((b((H(H(P*0i)J+^*0H,i)I,4(3(3H(H.^*03H-i¨*o5)33i(73(3(3-H,H+i)c)(H,i*I,H+i)I+4)33i)I-3H-3!2)0§K(i2J,L(H,H(^*(H,H*^*4H,i(^*0H,i(^*DH,j(_*<H,H)P*(^*,H,H+P*(^*8*h*h+hH,i)8(I3i§I**h*h*h*h*h*h*hH,i*8(6+(),03H,j(_*@i*I-H,P*<J.i,J(H,P*8J/s50H,H.i+J0^*<i¦I*H.H,P*4J1J.U(*H.U((J2i')o5/H.U()I.H,H(^*<H0H1U((H.i0J.i§i0i')o5/H/H.H2J*H(J.q50H,P*0J/H*I-H,P*(J0,hH,P*,H-q,hi)I-423+hH*m5+H/H0H(H1U((b((H/i)I/H(i)I(H*i)I*4(3(3H,H.^*<H,H-^*04*3iØ1U((5+i(I(i¨7i1^*(i$6iè1^*(i°7iè6^*(i¬7iÈ6^*(+hH(iÈ*n,hiÈ*I(+hH(i¨,n,hi¨,I(+hH(iØ,n,hiØ,I(+hH(iè,o,hH,i-H(i0c)(H(i*I(4)33iè1i1H,i-iÈ*8)Bi(I(+hH(ido,hH,i-H(i-c)(H(i*I(4)33iÈ6iè6H,i-iF8)BiØ1i)b((41-H,i-H(i/c)(H(i*I(4)3(3(-H,i-H(i1c)(H(i*I(4)3(3(-H,i-H(i0c)(H(i*I(4)3(3(3H,H/^*0H,H(^*<3i(I*4*3H,H,i¸)^*TH,H,iø-^*PH,H,iX^*LH,H,i(^*HH,i-8(I(H,i-8(I-i¥I*H,i,8(I.H(iErH-iEr5)H(i©*I1H-i)I0i(i;H.i,J(i(H(i(rCJ(J*H*i;sCI*i¨1I-H(I/+hH/,hH,i-H-V)(i)H,i+8(c)(H/i)I/H-i*I-H*i)I*4)-H(i)i¨1I/+hH(H*o,hH,i-H/V)(i)i(c)(H/i*I/H(i)I(4)33i¤I*H,iø-H,i¸)H,i-i;8)5+H0H1I2i(I-+hH-H2p,hH,H,iP8*J*i(p5-H*i7u,hH,i-H-i)H*c)(H-i)I-4*3i(I/i+I.i+I(*h*h*hH*i86*(*)3H-m,hi£I*403H-i)H,W)-I/i*I(4)3i3I.i/I(3H2H,H(8(H.J(H-J.p,hi¢I*4.3H,i-H-i)I*+hH(,hH*H/c)(H*i*I*H(i)I(4)-H.I-4+3(3(33H,W)1m,hiI*4,3H,iø-H,i¸)H,i-H18)J(,hi¡I*H(i(p5,H1H,V)ú-H,V)ø-o5,3H,i(H,iXH,i-H1i)H08)J(,hi I*H(i(p5,H0H,V)H,V)o5,3H,H,iPH,iH8+I*4+3(3(3H,i$6i¬78+I*3H*H3m5(3i)I-H*i(r5)3H)H,P*0^*(H+H,P*<^*(H*I-3H,i2L(H-33Á)+(i¨03b+(,(-(.(/(0(1(2(3(5(7(9(;(?(C(G(K(S([(c(k({(((«(Ë(ë((*)(iø03O)()()()(*(*(*(*(+(+(+(+(,(,(,(,(-(-(-(-(i¨13M8(9(:(((0(/(1(.(2(-(3(,(4(+(5(*(6()(7(T7*S7US0U `;WASMAudioDecoderCommon.getModule(WASMAudioDecoderCommon,I).then(O=>WebAssembly.instantiate(O,{})).then(({exports:O})=>{const n=new Map(Object.entries(O)),a=n.get("puff"),q=n.get("memory").buffer,F=new D(q),Z=new DataView(q);let ee=n.get("__heap_base");const te=N.length,X=ee;ee+=4,Z.setInt32(X,te,!0);const ne=ee;ee+=te,F.set(N,ne);const ce=ee;ee+=4,Z.setInt32(ce,F.byteLength-ee,!0),a(ee,ce,ne,X),z(F.slice(ee,ee+Z.getInt32(ce,!0)))})})}}}),Object.defineProperty(this,"wasm",{enumerable:!0,get:()=>this._wasm}),this.getOutputChannels=(N,z,I)=>{let O=[],n=0;for(;n<z;)O.push(N.slice(n*I,n++*I+I));return O},this.allocateTypedArray=(N,z,I=!0)=>{const O=this._wasm.malloc(z.BYTES_PER_ELEMENT*N);return I&&this._pointers.add(O),{ptr:O,len:N,buf:new z(this._wasm.HEAP,O,N)}},this.free=()=>{this._pointers.forEach(N=>{this._wasm.free(N)}),this._pointers.clear()},this.codeToString=N=>{const z=[],I=new Uint8Array(this._wasm.HEAP);for(let O=I[N];O!==0;O=I[++N])z.push(O);return String.fromCharCode.apply(null,z)},this.addError=(N,z,I,O,n,a)=>{N.push({message:z,frameLength:I,frameNumber:O,inputBytes:n,outputSamples:a})},this.instantiate=(N,z)=>(z&&WASMAudioDecoderCommon.setModule(N,z),this._wasm=new N(WASMAudioDecoderCommon).instantiate(),this._pointers=new Set,this._wasm.ready.then(()=>this))}var browser,hasRequiredBrowser;function requireBrowser(){return hasRequiredBrowser||(hasRequiredBrowser=1,browser=Worker),browser}var browserExports=requireBrowser();const NodeWorker=getDefaultExportFromCjs(browserExports),getWorker=()=>globalThis.Worker||NodeWorker;class WASMAudioDecoderWorker extends getWorker(){constructor(J,N,z,I){WASMAudioDecoderCommon.modules||new WASMAudioDecoderCommon;let O=WASMAudioDecoderCommon.modules.get(z);if(!O){let n="text/javascript",a,q=`'use strict';(${((F,Z,ee)=>{let te,X,ne=new Promise(ce=>{X=ce});self.onmessage=({data:{id:ce,command:oe,data:se}})=>{let ye=ne,ke={id:ce},ae;oe==="init"?(Object.defineProperties(F,{WASMAudioDecoderCommon:{value:Z},EmscriptenWASM:{value:ee},module:{value:se.module},isWebWorker:{value:!0}}),te=new F(se.options),X()):oe==="free"?te.free():oe==="ready"?ye=ye.then(()=>te.ready):oe==="reset"?ye=ye.then(()=>te.reset()):(Object.assign(ke,te[oe](Array.isArray(se)?se.map(de=>new Uint8Array(de)):new Uint8Array(se))),ae=ke.channelData?ke.channelData.map(de=>de.buffer):[]),ye.then(()=>self.postMessage(ke,ae))}}).toString()})(${z}, ${WASMAudioDecoderCommon}, ${I})`;try{a=typeof process.versions.node<"u"}catch{}O=a?`data:${n};base64,${Buffer.from(q).toString("base64")}`:URL.createObjectURL(new Blob([q],{type:n})),WASMAudioDecoderCommon.modules.set(z,O)}super(O,{name:N}),this._id=Number.MIN_SAFE_INTEGER,this._enqueuedOperations=new Map,this.onmessage=({data:n})=>{const{id:a,...q}=n;this._enqueuedOperations.get(a)(q),this._enqueuedOperations.delete(a)},new I(WASMAudioDecoderCommon).getModule().then(n=>{this.postToDecoder("init",{module:n,options:J})})}async postToDecoder(J,N){return new Promise(z=>{this.postMessage({command:J,id:this._id,data:N}),this._enqueuedOperations.set(this._id++,z)})}get ready(){return this.postToDecoder("ready")}async free(){await this.postToDecoder("free").finally(()=>{this.terminate()})}async reset(){await this.postToDecoder("reset")}}const assignNames=(D,J)=>{Object.defineProperty(D,"name",{value:J})};function EmscriptenWASM(D){function J(){}function N(fe){throw fe}var z,I;function O(){var fe=I.buffer;z=new Uint8Array(fe),new BigInt64Array(fe),new BigUint64Array(fe)}for(var n=()=>N(""),a=()=>{},q={},F=fe=>fe(),Z=()=>performance.now(),ee=(fe,Se)=>{if(q[fe]&&(clearTimeout(q[fe].id),delete q[fe]),!Se)return 0;var Te=setTimeout(()=>{delete q[fe],F(()=>ve(fe,Z()))},Se);return q[fe]={id:Te,timeout_ms:Se},0},te=Math.cos,X=fe=>(z.length,!1),ne=fe=>{throw`exit(${fe})`},ce=new Uint8Array(123),oe=25;oe>=0;--oe)ce[48+oe]=52+oe,ce[65+oe]=oe,ce[97+oe]=26+oe;ce[43]=62,ce[47]=63;var se={d:n,c:a,e:ee,a:te,f:X,b:ne};function ye(fe){ke=fe.i,ae=fe.j,de=fe.k,_e=fe.l,me=fe.m,ve=fe.o}var ke,ae,de,_e,me,ve;function ge(fe){fe.h()}EmscriptenWASM.wasm||Object.defineProperty(EmscriptenWASM,"wasm",{get:()=>String.raw`dynEncode0158c8b8d85e¼æ=M]lGu³õPo]ÐãÞ·£3² ÁÚ= Êöc/ÓZ8s³íÛ³uÐ¥t"+¦¦~dòR\(nº}÷£¢¢ë¢k}t¡) ,äÕüP
|
|
12
12
|
*øüäÖeùiÝWͦÖPM¨[æu>Ü(«l'Ë$c¿9ZEúº¼ù¼=}äÍÂý²\åôÒ
'.õtÅXî=}~õ"uÊrÁýóòÝ ÔúéÊ
|
|
13
13
|
/Îÿ4ñ3sl¬8mæÑå68à8uNÑçmhÔ¶©hwÒ½¸t¡î¾¾|®½®ê²
|
|
14
14
|
#Hzò44Bv½!;1Û÷Ô±xü½#Ó7(
0#,È$Ï#$$GÓéËEä àoç7ãoéJÉíï7±çOHAWáì@ì>j_»·ÄBg¡& ºËáPÍþÕâ|óZ5qíê£1(£=Mj»-³;Éb¸mÍIÙãË[@ºk¶äáV9t#wäÔy£óþN÷¸åKS W£)ýÌQ<¼°ì=}=}ÊÌ@㼤j@V¸0Wïú!÷ý£¾±²BMïðô=MãÕ2Úÿ¤ÜïV&¸áÇòßBÕØ&eÞj«@ߥ¬/Ï©Ì).ø~|V}o:¶çBj '¯ÅIÝBVU0¦~VBq´µOF#ÑÈVï ó>±w
5ooø«òÏ©2ú*Yó×&Øscò,óWû® =M«À3ÃUK£AhV!.ßÖª33pêPÃ¥¢;×òZ¹N´*Rwç²Ã= +2pæOôïÈ5 È5p£µ~ØÎE2¿×zÝê
LÂP7]O(&³BTJn6ì¬vøzýOb_¯ëSº [Þá4'þI&xa^ík¨a¨(bñý"w®×µØg),LèÏþ¬1×ü= àúN(5F:kTçZòË"êþÄUÏa%/Áïâ×*Ï3}~èKKnw][sÆ\3²( ¥o)1|()¥Õå¾!?= Ó¹O4xÙ¨ÌÕÆh£§×w¬¢¾9B{ÍØJÙ÷Âwf«E¢ÒpBÒGïÎUW¾£ÓYáG»mU^ðÛ7Lôyí¾7Nì?}Ádt|Öñåu&qýq¶
|
|
@@ -199,4 +199,4 @@ DÙ VààͳÄvÒ2; 5c±-ìÊöª§}Ou¡¡¦îGÇ D
|
|
|
199
199
|
Ùup3q@ݱuXtX07=Mp_¤I¬ø®®[¦ó[ÀRVsX?F^":ha?ØÎeÄQc{Yíz0j¹{b ×c4ö= %¡ì?XÜñÊ,xþÀf©ûyO}:Fà= NuÙO_hÌÍtÝg|ȳ]²(a= TÜøN»j/Ì|éÚ{^ëÐÖ{¡Çzñú_|Åûl*Ztì{8¯a@©¥ZKبc¿i<±üFÇkº-cy5±4§o9Ñ,;KzÌ $à1I=MºôÉ©¤=MêÈ5
|
|
200
200
|
}õíë(ðìÍäWD?£©ÿãª=MäÒ±ì6í)ÏÙtbFÐöÚFÈ´Ù§R1.]¢¦¨ùû,9ïtö»LÂôâ¦qªk{ä(9«4>°»B¶ñ»GÓ½vÃâ£d$°A0ô¼¦d=M¢«£Àß}â$æ0òÊ6¾%¼>3(
-D+ÂÔÂ
o7#æFåEIîkNDÒ_&3iÍHÌúk&@âk1ýîW¶Y¬XÞXáXâ¢XEeØØÈ\gi,Ç~æ{
Ü-ïÈÛx6Û{í8+¾\g¦ñÛírô9³®°3D_åãxQÈxþÚ·/ª= Íu_ÌuL^t^{g9áq?ª(üo!*Írâ&ÃËì÷¨Pd׺ÓG)àþê¤sJ
ñAÉå$AÐNÎçõnD1MøhO¥me Qʸ[F< ^MBÜÛ
|
|
201
201
|
Aãϧüï4î%M°6M
ùtN)FR[¾FqV6¥óðlò©Ë= c»R=}Ù8õ.%BÂIµÃI&æ×U1Q«Ïñ3&ÑóÓÝ»ñ²eL°(ÑòOzBð·Q]üôföê+h.³´)ÅKé¥JR#/GóuÉɾ¯Áõ¿-½ñ'î<·Q¼=MÛ²6+þçYdb_öcHmöôزj¾
nÚ7aÌvØOå¹÷e0FfÂÊÈønØ#?ÁhÊÀcÝåõ(åû)ü)éðк¿ÓÜ¡]qákÈÛÝL·ºrCMmp_ÀÏ Óìcç6®þsosÒÝóô1¬Ã6<2#Ò±C65Q"4B&pç
|
|
202
|
-
gUn
g= !þ+µèm M½Êê½½²¦é%0Yg~´p5.\Ø®zy9%ÔiÜ!ÙcÝŦH>ÓXÿZR[¬&ønÇlÓ_:ïi«ñ<ø"QÚ©yz
®ªOL¥ÎêÌÝi?Ê'/Ne»:2NÅÝ_òspüR Oø!!ù+##üÓkéªX-fpdq[U*]@ ö¨5ÍpÖYhܪ= ÛN3{ü® À)¡9þ-1® ÂcBNö÷0+È6òÒÑ;lÅ^_>ÓÛQ&jðMI줳àlS×j΢@ÈåÕ¢on=M°©xÉûÖäav=MM©²öÖ¹?{ÃßîøyÛ= 0òûÏ4grèNÒíÏqëðð-êö¸á¥$¨Q.Ò4ä¿V$N_Ý><´æë[â²F#T1É'utÿZXÁ(oàx¡Jo"öùSæ÷ÒUFÓs* U¡ÓºUµøGáL¨÷©ASjÕ®'!L¢ÕvC¿m·Gâ¼N¹³OÃã§1T:ê¹\Z£ËZæ.î}ª°O'ãà ¾I;ûÁHÃä&ÃÐÐK@3EÅÓÉ>½e@ã/òi¡|ÃE³{ñSCm
ÎëöÁÐÐ%Ó>d''¶9Á/T.N?äª æÿÀÐÐ%Ó¶ö¾ì¦)ÃÕ÷×"e|ÃþBåýrv¶K6öuâÐÌRÎËýæ×%IOIø¦Ä(HTJ~),ÕDCWWÃö(VwV=M§TsLP³ þV'tT#¡ZLêé;ßù[`});var le={a:oe};this.setModule=de=>{D.setModule(EmscriptenWASM,de)},this.getModule=()=>D.getModule(EmscriptenWASM),this.instantiate=()=>(this.getModule().then(de=>WebAssembly.instantiate(de,le)).then(de=>{const ge=de.exports;me(ge),I=ge.g,O(),we(ge),z()}),this.ready=new Promise(de=>{z=de}).then(()=>{this.HEAP=I.buffer,this.malloc=ae,this.free=he,this.opus_frame_decoder_create=_e,this.opus_frame_decode_float_deinterleaved=fe,this.opus_frame_decoder_destroy=be}),this)}function OpusDecoder(D={}){OpusDecoder.errors||Object.defineProperties(OpusDecoder,{errors:{value:new Map([[-1,"OPUS_BAD_ARG: One or more invalid/out of range arguments"],[-2,"OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer"],[-3,"OPUS_INTERNAL_ERROR: An internal error was detected"],[-4,"OPUS_INVALID_PACKET: The compressed data passed is corrupted"],[-5,"OPUS_UNIMPLEMENTED: Invalid/unsupported request number"],[-6,"OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed"],[-7,"OPUS_ALLOC_FAIL: Memory allocation has failed"]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(Z=>{this._common=Z,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);const X=this._common.allocateTypedArray(this._channels,Uint8Array);X.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,X.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=Z=>{if(!(Z instanceof Uint8Array))throw Error("Data to decode must be Uint8Array. Instead got "+typeof Z);this._input.buf.set(Z);let X=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,Z.length,this._output.ptr),ee;return X<0&&(ee="libopus "+X+" "+(OpusDecoder.errors.get(X)||"Unknown Error"),console.error(ee),X=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,X),samplesDecoded:X,error:ee}},this.decodeFrame=Z=>{let X=[];const ee=this._decode(Z);return ee.error&&this._common.addError(X,ee.error,Z.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=Z.length,this._outputSamples+=ee.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(X,[ee.outputBuffer],this._outputChannels,ee.samplesDecoded,this._sampleRate)},this.decodeFrames=Z=>{let X=[],ee=[],Q=0,ne=0;for(;ne<Z.length;){const se=Z[ne++],re=this._decode(se);X.push(re.outputBuffer),Q+=re.samplesDecoded,re.error&&this._common.addError(ee,re.error,se.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=se.length,this._outputSamples+=re.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(ee,X,this._outputChannels,Q,this._sampleRate)},this._isWebWorker=OpusDecoder.isWebWorker,this._WASMAudioDecoderCommon=OpusDecoder.WASMAudioDecoderCommon||WASMAudioDecoderCommon,this._EmscriptenWASM=OpusDecoder.EmscriptenWASM||EmscriptenWASM,this._module=OpusDecoder.module;const z=8,N=Z=>typeof Z=="number",J=D.sampleRate,I=D.channels,O=D.streamCount,n=D.coupledStreamCount,a=D.channelMappingTable,q=D.preSkip,F=D.forceStereo?1:0;if(I>2&&(!N(O)||!N(n)||!Array.isArray(a)))throw new Error("Invalid Opus Decoder Options for multichannel decoding.");return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(J)?J:48e3,this._channels=N(I)?I:2,this._streamCount=N(O)?O:1,this._coupledStreamCount=N(n)?n:this._channels-1,this._channelMappingTable=a||(this._channels===2?[0,1]:[0]),this._preSkip=q||0,this._forceStereo=I<=z&&I!=2?F:0,this._inputSize=32e3*.12*this._channels,this._outputChannelSize=120*48,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}class OpusDecoderWebWorker extends WASMAudioDecoderWorker{constructor(z){super(z,"opus-decoder",OpusDecoder,EmscriptenWASM)}async decodeFrame(z){return this.postToDecoder("decodeFrame",z)}async decodeFrames(z){return this.postToDecoder("decodeFrames",z)}}assignNames(OpusDecoder,"OpusDecoder"),assignNames(OpusDecoderWebWorker,"OpusDecoderWebWorker"),new OpusDecoder;class RoomPeer extends RoomUsers{constructor(N){super(N);ce(this,"getPeerStatsTimer",0);ce(this,"reports",[]);ce(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});ce(this,"initPeer",()=>{var N;(N=this.peerIns)==null||N.close(),this.transceiverMap=new Map,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),pe(this,Kt).call(this),pe(this,Qt).call(this)});ce(this,"initSendChannel",(N="",J)=>{});ce(this,"initReceiveChannel",(N="",J)=>{});ce(this,"replaceSenderStream",async(N=[],J)=>{const{userId:I}=this.options;N.length===0&&(N=mediaType_keys);for(const O of N){const n=this.transceiverMap.get(O);let a;if(n){const{sender:q}=n;J?a=this.getUserStream(I,O):a=this.getPhoneyStreams(O);const[F]=a.getTracks();F&&await q.replaceTrack(F)}}});ce(this,"getSenderTracks",async(N=[])=>{const J=[];for(const I of N){const O=this.transceiverMap.get(I);if(!O)continue;const{mid:n,sender:a}=O,{track:q}=a;if(!q)continue;const{id:F,enabled:Z}=q,X=mediaType_keys.findIndex(Q=>Q===I),ee={type:X,enabled:Z,trackName:`web-${X}-${F}`,location:"local",mid:n};J.push(ee)}return J});ce(this,"addSenders",async(N=[])=>{N.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const J=[];for(const I of N){if(this.transceiverMap.get(I))continue;const n=this.getPhoneyStreams(I),[a]=n.getTracks(),q=this.peerIns.addTransceiver(a,{direction:"sendonly"});this.transceiverMap.set(I,q),J.push(I)}if(N.length===0||J.length!==0){const I=await this.peerIns.createOffer();if(this.options.debug){const O=libExports$1.parse(I.sdp),n=dt(O.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:n,sdpJson:O,description:I})}await this.peerIns.setLocalDescription(I)}return J});ce(this,"removeSenders",async(N=[])=>{N.length===0&&(N=mediaType_keys);for(const J of N)this.transceiverMap.has(J)&&this.transceiverMap.delete(J)});ce(this,"onSubscribeUserTracks",N=>{let J=0;return new Promise(async I=>{const O=[];for(const n of N){const{tracks:a=[]}=n;for(const q of a){const{trackName:F,mid:Z}=q,[X]=await this.getUserTrackByTrackName([F]);O.push({...X,mid:Z})}}{let n=[];const a=async()=>{clearTimeout(J);const F=new Map;for(const X of n){const{userId:ee,mediaType:Q}=X;if(!ee||!Q)continue;F.has(ee)||F.set(ee,{userId:ee,tracks:[],updateStreams:{}});const se=F.get(ee);se.tracks.push(X),se.updateStreams[Q]=!0}const Z=[...F.values()];for(const X of Z){const{userId:ee,tracks:Q}=X;await this.updateUsertracks(ee,Q,!0)}await this.emitNotifyUpdateUsersStreams(Z),this.peerIns.removeEventListener("track",q);{const X=Array.from(O,ne=>ne.trackName),ee=Array.from(n,ne=>ne.trackName),Q=X.filter(ne=>!ee.includes(ne));I({target:X,success:ee,fail:Q})}},q=async F=>{const{streams:Z,transceiver:X}=F,[ee]=Z,{mid:Q,receiver:ne}=X,{track:se}=ne,{id:re,kind:oe}=se,me=O.find(fe=>fe.mid===`${Q}`);if(!me)return;const{userId:_e,mediaType:ae}=me;if(!(!_e||!ae)){{const fe={...me,mid:Q,msid:re};n.push(fe)}if(this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${n.length}/${O.length}`,{mediaType:ae,mid:Q,userTrack:me,e:F}),await this.initUserMediaStreamContext(_e,ae,ee),oe==="audio"){const fe=this.getUserMediaStreamContext(_e,ae);(fe==null?void 0:fe.kind)==="audio"&&fe.setMute(!1)}O.length===n.length&&a()}};this.peerIns.addEventListener("track",q),J=setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${n.length}/${O.length})`),a()},5*1e3)}})});Te(this,Kt,()=>{let N=0;const J=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.onconnectionstatechange=async I=>{const O=I.target.connectionState;switch(await this.taskQueue.setCondition("ice",!1),clearTimeout(N),O){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${O}`),await this.taskQueue.setCondition("ice",!0),this.setRoomState("connected");break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`),N=setTimeout(J,30*1e3);break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),this.setRoomState("failed");break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),J();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`);break}}});ce(this,"closeUserTracks",async(N,J=[],I=!1)=>{const O=[];for(const F of J){const{trackName:Z,msid:X}=F;O.push(Z),X&&O.push(X)}const n=F=>O.includes(F),a=this.peerIns.getTransceivers();for(const F of a){const{mid:Z,sender:X,receiver:ee}=F;X.track&&n(X.track.id)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${Z} is stop.`,F)),ee.track&&n(ee.track.id)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${Z} is stop.`,F))}const q=await this.getUser(N);if(q){for(const F of q.tracks){const{trackName:Z,msid:X,userId:ee,mediaType:Q}=F;!ee||!Q||!n(Z)||(this.removeUserMediaStreamContext(ee,Q),X&&delete F.msid)}if(I){const F=q.tracks.filter(({trackName:Z})=>!n(Z));await this.updateUsertracks(N,F,!1)}}});ce(this,"createOffer",async()=>{const N=await this.peerIns.createOffer();if(this.options.debug){const J=libExports$1.parse(N.sdp),I=dt(J.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:I,sdpJson:J,description:N})}await this.peerIns.setLocalDescription(N)});ce(this,"createAnswer",async()=>{const N=await this.peerIns.createAnswer();if(this.options.debug){const J=libExports$1.parse(N.sdp),I=dt(J.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:I,sdpJson:J,description:N})}await this.peerIns.setLocalDescription(N)});ce(this,"getSdp",()=>{var N;return(N=this.peerIns.localDescription)==null?void 0:N.sdp});ce(this,"setRemoteDescription",async N=>{if(this.options.debug){const J=libExports$1.parse(N.sdp),I=dt(J.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:I,sdpJson:J,description:N})}return await this.peerIns.setRemoteDescription(N),N});ce(this,"setCallStrategy",async(N,J=[])=>{J.length===0&&(J=mediaType_keys);let I="balanced";switch(N){case"qualityPriority":I="maintain-resolution";break;case"fluencyPriority":I="maintain-framerate";break;case"balancedDowngrade":I="balanced";break}const O=await this.getSelfInfo(),n=Array.from(O.tracks,({trackName:q})=>q),a=this.peerIns.getSenders();for(const q of a){const{track:F}=q;if(!F||!n.includes(F.id))continue;const Z=q.getParameters();q.setParameters({...Z,degradationPreference:I})}});ce(this,"setRTCRtpSenderParameters",N=>{try{const J=this.peerIns.getSenders();for(const I of J){const O=I.getParameters();I.setParameters({...O,...N})}}catch(J){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",J)}});ce(this,"getReportsByMid",async(N=[])=>N.length===0?this.reports:this.reports.filter(J=>N.includes(J.mid)));ce(this,"getRoomNetwork",()=>this.peerNetwork);ce(this,"getPeerNetwork",()=>this.peerNetwork);Te(this,Gt,async()=>{try{const N=await this.peerIns.getStats(),J=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],O=[...N.values()].filter(fe=>J.includes(fe.type));let n=0,a=0,q=0,F=0,Z=0,X=0,ee=[],Q=[];for(const fe of this.reports){const{packetsSent:be,packetsLost:he}=fe;be&&(q+=be),he&&(F+=he)}this.reports=O;for(const fe of this.reports){const{bytesSent:be,bytesReceived:he,packetsSent:ye,packetsLost:we,roundTripTime:le,jitter:de}=fe;be&&(a=be),he&&(n=he),ye&&(Z+=ye),we&&(X+=we),le&&ee.push((le*100).toFixed(2)),de&&Q.push(de.toFixed(2))}Q.sort().reverse(),ee.sort().reverse();const ne=Z-q,se=X-F,re=ne===0?"0.00":(se/ne).toFixed(2),[oe="0"]=ee,[me="0"]=Q,_e={outboundBytes:a,inboundBytes:n,lostRate:re,roundTripTime:oe,jitter:me};this.peerNetwork=_e;const ae=(fe,be,he)=>{const ye=Number(fe),we=Number(be),le=Number(he);let de="0";return ye<.03&&we<100&&le<.05?de="5":ye<.06&&we<160&&le<.1?de="4":ye<.1&&we<250&&le<.15?de="3":ye<.15&&we<400&&le<.2?de="2":de="1",Number(de)};{const fe=ae(re,oe,me),be=await this.getSelfInfo(),{network:he}=be,ye={egress:fe,ingress:fe};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,ye),JSON.stringify(he)!==JSON.stringify(ye)){this.emitNotifyUpdateUsers();const{userId:de,roomId:ge}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...ye,userId:de,roomId:ge}},!1)}},3*1e3)}}catch(N){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",N)}});Te(this,Qt,()=>{const N=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||pe(this,Gt).call(this)};this.getPeerStatsTimer=setInterval(N,1*1e3)});ce(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Kt=new WeakMap,Gt=new WeakMap,Qt=new WeakMap;class RoomCalls extends RoomPeer{constructor(N){super(N);Te(this,Rt,0);ce(this,"setLocalStream",(N,J)=>new Promise(async(I,O)=>{try{typeof N=="string"&&(N=[N]);for(const a of N)this.localStreamsActionMap.set(a,J);if(J){if(N.includes("microphoneCamera_audio")&&N.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):N.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):N.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):N.includes("screenSharing_audio")&&N.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):N.includes("screenSharing_audio")&&!N.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):N.includes("screenSharing_video")&&!N.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),N.includes("screenSharing_audio")){const a=await this.getLocalStream("screenSharing_audio");if(a){const q=a.getTracks();for(const F of q)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(N.includes("screenSharing_video")){const a=await this.getLocalStream("screenSharing_video");if(a){const q=a.getTracks();for(const F of q)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(N);const n=await this.getLocalStreams(N);this.cwsIns.emitNotify("onLocalStream",{code:200,data:n,desc:"local stream is change."}),I(n)}catch(n){O(n)}}));ce(this,"setMediaDeviceKind",(N,J)=>new Promise(async(I,O)=>{this.setDeviceKind(N,J);const n=await this.getSelfInfo(),{id:a,tracks:q=[],callActionMap:F}=n,Z=[],X=async ee=>{const Q=this.localStreamsActionMap.get(ee),ne=q.find(re=>re.mediaType===ee),se=F[ee];if(Q){Z.push(ee),await this.stopLocalStreams([ee]);try{await this.initLocalStream(ee)}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([ee],!1),O(re)}}if(ne){const re=await this.getLocalStream(ee);if(re){const oe=this.getUserMediaStreamContext(a,ee);oe==null||oe.replaceStream(re),se&&await this.replaceSenderStream([ee],!0)}}{const re=await this.getLocalStreams(Z);this.cwsIns.emitNotify("onLocalStream",{code:200,data:re,desc:"local stream is change."}),I(!0)}};N==="audioinput"&&X("microphoneCamera_audio"),N==="videoinput"&&X("microphoneCamera_video"),N==="audiooutput"&&(this.changeAudiooutput(),I(!0))}));ce(this,"changeScreenSharing",async N=>{const J=await this.getSelfInfo(),{tracks:I=[],callActionMap:O}=J;try{await this.setLocalStream(N,!0);for(const n of N)I.find(q=>q.mediaType===n&&O[n])&&await this.replaceSenderStream([n],!0)}catch(n){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",n)}});ce(this,"createSession",()=>new Promise(async(N,J)=>{if(["connecting","connected"].includes(this.roomState))return N(!0);this.setRoomState("connecting"),await this.taskQueue.createTask({describe:"createSession",conditionKeys:["createWs","createSession"],changeConditionKeys:["createSession"],func:()=>new Promise(async(I,O)=>{try{await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async n=>{const{code:a=0,desc:q,data:F}=n;if(a!==200)return O(q);const{remoteSdp:Z}=F;await this.taskQueue.setCondition("ice",!1),await this.taskQueue.createTask({describe:"ice",timeout:30*1e3,conditionKeys:["ice"],func:()=>new Promise(X=>setTimeout(()=>X(!0),300)),success:async()=>{I(!0)},fail:async X=>{throw new Error(`ice connection failed: ${X}`)}}),await this.setRemoteDescription({type:"answer",sdp:Z})})}catch(n){O(n)}}),success:async I=>{N(I)},fail:async I=>{this.reportLogs("ws_c_timeout",I.message||I),J(I)},complete:()=>{this.taskQueue.setCondition("createSession",!0)}})}));ce(this,"earlyConnect",(N=[])=>{this.isEarly=!0,pe(this,Pt).call(this),this.createSession(),N.length===0&&(N=["microphoneCamera_audio","microphoneCamera_video"]),pe(this,Ut).call(this,N)});ce(this,"joinRoom",async N=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"joinRoom",conditionKeys:["createWs"],changeConditionKeys:["joinRoom"],func:()=>new Promise(async(O,n)=>{try{this.setOptions(N),await pe(this,Pt).call(this),this.clearUsers();const{roomId:a,userId:q,callType:F,sdkToken:Z}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:F,roomId:a,user:{id:q,tracks:[],callAction:0},token:Z},version:2}).then(async X=>{const{code:ee=0,desc:Q="服务器繁忙",data:ne}=X;if(ee!==200)return n(Q);const{roomId:se="",roomUsers:re=[]}=ne;if(se!==a)return n("加入的房间不匹配");this.isInRoom=!0,this.initHeartbeat(),this.createSession(),await this.updateUsers(re);const oe=[];for(const _e of re){const{id:ae,channelCache:fe}=_e,{channels:be=[]}=fe;await this.updateUserBehaviors(ae,_e.behavior),await this.updateUserChannels(ae,be,!1),be.length!==0&&oe.push({userId:ae,channels:be})}this.subChannel(oe),await this.emitNotifyUpdateUsers();const me=await this.getUsers();O(me)})}catch(a){n(a)}}),success:async O=>{J(O)},fail:async O=>{this.reportLogs("join_room_error",O.message||O),I(O)},complete:()=>{this.taskQueue.setCondition("joinRoom",!0)}})}));ce(this,"quitRoom",()=>new Promise(async N=>{const{roomId:J,userId:I}=this.options,O={roomId:J,user:{id:I}};try{this.isInRoom=!1,clearInterval(pe(this,Rt)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(n){this.reportLogs("quit_room_error",n.message||n)}await new Promise(n=>setTimeout(()=>n(!0),300)),await this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:O}),N(!0)}));ce(this,"quitRoomEx",()=>new Promise(async N=>{const{roomId:J,userId:I}=this.options,O={roomId:J,user:{id:I}};try{this.isInRoom=!1,this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(n){this.reportLogs("quit_room_error",n.message||n)}await new Promise(n=>setTimeout(()=>n(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:O}),N(!0)}));ce(this,"syncRoomInfo",()=>new Promise(async(N,J)=>{const{userId:I}=this.options,O=await this.getUser(I),{id:n=I,callAction:a=0}=O;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:n,callAction:a}}}).then(async q=>{if(q.code!==200)return J(q.desc);const F=q.data.users;this.clearUsers(),await this.updateUsers(F),await this.updateUsertracks(O.id,O.tracks,!1);{const Z=await this.getUsers();N(Z)}}).catch(q=>J(q))}));ce(this,"publish",N=>new Promise(async(J,I)=>{{const O=await this.getSelfInfo(),{banBehaviorMap:n}=O;let a=!0;for(const q of N)if(n[q]){a=!1;break}if(a===!1)return I("publish is error: prohibited by administrator.")}try{await this.setLocalStream(N,!0)}catch(O){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",O)}await this.taskQueue.createTask({describe:"publish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["publish"],func:()=>new Promise(async(O,n)=>{try{const a=await this.getSelfInfo(),q=[];for(const Q of N){{const ne=this.getPhoneyStreams(Q);await this.initUserMediaStreamContext(a.id,Q,ne)}{const ne=await this.getLocalStream(Q);if(ne){const se=this.getUserMediaStreamContext(a.id,Q);se==null||se.replaceStream(ne)}else q.push(Q)}}const F=N.filter(Q=>!q.includes(Q)||["microphoneCamera_audio","microphoneCamera_video"].includes(Q));await this.replaceSenderStream(N,!1),await pe(this,Ut).call(this,F);const Z=await this.getSenderTracks(F),X=[...a.tracks,...Z];await this.updateUsertracks(a.id,X,!0);const ee=await this.getCallAction(X);await pe(this,Ct).call(this,ee),q.length!==0&&await this.inactiveTracks(q,!1),F.length!==0&&await this.replaceSenderStream(F,!0),pe(this,Yt).call(this,N);{await this.emitNotifyUpdateUsers();const Q=await this.getSelfInfo();O(Q)}}catch(a){n(a)}}),success:async O=>{J(O)},fail:async O=>{this.reportLogs("publish_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("publish",!0)}})}));ce(this,"stopPublish",(N=[])=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"stopPublish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(O,n)=>{try{const a=await this.getSelfInfo();N.length===0&&(N=mediaType_keys);const q=a.tracks.filter(({mediaType:Z})=>Z&&N.includes(Z)),F=async()=>{this.initMediaPhoneyStreams(N);const Z=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),O(Z)};if(q.length===0)return F();await this.replaceSenderStream(N,!0),await this.closeUserTracks(a.id,q,!0),await this.removeSenders(N);{const Z=await this.getCallAction(a.tracks);await pe(this,Ct).call(this,Z)}await this.createOffer(),this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:q}}).then(async Z=>{const{code:X=0,data:ee,desc:Q}=Z;if(X!==200)return n(Q);const{remoteSdp:ne}=ee;await this.setRemoteDescription({type:"answer",sdp:ne}),F()})}catch(a){n(a)}}),success:async O=>{J(O)},fail:async O=>{this.reportLogs("close_track_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));ce(this,"subscribe",(N=[],J=3)=>new Promise(async(I,O)=>{const n=await this.taskQueue.createTask({describe:"subscribe",strict:!0,conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["subscribe"],func:()=>new Promise(async(a,q)=>{try{const F=await this.getUsers();let Z=[];for(const Q of F){const{isSelf:ne,tracks:se=[]}=Q;if(!ne){const re=se.filter(({trackName:oe,mid:me=""})=>me!==""&&(N.includes(oe)||N.length===0));re.length!==0&&Z.push({...Q,tracks:re})}}const X=async(Q={})=>{const ne=Array.from(Z,({id:re})=>re),se=await this.getUsers(ne);await this.emitNotifyUpdateUsers(),a({users:se,detail:Q})};if(Z.length===0)return X();const ee=[];for(const Q of Z){const{id:ne,tracks:se}=Q,re=dt(se,["type","trackName"]),oe={id:ne,tracks:re};ee.push(oe)}this.cwsIns.sendMessage({event:"subscribe",data:{users:ee}}).then(async Q=>{const{code:ne=0,data:se,desc:re}=Q;if(ne!==200)return q(re);const{remoteSdp:oe,users:me=[]}=se;this.onSubscribeUserTracks(me).then(async _e=>{await this.renegotiate().then(()=>X(_e)).catch(ae=>q(ae))}).catch(_e=>{q(_e)}),await this.setRemoteDescription({type:"offer",sdp:oe})})}catch(F){q(F)}}),success:async a=>{n.clear(),this.taskQueue.setCondition("subscribe",!0),I(a)},fail:async a=>{if(this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: subscribe error. surplus count is ${J}`),J>0)return await new Promise(q=>setTimeout(()=>q(!0),(3-J)*1e3)),J=J-1,n.retry();n.clear(),this.reportLogs("subscribe_error",a.message||a),this.taskQueue.setCondition("subscribe",!0),O(a)},complete:async()=>{}})}));ce(this,"renegotiate",()=>new Promise(async(N,J)=>{try{await this.taskQueue.setCondition("renegotiate",!1),await this.createAnswer(),this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(I=>{const{code:O=0,desc:n}=I;if(O!==200)return J(n);N(I)}).finally(()=>{this.taskQueue.setCondition("renegotiate",!0)})}catch(I){J(I)}}));ce(this,"stopSubscribe",(N=[])=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"closeTrack",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(O,n)=>{try{const a=await this.getUsers(),q=[];for(const Z of a){const{tracks:X=[]}=Z;for(const ee of X){const{type:Q,mid:ne,trackName:se,mediaType:re,msid:oe}=ee;if(!(!re||!oe)&&(N.length===0||N.includes(se))){const me={type:Q,mid:ne,trackName:oe};q.push(me),await this.closeUserTracks(Z.id,[ee])}}}const F=async()=>{await this.emitNotifyUpdateUsers(),O(!0)};if(q.length===0)return F();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:q}}).then(async Z=>{const{remoteSdp:X}=Z.data;await this.setRemoteDescription({type:"answer",sdp:X})}),F()}catch(a){n(a)}}),success:async O=>{J(O)},fail:async O=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",O),this.reportLogs("close_track_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));ce(this,"inactiveTracks",async(N,J)=>new Promise(async I=>{const O=await this.getSelfInfo();if(!O||!O.id)return I(!0);const{tracks:n=[]}=O,a=[...n];for(let F of a){const{mediaType:Z}=F;if(Z&&N.includes(Z)){F.enabled=J;const X=await this.getLocalStream(Z);if(!X)continue;const ee=X.getTracks();for(const Q of ee)Q.enabled=J}}const q=await this.getCallAction(a);await pe(this,Ct).call(this,q),await this.replaceSenderStream(N,J),await this.emitNotifyUpdateUsers(),I(!0)}));ce(this,"setBanBehaviors",N=>new Promise(async(J,I)=>{try{const{roomId:O}=this.options,n=[];for(const a of N){const{id:q,banBehaviors:F}=a,Z=Object.keys(F);if(Z.length===0)continue;const X=[];for(const Q of Z){const ne=mediaType_keys.findIndex(oe=>oe===Q),se=F[Q],re={type:ne,behavior:se};X.push(re)}const ee={id:q,behaviors:X};n.push(ee)}this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:O,users:n}}).then(async a=>{const{code:q=0,desc:F}=a;if(q!==200)return I(F);J(a)}).finally(()=>{})}catch(O){I(O)}}));ce(this,"pubChannel",()=>new Promise(async(N,J)=>{const O=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:O}}).then(async n=>{const{code:a=0,data:q,desc:F}=n;if(a!==200)return J(F);const{channels:Z=[]}=q;for(const X of Z){const{channels:ee=[]}=X;for(const Q of ee){const{dataChannelName:ne,id:se}=Q;this.initSendChannel(ne,se)}}N(!0)}).catch(n=>{J(n)})}));ce(this,"subChannel",(N=[])=>new Promise(async(J,I)=>{if(N.length===0)return J(!0);await this.taskQueue.createTask({describe:"subChannel",strict:!0,conditionKeys:["createWs","createSession","ice"],changeConditionKeys:[],func:()=>this.cwsIns.sendMessage({event:"subChannel",data:{channels:N}}).then(async O=>{const{code:n=0,data:a,desc:q}=O;if(n!==200)return I(q);const{channels:F=[]}=a;for(const Z of F){const{channels:X=[]}=Z;for(const ee of X){const{dataChannelName:Q,id:ne}=ee;this.initReceiveChannel(Q,ne)}}}),success:async O=>{J(O)},fail:async O=>{I(O)}})}));ce(this,"debugger",()=>new Promise(async(N,J)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async I=>{if(I.code!==200)return J(I.desc);N(!0)}).catch(I=>{J(I)})}));ce(this,"shutdown",()=>new Promise(async(N,J)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async I=>{if(I.code!==200)return J(I.desc);N(!0)}).catch(I=>{J(I)})}));ce(this,"initHeartbeat",()=>{this.stopHeartbeat();const N=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),J=this.isInRoom?5*1e3:30*1e3;Pe(this,Rt,setInterval(N,J)),N()});ce(this,"stopHeartbeat",()=>{clearInterval(pe(this,Rt))});Te(this,Yt,async N=>{const{roomId:J}=this.options;if(!J)return;const{id:I,tracks:O=[]}=await this.getSelfInfo(),n=O.filter(a=>a.mediaType&&N.includes(a.mediaType));n.length!==0&&this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:J,user:{id:I,tracks:n}}})});Te(this,Ct,async N=>new Promise(async(J,I)=>{const{roomId:O,userId:n}=this.options,a={roomId:O,user:{id:n,callAction:N}};await this.cwsIns.sendMessage({event:"updateCall",data:a}).then(async q=>{const{code:F=0}=q;if(F!==200)return I(q);await this.updateUserCallAction(n,N),J(N)}).catch(q=>I(q))}));Te(this,Pt,()=>new Promise(async(N,J)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return N(!0);await this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:I,roomId:O,userId:n}=this.options;if(!I)return J("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const a={c:I,r:O,v:this.sdk_service_version};if(this.isEarly){const F=xt();a.i=F,this.setOptions({earlyId:F})}else a.b=n;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",a);const q=btoa(encodeURI(JSON.stringify(a)));await this.cwsIns.connect(q),this.initHeartbeat(),await this.taskQueue.setCondition("createWs",!0),await this.taskQueue.setCondition("createSession",!0),N(!0)}catch(I){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",I),this.reportLogs("ws_c_timeout",I.message||I),J(I)}}));Te(this,Ut,async N=>new Promise(async(J,I)=>{await this.taskQueue.createTask({describe:"createTrack",conditionKeys:["createWs","createSession","ice","createTrack","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(O,n)=>{try{await this.taskQueue.setCondition("createTrack",!1);const a=await this.addSenders(N),q=await this.getSenderTracks(a);if(q.length===0)return await this.taskQueue.setCondition("createTrack",!0),O(!0);this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:q,callAction:0}}).then(async F=>{const{code:Z=0,desc:X,data:ee}=F;if(Z!==200)return n(X);const{remoteSdp:Q}=ee;await this.setRemoteDescription({type:"answer",sdp:Q}),O(!0)})}catch(a){await this.removeSenders(N),n(a)}}),success:async O=>{J(O)},fail:async O=>{this.reportLogs("publish_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("createTrack",!0)}})}))}}Rt=new WeakMap,Yt=new WeakMap,Ct=new WeakMap,Pt=new WeakMap,Ut=new WeakMap;class Room extends RoomCalls{constructor(z){super(z)}}class QuickVO extends Room{constructor(N){super(N);Te(this,Tt,new Map);ce(this,"reconstruct",async()=>{if(this.cwsIns.state!=="connected"||this.roomState!=="failed")return;this.setRoomState("ready"),this.initMediaPhoneyStreams(),this.taskQueue.clear(),this.peerIns.close(),await this.syncRoomInfo(),this.initPeer(),this.taskQueue.setCondition("createSession",!0),this.taskQueue.setCondition("ice",!0),await this.createSession();const N=[],J=[],I=await this.getUsers();for(const O of I){const{isSelf:n,callActionMap:a,tracks:q=[]}=O;if(n)for(const F of mediaType_keys)a[F]&&N.push(F);for(const F of q)F.msid&&J.push(F.trackName)}await this.subscribe(J),await this.publish(N)});Te(this,Xt,()=>{{const N=async J=>{const{state:I}=J.data;if(I==="closed"){const{roomId:O,userId:n}=this.options,a={roomId:O,user:{id:n}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:a}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}this.reconstruct()};this.cwsIns.addNotify({event:"onRoomState",callback:N},!0)}{const N=async J=>{const{qualities:I=[]}=J.data,[O]=I;if(!(O&&O.userId===this.options.userId&&I.length===1)){for(const n of I){const{userId:a,egress:q,ingress:F}=n;this.checkUserInRoom(a)&&await this.updateUserNetwork(a,{egress:q,ingress:F})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:N},!0)}{const N=async J=>{const I=J.data.user;await this.updateUsers([I]),await this.updateUsertracks(I.id,I.track,!1),await this.updateUserBehaviors(I.id,I.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:N},!0)}{const N=async J=>{await this.removeUsers([J.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:N},!0)}{const N=async J=>{const{user:I}=J.data,{id:O,tracks:n=[],callAction:a=0}=I;if(await this.updateUserCallAction(O,a),await this.updateUserPermissions(O,3),await this.updateUsertracks(O,n,!0),this.options.newPublishAutoSubscribe){const q=this.getTrackNamesFormTracks(n);await this.subscribe(q)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:N},!0)}{const N=async J=>{const I=[J.data];this.subChannel(I)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:N},!0)}{const N=async J=>{const{id:I,tracks:O}=J.data.user;I!==this.options.userId&&(await this.closeUserTracks(I,O,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:N},!0)}{const N=async J=>{const{id:I,callAction:O}=J.data.user;this.checkUserInRoom(I)&&(await this.updateUserCallAction(I,O),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:N},!0)}{const N=async J=>{const{user:I}=J.data,{id:O,permissions:n=1}=I;n===1?await this.removeUsers([O]):n===3&&await this.updateUsers([I]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:N},!0)}{const N=async J=>{const{users:I}=J.data;for(const O of I){const{id:n,behavior:a}=O;await this.updateUserBehaviors(n,a)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:N},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async N=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});ce(this,"addNotify",N=>this.cwsIns.addNotify(N));Te(this,en,()=>{});Te(this,tn,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.reconstruct()}});Te(this,nn,async()=>{this.setRoomState("closed")});ce(this,"addRequestAnimationFrame",async(N,J)=>{{const O=pe(this,Tt).get(N);O&&cancelAnimationFrame(O)}const I=(O=Date.now())=>{J(O);const n=requestAnimationFrame(I);pe(this,Tt).set(N,n)};I()});ce(this,"clearRequestAnimationFrame",async(N=[])=>{N.length===0&&(N=[...pe(this,Tt).keys()]);const J=[];for(const I of N){const O=pe(this,Tt).get(I);O&&(cancelAnimationFrame(O),J.push(O))}return J});ce(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(N=>setTimeout(()=>N(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});pe(this,en).call(this),pe(this,tn).call(this),pe(this,nn).call(this),pe(this,Xt).call(this)}}Tt=new WeakMap,Xt=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
202
|
+
gUn
g= !þ+µèm M½Êê½½²¦é%0Yg~´p5.\Ø®zy9%ÔiÜ!ÙcÝŦH>ÓXÿZR[¬&ønÇlÓ_:ïi«ñ<ø"QÚ©yz
®ªOL¥ÎêÌÝi?Ê'/Ne»:2NÅÝ_òspüR Oø!!ù+##üÓkéªX-fpdq[U*]@ ö¨5ÍpÖYhܪ= ÛN3{ü® À)¡9þ-1® ÂcBNö÷0+È6òÒÑ;lÅ^_>ÓÛQ&jðMI줳àlS×j΢@ÈåÕ¢on=M°©xÉûÖäav=MM©²öÖ¹?{ÃßîøyÛ= 0òûÏ4grèNÒíÏqëðð-êö¸á¥$¨Q.Ò4ä¿V$N_Ý><´æë[â²F#T1É'utÿZXÁ(oàx¡Jo"öùSæ÷ÒUFÓs* U¡ÓºUµøGáL¨÷©ASjÕ®'!L¢ÕvC¿m·Gâ¼N¹³OÃã§1T:ê¹\Z£ËZæ.î}ª°O'ãà ¾I;ûÁHÃä&ÃÐÐK@3EÅÓÉ>½e@ã/òi¡|ÃE³{ñSCm
ÎëöÁÐÐ%Ó>d''¶9Á/T.N?äª æÿÀÐÐ%Ó¶ö¾ì¦)ÃÕ÷×"e|ÃþBåýrv¶K6öuâÐÌRÎËýæ×%IOIø¦Ä(HTJ~),ÕDCWWÃö(VwV=M§TsLP³ þV'tT#¡ZLêé;ßù[`});var le={a:se};this.setModule=fe=>{D.setModule(EmscriptenWASM,fe)},this.getModule=()=>D.getModule(EmscriptenWASM),this.instantiate=()=>(this.getModule().then(fe=>WebAssembly.instantiate(fe,le)).then(fe=>{const Se=fe.exports;ye(Se),I=Se.g,O(),ge(Se),J()}),this.ready=new Promise(fe=>{J=fe}).then(()=>{this.HEAP=I.buffer,this.malloc=ae,this.free=me,this.opus_frame_decoder_create=ke,this.opus_frame_decode_float_deinterleaved=de,this.opus_frame_decoder_destroy=_e}),this)}function OpusDecoder(D={}){OpusDecoder.errors||Object.defineProperties(OpusDecoder,{errors:{value:new Map([[-1,"OPUS_BAD_ARG: One or more invalid/out of range arguments"],[-2,"OPUS_BUFFER_TOO_SMALL: Not enough bytes allocated in the buffer"],[-3,"OPUS_INTERNAL_ERROR: An internal error was detected"],[-4,"OPUS_INVALID_PACKET: The compressed data passed is corrupted"],[-5,"OPUS_UNIMPLEMENTED: Invalid/unsupported request number"],[-6,"OPUS_INVALID_STATE: An encoder or decoder structure is invalid or already freed"],[-7,"OPUS_ALLOC_FAIL: Memory allocation has failed"]])}}),this._init=()=>new this._WASMAudioDecoderCommon(this).instantiate(this._EmscriptenWASM,this._module).then(Z=>{this._common=Z,this._inputBytes=0,this._outputSamples=0,this._frameNumber=0,this._input=this._common.allocateTypedArray(this._inputSize,Uint8Array),this._output=this._common.allocateTypedArray(this._outputChannels*this._outputChannelSize,Float32Array);const ee=this._common.allocateTypedArray(this._channels,Uint8Array);ee.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,ee.ptr,this._preSkip,this._forceStereo)}),Object.defineProperty(this,"ready",{enumerable:!0,get:()=>this._ready}),this.reset=()=>(this.free(),this._init()),this.free=()=>{this._common.free(),this._common.wasm.opus_frame_decoder_destroy(this._decoder),this._common.wasm.free(this._decoder)},this._decode=Z=>{if(!(Z instanceof Uint8Array))throw Error("Data to decode must be Uint8Array. Instead got "+typeof Z);this._input.buf.set(Z);let ee=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,Z.length,this._output.ptr),te;return ee<0&&(te="libopus "+ee+" "+(OpusDecoder.errors.get(ee)||"Unknown Error"),console.error(te),ee=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,ee),samplesDecoded:ee,error:te}},this.decodeFrame=Z=>{let ee=[];const te=this._decode(Z);return te.error&&this._common.addError(ee,te.error,Z.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=Z.length,this._outputSamples+=te.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(ee,[te.outputBuffer],this._outputChannels,te.samplesDecoded,this._sampleRate)},this.decodeFrames=Z=>{let ee=[],te=[],X=0,ne=0;for(;ne<Z.length;){const ce=Z[ne++],oe=this._decode(ce);ee.push(oe.outputBuffer),X+=oe.samplesDecoded,oe.error&&this._common.addError(te,oe.error,ce.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=ce.length,this._outputSamples+=oe.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(te,ee,this._outputChannels,X,this._sampleRate)},this._isWebWorker=OpusDecoder.isWebWorker,this._WASMAudioDecoderCommon=OpusDecoder.WASMAudioDecoderCommon||WASMAudioDecoderCommon,this._EmscriptenWASM=OpusDecoder.EmscriptenWASM||EmscriptenWASM,this._module=OpusDecoder.module;const J=8,N=Z=>typeof Z=="number",z=D.sampleRate,I=D.channels,O=D.streamCount,n=D.coupledStreamCount,a=D.channelMappingTable,q=D.preSkip,F=D.forceStereo?1:0;if(I>2&&(!N(O)||!N(n)||!Array.isArray(a)))throw new Error("Invalid Opus Decoder Options for multichannel decoding.");return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(z)?z:48e3,this._channels=N(I)?I:2,this._streamCount=N(O)?O:1,this._coupledStreamCount=N(n)?n:this._channels-1,this._channelMappingTable=a||(this._channels===2?[0,1]:[0]),this._preSkip=q||0,this._forceStereo=I<=J&&I!=2?F:0,this._inputSize=32e3*.12*this._channels,this._outputChannelSize=120*48,this._outputChannels=this._forceStereo?2:this._channels,this._ready=this._init(),this}class OpusDecoderWebWorker extends WASMAudioDecoderWorker{constructor(J){super(J,"opus-decoder",OpusDecoder,EmscriptenWASM)}async decodeFrame(J){return this.postToDecoder("decodeFrame",J)}async decodeFrames(J){return this.postToDecoder("decodeFrames",J)}}assignNames(OpusDecoder,"OpusDecoder"),assignNames(OpusDecoderWebWorker,"OpusDecoderWebWorker"),new OpusDecoder;class RoomPeer extends RoomUsers{constructor(N){super(N);he(this,"getPeerStatsTimer",0);he(this,"reports",[]);he(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});he(this,"initPeer",()=>{var N;(N=this.peerIns)==null||N.close(),this.transceiverMap=new Map,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),pe(this,Qt).call(this),pe(this,Xt).call(this)});he(this,"initSendChannel",(N="",z)=>{});he(this,"initReceiveChannel",(N="",z)=>{});he(this,"replaceSenderStream",async(N=[],z)=>{const{userId:I}=this.options;N.length===0&&(N=mediaType_keys);for(const O of N){const n=this.transceiverMap.get(O);let a;if(n){const{sender:q}=n;z?a=this.getUserStream(I,O):a=this.getPhoneyStreams(O);const[F]=a.getTracks();F&&await q.replaceTrack(F)}}});he(this,"getSenderTracks",async(N=[])=>{const z=[];for(const I of N){const O=this.transceiverMap.get(I);if(!O)continue;const{mid:n,sender:a}=O,{track:q}=a;if(!q)continue;const{id:F,enabled:Z}=q,ee=mediaType_keys.findIndex(X=>X===I),te={type:ee,enabled:Z,trackName:`web-${ee}-${F}`,location:"local",mid:n};z.push(te)}return z});he(this,"addSenders",async(N=[])=>{N.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const z=[];for(const I of N){if(this.transceiverMap.get(I))continue;const n=this.getPhoneyStreams(I),[a]=n.getTracks(),q=this.peerIns.addTransceiver(a,{direction:"sendonly"});this.transceiverMap.set(I,q),z.push(I)}if(N.length===0||z.length!==0){const I=await this.peerIns.createOffer();if(this.options.debug){const O=libExports$1.parse(I.sdp),n=dt(O.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:n,sdpJson:O,description:I})}await this.peerIns.setLocalDescription(I)}return z});he(this,"removeSenders",async(N=[])=>{N.length===0&&(N=mediaType_keys);for(const z of N)this.transceiverMap.has(z)&&this.transceiverMap.delete(z)});he(this,"onSubscribeUserTracks",N=>{let z=0;return new Promise(async I=>{const O=[];for(const n of N){const{tracks:a=[]}=n;for(const q of a){const{trackName:F,mid:Z}=q,[ee]=await this.getUserTrackByTrackName([F]);O.push({...ee,mid:Z})}}{let n=[];const a=async()=>{clearTimeout(z);const F=new Map;for(const ee of n){const{userId:te,mediaType:X}=ee;if(!te||!X)continue;F.has(te)||F.set(te,{userId:te,tracks:[],updateStreams:{}});const ce=F.get(te);ce.tracks.push(ee),ce.updateStreams[X]=!0}const Z=[...F.values()];for(const ee of Z){const{userId:te,tracks:X}=ee;await this.updateUsertracks(te,X,!0)}await this.emitNotifyUpdateUsersStreams(Z),this.peerIns.removeEventListener("track",q);{const ee=Array.from(O,ne=>ne.trackName),te=Array.from(n,ne=>ne.trackName),X=ee.filter(ne=>!te.includes(ne));I({target:ee,success:te,fail:X})}},q=async F=>{const{streams:Z,transceiver:ee}=F,[te]=Z,{mid:X,receiver:ne}=ee,{track:ce}=ne,{id:oe}=ce,se=O.find(ae=>ae.mid===`${X}`);if(!se)return;const{userId:ye,mediaType:ke}=se;if(!(!ye||!ke)){{const ae={...se,mid:X,msid:oe};n.push(ae)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${n.length}/${O.length}`,{mediaType:ke,mid:X,userTrack:se,e:F});{const ae=new Audio;if(ae.srcObject=te,await this.initUserMediaStreamContext(ye,ke,te),ke==="microphoneCamera_audio"||ke==="screenSharing_audio"){const de=this.getUserAudioMediaStreamContext(ye,ke);de==null||de.setMute(!1)}}O.length===n.length&&a()}};this.peerIns.addEventListener("track",q),z=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${n.length}/${O.length})`),a()},5*1e3)}})});Oe(this,Qt,()=>{let N=0;const z=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.onconnectionstatechange=async I=>{const O=I.target.connectionState;switch(await this.taskQueue.setCondition("ice",!1),clearTimeout(N),O){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${O}`),await this.taskQueue.setCondition("ice",!0),this.setRoomState("connected");break;case"disconnected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`),N=window.setTimeout(z,30*1e3);break;case"failed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),this.setRoomState("failed");break;case"closed":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b60000;",`------->quickvo: connectionState:${O}`),z();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${O}`);break}}});he(this,"closeUserTracks",async(N,z=[],I=!1)=>{const O=[];for(const F of z){const{trackName:Z,msid:ee}=F;O.push(Z),ee&&O.push(ee)}const n=F=>O.includes(F),a=this.peerIns.getTransceivers();for(const F of a){const{mid:Z,sender:ee,receiver:te}=F;ee.track&&n(ee.track.id)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${Z} is stop.`,F)),te.track&&n(te.track.id)&&(F.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${Z} is stop.`,F))}const q=await this.getUser(N);if(q){for(const F of q.tracks){const{trackName:Z,msid:ee,userId:te,mediaType:X}=F;!te||!X||!n(Z)||(this.removeUserMediaStreamContext(te,X),ee&&delete F.msid)}if(I){const F=q.tracks.filter(({trackName:Z})=>!n(Z));await this.updateUsertracks(N,F,!1)}}});he(this,"createOffer",async()=>{const N=await this.peerIns.createOffer();if(this.options.debug){const z=libExports$1.parse(N.sdp),I=dt(z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:I,sdpJson:z,description:N})}await this.peerIns.setLocalDescription(N)});he(this,"createAnswer",async()=>{const N=await this.peerIns.createAnswer();if(this.options.debug){const z=libExports$1.parse(N.sdp),I=dt(z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:I,sdpJson:z,description:N})}await this.peerIns.setLocalDescription(N)});he(this,"getSdp",()=>{var N;return(N=this.peerIns.localDescription)==null?void 0:N.sdp});he(this,"setRemoteDescription",async N=>{if(this.options.debug){const z=libExports$1.parse(N.sdp),I=dt(z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:I,sdpJson:z,description:N})}return await this.peerIns.setRemoteDescription(N),N});he(this,"setCallStrategy",async(N,z=[])=>{z.length===0&&(z=mediaType_keys);let I="balanced";switch(N){case"qualityPriority":I="maintain-resolution";break;case"fluencyPriority":I="maintain-framerate";break;case"balancedDowngrade":I="balanced";break}const O=await this.getSelfInfo(),n=Array.from(O.tracks,({trackName:q})=>q),a=this.peerIns.getSenders();for(const q of a){const{track:F}=q;if(!F||!n.includes(F.id))continue;const Z=q.getParameters();q.setParameters({...Z,degradationPreference:I})}});he(this,"setRTCRtpSenderParameters",N=>{try{const z=this.peerIns.getSenders();for(const I of z){const O=I.getParameters();I.setParameters({...O,...N})}}catch(z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",z)}});he(this,"getReportsByMid",async(N=[])=>N.length===0?this.reports:this.reports.filter(z=>N.includes(z.mid)));he(this,"getRoomNetwork",()=>this.peerNetwork);he(this,"getPeerNetwork",()=>this.peerNetwork);Oe(this,Yt,async()=>{try{const N=await this.peerIns.getStats(),z=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],O=[...N.values()].filter(de=>z.includes(de.type));let n=0,a=0,q=0,F=0,Z=0,ee=0,te=[],X=[];for(const de of this.reports){const{packetsSent:_e,packetsLost:me}=de;_e&&(q+=_e),me&&(F+=me)}this.reports=O;for(const de of this.reports){const{bytesSent:_e,bytesReceived:me,packetsSent:ve,packetsLost:ge,roundTripTime:le,jitter:fe}=de;_e&&(a=_e),me&&(n=me),ve&&(Z+=ve),ge&&(ee+=ge),le&&te.push((le*100).toFixed(2)),fe&&X.push(fe.toFixed(2))}X.sort().reverse(),te.sort().reverse();const ne=Z-q,ce=ee-F,oe=ne===0?"0.00":(ce/ne).toFixed(2),[se="0"]=te,[ye="0"]=X,ke={outboundBytes:a,inboundBytes:n,lostRate:oe,roundTripTime:se,jitter:ye};this.peerNetwork=ke;const ae=(de,_e,me)=>{const ve=Number(de),ge=Number(_e),le=Number(me);let fe="0";return ve<.03&&ge<100&&le<.05?fe="5":ve<.06&&ge<160&&le<.1?fe="4":ve<.1&&ge<250&&le<.15?fe="3":ve<.15&&ge<400&&le<.2?fe="2":fe="1",Number(fe)};{const de=ae(oe,se,ye),_e=await this.getSelfInfo(),{network:me}=_e,ve={egress:de,ingress:de};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,ve),JSON.stringify(me)!==JSON.stringify(ve)){this.emitNotifyUpdateUsers();const{userId:fe,roomId:Se}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...ve,userId:fe,roomId:Se}},!1)}},3*1e3)}}catch(N){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",N)}});Oe(this,Xt,()=>{const N=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||pe(this,Yt).call(this)};this.getPeerStatsTimer=window.setInterval(N,1*1e3)});he(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}Qt=new WeakMap,Yt=new WeakMap,Xt=new WeakMap;class RoomCalls extends RoomPeer{constructor(N){super(N);Oe(this,At,0);he(this,"setLocalStream",(N,z)=>new Promise(async(I,O)=>{try{typeof N=="string"&&(N=[N]);for(const a of N)this.localStreamsActionMap.set(a,z);if(z){if(N.includes("microphoneCamera_audio")&&N.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):N.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):N.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):N.includes("screenSharing_audio")&&N.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):N.includes("screenSharing_audio")&&!N.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):N.includes("screenSharing_video")&&!N.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),N.includes("screenSharing_audio")){const a=await this.getLocalStream("screenSharing_audio");if(a){const q=a.getTracks();for(const F of q)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(N.includes("screenSharing_video")){const a=await this.getLocalStream("screenSharing_video");if(a){const q=a.getTracks();for(const F of q)F.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(N);const n=await this.getLocalStreams(N);this.cwsIns.emitNotify("onLocalStream",{code:200,data:n,desc:"local stream is change."}),I(n)}catch(n){O(n)}}));he(this,"setMediaDeviceKind",(N,z)=>new Promise(async(I,O)=>{this.setDeviceKind(N,z);const n=await this.getSelfInfo(),{id:a,tracks:q=[],callActionMap:F}=n,Z=[],ee=async te=>{const X=this.localStreamsActionMap.get(te),ne=q.find(oe=>oe.mediaType===te),ce=F[te];if(X){Z.push(te),await this.stopLocalStreams([te]);try{await this.initLocalStream(te)}catch(oe){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",oe),await this.inactiveTracks([te],!1),O(oe)}}if(ne){const oe=await this.getLocalStream(te);oe&&(await this.initUserMediaStreamContext(a,te,oe),ce&&await this.replaceSenderStream([te],!0))}{const oe=await this.getLocalStreams(Z);this.cwsIns.emitNotify("onLocalStream",{code:200,data:oe,desc:"local stream is change."}),await this.emitNotifyUpdateUsers(),I(!0)}};N==="audioinput"&&ee("microphoneCamera_audio"),N==="videoinput"&&ee("microphoneCamera_video"),N==="audiooutput"&&(this.changeAudiooutput(),I(!0))}));he(this,"changeScreenSharing",async N=>{const z=await this.getSelfInfo(),{tracks:I=[],callActionMap:O}=z;try{await this.setLocalStream(N,!0);for(const n of N)I.find(q=>q.mediaType===n&&O[n])&&await this.replaceSenderStream([n],!0)}catch(n){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",n)}});he(this,"createSession",()=>new Promise(async(N,z)=>{if(["connecting","connected"].includes(this.roomState))return N(!0);this.setRoomState("connecting"),await this.taskQueue.createTask({describe:"createSession",conditionKeys:["createWs","createSession"],changeConditionKeys:["createSession"],func:()=>new Promise(async(I,O)=>{try{await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async n=>{const{code:a=0,desc:q,data:F}=n;if(a!==200)return O(q);const{remoteSdp:Z}=F;await this.taskQueue.setCondition("ice",!1),await this.taskQueue.createTask({describe:"ice",timeout:30*1e3,conditionKeys:["ice"],func:()=>new Promise(ee=>setTimeout(()=>ee(!0),300)),success:async()=>{I(!0)},fail:async ee=>{throw new Error(`ice connection failed: ${ee}`)}}),await this.setRemoteDescription({type:"answer",sdp:Z})})}catch(n){O(n)}}),success:async I=>{N(I)},fail:async I=>{this.reportLogs("ws_c_timeout",I.message||I),z(I)},complete:()=>{this.taskQueue.setCondition("createSession",!0)}})}));he(this,"earlyConnect",(N=[])=>{this.isEarly=!0,pe(this,Lt).call(this),this.createSession(),N.length===0&&(N=["microphoneCamera_audio","microphoneCamera_video"]),pe(this,Ht).call(this,N)});he(this,"joinRoom",async N=>new Promise(async(z,I)=>{await this.taskQueue.createTask({describe:"joinRoom",conditionKeys:["createWs"],changeConditionKeys:["joinRoom"],func:()=>new Promise(async(O,n)=>{try{this.setOptions(N),await pe(this,Lt).call(this),this.clearUsers();const{roomId:a,userId:q,callType:F,sdkToken:Z}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:F,roomId:a,user:{id:q,tracks:[],callAction:0},token:Z},version:2}).then(async ee=>{const{code:te=0,desc:X="服务器繁忙",data:ne}=ee;if(te!==200)return n(X);const{roomId:ce="",roomUsers:oe=[]}=ne;if(ce!==a)return n("加入的房间不匹配");this.isInRoom=!0,this.initHeartbeat(),this.createSession(),await this.updateUsers(oe);const se=[];for(const ke of oe){const{id:ae,channelCache:de}=ke,{channels:_e=[]}=de;await this.updateUserBehaviors(ae,ke.behavior),await this.updateUserChannels(ae,_e,!1),_e.length!==0&&se.push({userId:ae,channels:_e})}this.subChannel(se),await this.emitNotifyUpdateUsers();const ye=await this.getUsers();O(ye)})}catch(a){n(a)}}),success:async O=>{z(O)},fail:async O=>{this.reportLogs("join_room_error",O.message||O),I(O)},complete:()=>{this.taskQueue.setCondition("joinRoom",!0)}})}));he(this,"quitRoom",()=>new Promise(async N=>{const{roomId:z,userId:I}=this.options,O={roomId:z,user:{id:I}};try{this.isInRoom=!1,clearInterval(pe(this,At)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(n){this.reportLogs("quit_room_error",n.message||n)}await new Promise(n=>setTimeout(()=>n(!0),300)),await this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:O}),N(!0)}));he(this,"quitRoomEx",()=>new Promise(async N=>{const{roomId:z,userId:I}=this.options,O={roomId:z,user:{id:I}};try{this.isInRoom=!1,this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(n){this.reportLogs("quit_room_error",n.message||n)}await new Promise(n=>setTimeout(()=>n(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:O}),N(!0)}));he(this,"syncRoomInfo",()=>new Promise(async(N,z)=>{const{userId:I}=this.options,O=await this.getUser(I),{id:n=I,callAction:a=0}=O;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:n,callAction:a}}}).then(async q=>{if(q.code!==200)return z(q.desc);const F=q.data.users;this.clearUsers(),await this.updateUsers(F),await this.updateUsertracks(O.id,O.tracks,!1);{const Z=await this.getUsers();N(Z)}}).catch(q=>z(q))}));he(this,"publish",N=>new Promise(async(z,I)=>{{const O=await this.getSelfInfo(),{banBehaviorMap:n}=O;let a=!0;for(const q of N)if(n[q]){a=!1;break}if(a===!1)return I("publish is error: prohibited by administrator.")}try{await this.setLocalStream(N,!0)}catch(O){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",O)}await this.taskQueue.createTask({describe:"publish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["publish"],func:()=>new Promise(async(O,n)=>{try{const a=await this.getSelfInfo(),q=[];for(const X of N){{const ne=this.getPhoneyStreams(X);await this.initUserMediaStreamContext(a.id,X,ne)}{const ne=await this.getLocalStream(X);ne?await this.initUserMediaStreamContext(a.id,X,ne):q.push(X)}}const F=N.filter(X=>!q.includes(X)||["microphoneCamera_audio","microphoneCamera_video"].includes(X));await this.replaceSenderStream(N,!1),await pe(this,Ht).call(this,F);const Z=await this.getSenderTracks(F),ee=[...a.tracks,...Z];await this.updateUsertracks(a.id,ee,!0);const te=await this.getCallAction(ee);await pe(this,Dt).call(this,te),q.length!==0&&await this.inactiveTracks(q,!1),F.length!==0&&await this.replaceSenderStream(F,!0),pe(this,ei).call(this,N);{await this.emitNotifyUpdateUsers();const X=await this.getSelfInfo();O(X)}}catch(a){n(a)}}),success:async O=>{z(O)},fail:async O=>{this.reportLogs("publish_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("publish",!0)}})}));he(this,"stopPublish",(N=[])=>new Promise(async(z,I)=>{await this.taskQueue.createTask({describe:"stopPublish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(O,n)=>{try{const a=await this.getSelfInfo();N.length===0&&(N=mediaType_keys);const q=a.tracks.filter(({mediaType:Z})=>Z&&N.includes(Z)),F=async()=>{this.initMediaPhoneyStreams(N);const Z=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),O(Z)};if(q.length===0)return F();await this.replaceSenderStream(N,!0),await this.closeUserTracks(a.id,q,!0),await this.removeSenders(N);{const Z=await this.getCallAction(a.tracks);await pe(this,Dt).call(this,Z)}await this.createOffer(),this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:q}}).then(async Z=>{const{code:ee=0,data:te,desc:X}=Z;if(ee!==200)return n(X);const{remoteSdp:ne}=te;await this.setRemoteDescription({type:"answer",sdp:ne}),F()})}catch(a){n(a)}}),success:async O=>{z(O)},fail:async O=>{this.reportLogs("close_track_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));he(this,"subscribe",(N=[],z=3)=>new Promise(async(I,O)=>{const n=await this.taskQueue.createTask({describe:"subscribe",strict:!0,conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["subscribe"],func:()=>new Promise(async(a,q)=>{try{const F=await this.getUsers();let Z=[];for(const X of F){const{isSelf:ne,tracks:ce=[]}=X;if(!ne){const oe=ce.filter(({trackName:se,mid:ye=""})=>ye!==""&&(N.includes(se)||N.length===0));oe.length!==0&&Z.push({...X,tracks:oe})}}const ee=async(X={})=>{const ne=Array.from(Z,({id:oe})=>oe),ce=await this.getUsers(ne);await this.emitNotifyUpdateUsers(),a({users:ce,detail:X})};if(Z.length===0)return ee();const te=[];for(const X of Z){const{id:ne,tracks:ce}=X,oe=dt(ce,["type","trackName"]),se={id:ne,tracks:oe};te.push(se)}this.cwsIns.sendMessage({event:"subscribe",data:{users:te}}).then(async X=>{const{code:ne=0,data:ce,desc:oe}=X;if(ne!==200)return q(oe);const{remoteSdp:se,users:ye=[]}=ce;this.onSubscribeUserTracks(ye).then(async ke=>{await this.renegotiate().then(()=>ee(ke)).catch(ae=>q(ae))}).catch(ke=>{q(ke)}),await this.setRemoteDescription({type:"offer",sdp:se})})}catch(F){q(F)}}),success:async a=>{n.clear(),this.taskQueue.setCondition("subscribe",!0),I(a)},fail:async a=>{if(this.options.debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: subscribe error. surplus count is ${z}`),z>0)return await new Promise(q=>setTimeout(()=>q(!0),(3-z)*1e3)),z=z-1,n.retry();n.clear(),this.reportLogs("subscribe_error",a.message||a),this.taskQueue.setCondition("subscribe",!0),O(a)},complete:async()=>{}})}));he(this,"renegotiate",()=>new Promise(async(N,z)=>{try{await this.taskQueue.setCondition("renegotiate",!1),await this.createAnswer(),this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(I=>{const{code:O=0,desc:n}=I;if(O!==200)return z(n);N(I)}).finally(()=>{this.taskQueue.setCondition("renegotiate",!0)})}catch(I){z(I)}}));he(this,"stopSubscribe",(N=[])=>new Promise(async(z,I)=>{await this.taskQueue.createTask({describe:"closeTrack",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(O,n)=>{try{const a=await this.getUsers(),q=[];for(const Z of a){const{tracks:ee=[]}=Z;for(const te of ee){const{type:X,mid:ne,trackName:ce,mediaType:oe,msid:se}=te;if(!(!oe||!se)&&(N.length===0||N.includes(ce))){const ye={type:X,mid:ne,trackName:se};q.push(ye),await this.closeUserTracks(Z.id,[te])}}}const F=async()=>{await this.emitNotifyUpdateUsers(),O(!0)};if(q.length===0)return F();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:q}}).then(async Z=>{const{remoteSdp:ee}=Z.data;await this.setRemoteDescription({type:"answer",sdp:ee})}),F()}catch(a){n(a)}}),success:async O=>{z(O)},fail:async O=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",O),this.reportLogs("close_track_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));he(this,"inactiveTracks",async(N,z)=>new Promise(async I=>{const O=await this.getSelfInfo();if(!O||!O.id)return I(!0);const{tracks:n=[]}=O,a=[...n];for(let F of a){const{mediaType:Z}=F;if(Z&&N.includes(Z)){F.enabled=z;const ee=await this.getLocalStream(Z);if(!ee)continue;const te=ee.getTracks();for(const X of te)X.enabled=z}}const q=await this.getCallAction(a);await pe(this,Dt).call(this,q),await this.replaceSenderStream(N,z),await this.emitNotifyUpdateUsers(),I(!0)}));he(this,"setBanBehaviors",N=>new Promise(async(z,I)=>{try{const{roomId:O}=this.options,n=[];for(const a of N){const{id:q,banBehaviors:F}=a,Z=Object.keys(F);if(Z.length===0)continue;const ee=[];for(const X of Z){const ne=mediaType_keys.findIndex(se=>se===X),ce=F[X],oe={type:ne,behavior:ce};ee.push(oe)}const te={id:q,behaviors:ee};n.push(te)}this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:O,users:n}}).then(async a=>{const{code:q=0,desc:F}=a;if(q!==200)return I(F);z(a)}).finally(()=>{})}catch(O){I(O)}}));he(this,"pubChannel",()=>new Promise(async(N,z)=>{const O=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:O}}).then(async n=>{const{code:a=0,data:q,desc:F}=n;if(a!==200)return z(F);const{channels:Z=[]}=q;for(const ee of Z){const{channels:te=[]}=ee;for(const X of te){const{dataChannelName:ne,id:ce}=X;this.initSendChannel(ne,ce)}}N(!0)}).catch(n=>{z(n)})}));he(this,"subChannel",(N=[])=>new Promise(async(z,I)=>{if(N.length===0)return z(!0);await this.taskQueue.createTask({describe:"subChannel",strict:!0,conditionKeys:["createWs","createSession","ice"],changeConditionKeys:[],func:()=>this.cwsIns.sendMessage({event:"subChannel",data:{channels:N}}).then(async O=>{const{code:n=0,data:a,desc:q}=O;if(n!==200)return I(q);const{channels:F=[]}=a;for(const Z of F){const{channels:ee=[]}=Z;for(const te of ee){const{dataChannelName:X,id:ne}=te;this.initReceiveChannel(X,ne)}}}),success:async O=>{z(O)},fail:async O=>{I(O)}})}));he(this,"debugger",()=>new Promise(async(N,z)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async I=>{if(I.code!==200)return z(I.desc);N(!0)}).catch(I=>{z(I)})}));he(this,"shutdown",()=>new Promise(async(N,z)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async I=>{if(I.code!==200)return z(I.desc);N(!0)}).catch(I=>{z(I)})}));he(this,"initHeartbeat",()=>{this.stopHeartbeat();const N=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),z=this.isInRoom?5*1e3:30*1e3;Ue(this,At,window.setInterval(N,z)),N()});he(this,"stopHeartbeat",()=>{clearInterval(pe(this,At))});Oe(this,ei,async N=>{const{roomId:z}=this.options;if(!z)return;const{id:I,tracks:O=[]}=await this.getSelfInfo(),n=O.filter(a=>a.mediaType&&N.includes(a.mediaType));n.length!==0&&this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:z,user:{id:I,tracks:n}}})});Oe(this,Dt,async N=>new Promise(async(z,I)=>{const{roomId:O,userId:n}=this.options,a={roomId:O,user:{id:n,callAction:N}};await this.cwsIns.sendMessage({event:"updateCall",data:a}).then(async q=>{const{code:F=0}=q;if(F!==200)return I(q);await this.updateUserCallAction(n,N),z(N)}).catch(q=>I(q))}));Oe(this,Lt,()=>new Promise(async(N,z)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return N(!0);await this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:I,roomId:O,userId:n}=this.options;if(!I)return z("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const a={c:I,r:O,v:this.sdk_service_version};if(this.isEarly){const F=xt();a.i=F,this.setOptions({earlyId:F})}else a.b=n;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",a);const q=btoa(encodeURI(JSON.stringify(a)));await this.cwsIns.connect(q),this.initHeartbeat(),await this.taskQueue.setCondition("createWs",!0),await this.taskQueue.setCondition("createSession",!0),N(!0)}catch(I){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",I),this.reportLogs("ws_c_timeout",I.message||I),z(I)}}));Oe(this,Ht,async N=>new Promise(async(z,I)=>{await this.taskQueue.createTask({describe:"createTrack",conditionKeys:["createWs","createSession","ice","createTrack","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(O,n)=>{try{await this.taskQueue.setCondition("createTrack",!1);const a=await this.addSenders(N),q=await this.getSenderTracks(a);if(q.length===0)return await this.taskQueue.setCondition("createTrack",!0),O(!0);this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:q,callAction:0}}).then(async F=>{const{code:Z=0,desc:ee,data:te}=F;if(Z!==200)return n(ee);const{remoteSdp:X}=te;await this.setRemoteDescription({type:"answer",sdp:X}),O(!0)})}catch(a){await this.removeSenders(N),n(a)}}),success:async O=>{z(O)},fail:async O=>{this.reportLogs("publish_error",O.message||O),I(O)},complete:async()=>{await this.taskQueue.setCondition("createTrack",!0)}})}))}}At=new WeakMap,ei=new WeakMap,Dt=new WeakMap,Lt=new WeakMap,Ht=new WeakMap;class Room extends RoomCalls{constructor(J){super(J)}}class QuickVO extends Room{constructor(N){super(N);Oe(this,It,new Map);he(this,"reconstruct",async()=>{if(this.cwsIns.state!=="connected"||this.roomState!=="failed")return;this.setRoomState("ready"),this.initMediaPhoneyStreams(),this.taskQueue.clear(),this.peerIns.close(),await this.syncRoomInfo(),this.initPeer(),this.taskQueue.setCondition("createSession",!0),this.taskQueue.setCondition("ice",!0),await this.createSession();const N=[],z=[],I=await this.getUsers();for(const O of I){const{isSelf:n,callActionMap:a,tracks:q=[]}=O;if(n)for(const F of mediaType_keys)a[F]&&N.push(F);for(const F of q)F.msid&&z.push(F.trackName)}await this.subscribe(z),await this.publish(N)});Oe(this,ti,()=>{{const N=async z=>{const{state:I}=z.data;if(I==="closed"){const{roomId:O,userId:n}=this.options,a={roomId:O,user:{id:n}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:a}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}this.reconstruct()};this.cwsIns.addNotify({event:"onRoomState",callback:N},!0)}{const N=async z=>{const{qualities:I=[]}=z.data,[O]=I;if(!(O&&O.userId===this.options.userId&&I.length===1)){for(const n of I){const{userId:a,egress:q,ingress:F}=n;this.checkUserInRoom(a)&&await this.updateUserNetwork(a,{egress:q,ingress:F})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:N},!0)}{const N=async z=>{const I=z.data.user;await this.updateUsers([I]),await this.updateUsertracks(I.id,I.track,!1),await this.updateUserBehaviors(I.id,I.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:N},!0)}{const N=async z=>{await this.removeUsers([z.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:N},!0)}{const N=async z=>{const{user:I}=z.data,{id:O,tracks:n=[],callAction:a=0}=I;if(await this.updateUserCallAction(O,a),await this.updateUserPermissions(O,3),await this.updateUsertracks(O,n,!0),this.options.newPublishAutoSubscribe){const q=this.getTrackNamesFormTracks(n);await this.subscribe(q)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:N},!0)}{const N=async z=>{const I=[z.data];this.subChannel(I)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:N},!0)}{const N=async z=>{const{id:I,tracks:O}=z.data.user;I!==this.options.userId&&(await this.closeUserTracks(I,O,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:N},!0)}{const N=async z=>{const{id:I,callAction:O}=z.data.user;this.checkUserInRoom(I)&&(await this.updateUserCallAction(I,O),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:N},!0)}{const N=async z=>{const{user:I}=z.data,{id:O,permissions:n=1}=I;n===1?await this.removeUsers([O]):n===3&&await this.updateUsers([I]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:N},!0)}{const N=async z=>{const{users:I}=z.data;for(const O of I){const{id:n,behavior:a}=O;await this.updateUserBehaviors(n,a)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:N},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async N=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});he(this,"addNotify",N=>this.cwsIns.addNotify(N));Oe(this,ii,()=>{});Oe(this,ni,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.reconstruct()}});Oe(this,ri,async()=>{this.setRoomState("closed")});he(this,"addRequestAnimationFrame",async(N,z)=>{{const O=pe(this,It).get(N);O&&cancelAnimationFrame(O)}const I=(O=Date.now())=>{z(O);const n=requestAnimationFrame(I);pe(this,It).set(N,n)};I()});he(this,"clearRequestAnimationFrame",async(N=[])=>{N.length===0&&(N=[...pe(this,It).keys()]);const z=[];for(const I of N){const O=pe(this,It).get(I);O&&(cancelAnimationFrame(O),z.push(O))}return z});he(this,"destroy",async()=>{this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 销毁SDK"),this.cwsIns.emitNotify("onDestroy",{code:200,data:{},desc:"sdk is destroy."}),this.stopLocalStreams(),await new Promise(N=>setTimeout(()=>N(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});pe(this,ii).call(this),pe(this,ni).call(this),pe(this,ri).call(this),pe(this,ti).call(this)}}It=new WeakMap,ti=new WeakMap,ii=new WeakMap,ni=new WeakMap,ri=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|