quickvo-sdk-js 0.9.9 → 1.0.1
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 +21098 -21038
- package/dist/index.umd.cjs +7 -7
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
(function(_t,yt){typeof exports=="object"&&typeof module<"u"?yt(exports):typeof define=="function"&&define.amd?define(["exports"],yt):(_t=typeof globalThis<"u"?globalThis:_t||self,yt(_t["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var rr=Object.defineProperty;var tr=_t=>{throw TypeError(_t)};var ir=(_t,yt,Pt)=>yt in _t?rr(_t,yt,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):_t[yt]=Pt;var Ie=(_t,yt,Pt)=>ir(_t,typeof yt!="symbol"?yt+"":yt,Pt),nr=(_t,yt,Pt)=>yt.has(_t)||tr("Cannot "+Pt);var Be=(_t,yt,Pt)=>(nr(_t,yt,"read from private field"),Pt?Pt.call(_t):yt.get(_t)),st=(_t,yt,Pt)=>yt.has(_t)?tr("Cannot add the same private member more than once"):yt instanceof WeakSet?yt.add(_t):yt.set(_t,Pt),At=(_t,yt,Pt,Wt)=>(nr(_t,yt,"write to private field"),Wt?Wt.call(_t,Pt):yt.set(_t,Pt),Pt);var _t,yt,Pt,Wt,Xt,Bn,Nn,Mn,In,qn,Pn,Un,en,yn,pn,xn,Rn,cn,un,vn,bn,Cn,kn,tn,jt,ln,fn,mn,Sn,Ln,Fn,Tn,Hn,jn,zn,Jn,On,Wn,En,An,$n,_n,Vn,Zn,Kn,Gn;const lt=(q,K={})=>{const F={unit:"B",splitStr:" ",...K};let{unit:Z,splitStr:D}=F;const N=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O=N.findIndex(J=>J===Z),I=N.slice(O+1,N.length);let z=q;for(const J of I)if(Z=J,z=z/1024,z<1024)break;return`${z.toFixed(2)}${D}${Z}`},P=(q,K=[])=>{const F={...q},Z=Object.keys(F);for(const D of Z)K.findIndex(N=>String(N)===D)===-1&&delete F[D];return F},pt=(q,K=[],F=!0)=>{const Z=new Map;for(const N of q){const O=[];for(const z of K)O.push(N[z]);const I=`map-${O.join("-")}`;if(!Z.has(I)){Z.set(I,N);continue}F&&Z.set(I,N)}const D=Z.entries();return Array.from(D,([N,O])=>O)},dt=(q,K=[])=>{const F=[];for(const Z of q){const D=P(Z,K);F.push(D)}return F},ht=(q,K="value",F="label")=>{const Z=[],D=Object.entries(q);for(const[N,O]of D){const I={[F]:O,[K]:N};Z.push(I)}return Z},v$1=(q=0,K=1)=>{const F=Math.max(0,q),Z=Math.max(1,K),D=Math.random()*(Z-F+1)+F;return parseInt(`${D}`,10)},xt=(q=16,K=16)=>{const F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),Z=Math.min(F.length,K),D=Date.now().toString(Z),N=D.split(""),O=Math.max(4,q-D.length);for(let I=0;I<O;I++){const z=v$1(0,Z-1),J=F[z];N.push(J)}return N.join("").toUpperCase()},W=(q,K)=>{try{let F=Number(q);if(isNaN(F)){const Z=new Date(`${q}`);if(`${Z}`=="Invalid Date")return 0;F=Z.getTime()}if(K!==void 0){const Z=new Date().getTimezoneOffset();F+=(Z+K)*60*1e3}return F}catch(F){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:q,_offset:K,error:F}),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=q=>W(q),E$1=(q,K="YYYY-MM-DD hh:mm:ss",F={})=>{const Z={empty_str:"-",...F},{empty_str:D,offset:N}=Z,O=W(q,N);if(Number(q)!==0&&O===0)return D;const I=new Date(O),z=`${I.getFullYear()}`,J=`${I.getMonth()+1}`,Q=`${I.getDate()}`,ne=`${I.getDay()===0?7:I.getDay()}`,re=`${I.getHours()}`,te=`${I.getMinutes()}`,oe=`${I.getSeconds()}`,le=`${Math.ceil((O-L(`${z}/01/01 00:00:00`)+1)/864e5)}`,ae=`${Math.ceil(((O-L(`${z}/01/01 00:00:00`))/864e5-Number(ne))/7)+1}`,ce=[{k:"Y+",v:z},{k:"M+",v:J},{k:"D+",v:Q},{k:"W+",v:ne},{k:"h+",v:re},{k:"m+",v:te},{k:"s+",v:oe},{k:"d+",v:le},{k:"w+",v:ae}];let de;for(let{k:we,v:fe}of ce)if(de=new RegExp(`(${we})`).exec(K),de){const ge=de[1];let me=fe.padStart(ge.length,"0");ge.includes("W")&&(me=_[me.slice(0,2)]),K=K.replace(ge,me)}return K},V=new Map,$t=(q,K,F)=>{const Z=new Date().getTime(),D=V.get(q)||0;Z-F>D&&(K(),V.set(q,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(q){return q&&q.__esModule&&Object.prototype.hasOwnProperty.call(q,"default")?q.default:q}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var q=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(K){return K.encoding?"rtpmap:%d %s/%s/%s":K.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(K){return K.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(K){return K.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(K){return"extmap:%d"+(K.direction?"/%s":"%v")+(K["encrypt-uri"]?" %s":"%v")+" %s"+(K.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(K){return K.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(K){var F="candidate:%s %d %s %d %s %d typ %s";return F+=K.raddr!=null?" raddr %s rport %d":"%v%v",F+=K.tcptype!=null?" tcptype %s":"%v",K.generation!=null&&(F+=" generation %d"),F+=K["network-id"]!=null?" network-id %d":"%v",F+=K["network-cost"]!=null?" network-cost %d":"%v",F}},{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(K){var F="ssrc:%d";return K.attribute!=null&&(F+=" %s",K.value!=null&&(F+=":%s")),F}},{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(K){return K.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(K){return K.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(K){return"imageattr:%s %s %s"+(K.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(K){return"simulcast:%s %s"+(K.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(K){return"ts-refclk:%s"+(K.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(K){var F="mediaclk:";return F+=K.id!=null?"id=%s %s":"%v%s",F+=K.mediaClockValue!=null?"=%s":"",F+=K.rateNumerator!=null?" rate=%s":"",F+=K.rateDenominator!=null?"/%s":"",F}},{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(q).forEach(function(K){var F=q[K];F.forEach(function(Z){Z.reg||(Z.reg=/(.*)/),Z.format||(Z.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(q){var K=function(I){return String(Number(I))===I?Number(I):I},F=function(I,z,J,Q){if(Q&&!J)z[Q]=K(I[1]);else for(var ne=0;ne<J.length;ne+=1)I[ne+1]!=null&&(z[J[ne]]=K(I[ne+1]))},Z=function(I,z,J){var Q=I.name&&I.names;I.push&&!z[I.push]?z[I.push]=[]:Q&&!z[I.name]&&(z[I.name]={});var ne=I.push?{}:Q?z[I.name]:z;F(J.match(I.reg),ne,I.names,I.name),I.push&&z[I.push].push(ne)},D=requireGrammar(),N=RegExp.prototype.test.bind(/^([a-z])=(.*)/);q.parse=function(I){var z={},J=[],Q=z;return I.split(/(\r\n|\r|\n)/).filter(N).forEach(function(ne){var re=ne[0],te=ne.slice(2);re==="m"&&(J.push({rtp:[],fmtp:[]}),Q=J[J.length-1]);for(var oe=0;oe<(D[re]||[]).length;oe+=1){var le=D[re][oe];if(le.reg.test(te))return Z(le,Q,te)}}),z.media=J,z};var O=function(I,z){var J=z.split(/=(.+)/,2);return J.length===2?I[J[0]]=K(J[1]):J.length===1&&z.length>1&&(I[J[0]]=void 0),I};q.parseParams=function(I){return I.split(/;\s?/).reduce(O,{})},q.parseFmtpConfig=q.parseParams,q.parsePayloads=function(I){return I.toString().split(" ").map(Number)},q.parseRemoteCandidates=function(I){for(var z=[],J=I.split(" ").map(K),Q=0;Q<J.length;Q+=3)z.push({component:J[Q],ip:J[Q+1],port:J[Q+2]});return z},q.parseImageAttributes=function(I){return I.split(" ").map(function(z){return z.substring(1,z.length-1).split(",").reduce(O,{})})},q.parseSimulcastStreamList=function(I){return I.split(";").map(function(z){return z.split(",").map(function(J){var Q,ne=!1;return J[0]!=="~"?Q=K(J):(Q=K(J.substring(1,J.length)),ne=!0),{scid:Q,paused:ne}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var q=requireGrammar(),K=/%[sdv%]/g,F=function(O){var I=1,z=arguments,J=z.length;return O.replace(K,function(Q){if(I>=J)return Q;var ne=z[I];switch(I+=1,Q){case"%%":return"%";case"%s":return String(ne);case"%d":return Number(ne);case"%v":return""}})},Z=function(O,I,z){var J=I.format instanceof Function?I.format(I.push?z:z[I.name]):I.format,Q=[O+"="+J];if(I.names)for(var ne=0;ne<I.names.length;ne+=1){var re=I.names[ne];I.name?Q.push(z[I.name][re]):Q.push(z[I.names[ne]])}else Q.push(z[I.name]);return F.apply(null,Q)},D=["v","o","s","i","u","e","p","c","b","t","r","z","a"],N=["i","c","b","a"];return writer$1=function(O,I){I=I||{},O.version==null&&(O.version=0),O.name==null&&(O.name=" "),O.media.forEach(function(ne){ne.payloads==null&&(ne.payloads="")});var z=I.outerOrder||D,J=I.innerOrder||N,Q=[];return z.forEach(function(ne){q[ne].forEach(function(re){re.name in O&&O[re.name]!=null?Q.push(Z(ne,re,O)):re.push in O&&O[re.push]!=null&&O[re.push].forEach(function(te){Q.push(Z(ne,re,te))})})}),O.media.forEach(function(ne){Q.push(Z("m",q.m[0],ne)),J.forEach(function(re){q[re].forEach(function(te){te.name in ne&&ne[te.name]!=null?Q.push(Z(re,te,ne)):te.push in ne&&ne[te.push]!=null&&ne[te.push].forEach(function(oe){Q.push(Z(re,te,oe))})})})}),Q.join(`\r
|
|
1
|
+
(function(_t,yt){typeof exports=="object"&&typeof module<"u"?yt(exports):typeof define=="function"&&define.amd?define(["exports"],yt):(_t=typeof globalThis<"u"?globalThis:_t||self,yt(_t["snqu-calls-sdk-js"]={}))})(this,function(exports){"use strict";var rr=Object.defineProperty;var tr=_t=>{throw TypeError(_t)};var ir=(_t,yt,Pt)=>yt in _t?rr(_t,yt,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):_t[yt]=Pt;var Ie=(_t,yt,Pt)=>ir(_t,typeof yt!="symbol"?yt+"":yt,Pt),nr=(_t,yt,Pt)=>yt.has(_t)||tr("Cannot "+Pt);var Be=(_t,yt,Pt)=>(nr(_t,yt,"read from private field"),Pt?Pt.call(_t):yt.get(_t)),st=(_t,yt,Pt)=>yt.has(_t)?tr("Cannot add the same private member more than once"):yt instanceof WeakSet?yt.add(_t):yt.set(_t,Pt),At=(_t,yt,Pt,Wt)=>(nr(_t,yt,"write to private field"),Wt?Wt.call(_t,Pt):yt.set(_t,Pt),Pt);var _t,yt,Pt,Wt,Xt,Bn,Nn,Mn,In,qn,Pn,Un,en,yn,pn,xn,Cn,cn,un,vn,bn,Rn,kn,tn,jt,ln,fn,mn,Sn,Ln,Fn,Tn,Hn,jn,zn,Jn,On,Wn,En,An,$n,_n,Vn,Zn,Kn,Gn;const lt=(q,K={})=>{const F={unit:"B",splitStr:" ",...K};let{unit:Z,splitStr:D}=F;const N=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],O=N.findIndex(J=>J===Z),I=N.slice(O+1,N.length);let z=q;for(const J of I)if(Z=J,z=z/1024,z<1024)break;return`${z.toFixed(2)}${D}${Z}`},P=(q,K=[])=>{const F={...q},Z=Object.keys(F);for(const D of Z)K.findIndex(N=>String(N)===D)===-1&&delete F[D];return F},pt=(q,K=[],F=!0)=>{const Z=new Map;for(const N of q){const O=[];for(const z of K)O.push(N[z]);const I=`map-${O.join("-")}`;if(!Z.has(I)){Z.set(I,N);continue}F&&Z.set(I,N)}const D=Z.entries();return Array.from(D,([N,O])=>O)},dt=(q,K=[])=>{const F=[];for(const Z of q){const D=P(Z,K);F.push(D)}return F},ht=(q,K="value",F="label")=>{const Z=[],D=Object.entries(q);for(const[N,O]of D){const I={[F]:O,[K]:N};Z.push(I)}return Z},v$1=(q=0,K=1)=>{const F=Math.max(0,q),Z=Math.max(1,K),D=Math.random()*(Z-F+1)+F;return parseInt(`${D}`,10)},xt=(q=16,K=16)=>{const F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),Z=Math.min(F.length,K),D=Date.now().toString(Z),N=D.split(""),O=Math.max(4,q-D.length);for(let I=0;I<O;I++){const z=v$1(0,Z-1),J=F[z];N.push(J)}return N.join("").toUpperCase()},W=(q,K)=>{try{let F=Number(q);if(isNaN(F)){const Z=new Date(`${q}`);if(`${Z}`=="Invalid Date")return 0;F=Z.getTime()}if(K!==void 0){const Z=new Date().getTimezoneOffset();F+=(Z+K)*60*1e3}return F}catch(F){return console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;","------->timeStamp:err",{_val:q,_offset:K,error:F}),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=q=>W(q),E$1=(q,K="YYYY-MM-DD hh:mm:ss",F={})=>{const Z={empty_str:"-",...F},{empty_str:D,offset:N}=Z,O=W(q,N);if(Number(q)!==0&&O===0)return D;const I=new Date(O),z=`${I.getFullYear()}`,J=`${I.getMonth()+1}`,Q=`${I.getDate()}`,ne=`${I.getDay()===0?7:I.getDay()}`,re=`${I.getHours()}`,te=`${I.getMinutes()}`,oe=`${I.getSeconds()}`,le=`${Math.ceil((O-L(`${z}/01/01 00:00:00`)+1)/864e5)}`,ae=`${Math.ceil(((O-L(`${z}/01/01 00:00:00`))/864e5-Number(ne))/7)+1}`,ce=[{k:"Y+",v:z},{k:"M+",v:J},{k:"D+",v:Q},{k:"W+",v:ne},{k:"h+",v:re},{k:"m+",v:te},{k:"s+",v:oe},{k:"d+",v:le},{k:"w+",v:ae}];let de;for(let{k:we,v:fe}of ce)if(de=new RegExp(`(${we})`).exec(K),de){const ge=de[1];let me=fe.padStart(ge.length,"0");ge.includes("W")&&(me=_[me.slice(0,2)]),K=K.replace(ge,me)}return K},V=new Map,$t=(q,K,F)=>{const Z=new Date().getTime(),D=V.get(q)||0;Z-F>D&&(K(),V.set(q,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(q){return q&&q.__esModule&&Object.prototype.hasOwnProperty.call(q,"default")?q.default:q}var lib$1={},parser={},grammar={exports:{}},hasRequiredGrammar;function requireGrammar(){if(hasRequiredGrammar)return grammar.exports;hasRequiredGrammar=1;var q=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(K){return K.encoding?"rtpmap:%d %s/%s/%s":K.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(K){return K.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(K){return K.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(K){return"extmap:%d"+(K.direction?"/%s":"%v")+(K["encrypt-uri"]?" %s":"%v")+" %s"+(K.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(K){return K.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(K){var F="candidate:%s %d %s %d %s %d typ %s";return F+=K.raddr!=null?" raddr %s rport %d":"%v%v",F+=K.tcptype!=null?" tcptype %s":"%v",K.generation!=null&&(F+=" generation %d"),F+=K["network-id"]!=null?" network-id %d":"%v",F+=K["network-cost"]!=null?" network-cost %d":"%v",F}},{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(K){var F="ssrc:%d";return K.attribute!=null&&(F+=" %s",K.value!=null&&(F+=":%s")),F}},{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(K){return K.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(K){return K.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(K){return"imageattr:%s %s %s"+(K.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(K){return"simulcast:%s %s"+(K.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(K){return"ts-refclk:%s"+(K.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(K){var F="mediaclk:";return F+=K.id!=null?"id=%s %s":"%v%s",F+=K.mediaClockValue!=null?"=%s":"",F+=K.rateNumerator!=null?" rate=%s":"",F+=K.rateDenominator!=null?"/%s":"",F}},{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(q).forEach(function(K){var F=q[K];F.forEach(function(Z){Z.reg||(Z.reg=/(.*)/),Z.format||(Z.format="%s")})}),grammar.exports}var hasRequiredParser;function requireParser(){return hasRequiredParser||(hasRequiredParser=1,function(q){var K=function(I){return String(Number(I))===I?Number(I):I},F=function(I,z,J,Q){if(Q&&!J)z[Q]=K(I[1]);else for(var ne=0;ne<J.length;ne+=1)I[ne+1]!=null&&(z[J[ne]]=K(I[ne+1]))},Z=function(I,z,J){var Q=I.name&&I.names;I.push&&!z[I.push]?z[I.push]=[]:Q&&!z[I.name]&&(z[I.name]={});var ne=I.push?{}:Q?z[I.name]:z;F(J.match(I.reg),ne,I.names,I.name),I.push&&z[I.push].push(ne)},D=requireGrammar(),N=RegExp.prototype.test.bind(/^([a-z])=(.*)/);q.parse=function(I){var z={},J=[],Q=z;return I.split(/(\r\n|\r|\n)/).filter(N).forEach(function(ne){var re=ne[0],te=ne.slice(2);re==="m"&&(J.push({rtp:[],fmtp:[]}),Q=J[J.length-1]);for(var oe=0;oe<(D[re]||[]).length;oe+=1){var le=D[re][oe];if(le.reg.test(te))return Z(le,Q,te)}}),z.media=J,z};var O=function(I,z){var J=z.split(/=(.+)/,2);return J.length===2?I[J[0]]=K(J[1]):J.length===1&&z.length>1&&(I[J[0]]=void 0),I};q.parseParams=function(I){return I.split(/;\s?/).reduce(O,{})},q.parseFmtpConfig=q.parseParams,q.parsePayloads=function(I){return I.toString().split(" ").map(Number)},q.parseRemoteCandidates=function(I){for(var z=[],J=I.split(" ").map(K),Q=0;Q<J.length;Q+=3)z.push({component:J[Q],ip:J[Q+1],port:J[Q+2]});return z},q.parseImageAttributes=function(I){return I.split(" ").map(function(z){return z.substring(1,z.length-1).split(",").reduce(O,{})})},q.parseSimulcastStreamList=function(I){return I.split(";").map(function(z){return z.split(",").map(function(J){var Q,ne=!1;return J[0]!=="~"?Q=K(J):(Q=K(J.substring(1,J.length)),ne=!0),{scid:Q,paused:ne}})})}}(parser)),parser}var writer$1,hasRequiredWriter$1;function requireWriter$1(){if(hasRequiredWriter$1)return writer$1;hasRequiredWriter$1=1;var q=requireGrammar(),K=/%[sdv%]/g,F=function(O){var I=1,z=arguments,J=z.length;return O.replace(K,function(Q){if(I>=J)return Q;var ne=z[I];switch(I+=1,Q){case"%%":return"%";case"%s":return String(ne);case"%d":return Number(ne);case"%v":return""}})},Z=function(O,I,z){var J=I.format instanceof Function?I.format(I.push?z:z[I.name]):I.format,Q=[O+"="+J];if(I.names)for(var ne=0;ne<I.names.length;ne+=1){var re=I.names[ne];I.name?Q.push(z[I.name][re]):Q.push(z[I.names[ne]])}else Q.push(z[I.name]);return F.apply(null,Q)},D=["v","o","s","i","u","e","p","c","b","t","r","z","a"],N=["i","c","b","a"];return writer$1=function(O,I){I=I||{},O.version==null&&(O.version=0),O.name==null&&(O.name=" "),O.media.forEach(function(ne){ne.payloads==null&&(ne.payloads="")});var z=I.outerOrder||D,J=I.innerOrder||N,Q=[];return z.forEach(function(ne){q[ne].forEach(function(re){re.name in O&&O[re.name]!=null?Q.push(Z(ne,re,O)):re.push in O&&O[re.push]!=null&&O[re.push].forEach(function(te){Q.push(Z(ne,re,te))})})}),O.media.forEach(function(ne){Q.push(Z("m",q.m[0],ne)),J.forEach(function(re){q[re].forEach(function(te){te.name in ne&&ne[te.name]!=null?Q.push(Z(re,te,ne)):te.push in ne&&ne[te.push]!=null&&ne[te.push].forEach(function(oe){Q.push(Z(re,te,oe))})})})}),Q.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
|
-
`},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var q=requireParser(),K=requireWriter$1(),F=requireGrammar();return lib$1.grammar=F,lib$1.write=K,lib$1.parse=q.parse,lib$1.parseParams=q.parseParams,lib$1.parseFmtpConfig=q.parseFmtpConfig,lib$1.parsePayloads=q.parsePayloads,lib$1.parseRemoteCandidates=q.parseRemoteCandidates,lib$1.parseImageAttributes=q.parseImageAttributes,lib$1.parseSimulcastStreamList=q.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(K){Ie(this,"kind","video");Ie(this,"stream",new MediaStream);Ie(this,"stop",()=>{const K=this.stream.getTracks();for(const F of K)F.stop(),this.stream.removeTrack(F)});Ie(this,"replaceStream",K=>{const F=this.stream,Z=F.getTracks();for(const N of Z)F.removeTrack(N);const[D]=K.getVideoTracks();D&&F.addTrack(D)});Ie(this,"getStream",()=>this.stream);Ie(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(K)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C$1=Object.defineProperty,R=q=>{throw TypeError(q)},S=(q,K,F)=>K in q?C$1(q,K,{enumerable:!0,configurable:!0,writable:!0,value:F}):q[K]=F,l=(q,K,F)=>S(q,typeof K!="symbol"?K+"":K,F),v=(q,K,F)=>K.has(q)||R("Cannot "+F),t$2=(q,K,F)=>(v(q,K,"read from private field"),F?F.call(q):K.get(q)),c$1=(q,K,F)=>K.has(q)?R("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(q):K.set(q,F),i=(q,K,F,Z)=>(v(q,K,"write to private field"),K.set(q,F),F),s,r$2,h,p,m$2,f,w,x,g$2,b,B$1,y,T,d$1;class M{constructor(K){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:F=>!0,onReconnectSuccess:async F=>{},onReconnectStop:async F=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:F=>{}}),l(this,"ws"),c$1(this,r$2,-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,F=>{}),l(this,"close",async(F=1e3,Z="correctly close.")=>{var D;this.ws&&(i(this,f,!0),t$2(this,d$1).call(this),(D=this.ws)==null||D.close(F,Z))}),l(this,"connect",()=>new Promise(async F=>{i(this,w,F),this.ws=new WebSocket(t$2(this,s).url),this.ws.binaryType=t$2(this,s).binaryType,this.ws.onopen=t$2(this,b),this.ws.onmessage=t$2(this,g$2),this.ws.onerror=t$2(this,B$1),this.ws.onclose=t$2(this,y)})),l(this,"reconnect",async F=>new Promise(Z=>{t$2(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 D=N=>{t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${N}`),t$2(this,s).onReconnectStop({msg:N}),Z(N)};if(t$2(this,x).call(this)===!1)return D("stop reconnect. exceed maxReconnectionTime.");if(t$2(this,r$2)!==-1&&t$2(this,r$2)===0)return D("stop reconnect. surplusReconnectCount is 0.");if(!t$2(this,s).checkReconnect(F))return D("stop reconnect. checkReconnect is false.");t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t$2(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t$2(this,r$2)}`,F),i(this,p,setTimeout(async()=>{i(this,r$2,Math.max(-1,t$2(this,r$2)-1)),await this.connect();try{await t$2(this,s).onReconnectSuccess(this.ws)}catch(N){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",N)}Z(!0)},t$2(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async F=>{var Z;(!this.ws||this.ws.readyState!==1)&&(t$2(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$2(this,s).sendBeforAutoConnect&&(t$2(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(F)}),c$1(this,x,()=>{const F=Date.now();return t$2(this,h)===-1&&i(this,h,F+t$2(this,s).reconnectTime),!(F>t$2(this,h))}),c$1(this,g$2,F=>{const{data:Z}=F;t$2(this,s).onMessage(Z)}),c$1(this,b,()=>{t$2(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$2,t$2(this,s).reconnectCount),i(this,h,-1),t$2(this,T).call(this),t$2(this,w).call(this,this.ws)}),c$1(this,B$1,F=>{t$2(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.",F)}),c$1(this,y,F=>{if(t$2(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: ${F.code}, permanentClosed is ${t$2(this,f)}.`,F),t$2(this,d$1).call(this),!t$2(this,f))return this.reconnect(F);this.ws=void 0}),c$1(this,T,()=>{i(this,m$2,setInterval(()=>{const F=t$2(this,s).getHeartbeatMsg();F&&this.sendMessage(F)},t$2(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t$2(this,p)),clearInterval(t$2(this,m$2))}),i(this,s,{...t$2(this,s),...K}),i(this,r$2,t$2(this,s).reconnectCount)}}s=new WeakMap,r$2=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=q;function q(K,F){for(var Z=new Array(arguments.length-1),D=0,N=2,O=!0;N<arguments.length;)Z[D++]=arguments[N++];return new Promise(function(z,J){Z[D]=function(ne){if(O)if(O=!1,ne)J(ne);else{for(var re=new Array(arguments.length-1),te=0;te<re.length;)re[te++]=arguments[te];z.apply(null,re)}};try{K.apply(F||null,Z)}catch(Q){O&&(O=!1,J(Q))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(q){var K=q;K.length=function(I){var z=I.length;if(!z)return 0;for(var J=0;--z%4>1&&I.charAt(z)==="=";)++J;return Math.ceil(I.length*3)/4-J};for(var F=new Array(64),Z=new Array(123),D=0;D<64;)Z[F[D]=D<26?D+65:D<52?D+71:D<62?D-4:D-59|43]=D++;K.encode=function(I,z,J){for(var Q=null,ne=[],re=0,te=0,oe;z<J;){var le=I[z++];switch(te){case 0:ne[re++]=F[le>>2],oe=(le&3)<<4,te=1;break;case 1:ne[re++]=F[oe|le>>4],oe=(le&15)<<2,te=2;break;case 2:ne[re++]=F[oe|le>>6],ne[re++]=F[le&63],te=0;break}re>8191&&((Q||(Q=[])).push(String.fromCharCode.apply(String,ne)),re=0)}return te&&(ne[re++]=F[oe],ne[re++]=61,te===1&&(ne[re++]=61)),Q?(re&&Q.push(String.fromCharCode.apply(String,ne.slice(0,re))),Q.join("")):String.fromCharCode.apply(String,ne.slice(0,re))};var N="invalid encoding";K.decode=function(I,z,J){for(var Q=J,ne=0,re,te=0;te<I.length;){var oe=I.charCodeAt(te++);if(oe===61&&ne>1)break;if((oe=Z[oe])===void 0)throw Error(N);switch(ne){case 0:re=oe,ne=1;break;case 1:z[J++]=re<<2|(oe&48)>>4,re=oe,ne=2;break;case 2:z[J++]=(re&15)<<4|(oe&60)>>2,re=oe,ne=3;break;case 3:z[J++]=(re&3)<<6|oe,ne=0;break}}if(ne===1)throw Error(N);return J-Q},K.test=function(I){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(I)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=q;function q(){this._listeners={}}return q.prototype.on=function(F,Z,D){return(this._listeners[F]||(this._listeners[F]=[])).push({fn:Z,ctx:D||this}),this},q.prototype.off=function(F,Z){if(F===void 0)this._listeners={};else if(Z===void 0)this._listeners[F]=[];else for(var D=this._listeners[F],N=0;N<D.length;)D[N].fn===Z?D.splice(N,1):++N;return this},q.prototype.emit=function(F){var Z=this._listeners[F];if(Z){for(var D=[],N=1;N<arguments.length;)D.push(arguments[N++]);for(N=0;N<Z.length;)Z[N].fn.apply(Z[N++].ctx,D)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=q(q);function q(N){return typeof Float32Array<"u"?function(){var O=new Float32Array([-0]),I=new Uint8Array(O.buffer),z=I[3]===128;function J(te,oe,le){O[0]=te,oe[le]=I[0],oe[le+1]=I[1],oe[le+2]=I[2],oe[le+3]=I[3]}function Q(te,oe,le){O[0]=te,oe[le]=I[3],oe[le+1]=I[2],oe[le+2]=I[1],oe[le+3]=I[0]}N.writeFloatLE=z?J:Q,N.writeFloatBE=z?Q:J;function ne(te,oe){return I[0]=te[oe],I[1]=te[oe+1],I[2]=te[oe+2],I[3]=te[oe+3],O[0]}function re(te,oe){return I[3]=te[oe],I[2]=te[oe+1],I[1]=te[oe+2],I[0]=te[oe+3],O[0]}N.readFloatLE=z?ne:re,N.readFloatBE=z?re:ne}():function(){function O(z,J,Q,ne){var re=J<0?1:0;if(re&&(J=-J),J===0)z(1/J>0?0:2147483648,Q,ne);else if(isNaN(J))z(2143289344,Q,ne);else if(J>34028234663852886e22)z((re<<31|2139095040)>>>0,Q,ne);else if(J<11754943508222875e-54)z((re<<31|Math.round(J/1401298464324817e-60))>>>0,Q,ne);else{var te=Math.floor(Math.log(J)/Math.LN2),oe=Math.round(J*Math.pow(2,-te)*8388608)&8388607;z((re<<31|te+127<<23|oe)>>>0,Q,ne)}}N.writeFloatLE=O.bind(null,K),N.writeFloatBE=O.bind(null,F);function I(z,J,Q){var ne=z(J,Q),re=(ne>>31)*2+1,te=ne>>>23&255,oe=ne&8388607;return te===255?oe?NaN:re*(1/0):te===0?re*1401298464324817e-60*oe:re*Math.pow(2,te-150)*(oe+8388608)}N.readFloatLE=I.bind(null,Z),N.readFloatBE=I.bind(null,D)}(),typeof Float64Array<"u"?function(){var O=new Float64Array([-0]),I=new Uint8Array(O.buffer),z=I[7]===128;function J(te,oe,le){O[0]=te,oe[le]=I[0],oe[le+1]=I[1],oe[le+2]=I[2],oe[le+3]=I[3],oe[le+4]=I[4],oe[le+5]=I[5],oe[le+6]=I[6],oe[le+7]=I[7]}function Q(te,oe,le){O[0]=te,oe[le]=I[7],oe[le+1]=I[6],oe[le+2]=I[5],oe[le+3]=I[4],oe[le+4]=I[3],oe[le+5]=I[2],oe[le+6]=I[1],oe[le+7]=I[0]}N.writeDoubleLE=z?J:Q,N.writeDoubleBE=z?Q:J;function ne(te,oe){return I[0]=te[oe],I[1]=te[oe+1],I[2]=te[oe+2],I[3]=te[oe+3],I[4]=te[oe+4],I[5]=te[oe+5],I[6]=te[oe+6],I[7]=te[oe+7],O[0]}function re(te,oe){return I[7]=te[oe],I[6]=te[oe+1],I[5]=te[oe+2],I[4]=te[oe+3],I[3]=te[oe+4],I[2]=te[oe+5],I[1]=te[oe+6],I[0]=te[oe+7],O[0]}N.readDoubleLE=z?ne:re,N.readDoubleBE=z?re:ne}():function(){function O(z,J,Q,ne,re,te){var oe=ne<0?1:0;if(oe&&(ne=-ne),ne===0)z(0,re,te+J),z(1/ne>0?0:2147483648,re,te+Q);else if(isNaN(ne))z(0,re,te+J),z(2146959360,re,te+Q);else if(ne>17976931348623157e292)z(0,re,te+J),z((oe<<31|2146435072)>>>0,re,te+Q);else{var le;if(ne<22250738585072014e-324)le=ne/5e-324,z(le>>>0,re,te+J),z((oe<<31|le/4294967296)>>>0,re,te+Q);else{var ae=Math.floor(Math.log(ne)/Math.LN2);ae===1024&&(ae=1023),le=ne*Math.pow(2,-ae),z(le*4503599627370496>>>0,re,te+J),z((oe<<31|ae+1023<<20|le*1048576&1048575)>>>0,re,te+Q)}}}N.writeDoubleLE=O.bind(null,K,0,4),N.writeDoubleBE=O.bind(null,F,4,0);function I(z,J,Q,ne,re){var te=z(ne,re+J),oe=z(ne,re+Q),le=(oe>>31)*2+1,ae=oe>>>20&2047,ce=4294967296*(oe&1048575)+te;return ae===2047?ce?NaN:le*(1/0):ae===0?le*5e-324*ce:le*Math.pow(2,ae-1075)*(ce+4503599627370496)}N.readDoubleLE=I.bind(null,Z,0,4),N.readDoubleBE=I.bind(null,D,4,0)}(),N}function K(N,O,I){O[I]=N&255,O[I+1]=N>>>8&255,O[I+2]=N>>>16&255,O[I+3]=N>>>24}function F(N,O,I){O[I]=N>>>24,O[I+1]=N>>>16&255,O[I+2]=N>>>8&255,O[I+3]=N&255}function Z(N,O){return(N[O]|N[O+1]<<8|N[O+2]<<16|N[O+3]<<24)>>>0}function D(N,O){return(N[O]<<24|N[O+1]<<16|N[O+2]<<8|N[O+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(q){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(q){var K=q;K.length=function(Z){for(var D=0,N=0,O=0;O<Z.length;++O)N=Z.charCodeAt(O),N<128?D+=1:N<2048?D+=2:(N&64512)===55296&&(Z.charCodeAt(O+1)&64512)===56320?(++O,D+=4):D+=3;return D},K.read=function(Z,D,N){var O=N-D;if(O<1)return"";for(var I=null,z=[],J=0,Q;D<N;)Q=Z[D++],Q<128?z[J++]=Q:Q>191&&Q<224?z[J++]=(Q&31)<<6|Z[D++]&63:Q>239&&Q<365?(Q=((Q&7)<<18|(Z[D++]&63)<<12|(Z[D++]&63)<<6|Z[D++]&63)-65536,z[J++]=55296+(Q>>10),z[J++]=56320+(Q&1023)):z[J++]=(Q&15)<<12|(Z[D++]&63)<<6|Z[D++]&63,J>8191&&((I||(I=[])).push(String.fromCharCode.apply(String,z)),J=0);return I?(J&&I.push(String.fromCharCode.apply(String,z.slice(0,J))),I.join("")):String.fromCharCode.apply(String,z.slice(0,J))},K.write=function(Z,D,N){for(var O=N,I,z,J=0;J<Z.length;++J)I=Z.charCodeAt(J),I<128?D[N++]=I:I<2048?(D[N++]=I>>6|192,D[N++]=I&63|128):(I&64512)===55296&&((z=Z.charCodeAt(J+1))&64512)===56320?(I=65536+((I&1023)<<10)+(z&1023),++J,D[N++]=I>>18|240,D[N++]=I>>12&63|128,D[N++]=I>>6&63|128,D[N++]=I&63|128):(D[N++]=I>>12|224,D[N++]=I>>6&63|128,D[N++]=I&63|128);return N-O}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=q;function q(K,F,Z){var D=Z||8192,N=D>>>1,O=null,I=D;return function(J){if(J<1||J>N)return K(J);I+J>D&&(O=K(D),I=0);var Q=F.call(O,I,I+=J);return I&7&&(I=(I|7)+1),Q}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=K;var q=requireMinimal$1();function K(N,O){this.lo=N>>>0,this.hi=O>>>0}var F=K.zero=new K(0,0);F.toNumber=function(){return 0},F.zzEncode=F.zzDecode=function(){return this},F.length=function(){return 1};var Z=K.zeroHash="\0\0\0\0\0\0\0\0";K.fromNumber=function(O){if(O===0)return F;var I=O<0;I&&(O=-O);var z=O>>>0,J=(O-z)/4294967296>>>0;return I&&(J=~J>>>0,z=~z>>>0,++z>4294967295&&(z=0,++J>4294967295&&(J=0))),new K(z,J)},K.from=function(O){if(typeof O=="number")return K.fromNumber(O);if(q.isString(O))if(q.Long)O=q.Long.fromString(O);else return K.fromNumber(parseInt(O,10));return O.low||O.high?new K(O.low>>>0,O.high>>>0):F},K.prototype.toNumber=function(O){if(!O&&this.hi>>>31){var I=~this.lo+1>>>0,z=~this.hi>>>0;return I||(z=z+1>>>0),-(I+z*4294967296)}return this.lo+this.hi*4294967296},K.prototype.toLong=function(O){return q.Long?new q.Long(this.lo|0,this.hi|0,!!O):{low:this.lo|0,high:this.hi|0,unsigned:!!O}};var D=String.prototype.charCodeAt;return K.fromHash=function(O){return O===Z?F:new K((D.call(O,0)|D.call(O,1)<<8|D.call(O,2)<<16|D.call(O,3)<<24)>>>0,(D.call(O,4)|D.call(O,5)<<8|D.call(O,6)<<16|D.call(O,7)<<24)>>>0)},K.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)},K.prototype.zzEncode=function(){var O=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^O)>>>0,this.lo=(this.lo<<1^O)>>>0,this},K.prototype.zzDecode=function(){var O=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^O)>>>0,this.hi=(this.hi>>>1^O)>>>0,this},K.prototype.length=function(){var O=this.lo,I=(this.lo>>>28|this.hi<<4)>>>0,z=this.hi>>>24;return z===0?I===0?O<16384?O<128?1:2:O<2097152?3:4:I<16384?I<128?5:6:I<2097152?7:8:z<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(q){var K=q;K.asPromise=requireAspromise(),K.base64=requireBase64(),K.EventEmitter=requireEventemitter(),K.float=requireFloat(),K.inquire=requireInquire(),K.utf8=requireUtf8(),K.pool=requirePool(),K.LongBits=requireLongbits(),K.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),K.global=K.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,K.emptyArray=Object.freeze?Object.freeze([]):[],K.emptyObject=Object.freeze?Object.freeze({}):{},K.isInteger=Number.isInteger||function(N){return typeof N=="number"&&isFinite(N)&&Math.floor(N)===N},K.isString=function(N){return typeof N=="string"||N instanceof String},K.isObject=function(N){return N&&typeof N=="object"},K.isset=K.isSet=function(N,O){var I=N[O];return I!=null&&N.hasOwnProperty(O)?typeof I!="object"||(Array.isArray(I)?I.length:Object.keys(I).length)>0:!1},K.Buffer=function(){try{var D=K.inquire("buffer").Buffer;return D.prototype.utf8Write?D:null}catch{return null}}(),K._Buffer_from=null,K._Buffer_allocUnsafe=null,K.newBuffer=function(N){return typeof N=="number"?K.Buffer?K._Buffer_allocUnsafe(N):new K.Array(N):K.Buffer?K._Buffer_from(N):typeof Uint8Array>"u"?N:new Uint8Array(N)},K.Array=typeof Uint8Array<"u"?Uint8Array:Array,K.Long=K.global.dcodeIO&&K.global.dcodeIO.Long||K.global.Long||K.inquire("long"),K.key2Re=/^true|false|0|1$/,K.key32Re=/^-?(?:0|[1-9][0-9]*)$/,K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,K.longToHash=function(N){return N?K.LongBits.from(N).toHash():K.LongBits.zeroHash},K.longFromHash=function(N,O){var I=K.LongBits.fromHash(N);return K.Long?K.Long.fromBits(I.lo,I.hi,O):I.toNumber(!!O)};function F(D,N,O){for(var I=Object.keys(N),z=0;z<I.length;++z)(D[I[z]]===void 0||!O)&&(D[I[z]]=N[I[z]]);return D}K.merge=F,K.lcFirst=function(N){return N.charAt(0).toLowerCase()+N.substring(1)};function Z(D){function N(O,I){if(!(this instanceof N))return new N(O,I);Object.defineProperty(this,"message",{get:function(){return O}}),Error.captureStackTrace?Error.captureStackTrace(this,N):Object.defineProperty(this,"stack",{value:new Error().stack||""}),I&&F(this,I)}return N.prototype=Object.create(Error.prototype,{constructor:{value:N,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return D},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),N}K.newError=Z,K.ProtocolError=Z("ProtocolError"),K.oneOfGetter=function(N){for(var O={},I=0;I<N.length;++I)O[N[I]]=1;return function(){for(var z=Object.keys(this),J=z.length-1;J>-1;--J)if(O[z[J]]===1&&this[z[J]]!==void 0&&this[z[J]]!==null)return z[J]}},K.oneOfSetter=function(N){return function(O){for(var I=0;I<N.length;++I)N[I]!==O&&delete this[N[I]]}},K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},K._configure=function(){var D=K.Buffer;if(!D){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=D.from!==Uint8Array.from&&D.from||function(O,I){return new D(O,I)},K._Buffer_allocUnsafe=D.allocUnsafe||function(O){return new D(O)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=z;var q=requireMinimal$1(),K,F=q.LongBits,Z=q.base64,D=q.utf8;function N(ae,ce,de){this.fn=ae,this.len=ce,this.next=void 0,this.val=de}function O(){}function I(ae){this.head=ae.head,this.tail=ae.tail,this.len=ae.len,this.next=ae.states}function z(){this.len=0,this.head=new N(O,0,0),this.tail=this.head,this.states=null}var J=function(){return q.Buffer?function(){return(z.create=function(){return new K})()}:function(){return new z}};z.create=J(),z.alloc=function(ce){return new q.Array(ce)},q.Array!==Array&&(z.alloc=q.pool(z.alloc,q.Array.prototype.subarray)),z.prototype._push=function(ce,de,we){return this.tail=this.tail.next=new N(ce,de,we),this.len+=de,this};function Q(ae,ce,de){ce[de]=ae&255}function ne(ae,ce,de){for(;ae>127;)ce[de++]=ae&127|128,ae>>>=7;ce[de]=ae}function re(ae,ce){this.len=ae,this.next=void 0,this.val=ce}re.prototype=Object.create(N.prototype),re.prototype.fn=ne,z.prototype.uint32=function(ce){return this.len+=(this.tail=this.tail.next=new re((ce=ce>>>0)<128?1:ce<16384?2:ce<2097152?3:ce<268435456?4:5,ce)).len,this},z.prototype.int32=function(ce){return ce<0?this._push(te,10,F.fromNumber(ce)):this.uint32(ce)},z.prototype.sint32=function(ce){return this.uint32((ce<<1^ce>>31)>>>0)};function te(ae,ce,de){for(;ae.hi;)ce[de++]=ae.lo&127|128,ae.lo=(ae.lo>>>7|ae.hi<<25)>>>0,ae.hi>>>=7;for(;ae.lo>127;)ce[de++]=ae.lo&127|128,ae.lo=ae.lo>>>7;ce[de++]=ae.lo}z.prototype.uint64=function(ce){var de=F.from(ce);return this._push(te,de.length(),de)},z.prototype.int64=z.prototype.uint64,z.prototype.sint64=function(ce){var de=F.from(ce).zzEncode();return this._push(te,de.length(),de)},z.prototype.bool=function(ce){return this._push(Q,1,ce?1:0)};function oe(ae,ce,de){ce[de]=ae&255,ce[de+1]=ae>>>8&255,ce[de+2]=ae>>>16&255,ce[de+3]=ae>>>24}z.prototype.fixed32=function(ce){return this._push(oe,4,ce>>>0)},z.prototype.sfixed32=z.prototype.fixed32,z.prototype.fixed64=function(ce){var de=F.from(ce);return this._push(oe,4,de.lo)._push(oe,4,de.hi)},z.prototype.sfixed64=z.prototype.fixed64,z.prototype.float=function(ce){return this._push(q.float.writeFloatLE,4,ce)},z.prototype.double=function(ce){return this._push(q.float.writeDoubleLE,8,ce)};var le=q.Array.prototype.set?function(ce,de,we){de.set(ce,we)}:function(ce,de,we){for(var fe=0;fe<ce.length;++fe)de[we+fe]=ce[fe]};return z.prototype.bytes=function(ce){var de=ce.length>>>0;if(!de)return this._push(Q,1,0);if(q.isString(ce)){var we=z.alloc(de=Z.length(ce));Z.decode(ce,we,0),ce=we}return this.uint32(de)._push(le,de,ce)},z.prototype.string=function(ce){var de=D.length(ce);return de?this.uint32(de)._push(D.write,de,ce):this._push(Q,1,0)},z.prototype.fork=function(){return this.states=new I(this),this.head=this.tail=new N(O,0,0),this.len=0,this},z.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 N(O,0,0),this.len=0),this},z.prototype.ldelim=function(){var ce=this.head,de=this.tail,we=this.len;return this.reset().uint32(we),we&&(this.tail.next=ce.next,this.tail=de,this.len+=we),this},z.prototype.finish=function(){for(var ce=this.head.next,de=this.constructor.alloc(this.len),we=0;ce;)ce.fn(ce.val,de,we),we+=ce.len,ce=ce.next;return de},z._configure=function(ae){K=ae,z.create=J(),K._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=F;var q=requireWriter();(F.prototype=Object.create(q.prototype)).constructor=F;var K=requireMinimal$1();function F(){q.call(this)}F._configure=function(){F.alloc=K._Buffer_allocUnsafe,F.writeBytesBuffer=K.Buffer&&K.Buffer.prototype instanceof Uint8Array&&K.Buffer.prototype.set.name==="set"?function(N,O,I){O.set(N,I)}:function(N,O,I){if(N.copy)N.copy(O,I,0,N.length);else for(var z=0;z<N.length;)O[I++]=N[z++]}},F.prototype.bytes=function(N){K.isString(N)&&(N=K._Buffer_from(N,"base64"));var O=N.length>>>0;return this.uint32(O),O&&this._push(F.writeBytesBuffer,O,N),this};function Z(D,N,O){D.length<40?K.utf8.write(D,N,O):N.utf8Write?N.utf8Write(D,O):N.write(D,O)}return F.prototype.string=function(N){var O=K.Buffer.byteLength(N);return this.uint32(O),O&&this._push(Z,O,N),this},F._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=N;var q=requireMinimal$1(),K,F=q.LongBits,Z=q.utf8;function D(ne,re){return RangeError("index out of range: "+ne.pos+" + "+(re||1)+" > "+ne.len)}function N(ne){this.buf=ne,this.pos=0,this.len=ne.length}var O=typeof Uint8Array<"u"?function(re){if(re instanceof Uint8Array||Array.isArray(re))return new N(re);throw Error("illegal buffer")}:function(re){if(Array.isArray(re))return new N(re);throw Error("illegal buffer")},I=function(){return q.Buffer?function(te){return(N.create=function(le){return q.Buffer.isBuffer(le)?new K(le):O(le)})(te)}:O};N.create=I(),N.prototype._slice=q.Array.prototype.subarray||q.Array.prototype.slice,N.prototype.uint32=function(){var re=4294967295;return function(){if(re=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(re=(re|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(re=(re|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(re=(re|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(re=(re|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return re;if((this.pos+=5)>this.len)throw this.pos=this.len,D(this,10);return re}}(),N.prototype.int32=function(){return this.uint32()|0},N.prototype.sint32=function(){var re=this.uint32();return re>>>1^-(re&1)|0};function z(){var ne=new F(0,0),re=0;if(this.len-this.pos>4){for(;re<4;++re)if(ne.lo=(ne.lo|(this.buf[this.pos]&127)<<re*7)>>>0,this.buf[this.pos++]<128)return ne;if(ne.lo=(ne.lo|(this.buf[this.pos]&127)<<28)>>>0,ne.hi=(ne.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return ne;re=0}else{for(;re<3;++re){if(this.pos>=this.len)throw D(this);if(ne.lo=(ne.lo|(this.buf[this.pos]&127)<<re*7)>>>0,this.buf[this.pos++]<128)return ne}return ne.lo=(ne.lo|(this.buf[this.pos++]&127)<<re*7)>>>0,ne}if(this.len-this.pos>4){for(;re<5;++re)if(ne.hi=(ne.hi|(this.buf[this.pos]&127)<<re*7+3)>>>0,this.buf[this.pos++]<128)return ne}else for(;re<5;++re){if(this.pos>=this.len)throw D(this);if(ne.hi=(ne.hi|(this.buf[this.pos]&127)<<re*7+3)>>>0,this.buf[this.pos++]<128)return ne}throw Error("invalid varint encoding")}N.prototype.bool=function(){return this.uint32()!==0};function J(ne,re){return(ne[re-4]|ne[re-3]<<8|ne[re-2]<<16|ne[re-1]<<24)>>>0}N.prototype.fixed32=function(){if(this.pos+4>this.len)throw D(this,4);return J(this.buf,this.pos+=4)},N.prototype.sfixed32=function(){if(this.pos+4>this.len)throw D(this,4);return J(this.buf,this.pos+=4)|0};function Q(){if(this.pos+8>this.len)throw D(this,8);return new F(J(this.buf,this.pos+=4),J(this.buf,this.pos+=4))}return N.prototype.float=function(){if(this.pos+4>this.len)throw D(this,4);var re=q.float.readFloatLE(this.buf,this.pos);return this.pos+=4,re},N.prototype.double=function(){if(this.pos+8>this.len)throw D(this,4);var re=q.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,re},N.prototype.bytes=function(){var re=this.uint32(),te=this.pos,oe=this.pos+re;if(oe>this.len)throw D(this,re);if(this.pos+=re,Array.isArray(this.buf))return this.buf.slice(te,oe);if(te===oe){var le=q.Buffer;return le?le.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,te,oe)},N.prototype.string=function(){var re=this.bytes();return Z.read(re,0,re.length)},N.prototype.skip=function(re){if(typeof re=="number"){if(this.pos+re>this.len)throw D(this,re);this.pos+=re}else do if(this.pos>=this.len)throw D(this);while(this.buf[this.pos++]&128);return this},N.prototype.skipType=function(ne){switch(ne){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(ne=this.uint32()&7)!==4;)this.skipType(ne);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+ne+" at offset "+this.pos)}return this},N._configure=function(ne){K=ne,N.create=I(),K._configure();var re=q.Long?"toLong":"toNumber";q.merge(N.prototype,{int64:function(){return z.call(this)[re](!1)},uint64:function(){return z.call(this)[re](!0)},sint64:function(){return z.call(this).zzDecode()[re](!1)},fixed64:function(){return Q.call(this)[re](!0)},sfixed64:function(){return Q.call(this)[re](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=F;var q=requireReader();(F.prototype=Object.create(q.prototype)).constructor=F;var K=requireMinimal$1();function F(Z){q.call(this,Z)}return F._configure=function(){K.Buffer&&(F.prototype._slice=K.Buffer.prototype.slice)},F.prototype.string=function(){var D=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+D,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+D,this.len))},F._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=K;var q=requireMinimal$1();(K.prototype=Object.create(q.EventEmitter.prototype)).constructor=K;function K(F,Z,D){if(typeof F!="function")throw TypeError("rpcImpl must be a function");q.EventEmitter.call(this),this.rpcImpl=F,this.requestDelimited=!!Z,this.responseDelimited=!!D}return K.prototype.rpcCall=function F(Z,D,N,O,I){if(!O)throw TypeError("request must be specified");var z=this;if(!I)return q.asPromise(F,z,Z,D,N,O);if(!z.rpcImpl){setTimeout(function(){I(Error("already ended"))},0);return}try{return z.rpcImpl(Z,D[z.requestDelimited?"encodeDelimited":"encode"](O).finish(),function(Q,ne){if(Q)return z.emit("error",Q,Z),I(Q);if(ne===null){z.end(!0);return}if(!(ne instanceof N))try{ne=N[z.responseDelimited?"decodeDelimited":"decode"](ne)}catch(re){return z.emit("error",re,Z),I(re)}return z.emit("data",ne,Z),I(null,ne)})}catch(J){z.emit("error",J,Z),setTimeout(function(){I(J)},0);return}},K.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(q){var K=q;K.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(q){var K=q;K.build="minimal",K.Writer=requireWriter(),K.BufferWriter=requireWriter_buffer(),K.Reader=requireReader(),K.BufferReader=requireReader_buffer(),K.util=requireMinimal$1(),K.rpc=requireRpc(),K.roots=requireRoots(),K.configure=F;function F(){K.util._configure(),K.Writer._configure(K.BufferWriter),K.Reader._configure(K.BufferReader)}F()}(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 q={};return q.quick=function(){const K={};return K.voice=function(){const F={};return F.proto=function(){const Z={};return Z.CommonReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.event="",D.prototype.data=$util.newBuffer([]),D.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.version=0,D.prototype.compress=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.event!=null&&Object.hasOwnProperty.call(O,"event")&&I.uint32(10).string(O.event),O.data!=null&&Object.hasOwnProperty.call(O,"data")&&I.uint32(18).bytes(O.data),O.sn!=null&&Object.hasOwnProperty.call(O,"sn")&&I.uint32(24).int64(O.sn),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(32).int64(O.time),O.valid!=null&&Object.hasOwnProperty.call(O,"valid")&&I.uint32(40).int64(O.valid),O.version!=null&&Object.hasOwnProperty.call(O,"version")&&I.uint32(48).int32(O.version),O.compress!=null&&Object.hasOwnProperty.call(O,"compress")&&I.uint32(56).bool(O.compress),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CommonReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.event=O.string();break}case 2:{J.data=O.bytes();break}case 3:{J.sn=O.int64();break}case 4:{J.time=O.int64();break}case 5:{J.valid=O.int64();break}case 6:{J.version=O.int32();break}case 7:{J.compress=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.event!=null&&O.hasOwnProperty("event")&&!$util.isString(O.event)?"event: string expected":O.data!=null&&O.hasOwnProperty("data")&&!(O.data&&typeof O.data.length=="number"||$util.isString(O.data))?"data: buffer expected":O.sn!=null&&O.hasOwnProperty("sn")&&!$util.isInteger(O.sn)&&!(O.sn&&$util.isInteger(O.sn.low)&&$util.isInteger(O.sn.high))?"sn: integer|Long expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":O.valid!=null&&O.hasOwnProperty("valid")&&!$util.isInteger(O.valid)&&!(O.valid&&$util.isInteger(O.valid.low)&&$util.isInteger(O.valid.high))?"valid: integer|Long expected":O.version!=null&&O.hasOwnProperty("version")&&!$util.isInteger(O.version)?"version: integer expected":O.compress!=null&&O.hasOwnProperty("compress")&&typeof O.compress!="boolean"?"compress: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CommonReq)return O;let I=new $root.com.quick.voice.proto.CommonReq;return O.event!=null&&(I.event=String(O.event)),O.data!=null&&(typeof O.data=="string"?$util.base64.decode(O.data,I.data=$util.newBuffer($util.base64.length(O.data)),0):O.data.length>=0&&(I.data=O.data)),O.sn!=null&&($util.Long?(I.sn=$util.Long.fromValue(O.sn)).unsigned=!1:typeof O.sn=="string"?I.sn=parseInt(O.sn,10):typeof O.sn=="number"?I.sn=O.sn:typeof O.sn=="object"&&(I.sn=new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber())),O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),O.valid!=null&&($util.Long?(I.valid=$util.Long.fromValue(O.valid)).unsigned=!1:typeof O.valid=="string"?I.valid=parseInt(O.valid,10):typeof O.valid=="number"?I.valid=O.valid:typeof O.valid=="object"&&(I.valid=new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber())),O.version!=null&&(I.version=O.version|0),O.compress!=null&&(I.compress=!!O.compress),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults){if(z.event="",I.bytes===String?z.data="":(z.data=[],I.bytes!==Array&&(z.data=$util.newBuffer(z.data))),$util.Long){let J=new $util.Long(0,0,!1);z.sn=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.sn=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.valid=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.valid=I.longs===String?"0":0;z.version=0,z.compress=!1}return O.event!=null&&O.hasOwnProperty("event")&&(z.event=O.event),O.data!=null&&O.hasOwnProperty("data")&&(z.data=I.bytes===String?$util.base64.encode(O.data,0,O.data.length):I.bytes===Array?Array.prototype.slice.call(O.data):O.data),O.sn!=null&&O.hasOwnProperty("sn")&&(typeof O.sn=="number"?z.sn=I.longs===String?String(O.sn):O.sn:z.sn=I.longs===String?$util.Long.prototype.toString.call(O.sn):I.longs===Number?new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber():O.sn),O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),O.valid!=null&&O.hasOwnProperty("valid")&&(typeof O.valid=="number"?z.valid=I.longs===String?String(O.valid):O.valid:z.valid=I.longs===String?$util.Long.prototype.toString.call(O.valid):I.longs===Number?new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber():O.valid),O.version!=null&&O.hasOwnProperty("version")&&(z.version=O.version),O.compress!=null&&O.hasOwnProperty("compress")&&(z.compress=O.compress),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CommonReq"},D}(),Z.CommonRsp=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.event="",D.prototype.data=$util.newBuffer([]),D.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.code=0,D.prototype.desc="",D.prototype.version=0,D.prototype.compress=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.event!=null&&Object.hasOwnProperty.call(O,"event")&&I.uint32(10).string(O.event),O.data!=null&&Object.hasOwnProperty.call(O,"data")&&I.uint32(18).bytes(O.data),O.sn!=null&&Object.hasOwnProperty.call(O,"sn")&&I.uint32(24).int64(O.sn),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(32).int64(O.time),O.valid!=null&&Object.hasOwnProperty.call(O,"valid")&&I.uint32(40).int64(O.valid),O.code!=null&&Object.hasOwnProperty.call(O,"code")&&I.uint32(48).int32(O.code),O.desc!=null&&Object.hasOwnProperty.call(O,"desc")&&I.uint32(58).string(O.desc),O.version!=null&&Object.hasOwnProperty.call(O,"version")&&I.uint32(64).int32(O.version),O.compress!=null&&Object.hasOwnProperty.call(O,"compress")&&I.uint32(72).bool(O.compress),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CommonRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.event=O.string();break}case 2:{J.data=O.bytes();break}case 3:{J.sn=O.int64();break}case 4:{J.time=O.int64();break}case 5:{J.valid=O.int64();break}case 6:{J.code=O.int32();break}case 7:{J.desc=O.string();break}case 8:{J.version=O.int32();break}case 9:{J.compress=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.event!=null&&O.hasOwnProperty("event")&&!$util.isString(O.event)?"event: string expected":O.data!=null&&O.hasOwnProperty("data")&&!(O.data&&typeof O.data.length=="number"||$util.isString(O.data))?"data: buffer expected":O.sn!=null&&O.hasOwnProperty("sn")&&!$util.isInteger(O.sn)&&!(O.sn&&$util.isInteger(O.sn.low)&&$util.isInteger(O.sn.high))?"sn: integer|Long expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":O.valid!=null&&O.hasOwnProperty("valid")&&!$util.isInteger(O.valid)&&!(O.valid&&$util.isInteger(O.valid.low)&&$util.isInteger(O.valid.high))?"valid: integer|Long expected":O.code!=null&&O.hasOwnProperty("code")&&!$util.isInteger(O.code)?"code: integer expected":O.desc!=null&&O.hasOwnProperty("desc")&&!$util.isString(O.desc)?"desc: string expected":O.version!=null&&O.hasOwnProperty("version")&&!$util.isInteger(O.version)?"version: integer expected":O.compress!=null&&O.hasOwnProperty("compress")&&typeof O.compress!="boolean"?"compress: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CommonRsp)return O;let I=new $root.com.quick.voice.proto.CommonRsp;return O.event!=null&&(I.event=String(O.event)),O.data!=null&&(typeof O.data=="string"?$util.base64.decode(O.data,I.data=$util.newBuffer($util.base64.length(O.data)),0):O.data.length>=0&&(I.data=O.data)),O.sn!=null&&($util.Long?(I.sn=$util.Long.fromValue(O.sn)).unsigned=!1:typeof O.sn=="string"?I.sn=parseInt(O.sn,10):typeof O.sn=="number"?I.sn=O.sn:typeof O.sn=="object"&&(I.sn=new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber())),O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),O.valid!=null&&($util.Long?(I.valid=$util.Long.fromValue(O.valid)).unsigned=!1:typeof O.valid=="string"?I.valid=parseInt(O.valid,10):typeof O.valid=="number"?I.valid=O.valid:typeof O.valid=="object"&&(I.valid=new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber())),O.code!=null&&(I.code=O.code|0),O.desc!=null&&(I.desc=String(O.desc)),O.version!=null&&(I.version=O.version|0),O.compress!=null&&(I.compress=!!O.compress),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults){if(z.event="",I.bytes===String?z.data="":(z.data=[],I.bytes!==Array&&(z.data=$util.newBuffer(z.data))),$util.Long){let J=new $util.Long(0,0,!1);z.sn=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.sn=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.valid=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.valid=I.longs===String?"0":0;z.code=0,z.desc="",z.version=0,z.compress=!1}return O.event!=null&&O.hasOwnProperty("event")&&(z.event=O.event),O.data!=null&&O.hasOwnProperty("data")&&(z.data=I.bytes===String?$util.base64.encode(O.data,0,O.data.length):I.bytes===Array?Array.prototype.slice.call(O.data):O.data),O.sn!=null&&O.hasOwnProperty("sn")&&(typeof O.sn=="number"?z.sn=I.longs===String?String(O.sn):O.sn:z.sn=I.longs===String?$util.Long.prototype.toString.call(O.sn):I.longs===Number?new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber():O.sn),O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),O.valid!=null&&O.hasOwnProperty("valid")&&(typeof O.valid=="number"?z.valid=I.longs===String?String(O.valid):O.valid:z.valid=I.longs===String?$util.Long.prototype.toString.call(O.valid):I.longs===Number?new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber():O.valid),O.code!=null&&O.hasOwnProperty("code")&&(z.code=O.code),O.desc!=null&&O.hasOwnProperty("desc")&&(z.desc=O.desc),O.version!=null&&O.hasOwnProperty("version")&&(z.version=O.version),O.compress!=null&&O.hasOwnProperty("compress")&&(z.compress=O.compress),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CommonRsp"},D}(),Z.User=function(){function D(O){if(this.tracks=[],O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.id="",D.prototype.callAction=null,D.prototype.callState=null,D.prototype.joinTime=null,D.prototype.tracks=$util.emptyArray,D.prototype.permissions=null,D.prototype.isPublished=null,D.prototype.behavior=null,D.prototype.channelCache=null;let N;return Object.defineProperty(D.prototype,"_callAction",{get:$util.oneOfGetter(N=["callAction"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_callState",{get:$util.oneOfGetter(N=["callState"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_joinTime",{get:$util.oneOfGetter(N=["joinTime"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_permissions",{get:$util.oneOfGetter(N=["permissions"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_isPublished",{get:$util.oneOfGetter(N=["isPublished"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_behavior",{get:$util.oneOfGetter(N=["behavior"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_channelCache",{get:$util.oneOfGetter(N=["channelCache"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){if(z||(z=$Writer.create()),I.id!=null&&Object.hasOwnProperty.call(I,"id")&&z.uint32(10).string(I.id),I.callAction!=null&&Object.hasOwnProperty.call(I,"callAction")&&z.uint32(16).int32(I.callAction),I.callState!=null&&Object.hasOwnProperty.call(I,"callState")&&z.uint32(24).int32(I.callState),I.joinTime!=null&&Object.hasOwnProperty.call(I,"joinTime")&&z.uint32(32).int64(I.joinTime),I.tracks!=null&&I.tracks.length)for(let J=0;J<I.tracks.length;++J)$root.com.quick.voice.proto.Track.encode(I.tracks[J],z.uint32(42).fork()).ldelim();return I.permissions!=null&&Object.hasOwnProperty.call(I,"permissions")&&z.uint32(48).int32(I.permissions),I.isPublished!=null&&Object.hasOwnProperty.call(I,"isPublished")&&z.uint32(56).bool(I.isPublished),I.behavior!=null&&Object.hasOwnProperty.call(I,"behavior")&&z.uint32(64).int32(I.behavior),I.channelCache!=null&&Object.hasOwnProperty.call(I,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(I.channelCache,z.uint32(74).fork()).ldelim(),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.User;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.id=I.string();break}case 2:{Q.callAction=I.int32();break}case 3:{Q.callState=I.int32();break}case 4:{Q.joinTime=I.int64();break}case 5:{Q.tracks&&Q.tracks.length||(Q.tracks=[]),Q.tracks.push($root.com.quick.voice.proto.Track.decode(I,I.uint32()));break}case 6:{Q.permissions=I.int32();break}case 7:{Q.isPublished=I.bool();break}case 8:{Q.behavior=I.int32();break}case 9:{Q.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(I,I.uint32());break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.id!=null&&I.hasOwnProperty("id")&&!$util.isString(I.id))return"id: string expected";if(I.callAction!=null&&I.hasOwnProperty("callAction")&&!$util.isInteger(I.callAction))return"callAction: integer expected";if(I.callState!=null&&I.hasOwnProperty("callState")&&!$util.isInteger(I.callState))return"callState: integer expected";if(I.joinTime!=null&&I.hasOwnProperty("joinTime")&&!$util.isInteger(I.joinTime)&&!(I.joinTime&&$util.isInteger(I.joinTime.low)&&$util.isInteger(I.joinTime.high)))return"joinTime: integer|Long expected";if(I.tracks!=null&&I.hasOwnProperty("tracks")){if(!Array.isArray(I.tracks))return"tracks: array expected";for(let z=0;z<I.tracks.length;++z){let J=$root.com.quick.voice.proto.Track.verify(I.tracks[z]);if(J)return"tracks."+J}}if(I.permissions!=null&&I.hasOwnProperty("permissions")&&!$util.isInteger(I.permissions))return"permissions: integer expected";if(I.isPublished!=null&&I.hasOwnProperty("isPublished")&&typeof I.isPublished!="boolean")return"isPublished: boolean expected";if(I.behavior!=null&&I.hasOwnProperty("behavior")&&!$util.isInteger(I.behavior))return"behavior: integer expected";if(I.channelCache!=null&&I.hasOwnProperty("channelCache")){let z=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(I.channelCache);if(z)return"channelCache."+z}return null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.User)return I;let z=new $root.com.quick.voice.proto.User;if(I.id!=null&&(z.id=String(I.id)),I.callAction!=null&&(z.callAction=I.callAction|0),I.callState!=null&&(z.callState=I.callState|0),I.joinTime!=null&&($util.Long?(z.joinTime=$util.Long.fromValue(I.joinTime)).unsigned=!1:typeof I.joinTime=="string"?z.joinTime=parseInt(I.joinTime,10):typeof I.joinTime=="number"?z.joinTime=I.joinTime:typeof I.joinTime=="object"&&(z.joinTime=new $util.LongBits(I.joinTime.low>>>0,I.joinTime.high>>>0).toNumber())),I.tracks){if(!Array.isArray(I.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");z.tracks=[];for(let J=0;J<I.tracks.length;++J){if(typeof I.tracks[J]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");z.tracks[J]=$root.com.quick.voice.proto.Track.fromObject(I.tracks[J])}}if(I.permissions!=null&&(z.permissions=I.permissions|0),I.isPublished!=null&&(z.isPublished=!!I.isPublished),I.behavior!=null&&(z.behavior=I.behavior|0),I.channelCache!=null){if(typeof I.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(I.channelCache)}return z},D.toObject=function(I,z){z||(z={});let J={};if((z.arrays||z.defaults)&&(J.tracks=[]),z.defaults&&(J.id=""),I.id!=null&&I.hasOwnProperty("id")&&(J.id=I.id),I.callAction!=null&&I.hasOwnProperty("callAction")&&(J.callAction=I.callAction,z.oneofs&&(J._callAction="callAction")),I.callState!=null&&I.hasOwnProperty("callState")&&(J.callState=I.callState,z.oneofs&&(J._callState="callState")),I.joinTime!=null&&I.hasOwnProperty("joinTime")&&(typeof I.joinTime=="number"?J.joinTime=z.longs===String?String(I.joinTime):I.joinTime:J.joinTime=z.longs===String?$util.Long.prototype.toString.call(I.joinTime):z.longs===Number?new $util.LongBits(I.joinTime.low>>>0,I.joinTime.high>>>0).toNumber():I.joinTime,z.oneofs&&(J._joinTime="joinTime")),I.tracks&&I.tracks.length){J.tracks=[];for(let Q=0;Q<I.tracks.length;++Q)J.tracks[Q]=$root.com.quick.voice.proto.Track.toObject(I.tracks[Q],z)}return I.permissions!=null&&I.hasOwnProperty("permissions")&&(J.permissions=I.permissions,z.oneofs&&(J._permissions="permissions")),I.isPublished!=null&&I.hasOwnProperty("isPublished")&&(J.isPublished=I.isPublished,z.oneofs&&(J._isPublished="isPublished")),I.behavior!=null&&I.hasOwnProperty("behavior")&&(J.behavior=I.behavior,z.oneofs&&(J._behavior="behavior")),I.channelCache!=null&&I.hasOwnProperty("channelCache")&&(J.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(I.channelCache,z),z.oneofs&&(J._channelCache="channelCache")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.User"},D}(),Z.DataChannelCacheInfo=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.DataChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.DataChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.DataChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return O;let I=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.DataChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.DataChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.DataChannelCacheInfo"},D}(),Z.DataChannel=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.dataChannelName="",D.prototype.id=null;let N;return Object.defineProperty(D.prototype,"_id",{get:$util.oneOfGetter(N=["id"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.dataChannelName!=null&&Object.hasOwnProperty.call(I,"dataChannelName")&&z.uint32(10).string(I.dataChannelName),I.id!=null&&Object.hasOwnProperty.call(I,"id")&&z.uint32(16).int32(I.id),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.DataChannel;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.dataChannelName=I.string();break}case 2:{Q.id=I.int32();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){return typeof I!="object"||I===null?"object expected":I.dataChannelName!=null&&I.hasOwnProperty("dataChannelName")&&!$util.isString(I.dataChannelName)?"dataChannelName: string expected":I.id!=null&&I.hasOwnProperty("id")&&!$util.isInteger(I.id)?"id: integer expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.DataChannel)return I;let z=new $root.com.quick.voice.proto.DataChannel;return I.dataChannelName!=null&&(z.dataChannelName=String(I.dataChannelName)),I.id!=null&&(z.id=I.id|0),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.dataChannelName=""),I.dataChannelName!=null&&I.hasOwnProperty("dataChannelName")&&(J.dataChannelName=I.dataChannelName),I.id!=null&&I.hasOwnProperty("id")&&(J.id=I.id,z.oneofs&&(J._id="id")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.DataChannel"},D}(),Z.Login=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.appid="",D.prototype.userId="",D.prototype.sdkToken="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.appid!=null&&Object.hasOwnProperty.call(O,"appid")&&I.uint32(10).string(O.appid),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(18).string(O.userId),O.sdkToken!=null&&Object.hasOwnProperty.call(O,"sdkToken")&&I.uint32(26).string(O.sdkToken),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.Login;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.appid=O.string();break}case 2:{J.userId=O.string();break}case 3:{J.sdkToken=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.appid!=null&&O.hasOwnProperty("appid")&&!$util.isString(O.appid)?"appid: string expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&!$util.isString(O.sdkToken)?"sdkToken: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.Login)return O;let I=new $root.com.quick.voice.proto.Login;return O.appid!=null&&(I.appid=String(O.appid)),O.userId!=null&&(I.userId=String(O.userId)),O.sdkToken!=null&&(I.sdkToken=String(O.sdkToken)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.appid="",z.userId="",z.sdkToken=""),O.appid!=null&&O.hasOwnProperty("appid")&&(z.appid=O.appid),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&(z.sdkToken=O.sdkToken),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.Login"},D}(),Z.Track=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.mid="",D.prototype.trackName=null,D.prototype.location=null,D.prototype.userId=null,D.prototype.code=null,D.prototype.desc=null,D.prototype.type=null,D.prototype.isValid=null,D.prototype.simulcast=null;let N;return Object.defineProperty(D.prototype,"_trackName",{get:$util.oneOfGetter(N=["trackName"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_location",{get:$util.oneOfGetter(N=["location"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_userId",{get:$util.oneOfGetter(N=["userId"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_code",{get:$util.oneOfGetter(N=["code"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_desc",{get:$util.oneOfGetter(N=["desc"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_type",{get:$util.oneOfGetter(N=["type"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_isValid",{get:$util.oneOfGetter(N=["isValid"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_simulcast",{get:$util.oneOfGetter(N=["simulcast"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.mid!=null&&Object.hasOwnProperty.call(I,"mid")&&z.uint32(10).string(I.mid),I.trackName!=null&&Object.hasOwnProperty.call(I,"trackName")&&z.uint32(18).string(I.trackName),I.location!=null&&Object.hasOwnProperty.call(I,"location")&&z.uint32(26).string(I.location),I.userId!=null&&Object.hasOwnProperty.call(I,"userId")&&z.uint32(34).string(I.userId),I.code!=null&&Object.hasOwnProperty.call(I,"code")&&z.uint32(40).int32(I.code),I.desc!=null&&Object.hasOwnProperty.call(I,"desc")&&z.uint32(50).string(I.desc),I.type!=null&&Object.hasOwnProperty.call(I,"type")&&z.uint32(56).int32(I.type),I.isValid!=null&&Object.hasOwnProperty.call(I,"isValid")&&z.uint32(64).bool(I.isValid),I.simulcast!=null&&Object.hasOwnProperty.call(I,"simulcast")&&z.uint32(74).string(I.simulcast),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.Track;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.mid=I.string();break}case 2:{Q.trackName=I.string();break}case 3:{Q.location=I.string();break}case 4:{Q.userId=I.string();break}case 5:{Q.code=I.int32();break}case 6:{Q.desc=I.string();break}case 7:{Q.type=I.int32();break}case 8:{Q.isValid=I.bool();break}case 9:{Q.simulcast=I.string();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.mid!=null&&I.hasOwnProperty("mid")&&!$util.isString(I.mid))return"mid: string expected";if(I.trackName!=null&&I.hasOwnProperty("trackName")&&!$util.isString(I.trackName))return"trackName: string expected";if(I.location!=null&&I.hasOwnProperty("location")&&!$util.isString(I.location))return"location: string expected";if(I.userId!=null&&I.hasOwnProperty("userId")&&!$util.isString(I.userId))return"userId: string expected";if(I.code!=null&&I.hasOwnProperty("code")&&!$util.isInteger(I.code))return"code: integer expected";if(I.desc!=null&&I.hasOwnProperty("desc")&&!$util.isString(I.desc))return"desc: string expected";if(I.type!=null&&I.hasOwnProperty("type"))switch(I.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return I.isValid!=null&&I.hasOwnProperty("isValid")&&typeof I.isValid!="boolean"?"isValid: boolean expected":I.simulcast!=null&&I.hasOwnProperty("simulcast")&&!$util.isString(I.simulcast)?"simulcast: string expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.Track)return I;let z=new $root.com.quick.voice.proto.Track;switch(I.mid!=null&&(z.mid=String(I.mid)),I.trackName!=null&&(z.trackName=String(I.trackName)),I.location!=null&&(z.location=String(I.location)),I.userId!=null&&(z.userId=String(I.userId)),I.code!=null&&(z.code=I.code|0),I.desc!=null&&(z.desc=String(I.desc)),I.type){default:if(typeof I.type=="number"){z.type=I.type;break}break;case"Microphone":case 0:z.type=0;break;case"Camera":case 1:z.type=1;break;case"Screen":case 2:z.type=2;break;case"SystemVoice":case 3:z.type=3;break}return I.isValid!=null&&(z.isValid=!!I.isValid),I.simulcast!=null&&(z.simulcast=String(I.simulcast)),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.mid=""),I.mid!=null&&I.hasOwnProperty("mid")&&(J.mid=I.mid),I.trackName!=null&&I.hasOwnProperty("trackName")&&(J.trackName=I.trackName,z.oneofs&&(J._trackName="trackName")),I.location!=null&&I.hasOwnProperty("location")&&(J.location=I.location,z.oneofs&&(J._location="location")),I.userId!=null&&I.hasOwnProperty("userId")&&(J.userId=I.userId,z.oneofs&&(J._userId="userId")),I.code!=null&&I.hasOwnProperty("code")&&(J.code=I.code,z.oneofs&&(J._code="code")),I.desc!=null&&I.hasOwnProperty("desc")&&(J.desc=I.desc,z.oneofs&&(J._desc="desc")),I.type!=null&&I.hasOwnProperty("type")&&(J.type=z.enums===String?$root.com.quick.voice.proto.TrackType[I.type]===void 0?I.type:$root.com.quick.voice.proto.TrackType[I.type]:I.type,z.oneofs&&(J._type="type")),I.isValid!=null&&I.hasOwnProperty("isValid")&&(J.isValid=I.isValid,z.oneofs&&(J._isValid="isValid")),I.simulcast!=null&&I.hasOwnProperty("simulcast")&&(J.simulcast=I.simulcast,z.oneofs&&(J._simulcast="simulcast")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.Track"},D}(),Z.JoinReq=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.roomId="",D.prototype.user=null,D.prototype.callType=0,D.prototype.token=null;let N;return Object.defineProperty(D.prototype,"_token",{get:$util.oneOfGetter(N=["token"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.roomId!=null&&Object.hasOwnProperty.call(I,"roomId")&&z.uint32(10).string(I.roomId),I.user!=null&&Object.hasOwnProperty.call(I,"user")&&$root.com.quick.voice.proto.User.encode(I.user,z.uint32(18).fork()).ldelim(),I.callType!=null&&Object.hasOwnProperty.call(I,"callType")&&z.uint32(24).int32(I.callType),I.token!=null&&Object.hasOwnProperty.call(I,"token")&&z.uint32(34).string(I.token),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.JoinReq;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.roomId=I.string();break}case 2:{Q.user=$root.com.quick.voice.proto.User.decode(I,I.uint32());break}case 3:{Q.callType=I.int32();break}case 4:{Q.token=I.string();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.roomId!=null&&I.hasOwnProperty("roomId")&&!$util.isString(I.roomId))return"roomId: string expected";if(I.user!=null&&I.hasOwnProperty("user")){let z=$root.com.quick.voice.proto.User.verify(I.user);if(z)return"user."+z}if(I.callType!=null&&I.hasOwnProperty("callType"))switch(I.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return I.token!=null&&I.hasOwnProperty("token")&&!$util.isString(I.token)?"token: string expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.JoinReq)return I;let z=new $root.com.quick.voice.proto.JoinReq;if(I.roomId!=null&&(z.roomId=String(I.roomId)),I.user!=null){if(typeof I.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");z.user=$root.com.quick.voice.proto.User.fromObject(I.user)}switch(I.callType){default:if(typeof I.callType=="number"){z.callType=I.callType;break}break;case"Normal":case 0:z.callType=0;break;case"Meeting":case 1:z.callType=1;break;case"Live":case 2:z.callType=2;break}return I.token!=null&&(z.token=String(I.token)),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.roomId="",J.user=null,J.callType=z.enums===String?"Normal":0),I.roomId!=null&&I.hasOwnProperty("roomId")&&(J.roomId=I.roomId),I.user!=null&&I.hasOwnProperty("user")&&(J.user=$root.com.quick.voice.proto.User.toObject(I.user,z)),I.callType!=null&&I.hasOwnProperty("callType")&&(J.callType=z.enums===String?$root.com.quick.voice.proto.CallType[I.callType]===void 0?I.callType:$root.com.quick.voice.proto.CallType[I.callType]:I.callType),I.token!=null&&I.hasOwnProperty("token")&&(J.token=I.token,z.oneofs&&(J._token="token")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.JoinReq"},D}(),Z.JoinRsp=function(){function D(N){if(this.roomUsers=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.roomUsers=$util.emptyArray,D.prototype.callType=0,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.roomUsers!=null&&O.roomUsers.length)for(let z=0;z<O.roomUsers.length;++z)$root.com.quick.voice.proto.User.encode(O.roomUsers[z],I.uint32(18).fork()).ldelim();return O.callType!=null&&Object.hasOwnProperty.call(O,"callType")&&I.uint32(24).int32(O.callType),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.JoinRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.roomUsers&&J.roomUsers.length||(J.roomUsers=[]),J.roomUsers.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}case 3:{J.callType=O.int32();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.roomUsers!=null&&O.hasOwnProperty("roomUsers")){if(!Array.isArray(O.roomUsers))return"roomUsers: array expected";for(let I=0;I<O.roomUsers.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.roomUsers[I]);if(z)return"roomUsers."+z}}if(O.callType!=null&&O.hasOwnProperty("callType"))switch(O.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.JoinRsp)return O;let I=new $root.com.quick.voice.proto.JoinRsp;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.roomUsers){if(!Array.isArray(O.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");I.roomUsers=[];for(let z=0;z<O.roomUsers.length;++z){if(typeof O.roomUsers[z]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");I.roomUsers[z]=$root.com.quick.voice.proto.User.fromObject(O.roomUsers[z])}}switch(O.callType){default:if(typeof O.callType=="number"){I.callType=O.callType;break}break;case"Normal":case 0:I.callType=0;break;case"Meeting":case 1:I.callType=1;break;case"Live":case 2:I.callType=2;break}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.roomUsers=[]),I.defaults&&(z.roomId="",z.callType=I.enums===String?"Normal":0),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.roomUsers&&O.roomUsers.length){z.roomUsers=[];for(let J=0;J<O.roomUsers.length;++J)z.roomUsers[J]=$root.com.quick.voice.proto.User.toObject(O.roomUsers[J],I)}return O.callType!=null&&O.hasOwnProperty("callType")&&(z.callType=I.enums===String?$root.com.quick.voice.proto.CallType[O.callType]===void 0?O.callType:$root.com.quick.voice.proto.CallType[O.callType]:O.callType),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.JoinRsp"},D}(),Z.JoinNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.JoinNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.JoinNotify)return O;let I=new $root.com.quick.voice.proto.JoinNotify;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.JoinNotify"},D}(),Z.ConnectCFReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.sdp="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.sdp!=null&&Object.hasOwnProperty.call(O,"sdp")&&I.uint32(10).string(O.sdp),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ConnectCFReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.sdp=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.sdp!=null&&O.hasOwnProperty("sdp")&&!$util.isString(O.sdp)?"sdp: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ConnectCFReq)return O;let I=new $root.com.quick.voice.proto.ConnectCFReq;return O.sdp!=null&&(I.sdp=String(O.sdp)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.sdp=""),O.sdp!=null&&O.hasOwnProperty("sdp")&&(z.sdp=O.sdp),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ConnectCFReq"},D}(),Z.ConnectCFRsp=function(){function D(N){if(this.subscribeUsers=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.prototype.subscribeUsers=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),O.subscribeUsers!=null&&O.subscribeUsers.length)for(let z=0;z<O.subscribeUsers.length;++z)$root.com.quick.voice.proto.User.encode(O.subscribeUsers[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ConnectCFRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}case 2:{J.subscribeUsers&&J.subscribeUsers.length||(J.subscribeUsers=[]),J.subscribeUsers.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp))return"remoteSdp: string expected";if(O.subscribeUsers!=null&&O.hasOwnProperty("subscribeUsers")){if(!Array.isArray(O.subscribeUsers))return"subscribeUsers: array expected";for(let I=0;I<O.subscribeUsers.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.subscribeUsers[I]);if(z)return"subscribeUsers."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ConnectCFRsp)return O;let I=new $root.com.quick.voice.proto.ConnectCFRsp;if(O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),O.subscribeUsers){if(!Array.isArray(O.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");I.subscribeUsers=[];for(let z=0;z<O.subscribeUsers.length;++z){if(typeof O.subscribeUsers[z]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");I.subscribeUsers[z]=$root.com.quick.voice.proto.User.fromObject(O.subscribeUsers[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.subscribeUsers=[]),I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),O.subscribeUsers&&O.subscribeUsers.length){z.subscribeUsers=[];for(let J=0;J<O.subscribeUsers.length;++J)z.subscribeUsers[J]=$root.com.quick.voice.proto.User.toObject(O.subscribeUsers[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ConnectCFRsp"},D}(),Z.PublishReq=function(){function D(O){if(this.tracks=[],O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.sdp="",D.prototype.tracks=$util.emptyArray,D.prototype.callAction=0,D.prototype.recreate=null;let N;return Object.defineProperty(D.prototype,"_recreate",{get:$util.oneOfGetter(N=["recreate"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){if(z||(z=$Writer.create()),I.sdp!=null&&Object.hasOwnProperty.call(I,"sdp")&&z.uint32(10).string(I.sdp),I.tracks!=null&&I.tracks.length)for(let J=0;J<I.tracks.length;++J)$root.com.quick.voice.proto.Track.encode(I.tracks[J],z.uint32(18).fork()).ldelim();return I.callAction!=null&&Object.hasOwnProperty.call(I,"callAction")&&z.uint32(24).int32(I.callAction),I.recreate!=null&&Object.hasOwnProperty.call(I,"recreate")&&z.uint32(32).bool(I.recreate),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.PublishReq;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.sdp=I.string();break}case 2:{Q.tracks&&Q.tracks.length||(Q.tracks=[]),Q.tracks.push($root.com.quick.voice.proto.Track.decode(I,I.uint32()));break}case 3:{Q.callAction=I.int32();break}case 4:{Q.recreate=I.bool();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.sdp!=null&&I.hasOwnProperty("sdp")&&!$util.isString(I.sdp))return"sdp: string expected";if(I.tracks!=null&&I.hasOwnProperty("tracks")){if(!Array.isArray(I.tracks))return"tracks: array expected";for(let z=0;z<I.tracks.length;++z){let J=$root.com.quick.voice.proto.Track.verify(I.tracks[z]);if(J)return"tracks."+J}}return I.callAction!=null&&I.hasOwnProperty("callAction")&&!$util.isInteger(I.callAction)?"callAction: integer expected":I.recreate!=null&&I.hasOwnProperty("recreate")&&typeof I.recreate!="boolean"?"recreate: boolean expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.PublishReq)return I;let z=new $root.com.quick.voice.proto.PublishReq;if(I.sdp!=null&&(z.sdp=String(I.sdp)),I.tracks){if(!Array.isArray(I.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");z.tracks=[];for(let J=0;J<I.tracks.length;++J){if(typeof I.tracks[J]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");z.tracks[J]=$root.com.quick.voice.proto.Track.fromObject(I.tracks[J])}}return I.callAction!=null&&(z.callAction=I.callAction|0),I.recreate!=null&&(z.recreate=!!I.recreate),z},D.toObject=function(I,z){z||(z={});let J={};if((z.arrays||z.defaults)&&(J.tracks=[]),z.defaults&&(J.sdp="",J.callAction=0),I.sdp!=null&&I.hasOwnProperty("sdp")&&(J.sdp=I.sdp),I.tracks&&I.tracks.length){J.tracks=[];for(let Q=0;Q<I.tracks.length;++Q)J.tracks[Q]=$root.com.quick.voice.proto.Track.toObject(I.tracks[Q],z)}return I.callAction!=null&&I.hasOwnProperty("callAction")&&(J.callAction=I.callAction),I.recreate!=null&&I.hasOwnProperty("recreate")&&(J.recreate=I.recreate,z.oneofs&&(J._recreate="recreate")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.PublishReq"},D}(),Z.PublishRsp=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PublishRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp)?"remoteSdp: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PublishRsp)return O;let I=new $root.com.quick.voice.proto.PublishRsp;return O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PublishRsp"},D}(),Z.PublishNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PublishNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PublishNotify)return O;let I=new $root.com.quick.voice.proto.PublishNotify;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PublishNotify"},D}(),Z.SubscribeReq=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SubscribeReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SubscribeReq)return O;let I=new $root.com.quick.voice.proto.SubscribeReq;if(O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SubscribeReq"},D}(),Z.SubscribeRsp=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SubscribeRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}case 2:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp))return"remoteSdp: string expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SubscribeRsp)return O;let I=new $root.com.quick.voice.proto.SubscribeRsp;if(O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SubscribeRsp"},D}(),Z.RenegotiateReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.sdp="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.sdp!=null&&Object.hasOwnProperty.call(O,"sdp")&&I.uint32(18).string(O.sdp),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.RenegotiateReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.sdp=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.sdp!=null&&O.hasOwnProperty("sdp")&&!$util.isString(O.sdp)?"sdp: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.RenegotiateReq)return O;let I=new $root.com.quick.voice.proto.RenegotiateReq;return O.userId!=null&&(I.userId=String(O.userId)),O.sdp!=null&&(I.sdp=String(O.sdp)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.userId="",z.sdp=""),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.sdp!=null&&O.hasOwnProperty("sdp")&&(z.sdp=O.sdp),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.RenegotiateReq"},D}(),Z.QuitReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(18).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.QuitReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.QuitReq)return O;let I=new $root.com.quick.voice.proto.QuitReq;return O.userId!=null&&(I.userId=String(O.userId)),O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.userId="",z.roomId=""),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.QuitReq"},D}(),Z.QuitNotify=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.roomId="",D.prototype.user=null,D.prototype.code=null,D.prototype.desc=null;let N;return Object.defineProperty(D.prototype,"_code",{get:$util.oneOfGetter(N=["code"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_desc",{get:$util.oneOfGetter(N=["desc"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.roomId!=null&&Object.hasOwnProperty.call(I,"roomId")&&z.uint32(10).string(I.roomId),I.user!=null&&Object.hasOwnProperty.call(I,"user")&&$root.com.quick.voice.proto.User.encode(I.user,z.uint32(18).fork()).ldelim(),I.code!=null&&Object.hasOwnProperty.call(I,"code")&&z.uint32(24).int32(I.code),I.desc!=null&&Object.hasOwnProperty.call(I,"desc")&&z.uint32(34).string(I.desc),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.QuitNotify;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.roomId=I.string();break}case 2:{Q.user=$root.com.quick.voice.proto.User.decode(I,I.uint32());break}case 3:{Q.code=I.int32();break}case 4:{Q.desc=I.string();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.roomId!=null&&I.hasOwnProperty("roomId")&&!$util.isString(I.roomId))return"roomId: string expected";if(I.user!=null&&I.hasOwnProperty("user")){let z=$root.com.quick.voice.proto.User.verify(I.user);if(z)return"user."+z}return I.code!=null&&I.hasOwnProperty("code")&&!$util.isInteger(I.code)?"code: integer expected":I.desc!=null&&I.hasOwnProperty("desc")&&!$util.isString(I.desc)?"desc: string expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.QuitNotify)return I;let z=new $root.com.quick.voice.proto.QuitNotify;if(I.roomId!=null&&(z.roomId=String(I.roomId)),I.user!=null){if(typeof I.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");z.user=$root.com.quick.voice.proto.User.fromObject(I.user)}return I.code!=null&&(z.code=I.code|0),I.desc!=null&&(z.desc=String(I.desc)),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.roomId="",J.user=null),I.roomId!=null&&I.hasOwnProperty("roomId")&&(J.roomId=I.roomId),I.user!=null&&I.hasOwnProperty("user")&&(J.user=$root.com.quick.voice.proto.User.toObject(I.user,z)),I.code!=null&&I.hasOwnProperty("code")&&(J.code=I.code,z.oneofs&&(J._code="code")),I.desc!=null&&I.hasOwnProperty("desc")&&(J.desc=I.desc,z.oneofs&&(J._desc="desc")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.QuitNotify"},D}(),Z.TokenExpireNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.TokenExpireNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.TokenExpireNotify)return O;let I=new $root.com.quick.voice.proto.TokenExpireNotify;return O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.TokenExpireNotify"},D}(),Z.UpdateTokenReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.sdkToken="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.sdkToken!=null&&Object.hasOwnProperty.call(O,"sdkToken")&&I.uint32(18).string(O.sdkToken),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdateTokenReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.sdkToken=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&!$util.isString(O.sdkToken)?"sdkToken: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdateTokenReq)return O;let I=new $root.com.quick.voice.proto.UpdateTokenReq;return O.roomId!=null&&(I.roomId=String(O.roomId)),O.sdkToken!=null&&(I.sdkToken=String(O.sdkToken)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.sdkToken=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&(z.sdkToken=O.sdkToken),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdateTokenReq"},D}(),Z.NetQualityChange=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.roomId="",D.prototype.egress=0,D.prototype.ingress=0,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(18).string(O.roomId),O.egress!=null&&Object.hasOwnProperty.call(O,"egress")&&I.uint32(24).int32(O.egress),O.ingress!=null&&Object.hasOwnProperty.call(O,"ingress")&&I.uint32(32).int32(O.ingress),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.NetQualityChange;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.roomId=O.string();break}case 3:{J.egress=O.int32();break}case 4:{J.ingress=O.int32();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":O.egress!=null&&O.hasOwnProperty("egress")&&!$util.isInteger(O.egress)?"egress: integer expected":O.ingress!=null&&O.hasOwnProperty("ingress")&&!$util.isInteger(O.ingress)?"ingress: integer expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.NetQualityChange)return O;let I=new $root.com.quick.voice.proto.NetQualityChange;return O.userId!=null&&(I.userId=String(O.userId)),O.roomId!=null&&(I.roomId=String(O.roomId)),O.egress!=null&&(I.egress=O.egress|0),O.ingress!=null&&(I.ingress=O.ingress|0),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.userId="",z.roomId="",z.egress=0,z.ingress=0),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.egress!=null&&O.hasOwnProperty("egress")&&(z.egress=O.egress),O.ingress!=null&&O.hasOwnProperty("ingress")&&(z.ingress=O.ingress),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.NetQualityChange"},D}(),Z.NetQualityNotify=function(){function D(N){if(this.qualities=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.qualities=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.qualities!=null&&O.qualities.length)for(let z=0;z<O.qualities.length;++z)$root.com.quick.voice.proto.NetQualityChange.encode(O.qualities[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.NetQualityNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.qualities&&J.qualities.length||(J.qualities=[]),J.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.qualities!=null&&O.hasOwnProperty("qualities")){if(!Array.isArray(O.qualities))return"qualities: array expected";for(let I=0;I<O.qualities.length;++I){let z=$root.com.quick.voice.proto.NetQualityChange.verify(O.qualities[I]);if(z)return"qualities."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.NetQualityNotify)return O;let I=new $root.com.quick.voice.proto.NetQualityNotify;if(O.qualities){if(!Array.isArray(O.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");I.qualities=[];for(let z=0;z<O.qualities.length;++z){if(typeof O.qualities[z]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");I.qualities[z]=$root.com.quick.voice.proto.NetQualityChange.fromObject(O.qualities[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.qualities=[]),O.qualities&&O.qualities.length){z.qualities=[];for(let J=0;J<O.qualities.length;++J)z.qualities[J]=$root.com.quick.voice.proto.NetQualityChange.toObject(O.qualities[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.NetQualityNotify"},D}(),Z.UpdateCall=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdateCall;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdateCall)return O;let I=new $root.com.quick.voice.proto.UpdateCall;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdateCall"},D}(),Z.SyncRoomInfoReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return O;let I=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SyncRoomInfoReq"},D}(),Z.SyncRoomInfoRsp=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.isValid=!1,D.prototype.users=$util.emptyArray,D.prototype.isActive=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.isValid!=null&&Object.hasOwnProperty.call(O,"isValid")&&I.uint32(16).bool(O.isValid),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(26).fork()).ldelim();return O.isActive!=null&&Object.hasOwnProperty.call(O,"isActive")&&I.uint32(32).bool(O.isActive),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.isValid=O.bool();break}case 3:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}case 4:{J.isActive=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.isValid!=null&&O.hasOwnProperty("isValid")&&typeof O.isValid!="boolean")return"isValid: boolean expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return O.isActive!=null&&O.hasOwnProperty("isActive")&&typeof O.isActive!="boolean"?"isActive: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return O;let I=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.isValid!=null&&(I.isValid=!!O.isValid),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return O.isActive!=null&&(I.isActive=!!O.isActive),I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.roomId="",z.isValid=!1,z.isActive=!1),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.isValid!=null&&O.hasOwnProperty("isValid")&&(z.isValid=O.isValid),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return O.isActive!=null&&O.hasOwnProperty("isActive")&&(z.isActive=O.isActive),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SyncRoomInfoRsp"},D}(),Z.UpdateTime=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(8).int64(O.time),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdateTime;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.time=O.int64();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdateTime)return O;let I=new $root.com.quick.voice.proto.UpdateTime;return O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults)if($util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;return O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdateTime"},D}(),Z.CloseTrackReq=function(){function D(N){if(this.tracks=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.sdp="",D.prototype.tracks=$util.emptyArray,D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.sdp!=null&&Object.hasOwnProperty.call(O,"sdp")&&I.uint32(10).string(O.sdp),O.tracks!=null&&O.tracks.length)for(let z=0;z<O.tracks.length;++z)$root.com.quick.voice.proto.Track.encode(O.tracks[z],I.uint32(18).fork()).ldelim();return O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(26).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CloseTrackReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.sdp=O.string();break}case 2:{J.tracks&&J.tracks.length||(J.tracks=[]),J.tracks.push($root.com.quick.voice.proto.Track.decode(O,O.uint32()));break}case 3:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.sdp!=null&&O.hasOwnProperty("sdp")&&!$util.isString(O.sdp))return"sdp: string expected";if(O.tracks!=null&&O.hasOwnProperty("tracks")){if(!Array.isArray(O.tracks))return"tracks: array expected";for(let I=0;I<O.tracks.length;++I){let z=$root.com.quick.voice.proto.Track.verify(O.tracks[I]);if(z)return"tracks."+z}}return O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CloseTrackReq)return O;let I=new $root.com.quick.voice.proto.CloseTrackReq;if(O.sdp!=null&&(I.sdp=String(O.sdp)),O.tracks){if(!Array.isArray(O.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");I.tracks=[];for(let z=0;z<O.tracks.length;++z){if(typeof O.tracks[z]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");I.tracks[z]=$root.com.quick.voice.proto.Track.fromObject(O.tracks[z])}}return O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.tracks=[]),I.defaults&&(z.sdp="",z.roomId=""),O.sdp!=null&&O.hasOwnProperty("sdp")&&(z.sdp=O.sdp),O.tracks&&O.tracks.length){z.tracks=[];for(let J=0;J<O.tracks.length;++J)z.tracks[J]=$root.com.quick.voice.proto.Track.toObject(O.tracks[J],I)}return O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CloseTrackReq"},D}(),Z.CloseTrackRsp=function(){function D(N){if(this.tracks=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.prototype.tracks=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),O.tracks!=null&&O.tracks.length)for(let z=0;z<O.tracks.length;++z)$root.com.quick.voice.proto.Track.encode(O.tracks[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CloseTrackRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}case 2:{J.tracks&&J.tracks.length||(J.tracks=[]),J.tracks.push($root.com.quick.voice.proto.Track.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp))return"remoteSdp: string expected";if(O.tracks!=null&&O.hasOwnProperty("tracks")){if(!Array.isArray(O.tracks))return"tracks: array expected";for(let I=0;I<O.tracks.length;++I){let z=$root.com.quick.voice.proto.Track.verify(O.tracks[I]);if(z)return"tracks."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CloseTrackRsp)return O;let I=new $root.com.quick.voice.proto.CloseTrackRsp;if(O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),O.tracks){if(!Array.isArray(O.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");I.tracks=[];for(let z=0;z<O.tracks.length;++z){if(typeof O.tracks[z]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");I.tracks[z]=$root.com.quick.voice.proto.Track.fromObject(O.tracks[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.tracks=[]),I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),O.tracks&&O.tracks.length){z.tracks=[];for(let J=0;J<O.tracks.length;++J)z.tracks[J]=$root.com.quick.voice.proto.Track.toObject(O.tracks[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CloseTrackRsp"},D}(),Z.CloseTrackNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(10).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CloseTrackNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CloseTrackNotify)return O;let I=new $root.com.quick.voice.proto.CloseTrackNotify;if(O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.user=null),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CloseTrackNotify"},D}(),Z.ToggleLiveRoomReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return O;let I=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ToggleLiveRoomReq"},D}(),Z.ToggleLiveRoomRsq=function(){function D(N){if(this.roomUsers=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.hash="",D.prototype.roomUsers=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.hash!=null&&Object.hasOwnProperty.call(O,"hash")&&I.uint32(18).string(O.hash),O.roomUsers!=null&&O.roomUsers.length)for(let z=0;z<O.roomUsers.length;++z)$root.com.quick.voice.proto.User.encode(O.roomUsers[z],I.uint32(26).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.hash=O.string();break}case 3:{J.roomUsers&&J.roomUsers.length||(J.roomUsers=[]),J.roomUsers.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.hash!=null&&O.hasOwnProperty("hash")&&!$util.isString(O.hash))return"hash: string expected";if(O.roomUsers!=null&&O.hasOwnProperty("roomUsers")){if(!Array.isArray(O.roomUsers))return"roomUsers: array expected";for(let I=0;I<O.roomUsers.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.roomUsers[I]);if(z)return"roomUsers."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return O;let I=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.hash!=null&&(I.hash=String(O.hash)),O.roomUsers){if(!Array.isArray(O.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");I.roomUsers=[];for(let z=0;z<O.roomUsers.length;++z){if(typeof O.roomUsers[z]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");I.roomUsers[z]=$root.com.quick.voice.proto.User.fromObject(O.roomUsers[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.roomUsers=[]),I.defaults&&(z.roomId="",z.hash=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.hash!=null&&O.hasOwnProperty("hash")&&(z.hash=O.hash),O.roomUsers&&O.roomUsers.length){z.roomUsers=[];for(let J=0;J<O.roomUsers.length;++J)z.roomUsers[J]=$root.com.quick.voice.proto.User.toObject(O.roomUsers[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ToggleLiveRoomRsq"},D}(),Z.TrackType=function(){const D={},N=Object.create(D);return N[D[0]="Microphone"]=0,N[D[1]="Camera"]=1,N[D[2]="Screen"]=2,N[D[3]="SystemVoice"]=3,N}(),Z.ReportInfoReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.actionEvent="",D.prototype.userId="",D.prototype.platform="",D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.actionData="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.actionEvent!=null&&Object.hasOwnProperty.call(O,"actionEvent")&&I.uint32(10).string(O.actionEvent),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(18).string(O.userId),O.platform!=null&&Object.hasOwnProperty.call(O,"platform")&&I.uint32(26).string(O.platform),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(32).int64(O.time),O.actionData!=null&&Object.hasOwnProperty.call(O,"actionData")&&I.uint32(42).string(O.actionData),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ReportInfoReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.actionEvent=O.string();break}case 2:{J.userId=O.string();break}case 3:{J.platform=O.string();break}case 4:{J.time=O.int64();break}case 5:{J.actionData=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.actionEvent!=null&&O.hasOwnProperty("actionEvent")&&!$util.isString(O.actionEvent)?"actionEvent: string expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.platform!=null&&O.hasOwnProperty("platform")&&!$util.isString(O.platform)?"platform: string expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":O.actionData!=null&&O.hasOwnProperty("actionData")&&!$util.isString(O.actionData)?"actionData: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ReportInfoReq)return O;let I=new $root.com.quick.voice.proto.ReportInfoReq;return O.actionEvent!=null&&(I.actionEvent=String(O.actionEvent)),O.userId!=null&&(I.userId=String(O.userId)),O.platform!=null&&(I.platform=String(O.platform)),O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),O.actionData!=null&&(I.actionData=String(O.actionData)),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults){if(z.actionEvent="",z.userId="",z.platform="",$util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;z.actionData=""}return O.actionEvent!=null&&O.hasOwnProperty("actionEvent")&&(z.actionEvent=O.actionEvent),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.platform!=null&&O.hasOwnProperty("platform")&&(z.platform=O.platform),O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),O.actionData!=null&&O.hasOwnProperty("actionData")&&(z.actionData=O.actionData),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ReportInfoReq"},D}(),Z.UpdatePermissions=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdatePermissions;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdatePermissions)return O;let I=new $root.com.quick.voice.proto.UpdatePermissions;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdatePermissions"},D}(),Z.CallType=function(){const D={},N=Object.create(D);return N[D[0]="Normal"]=0,N[D[1]="Meeting"]=1,N[D[2]="Live"]=2,N}(),Z.QuitNotifyCode=function(){const D={},N=Object.create(D);return N[D[0]="NormalQuit"]=0,N[D[2021]="Timeout"]=2021,N[D[2011]="TokenExpired"]=2011,N[D[2022]="KickOut"]=2022,N[D[2023]="EndPk"]=2023,N[D[2024]="EndLive"]=2024,N}(),Z.UserBehavior=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.type=0,D.prototype.behavior=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.type!=null&&Object.hasOwnProperty.call(O,"type")&&I.uint32(8).int32(O.type),O.behavior!=null&&Object.hasOwnProperty.call(O,"behavior")&&I.uint32(16).bool(O.behavior),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UserBehavior;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.type=O.int32();break}case 2:{J.behavior=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.type!=null&&O.hasOwnProperty("type"))switch(O.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return O.behavior!=null&&O.hasOwnProperty("behavior")&&typeof O.behavior!="boolean"?"behavior: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UserBehavior)return O;let I=new $root.com.quick.voice.proto.UserBehavior;switch(O.type){default:if(typeof O.type=="number"){I.type=O.type;break}break;case"Microphone":case 0:I.type=0;break;case"Camera":case 1:I.type=1;break;case"Screen":case 2:I.type=2;break;case"SystemVoice":case 3:I.type=3;break}return O.behavior!=null&&(I.behavior=!!O.behavior),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.type=I.enums===String?"Microphone":0,z.behavior=!1),O.type!=null&&O.hasOwnProperty("type")&&(z.type=I.enums===String?$root.com.quick.voice.proto.TrackType[O.type]===void 0?O.type:$root.com.quick.voice.proto.TrackType[O.type]:O.type),O.behavior!=null&&O.hasOwnProperty("behavior")&&(z.behavior=O.behavior),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UserBehavior"},D}(),Z.PreventUser=function(){function D(N){if(this.behaviors=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.id="",D.prototype.behaviors=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.id!=null&&Object.hasOwnProperty.call(O,"id")&&I.uint32(10).string(O.id),O.behaviors!=null&&O.behaviors.length)for(let z=0;z<O.behaviors.length;++z)$root.com.quick.voice.proto.UserBehavior.encode(O.behaviors[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PreventUser;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.id=O.string();break}case 2:{J.behaviors&&J.behaviors.length||(J.behaviors=[]),J.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.id!=null&&O.hasOwnProperty("id")&&!$util.isString(O.id))return"id: string expected";if(O.behaviors!=null&&O.hasOwnProperty("behaviors")){if(!Array.isArray(O.behaviors))return"behaviors: array expected";for(let I=0;I<O.behaviors.length;++I){let z=$root.com.quick.voice.proto.UserBehavior.verify(O.behaviors[I]);if(z)return"behaviors."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PreventUser)return O;let I=new $root.com.quick.voice.proto.PreventUser;if(O.id!=null&&(I.id=String(O.id)),O.behaviors){if(!Array.isArray(O.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");I.behaviors=[];for(let z=0;z<O.behaviors.length;++z){if(typeof O.behaviors[z]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");I.behaviors[z]=$root.com.quick.voice.proto.UserBehavior.fromObject(O.behaviors[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.behaviors=[]),I.defaults&&(z.id=""),O.id!=null&&O.hasOwnProperty("id")&&(z.id=O.id),O.behaviors&&O.behaviors.length){z.behaviors=[];for(let J=0;J<O.behaviors.length;++J)z.behaviors[J]=$root.com.quick.voice.proto.UserBehavior.toObject(O.behaviors[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PreventUser"},D}(),Z.PreventUsersBehaviorReq=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.PreventUser.encode(O.users[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.PreventUser.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.PreventUser.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return O;let I=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");I.users[z]=$root.com.quick.voice.proto.PreventUser.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.PreventUser.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PreventUsersBehaviorReq"},D}(),Z.PreventUsersBehaviorNotify=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return O;let I=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},D}(),Z.AccelerationAreas=function(){const D={},N=Object.create(D);return N[D[0]="chinaMainland"]=0,N[D[1]="global"]=1,N[D[2]="overseas"]=2,N}(),Z.CountMethods=function(){const D={},N=Object.create(D);return N[D[0]="flow"]=0,N[D[1]="minutes"]=1,N}(),Z.BaseCDNAddress=function(){function D(N){if(this.urlMap={},N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.area=0,D.prototype.countType=0,D.prototype.urlMap=$util.emptyObject,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.area!=null&&Object.hasOwnProperty.call(O,"area")&&I.uint32(8).int32(O.area),O.countType!=null&&Object.hasOwnProperty.call(O,"countType")&&I.uint32(16).int32(O.countType),O.urlMap!=null&&Object.hasOwnProperty.call(O,"urlMap"))for(let z=Object.keys(O.urlMap),J=0;J<z.length;++J)I.uint32(26).fork().uint32(10).string(z[J]).uint32(18).string(O.urlMap[z[J]]).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.BaseCDNAddress,Q,ne;for(;O.pos<z;){let re=O.uint32();switch(re>>>3){case 1:{J.area=O.int32();break}case 2:{J.countType=O.int32();break}case 3:{J.urlMap===$util.emptyObject&&(J.urlMap={});let te=O.uint32()+O.pos;for(Q="",ne="";O.pos<te;){let oe=O.uint32();switch(oe>>>3){case 1:Q=O.string();break;case 2:ne=O.string();break;default:O.skipType(oe&7);break}}J.urlMap[Q]=ne;break}default:O.skipType(re&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.area!=null&&O.hasOwnProperty("area"))switch(O.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(O.countType!=null&&O.hasOwnProperty("countType"))switch(O.countType){default:return"countType: enum value expected";case 0:case 1:break}if(O.urlMap!=null&&O.hasOwnProperty("urlMap")){if(!$util.isObject(O.urlMap))return"urlMap: object expected";let I=Object.keys(O.urlMap);for(let z=0;z<I.length;++z)if(!$util.isString(O.urlMap[I[z]]))return"urlMap: string{k:string} expected"}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.BaseCDNAddress)return O;let I=new $root.com.quick.voice.proto.BaseCDNAddress;switch(O.area){default:if(typeof O.area=="number"){I.area=O.area;break}break;case"chinaMainland":case 0:I.area=0;break;case"global":case 1:I.area=1;break;case"overseas":case 2:I.area=2;break}switch(O.countType){default:if(typeof O.countType=="number"){I.countType=O.countType;break}break;case"flow":case 0:I.countType=0;break;case"minutes":case 1:I.countType=1;break}if(O.urlMap){if(typeof O.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");I.urlMap={};for(let z=Object.keys(O.urlMap),J=0;J<z.length;++J)I.urlMap[z[J]]=String(O.urlMap[z[J]])}return I},D.toObject=function(O,I){I||(I={});let z={};(I.objects||I.defaults)&&(z.urlMap={}),I.defaults&&(z.area=I.enums===String?"chinaMainland":0,z.countType=I.enums===String?"flow":0),O.area!=null&&O.hasOwnProperty("area")&&(z.area=I.enums===String?$root.com.quick.voice.proto.AccelerationAreas[O.area]===void 0?O.area:$root.com.quick.voice.proto.AccelerationAreas[O.area]:O.area),O.countType!=null&&O.hasOwnProperty("countType")&&(z.countType=I.enums===String?$root.com.quick.voice.proto.CountMethods[O.countType]===void 0?O.countType:$root.com.quick.voice.proto.CountMethods[O.countType]:O.countType);let J;if(O.urlMap&&(J=Object.keys(O.urlMap)).length){z.urlMap={};for(let Q=0;Q<J.length;++Q)z.urlMap[J[Q]]=O.urlMap[J[Q]]}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.BaseCDNAddress"},D}(),Z.CDNPlayAddressNotify=function(){function D(O){if(this.standLines=[],O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.roomId="",D.prototype.m3u8=null,D.prototype.rtmp=null,D.prototype.flv=null,D.prototype.rtmps=null,D.prototype.mainLine=null,D.prototype.standLines=$util.emptyArray;let N;return Object.defineProperty(D.prototype,"_m3u8",{get:$util.oneOfGetter(N=["m3u8"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_rtmp",{get:$util.oneOfGetter(N=["rtmp"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_flv",{get:$util.oneOfGetter(N=["flv"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_rtmps",{get:$util.oneOfGetter(N=["rtmps"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_mainLine",{get:$util.oneOfGetter(N=["mainLine"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){if(z||(z=$Writer.create()),I.roomId!=null&&Object.hasOwnProperty.call(I,"roomId")&&z.uint32(10).string(I.roomId),I.m3u8!=null&&Object.hasOwnProperty.call(I,"m3u8")&&z.uint32(18).string(I.m3u8),I.rtmp!=null&&Object.hasOwnProperty.call(I,"rtmp")&&z.uint32(26).string(I.rtmp),I.flv!=null&&Object.hasOwnProperty.call(I,"flv")&&z.uint32(34).string(I.flv),I.rtmps!=null&&Object.hasOwnProperty.call(I,"rtmps")&&z.uint32(42).string(I.rtmps),I.mainLine!=null&&Object.hasOwnProperty.call(I,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(I.mainLine,z.uint32(50).fork()).ldelim(),I.standLines!=null&&I.standLines.length)for(let J=0;J<I.standLines.length;++J)$root.com.quick.voice.proto.BaseCDNAddress.encode(I.standLines[J],z.uint32(58).fork()).ldelim();return z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.roomId=I.string();break}case 2:{Q.m3u8=I.string();break}case 3:{Q.rtmp=I.string();break}case 4:{Q.flv=I.string();break}case 5:{Q.rtmps=I.string();break}case 6:{Q.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(I,I.uint32());break}case 7:{Q.standLines&&Q.standLines.length||(Q.standLines=[]),Q.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(I,I.uint32()));break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.roomId!=null&&I.hasOwnProperty("roomId")&&!$util.isString(I.roomId))return"roomId: string expected";if(I.m3u8!=null&&I.hasOwnProperty("m3u8")&&!$util.isString(I.m3u8))return"m3u8: string expected";if(I.rtmp!=null&&I.hasOwnProperty("rtmp")&&!$util.isString(I.rtmp))return"rtmp: string expected";if(I.flv!=null&&I.hasOwnProperty("flv")&&!$util.isString(I.flv))return"flv: string expected";if(I.rtmps!=null&&I.hasOwnProperty("rtmps")&&!$util.isString(I.rtmps))return"rtmps: string expected";if(I.mainLine!=null&&I.hasOwnProperty("mainLine")){let z=$root.com.quick.voice.proto.BaseCDNAddress.verify(I.mainLine);if(z)return"mainLine."+z}if(I.standLines!=null&&I.hasOwnProperty("standLines")){if(!Array.isArray(I.standLines))return"standLines: array expected";for(let z=0;z<I.standLines.length;++z){let J=$root.com.quick.voice.proto.BaseCDNAddress.verify(I.standLines[z]);if(J)return"standLines."+J}}return null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return I;let z=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(I.roomId!=null&&(z.roomId=String(I.roomId)),I.m3u8!=null&&(z.m3u8=String(I.m3u8)),I.rtmp!=null&&(z.rtmp=String(I.rtmp)),I.flv!=null&&(z.flv=String(I.flv)),I.rtmps!=null&&(z.rtmps=String(I.rtmps)),I.mainLine!=null){if(typeof I.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(I.mainLine)}if(I.standLines){if(!Array.isArray(I.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");z.standLines=[];for(let J=0;J<I.standLines.length;++J){if(typeof I.standLines[J]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");z.standLines[J]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(I.standLines[J])}}return z},D.toObject=function(I,z){z||(z={});let J={};if((z.arrays||z.defaults)&&(J.standLines=[]),z.defaults&&(J.roomId=""),I.roomId!=null&&I.hasOwnProperty("roomId")&&(J.roomId=I.roomId),I.m3u8!=null&&I.hasOwnProperty("m3u8")&&(J.m3u8=I.m3u8,z.oneofs&&(J._m3u8="m3u8")),I.rtmp!=null&&I.hasOwnProperty("rtmp")&&(J.rtmp=I.rtmp,z.oneofs&&(J._rtmp="rtmp")),I.flv!=null&&I.hasOwnProperty("flv")&&(J.flv=I.flv,z.oneofs&&(J._flv="flv")),I.rtmps!=null&&I.hasOwnProperty("rtmps")&&(J.rtmps=I.rtmps,z.oneofs&&(J._rtmps="rtmps")),I.mainLine!=null&&I.hasOwnProperty("mainLine")&&(J.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(I.mainLine,z),z.oneofs&&(J._mainLine="mainLine")),I.standLines&&I.standLines.length){J.standLines=[];for(let Q=0;Q<I.standLines.length;++Q)J.standLines[Q]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(I.standLines[Q],z)}return J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.CDNPlayAddressNotify"},D}(),Z.UserChannel=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.DataChannel.encode(O.channels[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UserChannel;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.DataChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId))return"userId: string expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.DataChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UserChannel)return O;let I=new $root.com.quick.voice.proto.UserChannel;if(O.userId!=null&&(I.userId=String(O.userId)),O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.DataChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),I.defaults&&(z.userId=""),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.DataChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UserChannel"},D}(),Z.ChannelPublishReq=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.DataChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelPublishReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.DataChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.DataChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelPublishReq)return O;let I=new $root.com.quick.voice.proto.ChannelPublishReq;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.DataChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.DataChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelPublishReq"},D}(),Z.ChannelPublishRsq=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.UserChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.UserChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.UserChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return O;let I=new $root.com.quick.voice.proto.ChannelPublishRsq;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.UserChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.UserChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelPublishRsq"},D}(),Z.ChannelSubscribeReq=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.UserChannel.encode(O.users[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.UserChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.UserChannel.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return O;let I=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");I.users[z]=$root.com.quick.voice.proto.UserChannel.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.UserChannel.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelSubscribeReq"},D}(),Z.ChannelSubscribeRsq=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.UserChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.UserChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.UserChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return O;let I=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.UserChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.UserChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelSubscribeRsq"},D}(),Z}(),F}(),K}(),q})(),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(q){let K=q.length;for(;--K>=0;)q[K]=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(q,K,F,Z,D){this.static_tree=q,this.extra_bits=K,this.extra_base=F,this.elems=Z,this.max_length=D,this.has_stree=q&&q.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(q,K){this.dyn_tree=q,this.max_code=0,this.stat_desc=K}const d_code=q=>q<256?_dist_code[q]:_dist_code[256+(q>>>7)],put_short=(q,K)=>{q.pending_buf[q.pending++]=K&255,q.pending_buf[q.pending++]=K>>>8&255},send_bits=(q,K,F)=>{q.bi_valid>Buf_size-F?(q.bi_buf|=K<<q.bi_valid&65535,put_short(q,q.bi_buf),q.bi_buf=K>>Buf_size-q.bi_valid,q.bi_valid+=F-Buf_size):(q.bi_buf|=K<<q.bi_valid&65535,q.bi_valid+=F)},send_code=(q,K,F)=>{send_bits(q,F[K*2],F[K*2+1])},bi_reverse=(q,K)=>{let F=0;do F|=q&1,q>>>=1,F<<=1;while(--K>0);return F>>>1},bi_flush=q=>{q.bi_valid===16?(put_short(q,q.bi_buf),q.bi_buf=0,q.bi_valid=0):q.bi_valid>=8&&(q.pending_buf[q.pending++]=q.bi_buf&255,q.bi_buf>>=8,q.bi_valid-=8)},gen_bitlen=(q,K)=>{const F=K.dyn_tree,Z=K.max_code,D=K.stat_desc.static_tree,N=K.stat_desc.has_stree,O=K.stat_desc.extra_bits,I=K.stat_desc.extra_base,z=K.stat_desc.max_length;let J,Q,ne,re,te,oe,le=0;for(re=0;re<=MAX_BITS$1;re++)q.bl_count[re]=0;for(F[q.heap[q.heap_max]*2+1]=0,J=q.heap_max+1;J<HEAP_SIZE$1;J++)Q=q.heap[J],re=F[F[Q*2+1]*2+1]+1,re>z&&(re=z,le++),F[Q*2+1]=re,!(Q>Z)&&(q.bl_count[re]++,te=0,Q>=I&&(te=O[Q-I]),oe=F[Q*2],q.opt_len+=oe*(re+te),N&&(q.static_len+=oe*(D[Q*2+1]+te)));if(le!==0){do{for(re=z-1;q.bl_count[re]===0;)re--;q.bl_count[re]--,q.bl_count[re+1]+=2,q.bl_count[z]--,le-=2}while(le>0);for(re=z;re!==0;re--)for(Q=q.bl_count[re];Q!==0;)ne=q.heap[--J],!(ne>Z)&&(F[ne*2+1]!==re&&(q.opt_len+=(re-F[ne*2+1])*F[ne*2],F[ne*2+1]=re),Q--)}},gen_codes=(q,K,F)=>{const Z=new Array(MAX_BITS$1+1);let D=0,N,O;for(N=1;N<=MAX_BITS$1;N++)D=D+F[N-1]<<1,Z[N]=D;for(O=0;O<=K;O++){let I=q[O*2+1];I!==0&&(q[O*2]=bi_reverse(Z[I]++,I))}},tr_static_init=()=>{let q,K,F,Z,D;const N=new Array(MAX_BITS$1+1);for(F=0,Z=0;Z<LENGTH_CODES$1-1;Z++)for(base_length[Z]=F,q=0;q<1<<extra_lbits[Z];q++)_length_code[F++]=Z;for(_length_code[F-1]=Z,D=0,Z=0;Z<16;Z++)for(base_dist[Z]=D,q=0;q<1<<extra_dbits[Z];q++)_dist_code[D++]=Z;for(D>>=7;Z<D_CODES$1;Z++)for(base_dist[Z]=D<<7,q=0;q<1<<extra_dbits[Z]-7;q++)_dist_code[256+D++]=Z;for(K=0;K<=MAX_BITS$1;K++)N[K]=0;for(q=0;q<=143;)static_ltree[q*2+1]=8,q++,N[8]++;for(;q<=255;)static_ltree[q*2+1]=9,q++,N[9]++;for(;q<=279;)static_ltree[q*2+1]=7,q++,N[7]++;for(;q<=287;)static_ltree[q*2+1]=8,q++,N[8]++;for(gen_codes(static_ltree,L_CODES$1+1,N),q=0;q<D_CODES$1;q++)static_dtree[q*2+1]=5,static_dtree[q*2]=bi_reverse(q,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=q=>{let K;for(K=0;K<L_CODES$1;K++)q.dyn_ltree[K*2]=0;for(K=0;K<D_CODES$1;K++)q.dyn_dtree[K*2]=0;for(K=0;K<BL_CODES$1;K++)q.bl_tree[K*2]=0;q.dyn_ltree[END_BLOCK*2]=1,q.opt_len=q.static_len=0,q.sym_next=q.matches=0},bi_windup=q=>{q.bi_valid>8?put_short(q,q.bi_buf):q.bi_valid>0&&(q.pending_buf[q.pending++]=q.bi_buf),q.bi_buf=0,q.bi_valid=0},smaller=(q,K,F,Z)=>{const D=K*2,N=F*2;return q[D]<q[N]||q[D]===q[N]&&Z[K]<=Z[F]},pqdownheap=(q,K,F)=>{const Z=q.heap[F];let D=F<<1;for(;D<=q.heap_len&&(D<q.heap_len&&smaller(K,q.heap[D+1],q.heap[D],q.depth)&&D++,!smaller(K,Z,q.heap[D],q.depth));)q.heap[F]=q.heap[D],F=D,D<<=1;q.heap[F]=Z},compress_block=(q,K,F)=>{let Z,D,N=0,O,I;if(q.sym_next!==0)do Z=q.pending_buf[q.sym_buf+N++]&255,Z+=(q.pending_buf[q.sym_buf+N++]&255)<<8,D=q.pending_buf[q.sym_buf+N++],Z===0?send_code(q,D,K):(O=_length_code[D],send_code(q,O+LITERALS$1+1,K),I=extra_lbits[O],I!==0&&(D-=base_length[O],send_bits(q,D,I)),Z--,O=d_code(Z),send_code(q,O,F),I=extra_dbits[O],I!==0&&(Z-=base_dist[O],send_bits(q,Z,I)));while(N<q.sym_next);send_code(q,END_BLOCK,K)},build_tree=(q,K)=>{const F=K.dyn_tree,Z=K.stat_desc.static_tree,D=K.stat_desc.has_stree,N=K.stat_desc.elems;let O,I,z=-1,J;for(q.heap_len=0,q.heap_max=HEAP_SIZE$1,O=0;O<N;O++)F[O*2]!==0?(q.heap[++q.heap_len]=z=O,q.depth[O]=0):F[O*2+1]=0;for(;q.heap_len<2;)J=q.heap[++q.heap_len]=z<2?++z:0,F[J*2]=1,q.depth[J]=0,q.opt_len--,D&&(q.static_len-=Z[J*2+1]);for(K.max_code=z,O=q.heap_len>>1;O>=1;O--)pqdownheap(q,F,O);J=N;do O=q.heap[1],q.heap[1]=q.heap[q.heap_len--],pqdownheap(q,F,1),I=q.heap[1],q.heap[--q.heap_max]=O,q.heap[--q.heap_max]=I,F[J*2]=F[O*2]+F[I*2],q.depth[J]=(q.depth[O]>=q.depth[I]?q.depth[O]:q.depth[I])+1,F[O*2+1]=F[I*2+1]=J,q.heap[1]=J++,pqdownheap(q,F,1);while(q.heap_len>=2);q.heap[--q.heap_max]=q.heap[1],gen_bitlen(q,K),gen_codes(F,z,q.bl_count)},scan_tree=(q,K,F)=>{let Z,D=-1,N,O=K[0*2+1],I=0,z=7,J=4;for(O===0&&(z=138,J=3),K[(F+1)*2+1]=65535,Z=0;Z<=F;Z++)N=O,O=K[(Z+1)*2+1],!(++I<z&&N===O)&&(I<J?q.bl_tree[N*2]+=I:N!==0?(N!==D&&q.bl_tree[N*2]++,q.bl_tree[REP_3_6*2]++):I<=10?q.bl_tree[REPZ_3_10*2]++:q.bl_tree[REPZ_11_138*2]++,I=0,D=N,O===0?(z=138,J=3):N===O?(z=6,J=3):(z=7,J=4))},send_tree=(q,K,F)=>{let Z,D=-1,N,O=K[0*2+1],I=0,z=7,J=4;for(O===0&&(z=138,J=3),Z=0;Z<=F;Z++)if(N=O,O=K[(Z+1)*2+1],!(++I<z&&N===O)){if(I<J)do send_code(q,N,q.bl_tree);while(--I!==0);else N!==0?(N!==D&&(send_code(q,N,q.bl_tree),I--),send_code(q,REP_3_6,q.bl_tree),send_bits(q,I-3,2)):I<=10?(send_code(q,REPZ_3_10,q.bl_tree),send_bits(q,I-3,3)):(send_code(q,REPZ_11_138,q.bl_tree),send_bits(q,I-11,7));I=0,D=N,O===0?(z=138,J=3):N===O?(z=6,J=3):(z=7,J=4)}},build_bl_tree=q=>{let K;for(scan_tree(q,q.dyn_ltree,q.l_desc.max_code),scan_tree(q,q.dyn_dtree,q.d_desc.max_code),build_tree(q,q.bl_desc),K=BL_CODES$1-1;K>=3&&q.bl_tree[bl_order[K]*2+1]===0;K--);return q.opt_len+=3*(K+1)+5+5+4,K},send_all_trees=(q,K,F,Z)=>{let D;for(send_bits(q,K-257,5),send_bits(q,F-1,5),send_bits(q,Z-4,4),D=0;D<Z;D++)send_bits(q,q.bl_tree[bl_order[D]*2+1],3);send_tree(q,q.dyn_ltree,K-1),send_tree(q,q.dyn_dtree,F-1)},detect_data_type=q=>{let K=4093624447,F;for(F=0;F<=31;F++,K>>>=1)if(K&1&&q.dyn_ltree[F*2]!==0)return Z_BINARY;if(q.dyn_ltree[9*2]!==0||q.dyn_ltree[10*2]!==0||q.dyn_ltree[13*2]!==0)return Z_TEXT;for(F=32;F<LITERALS$1;F++)if(q.dyn_ltree[F*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=q=>{static_init_done||(tr_static_init(),static_init_done=!0),q.l_desc=new TreeDesc(q.dyn_ltree,static_l_desc),q.d_desc=new TreeDesc(q.dyn_dtree,static_d_desc),q.bl_desc=new TreeDesc(q.bl_tree,static_bl_desc),q.bi_buf=0,q.bi_valid=0,init_block(q)},_tr_stored_block$1=(q,K,F,Z)=>{send_bits(q,(STORED_BLOCK<<1)+(Z?1:0),3),bi_windup(q),put_short(q,F),put_short(q,~F),F&&q.pending_buf.set(q.window.subarray(K,K+F),q.pending),q.pending+=F},_tr_align$1=q=>{send_bits(q,STATIC_TREES<<1,3),send_code(q,END_BLOCK,static_ltree),bi_flush(q)},_tr_flush_block$1=(q,K,F,Z)=>{let D,N,O=0;q.level>0?(q.strm.data_type===Z_UNKNOWN$1&&(q.strm.data_type=detect_data_type(q)),build_tree(q,q.l_desc),build_tree(q,q.d_desc),O=build_bl_tree(q),D=q.opt_len+3+7>>>3,N=q.static_len+3+7>>>3,N<=D&&(D=N)):D=N=F+5,F+4<=D&&K!==-1?_tr_stored_block$1(q,K,F,Z):q.strategy===Z_FIXED$1||N===D?(send_bits(q,(STATIC_TREES<<1)+(Z?1:0),3),compress_block(q,static_ltree,static_dtree)):(send_bits(q,(DYN_TREES<<1)+(Z?1:0),3),send_all_trees(q,q.l_desc.max_code+1,q.d_desc.max_code+1,O+1),compress_block(q,q.dyn_ltree,q.dyn_dtree)),init_block(q),Z&&bi_windup(q)},_tr_tally$1=(q,K,F)=>(q.pending_buf[q.sym_buf+q.sym_next++]=K,q.pending_buf[q.sym_buf+q.sym_next++]=K>>8,q.pending_buf[q.sym_buf+q.sym_next++]=F,K===0?q.dyn_ltree[F*2]++:(q.matches++,K--,q.dyn_ltree[(_length_code[F]+LITERALS$1+1)*2]++,q.dyn_dtree[d_code(K)*2]++),q.sym_next===q.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=(q,K,F,Z)=>{let D=q&65535|0,N=q>>>16&65535|0,O=0;for(;F!==0;){O=F>2e3?2e3:F,F-=O;do D=D+K[Z++]|0,N=N+D|0;while(--O);D%=65521,N%=65521}return D|N<<16|0};var adler32_1=adler32;const makeTable=()=>{let q,K=[];for(var F=0;F<256;F++){q=F;for(var Z=0;Z<8;Z++)q=q&1?3988292384^q>>>1:q>>>1;K[F]=q}return K},crcTable=new Uint32Array(makeTable()),crc32=(q,K,F,Z)=>{const D=crcTable,N=Z+F;q^=-1;for(let O=Z;O<N;O++)q=q>>>8^D[(q^K[O])&255];return q^-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=(q,K)=>(q.msg=messages[K],K),rank=q=>q*2-(q>4?9:0),zero=q=>{let K=q.length;for(;--K>=0;)q[K]=0},slide_hash=q=>{let K,F,Z,D=q.w_size;K=q.hash_size,Z=K;do F=q.head[--Z],q.head[Z]=F>=D?F-D:0;while(--K);K=D,Z=K;do F=q.prev[--Z],q.prev[Z]=F>=D?F-D:0;while(--K)};let HASH_ZLIB=(q,K,F)=>(K<<q.hash_shift^F)&q.hash_mask,HASH=HASH_ZLIB;const flush_pending=q=>{const K=q.state;let F=K.pending;F>q.avail_out&&(F=q.avail_out),F!==0&&(q.output.set(K.pending_buf.subarray(K.pending_out,K.pending_out+F),q.next_out),q.next_out+=F,K.pending_out+=F,q.total_out+=F,q.avail_out-=F,K.pending-=F,K.pending===0&&(K.pending_out=0))},flush_block_only=(q,K)=>{_tr_flush_block(q,q.block_start>=0?q.block_start:-1,q.strstart-q.block_start,K),q.block_start=q.strstart,flush_pending(q.strm)},put_byte=(q,K)=>{q.pending_buf[q.pending++]=K},putShortMSB=(q,K)=>{q.pending_buf[q.pending++]=K>>>8&255,q.pending_buf[q.pending++]=K&255},read_buf=(q,K,F,Z)=>{let D=q.avail_in;return D>Z&&(D=Z),D===0?0:(q.avail_in-=D,K.set(q.input.subarray(q.next_in,q.next_in+D),F),q.state.wrap===1?q.adler=adler32_1(q.adler,K,D,F):q.state.wrap===2&&(q.adler=crc32_1(q.adler,K,D,F)),q.next_in+=D,q.total_in+=D,D)},longest_match=(q,K)=>{let F=q.max_chain_length,Z=q.strstart,D,N,O=q.prev_length,I=q.nice_match;const z=q.strstart>q.w_size-MIN_LOOKAHEAD?q.strstart-(q.w_size-MIN_LOOKAHEAD):0,J=q.window,Q=q.w_mask,ne=q.prev,re=q.strstart+MAX_MATCH;let te=J[Z+O-1],oe=J[Z+O];q.prev_length>=q.good_match&&(F>>=2),I>q.lookahead&&(I=q.lookahead);do if(D=K,!(J[D+O]!==oe||J[D+O-1]!==te||J[D]!==J[Z]||J[++D]!==J[Z+1])){Z+=2,D++;do;while(J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&Z<re);if(N=MAX_MATCH-(re-Z),Z=re-MAX_MATCH,N>O){if(q.match_start=K,O=N,N>=I)break;te=J[Z+O-1],oe=J[Z+O]}}while((K=ne[K&Q])>z&&--F!==0);return O<=q.lookahead?O:q.lookahead},fill_window=q=>{const K=q.w_size;let F,Z,D;do{if(Z=q.window_size-q.lookahead-q.strstart,q.strstart>=K+(K-MIN_LOOKAHEAD)&&(q.window.set(q.window.subarray(K,K+K-Z),0),q.match_start-=K,q.strstart-=K,q.block_start-=K,q.insert>q.strstart&&(q.insert=q.strstart),slide_hash(q),Z+=K),q.strm.avail_in===0)break;if(F=read_buf(q.strm,q.window,q.strstart+q.lookahead,Z),q.lookahead+=F,q.lookahead+q.insert>=MIN_MATCH)for(D=q.strstart-q.insert,q.ins_h=q.window[D],q.ins_h=HASH(q,q.ins_h,q.window[D+1]);q.insert&&(q.ins_h=HASH(q,q.ins_h,q.window[D+MIN_MATCH-1]),q.prev[D&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=D,D++,q.insert--,!(q.lookahead+q.insert<MIN_MATCH)););}while(q.lookahead<MIN_LOOKAHEAD&&q.strm.avail_in!==0)},deflate_stored=(q,K)=>{let F=q.pending_buf_size-5>q.w_size?q.w_size:q.pending_buf_size-5,Z,D,N,O=0,I=q.strm.avail_in;do{if(Z=65535,N=q.bi_valid+42>>3,q.strm.avail_out<N||(N=q.strm.avail_out-N,D=q.strstart-q.block_start,Z>D+q.strm.avail_in&&(Z=D+q.strm.avail_in),Z>N&&(Z=N),Z<F&&(Z===0&&K!==Z_FINISH$3||K===Z_NO_FLUSH$2||Z!==D+q.strm.avail_in)))break;O=K===Z_FINISH$3&&Z===D+q.strm.avail_in?1:0,_tr_stored_block(q,0,0,O),q.pending_buf[q.pending-4]=Z,q.pending_buf[q.pending-3]=Z>>8,q.pending_buf[q.pending-2]=~Z,q.pending_buf[q.pending-1]=~Z>>8,flush_pending(q.strm),D&&(D>Z&&(D=Z),q.strm.output.set(q.window.subarray(q.block_start,q.block_start+D),q.strm.next_out),q.strm.next_out+=D,q.strm.avail_out-=D,q.strm.total_out+=D,q.block_start+=D,Z-=D),Z&&(read_buf(q.strm,q.strm.output,q.strm.next_out,Z),q.strm.next_out+=Z,q.strm.avail_out-=Z,q.strm.total_out+=Z)}while(O===0);return I-=q.strm.avail_in,I&&(I>=q.w_size?(q.matches=2,q.window.set(q.strm.input.subarray(q.strm.next_in-q.w_size,q.strm.next_in),0),q.strstart=q.w_size,q.insert=q.strstart):(q.window_size-q.strstart<=I&&(q.strstart-=q.w_size,q.window.set(q.window.subarray(q.w_size,q.w_size+q.strstart),0),q.matches<2&&q.matches++,q.insert>q.strstart&&(q.insert=q.strstart)),q.window.set(q.strm.input.subarray(q.strm.next_in-I,q.strm.next_in),q.strstart),q.strstart+=I,q.insert+=I>q.w_size-q.insert?q.w_size-q.insert:I),q.block_start=q.strstart),q.high_water<q.strstart&&(q.high_water=q.strstart),O?BS_FINISH_DONE:K!==Z_NO_FLUSH$2&&K!==Z_FINISH$3&&q.strm.avail_in===0&&q.strstart===q.block_start?BS_BLOCK_DONE:(N=q.window_size-q.strstart,q.strm.avail_in>N&&q.block_start>=q.w_size&&(q.block_start-=q.w_size,q.strstart-=q.w_size,q.window.set(q.window.subarray(q.w_size,q.w_size+q.strstart),0),q.matches<2&&q.matches++,N+=q.w_size,q.insert>q.strstart&&(q.insert=q.strstart)),N>q.strm.avail_in&&(N=q.strm.avail_in),N&&(read_buf(q.strm,q.window,q.strstart,N),q.strstart+=N,q.insert+=N>q.w_size-q.insert?q.w_size-q.insert:N),q.high_water<q.strstart&&(q.high_water=q.strstart),N=q.bi_valid+42>>3,N=q.pending_buf_size-N>65535?65535:q.pending_buf_size-N,F=N>q.w_size?q.w_size:N,D=q.strstart-q.block_start,(D>=F||(D||K===Z_FINISH$3)&&K!==Z_NO_FLUSH$2&&q.strm.avail_in===0&&D<=N)&&(Z=D>N?N:D,O=K===Z_FINISH$3&&q.strm.avail_in===0&&Z===D?1:0,_tr_stored_block(q,q.block_start,Z,O),q.block_start+=Z,flush_pending(q.strm)),O?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(q,K)=>{let F,Z;for(;;){if(q.lookahead<MIN_LOOKAHEAD){if(fill_window(q),q.lookahead<MIN_LOOKAHEAD&&K===Z_NO_FLUSH$2)return BS_NEED_MORE;if(q.lookahead===0)break}if(F=0,q.lookahead>=MIN_MATCH&&(q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),F!==0&&q.strstart-F<=q.w_size-MIN_LOOKAHEAD&&(q.match_length=longest_match(q,F)),q.match_length>=MIN_MATCH)if(Z=_tr_tally(q,q.strstart-q.match_start,q.match_length-MIN_MATCH),q.lookahead-=q.match_length,q.match_length<=q.max_lazy_match&&q.lookahead>=MIN_MATCH){q.match_length--;do q.strstart++,q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart;while(--q.match_length!==0);q.strstart++}else q.strstart+=q.match_length,q.match_length=0,q.ins_h=q.window[q.strstart],q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+1]);else Z=_tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++;if(Z&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}return q.insert=q.strstart<MIN_MATCH-1?q.strstart:MIN_MATCH-1,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(q,K)=>{let F,Z,D;for(;;){if(q.lookahead<MIN_LOOKAHEAD){if(fill_window(q),q.lookahead<MIN_LOOKAHEAD&&K===Z_NO_FLUSH$2)return BS_NEED_MORE;if(q.lookahead===0)break}if(F=0,q.lookahead>=MIN_MATCH&&(q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),q.prev_length=q.match_length,q.prev_match=q.match_start,q.match_length=MIN_MATCH-1,F!==0&&q.prev_length<q.max_lazy_match&&q.strstart-F<=q.w_size-MIN_LOOKAHEAD&&(q.match_length=longest_match(q,F),q.match_length<=5&&(q.strategy===Z_FILTERED||q.match_length===MIN_MATCH&&q.strstart-q.match_start>4096)&&(q.match_length=MIN_MATCH-1)),q.prev_length>=MIN_MATCH&&q.match_length<=q.prev_length){D=q.strstart+q.lookahead-MIN_MATCH,Z=_tr_tally(q,q.strstart-1-q.prev_match,q.prev_length-MIN_MATCH),q.lookahead-=q.prev_length-1,q.prev_length-=2;do++q.strstart<=D&&(q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart);while(--q.prev_length!==0);if(q.match_available=0,q.match_length=MIN_MATCH-1,q.strstart++,Z&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}else if(q.match_available){if(Z=_tr_tally(q,0,q.window[q.strstart-1]),Z&&flush_block_only(q,!1),q.strstart++,q.lookahead--,q.strm.avail_out===0)return BS_NEED_MORE}else q.match_available=1,q.strstart++,q.lookahead--}return q.match_available&&(Z=_tr_tally(q,0,q.window[q.strstart-1]),q.match_available=0),q.insert=q.strstart<MIN_MATCH-1?q.strstart:MIN_MATCH-1,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(q,K)=>{let F,Z,D,N;const O=q.window;for(;;){if(q.lookahead<=MAX_MATCH){if(fill_window(q),q.lookahead<=MAX_MATCH&&K===Z_NO_FLUSH$2)return BS_NEED_MORE;if(q.lookahead===0)break}if(q.match_length=0,q.lookahead>=MIN_MATCH&&q.strstart>0&&(D=q.strstart-1,Z=O[D],Z===O[++D]&&Z===O[++D]&&Z===O[++D])){N=q.strstart+MAX_MATCH;do;while(Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&D<N);q.match_length=MAX_MATCH-(N-D),q.match_length>q.lookahead&&(q.match_length=q.lookahead)}if(q.match_length>=MIN_MATCH?(F=_tr_tally(q,1,q.match_length-MIN_MATCH),q.lookahead-=q.match_length,q.strstart+=q.match_length,q.match_length=0):(F=_tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++),F&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}return q.insert=0,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(q,K)=>{let F;for(;;){if(q.lookahead===0&&(fill_window(q),q.lookahead===0)){if(K===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(q.match_length=0,F=_tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++,F&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}return q.insert=0,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(q,K,F,Z,D){this.good_length=q,this.max_lazy=K,this.nice_length=F,this.max_chain=Z,this.func=D}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=q=>{q.window_size=2*q.w_size,zero(q.head),q.max_lazy_match=configuration_table[q.level].max_lazy,q.good_match=configuration_table[q.level].good_length,q.nice_match=configuration_table[q.level].nice_length,q.max_chain_length=configuration_table[q.level].max_chain,q.strstart=0,q.block_start=0,q.lookahead=0,q.insert=0,q.match_length=q.prev_length=MIN_MATCH-1,q.match_available=0,q.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=q=>{if(!q)return 1;const K=q.state;return!K||K.strm!==q||K.status!==INIT_STATE&&K.status!==GZIP_STATE&&K.status!==EXTRA_STATE&&K.status!==NAME_STATE&&K.status!==COMMENT_STATE&&K.status!==HCRC_STATE&&K.status!==BUSY_STATE&&K.status!==FINISH_STATE?1:0},deflateResetKeep=q=>{if(deflateStateCheck(q))return err(q,Z_STREAM_ERROR$2);q.total_in=q.total_out=0,q.data_type=Z_UNKNOWN;const K=q.state;return K.pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap===2?GZIP_STATE:K.wrap?INIT_STATE:BUSY_STATE,q.adler=K.wrap===2?0:1,K.last_flush=-2,_tr_init(K),Z_OK$3},deflateReset=q=>{const K=deflateResetKeep(q);return K===Z_OK$3&&lm_init(q.state),K},deflateSetHeader=(q,K)=>deflateStateCheck(q)||q.state.wrap!==2?Z_STREAM_ERROR$2:(q.state.gzhead=K,Z_OK$3),deflateInit2=(q,K,F,Z,D,N)=>{if(!q)return Z_STREAM_ERROR$2;let O=1;if(K===Z_DEFAULT_COMPRESSION$1&&(K=6),Z<0?(O=0,Z=-Z):Z>15&&(O=2,Z-=16),D<1||D>MAX_MEM_LEVEL||F!==Z_DEFLATED$2||Z<8||Z>15||K<0||K>9||N<0||N>Z_FIXED||Z===8&&O!==1)return err(q,Z_STREAM_ERROR$2);Z===8&&(Z=9);const I=new DeflateState;return q.state=I,I.strm=q,I.status=INIT_STATE,I.wrap=O,I.gzhead=null,I.w_bits=Z,I.w_size=1<<I.w_bits,I.w_mask=I.w_size-1,I.hash_bits=D+7,I.hash_size=1<<I.hash_bits,I.hash_mask=I.hash_size-1,I.hash_shift=~~((I.hash_bits+MIN_MATCH-1)/MIN_MATCH),I.window=new Uint8Array(I.w_size*2),I.head=new Uint16Array(I.hash_size),I.prev=new Uint16Array(I.w_size),I.lit_bufsize=1<<D+6,I.pending_buf_size=I.lit_bufsize*4,I.pending_buf=new Uint8Array(I.pending_buf_size),I.sym_buf=I.lit_bufsize,I.sym_end=(I.lit_bufsize-1)*3,I.level=K,I.strategy=N,I.method=F,deflateReset(q)},deflateInit=(q,K)=>deflateInit2(q,K,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(q,K)=>{if(deflateStateCheck(q)||K>Z_BLOCK$1||K<0)return q?err(q,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const F=q.state;if(!q.output||q.avail_in!==0&&!q.input||F.status===FINISH_STATE&&K!==Z_FINISH$3)return err(q,q.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const Z=F.last_flush;if(F.last_flush=K,F.pending!==0){if(flush_pending(q),q.avail_out===0)return F.last_flush=-1,Z_OK$3}else if(q.avail_in===0&&rank(K)<=rank(Z)&&K!==Z_FINISH$3)return err(q,Z_BUF_ERROR$1);if(F.status===FINISH_STATE&&q.avail_in!==0)return err(q,Z_BUF_ERROR$1);if(F.status===INIT_STATE&&F.wrap===0&&(F.status=BUSY_STATE),F.status===INIT_STATE){let D=Z_DEFLATED$2+(F.w_bits-8<<4)<<8,N=-1;if(F.strategy>=Z_HUFFMAN_ONLY||F.level<2?N=0:F.level<6?N=1:F.level===6?N=2:N=3,D|=N<<6,F.strstart!==0&&(D|=PRESET_DICT),D+=31-D%31,putShortMSB(F,D),F.strstart!==0&&(putShortMSB(F,q.adler>>>16),putShortMSB(F,q.adler&65535)),q.adler=1,F.status=BUSY_STATE,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3}if(F.status===GZIP_STATE){if(q.adler=0,put_byte(F,31),put_byte(F,139),put_byte(F,8),F.gzhead)put_byte(F,(F.gzhead.text?1:0)+(F.gzhead.hcrc?2:0)+(F.gzhead.extra?4:0)+(F.gzhead.name?8:0)+(F.gzhead.comment?16:0)),put_byte(F,F.gzhead.time&255),put_byte(F,F.gzhead.time>>8&255),put_byte(F,F.gzhead.time>>16&255),put_byte(F,F.gzhead.time>>24&255),put_byte(F,F.level===9?2:F.strategy>=Z_HUFFMAN_ONLY||F.level<2?4:0),put_byte(F,F.gzhead.os&255),F.gzhead.extra&&F.gzhead.extra.length&&(put_byte(F,F.gzhead.extra.length&255),put_byte(F,F.gzhead.extra.length>>8&255)),F.gzhead.hcrc&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending,0)),F.gzindex=0,F.status=EXTRA_STATE;else if(put_byte(F,0),put_byte(F,0),put_byte(F,0),put_byte(F,0),put_byte(F,0),put_byte(F,F.level===9?2:F.strategy>=Z_HUFFMAN_ONLY||F.level<2?4:0),put_byte(F,OS_CODE),F.status=BUSY_STATE,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3}if(F.status===EXTRA_STATE){if(F.gzhead.extra){let D=F.pending,N=(F.gzhead.extra.length&65535)-F.gzindex;for(;F.pending+N>F.pending_buf_size;){let I=F.pending_buf_size-F.pending;if(F.pending_buf.set(F.gzhead.extra.subarray(F.gzindex,F.gzindex+I),F.pending),F.pending=F.pending_buf_size,F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),F.gzindex+=I,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3;D=0,N-=I}let O=new Uint8Array(F.gzhead.extra);F.pending_buf.set(O.subarray(F.gzindex,F.gzindex+N),F.pending),F.pending+=N,F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),F.gzindex=0}F.status=NAME_STATE}if(F.status===NAME_STATE){if(F.gzhead.name){let D=F.pending,N;do{if(F.pending===F.pending_buf_size){if(F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3;D=0}F.gzindex<F.gzhead.name.length?N=F.gzhead.name.charCodeAt(F.gzindex++)&255:N=0,put_byte(F,N)}while(N!==0);F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),F.gzindex=0}F.status=COMMENT_STATE}if(F.status===COMMENT_STATE){if(F.gzhead.comment){let D=F.pending,N;do{if(F.pending===F.pending_buf_size){if(F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3;D=0}F.gzindex<F.gzhead.comment.length?N=F.gzhead.comment.charCodeAt(F.gzindex++)&255:N=0,put_byte(F,N)}while(N!==0);F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D))}F.status=HCRC_STATE}if(F.status===HCRC_STATE){if(F.gzhead.hcrc){if(F.pending+2>F.pending_buf_size&&(flush_pending(q),F.pending!==0))return F.last_flush=-1,Z_OK$3;put_byte(F,q.adler&255),put_byte(F,q.adler>>8&255),q.adler=0}if(F.status=BUSY_STATE,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3}if(q.avail_in!==0||F.lookahead!==0||K!==Z_NO_FLUSH$2&&F.status!==FINISH_STATE){let D=F.level===0?deflate_stored(F,K):F.strategy===Z_HUFFMAN_ONLY?deflate_huff(F,K):F.strategy===Z_RLE?deflate_rle(F,K):configuration_table[F.level].func(F,K);if((D===BS_FINISH_STARTED||D===BS_FINISH_DONE)&&(F.status=FINISH_STATE),D===BS_NEED_MORE||D===BS_FINISH_STARTED)return q.avail_out===0&&(F.last_flush=-1),Z_OK$3;if(D===BS_BLOCK_DONE&&(K===Z_PARTIAL_FLUSH?_tr_align(F):K!==Z_BLOCK$1&&(_tr_stored_block(F,0,0,!1),K===Z_FULL_FLUSH$1&&(zero(F.head),F.lookahead===0&&(F.strstart=0,F.block_start=0,F.insert=0))),flush_pending(q),q.avail_out===0))return F.last_flush=-1,Z_OK$3}return K!==Z_FINISH$3?Z_OK$3:F.wrap<=0?Z_STREAM_END$3:(F.wrap===2?(put_byte(F,q.adler&255),put_byte(F,q.adler>>8&255),put_byte(F,q.adler>>16&255),put_byte(F,q.adler>>24&255),put_byte(F,q.total_in&255),put_byte(F,q.total_in>>8&255),put_byte(F,q.total_in>>16&255),put_byte(F,q.total_in>>24&255)):(putShortMSB(F,q.adler>>>16),putShortMSB(F,q.adler&65535)),flush_pending(q),F.wrap>0&&(F.wrap=-F.wrap),F.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=q=>{if(deflateStateCheck(q))return Z_STREAM_ERROR$2;const K=q.state.status;return q.state=null,K===BUSY_STATE?err(q,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(q,K)=>{let F=K.length;if(deflateStateCheck(q))return Z_STREAM_ERROR$2;const Z=q.state,D=Z.wrap;if(D===2||D===1&&Z.status!==INIT_STATE||Z.lookahead)return Z_STREAM_ERROR$2;if(D===1&&(q.adler=adler32_1(q.adler,K,F,0)),Z.wrap=0,F>=Z.w_size){D===0&&(zero(Z.head),Z.strstart=0,Z.block_start=0,Z.insert=0);let z=new Uint8Array(Z.w_size);z.set(K.subarray(F-Z.w_size,F),0),K=z,F=Z.w_size}const N=q.avail_in,O=q.next_in,I=q.input;for(q.avail_in=F,q.next_in=0,q.input=K,fill_window(Z);Z.lookahead>=MIN_MATCH;){let z=Z.strstart,J=Z.lookahead-(MIN_MATCH-1);do Z.ins_h=HASH(Z,Z.ins_h,Z.window[z+MIN_MATCH-1]),Z.prev[z&Z.w_mask]=Z.head[Z.ins_h],Z.head[Z.ins_h]=z,z++;while(--J);Z.strstart=z,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,q.next_in=O,q.input=I,q.avail_in=N,Z.wrap=D,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=(q,K)=>Object.prototype.hasOwnProperty.call(q,K);var assign=function(q){const K=Array.prototype.slice.call(arguments,1);for(;K.length;){const F=K.shift();if(F){if(typeof F!="object")throw new TypeError(F+"must be non-object");for(const Z in F)_has(F,Z)&&(q[Z]=F[Z])}}return q},flattenChunks=q=>{let K=0;for(let Z=0,D=q.length;Z<D;Z++)K+=q[Z].length;const F=new Uint8Array(K);for(let Z=0,D=0,N=q.length;Z<N;Z++){let O=q[Z];F.set(O,D),D+=O.length}return F},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(q){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let q=0;q<256;q++)_utf8len[q]=q>=252?6:q>=248?5:q>=240?4:q>=224?3:q>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=q=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(q);let K,F,Z,D,N,O=q.length,I=0;for(D=0;D<O;D++)F=q.charCodeAt(D),(F&64512)===55296&&D+1<O&&(Z=q.charCodeAt(D+1),(Z&64512)===56320&&(F=65536+(F-55296<<10)+(Z-56320),D++)),I+=F<128?1:F<2048?2:F<65536?3:4;for(K=new Uint8Array(I),N=0,D=0;N<I;D++)F=q.charCodeAt(D),(F&64512)===55296&&D+1<O&&(Z=q.charCodeAt(D+1),(Z&64512)===56320&&(F=65536+(F-55296<<10)+(Z-56320),D++)),F<128?K[N++]=F:F<2048?(K[N++]=192|F>>>6,K[N++]=128|F&63):F<65536?(K[N++]=224|F>>>12,K[N++]=128|F>>>6&63,K[N++]=128|F&63):(K[N++]=240|F>>>18,K[N++]=128|F>>>12&63,K[N++]=128|F>>>6&63,K[N++]=128|F&63);return K};const buf2binstring=(q,K)=>{if(K<65534&&q.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,q.length===K?q:q.subarray(0,K));let F="";for(let Z=0;Z<K;Z++)F+=String.fromCharCode(q[Z]);return F};var buf2string=(q,K)=>{const F=K||q.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(q.subarray(0,K));let Z,D;const N=new Array(F*2);for(D=0,Z=0;Z<F;){let O=q[Z++];if(O<128){N[D++]=O;continue}let I=_utf8len[O];if(I>4){N[D++]=65533,Z+=I-1;continue}for(O&=I===2?31:I===3?15:7;I>1&&Z<F;)O=O<<6|q[Z++]&63,I--;if(I>1){N[D++]=65533;continue}O<65536?N[D++]=O:(O-=65536,N[D++]=55296|O>>10&1023,N[D++]=56320|O&1023)}return buf2binstring(N,D)},utf8border=(q,K)=>{K=K||q.length,K>q.length&&(K=q.length);let F=K-1;for(;F>=0&&(q[F]&192)===128;)F--;return F<0||F===0?K:F+_utf8len[q[F]]>K?F:K},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(q){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},q||{});let K=this.options;K.raw&&K.windowBits>0?K.windowBits=-K.windowBits:K.gzip&&K.windowBits>0&&K.windowBits<16&&(K.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let F=deflate_1$2.deflateInit2(this.strm,K.level,K.method,K.windowBits,K.memLevel,K.strategy);if(F!==Z_OK$2)throw new Error(messages[F]);if(K.header&&deflate_1$2.deflateSetHeader(this.strm,K.header),K.dictionary){let Z;if(typeof K.dictionary=="string"?Z=strings.string2buf(K.dictionary):toString$1.call(K.dictionary)==="[object ArrayBuffer]"?Z=new Uint8Array(K.dictionary):Z=K.dictionary,F=deflate_1$2.deflateSetDictionary(this.strm,Z),F!==Z_OK$2)throw new Error(messages[F]);this._dict_set=!0}}Deflate$1.prototype.push=function(q,K){const F=this.strm,Z=this.options.chunkSize;let D,N;if(this.ended)return!1;for(K===~~K?N=K:N=K===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof q=="string"?F.input=strings.string2buf(q):toString$1.call(q)==="[object ArrayBuffer]"?F.input=new Uint8Array(q):F.input=q,F.next_in=0,F.avail_in=F.input.length;;){if(F.avail_out===0&&(F.output=new Uint8Array(Z),F.next_out=0,F.avail_out=Z),(N===Z_SYNC_FLUSH||N===Z_FULL_FLUSH)&&F.avail_out<=6){this.onData(F.output.subarray(0,F.next_out)),F.avail_out=0;continue}if(D=deflate_1$2.deflate(F,N),D===Z_STREAM_END$2)return F.next_out>0&&this.onData(F.output.subarray(0,F.next_out)),D=deflate_1$2.deflateEnd(this.strm),this.onEnd(D),this.ended=!0,D===Z_OK$2;if(F.avail_out===0){this.onData(F.output);continue}if(N>0&&F.next_out>0){this.onData(F.output.subarray(0,F.next_out)),F.avail_out=0;continue}if(F.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(q){this.chunks.push(q)},Deflate$1.prototype.onEnd=function(q){q===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=q,this.msg=this.strm.msg};function deflate$1(q,K){const F=new Deflate$1(K);if(F.push(q,!0),F.err)throw F.msg||messages[F.err];return F.result}function deflateRaw$1(q,K){return K=K||{},K.raw=!0,deflate$1(q,K)}function gzip$1(q,K){return K=K||{},K.gzip=!0,deflate$1(q,K)}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 q(K,F){let Z,D,N,O,I,z,J,Q,ne,re,te,oe,le,ae,ce,de,we,fe,ge,me,ve,ke,xe,_e;const Te=K.state;Z=K.next_in,xe=K.input,D=Z+(K.avail_in-5),N=K.next_out,_e=K.output,O=N-(F-K.avail_out),I=N+(K.avail_out-257),z=Te.dmax,J=Te.wsize,Q=Te.whave,ne=Te.wnext,re=Te.window,te=Te.hold,oe=Te.bits,le=Te.lencode,ae=Te.distcode,ce=(1<<Te.lenbits)-1,de=(1<<Te.distbits)-1;e:do{oe<15&&(te+=xe[Z++]<<oe,oe+=8,te+=xe[Z++]<<oe,oe+=8),we=le[te&ce];t:for(;;){if(fe=we>>>24,te>>>=fe,oe-=fe,fe=we>>>16&255,fe===0)_e[N++]=we&65535;else if(fe&16){ge=we&65535,fe&=15,fe&&(oe<fe&&(te+=xe[Z++]<<oe,oe+=8),ge+=te&(1<<fe)-1,te>>>=fe,oe-=fe),oe<15&&(te+=xe[Z++]<<oe,oe+=8,te+=xe[Z++]<<oe,oe+=8),we=ae[te&de];n:for(;;){if(fe=we>>>24,te>>>=fe,oe-=fe,fe=we>>>16&255,fe&16){if(me=we&65535,fe&=15,oe<fe&&(te+=xe[Z++]<<oe,oe+=8,oe<fe&&(te+=xe[Z++]<<oe,oe+=8)),me+=te&(1<<fe)-1,me>z){K.msg="invalid distance too far back",Te.mode=BAD$1;break e}if(te>>>=fe,oe-=fe,fe=N-O,me>fe){if(fe=me-fe,fe>Q&&Te.sane){K.msg="invalid distance too far back",Te.mode=BAD$1;break e}if(ve=0,ke=re,ne===0){if(ve+=J-fe,fe<ge){ge-=fe;do _e[N++]=re[ve++];while(--fe);ve=N-me,ke=_e}}else if(ne<fe){if(ve+=J+ne-fe,fe-=ne,fe<ge){ge-=fe;do _e[N++]=re[ve++];while(--fe);if(ve=0,ne<ge){fe=ne,ge-=fe;do _e[N++]=re[ve++];while(--fe);ve=N-me,ke=_e}}}else if(ve+=ne-fe,fe<ge){ge-=fe;do _e[N++]=re[ve++];while(--fe);ve=N-me,ke=_e}for(;ge>2;)_e[N++]=ke[ve++],_e[N++]=ke[ve++],_e[N++]=ke[ve++],ge-=3;ge&&(_e[N++]=ke[ve++],ge>1&&(_e[N++]=ke[ve++]))}else{ve=N-me;do _e[N++]=_e[ve++],_e[N++]=_e[ve++],_e[N++]=_e[ve++],ge-=3;while(ge>2);ge&&(_e[N++]=_e[ve++],ge>1&&(_e[N++]=_e[ve++]))}}else if((fe&64)===0){we=ae[(we&65535)+(te&(1<<fe)-1)];continue n}else{K.msg="invalid distance code",Te.mode=BAD$1;break e}break}}else if((fe&64)===0){we=le[(we&65535)+(te&(1<<fe)-1)];continue t}else if(fe&32){Te.mode=TYPE$1;break e}else{K.msg="invalid literal/length code",Te.mode=BAD$1;break e}break}}while(Z<D&&N<I);ge=oe>>3,Z-=ge,oe-=ge<<3,te&=(1<<oe)-1,K.next_in=Z,K.next_out=N,K.avail_in=Z<D?5+(D-Z):5-(Z-D),K.avail_out=N<I?257+(I-N):257-(N-I),Te.hold=te,Te.bits=oe};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=(q,K,F,Z,D,N,O,I)=>{const z=I.bits;let J=0,Q=0,ne=0,re=0,te=0,oe=0,le=0,ae=0,ce=0,de=0,we,fe,ge,me,ve,ke=null,xe;const _e=new Uint16Array(MAXBITS+1),Te=new Uint16Array(MAXBITS+1);let qe=null,Ve,We,Fe;for(J=0;J<=MAXBITS;J++)_e[J]=0;for(Q=0;Q<Z;Q++)_e[K[F+Q]]++;for(te=z,re=MAXBITS;re>=1&&_e[re]===0;re--);if(te>re&&(te=re),re===0)return D[N++]=1<<24|64<<16|0,D[N++]=1<<24|64<<16|0,I.bits=1,0;for(ne=1;ne<re&&_e[ne]===0;ne++);for(te<ne&&(te=ne),ae=1,J=1;J<=MAXBITS;J++)if(ae<<=1,ae-=_e[J],ae<0)return-1;if(ae>0&&(q===CODES$1||re!==1))return-1;for(Te[1]=0,J=1;J<MAXBITS;J++)Te[J+1]=Te[J]+_e[J];for(Q=0;Q<Z;Q++)K[F+Q]!==0&&(O[Te[K[F+Q]]++]=Q);if(q===CODES$1?(ke=qe=O,xe=20):q===LENS$1?(ke=lbase,qe=lext,xe=257):(ke=dbase,qe=dext,xe=0),de=0,Q=0,J=ne,ve=N,oe=te,le=0,ge=-1,ce=1<<te,me=ce-1,q===LENS$1&&ce>ENOUGH_LENS$1||q===DISTS$1&&ce>ENOUGH_DISTS$1)return 1;for(;;){Ve=J-le,O[Q]+1<xe?(We=0,Fe=O[Q]):O[Q]>=xe?(We=qe[O[Q]-xe],Fe=ke[O[Q]-xe]):(We=96,Fe=0),we=1<<J-le,fe=1<<oe,ne=fe;do fe-=we,D[ve+(de>>le)+fe]=Ve<<24|We<<16|Fe|0;while(fe!==0);for(we=1<<J-1;de&we;)we>>=1;if(we!==0?(de&=we-1,de+=we):de=0,Q++,--_e[J]===0){if(J===re)break;J=K[F+O[Q]]}if(J>te&&(de&me)!==ge){for(le===0&&(le=te),ve+=ne,oe=J-le,ae=1<<oe;oe+le<re&&(ae-=_e[oe+le],!(ae<=0));)oe++,ae<<=1;if(ce+=1<<oe,q===LENS$1&&ce>ENOUGH_LENS$1||q===DISTS$1&&ce>ENOUGH_DISTS$1)return 1;ge=de&me,D[ge]=te<<24|oe<<16|ve-N|0}}return de!==0&&(D[ve+de]=J-le<<24|64<<16|0),I.bits=te,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=q=>(q>>>24&255)+(q>>>8&65280)+((q&65280)<<8)+((q&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=q=>{if(!q)return 1;const K=q.state;return!K||K.strm!==q||K.mode<HEAD||K.mode>SYNC?1:0},inflateResetKeep=q=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const K=q.state;return q.total_in=q.total_out=K.total=0,q.msg="",K.wrap&&(q.adler=K.wrap&1),K.mode=HEAD,K.last=0,K.havedict=0,K.flags=-1,K.dmax=32768,K.head=null,K.hold=0,K.bits=0,K.lencode=K.lendyn=new Int32Array(ENOUGH_LENS),K.distcode=K.distdyn=new Int32Array(ENOUGH_DISTS),K.sane=1,K.back=-1,Z_OK$1},inflateReset=q=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const K=q.state;return K.wsize=0,K.whave=0,K.wnext=0,inflateResetKeep(q)},inflateReset2=(q,K)=>{let F;if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const Z=q.state;return K<0?(F=0,K=-K):(F=(K>>4)+5,K<48&&(K&=15)),K&&(K<8||K>15)?Z_STREAM_ERROR$1:(Z.window!==null&&Z.wbits!==K&&(Z.window=null),Z.wrap=F,Z.wbits=K,inflateReset(q))},inflateInit2=(q,K)=>{if(!q)return Z_STREAM_ERROR$1;const F=new InflateState;q.state=F,F.strm=q,F.window=null,F.mode=HEAD;const Z=inflateReset2(q,K);return Z!==Z_OK$1&&(q.state=null),Z},inflateInit=q=>inflateInit2(q,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=q=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let K=0;for(;K<144;)q.lens[K++]=8;for(;K<256;)q.lens[K++]=9;for(;K<280;)q.lens[K++]=7;for(;K<288;)q.lens[K++]=8;for(inftrees(LENS,q.lens,0,288,lenfix,0,q.work,{bits:9}),K=0;K<32;)q.lens[K++]=5;inftrees(DISTS,q.lens,0,32,distfix,0,q.work,{bits:5}),virgin=!1}q.lencode=lenfix,q.lenbits=9,q.distcode=distfix,q.distbits=5},updatewindow=(q,K,F,Z)=>{let D;const N=q.state;return N.window===null&&(N.wsize=1<<N.wbits,N.wnext=0,N.whave=0,N.window=new Uint8Array(N.wsize)),Z>=N.wsize?(N.window.set(K.subarray(F-N.wsize,F),0),N.wnext=0,N.whave=N.wsize):(D=N.wsize-N.wnext,D>Z&&(D=Z),N.window.set(K.subarray(F-Z,F-Z+D),N.wnext),Z-=D,Z?(N.window.set(K.subarray(F-Z,F),0),N.wnext=Z,N.whave=N.wsize):(N.wnext+=D,N.wnext===N.wsize&&(N.wnext=0),N.whave<N.wsize&&(N.whave+=D))),0},inflate$2=(q,K)=>{let F,Z,D,N,O,I,z,J,Q,ne,re,te,oe,le,ae=0,ce,de,we,fe,ge,me,ve,ke;const xe=new Uint8Array(4);let _e,Te;const qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(q)||!q.output||!q.input&&q.avail_in!==0)return Z_STREAM_ERROR$1;F=q.state,F.mode===TYPE&&(F.mode=TYPEDO),O=q.next_out,D=q.output,z=q.avail_out,N=q.next_in,Z=q.input,I=q.avail_in,J=F.hold,Q=F.bits,ne=I,re=z,ke=Z_OK$1;e:for(;;)switch(F.mode){case HEAD:if(F.wrap===0){F.mode=TYPEDO;break}for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.wrap&2&&J===35615){F.wbits===0&&(F.wbits=15),F.check=0,xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0),J=0,Q=0,F.mode=FLAGS;break}if(F.head&&(F.head.done=!1),!(F.wrap&1)||(((J&255)<<8)+(J>>8))%31){q.msg="incorrect header check",F.mode=BAD;break}if((J&15)!==Z_DEFLATED){q.msg="unknown compression method",F.mode=BAD;break}if(J>>>=4,Q-=4,ve=(J&15)+8,F.wbits===0&&(F.wbits=ve),ve>15||ve>F.wbits){q.msg="invalid window size",F.mode=BAD;break}F.dmax=1<<F.wbits,F.flags=0,q.adler=F.check=1,F.mode=J&512?DICTID:TYPE,J=0,Q=0;break;case FLAGS:for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.flags=J,(F.flags&255)!==Z_DEFLATED){q.msg="unknown compression method",F.mode=BAD;break}if(F.flags&57344){q.msg="unknown header flags set",F.mode=BAD;break}F.head&&(F.head.text=J>>8&1),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0)),J=0,Q=0,F.mode=TIME;case TIME:for(;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.head&&(F.head.time=J),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,xe[2]=J>>>16&255,xe[3]=J>>>24&255,F.check=crc32_1(F.check,xe,4,0)),J=0,Q=0,F.mode=OS;case OS:for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.head&&(F.head.xflags=J&255,F.head.os=J>>8),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0)),J=0,Q=0,F.mode=EXLEN;case EXLEN:if(F.flags&1024){for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.length=J,F.head&&(F.head.extra_len=J),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0)),J=0,Q=0}else F.head&&(F.head.extra=null);F.mode=EXTRA;case EXTRA:if(F.flags&1024&&(te=F.length,te>I&&(te=I),te&&(F.head&&(ve=F.head.extra_len-F.length,F.head.extra||(F.head.extra=new Uint8Array(F.head.extra_len)),F.head.extra.set(Z.subarray(N,N+te),ve)),F.flags&512&&F.wrap&4&&(F.check=crc32_1(F.check,Z,te,N)),I-=te,N+=te,F.length-=te),F.length))break e;F.length=0,F.mode=NAME;case NAME:if(F.flags&2048){if(I===0)break e;te=0;do ve=Z[N+te++],F.head&&ve&&F.length<65536&&(F.head.name+=String.fromCharCode(ve));while(ve&&te<I);if(F.flags&512&&F.wrap&4&&(F.check=crc32_1(F.check,Z,te,N)),I-=te,N+=te,ve)break e}else F.head&&(F.head.name=null);F.length=0,F.mode=COMMENT;case COMMENT:if(F.flags&4096){if(I===0)break e;te=0;do ve=Z[N+te++],F.head&&ve&&F.length<65536&&(F.head.comment+=String.fromCharCode(ve));while(ve&&te<I);if(F.flags&512&&F.wrap&4&&(F.check=crc32_1(F.check,Z,te,N)),I-=te,N+=te,ve)break e}else F.head&&(F.head.comment=null);F.mode=HCRC;case HCRC:if(F.flags&512){for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.wrap&4&&J!==(F.check&65535)){q.msg="header crc mismatch",F.mode=BAD;break}J=0,Q=0}F.head&&(F.head.hcrc=F.flags>>9&1,F.head.done=!0),q.adler=F.check=0,F.mode=TYPE;break;case DICTID:for(;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}q.adler=F.check=zswap32(J),J=0,Q=0,F.mode=DICT;case DICT:if(F.havedict===0)return q.next_out=O,q.avail_out=z,q.next_in=N,q.avail_in=I,F.hold=J,F.bits=Q,Z_NEED_DICT$1;q.adler=F.check=1,F.mode=TYPE;case TYPE:if(K===Z_BLOCK||K===Z_TREES)break e;case TYPEDO:if(F.last){J>>>=Q&7,Q-=Q&7,F.mode=CHECK;break}for(;Q<3;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}switch(F.last=J&1,J>>>=1,Q-=1,J&3){case 0:F.mode=STORED;break;case 1:if(fixedtables(F),F.mode=LEN_,K===Z_TREES){J>>>=2,Q-=2;break e}break;case 2:F.mode=TABLE;break;case 3:q.msg="invalid block type",F.mode=BAD}J>>>=2,Q-=2;break;case STORED:for(J>>>=Q&7,Q-=Q&7;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if((J&65535)!==(J>>>16^65535)){q.msg="invalid stored block lengths",F.mode=BAD;break}if(F.length=J&65535,J=0,Q=0,F.mode=COPY_,K===Z_TREES)break e;case COPY_:F.mode=COPY;case COPY:if(te=F.length,te){if(te>I&&(te=I),te>z&&(te=z),te===0)break e;D.set(Z.subarray(N,N+te),O),I-=te,N+=te,z-=te,O+=te,F.length-=te;break}F.mode=TYPE;break;case TABLE:for(;Q<14;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.nlen=(J&31)+257,J>>>=5,Q-=5,F.ndist=(J&31)+1,J>>>=5,Q-=5,F.ncode=(J&15)+4,J>>>=4,Q-=4,F.nlen>286||F.ndist>30){q.msg="too many length or distance symbols",F.mode=BAD;break}F.have=0,F.mode=LENLENS;case LENLENS:for(;F.have<F.ncode;){for(;Q<3;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.lens[qe[F.have++]]=J&7,J>>>=3,Q-=3}for(;F.have<19;)F.lens[qe[F.have++]]=0;if(F.lencode=F.lendyn,F.lenbits=7,_e={bits:F.lenbits},ke=inftrees(CODES,F.lens,0,19,F.lencode,0,F.work,_e),F.lenbits=_e.bits,ke){q.msg="invalid code lengths set",F.mode=BAD;break}F.have=0,F.mode=CODELENS;case CODELENS:for(;F.have<F.nlen+F.ndist;){for(;ae=F.lencode[J&(1<<F.lenbits)-1],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(we<16)J>>>=ce,Q-=ce,F.lens[F.have++]=we;else{if(we===16){for(Te=ce+2;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(J>>>=ce,Q-=ce,F.have===0){q.msg="invalid bit length repeat",F.mode=BAD;break}ve=F.lens[F.have-1],te=3+(J&3),J>>>=2,Q-=2}else if(we===17){for(Te=ce+3;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=ce,Q-=ce,ve=0,te=3+(J&7),J>>>=3,Q-=3}else{for(Te=ce+7;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=ce,Q-=ce,ve=0,te=11+(J&127),J>>>=7,Q-=7}if(F.have+te>F.nlen+F.ndist){q.msg="invalid bit length repeat",F.mode=BAD;break}for(;te--;)F.lens[F.have++]=ve}}if(F.mode===BAD)break;if(F.lens[256]===0){q.msg="invalid code -- missing end-of-block",F.mode=BAD;break}if(F.lenbits=9,_e={bits:F.lenbits},ke=inftrees(LENS,F.lens,0,F.nlen,F.lencode,0,F.work,_e),F.lenbits=_e.bits,ke){q.msg="invalid literal/lengths set",F.mode=BAD;break}if(F.distbits=6,F.distcode=F.distdyn,_e={bits:F.distbits},ke=inftrees(DISTS,F.lens,F.nlen,F.ndist,F.distcode,0,F.work,_e),F.distbits=_e.bits,ke){q.msg="invalid distances set",F.mode=BAD;break}if(F.mode=LEN_,K===Z_TREES)break e;case LEN_:F.mode=LEN;case LEN:if(I>=6&&z>=258){q.next_out=O,q.avail_out=z,q.next_in=N,q.avail_in=I,F.hold=J,F.bits=Q,inffast(q,re),O=q.next_out,D=q.output,z=q.avail_out,N=q.next_in,Z=q.input,I=q.avail_in,J=F.hold,Q=F.bits,F.mode===TYPE&&(F.back=-1);break}for(F.back=0;ae=F.lencode[J&(1<<F.lenbits)-1],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(de&&(de&240)===0){for(fe=ce,ge=de,me=we;ae=F.lencode[me+((J&(1<<fe+ge)-1)>>fe)],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(fe+ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=fe,Q-=fe,F.back+=fe}if(J>>>=ce,Q-=ce,F.back+=ce,F.length=we,de===0){F.mode=LIT;break}if(de&32){F.back=-1,F.mode=TYPE;break}if(de&64){q.msg="invalid literal/length code",F.mode=BAD;break}F.extra=de&15,F.mode=LENEXT;case LENEXT:if(F.extra){for(Te=F.extra;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.length+=J&(1<<F.extra)-1,J>>>=F.extra,Q-=F.extra,F.back+=F.extra}F.was=F.length,F.mode=DIST;case DIST:for(;ae=F.distcode[J&(1<<F.distbits)-1],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if((de&240)===0){for(fe=ce,ge=de,me=we;ae=F.distcode[me+((J&(1<<fe+ge)-1)>>fe)],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(fe+ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=fe,Q-=fe,F.back+=fe}if(J>>>=ce,Q-=ce,F.back+=ce,de&64){q.msg="invalid distance code",F.mode=BAD;break}F.offset=we,F.extra=de&15,F.mode=DISTEXT;case DISTEXT:if(F.extra){for(Te=F.extra;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.offset+=J&(1<<F.extra)-1,J>>>=F.extra,Q-=F.extra,F.back+=F.extra}if(F.offset>F.dmax){q.msg="invalid distance too far back",F.mode=BAD;break}F.mode=MATCH;case MATCH:if(z===0)break e;if(te=re-z,F.offset>te){if(te=F.offset-te,te>F.whave&&F.sane){q.msg="invalid distance too far back",F.mode=BAD;break}te>F.wnext?(te-=F.wnext,oe=F.wsize-te):oe=F.wnext-te,te>F.length&&(te=F.length),le=F.window}else le=D,oe=O-F.offset,te=F.length;te>z&&(te=z),z-=te,F.length-=te;do D[O++]=le[oe++];while(--te);F.length===0&&(F.mode=LEN);break;case LIT:if(z===0)break e;D[O++]=F.length,z--,F.mode=LEN;break;case CHECK:if(F.wrap){for(;Q<32;){if(I===0)break e;I--,J|=Z[N++]<<Q,Q+=8}if(re-=z,q.total_out+=re,F.total+=re,F.wrap&4&&re&&(q.adler=F.check=F.flags?crc32_1(F.check,D,re,O-re):adler32_1(F.check,D,re,O-re)),re=z,F.wrap&4&&(F.flags?J:zswap32(J))!==F.check){q.msg="incorrect data check",F.mode=BAD;break}J=0,Q=0}F.mode=LENGTH;case LENGTH:if(F.wrap&&F.flags){for(;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.wrap&4&&J!==(F.total&4294967295)){q.msg="incorrect length check",F.mode=BAD;break}J=0,Q=0}F.mode=DONE;case DONE:ke=Z_STREAM_END$1;break e;case BAD:ke=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return q.next_out=O,q.avail_out=z,q.next_in=N,q.avail_in=I,F.hold=J,F.bits=Q,(F.wsize||re!==q.avail_out&&F.mode<BAD&&(F.mode<CHECK||K!==Z_FINISH$1))&&updatewindow(q,q.output,q.next_out,re-q.avail_out),ne-=q.avail_in,re-=q.avail_out,q.total_in+=ne,q.total_out+=re,F.total+=re,F.wrap&4&&re&&(q.adler=F.check=F.flags?crc32_1(F.check,D,re,q.next_out-re):adler32_1(F.check,D,re,q.next_out-re)),q.data_type=F.bits+(F.last?64:0)+(F.mode===TYPE?128:0)+(F.mode===LEN_||F.mode===COPY_?256:0),(ne===0&&re===0||K===Z_FINISH$1)&&ke===Z_OK$1&&(ke=Z_BUF_ERROR),ke},inflateEnd=q=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;let K=q.state;return K.window&&(K.window=null),q.state=null,Z_OK$1},inflateGetHeader=(q,K)=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const F=q.state;return(F.wrap&2)===0?Z_STREAM_ERROR$1:(F.head=K,K.done=!1,Z_OK$1)},inflateSetDictionary=(q,K)=>{const F=K.length;let Z,D,N;return inflateStateCheck(q)||(Z=q.state,Z.wrap!==0&&Z.mode!==DICT)?Z_STREAM_ERROR$1:Z.mode===DICT&&(D=1,D=adler32_1(D,K,F,0),D!==Z.check)?Z_DATA_ERROR$1:(N=updatewindow(q,K,F,F),N?(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(q){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},q||{});const K=this.options;K.raw&&K.windowBits>=0&&K.windowBits<16&&(K.windowBits=-K.windowBits,K.windowBits===0&&(K.windowBits=-15)),K.windowBits>=0&&K.windowBits<16&&!(q&&q.windowBits)&&(K.windowBits+=32),K.windowBits>15&&K.windowBits<48&&(K.windowBits&15)===0&&(K.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let F=inflate_1$2.inflateInit2(this.strm,K.windowBits);if(F!==Z_OK)throw new Error(messages[F]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),K.dictionary&&(typeof K.dictionary=="string"?K.dictionary=strings.string2buf(K.dictionary):toString.call(K.dictionary)==="[object ArrayBuffer]"&&(K.dictionary=new Uint8Array(K.dictionary)),K.raw&&(F=inflate_1$2.inflateSetDictionary(this.strm,K.dictionary),F!==Z_OK)))throw new Error(messages[F])}Inflate$1.prototype.push=function(q,K){const F=this.strm,Z=this.options.chunkSize,D=this.options.dictionary;let N,O,I;if(this.ended)return!1;for(K===~~K?O=K:O=K===!0?Z_FINISH:Z_NO_FLUSH,toString.call(q)==="[object ArrayBuffer]"?F.input=new Uint8Array(q):F.input=q,F.next_in=0,F.avail_in=F.input.length;;){for(F.avail_out===0&&(F.output=new Uint8Array(Z),F.next_out=0,F.avail_out=Z),N=inflate_1$2.inflate(F,O),N===Z_NEED_DICT&&D&&(N=inflate_1$2.inflateSetDictionary(F,D),N===Z_OK?N=inflate_1$2.inflate(F,O):N===Z_DATA_ERROR&&(N=Z_NEED_DICT));F.avail_in>0&&N===Z_STREAM_END&&F.state.wrap>0&&q[F.next_in]!==0;)inflate_1$2.inflateReset(F),N=inflate_1$2.inflate(F,O);switch(N){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(N),this.ended=!0,!1}if(I=F.avail_out,F.next_out&&(F.avail_out===0||N===Z_STREAM_END))if(this.options.to==="string"){let z=strings.utf8border(F.output,F.next_out),J=F.next_out-z,Q=strings.buf2string(F.output,z);F.next_out=J,F.avail_out=Z-J,J&&F.output.set(F.output.subarray(z,z+J),0),this.onData(Q)}else this.onData(F.output.length===F.next_out?F.output:F.output.subarray(0,F.next_out));if(!(N===Z_OK&&I===0)){if(N===Z_STREAM_END)return N=inflate_1$2.inflateEnd(this.strm),this.onEnd(N),this.ended=!0,!0;if(F.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(q){this.chunks.push(q)},Inflate$1.prototype.onEnd=function(q){q===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=q,this.msg=this.strm.msg};function inflate$1(q,K){const F=new Inflate$1(K);if(F.push(q),F.err)throw F.msg||messages[F.err];return F.result}function inflateRaw$1(q,K){return K=K||{},K.raw=!0,inflate$1(q,K)}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=q=>{const K=new Uint8Array(q),F=pako.deflate(K,{gzip:!0});return new Uint8Array(F==null?void 0:F.buffer)},decompressArrayBuffer=q=>{const K=new Uint8Array(q),F=pako.inflate(K,{gzip:!0});return new Uint8Array(F==null?void 0:F.buffer)},sendMessageFormat=q=>{const{event:K}=q;switch(q.data_original=q.data,q.time&&(q.timeStr=E$1(q.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),K){case"login":q.data=com.quick.voice.proto.Login.encode(q.data).finish();break;case"joinRoom":case"joinRoomEx":q.data=com.quick.voice.proto.JoinReq.encode(q.data).finish();break;case"quitRoom":q.data=com.quick.voice.proto.QuitReq.encode(q.data).finish();break;case"connectCF":q.data=com.quick.voice.proto.ConnectCFReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"publish":q.data=com.quick.voice.proto.PublishReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"pubChannel":q.data=com.quick.voice.proto.ChannelPublishReq.encode(q.data).finish();break;case"subscribe":q.data=com.quick.voice.proto.SubscribeReq.encode(q.data).finish();break;case"subChannel":q.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(q.data).finish();break;case"closeTrack":q.data=com.quick.voice.proto.CloseTrackReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"renegotiate":q.data=com.quick.voice.proto.RenegotiateReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"syncRoomInfo":q.data=com.quick.voice.proto.SyncRoomInfoReq.encode(q.data).finish();break;case"updateCall":q.data=com.quick.voice.proto.UpdateCall.encode(q.data).finish();break;case"networkQualityChange":q.data=com.quick.voice.proto.NetQualityChange.encode(q.data).finish();break;case"pubNotify":q.data=com.quick.voice.proto.PublishNotify.encode(q.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":q.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(q.data).finish();break;default:q.data=new Uint8Array;break}return q},onMessageFormat=q=>{const{event:K,compress:F=!1}=q;if(q.data_remote=q.data,q.time&&(q.timeStr=E$1(q.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),F)try{q.data=decompressArrayBuffer(q.data)}catch(Z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",Z)}switch(K){case"login":q.data=com.quick.voice.proto.Login.decode(q.data);break;case"joinRoom":case"joinRoomEx":q.data=com.quick.voice.proto.JoinRsp.decode(q.data);break;case"onJoinRoom":q.data=com.quick.voice.proto.JoinNotify.decode(q.data);break;case"onQuitRoom":q.data=com.quick.voice.proto.QuitNotify.decode(q.data);break;case"connectCF":q.data=com.quick.voice.proto.ConnectCFRsp.decode(q.data);break;case"publish":q.data=com.quick.voice.proto.PublishRsp.decode(q.data);break;case"pubChannel":q.data=com.quick.voice.proto.ChannelPublishRsq.decode(q.data);break;case"onPublish":q.data=com.quick.voice.proto.PublishNotify.decode(q.data);break;case"subscribe":q.data=com.quick.voice.proto.SubscribeRsp.decode(q.data);break;case"subChannel":q.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(q.data);break;case"closeTrack":q.data=com.quick.voice.proto.CloseTrackRsp.decode(q.data);break;case"onCloseTrack":q.data=com.quick.voice.proto.CloseTrackNotify.decode(q.data);break;case"onUpdateCall":q.data=com.quick.voice.proto.UpdateCall.decode(q.data);break;case"onDataChannelPublish":q.data=com.quick.voice.proto.UserChannel.decode(q.data);break;case"onDestroyRoom":q.data=com.quick.voice.proto.QuitNotify.decode(q.data);break;case"onUpdatePermissions":q.data=com.quick.voice.proto.UpdatePermissions.decode(q.data);break;case"onNetQuality":q.data=com.quick.voice.proto.NetQualityNotify.decode(q.data);break;case"syncRoomInfo":q.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(q.data);break;case"onCDNPlayUrlAdd":q.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(q.data);break;case"onUpdateBehavior":q.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(q.data);break;case"debugger":q.data=JSON.parse(new TextDecoder().decode(q.data));break}return q};class CallsWebSocket{constructor(K){st(this,_t);st(this,yt,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:20*1e3});st(this,Pt,"");st(this,Wt,{});st(this,Xt,{});Ie(this,"state","closed");Ie(this,"sendMessageBefore",async()=>{});Ie(this,"onReconnectSuccess",K=>{});Ie(this,"onReconnectStop",K=>{});st(this,Bn,K=>{let F=!0;const{code:Z=1e3}=K;return Z===1e3&&(F=!1),this.state="connecting",F});st(this,Nn,async K=>{Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",K),this.state="connected",this.onReconnectSuccess(K)});st(this,Mn,async K=>{Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",K),this.close(),this.state="closed",this.onReconnectStop(K)});st(this,In,(K,F={})=>{try{const{time:Z,event:D,data:N={},data_original:O={},data_remote:I,...z}=F,J=E$1(Z,"YYYY-MM-DD hh:mm:ss",{offset:480});let Q={};const ne=(we={})=>{const fe=JSON.parse(JSON.stringify(we)),ge=Object.keys(fe);for(const me of ge)(me.includes("sdp")||me.includes("Sdp"))&&(fe[me]="");return fe};let re="res ↓";switch(K){case"res":re="res ↓",Q=ne(N);break;case"req":re="req ↑",Q=ne(O);break}let te="#quickvo.logs";ignoreEvent.includes(D)&&(te="#quickvo.ignoreEvents");const oe={"#action":re,timeStr:J,event:D,data:Q,time:Z,...z},le=localStorage.getItem(te)||JSON.stringify([]),ae=JSON.parse(le);let ce=D==="heartbeat";const de=[oe];for(const we of ae){const{event:fe}=we;if(fe==="heartbeat"){if(ce)continue;ce=!0}if(de.length===200)break;de.push(we)}localStorage.setItem(te,JSON.stringify(de))}catch(Z){Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",Z)}});st(this,qn,(K,{resolve:F,reject:Z})=>{const{sn:D=""}=K,N=()=>{const I=Be(this,Wt)[D];clearTimeout(I.destructionTimer),delete Be(this,Wt)[D]},O=window.setTimeout(()=>{const I=Be(this,Wt)[D];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",I.message),N(),Z("event is timeout")},Be(this,yt).timeout);Be(this,Wt)[D]={message:K,resolve:F,reject:Z,destruction:N,destructionTimer:O}});st(this,Pn,K=>Be(this,Wt)[K]);st(this,Un,async K=>{const F=new Uint8Array(K),Z=com.quick.voice.proto.CommonRsp.decode(F),{sn:D,event:N}=Z,O=onMessageFormat(Z);if(Be(this,yt).debug&&(noLogEvents.includes(N)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",O),ignoreEvent.includes(N)||Be(this,In).call(this,"res",O)),notifyName_keys.includes(N))return this.emitNotify(N,P(O,["code","data","desc"]));const z=Be(this,Pn).call(this,D);if(z){const{resolve:J=ne=>{},destruction:Q=()=>{}}=z;J(P(O,["code","data","desc"])),Q()}});Ie(this,"clearEvents",(K=[])=>{const F=Object.keys(Be(this,Wt));K.length===0&&(K=F);for(const Z of F){if(!K.includes(Z))continue;const D=Be(this,Wt)[Z];if(D){const{destruction:N}=D;N()}}});Ie(this,"connect",async(K="")=>new Promise(async F=>{K&&At(this,Pt,K),Be(this,_t)&&(await Be(this,_t).close(),this.state="closed");const Z=`${Be(this,yt).url}?s=${Be(this,Pt)}&t=${Date.now()}`,D=new Date().getTime();if(At(this,_t,new M({...Be(this,yt),debug:!1,url:Z,binaryType:"arraybuffer",onMessage:Be(this,Un),checkReconnect:Be(this,Bn),getHeartbeatMsg:()=>"",onReconnectSuccess:Be(this,Nn),onReconnectStop:Be(this,Mn)})),this.state="connecting",await Be(this,_t).connect(),this.state="connected",Be(this,yt).debug){const O=new Date().getTime()-D;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${O}ms-广播事件`,Be(this,Xt))}F(Be(this,_t))}));Ie(this,"close",async()=>{var F;Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const K=Object.keys(Be(this,Wt));for(const Z of K){const{destructionTimer:D}=Be(this,Wt)[Z];clearTimeout(D)}At(this,Wt,{}),await((F=Be(this,_t))==null?void 0:F.close()),At(this,_t,void 0),this.state="closed"});Ie(this,"sendMessage",(K,F=!0)=>new Promise(async(Z,D)=>{var Q;await this.sendMessageBefore();const{event:N,...O}=K,I=Date.now(),z=sendMessageFormat({event:N,sn:+`${I}${v$1(1e3,9999)}`,time:I,valid:Be(this,yt).timeout,version:1,compress:!1,...O});Be(this,yt).debug&&(noLogEvents.includes(N)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",z),ignoreEvent.includes(N)||Be(this,In).call(this,"req",z)),F&&Be(this,qn).call(this,z,{resolve:Z,reject:D});const J=com.quick.voice.proto.CommonReq.encode(z).finish();(Q=Be(this,_t))==null||Q.sendMessage(J)}));Ie(this,"emitNotify",async(K,F)=>{const Z=Be(this,Xt)[K]||[];for(const D of Z){const{callback:N=async()=>{}}=D;await N(F)}});Ie(this,"addNotify",(K,F=!1)=>{const{event:Z,sn:D=xt(32)}=K;Be(this,Xt)[Z]||(Be(this,Xt)[Z]=[]);const N=Be(this,Xt)[Z],O=N.findIndex(I=>I.sn===D);return O!==-1&&N.splice(O,1),F?N.unshift(K):N.push(K),D});Ie(this,"removeNotify",(K=[])=>{if(K.length===0)At(this,Xt,{});else{const F=Object.keys(Be(this,Xt));for(const Z of F)Be(this,Xt)[Z]=Be(this,Xt)[Z].filter(D=>!K.includes(D.sn||""))}Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",Be(this,Xt))});At(this,yt,{...Be(this,yt),...K})}}_t=new WeakMap,yt=new WeakMap,Pt=new WeakMap,Wt=new WeakMap,Xt=new WeakMap,Bn=new WeakMap,Nn=new WeakMap,Mn=new WeakMap,In=new WeakMap,qn=new WeakMap,Pn=new WeakMap,Un=new WeakMap;/*! For license information please see pikazLocationModule.js.LICENSE.txt */var e$2={782:function(q){q.exports=(()=>{var K={483:(D,N,O)=>{D.exports=function I(z,J,Q){function ne(oe,le){if(!J[oe]){if(!z[oe]){if(re)return re(oe,!0);var ae=new Error("Cannot find module '"+oe+"'");throw ae.code="MODULE_NOT_FOUND",ae}var ce=J[oe]={exports:{}};z[oe][0].call(ce.exports,function(de){return ne(z[oe][1][de]||de)},ce,ce.exports,I,z,J,Q)}return J[oe].exports}for(var re=void 0,te=0;te<Q.length;te++)ne(Q[te]);return ne}({1:[function(I,z,J){(function(Q){var ne,re,te=Q.MutationObserver||Q.WebKitMutationObserver;if(te){var oe=0,le=new te(we),ae=Q.document.createTextNode("");le.observe(ae,{characterData:!0}),ne=function(){ae.data=oe=++oe%2}}else if(Q.setImmediate||Q.MessageChannel===void 0)ne="document"in Q&&"onreadystatechange"in Q.document.createElement("script")?function(){var fe=Q.document.createElement("script");fe.onreadystatechange=function(){we(),fe.onreadystatechange=null,fe.parentNode.removeChild(fe),fe=null},Q.document.documentElement.appendChild(fe)}:function(){setTimeout(we,0)};else{var ce=new Q.MessageChannel;ce.port1.onmessage=we,ne=function(){ce.port2.postMessage(0)}}var de=[];function we(){var fe,ge;re=!0;for(var me=de.length;me;){for(ge=de,de=[],fe=-1;++fe<me;)ge[fe]();me=de.length}re=!1}z.exports=function(fe){de.push(fe)!==1||re||ne()}}).call(this,O.g!==void 0?O.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(I,z,J){var Q=I(1);function ne(){}var re={},te=["REJECTED"],oe=["FULFILLED"],le=["PENDING"];function ae(me){if(typeof me!="function")throw new TypeError("resolver must be a function");this.state=le,this.queue=[],this.outcome=void 0,me!==ne&&fe(this,me)}function ce(me,ve,ke){this.promise=me,typeof ve=="function"&&(this.onFulfilled=ve,this.callFulfilled=this.otherCallFulfilled),typeof ke=="function"&&(this.onRejected=ke,this.callRejected=this.otherCallRejected)}function de(me,ve,ke){Q(function(){var xe;try{xe=ve(ke)}catch(_e){return re.reject(me,_e)}xe===me?re.reject(me,new TypeError("Cannot resolve promise with itself")):re.resolve(me,xe)})}function we(me){var ve=me&&me.then;if(me&&(typeof me=="object"||typeof me=="function")&&typeof ve=="function")return function(){ve.apply(me,arguments)}}function fe(me,ve){var ke=!1;function xe(qe){ke||(ke=!0,re.reject(me,qe))}function _e(qe){ke||(ke=!0,re.resolve(me,qe))}var Te=ge(function(){ve(_e,xe)});Te.status==="error"&&xe(Te.value)}function ge(me,ve){var ke={};try{ke.value=me(ve),ke.status="success"}catch(xe){ke.status="error",ke.value=xe}return ke}z.exports=ae,ae.prototype.catch=function(me){return this.then(null,me)},ae.prototype.then=function(me,ve){if(typeof me!="function"&&this.state===oe||typeof ve!="function"&&this.state===te)return this;var ke=new this.constructor(ne);return this.state!==le?de(ke,this.state===oe?me:ve,this.outcome):this.queue.push(new ce(ke,me,ve)),ke},ce.prototype.callFulfilled=function(me){re.resolve(this.promise,me)},ce.prototype.otherCallFulfilled=function(me){de(this.promise,this.onFulfilled,me)},ce.prototype.callRejected=function(me){re.reject(this.promise,me)},ce.prototype.otherCallRejected=function(me){de(this.promise,this.onRejected,me)},re.resolve=function(me,ve){var ke=ge(we,ve);if(ke.status==="error")return re.reject(me,ke.value);var xe=ke.value;if(xe)fe(me,xe);else{me.state=oe,me.outcome=ve;for(var _e=-1,Te=me.queue.length;++_e<Te;)me.queue[_e].callFulfilled(ve)}return me},re.reject=function(me,ve){me.state=te,me.outcome=ve;for(var ke=-1,xe=me.queue.length;++ke<xe;)me.queue[ke].callRejected(ve);return me},ae.resolve=function(me){return me instanceof this?me:re.resolve(new this(ne),me)},ae.reject=function(me){var ve=new this(ne);return re.reject(ve,me)},ae.all=function(me){var ve=this;if(Object.prototype.toString.call(me)!=="[object Array]")return this.reject(new TypeError("must be an array"));var ke=me.length,xe=!1;if(!ke)return this.resolve([]);for(var _e=new Array(ke),Te=0,qe=-1,Ve=new this(ne);++qe<ke;)We(me[qe],qe);return Ve;function We(Fe,Ot){ve.resolve(Fe).then(function(It){_e[Ot]=It,++Te!==ke||xe||(xe=!0,re.resolve(Ve,_e))},function(It){xe||(xe=!0,re.reject(Ve,It))})}},ae.race=function(me){if(Object.prototype.toString.call(me)!=="[object Array]")return this.reject(new TypeError("must be an array"));var ve,ke=me.length,xe=!1;if(!ke)return this.resolve([]);for(var _e=-1,Te=new this(ne);++_e<ke;)ve=me[_e],this.resolve(ve).then(function(qe){xe||(xe=!0,re.resolve(Te,qe))},function(qe){xe||(xe=!0,re.reject(Te,qe))});return Te}},{1:1}],3:[function(I,z,J){(function(Q){typeof Q.Promise!="function"&&(Q.Promise=I(2))}).call(this,O.g!==void 0?O.g:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(I,z,J){var Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},ne=function(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}();function re(ue,ye){ue=ue||[],ye=ye||{};try{return new Blob(ue,ye)}catch(Re){if(Re.name!=="TypeError")throw Re;for(var be=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),Ce=0;Ce<ue.length;Ce+=1)be.append(ue[Ce]);return be.getBlob(ye.type)}}typeof Promise>"u"&&I(3);var te=Promise;function oe(ue,ye){ye&&ue.then(function(be){ye(null,be)},function(be){ye(be)})}function le(ue,ye,be){typeof ye=="function"&&ue.then(ye),typeof be=="function"&&ue.catch(be)}function ae(ue){return typeof ue!="string"&&(console.warn(ue+" used as a key, but it is not a string."),ue=String(ue)),ue}function ce(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var de="local-forage-detect-blob-support",we=void 0,fe={},ge=Object.prototype.toString,me="readonly",ve="readwrite";function ke(ue){for(var ye=ue.length,be=new ArrayBuffer(ye),Ce=new Uint8Array(be),Re=0;Re<ye;Re++)Ce[Re]=ue.charCodeAt(Re);return be}function xe(ue){return typeof we=="boolean"?te.resolve(we):function(ye){return new te(function(be){var Ce=ye.transaction(de,ve),Re=re([""]);Ce.objectStore(de).put(Re,"key"),Ce.onabort=function(Ae){Ae.preventDefault(),Ae.stopPropagation(),be(!1)},Ce.oncomplete=function(){var Ae=navigator.userAgent.match(/Chrome\/(\d+)/),Pe=navigator.userAgent.match(/Edge\//);be(Pe||!Ae||parseInt(Ae[1],10)>=43)}}).catch(function(){return!1})}(ue).then(function(ye){return we=ye})}function _e(ue){var ye=fe[ue.name],be={};be.promise=new te(function(Ce,Re){be.resolve=Ce,be.reject=Re}),ye.deferredOperations.push(be),ye.dbReady?ye.dbReady=ye.dbReady.then(function(){return be.promise}):ye.dbReady=be.promise}function Te(ue){var ye=fe[ue.name].deferredOperations.pop();if(ye)return ye.resolve(),ye.promise}function qe(ue,ye){var be=fe[ue.name].deferredOperations.pop();if(be)return be.reject(ye),be.promise}function Ve(ue,ye){return new te(function(be,Ce){if(fe[ue.name]=fe[ue.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},ue.db){if(!ye)return be(ue.db);_e(ue),ue.db.close()}var Re=[ue.name];ye&&Re.push(ue.version);var Ae=ne.open.apply(ne,Re);ye&&(Ae.onupgradeneeded=function(Pe){var je=Ae.result;try{je.createObjectStore(ue.storeName),Pe.oldVersion<=1&&je.createObjectStore(de)}catch(Je){if(Je.name!=="ConstraintError")throw Je;console.warn('The database "'+ue.name+'" has been upgraded from version '+Pe.oldVersion+" to version "+Pe.newVersion+', but the storage "'+ue.storeName+'" already exists.')}}),Ae.onerror=function(Pe){Pe.preventDefault(),Ce(Ae.error)},Ae.onsuccess=function(){var Pe=Ae.result;Pe.onversionchange=function(je){je.target.close()},be(Pe),Te(ue)}})}function We(ue){return Ve(ue,!1)}function Fe(ue){return Ve(ue,!0)}function Ot(ue,ye){if(!ue.db)return!0;var be=!ue.db.objectStoreNames.contains(ue.storeName),Ce=ue.version<ue.db.version,Re=ue.version>ue.db.version;if(Ce&&(ue.version!==ye&&console.warn('The database "'+ue.name+`" can't be downgraded from version `+ue.db.version+" to version "+ue.version+"."),ue.version=ue.db.version),Re||be){if(be){var Ae=ue.db.version+1;Ae>ue.version&&(ue.version=Ae)}return!0}return!1}function It(ue){return re([ke(atob(ue.data))],{type:ue.type})}function Dt(ue){return ue&&ue.__local_forage_encoded_blob}function zt(ue){var ye=this,be=ye._initReady().then(function(){var Ce=fe[ye._dbInfo.name];if(Ce&&Ce.dbReady)return Ce.dbReady});return le(be,ue,ue),be}function Ut(ue,ye,be,Ce){Ce===void 0&&(Ce=1);try{var Re=ue.db.transaction(ue.storeName,ye);be(null,Re)}catch(Ae){if(Ce>0&&(!ue.db||Ae.name==="InvalidStateError"||Ae.name==="NotFoundError"))return te.resolve().then(function(){if(!ue.db||Ae.name==="NotFoundError"&&!ue.db.objectStoreNames.contains(ue.storeName)&&ue.version<=ue.db.version)return ue.db&&(ue.version=ue.db.version+1),Fe(ue)}).then(function(){return function(Pe){_e(Pe);for(var je=fe[Pe.name],Je=je.forages,He=0;He<Je.length;He++){var Ze=Je[He];Ze._dbInfo.db&&(Ze._dbInfo.db.close(),Ze._dbInfo.db=null)}return Pe.db=null,We(Pe).then(function(Qe){return Pe.db=Qe,Ot(Pe)?Fe(Pe):Qe}).then(function(Qe){Pe.db=je.db=Qe;for(var nt=0;nt<Je.length;nt++)Je[nt]._dbInfo.db=Qe}).catch(function(Qe){throw qe(Pe,Qe),Qe})}(ue).then(function(){Ut(ue,ye,be,Ce-1)})}).catch(be);be(Ae)}}var gt={_driver:"asyncStorage",_initStorage:function(ue){var ye=this,be={db:null};if(ue)for(var Ce in ue)be[Ce]=ue[Ce];var Re=fe[be.name];Re||(Re={forages:[],db:null,dbReady:null,deferredOperations:[]},fe[be.name]=Re),Re.forages.push(ye),ye._initReady||(ye._initReady=ye.ready,ye.ready=zt);var Ae=[];function Pe(){return te.resolve()}for(var je=0;je<Re.forages.length;je++){var Je=Re.forages[je];Je!==ye&&Ae.push(Je._initReady().catch(Pe))}var He=Re.forages.slice(0);return te.all(Ae).then(function(){return be.db=Re.db,We(be)}).then(function(Ze){return be.db=Ze,Ot(be,ye._defaultConfig.version)?Fe(be):Ze}).then(function(Ze){be.db=Re.db=Ze,ye._dbInfo=be;for(var Qe=0;Qe<He.length;Qe++){var nt=He[Qe];nt!==ye&&(nt._dbInfo.db=be.db,nt._dbInfo.version=be.version)}})},_support:function(){try{if(!ne||!ne.open)return!1;var ue=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),ye=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!ue||ye)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(ue,ye){var be=this,Ce=new te(function(Re,Ae){be.ready().then(function(){Ut(be._dbInfo,me,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName).openCursor(),He=1;Je.onsuccess=function(){var Ze=Je.result;if(Ze){var Qe=Ze.value;Dt(Qe)&&(Qe=It(Qe));var nt=ue(Qe,Ze.key,He++);nt!==void 0?Re(nt):Ze.continue()}else Re()},Je.onerror=function(){Ae(Je.error)}}catch(Ze){Ae(Ze)}})}).catch(Ae)});return oe(Ce,ye),Ce},getItem:function(ue,ye){var be=this;ue=ae(ue);var Ce=new te(function(Re,Ae){be.ready().then(function(){Ut(be._dbInfo,me,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName).get(ue);Je.onsuccess=function(){var He=Je.result;He===void 0&&(He=null),Dt(He)&&(He=It(He)),Re(He)},Je.onerror=function(){Ae(Je.error)}}catch(He){Ae(He)}})}).catch(Ae)});return oe(Ce,ye),Ce},setItem:function(ue,ye,be){var Ce=this;ue=ae(ue);var Re=new te(function(Ae,Pe){var je;Ce.ready().then(function(){return je=Ce._dbInfo,ge.call(ye)==="[object Blob]"?xe(je.db).then(function(Je){return Je?ye:(He=ye,new te(function(Ze,Qe){var nt=new FileReader;nt.onerror=Qe,nt.onloadend=function(ft){var bt=btoa(ft.target.result||"");Ze({__local_forage_encoded_blob:!0,data:bt,type:He.type})},nt.readAsBinaryString(He)}));var He}):ye}).then(function(Je){Ut(Ce._dbInfo,ve,function(He,Ze){if(He)return Pe(He);try{var Qe=Ze.objectStore(Ce._dbInfo.storeName);Je===null&&(Je=void 0);var nt=Qe.put(Je,ue);Ze.oncomplete=function(){Je===void 0&&(Je=null),Ae(Je)},Ze.onabort=Ze.onerror=function(){var ft=nt.error?nt.error:nt.transaction.error;Pe(ft)}}catch(ft){Pe(ft)}})}).catch(Pe)});return oe(Re,be),Re},removeItem:function(ue,ye){var be=this;ue=ae(ue);var Ce=new te(function(Re,Ae){be.ready().then(function(){Ut(be._dbInfo,ve,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName).delete(ue);je.oncomplete=function(){Re()},je.onerror=function(){Ae(Je.error)},je.onabort=function(){var He=Je.error?Je.error:Je.transaction.error;Ae(He)}}catch(He){Ae(He)}})}).catch(Ae)});return oe(Ce,ye),Ce},clear:function(ue){var ye=this,be=new te(function(Ce,Re){ye.ready().then(function(){Ut(ye._dbInfo,ve,function(Ae,Pe){if(Ae)return Re(Ae);try{var je=Pe.objectStore(ye._dbInfo.storeName).clear();Pe.oncomplete=function(){Ce()},Pe.onabort=Pe.onerror=function(){var Je=je.error?je.error:je.transaction.error;Re(Je)}}catch(Je){Re(Je)}})}).catch(Re)});return oe(be,ue),be},length:function(ue){var ye=this,be=new te(function(Ce,Re){ye.ready().then(function(){Ut(ye._dbInfo,me,function(Ae,Pe){if(Ae)return Re(Ae);try{var je=Pe.objectStore(ye._dbInfo.storeName).count();je.onsuccess=function(){Ce(je.result)},je.onerror=function(){Re(je.error)}}catch(Je){Re(Je)}})}).catch(Re)});return oe(be,ue),be},key:function(ue,ye){var be=this,Ce=new te(function(Re,Ae){ue<0?Re(null):be.ready().then(function(){Ut(be._dbInfo,me,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName),He=!1,Ze=Je.openKeyCursor();Ze.onsuccess=function(){var Qe=Ze.result;Qe?ue===0||He?Re(Qe.key):(He=!0,Qe.advance(ue)):Re(null)},Ze.onerror=function(){Ae(Ze.error)}}catch(Qe){Ae(Qe)}})}).catch(Ae)});return oe(Ce,ye),Ce},keys:function(ue){var ye=this,be=new te(function(Ce,Re){ye.ready().then(function(){Ut(ye._dbInfo,me,function(Ae,Pe){if(Ae)return Re(Ae);try{var je=Pe.objectStore(ye._dbInfo.storeName).openKeyCursor(),Je=[];je.onsuccess=function(){var He=je.result;He?(Je.push(He.key),He.continue()):Ce(Je)},je.onerror=function(){Re(je.error)}}catch(He){Re(He)}})}).catch(Re)});return oe(be,ue),be},dropInstance:function(ue,ye){ye=ce.apply(this,arguments);var be=this.config();(ue=typeof ue!="function"&&ue||{}).name||(ue.name=ue.name||be.name,ue.storeName=ue.storeName||be.storeName);var Ce,Re=this;if(ue.name){var Ae=ue.name===be.name&&Re._dbInfo.db?te.resolve(Re._dbInfo.db):We(ue).then(function(Pe){var je=fe[ue.name],Je=je.forages;je.db=Pe;for(var He=0;He<Je.length;He++)Je[He]._dbInfo.db=Pe;return Pe});Ce=ue.storeName?Ae.then(function(Pe){if(Pe.objectStoreNames.contains(ue.storeName)){var je=Pe.version+1;_e(ue);var Je=fe[ue.name],He=Je.forages;Pe.close();for(var Ze=0;Ze<He.length;Ze++){var Qe=He[Ze];Qe._dbInfo.db=null,Qe._dbInfo.version=je}var nt=new te(function(ft,bt){var qt=ne.open(ue.name,je);qt.onerror=function(an){qt.result.close(),bt(an)},qt.onupgradeneeded=function(){qt.result.deleteObjectStore(ue.storeName)},qt.onsuccess=function(){var an=qt.result;an.close(),ft(an)}});return nt.then(function(ft){Je.db=ft;for(var bt=0;bt<He.length;bt++){var qt=He[bt];qt._dbInfo.db=ft,Te(qt._dbInfo)}}).catch(function(ft){throw(qe(ue,ft)||te.resolve()).catch(function(){}),ft})}}):Ae.then(function(Pe){_e(ue);var je=fe[ue.name],Je=je.forages;Pe.close();for(var He=0;He<Je.length;He++)Je[He]._dbInfo.db=null;var Ze=new te(function(Qe,nt){var ft=ne.deleteDatabase(ue.name);ft.onerror=function(){var bt=ft.result;bt&&bt.close(),nt(ft.error)},ft.onblocked=function(){console.warn('dropInstance blocked for database "'+ue.name+'" until all open connections are closed')},ft.onsuccess=function(){var bt=ft.result;bt&&bt.close(),Qe(bt)}});return Ze.then(function(Qe){je.db=Qe;for(var nt=0;nt<Je.length;nt++)Te(Je[nt]._dbInfo)}).catch(function(Qe){throw(qe(ue,Qe)||te.resolve()).catch(function(){}),Qe})})}else Ce=te.reject("Invalid arguments");return oe(Ce,ye),Ce}},it="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zt=/^~~local_forage_type~([^~]+)~/,Ct="__lfsc__:",Ue=Ct.length,ot="arbf",Jt="blob",Nt="si08",rt="ui08",tt="uic8",at="si16",ct="si32",wt="ur16",Bt="ui32",Lt="fl32",Ft="fl64",Kt=Ue+ot.length,Gt=Object.prototype.toString;function dn(ue){var ye,be,Ce,Re,Ae,Pe=.75*ue.length,je=ue.length,Je=0;ue[ue.length-1]==="="&&(Pe--,ue[ue.length-2]==="="&&Pe--);var He=new ArrayBuffer(Pe),Ze=new Uint8Array(He);for(ye=0;ye<je;ye+=4)be=it.indexOf(ue[ye]),Ce=it.indexOf(ue[ye+1]),Re=it.indexOf(ue[ye+2]),Ae=it.indexOf(ue[ye+3]),Ze[Je++]=be<<2|Ce>>4,Ze[Je++]=(15&Ce)<<4|Re>>2,Ze[Je++]=(3&Re)<<6|63&Ae;return He}function nn(ue){var ye,be=new Uint8Array(ue),Ce="";for(ye=0;ye<be.length;ye+=3)Ce+=it[be[ye]>>2],Ce+=it[(3&be[ye])<<4|be[ye+1]>>4],Ce+=it[(15&be[ye+1])<<2|be[ye+2]>>6],Ce+=it[63&be[ye+2]];return be.length%3==2?Ce=Ce.substring(0,Ce.length-1)+"=":be.length%3==1&&(Ce=Ce.substring(0,Ce.length-2)+"=="),Ce}var rn={serialize:function(ue,ye){var be="";if(ue&&(be=Gt.call(ue)),ue&&(be==="[object ArrayBuffer]"||ue.buffer&&Gt.call(ue.buffer)==="[object ArrayBuffer]")){var Ce,Re=Ct;ue instanceof ArrayBuffer?(Ce=ue,Re+=ot):(Ce=ue.buffer,be==="[object Int8Array]"?Re+=Nt:be==="[object Uint8Array]"?Re+=rt:be==="[object Uint8ClampedArray]"?Re+=tt:be==="[object Int16Array]"?Re+=at:be==="[object Uint16Array]"?Re+=wt:be==="[object Int32Array]"?Re+=ct:be==="[object Uint32Array]"?Re+=Bt:be==="[object Float32Array]"?Re+=Lt:be==="[object Float64Array]"?Re+=Ft:ye(new Error("Failed to get type for BinaryArray"))),ye(Re+nn(Ce))}else if(be==="[object Blob]"){var Ae=new FileReader;Ae.onload=function(){var Pe="~~local_forage_type~"+ue.type+"~"+nn(this.result);ye("__lfsc__:blob"+Pe)},Ae.readAsArrayBuffer(ue)}else try{ye(JSON.stringify(ue))}catch(Pe){console.error("Couldn't convert value into a JSON string: ",ue),ye(null,Pe)}},deserialize:function(ue){if(ue.substring(0,Ue)!==Ct)return JSON.parse(ue);var ye,be=ue.substring(Kt),Ce=ue.substring(Ue,Kt);if(Ce===Jt&&Zt.test(be)){var Re=be.match(Zt);ye=Re[1],be=be.substring(Re[0].length)}var Ae=dn(be);switch(Ce){case ot:return Ae;case Jt:return re([Ae],{type:ye});case Nt:return new Int8Array(Ae);case rt:return new Uint8Array(Ae);case tt:return new Uint8ClampedArray(Ae);case at:return new Int16Array(Ae);case wt:return new Uint16Array(Ae);case ct:return new Int32Array(Ae);case Bt:return new Uint32Array(Ae);case Lt:return new Float32Array(Ae);case Ft:return new Float64Array(Ae);default:throw new Error("Unkown type: "+Ce)}},stringToBuffer:dn,bufferToString:nn};function Vt(ue,ye,be,Ce){ue.executeSql("CREATE TABLE IF NOT EXISTS "+ye.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],be,Ce)}function Qt(ue,ye,be,Ce,Re,Ae){ue.executeSql(be,Ce,Re,function(Pe,je){je.code===je.SYNTAX_ERR?Pe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[ye.storeName],function(Je,He){He.rows.length?Ae(Je,je):Vt(Je,ye,function(){Je.executeSql(be,Ce,Re,Ae)},Ae)},Ae):Ae(Pe,je)},Ae)}function gn(ue,ye,be,Ce){var Re=this;ue=ae(ue);var Ae=new te(function(Pe,je){Re.ready().then(function(){ye===void 0&&(ye=null);var Je=ye,He=Re._dbInfo;He.serializer.serialize(ye,function(Ze,Qe){Qe?je(Qe):He.db.transaction(function(nt){Qt(nt,He,"INSERT OR REPLACE INTO "+He.storeName+" (key, value) VALUES (?, ?)",[ue,Ze],function(){Pe(Je)},function(ft,bt){je(bt)})},function(nt){if(nt.code===nt.QUOTA_ERR){if(Ce>0)return void Pe(gn.apply(Re,[ue,Je,be,Ce-1]));je(nt)}})})}).catch(je)});return oe(Ae,be),Ae}function on(ue){return new te(function(ye,be){ue.transaction(function(Ce){Ce.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(Re,Ae){for(var Pe=[],je=0;je<Ae.rows.length;je++)Pe.push(Ae.rows.item(je).name);ye({db:ue,storeNames:Pe})},function(Re,Ae){be(Ae)})},function(Ce){be(Ce)})})}var Yt={_driver:"webSQLStorage",_initStorage:function(ue){var ye=this,be={db:null};if(ue)for(var Ce in ue)be[Ce]=typeof ue[Ce]!="string"?ue[Ce].toString():ue[Ce];var Re=new te(function(Ae,Pe){try{be.db=openDatabase(be.name,String(be.version),be.description,be.size)}catch(je){return Pe(je)}be.db.transaction(function(je){Vt(je,be,function(){ye._dbInfo=be,Ae()},function(Je,He){Pe(He)})},Pe)});return be.serializer=rn,Re},_support:typeof openDatabase=="function",iterate:function(ue,ye){var be=this,Ce=new te(function(Re,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"SELECT * FROM "+Pe.storeName,[],function(Je,He){for(var Ze=He.rows,Qe=Ze.length,nt=0;nt<Qe;nt++){var ft=Ze.item(nt),bt=ft.value;if(bt&&(bt=Pe.serializer.deserialize(bt)),(bt=ue(bt,ft.key,nt+1))!==void 0)return void Re(bt)}Re()},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Ce,ye),Ce},getItem:function(ue,ye){var be=this;ue=ae(ue);var Ce=new te(function(Re,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"SELECT * FROM "+Pe.storeName+" WHERE key = ? LIMIT 1",[ue],function(Je,He){var Ze=He.rows.length?He.rows.item(0).value:null;Ze&&(Ze=Pe.serializer.deserialize(Ze)),Re(Ze)},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Ce,ye),Ce},setItem:function(ue,ye,be){return gn.apply(this,[ue,ye,be,1])},removeItem:function(ue,ye){var be=this;ue=ae(ue);var Ce=new te(function(Re,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"DELETE FROM "+Pe.storeName+" WHERE key = ?",[ue],function(){Re()},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Ce,ye),Ce},clear:function(ue){var ye=this,be=new te(function(Ce,Re){ye.ready().then(function(){var Ae=ye._dbInfo;Ae.db.transaction(function(Pe){Qt(Pe,Ae,"DELETE FROM "+Ae.storeName,[],function(){Ce()},function(je,Je){Re(Je)})})}).catch(Re)});return oe(be,ue),be},length:function(ue){var ye=this,be=new te(function(Ce,Re){ye.ready().then(function(){var Ae=ye._dbInfo;Ae.db.transaction(function(Pe){Qt(Pe,Ae,"SELECT COUNT(key) as c FROM "+Ae.storeName,[],function(je,Je){var He=Je.rows.item(0).c;Ce(He)},function(je,Je){Re(Je)})})}).catch(Re)});return oe(be,ue),be},key:function(ue,ye){var be=this,Ce=new te(function(Re,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"SELECT key FROM "+Pe.storeName+" WHERE id = ? LIMIT 1",[ue+1],function(Je,He){var Ze=He.rows.length?He.rows.item(0).key:null;Re(Ze)},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Ce,ye),Ce},keys:function(ue){var ye=this,be=new te(function(Ce,Re){ye.ready().then(function(){var Ae=ye._dbInfo;Ae.db.transaction(function(Pe){Qt(Pe,Ae,"SELECT key FROM "+Ae.storeName,[],function(je,Je){for(var He=[],Ze=0;Ze<Je.rows.length;Ze++)He.push(Je.rows.item(Ze).key);Ce(He)},function(je,Je){Re(Je)})})}).catch(Re)});return oe(be,ue),be},dropInstance:function(ue,ye){ye=ce.apply(this,arguments);var be=this.config();(ue=typeof ue!="function"&&ue||{}).name||(ue.name=ue.name||be.name,ue.storeName=ue.storeName||be.storeName);var Ce,Re=this;return oe(Ce=ue.name?new te(function(Ae){var Pe;Pe=ue.name===be.name?Re._dbInfo.db:openDatabase(ue.name,"","",0),ue.storeName?Ae({db:Pe,storeNames:[ue.storeName]}):Ae(on(Pe))}).then(function(Ae){return new te(function(Pe,je){Ae.db.transaction(function(Je){function He(ft){return new te(function(bt,qt){Je.executeSql("DROP TABLE IF EXISTS "+ft,[],function(){bt()},function(an,wn){qt(wn)})})}for(var Ze=[],Qe=0,nt=Ae.storeNames.length;Qe<nt;Qe++)Ze.push(He(Ae.storeNames[Qe]));te.all(Ze).then(function(){Pe()}).catch(function(ft){je(ft)})},function(Je){je(Je)})})}):te.reject("Invalid arguments"),ye),Ce}};function se(ue,ye){var be=ue.name+"/";return ue.storeName!==ye.storeName&&(be+=ue.storeName+"/"),be}var X={_driver:"localStorageWrapper",_initStorage:function(ue){var ye={};if(ue)for(var be in ue)ye[be]=ue[be];return ye.keyPrefix=se(ue,this._defaultConfig),!function(){var Ce="_localforage_support_test";try{return localStorage.setItem(Ce,!0),localStorage.removeItem(Ce),!1}catch{return!0}}()||localStorage.length>0?(this._dbInfo=ye,ye.serializer=rn,te.resolve()):te.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(ue,ye){var be=this,Ce=be.ready().then(function(){for(var Re=be._dbInfo,Ae=Re.keyPrefix,Pe=Ae.length,je=localStorage.length,Je=1,He=0;He<je;He++){var Ze=localStorage.key(He);if(Ze.indexOf(Ae)===0){var Qe=localStorage.getItem(Ze);if(Qe&&(Qe=Re.serializer.deserialize(Qe)),(Qe=ue(Qe,Ze.substring(Pe),Je++))!==void 0)return Qe}}});return oe(Ce,ye),Ce},getItem:function(ue,ye){var be=this;ue=ae(ue);var Ce=be.ready().then(function(){var Re=be._dbInfo,Ae=localStorage.getItem(Re.keyPrefix+ue);return Ae&&(Ae=Re.serializer.deserialize(Ae)),Ae});return oe(Ce,ye),Ce},setItem:function(ue,ye,be){var Ce=this;ue=ae(ue);var Re=Ce.ready().then(function(){ye===void 0&&(ye=null);var Ae=ye;return new te(function(Pe,je){var Je=Ce._dbInfo;Je.serializer.serialize(ye,function(He,Ze){if(Ze)je(Ze);else try{localStorage.setItem(Je.keyPrefix+ue,He),Pe(Ae)}catch(Qe){Qe.name!=="QuotaExceededError"&&Qe.name!=="NS_ERROR_DOM_QUOTA_REACHED"||je(Qe),je(Qe)}})})});return oe(Re,be),Re},removeItem:function(ue,ye){var be=this;ue=ae(ue);var Ce=be.ready().then(function(){var Re=be._dbInfo;localStorage.removeItem(Re.keyPrefix+ue)});return oe(Ce,ye),Ce},clear:function(ue){var ye=this,be=ye.ready().then(function(){for(var Ce=ye._dbInfo.keyPrefix,Re=localStorage.length-1;Re>=0;Re--){var Ae=localStorage.key(Re);Ae.indexOf(Ce)===0&&localStorage.removeItem(Ae)}});return oe(be,ue),be},length:function(ue){var ye=this.keys().then(function(be){return be.length});return oe(ye,ue),ye},key:function(ue,ye){var be=this,Ce=be.ready().then(function(){var Re,Ae=be._dbInfo;try{Re=localStorage.key(ue)}catch{Re=null}return Re&&(Re=Re.substring(Ae.keyPrefix.length)),Re});return oe(Ce,ye),Ce},keys:function(ue){var ye=this,be=ye.ready().then(function(){for(var Ce=ye._dbInfo,Re=localStorage.length,Ae=[],Pe=0;Pe<Re;Pe++){var je=localStorage.key(Pe);je.indexOf(Ce.keyPrefix)===0&&Ae.push(je.substring(Ce.keyPrefix.length))}return Ae});return oe(be,ue),be},dropInstance:function(ue,ye){if(ye=ce.apply(this,arguments),!(ue=typeof ue!="function"&&ue||{}).name){var be=this.config();ue.name=ue.name||be.name,ue.storeName=ue.storeName||be.storeName}var Ce,Re=this;return Ce=ue.name?new te(function(Ae){ue.storeName?Ae(se(ue,Re._defaultConfig)):Ae(ue.name+"/")}).then(function(Ae){for(var Pe=localStorage.length-1;Pe>=0;Pe--){var je=localStorage.key(Pe);je.indexOf(Ae)===0&&localStorage.removeItem(je)}}):te.reject("Invalid arguments"),oe(Ce,ye),Ce}},ee=function(ue,ye){for(var be=ue.length,Ce=0;Ce<be;){if((Re=ue[Ce])===(Ae=ye)||typeof Re=="number"&&typeof Ae=="number"&&isNaN(Re)&&isNaN(Ae))return!0;Ce++}var Re,Ae;return!1},pe=Array.isArray||function(ue){return Object.prototype.toString.call(ue)==="[object Array]"},Oe={},De={},Le={INDEXEDDB:gt,WEBSQL:Yt,LOCALSTORAGE:X},ut=[Le.INDEXEDDB._driver,Le.WEBSQL._driver,Le.LOCALSTORAGE._driver],St=["dropInstance"],vt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(St),Rt={description:"",driver:ut.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tt(ue,ye){ue[ye]=function(){var be=arguments;return ue.ready().then(function(){return ue[ye].apply(ue,be)})}}function hn(){for(var ue=1;ue<arguments.length;ue++){var ye=arguments[ue];if(ye)for(var be in ye)ye.hasOwnProperty(be)&&(pe(ye[be])?arguments[0][be]=ye[be].slice():arguments[0][be]=ye[be])}return arguments[0]}var Yn=function(){function ue(ye){for(var be in function(Ae,Pe){if(!(Ae instanceof Pe))throw new TypeError("Cannot call a class as a function")}(this,ue),Le)if(Le.hasOwnProperty(be)){var Ce=Le[be],Re=Ce._driver;this[be]=Re,Oe[Re]||this.defineDriver(Ce)}this._defaultConfig=hn({},Rt),this._config=hn({},this._defaultConfig,ye),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return ue.prototype.config=function(ye){if((ye===void 0?"undefined":Q(ye))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var be in ye){if(be==="storeName"&&(ye[be]=ye[be].replace(/\W/g,"_")),be==="version"&&typeof ye[be]!="number")return new Error("Database version must be a number.");this._config[be]=ye[be]}return!("driver"in ye)||!ye.driver||this.setDriver(this._config.driver)}return typeof ye=="string"?this._config[ye]:this._config},ue.prototype.defineDriver=function(ye,be,Ce){var Re=new te(function(Ae,Pe){try{var je=ye._driver,Je=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!ye._driver)return void Pe(Je);for(var He=vt.concat("_initStorage"),Ze=0,Qe=He.length;Ze<Qe;Ze++){var nt=He[Ze];if((!ee(St,nt)||ye[nt])&&typeof ye[nt]!="function")return void Pe(Je)}(function(){for(var bt=function(Dn){return function(){var Xn=new Error("Method "+Dn+" is not implemented by the current driver"),Mt=te.reject(Xn);return oe(Mt,arguments[arguments.length-1]),Mt}},qt=0,an=St.length;qt<an;qt++){var wn=St[qt];ye[wn]||(ye[wn]=bt(wn))}})();var ft=function(bt){Oe[je]&&console.info("Redefining LocalForage driver: "+je),Oe[je]=ye,De[je]=bt,Ae()};"_support"in ye?ye._support&&typeof ye._support=="function"?ye._support().then(ft,Pe):ft(!!ye._support):ft(!0)}catch(bt){Pe(bt)}});return le(Re,be,Ce),Re},ue.prototype.driver=function(){return this._driver||null},ue.prototype.getDriver=function(ye,be,Ce){var Re=Oe[ye]?te.resolve(Oe[ye]):te.reject(new Error("Driver not found."));return le(Re,be,Ce),Re},ue.prototype.getSerializer=function(ye){var be=te.resolve(rn);return le(be,ye),be},ue.prototype.ready=function(ye){var be=this,Ce=be._driverSet.then(function(){return be._ready===null&&(be._ready=be._initDriver()),be._ready});return le(Ce,ye,ye),Ce},ue.prototype.setDriver=function(ye,be,Ce){var Re=this;pe(ye)||(ye=[ye]);var Ae=this._getSupportedDrivers(ye);function Pe(){Re._config.driver=Re.driver()}function je(He){return Re._extend(He),Pe(),Re._ready=Re._initStorage(Re._config),Re._ready}var Je=this._driverSet!==null?this._driverSet.catch(function(){return te.resolve()}):te.resolve();return this._driverSet=Je.then(function(){var He=Ae[0];return Re._dbInfo=null,Re._ready=null,Re.getDriver(He).then(function(Ze){Re._driver=Ze._driver,Pe(),Re._wrapLibraryMethodsWithReady(),Re._initDriver=function(Qe){return function(){var nt=0;return function ft(){for(;nt<Qe.length;){var bt=Qe[nt];return nt++,Re._dbInfo=null,Re._ready=null,Re.getDriver(bt).then(je).catch(ft)}Pe();var qt=new Error("No available storage method found.");return Re._driverSet=te.reject(qt),Re._driverSet}()}}(Ae)})}).catch(function(){Pe();var He=new Error("No available storage method found.");return Re._driverSet=te.reject(He),Re._driverSet}),le(this._driverSet,be,Ce),this._driverSet},ue.prototype.supports=function(ye){return!!De[ye]},ue.prototype._extend=function(ye){hn(this,ye)},ue.prototype._getSupportedDrivers=function(ye){for(var be=[],Ce=0,Re=ye.length;Ce<Re;Ce++){var Ae=ye[Ce];this.supports(Ae)&&be.push(Ae)}return be},ue.prototype._wrapLibraryMethodsWithReady=function(){for(var ye=0,be=vt.length;ye<be;ye++)Tt(this,vt[ye])},ue.prototype.createInstance=function(ye){return new ue(ye)},ue}(),Qn=new Yn;z.exports=Qn},{3:3}]},{},[4])(4)},961:(D,N,O)=>{var I,z=function(){var J=String.fromCharCode,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",re={};function te(le,ae){if(!re[le]){re[le]={};for(var ce=0;ce<le.length;ce++)re[le][le.charAt(ce)]=ce}return re[le][ae]}var oe={compressToBase64:function(le){if(le==null)return"";var ae=oe._compress(le,6,function(ce){return Q.charAt(ce)});switch(ae.length%4){default:case 0:return ae;case 1:return ae+"===";case 2:return ae+"==";case 3:return ae+"="}},decompressFromBase64:function(le){return le==null?"":le==""?null:oe._decompress(le.length,32,function(ae){return te(Q,le.charAt(ae))})},compressToUTF16:function(le){return le==null?"":oe._compress(le,15,function(ae){return J(ae+32)})+" "},decompressFromUTF16:function(le){return le==null?"":le==""?null:oe._decompress(le.length,16384,function(ae){return le.charCodeAt(ae)-32})},compressToUint8Array:function(le){for(var ae=oe.compress(le),ce=new Uint8Array(2*ae.length),de=0,we=ae.length;de<we;de++){var fe=ae.charCodeAt(de);ce[2*de]=fe>>>8,ce[2*de+1]=fe%256}return ce},decompressFromUint8Array:function(le){if(le==null)return oe.decompress(le);for(var ae=new Array(le.length/2),ce=0,de=ae.length;ce<de;ce++)ae[ce]=256*le[2*ce]+le[2*ce+1];var we=[];return ae.forEach(function(fe){we.push(J(fe))}),oe.decompress(we.join(""))},compressToEncodedURIComponent:function(le){return le==null?"":oe._compress(le,6,function(ae){return ne.charAt(ae)})},decompressFromEncodedURIComponent:function(le){return le==null?"":le==""?null:(le=le.replace(/ /g,"+"),oe._decompress(le.length,32,function(ae){return te(ne,le.charAt(ae))}))},compress:function(le){return oe._compress(le,16,function(ae){return J(ae)})},_compress:function(le,ae,ce){if(le==null)return"";var de,we,fe,ge={},me={},ve="",ke="",xe="",_e=2,Te=3,qe=2,Ve=[],We=0,Fe=0;for(fe=0;fe<le.length;fe+=1)if(ve=le.charAt(fe),Object.prototype.hasOwnProperty.call(ge,ve)||(ge[ve]=Te++,me[ve]=!0),ke=xe+ve,Object.prototype.hasOwnProperty.call(ge,ke))xe=ke;else{if(Object.prototype.hasOwnProperty.call(me,xe)){if(xe.charCodeAt(0)<256){for(de=0;de<qe;de++)We<<=1,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++;for(we=xe.charCodeAt(0),de=0;de<8;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}else{for(we=1,de=0;de<qe;de++)We=We<<1|we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we=0;for(we=xe.charCodeAt(0),de=0;de<16;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}--_e==0&&(_e=Math.pow(2,qe),qe++),delete me[xe]}else for(we=ge[xe],de=0;de<qe;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1;--_e==0&&(_e=Math.pow(2,qe),qe++),ge[ke]=Te++,xe=String(ve)}if(xe!==""){if(Object.prototype.hasOwnProperty.call(me,xe)){if(xe.charCodeAt(0)<256){for(de=0;de<qe;de++)We<<=1,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++;for(we=xe.charCodeAt(0),de=0;de<8;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}else{for(we=1,de=0;de<qe;de++)We=We<<1|we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we=0;for(we=xe.charCodeAt(0),de=0;de<16;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}--_e==0&&(_e=Math.pow(2,qe),qe++),delete me[xe]}else for(we=ge[xe],de=0;de<qe;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1;--_e==0&&(_e=Math.pow(2,qe),qe++)}for(we=2,de=0;de<qe;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1;for(;;){if(We<<=1,Fe==ae-1){Ve.push(ce(We));break}Fe++}return Ve.join("")},decompress:function(le){return le==null?"":le==""?null:oe._decompress(le.length,32768,function(ae){return le.charCodeAt(ae)})},_decompress:function(le,ae,ce){var de,we,fe,ge,me,ve,ke,xe=[],_e=4,Te=4,qe=3,Ve="",We=[],Fe={val:ce(0),position:ae,index:1};for(de=0;de<3;de+=1)xe[de]=de;for(fe=0,me=Math.pow(2,2),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;switch(fe){case 0:for(fe=0,me=Math.pow(2,8),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;ke=J(fe);break;case 1:for(fe=0,me=Math.pow(2,16),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;ke=J(fe);break;case 2:return""}for(xe[3]=ke,we=ke,We.push(ke);;){if(Fe.index>le)return"";for(fe=0,me=Math.pow(2,qe),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;switch(ke=fe){case 0:for(fe=0,me=Math.pow(2,8),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;xe[Te++]=J(fe),ke=Te-1,_e--;break;case 1:for(fe=0,me=Math.pow(2,16),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;xe[Te++]=J(fe),ke=Te-1,_e--;break;case 2:return We.join("")}if(_e==0&&(_e=Math.pow(2,qe),qe++),xe[ke])Ve=xe[ke];else{if(ke!==Te)return null;Ve=we+we.charAt(0)}We.push(Ve),xe[Te++]=we+Ve.charAt(0),we=Ve,--_e==0&&(_e=Math.pow(2,qe),qe++)}}};return oe}();(I=(function(){return z}).call(N,O,N,D))===void 0||(D.exports=I)},895:D=>{D.exports=function(N,O,I,z){var J=N[0],Q=N[1],ne=!1;I===void 0&&(I=0),z===void 0&&(z=O.length);for(var re=(z-I)/2,te=0,oe=re-1;te<re;oe=te++){var le=O[I+2*te+0],ae=O[I+2*te+1],ce=O[I+2*oe+0],de=O[I+2*oe+1];ae>Q!=de>Q&&J<(ce-le)*(Q-ae)/(de-ae)+le&&(ne=!ne)}return ne}},946:(D,N,O)=>{const I=O(909),z=async()=>await I.get({dir:"areaList",file:"index"}),J=({name:oe,list:le})=>{let ae=oe;const ce=le.find(we=>ae.indexOf(we.name)!==-1);if(ce){const we=ce.name.length;return ae=ae.slice(we,oe.length),{id:ce.id,name:ae,children:ce.children}}const de=le.find(we=>ae.indexOf(we.shortName)!==-1);if(de){const we=de.shortName.length;return ae=ae.slice(we,oe.length),{id:de.id,name:ae,children:de.children}}return null},Q=async(oe="",le)=>{let ae=oe;const ce={province:"",city:"",district:""};let de=le;le||(de=await z());const we=J({name:ae,list:de});if(we){ae=we.name,ce.province=we.id;const me=we.children,ve=J({name:ae,list:me});if(ve){ae=ve.name,ce.city=ve.id;const _e=J({name:ae,list:ve.children});return _e&&(ae=_e.name,ce.district=_e.id),ce}const ke=me.reduce((_e,Te)=>Te.children?_e.concat(Te.children):_e,[]),xe=J({name:ae,list:ke});return xe&&(ae=xe.name,ce.district=xe.id),ce}const fe=de.reduce((me,ve)=>ve.children?me.concat(ve.children):me,[]),ge=J({name:ae,list:fe});if(ge){ae=ge.name,ce.city=ge.id;const me=J({name:ae,list:ge.children});me&&(ae=me.name,ce.district=me.id)}return ce},ne=async(oe={})=>{let{code:le}={...oe};le=typeof le=="string"?le:le.toString();const ae={province:"",provinceCode:"",city:"",cityCode:"",district:"",districtCode:"",code:le,address:""};if((await z()).every(ce=>ce.id===le?(ae.province=ce.name,ae.provinceCode=ce.id,!1):!ce.children||ce.children.every(de=>de.id===le?(ae.province=ce.name,ae.provinceCode=ce.id,ae.city=de.name,ae.cityCode=de.id,!1):!de.children||de.children.every(we=>we.id!==le||(ae.province=ce.name,ae.provinceCode=ce.id,ae.city=de.name,ae.cityCode=de.id,ae.district=we.name,ae.districtCode=we.id,!1)))))throw new Error("未找到该地区");return ae.address=ae.province+ae.city+ae.district,ae},re=async({provinceCode:oe,cityCode:le,districtCode:ae})=>{const ce={province:{},city:{},district:{}};if(oe){const de=await I.get({dir:"province",file:oe});ce.province={code:de.id,location:de.location,name:de.name,pinyin:de.pinyin}}if(le){const de=(await I.get({dir:"city",file:oe})).find(we=>we.id===le);ce.city={code:de.id,location:de.location,name:de.name,pinyin:de.pinyin}}if(ae){const de=(await I.get({dir:"district",file:le})).find(we=>we.id===ae);ce.district={code:de.id,location:de.location,name:de.name,pinyin:de.pinyin}}return ce},te=async(oe,le)=>{let ae=le;if(ae||(ae=await z()),!oe)return ae.map(ce=>({code:ce.id,name:ce.name}));for(let ce=0;ce<ae.length;ce++){const de=ae[ce];if(de.id===oe&&de.children)return de.children.map(we=>({code:we.id,name:we.name}));if(de.children){const we=await te(oe,de.children);if(we)return we}}};D.exports={getList:te,searchCodeInfo:async({code:oe,detail:le})=>{const{province:ae,city:ce,district:de,address:we,provinceCode:fe,cityCode:ge,districtCode:me}=await ne({code:oe}),ve={province:ae,city:ce,district:de,address:we,code:oe};if(le){const ke=await re({provinceCode:fe,cityCode:ge,districtCode:me});ve.detail=ke}return ve},searchStrAddress:async oe=>{const{province:le,city:ae,district:ce}=await Q(oe);return ce||ae||le||null},analysisAddress:Q,searchCodeDetailInfo:async({code:oe})=>{const{provinceCode:le,cityCode:ae,districtCode:ce}=await ne({code:oe}),de=await re({provinceCode:le,cityCode:ae,districtCode:ce});return Object.keys(de.district).length?de.district:Object.keys(de.city).length?de.city:Object.keys(de.province).length?de.province:void 0}}},182:D=>{D.exports=new class{constructor(){this.config={timeout:1e4,enableHighAccuracy:!1,detail:!1},this.cdn=["https://npm.onmicrosoft.cn/@pikaz/location/lib","https://unpkg.com/@pikaz/location/lib"],this.userCdn=""}set(N){this.config={...this.config,...N},this.config.url&&(this.userCdn=this.config.url)}}},955:(D,N,O)=>{const I=O(909),z=O(895),J=O(182),Q=({latitude:ne,longitude:re,address:te})=>te.find(oe=>oe.polygon.find(le=>{if(z([re,ne],le))return le}));D.exports={getGeo:(ne={})=>{const{enableHighAccuracy:re,timeout:te}={...J.config,...ne};return new Promise((oe,le)=>{if(navigator.geolocation){const ae=navigator.geolocation.watchPosition(ce=>{const{latitude:de,longitude:we}=ce.coords;navigator.geolocation.clearWatch(ae),oe({latitude:de,longitude:we})},ce=>{switch(navigator.geolocation.clearWatch(ae),ce.code){case ce.PERMISSION_DENIED:le(new Error("html5已拒绝定位"));break;case ce.POSITION_UNAVAILABLE:le(new Error("html5位置信息不可用"));break;case ce.TIMEOUT:le(new Error("定位超时"));break;case ce.UNKNOWN_ERROR:le(new Error("html5定位未知错误"))}},{enableHighAccuracy:re,timeout:te,maximumAge:0})}else le(new Error("浏览器不支持HTML5定位"))})},getGeoCode:async({latitude:ne,longitude:re})=>{try{let te="";const oe=(await I.get({dir:"province",file:"short"})).filter(ae=>Q({latitude:ne,longitude:re,address:[ae]}));let le="";for(let ae=0;ae<oe.length;ae++){const{id:ce}=oe[ae],de=await I.get({dir:"province",file:ce}),we=Q({latitude:ne,longitude:re,address:[de]});we&&(le=we)}if(le){te=le.id;const ae=await I.get({dir:"city",file:le.id}),ce=Q({latitude:ne,longitude:re,address:ae});if(ce){te=ce.id;const de=await I.get({dir:"district",file:ce.id}),we=Q({latitude:ne,longitude:re,address:de});we&&(te=we.id)}}if(!te)throw new Error("非中国境内");return te}catch(te){throw te}}}},909:(D,N,O)=>{const I=O(218),{decompressFromEncodedURIComponent:z}=O(961),J=O(483),Q=O(182),{version:ne,fileDate:re}=O(147);D.exports=new class{constructor(){this.local=null,this.localConfig={name:"pikazLocation",storeName:"v"+ne.split(".")[0]+"."+ne.split(".")[1]}}async get({dir:te,file:oe}){if(!this.local){const ce=J.createInstance(this.localConfig);await ce.ready(),this.local=ce}const le=`${te}-${oe}-${re[te]}`,ae=await this.local.getItem(le);if(ae)return ae;try{const ce=await(async({file:de})=>{const we=I.CancelToken;let fe;const ge=async(me,ve)=>{const ke=await I({url:`${me}/static/${ve}.json`,method:"get",dataType:"json",cancelToken:new we(function(_e){fe=_e}),timeout:Q.timeout});if(!ke||!ke.data||Object.prototype.toString.call(ke.data.s)!="[object String]")throw new Error("未获取到文件");const xe=z(ke.data.s);return JSON.parse(xe)};try{const me=Q.userCdn;if(me)return await ge(me,de);throw new Error("未找到设置的url")}catch{const ve=Q.cdn.map(ke=>new Promise(xe=>{ge(ke,de).then(_e=>{xe(_e)}).catch(()=>{})}));try{return await Promise.race(ve)}catch{throw new Error("定位失败")}finally{fe()}}})({file:`${te}/${oe}`});return this.local.setItem(le,ce),ce}catch{throw new Error("定位失败")}}async getVal({key:te,gainVal:oe,expiration:le}){if(!this.local){const ge=J.createInstance(this.localConfig);await ge.ready(),this.local=ge}const ae=new Date().getTime(),ce=le||0,de=`local-${te}`,we=await this.local.getItem(de);if(we&&we.expiration>ae)return we.val;const fe=await oe();return await this.local.setItem(de,{val:fe,expiration:ae+ce}),fe}async clear(){await this.local.clear()}}},138:(D,N,O)=>{const I=O(182),{getGeo:z,getGeoCode:J}=O(955),{getList:Q,searchCodeInfo:ne,searchStrAddress:re,searchCodeDetailInfo:te}=O(946),{getIpCode:oe}=O(454),le=async(fe,ge={})=>{let{timeout:me}={...I.config,...ge};return await Promise.race([fe(ge),new Promise((ve,ke)=>{setTimeout(()=>{ke(new Error("定位超时"))},me)})])},ae=async(fe={})=>{let{timeout:ge,enableHighAccuracy:me,detail:ve,latitude:ke,longitude:xe}={...I.config,...fe};if(!ke||!xe){const{latitude:_e,longitude:Te}=await z({timeout:ge,enableHighAccuracy:me});ke=_e,xe=Te}return await le(async()=>{const _e=await J({latitude:ke,longitude:xe});if(!_e)throw new Error("非中国境内");return{...await ne({code:_e,detail:ve}),latitude:ke,longitude:xe}},{timeout:ge})},ce=async(fe={})=>{let{detail:ge,ip:me}={...I.config,...fe};const{code:ve,ip:ke}=await oe({ip:me});return me||(me=ke),{...await ne({code:ve,detail:ge}),ip:me}},de=async(fe={})=>{const{address:ge,detail:me}={...I.config,...fe},ve=await re(ge);if(!ve)throw new Error("解析地址失败,请确认地址包含省级或市级名称");return await ne({code:ve,detail:me})},we=async(fe={})=>{const{code:ge,detail:me}={...I.config,...fe};return await ne({code:ge,detail:me})};D.exports={setConfig:({timeout:fe,url:ge})=>{I.set({timeout:fe,url:ge})},getLocation:async(fe={})=>{try{return{...await ae(fe),type:"h5"}}catch{return{...await le(ce,fe),type:"ip"}}},getH5Location:ae,getIpLocation:fe=>le(ce,fe),searchList:async(fe={})=>{const{code:ge}={...fe};return await Q(ge||"")||[]},searchCodeAddress:fe=>le(we,fe),searchAddress:fe=>le(de,fe),searchCodeDetail:fe=>le(te,fe)}},454:(D,N,O)=>{const{decompressFromEncodedURIComponent:I}=O(961),z=O(909),J=ne=>{const re=ne.split(".").reduce((te,oe)=>`${te}${(le=>{const ae=le.split("").reverse();return new Array(3).fill(0).map((ce,de)=>ae[de]||0).reverse().join("")})(oe)}`,"");return Number(re)},Q=()=>new Promise((ne,re)=>{const te="ipCallback"+new Date().getTime(),oe=document.createElement("script");oe.onerror=()=>{re(new Error("获取ip失败"))},window[te]=le=>{le&&le.ip?ne(le.ip):re(new Error("ip定位失败"))},oe.src=I("BYFxAcGcC4HpYIbgJYDpkoGYE9UHsAnAc1gH5NCBbBEAXgCtI8A7cAMjYGMEAbHgIwScA1rSA")+te,document.body.appendChild(oe)});D.exports={addZero:J,getIpCode:async(ne={})=>{let{ip:re}={...ne};re||(re=await z.getVal({key:"ip",gainVal:Q,expiration:864e5}));const te=re.split(".").map(oe=>Number(oe)||0);if(te.length!==4)throw new Error("ip格式错误,只支持ipv4");return{code:(await z.get({dir:"ip",file:`${te[0]}.${te[1]}`})).reduce((oe,le)=>{const{district:ae,id:ce}=le,de=J(re);return de>=ae[0]&&de<=ae[1]?ce:oe},""),ip:re}}}},218:(D,N,O)=>{function I(ie,he){return function(){return ie.apply(he,arguments)}}const{toString:z}=Object.prototype,{getPrototypeOf:J}=Object,Q=(ne=Object.create(null),ie=>{const he=z.call(ie);return ne[he]||(ne[he]=he.slice(8,-1).toLowerCase())});var ne;const re=ie=>(ie=ie.toLowerCase(),he=>Q(he)===ie),te=ie=>he=>typeof he===ie,{isArray:oe}=Array,le=te("undefined"),ae=re("ArrayBuffer"),ce=te("string"),de=te("function"),we=te("number"),fe=ie=>ie!==null&&typeof ie=="object",ge=ie=>{if(Q(ie)!=="object")return!1;const he=J(ie);return!(he!==null&&he!==Object.prototype&&Object.getPrototypeOf(he)!==null||Symbol.toStringTag in ie||Symbol.iterator in ie)},me=re("Date"),ve=re("File"),ke=re("Blob"),xe=re("FileList"),_e=re("URLSearchParams");function Te(ie,he,{allOwnKeys:Se=!1}={}){if(ie==null)return;let Ee,$e;if(typeof ie!="object"&&(ie=[ie]),oe(ie))for(Ee=0,$e=ie.length;Ee<$e;Ee++)he.call(null,ie[Ee],Ee,ie);else{const Me=Se?Object.getOwnPropertyNames(ie):Object.keys(ie),Ne=Me.length;let Ge;for(Ee=0;Ee<Ne;Ee++)Ge=Me[Ee],he.call(null,ie[Ge],Ge,ie)}}function qe(ie,he){he=he.toLowerCase();const Se=Object.keys(ie);let Ee,$e=Se.length;for(;$e-- >0;)if(Ee=Se[$e],he===Ee.toLowerCase())return Ee;return null}const Ve=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:O.g,We=ie=>!le(ie)&&ie!==Ve,Fe=(Ot=typeof Uint8Array<"u"&&J(Uint8Array),ie=>Ot&&ie instanceof Ot);var Ot;const It=re("HTMLFormElement"),Dt=(({hasOwnProperty:ie})=>(he,Se)=>ie.call(he,Se))(Object.prototype),zt=re("RegExp"),Ut=(ie,he)=>{const Se=Object.getOwnPropertyDescriptors(ie),Ee={};Te(Se,($e,Me)=>{let Ne;(Ne=he($e,Me,ie))!==!1&&(Ee[Me]=Ne||$e)}),Object.defineProperties(ie,Ee)},gt="abcdefghijklmnopqrstuvwxyz",it="0123456789",Zt={DIGIT:it,ALPHA:gt,ALPHA_DIGIT:gt+gt.toUpperCase()+it},Ct=re("AsyncFunction");var Ue={isArray:oe,isArrayBuffer:ae,isBuffer:function(ie){return ie!==null&&!le(ie)&&ie.constructor!==null&&!le(ie.constructor)&&de(ie.constructor.isBuffer)&&ie.constructor.isBuffer(ie)},isFormData:ie=>{let he;return ie&&(typeof FormData=="function"&&ie instanceof FormData||de(ie.append)&&((he=Q(ie))==="formdata"||he==="object"&&de(ie.toString)&&ie.toString()==="[object FormData]"))},isArrayBufferView:function(ie){let he;return he=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ie):ie&&ie.buffer&&ae(ie.buffer),he},isString:ce,isNumber:we,isBoolean:ie=>ie===!0||ie===!1,isObject:fe,isPlainObject:ge,isUndefined:le,isDate:me,isFile:ve,isBlob:ke,isRegExp:zt,isFunction:de,isStream:ie=>fe(ie)&&de(ie.pipe),isURLSearchParams:_e,isTypedArray:Fe,isFileList:xe,forEach:Te,merge:function ie(){const{caseless:he}=We(this)&&this||{},Se={},Ee=($e,Me)=>{const Ne=he&&qe(Se,Me)||Me;ge(Se[Ne])&&ge($e)?Se[Ne]=ie(Se[Ne],$e):ge($e)?Se[Ne]=ie({},$e):oe($e)?Se[Ne]=$e.slice():Se[Ne]=$e};for(let $e=0,Me=arguments.length;$e<Me;$e++)arguments[$e]&&Te(arguments[$e],Ee);return Se},extend:(ie,he,Se,{allOwnKeys:Ee}={})=>(Te(he,($e,Me)=>{Se&&de($e)?ie[Me]=I($e,Se):ie[Me]=$e},{allOwnKeys:Ee}),ie),trim:ie=>ie.trim?ie.trim():ie.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:ie=>(ie.charCodeAt(0)===65279&&(ie=ie.slice(1)),ie),inherits:(ie,he,Se,Ee)=>{ie.prototype=Object.create(he.prototype,Ee),ie.prototype.constructor=ie,Object.defineProperty(ie,"super",{value:he.prototype}),Se&&Object.assign(ie.prototype,Se)},toFlatObject:(ie,he,Se,Ee)=>{let $e,Me,Ne;const Ge={};if(he=he||{},ie==null)return he;do{for($e=Object.getOwnPropertyNames(ie),Me=$e.length;Me-- >0;)Ne=$e[Me],Ee&&!Ee(Ne,ie,he)||Ge[Ne]||(he[Ne]=ie[Ne],Ge[Ne]=!0);ie=Se!==!1&&J(ie)}while(ie&&(!Se||Se(ie,he))&&ie!==Object.prototype);return he},kindOf:Q,kindOfTest:re,endsWith:(ie,he,Se)=>{ie=String(ie),(Se===void 0||Se>ie.length)&&(Se=ie.length),Se-=he.length;const Ee=ie.indexOf(he,Se);return Ee!==-1&&Ee===Se},toArray:ie=>{if(!ie)return null;if(oe(ie))return ie;let he=ie.length;if(!we(he))return null;const Se=new Array(he);for(;he-- >0;)Se[he]=ie[he];return Se},forEachEntry:(ie,he)=>{const Se=(ie&&ie[Symbol.iterator]).call(ie);let Ee;for(;(Ee=Se.next())&&!Ee.done;){const $e=Ee.value;he.call(ie,$e[0],$e[1])}},matchAll:(ie,he)=>{let Se;const Ee=[];for(;(Se=ie.exec(he))!==null;)Ee.push(Se);return Ee},isHTMLForm:It,hasOwnProperty:Dt,hasOwnProp:Dt,reduceDescriptors:Ut,freezeMethods:ie=>{Ut(ie,(he,Se)=>{if(de(ie)&&["arguments","caller","callee"].indexOf(Se)!==-1)return!1;const Ee=ie[Se];de(Ee)&&(he.enumerable=!1,"writable"in he?he.writable=!1:he.set||(he.set=()=>{throw Error("Can not rewrite read-only method '"+Se+"'")}))})},toObjectSet:(ie,he)=>{const Se={},Ee=$e=>{$e.forEach(Me=>{Se[Me]=!0})};return oe(ie)?Ee(ie):Ee(String(ie).split(he)),Se},toCamelCase:ie=>ie.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(he,Se,Ee){return Se.toUpperCase()+Ee}),noop:()=>{},toFiniteNumber:(ie,he)=>(ie=+ie,Number.isFinite(ie)?ie:he),findKey:qe,global:Ve,isContextDefined:We,ALPHABET:Zt,generateString:(ie=16,he=Zt.ALPHA_DIGIT)=>{let Se="";const{length:Ee}=he;for(;ie--;)Se+=he[Math.random()*Ee|0];return Se},isSpecCompliantForm:function(ie){return!!(ie&&de(ie.append)&&ie[Symbol.toStringTag]==="FormData"&&ie[Symbol.iterator])},toJSONObject:ie=>{const he=new Array(10),Se=(Ee,$e)=>{if(fe(Ee)){if(he.indexOf(Ee)>=0)return;if(!("toJSON"in Ee)){he[$e]=Ee;const Me=oe(Ee)?[]:{};return Te(Ee,(Ne,Ge)=>{const Ye=Se(Ne,$e+1);!le(Ye)&&(Me[Ge]=Ye)}),he[$e]=void 0,Me}}return Ee};return Se(ie,0)},isAsyncFn:Ct,isThenable:ie=>ie&&(fe(ie)||de(ie))&&de(ie.then)&&de(ie.catch)};function ot(ie,he,Se,Ee,$e){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=ie,this.name="AxiosError",he&&(this.code=he),Se&&(this.config=Se),Ee&&(this.request=Ee),$e&&(this.response=$e)}Ue.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ue.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Jt=ot.prototype,Nt={};function rt(ie){return Ue.isPlainObject(ie)||Ue.isArray(ie)}function tt(ie){return Ue.endsWith(ie,"[]")?ie.slice(0,-2):ie}function at(ie,he,Se){return ie?ie.concat(he).map(function(Ee,$e){return Ee=tt(Ee),!Se&&$e?"["+Ee+"]":Ee}).join(Se?".":""):he}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(ie=>{Nt[ie]={value:ie}}),Object.defineProperties(ot,Nt),Object.defineProperty(Jt,"isAxiosError",{value:!0}),ot.from=(ie,he,Se,Ee,$e,Me)=>{const Ne=Object.create(Jt);return Ue.toFlatObject(ie,Ne,function(Ge){return Ge!==Error.prototype},Ge=>Ge!=="isAxiosError"),ot.call(Ne,ie.message,he,Se,Ee,$e),Ne.cause=ie,Ne.name=ie.name,Me&&Object.assign(Ne,Me),Ne};const ct=Ue.toFlatObject(Ue,{},null,function(ie){return/^is[A-Z]/.test(ie)});function wt(ie,he,Se){if(!Ue.isObject(ie))throw new TypeError("target must be an object");he=he||new FormData;const Ee=(Se=Ue.toFlatObject(Se,{metaTokens:!0,dots:!1,indexes:!1},!1,function(et,kt){return!Ue.isUndefined(kt[et])})).metaTokens,$e=Se.visitor||Ke,Me=Se.dots,Ne=Se.indexes,Ge=(Se.Blob||typeof Blob<"u"&&Blob)&&Ue.isSpecCompliantForm(he);if(!Ue.isFunction($e))throw new TypeError("visitor must be a function");function Ye(et){if(et===null)return"";if(Ue.isDate(et))return et.toISOString();if(!Ge&&Ue.isBlob(et))throw new ot("Blob is not supported. Use a Buffer instead.");return Ue.isArrayBuffer(et)||Ue.isTypedArray(et)?Ge&&typeof Blob=="function"?new Blob([et]):Buffer.from(et):et}function Ke(et,kt,Xe){let Et=et;if(et&&!Xe&&typeof et=="object"){if(Ue.endsWith(kt,"{}"))kt=Ee?kt:kt.slice(0,-2),et=JSON.stringify(et);else if(Ue.isArray(et)&&function(Ht){return Ue.isArray(Ht)&&!Ht.some(rt)}(et)||(Ue.isFileList(et)||Ue.endsWith(kt,"[]"))&&(Et=Ue.toArray(et)))return kt=tt(kt),Et.forEach(function(Ht,sn){!Ue.isUndefined(Ht)&&Ht!==null&&he.append(Ne===!0?at([kt],sn,Me):Ne===null?kt:kt+"[]",Ye(Ht))}),!1}return!!rt(et)||(he.append(at(Xe,kt,Me),Ye(et)),!1)}const ze=[],mt=Object.assign(ct,{defaultVisitor:Ke,convertValue:Ye,isVisitable:rt});if(!Ue.isObject(ie))throw new TypeError("data must be an object");return function et(kt,Xe){if(!Ue.isUndefined(kt)){if(ze.indexOf(kt)!==-1)throw Error("Circular reference detected in "+Xe.join("."));ze.push(kt),Ue.forEach(kt,function(Et,Ht){(!(Ue.isUndefined(Et)||Et===null)&&$e.call(he,Et,Ue.isString(Ht)?Ht.trim():Ht,Xe,mt))===!0&&et(Et,Xe?Xe.concat(Ht):[Ht])}),ze.pop()}}(ie),he}function Bt(ie){const he={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(ie).replace(/[!'()~]|%20|%00/g,function(Se){return he[Se]})}function Lt(ie,he){this._pairs=[],ie&&wt(ie,this,he)}const Ft=Lt.prototype;function Kt(ie){return encodeURIComponent(ie).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gt(ie,he,Se){if(!he)return ie;const Ee=Se&&Se.encode||Kt,$e=Se&&Se.serialize;let Me;if(Me=$e?$e(he,Se):Ue.isURLSearchParams(he)?he.toString():new Lt(he,Se).toString(Ee),Me){const Ne=ie.indexOf("#");Ne!==-1&&(ie=ie.slice(0,Ne)),ie+=(ie.indexOf("?")===-1?"?":"&")+Me}return ie}Ft.append=function(ie,he){this._pairs.push([ie,he])},Ft.toString=function(ie){const he=ie?function(Se){return ie.call(this,Se,Bt)}:Bt;return this._pairs.map(function(Se){return he(Se[0])+"="+he(Se[1])},"").join("&")};var dn=class{constructor(){this.handlers=[]}use(ie,he,Se){return this.handlers.push({fulfilled:ie,rejected:he,synchronous:!!Se&&Se.synchronous,runWhen:Se?Se.runWhen:null}),this.handlers.length-1}eject(ie){this.handlers[ie]&&(this.handlers[ie]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(ie){Ue.forEach(this.handlers,function(he){he!==null&&ie(he)})}},nn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Lt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]};const Vt=typeof window<"u"&&typeof document<"u",Qt=(gn=typeof navigator<"u"&&navigator.product,Vt&&["ReactNative","NativeScript","NS"].indexOf(gn)<0);var gn;const on=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Yt={...Object.freeze({__proto__:null,hasBrowserEnv:Vt,hasStandardBrowserWebWorkerEnv:on,hasStandardBrowserEnv:Qt}),...rn};function se(ie){function he(Se,Ee,$e,Me){let Ne=Se[Me++];const Ge=Number.isFinite(+Ne),Ye=Me>=Se.length;return Ne=!Ne&&Ue.isArray($e)?$e.length:Ne,Ye?(Ue.hasOwnProp($e,Ne)?$e[Ne]=[$e[Ne],Ee]:$e[Ne]=Ee,!Ge):($e[Ne]&&Ue.isObject($e[Ne])||($e[Ne]=[]),he(Se,Ee,$e[Ne],Me)&&Ue.isArray($e[Ne])&&($e[Ne]=function(Ke){const ze={},mt=Object.keys(Ke);let et;const kt=mt.length;let Xe;for(et=0;et<kt;et++)Xe=mt[et],ze[Xe]=Ke[Xe];return ze}($e[Ne])),!Ge)}if(Ue.isFormData(ie)&&Ue.isFunction(ie.entries)){const Se={};return Ue.forEachEntry(ie,(Ee,$e)=>{he(function(Me){return Ue.matchAll(/\w+|\[(\w*)]/g,Me).map(Ne=>Ne[0]==="[]"?"":Ne[1]||Ne[0])}(Ee),$e,Se,0)}),Se}return null}const X={transitional:nn,adapter:["xhr","http"],transformRequest:[function(ie,he){const Se=he.getContentType()||"",Ee=Se.indexOf("application/json")>-1,$e=Ue.isObject(ie);if($e&&Ue.isHTMLForm(ie)&&(ie=new FormData(ie)),Ue.isFormData(ie))return Ee&&Ee?JSON.stringify(se(ie)):ie;if(Ue.isArrayBuffer(ie)||Ue.isBuffer(ie)||Ue.isStream(ie)||Ue.isFile(ie)||Ue.isBlob(ie))return ie;if(Ue.isArrayBufferView(ie))return ie.buffer;if(Ue.isURLSearchParams(ie))return he.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),ie.toString();let Me;if($e){if(Se.indexOf("application/x-www-form-urlencoded")>-1)return function(Ne,Ge){return wt(Ne,new Yt.classes.URLSearchParams,Object.assign({visitor:function(Ye,Ke,ze,mt){return Yt.isNode&&Ue.isBuffer(Ye)?(this.append(Ke,Ye.toString("base64")),!1):mt.defaultVisitor.apply(this,arguments)}},Ge))}(ie,this.formSerializer).toString();if((Me=Ue.isFileList(ie))||Se.indexOf("multipart/form-data")>-1){const Ne=this.env&&this.env.FormData;return wt(Me?{"files[]":ie}:ie,Ne&&new Ne,this.formSerializer)}}return $e||Ee?(he.setContentType("application/json",!1),function(Ne,Ge,Ye){if(Ue.isString(Ne))try{return(0,JSON.parse)(Ne),Ue.trim(Ne)}catch(Ke){if(Ke.name!=="SyntaxError")throw Ke}return(0,JSON.stringify)(Ne)}(ie)):ie}],transformResponse:[function(ie){const he=this.transitional||X.transitional,Se=he&&he.forcedJSONParsing,Ee=this.responseType==="json";if(ie&&Ue.isString(ie)&&(Se&&!this.responseType||Ee)){const $e=!(he&&he.silentJSONParsing)&&Ee;try{return JSON.parse(ie)}catch(Me){if($e)throw Me.name==="SyntaxError"?ot.from(Me,ot.ERR_BAD_RESPONSE,this,null,this.response):Me}}return ie}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yt.classes.FormData,Blob:Yt.classes.Blob},validateStatus:function(ie){return ie>=200&&ie<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ue.forEach(["delete","get","head","post","put","patch"],ie=>{X.headers[ie]={}});var ee=X;const pe=Ue.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oe=Symbol("internals");function De(ie){return ie&&String(ie).trim().toLowerCase()}function Le(ie){return ie===!1||ie==null?ie:Ue.isArray(ie)?ie.map(Le):String(ie)}function ut(ie,he,Se,Ee,$e){return Ue.isFunction(Ee)?Ee.call(this,he,Se):($e&&(he=Se),Ue.isString(he)?Ue.isString(Ee)?he.indexOf(Ee)!==-1:Ue.isRegExp(Ee)?Ee.test(he):void 0:void 0)}class St{constructor(he){he&&this.set(he)}set(he,Se,Ee){const $e=this;function Me(Ge,Ye,Ke){const ze=De(Ye);if(!ze)throw new Error("header name must be a non-empty string");const mt=Ue.findKey($e,ze);(!mt||$e[mt]===void 0||Ke===!0||Ke===void 0&&$e[mt]!==!1)&&($e[mt||Ye]=Le(Ge))}const Ne=(Ge,Ye)=>Ue.forEach(Ge,(Ke,ze)=>Me(Ke,ze,Ye));return Ue.isPlainObject(he)||he instanceof this.constructor?Ne(he,Se):Ue.isString(he)&&(he=he.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(he.trim())?Ne((Ge=>{const Ye={};let Ke,ze,mt;return Ge&&Ge.split(`
|
|
3
|
+
`},writer$1}var hasRequiredLib$1;function requireLib$1(){if(hasRequiredLib$1)return lib$1;hasRequiredLib$1=1;var q=requireParser(),K=requireWriter$1(),F=requireGrammar();return lib$1.grammar=F,lib$1.write=K,lib$1.parse=q.parse,lib$1.parseParams=q.parseParams,lib$1.parseFmtpConfig=q.parseFmtpConfig,lib$1.parsePayloads=q.parsePayloads,lib$1.parseRemoteCandidates=q.parseRemoteCandidates,lib$1.parseImageAttributes=q.parseImageAttributes,lib$1.parseSimulcastStreamList=q.parseSimulcastStreamList,lib$1}var libExports$1=requireLib$1();class VideoMediaContext{constructor(K){Ie(this,"kind","video");Ie(this,"stream",new MediaStream);Ie(this,"stop",()=>{const K=this.stream.getTracks();for(const F of K)F.stop(),this.stream.removeTrack(F)});Ie(this,"replaceStream",K=>{const F=this.stream,Z=F.getTracks();for(const N of Z)F.removeTrack(N);const[D]=K.getVideoTracks();D&&F.addTrack(D)});Ie(this,"getStream",()=>this.stream);Ie(this,"getTrack",()=>this.stream.getTracks()[0]);this.stream.addTrack(K)}}const enum_roomState={ready:"已就绪",checkAuth:"正在鉴权",connecting:"连接中",connected:"已连接",reconnect:"正在重新连接",disconnected:"已断开",failed:"连接错误",closed:"已关闭"};ht(enum_roomState);var C$1=Object.defineProperty,R=q=>{throw TypeError(q)},S=(q,K,F)=>K in q?C$1(q,K,{enumerable:!0,configurable:!0,writable:!0,value:F}):q[K]=F,l=(q,K,F)=>S(q,typeof K!="symbol"?K+"":K,F),v=(q,K,F)=>K.has(q)||R("Cannot "+F),t$2=(q,K,F)=>(v(q,K,"read from private field"),F?F.call(q):K.get(q)),c$1=(q,K,F)=>K.has(q)?R("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(q):K.set(q,F),i=(q,K,F,Z)=>(v(q,K,"write to private field"),K.set(q,F),F),s,r$2,h,p,m$2,f,w,x,g$2,b,B$1,y,T,d$1;class M{constructor(K){c$1(this,s,{url:"",binaryType:"blob",timeout:6*1e3,debug:!1,sendBeforAutoConnect:!1,reconnectCount:-1,reconnectTime:60*1e3,reconnectIntervalTime:5e3,heartbeatIntervalTime:1e4,checkReconnect:F=>!0,onReconnectSuccess:async F=>{},onReconnectStop:async F=>{},getHeartbeatMsg:()=>JSON.stringify({event:"heartbeat"}),onMessage:F=>{}}),l(this,"ws"),c$1(this,r$2,-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,F=>{}),l(this,"close",async(F=1e3,Z="correctly close.")=>{var D;this.ws&&(i(this,f,!0),t$2(this,d$1).call(this),(D=this.ws)==null||D.close(F,Z))}),l(this,"connect",()=>new Promise(async F=>{i(this,w,F),this.ws=new WebSocket(t$2(this,s).url),this.ws.binaryType=t$2(this,s).binaryType,this.ws.onopen=t$2(this,b),this.ws.onmessage=t$2(this,g$2),this.ws.onerror=t$2(this,B$1),this.ws.onclose=t$2(this,y)})),l(this,"reconnect",async F=>new Promise(Z=>{t$2(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 D=N=>{t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: ${N}`),t$2(this,s).onReconnectStop({msg:N}),Z(N)};if(t$2(this,x).call(this)===!1)return D("stop reconnect. exceed maxReconnectionTime.");if(t$2(this,r$2)!==-1&&t$2(this,r$2)===0)return D("stop reconnect. surplusReconnectCount is 0.");if(!t$2(this,s).checkReconnect(F))return D("stop reconnect. checkReconnect is false.");t$2(this,s).debug&&console.info("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;padding:16px 0;",`------->pr-ws: await ${t$2(this,s).reconnectIntervalTime}ms run reconnect. surplusReconnectCount is ${t$2(this,r$2)}`,F),i(this,p,setTimeout(async()=>{i(this,r$2,Math.max(-1,t$2(this,r$2)-1)),await this.connect();try{await t$2(this,s).onReconnectSuccess(this.ws)}catch(N){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->pr-ws: onReconnectSuccess is error",N)}Z(!0)},t$2(this,s).reconnectIntervalTime))})),l(this,"sendMessage",async F=>{var Z;(!this.ws||this.ws.readyState!==1)&&(t$2(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$2(this,s).sendBeforAutoConnect&&(t$2(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(F)}),c$1(this,x,()=>{const F=Date.now();return t$2(this,h)===-1&&i(this,h,F+t$2(this,s).reconnectTime),!(F>t$2(this,h))}),c$1(this,g$2,F=>{const{data:Z}=F;t$2(this,s).onMessage(Z)}),c$1(this,b,()=>{t$2(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$2,t$2(this,s).reconnectCount),i(this,h,-1),t$2(this,T).call(this),t$2(this,w).call(this,this.ws)}),c$1(this,B$1,F=>{t$2(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.",F)}),c$1(this,y,F=>{if(t$2(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: ${F.code}, permanentClosed is ${t$2(this,f)}.`,F),t$2(this,d$1).call(this),!t$2(this,f))return this.reconnect(F);this.ws=void 0}),c$1(this,T,()=>{i(this,m$2,setInterval(()=>{const F=t$2(this,s).getHeartbeatMsg();F&&this.sendMessage(F)},t$2(this,s).heartbeatIntervalTime))}),c$1(this,d$1,()=>{clearInterval(t$2(this,p)),clearInterval(t$2(this,m$2))}),i(this,s,{...t$2(this,s),...K}),i(this,r$2,t$2(this,s).reconnectCount)}}s=new WeakMap,r$2=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=q;function q(K,F){for(var Z=new Array(arguments.length-1),D=0,N=2,O=!0;N<arguments.length;)Z[D++]=arguments[N++];return new Promise(function(z,J){Z[D]=function(ne){if(O)if(O=!1,ne)J(ne);else{for(var re=new Array(arguments.length-1),te=0;te<re.length;)re[te++]=arguments[te];z.apply(null,re)}};try{K.apply(F||null,Z)}catch(Q){O&&(O=!1,J(Q))}})}return aspromise}var base64={},hasRequiredBase64;function requireBase64(){return hasRequiredBase64||(hasRequiredBase64=1,function(q){var K=q;K.length=function(I){var z=I.length;if(!z)return 0;for(var J=0;--z%4>1&&I.charAt(z)==="=";)++J;return Math.ceil(I.length*3)/4-J};for(var F=new Array(64),Z=new Array(123),D=0;D<64;)Z[F[D]=D<26?D+65:D<52?D+71:D<62?D-4:D-59|43]=D++;K.encode=function(I,z,J){for(var Q=null,ne=[],re=0,te=0,oe;z<J;){var le=I[z++];switch(te){case 0:ne[re++]=F[le>>2],oe=(le&3)<<4,te=1;break;case 1:ne[re++]=F[oe|le>>4],oe=(le&15)<<2,te=2;break;case 2:ne[re++]=F[oe|le>>6],ne[re++]=F[le&63],te=0;break}re>8191&&((Q||(Q=[])).push(String.fromCharCode.apply(String,ne)),re=0)}return te&&(ne[re++]=F[oe],ne[re++]=61,te===1&&(ne[re++]=61)),Q?(re&&Q.push(String.fromCharCode.apply(String,ne.slice(0,re))),Q.join("")):String.fromCharCode.apply(String,ne.slice(0,re))};var N="invalid encoding";K.decode=function(I,z,J){for(var Q=J,ne=0,re,te=0;te<I.length;){var oe=I.charCodeAt(te++);if(oe===61&&ne>1)break;if((oe=Z[oe])===void 0)throw Error(N);switch(ne){case 0:re=oe,ne=1;break;case 1:z[J++]=re<<2|(oe&48)>>4,re=oe,ne=2;break;case 2:z[J++]=(re&15)<<4|(oe&60)>>2,re=oe,ne=3;break;case 3:z[J++]=(re&3)<<6|oe,ne=0;break}}if(ne===1)throw Error(N);return J-Q},K.test=function(I){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(I)}}(base64)),base64}var eventemitter,hasRequiredEventemitter;function requireEventemitter(){if(hasRequiredEventemitter)return eventemitter;hasRequiredEventemitter=1,eventemitter=q;function q(){this._listeners={}}return q.prototype.on=function(F,Z,D){return(this._listeners[F]||(this._listeners[F]=[])).push({fn:Z,ctx:D||this}),this},q.prototype.off=function(F,Z){if(F===void 0)this._listeners={};else if(Z===void 0)this._listeners[F]=[];else for(var D=this._listeners[F],N=0;N<D.length;)D[N].fn===Z?D.splice(N,1):++N;return this},q.prototype.emit=function(F){var Z=this._listeners[F];if(Z){for(var D=[],N=1;N<arguments.length;)D.push(arguments[N++]);for(N=0;N<Z.length;)Z[N].fn.apply(Z[N++].ctx,D)}return this},eventemitter}var float,hasRequiredFloat;function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1,float=q(q);function q(N){return typeof Float32Array<"u"?function(){var O=new Float32Array([-0]),I=new Uint8Array(O.buffer),z=I[3]===128;function J(te,oe,le){O[0]=te,oe[le]=I[0],oe[le+1]=I[1],oe[le+2]=I[2],oe[le+3]=I[3]}function Q(te,oe,le){O[0]=te,oe[le]=I[3],oe[le+1]=I[2],oe[le+2]=I[1],oe[le+3]=I[0]}N.writeFloatLE=z?J:Q,N.writeFloatBE=z?Q:J;function ne(te,oe){return I[0]=te[oe],I[1]=te[oe+1],I[2]=te[oe+2],I[3]=te[oe+3],O[0]}function re(te,oe){return I[3]=te[oe],I[2]=te[oe+1],I[1]=te[oe+2],I[0]=te[oe+3],O[0]}N.readFloatLE=z?ne:re,N.readFloatBE=z?re:ne}():function(){function O(z,J,Q,ne){var re=J<0?1:0;if(re&&(J=-J),J===0)z(1/J>0?0:2147483648,Q,ne);else if(isNaN(J))z(2143289344,Q,ne);else if(J>34028234663852886e22)z((re<<31|2139095040)>>>0,Q,ne);else if(J<11754943508222875e-54)z((re<<31|Math.round(J/1401298464324817e-60))>>>0,Q,ne);else{var te=Math.floor(Math.log(J)/Math.LN2),oe=Math.round(J*Math.pow(2,-te)*8388608)&8388607;z((re<<31|te+127<<23|oe)>>>0,Q,ne)}}N.writeFloatLE=O.bind(null,K),N.writeFloatBE=O.bind(null,F);function I(z,J,Q){var ne=z(J,Q),re=(ne>>31)*2+1,te=ne>>>23&255,oe=ne&8388607;return te===255?oe?NaN:re*(1/0):te===0?re*1401298464324817e-60*oe:re*Math.pow(2,te-150)*(oe+8388608)}N.readFloatLE=I.bind(null,Z),N.readFloatBE=I.bind(null,D)}(),typeof Float64Array<"u"?function(){var O=new Float64Array([-0]),I=new Uint8Array(O.buffer),z=I[7]===128;function J(te,oe,le){O[0]=te,oe[le]=I[0],oe[le+1]=I[1],oe[le+2]=I[2],oe[le+3]=I[3],oe[le+4]=I[4],oe[le+5]=I[5],oe[le+6]=I[6],oe[le+7]=I[7]}function Q(te,oe,le){O[0]=te,oe[le]=I[7],oe[le+1]=I[6],oe[le+2]=I[5],oe[le+3]=I[4],oe[le+4]=I[3],oe[le+5]=I[2],oe[le+6]=I[1],oe[le+7]=I[0]}N.writeDoubleLE=z?J:Q,N.writeDoubleBE=z?Q:J;function ne(te,oe){return I[0]=te[oe],I[1]=te[oe+1],I[2]=te[oe+2],I[3]=te[oe+3],I[4]=te[oe+4],I[5]=te[oe+5],I[6]=te[oe+6],I[7]=te[oe+7],O[0]}function re(te,oe){return I[7]=te[oe],I[6]=te[oe+1],I[5]=te[oe+2],I[4]=te[oe+3],I[3]=te[oe+4],I[2]=te[oe+5],I[1]=te[oe+6],I[0]=te[oe+7],O[0]}N.readDoubleLE=z?ne:re,N.readDoubleBE=z?re:ne}():function(){function O(z,J,Q,ne,re,te){var oe=ne<0?1:0;if(oe&&(ne=-ne),ne===0)z(0,re,te+J),z(1/ne>0?0:2147483648,re,te+Q);else if(isNaN(ne))z(0,re,te+J),z(2146959360,re,te+Q);else if(ne>17976931348623157e292)z(0,re,te+J),z((oe<<31|2146435072)>>>0,re,te+Q);else{var le;if(ne<22250738585072014e-324)le=ne/5e-324,z(le>>>0,re,te+J),z((oe<<31|le/4294967296)>>>0,re,te+Q);else{var ae=Math.floor(Math.log(ne)/Math.LN2);ae===1024&&(ae=1023),le=ne*Math.pow(2,-ae),z(le*4503599627370496>>>0,re,te+J),z((oe<<31|ae+1023<<20|le*1048576&1048575)>>>0,re,te+Q)}}}N.writeDoubleLE=O.bind(null,K,0,4),N.writeDoubleBE=O.bind(null,F,4,0);function I(z,J,Q,ne,re){var te=z(ne,re+J),oe=z(ne,re+Q),le=(oe>>31)*2+1,ae=oe>>>20&2047,ce=4294967296*(oe&1048575)+te;return ae===2047?ce?NaN:le*(1/0):ae===0?le*5e-324*ce:le*Math.pow(2,ae-1075)*(ce+4503599627370496)}N.readDoubleLE=I.bind(null,Z,0,4),N.readDoubleBE=I.bind(null,D,4,0)}(),N}function K(N,O,I){O[I]=N&255,O[I+1]=N>>>8&255,O[I+2]=N>>>16&255,O[I+3]=N>>>24}function F(N,O,I){O[I]=N>>>24,O[I+1]=N>>>16&255,O[I+2]=N>>>8&255,O[I+3]=N&255}function Z(N,O){return(N[O]|N[O+1]<<8|N[O+2]<<16|N[O+3]<<24)>>>0}function D(N,O){return(N[O]<<24|N[O+1]<<16|N[O+2]<<8|N[O+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(q){}return null}return inquire_1}var utf8={},hasRequiredUtf8;function requireUtf8(){return hasRequiredUtf8||(hasRequiredUtf8=1,function(q){var K=q;K.length=function(Z){for(var D=0,N=0,O=0;O<Z.length;++O)N=Z.charCodeAt(O),N<128?D+=1:N<2048?D+=2:(N&64512)===55296&&(Z.charCodeAt(O+1)&64512)===56320?(++O,D+=4):D+=3;return D},K.read=function(Z,D,N){var O=N-D;if(O<1)return"";for(var I=null,z=[],J=0,Q;D<N;)Q=Z[D++],Q<128?z[J++]=Q:Q>191&&Q<224?z[J++]=(Q&31)<<6|Z[D++]&63:Q>239&&Q<365?(Q=((Q&7)<<18|(Z[D++]&63)<<12|(Z[D++]&63)<<6|Z[D++]&63)-65536,z[J++]=55296+(Q>>10),z[J++]=56320+(Q&1023)):z[J++]=(Q&15)<<12|(Z[D++]&63)<<6|Z[D++]&63,J>8191&&((I||(I=[])).push(String.fromCharCode.apply(String,z)),J=0);return I?(J&&I.push(String.fromCharCode.apply(String,z.slice(0,J))),I.join("")):String.fromCharCode.apply(String,z.slice(0,J))},K.write=function(Z,D,N){for(var O=N,I,z,J=0;J<Z.length;++J)I=Z.charCodeAt(J),I<128?D[N++]=I:I<2048?(D[N++]=I>>6|192,D[N++]=I&63|128):(I&64512)===55296&&((z=Z.charCodeAt(J+1))&64512)===56320?(I=65536+((I&1023)<<10)+(z&1023),++J,D[N++]=I>>18|240,D[N++]=I>>12&63|128,D[N++]=I>>6&63|128,D[N++]=I&63|128):(D[N++]=I>>12|224,D[N++]=I>>6&63|128,D[N++]=I&63|128);return N-O}}(utf8)),utf8}var pool_1,hasRequiredPool;function requirePool(){if(hasRequiredPool)return pool_1;hasRequiredPool=1,pool_1=q;function q(K,F,Z){var D=Z||8192,N=D>>>1,O=null,I=D;return function(J){if(J<1||J>N)return K(J);I+J>D&&(O=K(D),I=0);var Q=F.call(O,I,I+=J);return I&7&&(I=(I|7)+1),Q}}return pool_1}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=K;var q=requireMinimal$1();function K(N,O){this.lo=N>>>0,this.hi=O>>>0}var F=K.zero=new K(0,0);F.toNumber=function(){return 0},F.zzEncode=F.zzDecode=function(){return this},F.length=function(){return 1};var Z=K.zeroHash="\0\0\0\0\0\0\0\0";K.fromNumber=function(O){if(O===0)return F;var I=O<0;I&&(O=-O);var z=O>>>0,J=(O-z)/4294967296>>>0;return I&&(J=~J>>>0,z=~z>>>0,++z>4294967295&&(z=0,++J>4294967295&&(J=0))),new K(z,J)},K.from=function(O){if(typeof O=="number")return K.fromNumber(O);if(q.isString(O))if(q.Long)O=q.Long.fromString(O);else return K.fromNumber(parseInt(O,10));return O.low||O.high?new K(O.low>>>0,O.high>>>0):F},K.prototype.toNumber=function(O){if(!O&&this.hi>>>31){var I=~this.lo+1>>>0,z=~this.hi>>>0;return I||(z=z+1>>>0),-(I+z*4294967296)}return this.lo+this.hi*4294967296},K.prototype.toLong=function(O){return q.Long?new q.Long(this.lo|0,this.hi|0,!!O):{low:this.lo|0,high:this.hi|0,unsigned:!!O}};var D=String.prototype.charCodeAt;return K.fromHash=function(O){return O===Z?F:new K((D.call(O,0)|D.call(O,1)<<8|D.call(O,2)<<16|D.call(O,3)<<24)>>>0,(D.call(O,4)|D.call(O,5)<<8|D.call(O,6)<<16|D.call(O,7)<<24)>>>0)},K.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)},K.prototype.zzEncode=function(){var O=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^O)>>>0,this.lo=(this.lo<<1^O)>>>0,this},K.prototype.zzDecode=function(){var O=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^O)>>>0,this.hi=(this.hi>>>1^O)>>>0,this},K.prototype.length=function(){var O=this.lo,I=(this.lo>>>28|this.hi<<4)>>>0,z=this.hi>>>24;return z===0?I===0?O<16384?O<128?1:2:O<2097152?3:4:I<16384?I<128?5:6:I<2097152?7:8:z<128?9:10},longbits}var hasRequiredMinimal$1;function requireMinimal$1(){return hasRequiredMinimal$1||(hasRequiredMinimal$1=1,function(q){var K=q;K.asPromise=requireAspromise(),K.base64=requireBase64(),K.EventEmitter=requireEventemitter(),K.float=requireFloat(),K.inquire=requireInquire(),K.utf8=requireUtf8(),K.pool=requirePool(),K.LongBits=requireLongbits(),K.isNode=!!(typeof commonjsGlobal<"u"&&commonjsGlobal&&commonjsGlobal.process&&commonjsGlobal.process.versions&&commonjsGlobal.process.versions.node),K.global=K.isNode&&commonjsGlobal||typeof window<"u"&&window||typeof self<"u"&&self||minimal$1,K.emptyArray=Object.freeze?Object.freeze([]):[],K.emptyObject=Object.freeze?Object.freeze({}):{},K.isInteger=Number.isInteger||function(N){return typeof N=="number"&&isFinite(N)&&Math.floor(N)===N},K.isString=function(N){return typeof N=="string"||N instanceof String},K.isObject=function(N){return N&&typeof N=="object"},K.isset=K.isSet=function(N,O){var I=N[O];return I!=null&&N.hasOwnProperty(O)?typeof I!="object"||(Array.isArray(I)?I.length:Object.keys(I).length)>0:!1},K.Buffer=function(){try{var D=K.inquire("buffer").Buffer;return D.prototype.utf8Write?D:null}catch{return null}}(),K._Buffer_from=null,K._Buffer_allocUnsafe=null,K.newBuffer=function(N){return typeof N=="number"?K.Buffer?K._Buffer_allocUnsafe(N):new K.Array(N):K.Buffer?K._Buffer_from(N):typeof Uint8Array>"u"?N:new Uint8Array(N)},K.Array=typeof Uint8Array<"u"?Uint8Array:Array,K.Long=K.global.dcodeIO&&K.global.dcodeIO.Long||K.global.Long||K.inquire("long"),K.key2Re=/^true|false|0|1$/,K.key32Re=/^-?(?:0|[1-9][0-9]*)$/,K.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,K.longToHash=function(N){return N?K.LongBits.from(N).toHash():K.LongBits.zeroHash},K.longFromHash=function(N,O){var I=K.LongBits.fromHash(N);return K.Long?K.Long.fromBits(I.lo,I.hi,O):I.toNumber(!!O)};function F(D,N,O){for(var I=Object.keys(N),z=0;z<I.length;++z)(D[I[z]]===void 0||!O)&&(D[I[z]]=N[I[z]]);return D}K.merge=F,K.lcFirst=function(N){return N.charAt(0).toLowerCase()+N.substring(1)};function Z(D){function N(O,I){if(!(this instanceof N))return new N(O,I);Object.defineProperty(this,"message",{get:function(){return O}}),Error.captureStackTrace?Error.captureStackTrace(this,N):Object.defineProperty(this,"stack",{value:new Error().stack||""}),I&&F(this,I)}return N.prototype=Object.create(Error.prototype,{constructor:{value:N,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return D},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),N}K.newError=Z,K.ProtocolError=Z("ProtocolError"),K.oneOfGetter=function(N){for(var O={},I=0;I<N.length;++I)O[N[I]]=1;return function(){for(var z=Object.keys(this),J=z.length-1;J>-1;--J)if(O[z[J]]===1&&this[z[J]]!==void 0&&this[z[J]]!==null)return z[J]}},K.oneOfSetter=function(N){return function(O){for(var I=0;I<N.length;++I)N[I]!==O&&delete this[N[I]]}},K.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},K._configure=function(){var D=K.Buffer;if(!D){K._Buffer_from=K._Buffer_allocUnsafe=null;return}K._Buffer_from=D.from!==Uint8Array.from&&D.from||function(O,I){return new D(O,I)},K._Buffer_allocUnsafe=D.allocUnsafe||function(O){return new D(O)}}}(minimal$1)),minimal$1}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1,writer=z;var q=requireMinimal$1(),K,F=q.LongBits,Z=q.base64,D=q.utf8;function N(ae,ce,de){this.fn=ae,this.len=ce,this.next=void 0,this.val=de}function O(){}function I(ae){this.head=ae.head,this.tail=ae.tail,this.len=ae.len,this.next=ae.states}function z(){this.len=0,this.head=new N(O,0,0),this.tail=this.head,this.states=null}var J=function(){return q.Buffer?function(){return(z.create=function(){return new K})()}:function(){return new z}};z.create=J(),z.alloc=function(ce){return new q.Array(ce)},q.Array!==Array&&(z.alloc=q.pool(z.alloc,q.Array.prototype.subarray)),z.prototype._push=function(ce,de,we){return this.tail=this.tail.next=new N(ce,de,we),this.len+=de,this};function Q(ae,ce,de){ce[de]=ae&255}function ne(ae,ce,de){for(;ae>127;)ce[de++]=ae&127|128,ae>>>=7;ce[de]=ae}function re(ae,ce){this.len=ae,this.next=void 0,this.val=ce}re.prototype=Object.create(N.prototype),re.prototype.fn=ne,z.prototype.uint32=function(ce){return this.len+=(this.tail=this.tail.next=new re((ce=ce>>>0)<128?1:ce<16384?2:ce<2097152?3:ce<268435456?4:5,ce)).len,this},z.prototype.int32=function(ce){return ce<0?this._push(te,10,F.fromNumber(ce)):this.uint32(ce)},z.prototype.sint32=function(ce){return this.uint32((ce<<1^ce>>31)>>>0)};function te(ae,ce,de){for(;ae.hi;)ce[de++]=ae.lo&127|128,ae.lo=(ae.lo>>>7|ae.hi<<25)>>>0,ae.hi>>>=7;for(;ae.lo>127;)ce[de++]=ae.lo&127|128,ae.lo=ae.lo>>>7;ce[de++]=ae.lo}z.prototype.uint64=function(ce){var de=F.from(ce);return this._push(te,de.length(),de)},z.prototype.int64=z.prototype.uint64,z.prototype.sint64=function(ce){var de=F.from(ce).zzEncode();return this._push(te,de.length(),de)},z.prototype.bool=function(ce){return this._push(Q,1,ce?1:0)};function oe(ae,ce,de){ce[de]=ae&255,ce[de+1]=ae>>>8&255,ce[de+2]=ae>>>16&255,ce[de+3]=ae>>>24}z.prototype.fixed32=function(ce){return this._push(oe,4,ce>>>0)},z.prototype.sfixed32=z.prototype.fixed32,z.prototype.fixed64=function(ce){var de=F.from(ce);return this._push(oe,4,de.lo)._push(oe,4,de.hi)},z.prototype.sfixed64=z.prototype.fixed64,z.prototype.float=function(ce){return this._push(q.float.writeFloatLE,4,ce)},z.prototype.double=function(ce){return this._push(q.float.writeDoubleLE,8,ce)};var le=q.Array.prototype.set?function(ce,de,we){de.set(ce,we)}:function(ce,de,we){for(var fe=0;fe<ce.length;++fe)de[we+fe]=ce[fe]};return z.prototype.bytes=function(ce){var de=ce.length>>>0;if(!de)return this._push(Q,1,0);if(q.isString(ce)){var we=z.alloc(de=Z.length(ce));Z.decode(ce,we,0),ce=we}return this.uint32(de)._push(le,de,ce)},z.prototype.string=function(ce){var de=D.length(ce);return de?this.uint32(de)._push(D.write,de,ce):this._push(Q,1,0)},z.prototype.fork=function(){return this.states=new I(this),this.head=this.tail=new N(O,0,0),this.len=0,this},z.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 N(O,0,0),this.len=0),this},z.prototype.ldelim=function(){var ce=this.head,de=this.tail,we=this.len;return this.reset().uint32(we),we&&(this.tail.next=ce.next,this.tail=de,this.len+=we),this},z.prototype.finish=function(){for(var ce=this.head.next,de=this.constructor.alloc(this.len),we=0;ce;)ce.fn(ce.val,de,we),we+=ce.len,ce=ce.next;return de},z._configure=function(ae){K=ae,z.create=J(),K._configure()},writer}var writer_buffer,hasRequiredWriter_buffer;function requireWriter_buffer(){if(hasRequiredWriter_buffer)return writer_buffer;hasRequiredWriter_buffer=1,writer_buffer=F;var q=requireWriter();(F.prototype=Object.create(q.prototype)).constructor=F;var K=requireMinimal$1();function F(){q.call(this)}F._configure=function(){F.alloc=K._Buffer_allocUnsafe,F.writeBytesBuffer=K.Buffer&&K.Buffer.prototype instanceof Uint8Array&&K.Buffer.prototype.set.name==="set"?function(N,O,I){O.set(N,I)}:function(N,O,I){if(N.copy)N.copy(O,I,0,N.length);else for(var z=0;z<N.length;)O[I++]=N[z++]}},F.prototype.bytes=function(N){K.isString(N)&&(N=K._Buffer_from(N,"base64"));var O=N.length>>>0;return this.uint32(O),O&&this._push(F.writeBytesBuffer,O,N),this};function Z(D,N,O){D.length<40?K.utf8.write(D,N,O):N.utf8Write?N.utf8Write(D,O):N.write(D,O)}return F.prototype.string=function(N){var O=K.Buffer.byteLength(N);return this.uint32(O),O&&this._push(Z,O,N),this},F._configure(),writer_buffer}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1,reader=N;var q=requireMinimal$1(),K,F=q.LongBits,Z=q.utf8;function D(ne,re){return RangeError("index out of range: "+ne.pos+" + "+(re||1)+" > "+ne.len)}function N(ne){this.buf=ne,this.pos=0,this.len=ne.length}var O=typeof Uint8Array<"u"?function(re){if(re instanceof Uint8Array||Array.isArray(re))return new N(re);throw Error("illegal buffer")}:function(re){if(Array.isArray(re))return new N(re);throw Error("illegal buffer")},I=function(){return q.Buffer?function(te){return(N.create=function(le){return q.Buffer.isBuffer(le)?new K(le):O(le)})(te)}:O};N.create=I(),N.prototype._slice=q.Array.prototype.subarray||q.Array.prototype.slice,N.prototype.uint32=function(){var re=4294967295;return function(){if(re=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(re=(re|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(re=(re|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(re=(re|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(re=(re|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return re;if((this.pos+=5)>this.len)throw this.pos=this.len,D(this,10);return re}}(),N.prototype.int32=function(){return this.uint32()|0},N.prototype.sint32=function(){var re=this.uint32();return re>>>1^-(re&1)|0};function z(){var ne=new F(0,0),re=0;if(this.len-this.pos>4){for(;re<4;++re)if(ne.lo=(ne.lo|(this.buf[this.pos]&127)<<re*7)>>>0,this.buf[this.pos++]<128)return ne;if(ne.lo=(ne.lo|(this.buf[this.pos]&127)<<28)>>>0,ne.hi=(ne.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return ne;re=0}else{for(;re<3;++re){if(this.pos>=this.len)throw D(this);if(ne.lo=(ne.lo|(this.buf[this.pos]&127)<<re*7)>>>0,this.buf[this.pos++]<128)return ne}return ne.lo=(ne.lo|(this.buf[this.pos++]&127)<<re*7)>>>0,ne}if(this.len-this.pos>4){for(;re<5;++re)if(ne.hi=(ne.hi|(this.buf[this.pos]&127)<<re*7+3)>>>0,this.buf[this.pos++]<128)return ne}else for(;re<5;++re){if(this.pos>=this.len)throw D(this);if(ne.hi=(ne.hi|(this.buf[this.pos]&127)<<re*7+3)>>>0,this.buf[this.pos++]<128)return ne}throw Error("invalid varint encoding")}N.prototype.bool=function(){return this.uint32()!==0};function J(ne,re){return(ne[re-4]|ne[re-3]<<8|ne[re-2]<<16|ne[re-1]<<24)>>>0}N.prototype.fixed32=function(){if(this.pos+4>this.len)throw D(this,4);return J(this.buf,this.pos+=4)},N.prototype.sfixed32=function(){if(this.pos+4>this.len)throw D(this,4);return J(this.buf,this.pos+=4)|0};function Q(){if(this.pos+8>this.len)throw D(this,8);return new F(J(this.buf,this.pos+=4),J(this.buf,this.pos+=4))}return N.prototype.float=function(){if(this.pos+4>this.len)throw D(this,4);var re=q.float.readFloatLE(this.buf,this.pos);return this.pos+=4,re},N.prototype.double=function(){if(this.pos+8>this.len)throw D(this,4);var re=q.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,re},N.prototype.bytes=function(){var re=this.uint32(),te=this.pos,oe=this.pos+re;if(oe>this.len)throw D(this,re);if(this.pos+=re,Array.isArray(this.buf))return this.buf.slice(te,oe);if(te===oe){var le=q.Buffer;return le?le.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,te,oe)},N.prototype.string=function(){var re=this.bytes();return Z.read(re,0,re.length)},N.prototype.skip=function(re){if(typeof re=="number"){if(this.pos+re>this.len)throw D(this,re);this.pos+=re}else do if(this.pos>=this.len)throw D(this);while(this.buf[this.pos++]&128);return this},N.prototype.skipType=function(ne){switch(ne){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(ne=this.uint32()&7)!==4;)this.skipType(ne);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+ne+" at offset "+this.pos)}return this},N._configure=function(ne){K=ne,N.create=I(),K._configure();var re=q.Long?"toLong":"toNumber";q.merge(N.prototype,{int64:function(){return z.call(this)[re](!1)},uint64:function(){return z.call(this)[re](!0)},sint64:function(){return z.call(this).zzDecode()[re](!1)},fixed64:function(){return Q.call(this)[re](!0)},sfixed64:function(){return Q.call(this)[re](!1)}})},reader}var reader_buffer,hasRequiredReader_buffer;function requireReader_buffer(){if(hasRequiredReader_buffer)return reader_buffer;hasRequiredReader_buffer=1,reader_buffer=F;var q=requireReader();(F.prototype=Object.create(q.prototype)).constructor=F;var K=requireMinimal$1();function F(Z){q.call(this,Z)}return F._configure=function(){K.Buffer&&(F.prototype._slice=K.Buffer.prototype.slice)},F.prototype.string=function(){var D=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+D,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+D,this.len))},F._configure(),reader_buffer}var rpc={},service,hasRequiredService;function requireService(){if(hasRequiredService)return service;hasRequiredService=1,service=K;var q=requireMinimal$1();(K.prototype=Object.create(q.EventEmitter.prototype)).constructor=K;function K(F,Z,D){if(typeof F!="function")throw TypeError("rpcImpl must be a function");q.EventEmitter.call(this),this.rpcImpl=F,this.requestDelimited=!!Z,this.responseDelimited=!!D}return K.prototype.rpcCall=function F(Z,D,N,O,I){if(!O)throw TypeError("request must be specified");var z=this;if(!I)return q.asPromise(F,z,Z,D,N,O);if(!z.rpcImpl){setTimeout(function(){I(Error("already ended"))},0);return}try{return z.rpcImpl(Z,D[z.requestDelimited?"encodeDelimited":"encode"](O).finish(),function(Q,ne){if(Q)return z.emit("error",Q,Z),I(Q);if(ne===null){z.end(!0);return}if(!(ne instanceof N))try{ne=N[z.responseDelimited?"decodeDelimited":"decode"](ne)}catch(re){return z.emit("error",re,Z),I(re)}return z.emit("data",ne,Z),I(null,ne)})}catch(J){z.emit("error",J,Z),setTimeout(function(){I(J)},0);return}},K.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(q){var K=q;K.Service=requireService()}(rpc)),rpc}var roots,hasRequiredRoots;function requireRoots(){return hasRequiredRoots||(hasRequiredRoots=1,roots={}),roots}var hasRequiredIndexMinimal;function requireIndexMinimal(){return hasRequiredIndexMinimal||(hasRequiredIndexMinimal=1,function(q){var K=q;K.build="minimal",K.Writer=requireWriter(),K.BufferWriter=requireWriter_buffer(),K.Reader=requireReader(),K.BufferReader=requireReader_buffer(),K.util=requireMinimal$1(),K.rpc=requireRpc(),K.roots=requireRoots(),K.configure=F;function F(){K.util._configure(),K.Writer._configure(K.BufferWriter),K.Reader._configure(K.BufferReader)}F()}(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 q={};return q.quick=function(){const K={};return K.voice=function(){const F={};return F.proto=function(){const Z={};return Z.CommonReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.event="",D.prototype.data=$util.newBuffer([]),D.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.version=0,D.prototype.compress=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.event!=null&&Object.hasOwnProperty.call(O,"event")&&I.uint32(10).string(O.event),O.data!=null&&Object.hasOwnProperty.call(O,"data")&&I.uint32(18).bytes(O.data),O.sn!=null&&Object.hasOwnProperty.call(O,"sn")&&I.uint32(24).int64(O.sn),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(32).int64(O.time),O.valid!=null&&Object.hasOwnProperty.call(O,"valid")&&I.uint32(40).int64(O.valid),O.version!=null&&Object.hasOwnProperty.call(O,"version")&&I.uint32(48).int32(O.version),O.compress!=null&&Object.hasOwnProperty.call(O,"compress")&&I.uint32(56).bool(O.compress),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CommonReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.event=O.string();break}case 2:{J.data=O.bytes();break}case 3:{J.sn=O.int64();break}case 4:{J.time=O.int64();break}case 5:{J.valid=O.int64();break}case 6:{J.version=O.int32();break}case 7:{J.compress=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.event!=null&&O.hasOwnProperty("event")&&!$util.isString(O.event)?"event: string expected":O.data!=null&&O.hasOwnProperty("data")&&!(O.data&&typeof O.data.length=="number"||$util.isString(O.data))?"data: buffer expected":O.sn!=null&&O.hasOwnProperty("sn")&&!$util.isInteger(O.sn)&&!(O.sn&&$util.isInteger(O.sn.low)&&$util.isInteger(O.sn.high))?"sn: integer|Long expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":O.valid!=null&&O.hasOwnProperty("valid")&&!$util.isInteger(O.valid)&&!(O.valid&&$util.isInteger(O.valid.low)&&$util.isInteger(O.valid.high))?"valid: integer|Long expected":O.version!=null&&O.hasOwnProperty("version")&&!$util.isInteger(O.version)?"version: integer expected":O.compress!=null&&O.hasOwnProperty("compress")&&typeof O.compress!="boolean"?"compress: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CommonReq)return O;let I=new $root.com.quick.voice.proto.CommonReq;return O.event!=null&&(I.event=String(O.event)),O.data!=null&&(typeof O.data=="string"?$util.base64.decode(O.data,I.data=$util.newBuffer($util.base64.length(O.data)),0):O.data.length>=0&&(I.data=O.data)),O.sn!=null&&($util.Long?(I.sn=$util.Long.fromValue(O.sn)).unsigned=!1:typeof O.sn=="string"?I.sn=parseInt(O.sn,10):typeof O.sn=="number"?I.sn=O.sn:typeof O.sn=="object"&&(I.sn=new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber())),O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),O.valid!=null&&($util.Long?(I.valid=$util.Long.fromValue(O.valid)).unsigned=!1:typeof O.valid=="string"?I.valid=parseInt(O.valid,10):typeof O.valid=="number"?I.valid=O.valid:typeof O.valid=="object"&&(I.valid=new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber())),O.version!=null&&(I.version=O.version|0),O.compress!=null&&(I.compress=!!O.compress),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults){if(z.event="",I.bytes===String?z.data="":(z.data=[],I.bytes!==Array&&(z.data=$util.newBuffer(z.data))),$util.Long){let J=new $util.Long(0,0,!1);z.sn=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.sn=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.valid=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.valid=I.longs===String?"0":0;z.version=0,z.compress=!1}return O.event!=null&&O.hasOwnProperty("event")&&(z.event=O.event),O.data!=null&&O.hasOwnProperty("data")&&(z.data=I.bytes===String?$util.base64.encode(O.data,0,O.data.length):I.bytes===Array?Array.prototype.slice.call(O.data):O.data),O.sn!=null&&O.hasOwnProperty("sn")&&(typeof O.sn=="number"?z.sn=I.longs===String?String(O.sn):O.sn:z.sn=I.longs===String?$util.Long.prototype.toString.call(O.sn):I.longs===Number?new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber():O.sn),O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),O.valid!=null&&O.hasOwnProperty("valid")&&(typeof O.valid=="number"?z.valid=I.longs===String?String(O.valid):O.valid:z.valid=I.longs===String?$util.Long.prototype.toString.call(O.valid):I.longs===Number?new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber():O.valid),O.version!=null&&O.hasOwnProperty("version")&&(z.version=O.version),O.compress!=null&&O.hasOwnProperty("compress")&&(z.compress=O.compress),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CommonReq"},D}(),Z.CommonRsp=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.event="",D.prototype.data=$util.newBuffer([]),D.prototype.sn=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.valid=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.code=0,D.prototype.desc="",D.prototype.version=0,D.prototype.compress=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.event!=null&&Object.hasOwnProperty.call(O,"event")&&I.uint32(10).string(O.event),O.data!=null&&Object.hasOwnProperty.call(O,"data")&&I.uint32(18).bytes(O.data),O.sn!=null&&Object.hasOwnProperty.call(O,"sn")&&I.uint32(24).int64(O.sn),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(32).int64(O.time),O.valid!=null&&Object.hasOwnProperty.call(O,"valid")&&I.uint32(40).int64(O.valid),O.code!=null&&Object.hasOwnProperty.call(O,"code")&&I.uint32(48).int32(O.code),O.desc!=null&&Object.hasOwnProperty.call(O,"desc")&&I.uint32(58).string(O.desc),O.version!=null&&Object.hasOwnProperty.call(O,"version")&&I.uint32(64).int32(O.version),O.compress!=null&&Object.hasOwnProperty.call(O,"compress")&&I.uint32(72).bool(O.compress),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CommonRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.event=O.string();break}case 2:{J.data=O.bytes();break}case 3:{J.sn=O.int64();break}case 4:{J.time=O.int64();break}case 5:{J.valid=O.int64();break}case 6:{J.code=O.int32();break}case 7:{J.desc=O.string();break}case 8:{J.version=O.int32();break}case 9:{J.compress=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.event!=null&&O.hasOwnProperty("event")&&!$util.isString(O.event)?"event: string expected":O.data!=null&&O.hasOwnProperty("data")&&!(O.data&&typeof O.data.length=="number"||$util.isString(O.data))?"data: buffer expected":O.sn!=null&&O.hasOwnProperty("sn")&&!$util.isInteger(O.sn)&&!(O.sn&&$util.isInteger(O.sn.low)&&$util.isInteger(O.sn.high))?"sn: integer|Long expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":O.valid!=null&&O.hasOwnProperty("valid")&&!$util.isInteger(O.valid)&&!(O.valid&&$util.isInteger(O.valid.low)&&$util.isInteger(O.valid.high))?"valid: integer|Long expected":O.code!=null&&O.hasOwnProperty("code")&&!$util.isInteger(O.code)?"code: integer expected":O.desc!=null&&O.hasOwnProperty("desc")&&!$util.isString(O.desc)?"desc: string expected":O.version!=null&&O.hasOwnProperty("version")&&!$util.isInteger(O.version)?"version: integer expected":O.compress!=null&&O.hasOwnProperty("compress")&&typeof O.compress!="boolean"?"compress: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CommonRsp)return O;let I=new $root.com.quick.voice.proto.CommonRsp;return O.event!=null&&(I.event=String(O.event)),O.data!=null&&(typeof O.data=="string"?$util.base64.decode(O.data,I.data=$util.newBuffer($util.base64.length(O.data)),0):O.data.length>=0&&(I.data=O.data)),O.sn!=null&&($util.Long?(I.sn=$util.Long.fromValue(O.sn)).unsigned=!1:typeof O.sn=="string"?I.sn=parseInt(O.sn,10):typeof O.sn=="number"?I.sn=O.sn:typeof O.sn=="object"&&(I.sn=new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber())),O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),O.valid!=null&&($util.Long?(I.valid=$util.Long.fromValue(O.valid)).unsigned=!1:typeof O.valid=="string"?I.valid=parseInt(O.valid,10):typeof O.valid=="number"?I.valid=O.valid:typeof O.valid=="object"&&(I.valid=new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber())),O.code!=null&&(I.code=O.code|0),O.desc!=null&&(I.desc=String(O.desc)),O.version!=null&&(I.version=O.version|0),O.compress!=null&&(I.compress=!!O.compress),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults){if(z.event="",I.bytes===String?z.data="":(z.data=[],I.bytes!==Array&&(z.data=$util.newBuffer(z.data))),$util.Long){let J=new $util.Long(0,0,!1);z.sn=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.sn=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;if($util.Long){let J=new $util.Long(0,0,!1);z.valid=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.valid=I.longs===String?"0":0;z.code=0,z.desc="",z.version=0,z.compress=!1}return O.event!=null&&O.hasOwnProperty("event")&&(z.event=O.event),O.data!=null&&O.hasOwnProperty("data")&&(z.data=I.bytes===String?$util.base64.encode(O.data,0,O.data.length):I.bytes===Array?Array.prototype.slice.call(O.data):O.data),O.sn!=null&&O.hasOwnProperty("sn")&&(typeof O.sn=="number"?z.sn=I.longs===String?String(O.sn):O.sn:z.sn=I.longs===String?$util.Long.prototype.toString.call(O.sn):I.longs===Number?new $util.LongBits(O.sn.low>>>0,O.sn.high>>>0).toNumber():O.sn),O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),O.valid!=null&&O.hasOwnProperty("valid")&&(typeof O.valid=="number"?z.valid=I.longs===String?String(O.valid):O.valid:z.valid=I.longs===String?$util.Long.prototype.toString.call(O.valid):I.longs===Number?new $util.LongBits(O.valid.low>>>0,O.valid.high>>>0).toNumber():O.valid),O.code!=null&&O.hasOwnProperty("code")&&(z.code=O.code),O.desc!=null&&O.hasOwnProperty("desc")&&(z.desc=O.desc),O.version!=null&&O.hasOwnProperty("version")&&(z.version=O.version),O.compress!=null&&O.hasOwnProperty("compress")&&(z.compress=O.compress),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CommonRsp"},D}(),Z.User=function(){function D(O){if(this.tracks=[],O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.id="",D.prototype.callAction=null,D.prototype.callState=null,D.prototype.joinTime=null,D.prototype.tracks=$util.emptyArray,D.prototype.permissions=null,D.prototype.isPublished=null,D.prototype.behavior=null,D.prototype.channelCache=null;let N;return Object.defineProperty(D.prototype,"_callAction",{get:$util.oneOfGetter(N=["callAction"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_callState",{get:$util.oneOfGetter(N=["callState"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_joinTime",{get:$util.oneOfGetter(N=["joinTime"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_permissions",{get:$util.oneOfGetter(N=["permissions"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_isPublished",{get:$util.oneOfGetter(N=["isPublished"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_behavior",{get:$util.oneOfGetter(N=["behavior"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_channelCache",{get:$util.oneOfGetter(N=["channelCache"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){if(z||(z=$Writer.create()),I.id!=null&&Object.hasOwnProperty.call(I,"id")&&z.uint32(10).string(I.id),I.callAction!=null&&Object.hasOwnProperty.call(I,"callAction")&&z.uint32(16).int32(I.callAction),I.callState!=null&&Object.hasOwnProperty.call(I,"callState")&&z.uint32(24).int32(I.callState),I.joinTime!=null&&Object.hasOwnProperty.call(I,"joinTime")&&z.uint32(32).int64(I.joinTime),I.tracks!=null&&I.tracks.length)for(let J=0;J<I.tracks.length;++J)$root.com.quick.voice.proto.Track.encode(I.tracks[J],z.uint32(42).fork()).ldelim();return I.permissions!=null&&Object.hasOwnProperty.call(I,"permissions")&&z.uint32(48).int32(I.permissions),I.isPublished!=null&&Object.hasOwnProperty.call(I,"isPublished")&&z.uint32(56).bool(I.isPublished),I.behavior!=null&&Object.hasOwnProperty.call(I,"behavior")&&z.uint32(64).int32(I.behavior),I.channelCache!=null&&Object.hasOwnProperty.call(I,"channelCache")&&$root.com.quick.voice.proto.DataChannelCacheInfo.encode(I.channelCache,z.uint32(74).fork()).ldelim(),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.User;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.id=I.string();break}case 2:{Q.callAction=I.int32();break}case 3:{Q.callState=I.int32();break}case 4:{Q.joinTime=I.int64();break}case 5:{Q.tracks&&Q.tracks.length||(Q.tracks=[]),Q.tracks.push($root.com.quick.voice.proto.Track.decode(I,I.uint32()));break}case 6:{Q.permissions=I.int32();break}case 7:{Q.isPublished=I.bool();break}case 8:{Q.behavior=I.int32();break}case 9:{Q.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.decode(I,I.uint32());break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.id!=null&&I.hasOwnProperty("id")&&!$util.isString(I.id))return"id: string expected";if(I.callAction!=null&&I.hasOwnProperty("callAction")&&!$util.isInteger(I.callAction))return"callAction: integer expected";if(I.callState!=null&&I.hasOwnProperty("callState")&&!$util.isInteger(I.callState))return"callState: integer expected";if(I.joinTime!=null&&I.hasOwnProperty("joinTime")&&!$util.isInteger(I.joinTime)&&!(I.joinTime&&$util.isInteger(I.joinTime.low)&&$util.isInteger(I.joinTime.high)))return"joinTime: integer|Long expected";if(I.tracks!=null&&I.hasOwnProperty("tracks")){if(!Array.isArray(I.tracks))return"tracks: array expected";for(let z=0;z<I.tracks.length;++z){let J=$root.com.quick.voice.proto.Track.verify(I.tracks[z]);if(J)return"tracks."+J}}if(I.permissions!=null&&I.hasOwnProperty("permissions")&&!$util.isInteger(I.permissions))return"permissions: integer expected";if(I.isPublished!=null&&I.hasOwnProperty("isPublished")&&typeof I.isPublished!="boolean")return"isPublished: boolean expected";if(I.behavior!=null&&I.hasOwnProperty("behavior")&&!$util.isInteger(I.behavior))return"behavior: integer expected";if(I.channelCache!=null&&I.hasOwnProperty("channelCache")){let z=$root.com.quick.voice.proto.DataChannelCacheInfo.verify(I.channelCache);if(z)return"channelCache."+z}return null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.User)return I;let z=new $root.com.quick.voice.proto.User;if(I.id!=null&&(z.id=String(I.id)),I.callAction!=null&&(z.callAction=I.callAction|0),I.callState!=null&&(z.callState=I.callState|0),I.joinTime!=null&&($util.Long?(z.joinTime=$util.Long.fromValue(I.joinTime)).unsigned=!1:typeof I.joinTime=="string"?z.joinTime=parseInt(I.joinTime,10):typeof I.joinTime=="number"?z.joinTime=I.joinTime:typeof I.joinTime=="object"&&(z.joinTime=new $util.LongBits(I.joinTime.low>>>0,I.joinTime.high>>>0).toNumber())),I.tracks){if(!Array.isArray(I.tracks))throw TypeError(".com.quick.voice.proto.User.tracks: array expected");z.tracks=[];for(let J=0;J<I.tracks.length;++J){if(typeof I.tracks[J]!="object")throw TypeError(".com.quick.voice.proto.User.tracks: object expected");z.tracks[J]=$root.com.quick.voice.proto.Track.fromObject(I.tracks[J])}}if(I.permissions!=null&&(z.permissions=I.permissions|0),I.isPublished!=null&&(z.isPublished=!!I.isPublished),I.behavior!=null&&(z.behavior=I.behavior|0),I.channelCache!=null){if(typeof I.channelCache!="object")throw TypeError(".com.quick.voice.proto.User.channelCache: object expected");z.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.fromObject(I.channelCache)}return z},D.toObject=function(I,z){z||(z={});let J={};if((z.arrays||z.defaults)&&(J.tracks=[]),z.defaults&&(J.id=""),I.id!=null&&I.hasOwnProperty("id")&&(J.id=I.id),I.callAction!=null&&I.hasOwnProperty("callAction")&&(J.callAction=I.callAction,z.oneofs&&(J._callAction="callAction")),I.callState!=null&&I.hasOwnProperty("callState")&&(J.callState=I.callState,z.oneofs&&(J._callState="callState")),I.joinTime!=null&&I.hasOwnProperty("joinTime")&&(typeof I.joinTime=="number"?J.joinTime=z.longs===String?String(I.joinTime):I.joinTime:J.joinTime=z.longs===String?$util.Long.prototype.toString.call(I.joinTime):z.longs===Number?new $util.LongBits(I.joinTime.low>>>0,I.joinTime.high>>>0).toNumber():I.joinTime,z.oneofs&&(J._joinTime="joinTime")),I.tracks&&I.tracks.length){J.tracks=[];for(let Q=0;Q<I.tracks.length;++Q)J.tracks[Q]=$root.com.quick.voice.proto.Track.toObject(I.tracks[Q],z)}return I.permissions!=null&&I.hasOwnProperty("permissions")&&(J.permissions=I.permissions,z.oneofs&&(J._permissions="permissions")),I.isPublished!=null&&I.hasOwnProperty("isPublished")&&(J.isPublished=I.isPublished,z.oneofs&&(J._isPublished="isPublished")),I.behavior!=null&&I.hasOwnProperty("behavior")&&(J.behavior=I.behavior,z.oneofs&&(J._behavior="behavior")),I.channelCache!=null&&I.hasOwnProperty("channelCache")&&(J.channelCache=$root.com.quick.voice.proto.DataChannelCacheInfo.toObject(I.channelCache,z),z.oneofs&&(J._channelCache="channelCache")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.User"},D}(),Z.DataChannelCacheInfo=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.DataChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.DataChannelCacheInfo;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.DataChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.DataChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.DataChannelCacheInfo)return O;let I=new $root.com.quick.voice.proto.DataChannelCacheInfo;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.DataChannelCacheInfo.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.DataChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.DataChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.DataChannelCacheInfo"},D}(),Z.DataChannel=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.dataChannelName="",D.prototype.id=null;let N;return Object.defineProperty(D.prototype,"_id",{get:$util.oneOfGetter(N=["id"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.dataChannelName!=null&&Object.hasOwnProperty.call(I,"dataChannelName")&&z.uint32(10).string(I.dataChannelName),I.id!=null&&Object.hasOwnProperty.call(I,"id")&&z.uint32(16).int32(I.id),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.DataChannel;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.dataChannelName=I.string();break}case 2:{Q.id=I.int32();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){return typeof I!="object"||I===null?"object expected":I.dataChannelName!=null&&I.hasOwnProperty("dataChannelName")&&!$util.isString(I.dataChannelName)?"dataChannelName: string expected":I.id!=null&&I.hasOwnProperty("id")&&!$util.isInteger(I.id)?"id: integer expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.DataChannel)return I;let z=new $root.com.quick.voice.proto.DataChannel;return I.dataChannelName!=null&&(z.dataChannelName=String(I.dataChannelName)),I.id!=null&&(z.id=I.id|0),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.dataChannelName=""),I.dataChannelName!=null&&I.hasOwnProperty("dataChannelName")&&(J.dataChannelName=I.dataChannelName),I.id!=null&&I.hasOwnProperty("id")&&(J.id=I.id,z.oneofs&&(J._id="id")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.DataChannel"},D}(),Z.Login=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.appid="",D.prototype.userId="",D.prototype.sdkToken="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.appid!=null&&Object.hasOwnProperty.call(O,"appid")&&I.uint32(10).string(O.appid),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(18).string(O.userId),O.sdkToken!=null&&Object.hasOwnProperty.call(O,"sdkToken")&&I.uint32(26).string(O.sdkToken),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.Login;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.appid=O.string();break}case 2:{J.userId=O.string();break}case 3:{J.sdkToken=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.appid!=null&&O.hasOwnProperty("appid")&&!$util.isString(O.appid)?"appid: string expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&!$util.isString(O.sdkToken)?"sdkToken: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.Login)return O;let I=new $root.com.quick.voice.proto.Login;return O.appid!=null&&(I.appid=String(O.appid)),O.userId!=null&&(I.userId=String(O.userId)),O.sdkToken!=null&&(I.sdkToken=String(O.sdkToken)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.appid="",z.userId="",z.sdkToken=""),O.appid!=null&&O.hasOwnProperty("appid")&&(z.appid=O.appid),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&(z.sdkToken=O.sdkToken),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.Login"},D}(),Z.Track=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.mid="",D.prototype.trackName=null,D.prototype.location=null,D.prototype.userId=null,D.prototype.code=null,D.prototype.desc=null,D.prototype.type=null,D.prototype.isValid=null,D.prototype.simulcast=null;let N;return Object.defineProperty(D.prototype,"_trackName",{get:$util.oneOfGetter(N=["trackName"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_location",{get:$util.oneOfGetter(N=["location"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_userId",{get:$util.oneOfGetter(N=["userId"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_code",{get:$util.oneOfGetter(N=["code"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_desc",{get:$util.oneOfGetter(N=["desc"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_type",{get:$util.oneOfGetter(N=["type"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_isValid",{get:$util.oneOfGetter(N=["isValid"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_simulcast",{get:$util.oneOfGetter(N=["simulcast"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.mid!=null&&Object.hasOwnProperty.call(I,"mid")&&z.uint32(10).string(I.mid),I.trackName!=null&&Object.hasOwnProperty.call(I,"trackName")&&z.uint32(18).string(I.trackName),I.location!=null&&Object.hasOwnProperty.call(I,"location")&&z.uint32(26).string(I.location),I.userId!=null&&Object.hasOwnProperty.call(I,"userId")&&z.uint32(34).string(I.userId),I.code!=null&&Object.hasOwnProperty.call(I,"code")&&z.uint32(40).int32(I.code),I.desc!=null&&Object.hasOwnProperty.call(I,"desc")&&z.uint32(50).string(I.desc),I.type!=null&&Object.hasOwnProperty.call(I,"type")&&z.uint32(56).int32(I.type),I.isValid!=null&&Object.hasOwnProperty.call(I,"isValid")&&z.uint32(64).bool(I.isValid),I.simulcast!=null&&Object.hasOwnProperty.call(I,"simulcast")&&z.uint32(74).string(I.simulcast),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.Track;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.mid=I.string();break}case 2:{Q.trackName=I.string();break}case 3:{Q.location=I.string();break}case 4:{Q.userId=I.string();break}case 5:{Q.code=I.int32();break}case 6:{Q.desc=I.string();break}case 7:{Q.type=I.int32();break}case 8:{Q.isValid=I.bool();break}case 9:{Q.simulcast=I.string();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.mid!=null&&I.hasOwnProperty("mid")&&!$util.isString(I.mid))return"mid: string expected";if(I.trackName!=null&&I.hasOwnProperty("trackName")&&!$util.isString(I.trackName))return"trackName: string expected";if(I.location!=null&&I.hasOwnProperty("location")&&!$util.isString(I.location))return"location: string expected";if(I.userId!=null&&I.hasOwnProperty("userId")&&!$util.isString(I.userId))return"userId: string expected";if(I.code!=null&&I.hasOwnProperty("code")&&!$util.isInteger(I.code))return"code: integer expected";if(I.desc!=null&&I.hasOwnProperty("desc")&&!$util.isString(I.desc))return"desc: string expected";if(I.type!=null&&I.hasOwnProperty("type"))switch(I.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return I.isValid!=null&&I.hasOwnProperty("isValid")&&typeof I.isValid!="boolean"?"isValid: boolean expected":I.simulcast!=null&&I.hasOwnProperty("simulcast")&&!$util.isString(I.simulcast)?"simulcast: string expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.Track)return I;let z=new $root.com.quick.voice.proto.Track;switch(I.mid!=null&&(z.mid=String(I.mid)),I.trackName!=null&&(z.trackName=String(I.trackName)),I.location!=null&&(z.location=String(I.location)),I.userId!=null&&(z.userId=String(I.userId)),I.code!=null&&(z.code=I.code|0),I.desc!=null&&(z.desc=String(I.desc)),I.type){default:if(typeof I.type=="number"){z.type=I.type;break}break;case"Microphone":case 0:z.type=0;break;case"Camera":case 1:z.type=1;break;case"Screen":case 2:z.type=2;break;case"SystemVoice":case 3:z.type=3;break}return I.isValid!=null&&(z.isValid=!!I.isValid),I.simulcast!=null&&(z.simulcast=String(I.simulcast)),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.mid=""),I.mid!=null&&I.hasOwnProperty("mid")&&(J.mid=I.mid),I.trackName!=null&&I.hasOwnProperty("trackName")&&(J.trackName=I.trackName,z.oneofs&&(J._trackName="trackName")),I.location!=null&&I.hasOwnProperty("location")&&(J.location=I.location,z.oneofs&&(J._location="location")),I.userId!=null&&I.hasOwnProperty("userId")&&(J.userId=I.userId,z.oneofs&&(J._userId="userId")),I.code!=null&&I.hasOwnProperty("code")&&(J.code=I.code,z.oneofs&&(J._code="code")),I.desc!=null&&I.hasOwnProperty("desc")&&(J.desc=I.desc,z.oneofs&&(J._desc="desc")),I.type!=null&&I.hasOwnProperty("type")&&(J.type=z.enums===String?$root.com.quick.voice.proto.TrackType[I.type]===void 0?I.type:$root.com.quick.voice.proto.TrackType[I.type]:I.type,z.oneofs&&(J._type="type")),I.isValid!=null&&I.hasOwnProperty("isValid")&&(J.isValid=I.isValid,z.oneofs&&(J._isValid="isValid")),I.simulcast!=null&&I.hasOwnProperty("simulcast")&&(J.simulcast=I.simulcast,z.oneofs&&(J._simulcast="simulcast")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.Track"},D}(),Z.JoinReq=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.roomId="",D.prototype.user=null,D.prototype.callType=0,D.prototype.token=null;let N;return Object.defineProperty(D.prototype,"_token",{get:$util.oneOfGetter(N=["token"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.roomId!=null&&Object.hasOwnProperty.call(I,"roomId")&&z.uint32(10).string(I.roomId),I.user!=null&&Object.hasOwnProperty.call(I,"user")&&$root.com.quick.voice.proto.User.encode(I.user,z.uint32(18).fork()).ldelim(),I.callType!=null&&Object.hasOwnProperty.call(I,"callType")&&z.uint32(24).int32(I.callType),I.token!=null&&Object.hasOwnProperty.call(I,"token")&&z.uint32(34).string(I.token),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.JoinReq;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.roomId=I.string();break}case 2:{Q.user=$root.com.quick.voice.proto.User.decode(I,I.uint32());break}case 3:{Q.callType=I.int32();break}case 4:{Q.token=I.string();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.roomId!=null&&I.hasOwnProperty("roomId")&&!$util.isString(I.roomId))return"roomId: string expected";if(I.user!=null&&I.hasOwnProperty("user")){let z=$root.com.quick.voice.proto.User.verify(I.user);if(z)return"user."+z}if(I.callType!=null&&I.hasOwnProperty("callType"))switch(I.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return I.token!=null&&I.hasOwnProperty("token")&&!$util.isString(I.token)?"token: string expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.JoinReq)return I;let z=new $root.com.quick.voice.proto.JoinReq;if(I.roomId!=null&&(z.roomId=String(I.roomId)),I.user!=null){if(typeof I.user!="object")throw TypeError(".com.quick.voice.proto.JoinReq.user: object expected");z.user=$root.com.quick.voice.proto.User.fromObject(I.user)}switch(I.callType){default:if(typeof I.callType=="number"){z.callType=I.callType;break}break;case"Normal":case 0:z.callType=0;break;case"Meeting":case 1:z.callType=1;break;case"Live":case 2:z.callType=2;break}return I.token!=null&&(z.token=String(I.token)),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.roomId="",J.user=null,J.callType=z.enums===String?"Normal":0),I.roomId!=null&&I.hasOwnProperty("roomId")&&(J.roomId=I.roomId),I.user!=null&&I.hasOwnProperty("user")&&(J.user=$root.com.quick.voice.proto.User.toObject(I.user,z)),I.callType!=null&&I.hasOwnProperty("callType")&&(J.callType=z.enums===String?$root.com.quick.voice.proto.CallType[I.callType]===void 0?I.callType:$root.com.quick.voice.proto.CallType[I.callType]:I.callType),I.token!=null&&I.hasOwnProperty("token")&&(J.token=I.token,z.oneofs&&(J._token="token")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.JoinReq"},D}(),Z.JoinRsp=function(){function D(N){if(this.roomUsers=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.roomUsers=$util.emptyArray,D.prototype.callType=0,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.roomUsers!=null&&O.roomUsers.length)for(let z=0;z<O.roomUsers.length;++z)$root.com.quick.voice.proto.User.encode(O.roomUsers[z],I.uint32(18).fork()).ldelim();return O.callType!=null&&Object.hasOwnProperty.call(O,"callType")&&I.uint32(24).int32(O.callType),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.JoinRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.roomUsers&&J.roomUsers.length||(J.roomUsers=[]),J.roomUsers.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}case 3:{J.callType=O.int32();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.roomUsers!=null&&O.hasOwnProperty("roomUsers")){if(!Array.isArray(O.roomUsers))return"roomUsers: array expected";for(let I=0;I<O.roomUsers.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.roomUsers[I]);if(z)return"roomUsers."+z}}if(O.callType!=null&&O.hasOwnProperty("callType"))switch(O.callType){default:return"callType: enum value expected";case 0:case 1:case 2:break}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.JoinRsp)return O;let I=new $root.com.quick.voice.proto.JoinRsp;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.roomUsers){if(!Array.isArray(O.roomUsers))throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: array expected");I.roomUsers=[];for(let z=0;z<O.roomUsers.length;++z){if(typeof O.roomUsers[z]!="object")throw TypeError(".com.quick.voice.proto.JoinRsp.roomUsers: object expected");I.roomUsers[z]=$root.com.quick.voice.proto.User.fromObject(O.roomUsers[z])}}switch(O.callType){default:if(typeof O.callType=="number"){I.callType=O.callType;break}break;case"Normal":case 0:I.callType=0;break;case"Meeting":case 1:I.callType=1;break;case"Live":case 2:I.callType=2;break}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.roomUsers=[]),I.defaults&&(z.roomId="",z.callType=I.enums===String?"Normal":0),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.roomUsers&&O.roomUsers.length){z.roomUsers=[];for(let J=0;J<O.roomUsers.length;++J)z.roomUsers[J]=$root.com.quick.voice.proto.User.toObject(O.roomUsers[J],I)}return O.callType!=null&&O.hasOwnProperty("callType")&&(z.callType=I.enums===String?$root.com.quick.voice.proto.CallType[O.callType]===void 0?O.callType:$root.com.quick.voice.proto.CallType[O.callType]:O.callType),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.JoinRsp"},D}(),Z.JoinNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.JoinNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.JoinNotify)return O;let I=new $root.com.quick.voice.proto.JoinNotify;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.JoinNotify.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.JoinNotify"},D}(),Z.ConnectCFReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.sdp="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.sdp!=null&&Object.hasOwnProperty.call(O,"sdp")&&I.uint32(10).string(O.sdp),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ConnectCFReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.sdp=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.sdp!=null&&O.hasOwnProperty("sdp")&&!$util.isString(O.sdp)?"sdp: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ConnectCFReq)return O;let I=new $root.com.quick.voice.proto.ConnectCFReq;return O.sdp!=null&&(I.sdp=String(O.sdp)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.sdp=""),O.sdp!=null&&O.hasOwnProperty("sdp")&&(z.sdp=O.sdp),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ConnectCFReq"},D}(),Z.ConnectCFRsp=function(){function D(N){if(this.subscribeUsers=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.prototype.subscribeUsers=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),O.subscribeUsers!=null&&O.subscribeUsers.length)for(let z=0;z<O.subscribeUsers.length;++z)$root.com.quick.voice.proto.User.encode(O.subscribeUsers[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ConnectCFRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}case 2:{J.subscribeUsers&&J.subscribeUsers.length||(J.subscribeUsers=[]),J.subscribeUsers.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp))return"remoteSdp: string expected";if(O.subscribeUsers!=null&&O.hasOwnProperty("subscribeUsers")){if(!Array.isArray(O.subscribeUsers))return"subscribeUsers: array expected";for(let I=0;I<O.subscribeUsers.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.subscribeUsers[I]);if(z)return"subscribeUsers."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ConnectCFRsp)return O;let I=new $root.com.quick.voice.proto.ConnectCFRsp;if(O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),O.subscribeUsers){if(!Array.isArray(O.subscribeUsers))throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: array expected");I.subscribeUsers=[];for(let z=0;z<O.subscribeUsers.length;++z){if(typeof O.subscribeUsers[z]!="object")throw TypeError(".com.quick.voice.proto.ConnectCFRsp.subscribeUsers: object expected");I.subscribeUsers[z]=$root.com.quick.voice.proto.User.fromObject(O.subscribeUsers[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.subscribeUsers=[]),I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),O.subscribeUsers&&O.subscribeUsers.length){z.subscribeUsers=[];for(let J=0;J<O.subscribeUsers.length;++J)z.subscribeUsers[J]=$root.com.quick.voice.proto.User.toObject(O.subscribeUsers[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ConnectCFRsp"},D}(),Z.PublishReq=function(){function D(O){if(this.tracks=[],O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.sdp="",D.prototype.tracks=$util.emptyArray,D.prototype.callAction=0,D.prototype.recreate=null;let N;return Object.defineProperty(D.prototype,"_recreate",{get:$util.oneOfGetter(N=["recreate"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){if(z||(z=$Writer.create()),I.sdp!=null&&Object.hasOwnProperty.call(I,"sdp")&&z.uint32(10).string(I.sdp),I.tracks!=null&&I.tracks.length)for(let J=0;J<I.tracks.length;++J)$root.com.quick.voice.proto.Track.encode(I.tracks[J],z.uint32(18).fork()).ldelim();return I.callAction!=null&&Object.hasOwnProperty.call(I,"callAction")&&z.uint32(24).int32(I.callAction),I.recreate!=null&&Object.hasOwnProperty.call(I,"recreate")&&z.uint32(32).bool(I.recreate),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.PublishReq;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.sdp=I.string();break}case 2:{Q.tracks&&Q.tracks.length||(Q.tracks=[]),Q.tracks.push($root.com.quick.voice.proto.Track.decode(I,I.uint32()));break}case 3:{Q.callAction=I.int32();break}case 4:{Q.recreate=I.bool();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.sdp!=null&&I.hasOwnProperty("sdp")&&!$util.isString(I.sdp))return"sdp: string expected";if(I.tracks!=null&&I.hasOwnProperty("tracks")){if(!Array.isArray(I.tracks))return"tracks: array expected";for(let z=0;z<I.tracks.length;++z){let J=$root.com.quick.voice.proto.Track.verify(I.tracks[z]);if(J)return"tracks."+J}}return I.callAction!=null&&I.hasOwnProperty("callAction")&&!$util.isInteger(I.callAction)?"callAction: integer expected":I.recreate!=null&&I.hasOwnProperty("recreate")&&typeof I.recreate!="boolean"?"recreate: boolean expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.PublishReq)return I;let z=new $root.com.quick.voice.proto.PublishReq;if(I.sdp!=null&&(z.sdp=String(I.sdp)),I.tracks){if(!Array.isArray(I.tracks))throw TypeError(".com.quick.voice.proto.PublishReq.tracks: array expected");z.tracks=[];for(let J=0;J<I.tracks.length;++J){if(typeof I.tracks[J]!="object")throw TypeError(".com.quick.voice.proto.PublishReq.tracks: object expected");z.tracks[J]=$root.com.quick.voice.proto.Track.fromObject(I.tracks[J])}}return I.callAction!=null&&(z.callAction=I.callAction|0),I.recreate!=null&&(z.recreate=!!I.recreate),z},D.toObject=function(I,z){z||(z={});let J={};if((z.arrays||z.defaults)&&(J.tracks=[]),z.defaults&&(J.sdp="",J.callAction=0),I.sdp!=null&&I.hasOwnProperty("sdp")&&(J.sdp=I.sdp),I.tracks&&I.tracks.length){J.tracks=[];for(let Q=0;Q<I.tracks.length;++Q)J.tracks[Q]=$root.com.quick.voice.proto.Track.toObject(I.tracks[Q],z)}return I.callAction!=null&&I.hasOwnProperty("callAction")&&(J.callAction=I.callAction),I.recreate!=null&&I.hasOwnProperty("recreate")&&(J.recreate=I.recreate,z.oneofs&&(J._recreate="recreate")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.PublishReq"},D}(),Z.PublishRsp=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PublishRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp)?"remoteSdp: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PublishRsp)return O;let I=new $root.com.quick.voice.proto.PublishRsp;return O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PublishRsp"},D}(),Z.PublishNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PublishNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PublishNotify)return O;let I=new $root.com.quick.voice.proto.PublishNotify;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.PublishNotify.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PublishNotify"},D}(),Z.SubscribeReq=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SubscribeReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SubscribeReq)return O;let I=new $root.com.quick.voice.proto.SubscribeReq;if(O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.SubscribeReq.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.SubscribeReq.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SubscribeReq"},D}(),Z.SubscribeRsp=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SubscribeRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}case 2:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp))return"remoteSdp: string expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SubscribeRsp)return O;let I=new $root.com.quick.voice.proto.SubscribeRsp;if(O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.SubscribeRsp.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SubscribeRsp"},D}(),Z.RenegotiateReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.sdp="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.sdp!=null&&Object.hasOwnProperty.call(O,"sdp")&&I.uint32(18).string(O.sdp),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.RenegotiateReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.sdp=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.sdp!=null&&O.hasOwnProperty("sdp")&&!$util.isString(O.sdp)?"sdp: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.RenegotiateReq)return O;let I=new $root.com.quick.voice.proto.RenegotiateReq;return O.userId!=null&&(I.userId=String(O.userId)),O.sdp!=null&&(I.sdp=String(O.sdp)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.userId="",z.sdp=""),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.sdp!=null&&O.hasOwnProperty("sdp")&&(z.sdp=O.sdp),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.RenegotiateReq"},D}(),Z.QuitReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(18).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.QuitReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.QuitReq)return O;let I=new $root.com.quick.voice.proto.QuitReq;return O.userId!=null&&(I.userId=String(O.userId)),O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.userId="",z.roomId=""),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.QuitReq"},D}(),Z.QuitNotify=function(){function D(O){if(O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.roomId="",D.prototype.user=null,D.prototype.code=null,D.prototype.desc=null;let N;return Object.defineProperty(D.prototype,"_code",{get:$util.oneOfGetter(N=["code"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_desc",{get:$util.oneOfGetter(N=["desc"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){return z||(z=$Writer.create()),I.roomId!=null&&Object.hasOwnProperty.call(I,"roomId")&&z.uint32(10).string(I.roomId),I.user!=null&&Object.hasOwnProperty.call(I,"user")&&$root.com.quick.voice.proto.User.encode(I.user,z.uint32(18).fork()).ldelim(),I.code!=null&&Object.hasOwnProperty.call(I,"code")&&z.uint32(24).int32(I.code),I.desc!=null&&Object.hasOwnProperty.call(I,"desc")&&z.uint32(34).string(I.desc),z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.QuitNotify;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.roomId=I.string();break}case 2:{Q.user=$root.com.quick.voice.proto.User.decode(I,I.uint32());break}case 3:{Q.code=I.int32();break}case 4:{Q.desc=I.string();break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.roomId!=null&&I.hasOwnProperty("roomId")&&!$util.isString(I.roomId))return"roomId: string expected";if(I.user!=null&&I.hasOwnProperty("user")){let z=$root.com.quick.voice.proto.User.verify(I.user);if(z)return"user."+z}return I.code!=null&&I.hasOwnProperty("code")&&!$util.isInteger(I.code)?"code: integer expected":I.desc!=null&&I.hasOwnProperty("desc")&&!$util.isString(I.desc)?"desc: string expected":null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.QuitNotify)return I;let z=new $root.com.quick.voice.proto.QuitNotify;if(I.roomId!=null&&(z.roomId=String(I.roomId)),I.user!=null){if(typeof I.user!="object")throw TypeError(".com.quick.voice.proto.QuitNotify.user: object expected");z.user=$root.com.quick.voice.proto.User.fromObject(I.user)}return I.code!=null&&(z.code=I.code|0),I.desc!=null&&(z.desc=String(I.desc)),z},D.toObject=function(I,z){z||(z={});let J={};return z.defaults&&(J.roomId="",J.user=null),I.roomId!=null&&I.hasOwnProperty("roomId")&&(J.roomId=I.roomId),I.user!=null&&I.hasOwnProperty("user")&&(J.user=$root.com.quick.voice.proto.User.toObject(I.user,z)),I.code!=null&&I.hasOwnProperty("code")&&(J.code=I.code,z.oneofs&&(J._code="code")),I.desc!=null&&I.hasOwnProperty("desc")&&(J.desc=I.desc,z.oneofs&&(J._desc="desc")),J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.QuitNotify"},D}(),Z.TokenExpireNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.TokenExpireNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.TokenExpireNotify)return O;let I=new $root.com.quick.voice.proto.TokenExpireNotify;return O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.TokenExpireNotify"},D}(),Z.UpdateTokenReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.sdkToken="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.sdkToken!=null&&Object.hasOwnProperty.call(O,"sdkToken")&&I.uint32(18).string(O.sdkToken),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdateTokenReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.sdkToken=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&!$util.isString(O.sdkToken)?"sdkToken: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdateTokenReq)return O;let I=new $root.com.quick.voice.proto.UpdateTokenReq;return O.roomId!=null&&(I.roomId=String(O.roomId)),O.sdkToken!=null&&(I.sdkToken=String(O.sdkToken)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.sdkToken=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.sdkToken!=null&&O.hasOwnProperty("sdkToken")&&(z.sdkToken=O.sdkToken),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdateTokenReq"},D}(),Z.NetQualityChange=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.roomId="",D.prototype.egress=0,D.prototype.ingress=0,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(18).string(O.roomId),O.egress!=null&&Object.hasOwnProperty.call(O,"egress")&&I.uint32(24).int32(O.egress),O.ingress!=null&&Object.hasOwnProperty.call(O,"ingress")&&I.uint32(32).int32(O.ingress),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.NetQualityChange;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.roomId=O.string();break}case 3:{J.egress=O.int32();break}case 4:{J.ingress=O.int32();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":O.egress!=null&&O.hasOwnProperty("egress")&&!$util.isInteger(O.egress)?"egress: integer expected":O.ingress!=null&&O.hasOwnProperty("ingress")&&!$util.isInteger(O.ingress)?"ingress: integer expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.NetQualityChange)return O;let I=new $root.com.quick.voice.proto.NetQualityChange;return O.userId!=null&&(I.userId=String(O.userId)),O.roomId!=null&&(I.roomId=String(O.roomId)),O.egress!=null&&(I.egress=O.egress|0),O.ingress!=null&&(I.ingress=O.ingress|0),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.userId="",z.roomId="",z.egress=0,z.ingress=0),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.egress!=null&&O.hasOwnProperty("egress")&&(z.egress=O.egress),O.ingress!=null&&O.hasOwnProperty("ingress")&&(z.ingress=O.ingress),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.NetQualityChange"},D}(),Z.NetQualityNotify=function(){function D(N){if(this.qualities=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.qualities=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.qualities!=null&&O.qualities.length)for(let z=0;z<O.qualities.length;++z)$root.com.quick.voice.proto.NetQualityChange.encode(O.qualities[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.NetQualityNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.qualities&&J.qualities.length||(J.qualities=[]),J.qualities.push($root.com.quick.voice.proto.NetQualityChange.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.qualities!=null&&O.hasOwnProperty("qualities")){if(!Array.isArray(O.qualities))return"qualities: array expected";for(let I=0;I<O.qualities.length;++I){let z=$root.com.quick.voice.proto.NetQualityChange.verify(O.qualities[I]);if(z)return"qualities."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.NetQualityNotify)return O;let I=new $root.com.quick.voice.proto.NetQualityNotify;if(O.qualities){if(!Array.isArray(O.qualities))throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: array expected");I.qualities=[];for(let z=0;z<O.qualities.length;++z){if(typeof O.qualities[z]!="object")throw TypeError(".com.quick.voice.proto.NetQualityNotify.qualities: object expected");I.qualities[z]=$root.com.quick.voice.proto.NetQualityChange.fromObject(O.qualities[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.qualities=[]),O.qualities&&O.qualities.length){z.qualities=[];for(let J=0;J<O.qualities.length;++J)z.qualities[J]=$root.com.quick.voice.proto.NetQualityChange.toObject(O.qualities[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.NetQualityNotify"},D}(),Z.UpdateCall=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdateCall;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdateCall)return O;let I=new $root.com.quick.voice.proto.UpdateCall;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.UpdateCall.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdateCall"},D}(),Z.SyncRoomInfoReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SyncRoomInfoReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SyncRoomInfoReq)return O;let I=new $root.com.quick.voice.proto.SyncRoomInfoReq;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoReq.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SyncRoomInfoReq"},D}(),Z.SyncRoomInfoRsp=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.isValid=!1,D.prototype.users=$util.emptyArray,D.prototype.isActive=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.isValid!=null&&Object.hasOwnProperty.call(O,"isValid")&&I.uint32(16).bool(O.isValid),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(26).fork()).ldelim();return O.isActive!=null&&Object.hasOwnProperty.call(O,"isActive")&&I.uint32(32).bool(O.isActive),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.SyncRoomInfoRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.isValid=O.bool();break}case 3:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}case 4:{J.isActive=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.isValid!=null&&O.hasOwnProperty("isValid")&&typeof O.isValid!="boolean")return"isValid: boolean expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return O.isActive!=null&&O.hasOwnProperty("isActive")&&typeof O.isActive!="boolean"?"isActive: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.SyncRoomInfoRsp)return O;let I=new $root.com.quick.voice.proto.SyncRoomInfoRsp;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.isValid!=null&&(I.isValid=!!O.isValid),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.SyncRoomInfoRsp.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return O.isActive!=null&&(I.isActive=!!O.isActive),I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.roomId="",z.isValid=!1,z.isActive=!1),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.isValid!=null&&O.hasOwnProperty("isValid")&&(z.isValid=O.isValid),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return O.isActive!=null&&O.hasOwnProperty("isActive")&&(z.isActive=O.isActive),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.SyncRoomInfoRsp"},D}(),Z.UpdateTime=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(8).int64(O.time),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdateTime;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.time=O.int64();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdateTime)return O;let I=new $root.com.quick.voice.proto.UpdateTime;return O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults)if($util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;return O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdateTime"},D}(),Z.CloseTrackReq=function(){function D(N){if(this.tracks=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.sdp="",D.prototype.tracks=$util.emptyArray,D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.sdp!=null&&Object.hasOwnProperty.call(O,"sdp")&&I.uint32(10).string(O.sdp),O.tracks!=null&&O.tracks.length)for(let z=0;z<O.tracks.length;++z)$root.com.quick.voice.proto.Track.encode(O.tracks[z],I.uint32(18).fork()).ldelim();return O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(26).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CloseTrackReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.sdp=O.string();break}case 2:{J.tracks&&J.tracks.length||(J.tracks=[]),J.tracks.push($root.com.quick.voice.proto.Track.decode(O,O.uint32()));break}case 3:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.sdp!=null&&O.hasOwnProperty("sdp")&&!$util.isString(O.sdp))return"sdp: string expected";if(O.tracks!=null&&O.hasOwnProperty("tracks")){if(!Array.isArray(O.tracks))return"tracks: array expected";for(let I=0;I<O.tracks.length;++I){let z=$root.com.quick.voice.proto.Track.verify(O.tracks[I]);if(z)return"tracks."+z}}return O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CloseTrackReq)return O;let I=new $root.com.quick.voice.proto.CloseTrackReq;if(O.sdp!=null&&(I.sdp=String(O.sdp)),O.tracks){if(!Array.isArray(O.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: array expected");I.tracks=[];for(let z=0;z<O.tracks.length;++z){if(typeof O.tracks[z]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackReq.tracks: object expected");I.tracks[z]=$root.com.quick.voice.proto.Track.fromObject(O.tracks[z])}}return O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.tracks=[]),I.defaults&&(z.sdp="",z.roomId=""),O.sdp!=null&&O.hasOwnProperty("sdp")&&(z.sdp=O.sdp),O.tracks&&O.tracks.length){z.tracks=[];for(let J=0;J<O.tracks.length;++J)z.tracks[J]=$root.com.quick.voice.proto.Track.toObject(O.tracks[J],I)}return O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CloseTrackReq"},D}(),Z.CloseTrackRsp=function(){function D(N){if(this.tracks=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.remoteSdp="",D.prototype.tracks=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.remoteSdp!=null&&Object.hasOwnProperty.call(O,"remoteSdp")&&I.uint32(10).string(O.remoteSdp),O.tracks!=null&&O.tracks.length)for(let z=0;z<O.tracks.length;++z)$root.com.quick.voice.proto.Track.encode(O.tracks[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CloseTrackRsp;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.remoteSdp=O.string();break}case 2:{J.tracks&&J.tracks.length||(J.tracks=[]),J.tracks.push($root.com.quick.voice.proto.Track.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&!$util.isString(O.remoteSdp))return"remoteSdp: string expected";if(O.tracks!=null&&O.hasOwnProperty("tracks")){if(!Array.isArray(O.tracks))return"tracks: array expected";for(let I=0;I<O.tracks.length;++I){let z=$root.com.quick.voice.proto.Track.verify(O.tracks[I]);if(z)return"tracks."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CloseTrackRsp)return O;let I=new $root.com.quick.voice.proto.CloseTrackRsp;if(O.remoteSdp!=null&&(I.remoteSdp=String(O.remoteSdp)),O.tracks){if(!Array.isArray(O.tracks))throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: array expected");I.tracks=[];for(let z=0;z<O.tracks.length;++z){if(typeof O.tracks[z]!="object")throw TypeError(".com.quick.voice.proto.CloseTrackRsp.tracks: object expected");I.tracks[z]=$root.com.quick.voice.proto.Track.fromObject(O.tracks[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.tracks=[]),I.defaults&&(z.remoteSdp=""),O.remoteSdp!=null&&O.hasOwnProperty("remoteSdp")&&(z.remoteSdp=O.remoteSdp),O.tracks&&O.tracks.length){z.tracks=[];for(let J=0;J<O.tracks.length;++J)z.tracks[J]=$root.com.quick.voice.proto.Track.toObject(O.tracks[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CloseTrackRsp"},D}(),Z.CloseTrackNotify=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(10).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.CloseTrackNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.CloseTrackNotify)return O;let I=new $root.com.quick.voice.proto.CloseTrackNotify;if(O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.CloseTrackNotify.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.user=null),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.CloseTrackNotify"},D}(),Z.ToggleLiveRoomReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ToggleLiveRoomReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId)?"roomId: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ToggleLiveRoomReq)return O;let I=new $root.com.quick.voice.proto.ToggleLiveRoomReq;return O.roomId!=null&&(I.roomId=String(O.roomId)),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ToggleLiveRoomReq"},D}(),Z.ToggleLiveRoomRsq=function(){function D(N){if(this.roomUsers=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.hash="",D.prototype.roomUsers=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.hash!=null&&Object.hasOwnProperty.call(O,"hash")&&I.uint32(18).string(O.hash),O.roomUsers!=null&&O.roomUsers.length)for(let z=0;z<O.roomUsers.length;++z)$root.com.quick.voice.proto.User.encode(O.roomUsers[z],I.uint32(26).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.hash=O.string();break}case 3:{J.roomUsers&&J.roomUsers.length||(J.roomUsers=[]),J.roomUsers.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.hash!=null&&O.hasOwnProperty("hash")&&!$util.isString(O.hash))return"hash: string expected";if(O.roomUsers!=null&&O.hasOwnProperty("roomUsers")){if(!Array.isArray(O.roomUsers))return"roomUsers: array expected";for(let I=0;I<O.roomUsers.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.roomUsers[I]);if(z)return"roomUsers."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ToggleLiveRoomRsq)return O;let I=new $root.com.quick.voice.proto.ToggleLiveRoomRsq;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.hash!=null&&(I.hash=String(O.hash)),O.roomUsers){if(!Array.isArray(O.roomUsers))throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: array expected");I.roomUsers=[];for(let z=0;z<O.roomUsers.length;++z){if(typeof O.roomUsers[z]!="object")throw TypeError(".com.quick.voice.proto.ToggleLiveRoomRsq.roomUsers: object expected");I.roomUsers[z]=$root.com.quick.voice.proto.User.fromObject(O.roomUsers[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.roomUsers=[]),I.defaults&&(z.roomId="",z.hash=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.hash!=null&&O.hasOwnProperty("hash")&&(z.hash=O.hash),O.roomUsers&&O.roomUsers.length){z.roomUsers=[];for(let J=0;J<O.roomUsers.length;++J)z.roomUsers[J]=$root.com.quick.voice.proto.User.toObject(O.roomUsers[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ToggleLiveRoomRsq"},D}(),Z.TrackType=function(){const D={},N=Object.create(D);return N[D[0]="Microphone"]=0,N[D[1]="Camera"]=1,N[D[2]="Screen"]=2,N[D[3]="SystemVoice"]=3,N}(),Z.ReportInfoReq=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.actionEvent="",D.prototype.userId="",D.prototype.platform="",D.prototype.time=$util.Long?$util.Long.fromBits(0,0,!1):0,D.prototype.actionData="",D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.actionEvent!=null&&Object.hasOwnProperty.call(O,"actionEvent")&&I.uint32(10).string(O.actionEvent),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(18).string(O.userId),O.platform!=null&&Object.hasOwnProperty.call(O,"platform")&&I.uint32(26).string(O.platform),O.time!=null&&Object.hasOwnProperty.call(O,"time")&&I.uint32(32).int64(O.time),O.actionData!=null&&Object.hasOwnProperty.call(O,"actionData")&&I.uint32(42).string(O.actionData),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ReportInfoReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.actionEvent=O.string();break}case 2:{J.userId=O.string();break}case 3:{J.platform=O.string();break}case 4:{J.time=O.int64();break}case 5:{J.actionData=O.string();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){return typeof O!="object"||O===null?"object expected":O.actionEvent!=null&&O.hasOwnProperty("actionEvent")&&!$util.isString(O.actionEvent)?"actionEvent: string expected":O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId)?"userId: string expected":O.platform!=null&&O.hasOwnProperty("platform")&&!$util.isString(O.platform)?"platform: string expected":O.time!=null&&O.hasOwnProperty("time")&&!$util.isInteger(O.time)&&!(O.time&&$util.isInteger(O.time.low)&&$util.isInteger(O.time.high))?"time: integer|Long expected":O.actionData!=null&&O.hasOwnProperty("actionData")&&!$util.isString(O.actionData)?"actionData: string expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ReportInfoReq)return O;let I=new $root.com.quick.voice.proto.ReportInfoReq;return O.actionEvent!=null&&(I.actionEvent=String(O.actionEvent)),O.userId!=null&&(I.userId=String(O.userId)),O.platform!=null&&(I.platform=String(O.platform)),O.time!=null&&($util.Long?(I.time=$util.Long.fromValue(O.time)).unsigned=!1:typeof O.time=="string"?I.time=parseInt(O.time,10):typeof O.time=="number"?I.time=O.time:typeof O.time=="object"&&(I.time=new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber())),O.actionData!=null&&(I.actionData=String(O.actionData)),I},D.toObject=function(O,I){I||(I={});let z={};if(I.defaults){if(z.actionEvent="",z.userId="",z.platform="",$util.Long){let J=new $util.Long(0,0,!1);z.time=I.longs===String?J.toString():I.longs===Number?J.toNumber():J}else z.time=I.longs===String?"0":0;z.actionData=""}return O.actionEvent!=null&&O.hasOwnProperty("actionEvent")&&(z.actionEvent=O.actionEvent),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.platform!=null&&O.hasOwnProperty("platform")&&(z.platform=O.platform),O.time!=null&&O.hasOwnProperty("time")&&(typeof O.time=="number"?z.time=I.longs===String?String(O.time):O.time:z.time=I.longs===String?$util.Long.prototype.toString.call(O.time):I.longs===Number?new $util.LongBits(O.time.low>>>0,O.time.high>>>0).toNumber():O.time),O.actionData!=null&&O.hasOwnProperty("actionData")&&(z.actionData=O.actionData),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ReportInfoReq"},D}(),Z.UpdatePermissions=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.user=null,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.user!=null&&Object.hasOwnProperty.call(O,"user")&&$root.com.quick.voice.proto.User.encode(O.user,I.uint32(18).fork()).ldelim(),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UpdatePermissions;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.user=$root.com.quick.voice.proto.User.decode(O,O.uint32());break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.user!=null&&O.hasOwnProperty("user")){let I=$root.com.quick.voice.proto.User.verify(O.user);if(I)return"user."+I}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UpdatePermissions)return O;let I=new $root.com.quick.voice.proto.UpdatePermissions;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.user!=null){if(typeof O.user!="object")throw TypeError(".com.quick.voice.proto.UpdatePermissions.user: object expected");I.user=$root.com.quick.voice.proto.User.fromObject(O.user)}return I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.roomId="",z.user=null),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.user!=null&&O.hasOwnProperty("user")&&(z.user=$root.com.quick.voice.proto.User.toObject(O.user,I)),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UpdatePermissions"},D}(),Z.CallType=function(){const D={},N=Object.create(D);return N[D[0]="Normal"]=0,N[D[1]="Meeting"]=1,N[D[2]="Live"]=2,N}(),Z.QuitNotifyCode=function(){const D={},N=Object.create(D);return N[D[0]="NormalQuit"]=0,N[D[2021]="Timeout"]=2021,N[D[2011]="TokenExpired"]=2011,N[D[2022]="KickOut"]=2022,N[D[2023]="EndPk"]=2023,N[D[2024]="EndLive"]=2024,N}(),Z.UserBehavior=function(){function D(N){if(N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.type=0,D.prototype.behavior=!1,D.create=function(O){return new D(O)},D.encode=function(O,I){return I||(I=$Writer.create()),O.type!=null&&Object.hasOwnProperty.call(O,"type")&&I.uint32(8).int32(O.type),O.behavior!=null&&Object.hasOwnProperty.call(O,"behavior")&&I.uint32(16).bool(O.behavior),I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UserBehavior;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.type=O.int32();break}case 2:{J.behavior=O.bool();break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.type!=null&&O.hasOwnProperty("type"))switch(O.type){default:return"type: enum value expected";case 0:case 1:case 2:case 3:break}return O.behavior!=null&&O.hasOwnProperty("behavior")&&typeof O.behavior!="boolean"?"behavior: boolean expected":null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UserBehavior)return O;let I=new $root.com.quick.voice.proto.UserBehavior;switch(O.type){default:if(typeof O.type=="number"){I.type=O.type;break}break;case"Microphone":case 0:I.type=0;break;case"Camera":case 1:I.type=1;break;case"Screen":case 2:I.type=2;break;case"SystemVoice":case 3:I.type=3;break}return O.behavior!=null&&(I.behavior=!!O.behavior),I},D.toObject=function(O,I){I||(I={});let z={};return I.defaults&&(z.type=I.enums===String?"Microphone":0,z.behavior=!1),O.type!=null&&O.hasOwnProperty("type")&&(z.type=I.enums===String?$root.com.quick.voice.proto.TrackType[O.type]===void 0?O.type:$root.com.quick.voice.proto.TrackType[O.type]:O.type),O.behavior!=null&&O.hasOwnProperty("behavior")&&(z.behavior=O.behavior),z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UserBehavior"},D}(),Z.PreventUser=function(){function D(N){if(this.behaviors=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.id="",D.prototype.behaviors=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.id!=null&&Object.hasOwnProperty.call(O,"id")&&I.uint32(10).string(O.id),O.behaviors!=null&&O.behaviors.length)for(let z=0;z<O.behaviors.length;++z)$root.com.quick.voice.proto.UserBehavior.encode(O.behaviors[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PreventUser;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.id=O.string();break}case 2:{J.behaviors&&J.behaviors.length||(J.behaviors=[]),J.behaviors.push($root.com.quick.voice.proto.UserBehavior.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.id!=null&&O.hasOwnProperty("id")&&!$util.isString(O.id))return"id: string expected";if(O.behaviors!=null&&O.hasOwnProperty("behaviors")){if(!Array.isArray(O.behaviors))return"behaviors: array expected";for(let I=0;I<O.behaviors.length;++I){let z=$root.com.quick.voice.proto.UserBehavior.verify(O.behaviors[I]);if(z)return"behaviors."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PreventUser)return O;let I=new $root.com.quick.voice.proto.PreventUser;if(O.id!=null&&(I.id=String(O.id)),O.behaviors){if(!Array.isArray(O.behaviors))throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: array expected");I.behaviors=[];for(let z=0;z<O.behaviors.length;++z){if(typeof O.behaviors[z]!="object")throw TypeError(".com.quick.voice.proto.PreventUser.behaviors: object expected");I.behaviors[z]=$root.com.quick.voice.proto.UserBehavior.fromObject(O.behaviors[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.behaviors=[]),I.defaults&&(z.id=""),O.id!=null&&O.hasOwnProperty("id")&&(z.id=O.id),O.behaviors&&O.behaviors.length){z.behaviors=[];for(let J=0;J<O.behaviors.length;++J)z.behaviors[J]=$root.com.quick.voice.proto.UserBehavior.toObject(O.behaviors[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PreventUser"},D}(),Z.PreventUsersBehaviorReq=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.PreventUser.encode(O.users[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.PreventUser.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.PreventUser.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PreventUsersBehaviorReq)return O;let I=new $root.com.quick.voice.proto.PreventUsersBehaviorReq;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorReq.users: object expected");I.users[z]=$root.com.quick.voice.proto.PreventUser.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.PreventUser.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PreventUsersBehaviorReq"},D}(),Z.PreventUsersBehaviorNotify=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.roomId="",D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.roomId!=null&&Object.hasOwnProperty.call(O,"roomId")&&I.uint32(10).string(O.roomId),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.User.encode(O.users[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.roomId=O.string();break}case 2:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.User.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.roomId!=null&&O.hasOwnProperty("roomId")&&!$util.isString(O.roomId))return"roomId: string expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.User.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.PreventUsersBehaviorNotify)return O;let I=new $root.com.quick.voice.proto.PreventUsersBehaviorNotify;if(O.roomId!=null&&(I.roomId=String(O.roomId)),O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.PreventUsersBehaviorNotify.users: object expected");I.users[z]=$root.com.quick.voice.proto.User.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),I.defaults&&(z.roomId=""),O.roomId!=null&&O.hasOwnProperty("roomId")&&(z.roomId=O.roomId),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.User.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.PreventUsersBehaviorNotify"},D}(),Z.AccelerationAreas=function(){const D={},N=Object.create(D);return N[D[0]="chinaMainland"]=0,N[D[1]="global"]=1,N[D[2]="overseas"]=2,N}(),Z.CountMethods=function(){const D={},N=Object.create(D);return N[D[0]="flow"]=0,N[D[1]="minutes"]=1,N}(),Z.BaseCDNAddress=function(){function D(N){if(this.urlMap={},N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.area=0,D.prototype.countType=0,D.prototype.urlMap=$util.emptyObject,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.area!=null&&Object.hasOwnProperty.call(O,"area")&&I.uint32(8).int32(O.area),O.countType!=null&&Object.hasOwnProperty.call(O,"countType")&&I.uint32(16).int32(O.countType),O.urlMap!=null&&Object.hasOwnProperty.call(O,"urlMap"))for(let z=Object.keys(O.urlMap),J=0;J<z.length;++J)I.uint32(26).fork().uint32(10).string(z[J]).uint32(18).string(O.urlMap[z[J]]).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.BaseCDNAddress,Q,ne;for(;O.pos<z;){let re=O.uint32();switch(re>>>3){case 1:{J.area=O.int32();break}case 2:{J.countType=O.int32();break}case 3:{J.urlMap===$util.emptyObject&&(J.urlMap={});let te=O.uint32()+O.pos;for(Q="",ne="";O.pos<te;){let oe=O.uint32();switch(oe>>>3){case 1:Q=O.string();break;case 2:ne=O.string();break;default:O.skipType(oe&7);break}}J.urlMap[Q]=ne;break}default:O.skipType(re&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.area!=null&&O.hasOwnProperty("area"))switch(O.area){default:return"area: enum value expected";case 0:case 1:case 2:break}if(O.countType!=null&&O.hasOwnProperty("countType"))switch(O.countType){default:return"countType: enum value expected";case 0:case 1:break}if(O.urlMap!=null&&O.hasOwnProperty("urlMap")){if(!$util.isObject(O.urlMap))return"urlMap: object expected";let I=Object.keys(O.urlMap);for(let z=0;z<I.length;++z)if(!$util.isString(O.urlMap[I[z]]))return"urlMap: string{k:string} expected"}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.BaseCDNAddress)return O;let I=new $root.com.quick.voice.proto.BaseCDNAddress;switch(O.area){default:if(typeof O.area=="number"){I.area=O.area;break}break;case"chinaMainland":case 0:I.area=0;break;case"global":case 1:I.area=1;break;case"overseas":case 2:I.area=2;break}switch(O.countType){default:if(typeof O.countType=="number"){I.countType=O.countType;break}break;case"flow":case 0:I.countType=0;break;case"minutes":case 1:I.countType=1;break}if(O.urlMap){if(typeof O.urlMap!="object")throw TypeError(".com.quick.voice.proto.BaseCDNAddress.urlMap: object expected");I.urlMap={};for(let z=Object.keys(O.urlMap),J=0;J<z.length;++J)I.urlMap[z[J]]=String(O.urlMap[z[J]])}return I},D.toObject=function(O,I){I||(I={});let z={};(I.objects||I.defaults)&&(z.urlMap={}),I.defaults&&(z.area=I.enums===String?"chinaMainland":0,z.countType=I.enums===String?"flow":0),O.area!=null&&O.hasOwnProperty("area")&&(z.area=I.enums===String?$root.com.quick.voice.proto.AccelerationAreas[O.area]===void 0?O.area:$root.com.quick.voice.proto.AccelerationAreas[O.area]:O.area),O.countType!=null&&O.hasOwnProperty("countType")&&(z.countType=I.enums===String?$root.com.quick.voice.proto.CountMethods[O.countType]===void 0?O.countType:$root.com.quick.voice.proto.CountMethods[O.countType]:O.countType);let J;if(O.urlMap&&(J=Object.keys(O.urlMap)).length){z.urlMap={};for(let Q=0;Q<J.length;++Q)z.urlMap[J[Q]]=O.urlMap[J[Q]]}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.BaseCDNAddress"},D}(),Z.CDNPlayAddressNotify=function(){function D(O){if(this.standLines=[],O)for(let I=Object.keys(O),z=0;z<I.length;++z)O[I[z]]!=null&&(this[I[z]]=O[I[z]])}D.prototype.roomId="",D.prototype.m3u8=null,D.prototype.rtmp=null,D.prototype.flv=null,D.prototype.rtmps=null,D.prototype.mainLine=null,D.prototype.standLines=$util.emptyArray;let N;return Object.defineProperty(D.prototype,"_m3u8",{get:$util.oneOfGetter(N=["m3u8"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_rtmp",{get:$util.oneOfGetter(N=["rtmp"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_flv",{get:$util.oneOfGetter(N=["flv"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_rtmps",{get:$util.oneOfGetter(N=["rtmps"]),set:$util.oneOfSetter(N)}),Object.defineProperty(D.prototype,"_mainLine",{get:$util.oneOfGetter(N=["mainLine"]),set:$util.oneOfSetter(N)}),D.create=function(I){return new D(I)},D.encode=function(I,z){if(z||(z=$Writer.create()),I.roomId!=null&&Object.hasOwnProperty.call(I,"roomId")&&z.uint32(10).string(I.roomId),I.m3u8!=null&&Object.hasOwnProperty.call(I,"m3u8")&&z.uint32(18).string(I.m3u8),I.rtmp!=null&&Object.hasOwnProperty.call(I,"rtmp")&&z.uint32(26).string(I.rtmp),I.flv!=null&&Object.hasOwnProperty.call(I,"flv")&&z.uint32(34).string(I.flv),I.rtmps!=null&&Object.hasOwnProperty.call(I,"rtmps")&&z.uint32(42).string(I.rtmps),I.mainLine!=null&&Object.hasOwnProperty.call(I,"mainLine")&&$root.com.quick.voice.proto.BaseCDNAddress.encode(I.mainLine,z.uint32(50).fork()).ldelim(),I.standLines!=null&&I.standLines.length)for(let J=0;J<I.standLines.length;++J)$root.com.quick.voice.proto.BaseCDNAddress.encode(I.standLines[J],z.uint32(58).fork()).ldelim();return z},D.encodeDelimited=function(I,z){return this.encode(I,z).ldelim()},D.decode=function(I,z){I instanceof $Reader||(I=$Reader.create(I));let J=z===void 0?I.len:I.pos+z,Q=new $root.com.quick.voice.proto.CDNPlayAddressNotify;for(;I.pos<J;){let ne=I.uint32();switch(ne>>>3){case 1:{Q.roomId=I.string();break}case 2:{Q.m3u8=I.string();break}case 3:{Q.rtmp=I.string();break}case 4:{Q.flv=I.string();break}case 5:{Q.rtmps=I.string();break}case 6:{Q.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.decode(I,I.uint32());break}case 7:{Q.standLines&&Q.standLines.length||(Q.standLines=[]),Q.standLines.push($root.com.quick.voice.proto.BaseCDNAddress.decode(I,I.uint32()));break}default:I.skipType(ne&7);break}}return Q},D.decodeDelimited=function(I){return I instanceof $Reader||(I=new $Reader(I)),this.decode(I,I.uint32())},D.verify=function(I){if(typeof I!="object"||I===null)return"object expected";if(I.roomId!=null&&I.hasOwnProperty("roomId")&&!$util.isString(I.roomId))return"roomId: string expected";if(I.m3u8!=null&&I.hasOwnProperty("m3u8")&&!$util.isString(I.m3u8))return"m3u8: string expected";if(I.rtmp!=null&&I.hasOwnProperty("rtmp")&&!$util.isString(I.rtmp))return"rtmp: string expected";if(I.flv!=null&&I.hasOwnProperty("flv")&&!$util.isString(I.flv))return"flv: string expected";if(I.rtmps!=null&&I.hasOwnProperty("rtmps")&&!$util.isString(I.rtmps))return"rtmps: string expected";if(I.mainLine!=null&&I.hasOwnProperty("mainLine")){let z=$root.com.quick.voice.proto.BaseCDNAddress.verify(I.mainLine);if(z)return"mainLine."+z}if(I.standLines!=null&&I.hasOwnProperty("standLines")){if(!Array.isArray(I.standLines))return"standLines: array expected";for(let z=0;z<I.standLines.length;++z){let J=$root.com.quick.voice.proto.BaseCDNAddress.verify(I.standLines[z]);if(J)return"standLines."+J}}return null},D.fromObject=function(I){if(I instanceof $root.com.quick.voice.proto.CDNPlayAddressNotify)return I;let z=new $root.com.quick.voice.proto.CDNPlayAddressNotify;if(I.roomId!=null&&(z.roomId=String(I.roomId)),I.m3u8!=null&&(z.m3u8=String(I.m3u8)),I.rtmp!=null&&(z.rtmp=String(I.rtmp)),I.flv!=null&&(z.flv=String(I.flv)),I.rtmps!=null&&(z.rtmps=String(I.rtmps)),I.mainLine!=null){if(typeof I.mainLine!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.mainLine: object expected");z.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(I.mainLine)}if(I.standLines){if(!Array.isArray(I.standLines))throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: array expected");z.standLines=[];for(let J=0;J<I.standLines.length;++J){if(typeof I.standLines[J]!="object")throw TypeError(".com.quick.voice.proto.CDNPlayAddressNotify.standLines: object expected");z.standLines[J]=$root.com.quick.voice.proto.BaseCDNAddress.fromObject(I.standLines[J])}}return z},D.toObject=function(I,z){z||(z={});let J={};if((z.arrays||z.defaults)&&(J.standLines=[]),z.defaults&&(J.roomId=""),I.roomId!=null&&I.hasOwnProperty("roomId")&&(J.roomId=I.roomId),I.m3u8!=null&&I.hasOwnProperty("m3u8")&&(J.m3u8=I.m3u8,z.oneofs&&(J._m3u8="m3u8")),I.rtmp!=null&&I.hasOwnProperty("rtmp")&&(J.rtmp=I.rtmp,z.oneofs&&(J._rtmp="rtmp")),I.flv!=null&&I.hasOwnProperty("flv")&&(J.flv=I.flv,z.oneofs&&(J._flv="flv")),I.rtmps!=null&&I.hasOwnProperty("rtmps")&&(J.rtmps=I.rtmps,z.oneofs&&(J._rtmps="rtmps")),I.mainLine!=null&&I.hasOwnProperty("mainLine")&&(J.mainLine=$root.com.quick.voice.proto.BaseCDNAddress.toObject(I.mainLine,z),z.oneofs&&(J._mainLine="mainLine")),I.standLines&&I.standLines.length){J.standLines=[];for(let Q=0;Q<I.standLines.length;++Q)J.standLines[Q]=$root.com.quick.voice.proto.BaseCDNAddress.toObject(I.standLines[Q],z)}return J},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(I){return I===void 0&&(I="type.googleapis.com"),I+"/com.quick.voice.proto.CDNPlayAddressNotify"},D}(),Z.UserChannel=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.userId="",D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.userId!=null&&Object.hasOwnProperty.call(O,"userId")&&I.uint32(10).string(O.userId),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.DataChannel.encode(O.channels[z],I.uint32(18).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.UserChannel;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.userId=O.string();break}case 2:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.DataChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.userId!=null&&O.hasOwnProperty("userId")&&!$util.isString(O.userId))return"userId: string expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.DataChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.UserChannel)return O;let I=new $root.com.quick.voice.proto.UserChannel;if(O.userId!=null&&(I.userId=String(O.userId)),O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.UserChannel.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.UserChannel.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.DataChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),I.defaults&&(z.userId=""),O.userId!=null&&O.hasOwnProperty("userId")&&(z.userId=O.userId),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.DataChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.UserChannel"},D}(),Z.ChannelPublishReq=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.DataChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelPublishReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.DataChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.DataChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelPublishReq)return O;let I=new $root.com.quick.voice.proto.ChannelPublishReq;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishReq.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.DataChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.DataChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelPublishReq"},D}(),Z.ChannelPublishRsq=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.UserChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelPublishRsq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.UserChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.UserChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelPublishRsq)return O;let I=new $root.com.quick.voice.proto.ChannelPublishRsq;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelPublishRsq.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.UserChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.UserChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelPublishRsq"},D}(),Z.ChannelSubscribeReq=function(){function D(N){if(this.users=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.users=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.users!=null&&O.users.length)for(let z=0;z<O.users.length;++z)$root.com.quick.voice.proto.UserChannel.encode(O.users[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelSubscribeReq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.users&&J.users.length||(J.users=[]),J.users.push($root.com.quick.voice.proto.UserChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.users!=null&&O.hasOwnProperty("users")){if(!Array.isArray(O.users))return"users: array expected";for(let I=0;I<O.users.length;++I){let z=$root.com.quick.voice.proto.UserChannel.verify(O.users[I]);if(z)return"users."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelSubscribeReq)return O;let I=new $root.com.quick.voice.proto.ChannelSubscribeReq;if(O.users){if(!Array.isArray(O.users))throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: array expected");I.users=[];for(let z=0;z<O.users.length;++z){if(typeof O.users[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeReq.users: object expected");I.users[z]=$root.com.quick.voice.proto.UserChannel.fromObject(O.users[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.users=[]),O.users&&O.users.length){z.users=[];for(let J=0;J<O.users.length;++J)z.users[J]=$root.com.quick.voice.proto.UserChannel.toObject(O.users[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelSubscribeReq"},D}(),Z.ChannelSubscribeRsq=function(){function D(N){if(this.channels=[],N)for(let O=Object.keys(N),I=0;I<O.length;++I)N[O[I]]!=null&&(this[O[I]]=N[O[I]])}return D.prototype.channels=$util.emptyArray,D.create=function(O){return new D(O)},D.encode=function(O,I){if(I||(I=$Writer.create()),O.channels!=null&&O.channels.length)for(let z=0;z<O.channels.length;++z)$root.com.quick.voice.proto.UserChannel.encode(O.channels[z],I.uint32(10).fork()).ldelim();return I},D.encodeDelimited=function(O,I){return this.encode(O,I).ldelim()},D.decode=function(O,I){O instanceof $Reader||(O=$Reader.create(O));let z=I===void 0?O.len:O.pos+I,J=new $root.com.quick.voice.proto.ChannelSubscribeRsq;for(;O.pos<z;){let Q=O.uint32();switch(Q>>>3){case 1:{J.channels&&J.channels.length||(J.channels=[]),J.channels.push($root.com.quick.voice.proto.UserChannel.decode(O,O.uint32()));break}default:O.skipType(Q&7);break}}return J},D.decodeDelimited=function(O){return O instanceof $Reader||(O=new $Reader(O)),this.decode(O,O.uint32())},D.verify=function(O){if(typeof O!="object"||O===null)return"object expected";if(O.channels!=null&&O.hasOwnProperty("channels")){if(!Array.isArray(O.channels))return"channels: array expected";for(let I=0;I<O.channels.length;++I){let z=$root.com.quick.voice.proto.UserChannel.verify(O.channels[I]);if(z)return"channels."+z}}return null},D.fromObject=function(O){if(O instanceof $root.com.quick.voice.proto.ChannelSubscribeRsq)return O;let I=new $root.com.quick.voice.proto.ChannelSubscribeRsq;if(O.channels){if(!Array.isArray(O.channels))throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: array expected");I.channels=[];for(let z=0;z<O.channels.length;++z){if(typeof O.channels[z]!="object")throw TypeError(".com.quick.voice.proto.ChannelSubscribeRsq.channels: object expected");I.channels[z]=$root.com.quick.voice.proto.UserChannel.fromObject(O.channels[z])}}return I},D.toObject=function(O,I){I||(I={});let z={};if((I.arrays||I.defaults)&&(z.channels=[]),O.channels&&O.channels.length){z.channels=[];for(let J=0;J<O.channels.length;++J)z.channels[J]=$root.com.quick.voice.proto.UserChannel.toObject(O.channels[J],I)}return z},D.prototype.toJSON=function(){return this.constructor.toObject(this,minimalExports.util.toJSONOptions)},D.getTypeUrl=function(O){return O===void 0&&(O="type.googleapis.com"),O+"/com.quick.voice.proto.ChannelSubscribeRsq"},D}(),Z}(),F}(),K}(),q})(),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(q){let K=q.length;for(;--K>=0;)q[K]=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(q,K,F,Z,D){this.static_tree=q,this.extra_bits=K,this.extra_base=F,this.elems=Z,this.max_length=D,this.has_stree=q&&q.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(q,K){this.dyn_tree=q,this.max_code=0,this.stat_desc=K}const d_code=q=>q<256?_dist_code[q]:_dist_code[256+(q>>>7)],put_short=(q,K)=>{q.pending_buf[q.pending++]=K&255,q.pending_buf[q.pending++]=K>>>8&255},send_bits=(q,K,F)=>{q.bi_valid>Buf_size-F?(q.bi_buf|=K<<q.bi_valid&65535,put_short(q,q.bi_buf),q.bi_buf=K>>Buf_size-q.bi_valid,q.bi_valid+=F-Buf_size):(q.bi_buf|=K<<q.bi_valid&65535,q.bi_valid+=F)},send_code=(q,K,F)=>{send_bits(q,F[K*2],F[K*2+1])},bi_reverse=(q,K)=>{let F=0;do F|=q&1,q>>>=1,F<<=1;while(--K>0);return F>>>1},bi_flush=q=>{q.bi_valid===16?(put_short(q,q.bi_buf),q.bi_buf=0,q.bi_valid=0):q.bi_valid>=8&&(q.pending_buf[q.pending++]=q.bi_buf&255,q.bi_buf>>=8,q.bi_valid-=8)},gen_bitlen=(q,K)=>{const F=K.dyn_tree,Z=K.max_code,D=K.stat_desc.static_tree,N=K.stat_desc.has_stree,O=K.stat_desc.extra_bits,I=K.stat_desc.extra_base,z=K.stat_desc.max_length;let J,Q,ne,re,te,oe,le=0;for(re=0;re<=MAX_BITS$1;re++)q.bl_count[re]=0;for(F[q.heap[q.heap_max]*2+1]=0,J=q.heap_max+1;J<HEAP_SIZE$1;J++)Q=q.heap[J],re=F[F[Q*2+1]*2+1]+1,re>z&&(re=z,le++),F[Q*2+1]=re,!(Q>Z)&&(q.bl_count[re]++,te=0,Q>=I&&(te=O[Q-I]),oe=F[Q*2],q.opt_len+=oe*(re+te),N&&(q.static_len+=oe*(D[Q*2+1]+te)));if(le!==0){do{for(re=z-1;q.bl_count[re]===0;)re--;q.bl_count[re]--,q.bl_count[re+1]+=2,q.bl_count[z]--,le-=2}while(le>0);for(re=z;re!==0;re--)for(Q=q.bl_count[re];Q!==0;)ne=q.heap[--J],!(ne>Z)&&(F[ne*2+1]!==re&&(q.opt_len+=(re-F[ne*2+1])*F[ne*2],F[ne*2+1]=re),Q--)}},gen_codes=(q,K,F)=>{const Z=new Array(MAX_BITS$1+1);let D=0,N,O;for(N=1;N<=MAX_BITS$1;N++)D=D+F[N-1]<<1,Z[N]=D;for(O=0;O<=K;O++){let I=q[O*2+1];I!==0&&(q[O*2]=bi_reverse(Z[I]++,I))}},tr_static_init=()=>{let q,K,F,Z,D;const N=new Array(MAX_BITS$1+1);for(F=0,Z=0;Z<LENGTH_CODES$1-1;Z++)for(base_length[Z]=F,q=0;q<1<<extra_lbits[Z];q++)_length_code[F++]=Z;for(_length_code[F-1]=Z,D=0,Z=0;Z<16;Z++)for(base_dist[Z]=D,q=0;q<1<<extra_dbits[Z];q++)_dist_code[D++]=Z;for(D>>=7;Z<D_CODES$1;Z++)for(base_dist[Z]=D<<7,q=0;q<1<<extra_dbits[Z]-7;q++)_dist_code[256+D++]=Z;for(K=0;K<=MAX_BITS$1;K++)N[K]=0;for(q=0;q<=143;)static_ltree[q*2+1]=8,q++,N[8]++;for(;q<=255;)static_ltree[q*2+1]=9,q++,N[9]++;for(;q<=279;)static_ltree[q*2+1]=7,q++,N[7]++;for(;q<=287;)static_ltree[q*2+1]=8,q++,N[8]++;for(gen_codes(static_ltree,L_CODES$1+1,N),q=0;q<D_CODES$1;q++)static_dtree[q*2+1]=5,static_dtree[q*2]=bi_reverse(q,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=q=>{let K;for(K=0;K<L_CODES$1;K++)q.dyn_ltree[K*2]=0;for(K=0;K<D_CODES$1;K++)q.dyn_dtree[K*2]=0;for(K=0;K<BL_CODES$1;K++)q.bl_tree[K*2]=0;q.dyn_ltree[END_BLOCK*2]=1,q.opt_len=q.static_len=0,q.sym_next=q.matches=0},bi_windup=q=>{q.bi_valid>8?put_short(q,q.bi_buf):q.bi_valid>0&&(q.pending_buf[q.pending++]=q.bi_buf),q.bi_buf=0,q.bi_valid=0},smaller=(q,K,F,Z)=>{const D=K*2,N=F*2;return q[D]<q[N]||q[D]===q[N]&&Z[K]<=Z[F]},pqdownheap=(q,K,F)=>{const Z=q.heap[F];let D=F<<1;for(;D<=q.heap_len&&(D<q.heap_len&&smaller(K,q.heap[D+1],q.heap[D],q.depth)&&D++,!smaller(K,Z,q.heap[D],q.depth));)q.heap[F]=q.heap[D],F=D,D<<=1;q.heap[F]=Z},compress_block=(q,K,F)=>{let Z,D,N=0,O,I;if(q.sym_next!==0)do Z=q.pending_buf[q.sym_buf+N++]&255,Z+=(q.pending_buf[q.sym_buf+N++]&255)<<8,D=q.pending_buf[q.sym_buf+N++],Z===0?send_code(q,D,K):(O=_length_code[D],send_code(q,O+LITERALS$1+1,K),I=extra_lbits[O],I!==0&&(D-=base_length[O],send_bits(q,D,I)),Z--,O=d_code(Z),send_code(q,O,F),I=extra_dbits[O],I!==0&&(Z-=base_dist[O],send_bits(q,Z,I)));while(N<q.sym_next);send_code(q,END_BLOCK,K)},build_tree=(q,K)=>{const F=K.dyn_tree,Z=K.stat_desc.static_tree,D=K.stat_desc.has_stree,N=K.stat_desc.elems;let O,I,z=-1,J;for(q.heap_len=0,q.heap_max=HEAP_SIZE$1,O=0;O<N;O++)F[O*2]!==0?(q.heap[++q.heap_len]=z=O,q.depth[O]=0):F[O*2+1]=0;for(;q.heap_len<2;)J=q.heap[++q.heap_len]=z<2?++z:0,F[J*2]=1,q.depth[J]=0,q.opt_len--,D&&(q.static_len-=Z[J*2+1]);for(K.max_code=z,O=q.heap_len>>1;O>=1;O--)pqdownheap(q,F,O);J=N;do O=q.heap[1],q.heap[1]=q.heap[q.heap_len--],pqdownheap(q,F,1),I=q.heap[1],q.heap[--q.heap_max]=O,q.heap[--q.heap_max]=I,F[J*2]=F[O*2]+F[I*2],q.depth[J]=(q.depth[O]>=q.depth[I]?q.depth[O]:q.depth[I])+1,F[O*2+1]=F[I*2+1]=J,q.heap[1]=J++,pqdownheap(q,F,1);while(q.heap_len>=2);q.heap[--q.heap_max]=q.heap[1],gen_bitlen(q,K),gen_codes(F,z,q.bl_count)},scan_tree=(q,K,F)=>{let Z,D=-1,N,O=K[0*2+1],I=0,z=7,J=4;for(O===0&&(z=138,J=3),K[(F+1)*2+1]=65535,Z=0;Z<=F;Z++)N=O,O=K[(Z+1)*2+1],!(++I<z&&N===O)&&(I<J?q.bl_tree[N*2]+=I:N!==0?(N!==D&&q.bl_tree[N*2]++,q.bl_tree[REP_3_6*2]++):I<=10?q.bl_tree[REPZ_3_10*2]++:q.bl_tree[REPZ_11_138*2]++,I=0,D=N,O===0?(z=138,J=3):N===O?(z=6,J=3):(z=7,J=4))},send_tree=(q,K,F)=>{let Z,D=-1,N,O=K[0*2+1],I=0,z=7,J=4;for(O===0&&(z=138,J=3),Z=0;Z<=F;Z++)if(N=O,O=K[(Z+1)*2+1],!(++I<z&&N===O)){if(I<J)do send_code(q,N,q.bl_tree);while(--I!==0);else N!==0?(N!==D&&(send_code(q,N,q.bl_tree),I--),send_code(q,REP_3_6,q.bl_tree),send_bits(q,I-3,2)):I<=10?(send_code(q,REPZ_3_10,q.bl_tree),send_bits(q,I-3,3)):(send_code(q,REPZ_11_138,q.bl_tree),send_bits(q,I-11,7));I=0,D=N,O===0?(z=138,J=3):N===O?(z=6,J=3):(z=7,J=4)}},build_bl_tree=q=>{let K;for(scan_tree(q,q.dyn_ltree,q.l_desc.max_code),scan_tree(q,q.dyn_dtree,q.d_desc.max_code),build_tree(q,q.bl_desc),K=BL_CODES$1-1;K>=3&&q.bl_tree[bl_order[K]*2+1]===0;K--);return q.opt_len+=3*(K+1)+5+5+4,K},send_all_trees=(q,K,F,Z)=>{let D;for(send_bits(q,K-257,5),send_bits(q,F-1,5),send_bits(q,Z-4,4),D=0;D<Z;D++)send_bits(q,q.bl_tree[bl_order[D]*2+1],3);send_tree(q,q.dyn_ltree,K-1),send_tree(q,q.dyn_dtree,F-1)},detect_data_type=q=>{let K=4093624447,F;for(F=0;F<=31;F++,K>>>=1)if(K&1&&q.dyn_ltree[F*2]!==0)return Z_BINARY;if(q.dyn_ltree[9*2]!==0||q.dyn_ltree[10*2]!==0||q.dyn_ltree[13*2]!==0)return Z_TEXT;for(F=32;F<LITERALS$1;F++)if(q.dyn_ltree[F*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=q=>{static_init_done||(tr_static_init(),static_init_done=!0),q.l_desc=new TreeDesc(q.dyn_ltree,static_l_desc),q.d_desc=new TreeDesc(q.dyn_dtree,static_d_desc),q.bl_desc=new TreeDesc(q.bl_tree,static_bl_desc),q.bi_buf=0,q.bi_valid=0,init_block(q)},_tr_stored_block$1=(q,K,F,Z)=>{send_bits(q,(STORED_BLOCK<<1)+(Z?1:0),3),bi_windup(q),put_short(q,F),put_short(q,~F),F&&q.pending_buf.set(q.window.subarray(K,K+F),q.pending),q.pending+=F},_tr_align$1=q=>{send_bits(q,STATIC_TREES<<1,3),send_code(q,END_BLOCK,static_ltree),bi_flush(q)},_tr_flush_block$1=(q,K,F,Z)=>{let D,N,O=0;q.level>0?(q.strm.data_type===Z_UNKNOWN$1&&(q.strm.data_type=detect_data_type(q)),build_tree(q,q.l_desc),build_tree(q,q.d_desc),O=build_bl_tree(q),D=q.opt_len+3+7>>>3,N=q.static_len+3+7>>>3,N<=D&&(D=N)):D=N=F+5,F+4<=D&&K!==-1?_tr_stored_block$1(q,K,F,Z):q.strategy===Z_FIXED$1||N===D?(send_bits(q,(STATIC_TREES<<1)+(Z?1:0),3),compress_block(q,static_ltree,static_dtree)):(send_bits(q,(DYN_TREES<<1)+(Z?1:0),3),send_all_trees(q,q.l_desc.max_code+1,q.d_desc.max_code+1,O+1),compress_block(q,q.dyn_ltree,q.dyn_dtree)),init_block(q),Z&&bi_windup(q)},_tr_tally$1=(q,K,F)=>(q.pending_buf[q.sym_buf+q.sym_next++]=K,q.pending_buf[q.sym_buf+q.sym_next++]=K>>8,q.pending_buf[q.sym_buf+q.sym_next++]=F,K===0?q.dyn_ltree[F*2]++:(q.matches++,K--,q.dyn_ltree[(_length_code[F]+LITERALS$1+1)*2]++,q.dyn_dtree[d_code(K)*2]++),q.sym_next===q.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=(q,K,F,Z)=>{let D=q&65535|0,N=q>>>16&65535|0,O=0;for(;F!==0;){O=F>2e3?2e3:F,F-=O;do D=D+K[Z++]|0,N=N+D|0;while(--O);D%=65521,N%=65521}return D|N<<16|0};var adler32_1=adler32;const makeTable=()=>{let q,K=[];for(var F=0;F<256;F++){q=F;for(var Z=0;Z<8;Z++)q=q&1?3988292384^q>>>1:q>>>1;K[F]=q}return K},crcTable=new Uint32Array(makeTable()),crc32=(q,K,F,Z)=>{const D=crcTable,N=Z+F;q^=-1;for(let O=Z;O<N;O++)q=q>>>8^D[(q^K[O])&255];return q^-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=(q,K)=>(q.msg=messages[K],K),rank=q=>q*2-(q>4?9:0),zero=q=>{let K=q.length;for(;--K>=0;)q[K]=0},slide_hash=q=>{let K,F,Z,D=q.w_size;K=q.hash_size,Z=K;do F=q.head[--Z],q.head[Z]=F>=D?F-D:0;while(--K);K=D,Z=K;do F=q.prev[--Z],q.prev[Z]=F>=D?F-D:0;while(--K)};let HASH_ZLIB=(q,K,F)=>(K<<q.hash_shift^F)&q.hash_mask,HASH=HASH_ZLIB;const flush_pending=q=>{const K=q.state;let F=K.pending;F>q.avail_out&&(F=q.avail_out),F!==0&&(q.output.set(K.pending_buf.subarray(K.pending_out,K.pending_out+F),q.next_out),q.next_out+=F,K.pending_out+=F,q.total_out+=F,q.avail_out-=F,K.pending-=F,K.pending===0&&(K.pending_out=0))},flush_block_only=(q,K)=>{_tr_flush_block(q,q.block_start>=0?q.block_start:-1,q.strstart-q.block_start,K),q.block_start=q.strstart,flush_pending(q.strm)},put_byte=(q,K)=>{q.pending_buf[q.pending++]=K},putShortMSB=(q,K)=>{q.pending_buf[q.pending++]=K>>>8&255,q.pending_buf[q.pending++]=K&255},read_buf=(q,K,F,Z)=>{let D=q.avail_in;return D>Z&&(D=Z),D===0?0:(q.avail_in-=D,K.set(q.input.subarray(q.next_in,q.next_in+D),F),q.state.wrap===1?q.adler=adler32_1(q.adler,K,D,F):q.state.wrap===2&&(q.adler=crc32_1(q.adler,K,D,F)),q.next_in+=D,q.total_in+=D,D)},longest_match=(q,K)=>{let F=q.max_chain_length,Z=q.strstart,D,N,O=q.prev_length,I=q.nice_match;const z=q.strstart>q.w_size-MIN_LOOKAHEAD?q.strstart-(q.w_size-MIN_LOOKAHEAD):0,J=q.window,Q=q.w_mask,ne=q.prev,re=q.strstart+MAX_MATCH;let te=J[Z+O-1],oe=J[Z+O];q.prev_length>=q.good_match&&(F>>=2),I>q.lookahead&&(I=q.lookahead);do if(D=K,!(J[D+O]!==oe||J[D+O-1]!==te||J[D]!==J[Z]||J[++D]!==J[Z+1])){Z+=2,D++;do;while(J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&J[++Z]===J[++D]&&Z<re);if(N=MAX_MATCH-(re-Z),Z=re-MAX_MATCH,N>O){if(q.match_start=K,O=N,N>=I)break;te=J[Z+O-1],oe=J[Z+O]}}while((K=ne[K&Q])>z&&--F!==0);return O<=q.lookahead?O:q.lookahead},fill_window=q=>{const K=q.w_size;let F,Z,D;do{if(Z=q.window_size-q.lookahead-q.strstart,q.strstart>=K+(K-MIN_LOOKAHEAD)&&(q.window.set(q.window.subarray(K,K+K-Z),0),q.match_start-=K,q.strstart-=K,q.block_start-=K,q.insert>q.strstart&&(q.insert=q.strstart),slide_hash(q),Z+=K),q.strm.avail_in===0)break;if(F=read_buf(q.strm,q.window,q.strstart+q.lookahead,Z),q.lookahead+=F,q.lookahead+q.insert>=MIN_MATCH)for(D=q.strstart-q.insert,q.ins_h=q.window[D],q.ins_h=HASH(q,q.ins_h,q.window[D+1]);q.insert&&(q.ins_h=HASH(q,q.ins_h,q.window[D+MIN_MATCH-1]),q.prev[D&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=D,D++,q.insert--,!(q.lookahead+q.insert<MIN_MATCH)););}while(q.lookahead<MIN_LOOKAHEAD&&q.strm.avail_in!==0)},deflate_stored=(q,K)=>{let F=q.pending_buf_size-5>q.w_size?q.w_size:q.pending_buf_size-5,Z,D,N,O=0,I=q.strm.avail_in;do{if(Z=65535,N=q.bi_valid+42>>3,q.strm.avail_out<N||(N=q.strm.avail_out-N,D=q.strstart-q.block_start,Z>D+q.strm.avail_in&&(Z=D+q.strm.avail_in),Z>N&&(Z=N),Z<F&&(Z===0&&K!==Z_FINISH$3||K===Z_NO_FLUSH$2||Z!==D+q.strm.avail_in)))break;O=K===Z_FINISH$3&&Z===D+q.strm.avail_in?1:0,_tr_stored_block(q,0,0,O),q.pending_buf[q.pending-4]=Z,q.pending_buf[q.pending-3]=Z>>8,q.pending_buf[q.pending-2]=~Z,q.pending_buf[q.pending-1]=~Z>>8,flush_pending(q.strm),D&&(D>Z&&(D=Z),q.strm.output.set(q.window.subarray(q.block_start,q.block_start+D),q.strm.next_out),q.strm.next_out+=D,q.strm.avail_out-=D,q.strm.total_out+=D,q.block_start+=D,Z-=D),Z&&(read_buf(q.strm,q.strm.output,q.strm.next_out,Z),q.strm.next_out+=Z,q.strm.avail_out-=Z,q.strm.total_out+=Z)}while(O===0);return I-=q.strm.avail_in,I&&(I>=q.w_size?(q.matches=2,q.window.set(q.strm.input.subarray(q.strm.next_in-q.w_size,q.strm.next_in),0),q.strstart=q.w_size,q.insert=q.strstart):(q.window_size-q.strstart<=I&&(q.strstart-=q.w_size,q.window.set(q.window.subarray(q.w_size,q.w_size+q.strstart),0),q.matches<2&&q.matches++,q.insert>q.strstart&&(q.insert=q.strstart)),q.window.set(q.strm.input.subarray(q.strm.next_in-I,q.strm.next_in),q.strstart),q.strstart+=I,q.insert+=I>q.w_size-q.insert?q.w_size-q.insert:I),q.block_start=q.strstart),q.high_water<q.strstart&&(q.high_water=q.strstart),O?BS_FINISH_DONE:K!==Z_NO_FLUSH$2&&K!==Z_FINISH$3&&q.strm.avail_in===0&&q.strstart===q.block_start?BS_BLOCK_DONE:(N=q.window_size-q.strstart,q.strm.avail_in>N&&q.block_start>=q.w_size&&(q.block_start-=q.w_size,q.strstart-=q.w_size,q.window.set(q.window.subarray(q.w_size,q.w_size+q.strstart),0),q.matches<2&&q.matches++,N+=q.w_size,q.insert>q.strstart&&(q.insert=q.strstart)),N>q.strm.avail_in&&(N=q.strm.avail_in),N&&(read_buf(q.strm,q.window,q.strstart,N),q.strstart+=N,q.insert+=N>q.w_size-q.insert?q.w_size-q.insert:N),q.high_water<q.strstart&&(q.high_water=q.strstart),N=q.bi_valid+42>>3,N=q.pending_buf_size-N>65535?65535:q.pending_buf_size-N,F=N>q.w_size?q.w_size:N,D=q.strstart-q.block_start,(D>=F||(D||K===Z_FINISH$3)&&K!==Z_NO_FLUSH$2&&q.strm.avail_in===0&&D<=N)&&(Z=D>N?N:D,O=K===Z_FINISH$3&&q.strm.avail_in===0&&Z===D?1:0,_tr_stored_block(q,q.block_start,Z,O),q.block_start+=Z,flush_pending(q.strm)),O?BS_FINISH_STARTED:BS_NEED_MORE)},deflate_fast=(q,K)=>{let F,Z;for(;;){if(q.lookahead<MIN_LOOKAHEAD){if(fill_window(q),q.lookahead<MIN_LOOKAHEAD&&K===Z_NO_FLUSH$2)return BS_NEED_MORE;if(q.lookahead===0)break}if(F=0,q.lookahead>=MIN_MATCH&&(q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),F!==0&&q.strstart-F<=q.w_size-MIN_LOOKAHEAD&&(q.match_length=longest_match(q,F)),q.match_length>=MIN_MATCH)if(Z=_tr_tally(q,q.strstart-q.match_start,q.match_length-MIN_MATCH),q.lookahead-=q.match_length,q.match_length<=q.max_lazy_match&&q.lookahead>=MIN_MATCH){q.match_length--;do q.strstart++,q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart;while(--q.match_length!==0);q.strstart++}else q.strstart+=q.match_length,q.match_length=0,q.ins_h=q.window[q.strstart],q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+1]);else Z=_tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++;if(Z&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}return q.insert=q.strstart<MIN_MATCH-1?q.strstart:MIN_MATCH-1,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(q,K)=>{let F,Z,D;for(;;){if(q.lookahead<MIN_LOOKAHEAD){if(fill_window(q),q.lookahead<MIN_LOOKAHEAD&&K===Z_NO_FLUSH$2)return BS_NEED_MORE;if(q.lookahead===0)break}if(F=0,q.lookahead>=MIN_MATCH&&(q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart),q.prev_length=q.match_length,q.prev_match=q.match_start,q.match_length=MIN_MATCH-1,F!==0&&q.prev_length<q.max_lazy_match&&q.strstart-F<=q.w_size-MIN_LOOKAHEAD&&(q.match_length=longest_match(q,F),q.match_length<=5&&(q.strategy===Z_FILTERED||q.match_length===MIN_MATCH&&q.strstart-q.match_start>4096)&&(q.match_length=MIN_MATCH-1)),q.prev_length>=MIN_MATCH&&q.match_length<=q.prev_length){D=q.strstart+q.lookahead-MIN_MATCH,Z=_tr_tally(q,q.strstart-1-q.prev_match,q.prev_length-MIN_MATCH),q.lookahead-=q.prev_length-1,q.prev_length-=2;do++q.strstart<=D&&(q.ins_h=HASH(q,q.ins_h,q.window[q.strstart+MIN_MATCH-1]),F=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart);while(--q.prev_length!==0);if(q.match_available=0,q.match_length=MIN_MATCH-1,q.strstart++,Z&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}else if(q.match_available){if(Z=_tr_tally(q,0,q.window[q.strstart-1]),Z&&flush_block_only(q,!1),q.strstart++,q.lookahead--,q.strm.avail_out===0)return BS_NEED_MORE}else q.match_available=1,q.strstart++,q.lookahead--}return q.match_available&&(Z=_tr_tally(q,0,q.window[q.strstart-1]),q.match_available=0),q.insert=q.strstart<MIN_MATCH-1?q.strstart:MIN_MATCH-1,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(q,K)=>{let F,Z,D,N;const O=q.window;for(;;){if(q.lookahead<=MAX_MATCH){if(fill_window(q),q.lookahead<=MAX_MATCH&&K===Z_NO_FLUSH$2)return BS_NEED_MORE;if(q.lookahead===0)break}if(q.match_length=0,q.lookahead>=MIN_MATCH&&q.strstart>0&&(D=q.strstart-1,Z=O[D],Z===O[++D]&&Z===O[++D]&&Z===O[++D])){N=q.strstart+MAX_MATCH;do;while(Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&Z===O[++D]&&D<N);q.match_length=MAX_MATCH-(N-D),q.match_length>q.lookahead&&(q.match_length=q.lookahead)}if(q.match_length>=MIN_MATCH?(F=_tr_tally(q,1,q.match_length-MIN_MATCH),q.lookahead-=q.match_length,q.strstart+=q.match_length,q.match_length=0):(F=_tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++),F&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}return q.insert=0,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(q,K)=>{let F;for(;;){if(q.lookahead===0&&(fill_window(q),q.lookahead===0)){if(K===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(q.match_length=0,F=_tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++,F&&(flush_block_only(q,!1),q.strm.avail_out===0))return BS_NEED_MORE}return q.insert=0,K===Z_FINISH$3?(flush_block_only(q,!0),q.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):q.sym_next&&(flush_block_only(q,!1),q.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(q,K,F,Z,D){this.good_length=q,this.max_lazy=K,this.nice_length=F,this.max_chain=Z,this.func=D}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=q=>{q.window_size=2*q.w_size,zero(q.head),q.max_lazy_match=configuration_table[q.level].max_lazy,q.good_match=configuration_table[q.level].good_length,q.nice_match=configuration_table[q.level].nice_length,q.max_chain_length=configuration_table[q.level].max_chain,q.strstart=0,q.block_start=0,q.lookahead=0,q.insert=0,q.match_length=q.prev_length=MIN_MATCH-1,q.match_available=0,q.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=q=>{if(!q)return 1;const K=q.state;return!K||K.strm!==q||K.status!==INIT_STATE&&K.status!==GZIP_STATE&&K.status!==EXTRA_STATE&&K.status!==NAME_STATE&&K.status!==COMMENT_STATE&&K.status!==HCRC_STATE&&K.status!==BUSY_STATE&&K.status!==FINISH_STATE?1:0},deflateResetKeep=q=>{if(deflateStateCheck(q))return err(q,Z_STREAM_ERROR$2);q.total_in=q.total_out=0,q.data_type=Z_UNKNOWN;const K=q.state;return K.pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap===2?GZIP_STATE:K.wrap?INIT_STATE:BUSY_STATE,q.adler=K.wrap===2?0:1,K.last_flush=-2,_tr_init(K),Z_OK$3},deflateReset=q=>{const K=deflateResetKeep(q);return K===Z_OK$3&&lm_init(q.state),K},deflateSetHeader=(q,K)=>deflateStateCheck(q)||q.state.wrap!==2?Z_STREAM_ERROR$2:(q.state.gzhead=K,Z_OK$3),deflateInit2=(q,K,F,Z,D,N)=>{if(!q)return Z_STREAM_ERROR$2;let O=1;if(K===Z_DEFAULT_COMPRESSION$1&&(K=6),Z<0?(O=0,Z=-Z):Z>15&&(O=2,Z-=16),D<1||D>MAX_MEM_LEVEL||F!==Z_DEFLATED$2||Z<8||Z>15||K<0||K>9||N<0||N>Z_FIXED||Z===8&&O!==1)return err(q,Z_STREAM_ERROR$2);Z===8&&(Z=9);const I=new DeflateState;return q.state=I,I.strm=q,I.status=INIT_STATE,I.wrap=O,I.gzhead=null,I.w_bits=Z,I.w_size=1<<I.w_bits,I.w_mask=I.w_size-1,I.hash_bits=D+7,I.hash_size=1<<I.hash_bits,I.hash_mask=I.hash_size-1,I.hash_shift=~~((I.hash_bits+MIN_MATCH-1)/MIN_MATCH),I.window=new Uint8Array(I.w_size*2),I.head=new Uint16Array(I.hash_size),I.prev=new Uint16Array(I.w_size),I.lit_bufsize=1<<D+6,I.pending_buf_size=I.lit_bufsize*4,I.pending_buf=new Uint8Array(I.pending_buf_size),I.sym_buf=I.lit_bufsize,I.sym_end=(I.lit_bufsize-1)*3,I.level=K,I.strategy=N,I.method=F,deflateReset(q)},deflateInit=(q,K)=>deflateInit2(q,K,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(q,K)=>{if(deflateStateCheck(q)||K>Z_BLOCK$1||K<0)return q?err(q,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const F=q.state;if(!q.output||q.avail_in!==0&&!q.input||F.status===FINISH_STATE&&K!==Z_FINISH$3)return err(q,q.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);const Z=F.last_flush;if(F.last_flush=K,F.pending!==0){if(flush_pending(q),q.avail_out===0)return F.last_flush=-1,Z_OK$3}else if(q.avail_in===0&&rank(K)<=rank(Z)&&K!==Z_FINISH$3)return err(q,Z_BUF_ERROR$1);if(F.status===FINISH_STATE&&q.avail_in!==0)return err(q,Z_BUF_ERROR$1);if(F.status===INIT_STATE&&F.wrap===0&&(F.status=BUSY_STATE),F.status===INIT_STATE){let D=Z_DEFLATED$2+(F.w_bits-8<<4)<<8,N=-1;if(F.strategy>=Z_HUFFMAN_ONLY||F.level<2?N=0:F.level<6?N=1:F.level===6?N=2:N=3,D|=N<<6,F.strstart!==0&&(D|=PRESET_DICT),D+=31-D%31,putShortMSB(F,D),F.strstart!==0&&(putShortMSB(F,q.adler>>>16),putShortMSB(F,q.adler&65535)),q.adler=1,F.status=BUSY_STATE,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3}if(F.status===GZIP_STATE){if(q.adler=0,put_byte(F,31),put_byte(F,139),put_byte(F,8),F.gzhead)put_byte(F,(F.gzhead.text?1:0)+(F.gzhead.hcrc?2:0)+(F.gzhead.extra?4:0)+(F.gzhead.name?8:0)+(F.gzhead.comment?16:0)),put_byte(F,F.gzhead.time&255),put_byte(F,F.gzhead.time>>8&255),put_byte(F,F.gzhead.time>>16&255),put_byte(F,F.gzhead.time>>24&255),put_byte(F,F.level===9?2:F.strategy>=Z_HUFFMAN_ONLY||F.level<2?4:0),put_byte(F,F.gzhead.os&255),F.gzhead.extra&&F.gzhead.extra.length&&(put_byte(F,F.gzhead.extra.length&255),put_byte(F,F.gzhead.extra.length>>8&255)),F.gzhead.hcrc&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending,0)),F.gzindex=0,F.status=EXTRA_STATE;else if(put_byte(F,0),put_byte(F,0),put_byte(F,0),put_byte(F,0),put_byte(F,0),put_byte(F,F.level===9?2:F.strategy>=Z_HUFFMAN_ONLY||F.level<2?4:0),put_byte(F,OS_CODE),F.status=BUSY_STATE,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3}if(F.status===EXTRA_STATE){if(F.gzhead.extra){let D=F.pending,N=(F.gzhead.extra.length&65535)-F.gzindex;for(;F.pending+N>F.pending_buf_size;){let I=F.pending_buf_size-F.pending;if(F.pending_buf.set(F.gzhead.extra.subarray(F.gzindex,F.gzindex+I),F.pending),F.pending=F.pending_buf_size,F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),F.gzindex+=I,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3;D=0,N-=I}let O=new Uint8Array(F.gzhead.extra);F.pending_buf.set(O.subarray(F.gzindex,F.gzindex+N),F.pending),F.pending+=N,F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),F.gzindex=0}F.status=NAME_STATE}if(F.status===NAME_STATE){if(F.gzhead.name){let D=F.pending,N;do{if(F.pending===F.pending_buf_size){if(F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3;D=0}F.gzindex<F.gzhead.name.length?N=F.gzhead.name.charCodeAt(F.gzindex++)&255:N=0,put_byte(F,N)}while(N!==0);F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),F.gzindex=0}F.status=COMMENT_STATE}if(F.status===COMMENT_STATE){if(F.gzhead.comment){let D=F.pending,N;do{if(F.pending===F.pending_buf_size){if(F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D)),flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3;D=0}F.gzindex<F.gzhead.comment.length?N=F.gzhead.comment.charCodeAt(F.gzindex++)&255:N=0,put_byte(F,N)}while(N!==0);F.gzhead.hcrc&&F.pending>D&&(q.adler=crc32_1(q.adler,F.pending_buf,F.pending-D,D))}F.status=HCRC_STATE}if(F.status===HCRC_STATE){if(F.gzhead.hcrc){if(F.pending+2>F.pending_buf_size&&(flush_pending(q),F.pending!==0))return F.last_flush=-1,Z_OK$3;put_byte(F,q.adler&255),put_byte(F,q.adler>>8&255),q.adler=0}if(F.status=BUSY_STATE,flush_pending(q),F.pending!==0)return F.last_flush=-1,Z_OK$3}if(q.avail_in!==0||F.lookahead!==0||K!==Z_NO_FLUSH$2&&F.status!==FINISH_STATE){let D=F.level===0?deflate_stored(F,K):F.strategy===Z_HUFFMAN_ONLY?deflate_huff(F,K):F.strategy===Z_RLE?deflate_rle(F,K):configuration_table[F.level].func(F,K);if((D===BS_FINISH_STARTED||D===BS_FINISH_DONE)&&(F.status=FINISH_STATE),D===BS_NEED_MORE||D===BS_FINISH_STARTED)return q.avail_out===0&&(F.last_flush=-1),Z_OK$3;if(D===BS_BLOCK_DONE&&(K===Z_PARTIAL_FLUSH?_tr_align(F):K!==Z_BLOCK$1&&(_tr_stored_block(F,0,0,!1),K===Z_FULL_FLUSH$1&&(zero(F.head),F.lookahead===0&&(F.strstart=0,F.block_start=0,F.insert=0))),flush_pending(q),q.avail_out===0))return F.last_flush=-1,Z_OK$3}return K!==Z_FINISH$3?Z_OK$3:F.wrap<=0?Z_STREAM_END$3:(F.wrap===2?(put_byte(F,q.adler&255),put_byte(F,q.adler>>8&255),put_byte(F,q.adler>>16&255),put_byte(F,q.adler>>24&255),put_byte(F,q.total_in&255),put_byte(F,q.total_in>>8&255),put_byte(F,q.total_in>>16&255),put_byte(F,q.total_in>>24&255)):(putShortMSB(F,q.adler>>>16),putShortMSB(F,q.adler&65535)),flush_pending(q),F.wrap>0&&(F.wrap=-F.wrap),F.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=q=>{if(deflateStateCheck(q))return Z_STREAM_ERROR$2;const K=q.state.status;return q.state=null,K===BUSY_STATE?err(q,Z_DATA_ERROR$2):Z_OK$3},deflateSetDictionary=(q,K)=>{let F=K.length;if(deflateStateCheck(q))return Z_STREAM_ERROR$2;const Z=q.state,D=Z.wrap;if(D===2||D===1&&Z.status!==INIT_STATE||Z.lookahead)return Z_STREAM_ERROR$2;if(D===1&&(q.adler=adler32_1(q.adler,K,F,0)),Z.wrap=0,F>=Z.w_size){D===0&&(zero(Z.head),Z.strstart=0,Z.block_start=0,Z.insert=0);let z=new Uint8Array(Z.w_size);z.set(K.subarray(F-Z.w_size,F),0),K=z,F=Z.w_size}const N=q.avail_in,O=q.next_in,I=q.input;for(q.avail_in=F,q.next_in=0,q.input=K,fill_window(Z);Z.lookahead>=MIN_MATCH;){let z=Z.strstart,J=Z.lookahead-(MIN_MATCH-1);do Z.ins_h=HASH(Z,Z.ins_h,Z.window[z+MIN_MATCH-1]),Z.prev[z&Z.w_mask]=Z.head[Z.ins_h],Z.head[Z.ins_h]=z,z++;while(--J);Z.strstart=z,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,q.next_in=O,q.input=I,q.avail_in=N,Z.wrap=D,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=(q,K)=>Object.prototype.hasOwnProperty.call(q,K);var assign=function(q){const K=Array.prototype.slice.call(arguments,1);for(;K.length;){const F=K.shift();if(F){if(typeof F!="object")throw new TypeError(F+"must be non-object");for(const Z in F)_has(F,Z)&&(q[Z]=F[Z])}}return q},flattenChunks=q=>{let K=0;for(let Z=0,D=q.length;Z<D;Z++)K+=q[Z].length;const F=new Uint8Array(K);for(let Z=0,D=0,N=q.length;Z<N;Z++){let O=q[Z];F.set(O,D),D+=O.length}return F},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(q){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let q=0;q<256;q++)_utf8len[q]=q>=252?6:q>=248?5:q>=240?4:q>=224?3:q>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=q=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(q);let K,F,Z,D,N,O=q.length,I=0;for(D=0;D<O;D++)F=q.charCodeAt(D),(F&64512)===55296&&D+1<O&&(Z=q.charCodeAt(D+1),(Z&64512)===56320&&(F=65536+(F-55296<<10)+(Z-56320),D++)),I+=F<128?1:F<2048?2:F<65536?3:4;for(K=new Uint8Array(I),N=0,D=0;N<I;D++)F=q.charCodeAt(D),(F&64512)===55296&&D+1<O&&(Z=q.charCodeAt(D+1),(Z&64512)===56320&&(F=65536+(F-55296<<10)+(Z-56320),D++)),F<128?K[N++]=F:F<2048?(K[N++]=192|F>>>6,K[N++]=128|F&63):F<65536?(K[N++]=224|F>>>12,K[N++]=128|F>>>6&63,K[N++]=128|F&63):(K[N++]=240|F>>>18,K[N++]=128|F>>>12&63,K[N++]=128|F>>>6&63,K[N++]=128|F&63);return K};const buf2binstring=(q,K)=>{if(K<65534&&q.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,q.length===K?q:q.subarray(0,K));let F="";for(let Z=0;Z<K;Z++)F+=String.fromCharCode(q[Z]);return F};var buf2string=(q,K)=>{const F=K||q.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(q.subarray(0,K));let Z,D;const N=new Array(F*2);for(D=0,Z=0;Z<F;){let O=q[Z++];if(O<128){N[D++]=O;continue}let I=_utf8len[O];if(I>4){N[D++]=65533,Z+=I-1;continue}for(O&=I===2?31:I===3?15:7;I>1&&Z<F;)O=O<<6|q[Z++]&63,I--;if(I>1){N[D++]=65533;continue}O<65536?N[D++]=O:(O-=65536,N[D++]=55296|O>>10&1023,N[D++]=56320|O&1023)}return buf2binstring(N,D)},utf8border=(q,K)=>{K=K||q.length,K>q.length&&(K=q.length);let F=K-1;for(;F>=0&&(q[F]&192)===128;)F--;return F<0||F===0?K:F+_utf8len[q[F]]>K?F:K},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(q){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},q||{});let K=this.options;K.raw&&K.windowBits>0?K.windowBits=-K.windowBits:K.gzip&&K.windowBits>0&&K.windowBits<16&&(K.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let F=deflate_1$2.deflateInit2(this.strm,K.level,K.method,K.windowBits,K.memLevel,K.strategy);if(F!==Z_OK$2)throw new Error(messages[F]);if(K.header&&deflate_1$2.deflateSetHeader(this.strm,K.header),K.dictionary){let Z;if(typeof K.dictionary=="string"?Z=strings.string2buf(K.dictionary):toString$1.call(K.dictionary)==="[object ArrayBuffer]"?Z=new Uint8Array(K.dictionary):Z=K.dictionary,F=deflate_1$2.deflateSetDictionary(this.strm,Z),F!==Z_OK$2)throw new Error(messages[F]);this._dict_set=!0}}Deflate$1.prototype.push=function(q,K){const F=this.strm,Z=this.options.chunkSize;let D,N;if(this.ended)return!1;for(K===~~K?N=K:N=K===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof q=="string"?F.input=strings.string2buf(q):toString$1.call(q)==="[object ArrayBuffer]"?F.input=new Uint8Array(q):F.input=q,F.next_in=0,F.avail_in=F.input.length;;){if(F.avail_out===0&&(F.output=new Uint8Array(Z),F.next_out=0,F.avail_out=Z),(N===Z_SYNC_FLUSH||N===Z_FULL_FLUSH)&&F.avail_out<=6){this.onData(F.output.subarray(0,F.next_out)),F.avail_out=0;continue}if(D=deflate_1$2.deflate(F,N),D===Z_STREAM_END$2)return F.next_out>0&&this.onData(F.output.subarray(0,F.next_out)),D=deflate_1$2.deflateEnd(this.strm),this.onEnd(D),this.ended=!0,D===Z_OK$2;if(F.avail_out===0){this.onData(F.output);continue}if(N>0&&F.next_out>0){this.onData(F.output.subarray(0,F.next_out)),F.avail_out=0;continue}if(F.avail_in===0)break}return!0},Deflate$1.prototype.onData=function(q){this.chunks.push(q)},Deflate$1.prototype.onEnd=function(q){q===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=q,this.msg=this.strm.msg};function deflate$1(q,K){const F=new Deflate$1(K);if(F.push(q,!0),F.err)throw F.msg||messages[F.err];return F.result}function deflateRaw$1(q,K){return K=K||{},K.raw=!0,deflate$1(q,K)}function gzip$1(q,K){return K=K||{},K.gzip=!0,deflate$1(q,K)}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 q(K,F){let Z,D,N,O,I,z,J,Q,ne,re,te,oe,le,ae,ce,de,we,fe,ge,me,ve,ke,xe,_e;const Te=K.state;Z=K.next_in,xe=K.input,D=Z+(K.avail_in-5),N=K.next_out,_e=K.output,O=N-(F-K.avail_out),I=N+(K.avail_out-257),z=Te.dmax,J=Te.wsize,Q=Te.whave,ne=Te.wnext,re=Te.window,te=Te.hold,oe=Te.bits,le=Te.lencode,ae=Te.distcode,ce=(1<<Te.lenbits)-1,de=(1<<Te.distbits)-1;e:do{oe<15&&(te+=xe[Z++]<<oe,oe+=8,te+=xe[Z++]<<oe,oe+=8),we=le[te&ce];t:for(;;){if(fe=we>>>24,te>>>=fe,oe-=fe,fe=we>>>16&255,fe===0)_e[N++]=we&65535;else if(fe&16){ge=we&65535,fe&=15,fe&&(oe<fe&&(te+=xe[Z++]<<oe,oe+=8),ge+=te&(1<<fe)-1,te>>>=fe,oe-=fe),oe<15&&(te+=xe[Z++]<<oe,oe+=8,te+=xe[Z++]<<oe,oe+=8),we=ae[te&de];n:for(;;){if(fe=we>>>24,te>>>=fe,oe-=fe,fe=we>>>16&255,fe&16){if(me=we&65535,fe&=15,oe<fe&&(te+=xe[Z++]<<oe,oe+=8,oe<fe&&(te+=xe[Z++]<<oe,oe+=8)),me+=te&(1<<fe)-1,me>z){K.msg="invalid distance too far back",Te.mode=BAD$1;break e}if(te>>>=fe,oe-=fe,fe=N-O,me>fe){if(fe=me-fe,fe>Q&&Te.sane){K.msg="invalid distance too far back",Te.mode=BAD$1;break e}if(ve=0,ke=re,ne===0){if(ve+=J-fe,fe<ge){ge-=fe;do _e[N++]=re[ve++];while(--fe);ve=N-me,ke=_e}}else if(ne<fe){if(ve+=J+ne-fe,fe-=ne,fe<ge){ge-=fe;do _e[N++]=re[ve++];while(--fe);if(ve=0,ne<ge){fe=ne,ge-=fe;do _e[N++]=re[ve++];while(--fe);ve=N-me,ke=_e}}}else if(ve+=ne-fe,fe<ge){ge-=fe;do _e[N++]=re[ve++];while(--fe);ve=N-me,ke=_e}for(;ge>2;)_e[N++]=ke[ve++],_e[N++]=ke[ve++],_e[N++]=ke[ve++],ge-=3;ge&&(_e[N++]=ke[ve++],ge>1&&(_e[N++]=ke[ve++]))}else{ve=N-me;do _e[N++]=_e[ve++],_e[N++]=_e[ve++],_e[N++]=_e[ve++],ge-=3;while(ge>2);ge&&(_e[N++]=_e[ve++],ge>1&&(_e[N++]=_e[ve++]))}}else if((fe&64)===0){we=ae[(we&65535)+(te&(1<<fe)-1)];continue n}else{K.msg="invalid distance code",Te.mode=BAD$1;break e}break}}else if((fe&64)===0){we=le[(we&65535)+(te&(1<<fe)-1)];continue t}else if(fe&32){Te.mode=TYPE$1;break e}else{K.msg="invalid literal/length code",Te.mode=BAD$1;break e}break}}while(Z<D&&N<I);ge=oe>>3,Z-=ge,oe-=ge<<3,te&=(1<<oe)-1,K.next_in=Z,K.next_out=N,K.avail_in=Z<D?5+(D-Z):5-(Z-D),K.avail_out=N<I?257+(I-N):257-(N-I),Te.hold=te,Te.bits=oe};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=(q,K,F,Z,D,N,O,I)=>{const z=I.bits;let J=0,Q=0,ne=0,re=0,te=0,oe=0,le=0,ae=0,ce=0,de=0,we,fe,ge,me,ve,ke=null,xe;const _e=new Uint16Array(MAXBITS+1),Te=new Uint16Array(MAXBITS+1);let qe=null,Ve,We,Fe;for(J=0;J<=MAXBITS;J++)_e[J]=0;for(Q=0;Q<Z;Q++)_e[K[F+Q]]++;for(te=z,re=MAXBITS;re>=1&&_e[re]===0;re--);if(te>re&&(te=re),re===0)return D[N++]=1<<24|64<<16|0,D[N++]=1<<24|64<<16|0,I.bits=1,0;for(ne=1;ne<re&&_e[ne]===0;ne++);for(te<ne&&(te=ne),ae=1,J=1;J<=MAXBITS;J++)if(ae<<=1,ae-=_e[J],ae<0)return-1;if(ae>0&&(q===CODES$1||re!==1))return-1;for(Te[1]=0,J=1;J<MAXBITS;J++)Te[J+1]=Te[J]+_e[J];for(Q=0;Q<Z;Q++)K[F+Q]!==0&&(O[Te[K[F+Q]]++]=Q);if(q===CODES$1?(ke=qe=O,xe=20):q===LENS$1?(ke=lbase,qe=lext,xe=257):(ke=dbase,qe=dext,xe=0),de=0,Q=0,J=ne,ve=N,oe=te,le=0,ge=-1,ce=1<<te,me=ce-1,q===LENS$1&&ce>ENOUGH_LENS$1||q===DISTS$1&&ce>ENOUGH_DISTS$1)return 1;for(;;){Ve=J-le,O[Q]+1<xe?(We=0,Fe=O[Q]):O[Q]>=xe?(We=qe[O[Q]-xe],Fe=ke[O[Q]-xe]):(We=96,Fe=0),we=1<<J-le,fe=1<<oe,ne=fe;do fe-=we,D[ve+(de>>le)+fe]=Ve<<24|We<<16|Fe|0;while(fe!==0);for(we=1<<J-1;de&we;)we>>=1;if(we!==0?(de&=we-1,de+=we):de=0,Q++,--_e[J]===0){if(J===re)break;J=K[F+O[Q]]}if(J>te&&(de&me)!==ge){for(le===0&&(le=te),ve+=ne,oe=J-le,ae=1<<oe;oe+le<re&&(ae-=_e[oe+le],!(ae<=0));)oe++,ae<<=1;if(ce+=1<<oe,q===LENS$1&&ce>ENOUGH_LENS$1||q===DISTS$1&&ce>ENOUGH_DISTS$1)return 1;ge=de&me,D[ge]=te<<24|oe<<16|ve-N|0}}return de!==0&&(D[ve+de]=J-le<<24|64<<16|0),I.bits=te,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=q=>(q>>>24&255)+(q>>>8&65280)+((q&65280)<<8)+((q&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=q=>{if(!q)return 1;const K=q.state;return!K||K.strm!==q||K.mode<HEAD||K.mode>SYNC?1:0},inflateResetKeep=q=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const K=q.state;return q.total_in=q.total_out=K.total=0,q.msg="",K.wrap&&(q.adler=K.wrap&1),K.mode=HEAD,K.last=0,K.havedict=0,K.flags=-1,K.dmax=32768,K.head=null,K.hold=0,K.bits=0,K.lencode=K.lendyn=new Int32Array(ENOUGH_LENS),K.distcode=K.distdyn=new Int32Array(ENOUGH_DISTS),K.sane=1,K.back=-1,Z_OK$1},inflateReset=q=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const K=q.state;return K.wsize=0,K.whave=0,K.wnext=0,inflateResetKeep(q)},inflateReset2=(q,K)=>{let F;if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const Z=q.state;return K<0?(F=0,K=-K):(F=(K>>4)+5,K<48&&(K&=15)),K&&(K<8||K>15)?Z_STREAM_ERROR$1:(Z.window!==null&&Z.wbits!==K&&(Z.window=null),Z.wrap=F,Z.wbits=K,inflateReset(q))},inflateInit2=(q,K)=>{if(!q)return Z_STREAM_ERROR$1;const F=new InflateState;q.state=F,F.strm=q,F.window=null,F.mode=HEAD;const Z=inflateReset2(q,K);return Z!==Z_OK$1&&(q.state=null),Z},inflateInit=q=>inflateInit2(q,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=q=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let K=0;for(;K<144;)q.lens[K++]=8;for(;K<256;)q.lens[K++]=9;for(;K<280;)q.lens[K++]=7;for(;K<288;)q.lens[K++]=8;for(inftrees(LENS,q.lens,0,288,lenfix,0,q.work,{bits:9}),K=0;K<32;)q.lens[K++]=5;inftrees(DISTS,q.lens,0,32,distfix,0,q.work,{bits:5}),virgin=!1}q.lencode=lenfix,q.lenbits=9,q.distcode=distfix,q.distbits=5},updatewindow=(q,K,F,Z)=>{let D;const N=q.state;return N.window===null&&(N.wsize=1<<N.wbits,N.wnext=0,N.whave=0,N.window=new Uint8Array(N.wsize)),Z>=N.wsize?(N.window.set(K.subarray(F-N.wsize,F),0),N.wnext=0,N.whave=N.wsize):(D=N.wsize-N.wnext,D>Z&&(D=Z),N.window.set(K.subarray(F-Z,F-Z+D),N.wnext),Z-=D,Z?(N.window.set(K.subarray(F-Z,F),0),N.wnext=Z,N.whave=N.wsize):(N.wnext+=D,N.wnext===N.wsize&&(N.wnext=0),N.whave<N.wsize&&(N.whave+=D))),0},inflate$2=(q,K)=>{let F,Z,D,N,O,I,z,J,Q,ne,re,te,oe,le,ae=0,ce,de,we,fe,ge,me,ve,ke;const xe=new Uint8Array(4);let _e,Te;const qe=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(inflateStateCheck(q)||!q.output||!q.input&&q.avail_in!==0)return Z_STREAM_ERROR$1;F=q.state,F.mode===TYPE&&(F.mode=TYPEDO),O=q.next_out,D=q.output,z=q.avail_out,N=q.next_in,Z=q.input,I=q.avail_in,J=F.hold,Q=F.bits,ne=I,re=z,ke=Z_OK$1;e:for(;;)switch(F.mode){case HEAD:if(F.wrap===0){F.mode=TYPEDO;break}for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.wrap&2&&J===35615){F.wbits===0&&(F.wbits=15),F.check=0,xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0),J=0,Q=0,F.mode=FLAGS;break}if(F.head&&(F.head.done=!1),!(F.wrap&1)||(((J&255)<<8)+(J>>8))%31){q.msg="incorrect header check",F.mode=BAD;break}if((J&15)!==Z_DEFLATED){q.msg="unknown compression method",F.mode=BAD;break}if(J>>>=4,Q-=4,ve=(J&15)+8,F.wbits===0&&(F.wbits=ve),ve>15||ve>F.wbits){q.msg="invalid window size",F.mode=BAD;break}F.dmax=1<<F.wbits,F.flags=0,q.adler=F.check=1,F.mode=J&512?DICTID:TYPE,J=0,Q=0;break;case FLAGS:for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.flags=J,(F.flags&255)!==Z_DEFLATED){q.msg="unknown compression method",F.mode=BAD;break}if(F.flags&57344){q.msg="unknown header flags set",F.mode=BAD;break}F.head&&(F.head.text=J>>8&1),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0)),J=0,Q=0,F.mode=TIME;case TIME:for(;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.head&&(F.head.time=J),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,xe[2]=J>>>16&255,xe[3]=J>>>24&255,F.check=crc32_1(F.check,xe,4,0)),J=0,Q=0,F.mode=OS;case OS:for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.head&&(F.head.xflags=J&255,F.head.os=J>>8),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0)),J=0,Q=0,F.mode=EXLEN;case EXLEN:if(F.flags&1024){for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.length=J,F.head&&(F.head.extra_len=J),F.flags&512&&F.wrap&4&&(xe[0]=J&255,xe[1]=J>>>8&255,F.check=crc32_1(F.check,xe,2,0)),J=0,Q=0}else F.head&&(F.head.extra=null);F.mode=EXTRA;case EXTRA:if(F.flags&1024&&(te=F.length,te>I&&(te=I),te&&(F.head&&(ve=F.head.extra_len-F.length,F.head.extra||(F.head.extra=new Uint8Array(F.head.extra_len)),F.head.extra.set(Z.subarray(N,N+te),ve)),F.flags&512&&F.wrap&4&&(F.check=crc32_1(F.check,Z,te,N)),I-=te,N+=te,F.length-=te),F.length))break e;F.length=0,F.mode=NAME;case NAME:if(F.flags&2048){if(I===0)break e;te=0;do ve=Z[N+te++],F.head&&ve&&F.length<65536&&(F.head.name+=String.fromCharCode(ve));while(ve&&te<I);if(F.flags&512&&F.wrap&4&&(F.check=crc32_1(F.check,Z,te,N)),I-=te,N+=te,ve)break e}else F.head&&(F.head.name=null);F.length=0,F.mode=COMMENT;case COMMENT:if(F.flags&4096){if(I===0)break e;te=0;do ve=Z[N+te++],F.head&&ve&&F.length<65536&&(F.head.comment+=String.fromCharCode(ve));while(ve&&te<I);if(F.flags&512&&F.wrap&4&&(F.check=crc32_1(F.check,Z,te,N)),I-=te,N+=te,ve)break e}else F.head&&(F.head.comment=null);F.mode=HCRC;case HCRC:if(F.flags&512){for(;Q<16;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.wrap&4&&J!==(F.check&65535)){q.msg="header crc mismatch",F.mode=BAD;break}J=0,Q=0}F.head&&(F.head.hcrc=F.flags>>9&1,F.head.done=!0),q.adler=F.check=0,F.mode=TYPE;break;case DICTID:for(;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}q.adler=F.check=zswap32(J),J=0,Q=0,F.mode=DICT;case DICT:if(F.havedict===0)return q.next_out=O,q.avail_out=z,q.next_in=N,q.avail_in=I,F.hold=J,F.bits=Q,Z_NEED_DICT$1;q.adler=F.check=1,F.mode=TYPE;case TYPE:if(K===Z_BLOCK||K===Z_TREES)break e;case TYPEDO:if(F.last){J>>>=Q&7,Q-=Q&7,F.mode=CHECK;break}for(;Q<3;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}switch(F.last=J&1,J>>>=1,Q-=1,J&3){case 0:F.mode=STORED;break;case 1:if(fixedtables(F),F.mode=LEN_,K===Z_TREES){J>>>=2,Q-=2;break e}break;case 2:F.mode=TABLE;break;case 3:q.msg="invalid block type",F.mode=BAD}J>>>=2,Q-=2;break;case STORED:for(J>>>=Q&7,Q-=Q&7;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if((J&65535)!==(J>>>16^65535)){q.msg="invalid stored block lengths",F.mode=BAD;break}if(F.length=J&65535,J=0,Q=0,F.mode=COPY_,K===Z_TREES)break e;case COPY_:F.mode=COPY;case COPY:if(te=F.length,te){if(te>I&&(te=I),te>z&&(te=z),te===0)break e;D.set(Z.subarray(N,N+te),O),I-=te,N+=te,z-=te,O+=te,F.length-=te;break}F.mode=TYPE;break;case TABLE:for(;Q<14;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.nlen=(J&31)+257,J>>>=5,Q-=5,F.ndist=(J&31)+1,J>>>=5,Q-=5,F.ncode=(J&15)+4,J>>>=4,Q-=4,F.nlen>286||F.ndist>30){q.msg="too many length or distance symbols",F.mode=BAD;break}F.have=0,F.mode=LENLENS;case LENLENS:for(;F.have<F.ncode;){for(;Q<3;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.lens[qe[F.have++]]=J&7,J>>>=3,Q-=3}for(;F.have<19;)F.lens[qe[F.have++]]=0;if(F.lencode=F.lendyn,F.lenbits=7,_e={bits:F.lenbits},ke=inftrees(CODES,F.lens,0,19,F.lencode,0,F.work,_e),F.lenbits=_e.bits,ke){q.msg="invalid code lengths set",F.mode=BAD;break}F.have=0,F.mode=CODELENS;case CODELENS:for(;F.have<F.nlen+F.ndist;){for(;ae=F.lencode[J&(1<<F.lenbits)-1],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(we<16)J>>>=ce,Q-=ce,F.lens[F.have++]=we;else{if(we===16){for(Te=ce+2;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(J>>>=ce,Q-=ce,F.have===0){q.msg="invalid bit length repeat",F.mode=BAD;break}ve=F.lens[F.have-1],te=3+(J&3),J>>>=2,Q-=2}else if(we===17){for(Te=ce+3;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=ce,Q-=ce,ve=0,te=3+(J&7),J>>>=3,Q-=3}else{for(Te=ce+7;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=ce,Q-=ce,ve=0,te=11+(J&127),J>>>=7,Q-=7}if(F.have+te>F.nlen+F.ndist){q.msg="invalid bit length repeat",F.mode=BAD;break}for(;te--;)F.lens[F.have++]=ve}}if(F.mode===BAD)break;if(F.lens[256]===0){q.msg="invalid code -- missing end-of-block",F.mode=BAD;break}if(F.lenbits=9,_e={bits:F.lenbits},ke=inftrees(LENS,F.lens,0,F.nlen,F.lencode,0,F.work,_e),F.lenbits=_e.bits,ke){q.msg="invalid literal/lengths set",F.mode=BAD;break}if(F.distbits=6,F.distcode=F.distdyn,_e={bits:F.distbits},ke=inftrees(DISTS,F.lens,F.nlen,F.ndist,F.distcode,0,F.work,_e),F.distbits=_e.bits,ke){q.msg="invalid distances set",F.mode=BAD;break}if(F.mode=LEN_,K===Z_TREES)break e;case LEN_:F.mode=LEN;case LEN:if(I>=6&&z>=258){q.next_out=O,q.avail_out=z,q.next_in=N,q.avail_in=I,F.hold=J,F.bits=Q,inffast(q,re),O=q.next_out,D=q.output,z=q.avail_out,N=q.next_in,Z=q.input,I=q.avail_in,J=F.hold,Q=F.bits,F.mode===TYPE&&(F.back=-1);break}for(F.back=0;ae=F.lencode[J&(1<<F.lenbits)-1],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(de&&(de&240)===0){for(fe=ce,ge=de,me=we;ae=F.lencode[me+((J&(1<<fe+ge)-1)>>fe)],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(fe+ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=fe,Q-=fe,F.back+=fe}if(J>>>=ce,Q-=ce,F.back+=ce,F.length=we,de===0){F.mode=LIT;break}if(de&32){F.back=-1,F.mode=TYPE;break}if(de&64){q.msg="invalid literal/length code",F.mode=BAD;break}F.extra=de&15,F.mode=LENEXT;case LENEXT:if(F.extra){for(Te=F.extra;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.length+=J&(1<<F.extra)-1,J>>>=F.extra,Q-=F.extra,F.back+=F.extra}F.was=F.length,F.mode=DIST;case DIST:for(;ae=F.distcode[J&(1<<F.distbits)-1],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if((de&240)===0){for(fe=ce,ge=de,me=we;ae=F.distcode[me+((J&(1<<fe+ge)-1)>>fe)],ce=ae>>>24,de=ae>>>16&255,we=ae&65535,!(fe+ce<=Q);){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}J>>>=fe,Q-=fe,F.back+=fe}if(J>>>=ce,Q-=ce,F.back+=ce,de&64){q.msg="invalid distance code",F.mode=BAD;break}F.offset=we,F.extra=de&15,F.mode=DISTEXT;case DISTEXT:if(F.extra){for(Te=F.extra;Q<Te;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}F.offset+=J&(1<<F.extra)-1,J>>>=F.extra,Q-=F.extra,F.back+=F.extra}if(F.offset>F.dmax){q.msg="invalid distance too far back",F.mode=BAD;break}F.mode=MATCH;case MATCH:if(z===0)break e;if(te=re-z,F.offset>te){if(te=F.offset-te,te>F.whave&&F.sane){q.msg="invalid distance too far back",F.mode=BAD;break}te>F.wnext?(te-=F.wnext,oe=F.wsize-te):oe=F.wnext-te,te>F.length&&(te=F.length),le=F.window}else le=D,oe=O-F.offset,te=F.length;te>z&&(te=z),z-=te,F.length-=te;do D[O++]=le[oe++];while(--te);F.length===0&&(F.mode=LEN);break;case LIT:if(z===0)break e;D[O++]=F.length,z--,F.mode=LEN;break;case CHECK:if(F.wrap){for(;Q<32;){if(I===0)break e;I--,J|=Z[N++]<<Q,Q+=8}if(re-=z,q.total_out+=re,F.total+=re,F.wrap&4&&re&&(q.adler=F.check=F.flags?crc32_1(F.check,D,re,O-re):adler32_1(F.check,D,re,O-re)),re=z,F.wrap&4&&(F.flags?J:zswap32(J))!==F.check){q.msg="incorrect data check",F.mode=BAD;break}J=0,Q=0}F.mode=LENGTH;case LENGTH:if(F.wrap&&F.flags){for(;Q<32;){if(I===0)break e;I--,J+=Z[N++]<<Q,Q+=8}if(F.wrap&4&&J!==(F.total&4294967295)){q.msg="incorrect length check",F.mode=BAD;break}J=0,Q=0}F.mode=DONE;case DONE:ke=Z_STREAM_END$1;break e;case BAD:ke=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return q.next_out=O,q.avail_out=z,q.next_in=N,q.avail_in=I,F.hold=J,F.bits=Q,(F.wsize||re!==q.avail_out&&F.mode<BAD&&(F.mode<CHECK||K!==Z_FINISH$1))&&updatewindow(q,q.output,q.next_out,re-q.avail_out),ne-=q.avail_in,re-=q.avail_out,q.total_in+=ne,q.total_out+=re,F.total+=re,F.wrap&4&&re&&(q.adler=F.check=F.flags?crc32_1(F.check,D,re,q.next_out-re):adler32_1(F.check,D,re,q.next_out-re)),q.data_type=F.bits+(F.last?64:0)+(F.mode===TYPE?128:0)+(F.mode===LEN_||F.mode===COPY_?256:0),(ne===0&&re===0||K===Z_FINISH$1)&&ke===Z_OK$1&&(ke=Z_BUF_ERROR),ke},inflateEnd=q=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;let K=q.state;return K.window&&(K.window=null),q.state=null,Z_OK$1},inflateGetHeader=(q,K)=>{if(inflateStateCheck(q))return Z_STREAM_ERROR$1;const F=q.state;return(F.wrap&2)===0?Z_STREAM_ERROR$1:(F.head=K,K.done=!1,Z_OK$1)},inflateSetDictionary=(q,K)=>{const F=K.length;let Z,D,N;return inflateStateCheck(q)||(Z=q.state,Z.wrap!==0&&Z.mode!==DICT)?Z_STREAM_ERROR$1:Z.mode===DICT&&(D=1,D=adler32_1(D,K,F,0),D!==Z.check)?Z_DATA_ERROR$1:(N=updatewindow(q,K,F,F),N?(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(q){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},q||{});const K=this.options;K.raw&&K.windowBits>=0&&K.windowBits<16&&(K.windowBits=-K.windowBits,K.windowBits===0&&(K.windowBits=-15)),K.windowBits>=0&&K.windowBits<16&&!(q&&q.windowBits)&&(K.windowBits+=32),K.windowBits>15&&K.windowBits<48&&(K.windowBits&15)===0&&(K.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let F=inflate_1$2.inflateInit2(this.strm,K.windowBits);if(F!==Z_OK)throw new Error(messages[F]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),K.dictionary&&(typeof K.dictionary=="string"?K.dictionary=strings.string2buf(K.dictionary):toString.call(K.dictionary)==="[object ArrayBuffer]"&&(K.dictionary=new Uint8Array(K.dictionary)),K.raw&&(F=inflate_1$2.inflateSetDictionary(this.strm,K.dictionary),F!==Z_OK)))throw new Error(messages[F])}Inflate$1.prototype.push=function(q,K){const F=this.strm,Z=this.options.chunkSize,D=this.options.dictionary;let N,O,I;if(this.ended)return!1;for(K===~~K?O=K:O=K===!0?Z_FINISH:Z_NO_FLUSH,toString.call(q)==="[object ArrayBuffer]"?F.input=new Uint8Array(q):F.input=q,F.next_in=0,F.avail_in=F.input.length;;){for(F.avail_out===0&&(F.output=new Uint8Array(Z),F.next_out=0,F.avail_out=Z),N=inflate_1$2.inflate(F,O),N===Z_NEED_DICT&&D&&(N=inflate_1$2.inflateSetDictionary(F,D),N===Z_OK?N=inflate_1$2.inflate(F,O):N===Z_DATA_ERROR&&(N=Z_NEED_DICT));F.avail_in>0&&N===Z_STREAM_END&&F.state.wrap>0&&q[F.next_in]!==0;)inflate_1$2.inflateReset(F),N=inflate_1$2.inflate(F,O);switch(N){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(N),this.ended=!0,!1}if(I=F.avail_out,F.next_out&&(F.avail_out===0||N===Z_STREAM_END))if(this.options.to==="string"){let z=strings.utf8border(F.output,F.next_out),J=F.next_out-z,Q=strings.buf2string(F.output,z);F.next_out=J,F.avail_out=Z-J,J&&F.output.set(F.output.subarray(z,z+J),0),this.onData(Q)}else this.onData(F.output.length===F.next_out?F.output:F.output.subarray(0,F.next_out));if(!(N===Z_OK&&I===0)){if(N===Z_STREAM_END)return N=inflate_1$2.inflateEnd(this.strm),this.onEnd(N),this.ended=!0,!0;if(F.avail_in===0)break}}return!0},Inflate$1.prototype.onData=function(q){this.chunks.push(q)},Inflate$1.prototype.onEnd=function(q){q===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=q,this.msg=this.strm.msg};function inflate$1(q,K){const F=new Inflate$1(K);if(F.push(q),F.err)throw F.msg||messages[F.err];return F.result}function inflateRaw$1(q,K){return K=K||{},K.raw=!0,inflate$1(q,K)}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=q=>{const K=new Uint8Array(q),F=pako.deflate(K,{gzip:!0});return new Uint8Array(F==null?void 0:F.buffer)},decompressArrayBuffer=q=>{const K=new Uint8Array(q),F=pako.inflate(K,{gzip:!0});return new Uint8Array(F==null?void 0:F.buffer)},sendMessageFormat=q=>{const{event:K}=q;switch(q.data_original=q.data,q.time&&(q.timeStr=E$1(q.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),K){case"login":q.data=com.quick.voice.proto.Login.encode(q.data).finish();break;case"joinRoom":case"joinRoomEx":q.data=com.quick.voice.proto.JoinReq.encode(q.data).finish();break;case"quitRoom":q.data=com.quick.voice.proto.QuitReq.encode(q.data).finish();break;case"connectCF":q.data=com.quick.voice.proto.ConnectCFReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"publish":q.data=com.quick.voice.proto.PublishReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"pubChannel":q.data=com.quick.voice.proto.ChannelPublishReq.encode(q.data).finish();break;case"subscribe":q.data=com.quick.voice.proto.SubscribeReq.encode(q.data).finish();break;case"subChannel":q.data=com.quick.voice.proto.ChannelSubscribeRsq.encode(q.data).finish();break;case"closeTrack":q.data=com.quick.voice.proto.CloseTrackReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"renegotiate":q.data=com.quick.voice.proto.RenegotiateReq.encode(q.data).finish(),q.data=compressArrayBuffer(q.data),q.compress=!0;break;case"syncRoomInfo":q.data=com.quick.voice.proto.SyncRoomInfoReq.encode(q.data).finish();break;case"updateCall":q.data=com.quick.voice.proto.UpdateCall.encode(q.data).finish();break;case"networkQualityChange":q.data=com.quick.voice.proto.NetQualityChange.encode(q.data).finish();break;case"pubNotify":q.data=com.quick.voice.proto.PublishNotify.encode(q.data).finish();break;case"onDataChannelPublish":break;case"preventUsersBehavior":q.data=com.quick.voice.proto.PreventUsersBehaviorReq.encode(q.data).finish();break;default:q.data=new Uint8Array;break}return q},onMessageFormat=q=>{const{event:K,compress:F=!1}=q;if(q.data_remote=q.data,q.time&&(q.timeStr=E$1(q.time,"YYYY-MM-DD hh:mm:ss",{offset:480})),F)try{q.data=decompressArrayBuffer(q.data)}catch(Z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:消息解压错误",Z)}switch(K){case"login":q.data=com.quick.voice.proto.Login.decode(q.data);break;case"joinRoom":case"joinRoomEx":q.data=com.quick.voice.proto.JoinRsp.decode(q.data);break;case"onJoinRoom":q.data=com.quick.voice.proto.JoinNotify.decode(q.data);break;case"onQuitRoom":q.data=com.quick.voice.proto.QuitNotify.decode(q.data);break;case"connectCF":q.data=com.quick.voice.proto.ConnectCFRsp.decode(q.data);break;case"publish":q.data=com.quick.voice.proto.PublishRsp.decode(q.data);break;case"pubChannel":q.data=com.quick.voice.proto.ChannelPublishRsq.decode(q.data);break;case"onPublish":q.data=com.quick.voice.proto.PublishNotify.decode(q.data);break;case"subscribe":q.data=com.quick.voice.proto.SubscribeRsp.decode(q.data);break;case"subChannel":q.data=com.quick.voice.proto.ChannelSubscribeRsq.decode(q.data);break;case"closeTrack":q.data=com.quick.voice.proto.CloseTrackRsp.decode(q.data);break;case"onCloseTrack":q.data=com.quick.voice.proto.CloseTrackNotify.decode(q.data);break;case"onUpdateCall":q.data=com.quick.voice.proto.UpdateCall.decode(q.data);break;case"onDataChannelPublish":q.data=com.quick.voice.proto.UserChannel.decode(q.data);break;case"onDestroyRoom":q.data=com.quick.voice.proto.QuitNotify.decode(q.data);break;case"onUpdatePermissions":q.data=com.quick.voice.proto.UpdatePermissions.decode(q.data);break;case"onNetQuality":q.data=com.quick.voice.proto.NetQualityNotify.decode(q.data);break;case"syncRoomInfo":q.data=com.quick.voice.proto.SyncRoomInfoRsp.decode(q.data);break;case"onCDNPlayUrlAdd":q.data=com.quick.voice.proto.CDNPlayAddressNotify.decode(q.data);break;case"onUpdateBehavior":q.data=com.quick.voice.proto.PreventUsersBehaviorNotify.decode(q.data);break;case"debugger":q.data=JSON.parse(new TextDecoder().decode(q.data));break}return q};class CallsWebSocket{constructor(K){st(this,_t);st(this,yt,{url:"wss://demo.putplay.cc/websocket",debug:!1,reconnectCount:10,timeout:20*1e3});st(this,Pt,"");st(this,Wt,{});st(this,Xt,{});Ie(this,"state","closed");Ie(this,"sendMessageBefore",async()=>{});Ie(this,"onReconnectSuccess",K=>{});Ie(this,"onReconnectStop",K=>{});st(this,Bn,K=>{let F=!0;const{code:Z=1e3}=K;return Z===1e3&&(F=!1),this.state="connecting",F});st(this,Nn,async K=>{Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连成功",K),this.state="connected",this.onReconnectSuccess(K)});st(this,Mn,async K=>{Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 重连停止",K),this.close(),this.state="closed",this.onReconnectStop(K)});st(this,In,(K,F={})=>{try{const{time:Z,event:D,data:N={},data_original:O={},data_remote:I,...z}=F,J=E$1(Z,"YYYY-MM-DD hh:mm:ss",{offset:480});let Q={};const ne=(we={})=>{const fe=JSON.parse(JSON.stringify(we)),ge=Object.keys(fe);for(const me of ge)(me.includes("sdp")||me.includes("Sdp"))&&(fe[me]="");return fe};let re="res ↓";switch(K){case"res":re="res ↓",Q=ne(N);break;case"req":re="req ↑",Q=ne(O);break}let te="#quickvo.logs";ignoreEvent.includes(D)&&(te="#quickvo.ignoreEvents");const oe={"#action":re,timeStr:J,event:D,data:Q,time:Z,...z},le=localStorage.getItem(te)||JSON.stringify([]),ae=JSON.parse(le);let ce=D==="heartbeat";const de=[oe];for(const we of ae){const{event:fe}=we;if(fe==="heartbeat"){if(ce)continue;ce=!0}if(de.length===200)break;de.push(we)}localStorage.setItem(te,JSON.stringify(de))}catch(Z){Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: updataLogs is error",Z)}});st(this,qn,(K,{resolve:F,reject:Z})=>{const{sn:D=""}=K,N=()=>{const I=Be(this,Wt)[D];clearTimeout(I.destructionTimer),delete Be(this,Wt)[D]},O=window.setTimeout(()=>{const I=Be(this,Wt)[D];console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo:event is timeout",I.message),N(),Z("event is timeout")},Be(this,yt).timeout);Be(this,Wt)[D]={message:K,resolve:F,reject:Z,destruction:N,destructionTimer:O}});st(this,Pn,K=>Be(this,Wt)[K]);st(this,Un,async K=>{const F=new Uint8Array(K),Z=com.quick.voice.proto.CommonRsp.decode(F),{sn:D,event:N}=Z,O=onMessageFormat(Z);if(Be(this,yt).debug&&(noLogEvents.includes(N)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff0097;padding:16px 0;","------->quickvo: 响应消息↓",O),ignoreEvent.includes(N)||Be(this,In).call(this,"res",O)),notifyName_keys.includes(N))return this.emitNotify(N,P(O,["code","data","desc"]));const z=Be(this,Pn).call(this,D);if(z){const{resolve:J=ne=>{},destruction:Q=()=>{}}=z;J(P(O,["code","data","desc"])),Q()}});Ie(this,"clearEvents",(K=[])=>{const F=Object.keys(Be(this,Wt));K.length===0&&(K=F);for(const Z of F){if(!K.includes(Z))continue;const D=Be(this,Wt)[Z];if(D){const{destruction:N}=D;N()}}});Ie(this,"connect",async(K="")=>new Promise(async F=>{K&&At(this,Pt,K),Be(this,_t)&&(await Be(this,_t).close(),this.state="closed");const Z=`${Be(this,yt).url}?s=${Be(this,Pt)}&t=${Date.now()}`,D=new Date().getTime();if(At(this,_t,new M({...Be(this,yt),debug:!1,url:Z,binaryType:"arraybuffer",onMessage:Be(this,Un),checkReconnect:Be(this,Bn),getHeartbeatMsg:()=>"",onReconnectSuccess:Be(this,Nn),onReconnectStop:Be(this,Mn)})),this.state="connecting",await Be(this,_t).connect(),this.state="connected",Be(this,yt).debug){const O=new Date().getTime()-D;console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: 连接耗时-${O}ms-广播事件`,Be(this,Xt))}F(Be(this,_t))}));Ie(this,"close",async()=>{var F;Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: cws is close.");const K=Object.keys(Be(this,Wt));for(const Z of K){const{destructionTimer:D}=Be(this,Wt)[Z];clearTimeout(D)}At(this,Wt,{}),await((F=Be(this,_t))==null?void 0:F.close()),At(this,_t,void 0),this.state="closed"});Ie(this,"sendMessage",(K,F=!0)=>new Promise(async(Z,D)=>{var Q;await this.sendMessageBefore();const{event:N,...O}=K,I=Date.now(),z=sendMessageFormat({event:N,sn:+`${I}${v$1(1e3,9999)}`,time:I,valid:Be(this,yt).timeout,version:1,compress:!1,...O});Be(this,yt).debug&&(noLogEvents.includes(N)||console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ff9700;padding:16px 0;","------->quickvo: 发送消息↑",z),ignoreEvent.includes(N)||Be(this,In).call(this,"req",z)),F&&Be(this,qn).call(this,z,{resolve:Z,reject:D});const J=com.quick.voice.proto.CommonReq.encode(z).finish();(Q=Be(this,_t))==null||Q.sendMessage(J)}));Ie(this,"emitNotify",async(K,F)=>{const Z=Be(this,Xt)[K]||[];for(const D of Z){const{callback:N=async()=>{}}=D;await N(F)}});Ie(this,"addNotify",(K,F=!1)=>{const{event:Z,sn:D=xt(32)}=K;Be(this,Xt)[Z]||(Be(this,Xt)[Z]=[]);const N=Be(this,Xt)[Z],O=N.findIndex(I=>I.sn===D);return O!==-1&&N.splice(O,1),F?N.unshift(K):N.push(K),D});Ie(this,"removeNotify",(K=[])=>{if(K.length===0)At(this,Xt,{});else{const F=Object.keys(Be(this,Xt));for(const Z of F)Be(this,Xt)[Z]=Be(this,Xt)[Z].filter(D=>!K.includes(D.sn||""))}Be(this,yt).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: 移除广播事件",Be(this,Xt))});At(this,yt,{...Be(this,yt),...K})}}_t=new WeakMap,yt=new WeakMap,Pt=new WeakMap,Wt=new WeakMap,Xt=new WeakMap,Bn=new WeakMap,Nn=new WeakMap,Mn=new WeakMap,In=new WeakMap,qn=new WeakMap,Pn=new WeakMap,Un=new WeakMap;/*! For license information please see pikazLocationModule.js.LICENSE.txt */var e$2={782:function(q){q.exports=(()=>{var K={483:(D,N,O)=>{D.exports=function I(z,J,Q){function ne(oe,le){if(!J[oe]){if(!z[oe]){if(re)return re(oe,!0);var ae=new Error("Cannot find module '"+oe+"'");throw ae.code="MODULE_NOT_FOUND",ae}var ce=J[oe]={exports:{}};z[oe][0].call(ce.exports,function(de){return ne(z[oe][1][de]||de)},ce,ce.exports,I,z,J,Q)}return J[oe].exports}for(var re=void 0,te=0;te<Q.length;te++)ne(Q[te]);return ne}({1:[function(I,z,J){(function(Q){var ne,re,te=Q.MutationObserver||Q.WebKitMutationObserver;if(te){var oe=0,le=new te(we),ae=Q.document.createTextNode("");le.observe(ae,{characterData:!0}),ne=function(){ae.data=oe=++oe%2}}else if(Q.setImmediate||Q.MessageChannel===void 0)ne="document"in Q&&"onreadystatechange"in Q.document.createElement("script")?function(){var fe=Q.document.createElement("script");fe.onreadystatechange=function(){we(),fe.onreadystatechange=null,fe.parentNode.removeChild(fe),fe=null},Q.document.documentElement.appendChild(fe)}:function(){setTimeout(we,0)};else{var ce=new Q.MessageChannel;ce.port1.onmessage=we,ne=function(){ce.port2.postMessage(0)}}var de=[];function we(){var fe,ge;re=!0;for(var me=de.length;me;){for(ge=de,de=[],fe=-1;++fe<me;)ge[fe]();me=de.length}re=!1}z.exports=function(fe){de.push(fe)!==1||re||ne()}}).call(this,O.g!==void 0?O.g:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(I,z,J){var Q=I(1);function ne(){}var re={},te=["REJECTED"],oe=["FULFILLED"],le=["PENDING"];function ae(me){if(typeof me!="function")throw new TypeError("resolver must be a function");this.state=le,this.queue=[],this.outcome=void 0,me!==ne&&fe(this,me)}function ce(me,ve,ke){this.promise=me,typeof ve=="function"&&(this.onFulfilled=ve,this.callFulfilled=this.otherCallFulfilled),typeof ke=="function"&&(this.onRejected=ke,this.callRejected=this.otherCallRejected)}function de(me,ve,ke){Q(function(){var xe;try{xe=ve(ke)}catch(_e){return re.reject(me,_e)}xe===me?re.reject(me,new TypeError("Cannot resolve promise with itself")):re.resolve(me,xe)})}function we(me){var ve=me&&me.then;if(me&&(typeof me=="object"||typeof me=="function")&&typeof ve=="function")return function(){ve.apply(me,arguments)}}function fe(me,ve){var ke=!1;function xe(qe){ke||(ke=!0,re.reject(me,qe))}function _e(qe){ke||(ke=!0,re.resolve(me,qe))}var Te=ge(function(){ve(_e,xe)});Te.status==="error"&&xe(Te.value)}function ge(me,ve){var ke={};try{ke.value=me(ve),ke.status="success"}catch(xe){ke.status="error",ke.value=xe}return ke}z.exports=ae,ae.prototype.catch=function(me){return this.then(null,me)},ae.prototype.then=function(me,ve){if(typeof me!="function"&&this.state===oe||typeof ve!="function"&&this.state===te)return this;var ke=new this.constructor(ne);return this.state!==le?de(ke,this.state===oe?me:ve,this.outcome):this.queue.push(new ce(ke,me,ve)),ke},ce.prototype.callFulfilled=function(me){re.resolve(this.promise,me)},ce.prototype.otherCallFulfilled=function(me){de(this.promise,this.onFulfilled,me)},ce.prototype.callRejected=function(me){re.reject(this.promise,me)},ce.prototype.otherCallRejected=function(me){de(this.promise,this.onRejected,me)},re.resolve=function(me,ve){var ke=ge(we,ve);if(ke.status==="error")return re.reject(me,ke.value);var xe=ke.value;if(xe)fe(me,xe);else{me.state=oe,me.outcome=ve;for(var _e=-1,Te=me.queue.length;++_e<Te;)me.queue[_e].callFulfilled(ve)}return me},re.reject=function(me,ve){me.state=te,me.outcome=ve;for(var ke=-1,xe=me.queue.length;++ke<xe;)me.queue[ke].callRejected(ve);return me},ae.resolve=function(me){return me instanceof this?me:re.resolve(new this(ne),me)},ae.reject=function(me){var ve=new this(ne);return re.reject(ve,me)},ae.all=function(me){var ve=this;if(Object.prototype.toString.call(me)!=="[object Array]")return this.reject(new TypeError("must be an array"));var ke=me.length,xe=!1;if(!ke)return this.resolve([]);for(var _e=new Array(ke),Te=0,qe=-1,Ve=new this(ne);++qe<ke;)We(me[qe],qe);return Ve;function We(Fe,Ot){ve.resolve(Fe).then(function(It){_e[Ot]=It,++Te!==ke||xe||(xe=!0,re.resolve(Ve,_e))},function(It){xe||(xe=!0,re.reject(Ve,It))})}},ae.race=function(me){if(Object.prototype.toString.call(me)!=="[object Array]")return this.reject(new TypeError("must be an array"));var ve,ke=me.length,xe=!1;if(!ke)return this.resolve([]);for(var _e=-1,Te=new this(ne);++_e<ke;)ve=me[_e],this.resolve(ve).then(function(qe){xe||(xe=!0,re.resolve(Te,qe))},function(qe){xe||(xe=!0,re.reject(Te,qe))});return Te}},{1:1}],3:[function(I,z,J){(function(Q){typeof Q.Promise!="function"&&(Q.Promise=I(2))}).call(this,O.g!==void 0?O.g:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(I,z,J){var Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ue){return typeof ue}:function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},ne=function(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}();function re(ue,ye){ue=ue||[],ye=ye||{};try{return new Blob(ue,ye)}catch(Ce){if(Ce.name!=="TypeError")throw Ce;for(var be=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),Re=0;Re<ue.length;Re+=1)be.append(ue[Re]);return be.getBlob(ye.type)}}typeof Promise>"u"&&I(3);var te=Promise;function oe(ue,ye){ye&&ue.then(function(be){ye(null,be)},function(be){ye(be)})}function le(ue,ye,be){typeof ye=="function"&&ue.then(ye),typeof be=="function"&&ue.catch(be)}function ae(ue){return typeof ue!="string"&&(console.warn(ue+" used as a key, but it is not a string."),ue=String(ue)),ue}function ce(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var de="local-forage-detect-blob-support",we=void 0,fe={},ge=Object.prototype.toString,me="readonly",ve="readwrite";function ke(ue){for(var ye=ue.length,be=new ArrayBuffer(ye),Re=new Uint8Array(be),Ce=0;Ce<ye;Ce++)Re[Ce]=ue.charCodeAt(Ce);return be}function xe(ue){return typeof we=="boolean"?te.resolve(we):function(ye){return new te(function(be){var Re=ye.transaction(de,ve),Ce=re([""]);Re.objectStore(de).put(Ce,"key"),Re.onabort=function(Ae){Ae.preventDefault(),Ae.stopPropagation(),be(!1)},Re.oncomplete=function(){var Ae=navigator.userAgent.match(/Chrome\/(\d+)/),Pe=navigator.userAgent.match(/Edge\//);be(Pe||!Ae||parseInt(Ae[1],10)>=43)}}).catch(function(){return!1})}(ue).then(function(ye){return we=ye})}function _e(ue){var ye=fe[ue.name],be={};be.promise=new te(function(Re,Ce){be.resolve=Re,be.reject=Ce}),ye.deferredOperations.push(be),ye.dbReady?ye.dbReady=ye.dbReady.then(function(){return be.promise}):ye.dbReady=be.promise}function Te(ue){var ye=fe[ue.name].deferredOperations.pop();if(ye)return ye.resolve(),ye.promise}function qe(ue,ye){var be=fe[ue.name].deferredOperations.pop();if(be)return be.reject(ye),be.promise}function Ve(ue,ye){return new te(function(be,Re){if(fe[ue.name]=fe[ue.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},ue.db){if(!ye)return be(ue.db);_e(ue),ue.db.close()}var Ce=[ue.name];ye&&Ce.push(ue.version);var Ae=ne.open.apply(ne,Ce);ye&&(Ae.onupgradeneeded=function(Pe){var je=Ae.result;try{je.createObjectStore(ue.storeName),Pe.oldVersion<=1&&je.createObjectStore(de)}catch(Je){if(Je.name!=="ConstraintError")throw Je;console.warn('The database "'+ue.name+'" has been upgraded from version '+Pe.oldVersion+" to version "+Pe.newVersion+', but the storage "'+ue.storeName+'" already exists.')}}),Ae.onerror=function(Pe){Pe.preventDefault(),Re(Ae.error)},Ae.onsuccess=function(){var Pe=Ae.result;Pe.onversionchange=function(je){je.target.close()},be(Pe),Te(ue)}})}function We(ue){return Ve(ue,!1)}function Fe(ue){return Ve(ue,!0)}function Ot(ue,ye){if(!ue.db)return!0;var be=!ue.db.objectStoreNames.contains(ue.storeName),Re=ue.version<ue.db.version,Ce=ue.version>ue.db.version;if(Re&&(ue.version!==ye&&console.warn('The database "'+ue.name+`" can't be downgraded from version `+ue.db.version+" to version "+ue.version+"."),ue.version=ue.db.version),Ce||be){if(be){var Ae=ue.db.version+1;Ae>ue.version&&(ue.version=Ae)}return!0}return!1}function It(ue){return re([ke(atob(ue.data))],{type:ue.type})}function Dt(ue){return ue&&ue.__local_forage_encoded_blob}function zt(ue){var ye=this,be=ye._initReady().then(function(){var Re=fe[ye._dbInfo.name];if(Re&&Re.dbReady)return Re.dbReady});return le(be,ue,ue),be}function Ut(ue,ye,be,Re){Re===void 0&&(Re=1);try{var Ce=ue.db.transaction(ue.storeName,ye);be(null,Ce)}catch(Ae){if(Re>0&&(!ue.db||Ae.name==="InvalidStateError"||Ae.name==="NotFoundError"))return te.resolve().then(function(){if(!ue.db||Ae.name==="NotFoundError"&&!ue.db.objectStoreNames.contains(ue.storeName)&&ue.version<=ue.db.version)return ue.db&&(ue.version=ue.db.version+1),Fe(ue)}).then(function(){return function(Pe){_e(Pe);for(var je=fe[Pe.name],Je=je.forages,He=0;He<Je.length;He++){var Ze=Je[He];Ze._dbInfo.db&&(Ze._dbInfo.db.close(),Ze._dbInfo.db=null)}return Pe.db=null,We(Pe).then(function(Qe){return Pe.db=Qe,Ot(Pe)?Fe(Pe):Qe}).then(function(Qe){Pe.db=je.db=Qe;for(var nt=0;nt<Je.length;nt++)Je[nt]._dbInfo.db=Qe}).catch(function(Qe){throw qe(Pe,Qe),Qe})}(ue).then(function(){Ut(ue,ye,be,Re-1)})}).catch(be);be(Ae)}}var gt={_driver:"asyncStorage",_initStorage:function(ue){var ye=this,be={db:null};if(ue)for(var Re in ue)be[Re]=ue[Re];var Ce=fe[be.name];Ce||(Ce={forages:[],db:null,dbReady:null,deferredOperations:[]},fe[be.name]=Ce),Ce.forages.push(ye),ye._initReady||(ye._initReady=ye.ready,ye.ready=zt);var Ae=[];function Pe(){return te.resolve()}for(var je=0;je<Ce.forages.length;je++){var Je=Ce.forages[je];Je!==ye&&Ae.push(Je._initReady().catch(Pe))}var He=Ce.forages.slice(0);return te.all(Ae).then(function(){return be.db=Ce.db,We(be)}).then(function(Ze){return be.db=Ze,Ot(be,ye._defaultConfig.version)?Fe(be):Ze}).then(function(Ze){be.db=Ce.db=Ze,ye._dbInfo=be;for(var Qe=0;Qe<He.length;Qe++){var nt=He[Qe];nt!==ye&&(nt._dbInfo.db=be.db,nt._dbInfo.version=be.version)}})},_support:function(){try{if(!ne||!ne.open)return!1;var ue=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),ye=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!ue||ye)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(ue,ye){var be=this,Re=new te(function(Ce,Ae){be.ready().then(function(){Ut(be._dbInfo,me,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName).openCursor(),He=1;Je.onsuccess=function(){var Ze=Je.result;if(Ze){var Qe=Ze.value;Dt(Qe)&&(Qe=It(Qe));var nt=ue(Qe,Ze.key,He++);nt!==void 0?Ce(nt):Ze.continue()}else Ce()},Je.onerror=function(){Ae(Je.error)}}catch(Ze){Ae(Ze)}})}).catch(Ae)});return oe(Re,ye),Re},getItem:function(ue,ye){var be=this;ue=ae(ue);var Re=new te(function(Ce,Ae){be.ready().then(function(){Ut(be._dbInfo,me,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName).get(ue);Je.onsuccess=function(){var He=Je.result;He===void 0&&(He=null),Dt(He)&&(He=It(He)),Ce(He)},Je.onerror=function(){Ae(Je.error)}}catch(He){Ae(He)}})}).catch(Ae)});return oe(Re,ye),Re},setItem:function(ue,ye,be){var Re=this;ue=ae(ue);var Ce=new te(function(Ae,Pe){var je;Re.ready().then(function(){return je=Re._dbInfo,ge.call(ye)==="[object Blob]"?xe(je.db).then(function(Je){return Je?ye:(He=ye,new te(function(Ze,Qe){var nt=new FileReader;nt.onerror=Qe,nt.onloadend=function(ft){var bt=btoa(ft.target.result||"");Ze({__local_forage_encoded_blob:!0,data:bt,type:He.type})},nt.readAsBinaryString(He)}));var He}):ye}).then(function(Je){Ut(Re._dbInfo,ve,function(He,Ze){if(He)return Pe(He);try{var Qe=Ze.objectStore(Re._dbInfo.storeName);Je===null&&(Je=void 0);var nt=Qe.put(Je,ue);Ze.oncomplete=function(){Je===void 0&&(Je=null),Ae(Je)},Ze.onabort=Ze.onerror=function(){var ft=nt.error?nt.error:nt.transaction.error;Pe(ft)}}catch(ft){Pe(ft)}})}).catch(Pe)});return oe(Ce,be),Ce},removeItem:function(ue,ye){var be=this;ue=ae(ue);var Re=new te(function(Ce,Ae){be.ready().then(function(){Ut(be._dbInfo,ve,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName).delete(ue);je.oncomplete=function(){Ce()},je.onerror=function(){Ae(Je.error)},je.onabort=function(){var He=Je.error?Je.error:Je.transaction.error;Ae(He)}}catch(He){Ae(He)}})}).catch(Ae)});return oe(Re,ye),Re},clear:function(ue){var ye=this,be=new te(function(Re,Ce){ye.ready().then(function(){Ut(ye._dbInfo,ve,function(Ae,Pe){if(Ae)return Ce(Ae);try{var je=Pe.objectStore(ye._dbInfo.storeName).clear();Pe.oncomplete=function(){Re()},Pe.onabort=Pe.onerror=function(){var Je=je.error?je.error:je.transaction.error;Ce(Je)}}catch(Je){Ce(Je)}})}).catch(Ce)});return oe(be,ue),be},length:function(ue){var ye=this,be=new te(function(Re,Ce){ye.ready().then(function(){Ut(ye._dbInfo,me,function(Ae,Pe){if(Ae)return Ce(Ae);try{var je=Pe.objectStore(ye._dbInfo.storeName).count();je.onsuccess=function(){Re(je.result)},je.onerror=function(){Ce(je.error)}}catch(Je){Ce(Je)}})}).catch(Ce)});return oe(be,ue),be},key:function(ue,ye){var be=this,Re=new te(function(Ce,Ae){ue<0?Ce(null):be.ready().then(function(){Ut(be._dbInfo,me,function(Pe,je){if(Pe)return Ae(Pe);try{var Je=je.objectStore(be._dbInfo.storeName),He=!1,Ze=Je.openKeyCursor();Ze.onsuccess=function(){var Qe=Ze.result;Qe?ue===0||He?Ce(Qe.key):(He=!0,Qe.advance(ue)):Ce(null)},Ze.onerror=function(){Ae(Ze.error)}}catch(Qe){Ae(Qe)}})}).catch(Ae)});return oe(Re,ye),Re},keys:function(ue){var ye=this,be=new te(function(Re,Ce){ye.ready().then(function(){Ut(ye._dbInfo,me,function(Ae,Pe){if(Ae)return Ce(Ae);try{var je=Pe.objectStore(ye._dbInfo.storeName).openKeyCursor(),Je=[];je.onsuccess=function(){var He=je.result;He?(Je.push(He.key),He.continue()):Re(Je)},je.onerror=function(){Ce(je.error)}}catch(He){Ce(He)}})}).catch(Ce)});return oe(be,ue),be},dropInstance:function(ue,ye){ye=ce.apply(this,arguments);var be=this.config();(ue=typeof ue!="function"&&ue||{}).name||(ue.name=ue.name||be.name,ue.storeName=ue.storeName||be.storeName);var Re,Ce=this;if(ue.name){var Ae=ue.name===be.name&&Ce._dbInfo.db?te.resolve(Ce._dbInfo.db):We(ue).then(function(Pe){var je=fe[ue.name],Je=je.forages;je.db=Pe;for(var He=0;He<Je.length;He++)Je[He]._dbInfo.db=Pe;return Pe});Re=ue.storeName?Ae.then(function(Pe){if(Pe.objectStoreNames.contains(ue.storeName)){var je=Pe.version+1;_e(ue);var Je=fe[ue.name],He=Je.forages;Pe.close();for(var Ze=0;Ze<He.length;Ze++){var Qe=He[Ze];Qe._dbInfo.db=null,Qe._dbInfo.version=je}var nt=new te(function(ft,bt){var qt=ne.open(ue.name,je);qt.onerror=function(an){qt.result.close(),bt(an)},qt.onupgradeneeded=function(){qt.result.deleteObjectStore(ue.storeName)},qt.onsuccess=function(){var an=qt.result;an.close(),ft(an)}});return nt.then(function(ft){Je.db=ft;for(var bt=0;bt<He.length;bt++){var qt=He[bt];qt._dbInfo.db=ft,Te(qt._dbInfo)}}).catch(function(ft){throw(qe(ue,ft)||te.resolve()).catch(function(){}),ft})}}):Ae.then(function(Pe){_e(ue);var je=fe[ue.name],Je=je.forages;Pe.close();for(var He=0;He<Je.length;He++)Je[He]._dbInfo.db=null;var Ze=new te(function(Qe,nt){var ft=ne.deleteDatabase(ue.name);ft.onerror=function(){var bt=ft.result;bt&&bt.close(),nt(ft.error)},ft.onblocked=function(){console.warn('dropInstance blocked for database "'+ue.name+'" until all open connections are closed')},ft.onsuccess=function(){var bt=ft.result;bt&&bt.close(),Qe(bt)}});return Ze.then(function(Qe){je.db=Qe;for(var nt=0;nt<Je.length;nt++)Te(Je[nt]._dbInfo)}).catch(function(Qe){throw(qe(ue,Qe)||te.resolve()).catch(function(){}),Qe})})}else Re=te.reject("Invalid arguments");return oe(Re,ye),Re}},it="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zt=/^~~local_forage_type~([^~]+)~/,Rt="__lfsc__:",Ue=Rt.length,ot="arbf",Jt="blob",Nt="si08",rt="ui08",tt="uic8",at="si16",ct="si32",wt="ur16",Bt="ui32",Lt="fl32",Ft="fl64",Kt=Ue+ot.length,Gt=Object.prototype.toString;function dn(ue){var ye,be,Re,Ce,Ae,Pe=.75*ue.length,je=ue.length,Je=0;ue[ue.length-1]==="="&&(Pe--,ue[ue.length-2]==="="&&Pe--);var He=new ArrayBuffer(Pe),Ze=new Uint8Array(He);for(ye=0;ye<je;ye+=4)be=it.indexOf(ue[ye]),Re=it.indexOf(ue[ye+1]),Ce=it.indexOf(ue[ye+2]),Ae=it.indexOf(ue[ye+3]),Ze[Je++]=be<<2|Re>>4,Ze[Je++]=(15&Re)<<4|Ce>>2,Ze[Je++]=(3&Ce)<<6|63&Ae;return He}function nn(ue){var ye,be=new Uint8Array(ue),Re="";for(ye=0;ye<be.length;ye+=3)Re+=it[be[ye]>>2],Re+=it[(3&be[ye])<<4|be[ye+1]>>4],Re+=it[(15&be[ye+1])<<2|be[ye+2]>>6],Re+=it[63&be[ye+2]];return be.length%3==2?Re=Re.substring(0,Re.length-1)+"=":be.length%3==1&&(Re=Re.substring(0,Re.length-2)+"=="),Re}var rn={serialize:function(ue,ye){var be="";if(ue&&(be=Gt.call(ue)),ue&&(be==="[object ArrayBuffer]"||ue.buffer&&Gt.call(ue.buffer)==="[object ArrayBuffer]")){var Re,Ce=Rt;ue instanceof ArrayBuffer?(Re=ue,Ce+=ot):(Re=ue.buffer,be==="[object Int8Array]"?Ce+=Nt:be==="[object Uint8Array]"?Ce+=rt:be==="[object Uint8ClampedArray]"?Ce+=tt:be==="[object Int16Array]"?Ce+=at:be==="[object Uint16Array]"?Ce+=wt:be==="[object Int32Array]"?Ce+=ct:be==="[object Uint32Array]"?Ce+=Bt:be==="[object Float32Array]"?Ce+=Lt:be==="[object Float64Array]"?Ce+=Ft:ye(new Error("Failed to get type for BinaryArray"))),ye(Ce+nn(Re))}else if(be==="[object Blob]"){var Ae=new FileReader;Ae.onload=function(){var Pe="~~local_forage_type~"+ue.type+"~"+nn(this.result);ye("__lfsc__:blob"+Pe)},Ae.readAsArrayBuffer(ue)}else try{ye(JSON.stringify(ue))}catch(Pe){console.error("Couldn't convert value into a JSON string: ",ue),ye(null,Pe)}},deserialize:function(ue){if(ue.substring(0,Ue)!==Rt)return JSON.parse(ue);var ye,be=ue.substring(Kt),Re=ue.substring(Ue,Kt);if(Re===Jt&&Zt.test(be)){var Ce=be.match(Zt);ye=Ce[1],be=be.substring(Ce[0].length)}var Ae=dn(be);switch(Re){case ot:return Ae;case Jt:return re([Ae],{type:ye});case Nt:return new Int8Array(Ae);case rt:return new Uint8Array(Ae);case tt:return new Uint8ClampedArray(Ae);case at:return new Int16Array(Ae);case wt:return new Uint16Array(Ae);case ct:return new Int32Array(Ae);case Bt:return new Uint32Array(Ae);case Lt:return new Float32Array(Ae);case Ft:return new Float64Array(Ae);default:throw new Error("Unkown type: "+Re)}},stringToBuffer:dn,bufferToString:nn};function Vt(ue,ye,be,Re){ue.executeSql("CREATE TABLE IF NOT EXISTS "+ye.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],be,Re)}function Qt(ue,ye,be,Re,Ce,Ae){ue.executeSql(be,Re,Ce,function(Pe,je){je.code===je.SYNTAX_ERR?Pe.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[ye.storeName],function(Je,He){He.rows.length?Ae(Je,je):Vt(Je,ye,function(){Je.executeSql(be,Re,Ce,Ae)},Ae)},Ae):Ae(Pe,je)},Ae)}function gn(ue,ye,be,Re){var Ce=this;ue=ae(ue);var Ae=new te(function(Pe,je){Ce.ready().then(function(){ye===void 0&&(ye=null);var Je=ye,He=Ce._dbInfo;He.serializer.serialize(ye,function(Ze,Qe){Qe?je(Qe):He.db.transaction(function(nt){Qt(nt,He,"INSERT OR REPLACE INTO "+He.storeName+" (key, value) VALUES (?, ?)",[ue,Ze],function(){Pe(Je)},function(ft,bt){je(bt)})},function(nt){if(nt.code===nt.QUOTA_ERR){if(Re>0)return void Pe(gn.apply(Ce,[ue,Je,be,Re-1]));je(nt)}})})}).catch(je)});return oe(Ae,be),Ae}function on(ue){return new te(function(ye,be){ue.transaction(function(Re){Re.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(Ce,Ae){for(var Pe=[],je=0;je<Ae.rows.length;je++)Pe.push(Ae.rows.item(je).name);ye({db:ue,storeNames:Pe})},function(Ce,Ae){be(Ae)})},function(Re){be(Re)})})}var Yt={_driver:"webSQLStorage",_initStorage:function(ue){var ye=this,be={db:null};if(ue)for(var Re in ue)be[Re]=typeof ue[Re]!="string"?ue[Re].toString():ue[Re];var Ce=new te(function(Ae,Pe){try{be.db=openDatabase(be.name,String(be.version),be.description,be.size)}catch(je){return Pe(je)}be.db.transaction(function(je){Vt(je,be,function(){ye._dbInfo=be,Ae()},function(Je,He){Pe(He)})},Pe)});return be.serializer=rn,Ce},_support:typeof openDatabase=="function",iterate:function(ue,ye){var be=this,Re=new te(function(Ce,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"SELECT * FROM "+Pe.storeName,[],function(Je,He){for(var Ze=He.rows,Qe=Ze.length,nt=0;nt<Qe;nt++){var ft=Ze.item(nt),bt=ft.value;if(bt&&(bt=Pe.serializer.deserialize(bt)),(bt=ue(bt,ft.key,nt+1))!==void 0)return void Ce(bt)}Ce()},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Re,ye),Re},getItem:function(ue,ye){var be=this;ue=ae(ue);var Re=new te(function(Ce,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"SELECT * FROM "+Pe.storeName+" WHERE key = ? LIMIT 1",[ue],function(Je,He){var Ze=He.rows.length?He.rows.item(0).value:null;Ze&&(Ze=Pe.serializer.deserialize(Ze)),Ce(Ze)},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Re,ye),Re},setItem:function(ue,ye,be){return gn.apply(this,[ue,ye,be,1])},removeItem:function(ue,ye){var be=this;ue=ae(ue);var Re=new te(function(Ce,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"DELETE FROM "+Pe.storeName+" WHERE key = ?",[ue],function(){Ce()},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Re,ye),Re},clear:function(ue){var ye=this,be=new te(function(Re,Ce){ye.ready().then(function(){var Ae=ye._dbInfo;Ae.db.transaction(function(Pe){Qt(Pe,Ae,"DELETE FROM "+Ae.storeName,[],function(){Re()},function(je,Je){Ce(Je)})})}).catch(Ce)});return oe(be,ue),be},length:function(ue){var ye=this,be=new te(function(Re,Ce){ye.ready().then(function(){var Ae=ye._dbInfo;Ae.db.transaction(function(Pe){Qt(Pe,Ae,"SELECT COUNT(key) as c FROM "+Ae.storeName,[],function(je,Je){var He=Je.rows.item(0).c;Re(He)},function(je,Je){Ce(Je)})})}).catch(Ce)});return oe(be,ue),be},key:function(ue,ye){var be=this,Re=new te(function(Ce,Ae){be.ready().then(function(){var Pe=be._dbInfo;Pe.db.transaction(function(je){Qt(je,Pe,"SELECT key FROM "+Pe.storeName+" WHERE id = ? LIMIT 1",[ue+1],function(Je,He){var Ze=He.rows.length?He.rows.item(0).key:null;Ce(Ze)},function(Je,He){Ae(He)})})}).catch(Ae)});return oe(Re,ye),Re},keys:function(ue){var ye=this,be=new te(function(Re,Ce){ye.ready().then(function(){var Ae=ye._dbInfo;Ae.db.transaction(function(Pe){Qt(Pe,Ae,"SELECT key FROM "+Ae.storeName,[],function(je,Je){for(var He=[],Ze=0;Ze<Je.rows.length;Ze++)He.push(Je.rows.item(Ze).key);Re(He)},function(je,Je){Ce(Je)})})}).catch(Ce)});return oe(be,ue),be},dropInstance:function(ue,ye){ye=ce.apply(this,arguments);var be=this.config();(ue=typeof ue!="function"&&ue||{}).name||(ue.name=ue.name||be.name,ue.storeName=ue.storeName||be.storeName);var Re,Ce=this;return oe(Re=ue.name?new te(function(Ae){var Pe;Pe=ue.name===be.name?Ce._dbInfo.db:openDatabase(ue.name,"","",0),ue.storeName?Ae({db:Pe,storeNames:[ue.storeName]}):Ae(on(Pe))}).then(function(Ae){return new te(function(Pe,je){Ae.db.transaction(function(Je){function He(ft){return new te(function(bt,qt){Je.executeSql("DROP TABLE IF EXISTS "+ft,[],function(){bt()},function(an,wn){qt(wn)})})}for(var Ze=[],Qe=0,nt=Ae.storeNames.length;Qe<nt;Qe++)Ze.push(He(Ae.storeNames[Qe]));te.all(Ze).then(function(){Pe()}).catch(function(ft){je(ft)})},function(Je){je(Je)})})}):te.reject("Invalid arguments"),ye),Re}};function se(ue,ye){var be=ue.name+"/";return ue.storeName!==ye.storeName&&(be+=ue.storeName+"/"),be}var X={_driver:"localStorageWrapper",_initStorage:function(ue){var ye={};if(ue)for(var be in ue)ye[be]=ue[be];return ye.keyPrefix=se(ue,this._defaultConfig),!function(){var Re="_localforage_support_test";try{return localStorage.setItem(Re,!0),localStorage.removeItem(Re),!1}catch{return!0}}()||localStorage.length>0?(this._dbInfo=ye,ye.serializer=rn,te.resolve()):te.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(ue,ye){var be=this,Re=be.ready().then(function(){for(var Ce=be._dbInfo,Ae=Ce.keyPrefix,Pe=Ae.length,je=localStorage.length,Je=1,He=0;He<je;He++){var Ze=localStorage.key(He);if(Ze.indexOf(Ae)===0){var Qe=localStorage.getItem(Ze);if(Qe&&(Qe=Ce.serializer.deserialize(Qe)),(Qe=ue(Qe,Ze.substring(Pe),Je++))!==void 0)return Qe}}});return oe(Re,ye),Re},getItem:function(ue,ye){var be=this;ue=ae(ue);var Re=be.ready().then(function(){var Ce=be._dbInfo,Ae=localStorage.getItem(Ce.keyPrefix+ue);return Ae&&(Ae=Ce.serializer.deserialize(Ae)),Ae});return oe(Re,ye),Re},setItem:function(ue,ye,be){var Re=this;ue=ae(ue);var Ce=Re.ready().then(function(){ye===void 0&&(ye=null);var Ae=ye;return new te(function(Pe,je){var Je=Re._dbInfo;Je.serializer.serialize(ye,function(He,Ze){if(Ze)je(Ze);else try{localStorage.setItem(Je.keyPrefix+ue,He),Pe(Ae)}catch(Qe){Qe.name!=="QuotaExceededError"&&Qe.name!=="NS_ERROR_DOM_QUOTA_REACHED"||je(Qe),je(Qe)}})})});return oe(Ce,be),Ce},removeItem:function(ue,ye){var be=this;ue=ae(ue);var Re=be.ready().then(function(){var Ce=be._dbInfo;localStorage.removeItem(Ce.keyPrefix+ue)});return oe(Re,ye),Re},clear:function(ue){var ye=this,be=ye.ready().then(function(){for(var Re=ye._dbInfo.keyPrefix,Ce=localStorage.length-1;Ce>=0;Ce--){var Ae=localStorage.key(Ce);Ae.indexOf(Re)===0&&localStorage.removeItem(Ae)}});return oe(be,ue),be},length:function(ue){var ye=this.keys().then(function(be){return be.length});return oe(ye,ue),ye},key:function(ue,ye){var be=this,Re=be.ready().then(function(){var Ce,Ae=be._dbInfo;try{Ce=localStorage.key(ue)}catch{Ce=null}return Ce&&(Ce=Ce.substring(Ae.keyPrefix.length)),Ce});return oe(Re,ye),Re},keys:function(ue){var ye=this,be=ye.ready().then(function(){for(var Re=ye._dbInfo,Ce=localStorage.length,Ae=[],Pe=0;Pe<Ce;Pe++){var je=localStorage.key(Pe);je.indexOf(Re.keyPrefix)===0&&Ae.push(je.substring(Re.keyPrefix.length))}return Ae});return oe(be,ue),be},dropInstance:function(ue,ye){if(ye=ce.apply(this,arguments),!(ue=typeof ue!="function"&&ue||{}).name){var be=this.config();ue.name=ue.name||be.name,ue.storeName=ue.storeName||be.storeName}var Re,Ce=this;return Re=ue.name?new te(function(Ae){ue.storeName?Ae(se(ue,Ce._defaultConfig)):Ae(ue.name+"/")}).then(function(Ae){for(var Pe=localStorage.length-1;Pe>=0;Pe--){var je=localStorage.key(Pe);je.indexOf(Ae)===0&&localStorage.removeItem(je)}}):te.reject("Invalid arguments"),oe(Re,ye),Re}},ee=function(ue,ye){for(var be=ue.length,Re=0;Re<be;){if((Ce=ue[Re])===(Ae=ye)||typeof Ce=="number"&&typeof Ae=="number"&&isNaN(Ce)&&isNaN(Ae))return!0;Re++}var Ce,Ae;return!1},pe=Array.isArray||function(ue){return Object.prototype.toString.call(ue)==="[object Array]"},Oe={},De={},Le={INDEXEDDB:gt,WEBSQL:Yt,LOCALSTORAGE:X},ut=[Le.INDEXEDDB._driver,Le.WEBSQL._driver,Le.LOCALSTORAGE._driver],St=["dropInstance"],vt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(St),Ct={description:"",driver:ut.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tt(ue,ye){ue[ye]=function(){var be=arguments;return ue.ready().then(function(){return ue[ye].apply(ue,be)})}}function hn(){for(var ue=1;ue<arguments.length;ue++){var ye=arguments[ue];if(ye)for(var be in ye)ye.hasOwnProperty(be)&&(pe(ye[be])?arguments[0][be]=ye[be].slice():arguments[0][be]=ye[be])}return arguments[0]}var Yn=function(){function ue(ye){for(var be in function(Ae,Pe){if(!(Ae instanceof Pe))throw new TypeError("Cannot call a class as a function")}(this,ue),Le)if(Le.hasOwnProperty(be)){var Re=Le[be],Ce=Re._driver;this[be]=Ce,Oe[Ce]||this.defineDriver(Re)}this._defaultConfig=hn({},Ct),this._config=hn({},this._defaultConfig,ye),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return ue.prototype.config=function(ye){if((ye===void 0?"undefined":Q(ye))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var be in ye){if(be==="storeName"&&(ye[be]=ye[be].replace(/\W/g,"_")),be==="version"&&typeof ye[be]!="number")return new Error("Database version must be a number.");this._config[be]=ye[be]}return!("driver"in ye)||!ye.driver||this.setDriver(this._config.driver)}return typeof ye=="string"?this._config[ye]:this._config},ue.prototype.defineDriver=function(ye,be,Re){var Ce=new te(function(Ae,Pe){try{var je=ye._driver,Je=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!ye._driver)return void Pe(Je);for(var He=vt.concat("_initStorage"),Ze=0,Qe=He.length;Ze<Qe;Ze++){var nt=He[Ze];if((!ee(St,nt)||ye[nt])&&typeof ye[nt]!="function")return void Pe(Je)}(function(){for(var bt=function(Dn){return function(){var Xn=new Error("Method "+Dn+" is not implemented by the current driver"),Mt=te.reject(Xn);return oe(Mt,arguments[arguments.length-1]),Mt}},qt=0,an=St.length;qt<an;qt++){var wn=St[qt];ye[wn]||(ye[wn]=bt(wn))}})();var ft=function(bt){Oe[je]&&console.info("Redefining LocalForage driver: "+je),Oe[je]=ye,De[je]=bt,Ae()};"_support"in ye?ye._support&&typeof ye._support=="function"?ye._support().then(ft,Pe):ft(!!ye._support):ft(!0)}catch(bt){Pe(bt)}});return le(Ce,be,Re),Ce},ue.prototype.driver=function(){return this._driver||null},ue.prototype.getDriver=function(ye,be,Re){var Ce=Oe[ye]?te.resolve(Oe[ye]):te.reject(new Error("Driver not found."));return le(Ce,be,Re),Ce},ue.prototype.getSerializer=function(ye){var be=te.resolve(rn);return le(be,ye),be},ue.prototype.ready=function(ye){var be=this,Re=be._driverSet.then(function(){return be._ready===null&&(be._ready=be._initDriver()),be._ready});return le(Re,ye,ye),Re},ue.prototype.setDriver=function(ye,be,Re){var Ce=this;pe(ye)||(ye=[ye]);var Ae=this._getSupportedDrivers(ye);function Pe(){Ce._config.driver=Ce.driver()}function je(He){return Ce._extend(He),Pe(),Ce._ready=Ce._initStorage(Ce._config),Ce._ready}var Je=this._driverSet!==null?this._driverSet.catch(function(){return te.resolve()}):te.resolve();return this._driverSet=Je.then(function(){var He=Ae[0];return Ce._dbInfo=null,Ce._ready=null,Ce.getDriver(He).then(function(Ze){Ce._driver=Ze._driver,Pe(),Ce._wrapLibraryMethodsWithReady(),Ce._initDriver=function(Qe){return function(){var nt=0;return function ft(){for(;nt<Qe.length;){var bt=Qe[nt];return nt++,Ce._dbInfo=null,Ce._ready=null,Ce.getDriver(bt).then(je).catch(ft)}Pe();var qt=new Error("No available storage method found.");return Ce._driverSet=te.reject(qt),Ce._driverSet}()}}(Ae)})}).catch(function(){Pe();var He=new Error("No available storage method found.");return Ce._driverSet=te.reject(He),Ce._driverSet}),le(this._driverSet,be,Re),this._driverSet},ue.prototype.supports=function(ye){return!!De[ye]},ue.prototype._extend=function(ye){hn(this,ye)},ue.prototype._getSupportedDrivers=function(ye){for(var be=[],Re=0,Ce=ye.length;Re<Ce;Re++){var Ae=ye[Re];this.supports(Ae)&&be.push(Ae)}return be},ue.prototype._wrapLibraryMethodsWithReady=function(){for(var ye=0,be=vt.length;ye<be;ye++)Tt(this,vt[ye])},ue.prototype.createInstance=function(ye){return new ue(ye)},ue}(),Qn=new Yn;z.exports=Qn},{3:3}]},{},[4])(4)},961:(D,N,O)=>{var I,z=function(){var J=String.fromCharCode,Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",re={};function te(le,ae){if(!re[le]){re[le]={};for(var ce=0;ce<le.length;ce++)re[le][le.charAt(ce)]=ce}return re[le][ae]}var oe={compressToBase64:function(le){if(le==null)return"";var ae=oe._compress(le,6,function(ce){return Q.charAt(ce)});switch(ae.length%4){default:case 0:return ae;case 1:return ae+"===";case 2:return ae+"==";case 3:return ae+"="}},decompressFromBase64:function(le){return le==null?"":le==""?null:oe._decompress(le.length,32,function(ae){return te(Q,le.charAt(ae))})},compressToUTF16:function(le){return le==null?"":oe._compress(le,15,function(ae){return J(ae+32)})+" "},decompressFromUTF16:function(le){return le==null?"":le==""?null:oe._decompress(le.length,16384,function(ae){return le.charCodeAt(ae)-32})},compressToUint8Array:function(le){for(var ae=oe.compress(le),ce=new Uint8Array(2*ae.length),de=0,we=ae.length;de<we;de++){var fe=ae.charCodeAt(de);ce[2*de]=fe>>>8,ce[2*de+1]=fe%256}return ce},decompressFromUint8Array:function(le){if(le==null)return oe.decompress(le);for(var ae=new Array(le.length/2),ce=0,de=ae.length;ce<de;ce++)ae[ce]=256*le[2*ce]+le[2*ce+1];var we=[];return ae.forEach(function(fe){we.push(J(fe))}),oe.decompress(we.join(""))},compressToEncodedURIComponent:function(le){return le==null?"":oe._compress(le,6,function(ae){return ne.charAt(ae)})},decompressFromEncodedURIComponent:function(le){return le==null?"":le==""?null:(le=le.replace(/ /g,"+"),oe._decompress(le.length,32,function(ae){return te(ne,le.charAt(ae))}))},compress:function(le){return oe._compress(le,16,function(ae){return J(ae)})},_compress:function(le,ae,ce){if(le==null)return"";var de,we,fe,ge={},me={},ve="",ke="",xe="",_e=2,Te=3,qe=2,Ve=[],We=0,Fe=0;for(fe=0;fe<le.length;fe+=1)if(ve=le.charAt(fe),Object.prototype.hasOwnProperty.call(ge,ve)||(ge[ve]=Te++,me[ve]=!0),ke=xe+ve,Object.prototype.hasOwnProperty.call(ge,ke))xe=ke;else{if(Object.prototype.hasOwnProperty.call(me,xe)){if(xe.charCodeAt(0)<256){for(de=0;de<qe;de++)We<<=1,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++;for(we=xe.charCodeAt(0),de=0;de<8;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}else{for(we=1,de=0;de<qe;de++)We=We<<1|we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we=0;for(we=xe.charCodeAt(0),de=0;de<16;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}--_e==0&&(_e=Math.pow(2,qe),qe++),delete me[xe]}else for(we=ge[xe],de=0;de<qe;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1;--_e==0&&(_e=Math.pow(2,qe),qe++),ge[ke]=Te++,xe=String(ve)}if(xe!==""){if(Object.prototype.hasOwnProperty.call(me,xe)){if(xe.charCodeAt(0)<256){for(de=0;de<qe;de++)We<<=1,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++;for(we=xe.charCodeAt(0),de=0;de<8;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}else{for(we=1,de=0;de<qe;de++)We=We<<1|we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we=0;for(we=xe.charCodeAt(0),de=0;de<16;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1}--_e==0&&(_e=Math.pow(2,qe),qe++),delete me[xe]}else for(we=ge[xe],de=0;de<qe;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1;--_e==0&&(_e=Math.pow(2,qe),qe++)}for(we=2,de=0;de<qe;de++)We=We<<1|1&we,Fe==ae-1?(Fe=0,Ve.push(ce(We)),We=0):Fe++,we>>=1;for(;;){if(We<<=1,Fe==ae-1){Ve.push(ce(We));break}Fe++}return Ve.join("")},decompress:function(le){return le==null?"":le==""?null:oe._decompress(le.length,32768,function(ae){return le.charCodeAt(ae)})},_decompress:function(le,ae,ce){var de,we,fe,ge,me,ve,ke,xe=[],_e=4,Te=4,qe=3,Ve="",We=[],Fe={val:ce(0),position:ae,index:1};for(de=0;de<3;de+=1)xe[de]=de;for(fe=0,me=Math.pow(2,2),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;switch(fe){case 0:for(fe=0,me=Math.pow(2,8),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;ke=J(fe);break;case 1:for(fe=0,me=Math.pow(2,16),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;ke=J(fe);break;case 2:return""}for(xe[3]=ke,we=ke,We.push(ke);;){if(Fe.index>le)return"";for(fe=0,me=Math.pow(2,qe),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;switch(ke=fe){case 0:for(fe=0,me=Math.pow(2,8),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;xe[Te++]=J(fe),ke=Te-1,_e--;break;case 1:for(fe=0,me=Math.pow(2,16),ve=1;ve!=me;)ge=Fe.val&Fe.position,Fe.position>>=1,Fe.position==0&&(Fe.position=ae,Fe.val=ce(Fe.index++)),fe|=(ge>0?1:0)*ve,ve<<=1;xe[Te++]=J(fe),ke=Te-1,_e--;break;case 2:return We.join("")}if(_e==0&&(_e=Math.pow(2,qe),qe++),xe[ke])Ve=xe[ke];else{if(ke!==Te)return null;Ve=we+we.charAt(0)}We.push(Ve),xe[Te++]=we+Ve.charAt(0),we=Ve,--_e==0&&(_e=Math.pow(2,qe),qe++)}}};return oe}();(I=(function(){return z}).call(N,O,N,D))===void 0||(D.exports=I)},895:D=>{D.exports=function(N,O,I,z){var J=N[0],Q=N[1],ne=!1;I===void 0&&(I=0),z===void 0&&(z=O.length);for(var re=(z-I)/2,te=0,oe=re-1;te<re;oe=te++){var le=O[I+2*te+0],ae=O[I+2*te+1],ce=O[I+2*oe+0],de=O[I+2*oe+1];ae>Q!=de>Q&&J<(ce-le)*(Q-ae)/(de-ae)+le&&(ne=!ne)}return ne}},946:(D,N,O)=>{const I=O(909),z=async()=>await I.get({dir:"areaList",file:"index"}),J=({name:oe,list:le})=>{let ae=oe;const ce=le.find(we=>ae.indexOf(we.name)!==-1);if(ce){const we=ce.name.length;return ae=ae.slice(we,oe.length),{id:ce.id,name:ae,children:ce.children}}const de=le.find(we=>ae.indexOf(we.shortName)!==-1);if(de){const we=de.shortName.length;return ae=ae.slice(we,oe.length),{id:de.id,name:ae,children:de.children}}return null},Q=async(oe="",le)=>{let ae=oe;const ce={province:"",city:"",district:""};let de=le;le||(de=await z());const we=J({name:ae,list:de});if(we){ae=we.name,ce.province=we.id;const me=we.children,ve=J({name:ae,list:me});if(ve){ae=ve.name,ce.city=ve.id;const _e=J({name:ae,list:ve.children});return _e&&(ae=_e.name,ce.district=_e.id),ce}const ke=me.reduce((_e,Te)=>Te.children?_e.concat(Te.children):_e,[]),xe=J({name:ae,list:ke});return xe&&(ae=xe.name,ce.district=xe.id),ce}const fe=de.reduce((me,ve)=>ve.children?me.concat(ve.children):me,[]),ge=J({name:ae,list:fe});if(ge){ae=ge.name,ce.city=ge.id;const me=J({name:ae,list:ge.children});me&&(ae=me.name,ce.district=me.id)}return ce},ne=async(oe={})=>{let{code:le}={...oe};le=typeof le=="string"?le:le.toString();const ae={province:"",provinceCode:"",city:"",cityCode:"",district:"",districtCode:"",code:le,address:""};if((await z()).every(ce=>ce.id===le?(ae.province=ce.name,ae.provinceCode=ce.id,!1):!ce.children||ce.children.every(de=>de.id===le?(ae.province=ce.name,ae.provinceCode=ce.id,ae.city=de.name,ae.cityCode=de.id,!1):!de.children||de.children.every(we=>we.id!==le||(ae.province=ce.name,ae.provinceCode=ce.id,ae.city=de.name,ae.cityCode=de.id,ae.district=we.name,ae.districtCode=we.id,!1)))))throw new Error("未找到该地区");return ae.address=ae.province+ae.city+ae.district,ae},re=async({provinceCode:oe,cityCode:le,districtCode:ae})=>{const ce={province:{},city:{},district:{}};if(oe){const de=await I.get({dir:"province",file:oe});ce.province={code:de.id,location:de.location,name:de.name,pinyin:de.pinyin}}if(le){const de=(await I.get({dir:"city",file:oe})).find(we=>we.id===le);ce.city={code:de.id,location:de.location,name:de.name,pinyin:de.pinyin}}if(ae){const de=(await I.get({dir:"district",file:le})).find(we=>we.id===ae);ce.district={code:de.id,location:de.location,name:de.name,pinyin:de.pinyin}}return ce},te=async(oe,le)=>{let ae=le;if(ae||(ae=await z()),!oe)return ae.map(ce=>({code:ce.id,name:ce.name}));for(let ce=0;ce<ae.length;ce++){const de=ae[ce];if(de.id===oe&&de.children)return de.children.map(we=>({code:we.id,name:we.name}));if(de.children){const we=await te(oe,de.children);if(we)return we}}};D.exports={getList:te,searchCodeInfo:async({code:oe,detail:le})=>{const{province:ae,city:ce,district:de,address:we,provinceCode:fe,cityCode:ge,districtCode:me}=await ne({code:oe}),ve={province:ae,city:ce,district:de,address:we,code:oe};if(le){const ke=await re({provinceCode:fe,cityCode:ge,districtCode:me});ve.detail=ke}return ve},searchStrAddress:async oe=>{const{province:le,city:ae,district:ce}=await Q(oe);return ce||ae||le||null},analysisAddress:Q,searchCodeDetailInfo:async({code:oe})=>{const{provinceCode:le,cityCode:ae,districtCode:ce}=await ne({code:oe}),de=await re({provinceCode:le,cityCode:ae,districtCode:ce});return Object.keys(de.district).length?de.district:Object.keys(de.city).length?de.city:Object.keys(de.province).length?de.province:void 0}}},182:D=>{D.exports=new class{constructor(){this.config={timeout:1e4,enableHighAccuracy:!1,detail:!1},this.cdn=["https://npm.onmicrosoft.cn/@pikaz/location/lib","https://unpkg.com/@pikaz/location/lib"],this.userCdn=""}set(N){this.config={...this.config,...N},this.config.url&&(this.userCdn=this.config.url)}}},955:(D,N,O)=>{const I=O(909),z=O(895),J=O(182),Q=({latitude:ne,longitude:re,address:te})=>te.find(oe=>oe.polygon.find(le=>{if(z([re,ne],le))return le}));D.exports={getGeo:(ne={})=>{const{enableHighAccuracy:re,timeout:te}={...J.config,...ne};return new Promise((oe,le)=>{if(navigator.geolocation){const ae=navigator.geolocation.watchPosition(ce=>{const{latitude:de,longitude:we}=ce.coords;navigator.geolocation.clearWatch(ae),oe({latitude:de,longitude:we})},ce=>{switch(navigator.geolocation.clearWatch(ae),ce.code){case ce.PERMISSION_DENIED:le(new Error("html5已拒绝定位"));break;case ce.POSITION_UNAVAILABLE:le(new Error("html5位置信息不可用"));break;case ce.TIMEOUT:le(new Error("定位超时"));break;case ce.UNKNOWN_ERROR:le(new Error("html5定位未知错误"))}},{enableHighAccuracy:re,timeout:te,maximumAge:0})}else le(new Error("浏览器不支持HTML5定位"))})},getGeoCode:async({latitude:ne,longitude:re})=>{try{let te="";const oe=(await I.get({dir:"province",file:"short"})).filter(ae=>Q({latitude:ne,longitude:re,address:[ae]}));let le="";for(let ae=0;ae<oe.length;ae++){const{id:ce}=oe[ae],de=await I.get({dir:"province",file:ce}),we=Q({latitude:ne,longitude:re,address:[de]});we&&(le=we)}if(le){te=le.id;const ae=await I.get({dir:"city",file:le.id}),ce=Q({latitude:ne,longitude:re,address:ae});if(ce){te=ce.id;const de=await I.get({dir:"district",file:ce.id}),we=Q({latitude:ne,longitude:re,address:de});we&&(te=we.id)}}if(!te)throw new Error("非中国境内");return te}catch(te){throw te}}}},909:(D,N,O)=>{const I=O(218),{decompressFromEncodedURIComponent:z}=O(961),J=O(483),Q=O(182),{version:ne,fileDate:re}=O(147);D.exports=new class{constructor(){this.local=null,this.localConfig={name:"pikazLocation",storeName:"v"+ne.split(".")[0]+"."+ne.split(".")[1]}}async get({dir:te,file:oe}){if(!this.local){const ce=J.createInstance(this.localConfig);await ce.ready(),this.local=ce}const le=`${te}-${oe}-${re[te]}`,ae=await this.local.getItem(le);if(ae)return ae;try{const ce=await(async({file:de})=>{const we=I.CancelToken;let fe;const ge=async(me,ve)=>{const ke=await I({url:`${me}/static/${ve}.json`,method:"get",dataType:"json",cancelToken:new we(function(_e){fe=_e}),timeout:Q.timeout});if(!ke||!ke.data||Object.prototype.toString.call(ke.data.s)!="[object String]")throw new Error("未获取到文件");const xe=z(ke.data.s);return JSON.parse(xe)};try{const me=Q.userCdn;if(me)return await ge(me,de);throw new Error("未找到设置的url")}catch{const ve=Q.cdn.map(ke=>new Promise(xe=>{ge(ke,de).then(_e=>{xe(_e)}).catch(()=>{})}));try{return await Promise.race(ve)}catch{throw new Error("定位失败")}finally{fe()}}})({file:`${te}/${oe}`});return this.local.setItem(le,ce),ce}catch{throw new Error("定位失败")}}async getVal({key:te,gainVal:oe,expiration:le}){if(!this.local){const ge=J.createInstance(this.localConfig);await ge.ready(),this.local=ge}const ae=new Date().getTime(),ce=le||0,de=`local-${te}`,we=await this.local.getItem(de);if(we&&we.expiration>ae)return we.val;const fe=await oe();return await this.local.setItem(de,{val:fe,expiration:ae+ce}),fe}async clear(){await this.local.clear()}}},138:(D,N,O)=>{const I=O(182),{getGeo:z,getGeoCode:J}=O(955),{getList:Q,searchCodeInfo:ne,searchStrAddress:re,searchCodeDetailInfo:te}=O(946),{getIpCode:oe}=O(454),le=async(fe,ge={})=>{let{timeout:me}={...I.config,...ge};return await Promise.race([fe(ge),new Promise((ve,ke)=>{setTimeout(()=>{ke(new Error("定位超时"))},me)})])},ae=async(fe={})=>{let{timeout:ge,enableHighAccuracy:me,detail:ve,latitude:ke,longitude:xe}={...I.config,...fe};if(!ke||!xe){const{latitude:_e,longitude:Te}=await z({timeout:ge,enableHighAccuracy:me});ke=_e,xe=Te}return await le(async()=>{const _e=await J({latitude:ke,longitude:xe});if(!_e)throw new Error("非中国境内");return{...await ne({code:_e,detail:ve}),latitude:ke,longitude:xe}},{timeout:ge})},ce=async(fe={})=>{let{detail:ge,ip:me}={...I.config,...fe};const{code:ve,ip:ke}=await oe({ip:me});return me||(me=ke),{...await ne({code:ve,detail:ge}),ip:me}},de=async(fe={})=>{const{address:ge,detail:me}={...I.config,...fe},ve=await re(ge);if(!ve)throw new Error("解析地址失败,请确认地址包含省级或市级名称");return await ne({code:ve,detail:me})},we=async(fe={})=>{const{code:ge,detail:me}={...I.config,...fe};return await ne({code:ge,detail:me})};D.exports={setConfig:({timeout:fe,url:ge})=>{I.set({timeout:fe,url:ge})},getLocation:async(fe={})=>{try{return{...await ae(fe),type:"h5"}}catch{return{...await le(ce,fe),type:"ip"}}},getH5Location:ae,getIpLocation:fe=>le(ce,fe),searchList:async(fe={})=>{const{code:ge}={...fe};return await Q(ge||"")||[]},searchCodeAddress:fe=>le(we,fe),searchAddress:fe=>le(de,fe),searchCodeDetail:fe=>le(te,fe)}},454:(D,N,O)=>{const{decompressFromEncodedURIComponent:I}=O(961),z=O(909),J=ne=>{const re=ne.split(".").reduce((te,oe)=>`${te}${(le=>{const ae=le.split("").reverse();return new Array(3).fill(0).map((ce,de)=>ae[de]||0).reverse().join("")})(oe)}`,"");return Number(re)},Q=()=>new Promise((ne,re)=>{const te="ipCallback"+new Date().getTime(),oe=document.createElement("script");oe.onerror=()=>{re(new Error("获取ip失败"))},window[te]=le=>{le&&le.ip?ne(le.ip):re(new Error("ip定位失败"))},oe.src=I("BYFxAcGcC4HpYIbgJYDpkoGYE9UHsAnAc1gH5NCBbBEAXgCtI8A7cAMjYGMEAbHgIwScA1rSA")+te,document.body.appendChild(oe)});D.exports={addZero:J,getIpCode:async(ne={})=>{let{ip:re}={...ne};re||(re=await z.getVal({key:"ip",gainVal:Q,expiration:864e5}));const te=re.split(".").map(oe=>Number(oe)||0);if(te.length!==4)throw new Error("ip格式错误,只支持ipv4");return{code:(await z.get({dir:"ip",file:`${te[0]}.${te[1]}`})).reduce((oe,le)=>{const{district:ae,id:ce}=le,de=J(re);return de>=ae[0]&&de<=ae[1]?ce:oe},""),ip:re}}}},218:(D,N,O)=>{function I(ie,he){return function(){return ie.apply(he,arguments)}}const{toString:z}=Object.prototype,{getPrototypeOf:J}=Object,Q=(ne=Object.create(null),ie=>{const he=z.call(ie);return ne[he]||(ne[he]=he.slice(8,-1).toLowerCase())});var ne;const re=ie=>(ie=ie.toLowerCase(),he=>Q(he)===ie),te=ie=>he=>typeof he===ie,{isArray:oe}=Array,le=te("undefined"),ae=re("ArrayBuffer"),ce=te("string"),de=te("function"),we=te("number"),fe=ie=>ie!==null&&typeof ie=="object",ge=ie=>{if(Q(ie)!=="object")return!1;const he=J(ie);return!(he!==null&&he!==Object.prototype&&Object.getPrototypeOf(he)!==null||Symbol.toStringTag in ie||Symbol.iterator in ie)},me=re("Date"),ve=re("File"),ke=re("Blob"),xe=re("FileList"),_e=re("URLSearchParams");function Te(ie,he,{allOwnKeys:Se=!1}={}){if(ie==null)return;let Ee,$e;if(typeof ie!="object"&&(ie=[ie]),oe(ie))for(Ee=0,$e=ie.length;Ee<$e;Ee++)he.call(null,ie[Ee],Ee,ie);else{const Me=Se?Object.getOwnPropertyNames(ie):Object.keys(ie),Ne=Me.length;let Ge;for(Ee=0;Ee<Ne;Ee++)Ge=Me[Ee],he.call(null,ie[Ge],Ge,ie)}}function qe(ie,he){he=he.toLowerCase();const Se=Object.keys(ie);let Ee,$e=Se.length;for(;$e-- >0;)if(Ee=Se[$e],he===Ee.toLowerCase())return Ee;return null}const Ve=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:O.g,We=ie=>!le(ie)&&ie!==Ve,Fe=(Ot=typeof Uint8Array<"u"&&J(Uint8Array),ie=>Ot&&ie instanceof Ot);var Ot;const It=re("HTMLFormElement"),Dt=(({hasOwnProperty:ie})=>(he,Se)=>ie.call(he,Se))(Object.prototype),zt=re("RegExp"),Ut=(ie,he)=>{const Se=Object.getOwnPropertyDescriptors(ie),Ee={};Te(Se,($e,Me)=>{let Ne;(Ne=he($e,Me,ie))!==!1&&(Ee[Me]=Ne||$e)}),Object.defineProperties(ie,Ee)},gt="abcdefghijklmnopqrstuvwxyz",it="0123456789",Zt={DIGIT:it,ALPHA:gt,ALPHA_DIGIT:gt+gt.toUpperCase()+it},Rt=re("AsyncFunction");var Ue={isArray:oe,isArrayBuffer:ae,isBuffer:function(ie){return ie!==null&&!le(ie)&&ie.constructor!==null&&!le(ie.constructor)&&de(ie.constructor.isBuffer)&&ie.constructor.isBuffer(ie)},isFormData:ie=>{let he;return ie&&(typeof FormData=="function"&&ie instanceof FormData||de(ie.append)&&((he=Q(ie))==="formdata"||he==="object"&&de(ie.toString)&&ie.toString()==="[object FormData]"))},isArrayBufferView:function(ie){let he;return he=typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(ie):ie&&ie.buffer&&ae(ie.buffer),he},isString:ce,isNumber:we,isBoolean:ie=>ie===!0||ie===!1,isObject:fe,isPlainObject:ge,isUndefined:le,isDate:me,isFile:ve,isBlob:ke,isRegExp:zt,isFunction:de,isStream:ie=>fe(ie)&&de(ie.pipe),isURLSearchParams:_e,isTypedArray:Fe,isFileList:xe,forEach:Te,merge:function ie(){const{caseless:he}=We(this)&&this||{},Se={},Ee=($e,Me)=>{const Ne=he&&qe(Se,Me)||Me;ge(Se[Ne])&&ge($e)?Se[Ne]=ie(Se[Ne],$e):ge($e)?Se[Ne]=ie({},$e):oe($e)?Se[Ne]=$e.slice():Se[Ne]=$e};for(let $e=0,Me=arguments.length;$e<Me;$e++)arguments[$e]&&Te(arguments[$e],Ee);return Se},extend:(ie,he,Se,{allOwnKeys:Ee}={})=>(Te(he,($e,Me)=>{Se&&de($e)?ie[Me]=I($e,Se):ie[Me]=$e},{allOwnKeys:Ee}),ie),trim:ie=>ie.trim?ie.trim():ie.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:ie=>(ie.charCodeAt(0)===65279&&(ie=ie.slice(1)),ie),inherits:(ie,he,Se,Ee)=>{ie.prototype=Object.create(he.prototype,Ee),ie.prototype.constructor=ie,Object.defineProperty(ie,"super",{value:he.prototype}),Se&&Object.assign(ie.prototype,Se)},toFlatObject:(ie,he,Se,Ee)=>{let $e,Me,Ne;const Ge={};if(he=he||{},ie==null)return he;do{for($e=Object.getOwnPropertyNames(ie),Me=$e.length;Me-- >0;)Ne=$e[Me],Ee&&!Ee(Ne,ie,he)||Ge[Ne]||(he[Ne]=ie[Ne],Ge[Ne]=!0);ie=Se!==!1&&J(ie)}while(ie&&(!Se||Se(ie,he))&&ie!==Object.prototype);return he},kindOf:Q,kindOfTest:re,endsWith:(ie,he,Se)=>{ie=String(ie),(Se===void 0||Se>ie.length)&&(Se=ie.length),Se-=he.length;const Ee=ie.indexOf(he,Se);return Ee!==-1&&Ee===Se},toArray:ie=>{if(!ie)return null;if(oe(ie))return ie;let he=ie.length;if(!we(he))return null;const Se=new Array(he);for(;he-- >0;)Se[he]=ie[he];return Se},forEachEntry:(ie,he)=>{const Se=(ie&&ie[Symbol.iterator]).call(ie);let Ee;for(;(Ee=Se.next())&&!Ee.done;){const $e=Ee.value;he.call(ie,$e[0],$e[1])}},matchAll:(ie,he)=>{let Se;const Ee=[];for(;(Se=ie.exec(he))!==null;)Ee.push(Se);return Ee},isHTMLForm:It,hasOwnProperty:Dt,hasOwnProp:Dt,reduceDescriptors:Ut,freezeMethods:ie=>{Ut(ie,(he,Se)=>{if(de(ie)&&["arguments","caller","callee"].indexOf(Se)!==-1)return!1;const Ee=ie[Se];de(Ee)&&(he.enumerable=!1,"writable"in he?he.writable=!1:he.set||(he.set=()=>{throw Error("Can not rewrite read-only method '"+Se+"'")}))})},toObjectSet:(ie,he)=>{const Se={},Ee=$e=>{$e.forEach(Me=>{Se[Me]=!0})};return oe(ie)?Ee(ie):Ee(String(ie).split(he)),Se},toCamelCase:ie=>ie.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(he,Se,Ee){return Se.toUpperCase()+Ee}),noop:()=>{},toFiniteNumber:(ie,he)=>(ie=+ie,Number.isFinite(ie)?ie:he),findKey:qe,global:Ve,isContextDefined:We,ALPHABET:Zt,generateString:(ie=16,he=Zt.ALPHA_DIGIT)=>{let Se="";const{length:Ee}=he;for(;ie--;)Se+=he[Math.random()*Ee|0];return Se},isSpecCompliantForm:function(ie){return!!(ie&&de(ie.append)&&ie[Symbol.toStringTag]==="FormData"&&ie[Symbol.iterator])},toJSONObject:ie=>{const he=new Array(10),Se=(Ee,$e)=>{if(fe(Ee)){if(he.indexOf(Ee)>=0)return;if(!("toJSON"in Ee)){he[$e]=Ee;const Me=oe(Ee)?[]:{};return Te(Ee,(Ne,Ge)=>{const Ye=Se(Ne,$e+1);!le(Ye)&&(Me[Ge]=Ye)}),he[$e]=void 0,Me}}return Ee};return Se(ie,0)},isAsyncFn:Rt,isThenable:ie=>ie&&(fe(ie)||de(ie))&&de(ie.then)&&de(ie.catch)};function ot(ie,he,Se,Ee,$e){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=ie,this.name="AxiosError",he&&(this.code=he),Se&&(this.config=Se),Ee&&(this.request=Ee),$e&&(this.response=$e)}Ue.inherits(ot,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ue.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Jt=ot.prototype,Nt={};function rt(ie){return Ue.isPlainObject(ie)||Ue.isArray(ie)}function tt(ie){return Ue.endsWith(ie,"[]")?ie.slice(0,-2):ie}function at(ie,he,Se){return ie?ie.concat(he).map(function(Ee,$e){return Ee=tt(Ee),!Se&&$e?"["+Ee+"]":Ee}).join(Se?".":""):he}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(ie=>{Nt[ie]={value:ie}}),Object.defineProperties(ot,Nt),Object.defineProperty(Jt,"isAxiosError",{value:!0}),ot.from=(ie,he,Se,Ee,$e,Me)=>{const Ne=Object.create(Jt);return Ue.toFlatObject(ie,Ne,function(Ge){return Ge!==Error.prototype},Ge=>Ge!=="isAxiosError"),ot.call(Ne,ie.message,he,Se,Ee,$e),Ne.cause=ie,Ne.name=ie.name,Me&&Object.assign(Ne,Me),Ne};const ct=Ue.toFlatObject(Ue,{},null,function(ie){return/^is[A-Z]/.test(ie)});function wt(ie,he,Se){if(!Ue.isObject(ie))throw new TypeError("target must be an object");he=he||new FormData;const Ee=(Se=Ue.toFlatObject(Se,{metaTokens:!0,dots:!1,indexes:!1},!1,function(et,kt){return!Ue.isUndefined(kt[et])})).metaTokens,$e=Se.visitor||Ke,Me=Se.dots,Ne=Se.indexes,Ge=(Se.Blob||typeof Blob<"u"&&Blob)&&Ue.isSpecCompliantForm(he);if(!Ue.isFunction($e))throw new TypeError("visitor must be a function");function Ye(et){if(et===null)return"";if(Ue.isDate(et))return et.toISOString();if(!Ge&&Ue.isBlob(et))throw new ot("Blob is not supported. Use a Buffer instead.");return Ue.isArrayBuffer(et)||Ue.isTypedArray(et)?Ge&&typeof Blob=="function"?new Blob([et]):Buffer.from(et):et}function Ke(et,kt,Xe){let Et=et;if(et&&!Xe&&typeof et=="object"){if(Ue.endsWith(kt,"{}"))kt=Ee?kt:kt.slice(0,-2),et=JSON.stringify(et);else if(Ue.isArray(et)&&function(Ht){return Ue.isArray(Ht)&&!Ht.some(rt)}(et)||(Ue.isFileList(et)||Ue.endsWith(kt,"[]"))&&(Et=Ue.toArray(et)))return kt=tt(kt),Et.forEach(function(Ht,sn){!Ue.isUndefined(Ht)&&Ht!==null&&he.append(Ne===!0?at([kt],sn,Me):Ne===null?kt:kt+"[]",Ye(Ht))}),!1}return!!rt(et)||(he.append(at(Xe,kt,Me),Ye(et)),!1)}const ze=[],mt=Object.assign(ct,{defaultVisitor:Ke,convertValue:Ye,isVisitable:rt});if(!Ue.isObject(ie))throw new TypeError("data must be an object");return function et(kt,Xe){if(!Ue.isUndefined(kt)){if(ze.indexOf(kt)!==-1)throw Error("Circular reference detected in "+Xe.join("."));ze.push(kt),Ue.forEach(kt,function(Et,Ht){(!(Ue.isUndefined(Et)||Et===null)&&$e.call(he,Et,Ue.isString(Ht)?Ht.trim():Ht,Xe,mt))===!0&&et(Et,Xe?Xe.concat(Ht):[Ht])}),ze.pop()}}(ie),he}function Bt(ie){const he={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(ie).replace(/[!'()~]|%20|%00/g,function(Se){return he[Se]})}function Lt(ie,he){this._pairs=[],ie&&wt(ie,this,he)}const Ft=Lt.prototype;function Kt(ie){return encodeURIComponent(ie).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Gt(ie,he,Se){if(!he)return ie;const Ee=Se&&Se.encode||Kt,$e=Se&&Se.serialize;let Me;if(Me=$e?$e(he,Se):Ue.isURLSearchParams(he)?he.toString():new Lt(he,Se).toString(Ee),Me){const Ne=ie.indexOf("#");Ne!==-1&&(ie=ie.slice(0,Ne)),ie+=(ie.indexOf("?")===-1?"?":"&")+Me}return ie}Ft.append=function(ie,he){this._pairs.push([ie,he])},Ft.toString=function(ie){const he=ie?function(Se){return ie.call(this,Se,Bt)}:Bt;return this._pairs.map(function(Se){return he(Se[0])+"="+he(Se[1])},"").join("&")};var dn=class{constructor(){this.handlers=[]}use(ie,he,Se){return this.handlers.push({fulfilled:ie,rejected:he,synchronous:!!Se&&Se.synchronous,runWhen:Se?Se.runWhen:null}),this.handlers.length-1}eject(ie){this.handlers[ie]&&(this.handlers[ie]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(ie){Ue.forEach(this.handlers,function(he){he!==null&&ie(he)})}},nn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},rn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Lt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]};const Vt=typeof window<"u"&&typeof document<"u",Qt=(gn=typeof navigator<"u"&&navigator.product,Vt&&["ReactNative","NativeScript","NS"].indexOf(gn)<0);var gn;const on=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function";var Yt={...Object.freeze({__proto__:null,hasBrowserEnv:Vt,hasStandardBrowserWebWorkerEnv:on,hasStandardBrowserEnv:Qt}),...rn};function se(ie){function he(Se,Ee,$e,Me){let Ne=Se[Me++];const Ge=Number.isFinite(+Ne),Ye=Me>=Se.length;return Ne=!Ne&&Ue.isArray($e)?$e.length:Ne,Ye?(Ue.hasOwnProp($e,Ne)?$e[Ne]=[$e[Ne],Ee]:$e[Ne]=Ee,!Ge):($e[Ne]&&Ue.isObject($e[Ne])||($e[Ne]=[]),he(Se,Ee,$e[Ne],Me)&&Ue.isArray($e[Ne])&&($e[Ne]=function(Ke){const ze={},mt=Object.keys(Ke);let et;const kt=mt.length;let Xe;for(et=0;et<kt;et++)Xe=mt[et],ze[Xe]=Ke[Xe];return ze}($e[Ne])),!Ge)}if(Ue.isFormData(ie)&&Ue.isFunction(ie.entries)){const Se={};return Ue.forEachEntry(ie,(Ee,$e)=>{he(function(Me){return Ue.matchAll(/\w+|\[(\w*)]/g,Me).map(Ne=>Ne[0]==="[]"?"":Ne[1]||Ne[0])}(Ee),$e,Se,0)}),Se}return null}const X={transitional:nn,adapter:["xhr","http"],transformRequest:[function(ie,he){const Se=he.getContentType()||"",Ee=Se.indexOf("application/json")>-1,$e=Ue.isObject(ie);if($e&&Ue.isHTMLForm(ie)&&(ie=new FormData(ie)),Ue.isFormData(ie))return Ee&&Ee?JSON.stringify(se(ie)):ie;if(Ue.isArrayBuffer(ie)||Ue.isBuffer(ie)||Ue.isStream(ie)||Ue.isFile(ie)||Ue.isBlob(ie))return ie;if(Ue.isArrayBufferView(ie))return ie.buffer;if(Ue.isURLSearchParams(ie))return he.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),ie.toString();let Me;if($e){if(Se.indexOf("application/x-www-form-urlencoded")>-1)return function(Ne,Ge){return wt(Ne,new Yt.classes.URLSearchParams,Object.assign({visitor:function(Ye,Ke,ze,mt){return Yt.isNode&&Ue.isBuffer(Ye)?(this.append(Ke,Ye.toString("base64")),!1):mt.defaultVisitor.apply(this,arguments)}},Ge))}(ie,this.formSerializer).toString();if((Me=Ue.isFileList(ie))||Se.indexOf("multipart/form-data")>-1){const Ne=this.env&&this.env.FormData;return wt(Me?{"files[]":ie}:ie,Ne&&new Ne,this.formSerializer)}}return $e||Ee?(he.setContentType("application/json",!1),function(Ne,Ge,Ye){if(Ue.isString(Ne))try{return(0,JSON.parse)(Ne),Ue.trim(Ne)}catch(Ke){if(Ke.name!=="SyntaxError")throw Ke}return(0,JSON.stringify)(Ne)}(ie)):ie}],transformResponse:[function(ie){const he=this.transitional||X.transitional,Se=he&&he.forcedJSONParsing,Ee=this.responseType==="json";if(ie&&Ue.isString(ie)&&(Se&&!this.responseType||Ee)){const $e=!(he&&he.silentJSONParsing)&&Ee;try{return JSON.parse(ie)}catch(Me){if($e)throw Me.name==="SyntaxError"?ot.from(Me,ot.ERR_BAD_RESPONSE,this,null,this.response):Me}}return ie}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yt.classes.FormData,Blob:Yt.classes.Blob},validateStatus:function(ie){return ie>=200&&ie<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ue.forEach(["delete","get","head","post","put","patch"],ie=>{X.headers[ie]={}});var ee=X;const pe=Ue.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Oe=Symbol("internals");function De(ie){return ie&&String(ie).trim().toLowerCase()}function Le(ie){return ie===!1||ie==null?ie:Ue.isArray(ie)?ie.map(Le):String(ie)}function ut(ie,he,Se,Ee,$e){return Ue.isFunction(Ee)?Ee.call(this,he,Se):($e&&(he=Se),Ue.isString(he)?Ue.isString(Ee)?he.indexOf(Ee)!==-1:Ue.isRegExp(Ee)?Ee.test(he):void 0:void 0)}class St{constructor(he){he&&this.set(he)}set(he,Se,Ee){const $e=this;function Me(Ge,Ye,Ke){const ze=De(Ye);if(!ze)throw new Error("header name must be a non-empty string");const mt=Ue.findKey($e,ze);(!mt||$e[mt]===void 0||Ke===!0||Ke===void 0&&$e[mt]!==!1)&&($e[mt||Ye]=Le(Ge))}const Ne=(Ge,Ye)=>Ue.forEach(Ge,(Ke,ze)=>Me(Ke,ze,Ye));return Ue.isPlainObject(he)||he instanceof this.constructor?Ne(he,Se):Ue.isString(he)&&(he=he.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(he.trim())?Ne((Ge=>{const Ye={};let Ke,ze,mt;return Ge&&Ge.split(`
|
|
4
4
|
`).forEach(function(et){mt=et.indexOf(":"),Ke=et.substring(0,mt).trim().toLowerCase(),ze=et.substring(mt+1).trim(),!Ke||Ye[Ke]&&pe[Ke]||(Ke==="set-cookie"?Ye[Ke]?Ye[Ke].push(ze):Ye[Ke]=[ze]:Ye[Ke]=Ye[Ke]?Ye[Ke]+", "+ze:ze)}),Ye})(he),Se):he!=null&&Me(Se,he,Ee),this}get(he,Se){if(he=De(he)){const Ee=Ue.findKey(this,he);if(Ee){const $e=this[Ee];if(!Se)return $e;if(Se===!0)return function(Me){const Ne=Object.create(null),Ge=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let Ye;for(;Ye=Ge.exec(Me);)Ne[Ye[1]]=Ye[2];return Ne}($e);if(Ue.isFunction(Se))return Se.call(this,$e,Ee);if(Ue.isRegExp(Se))return Se.exec($e);throw new TypeError("parser must be boolean|regexp|function")}}}has(he,Se){if(he=De(he)){const Ee=Ue.findKey(this,he);return!(!Ee||this[Ee]===void 0||Se&&!ut(0,this[Ee],Ee,Se))}return!1}delete(he,Se){const Ee=this;let $e=!1;function Me(Ne){if(Ne=De(Ne)){const Ge=Ue.findKey(Ee,Ne);!Ge||Se&&!ut(0,Ee[Ge],Ge,Se)||(delete Ee[Ge],$e=!0)}}return Ue.isArray(he)?he.forEach(Me):Me(he),$e}clear(he){const Se=Object.keys(this);let Ee=Se.length,$e=!1;for(;Ee--;){const Me=Se[Ee];he&&!ut(0,this[Me],Me,he,!0)||(delete this[Me],$e=!0)}return $e}normalize(he){const Se=this,Ee={};return Ue.forEach(this,($e,Me)=>{const Ne=Ue.findKey(Ee,Me);if(Ne)return Se[Ne]=Le($e),void delete Se[Me];const Ge=he?function(Ye){return Ye.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Ke,ze,mt)=>ze.toUpperCase()+mt)}(Me):String(Me).trim();Ge!==Me&&delete Se[Me],Se[Ge]=Le($e),Ee[Ge]=!0}),this}concat(...he){return this.constructor.concat(this,...he)}toJSON(he){const Se=Object.create(null);return Ue.forEach(this,(Ee,$e)=>{Ee!=null&&Ee!==!1&&(Se[$e]=he&&Ue.isArray(Ee)?Ee.join(", "):Ee)}),Se}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([he,Se])=>he+": "+Se).join(`
|
|
5
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(he){return he instanceof this?he:new this(he)}static concat(he,...Se){const Ee=new this(he);return Se.forEach($e=>Ee.set($e)),Ee}static accessor(he){const Se=(this[Oe]=this[Oe]={accessors:{}}).accessors,Ee=this.prototype;function $e(Me){const Ne=De(Me);Se[Ne]||(function(Ge,Ye){const Ke=Ue.toCamelCase(" "+Ye);["get","set","has"].forEach(ze=>{Object.defineProperty(Ge,ze+Ke,{value:function(mt,et,kt){return this[ze].call(this,Ye,mt,et,kt)},configurable:!0})})}(Ee,Me),Se[Ne]=!0)}return Ue.isArray(he)?he.forEach($e):$e(he),this}}St.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ue.reduceDescriptors(St.prototype,({value:ie},he)=>{let Se=he[0].toUpperCase()+he.slice(1);return{get:()=>ie,set(Ee){this[Se]=Ee}}}),Ue.freezeMethods(St);var vt=St;function
|
|
6
|
-
`+Me.map(
|
|
7
|
-
`):" "+Ce(Me[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return Ee};function Pe(ie){if(ie.cancelToken&&ie.cancelToken.throwIfRequested(),ie.signal&&ie.signal.aborted)throw new hn(null,ie)}function je(ie){return Pe(ie),ie.headers=vt.from(ie.headers),ie.data=Rt.call(ie,ie.transformRequest),["post","put","patch"].indexOf(ie.method)!==-1&&ie.headers.setContentType("application/x-www-form-urlencoded",!1),Ae(ie.adapter||ee.adapter)(ie).then(function(he){return Pe(ie),he.data=Rt.call(ie,ie.transformResponse,he),he.headers=vt.from(he.headers),he},function(he){return Tt(he)||(Pe(ie),he&&he.response&&(he.response.data=Rt.call(ie,ie.transformResponse,he.response),he.response.headers=vt.from(he.response.headers))),Promise.reject(he)})}const Je=ie=>ie instanceof vt?ie.toJSON():ie;function He(ie,he){he=he||{};const Se={};function Ee(Ke,ze,mt){return Ue.isPlainObject(Ke)&&Ue.isPlainObject(ze)?Ue.merge.call({caseless:mt},Ke,ze):Ue.isPlainObject(ze)?Ue.merge({},ze):Ue.isArray(ze)?ze.slice():ze}function $e(Ke,ze,mt){return Ue.isUndefined(ze)?Ue.isUndefined(Ke)?void 0:Ee(void 0,Ke,mt):Ee(Ke,ze,mt)}function Me(Ke,ze){if(!Ue.isUndefined(ze))return Ee(void 0,ze)}function Ne(Ke,ze){return Ue.isUndefined(ze)?Ue.isUndefined(Ke)?void 0:Ee(void 0,Ke):Ee(void 0,ze)}function Ge(Ke,ze,mt){return mt in he?Ee(Ke,ze):mt in ie?Ee(void 0,Ke):void 0}const Ye={url:Me,method:Me,data:Me,baseURL:Ne,transformRequest:Ne,transformResponse:Ne,paramsSerializer:Ne,timeout:Ne,timeoutMessage:Ne,withCredentials:Ne,withXSRFToken:Ne,adapter:Ne,responseType:Ne,xsrfCookieName:Ne,xsrfHeaderName:Ne,onUploadProgress:Ne,onDownloadProgress:Ne,decompress:Ne,maxContentLength:Ne,maxBodyLength:Ne,beforeRedirect:Ne,transport:Ne,httpAgent:Ne,httpsAgent:Ne,cancelToken:Ne,socketPath:Ne,responseEncoding:Ne,validateStatus:Ge,headers:(Ke,ze)=>$e(Je(Ke),Je(ze),!0)};return Ue.forEach(Object.keys(Object.assign({},ie,he)),function(Ke){const ze=Ye[Ke]||$e,mt=ze(ie[Ke],he[Ke],Ke);Ue.isUndefined(mt)&&ze!==Ge||(Se[Ke]=mt)}),Se}const Ze={};["object","boolean","number","function","string","symbol"].forEach((ie,he)=>{Ze[ie]=function(Se){return typeof Se===ie||"a"+(he<1?"n ":" ")+ie}});const Qe={};Ze.transitional=function(ie,he,Se){function Ee($e,Me){return"[Axios v1.6.2] Transitional option '"+$e+"'"+Me+(Se?". "+Se:"")}return($e,Me,Ne)=>{if(ie===!1)throw new ot(Ee(Me," has been removed"+(he?" in "+he:"")),ot.ERR_DEPRECATED);return he&&!Qe[Me]&&(Qe[Me]=!0,console.warn(Ee(Me," has been deprecated since v"+he+" and will be removed in the near future"))),!ie||ie($e,Me,Ne)}};var nt={assertOptions:function(ie,he,Se){if(typeof ie!="object")throw new ot("options must be an object",ot.ERR_BAD_OPTION_VALUE);const Ee=Object.keys(ie);let $e=Ee.length;for(;$e-- >0;){const Me=Ee[$e],Ne=he[Me];if(Ne){const Ge=ie[Me],Ye=Ge===void 0||Ne(Ge,Me,ie);if(Ye!==!0)throw new ot("option "+Me+" must be "+Ye,ot.ERR_BAD_OPTION_VALUE)}else if(Se!==!0)throw new ot("Unknown option "+Me,ot.ERR_BAD_OPTION)}},validators:Ze};const ft=nt.validators;class bt{constructor(he){this.defaults=he,this.interceptors={request:new dn,response:new dn}}request(he,Se){typeof he=="string"?(Se=Se||{}).url=he:Se=he||{},Se=He(this.defaults,Se);const{transitional:Ee,paramsSerializer:$e,headers:Me}=Se;Ee!==void 0&&nt.assertOptions(Ee,{silentJSONParsing:ft.transitional(ft.boolean),forcedJSONParsing:ft.transitional(ft.boolean),clarifyTimeoutError:ft.transitional(ft.boolean)},!1),$e!=null&&(Ue.isFunction($e)?Se.paramsSerializer={serialize:$e}:nt.assertOptions($e,{encode:ft.function,serialize:ft.function},!0)),Se.method=(Se.method||this.defaults.method||"get").toLowerCase();let Ne=Me&&Ue.merge(Me.common,Me[Se.method]);Me&&Ue.forEach(["delete","get","head","post","put","patch","common"],Xe=>{delete Me[Xe]}),Se.headers=vt.concat(Ne,Me);const Ge=[];let Ye=!0;this.interceptors.request.forEach(function(Xe){typeof Xe.runWhen=="function"&&Xe.runWhen(Se)===!1||(Ye=Ye&&Xe.synchronous,Ge.unshift(Xe.fulfilled,Xe.rejected))});const Ke=[];let ze;this.interceptors.response.forEach(function(Xe){Ke.push(Xe.fulfilled,Xe.rejected)});let mt,et=0;if(!Ye){const Xe=[je.bind(this),void 0];for(Xe.unshift.apply(Xe,Ge),Xe.push.apply(Xe,Ke),mt=Xe.length,ze=Promise.resolve(Se);et<mt;)ze=ze.then(Xe[et++],Xe[et++]);return ze}mt=Ge.length;let kt=Se;for(et=0;et<mt;){const Xe=Ge[et++],Et=Ge[et++];try{kt=Xe(kt)}catch(Ht){Et.call(this,Ht);break}}try{ze=je.call(this,kt)}catch(Xe){return Promise.reject(Xe)}for(et=0,mt=Ke.length;et<mt;)ze=ze.then(Ke[et++],Ke[et++]);return ze}getUri(he){return Gt(Qn((he=He(this.defaults,he)).baseURL,he.url),he.params,he.paramsSerializer)}}Ue.forEach(["delete","get","head","options"],function(ie){bt.prototype[ie]=function(he,Se){return this.request(He(Se||{},{method:ie,url:he,data:(Se||{}).data}))}}),Ue.forEach(["post","put","patch"],function(ie){function he(Se){return function(Ee,$e,Me){return this.request(He(Me||{},{method:ie,headers:Se?{"Content-Type":"multipart/form-data"}:{},url:Ee,data:$e}))}}bt.prototype[ie]=he(),bt.prototype[ie+"Form"]=he(!0)});var qt=bt;class an{constructor(he){if(typeof he!="function")throw new TypeError("executor must be a function.");let Se;this.promise=new Promise(function($e){Se=$e});const Ee=this;this.promise.then($e=>{if(!Ee._listeners)return;let Me=Ee._listeners.length;for(;Me-- >0;)Ee._listeners[Me]($e);Ee._listeners=null}),this.promise.then=$e=>{let Me;const Ne=new Promise(Ge=>{Ee.subscribe(Ge),Me=Ge}).then($e);return Ne.cancel=function(){Ee.unsubscribe(Me)},Ne},he(function($e,Me,Ne){Ee.reason||(Ee.reason=new hn($e,Me,Ne),Se(Ee.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(he){this.reason?he(this.reason):this._listeners?this._listeners.push(he):this._listeners=[he]}unsubscribe(he){if(!this._listeners)return;const Se=this._listeners.indexOf(he);Se!==-1&&this._listeners.splice(Se,1)}static source(){let he;return{token:new an(function(Se){he=Se}),cancel:he}}}var wn=an;const Dn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Dn).forEach(([ie,he])=>{Dn[he]=ie});var Xn=Dn;const Mt=function ie(he){const Se=new qt(he),Ee=I(qt.prototype.request,Se);return Ue.extend(Ee,qt.prototype,Se,{allOwnKeys:!0}),Ue.extend(Ee,Se,null,{allOwnKeys:!0}),Ee.create=function($e){return ie(He(he,$e))},Ee}(ee);Mt.Axios=qt,Mt.CanceledError=hn,Mt.CancelToken=wn,Mt.isCancel=Tt,Mt.VERSION="1.6.2",Mt.toFormData=wt,Mt.AxiosError=ot,Mt.Cancel=Mt.CanceledError,Mt.all=function(ie){return Promise.all(ie)},Mt.spread=function(ie){return function(he){return ie.apply(null,he)}},Mt.isAxiosError=function(ie){return Ue.isObject(ie)&&ie.isAxiosError===!0},Mt.mergeConfig=He,Mt.AxiosHeaders=vt,Mt.formToJSON=ie=>se(Ue.isHTMLForm(ie)?new FormData(ie):ie),Mt.getAdapter=Ae,Mt.HttpStatusCode=Xn,Mt.default=Mt,D.exports=Mt},147:D=>{D.exports=JSON.parse('{"name":"@pikaz/location","version":"1.0.9","description":"used to obtain location from the browser","private":false,"main":"lib/pikazLocation.js","module":"lib/pikazLocationModule.js","scripts":{"compress":"node utils/compress.js","analysisip":"node utils/analysisIp.js","build":"webpack && webpack --config module.config.js"},"keywords":["geolocation","location","longitude","latitude","province","city","district"],"files":["lib"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/pikaz-18/pikaz-location.git"},"author":"pikaz","license":"MIT","bugs":{"url":"https://github.com/pikaz-18/pikaz-location/issues"},"homepage":"https://github.com/pikaz-18/pikaz-location#readme","devDependencies":{"clean-webpack-plugin":"^4.0.0","copy-webpack-plugin":"^10.2.0","object-hash":"^3.0.0","webpack":"^5.65.0","webpack-cli":"^4.9.1"},"dependencies":{"axios":"^1.6.2","localforage":"^1.10.0","lz-string":"^1.4.4","point-in-polygon":"^1.1.0"},"fileDate":{"areaList":"202212301139","city":"202212301139","district":"202212301139","ip":"2024532110","province":"202317042"},"fileCode":{"areaList":"64b5a33f94b14ae208fca152fdc89dca1048360a","city":"7827eb2bc906b83df109ab24242ce68f98f9558b","district":"14d77ce6236e2025a4b1e3900cc70d0c32a62d0b","ip":"befa0a8a45fdc238a0fb4e4a3011dae43a06c1b4","province":"629a3c20a32e0de95e0633e0385234e2b7886c2d"}}')}},F={};function Z(D){var N=F[D];if(N!==void 0)return N.exports;var O=F[D]={exports:{}};return K[D](O,O.exports,Z),O.exports}return Z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),Z(138)})()}},t$1={};function n(q){var K=t$1[q];if(K!==void 0)return K.exports;var F=t$1[q]={exports:{}};return e$2[q].call(F.exports,F,F.exports,n),F.exports}n.n=q=>{var K=q&&q.__esModule?()=>q.default:()=>q;return n.d(K,{a:K}),K},n.d=(q,K)=>{for(var F in K)n.o(K,F)&&!n.o(q,F)&&Object.defineProperty(q,F,{enumerable:!0,get:K[F]})},n.o=(q,K)=>Object.prototype.hasOwnProperty.call(q,K);var r$1={};(()=>{n.d(r$1,{v6:()=>q.setConfig,k$:()=>q.getLocation,SG:()=>q.getH5Location,Qf:()=>q.getIpLocation,Mc:()=>q.searchList,kr:()=>q.searchCodeAddress,Gp:()=>q.searchAddress,I5:()=>q.searchCodeDetail,ZP:()=>K});var q=n(782);const K={setConfig:q.setConfig,getLocation:q.getLocation,getH5Location:q.getH5Location,getIpLocation:q.getIpLocation,searchList:q.searchList,searchCodeAddress:q.searchCodeAddress,searchAddress:q.searchAddress,searchCodeDetail:q.searchCodeDetail}})(),r$1.ZP,r$1.SG;var a=r$1.Qf;r$1.k$,r$1.Gp,r$1.kr,r$1.I5,r$1.Mc,r$1.v6;const createMutedAudioStream=q=>{const K=q.createOscillator();K.type="sine",K.frequency.setValueAtTime(0,q.currentTime);const F=q.createGain();F.gain.value=0,K.connect(F),F.connect(q.destination),K.start();const Z=q.createMediaStreamDestination();return F.disconnect(),K.connect(Z),Z.stream},createFakeVideoStream=(q=10,K=10,F=30)=>{const Z=document.createElement("canvas"),D=Z.getContext("2d");Z.width=q,Z.height=K;let N=0;return setInterval(()=>{D.clearRect(0,0,Z.width,Z.height);const z=D.createLinearGradient(0,0,Z.width,Z.height);z.addColorStop(0,`hsla(${N}, 100%, 50%, 0)`),z.addColorStop(1,`hsla(${N+120}, 100%, 50%, 0)`),D.fillStyle=z,D.fillRect(0,0,Z.width,Z.height),N=(N+1)%360},100),Z.captureStream(F)},parseCandidate=async q=>{let K;q.indexOf("a=candidate:")===0?K=q.substring(12).split(" "):K=q.substring(10).split(" ");let F={foundation:K[0],component:K[1],protocol:K[2].toLowerCase(),priority:parseInt(K[3],10),ip:K[4],port:parseInt(K[5],10),type:K[7]},Z,D,N;for(let z=8;z<K.length;z+=2)switch(K[z]){case"raddr":Z=K[z+1];break;case"rport":D=parseInt(K[z+1],10);break;case"tcptype":N=K[z+1];break}let O;return F.type==="srflx"&&(O=await a({ip:F.ip,detail:!0})),{...F,relatedAddress:Z,relatedPort:D,tcpType:N,addressDetail:O}};var E=Object.defineProperty,$=q=>{throw TypeError(q)},j=(q,K,F)=>K in q?E(q,K,{enumerable:!0,configurable:!0,writable:!0,value:F}):q[K]=F,u=(q,K,F)=>j(q,typeof K!="symbol"?K+"":K,F),B=(q,K,F)=>K.has(q)||$("Cannot "+F),o=(q,K,F)=>(B(q,K,"read from private field"),F?F.call(q):K.get(q)),k=(q,K,F)=>K.has(q)?$("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(q):K.set(q,F),g$1=(q,K,F,Z)=>(B(q,K,"write to private field"),K.set(q,F),F),C=(q,K,F,Z)=>({set _(D){g$1(q,K,D)},get _(){return o(q,K,Z)}}),d,r,c,m$1;class Y{constructor(K,F={}){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,D)=>{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 N=o(this,r).get(Z);o(this,r).set(Z,D),N===!1&&D&&await this.executeTasks()}),u(this,"createTask",async Z=>{const D={describe:"",strict:!1,timeout:0,success:async fe=>{},fail:async fe=>{},complete:async()=>{},...Z},{describe:N,strict:O,timeout:I,conditionKeys:z,changeConditionKeys:J=[],func:Q,success:ne,fail:re,complete:te}=D,oe=`${C(this,m$1)._++}`,le=()=>{let fe=!0;for(const ge of z)if(!o(this,r).get(ge)){fe=!1;break}return fe};let ae=0;const ce=()=>{o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${N} (${oe}) end`),o(this,c).delete(oe)},de=async()=>{if(!o(this,c).get(oe)||we.runing)return;we.runing=!0;for(const me of J)this.setCondition(me,!1);o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${N} (${oe}) run`);const fe=we.func(),ge=new Promise((me,ve)=>{I&&(ae=setTimeout(()=>{ve(`task: ${oe} (${N}) is timeout.`)},I))});return Promise.race([fe,ge]).finally(()=>{we.strict===!1&&we.clear(),clearTimeout(ae),we.runing=!1,te()}).then(me=>{ne(me)}).catch(me=>{re(me)})},we={key:oe,describe:N,strict:O,conditionKeys:z,runing:!1,func:Q,checkAccord:le,success:ne,fail:re,complete:te,run:de,retry:()=>(we.runing=!1,de()),clear:ce};return o(this,c).set(oe,we),we.checkAccord()&&setTimeout(()=>we.run(),0),we}),u(this,"executeTasks",async()=>{const Z=[...o(this,c).values()];for(const D of Z)D.checkAccord()&&D.run()}),u(this,"clear",(Z=[])=>{if(Z.length===0){g$1(this,c,new Map);return}for(const D of Z)o(this,c).delete(D)}),u(this,"getConditions",()=>Object.fromEntries(o(this,r))),u(this,"getTasks",()=>o(this,c));for(const Z of K)o(this,r).set(Z,!0);g$1(this,d,{debug:!1,...F})}}d=new WeakMap,r=new WeakMap,c=new WeakMap,m$1=new WeakMap;class NetworkQualityTester{constructor(K=[]){Ie(this,"targetUrls",[]);Ie(this,"results",[]);K.length===0&&K.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=K,this.results=[]}async testAll(){const K=this.targetUrls.map(F=>this.testUrl(F));return await Promise.all(K),this.analyzeResults()}async testUrl(K){const F=performance.now();let Z=0,D=!1;try{await fetch(K,{method:"HEAD",cache:"no-store"});const N=performance.now()-F,O=performance.now(),z=await(await fetch(K,{cache:"no-store"})).blob(),J=performance.now()-O;Z=z.size,D=!0,this.results.push({url:K,success:D,headTime:N,getTime:J,size:Z,downloadSpeed:Z>0?(Z/1024/(J/1e3)).toFixed(2):0,totalTime:performance.now()-F})}catch(N){this.results.push({url:K,success:!1,error:N.message,totalTime:performance.now()-F})}}analyzeResults(){const K=this.results.filter(N=>N.success);if(K.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const F=K.reduce((N,O)=>N+O.size,0),Z=K.reduce((N,O)=>N+O.totalTime,0),D=K.reduce((N,O)=>N+parseFloat(O.downloadSpeed),0)/K.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:K.length,averageDownloadSpeed:`${D.toFixed(2)} KB/s`,averageResponseTime:`${(Z/K.length).toFixed(2)}ms`,totalDataTransferred:`${(F/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(q){(function(K){var F="undefined",Z=F!==typeof Buffer&&Buffer,D=F!==typeof Uint8Array&&Uint8Array,N=F!==typeof ArrayBuffer&&ArrayBuffer,O=[0,0,0,0,0,0,0,0],I=Array.isArray||me,z=4294967296,J=16777216,Q;ne("Uint64BE",!0,!0),ne("Int64BE",!0,!1),ne("Uint64LE",!1,!0),ne("Int64LE",!1,!1);function ne(ve,ke,xe){var _e=ke?0:4,Te=ke?4:0,qe=ke?0:3,Ve=ke?1:2,We=ke?2:1,Fe=ke?3:0,Ot=ke?de:fe,It=ke?we:ge,Dt=gt.prototype,zt="is"+ve,Ut="_"+zt;return Dt.buffer=void 0,Dt.offset=0,Dt[Ut]=!0,Dt.toNumber=Ue,Dt.toString=ot,Dt.toJSON=Ue,Dt.toArray=re,Z&&(Dt.toBuffer=te),D&&(Dt.toArrayBuffer=oe),gt[zt]=it,K[ve]=gt,gt;function gt(rt,tt,at,ct){return this instanceof gt?Zt(this,rt,tt,at,ct):new gt(rt,tt,at,ct)}function it(rt){return!!(rt&&rt[Ut])}function Zt(rt,tt,at,ct,wt){if(D&&N&&(tt instanceof N&&(tt=new D(tt)),ct instanceof N&&(ct=new D(ct))),!tt&&!at&&!ct&&!Q){rt.buffer=ce(O,0);return}if(!le(tt,at)){var Bt=Q||Array;wt=at,ct=tt,at=0,tt=Q===Z?Z.alloc(8):new Bt(8)}rt.buffer=tt,rt.offset=at|=0,F!==typeof ct&&(typeof ct=="string"?Ct(tt,at,ct,wt||10):le(ct,wt)?ae(tt,at,ct,wt):typeof wt=="number"?(Jt(tt,at+_e,ct),Jt(tt,at+Te,wt)):ct>0?Ot(tt,at,ct):ct<0?It(tt,at,ct):ae(tt,at,O,0))}function Ct(rt,tt,at,ct){var wt=0,Bt=at.length,Lt=0,Ft=0;at[0]==="-"&&wt++;for(var Kt=wt;wt<Bt;){var Gt=parseInt(at[wt++],ct);if(!(Gt>=0))break;Ft=Ft*ct+Gt,Lt=Lt*ct+Math.floor(Ft/z),Ft%=z}Kt&&(Lt=~Lt,Ft?Ft=z-Ft:Lt++),Jt(rt,tt+_e,Lt),Jt(rt,tt+Te,Ft)}function Ue(){var rt=this.buffer,tt=this.offset,at=Nt(rt,tt+_e),ct=Nt(rt,tt+Te);return xe||(at|=0),at?at*z+ct:ct}function ot(rt){var tt=this.buffer,at=this.offset,ct=Nt(tt,at+_e),wt=Nt(tt,at+Te),Bt="",Lt=!xe&&ct&2147483648;for(Lt&&(ct=~ct,wt=z-wt),rt=rt||10;;){var Ft=ct%rt*z+wt;if(ct=Math.floor(ct/rt),wt=Math.floor(Ft/rt),Bt=(Ft%rt).toString(rt)+Bt,!ct&&!wt)break}return Lt&&(Bt="-"+Bt),Bt}function Jt(rt,tt,at){rt[tt+Fe]=at&255,at=at>>8,rt[tt+We]=at&255,at=at>>8,rt[tt+Ve]=at&255,at=at>>8,rt[tt+qe]=at&255}function Nt(rt,tt){return rt[tt+qe]*J+(rt[tt+Ve]<<16)+(rt[tt+We]<<8)+rt[tt+Fe]}}function re(ve){var ke=this.buffer,xe=this.offset;return Q=null,ve!==!1&&I(ke)?ke.length===8?ke:ke.slice(xe,xe+8):ce(ke,xe)}function te(ve){var ke=this.buffer,xe=this.offset;return Q=Z,ve!==!1&&Z.isBuffer(ke)?ke.length===8?ke:ke.slice(xe,xe+8):Z.from(oe.call(this,ve))}function oe(ve){var ke=this.buffer,xe=this.offset,_e=ke.buffer;if(Q=D,ve!==!1&&!ke.offset&&_e instanceof N)return _e.byteLength===8?_e:_e.slice(xe,xe+8);var Te=new D(8);return ae(Te,0,ke,xe),Te.buffer}function le(ve,ke){var xe=ve&&ve.length;return ke|=0,xe&&ke+8<=xe&&typeof ve[ke]!="string"}function ae(ve,ke,xe,_e){ke|=0,_e|=0;for(var Te=0;Te<8;Te++)ve[ke++]=xe[_e++]&255}function ce(ve,ke){return Array.prototype.slice.call(ve,ke,ke+8)}function de(ve,ke,xe){for(var _e=ke+8;_e>ke;)ve[--_e]=xe&255,xe/=256}function we(ve,ke,xe){var _e=ke+8;for(xe++;_e>ke;)ve[--_e]=-xe&255^255,xe/=256}function fe(ve,ke,xe){for(var _e=ke+8;ke<_e;)ve[ke++]=xe&255,xe/=256}function ge(ve,ke,xe){var _e=ke+8;for(xe++;ke<_e;)ve[ke++]=-xe&255^255,xe/=256}function me(ve){return!!ve&&Object.prototype.toString.call(ve)=="[object Array]"}})(typeof q.nodeName!="string"?q: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)
|
|
5
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(he){return he instanceof this?he:new this(he)}static concat(he,...Se){const Ee=new this(he);return Se.forEach($e=>Ee.set($e)),Ee}static accessor(he){const Se=(this[Oe]=this[Oe]={accessors:{}}).accessors,Ee=this.prototype;function $e(Me){const Ne=De(Me);Se[Ne]||(function(Ge,Ye){const Ke=Ue.toCamelCase(" "+Ye);["get","set","has"].forEach(ze=>{Object.defineProperty(Ge,ze+Ke,{value:function(mt,et,kt){return this[ze].call(this,Ye,mt,et,kt)},configurable:!0})})}(Ee,Me),Se[Ne]=!0)}return Ue.isArray(he)?he.forEach($e):$e(he),this}}St.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ue.reduceDescriptors(St.prototype,({value:ie},he)=>{let Se=he[0].toUpperCase()+he.slice(1);return{get:()=>ie,set(Ee){this[Se]=Ee}}}),Ue.freezeMethods(St);var vt=St;function Ct(ie,he){const Se=this||ee,Ee=he||Se,$e=vt.from(Ee.headers);let Me=Ee.data;return Ue.forEach(ie,function(Ne){Me=Ne.call(Se,Me,$e.normalize(),he?he.status:void 0)}),$e.normalize(),Me}function Tt(ie){return!(!ie||!ie.__CANCEL__)}function hn(ie,he,Se){ot.call(this,ie??"canceled",ot.ERR_CANCELED,he,Se),this.name="CanceledError"}Ue.inherits(hn,ot,{__CANCEL__:!0});var Yn=Yt.hasStandardBrowserEnv?{write(ie,he,Se,Ee,$e,Me){const Ne=[ie+"="+encodeURIComponent(he)];Ue.isNumber(Se)&&Ne.push("expires="+new Date(Se).toGMTString()),Ue.isString(Ee)&&Ne.push("path="+Ee),Ue.isString($e)&&Ne.push("domain="+$e),Me===!0&&Ne.push("secure"),document.cookie=Ne.join("; ")},read(ie){const he=document.cookie.match(new RegExp("(^|;\\s*)("+ie+")=([^;]*)"));return he?decodeURIComponent(he[3]):null},remove(ie){this.write(ie,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Qn(ie,he){return ie&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(he)?function(Se,Ee){return Ee?Se.replace(/\/+$/,"")+"/"+Ee.replace(/^\/+/,""):Se}(ie,he):he}var ue=Yt.hasStandardBrowserEnv?function(){const ie=/(msie|trident)/i.test(navigator.userAgent),he=document.createElement("a");let Se;function Ee($e){let Me=$e;return ie&&(he.setAttribute("href",Me),Me=he.href),he.setAttribute("href",Me),{href:he.href,protocol:he.protocol?he.protocol.replace(/:$/,""):"",host:he.host,search:he.search?he.search.replace(/^\?/,""):"",hash:he.hash?he.hash.replace(/^#/,""):"",hostname:he.hostname,port:he.port,pathname:he.pathname.charAt(0)==="/"?he.pathname:"/"+he.pathname}}return Se=Ee(window.location.href),function($e){const Me=Ue.isString($e)?Ee($e):$e;return Me.protocol===Se.protocol&&Me.host===Se.host}}():function(){return!0};function ye(ie,he){let Se=0;const Ee=function($e,Me){$e=$e||10;const Ne=new Array($e),Ge=new Array($e);let Ye,Ke=0,ze=0;return Me=Me!==void 0?Me:1e3,function(mt){const et=Date.now(),kt=Ge[ze];Ye||(Ye=et),Ne[Ke]=mt,Ge[Ke]=et;let Xe=ze,Et=0;for(;Xe!==Ke;)Et+=Ne[Xe++],Xe%=$e;if(Ke=(Ke+1)%$e,Ke===ze&&(ze=(ze+1)%$e),et-Ye<Me)return;const Ht=kt&&et-kt;return Ht?Math.round(1e3*Et/Ht):void 0}}(50,250);return $e=>{const Me=$e.loaded,Ne=$e.lengthComputable?$e.total:void 0,Ge=Me-Se,Ye=Ee(Ge);Se=Me;const Ke={loaded:Me,total:Ne,progress:Ne?Me/Ne:void 0,bytes:Ge,rate:Ye||void 0,estimated:Ye&&Ne&&Me<=Ne?(Ne-Me)/Ye:void 0,event:$e};Ke[he?"download":"upload"]=!0,ie(Ke)}}const be={http:null,xhr:typeof XMLHttpRequest<"u"&&function(ie){return new Promise(function(he,Se){let Ee=ie.data;const $e=vt.from(ie.headers).normalize();let Me,Ne,{responseType:Ge,withXSRFToken:Ye}=ie;function Ke(){ie.cancelToken&&ie.cancelToken.unsubscribe(Me),ie.signal&&ie.signal.removeEventListener("abort",Me)}if(Ue.isFormData(Ee)){if(Yt.hasStandardBrowserEnv||Yt.hasStandardBrowserWebWorkerEnv)$e.setContentType(!1);else if((Ne=$e.getContentType())!==!1){const[Xe,...Et]=Ne?Ne.split(";").map(Ht=>Ht.trim()).filter(Boolean):[];$e.setContentType([Xe||"multipart/form-data",...Et].join("; "))}}let ze=new XMLHttpRequest;if(ie.auth){const Xe=ie.auth.username||"",Et=ie.auth.password?unescape(encodeURIComponent(ie.auth.password)):"";$e.set("Authorization","Basic "+btoa(Xe+":"+Et))}const mt=Qn(ie.baseURL,ie.url);function et(){if(!ze)return;const Xe=vt.from("getAllResponseHeaders"in ze&&ze.getAllResponseHeaders());(function(Et,Ht,sn){const er=sn.config.validateStatus;sn.status&&er&&!er(sn.status)?Ht(new ot("Request failed with status code "+sn.status,[ot.ERR_BAD_REQUEST,ot.ERR_BAD_RESPONSE][Math.floor(sn.status/100)-4],sn.config,sn.request,sn)):Et(sn)})(function(Et){he(Et),Ke()},function(Et){Se(Et),Ke()},{data:Ge&&Ge!=="text"&&Ge!=="json"?ze.response:ze.responseText,status:ze.status,statusText:ze.statusText,headers:Xe,config:ie,request:ze}),ze=null}if(ze.open(ie.method.toUpperCase(),Gt(mt,ie.params,ie.paramsSerializer),!0),ze.timeout=ie.timeout,"onloadend"in ze?ze.onloadend=et:ze.onreadystatechange=function(){ze&&ze.readyState===4&&(ze.status!==0||ze.responseURL&&ze.responseURL.indexOf("file:")===0)&&setTimeout(et)},ze.onabort=function(){ze&&(Se(new ot("Request aborted",ot.ECONNABORTED,ie,ze)),ze=null)},ze.onerror=function(){Se(new ot("Network Error",ot.ERR_NETWORK,ie,ze)),ze=null},ze.ontimeout=function(){let Xe=ie.timeout?"timeout of "+ie.timeout+"ms exceeded":"timeout exceeded";const Et=ie.transitional||nn;ie.timeoutErrorMessage&&(Xe=ie.timeoutErrorMessage),Se(new ot(Xe,Et.clarifyTimeoutError?ot.ETIMEDOUT:ot.ECONNABORTED,ie,ze)),ze=null},Yt.hasStandardBrowserEnv&&(Ye&&Ue.isFunction(Ye)&&(Ye=Ye(ie)),Ye||Ye!==!1&&ue(mt))){const Xe=ie.xsrfHeaderName&&ie.xsrfCookieName&&Yn.read(ie.xsrfCookieName);Xe&&$e.set(ie.xsrfHeaderName,Xe)}Ee===void 0&&$e.setContentType(null),"setRequestHeader"in ze&&Ue.forEach($e.toJSON(),function(Xe,Et){ze.setRequestHeader(Et,Xe)}),Ue.isUndefined(ie.withCredentials)||(ze.withCredentials=!!ie.withCredentials),Ge&&Ge!=="json"&&(ze.responseType=ie.responseType),typeof ie.onDownloadProgress=="function"&&ze.addEventListener("progress",ye(ie.onDownloadProgress,!0)),typeof ie.onUploadProgress=="function"&&ze.upload&&ze.upload.addEventListener("progress",ye(ie.onUploadProgress)),(ie.cancelToken||ie.signal)&&(Me=Xe=>{ze&&(Se(!Xe||Xe.type?new hn(null,ie,ze):Xe),ze.abort(),ze=null)},ie.cancelToken&&ie.cancelToken.subscribe(Me),ie.signal&&(ie.signal.aborted?Me():ie.signal.addEventListener("abort",Me)));const kt=function(Xe){const Et=/^([-+\w]{1,25})(:?\/\/|:)/.exec(Xe);return Et&&Et[1]||""}(mt);kt&&Yt.protocols.indexOf(kt)===-1?Se(new ot("Unsupported protocol "+kt+":",ot.ERR_BAD_REQUEST,ie)):ze.send(Ee||null)})}};Ue.forEach(be,(ie,he)=>{if(ie){try{Object.defineProperty(ie,"name",{value:he})}catch{}Object.defineProperty(ie,"adapterName",{value:he})}});const Re=ie=>`- ${ie}`,Ce=ie=>Ue.isFunction(ie)||ie===null||ie===!1;var Ae=ie=>{ie=Ue.isArray(ie)?ie:[ie];const{length:he}=ie;let Se,Ee;const $e={};for(let Me=0;Me<he;Me++){let Ne;if(Se=ie[Me],Ee=Se,!Ce(Se)&&(Ee=be[(Ne=String(Se)).toLowerCase()],Ee===void 0))throw new ot(`Unknown adapter '${Ne}'`);if(Ee)break;$e[Ne||"#"+Me]=Ee}if(!Ee){const Me=Object.entries($e).map(([Ne,Ge])=>`adapter ${Ne} `+(Ge===!1?"is not supported by the environment":"is not available in the build"));throw new ot("There is no suitable adapter to dispatch the request "+(he?Me.length>1?`since :
|
|
6
|
+
`+Me.map(Re).join(`
|
|
7
|
+
`):" "+Re(Me[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return Ee};function Pe(ie){if(ie.cancelToken&&ie.cancelToken.throwIfRequested(),ie.signal&&ie.signal.aborted)throw new hn(null,ie)}function je(ie){return Pe(ie),ie.headers=vt.from(ie.headers),ie.data=Ct.call(ie,ie.transformRequest),["post","put","patch"].indexOf(ie.method)!==-1&&ie.headers.setContentType("application/x-www-form-urlencoded",!1),Ae(ie.adapter||ee.adapter)(ie).then(function(he){return Pe(ie),he.data=Ct.call(ie,ie.transformResponse,he),he.headers=vt.from(he.headers),he},function(he){return Tt(he)||(Pe(ie),he&&he.response&&(he.response.data=Ct.call(ie,ie.transformResponse,he.response),he.response.headers=vt.from(he.response.headers))),Promise.reject(he)})}const Je=ie=>ie instanceof vt?ie.toJSON():ie;function He(ie,he){he=he||{};const Se={};function Ee(Ke,ze,mt){return Ue.isPlainObject(Ke)&&Ue.isPlainObject(ze)?Ue.merge.call({caseless:mt},Ke,ze):Ue.isPlainObject(ze)?Ue.merge({},ze):Ue.isArray(ze)?ze.slice():ze}function $e(Ke,ze,mt){return Ue.isUndefined(ze)?Ue.isUndefined(Ke)?void 0:Ee(void 0,Ke,mt):Ee(Ke,ze,mt)}function Me(Ke,ze){if(!Ue.isUndefined(ze))return Ee(void 0,ze)}function Ne(Ke,ze){return Ue.isUndefined(ze)?Ue.isUndefined(Ke)?void 0:Ee(void 0,Ke):Ee(void 0,ze)}function Ge(Ke,ze,mt){return mt in he?Ee(Ke,ze):mt in ie?Ee(void 0,Ke):void 0}const Ye={url:Me,method:Me,data:Me,baseURL:Ne,transformRequest:Ne,transformResponse:Ne,paramsSerializer:Ne,timeout:Ne,timeoutMessage:Ne,withCredentials:Ne,withXSRFToken:Ne,adapter:Ne,responseType:Ne,xsrfCookieName:Ne,xsrfHeaderName:Ne,onUploadProgress:Ne,onDownloadProgress:Ne,decompress:Ne,maxContentLength:Ne,maxBodyLength:Ne,beforeRedirect:Ne,transport:Ne,httpAgent:Ne,httpsAgent:Ne,cancelToken:Ne,socketPath:Ne,responseEncoding:Ne,validateStatus:Ge,headers:(Ke,ze)=>$e(Je(Ke),Je(ze),!0)};return Ue.forEach(Object.keys(Object.assign({},ie,he)),function(Ke){const ze=Ye[Ke]||$e,mt=ze(ie[Ke],he[Ke],Ke);Ue.isUndefined(mt)&&ze!==Ge||(Se[Ke]=mt)}),Se}const Ze={};["object","boolean","number","function","string","symbol"].forEach((ie,he)=>{Ze[ie]=function(Se){return typeof Se===ie||"a"+(he<1?"n ":" ")+ie}});const Qe={};Ze.transitional=function(ie,he,Se){function Ee($e,Me){return"[Axios v1.6.2] Transitional option '"+$e+"'"+Me+(Se?". "+Se:"")}return($e,Me,Ne)=>{if(ie===!1)throw new ot(Ee(Me," has been removed"+(he?" in "+he:"")),ot.ERR_DEPRECATED);return he&&!Qe[Me]&&(Qe[Me]=!0,console.warn(Ee(Me," has been deprecated since v"+he+" and will be removed in the near future"))),!ie||ie($e,Me,Ne)}};var nt={assertOptions:function(ie,he,Se){if(typeof ie!="object")throw new ot("options must be an object",ot.ERR_BAD_OPTION_VALUE);const Ee=Object.keys(ie);let $e=Ee.length;for(;$e-- >0;){const Me=Ee[$e],Ne=he[Me];if(Ne){const Ge=ie[Me],Ye=Ge===void 0||Ne(Ge,Me,ie);if(Ye!==!0)throw new ot("option "+Me+" must be "+Ye,ot.ERR_BAD_OPTION_VALUE)}else if(Se!==!0)throw new ot("Unknown option "+Me,ot.ERR_BAD_OPTION)}},validators:Ze};const ft=nt.validators;class bt{constructor(he){this.defaults=he,this.interceptors={request:new dn,response:new dn}}request(he,Se){typeof he=="string"?(Se=Se||{}).url=he:Se=he||{},Se=He(this.defaults,Se);const{transitional:Ee,paramsSerializer:$e,headers:Me}=Se;Ee!==void 0&&nt.assertOptions(Ee,{silentJSONParsing:ft.transitional(ft.boolean),forcedJSONParsing:ft.transitional(ft.boolean),clarifyTimeoutError:ft.transitional(ft.boolean)},!1),$e!=null&&(Ue.isFunction($e)?Se.paramsSerializer={serialize:$e}:nt.assertOptions($e,{encode:ft.function,serialize:ft.function},!0)),Se.method=(Se.method||this.defaults.method||"get").toLowerCase();let Ne=Me&&Ue.merge(Me.common,Me[Se.method]);Me&&Ue.forEach(["delete","get","head","post","put","patch","common"],Xe=>{delete Me[Xe]}),Se.headers=vt.concat(Ne,Me);const Ge=[];let Ye=!0;this.interceptors.request.forEach(function(Xe){typeof Xe.runWhen=="function"&&Xe.runWhen(Se)===!1||(Ye=Ye&&Xe.synchronous,Ge.unshift(Xe.fulfilled,Xe.rejected))});const Ke=[];let ze;this.interceptors.response.forEach(function(Xe){Ke.push(Xe.fulfilled,Xe.rejected)});let mt,et=0;if(!Ye){const Xe=[je.bind(this),void 0];for(Xe.unshift.apply(Xe,Ge),Xe.push.apply(Xe,Ke),mt=Xe.length,ze=Promise.resolve(Se);et<mt;)ze=ze.then(Xe[et++],Xe[et++]);return ze}mt=Ge.length;let kt=Se;for(et=0;et<mt;){const Xe=Ge[et++],Et=Ge[et++];try{kt=Xe(kt)}catch(Ht){Et.call(this,Ht);break}}try{ze=je.call(this,kt)}catch(Xe){return Promise.reject(Xe)}for(et=0,mt=Ke.length;et<mt;)ze=ze.then(Ke[et++],Ke[et++]);return ze}getUri(he){return Gt(Qn((he=He(this.defaults,he)).baseURL,he.url),he.params,he.paramsSerializer)}}Ue.forEach(["delete","get","head","options"],function(ie){bt.prototype[ie]=function(he,Se){return this.request(He(Se||{},{method:ie,url:he,data:(Se||{}).data}))}}),Ue.forEach(["post","put","patch"],function(ie){function he(Se){return function(Ee,$e,Me){return this.request(He(Me||{},{method:ie,headers:Se?{"Content-Type":"multipart/form-data"}:{},url:Ee,data:$e}))}}bt.prototype[ie]=he(),bt.prototype[ie+"Form"]=he(!0)});var qt=bt;class an{constructor(he){if(typeof he!="function")throw new TypeError("executor must be a function.");let Se;this.promise=new Promise(function($e){Se=$e});const Ee=this;this.promise.then($e=>{if(!Ee._listeners)return;let Me=Ee._listeners.length;for(;Me-- >0;)Ee._listeners[Me]($e);Ee._listeners=null}),this.promise.then=$e=>{let Me;const Ne=new Promise(Ge=>{Ee.subscribe(Ge),Me=Ge}).then($e);return Ne.cancel=function(){Ee.unsubscribe(Me)},Ne},he(function($e,Me,Ne){Ee.reason||(Ee.reason=new hn($e,Me,Ne),Se(Ee.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(he){this.reason?he(this.reason):this._listeners?this._listeners.push(he):this._listeners=[he]}unsubscribe(he){if(!this._listeners)return;const Se=this._listeners.indexOf(he);Se!==-1&&this._listeners.splice(Se,1)}static source(){let he;return{token:new an(function(Se){he=Se}),cancel:he}}}var wn=an;const Dn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Dn).forEach(([ie,he])=>{Dn[he]=ie});var Xn=Dn;const Mt=function ie(he){const Se=new qt(he),Ee=I(qt.prototype.request,Se);return Ue.extend(Ee,qt.prototype,Se,{allOwnKeys:!0}),Ue.extend(Ee,Se,null,{allOwnKeys:!0}),Ee.create=function($e){return ie(He(he,$e))},Ee}(ee);Mt.Axios=qt,Mt.CanceledError=hn,Mt.CancelToken=wn,Mt.isCancel=Tt,Mt.VERSION="1.6.2",Mt.toFormData=wt,Mt.AxiosError=ot,Mt.Cancel=Mt.CanceledError,Mt.all=function(ie){return Promise.all(ie)},Mt.spread=function(ie){return function(he){return ie.apply(null,he)}},Mt.isAxiosError=function(ie){return Ue.isObject(ie)&&ie.isAxiosError===!0},Mt.mergeConfig=He,Mt.AxiosHeaders=vt,Mt.formToJSON=ie=>se(Ue.isHTMLForm(ie)?new FormData(ie):ie),Mt.getAdapter=Ae,Mt.HttpStatusCode=Xn,Mt.default=Mt,D.exports=Mt},147:D=>{D.exports=JSON.parse('{"name":"@pikaz/location","version":"1.0.9","description":"used to obtain location from the browser","private":false,"main":"lib/pikazLocation.js","module":"lib/pikazLocationModule.js","scripts":{"compress":"node utils/compress.js","analysisip":"node utils/analysisIp.js","build":"webpack && webpack --config module.config.js"},"keywords":["geolocation","location","longitude","latitude","province","city","district"],"files":["lib"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/pikaz-18/pikaz-location.git"},"author":"pikaz","license":"MIT","bugs":{"url":"https://github.com/pikaz-18/pikaz-location/issues"},"homepage":"https://github.com/pikaz-18/pikaz-location#readme","devDependencies":{"clean-webpack-plugin":"^4.0.0","copy-webpack-plugin":"^10.2.0","object-hash":"^3.0.0","webpack":"^5.65.0","webpack-cli":"^4.9.1"},"dependencies":{"axios":"^1.6.2","localforage":"^1.10.0","lz-string":"^1.4.4","point-in-polygon":"^1.1.0"},"fileDate":{"areaList":"202212301139","city":"202212301139","district":"202212301139","ip":"2024532110","province":"202317042"},"fileCode":{"areaList":"64b5a33f94b14ae208fca152fdc89dca1048360a","city":"7827eb2bc906b83df109ab24242ce68f98f9558b","district":"14d77ce6236e2025a4b1e3900cc70d0c32a62d0b","ip":"befa0a8a45fdc238a0fb4e4a3011dae43a06c1b4","province":"629a3c20a32e0de95e0633e0385234e2b7886c2d"}}')}},F={};function Z(D){var N=F[D];if(N!==void 0)return N.exports;var O=F[D]={exports:{}};return K[D](O,O.exports,Z),O.exports}return Z.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),Z(138)})()}},t$1={};function n(q){var K=t$1[q];if(K!==void 0)return K.exports;var F=t$1[q]={exports:{}};return e$2[q].call(F.exports,F,F.exports,n),F.exports}n.n=q=>{var K=q&&q.__esModule?()=>q.default:()=>q;return n.d(K,{a:K}),K},n.d=(q,K)=>{for(var F in K)n.o(K,F)&&!n.o(q,F)&&Object.defineProperty(q,F,{enumerable:!0,get:K[F]})},n.o=(q,K)=>Object.prototype.hasOwnProperty.call(q,K);var r$1={};(()=>{n.d(r$1,{v6:()=>q.setConfig,k$:()=>q.getLocation,SG:()=>q.getH5Location,Qf:()=>q.getIpLocation,Mc:()=>q.searchList,kr:()=>q.searchCodeAddress,Gp:()=>q.searchAddress,I5:()=>q.searchCodeDetail,ZP:()=>K});var q=n(782);const K={setConfig:q.setConfig,getLocation:q.getLocation,getH5Location:q.getH5Location,getIpLocation:q.getIpLocation,searchList:q.searchList,searchCodeAddress:q.searchCodeAddress,searchAddress:q.searchAddress,searchCodeDetail:q.searchCodeDetail}})(),r$1.ZP,r$1.SG;var a=r$1.Qf;r$1.k$,r$1.Gp,r$1.kr,r$1.I5,r$1.Mc,r$1.v6;const createMutedAudioStream=q=>{const K=q.createOscillator();K.type="sine",K.frequency.setValueAtTime(0,q.currentTime);const F=q.createGain();F.gain.value=0,K.connect(F),F.connect(q.destination),K.start();const Z=q.createMediaStreamDestination();return F.disconnect(),K.connect(Z),Z.stream},createFakeVideoStream=(q=10,K=10,F=30)=>{const Z=document.createElement("canvas"),D=Z.getContext("2d");Z.width=q,Z.height=K;let N=0;return setInterval(()=>{D.clearRect(0,0,Z.width,Z.height);const z=D.createLinearGradient(0,0,Z.width,Z.height);z.addColorStop(0,`hsla(${N}, 100%, 50%, 0)`),z.addColorStop(1,`hsla(${N+120}, 100%, 50%, 0)`),D.fillStyle=z,D.fillRect(0,0,Z.width,Z.height),N=(N+1)%360},100),Z.captureStream(F)},parseCandidate=async q=>{let K;q.indexOf("a=candidate:")===0?K=q.substring(12).split(" "):K=q.substring(10).split(" ");let F={foundation:K[0],component:K[1],protocol:K[2].toLowerCase(),priority:parseInt(K[3],10),ip:K[4],port:parseInt(K[5],10),type:K[7]},Z,D,N;for(let z=8;z<K.length;z+=2)switch(K[z]){case"raddr":Z=K[z+1];break;case"rport":D=parseInt(K[z+1],10);break;case"tcptype":N=K[z+1];break}let O;return F.type==="srflx"&&(O=await a({ip:F.ip,detail:!0})),{...F,relatedAddress:Z,relatedPort:D,tcpType:N,addressDetail:O}};var E=Object.defineProperty,$=q=>{throw TypeError(q)},j=(q,K,F)=>K in q?E(q,K,{enumerable:!0,configurable:!0,writable:!0,value:F}):q[K]=F,u=(q,K,F)=>j(q,typeof K!="symbol"?K+"":K,F),B=(q,K,F)=>K.has(q)||$("Cannot "+F),o=(q,K,F)=>(B(q,K,"read from private field"),F?F.call(q):K.get(q)),k=(q,K,F)=>K.has(q)?$("Cannot add the same private member more than once"):K instanceof WeakSet?K.add(q):K.set(q,F),g$1=(q,K,F,Z)=>(B(q,K,"write to private field"),K.set(q,F),F),C=(q,K,F,Z)=>({set _(D){g$1(q,K,D)},get _(){return o(q,K,Z)}}),d,r,c,m$1;class Y{constructor(K,F={}){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,D)=>{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 N=o(this,r).get(Z);o(this,r).set(Z,D),N===!1&&D&&await this.executeTasks()}),u(this,"createTask",async Z=>{const D={describe:"",strict:!1,timeout:0,success:async fe=>{},fail:async fe=>{},complete:async()=>{},...Z},{describe:N,strict:O,timeout:I,conditionKeys:z,changeConditionKeys:J=[],func:Q,success:ne,fail:re,complete:te}=D,oe=`${C(this,m$1)._++}`,le=()=>{let fe=!0;for(const ge of z)if(!o(this,r).get(ge)){fe=!1;break}return fe};let ae=0;const ce=()=>{o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${N} (${oe}) end`),o(this,c).delete(oe)},de=async()=>{if(!o(this,c).get(oe)||we.runing)return;we.runing=!0;for(const me of J)this.setCondition(me,!1);o(this,d).debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->pr-task-queue: task ${N} (${oe}) run`);const fe=we.func(),ge=new Promise((me,ve)=>{I&&(ae=setTimeout(()=>{ve(`task: ${oe} (${N}) is timeout.`)},I))});return Promise.race([fe,ge]).finally(()=>{we.strict===!1&&we.clear(),clearTimeout(ae),we.runing=!1,te()}).then(me=>{ne(me)}).catch(me=>{re(me)})},we={key:oe,describe:N,strict:O,conditionKeys:z,runing:!1,func:Q,checkAccord:le,success:ne,fail:re,complete:te,run:de,retry:()=>(we.runing=!1,de()),clear:ce};return o(this,c).set(oe,we),we.checkAccord()&&setTimeout(()=>we.run(),0),we}),u(this,"executeTasks",async()=>{const Z=[...o(this,c).values()];for(const D of Z)D.checkAccord()&&D.run()}),u(this,"clear",(Z=[])=>{if(Z.length===0){g$1(this,c,new Map);return}for(const D of Z)o(this,c).delete(D)}),u(this,"getConditions",()=>Object.fromEntries(o(this,r))),u(this,"getTasks",()=>o(this,c));for(const Z of K)o(this,r).set(Z,!0);g$1(this,d,{debug:!1,...F})}}d=new WeakMap,r=new WeakMap,c=new WeakMap,m$1=new WeakMap;class NetworkQualityTester{constructor(K=[]){Ie(this,"targetUrls",[]);Ie(this,"results",[]);K.length===0&&K.push("https://api.pryun.vip/favicon-32x32.png"),this.targetUrls=K,this.results=[]}async testAll(){const K=this.targetUrls.map(F=>this.testUrl(F));return await Promise.all(K),this.analyzeResults()}async testUrl(K){const F=performance.now();let Z=0,D=!1;try{await fetch(K,{method:"HEAD",cache:"no-store"});const N=performance.now()-F,O=performance.now(),z=await(await fetch(K,{cache:"no-store"})).blob(),J=performance.now()-O;Z=z.size,D=!0,this.results.push({url:K,success:D,headTime:N,getTime:J,size:Z,downloadSpeed:Z>0?(Z/1024/(J/1e3)).toFixed(2):0,totalTime:performance.now()-F})}catch(N){this.results.push({url:K,success:!1,error:N.message,totalTime:performance.now()-F})}}analyzeResults(){const K=this.results.filter(N=>N.success);if(K.length===0)return{overallSuccess:!1,message:"所有测试均失败"};const F=K.reduce((N,O)=>N+O.size,0),Z=K.reduce((N,O)=>N+O.totalTime,0),D=K.reduce((N,O)=>N+parseFloat(O.downloadSpeed),0)/K.length;return{overallSuccess:!0,totalTests:this.results.length,successfulTests:K.length,averageDownloadSpeed:`${D.toFixed(2)} KB/s`,averageResponseTime:`${(Z/K.length).toFixed(2)}ms`,totalDataTransferred:`${(F/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(q){(function(K){var F="undefined",Z=F!==typeof Buffer&&Buffer,D=F!==typeof Uint8Array&&Uint8Array,N=F!==typeof ArrayBuffer&&ArrayBuffer,O=[0,0,0,0,0,0,0,0],I=Array.isArray||me,z=4294967296,J=16777216,Q;ne("Uint64BE",!0,!0),ne("Int64BE",!0,!1),ne("Uint64LE",!1,!0),ne("Int64LE",!1,!1);function ne(ve,ke,xe){var _e=ke?0:4,Te=ke?4:0,qe=ke?0:3,Ve=ke?1:2,We=ke?2:1,Fe=ke?3:0,Ot=ke?de:fe,It=ke?we:ge,Dt=gt.prototype,zt="is"+ve,Ut="_"+zt;return Dt.buffer=void 0,Dt.offset=0,Dt[Ut]=!0,Dt.toNumber=Ue,Dt.toString=ot,Dt.toJSON=Ue,Dt.toArray=re,Z&&(Dt.toBuffer=te),D&&(Dt.toArrayBuffer=oe),gt[zt]=it,K[ve]=gt,gt;function gt(rt,tt,at,ct){return this instanceof gt?Zt(this,rt,tt,at,ct):new gt(rt,tt,at,ct)}function it(rt){return!!(rt&&rt[Ut])}function Zt(rt,tt,at,ct,wt){if(D&&N&&(tt instanceof N&&(tt=new D(tt)),ct instanceof N&&(ct=new D(ct))),!tt&&!at&&!ct&&!Q){rt.buffer=ce(O,0);return}if(!le(tt,at)){var Bt=Q||Array;wt=at,ct=tt,at=0,tt=Q===Z?Z.alloc(8):new Bt(8)}rt.buffer=tt,rt.offset=at|=0,F!==typeof ct&&(typeof ct=="string"?Rt(tt,at,ct,wt||10):le(ct,wt)?ae(tt,at,ct,wt):typeof wt=="number"?(Jt(tt,at+_e,ct),Jt(tt,at+Te,wt)):ct>0?Ot(tt,at,ct):ct<0?It(tt,at,ct):ae(tt,at,O,0))}function Rt(rt,tt,at,ct){var wt=0,Bt=at.length,Lt=0,Ft=0;at[0]==="-"&&wt++;for(var Kt=wt;wt<Bt;){var Gt=parseInt(at[wt++],ct);if(!(Gt>=0))break;Ft=Ft*ct+Gt,Lt=Lt*ct+Math.floor(Ft/z),Ft%=z}Kt&&(Lt=~Lt,Ft?Ft=z-Ft:Lt++),Jt(rt,tt+_e,Lt),Jt(rt,tt+Te,Ft)}function Ue(){var rt=this.buffer,tt=this.offset,at=Nt(rt,tt+_e),ct=Nt(rt,tt+Te);return xe||(at|=0),at?at*z+ct:ct}function ot(rt){var tt=this.buffer,at=this.offset,ct=Nt(tt,at+_e),wt=Nt(tt,at+Te),Bt="",Lt=!xe&&ct&2147483648;for(Lt&&(ct=~ct,wt=z-wt),rt=rt||10;;){var Ft=ct%rt*z+wt;if(ct=Math.floor(ct/rt),wt=Math.floor(Ft/rt),Bt=(Ft%rt).toString(rt)+Bt,!ct&&!wt)break}return Lt&&(Bt="-"+Bt),Bt}function Jt(rt,tt,at){rt[tt+Fe]=at&255,at=at>>8,rt[tt+We]=at&255,at=at>>8,rt[tt+Ve]=at&255,at=at>>8,rt[tt+qe]=at&255}function Nt(rt,tt){return rt[tt+qe]*J+(rt[tt+Ve]<<16)+(rt[tt+We]<<8)+rt[tt+Fe]}}function re(ve){var ke=this.buffer,xe=this.offset;return Q=null,ve!==!1&&I(ke)?ke.length===8?ke:ke.slice(xe,xe+8):ce(ke,xe)}function te(ve){var ke=this.buffer,xe=this.offset;return Q=Z,ve!==!1&&Z.isBuffer(ke)?ke.length===8?ke:ke.slice(xe,xe+8):Z.from(oe.call(this,ve))}function oe(ve){var ke=this.buffer,xe=this.offset,_e=ke.buffer;if(Q=D,ve!==!1&&!ke.offset&&_e instanceof N)return _e.byteLength===8?_e:_e.slice(xe,xe+8);var Te=new D(8);return ae(Te,0,ke,xe),Te.buffer}function le(ve,ke){var xe=ve&&ve.length;return ke|=0,xe&&ke+8<=xe&&typeof ve[ke]!="string"}function ae(ve,ke,xe,_e){ke|=0,_e|=0;for(var Te=0;Te<8;Te++)ve[ke++]=xe[_e++]&255}function ce(ve,ke){return Array.prototype.slice.call(ve,ke,ke+8)}function de(ve,ke,xe){for(var _e=ke+8;_e>ke;)ve[--_e]=xe&255,xe/=256}function we(ve,ke,xe){var _e=ke+8;for(xe++;_e>ke;)ve[--_e]=-xe&255^255,xe/=256}function fe(ve,ke,xe){for(var _e=ke+8;ke<_e;)ve[ke++]=xe&255,xe/=256}function ge(ve,ke,xe){var _e=ke+8;for(xe++;ke<_e;)ve[ke++]=-xe&255^255,xe/=256}function me(ve){return!!ve&&Object.prototype.toString.call(ve)=="[object Array]"}})(typeof q.nodeName!="string"?q: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)
|
|
8
8
|
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 q=requireTools(),K=requireTools(),F=requireEbmlID(),Z=function(){function D(){this._schema=F.byEbmlID,this._buffers=[],this._stack=[]}return D.prototype.encode=function(N){var O=this;return q.concat(N.reduce(function(I,z){return I.concat(O.encodeChunk(z))},[])).buffer},D.prototype.encodeChunk=function(N){return N.type==="m"?N.isEnd?this.endTag(N):this.startTag(N):(N.data=K.Buffer.from(N.data),this.writeTag(N)),this.flush()},D.prototype.flush=function(){var N=this._buffers;return this._buffers=[],N},D.prototype.getSchemaInfo=function(N){for(var O=Object.keys(this._schema).map(Number),I=0;I<O.length;I++){var z=O[I];if(this._schema[z].name===N)return new K.Buffer(z.toString(16),"hex")}return null},D.prototype.writeTag=function(N){var O=N.name,I=this.getSchemaInfo(O),z=N.data;if(I==null)throw new Error("No schema entry found for "+O);var J=q.encodeTag(I,z);if(this._stack.length>0){var Q=this._stack[this._stack.length-1];Q.children.push({tagId:I,elm:N,children:[],data:J});return}this._buffers=this._buffers.concat(J)},D.prototype.startTag=function(N){var O=N.name,I=this.getSchemaInfo(O);if(I==null)throw new Error("No schema entry found for "+O);if(N.unknownSize){var z=q.encodeTag(I,new K.Buffer(0),N.unknownSize);this._buffers=this._buffers.concat(z);return}var J={tagId:I,elm:N,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(J),this._stack.push(J)},D.prototype.endTag=function(N){N.name;var O=this._stack.pop();if(O==null)throw new Error("EBML structure is broken");if(O.elm.name!==N.name)throw new Error("EBML structure is broken");var I=O.children.reduce(function(J,Q){if(Q.data===null)throw new Error("EBML structure is broken");return J.concat(Q.data)},[]),z=q.concat(I);O.elm.type==="m"?O.data=q.encodeTag(O.tagId,z,O.elm.unknownSize):O.data=q.encodeTag(O.tagId,z),this._stack.length<1&&(this._buffers=this._buffers.concat(O.data))},D}();return EBMLEncoder.default=Z,EBMLEncoder}var buffer={},base64Js={},hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1,base64Js.byteLength=I,base64Js.toByteArray=J,base64Js.fromByteArray=re;for(var q=[],K=[],F=typeof Uint8Array<"u"?Uint8Array:Array,Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=0,N=Z.length;D<N;++D)q[D]=Z[D],K[Z.charCodeAt(D)]=D;K[45]=62,K[95]=63;function O(te){var oe=te.length;if(oe%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var le=te.indexOf("=");le===-1&&(le=oe);var ae=le===oe?0:4-le%4;return[le,ae]}function I(te){var oe=O(te),le=oe[0],ae=oe[1];return(le+ae)*3/4-ae}function z(te,oe,le){return(oe+le)*3/4-le}function J(te){var oe,le=O(te),ae=le[0],ce=le[1],de=new F(z(te,ae,ce)),we=0,fe=ce>0?ae-4:ae,ge;for(ge=0;ge<fe;ge+=4)oe=K[te.charCodeAt(ge)]<<18|K[te.charCodeAt(ge+1)]<<12|K[te.charCodeAt(ge+2)]<<6|K[te.charCodeAt(ge+3)],de[we++]=oe>>16&255,de[we++]=oe>>8&255,de[we++]=oe&255;return ce===2&&(oe=K[te.charCodeAt(ge)]<<2|K[te.charCodeAt(ge+1)]>>4,de[we++]=oe&255),ce===1&&(oe=K[te.charCodeAt(ge)]<<10|K[te.charCodeAt(ge+1)]<<4|K[te.charCodeAt(ge+2)]>>2,de[we++]=oe>>8&255,de[we++]=oe&255),de}function Q(te){return q[te>>18&63]+q[te>>12&63]+q[te>>6&63]+q[te&63]}function ne(te,oe,le){for(var ae,ce=[],de=oe;de<le;de+=3)ae=(te[de]<<16&16711680)+(te[de+1]<<8&65280)+(te[de+2]&255),ce.push(Q(ae));return ce.join("")}function re(te){for(var oe,le=te.length,ae=le%3,ce=[],de=16383,we=0,fe=le-ae;we<fe;we+=de)ce.push(ne(te,we,we+de>fe?fe:we+de));return ae===1?(oe=te[le-1],ce.push(q[oe>>2]+q[oe<<4&63]+"==")):ae===2&&(oe=(te[le-2]<<8)+te[le-1],ce.push(q[oe>>10]+q[oe>>4&63]+q[oe<<2&63]+"=")),ce.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(q,K,F,Z,D){var N,O,I=D*8-Z-1,z=(1<<I)-1,J=z>>1,Q=-7,ne=F?D-1:0,re=F?-1:1,te=q[K+ne];for(ne+=re,N=te&(1<<-Q)-1,te>>=-Q,Q+=I;Q>0;N=N*256+q[K+ne],ne+=re,Q-=8);for(O=N&(1<<-Q)-1,N>>=-Q,Q+=Z;Q>0;O=O*256+q[K+ne],ne+=re,Q-=8);if(N===0)N=1-J;else{if(N===z)return O?NaN:(te?-1:1)*(1/0);O=O+Math.pow(2,Z),N=N-J}return(te?-1:1)*O*Math.pow(2,N-Z)},ieee754.write=function(q,K,F,Z,D,N){var O,I,z,J=N*8-D-1,Q=(1<<J)-1,ne=Q>>1,re=D===23?Math.pow(2,-24)-Math.pow(2,-77):0,te=Z?0:N-1,oe=Z?1:-1,le=K<0||K===0&&1/K<0?1:0;for(K=Math.abs(K),isNaN(K)||K===1/0?(I=isNaN(K)?1:0,O=Q):(O=Math.floor(Math.log(K)/Math.LN2),K*(z=Math.pow(2,-O))<1&&(O--,z*=2),O+ne>=1?K+=re/z:K+=re*Math.pow(2,1-ne),K*z>=2&&(O++,z/=2),O+ne>=Q?(I=0,O=Q):O+ne>=1?(I=(K*z-1)*Math.pow(2,D),O=O+ne):(I=K*Math.pow(2,ne-1)*Math.pow(2,D),O=0));D>=8;q[F+te]=I&255,te+=oe,I/=256,D-=8);for(O=O<<D|I,J+=D;J>0;q[F+te]=O&255,te+=oe,O/=256,J-=8);q[F+te-oe]|=le*128}),ieee754}/*!
|
|
9
9
|
* The buffer module from node.js, for the browser.
|
|
10
10
|
*
|
|
11
11
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
12
12
|
* @license MIT
|
|
13
|
-
*/var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function(q){const K=requireBase64Js(),F=requireIeee754(),Z=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;q.Buffer=I,q.SlowBuffer=de,q.INSPECT_MAX_BYTES=50;const D=2147483647;q.kMaxLength=D,I.TYPED_ARRAY_SUPPORT=N(),!I.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 N(){try{const se=new Uint8Array(1),X={foo:function(){return 42}};return Object.setPrototypeOf(X,Uint8Array.prototype),Object.setPrototypeOf(se,X),se.foo()===42}catch{return!1}}Object.defineProperty(I.prototype,"parent",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.buffer}}),Object.defineProperty(I.prototype,"offset",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.byteOffset}});function O(se){if(se>D)throw new RangeError('The value "'+se+'" is invalid for option "size"');const X=new Uint8Array(se);return Object.setPrototypeOf(X,I.prototype),X}function I(se,X,ee){if(typeof se=="number"){if(typeof X=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ne(se)}return z(se,X,ee)}I.poolSize=8192;function z(se,X,ee){if(typeof se=="string")return re(se,X);if(ArrayBuffer.isView(se))return oe(se);if(se==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se);if(Vt(se,ArrayBuffer)||se&&Vt(se.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vt(se,SharedArrayBuffer)||se&&Vt(se.buffer,SharedArrayBuffer)))return le(se,X,ee);if(typeof se=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const pe=se.valueOf&&se.valueOf();if(pe!=null&&pe!==se)return I.from(pe,X,ee);const Oe=ae(se);if(Oe)return Oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof se[Symbol.toPrimitive]=="function")return I.from(se[Symbol.toPrimitive]("string"),X,ee);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se)}I.from=function(se,X,ee){return z(se,X,ee)},Object.setPrototypeOf(I.prototype,Uint8Array.prototype),Object.setPrototypeOf(I,Uint8Array);function J(se){if(typeof se!="number")throw new TypeError('"size" argument must be of type number');if(se<0)throw new RangeError('The value "'+se+'" is invalid for option "size"')}function Q(se,X,ee){return J(se),se<=0?O(se):X!==void 0?typeof ee=="string"?O(se).fill(X,ee):O(se).fill(X):O(se)}I.alloc=function(se,X,ee){return Q(se,X,ee)};function ne(se){return J(se),O(se<0?0:ce(se)|0)}I.allocUnsafe=function(se){return ne(se)},I.allocUnsafeSlow=function(se){return ne(se)};function re(se,X){if((typeof X!="string"||X==="")&&(X="utf8"),!I.isEncoding(X))throw new TypeError("Unknown encoding: "+X);const ee=we(se,X)|0;let pe=O(ee);const Oe=pe.write(se,X);return Oe!==ee&&(pe=pe.slice(0,Oe)),pe}function te(se){const X=se.length<0?0:ce(se.length)|0,ee=O(X);for(let pe=0;pe<X;pe+=1)ee[pe]=se[pe]&255;return ee}function oe(se){if(Vt(se,Uint8Array)){const X=new Uint8Array(se);return le(X.buffer,X.byteOffset,X.byteLength)}return te(se)}function le(se,X,ee){if(X<0||se.byteLength<X)throw new RangeError('"offset" is outside of buffer bounds');if(se.byteLength<X+(ee||0))throw new RangeError('"length" is outside of buffer bounds');let pe;return X===void 0&&ee===void 0?pe=new Uint8Array(se):ee===void 0?pe=new Uint8Array(se,X):pe=new Uint8Array(se,X,ee),Object.setPrototypeOf(pe,I.prototype),pe}function ae(se){if(I.isBuffer(se)){const X=ce(se.length)|0,ee=O(X);return ee.length===0||se.copy(ee,0,0,X),ee}if(se.length!==void 0)return typeof se.length!="number"||Qt(se.length)?O(0):te(se);if(se.type==="Buffer"&&Array.isArray(se.data))return te(se.data)}function ce(se){if(se>=D)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D.toString(16)+" bytes");return se|0}function de(se){return+se!=se&&(se=0),I.alloc(+se)}I.isBuffer=function(X){return X!=null&&X._isBuffer===!0&&X!==I.prototype},I.compare=function(X,ee){if(Vt(X,Uint8Array)&&(X=I.from(X,X.offset,X.byteLength)),Vt(ee,Uint8Array)&&(ee=I.from(ee,ee.offset,ee.byteLength)),!I.isBuffer(X)||!I.isBuffer(ee))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(X===ee)return 0;let pe=X.length,Oe=ee.length;for(let De=0,Le=Math.min(pe,Oe);De<Le;++De)if(X[De]!==ee[De]){pe=X[De],Oe=ee[De];break}return pe<Oe?-1:Oe<pe?1:0},I.isEncoding=function(X){switch(String(X).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}},I.concat=function(X,ee){if(!Array.isArray(X))throw new TypeError('"list" argument must be an Array of Buffers');if(X.length===0)return I.alloc(0);let pe;if(ee===void 0)for(ee=0,pe=0;pe<X.length;++pe)ee+=X[pe].length;const Oe=I.allocUnsafe(ee);let De=0;for(pe=0;pe<X.length;++pe){let Le=X[pe];if(Vt(Le,Uint8Array))De+Le.length>Oe.length?(I.isBuffer(Le)||(Le=I.from(Le)),Le.copy(Oe,De)):Uint8Array.prototype.set.call(Oe,Le,De);else if(I.isBuffer(Le))Le.copy(Oe,De);else throw new TypeError('"list" argument must be an Array of Buffers');De+=Le.length}return Oe};function we(se,X){if(I.isBuffer(se))return se.length;if(ArrayBuffer.isView(se)||Vt(se,ArrayBuffer))return se.byteLength;if(typeof se!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof se);const ee=se.length,pe=arguments.length>2&&arguments[2]===!0;if(!pe&&ee===0)return 0;let Oe=!1;for(;;)switch(X){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":return Kt(se).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee*2;case"hex":return ee>>>1;case"base64":return nn(se).length;default:if(Oe)return pe?-1:Kt(se).length;X=(""+X).toLowerCase(),Oe=!0}}I.byteLength=we;function fe(se,X,ee){let pe=!1;if((X===void 0||X<0)&&(X=0),X>this.length||((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)||(ee>>>=0,X>>>=0,ee<=X))return"";for(se||(se="utf8");;)switch(se){case"hex":return zt(this,X,ee);case"utf8":case"utf-8":return We(this,X,ee);case"ascii":return It(this,X,ee);case"latin1":case"binary":return Dt(this,X,ee);case"base64":return Ve(this,X,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ut(this,X,ee);default:if(pe)throw new TypeError("Unknown encoding: "+se);se=(se+"").toLowerCase(),pe=!0}}I.prototype._isBuffer=!0;function ge(se,X,ee){const pe=se[X];se[X]=se[ee],se[ee]=pe}I.prototype.swap16=function(){const X=this.length;if(X%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ee=0;ee<X;ee+=2)ge(this,ee,ee+1);return this},I.prototype.swap32=function(){const X=this.length;if(X%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ee=0;ee<X;ee+=4)ge(this,ee,ee+3),ge(this,ee+1,ee+2);return this},I.prototype.swap64=function(){const X=this.length;if(X%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ee=0;ee<X;ee+=8)ge(this,ee,ee+7),ge(this,ee+1,ee+6),ge(this,ee+2,ee+5),ge(this,ee+3,ee+4);return this},I.prototype.toString=function(){const X=this.length;return X===0?"":arguments.length===0?We(this,0,X):fe.apply(this,arguments)},I.prototype.toLocaleString=I.prototype.toString,I.prototype.equals=function(X){if(!I.isBuffer(X))throw new TypeError("Argument must be a Buffer");return this===X?!0:I.compare(this,X)===0},I.prototype.inspect=function(){let X="";const ee=q.INSPECT_MAX_BYTES;return X=this.toString("hex",0,ee).replace(/(.{2})/g,"$1 ").trim(),this.length>ee&&(X+=" ... "),"<Buffer "+X+">"},Z&&(I.prototype[Z]=I.prototype.inspect),I.prototype.compare=function(X,ee,pe,Oe,De){if(Vt(X,Uint8Array)&&(X=I.from(X,X.offset,X.byteLength)),!I.isBuffer(X))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof X);if(ee===void 0&&(ee=0),pe===void 0&&(pe=X?X.length:0),Oe===void 0&&(Oe=0),De===void 0&&(De=this.length),ee<0||pe>X.length||Oe<0||De>this.length)throw new RangeError("out of range index");if(Oe>=De&&ee>=pe)return 0;if(Oe>=De)return-1;if(ee>=pe)return 1;if(ee>>>=0,pe>>>=0,Oe>>>=0,De>>>=0,this===X)return 0;let Le=De-Oe,ut=pe-ee;const St=Math.min(Le,ut),vt=this.slice(Oe,De),Rt=X.slice(ee,pe);for(let Tt=0;Tt<St;++Tt)if(vt[Tt]!==Rt[Tt]){Le=vt[Tt],ut=Rt[Tt];break}return Le<ut?-1:ut<Le?1:0};function me(se,X,ee,pe,Oe){if(se.length===0)return-1;if(typeof ee=="string"?(pe=ee,ee=0):ee>2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ee=+ee,Qt(ee)&&(ee=Oe?0:se.length-1),ee<0&&(ee=se.length+ee),ee>=se.length){if(Oe)return-1;ee=se.length-1}else if(ee<0)if(Oe)ee=0;else return-1;if(typeof X=="string"&&(X=I.from(X,pe)),I.isBuffer(X))return X.length===0?-1:ve(se,X,ee,pe,Oe);if(typeof X=="number")return X=X&255,typeof Uint8Array.prototype.indexOf=="function"?Oe?Uint8Array.prototype.indexOf.call(se,X,ee):Uint8Array.prototype.lastIndexOf.call(se,X,ee):ve(se,[X],ee,pe,Oe);throw new TypeError("val must be string, number or Buffer")}function ve(se,X,ee,pe,Oe){let De=1,Le=se.length,ut=X.length;if(pe!==void 0&&(pe=String(pe).toLowerCase(),pe==="ucs2"||pe==="ucs-2"||pe==="utf16le"||pe==="utf-16le")){if(se.length<2||X.length<2)return-1;De=2,Le/=2,ut/=2,ee/=2}function St(Rt,Tt){return De===1?Rt[Tt]:Rt.readUInt16BE(Tt*De)}let vt;if(Oe){let Rt=-1;for(vt=ee;vt<Le;vt++)if(St(se,vt)===St(X,Rt===-1?0:vt-Rt)){if(Rt===-1&&(Rt=vt),vt-Rt+1===ut)return Rt*De}else Rt!==-1&&(vt-=vt-Rt),Rt=-1}else for(ee+ut>Le&&(ee=Le-ut),vt=ee;vt>=0;vt--){let Rt=!0;for(let Tt=0;Tt<ut;Tt++)if(St(se,vt+Tt)!==St(X,Tt)){Rt=!1;break}if(Rt)return vt}return-1}I.prototype.includes=function(X,ee,pe){return this.indexOf(X,ee,pe)!==-1},I.prototype.indexOf=function(X,ee,pe){return me(this,X,ee,pe,!0)},I.prototype.lastIndexOf=function(X,ee,pe){return me(this,X,ee,pe,!1)};function ke(se,X,ee,pe){ee=Number(ee)||0;const Oe=se.length-ee;pe?(pe=Number(pe),pe>Oe&&(pe=Oe)):pe=Oe;const De=X.length;pe>De/2&&(pe=De/2);let Le;for(Le=0;Le<pe;++Le){const ut=parseInt(X.substr(Le*2,2),16);if(Qt(ut))return Le;se[ee+Le]=ut}return Le}function xe(se,X,ee,pe){return rn(Kt(X,se.length-ee),se,ee,pe)}function _e(se,X,ee,pe){return rn(Gt(X),se,ee,pe)}function Te(se,X,ee,pe){return rn(nn(X),se,ee,pe)}function qe(se,X,ee,pe){return rn(dn(X,se.length-ee),se,ee,pe)}I.prototype.write=function(X,ee,pe,Oe){if(ee===void 0)Oe="utf8",pe=this.length,ee=0;else if(pe===void 0&&typeof ee=="string")Oe=ee,pe=this.length,ee=0;else if(isFinite(ee))ee=ee>>>0,isFinite(pe)?(pe=pe>>>0,Oe===void 0&&(Oe="utf8")):(Oe=pe,pe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const De=this.length-ee;if((pe===void 0||pe>De)&&(pe=De),X.length>0&&(pe<0||ee<0)||ee>this.length)throw new RangeError("Attempt to write outside buffer bounds");Oe||(Oe="utf8");let Le=!1;for(;;)switch(Oe){case"hex":return ke(this,X,ee,pe);case"utf8":case"utf-8":return xe(this,X,ee,pe);case"ascii":case"latin1":case"binary":return _e(this,X,ee,pe);case"base64":return Te(this,X,ee,pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,X,ee,pe);default:if(Le)throw new TypeError("Unknown encoding: "+Oe);Oe=(""+Oe).toLowerCase(),Le=!0}},I.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ve(se,X,ee){return X===0&&ee===se.length?K.fromByteArray(se):K.fromByteArray(se.slice(X,ee))}function We(se,X,ee){ee=Math.min(se.length,ee);const pe=[];let Oe=X;for(;Oe<ee;){const De=se[Oe];let Le=null,ut=De>239?4:De>223?3:De>191?2:1;if(Oe+ut<=ee){let St,vt,Rt,Tt;switch(ut){case 1:De<128&&(Le=De);break;case 2:St=se[Oe+1],(St&192)===128&&(Tt=(De&31)<<6|St&63,Tt>127&&(Le=Tt));break;case 3:St=se[Oe+1],vt=se[Oe+2],(St&192)===128&&(vt&192)===128&&(Tt=(De&15)<<12|(St&63)<<6|vt&63,Tt>2047&&(Tt<55296||Tt>57343)&&(Le=Tt));break;case 4:St=se[Oe+1],vt=se[Oe+2],Rt=se[Oe+3],(St&192)===128&&(vt&192)===128&&(Rt&192)===128&&(Tt=(De&15)<<18|(St&63)<<12|(vt&63)<<6|Rt&63,Tt>65535&&Tt<1114112&&(Le=Tt))}}Le===null?(Le=65533,ut=1):Le>65535&&(Le-=65536,pe.push(Le>>>10&1023|55296),Le=56320|Le&1023),pe.push(Le),Oe+=ut}return Ot(pe)}const Fe=4096;function Ot(se){const X=se.length;if(X<=Fe)return String.fromCharCode.apply(String,se);let ee="",pe=0;for(;pe<X;)ee+=String.fromCharCode.apply(String,se.slice(pe,pe+=Fe));return ee}function It(se,X,ee){let pe="";ee=Math.min(se.length,ee);for(let Oe=X;Oe<ee;++Oe)pe+=String.fromCharCode(se[Oe]&127);return pe}function Dt(se,X,ee){let pe="";ee=Math.min(se.length,ee);for(let Oe=X;Oe<ee;++Oe)pe+=String.fromCharCode(se[Oe]);return pe}function zt(se,X,ee){const pe=se.length;(!X||X<0)&&(X=0),(!ee||ee<0||ee>pe)&&(ee=pe);let Oe="";for(let De=X;De<ee;++De)Oe+=gn[se[De]];return Oe}function Ut(se,X,ee){const pe=se.slice(X,ee);let Oe="";for(let De=0;De<pe.length-1;De+=2)Oe+=String.fromCharCode(pe[De]+pe[De+1]*256);return Oe}I.prototype.slice=function(X,ee){const pe=this.length;X=~~X,ee=ee===void 0?pe:~~ee,X<0?(X+=pe,X<0&&(X=0)):X>pe&&(X=pe),ee<0?(ee+=pe,ee<0&&(ee=0)):ee>pe&&(ee=pe),ee<X&&(ee=X);const Oe=this.subarray(X,ee);return Object.setPrototypeOf(Oe,I.prototype),Oe};function gt(se,X,ee){if(se%1!==0||se<0)throw new RangeError("offset is not uint");if(se+X>ee)throw new RangeError("Trying to access beyond buffer length")}I.prototype.readUintLE=I.prototype.readUIntLE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=this[X],De=1,Le=0;for(;++Le<ee&&(De*=256);)Oe+=this[X+Le]*De;return Oe},I.prototype.readUintBE=I.prototype.readUIntBE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=this[X+--ee],De=1;for(;ee>0&&(De*=256);)Oe+=this[X+--ee]*De;return Oe},I.prototype.readUint8=I.prototype.readUInt8=function(X,ee){return X=X>>>0,ee||gt(X,1,this.length),this[X]},I.prototype.readUint16LE=I.prototype.readUInt16LE=function(X,ee){return X=X>>>0,ee||gt(X,2,this.length),this[X]|this[X+1]<<8},I.prototype.readUint16BE=I.prototype.readUInt16BE=function(X,ee){return X=X>>>0,ee||gt(X,2,this.length),this[X]<<8|this[X+1]},I.prototype.readUint32LE=I.prototype.readUInt32LE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),(this[X]|this[X+1]<<8|this[X+2]<<16)+this[X+3]*16777216},I.prototype.readUint32BE=I.prototype.readUInt32BE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),this[X]*16777216+(this[X+1]<<16|this[X+2]<<8|this[X+3])},I.prototype.readBigUInt64LE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=ee+this[++X]*2**8+this[++X]*2**16+this[++X]*2**24,De=this[++X]+this[++X]*2**8+this[++X]*2**16+pe*2**24;return BigInt(Oe)+(BigInt(De)<<BigInt(32))}),I.prototype.readBigUInt64BE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=ee*2**24+this[++X]*2**16+this[++X]*2**8+this[++X],De=this[++X]*2**24+this[++X]*2**16+this[++X]*2**8+pe;return(BigInt(Oe)<<BigInt(32))+BigInt(De)}),I.prototype.readIntLE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=this[X],De=1,Le=0;for(;++Le<ee&&(De*=256);)Oe+=this[X+Le]*De;return De*=128,Oe>=De&&(Oe-=Math.pow(2,8*ee)),Oe},I.prototype.readIntBE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=ee,De=1,Le=this[X+--Oe];for(;Oe>0&&(De*=256);)Le+=this[X+--Oe]*De;return De*=128,Le>=De&&(Le-=Math.pow(2,8*ee)),Le},I.prototype.readInt8=function(X,ee){return X=X>>>0,ee||gt(X,1,this.length),this[X]&128?(255-this[X]+1)*-1:this[X]},I.prototype.readInt16LE=function(X,ee){X=X>>>0,ee||gt(X,2,this.length);const pe=this[X]|this[X+1]<<8;return pe&32768?pe|4294901760:pe},I.prototype.readInt16BE=function(X,ee){X=X>>>0,ee||gt(X,2,this.length);const pe=this[X+1]|this[X]<<8;return pe&32768?pe|4294901760:pe},I.prototype.readInt32LE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),this[X]|this[X+1]<<8|this[X+2]<<16|this[X+3]<<24},I.prototype.readInt32BE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),this[X]<<24|this[X+1]<<16|this[X+2]<<8|this[X+3]},I.prototype.readBigInt64LE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=this[X+4]+this[X+5]*2**8+this[X+6]*2**16+(pe<<24);return(BigInt(Oe)<<BigInt(32))+BigInt(ee+this[++X]*2**8+this[++X]*2**16+this[++X]*2**24)}),I.prototype.readBigInt64BE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=(ee<<24)+this[++X]*2**16+this[++X]*2**8+this[++X];return(BigInt(Oe)<<BigInt(32))+BigInt(this[++X]*2**24+this[++X]*2**16+this[++X]*2**8+pe)}),I.prototype.readFloatLE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),F.read(this,X,!0,23,4)},I.prototype.readFloatBE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),F.read(this,X,!1,23,4)},I.prototype.readDoubleLE=function(X,ee){return X=X>>>0,ee||gt(X,8,this.length),F.read(this,X,!0,52,8)},I.prototype.readDoubleBE=function(X,ee){return X=X>>>0,ee||gt(X,8,this.length),F.read(this,X,!1,52,8)};function it(se,X,ee,pe,Oe,De){if(!I.isBuffer(se))throw new TypeError('"buffer" argument must be a Buffer instance');if(X>Oe||X<De)throw new RangeError('"value" argument is out of bounds');if(ee+pe>se.length)throw new RangeError("Index out of range")}I.prototype.writeUintLE=I.prototype.writeUIntLE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,pe=pe>>>0,!Oe){const ut=Math.pow(2,8*pe)-1;it(this,X,ee,pe,ut,0)}let De=1,Le=0;for(this[ee]=X&255;++Le<pe&&(De*=256);)this[ee+Le]=X/De&255;return ee+pe},I.prototype.writeUintBE=I.prototype.writeUIntBE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,pe=pe>>>0,!Oe){const ut=Math.pow(2,8*pe)-1;it(this,X,ee,pe,ut,0)}let De=pe-1,Le=1;for(this[ee+De]=X&255;--De>=0&&(Le*=256);)this[ee+De]=X/Le&255;return ee+pe},I.prototype.writeUint8=I.prototype.writeUInt8=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,1,255,0),this[ee]=X&255,ee+1},I.prototype.writeUint16LE=I.prototype.writeUInt16LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,65535,0),this[ee]=X&255,this[ee+1]=X>>>8,ee+2},I.prototype.writeUint16BE=I.prototype.writeUInt16BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,65535,0),this[ee]=X>>>8,this[ee+1]=X&255,ee+2},I.prototype.writeUint32LE=I.prototype.writeUInt32LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,4294967295,0),this[ee+3]=X>>>24,this[ee+2]=X>>>16,this[ee+1]=X>>>8,this[ee]=X&255,ee+4},I.prototype.writeUint32BE=I.prototype.writeUInt32BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,4294967295,0),this[ee]=X>>>24,this[ee+1]=X>>>16,this[ee+2]=X>>>8,this[ee+3]=X&255,ee+4};function Zt(se,X,ee,pe,Oe){ct(X,pe,Oe,se,ee,7);let De=Number(X&BigInt(4294967295));se[ee++]=De,De=De>>8,se[ee++]=De,De=De>>8,se[ee++]=De,De=De>>8,se[ee++]=De;let Le=Number(X>>BigInt(32)&BigInt(4294967295));return se[ee++]=Le,Le=Le>>8,se[ee++]=Le,Le=Le>>8,se[ee++]=Le,Le=Le>>8,se[ee++]=Le,ee}function Ct(se,X,ee,pe,Oe){ct(X,pe,Oe,se,ee,7);let De=Number(X&BigInt(4294967295));se[ee+7]=De,De=De>>8,se[ee+6]=De,De=De>>8,se[ee+5]=De,De=De>>8,se[ee+4]=De;let Le=Number(X>>BigInt(32)&BigInt(4294967295));return se[ee+3]=Le,Le=Le>>8,se[ee+2]=Le,Le=Le>>8,se[ee+1]=Le,Le=Le>>8,se[ee]=Le,ee+8}I.prototype.writeBigUInt64LE=on(function(X,ee=0){return Zt(this,X,ee,BigInt(0),BigInt("0xffffffffffffffff"))}),I.prototype.writeBigUInt64BE=on(function(X,ee=0){return Ct(this,X,ee,BigInt(0),BigInt("0xffffffffffffffff"))}),I.prototype.writeIntLE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,!Oe){const St=Math.pow(2,8*pe-1);it(this,X,ee,pe,St-1,-St)}let De=0,Le=1,ut=0;for(this[ee]=X&255;++De<pe&&(Le*=256);)X<0&&ut===0&&this[ee+De-1]!==0&&(ut=1),this[ee+De]=(X/Le>>0)-ut&255;return ee+pe},I.prototype.writeIntBE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,!Oe){const St=Math.pow(2,8*pe-1);it(this,X,ee,pe,St-1,-St)}let De=pe-1,Le=1,ut=0;for(this[ee+De]=X&255;--De>=0&&(Le*=256);)X<0&&ut===0&&this[ee+De+1]!==0&&(ut=1),this[ee+De]=(X/Le>>0)-ut&255;return ee+pe},I.prototype.writeInt8=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,1,127,-128),X<0&&(X=255+X+1),this[ee]=X&255,ee+1},I.prototype.writeInt16LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,32767,-32768),this[ee]=X&255,this[ee+1]=X>>>8,ee+2},I.prototype.writeInt16BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,32767,-32768),this[ee]=X>>>8,this[ee+1]=X&255,ee+2},I.prototype.writeInt32LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,2147483647,-2147483648),this[ee]=X&255,this[ee+1]=X>>>8,this[ee+2]=X>>>16,this[ee+3]=X>>>24,ee+4},I.prototype.writeInt32BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,2147483647,-2147483648),X<0&&(X=4294967295+X+1),this[ee]=X>>>24,this[ee+1]=X>>>16,this[ee+2]=X>>>8,this[ee+3]=X&255,ee+4},I.prototype.writeBigInt64LE=on(function(X,ee=0){return Zt(this,X,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),I.prototype.writeBigInt64BE=on(function(X,ee=0){return Ct(this,X,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ue(se,X,ee,pe,Oe,De){if(ee+pe>se.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function ot(se,X,ee,pe,Oe){return X=+X,ee=ee>>>0,Oe||Ue(se,X,ee,4),F.write(se,X,ee,pe,23,4),ee+4}I.prototype.writeFloatLE=function(X,ee,pe){return ot(this,X,ee,!0,pe)},I.prototype.writeFloatBE=function(X,ee,pe){return ot(this,X,ee,!1,pe)};function Jt(se,X,ee,pe,Oe){return X=+X,ee=ee>>>0,Oe||Ue(se,X,ee,8),F.write(se,X,ee,pe,52,8),ee+8}I.prototype.writeDoubleLE=function(X,ee,pe){return Jt(this,X,ee,!0,pe)},I.prototype.writeDoubleBE=function(X,ee,pe){return Jt(this,X,ee,!1,pe)},I.prototype.copy=function(X,ee,pe,Oe){if(!I.isBuffer(X))throw new TypeError("argument should be a Buffer");if(pe||(pe=0),!Oe&&Oe!==0&&(Oe=this.length),ee>=X.length&&(ee=X.length),ee||(ee=0),Oe>0&&Oe<pe&&(Oe=pe),Oe===pe||X.length===0||this.length===0)return 0;if(ee<0)throw new RangeError("targetStart out of bounds");if(pe<0||pe>=this.length)throw new RangeError("Index out of range");if(Oe<0)throw new RangeError("sourceEnd out of bounds");Oe>this.length&&(Oe=this.length),X.length-ee<Oe-pe&&(Oe=X.length-ee+pe);const De=Oe-pe;return this===X&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ee,pe,Oe):Uint8Array.prototype.set.call(X,this.subarray(pe,Oe),ee),De},I.prototype.fill=function(X,ee,pe,Oe){if(typeof X=="string"){if(typeof ee=="string"?(Oe=ee,ee=0,pe=this.length):typeof pe=="string"&&(Oe=pe,pe=this.length),Oe!==void 0&&typeof Oe!="string")throw new TypeError("encoding must be a string");if(typeof Oe=="string"&&!I.isEncoding(Oe))throw new TypeError("Unknown encoding: "+Oe);if(X.length===1){const Le=X.charCodeAt(0);(Oe==="utf8"&&Le<128||Oe==="latin1")&&(X=Le)}}else typeof X=="number"?X=X&255:typeof X=="boolean"&&(X=Number(X));if(ee<0||this.length<ee||this.length<pe)throw new RangeError("Out of range index");if(pe<=ee)return this;ee=ee>>>0,pe=pe===void 0?this.length:pe>>>0,X||(X=0);let De;if(typeof X=="number")for(De=ee;De<pe;++De)this[De]=X;else{const Le=I.isBuffer(X)?X:I.from(X,Oe),ut=Le.length;if(ut===0)throw new TypeError('The value "'+X+'" is invalid for argument "value"');for(De=0;De<pe-ee;++De)this[De+ee]=Le[De%ut]}return this};const Nt={};function rt(se,X,ee){Nt[se]=class extends ee{constructor(){super(),Object.defineProperty(this,"message",{value:X.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${se}]`,this.stack,delete this.name}get code(){return se}set code(Oe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Oe,writable:!0})}toString(){return`${this.name} [${se}]: ${this.message}`}}}rt("ERR_BUFFER_OUT_OF_BOUNDS",function(se){return se?`${se} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),rt("ERR_INVALID_ARG_TYPE",function(se,X){return`The "${se}" argument must be of type number. Received type ${typeof X}`},TypeError),rt("ERR_OUT_OF_RANGE",function(se,X,ee){let pe=`The value of "${se}" is out of range.`,Oe=ee;return Number.isInteger(ee)&&Math.abs(ee)>2**32?Oe=tt(String(ee)):typeof ee=="bigint"&&(Oe=String(ee),(ee>BigInt(2)**BigInt(32)||ee<-(BigInt(2)**BigInt(32)))&&(Oe=tt(Oe)),Oe+="n"),pe+=` It must be ${X}. Received ${Oe}`,pe},RangeError);function tt(se){let X="",ee=se.length;const pe=se[0]==="-"?1:0;for(;ee>=pe+4;ee-=3)X=`_${se.slice(ee-3,ee)}${X}`;return`${se.slice(0,ee)}${X}`}function at(se,X,ee){wt(X,"offset"),(se[X]===void 0||se[X+ee]===void 0)&&Bt(X,se.length-(ee+1))}function ct(se,X,ee,pe,Oe,De){if(se>ee||se<X){const Le=typeof X=="bigint"?"n":"";let ut;throw X===0||X===BigInt(0)?ut=`>= 0${Le} and < 2${Le} ** ${(De+1)*8}${Le}`:ut=`>= -(2${Le} ** ${(De+1)*8-1}${Le}) and < 2 ** ${(De+1)*8-1}${Le}`,new Nt.ERR_OUT_OF_RANGE("value",ut,se)}at(pe,Oe,De)}function wt(se,X){if(typeof se!="number")throw new Nt.ERR_INVALID_ARG_TYPE(X,"number",se)}function Bt(se,X,ee){throw Math.floor(se)!==se?(wt(se,ee),new Nt.ERR_OUT_OF_RANGE("offset","an integer",se)):X<0?new Nt.ERR_BUFFER_OUT_OF_BOUNDS:new Nt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${X}`,se)}const Lt=/[^+/0-9A-Za-z-_]/g;function Ft(se){if(se=se.split("=")[0],se=se.trim().replace(Lt,""),se.length<2)return"";for(;se.length%4!==0;)se=se+"=";return se}function Kt(se,X){X=X||1/0;let ee;const pe=se.length;let Oe=null;const De=[];for(let Le=0;Le<pe;++Le){if(ee=se.charCodeAt(Le),ee>55295&&ee<57344){if(!Oe){if(ee>56319){(X-=3)>-1&&De.push(239,191,189);continue}else if(Le+1===pe){(X-=3)>-1&&De.push(239,191,189);continue}Oe=ee;continue}if(ee<56320){(X-=3)>-1&&De.push(239,191,189),Oe=ee;continue}ee=(Oe-55296<<10|ee-56320)+65536}else Oe&&(X-=3)>-1&&De.push(239,191,189);if(Oe=null,ee<128){if((X-=1)<0)break;De.push(ee)}else if(ee<2048){if((X-=2)<0)break;De.push(ee>>6|192,ee&63|128)}else if(ee<65536){if((X-=3)<0)break;De.push(ee>>12|224,ee>>6&63|128,ee&63|128)}else if(ee<1114112){if((X-=4)<0)break;De.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,ee&63|128)}else throw new Error("Invalid code point")}return De}function Gt(se){const X=[];for(let ee=0;ee<se.length;++ee)X.push(se.charCodeAt(ee)&255);return X}function dn(se,X){let ee,pe,Oe;const De=[];for(let Le=0;Le<se.length&&!((X-=2)<0);++Le)ee=se.charCodeAt(Le),pe=ee>>8,Oe=ee%256,De.push(Oe),De.push(pe);return De}function nn(se){return K.toByteArray(Ft(se))}function rn(se,X,ee,pe){let Oe;for(Oe=0;Oe<pe&&!(Oe+ee>=X.length||Oe>=se.length);++Oe)X[Oe+ee]=se[Oe];return Oe}function Vt(se,X){return se instanceof X||se!=null&&se.constructor!=null&&se.constructor.name!=null&&se.constructor.name===X.name}function Qt(se){return se!==se}const gn=function(){const se="0123456789abcdef",X=new Array(256);for(let ee=0;ee<16;++ee){const pe=ee*16;for(let Oe=0;Oe<16;++Oe)X[pe+Oe]=se[ee]+se[Oe]}return X}();function on(se){return typeof BigInt>"u"?Yt:se}function Yt(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var q=toolsEbml&&toolsEbml.__assign||function(){return q=Object.assign||function(D){for(var N,O=1,I=arguments.length;O<I;O++){N=arguments[O];for(var z in N)Object.prototype.hasOwnProperty.call(N,z)&&(D[z]=N[z])}return D},q.apply(this,arguments)},K=toolsEbml&&toolsEbml.__spreadArray||function(D,N,O){if(O||arguments.length===2)for(var I=0,z=N.length,J;I<z;I++)(J||!(I in N))&&(J||(J=Array.prototype.slice.call(N,0,I)),J[I]=N[I]);return D.concat(J||Array.prototype.slice.call(N))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var F=requireTools(),Z=function(){function D(){}return D.readVint=function(N,O){O===void 0&&(O=0);var I=8-Math.floor(Math.log2(N[O]));if(I>8){var z=D.readHexString(N,O,O+I);throw new Error("Unrepresentable length: ".concat(I," ").concat(z))}if(O+I>N.length)return null;for(var J=N[O]&(1<<8-I)-1,Q=1;Q<I;Q+=1){if(Q===7&&J>=Math.pow(2,8)&&N[O+7]>0)return{length:I,value:-1};J*=Math.pow(2,8),J+=N[O+Q]}return{length:I,value:J}},D.writeVint=function(N){if(N<0||N>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(N));var O=1;for(O=1;O<=8&&!(N<Math.pow(2,7*O)-1);O+=1);for(var I=F.Buffer.alloc(O),z=N,J=1;J<=O;J+=1){var Q=z&255;I[O-J]=Q,z-=Q,z/=Math.pow(2,8)}return I[0]|=1<<8-O,I},D.concatenate=function(N,O){return!N&&!O?F.Buffer.from([]):!N||N.byteLength===0?O:!O||O.byteLength===0?N:F.Buffer.from(K(K([],N,!0),O,!0))},D.readHexString=function(N,O,I){return O===void 0&&(O=0),I===void 0&&(I=N.byteLength),Array.from(N.slice(O,I)).map(function(z){return Number(z).toString(16)}).reduce(function(z,J){return"".concat(z).concat(J.padStart(2,"0"))},"")},D.readUtf8=function(N){try{return F.Buffer.from(N).toString("utf8")}catch{return null}},D.readUnsigned=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 1:return O.getUint8(0);case 2:return O.getUint16(0);case 4:return O.getUint32(0)}return N.byteLength<=6?N.reduce(function(I,z){return I*256+z},0):D.readHexString(N,0,N.byteLength)},D.readSigned=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 1:return O.getInt8(0);case 2:return O.getInt16(0);case 4:return O.getInt32(0);default:return NaN}},D.readFloat=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 4:return O.getFloat32(0);case 8:return O.getFloat64(0);default:return NaN}},D.readDate=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 1:return new Date(O.getUint8(0));case 2:return new Date(O.getUint16(0));case 4:return new Date(O.getUint32(0));case 8:return new Date(Number.parseInt(D.readHexString(N),16));default:return new Date(0)}},D.readDataFromTag=function(N,O){var I=N.type,z=N.name,J=N.track,Q=N.discardable||!1,ne=N.keyframe||!1,re=null,te;switch(I){case"u":te=D.readUnsigned(O);break;case"f":te=D.readFloat(O);break;case"i":te=D.readSigned(O);break;case"s":te=String.fromCharCode.apply(String,O);break;case"8":te=D.readUtf8(O);break;case"d":te=D.readDate(O);break}if(z==="SimpleBlock"||z==="Block"){var oe=0,le=D.readVint(O,oe),ae=le.length,ce=le.value;oe+=ae,J=ce,te=D.readSigned(O.subarray(oe,oe+2)),oe+=2,z==="SimpleBlock"&&(ne=!!(O[ae+2]&128),Q=!!(O[ae+2]&1)),oe+=1,re=O.subarray(oe)}return q(q({},N),{data:O,discardable:Q,keyframe:ne,payload:re,track:J,value:te})},D}();return toolsEbml.default=Z,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(q,K,F){K=K||0;for(var Z=1;Z<=8&&!(q[K]>=Math.pow(2,8-Z));Z++);if(Z>8)throw new Error("Unrepresentable length: "+Z+" "+q.toString("hex",K,K+Z));if(K+Z>q.length)return null;var D,N=q[K]&(1<<8-Z)-1;for(D=1;D<Z;D++){if(D===7&&N>=Math.pow(2,45)&&q[K+7]>0)return{length:Z,value:-1};N*=Math.pow(2,8),N+=q[K+D]}return F&&(N-=Math.pow(2,Z*7-1)-1),{length:Z,value:N}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var q=requireVint();function K(F){this.buffer=F,this.offset=0}return K.prototype.nextInt16BE=function(){var F=this.buffer.readInt16BE(this.offset);return this.offset+=2,F},K.prototype.nextUInt8=function(){var F=this.buffer.readUInt8(this.offset);return this.offset+=1,F},K.prototype.nextUIntV=function(){var F=q(this.buffer,this.offset);return this.offset+=F.length,F.value},K.prototype.nextIntV=function(){var F=q(this.buffer,this.offset,!0);return this.offset+=F.length,F.value},K.prototype.nextBuffer=function(F){var Z=F?this.buffer.slice(this.offset,this.offset+F):this.buffer.slice(this.offset);return this.offset+=F||this.length,Z},Object.defineProperty(K.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=K,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var q=requireBufferReader(),K=1,F=3,Z=2;ebmlBlock=function(N){var O={},I=new q(N);O.trackNumber=I.nextUIntV(),O.timecode=I.nextInt16BE();var z=I.nextUInt8();O.invisible=!!(z&8),O.keyframe=!!(z&128),O.discardable=!!(z&1);var J=(z&6)>>1;return O.frames=D(I,J),O};function D(N,O){if(!O)return[N.nextBuffer()];var I,z,J=[],Q=N.nextUInt8()+1;if(O===Z){if(N.length%Q!==0)throw new Error("Fixed-Size Lacing Error");for(z=N.length/Q,I=0;I<Q;I++)J.push(N.nextBuffer(z));return J}var ne=[];if(O===K)for(I=0;I<Q-1;I++){var re;z=0;do re=N.nextUInt8(),z+=re;while(re===255);ne.push(z)}else if(O===F)for(z=N.nextUIntV(),ne.push(z),I=1;I<Q-1;I++)z+=N.nextIntV(),ne.push(z);for(I=0;I<Q-1;I++)J.push(N.nextBuffer(ne[I]));return J.push(N.nextBuffer()),J}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function(q){Object.defineProperty(q,"__esModule",{value:!0}),q.convertEBMLDateToJSDate=q.createFloatBuffer=q.createIntBuffer=q.createUIntBuffer=q.encodeValueToBuffer=q.concat=q.putRefinedMetaData=q.extractElement=q.removeElement=q.makeMetadataSeekable=q.createRIFFChunk=q.VP8BitStreamToRiffWebPBuffer=q.WebPBlockFilter=q.encodeTag=q.readBlock=q.ebmlBlock=q.writeVint=q.readVint=q.Buffer=void 0;var K=requireInt64Buffer(),F=requireEBMLEncoder(),Z=requireBuffer(),D=requireToolsEbml(),N=requireEbmlBlock();q.Buffer=Z.Buffer,q.readVint=D.default.readVint,q.writeVint=D.default.writeVint,q.ebmlBlock=N;function O(_e){return(0,q.ebmlBlock)(new q.Buffer(_e))}q.readBlock=O;function I(_e,Te,qe){return qe===void 0&&(qe=!1),fe([_e,qe?new q.Buffer("01ffffffffffffff","hex"):(0,q.writeVint)(Te.length),Te])}q.encodeTag=I;function z(_e){return _e.reduce(function(Te,qe){if(qe.type!=="b"||qe.name!=="SimpleBlock")return Te;var Ve=(0,q.ebmlBlock)(qe.data),We=Ve.frames.some(function(Fe){var Ot=Fe.slice(3,6).toString("hex");return Ot==="9d012a"});return We?Te.concat(qe):Te},[])}q.WebPBlockFilter=z;function J(_e){var Te=Q("VP8 ",_e),qe=fe([new q.Buffer("WEBP","ascii"),Te]);return Q("RIFF",qe)}q.VP8BitStreamToRiffWebPBuffer=J;function Q(_e,Te){var qe=new q.Buffer(4);return qe.writeUInt32LE(Te.byteLength,0),fe([new q.Buffer(_e.substr(0,4),"ascii"),qe,Te,new q.Buffer(Te.byteLength%2===0?0:1)])}q.createRIFFChunk=Q;function ne(_e,Te,qe){var Ve=te("EBML",_e),We=le(Ve),Fe=We+12,Ot=_e[_e.length-1].dataEnd-Fe,It=te("Info",_e);re("Duration",It),It.splice(1,0,{name:"Duration",type:"f",data:ke(Te,8)});for(var Dt=le(It),zt=te("Tracks",_e),Ut=le(zt),gt=47,it=[],Zt=5+qe.length*15,Ct=[],Ue=-1,ot=10,Jt=function(ct){var wt=gt,Bt=wt+Dt,Lt=Bt+Ut,Ft=Lt+Zt,Kt=Ft-Ot;if(it=[],it.push({name:"SeekHead",type:"m",isEnd:!1}),it.push({name:"Seek",type:"m",isEnd:!1}),it.push({name:"SeekID",type:"b",data:new q.Buffer([21,73,169,102])}),it.push({name:"SeekPosition",type:"u",data:me(wt)}),it.push({name:"Seek",type:"m",isEnd:!0}),it.push({name:"Seek",type:"m",isEnd:!1}),it.push({name:"SeekID",type:"b",data:new q.Buffer([22,84,174,107])}),it.push({name:"SeekPosition",type:"u",data:me(Bt)}),it.push({name:"Seek",type:"m",isEnd:!0}),it.push({name:"Seek",type:"m",isEnd:!1}),it.push({name:"SeekID",type:"b",data:new q.Buffer([28,83,187,107])}),it.push({name:"SeekPosition",type:"u",data:me(Lt)}),it.push({name:"Seek",type:"m",isEnd:!0}),it.push({name:"SeekHead",type:"m",isEnd:!0}),gt=le(it),Ct=[],Ct.push({name:"Cues",type:"m",isEnd:!1}),qe.forEach(function(Gt){var dn=Gt.CueTrack,nn=Gt.CueClusterPosition,rn=Gt.CueTime;Ct.push({name:"CuePoint",type:"m",isEnd:!1}),Ct.push({name:"CueTime",type:"u",data:me(rn)}),Ct.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Ct.push({name:"CueTrack",type:"u",data:me(dn)}),nn-=Fe,nn+=Kt,Ct.push({name:"CueClusterPosition",type:"u",data:me(nn)}),Ct.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Ct.push({name:"CuePoint",type:"m",isEnd:!0})}),Ct.push({name:"Cues",type:"m",isEnd:!0}),Zt=le(Ct),Ue!==Kt){if(Ue=Kt,ct===ot-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Nt=0;Nt<ot;Nt++){var rt=Jt(Nt);if(rt==="break")break}var tt=[].concat.apply([],[Ve,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},it,It,zt,Ct]),at=new F.default().encode(tt);return at}q.makeMetadataSeekable=ne;function re(_e,Te){for(var qe=-1,Ve=0;Ve<Te.length;Ve++){var We=Te[Ve];if(We.name===_e)if(We.type==="m")if(!We.isEnd)qe=Ve;else{if(qe==-1)throw new Error("Detected ".concat(_e," closing element before finding the start"));Te.splice(qe,Ve-qe+1);return}else{Te.splice(Ve,1);return}}}q.removeElement=re;function te(_e,Te){for(var qe=[],Ve=-1,We=0;We<Te.length;We++){var Fe=Te[We];if(Fe.name===_e)if(Fe.type==="m")if(!Fe.isEnd)Ve=We;else{if(Ve==-1)throw new Error("Detected ".concat(_e," closing element before finding the start"));qe=Te.slice(Ve,We+1);break}else{qe.push(Te[We]);break}}return qe}q.extractElement=te;function oe(_e,Te){Array.isArray(Te.cueInfos)&&!Array.isArray(Te.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),Te.cues=Te.cueInfos);for(var qe=[],Ve=[],We=0;We<_e.length;We++){var Fe=_e[We];if(Fe.type==="m"&&Fe.name==="Segment"){if(qe=_e.slice(0,We),Ve=_e.slice(We),Fe.unknownSize){Ve.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(Ve[Ve.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Ot=Ve[Ve.length-1].dataEnd,It=qe[qe.length-1].dataEnd,Dt=new F.default().encode(qe).byteLength,zt=Dt-It,Ut=Ot-Ve[0].tagStart;Ve[0].tagStart-It,Ve[0].tagStart;var gt=new q.Buffer([24,83,128,103]),it=new q.Buffer("01ffffffffffffff","hex"),Zt=gt.byteLength+it.byteLength,Ct=Ut,Ue;for(Ue=1;Ue<20;Ue++){var ot=It+Zt+Ct,Jt=ot-Ot,Nt=zt+Jt,rt=ae(Ve,Nt,Te),tt=new F.default().encode(rt).byteLength;if(tt===Ct)return new F.default().encode([].concat(qe,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],rt));Ct=tt}throw new Error("unable to refine metadata, stable size could not be found in "+Ue+" iterations!")}q.putRefinedMetaData=oe;function le(_e){var Te=new F.default;return _e.reduce(function(qe,Ve){return qe.concat(Te.encode([Ve]))},[]).reduce(function(qe,Ve){return qe+Ve.byteLength},0)}function ae(_e,Te,qe){var Ve=qe.duration,We=qe.clusterPtrs,Fe=qe.cues,Ot=_e.slice(0);if(typeof Ve=="number"){var It=!1;Ot.forEach(function(zt){zt.type==="f"&&zt.name==="Duration"&&(It=!0,zt.data=ke(Ve,8))}),It||we(Ot,"Info",[{name:"Duration",type:"f",data:ke(Ve,8)}])}Array.isArray(Fe)&&we(Ot,"Cues",de(Fe,Te));var Dt=[];return Array.isArray(We)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Dt=ce(We,Te)),we(Ot,"SeekHead",Dt,!0),Ot}function ce(_e,Te){var qe=[];return _e.forEach(function(Ve){qe.push({name:"Seek",type:"m",isEnd:!1}),qe.push({name:"SeekID",type:"b",data:new q.Buffer([31,67,182,117])}),qe.push({name:"SeekPosition",type:"u",data:me(Ve+Te)}),qe.push({name:"Seek",type:"m",isEnd:!0})}),qe}function de(_e,Te){var qe=[];return _e.forEach(function(Ve){var We=Ve.CueTrack,Fe=Ve.CueClusterPosition,Ot=Ve.CueTime;qe.push({name:"CuePoint",type:"m",isEnd:!1}),qe.push({name:"CueTime",type:"u",data:me(Ot)}),qe.push({name:"CueTrackPositions",type:"m",isEnd:!1}),qe.push({name:"CueTrack",type:"u",data:me(We)}),qe.push({name:"CueClusterPosition",type:"u",data:me(Fe+Te)}),qe.push({name:"CueTrackPositions",type:"m",isEnd:!0}),qe.push({name:"CuePoint",type:"m",isEnd:!0})}),qe}function we(_e,Te,qe,Ve){Ve===void 0&&(Ve=!1);for(var We=-1,Fe=0;Fe<_e.length;Fe++){var Ot=_e[Fe];if(Ot.type==="m"&&Ot.name===Te&&Ot.isEnd===!1){We=Fe;break}}We>=0?Array.prototype.splice.apply(_e,[We+1,0].concat(qe)):Ve?[].concat([{name:Te,type:"m",isEnd:!1}],qe,[{name:Te,type:"m",isEnd:!0}]).reverse().forEach(function(It){_e.unshift(It)}):(_e.push({name:Te,type:"m",isEnd:!1}),qe.forEach(function(It){_e.push(It)}),_e.push({name:Te,type:"m",isEnd:!0}))}function fe(_e){return q.Buffer.concat(_e)}q.concat=fe;function ge(_e){var Te=new q.Buffer(0);if(_e.type==="m")return _e;switch(_e.type){case"u":Te=me(_e.value);break;case"i":Te=ve(_e.value);break;case"f":Te=ke(_e.value);break;case"s":Te=new q.Buffer(_e.value,"ascii");break;case"8":Te=new q.Buffer(_e.value,"utf8");break;case"b":Te=_e.value;break;case"d":Te=new K.Int64BE(_e.value.getTime().toString()).toBuffer();break}return Object.assign({},_e,{data:Te})}q.encodeValueToBuffer=ge;function me(_e){for(var Te=1;_e>=Math.pow(2,8*Te);Te++);if(Te>=7)return console.warn("7bit or more bigger uint not supported."),new K.Uint64BE(_e).toBuffer();var qe=new q.Buffer(Te);return qe.writeUIntBE(_e,0,Te),qe}q.createUIntBuffer=me;function ve(_e){for(var Te=1;_e>=Math.pow(2,8*Te);Te++);if(Te>=7)return console.warn("7bit or more bigger uint not supported."),new K.Int64BE(_e).toBuffer();var qe=new q.Buffer(Te);return qe.writeIntBE(_e,0,Te),qe}q.createIntBuffer=ve;function ke(_e,Te){if(Te===void 0&&(Te=8),Te===8){var qe=new q.Buffer(8);return qe.writeDoubleBE(_e,0),qe}else if(Te===4){var qe=new q.Buffer(4);return qe.writeFloatBE(_e,0),qe}else throw new Error("float type bits must 4bytes or 8bytes")}q.createFloatBuffer=ke;function xe(_e){return _e instanceof Date?_e:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(_e)/1e3/1e3)}q.convertEBMLDateToJSDate=xe}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var q=requireInt64Buffer(),K=requireTools(),F=requireTools(),Z=requireEbmlID(),D;(function(O){O[O.STATE_TAG=1]="STATE_TAG",O[O.STATE_SIZE=2]="STATE_SIZE",O[O.STATE_CONTENT=3]="STATE_CONTENT"})(D||(D={}));var N=function(){function O(){this._buffer=new K.Buffer(0),this._tag_stack=[],this._state=D.STATE_TAG,this._cursor=0,this._total=0,this._schema=Z.byEbmlID,this._result=[]}return O.prototype.decode=function(I){this.readChunk(I);var z=this._result;return this._result=[],z},O.prototype.readChunk=function(I){for(this._buffer=F.concat([this._buffer,new K.Buffer(I)]);this._cursor<this._buffer.length&&!(this._state===D.STATE_TAG&&!this.readTag()||this._state===D.STATE_SIZE&&!this.readSize()||this._state===D.STATE_CONTENT&&!this.readContent()););},O.prototype.getSchemaInfo=function(I){return this._schema[I]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},O.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var I=(0,K.readVint)(this._buffer,this._cursor);if(I==null)return!1;var z=this._buffer.slice(this._cursor,this._cursor+I.length),J=z.reduce(function(re,te,oe,le){return re+te*Math.pow(16,2*(le.length-1-oe))},0),Q=this.getSchemaInfo(J),ne={EBML_ID:J.toString(16),schema:Q,type:Q.type,name:Q.name,level:Q.level,tagStart:this._total,tagEnd:this._total+I.length,sizeStart:this._total+I.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(ne),this._cursor+=I.length,this._total+=I.length,this._state=D.STATE_SIZE,!0},O.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var I=(0,K.readVint)(this._buffer,this._cursor);if(I==null)return!1;var z=this._tag_stack[this._tag_stack.length-1];return z.sizeEnd=z.sizeStart+I.length,z.dataStart=z.sizeEnd,z.dataSize=I.value,I.value===-1?(z.dataEnd=-1,z.type==="m"&&(z.unknownSize=!0)):z.dataEnd=z.sizeEnd+I.value,this._cursor+=I.length,this._total+=I.length,this._state=D.STATE_CONTENT,!0},O.prototype.readContent=function(){var I=this._tag_stack[this._tag_stack.length-1];if(I.type==="m"){if(I.isEnd=!1,this._result.push(I),this._state=D.STATE_TAG,I.dataSize===0){var z=Object.assign({},I,{isEnd:!0});this._result.push(z),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+I.dataSize)return!1;var J=this._buffer.slice(this._cursor,this._cursor+I.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+I.dataSize),I.data=J,I.type){case"u":I.value=J.readUIntBE(0,J.length);break;case"i":I.value=J.readIntBE(0,J.length);break;case"f":I.value=I.dataSize===4?J.readFloatBE(0):I.dataSize===8?J.readDoubleBE(0):(console.warn("cannot read ".concat(I.dataSize," octets float. failback to 0")),0);break;case"s":I.value=J.toString("ascii");break;case"8":I.value=J.toString("utf8");break;case"b":I.value=J;break;case"d":I.value=(0,K.convertEBMLDateToJSDate)(new q.Int64BE(J).toNumber());break}if(I.value===null)throw new Error("unknown tag type:"+I.type);for(this._result.push(I),this._total+=I.dataSize,this._state=D.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var Q=this._tag_stack[this._tag_stack.length-1];if(Q.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<Q.dataEnd)break;if(Q.type!=="m")throw new Error("parent element is not master element");var z=Object.assign({},Q,{isEnd:!0});this._result.push(z),this._tag_stack.pop()}return!0},O}();return EBMLDecoder.default=N,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var q=typeof Reflect=="object"?Reflect:null,K=q&&typeof q.apply=="function"?q.apply:function(ge,me,ve){return Function.prototype.apply.call(ge,me,ve)},F;q&&typeof q.ownKeys=="function"?F=q.ownKeys:Object.getOwnPropertySymbols?F=function(ge){return Object.getOwnPropertyNames(ge).concat(Object.getOwnPropertySymbols(ge))}:F=function(ge){return Object.getOwnPropertyNames(ge)};function Z(fe){console&&console.warn&&console.warn(fe)}var D=Number.isNaN||function(ge){return ge!==ge};function N(){N.init.call(this)}events.exports=N,events.exports.once=ce,N.EventEmitter=N,N.prototype._events=void 0,N.prototype._eventsCount=0,N.prototype._maxListeners=void 0;var O=10;function I(fe){if(typeof fe!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof fe)}Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:function(){return O},set:function(fe){if(typeof fe!="number"||fe<0||D(fe))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+fe+".");O=fe}}),N.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},N.prototype.setMaxListeners=function(ge){if(typeof ge!="number"||ge<0||D(ge))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ge+".");return this._maxListeners=ge,this};function z(fe){return fe._maxListeners===void 0?N.defaultMaxListeners:fe._maxListeners}N.prototype.getMaxListeners=function(){return z(this)},N.prototype.emit=function(ge){for(var me=[],ve=1;ve<arguments.length;ve++)me.push(arguments[ve]);var ke=ge==="error",xe=this._events;if(xe!==void 0)ke=ke&&xe.error===void 0;else if(!ke)return!1;if(ke){var _e;if(me.length>0&&(_e=me[0]),_e instanceof Error)throw _e;var Te=new Error("Unhandled error."+(_e?" ("+_e.message+")":""));throw Te.context=_e,Te}var qe=xe[ge];if(qe===void 0)return!1;if(typeof qe=="function")K(qe,this,me);else for(var Ve=qe.length,We=oe(qe,Ve),ve=0;ve<Ve;++ve)K(We[ve],this,me);return!0};function J(fe,ge,me,ve){var ke,xe,_e;if(I(me),xe=fe._events,xe===void 0?(xe=fe._events=Object.create(null),fe._eventsCount=0):(xe.newListener!==void 0&&(fe.emit("newListener",ge,me.listener?me.listener:me),xe=fe._events),_e=xe[ge]),_e===void 0)_e=xe[ge]=me,++fe._eventsCount;else if(typeof _e=="function"?_e=xe[ge]=ve?[me,_e]:[_e,me]:ve?_e.unshift(me):_e.push(me),ke=z(fe),ke>0&&_e.length>ke&&!_e.warned){_e.warned=!0;var Te=new Error("Possible EventEmitter memory leak detected. "+_e.length+" "+String(ge)+" listeners added. Use emitter.setMaxListeners() to increase limit");Te.name="MaxListenersExceededWarning",Te.emitter=fe,Te.type=ge,Te.count=_e.length,Z(Te)}return fe}N.prototype.addListener=function(ge,me){return J(this,ge,me,!1)},N.prototype.on=N.prototype.addListener,N.prototype.prependListener=function(ge,me){return J(this,ge,me,!0)};function Q(){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 ne(fe,ge,me){var ve={fired:!1,wrapFn:void 0,target:fe,type:ge,listener:me},ke=Q.bind(ve);return ke.listener=me,ve.wrapFn=ke,ke}N.prototype.once=function(ge,me){return I(me),this.on(ge,ne(this,ge,me)),this},N.prototype.prependOnceListener=function(ge,me){return I(me),this.prependListener(ge,ne(this,ge,me)),this},N.prototype.removeListener=function(ge,me){var ve,ke,xe,_e,Te;if(I(me),ke=this._events,ke===void 0)return this;if(ve=ke[ge],ve===void 0)return this;if(ve===me||ve.listener===me)--this._eventsCount===0?this._events=Object.create(null):(delete ke[ge],ke.removeListener&&this.emit("removeListener",ge,ve.listener||me));else if(typeof ve!="function"){for(xe=-1,_e=ve.length-1;_e>=0;_e--)if(ve[_e]===me||ve[_e].listener===me){Te=ve[_e].listener,xe=_e;break}if(xe<0)return this;xe===0?ve.shift():le(ve,xe),ve.length===1&&(ke[ge]=ve[0]),ke.removeListener!==void 0&&this.emit("removeListener",ge,Te||me)}return this},N.prototype.off=N.prototype.removeListener,N.prototype.removeAllListeners=function(ge){var me,ve,ke;if(ve=this._events,ve===void 0)return this;if(ve.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ve[ge]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ve[ge]),this;if(arguments.length===0){var xe=Object.keys(ve),_e;for(ke=0;ke<xe.length;++ke)_e=xe[ke],_e!=="removeListener"&&this.removeAllListeners(_e);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(me=ve[ge],typeof me=="function")this.removeListener(ge,me);else if(me!==void 0)for(ke=me.length-1;ke>=0;ke--)this.removeListener(ge,me[ke]);return this};function re(fe,ge,me){var ve=fe._events;if(ve===void 0)return[];var ke=ve[ge];return ke===void 0?[]:typeof ke=="function"?me?[ke.listener||ke]:[ke]:me?ae(ke):oe(ke,ke.length)}N.prototype.listeners=function(ge){return re(this,ge,!0)},N.prototype.rawListeners=function(ge){return re(this,ge,!1)},N.listenerCount=function(fe,ge){return typeof fe.listenerCount=="function"?fe.listenerCount(ge):te.call(fe,ge)},N.prototype.listenerCount=te;function te(fe){var ge=this._events;if(ge!==void 0){var me=ge[fe];if(typeof me=="function")return 1;if(me!==void 0)return me.length}return 0}N.prototype.eventNames=function(){return this._eventsCount>0?F(this._events):[]};function oe(fe,ge){for(var me=new Array(ge),ve=0;ve<ge;++ve)me[ve]=fe[ve];return me}function le(fe,ge){for(;ge+1<fe.length;ge++)fe[ge]=fe[ge+1];fe.pop()}function ae(fe){for(var ge=new Array(fe.length),me=0;me<ge.length;++me)ge[me]=fe[me].listener||fe[me];return ge}function ce(fe,ge){return new Promise(function(me,ve){function ke(_e){fe.removeListener(ge,xe),ve(_e)}function xe(){typeof fe.removeListener=="function"&&fe.removeListener("error",ke),me([].slice.call(arguments))}we(fe,ge,xe,{once:!0}),ge!=="error"&&de(fe,ke,{once:!0})})}function de(fe,ge,me){typeof fe.on=="function"&&we(fe,"error",ge,me)}function we(fe,ge,me,ve){if(typeof fe.on=="function")ve.once?fe.once(ge,me):fe.on(ge,me);else if(typeof fe.addEventListener=="function")fe.addEventListener(ge,function ke(xe){ve.once&&fe.removeEventListener(ge,ke),me(xe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof fe)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var q=EBMLReader&&EBMLReader.__extends||function(){var D=function(N,O){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,z){I.__proto__=z}||function(I,z){for(var J in z)Object.prototype.hasOwnProperty.call(z,J)&&(I[J]=z[J])},D(N,O)};return function(N,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");D(N,O);function I(){this.constructor=N}N.prototype=O===null?Object.create(O):(I.prototype=O.prototype,new I)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var K=requireEvents(),F=requireTools(),Z=function(D){q(N,D);function N(){var O=D.call(this)||this;return O.logGroup="",O.hasLoggingStarted=!1,O.metadataloaded=!1,O.chunks=[],O.stack=[],O.segmentOffset=0,O.last2SimpleBlockVideoTrackTimecode=[0,0],O.last2SimpleBlockAudioTrackTimecode=[0,0],O.lastClusterTimecode=0,O.lastClusterPosition=0,O.timecodeScale=1e6,O.metadataSize=0,O.metadatas=[],O.cues=[],O.firstVideoBlockRead=!1,O.firstAudioBlockRead=!1,O.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},O.trackTypes=[],O.trackDefaultDuration=[],O.trackCodecDelay=[],O.trackInfo={type:"nothing"},O.ended=!1,O.logging=!1,O.use_duration_every_simpleblock=!1,O.use_webp=!1,O.use_segment_info=!0,O.drop_default_duration=!0,O}return N.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()},N.prototype.emit_segment_info=function(){var O=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var J=this.lastClusterTimecode,Q=this.duration,ne=this.timecodeScale;this.emit("cluster",{timecode:J,data:O}),this.emit("duration",{timecodeScale:ne,duration:Q})}else{this.metadataloaded=!0,this.metadatas=O;var I=this.trackTypes.indexOf(1),z=this.trackTypes.indexOf(2);if(this.trackInfo=I>=0&&z>=0?{type:"both",trackNumber:I}:I>=0?{type:"video",trackNumber:I}:z>=0?{type:"audio",trackNumber:z}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:O,metadataSize:this.metadataSize})}},N.prototype.read=function(O){var I=this,z=!1;if(!this.ended){if(O.type==="m")if(O.isEnd)this.stack.pop();else{var J=this.stack[this.stack.length-1];if(J!=null&&J.level>=O.level){this.stack.pop(),this.logging&&console.groupEnd(),J.dataEnd=O.dataEnd,J.dataSize=O.dataEnd-J.dataStart,J.unknownSize=!1;var Q=Object.assign({},J,{name:J.name,type:J.type,isEnd:!0});this.chunks.push(Q)}this.stack.push(O)}if(O.type==="m"&&O.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=O.dataStart,this.emit("segment_offset",this.segmentOffset);else if(O.type==="b"&&O.name==="SimpleBlock"){var ne=F.ebmlBlock(O.data),re=ne.timecode,te=ne.trackNumber,oe=ne.frames;if(this.trackTypes[te]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var le=this.lastClusterTimecode+re;this.cues.push({CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le}),this.emit("cue_info",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],re]}else if(this.trackTypes[te]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var le=this.lastClusterTimecode+re;this.cues.push({CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le}),this.emit("cue_info",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],re]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&oe.forEach(function(ae){var ce=ae.slice(3,6).toString("hex");if(ce==="9d012a"){var de=F.VP8BitStreamToRiffWebPBuffer(ae),we=new Blob([de],{type:"image/webp"}),fe=I.duration;I.emit("webp",{currentTime:fe,webp:we})}})}else O.type==="m"&&O.name==="Cluster"&&O.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",O.tagStart),this.lastClusterPosition=O.tagStart):O.type==="u"&&O.name==="Timecode"?this.lastClusterTimecode=O.value:O.type==="u"&&O.name==="TimecodeScale"?this.timecodeScale=O.value:O.type==="m"&&O.name==="TrackEntry"?O.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}:O.type==="u"&&O.name==="TrackType"?this.currentTrack.TrackType=O.value:O.type==="u"&&O.name==="TrackNumber"?this.currentTrack.TrackNumber=O.value:O.type==="u"&&O.name==="CodecDelay"?this.currentTrack.CodecDelay=O.value:O.type==="u"&&O.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),z=!0):this.currentTrack.DefaultDuration=O.value:O.name==="unknown"&&console.warn(O);!this.metadataloaded&&O.dataEnd>0&&(this.metadataSize=O.dataEnd),z||this.chunks.push(O),this.logging&&this.put(O)}},Object.defineProperty(N.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var O=0,I=0,z=0,J=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof J=="number")O=J;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){O=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockAudioTrackTimecode[1]}else{O=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){O=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){O=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockAudioTrackTimecode[1]}var ne=(this.lastClusterTimecode+z)*this.timecodeScale+O-I,re=ne/this.timecodeScale;return Math.floor(re)},enumerable:!1,configurable:!0}),N.prototype.addListener=function(O,I){return D.prototype.addListener.call(this,O,I)},N.prototype.put=function(O){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),O.type==="m"?O.isEnd?console.groupEnd():console.group(O.name+":"+O.tagStart):O.type==="b"?console.log(O.name,O.type):console.log(O.name,O.tagStart,O.type,O.value)},N}(K.EventEmitter);return EBMLReader.default=Z,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(q){var K=ebml&&ebml.__createBinding||(Object.create?function(I,z,J,Q){Q===void 0&&(Q=J),Object.defineProperty(I,Q,{enumerable:!0,get:function(){return z[J]}})}:function(I,z,J,Q){Q===void 0&&(Q=J),I[Q]=z[J]}),F=ebml&&ebml.__exportStar||function(I,z){for(var J in I)J!=="default"&&!Object.prototype.hasOwnProperty.call(z,J)&&K(z,I,J)};Object.defineProperty(q,"__esModule",{value:!0}),q.tools=q.Reader=q.Encoder=q.Decoder=void 0,F(requireEBML(),q);var Z=requireEBMLDecoder();q.Decoder=Z.default;var D=requireEBMLEncoder();q.Encoder=D.default;var N=requireEBMLReader();q.Reader=N.default;var O=requireTools();q.tools=O}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var q=lib&&lib.__awaiter||function(D,N,O,I){function z(J){return J instanceof O?J:new O(function(Q){Q(J)})}return new(O||(O=Promise))(function(J,Q){function ne(oe){try{te(I.next(oe))}catch(le){Q(le)}}function re(oe){try{te(I.throw(oe))}catch(le){Q(le)}}function te(oe){oe.done?J(oe.value):z(oe.value).then(ne,re)}te((I=I.apply(D,N||[])).next())})},K=lib&&lib.__generator||function(D,N){var O={label:0,sent:function(){if(J[0]&1)throw J[1];return J[1]},trys:[],ops:[]},I,z,J,Q;return Q={next:ne(0),throw:ne(1),return:ne(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ne(te){return function(oe){return re([te,oe])}}function re(te){if(I)throw new TypeError("Generator is already executing.");for(;O;)try{if(I=1,z&&(J=te[0]&2?z.return:te[0]?z.throw||((J=z.return)&&J.call(z),0):z.next)&&!(J=J.call(z,te[1])).done)return J;switch(z=0,J&&(te=[te[0]&2,J.value]),te[0]){case 0:case 1:J=te;break;case 4:return O.label++,{value:te[1],done:!1};case 5:O.label++,z=te[1],te=[0];continue;case 7:te=O.ops.pop(),O.trys.pop();continue;default:if(J=O.trys,!(J=J.length>0&&J[J.length-1])&&(te[0]===6||te[0]===2)){O=0;continue}if(te[0]===3&&(!J||te[1]>J[0]&&te[1]<J[3])){O.label=te[1];break}if(te[0]===6&&O.label<J[1]){O.label=J[1],J=te;break}if(J&&O.label<J[2]){O.label=J[2],O.ops.push(te);break}J[2]&&O.ops.pop(),O.trys.pop();continue}te=N.call(D,O)}catch(oe){te=[6,oe],z=0}finally{I=J=0}if(te[0]&5)throw te[1];return{value:te[0]?te[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var F=requireEbml();function Z(D){return q(this,void 0,void 0,function(){var N,O,I,z,J,Q,ne,re,te,oe,le,ae;return K(this,function(ce){switch(ce.label){case 0:if(!D)throw Error("call to fixWebmDuration requires a blob");N=new F.Decoder,O=new F.Reader,I=D.stream(),z=I.getReader(),ce.label=1;case 1:return[4,z.read()];case 2:return J=ce.sent(),Q=J.done,ne=J.value,Q?(O.stop(),[3,3]):(re=N.decode(ne),re=re==null?void 0:re.filter(function(de){return de.type!=="unknown"}),re.forEach(function(de){O.read(de)}),ne=null,[3,1]);case 3:return te=F.tools.makeMetadataSeekable(O.metadatas,O.duration,O.cues),oe=new Blob([te],{type:D.type}),le=D.slice(O.metadataSize),ae=new Blob([oe,le],{type:D.type}),[2,ae]}})})}return lib.default=Z,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){st(this,en);st(this,yn,!1);st(this,pn,!1);st(this,xn,0);st(this,Rn,0);st(this,cn,0);st(this,un,0);st(this,vn,0);Ie(this,"onchange",K=>{});Ie(this,"onDurationChange",K=>{});Ie(this,"start",async(K="")=>{K||(K=`video_Record_${E$1(Date.now())}`);let F=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(Z=>{const D=Z.getTracks();for(const O of D)O.onended=()=>this.stop();At(this,yn,!0),At(this,pn,!1),At(this,en,new MediaRecorder(Z)),Be(this,en).start();const N=new Date().getTime();At(this,xn,N),At(this,cn,N),Be(this,bn).call(this),Be(this,Cn).call(this),Be(this,en).addEventListener("dataavailable",O=>{F.push(O.data)}),Be(this,en).addEventListener("stop",async()=>{At(this,yn,!1);const O=new Date().getTime();At(this,Rn,O),At(this,un,Be(this,un)+(O-Be(this,cn))),Be(this,bn).call(this),clearInterval(Be(this,vn));const I=Z.getTracks();for(const re of I)re.stop();if(Be(this,en)===null)return;const z=new Blob(F,{type:Be(this,en).mimeType}),J=await fixWebmDuration(z),Q=URL.createObjectURL(J),ne=document.createElement("a");ne.href=Q,ne.download=`${K}.mp4`,ne.click(),URL.revokeObjectURL(Q),F=[],At(this,en,null)})})});Ie(this,"pause",async()=>{var F;await new Promise(Z=>setTimeout(()=>Z(!0),300)),(F=Be(this,en))==null||F.pause(),At(this,pn,!0);const K=new Date().getTime();At(this,un,Be(this,un)+(K-Be(this,cn))),Be(this,bn).call(this),clearInterval(Be(this,vn))});Ie(this,"resume",async()=>{var F;(F=Be(this,en))==null||F.resume(),At(this,pn,!1);const K=new Date().getTime();At(this,cn,K),Be(this,bn).call(this),Be(this,Cn).call(this)});Ie(this,"stop",async()=>{var K;(K=Be(this,en))==null||K.stop()});Ie(this,"getDuration",()=>{if(Be(this,cn)===0)return 0;let K=Be(this,un);const F=new Date().getTime();if(Be(this,yn)&&Be(this,pn)===!1){const Z=F-Be(this,cn);At(this,cn,F),K=K+Z}return K});Ie(this,"getInfo",()=>({active:Be(this,yn),pause:Be(this,pn),startTime:Be(this,xn),endTime:Be(this,Rn),duration:Be(this,un)}));st(this,bn,()=>{const K=this.getInfo();this.onchange(K)});st(this,Cn,()=>{clearInterval(Be(this,vn)),At(this,vn,window.setInterval(()=>{At(this,un,this.getDuration()),this.onDurationChange(Be(this,un))},500))})}}en=new WeakMap,yn=new WeakMap,pn=new WeakMap,xn=new WeakMap,Rn=new WeakMap,cn=new WeakMap,un=new WeakMap,vn=new WeakMap,bn=new WeakMap,Cn=new WeakMap;class RoomBase{constructor(K){Ie(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!0,logUrl:"https://logs.putplay.cc",newPublishAutoSubscribe:!0});Ie(this,"sdk_service_version","1.0.6");Ie(this,"prohibitNotify",!1);Ie(this,"isEarly",!1);Ie(this,"isInRoom",!1);Ie(this,"taskQueue");Ie(this,"roomState","ready");Ie(this,"createAt",Date.now());Ie(this,"cwsIns");Ie(this,"peerIns");Ie(this,"transceiverMap",new Map);Ie(this,"sendChannel");Ie(this,"receiveChannel");Ie(this,"userMap",new Map);Ie(this,"setLocalStreamActiveMap",new Map);Ie(this,"phoneyStreams",new Map);Ie(this,"recorder",new StreamRecorder);Ie(this,"networkQualityTester",new NetworkQualityTester);Ie(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Ie(this,"reportLogs",(K,F="未知错误")=>{const{appid:Z,userId:D,earlyId:N="",logUrl:O,reportErr:I}=this.options;if(!I)return;const z="web",J=Q=>({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})[Q].toString();{const Q=J(K),ne={origin:z,type:Q,app_id:Z,user_id:D,ins_id:N,desc:F},re=btoa(encodeURI(JSON.stringify(ne))),te=`${O}/upload/log?log_key=${re}`;{const oe=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),ae=new TextEncoder().encode(oe),ce=pako.deflate(ae,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:ne,url:te,size:lt(ce.byteLength)}),fetch(te,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:ce})}}});Ie(this,"initPhoneyStreams",(K,F=[])=>{F.length===0&&(F=mediaType_keys);for(const Z of F){const D=this.phoneyStreams.get(Z);if(D){const N=D.getTracks();for(const O of N)O.stop()}switch(Z){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(K));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(K));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});Ie(this,"getPhoneyStreams",K=>this.phoneyStreams.get(K));Ie(this,"getRoomInfo",()=>{const{options:K,roomState:F,createAt:Z}=this;return{...K,roomState:F,createAt:Z}});Ie(this,"setRoomState",K=>{this.roomState=K;const F=enum_roomState[K],Z={state:K,stateStr:F};this.cwsIns.emitNotify("onRoomState",{code:200,data:Z,desc:"room state is change."})});Ie(this,"setOptions",async K=>{const F={...this.options,...K};this.options=F});Ie(this,"stopStream",async K=>{const F=K.getTracks();for(const Z of F)Z.stop()});Ie(this,"getMediaDevicesErrInfo",async()=>{try{const K=await navigator.mediaDevices.enumerateDevices();K.find(Z=>Z.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),K.find(Z=>Z.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(K){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",K)}return this.mediaDevicesErrInfo});Ie(this,"getUserMediaKey",(K,F)=>`${K}-${F}`);Ie(this,"getCallAction",async K=>{let F="";const Z=N=>K.findIndex(({type:I,enabled:z=!0})=>I===N&&z)===-1?"0":"1";return F=`${Z(0)}${F}`,F=`${Z(1)}${F}`,F=`${Z(2)}${F}`,F=`${Z(3)}${F}`,parseInt(F,2)});Ie(this,"getCallActionMap",(K=0)=>{const Z=Number(K).toString(2).padStart(4,"0").split(""),[D,N,O,I]=Z;return{microphoneCamera_audio:!!Number(I),microphoneCamera_video:!!Number(O),screenSharing_video:!!Number(N),screenSharing_audio:!!Number(D)}});Ie(this,"getBanBehaviorMap",(K=0)=>{const Z=Number(K).toString(2).padStart(4,"0").split(""),[D,N,O,I]=Z;return{microphoneCamera_audio:!!Number(I),microphoneCamera_video:!!Number(O),screenSharing_video:!!Number(N),screenSharing_audio:!!Number(D)}});Ie(this,"getAverageVolume",(K,F)=>{K.getByteFrequencyData(F);let Z=0;for(let N=0;N<F.length;N++)Z+=F[N];return Math.ceil(Z/F.length)});Ie(this,"getTrackNamesFormTracks",(K,F=[],Z="trackName")=>{const D=[];for(const N of K){const{type:O}=N;if(F.length===0||F.includes(O)){const I=N[Z];I&&D.push(`${I}`)}}return D});Ie(this,"usersFilter",K=>dt(K,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((D,N)=>D.id.localeCompare(N.id,"en")));this.setOptions(K),this.cwsIns=new CallsWebSocket({...K}),this.taskQueue=new Y(["createWs","createSession","ice","joinRoom","createTrack","publish","subscribe","renegotiate","closeTrack"],{debug:K.debug}),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1),this.options.debug&&this.networkQualityTester.testAll().then(F=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: networkQualityTester",F)})}}var m=Object.defineProperty,G=(q,K,F)=>K in q?m(q,K,{enumerable:!0,configurable:!0,writable:!0,value:F}):q[K]=F,e$1=(q,K,F)=>G(q,typeof K!="symbol"?K+"":K,F);class g{constructor(K,F){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 D of Z)D.stop(),this.inputStream.removeTrack(D)}}),e$1(this,"getStream",()=>this.filterStream(this.outputStream)),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:D}=this;Z.getByteFrequencyData(D);let N=0;for(let O=0;O<D.length;O++)N+=D[O];return Math.ceil(N/D.length)}),e$1(this,"mixAudio",(Z,D="bgm")=>new Promise(async(N,O)=>{try{{const J=this.mixAudioMap.get(D);J&&J.stop()}const I=D==="bgs"?this.bgsGainNode:this.bgmGainNode,z=this.audioContext.createBufferSource();this.mixAudioMap.set(D,z),z.buffer=Z,z.connect(I),z.onended=()=>{z.disconnect(I),this.mixAudioMap.delete(D),N(!0)},z.start(0)}catch(I){O(I)}})),e$1(this,"mixAudioStop",Z=>{const D=this.mixAudioMap.get(Z);D==null||D.stop()}),e$1(this,"changeMix",(Z,D)=>{const N=Z==="bgs"?this.bgsGainNode:this.bgmGainNode;D?N.connect(this.destinationNode):N.disconnect(this.destinationNode)}),F&&(this.audioContext=F),this.inputStream=K,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:D,enhanceGainNode:N,bgsGainNode:O,bgmGainNode:I,analyserNode:z,outputGainNode:J,destinationNode:Q}=this;Z.connect(D),D.connect(N),N.connect(z),O.connect(z),I.connect(z),N.connect(Q),O.connect(Q),I.connect(Q),z.connect(J),J.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}}class RoomMedias extends RoomBase{constructor(F){super(F);st(this,kn,[]);st(this,tn,new Map);st(this,jt,new Map);st(this,ln,new Map);st(this,fn,new Map);st(this,mn,new Map);Ie(this,"localStreamsActionMap",new Map);st(this,Sn,new Map);Ie(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Ie(this,"initMediaPhoneyStreams",(F=[])=>this.initPhoneyStreams(this.audioContext,F));Ie(this,"initLocalStreamsFilter",()=>{for(const F of mediaType_keys){const Z=async D=>D;Be(this,Sn).set(F,Z)}});Ie(this,"setLocalFilterStream",(F,Z)=>{Be(this,Sn).set(F,Z)});st(this,Ln,()=>{Be(this,jt).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),Be(this,jt).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),Be(this,jt).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),Be(this,jt).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});st(this,Fn,()=>{Be(this,tn).set("audioinput","default"),Be(this,tn).set("videoinput","default"),Be(this,tn).set("audiooutput","default")});Ie(this,"emitNotifyUpdateUsersStreams",async F=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:F,desc:"users streams is change."})});Ie(this,"initUserMediaStreamContext",async(F,Z,D)=>{const[N]=D.getTracks();if(!N){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:F,mediaType:Z,stream:D});return}this.removeUserMediaStreamContext(F,Z);const O=this.getUserMediaKey(F,Z),{kind:I}=N;switch(I){case"audio":{const z=new MediaStream;z.addTrack(N);const J=new g(z,this.audioContext);Be(this,ln).set(O,J)}break;case"video":{const z=new VideoMediaContext(N);Be(this,fn).set(O,z)}break}});Ie(this,"getUserMediaStreamContext",(F,Z)=>{const D=this.getUserMediaKey(F,Z);if(["microphoneCamera_audio","screenSharing_audio"].includes(Z))return Be(this,ln).get(D);if(["microphoneCamera_video","screenSharing_video"].includes(Z))return Be(this,fn).get(D)});Ie(this,"getUserAudioMediaStreamContext",(F,Z)=>{const D=this.getUserMediaKey(F,Z);return Be(this,ln).get(D)});Ie(this,"removeUserMediaStreamContext",(F,Z)=>{const D=this.getUserMediaKey(F,Z);if(["microphoneCamera_audio","screenSharing_audio"].includes(Z)){const N=Be(this,ln).get(D);return N==null||N.stop(),Be(this,ln).delete(D)}if(["microphoneCamera_video","screenSharing_video"].includes(Z)){const N=Be(this,fn).get(D);return N==null||N.stop(),Be(this,fn).get(D)}});Ie(this,"getUserStream",(F,Z)=>{const D=this.getUserMediaStreamContext(F,Z);return(D==null?void 0:D.getStream())||new MediaStream});Ie(this,"getUserStreams",(F,Z=[])=>{Z.length===0&&(Z=mediaType_keys);const D={};for(const N of Z){const O=this.getUserStream(F,N);D[N]=O}return D});Ie(this,"removeUserStreams",async(F,Z=[])=>{Z.length===0&&(Z=mediaType_keys);for(const D of Z)this.removeUserMediaStreamContext(F,D)});Ie(this,"clearUserStreams",()=>{{const F=Be(this,ln).values();for(const Z of F)Z.stop();At(this,ln,new Map)}{const F=Be(this,fn).values();for(const Z of F)Z.stop();At(this,fn,new Map)}});Ie(this,"setMediaTrackConstraints",async(F,Z)=>{Be(this,jt).set(F,Z);const D=await this.getLocalStream(F);if(!D)return;const N=D.getTracks();if(N.length!==0)for(const O of N){const I=O.getConstraints(),J={...Be(this,jt).get(F),...I,...Z};await O.applyConstraints(J)}});Ie(this,"stopLocalStreams",async(F=[])=>{F.length===0&&(F=mediaType_keys);for(const Z of F){const D=Be(this,mn).get(Z);D&&await this.stopStream(D),Be(this,mn).delete(Z)}});Ie(this,"addLocalStream",(F,Z)=>{const D=Be(this,mn).get(F);D&&this.stopStream(D),Be(this,mn).set(F,Z)});Ie(this,"initLocalStream",async F=>{switch(F){case"microphoneCamera_audio":{const Z=Be(this,tn).get("audioinput"),D=Be(this,jt).get("microphoneCamera_audio"),N=await navigator.mediaDevices.getUserMedia({audio:{deviceId:Z,...D},video:!1});this.addLocalStream("microphoneCamera_audio",N)}break;case"microphoneCamera_video":{const Z=Be(this,tn).get("videoinput"),D=Be(this,jt).get("microphoneCamera_video"),N=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:Z,...D}});this.addLocalStream("microphoneCamera_video",N)}break;case"microphoneCamera":{const Z=Be(this,tn).get("audioinput"),D=Be(this,tn).get("videoinput"),N=Be(this,jt).get("microphoneCamera_audio"),O=Be(this,jt).get("microphoneCamera_video"),z=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:Z,...N},video:{deviceId:D,...O}})).getTracks();for(const J of z){const{kind:Q}=J;if(Q==="audio"){const ne=new MediaStream;ne.addTrack(J),this.addLocalStream("microphoneCamera_audio",ne)}if(Q==="video"){const ne=new MediaStream;ne.addTrack(J),this.addLocalStream("microphoneCamera_video",ne)}}}break;case"screenSharing_audio":{const Z=Be(this,jt).get("screenSharing_audio"),N=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...Z})).getTracks();for(const O of N){const{kind:I}=O;if(I==="audio"){const z=new MediaStream;z.addTrack(O),this.addLocalStream("screenSharing_audio",z)}}}break;case"screenSharing_video":{const Z=Be(this,jt).get(F),N=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...Z})).getTracks();for(const O of N){const{kind:I}=O;if(I==="video"){const z=new MediaStream;z.addTrack(O),this.addLocalStream("screenSharing_video",z)}}}break;case"screenSharing":{const Z=Be(this,jt).get("screenSharing_audio"),D=Be(this,jt).get("screenSharing_video"),O=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...Z,...D})).getTracks();for(const I of O){const{kind:z}=I;if(z==="audio"){const J=new MediaStream;J.addTrack(I),this.addLocalStream("screenSharing_audio",J)}if(z==="video"){const J=new MediaStream;J.addTrack(I),this.addLocalStream("screenSharing_video",J)}}}break}});Ie(this,"getLocalStream",async F=>{const Z=Be(this,mn).get(F),D=Be(this,Sn).get(F);let N=Z;return Z&&D&&(N=await D(Z)),N});Ie(this,"getLocalStreams",async(F=[])=>{F.length===0&&(F=mediaType_keys);const Z={};for(const D of F)Z[D]=await this.getLocalStream(D);return Z});st(this,Tn,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(F=>{At(this,kn,F.sort((Z,D)=>Z.label.localeCompare(D.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(F){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",F)}),Be(this,kn)));st(this,Hn,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await Be(this,Tn).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),Be(this,Tn).call(this)});Ie(this,"getMediaDeviceKind",F=>Be(this,tn).get(F));Ie(this,"changeAudiooutput",async()=>{try{const F=Be(this,tn).get("audiooutput");await this.audioContext.setSinkId(F)}catch(F){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",F)}});Ie(this,"setDeviceKind",(F,Z)=>{Be(this,tn).set(F,Z)});Ie(this,"setAudioOutputDevice",F=>this.setDeviceKind("audiooutput",F));Ie(this,"getEnumerateDevices",async F=>(await Be(this,Tn).call(this),Be(this,kn).filter(D=>D.kind===F)));Ie(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Ie(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Ie(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));Be(this,Hn).call(this),Be(this,Fn).call(this),Be(this,Ln).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var Z;((Z=this.audioContext)==null?void 0:Z.state)==="suspended"&&this.audioContext.resume()})}}kn=new WeakMap,tn=new WeakMap,jt=new WeakMap,ln=new WeakMap,fn=new WeakMap,mn=new WeakMap,Sn=new WeakMap,Ln=new WeakMap,Fn=new WeakMap,Tn=new WeakMap,Hn=new WeakMap;class RoomUsers extends RoomMedias{constructor(F){super(F);Ie(this,"getMaxVolumeUser",()=>{const F=Array.from(this.userMap.values(),({id:D})=>D);if(F.length===0)return;let Z=[];for(const D of F){const N=this.getUserAudioMediaStreamContext(D,"microphoneCamera_audio");if(!N)continue;const O=N.getVolume();Z.push({id:D,volume:O})}return Z=Z.sort((D,N)=>D.volume-N.volume>0?-1:1),Z[0]});Ie(this,"setVolume",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setInputGain(D)});Ie(this,"setEnhanceGain",async(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setEnhanceGain(D)});Ie(this,"setSpeaker",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setOutputGain(D);const O=D===0;N==null||N.setMute(O)});Ie(this,"playBgs",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);return N==null?void 0:N.mixAudio(D,"bgs")});Ie(this,"setBgsGain",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setBgsGain(D)});Ie(this,"stopBgs",(F,Z)=>{const D=this.getUserAudioMediaStreamContext(F,Z);D==null||D.mixAudioStop("bgs")});Ie(this,"playBgm",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);return N==null?void 0:N.mixAudio(D,"bgm")});Ie(this,"setBgmGain",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setBgmGain(D)});Ie(this,"stopBgm",(F,Z)=>{const D=this.getUserAudioMediaStreamContext(F,Z);D==null||D.mixAudioStop("bgm")});Ie(this,"changBgsMix",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.changeMix("bgs",D)});Ie(this,"changBgmMix",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.changeMix("bgm",D)});Ie(this,"getVolume",(F,Z)=>{const D=this.getUserAudioMediaStreamContext(F,Z);return D==null?void 0:D.getVolume()});Ie(this,"clearUsers",()=>{this.userMap=new Map});Ie(this,"removeUsers",async F=>{for(const Z of F)this.userMap.delete(Z),await this.removeUserStreams(Z)});Ie(this,"createUser",async F=>{const Z=Date.now(),D={id:F,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:F===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(F,D)});Ie(this,"getUser",async F=>(this.userMap.has(F)||await this.createUser(F),this.userMap.get(F)));Ie(this,"getUsers",async(F=[])=>{F.length===0&&(F=[...this.userMap.keys()]);const Z=[];for(const D of F){const N=await this.getUser(D);Z.push(N)}return Z});Ie(this,"getAllUserTrackMids",async()=>{const F=await this.getUsers(),Z=[];for(const D of F){const{tracks:N=[]}=D;for(const O of N)Z.push(O.mid)}return Z});Ie(this,"getUserTrackByTrackName",async F=>{const Z=await this.getUsers(),D=[];for(const N of Z){const{tracks:O=[]}=N;for(const I of O){const{trackName:z}=I;F.includes(z)&&D.push(I)}}return D});Ie(this,"getUserTrackFromMid",async F=>{const Z=await this.getUsers();let D;for(const N of Z){const{tracks:O=[]}=N;for(const I of O)if(I.mid===F){D=I;break}}return D});Ie(this,"checkUserInRoom",F=>this.userMap.has(F));Ie(this,"getUsersId",async()=>[...this.userMap.keys()]);Ie(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));Ie(this,"updateIsPublished",async(F,Z=!1)=>{const D=await this.getUser(F);D.isPublished=Z});Ie(this,"setUserUpdateStreams",async(F,Z,D=!0)=>{const N=await this.getUser(F),O={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};O[Z]=D,N.updateStreams=O});Ie(this,"updateUserChannels",async(F,Z=[],D)=>{const N=await this.getUser(F);D&&(Z=[...N.channels,...Z]),N.channels=Z});Ie(this,"updateUsertracks",async(F,Z=[],D)=>{const N=await this.getUser(F);D&&(Z=[...N.tracks,...Z]),Z=Z.filter(({mid:z=""})=>z!==""),Z=pt(Z,["type"]),Z=Z.sort((z,J)=>z.type-J.type<0?-1:1);for(const z of Z)z.userId=F,z.mediaType=mediaType_keys[z.type],z.enabled===void 0&&(z.enabled=!0);N.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const O=dt(N.tracks,["mediaType","enabled","mid","msid","trackName"]),I=dt(Z,["mediaType","enabled","mid","msid","trackName"]);{const z="microphoneCamera_audio",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}{const z="microphoneCamera_video",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}{const z="screenSharing_audio",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}{const z="screenSharing_video",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}N.tracks=Z});Ie(this,"updateUserCallAction",async(F,Z=0)=>{const D=await this.getUser(F);D.callAction=Z,D.callActionStr=Z.toString(2).padStart(4,"0"),D.callActionMap=this.getCallActionMap(Z)});Ie(this,"updateUserBehaviors",async(F,Z=0)=>{const D=await this.getUser(F);D.banBehavior=Z,D.banBehaviorStr=Z.toString(2).padStart(4,"0"),D.banBehaviorMap=this.getBanBehaviorMap(Z)});Ie(this,"updateUserNetwork",async(F,Z={egress:5,ingress:5})=>{const D=await this.getUser(F);D.network=Z});Ie(this,"updateUserPermissions",async(F,Z)=>{if(Z){const D=await this.getUser(F);D.permissions=Z}});Ie(this,"updateUserBase",async F=>{const Z=await this.getUser(F);Z.isSelf=F===this.options.userId,Z.updateAt=Date.now()});Ie(this,"updateUsers",async F=>{for(const Z of F){const{id:D,tracks:N,callAction:O,permissions:I,isPublished:z}=Z;await this.updateUserBase(D),await this.updateIsPublished(D,z),await this.updateUserPermissions(D,I),await this.updateUsertracks(D,N,!0),await this.updateUserCallAction(D,O),await this.updateUserNetwork(D)}});Ie(this,"emitNotifyUpdateUser",async F=>{const Z=await this.getUsers([F]),[D]=this.usersFilter(Z);this.cwsIns.emitNotify("onRoomUser",{code:200,data:D,desc:"user info is change."})});Ie(this,"emitNotifyUpdateUsers",async()=>{const F=await this.getUsers(),Z=this.usersFilter(F);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:Z,desc:"all users info is change."})})}}const t=(q,K=4294967295,F=79764919)=>{const Z=new Int32Array(256);let D,N,O,I=K;for(D=0;D<256;D++){for(O=D<<24,N=8;N>0;--N)O=2147483648&O?O<<1^F:O<<1;Z[D]=O}for(D=0;D<q.length;D++)I=I<<8^Z[255&(I>>24^q[D])];return I},e=(q,K=t)=>{const F=ae=>new Uint8Array(ae.length/2).map((ce,de)=>parseInt(ae.substring(2*de,2*(de+1)),16)),Z=ae=>F(ae)[0],D=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((ae,ce)=>D.set(ae,ce));const N=new Uint8Array(q.length);let O,I,z,J=!1,Q=0,ne=42,re=q.length>13&&q.substring(0,9)==="dynEncode",te=0;re&&(te=11,I=Z(q.substring(9,te)),I<=1&&(te+=2,ne=Z(q.substring(11,te))),I===1&&(te+=8,z=(ae=>new DataView(F(ae).buffer).getInt32(0,!0))(q.substring(13,te))));const oe=256-ne;for(let ae=te;ae<q.length;ae++)if(O=q.charCodeAt(ae),O!==61||J){if(O===92&&ae<q.length-5&&re){const ce=q.charCodeAt(ae+1);ce!==117&&ce!==85||(O=parseInt(q.substring(ae+2,ae+6),16),ae+=5)}if(O>255){const ce=D.get(O);ce&&(O=ce+127)}J&&(J=!1,O-=64),N[Q++]=O<ne&&O>0?O+oe:O-ne}else J=!0;const le=N.subarray(0,Q);if(re&&I===1){const ae=K(le);if(ae!==z){const ce="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",ce+`
|
|
13
|
+
*/var hasRequiredBuffer;function requireBuffer(){return hasRequiredBuffer||(hasRequiredBuffer=1,function(q){const K=requireBase64Js(),F=requireIeee754(),Z=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;q.Buffer=I,q.SlowBuffer=de,q.INSPECT_MAX_BYTES=50;const D=2147483647;q.kMaxLength=D,I.TYPED_ARRAY_SUPPORT=N(),!I.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 N(){try{const se=new Uint8Array(1),X={foo:function(){return 42}};return Object.setPrototypeOf(X,Uint8Array.prototype),Object.setPrototypeOf(se,X),se.foo()===42}catch{return!1}}Object.defineProperty(I.prototype,"parent",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.buffer}}),Object.defineProperty(I.prototype,"offset",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.byteOffset}});function O(se){if(se>D)throw new RangeError('The value "'+se+'" is invalid for option "size"');const X=new Uint8Array(se);return Object.setPrototypeOf(X,I.prototype),X}function I(se,X,ee){if(typeof se=="number"){if(typeof X=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ne(se)}return z(se,X,ee)}I.poolSize=8192;function z(se,X,ee){if(typeof se=="string")return re(se,X);if(ArrayBuffer.isView(se))return oe(se);if(se==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se);if(Vt(se,ArrayBuffer)||se&&Vt(se.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vt(se,SharedArrayBuffer)||se&&Vt(se.buffer,SharedArrayBuffer)))return le(se,X,ee);if(typeof se=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const pe=se.valueOf&&se.valueOf();if(pe!=null&&pe!==se)return I.from(pe,X,ee);const Oe=ae(se);if(Oe)return Oe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof se[Symbol.toPrimitive]=="function")return I.from(se[Symbol.toPrimitive]("string"),X,ee);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof se)}I.from=function(se,X,ee){return z(se,X,ee)},Object.setPrototypeOf(I.prototype,Uint8Array.prototype),Object.setPrototypeOf(I,Uint8Array);function J(se){if(typeof se!="number")throw new TypeError('"size" argument must be of type number');if(se<0)throw new RangeError('The value "'+se+'" is invalid for option "size"')}function Q(se,X,ee){return J(se),se<=0?O(se):X!==void 0?typeof ee=="string"?O(se).fill(X,ee):O(se).fill(X):O(se)}I.alloc=function(se,X,ee){return Q(se,X,ee)};function ne(se){return J(se),O(se<0?0:ce(se)|0)}I.allocUnsafe=function(se){return ne(se)},I.allocUnsafeSlow=function(se){return ne(se)};function re(se,X){if((typeof X!="string"||X==="")&&(X="utf8"),!I.isEncoding(X))throw new TypeError("Unknown encoding: "+X);const ee=we(se,X)|0;let pe=O(ee);const Oe=pe.write(se,X);return Oe!==ee&&(pe=pe.slice(0,Oe)),pe}function te(se){const X=se.length<0?0:ce(se.length)|0,ee=O(X);for(let pe=0;pe<X;pe+=1)ee[pe]=se[pe]&255;return ee}function oe(se){if(Vt(se,Uint8Array)){const X=new Uint8Array(se);return le(X.buffer,X.byteOffset,X.byteLength)}return te(se)}function le(se,X,ee){if(X<0||se.byteLength<X)throw new RangeError('"offset" is outside of buffer bounds');if(se.byteLength<X+(ee||0))throw new RangeError('"length" is outside of buffer bounds');let pe;return X===void 0&&ee===void 0?pe=new Uint8Array(se):ee===void 0?pe=new Uint8Array(se,X):pe=new Uint8Array(se,X,ee),Object.setPrototypeOf(pe,I.prototype),pe}function ae(se){if(I.isBuffer(se)){const X=ce(se.length)|0,ee=O(X);return ee.length===0||se.copy(ee,0,0,X),ee}if(se.length!==void 0)return typeof se.length!="number"||Qt(se.length)?O(0):te(se);if(se.type==="Buffer"&&Array.isArray(se.data))return te(se.data)}function ce(se){if(se>=D)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D.toString(16)+" bytes");return se|0}function de(se){return+se!=se&&(se=0),I.alloc(+se)}I.isBuffer=function(X){return X!=null&&X._isBuffer===!0&&X!==I.prototype},I.compare=function(X,ee){if(Vt(X,Uint8Array)&&(X=I.from(X,X.offset,X.byteLength)),Vt(ee,Uint8Array)&&(ee=I.from(ee,ee.offset,ee.byteLength)),!I.isBuffer(X)||!I.isBuffer(ee))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(X===ee)return 0;let pe=X.length,Oe=ee.length;for(let De=0,Le=Math.min(pe,Oe);De<Le;++De)if(X[De]!==ee[De]){pe=X[De],Oe=ee[De];break}return pe<Oe?-1:Oe<pe?1:0},I.isEncoding=function(X){switch(String(X).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}},I.concat=function(X,ee){if(!Array.isArray(X))throw new TypeError('"list" argument must be an Array of Buffers');if(X.length===0)return I.alloc(0);let pe;if(ee===void 0)for(ee=0,pe=0;pe<X.length;++pe)ee+=X[pe].length;const Oe=I.allocUnsafe(ee);let De=0;for(pe=0;pe<X.length;++pe){let Le=X[pe];if(Vt(Le,Uint8Array))De+Le.length>Oe.length?(I.isBuffer(Le)||(Le=I.from(Le)),Le.copy(Oe,De)):Uint8Array.prototype.set.call(Oe,Le,De);else if(I.isBuffer(Le))Le.copy(Oe,De);else throw new TypeError('"list" argument must be an Array of Buffers');De+=Le.length}return Oe};function we(se,X){if(I.isBuffer(se))return se.length;if(ArrayBuffer.isView(se)||Vt(se,ArrayBuffer))return se.byteLength;if(typeof se!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof se);const ee=se.length,pe=arguments.length>2&&arguments[2]===!0;if(!pe&&ee===0)return 0;let Oe=!1;for(;;)switch(X){case"ascii":case"latin1":case"binary":return ee;case"utf8":case"utf-8":return Kt(se).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee*2;case"hex":return ee>>>1;case"base64":return nn(se).length;default:if(Oe)return pe?-1:Kt(se).length;X=(""+X).toLowerCase(),Oe=!0}}I.byteLength=we;function fe(se,X,ee){let pe=!1;if((X===void 0||X<0)&&(X=0),X>this.length||((ee===void 0||ee>this.length)&&(ee=this.length),ee<=0)||(ee>>>=0,X>>>=0,ee<=X))return"";for(se||(se="utf8");;)switch(se){case"hex":return zt(this,X,ee);case"utf8":case"utf-8":return We(this,X,ee);case"ascii":return It(this,X,ee);case"latin1":case"binary":return Dt(this,X,ee);case"base64":return Ve(this,X,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ut(this,X,ee);default:if(pe)throw new TypeError("Unknown encoding: "+se);se=(se+"").toLowerCase(),pe=!0}}I.prototype._isBuffer=!0;function ge(se,X,ee){const pe=se[X];se[X]=se[ee],se[ee]=pe}I.prototype.swap16=function(){const X=this.length;if(X%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ee=0;ee<X;ee+=2)ge(this,ee,ee+1);return this},I.prototype.swap32=function(){const X=this.length;if(X%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ee=0;ee<X;ee+=4)ge(this,ee,ee+3),ge(this,ee+1,ee+2);return this},I.prototype.swap64=function(){const X=this.length;if(X%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ee=0;ee<X;ee+=8)ge(this,ee,ee+7),ge(this,ee+1,ee+6),ge(this,ee+2,ee+5),ge(this,ee+3,ee+4);return this},I.prototype.toString=function(){const X=this.length;return X===0?"":arguments.length===0?We(this,0,X):fe.apply(this,arguments)},I.prototype.toLocaleString=I.prototype.toString,I.prototype.equals=function(X){if(!I.isBuffer(X))throw new TypeError("Argument must be a Buffer");return this===X?!0:I.compare(this,X)===0},I.prototype.inspect=function(){let X="";const ee=q.INSPECT_MAX_BYTES;return X=this.toString("hex",0,ee).replace(/(.{2})/g,"$1 ").trim(),this.length>ee&&(X+=" ... "),"<Buffer "+X+">"},Z&&(I.prototype[Z]=I.prototype.inspect),I.prototype.compare=function(X,ee,pe,Oe,De){if(Vt(X,Uint8Array)&&(X=I.from(X,X.offset,X.byteLength)),!I.isBuffer(X))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof X);if(ee===void 0&&(ee=0),pe===void 0&&(pe=X?X.length:0),Oe===void 0&&(Oe=0),De===void 0&&(De=this.length),ee<0||pe>X.length||Oe<0||De>this.length)throw new RangeError("out of range index");if(Oe>=De&&ee>=pe)return 0;if(Oe>=De)return-1;if(ee>=pe)return 1;if(ee>>>=0,pe>>>=0,Oe>>>=0,De>>>=0,this===X)return 0;let Le=De-Oe,ut=pe-ee;const St=Math.min(Le,ut),vt=this.slice(Oe,De),Ct=X.slice(ee,pe);for(let Tt=0;Tt<St;++Tt)if(vt[Tt]!==Ct[Tt]){Le=vt[Tt],ut=Ct[Tt];break}return Le<ut?-1:ut<Le?1:0};function me(se,X,ee,pe,Oe){if(se.length===0)return-1;if(typeof ee=="string"?(pe=ee,ee=0):ee>2147483647?ee=2147483647:ee<-2147483648&&(ee=-2147483648),ee=+ee,Qt(ee)&&(ee=Oe?0:se.length-1),ee<0&&(ee=se.length+ee),ee>=se.length){if(Oe)return-1;ee=se.length-1}else if(ee<0)if(Oe)ee=0;else return-1;if(typeof X=="string"&&(X=I.from(X,pe)),I.isBuffer(X))return X.length===0?-1:ve(se,X,ee,pe,Oe);if(typeof X=="number")return X=X&255,typeof Uint8Array.prototype.indexOf=="function"?Oe?Uint8Array.prototype.indexOf.call(se,X,ee):Uint8Array.prototype.lastIndexOf.call(se,X,ee):ve(se,[X],ee,pe,Oe);throw new TypeError("val must be string, number or Buffer")}function ve(se,X,ee,pe,Oe){let De=1,Le=se.length,ut=X.length;if(pe!==void 0&&(pe=String(pe).toLowerCase(),pe==="ucs2"||pe==="ucs-2"||pe==="utf16le"||pe==="utf-16le")){if(se.length<2||X.length<2)return-1;De=2,Le/=2,ut/=2,ee/=2}function St(Ct,Tt){return De===1?Ct[Tt]:Ct.readUInt16BE(Tt*De)}let vt;if(Oe){let Ct=-1;for(vt=ee;vt<Le;vt++)if(St(se,vt)===St(X,Ct===-1?0:vt-Ct)){if(Ct===-1&&(Ct=vt),vt-Ct+1===ut)return Ct*De}else Ct!==-1&&(vt-=vt-Ct),Ct=-1}else for(ee+ut>Le&&(ee=Le-ut),vt=ee;vt>=0;vt--){let Ct=!0;for(let Tt=0;Tt<ut;Tt++)if(St(se,vt+Tt)!==St(X,Tt)){Ct=!1;break}if(Ct)return vt}return-1}I.prototype.includes=function(X,ee,pe){return this.indexOf(X,ee,pe)!==-1},I.prototype.indexOf=function(X,ee,pe){return me(this,X,ee,pe,!0)},I.prototype.lastIndexOf=function(X,ee,pe){return me(this,X,ee,pe,!1)};function ke(se,X,ee,pe){ee=Number(ee)||0;const Oe=se.length-ee;pe?(pe=Number(pe),pe>Oe&&(pe=Oe)):pe=Oe;const De=X.length;pe>De/2&&(pe=De/2);let Le;for(Le=0;Le<pe;++Le){const ut=parseInt(X.substr(Le*2,2),16);if(Qt(ut))return Le;se[ee+Le]=ut}return Le}function xe(se,X,ee,pe){return rn(Kt(X,se.length-ee),se,ee,pe)}function _e(se,X,ee,pe){return rn(Gt(X),se,ee,pe)}function Te(se,X,ee,pe){return rn(nn(X),se,ee,pe)}function qe(se,X,ee,pe){return rn(dn(X,se.length-ee),se,ee,pe)}I.prototype.write=function(X,ee,pe,Oe){if(ee===void 0)Oe="utf8",pe=this.length,ee=0;else if(pe===void 0&&typeof ee=="string")Oe=ee,pe=this.length,ee=0;else if(isFinite(ee))ee=ee>>>0,isFinite(pe)?(pe=pe>>>0,Oe===void 0&&(Oe="utf8")):(Oe=pe,pe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const De=this.length-ee;if((pe===void 0||pe>De)&&(pe=De),X.length>0&&(pe<0||ee<0)||ee>this.length)throw new RangeError("Attempt to write outside buffer bounds");Oe||(Oe="utf8");let Le=!1;for(;;)switch(Oe){case"hex":return ke(this,X,ee,pe);case"utf8":case"utf-8":return xe(this,X,ee,pe);case"ascii":case"latin1":case"binary":return _e(this,X,ee,pe);case"base64":return Te(this,X,ee,pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qe(this,X,ee,pe);default:if(Le)throw new TypeError("Unknown encoding: "+Oe);Oe=(""+Oe).toLowerCase(),Le=!0}},I.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ve(se,X,ee){return X===0&&ee===se.length?K.fromByteArray(se):K.fromByteArray(se.slice(X,ee))}function We(se,X,ee){ee=Math.min(se.length,ee);const pe=[];let Oe=X;for(;Oe<ee;){const De=se[Oe];let Le=null,ut=De>239?4:De>223?3:De>191?2:1;if(Oe+ut<=ee){let St,vt,Ct,Tt;switch(ut){case 1:De<128&&(Le=De);break;case 2:St=se[Oe+1],(St&192)===128&&(Tt=(De&31)<<6|St&63,Tt>127&&(Le=Tt));break;case 3:St=se[Oe+1],vt=se[Oe+2],(St&192)===128&&(vt&192)===128&&(Tt=(De&15)<<12|(St&63)<<6|vt&63,Tt>2047&&(Tt<55296||Tt>57343)&&(Le=Tt));break;case 4:St=se[Oe+1],vt=se[Oe+2],Ct=se[Oe+3],(St&192)===128&&(vt&192)===128&&(Ct&192)===128&&(Tt=(De&15)<<18|(St&63)<<12|(vt&63)<<6|Ct&63,Tt>65535&&Tt<1114112&&(Le=Tt))}}Le===null?(Le=65533,ut=1):Le>65535&&(Le-=65536,pe.push(Le>>>10&1023|55296),Le=56320|Le&1023),pe.push(Le),Oe+=ut}return Ot(pe)}const Fe=4096;function Ot(se){const X=se.length;if(X<=Fe)return String.fromCharCode.apply(String,se);let ee="",pe=0;for(;pe<X;)ee+=String.fromCharCode.apply(String,se.slice(pe,pe+=Fe));return ee}function It(se,X,ee){let pe="";ee=Math.min(se.length,ee);for(let Oe=X;Oe<ee;++Oe)pe+=String.fromCharCode(se[Oe]&127);return pe}function Dt(se,X,ee){let pe="";ee=Math.min(se.length,ee);for(let Oe=X;Oe<ee;++Oe)pe+=String.fromCharCode(se[Oe]);return pe}function zt(se,X,ee){const pe=se.length;(!X||X<0)&&(X=0),(!ee||ee<0||ee>pe)&&(ee=pe);let Oe="";for(let De=X;De<ee;++De)Oe+=gn[se[De]];return Oe}function Ut(se,X,ee){const pe=se.slice(X,ee);let Oe="";for(let De=0;De<pe.length-1;De+=2)Oe+=String.fromCharCode(pe[De]+pe[De+1]*256);return Oe}I.prototype.slice=function(X,ee){const pe=this.length;X=~~X,ee=ee===void 0?pe:~~ee,X<0?(X+=pe,X<0&&(X=0)):X>pe&&(X=pe),ee<0?(ee+=pe,ee<0&&(ee=0)):ee>pe&&(ee=pe),ee<X&&(ee=X);const Oe=this.subarray(X,ee);return Object.setPrototypeOf(Oe,I.prototype),Oe};function gt(se,X,ee){if(se%1!==0||se<0)throw new RangeError("offset is not uint");if(se+X>ee)throw new RangeError("Trying to access beyond buffer length")}I.prototype.readUintLE=I.prototype.readUIntLE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=this[X],De=1,Le=0;for(;++Le<ee&&(De*=256);)Oe+=this[X+Le]*De;return Oe},I.prototype.readUintBE=I.prototype.readUIntBE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=this[X+--ee],De=1;for(;ee>0&&(De*=256);)Oe+=this[X+--ee]*De;return Oe},I.prototype.readUint8=I.prototype.readUInt8=function(X,ee){return X=X>>>0,ee||gt(X,1,this.length),this[X]},I.prototype.readUint16LE=I.prototype.readUInt16LE=function(X,ee){return X=X>>>0,ee||gt(X,2,this.length),this[X]|this[X+1]<<8},I.prototype.readUint16BE=I.prototype.readUInt16BE=function(X,ee){return X=X>>>0,ee||gt(X,2,this.length),this[X]<<8|this[X+1]},I.prototype.readUint32LE=I.prototype.readUInt32LE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),(this[X]|this[X+1]<<8|this[X+2]<<16)+this[X+3]*16777216},I.prototype.readUint32BE=I.prototype.readUInt32BE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),this[X]*16777216+(this[X+1]<<16|this[X+2]<<8|this[X+3])},I.prototype.readBigUInt64LE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=ee+this[++X]*2**8+this[++X]*2**16+this[++X]*2**24,De=this[++X]+this[++X]*2**8+this[++X]*2**16+pe*2**24;return BigInt(Oe)+(BigInt(De)<<BigInt(32))}),I.prototype.readBigUInt64BE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=ee*2**24+this[++X]*2**16+this[++X]*2**8+this[++X],De=this[++X]*2**24+this[++X]*2**16+this[++X]*2**8+pe;return(BigInt(Oe)<<BigInt(32))+BigInt(De)}),I.prototype.readIntLE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=this[X],De=1,Le=0;for(;++Le<ee&&(De*=256);)Oe+=this[X+Le]*De;return De*=128,Oe>=De&&(Oe-=Math.pow(2,8*ee)),Oe},I.prototype.readIntBE=function(X,ee,pe){X=X>>>0,ee=ee>>>0,pe||gt(X,ee,this.length);let Oe=ee,De=1,Le=this[X+--Oe];for(;Oe>0&&(De*=256);)Le+=this[X+--Oe]*De;return De*=128,Le>=De&&(Le-=Math.pow(2,8*ee)),Le},I.prototype.readInt8=function(X,ee){return X=X>>>0,ee||gt(X,1,this.length),this[X]&128?(255-this[X]+1)*-1:this[X]},I.prototype.readInt16LE=function(X,ee){X=X>>>0,ee||gt(X,2,this.length);const pe=this[X]|this[X+1]<<8;return pe&32768?pe|4294901760:pe},I.prototype.readInt16BE=function(X,ee){X=X>>>0,ee||gt(X,2,this.length);const pe=this[X+1]|this[X]<<8;return pe&32768?pe|4294901760:pe},I.prototype.readInt32LE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),this[X]|this[X+1]<<8|this[X+2]<<16|this[X+3]<<24},I.prototype.readInt32BE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),this[X]<<24|this[X+1]<<16|this[X+2]<<8|this[X+3]},I.prototype.readBigInt64LE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=this[X+4]+this[X+5]*2**8+this[X+6]*2**16+(pe<<24);return(BigInt(Oe)<<BigInt(32))+BigInt(ee+this[++X]*2**8+this[++X]*2**16+this[++X]*2**24)}),I.prototype.readBigInt64BE=on(function(X){X=X>>>0,wt(X,"offset");const ee=this[X],pe=this[X+7];(ee===void 0||pe===void 0)&&Bt(X,this.length-8);const Oe=(ee<<24)+this[++X]*2**16+this[++X]*2**8+this[++X];return(BigInt(Oe)<<BigInt(32))+BigInt(this[++X]*2**24+this[++X]*2**16+this[++X]*2**8+pe)}),I.prototype.readFloatLE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),F.read(this,X,!0,23,4)},I.prototype.readFloatBE=function(X,ee){return X=X>>>0,ee||gt(X,4,this.length),F.read(this,X,!1,23,4)},I.prototype.readDoubleLE=function(X,ee){return X=X>>>0,ee||gt(X,8,this.length),F.read(this,X,!0,52,8)},I.prototype.readDoubleBE=function(X,ee){return X=X>>>0,ee||gt(X,8,this.length),F.read(this,X,!1,52,8)};function it(se,X,ee,pe,Oe,De){if(!I.isBuffer(se))throw new TypeError('"buffer" argument must be a Buffer instance');if(X>Oe||X<De)throw new RangeError('"value" argument is out of bounds');if(ee+pe>se.length)throw new RangeError("Index out of range")}I.prototype.writeUintLE=I.prototype.writeUIntLE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,pe=pe>>>0,!Oe){const ut=Math.pow(2,8*pe)-1;it(this,X,ee,pe,ut,0)}let De=1,Le=0;for(this[ee]=X&255;++Le<pe&&(De*=256);)this[ee+Le]=X/De&255;return ee+pe},I.prototype.writeUintBE=I.prototype.writeUIntBE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,pe=pe>>>0,!Oe){const ut=Math.pow(2,8*pe)-1;it(this,X,ee,pe,ut,0)}let De=pe-1,Le=1;for(this[ee+De]=X&255;--De>=0&&(Le*=256);)this[ee+De]=X/Le&255;return ee+pe},I.prototype.writeUint8=I.prototype.writeUInt8=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,1,255,0),this[ee]=X&255,ee+1},I.prototype.writeUint16LE=I.prototype.writeUInt16LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,65535,0),this[ee]=X&255,this[ee+1]=X>>>8,ee+2},I.prototype.writeUint16BE=I.prototype.writeUInt16BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,65535,0),this[ee]=X>>>8,this[ee+1]=X&255,ee+2},I.prototype.writeUint32LE=I.prototype.writeUInt32LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,4294967295,0),this[ee+3]=X>>>24,this[ee+2]=X>>>16,this[ee+1]=X>>>8,this[ee]=X&255,ee+4},I.prototype.writeUint32BE=I.prototype.writeUInt32BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,4294967295,0),this[ee]=X>>>24,this[ee+1]=X>>>16,this[ee+2]=X>>>8,this[ee+3]=X&255,ee+4};function Zt(se,X,ee,pe,Oe){ct(X,pe,Oe,se,ee,7);let De=Number(X&BigInt(4294967295));se[ee++]=De,De=De>>8,se[ee++]=De,De=De>>8,se[ee++]=De,De=De>>8,se[ee++]=De;let Le=Number(X>>BigInt(32)&BigInt(4294967295));return se[ee++]=Le,Le=Le>>8,se[ee++]=Le,Le=Le>>8,se[ee++]=Le,Le=Le>>8,se[ee++]=Le,ee}function Rt(se,X,ee,pe,Oe){ct(X,pe,Oe,se,ee,7);let De=Number(X&BigInt(4294967295));se[ee+7]=De,De=De>>8,se[ee+6]=De,De=De>>8,se[ee+5]=De,De=De>>8,se[ee+4]=De;let Le=Number(X>>BigInt(32)&BigInt(4294967295));return se[ee+3]=Le,Le=Le>>8,se[ee+2]=Le,Le=Le>>8,se[ee+1]=Le,Le=Le>>8,se[ee]=Le,ee+8}I.prototype.writeBigUInt64LE=on(function(X,ee=0){return Zt(this,X,ee,BigInt(0),BigInt("0xffffffffffffffff"))}),I.prototype.writeBigUInt64BE=on(function(X,ee=0){return Rt(this,X,ee,BigInt(0),BigInt("0xffffffffffffffff"))}),I.prototype.writeIntLE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,!Oe){const St=Math.pow(2,8*pe-1);it(this,X,ee,pe,St-1,-St)}let De=0,Le=1,ut=0;for(this[ee]=X&255;++De<pe&&(Le*=256);)X<0&&ut===0&&this[ee+De-1]!==0&&(ut=1),this[ee+De]=(X/Le>>0)-ut&255;return ee+pe},I.prototype.writeIntBE=function(X,ee,pe,Oe){if(X=+X,ee=ee>>>0,!Oe){const St=Math.pow(2,8*pe-1);it(this,X,ee,pe,St-1,-St)}let De=pe-1,Le=1,ut=0;for(this[ee+De]=X&255;--De>=0&&(Le*=256);)X<0&&ut===0&&this[ee+De+1]!==0&&(ut=1),this[ee+De]=(X/Le>>0)-ut&255;return ee+pe},I.prototype.writeInt8=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,1,127,-128),X<0&&(X=255+X+1),this[ee]=X&255,ee+1},I.prototype.writeInt16LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,32767,-32768),this[ee]=X&255,this[ee+1]=X>>>8,ee+2},I.prototype.writeInt16BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,2,32767,-32768),this[ee]=X>>>8,this[ee+1]=X&255,ee+2},I.prototype.writeInt32LE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,2147483647,-2147483648),this[ee]=X&255,this[ee+1]=X>>>8,this[ee+2]=X>>>16,this[ee+3]=X>>>24,ee+4},I.prototype.writeInt32BE=function(X,ee,pe){return X=+X,ee=ee>>>0,pe||it(this,X,ee,4,2147483647,-2147483648),X<0&&(X=4294967295+X+1),this[ee]=X>>>24,this[ee+1]=X>>>16,this[ee+2]=X>>>8,this[ee+3]=X&255,ee+4},I.prototype.writeBigInt64LE=on(function(X,ee=0){return Zt(this,X,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),I.prototype.writeBigInt64BE=on(function(X,ee=0){return Rt(this,X,ee,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ue(se,X,ee,pe,Oe,De){if(ee+pe>se.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("Index out of range")}function ot(se,X,ee,pe,Oe){return X=+X,ee=ee>>>0,Oe||Ue(se,X,ee,4),F.write(se,X,ee,pe,23,4),ee+4}I.prototype.writeFloatLE=function(X,ee,pe){return ot(this,X,ee,!0,pe)},I.prototype.writeFloatBE=function(X,ee,pe){return ot(this,X,ee,!1,pe)};function Jt(se,X,ee,pe,Oe){return X=+X,ee=ee>>>0,Oe||Ue(se,X,ee,8),F.write(se,X,ee,pe,52,8),ee+8}I.prototype.writeDoubleLE=function(X,ee,pe){return Jt(this,X,ee,!0,pe)},I.prototype.writeDoubleBE=function(X,ee,pe){return Jt(this,X,ee,!1,pe)},I.prototype.copy=function(X,ee,pe,Oe){if(!I.isBuffer(X))throw new TypeError("argument should be a Buffer");if(pe||(pe=0),!Oe&&Oe!==0&&(Oe=this.length),ee>=X.length&&(ee=X.length),ee||(ee=0),Oe>0&&Oe<pe&&(Oe=pe),Oe===pe||X.length===0||this.length===0)return 0;if(ee<0)throw new RangeError("targetStart out of bounds");if(pe<0||pe>=this.length)throw new RangeError("Index out of range");if(Oe<0)throw new RangeError("sourceEnd out of bounds");Oe>this.length&&(Oe=this.length),X.length-ee<Oe-pe&&(Oe=X.length-ee+pe);const De=Oe-pe;return this===X&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ee,pe,Oe):Uint8Array.prototype.set.call(X,this.subarray(pe,Oe),ee),De},I.prototype.fill=function(X,ee,pe,Oe){if(typeof X=="string"){if(typeof ee=="string"?(Oe=ee,ee=0,pe=this.length):typeof pe=="string"&&(Oe=pe,pe=this.length),Oe!==void 0&&typeof Oe!="string")throw new TypeError("encoding must be a string");if(typeof Oe=="string"&&!I.isEncoding(Oe))throw new TypeError("Unknown encoding: "+Oe);if(X.length===1){const Le=X.charCodeAt(0);(Oe==="utf8"&&Le<128||Oe==="latin1")&&(X=Le)}}else typeof X=="number"?X=X&255:typeof X=="boolean"&&(X=Number(X));if(ee<0||this.length<ee||this.length<pe)throw new RangeError("Out of range index");if(pe<=ee)return this;ee=ee>>>0,pe=pe===void 0?this.length:pe>>>0,X||(X=0);let De;if(typeof X=="number")for(De=ee;De<pe;++De)this[De]=X;else{const Le=I.isBuffer(X)?X:I.from(X,Oe),ut=Le.length;if(ut===0)throw new TypeError('The value "'+X+'" is invalid for argument "value"');for(De=0;De<pe-ee;++De)this[De+ee]=Le[De%ut]}return this};const Nt={};function rt(se,X,ee){Nt[se]=class extends ee{constructor(){super(),Object.defineProperty(this,"message",{value:X.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${se}]`,this.stack,delete this.name}get code(){return se}set code(Oe){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Oe,writable:!0})}toString(){return`${this.name} [${se}]: ${this.message}`}}}rt("ERR_BUFFER_OUT_OF_BOUNDS",function(se){return se?`${se} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),rt("ERR_INVALID_ARG_TYPE",function(se,X){return`The "${se}" argument must be of type number. Received type ${typeof X}`},TypeError),rt("ERR_OUT_OF_RANGE",function(se,X,ee){let pe=`The value of "${se}" is out of range.`,Oe=ee;return Number.isInteger(ee)&&Math.abs(ee)>2**32?Oe=tt(String(ee)):typeof ee=="bigint"&&(Oe=String(ee),(ee>BigInt(2)**BigInt(32)||ee<-(BigInt(2)**BigInt(32)))&&(Oe=tt(Oe)),Oe+="n"),pe+=` It must be ${X}. Received ${Oe}`,pe},RangeError);function tt(se){let X="",ee=se.length;const pe=se[0]==="-"?1:0;for(;ee>=pe+4;ee-=3)X=`_${se.slice(ee-3,ee)}${X}`;return`${se.slice(0,ee)}${X}`}function at(se,X,ee){wt(X,"offset"),(se[X]===void 0||se[X+ee]===void 0)&&Bt(X,se.length-(ee+1))}function ct(se,X,ee,pe,Oe,De){if(se>ee||se<X){const Le=typeof X=="bigint"?"n":"";let ut;throw X===0||X===BigInt(0)?ut=`>= 0${Le} and < 2${Le} ** ${(De+1)*8}${Le}`:ut=`>= -(2${Le} ** ${(De+1)*8-1}${Le}) and < 2 ** ${(De+1)*8-1}${Le}`,new Nt.ERR_OUT_OF_RANGE("value",ut,se)}at(pe,Oe,De)}function wt(se,X){if(typeof se!="number")throw new Nt.ERR_INVALID_ARG_TYPE(X,"number",se)}function Bt(se,X,ee){throw Math.floor(se)!==se?(wt(se,ee),new Nt.ERR_OUT_OF_RANGE("offset","an integer",se)):X<0?new Nt.ERR_BUFFER_OUT_OF_BOUNDS:new Nt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${X}`,se)}const Lt=/[^+/0-9A-Za-z-_]/g;function Ft(se){if(se=se.split("=")[0],se=se.trim().replace(Lt,""),se.length<2)return"";for(;se.length%4!==0;)se=se+"=";return se}function Kt(se,X){X=X||1/0;let ee;const pe=se.length;let Oe=null;const De=[];for(let Le=0;Le<pe;++Le){if(ee=se.charCodeAt(Le),ee>55295&&ee<57344){if(!Oe){if(ee>56319){(X-=3)>-1&&De.push(239,191,189);continue}else if(Le+1===pe){(X-=3)>-1&&De.push(239,191,189);continue}Oe=ee;continue}if(ee<56320){(X-=3)>-1&&De.push(239,191,189),Oe=ee;continue}ee=(Oe-55296<<10|ee-56320)+65536}else Oe&&(X-=3)>-1&&De.push(239,191,189);if(Oe=null,ee<128){if((X-=1)<0)break;De.push(ee)}else if(ee<2048){if((X-=2)<0)break;De.push(ee>>6|192,ee&63|128)}else if(ee<65536){if((X-=3)<0)break;De.push(ee>>12|224,ee>>6&63|128,ee&63|128)}else if(ee<1114112){if((X-=4)<0)break;De.push(ee>>18|240,ee>>12&63|128,ee>>6&63|128,ee&63|128)}else throw new Error("Invalid code point")}return De}function Gt(se){const X=[];for(let ee=0;ee<se.length;++ee)X.push(se.charCodeAt(ee)&255);return X}function dn(se,X){let ee,pe,Oe;const De=[];for(let Le=0;Le<se.length&&!((X-=2)<0);++Le)ee=se.charCodeAt(Le),pe=ee>>8,Oe=ee%256,De.push(Oe),De.push(pe);return De}function nn(se){return K.toByteArray(Ft(se))}function rn(se,X,ee,pe){let Oe;for(Oe=0;Oe<pe&&!(Oe+ee>=X.length||Oe>=se.length);++Oe)X[Oe+ee]=se[Oe];return Oe}function Vt(se,X){return se instanceof X||se!=null&&se.constructor!=null&&se.constructor.name!=null&&se.constructor.name===X.name}function Qt(se){return se!==se}const gn=function(){const se="0123456789abcdef",X=new Array(256);for(let ee=0;ee<16;++ee){const pe=ee*16;for(let Oe=0;Oe<16;++Oe)X[pe+Oe]=se[ee]+se[Oe]}return X}();function on(se){return typeof BigInt>"u"?Yt:se}function Yt(){throw new Error("BigInt not supported")}}(buffer)),buffer}var toolsEbml={},hasRequiredToolsEbml;function requireToolsEbml(){if(hasRequiredToolsEbml)return toolsEbml;hasRequiredToolsEbml=1;var q=toolsEbml&&toolsEbml.__assign||function(){return q=Object.assign||function(D){for(var N,O=1,I=arguments.length;O<I;O++){N=arguments[O];for(var z in N)Object.prototype.hasOwnProperty.call(N,z)&&(D[z]=N[z])}return D},q.apply(this,arguments)},K=toolsEbml&&toolsEbml.__spreadArray||function(D,N,O){if(O||arguments.length===2)for(var I=0,z=N.length,J;I<z;I++)(J||!(I in N))&&(J||(J=Array.prototype.slice.call(N,0,I)),J[I]=N[I]);return D.concat(J||Array.prototype.slice.call(N))};Object.defineProperty(toolsEbml,"__esModule",{value:!0});var F=requireTools(),Z=function(){function D(){}return D.readVint=function(N,O){O===void 0&&(O=0);var I=8-Math.floor(Math.log2(N[O]));if(I>8){var z=D.readHexString(N,O,O+I);throw new Error("Unrepresentable length: ".concat(I," ").concat(z))}if(O+I>N.length)return null;for(var J=N[O]&(1<<8-I)-1,Q=1;Q<I;Q+=1){if(Q===7&&J>=Math.pow(2,8)&&N[O+7]>0)return{length:I,value:-1};J*=Math.pow(2,8),J+=N[O+Q]}return{length:I,value:J}},D.writeVint=function(N){if(N<0||N>Math.pow(2,53))throw new Error("Unrepresentable value: ".concat(N));var O=1;for(O=1;O<=8&&!(N<Math.pow(2,7*O)-1);O+=1);for(var I=F.Buffer.alloc(O),z=N,J=1;J<=O;J+=1){var Q=z&255;I[O-J]=Q,z-=Q,z/=Math.pow(2,8)}return I[0]|=1<<8-O,I},D.concatenate=function(N,O){return!N&&!O?F.Buffer.from([]):!N||N.byteLength===0?O:!O||O.byteLength===0?N:F.Buffer.from(K(K([],N,!0),O,!0))},D.readHexString=function(N,O,I){return O===void 0&&(O=0),I===void 0&&(I=N.byteLength),Array.from(N.slice(O,I)).map(function(z){return Number(z).toString(16)}).reduce(function(z,J){return"".concat(z).concat(J.padStart(2,"0"))},"")},D.readUtf8=function(N){try{return F.Buffer.from(N).toString("utf8")}catch{return null}},D.readUnsigned=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 1:return O.getUint8(0);case 2:return O.getUint16(0);case 4:return O.getUint32(0)}return N.byteLength<=6?N.reduce(function(I,z){return I*256+z},0):D.readHexString(N,0,N.byteLength)},D.readSigned=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 1:return O.getInt8(0);case 2:return O.getInt16(0);case 4:return O.getInt32(0);default:return NaN}},D.readFloat=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 4:return O.getFloat32(0);case 8:return O.getFloat64(0);default:return NaN}},D.readDate=function(N){var O=new DataView(N.buffer,N.byteOffset,N.byteLength);switch(N.byteLength){case 1:return new Date(O.getUint8(0));case 2:return new Date(O.getUint16(0));case 4:return new Date(O.getUint32(0));case 8:return new Date(Number.parseInt(D.readHexString(N),16));default:return new Date(0)}},D.readDataFromTag=function(N,O){var I=N.type,z=N.name,J=N.track,Q=N.discardable||!1,ne=N.keyframe||!1,re=null,te;switch(I){case"u":te=D.readUnsigned(O);break;case"f":te=D.readFloat(O);break;case"i":te=D.readSigned(O);break;case"s":te=String.fromCharCode.apply(String,O);break;case"8":te=D.readUtf8(O);break;case"d":te=D.readDate(O);break}if(z==="SimpleBlock"||z==="Block"){var oe=0,le=D.readVint(O,oe),ae=le.length,ce=le.value;oe+=ae,J=ce,te=D.readSigned(O.subarray(oe,oe+2)),oe+=2,z==="SimpleBlock"&&(ne=!!(O[ae+2]&128),Q=!!(O[ae+2]&1)),oe+=1,re=O.subarray(oe)}return q(q({},N),{data:O,discardable:Q,keyframe:ne,payload:re,track:J,value:te})},D}();return toolsEbml.default=Z,toolsEbml}var vint,hasRequiredVint;function requireVint(){return hasRequiredVint||(hasRequiredVint=1,vint=function(q,K,F){K=K||0;for(var Z=1;Z<=8&&!(q[K]>=Math.pow(2,8-Z));Z++);if(Z>8)throw new Error("Unrepresentable length: "+Z+" "+q.toString("hex",K,K+Z));if(K+Z>q.length)return null;var D,N=q[K]&(1<<8-Z)-1;for(D=1;D<Z;D++){if(D===7&&N>=Math.pow(2,45)&&q[K+7]>0)return{length:Z,value:-1};N*=Math.pow(2,8),N+=q[K+D]}return F&&(N-=Math.pow(2,Z*7-1)-1),{length:Z,value:N}}),vint}var bufferReader,hasRequiredBufferReader;function requireBufferReader(){if(hasRequiredBufferReader)return bufferReader;hasRequiredBufferReader=1;var q=requireVint();function K(F){this.buffer=F,this.offset=0}return K.prototype.nextInt16BE=function(){var F=this.buffer.readInt16BE(this.offset);return this.offset+=2,F},K.prototype.nextUInt8=function(){var F=this.buffer.readUInt8(this.offset);return this.offset+=1,F},K.prototype.nextUIntV=function(){var F=q(this.buffer,this.offset);return this.offset+=F.length,F.value},K.prototype.nextIntV=function(){var F=q(this.buffer,this.offset,!0);return this.offset+=F.length,F.value},K.prototype.nextBuffer=function(F){var Z=F?this.buffer.slice(this.offset,this.offset+F):this.buffer.slice(this.offset);return this.offset+=F||this.length,Z},Object.defineProperty(K.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),bufferReader=K,bufferReader}var ebmlBlock,hasRequiredEbmlBlock;function requireEbmlBlock(){if(hasRequiredEbmlBlock)return ebmlBlock;hasRequiredEbmlBlock=1;var q=requireBufferReader(),K=1,F=3,Z=2;ebmlBlock=function(N){var O={},I=new q(N);O.trackNumber=I.nextUIntV(),O.timecode=I.nextInt16BE();var z=I.nextUInt8();O.invisible=!!(z&8),O.keyframe=!!(z&128),O.discardable=!!(z&1);var J=(z&6)>>1;return O.frames=D(I,J),O};function D(N,O){if(!O)return[N.nextBuffer()];var I,z,J=[],Q=N.nextUInt8()+1;if(O===Z){if(N.length%Q!==0)throw new Error("Fixed-Size Lacing Error");for(z=N.length/Q,I=0;I<Q;I++)J.push(N.nextBuffer(z));return J}var ne=[];if(O===K)for(I=0;I<Q-1;I++){var re;z=0;do re=N.nextUInt8(),z+=re;while(re===255);ne.push(z)}else if(O===F)for(z=N.nextUIntV(),ne.push(z),I=1;I<Q-1;I++)z+=N.nextIntV(),ne.push(z);for(I=0;I<Q-1;I++)J.push(N.nextBuffer(ne[I]));return J.push(N.nextBuffer()),J}return ebmlBlock}var hasRequiredTools;function requireTools(){return hasRequiredTools||(hasRequiredTools=1,function(q){Object.defineProperty(q,"__esModule",{value:!0}),q.convertEBMLDateToJSDate=q.createFloatBuffer=q.createIntBuffer=q.createUIntBuffer=q.encodeValueToBuffer=q.concat=q.putRefinedMetaData=q.extractElement=q.removeElement=q.makeMetadataSeekable=q.createRIFFChunk=q.VP8BitStreamToRiffWebPBuffer=q.WebPBlockFilter=q.encodeTag=q.readBlock=q.ebmlBlock=q.writeVint=q.readVint=q.Buffer=void 0;var K=requireInt64Buffer(),F=requireEBMLEncoder(),Z=requireBuffer(),D=requireToolsEbml(),N=requireEbmlBlock();q.Buffer=Z.Buffer,q.readVint=D.default.readVint,q.writeVint=D.default.writeVint,q.ebmlBlock=N;function O(_e){return(0,q.ebmlBlock)(new q.Buffer(_e))}q.readBlock=O;function I(_e,Te,qe){return qe===void 0&&(qe=!1),fe([_e,qe?new q.Buffer("01ffffffffffffff","hex"):(0,q.writeVint)(Te.length),Te])}q.encodeTag=I;function z(_e){return _e.reduce(function(Te,qe){if(qe.type!=="b"||qe.name!=="SimpleBlock")return Te;var Ve=(0,q.ebmlBlock)(qe.data),We=Ve.frames.some(function(Fe){var Ot=Fe.slice(3,6).toString("hex");return Ot==="9d012a"});return We?Te.concat(qe):Te},[])}q.WebPBlockFilter=z;function J(_e){var Te=Q("VP8 ",_e),qe=fe([new q.Buffer("WEBP","ascii"),Te]);return Q("RIFF",qe)}q.VP8BitStreamToRiffWebPBuffer=J;function Q(_e,Te){var qe=new q.Buffer(4);return qe.writeUInt32LE(Te.byteLength,0),fe([new q.Buffer(_e.substr(0,4),"ascii"),qe,Te,new q.Buffer(Te.byteLength%2===0?0:1)])}q.createRIFFChunk=Q;function ne(_e,Te,qe){var Ve=te("EBML",_e),We=le(Ve),Fe=We+12,Ot=_e[_e.length-1].dataEnd-Fe,It=te("Info",_e);re("Duration",It),It.splice(1,0,{name:"Duration",type:"f",data:ke(Te,8)});for(var Dt=le(It),zt=te("Tracks",_e),Ut=le(zt),gt=47,it=[],Zt=5+qe.length*15,Rt=[],Ue=-1,ot=10,Jt=function(ct){var wt=gt,Bt=wt+Dt,Lt=Bt+Ut,Ft=Lt+Zt,Kt=Ft-Ot;if(it=[],it.push({name:"SeekHead",type:"m",isEnd:!1}),it.push({name:"Seek",type:"m",isEnd:!1}),it.push({name:"SeekID",type:"b",data:new q.Buffer([21,73,169,102])}),it.push({name:"SeekPosition",type:"u",data:me(wt)}),it.push({name:"Seek",type:"m",isEnd:!0}),it.push({name:"Seek",type:"m",isEnd:!1}),it.push({name:"SeekID",type:"b",data:new q.Buffer([22,84,174,107])}),it.push({name:"SeekPosition",type:"u",data:me(Bt)}),it.push({name:"Seek",type:"m",isEnd:!0}),it.push({name:"Seek",type:"m",isEnd:!1}),it.push({name:"SeekID",type:"b",data:new q.Buffer([28,83,187,107])}),it.push({name:"SeekPosition",type:"u",data:me(Lt)}),it.push({name:"Seek",type:"m",isEnd:!0}),it.push({name:"SeekHead",type:"m",isEnd:!0}),gt=le(it),Rt=[],Rt.push({name:"Cues",type:"m",isEnd:!1}),qe.forEach(function(Gt){var dn=Gt.CueTrack,nn=Gt.CueClusterPosition,rn=Gt.CueTime;Rt.push({name:"CuePoint",type:"m",isEnd:!1}),Rt.push({name:"CueTime",type:"u",data:me(rn)}),Rt.push({name:"CueTrackPositions",type:"m",isEnd:!1}),Rt.push({name:"CueTrack",type:"u",data:me(dn)}),nn-=Fe,nn+=Kt,Rt.push({name:"CueClusterPosition",type:"u",data:me(nn)}),Rt.push({name:"CueTrackPositions",type:"m",isEnd:!0}),Rt.push({name:"CuePoint",type:"m",isEnd:!0})}),Rt.push({name:"Cues",type:"m",isEnd:!0}),Zt=le(Rt),Ue!==Kt){if(Ue=Kt,ct===ot-1)throw new Error("Failed to converge to a stable metadata size")}else return"break"},Nt=0;Nt<ot;Nt++){var rt=Jt(Nt);if(rt==="break")break}var tt=[].concat.apply([],[Ve,{name:"Segment",type:"m",isEnd:!1,unknownSize:!0},it,It,zt,Rt]),at=new F.default().encode(tt);return at}q.makeMetadataSeekable=ne;function re(_e,Te){for(var qe=-1,Ve=0;Ve<Te.length;Ve++){var We=Te[Ve];if(We.name===_e)if(We.type==="m")if(!We.isEnd)qe=Ve;else{if(qe==-1)throw new Error("Detected ".concat(_e," closing element before finding the start"));Te.splice(qe,Ve-qe+1);return}else{Te.splice(Ve,1);return}}}q.removeElement=re;function te(_e,Te){for(var qe=[],Ve=-1,We=0;We<Te.length;We++){var Fe=Te[We];if(Fe.name===_e)if(Fe.type==="m")if(!Fe.isEnd)Ve=We;else{if(Ve==-1)throw new Error("Detected ".concat(_e," closing element before finding the start"));qe=Te.slice(Ve,We+1);break}else{qe.push(Te[We]);break}}return qe}q.extractElement=te;function oe(_e,Te){Array.isArray(Te.cueInfos)&&!Array.isArray(Te.cues)&&(console.warn("putRefinedMetaData: info.cueInfos property is deprecated. please use info.cues"),Te.cues=Te.cueInfos);for(var qe=[],Ve=[],We=0;We<_e.length;We++){var Fe=_e[We];if(Fe.type==="m"&&Fe.name==="Segment"){if(qe=_e.slice(0,We),Ve=_e.slice(We),Fe.unknownSize){Ve.shift();break}throw new Error("this metadata is not streaming webm file")}}if(!(Ve[Ve.length-1].dataEnd>0))throw new Error("metadata dataEnd has wrong number");var Ot=Ve[Ve.length-1].dataEnd,It=qe[qe.length-1].dataEnd,Dt=new F.default().encode(qe).byteLength,zt=Dt-It,Ut=Ot-Ve[0].tagStart;Ve[0].tagStart-It,Ve[0].tagStart;var gt=new q.Buffer([24,83,128,103]),it=new q.Buffer("01ffffffffffffff","hex"),Zt=gt.byteLength+it.byteLength,Rt=Ut,Ue;for(Ue=1;Ue<20;Ue++){var ot=It+Zt+Rt,Jt=ot-Ot,Nt=zt+Jt,rt=ae(Ve,Nt,Te),tt=new F.default().encode(rt).byteLength;if(tt===Rt)return new F.default().encode([].concat(qe,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],rt));Rt=tt}throw new Error("unable to refine metadata, stable size could not be found in "+Ue+" iterations!")}q.putRefinedMetaData=oe;function le(_e){var Te=new F.default;return _e.reduce(function(qe,Ve){return qe.concat(Te.encode([Ve]))},[]).reduce(function(qe,Ve){return qe+Ve.byteLength},0)}function ae(_e,Te,qe){var Ve=qe.duration,We=qe.clusterPtrs,Fe=qe.cues,Ot=_e.slice(0);if(typeof Ve=="number"){var It=!1;Ot.forEach(function(zt){zt.type==="f"&&zt.name==="Duration"&&(It=!0,zt.data=ke(Ve,8))}),It||we(Ot,"Info",[{name:"Duration",type:"f",data:ke(Ve,8)}])}Array.isArray(Fe)&&we(Ot,"Cues",de(Fe,Te));var Dt=[];return Array.isArray(We)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),Dt=ce(We,Te)),we(Ot,"SeekHead",Dt,!0),Ot}function ce(_e,Te){var qe=[];return _e.forEach(function(Ve){qe.push({name:"Seek",type:"m",isEnd:!1}),qe.push({name:"SeekID",type:"b",data:new q.Buffer([31,67,182,117])}),qe.push({name:"SeekPosition",type:"u",data:me(Ve+Te)}),qe.push({name:"Seek",type:"m",isEnd:!0})}),qe}function de(_e,Te){var qe=[];return _e.forEach(function(Ve){var We=Ve.CueTrack,Fe=Ve.CueClusterPosition,Ot=Ve.CueTime;qe.push({name:"CuePoint",type:"m",isEnd:!1}),qe.push({name:"CueTime",type:"u",data:me(Ot)}),qe.push({name:"CueTrackPositions",type:"m",isEnd:!1}),qe.push({name:"CueTrack",type:"u",data:me(We)}),qe.push({name:"CueClusterPosition",type:"u",data:me(Fe+Te)}),qe.push({name:"CueTrackPositions",type:"m",isEnd:!0}),qe.push({name:"CuePoint",type:"m",isEnd:!0})}),qe}function we(_e,Te,qe,Ve){Ve===void 0&&(Ve=!1);for(var We=-1,Fe=0;Fe<_e.length;Fe++){var Ot=_e[Fe];if(Ot.type==="m"&&Ot.name===Te&&Ot.isEnd===!1){We=Fe;break}}We>=0?Array.prototype.splice.apply(_e,[We+1,0].concat(qe)):Ve?[].concat([{name:Te,type:"m",isEnd:!1}],qe,[{name:Te,type:"m",isEnd:!0}]).reverse().forEach(function(It){_e.unshift(It)}):(_e.push({name:Te,type:"m",isEnd:!1}),qe.forEach(function(It){_e.push(It)}),_e.push({name:Te,type:"m",isEnd:!0}))}function fe(_e){return q.Buffer.concat(_e)}q.concat=fe;function ge(_e){var Te=new q.Buffer(0);if(_e.type==="m")return _e;switch(_e.type){case"u":Te=me(_e.value);break;case"i":Te=ve(_e.value);break;case"f":Te=ke(_e.value);break;case"s":Te=new q.Buffer(_e.value,"ascii");break;case"8":Te=new q.Buffer(_e.value,"utf8");break;case"b":Te=_e.value;break;case"d":Te=new K.Int64BE(_e.value.getTime().toString()).toBuffer();break}return Object.assign({},_e,{data:Te})}q.encodeValueToBuffer=ge;function me(_e){for(var Te=1;_e>=Math.pow(2,8*Te);Te++);if(Te>=7)return console.warn("7bit or more bigger uint not supported."),new K.Uint64BE(_e).toBuffer();var qe=new q.Buffer(Te);return qe.writeUIntBE(_e,0,Te),qe}q.createUIntBuffer=me;function ve(_e){for(var Te=1;_e>=Math.pow(2,8*Te);Te++);if(Te>=7)return console.warn("7bit or more bigger uint not supported."),new K.Int64BE(_e).toBuffer();var qe=new q.Buffer(Te);return qe.writeIntBE(_e,0,Te),qe}q.createIntBuffer=ve;function ke(_e,Te){if(Te===void 0&&(Te=8),Te===8){var qe=new q.Buffer(8);return qe.writeDoubleBE(_e,0),qe}else if(Te===4){var qe=new q.Buffer(4);return qe.writeFloatBE(_e,0),qe}else throw new Error("float type bits must 4bytes or 8bytes")}q.createFloatBuffer=ke;function xe(_e){return _e instanceof Date?_e:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(_e)/1e3/1e3)}q.convertEBMLDateToJSDate=xe}(tools)),tools}var hasRequiredEBMLDecoder;function requireEBMLDecoder(){if(hasRequiredEBMLDecoder)return EBMLDecoder;hasRequiredEBMLDecoder=1,Object.defineProperty(EBMLDecoder,"__esModule",{value:!0});var q=requireInt64Buffer(),K=requireTools(),F=requireTools(),Z=requireEbmlID(),D;(function(O){O[O.STATE_TAG=1]="STATE_TAG",O[O.STATE_SIZE=2]="STATE_SIZE",O[O.STATE_CONTENT=3]="STATE_CONTENT"})(D||(D={}));var N=function(){function O(){this._buffer=new K.Buffer(0),this._tag_stack=[],this._state=D.STATE_TAG,this._cursor=0,this._total=0,this._schema=Z.byEbmlID,this._result=[]}return O.prototype.decode=function(I){this.readChunk(I);var z=this._result;return this._result=[],z},O.prototype.readChunk=function(I){for(this._buffer=F.concat([this._buffer,new K.Buffer(I)]);this._cursor<this._buffer.length&&!(this._state===D.STATE_TAG&&!this.readTag()||this._state===D.STATE_SIZE&&!this.readSize()||this._state===D.STATE_CONTENT&&!this.readContent()););},O.prototype.getSchemaInfo=function(I){return this._schema[I]||{name:"unknown",level:-1,type:"unknown",description:"unknown"}},O.prototype.readTag=function(){if(this._cursor>=this._buffer.length)return!1;var I=(0,K.readVint)(this._buffer,this._cursor);if(I==null)return!1;var z=this._buffer.slice(this._cursor,this._cursor+I.length),J=z.reduce(function(re,te,oe,le){return re+te*Math.pow(16,2*(le.length-1-oe))},0),Q=this.getSchemaInfo(J),ne={EBML_ID:J.toString(16),schema:Q,type:Q.type,name:Q.name,level:Q.level,tagStart:this._total,tagEnd:this._total+I.length,sizeStart:this._total+I.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(ne),this._cursor+=I.length,this._total+=I.length,this._state=D.STATE_SIZE,!0},O.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var I=(0,K.readVint)(this._buffer,this._cursor);if(I==null)return!1;var z=this._tag_stack[this._tag_stack.length-1];return z.sizeEnd=z.sizeStart+I.length,z.dataStart=z.sizeEnd,z.dataSize=I.value,I.value===-1?(z.dataEnd=-1,z.type==="m"&&(z.unknownSize=!0)):z.dataEnd=z.sizeEnd+I.value,this._cursor+=I.length,this._total+=I.length,this._state=D.STATE_CONTENT,!0},O.prototype.readContent=function(){var I=this._tag_stack[this._tag_stack.length-1];if(I.type==="m"){if(I.isEnd=!1,this._result.push(I),this._state=D.STATE_TAG,I.dataSize===0){var z=Object.assign({},I,{isEnd:!0});this._result.push(z),this._tag_stack.pop()}return!0}if(this._buffer.length<this._cursor+I.dataSize)return!1;var J=this._buffer.slice(this._cursor,this._cursor+I.dataSize);switch(this._buffer=this._buffer.slice(this._cursor+I.dataSize),I.data=J,I.type){case"u":I.value=J.readUIntBE(0,J.length);break;case"i":I.value=J.readIntBE(0,J.length);break;case"f":I.value=I.dataSize===4?J.readFloatBE(0):I.dataSize===8?J.readDoubleBE(0):(console.warn("cannot read ".concat(I.dataSize," octets float. failback to 0")),0);break;case"s":I.value=J.toString("ascii");break;case"8":I.value=J.toString("utf8");break;case"b":I.value=J;break;case"d":I.value=(0,K.convertEBMLDateToJSDate)(new q.Int64BE(J).toNumber());break}if(I.value===null)throw new Error("unknown tag type:"+I.type);for(this._result.push(I),this._total+=I.dataSize,this._state=D.STATE_TAG,this._cursor=0,this._tag_stack.pop();this._tag_stack.length>0;){var Q=this._tag_stack[this._tag_stack.length-1];if(Q.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total<Q.dataEnd)break;if(Q.type!=="m")throw new Error("parent element is not master element");var z=Object.assign({},Q,{isEnd:!0});this._result.push(z),this._tag_stack.pop()}return!0},O}();return EBMLDecoder.default=N,EBMLDecoder}var EBMLReader={},events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var q=typeof Reflect=="object"?Reflect:null,K=q&&typeof q.apply=="function"?q.apply:function(ge,me,ve){return Function.prototype.apply.call(ge,me,ve)},F;q&&typeof q.ownKeys=="function"?F=q.ownKeys:Object.getOwnPropertySymbols?F=function(ge){return Object.getOwnPropertyNames(ge).concat(Object.getOwnPropertySymbols(ge))}:F=function(ge){return Object.getOwnPropertyNames(ge)};function Z(fe){console&&console.warn&&console.warn(fe)}var D=Number.isNaN||function(ge){return ge!==ge};function N(){N.init.call(this)}events.exports=N,events.exports.once=ce,N.EventEmitter=N,N.prototype._events=void 0,N.prototype._eventsCount=0,N.prototype._maxListeners=void 0;var O=10;function I(fe){if(typeof fe!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof fe)}Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:function(){return O},set:function(fe){if(typeof fe!="number"||fe<0||D(fe))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+fe+".");O=fe}}),N.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},N.prototype.setMaxListeners=function(ge){if(typeof ge!="number"||ge<0||D(ge))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+ge+".");return this._maxListeners=ge,this};function z(fe){return fe._maxListeners===void 0?N.defaultMaxListeners:fe._maxListeners}N.prototype.getMaxListeners=function(){return z(this)},N.prototype.emit=function(ge){for(var me=[],ve=1;ve<arguments.length;ve++)me.push(arguments[ve]);var ke=ge==="error",xe=this._events;if(xe!==void 0)ke=ke&&xe.error===void 0;else if(!ke)return!1;if(ke){var _e;if(me.length>0&&(_e=me[0]),_e instanceof Error)throw _e;var Te=new Error("Unhandled error."+(_e?" ("+_e.message+")":""));throw Te.context=_e,Te}var qe=xe[ge];if(qe===void 0)return!1;if(typeof qe=="function")K(qe,this,me);else for(var Ve=qe.length,We=oe(qe,Ve),ve=0;ve<Ve;++ve)K(We[ve],this,me);return!0};function J(fe,ge,me,ve){var ke,xe,_e;if(I(me),xe=fe._events,xe===void 0?(xe=fe._events=Object.create(null),fe._eventsCount=0):(xe.newListener!==void 0&&(fe.emit("newListener",ge,me.listener?me.listener:me),xe=fe._events),_e=xe[ge]),_e===void 0)_e=xe[ge]=me,++fe._eventsCount;else if(typeof _e=="function"?_e=xe[ge]=ve?[me,_e]:[_e,me]:ve?_e.unshift(me):_e.push(me),ke=z(fe),ke>0&&_e.length>ke&&!_e.warned){_e.warned=!0;var Te=new Error("Possible EventEmitter memory leak detected. "+_e.length+" "+String(ge)+" listeners added. Use emitter.setMaxListeners() to increase limit");Te.name="MaxListenersExceededWarning",Te.emitter=fe,Te.type=ge,Te.count=_e.length,Z(Te)}return fe}N.prototype.addListener=function(ge,me){return J(this,ge,me,!1)},N.prototype.on=N.prototype.addListener,N.prototype.prependListener=function(ge,me){return J(this,ge,me,!0)};function Q(){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 ne(fe,ge,me){var ve={fired:!1,wrapFn:void 0,target:fe,type:ge,listener:me},ke=Q.bind(ve);return ke.listener=me,ve.wrapFn=ke,ke}N.prototype.once=function(ge,me){return I(me),this.on(ge,ne(this,ge,me)),this},N.prototype.prependOnceListener=function(ge,me){return I(me),this.prependListener(ge,ne(this,ge,me)),this},N.prototype.removeListener=function(ge,me){var ve,ke,xe,_e,Te;if(I(me),ke=this._events,ke===void 0)return this;if(ve=ke[ge],ve===void 0)return this;if(ve===me||ve.listener===me)--this._eventsCount===0?this._events=Object.create(null):(delete ke[ge],ke.removeListener&&this.emit("removeListener",ge,ve.listener||me));else if(typeof ve!="function"){for(xe=-1,_e=ve.length-1;_e>=0;_e--)if(ve[_e]===me||ve[_e].listener===me){Te=ve[_e].listener,xe=_e;break}if(xe<0)return this;xe===0?ve.shift():le(ve,xe),ve.length===1&&(ke[ge]=ve[0]),ke.removeListener!==void 0&&this.emit("removeListener",ge,Te||me)}return this},N.prototype.off=N.prototype.removeListener,N.prototype.removeAllListeners=function(ge){var me,ve,ke;if(ve=this._events,ve===void 0)return this;if(ve.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ve[ge]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ve[ge]),this;if(arguments.length===0){var xe=Object.keys(ve),_e;for(ke=0;ke<xe.length;++ke)_e=xe[ke],_e!=="removeListener"&&this.removeAllListeners(_e);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(me=ve[ge],typeof me=="function")this.removeListener(ge,me);else if(me!==void 0)for(ke=me.length-1;ke>=0;ke--)this.removeListener(ge,me[ke]);return this};function re(fe,ge,me){var ve=fe._events;if(ve===void 0)return[];var ke=ve[ge];return ke===void 0?[]:typeof ke=="function"?me?[ke.listener||ke]:[ke]:me?ae(ke):oe(ke,ke.length)}N.prototype.listeners=function(ge){return re(this,ge,!0)},N.prototype.rawListeners=function(ge){return re(this,ge,!1)},N.listenerCount=function(fe,ge){return typeof fe.listenerCount=="function"?fe.listenerCount(ge):te.call(fe,ge)},N.prototype.listenerCount=te;function te(fe){var ge=this._events;if(ge!==void 0){var me=ge[fe];if(typeof me=="function")return 1;if(me!==void 0)return me.length}return 0}N.prototype.eventNames=function(){return this._eventsCount>0?F(this._events):[]};function oe(fe,ge){for(var me=new Array(ge),ve=0;ve<ge;++ve)me[ve]=fe[ve];return me}function le(fe,ge){for(;ge+1<fe.length;ge++)fe[ge]=fe[ge+1];fe.pop()}function ae(fe){for(var ge=new Array(fe.length),me=0;me<ge.length;++me)ge[me]=fe[me].listener||fe[me];return ge}function ce(fe,ge){return new Promise(function(me,ve){function ke(_e){fe.removeListener(ge,xe),ve(_e)}function xe(){typeof fe.removeListener=="function"&&fe.removeListener("error",ke),me([].slice.call(arguments))}we(fe,ge,xe,{once:!0}),ge!=="error"&&de(fe,ke,{once:!0})})}function de(fe,ge,me){typeof fe.on=="function"&&we(fe,"error",ge,me)}function we(fe,ge,me,ve){if(typeof fe.on=="function")ve.once?fe.once(ge,me):fe.on(ge,me);else if(typeof fe.addEventListener=="function")fe.addEventListener(ge,function ke(xe){ve.once&&fe.removeEventListener(ge,ke),me(xe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof fe)}return events.exports}var hasRequiredEBMLReader;function requireEBMLReader(){if(hasRequiredEBMLReader)return EBMLReader;hasRequiredEBMLReader=1;var q=EBMLReader&&EBMLReader.__extends||function(){var D=function(N,O){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,z){I.__proto__=z}||function(I,z){for(var J in z)Object.prototype.hasOwnProperty.call(z,J)&&(I[J]=z[J])},D(N,O)};return function(N,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");D(N,O);function I(){this.constructor=N}N.prototype=O===null?Object.create(O):(I.prototype=O.prototype,new I)}}();Object.defineProperty(EBMLReader,"__esModule",{value:!0});var K=requireEvents(),F=requireTools(),Z=function(D){q(N,D);function N(){var O=D.call(this)||this;return O.logGroup="",O.hasLoggingStarted=!1,O.metadataloaded=!1,O.chunks=[],O.stack=[],O.segmentOffset=0,O.last2SimpleBlockVideoTrackTimecode=[0,0],O.last2SimpleBlockAudioTrackTimecode=[0,0],O.lastClusterTimecode=0,O.lastClusterPosition=0,O.timecodeScale=1e6,O.metadataSize=0,O.metadatas=[],O.cues=[],O.firstVideoBlockRead=!1,O.firstAudioBlockRead=!1,O.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},O.trackTypes=[],O.trackDefaultDuration=[],O.trackCodecDelay=[],O.trackInfo={type:"nothing"},O.ended=!1,O.logging=!1,O.use_duration_every_simpleblock=!1,O.use_webp=!1,O.use_segment_info=!0,O.drop_default_duration=!0,O}return N.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()},N.prototype.emit_segment_info=function(){var O=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var J=this.lastClusterTimecode,Q=this.duration,ne=this.timecodeScale;this.emit("cluster",{timecode:J,data:O}),this.emit("duration",{timecodeScale:ne,duration:Q})}else{this.metadataloaded=!0,this.metadatas=O;var I=this.trackTypes.indexOf(1),z=this.trackTypes.indexOf(2);if(this.trackInfo=I>=0&&z>=0?{type:"both",trackNumber:I}:I>=0?{type:"video",trackNumber:I}:z>=0?{type:"audio",trackNumber:z}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:O,metadataSize:this.metadataSize})}},N.prototype.read=function(O){var I=this,z=!1;if(!this.ended){if(O.type==="m")if(O.isEnd)this.stack.pop();else{var J=this.stack[this.stack.length-1];if(J!=null&&J.level>=O.level){this.stack.pop(),this.logging&&console.groupEnd(),J.dataEnd=O.dataEnd,J.dataSize=O.dataEnd-J.dataStart,J.unknownSize=!1;var Q=Object.assign({},J,{name:J.name,type:J.type,isEnd:!0});this.chunks.push(Q)}this.stack.push(O)}if(O.type==="m"&&O.name=="Segment")this.segmentOffset!=0&&console.warn("Multiple segments detected!"),this.segmentOffset=O.dataStart,this.emit("segment_offset",this.segmentOffset);else if(O.type==="b"&&O.name==="SimpleBlock"){var ne=F.ebmlBlock(O.data),re=ne.timecode,te=ne.trackNumber,oe=ne.frames;if(this.trackTypes[te]===1){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,this.trackInfo.type==="both"||this.trackInfo.type==="video")){var le=this.lastClusterTimecode+re;this.cues.push({CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le}),this.emit("cue_info",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],re]}else if(this.trackTypes[te]===2){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,this.trackInfo.type==="audio")){var le=this.lastClusterTimecode+re;this.cues.push({CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le}),this.emit("cue_info",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:te,CueClusterPosition:this.lastClusterPosition,CueTime:le})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],re]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&oe.forEach(function(ae){var ce=ae.slice(3,6).toString("hex");if(ce==="9d012a"){var de=F.VP8BitStreamToRiffWebPBuffer(ae),we=new Blob([de],{type:"image/webp"}),fe=I.duration;I.emit("webp",{currentTime:fe,webp:we})}})}else O.type==="m"&&O.name==="Cluster"&&O.isEnd===!1?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",O.tagStart),this.lastClusterPosition=O.tagStart):O.type==="u"&&O.name==="Timecode"?this.lastClusterTimecode=O.value:O.type==="u"&&O.name==="TimecodeScale"?this.timecodeScale=O.value:O.type==="m"&&O.name==="TrackEntry"?O.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}:O.type==="u"&&O.name==="TrackType"?this.currentTrack.TrackType=O.value:O.type==="u"&&O.name==="TrackNumber"?this.currentTrack.TrackNumber=O.value:O.type==="u"&&O.name==="CodecDelay"?this.currentTrack.CodecDelay=O.value:O.type==="u"&&O.name==="DefaultDuration"?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),z=!0):this.currentTrack.DefaultDuration=O.value:O.name==="unknown"&&console.warn(O);!this.metadataloaded&&O.dataEnd>0&&(this.metadataSize=O.dataEnd),z||this.chunks.push(O),this.logging&&this.put(O)}},Object.defineProperty(N.prototype,"duration",{get:function(){if(this.trackInfo.type==="nothing")return console.warn("no video, no audio track"),0;var O=0,I=0,z=0,J=this.trackDefaultDuration[this.trackInfo.trackNumber];if(typeof J=="number")O=J;else if(this.trackInfo.type==="both")if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){O=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackTypes.indexOf(2)];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockAudioTrackTimecode[1]}else{O=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackTypes.indexOf(1)];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="video"){O=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockVideoTrackTimecode[1]}else if(this.trackInfo.type==="audio"){O=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var Q=this.trackCodecDelay[this.trackInfo.trackNumber];typeof Q=="number"&&(I=Q),z=this.last2SimpleBlockAudioTrackTimecode[1]}var ne=(this.lastClusterTimecode+z)*this.timecodeScale+O-I,re=ne/this.timecodeScale;return Math.floor(re)},enumerable:!1,configurable:!0}),N.prototype.addListener=function(O,I){return D.prototype.addListener.call(this,O,I)},N.prototype.put=function(O){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),O.type==="m"?O.isEnd?console.groupEnd():console.group(O.name+":"+O.tagStart):O.type==="b"?console.log(O.name,O.type):console.log(O.name,O.tagStart,O.type,O.value)},N}(K.EventEmitter);return EBMLReader.default=Z,EBMLReader}var hasRequiredEbml;function requireEbml(){return hasRequiredEbml||(hasRequiredEbml=1,function(q){var K=ebml&&ebml.__createBinding||(Object.create?function(I,z,J,Q){Q===void 0&&(Q=J),Object.defineProperty(I,Q,{enumerable:!0,get:function(){return z[J]}})}:function(I,z,J,Q){Q===void 0&&(Q=J),I[Q]=z[J]}),F=ebml&&ebml.__exportStar||function(I,z){for(var J in I)J!=="default"&&!Object.prototype.hasOwnProperty.call(z,J)&&K(z,I,J)};Object.defineProperty(q,"__esModule",{value:!0}),q.tools=q.Reader=q.Encoder=q.Decoder=void 0,F(requireEBML(),q);var Z=requireEBMLDecoder();q.Decoder=Z.default;var D=requireEBMLEncoder();q.Encoder=D.default;var N=requireEBMLReader();q.Reader=N.default;var O=requireTools();q.tools=O}(ebml)),ebml}var hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var q=lib&&lib.__awaiter||function(D,N,O,I){function z(J){return J instanceof O?J:new O(function(Q){Q(J)})}return new(O||(O=Promise))(function(J,Q){function ne(oe){try{te(I.next(oe))}catch(le){Q(le)}}function re(oe){try{te(I.throw(oe))}catch(le){Q(le)}}function te(oe){oe.done?J(oe.value):z(oe.value).then(ne,re)}te((I=I.apply(D,N||[])).next())})},K=lib&&lib.__generator||function(D,N){var O={label:0,sent:function(){if(J[0]&1)throw J[1];return J[1]},trys:[],ops:[]},I,z,J,Q;return Q={next:ne(0),throw:ne(1),return:ne(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function ne(te){return function(oe){return re([te,oe])}}function re(te){if(I)throw new TypeError("Generator is already executing.");for(;O;)try{if(I=1,z&&(J=te[0]&2?z.return:te[0]?z.throw||((J=z.return)&&J.call(z),0):z.next)&&!(J=J.call(z,te[1])).done)return J;switch(z=0,J&&(te=[te[0]&2,J.value]),te[0]){case 0:case 1:J=te;break;case 4:return O.label++,{value:te[1],done:!1};case 5:O.label++,z=te[1],te=[0];continue;case 7:te=O.ops.pop(),O.trys.pop();continue;default:if(J=O.trys,!(J=J.length>0&&J[J.length-1])&&(te[0]===6||te[0]===2)){O=0;continue}if(te[0]===3&&(!J||te[1]>J[0]&&te[1]<J[3])){O.label=te[1];break}if(te[0]===6&&O.label<J[1]){O.label=J[1],J=te;break}if(J&&O.label<J[2]){O.label=J[2],O.ops.push(te);break}J[2]&&O.ops.pop(),O.trys.pop();continue}te=N.call(D,O)}catch(oe){te=[6,oe],z=0}finally{I=J=0}if(te[0]&5)throw te[1];return{value:te[0]?te[1]:void 0,done:!0}}};Object.defineProperty(lib,"__esModule",{value:!0});var F=requireEbml();function Z(D){return q(this,void 0,void 0,function(){var N,O,I,z,J,Q,ne,re,te,oe,le,ae;return K(this,function(ce){switch(ce.label){case 0:if(!D)throw Error("call to fixWebmDuration requires a blob");N=new F.Decoder,O=new F.Reader,I=D.stream(),z=I.getReader(),ce.label=1;case 1:return[4,z.read()];case 2:return J=ce.sent(),Q=J.done,ne=J.value,Q?(O.stop(),[3,3]):(re=N.decode(ne),re=re==null?void 0:re.filter(function(de){return de.type!=="unknown"}),re.forEach(function(de){O.read(de)}),ne=null,[3,1]);case 3:return te=F.tools.makeMetadataSeekable(O.metadatas,O.duration,O.cues),oe=new Blob([te],{type:D.type}),le=D.slice(O.metadataSize),ae=new Blob([oe,le],{type:D.type}),[2,ae]}})})}return lib.default=Z,lib}var libExports=requireLib();const fixWebmDuration=getDefaultExportFromCjs(libExports);class StreamRecorder{constructor(){st(this,en);st(this,yn,!1);st(this,pn,!1);st(this,xn,0);st(this,Cn,0);st(this,cn,0);st(this,un,0);st(this,vn,0);Ie(this,"onchange",K=>{});Ie(this,"onDurationChange",K=>{});Ie(this,"start",async(K="")=>{K||(K=`video_Record_${E$1(Date.now())}`);let F=[];return navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0}).then(Z=>{const D=Z.getTracks();for(const O of D)O.onended=()=>this.stop();At(this,yn,!0),At(this,pn,!1),At(this,en,new MediaRecorder(Z)),Be(this,en).start();const N=new Date().getTime();At(this,xn,N),At(this,cn,N),Be(this,bn).call(this),Be(this,Rn).call(this),Be(this,en).addEventListener("dataavailable",O=>{F.push(O.data)}),Be(this,en).addEventListener("stop",async()=>{At(this,yn,!1);const O=new Date().getTime();At(this,Cn,O),At(this,un,Be(this,un)+(O-Be(this,cn))),Be(this,bn).call(this),clearInterval(Be(this,vn));const I=Z.getTracks();for(const re of I)re.stop();if(Be(this,en)===null)return;const z=new Blob(F,{type:Be(this,en).mimeType}),J=await fixWebmDuration(z),Q=URL.createObjectURL(J),ne=document.createElement("a");ne.href=Q,ne.download=`${K}.mp4`,ne.click(),URL.revokeObjectURL(Q),F=[],At(this,en,null)})})});Ie(this,"pause",async()=>{var F;await new Promise(Z=>setTimeout(()=>Z(!0),300)),(F=Be(this,en))==null||F.pause(),At(this,pn,!0);const K=new Date().getTime();At(this,un,Be(this,un)+(K-Be(this,cn))),Be(this,bn).call(this),clearInterval(Be(this,vn))});Ie(this,"resume",async()=>{var F;(F=Be(this,en))==null||F.resume(),At(this,pn,!1);const K=new Date().getTime();At(this,cn,K),Be(this,bn).call(this),Be(this,Rn).call(this)});Ie(this,"stop",async()=>{var K;(K=Be(this,en))==null||K.stop()});Ie(this,"getDuration",()=>{if(Be(this,cn)===0)return 0;let K=Be(this,un);const F=new Date().getTime();if(Be(this,yn)&&Be(this,pn)===!1){const Z=F-Be(this,cn);At(this,cn,F),K=K+Z}return K});Ie(this,"getInfo",()=>({active:Be(this,yn),pause:Be(this,pn),startTime:Be(this,xn),endTime:Be(this,Cn),duration:Be(this,un)}));st(this,bn,()=>{const K=this.getInfo();this.onchange(K)});st(this,Rn,()=>{clearInterval(Be(this,vn)),At(this,vn,window.setInterval(()=>{At(this,un,this.getDuration()),this.onDurationChange(Be(this,un))},500))})}}en=new WeakMap,yn=new WeakMap,pn=new WeakMap,xn=new WeakMap,Cn=new WeakMap,cn=new WeakMap,un=new WeakMap,vn=new WeakMap,bn=new WeakMap,Rn=new WeakMap;class RoomBase{constructor(K){Ie(this,"options",{appid:"",sdkToken:"",roomId:"",userId:"",earlyId:"",callType:0,debug:!1,reportErr:!0,logUrl:"https://logs.putplay.cc",newPublishAutoSubscribe:!0});Ie(this,"sdk_service_version","1.0.6");Ie(this,"prohibitNotify",!1);Ie(this,"isEarly",!1);Ie(this,"isInRoom",!1);Ie(this,"taskQueue");Ie(this,"roomState","ready");Ie(this,"createAt",Date.now());Ie(this,"cwsIns");Ie(this,"peerIns");Ie(this,"transceiverMap",new Map);Ie(this,"sendChannel");Ie(this,"receiveChannel");Ie(this,"userMap",new Map);Ie(this,"setLocalStreamActiveMap",new Map);Ie(this,"phoneyStreams",new Map);Ie(this,"recorder",new StreamRecorder);Ie(this,"networkQualityTester",new NetworkQualityTester);Ie(this,"mediaDevicesErrInfo",{microphoneCamera_audio:"",microphoneCamera_video:"",screenSharing_video:"",screenSharing_audio:""});Ie(this,"reportLogs",(K,F="未知错误")=>{const{appid:Z,userId:D,earlyId:N="",logUrl:O,reportErr:I}=this.options;if(!I)return;const z="web",J=Q=>({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})[Q].toString();{const Q=J(K),ne={origin:z,type:Q,app_id:Z,user_id:D,ins_id:N,desc:F},re=btoa(encodeURI(JSON.stringify(ne))),te=`${O}/upload/log?log_key=${re}`;{const oe=localStorage.getItem("#quickvo.logs")||JSON.stringify([]),ae=new TextEncoder().encode(oe),ce=pako.deflate(ae,{gzip:!0});this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: reportLogs",{obj:ne,url:te,size:lt(ce.byteLength)}),fetch(te,{headers:{"Content-Type":"multipart/form-data"},method:"POST",body:ce})}}});Ie(this,"initPhoneyStreams",(K,F=[])=>{F.length===0&&(F=mediaType_keys);for(const Z of F){const D=this.phoneyStreams.get(Z);if(D){const N=D.getTracks();for(const O of N)O.stop()}switch(Z){case"microphoneCamera_audio":this.phoneyStreams.set("microphoneCamera_audio",createMutedAudioStream(K));break;case"microphoneCamera_video":this.phoneyStreams.set("microphoneCamera_video",createFakeVideoStream());break;case"screenSharing_audio":this.phoneyStreams.set("screenSharing_audio",createMutedAudioStream(K));break;case"screenSharing_video":this.phoneyStreams.set("screenSharing_video",createFakeVideoStream());break}}});Ie(this,"getPhoneyStreams",K=>this.phoneyStreams.get(K));Ie(this,"getRoomInfo",()=>{const{options:K,roomState:F,createAt:Z}=this;return{...K,roomState:F,createAt:Z}});Ie(this,"setRoomState",K=>{this.roomState=K;const F=enum_roomState[K],Z={state:K,stateStr:F};this.cwsIns.emitNotify("onRoomState",{code:200,data:Z,desc:"room state is change."})});Ie(this,"setOptions",async K=>{const F={...this.options,...K};this.options=F});Ie(this,"stopStream",async K=>{const F=K.getTracks();for(const Z of F)Z.stop()});Ie(this,"getMediaDevicesErrInfo",async()=>{try{const K=await navigator.mediaDevices.enumerateDevices();K.find(Z=>Z.kind==="audioinput")||(this.mediaDevicesErrInfo.microphoneCamera_audio="audioinput is not available."),K.find(Z=>Z.kind==="videoinput")||(this.mediaDevicesErrInfo.microphoneCamera_video="videoinput is not available.")}catch(K){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getMediaDevicesErrInfo is error.",K)}return this.mediaDevicesErrInfo});Ie(this,"getUserMediaKey",(K,F)=>`${K}-${F}`);Ie(this,"getCallAction",async K=>{let F="";const Z=N=>K.findIndex(({type:I,enabled:z=!0})=>I===N&&z)===-1?"0":"1";return F=`${Z(0)}${F}`,F=`${Z(1)}${F}`,F=`${Z(2)}${F}`,F=`${Z(3)}${F}`,parseInt(F,2)});Ie(this,"getCallActionMap",(K=0)=>{const Z=Number(K).toString(2).padStart(4,"0").split(""),[D,N,O,I]=Z;return{microphoneCamera_audio:!!Number(I),microphoneCamera_video:!!Number(O),screenSharing_video:!!Number(N),screenSharing_audio:!!Number(D)}});Ie(this,"getBanBehaviorMap",(K=0)=>{const Z=Number(K).toString(2).padStart(4,"0").split(""),[D,N,O,I]=Z;return{microphoneCamera_audio:!!Number(I),microphoneCamera_video:!!Number(O),screenSharing_video:!!Number(N),screenSharing_audio:!!Number(D)}});Ie(this,"getAverageVolume",(K,F)=>{K.getByteFrequencyData(F);let Z=0;for(let N=0;N<F.length;N++)Z+=F[N];return Math.ceil(Z/F.length)});Ie(this,"getTrackNamesFormTracks",(K,F=[],Z="trackName")=>{const D=[];for(const N of K){const{type:O}=N;if(F.length===0||F.includes(O)){const I=N[Z];I&&D.push(`${I}`)}}return D});Ie(this,"usersFilter",K=>dt(K,["id","isSelf","isOwner","joinTime","tracks","network","permissions","isPublished","updateStreams","callAction","callActionStr","callActionMap","banBehavior","banBehaviorStr","banBehaviorMap"]).sort((D,N)=>D.id.localeCompare(N.id,"en")));this.setOptions(K),this.cwsIns=new CallsWebSocket({...K}),this.taskQueue=new Y(["createWs","createSession","ice","joinRoom","createTrack","publish","subscribe","renegotiate","closeTrack"],{debug:K.debug}),this.taskQueue.setCondition("createSession",!1),this.taskQueue.setCondition("ice",!1),this.options.debug&&this.networkQualityTester.testAll().then(F=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: networkQualityTester",F)})}}var m=Object.defineProperty,G=(q,K,F)=>K in q?m(q,K,{enumerable:!0,configurable:!0,writable:!0,value:F}):q[K]=F,e$1=(q,K,F)=>G(q,typeof K!="symbol"?K+"":K,F);class g{constructor(K,F){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 D of Z)D.stop(),this.inputStream.removeTrack(D)}}),e$1(this,"getStream",()=>this.filterStream(this.outputStream)),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:D}=this;Z.getByteFrequencyData(D);let N=0;for(let O=0;O<D.length;O++)N+=D[O];return Math.ceil(N/D.length)}),e$1(this,"mixAudio",(Z,D="bgm")=>new Promise(async(N,O)=>{try{{const J=this.mixAudioMap.get(D);J&&J.stop()}const I=D==="bgs"?this.bgsGainNode:this.bgmGainNode,z=this.audioContext.createBufferSource();this.mixAudioMap.set(D,z),z.buffer=Z,z.connect(I),z.onended=()=>{z.disconnect(I),this.mixAudioMap.delete(D),N(!0)},z.start(0)}catch(I){O(I)}})),e$1(this,"mixAudioStop",Z=>{const D=this.mixAudioMap.get(Z);D==null||D.stop()}),e$1(this,"changeMix",(Z,D)=>{const N=Z==="bgs"?this.bgsGainNode:this.bgmGainNode;D?N.connect(this.destinationNode):N.disconnect(this.destinationNode)}),F&&(this.audioContext=F),this.inputStream=K,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:D,enhanceGainNode:N,bgsGainNode:O,bgmGainNode:I,analyserNode:z,outputGainNode:J,destinationNode:Q}=this;Z.connect(D),D.connect(N),N.connect(z),O.connect(z),I.connect(z),N.connect(Q),O.connect(Q),I.connect(Q),z.connect(J),J.connect(this.audioContext.destination)}this.setMute(!0),this.audioContext.resume()}}class RoomMedias extends RoomBase{constructor(F){super(F);st(this,kn,[]);st(this,tn,new Map);st(this,jt,new Map);st(this,ln,new Map);st(this,fn,new Map);st(this,mn,new Map);Ie(this,"localStreamsActionMap",new Map);st(this,Sn,new Map);Ie(this,"audioContext",new(window.AudioContext||window.webkitAudioContext));Ie(this,"initMediaPhoneyStreams",(F=[])=>this.initPhoneyStreams(this.audioContext,F));Ie(this,"initLocalStreamsFilter",()=>{for(const F of mediaType_keys){const Z=async D=>D;Be(this,Sn).set(F,Z)}});Ie(this,"setLocalFilterStream",(F,Z)=>{Be(this,Sn).set(F,Z)});st(this,Ln,()=>{Be(this,jt).set("microphoneCamera_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}),Be(this,jt).set("microphoneCamera_video",{frameRate:{min:10,ideal:30}}),Be(this,jt).set("screenSharing_video",{frameRate:{min:10,ideal:30}}),Be(this,jt).set("screenSharing_audio",{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0})});st(this,Fn,()=>{Be(this,tn).set("audioinput","default"),Be(this,tn).set("videoinput","default"),Be(this,tn).set("audiooutput","default")});Ie(this,"emitNotifyUpdateUsersStreams",async F=>{this.cwsIns.emitNotify("onRoomUsersStreams",{code:200,data:F,desc:"users streams is change."})});Ie(this,"initUserMediaStreamContext",async(F,Z,D)=>{const[N]=D.getTracks();if(!N){console.warn("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: tracks.length is 0.",{userId:F,mediaType:Z,stream:D});return}this.removeUserMediaStreamContext(F,Z);const O=this.getUserMediaKey(F,Z),{kind:I}=N;switch(I){case"audio":{const z=new MediaStream;z.addTrack(N);const J=new g(z,this.audioContext);Be(this,ln).set(O,J)}break;case"video":{const z=new VideoMediaContext(N);Be(this,fn).set(O,z)}break}});Ie(this,"getUserMediaStreamContext",(F,Z)=>{const D=this.getUserMediaKey(F,Z);if(["microphoneCamera_audio","screenSharing_audio"].includes(Z))return Be(this,ln).get(D);if(["microphoneCamera_video","screenSharing_video"].includes(Z))return Be(this,fn).get(D)});Ie(this,"getUserAudioMediaStreamContext",(F,Z)=>{const D=this.getUserMediaKey(F,Z);return Be(this,ln).get(D)});Ie(this,"removeUserMediaStreamContext",(F,Z)=>{const D=this.getUserMediaKey(F,Z);if(["microphoneCamera_audio","screenSharing_audio"].includes(Z)){const N=Be(this,ln).get(D);return N==null||N.stop(),Be(this,ln).delete(D)}if(["microphoneCamera_video","screenSharing_video"].includes(Z)){const N=Be(this,fn).get(D);return N==null||N.stop(),Be(this,fn).get(D)}});Ie(this,"getUserStream",(F,Z)=>{const D=this.getUserMediaStreamContext(F,Z);return(D==null?void 0:D.getStream())||new MediaStream});Ie(this,"getUserStreams",(F,Z=[])=>{Z.length===0&&(Z=mediaType_keys);const D={};for(const N of Z){const O=this.getUserStream(F,N);D[N]=O}return D});Ie(this,"removeUserStreams",async(F,Z=[])=>{Z.length===0&&(Z=mediaType_keys);for(const D of Z)this.removeUserMediaStreamContext(F,D)});Ie(this,"clearUserStreams",()=>{{const F=Be(this,ln).values();for(const Z of F)Z.stop();At(this,ln,new Map)}{const F=Be(this,fn).values();for(const Z of F)Z.stop();At(this,fn,new Map)}});Ie(this,"setMediaTrackConstraints",async(F,Z)=>{Be(this,jt).set(F,Z);const D=await this.getLocalStream(F);if(!D)return;const N=D.getTracks();if(N.length!==0)for(const O of N){const I=O.getConstraints(),J={...Be(this,jt).get(F),...I,...Z};await O.applyConstraints(J)}});Ie(this,"stopLocalStreams",async(F=[])=>{F.length===0&&(F=mediaType_keys);for(const Z of F){const D=Be(this,mn).get(Z);D&&await this.stopStream(D),Be(this,mn).delete(Z)}});Ie(this,"addLocalStream",(F,Z)=>{const D=Be(this,mn).get(F);D&&this.stopStream(D),Be(this,mn).set(F,Z)});Ie(this,"initLocalStream",async F=>{switch(F){case"microphoneCamera_audio":{const Z=Be(this,tn).get("audioinput"),D=Be(this,jt).get("microphoneCamera_audio"),N=await navigator.mediaDevices.getUserMedia({audio:{deviceId:Z,...D},video:!1});this.addLocalStream("microphoneCamera_audio",N)}break;case"microphoneCamera_video":{const Z=Be(this,tn).get("videoinput"),D=Be(this,jt).get("microphoneCamera_video"),N=await navigator.mediaDevices.getUserMedia({audio:!1,video:{deviceId:Z,...D}});this.addLocalStream("microphoneCamera_video",N)}break;case"microphoneCamera":{const Z=Be(this,tn).get("audioinput"),D=Be(this,tn).get("videoinput"),N=Be(this,jt).get("microphoneCamera_audio"),O=Be(this,jt).get("microphoneCamera_video"),z=(await navigator.mediaDevices.getUserMedia({audio:{deviceId:Z,...N},video:{deviceId:D,...O}})).getTracks();for(const J of z){const{kind:Q}=J;if(Q==="audio"){const ne=new MediaStream;ne.addTrack(J),this.addLocalStream("microphoneCamera_audio",ne)}if(Q==="video"){const ne=new MediaStream;ne.addTrack(J),this.addLocalStream("microphoneCamera_video",ne)}}}break;case"screenSharing_audio":{const Z=Be(this,jt).get("screenSharing_audio"),N=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...Z})).getTracks();for(const O of N){const{kind:I}=O;if(I==="audio"){const z=new MediaStream;z.addTrack(O),this.addLocalStream("screenSharing_audio",z)}}}break;case"screenSharing_video":{const Z=Be(this,jt).get(F),N=(await navigator.mediaDevices.getDisplayMedia({audio:!1,video:!0,...Z})).getTracks();for(const O of N){const{kind:I}=O;if(I==="video"){const z=new MediaStream;z.addTrack(O),this.addLocalStream("screenSharing_video",z)}}}break;case"screenSharing":{const Z=Be(this,jt).get("screenSharing_audio"),D=Be(this,jt).get("screenSharing_video"),O=(await navigator.mediaDevices.getDisplayMedia({audio:!0,video:!0,...Z,...D})).getTracks();for(const I of O){const{kind:z}=I;if(z==="audio"){const J=new MediaStream;J.addTrack(I),this.addLocalStream("screenSharing_audio",J)}if(z==="video"){const J=new MediaStream;J.addTrack(I),this.addLocalStream("screenSharing_video",J)}}}break}});Ie(this,"getLocalStream",async F=>{const Z=Be(this,mn).get(F),D=Be(this,Sn).get(F);let N=Z;return Z&&D&&(N=await D(Z)),N});Ie(this,"getLocalStreams",async(F=[])=>{F.length===0&&(F=mediaType_keys);const Z={};for(const D of F)Z[D]=await this.getLocalStream(D);return Z});st(this,Tn,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(F=>{const Z=F.filter(D=>!["default","communications"].includes(D.deviceId));At(this,kn,Z.sort((D,N)=>D.label.localeCompare(N.label,"zh-Hans-CN",{sensitivity:"accent"})))}).catch(function(F){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: getEnumerateDevices is err",F)}),Be(this,kn)));st(this,Hn,()=>{navigator.mediaDevices&&(navigator.mediaDevices.ondevicechange=async()=>{await Be(this,Tn).call(this),this.cwsIns.emitNotify("onDevicechange",{code:200,data:{},desc:"device is change."})}),Be(this,Tn).call(this)});Ie(this,"getMediaDeviceKind",F=>Be(this,tn).get(F));Ie(this,"changeAudiooutput",async()=>{try{const F=Be(this,tn).get("audiooutput");await this.audioContext.setSinkId(F)}catch(F){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setSinkId is error.",F)}});Ie(this,"setDeviceKind",(F,Z)=>{Be(this,tn).set(F,Z)});Ie(this,"setAudioOutputDevice",F=>this.setDeviceKind("audiooutput",F));Ie(this,"getEnumerateDevices",async F=>(await Be(this,Tn).call(this),Be(this,kn).filter(D=>D.kind===F)));Ie(this,"getEnumerateAudioinputDevices",()=>this.getEnumerateDevices("audioinput"));Ie(this,"getEnumerateAudioOutputDevices",()=>this.getEnumerateDevices("audiooutput"));Ie(this,"getEnumerateVideoinputDevices",()=>this.getEnumerateDevices("videoinput"));Be(this,Hn).call(this),Be(this,Fn).call(this),Be(this,Ln).call(this),this.initPhoneyStreams(this.audioContext),document.addEventListener("click",()=>{var Z;((Z=this.audioContext)==null?void 0:Z.state)==="suspended"&&this.audioContext.resume()})}}kn=new WeakMap,tn=new WeakMap,jt=new WeakMap,ln=new WeakMap,fn=new WeakMap,mn=new WeakMap,Sn=new WeakMap,Ln=new WeakMap,Fn=new WeakMap,Tn=new WeakMap,Hn=new WeakMap;class RoomUsers extends RoomMedias{constructor(F){super(F);Ie(this,"getMaxVolumeUser",()=>{const F=Array.from(this.userMap.values(),({id:D})=>D);if(F.length===0)return;let Z=[];for(const D of F){const N=this.getUserAudioMediaStreamContext(D,"microphoneCamera_audio");if(!N)continue;const O=N.getVolume();Z.push({id:D,volume:O})}return Z=Z.sort((D,N)=>D.volume-N.volume>0?-1:1),Z[0]});Ie(this,"setVolume",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setInputGain(D)});Ie(this,"setEnhanceGain",async(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setEnhanceGain(D)});Ie(this,"setSpeaker",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setOutputGain(D);const O=D===0;N==null||N.setMute(O)});Ie(this,"playBgs",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);return N==null?void 0:N.mixAudio(D,"bgs")});Ie(this,"setBgsGain",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setBgsGain(D)});Ie(this,"stopBgs",(F,Z)=>{const D=this.getUserAudioMediaStreamContext(F,Z);D==null||D.mixAudioStop("bgs")});Ie(this,"playBgm",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);return N==null?void 0:N.mixAudio(D,"bgm")});Ie(this,"setBgmGain",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.setBgmGain(D)});Ie(this,"stopBgm",(F,Z)=>{const D=this.getUserAudioMediaStreamContext(F,Z);D==null||D.mixAudioStop("bgm")});Ie(this,"changBgsMix",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.changeMix("bgs",D)});Ie(this,"changBgmMix",(F,Z,D)=>{const N=this.getUserAudioMediaStreamContext(F,Z);N==null||N.changeMix("bgm",D)});Ie(this,"getVolume",(F,Z)=>{const D=this.getUserAudioMediaStreamContext(F,Z);return D==null?void 0:D.getVolume()});Ie(this,"clearUsers",()=>{this.userMap=new Map});Ie(this,"removeUsers",async F=>{for(const Z of F)this.userMap.delete(Z),await this.removeUserStreams(Z)});Ie(this,"createUser",async F=>{const Z=Date.now(),D={id:F,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:F===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(F,D)});Ie(this,"getUser",async F=>(this.userMap.has(F)||await this.createUser(F),this.userMap.get(F)));Ie(this,"getUsers",async(F=[])=>{F.length===0&&(F=[...this.userMap.keys()]);const Z=[];for(const D of F){const N=await this.getUser(D);Z.push(N)}return Z});Ie(this,"getAllUserTrackMids",async()=>{const F=await this.getUsers(),Z=[];for(const D of F){const{tracks:N=[]}=D;for(const O of N)Z.push(O.mid)}return Z});Ie(this,"getUserTrackByTrackName",async F=>{const Z=await this.getUsers(),D=[];for(const N of Z){const{tracks:O=[]}=N;for(const I of O){const{trackName:z}=I;F.includes(z)&&D.push(I)}}return D});Ie(this,"getUserTrackFromMid",async F=>{const Z=await this.getUsers();let D;for(const N of Z){const{tracks:O=[]}=N;for(const I of O)if(I.mid===F){D=I;break}}return D});Ie(this,"checkUserInRoom",F=>this.userMap.has(F));Ie(this,"getUsersId",async()=>[...this.userMap.keys()]);Ie(this,"getSelfInfo",async()=>await this.getUser(this.options.userId));Ie(this,"updateIsPublished",async(F,Z=!1)=>{const D=await this.getUser(F);D.isPublished=Z});Ie(this,"setUserUpdateStreams",async(F,Z,D=!0)=>{const N=await this.getUser(F),O={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};O[Z]=D,N.updateStreams=O});Ie(this,"updateUserChannels",async(F,Z=[],D)=>{const N=await this.getUser(F);D&&(Z=[...N.channels,...Z]),N.channels=Z});Ie(this,"updateUsertracks",async(F,Z=[],D)=>{const N=await this.getUser(F);D&&(Z=[...N.tracks,...Z]),Z=Z.filter(({mid:z=""})=>z!==""),Z=pt(Z,["type"]),Z=Z.sort((z,J)=>z.type-J.type<0?-1:1);for(const z of Z)z.userId=F,z.mediaType=mediaType_keys[z.type],z.enabled===void 0&&(z.enabled=!0);N.updateStreams={microphoneCamera_audio:!1,microphoneCamera_video:!1,screenSharing_video:!1,screenSharing_audio:!1};const O=dt(N.tracks,["mediaType","enabled","mid","msid","trackName"]),I=dt(Z,["mediaType","enabled","mid","msid","trackName"]);{const z="microphoneCamera_audio",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}{const z="microphoneCamera_video",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}{const z="screenSharing_audio",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}{const z="screenSharing_video",J=I.find(re=>re.mediaType===z),Q=O.find(re=>re.mediaType===z),ne=JSON.stringify(J)!==JSON.stringify(Q);N.updateStreams[z]=ne}N.tracks=Z});Ie(this,"updateUserCallAction",async(F,Z=0)=>{const D=await this.getUser(F);D.callAction=Z,D.callActionStr=Z.toString(2).padStart(4,"0"),D.callActionMap=this.getCallActionMap(Z)});Ie(this,"updateUserBehaviors",async(F,Z=0)=>{const D=await this.getUser(F);D.banBehavior=Z,D.banBehaviorStr=Z.toString(2).padStart(4,"0"),D.banBehaviorMap=this.getBanBehaviorMap(Z)});Ie(this,"updateUserNetwork",async(F,Z={egress:5,ingress:5})=>{const D=await this.getUser(F);D.network=Z});Ie(this,"updateUserPermissions",async(F,Z)=>{if(Z){const D=await this.getUser(F);D.permissions=Z}});Ie(this,"updateUserBase",async F=>{const Z=await this.getUser(F);Z.isSelf=F===this.options.userId,Z.updateAt=Date.now()});Ie(this,"updateUsers",async F=>{for(const Z of F){const{id:D,tracks:N,callAction:O,permissions:I,isPublished:z}=Z;await this.updateUserBase(D),await this.updateIsPublished(D,z),await this.updateUserPermissions(D,I),await this.updateUsertracks(D,N,!0),await this.updateUserCallAction(D,O),await this.updateUserNetwork(D)}});Ie(this,"emitNotifyUpdateUser",async F=>{const Z=await this.getUsers([F]),[D]=this.usersFilter(Z);this.cwsIns.emitNotify("onRoomUser",{code:200,data:D,desc:"user info is change."})});Ie(this,"emitNotifyUpdateUsers",async()=>{const F=await this.getUsers(),Z=this.usersFilter(F);this.cwsIns.emitNotify("onRoomUsers",{code:200,data:Z,desc:"all users info is change."})})}}const t=(q,K=4294967295,F=79764919)=>{const Z=new Int32Array(256);let D,N,O,I=K;for(D=0;D<256;D++){for(O=D<<24,N=8;N>0;--N)O=2147483648&O?O<<1^F:O<<1;Z[D]=O}for(D=0;D<q.length;D++)I=I<<8^Z[255&(I>>24^q[D])];return I},e=(q,K=t)=>{const F=ae=>new Uint8Array(ae.length/2).map((ce,de)=>parseInt(ae.substring(2*de,2*(de+1)),16)),Z=ae=>F(ae)[0],D=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((ae,ce)=>D.set(ae,ce));const N=new Uint8Array(q.length);let O,I,z,J=!1,Q=0,ne=42,re=q.length>13&&q.substring(0,9)==="dynEncode",te=0;re&&(te=11,I=Z(q.substring(9,te)),I<=1&&(te+=2,ne=Z(q.substring(11,te))),I===1&&(te+=8,z=(ae=>new DataView(F(ae).buffer).getInt32(0,!0))(q.substring(13,te))));const oe=256-ne;for(let ae=te;ae<q.length;ae++)if(O=q.charCodeAt(ae),O!==61||J){if(O===92&&ae<q.length-5&&re){const ce=q.charCodeAt(ae+1);ce!==117&&ce!==85||(O=parseInt(q.substring(ae+2,ae+6),16),ae+=5)}if(O>255){const ce=D.get(O);ce&&(O=ce+127)}J&&(J=!1,O-=64),N[Q++]=O<ne&&O>0?O+oe:O-ne}else J=!0;const le=N.subarray(0,Q);if(re&&I===1){const ae=K(le);if(ae!==z){const ce="Decode failed crc32 validation";throw console.error("`simple-yenc`\n",ce+`
|
|
14
14
|
`,"Expected: "+z+"; Got: "+ae+`
|
|
15
15
|
`,"Visit https://github.com/eshaz/simple-yenc for more information"),Error(ce)}}return le};function WASMAudioDecoderCommon(){const q=Uint8Array,K=Float32Array;WASMAudioDecoderCommon.modules||Object.defineProperties(WASMAudioDecoderCommon,{modules:{value:new WeakMap},setModule:{value(F,Z){WASMAudioDecoderCommon.modules.set(F,Promise.resolve(Z))}},getModule:{value(F,Z){let D=WASMAudioDecoderCommon.modules.get(F);return D||(Z?D=WebAssembly.compile(e(Z)):(Z=F.wasm,D=WASMAudioDecoderCommon.inflateDynEncodeString(Z).then(N=>WebAssembly.compile(N))),WASMAudioDecoderCommon.modules.set(F,D)),D}},concatFloat32:{value(F,Z){let D=new K(Z),N=0,O=0;for(;N<F.length;)D.set(F[N],O),O+=F[N++].length;return D}},getDecodedAudio:{value:(F,Z,D,N,O)=>({errors:F,channelData:Z,samplesDecoded:D,sampleRate:N,bitDepth:O})},getDecodedAudioMultiChannel:{value(F,Z,D,N,O,I){let z=[],J,Q;for(J=0;J<D;J++){const ne=[];for(Q=0;Q<Z.length;)ne.push(Z[Q++][J]||[]);z.push(WASMAudioDecoderCommon.concatFloat32(ne,N))}return WASMAudioDecoderCommon.getDecodedAudio(F,z,N,O,I)}},inflateDynEncodeString:{value(F){return F=e(F),new Promise(Z=>{const D=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,D).then(N=>WebAssembly.instantiate(N,{})).then(({exports:N})=>{const O=new Map(Object.entries(N)),I=O.get("puff"),z=O.get("memory").buffer,J=new q(z),Q=new DataView(z);let ne=O.get("__heap_base");const re=F.length,te=ne;ne+=4,Q.setInt32(te,re,!0);const oe=ne;ne+=re,J.set(F,oe);const le=ne;ne+=4,Q.setInt32(le,J.byteLength-ne,!0),I(ne,le,oe,te),Z(J.slice(ne,ne+Q.getInt32(le,!0)))})})}}}),Object.defineProperty(this,"wasm",{enumerable:!0,get:()=>this._wasm}),this.getOutputChannels=(F,Z,D)=>{let N=[],O=0;for(;O<Z;)N.push(F.slice(O*D,O++*D+D));return N},this.allocateTypedArray=(F,Z,D=!0)=>{const N=this._wasm.malloc(Z.BYTES_PER_ELEMENT*F);return D&&this._pointers.add(N),{ptr:N,len:F,buf:new Z(this._wasm.HEAP,N,F)}},this.free=()=>{this._pointers.forEach(F=>{this._wasm.free(F)}),this._pointers.clear()},this.codeToString=F=>{const Z=[],D=new Uint8Array(this._wasm.HEAP);for(let N=D[F];N!==0;N=D[++F])Z.push(N);return String.fromCharCode.apply(null,Z)},this.addError=(F,Z,D,N,O,I)=>{F.push({message:Z,frameLength:D,frameNumber:N,inputBytes:O,outputSamples:I})},this.instantiate=(F,Z)=>(Z&&WASMAudioDecoderCommon.setModule(F,Z),this._wasm=new F(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(K,F,Z,D){WASMAudioDecoderCommon.modules||new WASMAudioDecoderCommon;let N=WASMAudioDecoderCommon.modules.get(Z);if(!N){let O="text/javascript",I,z=`'use strict';(${((J,Q,ne)=>{let re,te,oe=new Promise(le=>{te=le});self.onmessage=({data:{id:le,command:ae,data:ce}})=>{let de=oe,we={id:le},fe;ae==="init"?(Object.defineProperties(J,{WASMAudioDecoderCommon:{value:Q},EmscriptenWASM:{value:ne},module:{value:ce.module},isWebWorker:{value:!0}}),re=new J(ce.options),te()):ae==="free"?re.free():ae==="ready"?de=de.then(()=>re.ready):ae==="reset"?de=de.then(()=>re.reset()):(Object.assign(we,re[ae](Array.isArray(ce)?ce.map(ge=>new Uint8Array(ge)):new Uint8Array(ce))),fe=we.channelData?we.channelData.map(ge=>ge.buffer):[]),de.then(()=>self.postMessage(we,fe))}}).toString()})(${Z}, ${WASMAudioDecoderCommon}, ${D})`;try{I=typeof process.versions.node<"u"}catch{}N=I?`data:${O};base64,${Buffer.from(z).toString("base64")}`:URL.createObjectURL(new Blob([z],{type:O})),WASMAudioDecoderCommon.modules.set(Z,N)}super(N,{name:F}),this._id=Number.MIN_SAFE_INTEGER,this._enqueuedOperations=new Map,this.onmessage=({data:O})=>{const{id:I,...z}=O;this._enqueuedOperations.get(I)(z),this._enqueuedOperations.delete(I)},new D(WASMAudioDecoderCommon).getModule().then(O=>{this.postToDecoder("init",{module:O,options:K})})}async postToDecoder(K,F){return new Promise(Z=>{this.postMessage({command:K,id:this._id,data:F}),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=(q,K)=>{Object.defineProperty(q,"name",{value:K})};function EmscriptenWASM(q){function K(){}function F(Te){throw Te}var Z,D;function N(){var Te=D.buffer;Z=new Uint8Array(Te),new BigInt64Array(Te),new BigUint64Array(Te)}for(var O=()=>F(""),I=()=>{},z={},J=Te=>Te(),Q=()=>performance.now(),ne=(Te,qe)=>{if(z[Te]&&(clearTimeout(z[Te].id),delete z[Te]),!qe)return 0;var Ve=setTimeout(()=>{delete z[Te],J(()=>ke(Te,Q()))},qe);return z[Te]={id:Ve,timeout_ms:qe},0},re=Math.cos,te=Te=>(Z.length,!1),oe=Te=>{throw`exit(${Te})`},le=new Uint8Array(123),ae=25;ae>=0;--ae)le[48+ae]=52+ae,le[65+ae]=ae,le[97+ae]=26+ae;le[43]=62,le[47]=63;var ce={d:O,c:I,e:ne,a:re,f:te,b:oe};function de(Te){we=Te.i,fe=Te.j,ge=Te.k,me=Te.l,ve=Te.m,ke=Te.o}var we,fe,ge,me,ve,ke;function xe(Te){Te.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
|
|
16
16
|
*øüäÖeùiÝWͦÖPM¨[æu>Ü(«l'Ë$c¿9ZEúº¼ù¼=}äÍÂý²\åôÒ
'.õtÅXî=}~õ"uÊrÁýóòÝ ÔúéÊ
|
|
@@ -203,4 +203,4 @@ DÙ VààͳÄvÒ2; 5c±-ìÊöª§}Ou¡¡¦îGÇ D
|
|
|
203
203
|
Ù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
|
|
204
204
|
}õíë(ðìÍä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ÜÛ
|
|
205
205
|
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ç
|
|
206
|
-
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 _e={a:ce};this.setModule=Te=>{q.setModule(EmscriptenWASM,Te)},this.getModule=()=>q.getModule(EmscriptenWASM),this.instantiate=()=>(this.getModule().then(Te=>WebAssembly.instantiate(Te,_e)).then(Te=>{const qe=Te.exports;de(qe),D=qe.g,N(),xe(qe),K()}),this.ready=new Promise(Te=>{K=Te}).then(()=>{this.HEAP=D.buffer,this.malloc=fe,this.free=ve,this.opus_frame_decoder_create=we,this.opus_frame_decode_float_deinterleaved=ge,this.opus_frame_decoder_destroy=me}),this)}function OpusDecoder(q={}){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(Q=>{this._common=Q,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 ne=this._common.allocateTypedArray(this._channels,Uint8Array);ne.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,ne.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=Q=>{if(!(Q instanceof Uint8Array))throw Error("Data to decode must be Uint8Array. Instead got "+typeof Q);this._input.buf.set(Q);let ne=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,Q.length,this._output.ptr),re;return ne<0&&(re="libopus "+ne+" "+(OpusDecoder.errors.get(ne)||"Unknown Error"),console.error(re),ne=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,ne),samplesDecoded:ne,error:re}},this.decodeFrame=Q=>{let ne=[];const re=this._decode(Q);return re.error&&this._common.addError(ne,re.error,Q.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=Q.length,this._outputSamples+=re.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(ne,[re.outputBuffer],this._outputChannels,re.samplesDecoded,this._sampleRate)},this.decodeFrames=Q=>{let ne=[],re=[],te=0,oe=0;for(;oe<Q.length;){const le=Q[oe++],ae=this._decode(le);ne.push(ae.outputBuffer),te+=ae.samplesDecoded,ae.error&&this._common.addError(re,ae.error,le.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=le.length,this._outputSamples+=ae.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(re,ne,this._outputChannels,te,this._sampleRate)},this._isWebWorker=OpusDecoder.isWebWorker,this._WASMAudioDecoderCommon=OpusDecoder.WASMAudioDecoderCommon||WASMAudioDecoderCommon,this._EmscriptenWASM=OpusDecoder.EmscriptenWASM||EmscriptenWASM,this._module=OpusDecoder.module;const K=8,F=Q=>typeof Q=="number",Z=q.sampleRate,D=q.channels,N=q.streamCount,O=q.coupledStreamCount,I=q.channelMappingTable,z=q.preSkip,J=q.forceStereo?1:0;if(D>2&&(!F(N)||!F(O)||!Array.isArray(I)))throw new Error("Invalid Opus Decoder Options for multichannel decoding.");return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(Z)?Z:48e3,this._channels=F(D)?D:2,this._streamCount=F(N)?N:1,this._coupledStreamCount=F(O)?O:this._channels-1,this._channelMappingTable=I||(this._channels===2?[0,1]:[0]),this._preSkip=z||0,this._forceStereo=D<=K&&D!=2?J: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(K){super(K,"opus-decoder",OpusDecoder,EmscriptenWASM)}async decodeFrame(K){return this.postToDecoder("decodeFrame",K)}async decodeFrames(K){return this.postToDecoder("decodeFrames",K)}}assignNames(OpusDecoder,"OpusDecoder"),assignNames(OpusDecoderWebWorker,"OpusDecoderWebWorker"),new OpusDecoder;class RoomPeer extends RoomUsers{constructor(F){super(F);Ie(this,"getPeerStatsTimer",0);Ie(this,"reports",[]);Ie(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Ie(this,"initPeer",()=>{var Z;(Z=this.peerIns)==null||Z.close(),this.transceiverMap=new Map,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),Be(this,jn).call(this),Be(this,Jn).call(this);const F=[];this.peerIns.onicecandidate=async D=>{if(D.candidate){const N=await parseCandidate(D.candidate.candidate);F.push(N)}console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: parseCandidate",F)}});Ie(this,"getNatType",async()=>{});Ie(this,"initSendChannel",(F="",Z)=>{});Ie(this,"initReceiveChannel",(F="",Z)=>{});Ie(this,"replaceSenderStream",async(F=[],Z)=>{const{userId:D}=this.options;F.length===0&&(F=mediaType_keys);for(const N of F){const O=this.transceiverMap.get(N);let I;if(O){const{sender:z}=O;Z?I=this.getUserStream(D,N):I=this.getPhoneyStreams(N);const[J]=I.getTracks();J&&await z.replaceTrack(J)}}});Ie(this,"getSenderTracks",async(F=[])=>{const Z=[];for(const D of F){const N=this.transceiverMap.get(D);if(!N)continue;const{mid:O,sender:I}=N,{track:z}=I;if(!z)continue;const{id:J,enabled:Q}=z,ne=mediaType_keys.findIndex(te=>te===D),re={type:ne,enabled:Q,trackName:`web-${ne}-${J}`,location:"local",mid:O};Z.push(re)}return Z});Ie(this,"addSenders",async(F=[])=>{F.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const Z=[];for(const D of F){if(this.transceiverMap.get(D))continue;const O=this.getPhoneyStreams(D),[I]=O.getTracks(),z=this.peerIns.addTransceiver(I,{direction:"sendonly"});this.transceiverMap.set(D,z),Z.push(D)}if(F.length===0||Z.length!==0){const D=await this.peerIns.createOffer();if(this.options.debug){const N=libExports$1.parse(D.sdp),O=dt(N.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:O,sdpJson:N,description:D})}await this.peerIns.setLocalDescription(D)}return Z});Ie(this,"removeSenders",async(F=[])=>{F.length===0&&(F=mediaType_keys);for(const Z of F)this.transceiverMap.has(Z)&&this.transceiverMap.delete(Z)});Ie(this,"onSubscribeUserTracks",F=>{let Z=0;return new Promise(async D=>{const N=[];for(const O of F){const{tracks:I=[]}=O;for(const z of I){const{trackName:J,mid:Q}=z,[ne]=await this.getUserTrackByTrackName([J]);N.push({...ne,mid:Q})}}{let O=[];const I=async()=>{clearTimeout(Z);const J=new Map;for(const ne of O){const{userId:re,mediaType:te}=ne;if(!re||!te)continue;J.has(re)||J.set(re,{userId:re,tracks:[],updateStreams:{}});const le=J.get(re);le.tracks.push(ne),le.updateStreams[te]=!0}const Q=[...J.values()];for(const ne of Q){const{userId:re,tracks:te}=ne;await this.updateUsertracks(re,te,!0)}await this.emitNotifyUpdateUsersStreams(Q),this.peerIns.removeEventListener("track",z);{const ne=Array.from(N,oe=>oe.trackName),re=Array.from(O,oe=>oe.trackName),te=ne.filter(oe=>!re.includes(oe));D({target:ne,success:re,fail:te})}},z=async J=>{const{streams:Q,transceiver:ne}=J,[re]=Q,{mid:te,receiver:oe}=ne,{track:le}=oe,{id:ae}=le,ce=N.find(fe=>fe.mid===`${te}`);if(!ce)return;const{userId:de,mediaType:we}=ce;if(!(!de||!we)){{const fe={...ce,mid:te,msid:ae};O.push(fe)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${O.length}/${N.length}`,{mediaType:we,mid:te,userTrack:ce,e:J});{const fe=new Audio;if(fe.srcObject=re,await this.initUserMediaStreamContext(de,we,re),we==="microphoneCamera_audio"||we==="screenSharing_audio"){const ge=this.getUserAudioMediaStreamContext(de,we);ge==null||ge.setMute(!1)}}N.length===O.length&&I()}};this.peerIns.addEventListener("track",z),Z=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${O.length}/${N.length})`),I()},5*1e3)}})});st(this,jn,()=>{let F=0;const Z=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.onconnectionstatechange=async D=>{const N=D.target.connectionState;switch(await this.taskQueue.setCondition("ice",!1),clearTimeout(F),N){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${N}`),await this.taskQueue.setCondition("ice",!0),await this.getNatType(),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:${N}`),F=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:${N}`),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:${N}`),Z();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${N}`);break}}});Ie(this,"closeUserTracks",async(F,Z=[],D=!1)=>{const N=[];for(const J of Z){const{trackName:Q,msid:ne}=J;N.push(Q),ne&&N.push(ne)}const O=J=>N.includes(J),I=this.peerIns.getTransceivers();for(const J of I){const{mid:Q,sender:ne,receiver:re}=J;ne.track&&O(ne.track.id)&&(J.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${Q} is stop.`,J)),re.track&&O(re.track.id)&&(J.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${Q} is stop.`,J))}const z=await this.getUser(F);if(z){for(const J of z.tracks){const{trackName:Q,msid:ne,userId:re,mediaType:te}=J;!re||!te||!O(Q)||(this.removeUserMediaStreamContext(re,te),ne&&delete J.msid)}if(D){const J=z.tracks.filter(({trackName:Q})=>!O(Q));await this.updateUsertracks(F,J,!1)}}});Ie(this,"createOffer",async()=>{const F=await this.peerIns.createOffer();if(this.options.debug){const Z=libExports$1.parse(F.sdp),D=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:D,sdpJson:Z,description:F})}await this.peerIns.setLocalDescription(F)});Ie(this,"createAnswer",async()=>{const F=await this.peerIns.createAnswer();if(this.options.debug){const Z=libExports$1.parse(F.sdp),D=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:D,sdpJson:Z,description:F})}await this.peerIns.setLocalDescription(F)});Ie(this,"getSdp",()=>{var F;return(F=this.peerIns.localDescription)==null?void 0:F.sdp});Ie(this,"setRemoteDescription",async F=>{if(this.options.debug){const Z=libExports$1.parse(F.sdp),D=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:D,sdpJson:Z,description:F})}return await this.peerIns.setRemoteDescription(F),F});Ie(this,"setCallStrategy",async(F,Z=[])=>{Z.length===0&&(Z=mediaType_keys);let D="balanced";switch(F){case"qualityPriority":D="maintain-resolution";break;case"fluencyPriority":D="maintain-framerate";break;case"balancedDowngrade":D="balanced";break}const N=await this.getSelfInfo(),O=Array.from(N.tracks,({trackName:z})=>z),I=this.peerIns.getSenders();for(const z of I){const{track:J}=z;if(!J||!O.includes(J.id))continue;const Q=z.getParameters();z.setParameters({...Q,degradationPreference:D})}});Ie(this,"setRTCRtpSenderParameters",F=>{try{const Z=this.peerIns.getSenders();for(const D of Z){const N=D.getParameters();D.setParameters({...N,...F})}}catch(Z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",Z)}});Ie(this,"getReportsByMid",async(F=[])=>F.length===0?this.reports:this.reports.filter(Z=>F.includes(Z.mid)));Ie(this,"getRoomNetwork",()=>this.peerNetwork);Ie(this,"getPeerNetwork",()=>this.peerNetwork);st(this,zn,async()=>{try{const F=await this.peerIns.getStats(),Z=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],N=[...F.values()].filter(ge=>Z.includes(ge.type));let O=0,I=0,z=0,J=0,Q=0,ne=0,re=[],te=[];for(const ge of this.reports){const{packetsSent:me,packetsLost:ve}=ge;me&&(z+=me),ve&&(J+=ve)}this.reports=N;for(const ge of this.reports){const{bytesSent:me,bytesReceived:ve,packetsSent:ke,packetsLost:xe,roundTripTime:_e,jitter:Te}=ge;me&&(I=me),ve&&(O=ve),ke&&(Q+=ke),xe&&(ne+=xe),_e&&re.push((_e*100).toFixed(2)),Te&&te.push(Te.toFixed(2))}te.sort().reverse(),re.sort().reverse();const oe=Q-z,le=ne-J,ae=oe===0?"0.00":(le/oe).toFixed(2),[ce="0"]=re,[de="0"]=te,we={outboundBytes:I,inboundBytes:O,lostRate:ae,roundTripTime:ce,jitter:de};this.peerNetwork=we;const fe=(ge,me,ve)=>{const ke=Number(ge),xe=Number(me),_e=Number(ve);let Te="0";return ke<.03&&xe<100&&_e<.05?Te="5":ke<.06&&xe<160&&_e<.1?Te="4":ke<.1&&xe<250&&_e<.15?Te="3":ke<.15&&xe<400&&_e<.2?Te="2":Te="1",Number(Te)};{const ge=fe(ae,ce,de),me=await this.getSelfInfo(),{network:ve}=me,ke={egress:ge,ingress:ge};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,ke),JSON.stringify(ve)!==JSON.stringify(ke)){this.emitNotifyUpdateUsers();const{userId:Te,roomId:qe}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...ke,userId:Te,roomId:qe}},!1)}},3*1e3)}}catch(F){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",F)}});st(this,Jn,()=>{const F=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||Be(this,zn).call(this)};this.getPeerStatsTimer=window.setInterval(F,1*1e3)});Ie(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}jn=new WeakMap,zn=new WeakMap,Jn=new WeakMap;class RoomCalls extends RoomPeer{constructor(F){super(F);st(this,On,0);Ie(this,"setLocalStream",(F,Z)=>new Promise(async(D,N)=>{try{typeof F=="string"&&(F=[F]);for(const I of F)this.localStreamsActionMap.set(I,Z);if(Z){if(F.includes("microphoneCamera_audio")&&F.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):F.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):F.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):F.includes("screenSharing_audio")&&F.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):F.includes("screenSharing_audio")&&!F.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):F.includes("screenSharing_video")&&!F.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),F.includes("screenSharing_audio")){const I=await this.getLocalStream("screenSharing_audio");if(I){const z=I.getTracks();for(const J of z)J.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(F.includes("screenSharing_video")){const I=await this.getLocalStream("screenSharing_video");if(I){const z=I.getTracks();for(const J of z)J.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(F);const O=await this.getLocalStreams(F);this.cwsIns.emitNotify("onLocalStream",{code:200,data:O,desc:"local stream is change."}),D(O)}catch(O){N(O)}}));Ie(this,"setMediaDeviceKind",(F,Z)=>new Promise(async(D,N)=>{this.setDeviceKind(F,Z);const O=await this.getSelfInfo(),{id:I,tracks:z=[],callActionMap:J}=O,Q=[],ne=async re=>{const te=this.localStreamsActionMap.get(re),oe=z.find(ae=>ae.mediaType===re),le=J[re];if(te){Q.push(re),await this.stopLocalStreams([re]);try{await this.initLocalStream(re)}catch(ae){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",ae),await this.inactiveTracks([re],!1),N(ae)}}if(oe){const ae=await this.getLocalStream(re);ae&&(await this.initUserMediaStreamContext(I,re,ae),le&&await this.replaceSenderStream([re],!0))}{const ae=await this.getLocalStreams(Q);this.cwsIns.emitNotify("onLocalStream",{code:200,data:ae,desc:"local stream is change."}),await this.emitNotifyUpdateUsers(),D(!0)}};F==="audioinput"&&ne("microphoneCamera_audio"),F==="videoinput"&&ne("microphoneCamera_video"),F==="audiooutput"&&(await this.changeAudiooutput(),D(!0))}));Ie(this,"changeScreenSharing",async F=>{const Z=await this.getSelfInfo(),{tracks:D=[],callActionMap:N}=Z;try{await this.setLocalStream(F,!0);for(const O of F)D.find(z=>z.mediaType===O&&N[O])&&await this.replaceSenderStream([O],!0)}catch(O){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",O)}});Ie(this,"createSession",()=>new Promise(async(F,Z)=>{if(["connecting","connected"].includes(this.roomState))return F(!0);this.setRoomState("connecting"),await this.taskQueue.createTask({describe:"createSession",conditionKeys:["createWs","createSession"],changeConditionKeys:["createSession"],func:()=>new Promise(async(D,N)=>{try{await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async O=>{const{code:I=0,desc:z,data:J}=O;if(I!==200)return N(z);const{remoteSdp:Q}=J;await this.taskQueue.setCondition("ice",!1),await this.taskQueue.createTask({describe:"ice",timeout:30*1e3,conditionKeys:["ice"],func:()=>new Promise(ne=>setTimeout(()=>ne(!0),300)),success:async()=>{D(!0)},fail:async ne=>{throw new Error(`ice connection failed: ${ne}`)}}),await this.setRemoteDescription({type:"answer",sdp:Q})})}catch(O){N(O)}}),success:async D=>{F(D)},fail:async D=>{this.reportLogs("ws_c_timeout",D.message||D),Z(D)},complete:()=>{this.taskQueue.setCondition("createSession",!0)}})}));Ie(this,"earlyConnect",(F=[])=>{this.isEarly=!0,Be(this,An).call(this),this.createSession(),F.length===0&&(F=["microphoneCamera_audio","microphoneCamera_video"]),Be(this,$n).call(this,F)});Ie(this,"joinRoom",async F=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"joinRoom",conditionKeys:["createWs"],changeConditionKeys:["joinRoom"],func:()=>new Promise(async(N,O)=>{try{this.setOptions(F),await Be(this,An).call(this),this.clearUsers();const{roomId:I,userId:z,callType:J,sdkToken:Q}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:J,roomId:I,user:{id:z,tracks:[],callAction:0},token:Q},version:2}).then(async ne=>{const{code:re=0,desc:te="服务器繁忙",data:oe}=ne;if(re!==200)return O(te);const{roomId:le="",roomUsers:ae=[]}=oe;if(le!==I)return O("加入的房间不匹配");this.isInRoom=!0,this.initHeartbeat(),this.createSession(),await this.updateUsers(ae);const ce=[];for(const we of ae){const{id:fe,channelCache:ge}=we,{channels:me=[]}=ge;await this.updateUserBehaviors(fe,we.behavior),await this.updateUserChannels(fe,me,!1),me.length!==0&&ce.push({userId:fe,channels:me})}this.subChannel(ce),await this.emitNotifyUpdateUsers();const de=await this.getUsers();N(de)})}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("join_room_error",N.message||N),D(N)},complete:()=>{this.taskQueue.setCondition("joinRoom",!0)}})}));Ie(this,"quitRoom",()=>new Promise(async F=>{const{roomId:Z,userId:D}=this.options,N={roomId:Z,user:{id:D}};try{this.isInRoom=!1,clearInterval(Be(this,On)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(O){this.reportLogs("quit_room_error",O.message||O)}await new Promise(O=>setTimeout(()=>O(!0),300)),await this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:N}),F(!0)}));Ie(this,"quitRoomEx",()=>new Promise(async F=>{const{roomId:Z,userId:D}=this.options,N={roomId:Z,user:{id:D}};try{this.isInRoom=!1,this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(O){this.reportLogs("quit_room_error",O.message||O)}await new Promise(O=>setTimeout(()=>O(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:N}),F(!0)}));Ie(this,"syncRoomInfo",()=>new Promise(async(F,Z)=>{const{userId:D}=this.options,N=await this.getUser(D),{id:O=D,callAction:I=0}=N;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:O,callAction:I}}}).then(async z=>{if(z.code!==200)return Z(z.desc);const J=z.data.users;this.clearUsers(),await this.updateUsers(J),await this.updateUsertracks(N.id,N.tracks,!1);{const Q=await this.getUsers();F(Q)}}).catch(z=>Z(z))}));Ie(this,"publish",F=>new Promise(async(Z,D)=>{{const N=await this.getSelfInfo(),{banBehaviorMap:O}=N;let I=!0;for(const z of F)if(O[z]){I=!1;break}if(I===!1)return D("publish is error: prohibited by administrator.")}try{await this.setLocalStream(F,!0)}catch(N){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",N)}await this.taskQueue.createTask({describe:"publish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["publish"],func:()=>new Promise(async(N,O)=>{try{const I=await this.getSelfInfo(),z=[];for(const te of F){{const oe=this.getPhoneyStreams(te);await this.initUserMediaStreamContext(I.id,te,oe)}{const oe=await this.getLocalStream(te);oe?await this.initUserMediaStreamContext(I.id,te,oe):z.push(te)}}const J=F.filter(te=>!z.includes(te)||["microphoneCamera_audio","microphoneCamera_video"].includes(te));await this.replaceSenderStream(F,!1),await Be(this,$n).call(this,J);const Q=await this.getSenderTracks(J),ne=[...I.tracks,...Q];await this.updateUsertracks(I.id,ne,!0),z.length!==0&&await this.inactiveTracks(z,!1),J.length!==0&&await this.replaceSenderStream(J,!0);const re=await this.getCallAction(ne);await Be(this,En).call(this,re),await new Promise(te=>setTimeout(()=>te(!0),230)),Be(this,Wn).call(this,F);{await this.emitNotifyUpdateUsers();const te=await this.getSelfInfo();N(te)}}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("publish_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("publish",!0)}})}));Ie(this,"stopPublish",(F=[])=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"stopPublish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(N,O)=>{try{const I=await this.getSelfInfo();F.length===0&&(F=mediaType_keys);const z=I.tracks.filter(({mediaType:Q})=>Q&&F.includes(Q)),J=async()=>{this.initMediaPhoneyStreams(F);const Q=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),N(Q)};if(z.length===0)return J();await this.replaceSenderStream(F,!0),await this.closeUserTracks(I.id,z,!0),await this.removeSenders(F);{const Q=await this.getCallAction(I.tracks);await Be(this,En).call(this,Q)}await this.createOffer(),this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:z}}).then(async Q=>{const{code:ne=0,data:re,desc:te}=Q;if(ne!==200)return O(te);const{remoteSdp:oe}=re;await this.setRemoteDescription({type:"answer",sdp:oe}),J()})}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("close_track_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Ie(this,"subscribe",(F=[],Z=3)=>new Promise(async(D,N)=>{const O=await this.taskQueue.createTask({describe:"subscribe",strict:!0,conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["subscribe"],func:()=>new Promise(async(I,z)=>{try{const J=await this.getUsers();let Q=[];for(const te of J){const{isSelf:oe,tracks:le=[]}=te;if(!oe){const ae=le.filter(({trackName:ce,mid:de=""})=>de!==""&&(F.includes(ce)||F.length===0));ae.length!==0&&Q.push({...te,tracks:ae})}}const ne=async(te={})=>{const oe=Array.from(Q,({id:ae})=>ae),le=await this.getUsers(oe);await this.emitNotifyUpdateUsers(),I({users:le,detail:te})};if(Q.length===0)return ne();const re=[];for(const te of Q){const{id:oe,tracks:le}=te,ae=dt(le,["type","trackName"]),ce={id:oe,tracks:ae};re.push(ce)}this.cwsIns.sendMessage({event:"subscribe",data:{users:re}}).then(async te=>{const{code:oe=0,data:le,desc:ae}=te;if(oe!==200)return z(ae);const{remoteSdp:ce,users:de=[]}=le;this.onSubscribeUserTracks(de).then(async we=>{await this.renegotiate().then(()=>ne(we)).catch(fe=>z(fe))}).catch(we=>{z(we)}),await this.setRemoteDescription({type:"offer",sdp:ce})})}catch(J){z(J)}}),success:async I=>{O.clear(),this.taskQueue.setCondition("subscribe",!0),D(I)},fail:async I=>{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(z=>setTimeout(()=>z(!0),(3-Z)*1e3)),Z=Z-1,O.retry();O.clear(),this.reportLogs("subscribe_error",I.message||I),this.taskQueue.setCondition("subscribe",!0),N(I)},complete:async()=>{}})}));Ie(this,"renegotiate",()=>new Promise(async(F,Z)=>{try{await this.taskQueue.setCondition("renegotiate",!1),await this.createAnswer(),this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(D=>{const{code:N=0,desc:O}=D;if(N!==200)return Z(O);F(D)}).finally(()=>{this.taskQueue.setCondition("renegotiate",!0)})}catch(D){Z(D)}}));Ie(this,"stopSubscribe",(F=[])=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"closeTrack",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(N,O)=>{try{const I=await this.getUsers(),z=[];for(const Q of I){const{tracks:ne=[]}=Q;for(const re of ne){const{type:te,mid:oe,trackName:le,mediaType:ae,msid:ce}=re;if(!(!ae||!ce)&&(F.length===0||F.includes(le))){const de={type:te,mid:oe,trackName:ce};z.push(de),await this.closeUserTracks(Q.id,[re])}}}const J=async()=>{await this.emitNotifyUpdateUsers(),N(!0)};if(z.length===0)return J();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:z}}).then(async Q=>{const{remoteSdp:ne}=Q.data;await this.setRemoteDescription({type:"answer",sdp:ne})}),J()}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",N),this.reportLogs("close_track_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Ie(this,"inactiveTracks",async(F,Z)=>new Promise(async D=>{const N=await this.getSelfInfo();if(!N||!N.id)return D(!0);const{tracks:O=[]}=N,I=[...O];for(let J of I){const{mediaType:Q}=J;if(Q&&F.includes(Q)){J.enabled=Z;const ne=await this.getLocalStream(Q);if(!ne)continue;const re=ne.getTracks();for(const te of re)te.enabled=Z}}await this.replaceSenderStream(F,Z);const z=await this.getCallAction(I);await Be(this,En).call(this,z),await this.emitNotifyUpdateUsers(),D(!0)}));Ie(this,"setBanBehaviors",F=>new Promise(async(Z,D)=>{try{const{roomId:N}=this.options,O=[];for(const I of F){const{id:z,banBehaviors:J}=I,Q=Object.keys(J);if(Q.length===0)continue;const ne=[];for(const te of Q){const oe=mediaType_keys.findIndex(ce=>ce===te),le=J[te],ae={type:oe,behavior:le};ne.push(ae)}const re={id:z,behaviors:ne};O.push(re)}this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:N,users:O}}).then(async I=>{const{code:z=0,desc:J}=I;if(z!==200)return D(J);Z(I)}).finally(()=>{})}catch(N){D(N)}}));Ie(this,"pubChannel",()=>new Promise(async(F,Z)=>{const N=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:N}}).then(async O=>{const{code:I=0,data:z,desc:J}=O;if(I!==200)return Z(J);const{channels:Q=[]}=z;for(const ne of Q){const{channels:re=[]}=ne;for(const te of re){const{dataChannelName:oe,id:le}=te;this.initSendChannel(oe,le)}}F(!0)}).catch(O=>{Z(O)})}));Ie(this,"subChannel",(F=[])=>new Promise(async(Z,D)=>{if(F.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:F}}).then(async N=>{const{code:O=0,data:I,desc:z}=N;if(O!==200)return D(z);const{channels:J=[]}=I;for(const Q of J){const{channels:ne=[]}=Q;for(const re of ne){const{dataChannelName:te,id:oe}=re;this.initReceiveChannel(te,oe)}}}),success:async N=>{Z(N)},fail:async N=>{D(N)}})}));Ie(this,"debugger",()=>new Promise(async(F,Z)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async D=>{if(D.code!==200)return Z(D.desc);F(!0)}).catch(D=>{Z(D)})}));Ie(this,"shutdown",()=>new Promise(async(F,Z)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async D=>{if(D.code!==200)return Z(D.desc);F(!0)}).catch(D=>{Z(D)})}));Ie(this,"initHeartbeat",()=>{this.stopHeartbeat();const F=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),Z=this.isInRoom?5*1e3:30*1e3;At(this,On,window.setInterval(F,Z)),F()});Ie(this,"stopHeartbeat",()=>{clearInterval(Be(this,On))});st(this,Wn,async F=>{const{roomId:Z}=this.options;if(!Z)return;const{id:D,tracks:N=[]}=await this.getSelfInfo(),O=N.filter(I=>I.mediaType&&F.includes(I.mediaType));O.length!==0&&this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:Z,user:{id:D,tracks:O}}})});st(this,En,async F=>new Promise(async(Z,D)=>{const{roomId:N,userId:O}=this.options,I={roomId:N,user:{id:O,callAction:F}};await this.cwsIns.sendMessage({event:"updateCall",data:I}).then(async z=>{const{code:J=0}=z;if(J!==200)return D(z);await this.updateUserCallAction(O,F),Z(F)}).catch(z=>D(z))}));st(this,An,()=>new Promise(async(F,Z)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return F(!0);await this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:D,roomId:N,userId:O}=this.options;if(!D)return Z("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const I={c:D,r:N,v:this.sdk_service_version};if(this.isEarly){const J=xt();I.i=J,this.setOptions({earlyId:J})}else I.b=O;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",I);const z=btoa(encodeURI(JSON.stringify(I)));await this.cwsIns.connect(z),this.initHeartbeat(),await this.taskQueue.setCondition("createWs",!0),await this.taskQueue.setCondition("createSession",!0),F(!0)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",D),this.reportLogs("ws_c_timeout",D.message||D),Z(D)}}));st(this,$n,async F=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"createTrack",conditionKeys:["createWs","createSession","ice","createTrack","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(N,O)=>{try{await this.taskQueue.setCondition("createTrack",!1);const I=await this.addSenders(F),z=await this.getSenderTracks(I);if(z.length===0)return await this.taskQueue.setCondition("createTrack",!0),N(!0);this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:z,callAction:0}}).then(async J=>{const{code:Q=0,desc:ne,data:re}=J;if(Q!==200)return O(ne);const{remoteSdp:te}=re;await this.setRemoteDescription({type:"answer",sdp:te}),N(!0)})}catch(I){await this.removeSenders(F),O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("publish_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("createTrack",!0)}})}))}}On=new WeakMap,Wn=new WeakMap,En=new WeakMap,An=new WeakMap,$n=new WeakMap;class Room extends RoomCalls{constructor(K){super(K)}}class QuickVO extends Room{constructor(F){super(F);st(this,_n,new Map);Ie(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 F=[],Z=[],D=await this.getUsers();for(const N of D){const{isSelf:O,callActionMap:I,tracks:z=[]}=N;if(O)for(const J of mediaType_keys)I[J]&&F.push(J);for(const J of z)J.msid&&Z.push(J.trackName)}await this.subscribe(Z),await this.publish(F)});st(this,Vn,()=>{{const F=async Z=>{const{state:D}=Z.data;if(D==="closed"){const{roomId:N,userId:O}=this.options,I={roomId:N,user:{id:O}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:I}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}this.reconstruct()};this.cwsIns.addNotify({event:"onRoomState",callback:F},!0)}{const F=async Z=>{const{qualities:D=[]}=Z.data,[N]=D;if(!(N&&N.userId===this.options.userId&&D.length===1)){for(const O of D){const{userId:I,egress:z,ingress:J}=O;this.checkUserInRoom(I)&&await this.updateUserNetwork(I,{egress:z,ingress:J})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:F},!0)}{const F=async Z=>{const D=Z.data.user;await this.updateUsers([D]),await this.updateUsertracks(D.id,D.track,!1),await this.updateUserBehaviors(D.id,D.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:F},!0)}{const F=async Z=>{await this.removeUsers([Z.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:F},!0)}{const F=async Z=>{const{user:D}=Z.data,{id:N,tracks:O=[],callAction:I=0}=D;if(await this.updateUserCallAction(N,I),await this.updateUserPermissions(N,3),await this.updateUsertracks(N,O,!0),this.options.newPublishAutoSubscribe){const z=this.getTrackNamesFormTracks(O);await this.subscribe(z)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:F},!0)}{const F=async Z=>{const D=[Z.data];this.subChannel(D)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:F},!0)}{const F=async Z=>{const{id:D,tracks:N}=Z.data.user;D!==this.options.userId&&(await this.closeUserTracks(D,N,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:F},!0)}{const F=async Z=>{const{id:D,callAction:N}=Z.data.user;this.checkUserInRoom(D)&&(await this.updateUserCallAction(D,N),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:F},!0)}{const F=async Z=>{const{user:D}=Z.data,{id:N,permissions:O=1}=D;O===1?await this.removeUsers([N]):O===3&&await this.updateUsers([D]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:F},!0)}{const F=async Z=>{const{users:D}=Z.data;for(const N of D){const{id:O,behavior:I}=N;await this.updateUserBehaviors(O,I)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:F},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async F=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Ie(this,"addNotify",F=>this.cwsIns.addNotify(F));st(this,Zn,()=>{});st(this,Kn,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.reconstruct()}});st(this,Gn,async()=>{this.setRoomState("closed")});Ie(this,"addRequestAnimationFrame",async(F,Z)=>{{const N=Be(this,_n).get(F);N&&cancelAnimationFrame(N)}const D=(N=Date.now())=>{Z(N);const O=requestAnimationFrame(D);Be(this,_n).set(F,O)};D()});Ie(this,"clearRequestAnimationFrame",async(F=[])=>{F.length===0&&(F=[...Be(this,_n).keys()]);const Z=[];for(const D of F){const N=Be(this,_n).get(D);N&&(cancelAnimationFrame(N),Z.push(N))}return Z});Ie(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(F=>setTimeout(()=>F(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});Be(this,Zn).call(this),Be(this,Kn).call(this),Be(this,Gn).call(this),Be(this,Vn).call(this)}}_n=new WeakMap,Vn=new WeakMap,Zn=new WeakMap,Kn=new WeakMap,Gn=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
206
|
+
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 _e={a:ce};this.setModule=Te=>{q.setModule(EmscriptenWASM,Te)},this.getModule=()=>q.getModule(EmscriptenWASM),this.instantiate=()=>(this.getModule().then(Te=>WebAssembly.instantiate(Te,_e)).then(Te=>{const qe=Te.exports;de(qe),D=qe.g,N(),xe(qe),K()}),this.ready=new Promise(Te=>{K=Te}).then(()=>{this.HEAP=D.buffer,this.malloc=fe,this.free=ve,this.opus_frame_decoder_create=we,this.opus_frame_decode_float_deinterleaved=ge,this.opus_frame_decoder_destroy=me}),this)}function OpusDecoder(q={}){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(Q=>{this._common=Q,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 ne=this._common.allocateTypedArray(this._channels,Uint8Array);ne.buf.set(this._channelMappingTable),this._decoder=this._common.wasm.opus_frame_decoder_create(this._sampleRate,this._channels,this._streamCount,this._coupledStreamCount,ne.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=Q=>{if(!(Q instanceof Uint8Array))throw Error("Data to decode must be Uint8Array. Instead got "+typeof Q);this._input.buf.set(Q);let ne=this._common.wasm.opus_frame_decode_float_deinterleaved(this._decoder,this._input.ptr,Q.length,this._output.ptr),re;return ne<0&&(re="libopus "+ne+" "+(OpusDecoder.errors.get(ne)||"Unknown Error"),console.error(re),ne=0),{outputBuffer:this._common.getOutputChannels(this._output.buf,this._outputChannels,ne),samplesDecoded:ne,error:re}},this.decodeFrame=Q=>{let ne=[];const re=this._decode(Q);return re.error&&this._common.addError(ne,re.error,Q.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=Q.length,this._outputSamples+=re.samplesDecoded,this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(ne,[re.outputBuffer],this._outputChannels,re.samplesDecoded,this._sampleRate)},this.decodeFrames=Q=>{let ne=[],re=[],te=0,oe=0;for(;oe<Q.length;){const le=Q[oe++],ae=this._decode(le);ne.push(ae.outputBuffer),te+=ae.samplesDecoded,ae.error&&this._common.addError(re,ae.error,le.length,this._frameNumber,this._inputBytes,this._outputSamples),this._frameNumber++,this._inputBytes+=le.length,this._outputSamples+=ae.samplesDecoded}return this._WASMAudioDecoderCommon.getDecodedAudioMultiChannel(re,ne,this._outputChannels,te,this._sampleRate)},this._isWebWorker=OpusDecoder.isWebWorker,this._WASMAudioDecoderCommon=OpusDecoder.WASMAudioDecoderCommon||WASMAudioDecoderCommon,this._EmscriptenWASM=OpusDecoder.EmscriptenWASM||EmscriptenWASM,this._module=OpusDecoder.module;const K=8,F=Q=>typeof Q=="number",Z=q.sampleRate,D=q.channels,N=q.streamCount,O=q.coupledStreamCount,I=q.channelMappingTable,z=q.preSkip,J=q.forceStereo?1:0;if(D>2&&(!F(N)||!F(O)||!Array.isArray(I)))throw new Error("Invalid Opus Decoder Options for multichannel decoding.");return this._sampleRate=[8e3,12e3,16e3,24e3,48e3].includes(Z)?Z:48e3,this._channels=F(D)?D:2,this._streamCount=F(N)?N:1,this._coupledStreamCount=F(O)?O:this._channels-1,this._channelMappingTable=I||(this._channels===2?[0,1]:[0]),this._preSkip=z||0,this._forceStereo=D<=K&&D!=2?J: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(K){super(K,"opus-decoder",OpusDecoder,EmscriptenWASM)}async decodeFrame(K){return this.postToDecoder("decodeFrame",K)}async decodeFrames(K){return this.postToDecoder("decodeFrames",K)}}assignNames(OpusDecoder,"OpusDecoder"),assignNames(OpusDecoderWebWorker,"OpusDecoderWebWorker"),new OpusDecoder;class RoomPeer extends RoomUsers{constructor(F){super(F);Ie(this,"getPeerStatsTimer",0);Ie(this,"reports",[]);Ie(this,"peerNetwork",{inboundBytes:0,outboundBytes:0,lostRate:"0.00",roundTripTime:"0",jitter:"0"});Ie(this,"initPeer",()=>{var Z;(Z=this.peerIns)==null||Z.close(),this.transceiverMap=new Map,this.peerIns=new RTCPeerConnection({iceServers:[{urls:"stun:stun.cloudflare.com:3478"}],bundlePolicy:"max-bundle"}),this.peerIns.createDataChannel("scapegoat-channel"),Be(this,jn).call(this),Be(this,Jn).call(this);const F=[];this.peerIns.onicecandidate=async D=>{if(D.candidate){const N=await parseCandidate(D.candidate.candidate);F.push(N)}console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->Breathe: parseCandidate",F)}});Ie(this,"getNatType",async()=>{});Ie(this,"initSendChannel",(F="",Z)=>{});Ie(this,"initReceiveChannel",(F="",Z)=>{});Ie(this,"replaceSenderStream",async(F=[],Z)=>{const{userId:D}=this.options;F.length===0&&(F=mediaType_keys);for(const N of F){const O=this.transceiverMap.get(N);let I;if(O){const{sender:z}=O;Z?I=this.getUserStream(D,N):I=this.getPhoneyStreams(N);const[J]=I.getTracks();J&&await z.replaceTrack(J)}}});Ie(this,"getSenderTracks",async(F=[])=>{const Z=[];for(const D of F){const N=this.transceiverMap.get(D);if(!N)continue;const{mid:O,sender:I}=N,{track:z}=I;if(!z)continue;const{id:J,enabled:Q}=z,ne=mediaType_keys.findIndex(te=>te===D),re={type:ne,enabled:Q,trackName:`web-${ne}-${J}`,location:"local",mid:O};Z.push(re)}return Z});Ie(this,"addSenders",async(F=[])=>{F.length===0&&(this.peerIns.addTransceiver("audio",{direction:"sendonly"}),this.peerIns.addTransceiver("video",{direction:"sendonly"}));const Z=[];for(const D of F){if(this.transceiverMap.get(D))continue;const O=this.getPhoneyStreams(D),[I]=O.getTracks(),z=this.peerIns.addTransceiver(I,{direction:"sendonly"});this.transceiverMap.set(D,z),Z.push(D)}if(F.length===0||Z.length!==0){const D=await this.peerIns.createOffer();if(this.options.debug){const N=libExports$1.parse(D.sdp),O=dt(N.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setLocalDescription",{msidArr:O,sdpJson:N,description:D})}await this.peerIns.setLocalDescription(D)}return Z});Ie(this,"removeSenders",async(F=[])=>{F.length===0&&(F=mediaType_keys);for(const Z of F)this.transceiverMap.has(Z)&&this.transceiverMap.delete(Z)});Ie(this,"onSubscribeUserTracks",F=>{let Z=0;return new Promise(async D=>{const N=[];for(const O of F){const{tracks:I=[]}=O;for(const z of I){const{trackName:J,mid:Q}=z,[ne]=await this.getUserTrackByTrackName([J]);N.push({...ne,mid:Q})}}{let O=[];const I=async()=>{clearTimeout(Z);const J=new Map;for(const ne of O){const{userId:re,mediaType:te}=ne;if(!re||!te)continue;J.has(re)||J.set(re,{userId:re,tracks:[],updateStreams:{}});const le=J.get(re);le.tracks.push(ne),le.updateStreams[te]=!0}const Q=[...J.values()];for(const ne of Q){const{userId:re,tracks:te}=ne;await this.updateUsertracks(re,te,!0)}await this.emitNotifyUpdateUsersStreams(Q),this.peerIns.removeEventListener("track",z);{const ne=Array.from(N,oe=>oe.trackName),re=Array.from(O,oe=>oe.trackName),te=ne.filter(oe=>!re.includes(oe));D({target:ne,success:re,fail:te})}},z=async J=>{const{streams:Q,transceiver:ne}=J,[re]=Q,{mid:te,receiver:oe}=ne,{track:le}=oe,{id:ae}=le,ce=N.find(fe=>fe.mid===`${te}`);if(!ce)return;const{userId:de,mediaType:we}=ce;if(!(!de||!we)){{const fe={...ce,mid:te,msid:ae};O.push(fe)}this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: await subscribe ${O.length}/${N.length}`,{mediaType:we,mid:te,userTrack:ce,e:J});{const fe=new Audio;if(fe.srcObject=re,await this.initUserMediaStreamContext(de,we,re),we==="microphoneCamera_audio"||we==="screenSharing_audio"){const ge=this.getUserAudioMediaStreamContext(de,we);ge==null||ge.setMute(!1)}}N.length===O.length&&I()}};this.peerIns.addEventListener("track",z),Z=window.setTimeout(()=>{this.reportLogs("subscribe_error",`incomplete subscription. (${O.length}/${N.length})`),I()},5*1e3)}})});st(this,jn,()=>{let F=0;const Z=()=>{this.peerIns.close(),this.setRoomState("closed")};this.peerIns.onconnectionstatechange=async D=>{const N=D.target.connectionState;switch(await this.taskQueue.setCondition("ice",!1),clearTimeout(F),N){case"connected":this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#00b60f;",`------->quickvo: connectionState:${N}`),await this.taskQueue.setCondition("ice",!0),await this.getNatType(),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:${N}`),F=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:${N}`),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:${N}`),Z();break;default:this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#b64900;",`------->quickvo: connectionState:${N}`);break}}});Ie(this,"closeUserTracks",async(F,Z=[],D=!1)=>{const N=[];for(const J of Z){const{trackName:Q,msid:ne}=J;N.push(Q),ne&&N.push(ne)}const O=J=>N.includes(J),I=this.peerIns.getTransceivers();for(const J of I){const{mid:Q,sender:ne,receiver:re}=J;ne.track&&O(ne.track.id)&&(J.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.sender: ${Q} is stop.`,J)),re.track&&O(re.track.id)&&(J.stop(),this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;",`------->quickvo: transceiver.receiver: ${Q} is stop.`,J))}const z=await this.getUser(F);if(z){for(const J of z.tracks){const{trackName:Q,msid:ne,userId:re,mediaType:te}=J;!re||!te||!O(Q)||(this.removeUserMediaStreamContext(re,te),ne&&delete J.msid)}if(D){const J=z.tracks.filter(({trackName:Q})=>!O(Q));await this.updateUsertracks(F,J,!1)}}});Ie(this,"createOffer",async()=>{const F=await this.peerIns.createOffer();if(this.options.debug){const Z=libExports$1.parse(F.sdp),D=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createOffer",{msidArr:D,sdpJson:Z,description:F})}await this.peerIns.setLocalDescription(F)});Ie(this,"createAnswer",async()=>{const F=await this.peerIns.createAnswer();if(this.options.debug){const Z=libExports$1.parse(F.sdp),D=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: createAnswer",{msidArr:D,sdpJson:Z,description:F})}await this.peerIns.setLocalDescription(F)});Ie(this,"getSdp",()=>{var F;return(F=this.peerIns.localDescription)==null?void 0:F.sdp});Ie(this,"setRemoteDescription",async F=>{if(this.options.debug){const Z=libExports$1.parse(F.sdp),D=dt(Z.media,["mid","msid","type"]);console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#ffffff;","------->quickvo: setRemoteDescription",{msidArr:D,sdpJson:Z,description:F})}return await this.peerIns.setRemoteDescription(F),F});Ie(this,"setCallStrategy",async(F,Z=[])=>{Z.length===0&&(Z=mediaType_keys);let D="balanced";switch(F){case"qualityPriority":D="maintain-resolution";break;case"fluencyPriority":D="maintain-framerate";break;case"balancedDowngrade":D="balanced";break}const N=await this.getSelfInfo(),O=Array.from(N.tracks,({trackName:z})=>z),I=this.peerIns.getSenders();for(const z of I){const{track:J}=z;if(!J||!O.includes(J.id))continue;const Q=z.getParameters();z.setParameters({...Q,degradationPreference:D})}});Ie(this,"setRTCRtpSenderParameters",F=>{try{const Z=this.peerIns.getSenders();for(const D of Z){const N=D.getParameters();D.setParameters({...N,...F})}}catch(Z){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setRTCRtpSenderParameters is error.",Z)}});Ie(this,"getReportsByMid",async(F=[])=>F.length===0?this.reports:this.reports.filter(Z=>F.includes(Z.mid)));Ie(this,"getRoomNetwork",()=>this.peerNetwork);Ie(this,"getPeerNetwork",()=>this.peerNetwork);st(this,zn,async()=>{try{const F=await this.peerIns.getStats(),Z=["inbound-rtp","remote-inbound-rtp","outbound-rtp","transport"],N=[...F.values()].filter(ge=>Z.includes(ge.type));let O=0,I=0,z=0,J=0,Q=0,ne=0,re=[],te=[];for(const ge of this.reports){const{packetsSent:me,packetsLost:ve}=ge;me&&(z+=me),ve&&(J+=ve)}this.reports=N;for(const ge of this.reports){const{bytesSent:me,bytesReceived:ve,packetsSent:ke,packetsLost:xe,roundTripTime:_e,jitter:Te}=ge;me&&(I=me),ve&&(O=ve),ke&&(Q+=ke),xe&&(ne+=xe),_e&&re.push((_e*100).toFixed(2)),Te&&te.push(Te.toFixed(2))}te.sort().reverse(),re.sort().reverse();const oe=Q-z,le=ne-J,ae=oe===0?"0.00":(le/oe).toFixed(2),[ce="0"]=re,[de="0"]=te,we={outboundBytes:I,inboundBytes:O,lostRate:ae,roundTripTime:ce,jitter:de};this.peerNetwork=we;const fe=(ge,me,ve)=>{const ke=Number(ge),xe=Number(me),_e=Number(ve);let Te="0";return ke<.03&&xe<100&&_e<.05?Te="5":ke<.06&&xe<160&&_e<.1?Te="4":ke<.1&&xe<250&&_e<.15?Te="3":ke<.15&&xe<400&&_e<.2?Te="2":Te="1",Number(Te)};{const ge=fe(ae,ce,de),me=await this.getSelfInfo(),{network:ve}=me,ke={egress:ge,ingress:ge};$t("updateUserNetwork",async()=>{if(await this.updateUserNetwork(this.options.userId,ke),JSON.stringify(ve)!==JSON.stringify(ke)){this.emitNotifyUpdateUsers();const{userId:Te,roomId:qe}=this.options;this.cwsIns.sendMessage({event:"networkQualityChange",data:{...ke,userId:Te,roomId:qe}},!1)}},3*1e3)}}catch(F){console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setNetQuality is err.",F)}});st(this,Jn,()=>{const F=async()=>{this.peerIns.connectionState!=="connected"||!this.options.roomId||Be(this,zn).call(this)};this.getPeerStatsTimer=window.setInterval(F,1*1e3)});Ie(this,"stopGetPeerStats",()=>clearInterval(this.getPeerStatsTimer))}}jn=new WeakMap,zn=new WeakMap,Jn=new WeakMap;class RoomCalls extends RoomPeer{constructor(F){super(F);st(this,On,0);Ie(this,"setLocalStream",(F,Z)=>new Promise(async(D,N)=>{try{typeof F=="string"&&(F=[F]);for(const I of F)this.localStreamsActionMap.set(I,Z);if(Z){if(F.includes("microphoneCamera_audio")&&F.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera"):F.includes("microphoneCamera_audio")?await this.initLocalStream("microphoneCamera_audio"):F.includes("microphoneCamera_video")?await this.initLocalStream("microphoneCamera_video"):F.includes("screenSharing_audio")&&F.includes("screenSharing_video")?await this.initLocalStream("screenSharing"):F.includes("screenSharing_audio")&&!F.includes("screenSharing_video")?await this.initLocalStream("screenSharing_audio"):F.includes("screenSharing_video")&&!F.includes("screenSharing_audio")&&await this.initLocalStream("screenSharing_video"),F.includes("screenSharing_audio")){const I=await this.getLocalStream("screenSharing_audio");if(I){const z=I.getTracks();for(const J of z)J.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}if(F.includes("screenSharing_video")){const I=await this.getLocalStream("screenSharing_video");if(I){const z=I.getTracks();for(const J of z)J.onended=()=>this.stopPublish(["screenSharing_audio","screenSharing_video"])}}}else await this.stopLocalStreams(F);const O=await this.getLocalStreams(F);this.cwsIns.emitNotify("onLocalStream",{code:200,data:O,desc:"local stream is change."}),D(O)}catch(O){N(O)}}));Ie(this,"setMediaDeviceKind",(F,Z)=>new Promise(async(D,N)=>{this.setDeviceKind(F,Z);const O=await this.getSelfInfo(),{id:I,tracks:z=[],callActionMap:J}=O,Q=[],ne=async re=>{const te=this.localStreamsActionMap.get(re),oe=z.find(ae=>ae.mediaType===re),le=J[re];if(te){Q.push(re),await this.stopLocalStreams([re]);try{await this.initLocalStream(re)}catch(ae){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: initLocalStream is error.",ae),await this.inactiveTracks([re],!1),N(ae)}}if(oe){const ae=await this.getLocalStream(re);ae&&(await this.initUserMediaStreamContext(I,re,ae),le&&await this.replaceSenderStream([re],!0))}{const ae=await this.getLocalStreams(Q);this.cwsIns.emitNotify("onLocalStream",{code:200,data:ae,desc:"local stream is change."}),await this.emitNotifyUpdateUsers(),D(!0)}};F==="audioinput"&&ne("microphoneCamera_audio"),F==="videoinput"&&ne("microphoneCamera_video"),F==="audiooutput"&&(await this.changeAudiooutput(),D(!0))}));Ie(this,"changeScreenSharing",async F=>{const Z=await this.getSelfInfo(),{tracks:D=[],callActionMap:N}=Z;try{await this.setLocalStream(F,!0);for(const O of F)D.find(z=>z.mediaType===O&&N[O])&&await this.replaceSenderStream([O],!0)}catch(O){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: changeScreenSharing is error.",O)}});Ie(this,"createSession",()=>new Promise(async(F,Z)=>{if(["connecting","connected"].includes(this.roomState))return F(!0);this.setRoomState("connecting"),await this.taskQueue.createTask({describe:"createSession",conditionKeys:["createWs","createSession"],changeConditionKeys:["createSession"],func:()=>new Promise(async(D,N)=>{try{await this.addSenders(),this.cwsIns.sendMessage({event:"connectCF",data:{sdp:this.getSdp()}}).then(async O=>{const{code:I=0,desc:z,data:J}=O;if(I!==200)return N(z);const{remoteSdp:Q}=J;await this.taskQueue.setCondition("ice",!1),await this.taskQueue.createTask({describe:"ice",timeout:30*1e3,conditionKeys:["ice"],func:()=>new Promise(ne=>setTimeout(()=>ne(!0),300)),success:async()=>{D(!0)},fail:async ne=>{throw new Error(`ice connection failed: ${ne}`)}}),await this.setRemoteDescription({type:"answer",sdp:Q})})}catch(O){N(O)}}),success:async D=>{F(D)},fail:async D=>{this.reportLogs("ws_c_timeout",D.message||D),Z(D)},complete:()=>{this.taskQueue.setCondition("createSession",!0)}})}));Ie(this,"earlyConnect",(F=[])=>{this.isEarly=!0,Be(this,An).call(this),this.createSession(),F.length===0&&(F=["microphoneCamera_audio","microphoneCamera_video"]),Be(this,$n).call(this,F)});Ie(this,"joinRoom",async F=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"joinRoom",conditionKeys:["createWs"],changeConditionKeys:["joinRoom"],func:()=>new Promise(async(N,O)=>{try{this.setOptions(F),await Be(this,An).call(this),this.clearUsers();const{roomId:I,userId:z,callType:J,sdkToken:Q}=this.options;this.cwsIns.sendMessage({event:this.isEarly?"joinRoomEx":"joinRoom",data:{callType:J,roomId:I,user:{id:z,tracks:[],callAction:0},token:Q},version:2}).then(async ne=>{const{code:re=0,desc:te="服务器繁忙",data:oe}=ne;if(re!==200)return O(te);const{roomId:le="",roomUsers:ae=[]}=oe;if(le!==I)return O("加入的房间不匹配");this.isInRoom=!0,this.taskQueue.setCondition("createTrack",!0),this.taskQueue.setCondition("publish",!0),this.taskQueue.setCondition("subscribe",!0),this.taskQueue.setCondition("renegotiate",!0),this.taskQueue.setCondition("closeTrack",!0),this.initHeartbeat(),this.createSession(),await this.updateUsers(ae);const ce=[];for(const we of ae){const{id:fe,channelCache:ge}=we,{channels:me=[]}=ge;await this.updateUserBehaviors(fe,we.behavior),await this.updateUserChannels(fe,me,!1),me.length!==0&&ce.push({userId:fe,channels:me})}this.subChannel(ce),await this.emitNotifyUpdateUsers();const de=await this.getUsers();N(de)})}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("join_room_error",N.message||N),D(N)},complete:()=>{this.taskQueue.setCondition("joinRoom",!0)}})}));Ie(this,"quitRoom",()=>new Promise(async F=>{const{roomId:Z,userId:D}=this.options,N={roomId:Z,user:{id:D}};try{this.isInRoom=!1,clearInterval(Be(this,On)),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.setRoomState("ready")}catch(O){this.reportLogs("quit_room_error",O.message||O)}await new Promise(O=>setTimeout(()=>O(!0),300)),await this.taskQueue.setCondition("closeTrack",!0),this.cwsIns.sendMessage({event:"quitRoom",data:N}),F(!0)}));Ie(this,"quitRoomEx",()=>new Promise(async F=>{const{roomId:Z,userId:D}=this.options,N={roomId:Z,user:{id:D}};try{this.isInRoom=!1,this.initHeartbeat(),await this.stopLocalStreams(),this.stopSubscribe(),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams()}catch(O){this.reportLogs("quit_room_error",O.message||O)}await new Promise(O=>setTimeout(()=>O(!0),300)),this.cwsIns.sendMessage({event:"quitRoomEx",data:N}),F(!0)}));Ie(this,"syncRoomInfo",()=>new Promise(async(F,Z)=>{const{userId:D}=this.options,N=await this.getUser(D),{id:O=D,callAction:I=0}=N;this.cwsIns.sendMessage({event:"syncRoomInfo",data:{user:{id:O,callAction:I}}}).then(async z=>{if(z.code!==200)return Z(z.desc);const J=z.data.users;this.clearUsers(),await this.updateUsers(J),await this.updateUsertracks(N.id,N.tracks,!1);{const Q=await this.getUsers();F(Q)}}).catch(z=>Z(z))}));Ie(this,"publish",F=>new Promise(async(Z,D)=>{{const N=await this.getSelfInfo(),{banBehaviorMap:O}=N;let I=!0;for(const z of F)if(O[z]){I=!1;break}if(I===!1)return D("publish is error: prohibited by administrator.")}try{await this.setLocalStream(F,!0)}catch(N){this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: setLocalStream is error.",N)}await this.taskQueue.createTask({describe:"publish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["publish"],func:()=>new Promise(async(N,O)=>{try{const I=await this.getSelfInfo(),z=[];for(const te of F){{const oe=this.getPhoneyStreams(te);await this.initUserMediaStreamContext(I.id,te,oe)}{const oe=await this.getLocalStream(te);oe?await this.initUserMediaStreamContext(I.id,te,oe):z.push(te)}}const J=F.filter(te=>!z.includes(te)||["microphoneCamera_audio","microphoneCamera_video"].includes(te));await this.replaceSenderStream(F,!1),await Be(this,$n).call(this,J);const Q=await this.getSenderTracks(J),ne=[...I.tracks,...Q];await this.updateUsertracks(I.id,ne,!0),z.length!==0&&await this.inactiveTracks(z,!1),J.length!==0&&await this.replaceSenderStream(J,!0);const re=await this.getCallAction(ne);await Be(this,En).call(this,re),await new Promise(te=>setTimeout(()=>te(!0),230)),Be(this,Wn).call(this,F);{await this.emitNotifyUpdateUsers();const te=await this.getSelfInfo();N(te)}}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("publish_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("publish",!0)}})}));Ie(this,"stopPublish",(F=[])=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"stopPublish",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(N,O)=>{try{const I=await this.getSelfInfo();F.length===0&&(F=mediaType_keys);const z=I.tracks.filter(({mediaType:Q})=>Q&&F.includes(Q)),J=async()=>{this.initMediaPhoneyStreams(F);const Q=await this.getSelfInfo();await this.emitNotifyUpdateUsers(),N(Q)};if(z.length===0)return J();await this.replaceSenderStream(F,!0),await this.closeUserTracks(I.id,z,!0),await this.removeSenders(F);{const Q=await this.getCallAction(I.tracks);await Be(this,En).call(this,Q)}await this.createOffer(),this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:z}}).then(async Q=>{const{code:ne=0,data:re,desc:te}=Q;if(ne!==200)return O(te);const{remoteSdp:oe}=re;await this.setRemoteDescription({type:"answer",sdp:oe}),J()})}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("close_track_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Ie(this,"subscribe",(F=[],Z=3)=>new Promise(async(D,N)=>{const O=await this.taskQueue.createTask({describe:"subscribe",strict:!0,conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe","renegotiate","closeTrack"],changeConditionKeys:["subscribe"],func:()=>new Promise(async(I,z)=>{try{const J=await this.getUsers();let Q=[];for(const te of J){const{isSelf:oe,tracks:le=[]}=te;if(!oe){const ae=le.filter(({trackName:ce,mid:de=""})=>de!==""&&(F.includes(ce)||F.length===0));ae.length!==0&&Q.push({...te,tracks:ae})}}const ne=async(te={})=>{const oe=Array.from(Q,({id:ae})=>ae),le=await this.getUsers(oe);await this.emitNotifyUpdateUsers(),I({users:le,detail:te})};if(Q.length===0)return ne();const re=[];for(const te of Q){const{id:oe,tracks:le}=te,ae=dt(le,["type","trackName"]),ce={id:oe,tracks:ae};re.push(ce)}this.cwsIns.sendMessage({event:"subscribe",data:{users:re}}).then(async te=>{const{code:oe=0,data:le,desc:ae}=te;if(oe!==200)return z(ae);const{remoteSdp:ce,users:de=[]}=le;this.onSubscribeUserTracks(de).then(async we=>{await this.renegotiate().then(()=>ne(we)).catch(fe=>z(fe))}).catch(we=>{z(we)}),await this.setRemoteDescription({type:"offer",sdp:ce})})}catch(J){z(J)}}),success:async I=>{O.clear(),this.taskQueue.setCondition("subscribe",!0),D(I)},fail:async I=>{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(z=>setTimeout(()=>z(!0),(3-Z)*1e3)),Z=Z-1,O.retry();O.clear(),this.reportLogs("subscribe_error",I.message||I),this.taskQueue.setCondition("subscribe",!0),N(I)},complete:async()=>{}})}));Ie(this,"renegotiate",()=>new Promise(async(F,Z)=>{try{await this.taskQueue.setCondition("renegotiate",!1),await this.createAnswer(),this.cwsIns.sendMessage({event:"renegotiate",data:{sdp:this.getSdp()}}).then(D=>{const{code:N=0,desc:O}=D;if(N!==200)return Z(O);F(D)}).finally(()=>{this.taskQueue.setCondition("renegotiate",!0)})}catch(D){Z(D)}}));Ie(this,"stopSubscribe",(F=[])=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"closeTrack",conditionKeys:["createWs","createSession","ice","createTrack","publish","subscribe"],changeConditionKeys:["closeTrack"],func:()=>new Promise(async(N,O)=>{try{const I=await this.getUsers(),z=[];for(const Q of I){const{tracks:ne=[]}=Q;for(const re of ne){const{type:te,mid:oe,trackName:le,mediaType:ae,msid:ce}=re;if(!(!ae||!ce)&&(F.length===0||F.includes(le))){const de={type:te,mid:oe,trackName:ce};z.push(de),await this.closeUserTracks(Q.id,[re])}}}const J=async()=>{await this.emitNotifyUpdateUsers(),N(!0)};if(z.length===0)return J();await this.createOffer(),await this.cwsIns.sendMessage({event:"closeTrack",data:{roomId:this.options.roomId,sdp:this.getSdp(),tracks:z}}).then(async Q=>{const{remoteSdp:ne}=Q.data;await this.setRemoteDescription({type:"answer",sdp:ne})}),J()}catch(I){O(I)}}),success:async N=>{Z(N)},fail:async N=>{console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: stopPublish is error.",N),this.reportLogs("close_track_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("closeTrack",!0)}})}));Ie(this,"inactiveTracks",async(F,Z)=>new Promise(async D=>{const N=await this.getSelfInfo();if(!N||!N.id)return D(!0);const{tracks:O=[]}=N,I=[...O];for(let J of I){const{mediaType:Q}=J;if(Q&&F.includes(Q)){J.enabled=Z;const ne=await this.getLocalStream(Q);if(!ne)continue;const re=ne.getTracks();for(const te of re)te.enabled=Z}}await this.replaceSenderStream(F,Z);const z=await this.getCallAction(I);await Be(this,En).call(this,z),await this.emitNotifyUpdateUsers(),D(!0)}));Ie(this,"setBanBehaviors",F=>new Promise(async(Z,D)=>{try{const{roomId:N}=this.options,O=[];for(const I of F){const{id:z,banBehaviors:J}=I,Q=Object.keys(J);if(Q.length===0)continue;const ne=[];for(const te of Q){const oe=mediaType_keys.findIndex(ce=>ce===te),le=J[te],ae={type:oe,behavior:le};ne.push(ae)}const re={id:z,behaviors:ne};O.push(re)}this.cwsIns.sendMessage({event:"preventUsersBehavior",data:{roomId:N,users:O}}).then(async I=>{const{code:z=0,desc:J}=I;if(z!==200)return D(J);Z(I)}).finally(()=>{})}catch(N){D(N)}}));Ie(this,"pubChannel",()=>new Promise(async(F,Z)=>{const N=[{dataChannelName:"web-channe"}];await this.cwsIns.sendMessage({event:"pubChannel",data:{channels:N}}).then(async O=>{const{code:I=0,data:z,desc:J}=O;if(I!==200)return Z(J);const{channels:Q=[]}=z;for(const ne of Q){const{channels:re=[]}=ne;for(const te of re){const{dataChannelName:oe,id:le}=te;this.initSendChannel(oe,le)}}F(!0)}).catch(O=>{Z(O)})}));Ie(this,"subChannel",(F=[])=>new Promise(async(Z,D)=>{if(F.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:F}}).then(async N=>{const{code:O=0,data:I,desc:z}=N;if(O!==200)return D(z);const{channels:J=[]}=I;for(const Q of J){const{channels:ne=[]}=Q;for(const re of ne){const{dataChannelName:te,id:oe}=re;this.initReceiveChannel(te,oe)}}}),success:async N=>{Z(N)},fail:async N=>{D(N)}})}));Ie(this,"debugger",()=>new Promise(async(F,Z)=>{await this.cwsIns.sendMessage({event:"debugger"},!1).then(async D=>{if(D.code!==200)return Z(D.desc);F(!0)}).catch(D=>{Z(D)})}));Ie(this,"shutdown",()=>new Promise(async(F,Z)=>{await this.cwsIns.sendMessage({event:"shutdown"},!1).then(async D=>{if(D.code!==200)return Z(D.desc);F(!0)}).catch(D=>{Z(D)})}));Ie(this,"initHeartbeat",()=>{this.stopHeartbeat();const F=()=>this.cwsIns.sendMessage({event:this.isInRoom?"heartbeat":"heartbeatEx"},!1),Z=this.isInRoom?5*1e3:30*1e3;At(this,On,window.setInterval(F,Z)),F()});Ie(this,"stopHeartbeat",()=>{clearInterval(Be(this,On))});st(this,Wn,async F=>{const{roomId:Z}=this.options;if(!Z)return;const{id:D,tracks:N=[]}=await this.getSelfInfo(),O=N.filter(I=>I.mediaType&&F.includes(I.mediaType));O.length!==0&&this.cwsIns.sendMessage({event:"pubNotify",data:{roomId:Z,user:{id:D,tracks:O}}})});st(this,En,async F=>new Promise(async(Z,D)=>{const{roomId:N,userId:O}=this.options,I={roomId:N,user:{id:O,callAction:F}};await this.cwsIns.sendMessage({event:"updateCall",data:I}).then(async z=>{const{code:J=0}=z;if(J!==200)return D(z);await this.updateUserCallAction(O,F),Z(F)}).catch(z=>D(z))}));st(this,An,()=>new Promise(async(F,Z)=>{try{if(["connecting","connected"].includes(this.cwsIns.state))return F(!0);await this.taskQueue.setCondition("createWs",!1),this.cwsIns.clearEvents(),this.initPeer();const{appid:D,roomId:N,userId:O}=this.options;if(!D)return Z("quickvo: createWs is error. You must first use QuickVO.setOptions to set the appid.");const I={c:D,r:N,v:this.sdk_service_version};if(this.isEarly){const J=xt();I.i=J,this.setOptions({earlyId:J})}else I.b=O;this.options.debug&&console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs",I);const z=btoa(encodeURI(JSON.stringify(I)));await this.cwsIns.connect(z),this.initHeartbeat(),await this.taskQueue.setCondition("createWs",!0),await this.taskQueue.setCondition("createSession",!0),F(!0)}catch(D){console.error("\x1B[38;2;0;151;255m%c%s\x1B[0m","color:#0097ff;","------->quickvo: createWs is error.",D),this.reportLogs("ws_c_timeout",D.message||D),Z(D)}}));st(this,$n,async F=>new Promise(async(Z,D)=>{await this.taskQueue.createTask({describe:"createTrack",conditionKeys:["createWs","createSession","ice","createTrack","subscribe","renegotiate","closeTrack"],func:()=>new Promise(async(N,O)=>{try{await this.taskQueue.setCondition("createTrack",!1);const I=await this.addSenders(F),z=await this.getSenderTracks(I);if(z.length===0)return await this.taskQueue.setCondition("createTrack",!0),N(!0);this.cwsIns.sendMessage({event:"publish",data:{sdp:this.getSdp(),tracks:z,callAction:0}}).then(async J=>{const{code:Q=0,desc:ne,data:re}=J;if(Q!==200)return O(ne);const{remoteSdp:te}=re;await this.setRemoteDescription({type:"answer",sdp:te}),N(!0)})}catch(I){await this.removeSenders(F),O(I)}}),success:async N=>{Z(N)},fail:async N=>{this.reportLogs("publish_error",N.message||N),D(N)},complete:async()=>{await this.taskQueue.setCondition("createTrack",!0)}})}))}}On=new WeakMap,Wn=new WeakMap,En=new WeakMap,An=new WeakMap,$n=new WeakMap;class Room extends RoomCalls{constructor(K){super(K)}}class QuickVO extends Room{constructor(F){super(F);st(this,_n,new Map);Ie(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 F=[],Z=[],D=await this.getUsers();for(const N of D){const{isSelf:O,callActionMap:I,tracks:z=[]}=N;if(O)for(const J of mediaType_keys)I[J]&&F.push(J);for(const J of z)J.msid&&Z.push(J.trackName)}await this.subscribe(Z),await this.publish(F)});st(this,Vn,()=>{{const F=async Z=>{const{state:D}=Z.data;if(D==="closed"){const{roomId:N,userId:O}=this.options,I={roomId:N,user:{id:O}};this.stopHeartbeat(),this.cwsIns.sendMessage({event:"quitRoom",data:I}),this.cwsIns.close(),this.reportLogs("webrtc_c_timeout","webrtc state is closed.")}this.reconstruct()};this.cwsIns.addNotify({event:"onRoomState",callback:F},!0)}{const F=async Z=>{const{qualities:D=[]}=Z.data,[N]=D;if(!(N&&N.userId===this.options.userId&&D.length===1)){for(const O of D){const{userId:I,egress:z,ingress:J}=O;this.checkUserInRoom(I)&&await this.updateUserNetwork(I,{egress:z,ingress:J})}await this.emitNotifyUpdateUsers()}};this.cwsIns.addNotify({event:"onNetQuality",callback:F},!0)}{const F=async Z=>{const D=Z.data.user;await this.updateUsers([D]),await this.updateUsertracks(D.id,D.track,!1),await this.updateUserBehaviors(D.id,D.behavior),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onJoinRoom",callback:F},!0)}{const F=async Z=>{await this.removeUsers([Z.data.user.id]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onQuitRoom",callback:F},!0)}{const F=async Z=>{const{user:D}=Z.data,{id:N,tracks:O=[],callAction:I=0}=D;if(await this.updateUserCallAction(N,I),await this.updateUserPermissions(N,3),await this.updateUsertracks(N,O,!0),this.options.newPublishAutoSubscribe){const z=this.getTrackNamesFormTracks(O);await this.subscribe(z)}else await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onPublish",callback:F},!0)}{const F=async Z=>{const D=[Z.data];this.subChannel(D)};this.cwsIns.addNotify({event:"onDataChannelPublish",callback:F},!0)}{const F=async Z=>{const{id:D,tracks:N}=Z.data.user;D!==this.options.userId&&(await this.closeUserTracks(D,N,!0),await this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onCloseTrack",callback:F},!0)}{const F=async Z=>{const{id:D,callAction:N}=Z.data.user;this.checkUserInRoom(D)&&(await this.updateUserCallAction(D,N),this.emitNotifyUpdateUsers())};this.cwsIns.addNotify({event:"onUpdateCall",callback:F},!0)}{const F=async Z=>{const{user:D}=Z.data,{id:N,permissions:O=1}=D;O===1?await this.removeUsers([N]):O===3&&await this.updateUsers([D]),await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdatePermissions",callback:F},!0)}{const F=async Z=>{const{users:D}=Z.data;for(const N of D){const{id:O,behavior:I}=N;await this.updateUserBehaviors(O,I)}await this.emitNotifyUpdateUsers()};this.cwsIns.addNotify({event:"onUpdateBehavior",callback:F},!0)}this.cwsIns.addNotify({event:"onTokenExpired",callback:async F=>this.destroy()},!0),this.cwsIns.addNotify({event:"destroyRoom",callback:this.destroy},!0)});Ie(this,"addNotify",F=>this.cwsIns.addNotify(F));st(this,Zn,()=>{});st(this,Kn,()=>{this.cwsIns.onReconnectSuccess=async()=>{this.reconstruct()}});st(this,Gn,async()=>{this.setRoomState("closed")});Ie(this,"addRequestAnimationFrame",async(F,Z)=>{{const N=Be(this,_n).get(F);N&&cancelAnimationFrame(N)}const D=(N=Date.now())=>{Z(N);const O=requestAnimationFrame(D);Be(this,_n).set(F,O)};D()});Ie(this,"clearRequestAnimationFrame",async(F=[])=>{F.length===0&&(F=[...Be(this,_n).keys()]);const Z=[];for(const D of F){const N=Be(this,_n).get(D);N&&(cancelAnimationFrame(N),Z.push(N))}return Z});Ie(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(F=>setTimeout(()=>F(!0),300)),this.stopGetPeerStats(),this.clearUsers(),this.clearUserStreams(),this.cwsIns.clearEvents(),this.cwsIns.close()});Be(this,Zn).call(this),Be(this,Kn).call(this),Be(this,Gn).call(this),Be(this,Vn).call(this)}}_n=new WeakMap,Vn=new WeakMap,Zn=new WeakMap,Kn=new WeakMap,Gn=new WeakMap,exports.QuickVO=QuickVO,exports.ignoreEvent=ignoreEvent,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|