@cloudflare/realtimekit 1.0.2-staging.1 → 1.0.2-staging.3

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/mock.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function Tt(e){let t=typeof e;if(t=="object"){if(Array.isArray(e))return"array";if(e===null)return"null"}return t}function es(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}let z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),qe=[];for(let e=0;e<z.length;e++)qe[z[e].charCodeAt(0)]=e;qe["-".charCodeAt(0)]=z.indexOf("+");qe["_".charCodeAt(0)]=z.indexOf("/");function ts(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let n=new Uint8Array(t),s=0,r=0,o,l=0;for(let p=0;p<e.length;p++){if(o=qe[e.charCodeAt(p)],o===void 0)switch(e[p]){case"=":r=0;case`
2
- `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:l=o,r=1;break;case 1:n[s++]=l<<2|(o&48)>>4,l=o,r=2;break;case 2:n[s++]=(l&15)<<4|(o&60)>>2,l=o,r=3;break;case 3:n[s++]=(l&3)<<6|o,r=0;break}}if(r==1)throw Error("invalid base64 string.");return n.subarray(0,s)}function ns(e){let t="",n=0,s,r=0;for(let o=0;o<e.length;o++)switch(s=e[o],n){case 0:t+=z[s>>2],r=(s&3)<<4,n=1;break;case 1:t+=z[r|s>>4],r=(s&15)<<2,n=2;break;case 2:t+=z[r|s>>6],t+=z[s&63],n=0;break}return n&&(t+=z[r],t+="=",n==1&&(t+="=")),t}var Pe;(function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(n,s,r,o,l)=>{(t(s)?s[e.symbol]:s[e.symbol]=[]).push({no:r,wireType:o,data:l})},e.onWrite=(n,s,r)=>{for(let{no:o,wireType:l,data:p}of e.list(s))r.tag(o,l).raw(p)},e.list=(n,s)=>{if(t(n)){let r=n[e.symbol];return s?r.filter(o=>o.no==s):r}return[]},e.last=(n,s)=>e.list(n,s).slice(-1)[0];const t=n=>n&&Array.isArray(n[e.symbol])})(Pe||(Pe={}));var P;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(P||(P={}));function ss(){let e=0,t=0;for(let s=0;s<28;s+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,(n&128)==0)return this.assertBounds(),[e,t];for(let s=3;s<=31;s+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function Qe(e,t,n){for(let o=0;o<28;o=o+7){const l=e>>>o,p=!(l>>>7==0&&t==0),h=(p?l|128:l)&255;if(n.push(h),!p)return}const s=e>>>28&15|(t&7)<<4,r=t>>3!=0;if(n.push((r?s|128:s)&255),!!r){for(let o=3;o<31;o=o+7){const l=t>>>o,p=l>>>7!=0,h=(p?l|128:l)&255;if(n.push(h),!p)return}n.push(t>>>31&1)}}const Ne=(1<<16)*(1<<16);function Qt(e){let t=e[0]=="-";t&&(e=e.slice(1));const n=1e6;let s=0,r=0;function o(l,p){const h=Number(e.slice(l,p));r*=n,s=s*n+h,s>=Ne&&(r=r+(s/Ne|0),s=s%Ne)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[t,s,r]}function rt(e,t){if(t>>>0<=2097151)return""+(Ne*t+(e>>>0));let n=e&16777215,s=(e>>>24|t<<8)>>>0&16777215,r=t>>16&65535,o=n+s*6777216+r*6710656,l=s+r*8147497,p=r*2,h=1e7;o>=h&&(l+=Math.floor(o/h),o%=h),l>=h&&(p+=Math.floor(l/h),l%=h);function T(_,I){let v=_?String(_):"";return I?"0000000".slice(v.length)+v:v}return T(p,0)+T(l,p)+T(o,1)}function Ct(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function rs(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}let N;function os(){const e=new DataView(new ArrayBuffer(8));N=globalThis.BigInt!==void 0&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}os();function en(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const tn=/^-?[0-9]+$/,Le=4294967296,Ee=2147483648;class nn{constructor(t,n){this.lo=t|0,this.hi=n|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*Le+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class M extends nn{static from(t){if(N)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=N.C(t);case"number":if(t===0)return this.ZERO;t=N.C(t);case"bigint":if(!t)return this.ZERO;if(t<N.UMIN)throw new Error("signed value for ulong");if(t>N.UMAX)throw new Error("ulong too large");return N.V.setBigUint64(0,t,!0),new M(N.V.getInt32(0,!0),N.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!tn.test(t))throw new Error("string is no integer");let[n,s,r]=Qt(t);if(n)throw new Error("signed value for ulong");return new M(s,r);case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new M(t,t/Le)}throw new Error("unknown value "+typeof t)}toString(){return N?this.toBigInt().toString():rt(this.lo,this.hi)}toBigInt(){return en(N),N.V.setInt32(0,this.lo,!0),N.V.setInt32(4,this.hi,!0),N.V.getBigUint64(0,!0)}}M.ZERO=new M(0,0);class x extends nn{static from(t){if(N)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=N.C(t);case"number":if(t===0)return this.ZERO;t=N.C(t);case"bigint":if(!t)return this.ZERO;if(t<N.MIN)throw new Error("signed long too small");if(t>N.MAX)throw new Error("signed long too large");return N.V.setBigInt64(0,t,!0),new x(N.V.getInt32(0,!0),N.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!tn.test(t))throw new Error("string is no integer");let[n,s,r]=Qt(t);if(n){if(r>Ee||r==Ee&&s!=0)throw new Error("signed long too small")}else if(r>=Ee)throw new Error("signed long too large");let o=new x(s,r);return n?o.negate():o;case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new x(t,t/Le):new x(-t,-t/Le).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&Ee)!==0}negate(){let t=~this.hi,n=this.lo;return n?n=~n+1:t+=1,new x(n,t)}toString(){if(N)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+rt(t.lo,t.hi)}return rt(this.lo,this.hi)}toBigInt(){return en(N),N.V.setInt32(0,this.lo,!0),N.V.setInt32(4,this.hi,!0),N.V.getBigInt64(0,!0)}}x.ZERO=new x(0,0);const Pt={readUnknownField:!0,readerFactory:e=>new is(e)};function as(e){return e?Object.assign(Object.assign({},Pt),e):Pt}class is{constructor(t,n){this.varint64=ss,this.uint32=rs,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=n!=null?n:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),n=t>>>3,s=t&7;if(n<=0||s<0||s>5)throw new Error("illegal tag: field no "+n+" wire type "+s);return[n,s]}skip(t){let n=this.pos;switch(t){case P.Varint:for(;this.buf[this.pos++]&128;);break;case P.Bit64:this.pos+=4;case P.Bit32:this.pos+=4;break;case P.LengthDelimited:let s=this.uint32();this.pos+=s;break;case P.StartGroup:let r;for(;(r=this.tag()[1])!==P.EndGroup;)this.skip(r);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return new x(...this.varint64())}uint64(){return new M(...this.varint64())}sint64(){let[t,n]=this.varint64(),s=-(t&1);return t=(t>>>1|(n&1)<<31)^s,n=n>>>1^s,new x(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new M(this.sfixed32(),this.sfixed32())}sfixed64(){return new x(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(){return this.textDecoder.decode(this.bytes())}}function E(e,t){if(!e)throw new Error(t)}const cs=34028234663852886e22,us=-34028234663852886e22,ls=4294967295,ds=2147483647,ps=-2147483648;function Te(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>ds||e<ps)throw new Error("invalid int 32: "+e)}function Ae(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>ls||e<0)throw new Error("invalid uint 32: "+e)}function wt(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(!!Number.isFinite(e)&&(e>cs||e<us))throw new Error("invalid float 32: "+e)}const Lt={writeUnknownFields:!0,writerFactory:()=>new fs};function ms(e){return e?Object.assign(Object.assign({},Lt),e):Lt}class fs{constructor(t){this.stack=[],this.textEncoder=t!=null?t:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let r=0;r<this.chunks.length;r++)t+=this.chunks[r].length;let n=new Uint8Array(t),s=0;for(let r=0;r<this.chunks.length;r++)n.set(this.chunks[r],s),s+=this.chunks[r].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,n){return this.uint32((t<<3|n)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(Ae(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return Te(t),Ct(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.textEncoder.encode(t);return this.uint32(n.byteLength),this.raw(n)}float(t){wt(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){Ae(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){Te(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return Te(t),t=(t<<1^t>>31)>>>0,Ct(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),s=new DataView(n.buffer),r=x.from(t);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),s=new DataView(n.buffer),r=M.from(t);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(n)}int64(t){let n=x.from(t);return Qe(n.lo,n.hi,this.buf),this}sint64(t){let n=x.from(t),s=n.hi>>31,r=n.lo<<1^s,o=(n.hi<<1|n.lo>>>31)^s;return Qe(r,o,this.buf),this}uint64(t){let n=M.from(t);return Qe(n.lo,n.hi,this.buf),this}}const At={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},Bt={ignoreUnknownFields:!1};function hs(e){return e?Object.assign(Object.assign({},Bt),e):Bt}function gs(e){return e?Object.assign(Object.assign({},At),e):At}const sn=Symbol.for("protobuf-ts/message-type");function Dt(e){let t=!1;const n=[];for(let s=0;s<e.length;s++){let r=e.charAt(s);r=="_"?t=!0:/\d/.test(r)?(n.push(r),t=!0):t?(n.push(r.toUpperCase()),t=!1):s==0?n.push(r.toLowerCase()):n.push(r)}return n.join("")}var g;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(g||(g={}));var $;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})($||($={}));var Be;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(Be||(Be={}));function ks(e){var t,n,s,r;return e.localName=(t=e.localName)!==null&&t!==void 0?t:Dt(e.name),e.jsonName=(n=e.jsonName)!==null&&n!==void 0?n:Dt(e.name),e.repeat=(s=e.repeat)!==null&&s!==void 0?s:Be.NO,e.opt=(r=e.opt)!==null&&r!==void 0?r:e.repeat||e.oneof?!1:e.kind=="message",e}function Ts(e){if(typeof e!="object"||e===null||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case"undefined":return Object.keys(e).length==1;default:return!1}}class ws{constructor(t){var n;this.fields=(n=t.fields)!==null&&n!==void 0?n:[]}prepare(){if(this.data)return;const t=[],n=[],s=[];for(let r of this.fields)if(r.oneof)s.includes(r.oneof)||(s.push(r.oneof),t.push(r.oneof),n.push(r.oneof));else switch(n.push(r.localName),r.kind){case"scalar":case"enum":(!r.opt||r.repeat)&&t.push(r.localName);break;case"message":r.repeat&&t.push(r.localName);break;case"map":t.push(r.localName);break}this.data={req:t,known:n,oneofs:Object.values(s)}}is(t,n,s=!1){if(n<0)return!0;if(t==null||typeof t!="object")return!1;this.prepare();let r=Object.keys(t),o=this.data;if(r.length<o.req.length||o.req.some(l=>!r.includes(l))||!s&&r.some(l=>!o.known.includes(l)))return!1;if(n<1)return!0;for(const l of o.oneofs){const p=t[l];if(!Ts(p))return!1;if(p.oneofKind===void 0)continue;const h=this.fields.find(T=>T.localName===p.oneofKind);if(!h||!this.field(p[p.oneofKind],h,s,n))return!1}for(const l of this.fields)if(l.oneof===void 0&&!this.field(t[l.localName],l,s,n))return!1;return!0}field(t,n,s,r){let o=n.repeat;switch(n.kind){case"scalar":return t===void 0?n.opt:o?this.scalars(t,n.T,r,n.L):this.scalar(t,n.T,n.L);case"enum":return t===void 0?n.opt:o?this.scalars(t,g.INT32,r):this.scalar(t,g.INT32);case"message":return t===void 0?!0:o?this.messages(t,n.T(),s,r):this.message(t,n.T(),s,r);case"map":if(typeof t!="object"||t===null)return!1;if(r<2)return!0;if(!this.mapKeys(t,n.K,r))return!1;switch(n.V.kind){case"scalar":return this.scalars(Object.values(t),n.V.T,r,n.V.L);case"enum":return this.scalars(Object.values(t),g.INT32,r);case"message":return this.messages(Object.values(t),n.V.T(),s,r)}break}return!0}message(t,n,s,r){return s?n.isAssignable(t,r):n.is(t,r)}messages(t,n,s,r){if(!Array.isArray(t))return!1;if(r<2)return!0;if(s){for(let o=0;o<t.length&&o<r;o++)if(!n.isAssignable(t[o],r-1))return!1}else for(let o=0;o<t.length&&o<r;o++)if(!n.is(t[o],r-1))return!1;return!0}scalar(t,n,s){let r=typeof t;switch(n){case g.UINT64:case g.FIXED64:case g.INT64:case g.SFIXED64:case g.SINT64:switch(s){case $.BIGINT:return r=="bigint";case $.NUMBER:return r=="number"&&!isNaN(t);default:return r=="string"}case g.BOOL:return r=="boolean";case g.STRING:return r=="string";case g.BYTES:return t instanceof Uint8Array;case g.DOUBLE:case g.FLOAT:return r=="number"&&!isNaN(t);default:return r=="number"&&Number.isInteger(t)}}scalars(t,n,s,r){if(!Array.isArray(t))return!1;if(s<2)return!0;if(Array.isArray(t)){for(let o=0;o<t.length&&o<s;o++)if(!this.scalar(t[o],n,r))return!1}return!0}mapKeys(t,n,s){let r=Object.keys(t);switch(n){case g.INT32:case g.FIXED32:case g.SFIXED32:case g.SINT32:case g.UINT32:return this.scalars(r.slice(0,s).map(o=>parseInt(o)),n,s);case g.BOOL:return this.scalars(r.slice(0,s).map(o=>o=="true"?!0:o=="false"?!1:o),n,s);default:return this.scalars(r,n,s,$.STRING)}}}function j(e,t){switch(t){case $.BIGINT:return e.toBigInt();case $.NUMBER:return e.toNumber();default:return e.toString()}}class ys{constructor(t){this.info=t}prepare(){var t;if(this.fMap===void 0){this.fMap={};const n=(t=this.info.fields)!==null&&t!==void 0?t:[];for(const s of n)this.fMap[s.name]=s,this.fMap[s.jsonName]=s,this.fMap[s.localName]=s}}assert(t,n,s){if(!t){let r=Tt(s);throw(r=="number"||r=="boolean")&&(r=s.toString()),new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${n}`)}}read(t,n,s){this.prepare();const r=[];for(const[o,l]of Object.entries(t)){const p=this.fMap[o];if(!p){if(!s.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}const h=p.localName;let T;if(p.oneof){if(l===null&&(p.kind!=="enum"||p.T()[0]!=="google.protobuf.NullValue"))continue;if(r.includes(p.oneof))throw new Error(`Multiple members of the oneof group "${p.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(p.oneof),T=n[p.oneof]={oneofKind:h}}else T=n;if(p.kind=="map"){if(l===null)continue;this.assert(es(l),p.name,l);const _=T[h];for(const[I,v]of Object.entries(l)){this.assert(v!==null,p.name+" map value",null);let D;switch(p.V.kind){case"message":D=p.V.T().internalJsonRead(v,s);break;case"enum":if(D=this.enum(p.V.T(),v,p.name,s.ignoreUnknownFields),D===!1)continue;break;case"scalar":D=this.scalar(v,p.V.T,p.V.L,p.name);break}this.assert(D!==void 0,p.name+" map value",v);let U=I;p.K==g.BOOL&&(U=U=="true"?!0:U=="false"?!1:U),U=this.scalar(U,p.K,$.STRING,p.name).toString(),_[U]=D}}else if(p.repeat){if(l===null)continue;this.assert(Array.isArray(l),p.name,l);const _=T[h];for(const I of l){this.assert(I!==null,p.name,null);let v;switch(p.kind){case"message":v=p.T().internalJsonRead(I,s);break;case"enum":if(v=this.enum(p.T(),I,p.name,s.ignoreUnknownFields),v===!1)continue;break;case"scalar":v=this.scalar(I,p.T,p.L,p.name);break}this.assert(v!==void 0,p.name,l),_.push(v)}}else switch(p.kind){case"message":if(l===null&&p.T().typeName!="google.protobuf.Value"){this.assert(p.oneof===void 0,p.name+" (oneof member)",null);continue}T[h]=p.T().internalJsonRead(l,s,T[h]);break;case"enum":if(l===null)continue;let _=this.enum(p.T(),l,p.name,s.ignoreUnknownFields);if(_===!1)continue;T[h]=_;break;case"scalar":if(l===null)continue;T[h]=this.scalar(l,p.T,p.L,p.name);break}}}enum(t,n,s,r){if(t[0]=="google.protobuf.NullValue"&&E(n===null||n==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${s}, enum ${t[0]} only accepts null.`),n===null)return 0;switch(typeof n){case"number":return E(Number.isInteger(n),`Unable to parse field ${this.info.typeName}#${s}, enum can only be integral number, got ${n}.`),n;case"string":let o=n;t[2]&&n.substring(0,t[2].length)===t[2]&&(o=n.substring(t[2].length));let l=t[1][o];return typeof l=="undefined"&&r?!1:(E(typeof l=="number",`Unable to parse field ${this.info.typeName}#${s}, enum ${t[0]} has no value for "${n}".`),l)}E(!1,`Unable to parse field ${this.info.typeName}#${s}, cannot parse enum value from ${typeof n}".`)}scalar(t,n,s,r){let o;try{switch(n){case g.DOUBLE:case g.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""){o="empty string";break}if(typeof t=="string"&&t.trim().length!==t.length){o="extra whitespace";break}if(typeof t!="string"&&typeof t!="number")break;let l=Number(t);if(Number.isNaN(l)){o="not a number";break}if(!Number.isFinite(l)){o="too large or small";break}return n==g.FLOAT&&wt(l),l;case g.INT32:case g.FIXED32:case g.SFIXED32:case g.SINT32:case g.UINT32:if(t===null)return 0;let p;if(typeof t=="number"?p=t:t===""?o="empty string":typeof t=="string"&&(t.trim().length!==t.length?o="extra whitespace":p=Number(t)),p===void 0)break;return n==g.UINT32?Ae(p):Te(p),p;case g.INT64:case g.SFIXED64:case g.SINT64:if(t===null)return j(x.ZERO,s);if(typeof t!="number"&&typeof t!="string")break;return j(x.from(t),s);case g.FIXED64:case g.UINT64:if(t===null)return j(M.ZERO,s);if(typeof t!="number"&&typeof t!="string")break;return j(M.from(t),s);case g.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case g.STRING:if(t===null)return"";if(typeof t!="string"){o="extra whitespace";break}try{encodeURIComponent(t)}catch(h){h="invalid UTF8";break}return t;case g.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return ts(t)}}catch(l){o=l.message}this.assert(!1,r+(o?" - "+o:""),t)}}class bs{constructor(t){var n;this.fields=(n=t.fields)!==null&&n!==void 0?n:[]}write(t,n){const s={},r=t;for(const o of this.fields){if(!o.oneof){let T=this.field(o,r[o.localName],n);T!==void 0&&(s[n.useProtoFieldName?o.name:o.jsonName]=T);continue}const l=r[o.oneof];if(l.oneofKind!==o.localName)continue;const p=o.kind=="scalar"||o.kind=="enum"?Object.assign(Object.assign({},n),{emitDefaultValues:!0}):n;let h=this.field(o,l[o.localName],p);E(h!==void 0),s[n.useProtoFieldName?o.name:o.jsonName]=h}return s}field(t,n,s){let r;if(t.kind=="map"){E(typeof n=="object"&&n!==null);const o={};switch(t.V.kind){case"scalar":for(const[h,T]of Object.entries(n)){const _=this.scalar(t.V.T,T,t.name,!1,!0);E(_!==void 0),o[h.toString()]=_}break;case"message":const l=t.V.T();for(const[h,T]of Object.entries(n)){const _=this.message(l,T,t.name,s);E(_!==void 0),o[h.toString()]=_}break;case"enum":const p=t.V.T();for(const[h,T]of Object.entries(n)){E(T===void 0||typeof T=="number");const _=this.enum(p,T,t.name,!1,!0,s.enumAsInteger);E(_!==void 0),o[h.toString()]=_}break}(s.emitDefaultValues||Object.keys(o).length>0)&&(r=o)}else if(t.repeat){E(Array.isArray(n));const o=[];switch(t.kind){case"scalar":for(let h=0;h<n.length;h++){const T=this.scalar(t.T,n[h],t.name,t.opt,!0);E(T!==void 0),o.push(T)}break;case"enum":const l=t.T();for(let h=0;h<n.length;h++){E(n[h]===void 0||typeof n[h]=="number");const T=this.enum(l,n[h],t.name,t.opt,!0,s.enumAsInteger);E(T!==void 0),o.push(T)}break;case"message":const p=t.T();for(let h=0;h<n.length;h++){const T=this.message(p,n[h],t.name,s);E(T!==void 0),o.push(T)}break}(s.emitDefaultValues||o.length>0||s.emitDefaultValues)&&(r=o)}else switch(t.kind){case"scalar":r=this.scalar(t.T,n,t.name,t.opt,s.emitDefaultValues);break;case"enum":r=this.enum(t.T(),n,t.name,t.opt,s.emitDefaultValues,s.enumAsInteger);break;case"message":r=this.message(t.T(),n,t.name,s);break}return r}enum(t,n,s,r,o,l){if(t[0]=="google.protobuf.NullValue")return!o&&!r?void 0:null;if(n===void 0){E(r);return}if(!(n===0&&!o&&!r))return E(typeof n=="number"),E(Number.isInteger(n)),l||!t[1].hasOwnProperty(n)?n:t[2]?t[2]+t[1][n]:t[1][n]}message(t,n,s,r){return n===void 0?r.emitDefaultValues?null:void 0:t.internalJsonWrite(n,r)}scalar(t,n,s,r,o){if(n===void 0){E(r);return}const l=o||r;switch(t){case g.INT32:case g.SFIXED32:case g.SINT32:return n===0?l?0:void 0:(Te(n),n);case g.FIXED32:case g.UINT32:return n===0?l?0:void 0:(Ae(n),n);case g.FLOAT:wt(n);case g.DOUBLE:return n===0?l?0:void 0:(E(typeof n=="number"),Number.isNaN(n)?"NaN":n===Number.POSITIVE_INFINITY?"Infinity":n===Number.NEGATIVE_INFINITY?"-Infinity":n);case g.STRING:return n===""?l?"":void 0:(E(typeof n=="string"),n);case g.BOOL:return n===!1?l?!1:void 0:(E(typeof n=="boolean"),n);case g.UINT64:case g.FIXED64:E(typeof n=="number"||typeof n=="string"||typeof n=="bigint");let p=M.from(n);return p.isZero()&&!l?void 0:p.toString();case g.INT64:case g.SFIXED64:case g.SINT64:E(typeof n=="number"||typeof n=="string"||typeof n=="bigint");let h=x.from(n);return h.isZero()&&!l?void 0:h.toString();case g.BYTES:return E(n instanceof Uint8Array),n.byteLength?ns(n):l?"":void 0}}}function ot(e,t=$.STRING){switch(e){case g.BOOL:return!1;case g.UINT64:case g.FIXED64:return j(M.ZERO,t);case g.INT64:case g.SFIXED64:case g.SINT64:return j(x.ZERO,t);case g.DOUBLE:case g.FLOAT:return 0;case g.BYTES:return new Uint8Array(0);case g.STRING:return"";default:return 0}}class _s{constructor(t){this.info=t}prepare(){var t;if(!this.fieldNoToField){const n=(t=this.info.fields)!==null&&t!==void 0?t:[];this.fieldNoToField=new Map(n.map(s=>[s.no,s]))}}read(t,n,s,r){this.prepare();const o=r===void 0?t.len:t.pos+r;for(;t.pos<o;){const[l,p]=t.tag(),h=this.fieldNoToField.get(l);if(!h){let v=s.readUnknownField;if(v=="throw")throw new Error(`Unknown field ${l} (wire type ${p}) for ${this.info.typeName}`);let D=t.skip(p);v!==!1&&(v===!0?Pe.onRead:v)(this.info.typeName,n,l,p,D);continue}let T=n,_=h.repeat,I=h.localName;switch(h.oneof&&(T=T[h.oneof],T.oneofKind!==I&&(T=n[h.oneof]={oneofKind:I})),h.kind){case"scalar":case"enum":let v=h.kind=="enum"?g.INT32:h.T,D=h.kind=="scalar"?h.L:void 0;if(_){let se=T[I];if(p==P.LengthDelimited&&v!=g.STRING&&v!=g.BYTES){let pe=t.uint32()+t.pos;for(;t.pos<pe;)se.push(this.scalar(t,v,D))}else se.push(this.scalar(t,v,D))}else T[I]=this.scalar(t,v,D);break;case"message":if(_){let se=T[I],pe=h.T().internalBinaryRead(t,t.uint32(),s);se.push(pe)}else T[I]=h.T().internalBinaryRead(t,t.uint32(),s,T[I]);break;case"map":let[U,We]=this.mapEntry(h,t,s);T[I][U]=We;break}}}mapEntry(t,n,s){let r=n.uint32(),o=n.pos+r,l,p;for(;n.pos<o;){let[h,T]=n.tag();switch(h){case 1:t.K==g.BOOL?l=n.bool().toString():l=this.scalar(n,t.K,$.STRING);break;case 2:switch(t.V.kind){case"scalar":p=this.scalar(n,t.V.T,t.V.L);break;case"enum":p=n.int32();break;case"message":p=t.V.T().internalBinaryRead(n,n.uint32(),s);break}break;default:throw new Error(`Unknown field ${h} (wire type ${T}) in map entry for ${this.info.typeName}#${t.name}`)}}if(l===void 0){let h=ot(t.K);l=t.K==g.BOOL?h.toString():h}if(p===void 0)switch(t.V.kind){case"scalar":p=ot(t.V.T,t.V.L);break;case"enum":p=0;break;case"message":p=t.V.T().create();break}return[l,p]}scalar(t,n,s){switch(n){case g.INT32:return t.int32();case g.STRING:return t.string();case g.BOOL:return t.bool();case g.DOUBLE:return t.double();case g.FLOAT:return t.float();case g.INT64:return j(t.int64(),s);case g.UINT64:return j(t.uint64(),s);case g.FIXED64:return j(t.fixed64(),s);case g.FIXED32:return t.fixed32();case g.BYTES:return t.bytes();case g.UINT32:return t.uint32();case g.SFIXED32:return t.sfixed32();case g.SFIXED64:return j(t.sfixed64(),s);case g.SINT32:return t.sint32();case g.SINT64:return j(t.sint64(),s)}}}class vs{constructor(t){this.info=t}prepare(){if(!this.fields){const t=this.info.fields?this.info.fields.concat():[];this.fields=t.sort((n,s)=>n.no-s.no)}}write(t,n,s){this.prepare();for(const o of this.fields){let l,p,h=o.repeat,T=o.localName;if(o.oneof){const _=t[o.oneof];if(_.oneofKind!==T)continue;l=_[T],p=!0}else l=t[T],p=!1;switch(o.kind){case"scalar":case"enum":let _=o.kind=="enum"?g.INT32:o.T;if(h)if(E(Array.isArray(l)),h==Be.PACKED)this.packed(n,_,o.no,l);else for(const I of l)this.scalar(n,_,o.no,I,!0);else l===void 0?E(o.opt):this.scalar(n,_,o.no,l,p||o.opt);break;case"message":if(h){E(Array.isArray(l));for(const I of l)this.message(n,s,o.T(),o.no,I)}else this.message(n,s,o.T(),o.no,l);break;case"map":E(typeof l=="object"&&l!==null);for(const[I,v]of Object.entries(l))this.mapEntry(n,s,o,I,v);break}}let r=s.writeUnknownFields;r!==!1&&(r===!0?Pe.onWrite:r)(this.info.typeName,t,n)}mapEntry(t,n,s,r,o){t.tag(s.no,P.LengthDelimited),t.fork();let l=r;switch(s.K){case g.INT32:case g.FIXED32:case g.UINT32:case g.SFIXED32:case g.SINT32:l=Number.parseInt(r);break;case g.BOOL:E(r=="true"||r=="false"),l=r=="true";break}switch(this.scalar(t,s.K,1,l,!0),s.V.kind){case"scalar":this.scalar(t,s.V.T,2,o,!0);break;case"enum":this.scalar(t,g.INT32,2,o,!0);break;case"message":this.message(t,n,s.V.T(),2,o);break}t.join()}message(t,n,s,r,o){o!==void 0&&(s.internalBinaryWrite(o,t.tag(r,P.LengthDelimited).fork(),n),t.join())}scalar(t,n,s,r,o){let[l,p,h]=this.scalarInfo(n,r);(!h||o)&&(t.tag(s,l),t[p](r))}packed(t,n,s,r){if(!r.length)return;E(n!==g.BYTES&&n!==g.STRING),t.tag(s,P.LengthDelimited),t.fork();let[,o]=this.scalarInfo(n);for(let l=0;l<r.length;l++)t[o](r[l]);t.join()}scalarInfo(t,n){let s=P.Varint,r,o=n===void 0,l=n===0;switch(t){case g.INT32:r="int32";break;case g.STRING:l=o||!n.length,s=P.LengthDelimited,r="string";break;case g.BOOL:l=n===!1,r="bool";break;case g.UINT32:r="uint32";break;case g.DOUBLE:s=P.Bit64,r="double";break;case g.FLOAT:s=P.Bit32,r="float";break;case g.INT64:l=o||x.from(n).isZero(),r="int64";break;case g.UINT64:l=o||M.from(n).isZero(),r="uint64";break;case g.FIXED64:l=o||M.from(n).isZero(),s=P.Bit64,r="fixed64";break;case g.BYTES:l=o||!n.byteLength,s=P.LengthDelimited,r="bytes";break;case g.FIXED32:s=P.Bit32,r="fixed32";break;case g.SFIXED32:s=P.Bit32,r="sfixed32";break;case g.SFIXED64:l=o||x.from(n).isZero(),s=P.Bit64,r="sfixed64";break;case g.SINT32:r="sint32";break;case g.SINT64:l=o||x.from(n).isZero(),r="sint64";break}return[s,r,o||l]}}function Es(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},sn,{value:e});for(let n of e.fields){let s=n.localName;if(!n.opt)if(n.oneof)t[n.oneof]={oneofKind:void 0};else if(n.repeat)t[s]=[];else switch(n.kind){case"scalar":t[s]=ot(n.T,n.L);break;case"enum":t[s]=0;break;case"map":t[s]={};break}}return t}function et(e,t,n){let s,r=n,o;for(let l of e.fields){let p=l.localName;if(l.oneof){const h=r[l.oneof];if((h==null?void 0:h.oneofKind)==null)continue;if(s=h[p],o=t[l.oneof],o.oneofKind=h.oneofKind,s==null){delete o[p];continue}}else if(s=r[p],o=t,s==null)continue;switch(l.repeat&&(o[p].length=s.length),l.kind){case"scalar":case"enum":if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=s[T];else o[p]=s;break;case"message":let h=l.T();if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=h.create(s[T]);else o[p]===void 0?o[p]=h.create(s):h.mergePartial(o[p],s);break;case"map":switch(l.V.kind){case"scalar":case"enum":Object.assign(o[p],s);break;case"message":let T=l.V.T();for(let _ of Object.keys(s))o[p][_]=T.create(s[_]);break}break}}}function Rs(e,t,n){if(t===n)return!0;if(!t||!n)return!1;for(let s of e.fields){let r=s.localName,o=s.oneof?t[s.oneof][r]:t[r],l=s.oneof?n[s.oneof][r]:n[r];switch(s.kind){case"enum":case"scalar":let p=s.kind=="enum"?g.INT32:s.T;if(!(s.repeat?Mt(p,o,l):rn(p,o,l)))return!1;break;case"map":if(!(s.V.kind=="message"?Ft(s.V.T(),Re(o),Re(l)):Mt(s.V.kind=="enum"?g.INT32:s.V.T,Re(o),Re(l))))return!1;break;case"message":let h=s.T();if(!(s.repeat?Ft(h,o,l):h.equals(o,l)))return!1;break}}return!0}const Re=Object.values;function rn(e,t,n){if(t===n)return!0;if(e!==g.BYTES)return!1;let s=t,r=n;if(s.length!==r.length)return!1;for(let o=0;o<s.length;o++)if(s[o]!=r[o])return!1;return!0}function Mt(e,t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!rn(e,t[s],n[s]))return!1;return!0}function Ft(e,t,n){if(t.length!==n.length)return!1;for(let s=0;s<t.length;s++)if(!e.equals(t[s],n[s]))return!1;return!0}const Os=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));class u{constructor(t,n,s){this.defaultCheckDepth=16,this.typeName=t,this.fields=n.map(ks),this.options=s!=null?s:{},this.messagePrototype=Object.create(null,Object.assign(Object.assign({},Os),{[sn]:{value:this}})),this.refTypeCheck=new ws(this),this.refJsonReader=new ys(this),this.refJsonWriter=new bs(this),this.refBinReader=new _s(this),this.refBinWriter=new vs(this)}create(t){let n=Es(this);return t!==void 0&&et(this,n,t),n}clone(t){let n=this.create();return et(this,n,t),n}equals(t,n){return Rs(this,t,n)}is(t,n=this.defaultCheckDepth){return this.refTypeCheck.is(t,n,!1)}isAssignable(t,n=this.defaultCheckDepth){return this.refTypeCheck.is(t,n,!0)}mergePartial(t,n){et(this,t,n)}fromBinary(t,n){let s=as(n);return this.internalBinaryRead(s.readerFactory(t),t.byteLength,s)}fromJson(t,n){return this.internalJsonRead(t,hs(n))}fromJsonString(t,n){let s=JSON.parse(t);return this.fromJson(s,n)}toJson(t,n){return this.internalJsonWrite(t,gs(n))}toJsonString(t,n){var s;let r=this.toJson(t,n);return JSON.stringify(r,null,(s=n==null?void 0:n.prettySpaces)!==null&&s!==void 0?s:0)}toBinary(t,n){let s=ms(n);return this.internalBinaryWrite(t,s.writerFactory(),s).finish()}internalJsonRead(t,n,s){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let r=s!=null?s:this.create();return this.refJsonReader.read(t,r,n),r}throw new Error(`Unable to parse message ${this.typeName} from JSON ${Tt(t)}.`)}internalJsonWrite(t,n){return this.refJsonWriter.write(t,n)}internalBinaryWrite(t,n,s){return this.refBinWriter.write(t,n,s),n}internalBinaryRead(t,n,s,r){let o=r!=null?r:this.create();return this.refBinReader.read(t,o,s,n),o}}var Ss=Object.defineProperty,Ns=Object.defineProperties,xs=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,Is=Object.prototype.hasOwnProperty,Cs=Object.prototype.propertyIsEnumerable,at=(e,t,n)=>t in e?Ss(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qt=(e,t)=>{for(var n in t||(t={}))Is.call(t,n)&&at(e,n,t[n]);if(Ut)for(var n of Ut(t))Cs.call(t,n)&&at(e,n,t[n]);return e},Ps=(e,t)=>Ns(e,xs(t)),R=(e,t,n)=>(at(e,typeof t!="symbol"?t+"":t,n),n),on=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},ie=(e,t,n)=>(on(e,t,"read from private field"),n?n.call(e):t.get(e)),Oe=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Vt=(e,t,n,s)=>(on(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n),Ls=(e,t,n)=>new Promise((s,r)=>{var o=h=>{try{p(n.next(h))}catch(T){r(T)}},l=h=>{try{p(n.throw(h))}catch(T){r(T)}},p=h=>h.done?s(h.value):Promise.resolve(h.value).then(o,l);p((n=n.apply(e,t)).next())}),he=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},De={},As={get exports(){return De},set exports(e){De=e}},ce=typeof Reflect=="object"?Reflect:null,Gt=ce&&typeof ce.apply=="function"?ce.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},xe;ce&&typeof ce.ownKeys=="function"?xe=ce.ownKeys:Object.getOwnPropertySymbols?xe=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:xe=function(e){return Object.getOwnPropertyNames(e)};function Bs(e){console&&console.warn&&console.warn(e)}var an=Number.isNaN||function(e){return e!==e};function O(){O.init.call(this)}As.exports=O;De.once=Us;O.EventEmitter=O;O.prototype._events=void 0;O.prototype._eventsCount=0;O.prototype._maxListeners=void 0;var jt=10;function Ve(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:function(){return jt},set:function(e){if(typeof e!="number"||e<0||an(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");jt=e}});O.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};O.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||an(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function cn(e){return e._maxListeners===void 0?O.defaultMaxListeners:e._maxListeners}O.prototype.getMaxListeners=function(){return cn(this)};O.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")Gt(p,this,t);else for(var h=p.length,T=mn(p,h),n=0;n<h;++n)Gt(T[n],this,t);return!0};function un(e,t,n,s){var r,o,l;if(Ve(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l=="function"?l=o[t]=s?[n,l]:[l,n]:s?l.unshift(n):l.push(n),r=cn(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=l.length,Bs(p)}return e}O.prototype.addListener=function(e,t){return un(this,e,t,!1)};O.prototype.on=O.prototype.addListener;O.prototype.prependListener=function(e,t){return un(this,e,t,!0)};function Ds(){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 ln(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=Ds.bind(s);return r.listener=n,s.wrapFn=r,r}O.prototype.once=function(e,t){return Ve(t),this.on(e,ln(this,e,t)),this};O.prototype.prependOnceListener=function(e,t){return Ve(t),this.prependListener(e,ln(this,e,t)),this};O.prototype.removeListener=function(e,t){var n,s,r,o,l;if(Ve(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,r=o;break}if(r<0)return this;r===0?n.shift():Ms(n,r),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var r=Object.keys(n),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function dn(e,t,n){var s=e._events;if(s===void 0)return[];var r=s[t];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?Fs(r):mn(r,r.length)}O.prototype.listeners=function(e){return dn(this,e,!0)};O.prototype.rawListeners=function(e){return dn(this,e,!1)};O.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):pn.call(e,t)};O.prototype.listenerCount=pn;function pn(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}O.prototype.eventNames=function(){return this._eventsCount>0?xe(this._events):[]};function mn(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function Ms(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Fs(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function Us(e,t){return new Promise(function(n,s){function r(l){e.removeListener(t,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),n([].slice.call(arguments))}fn(e,t,o,{once:!0}),t!=="error"&&qs(e,r,{once:!0})})}function qs(e,t,n){typeof e.on=="function"&&fn(e,"error",t,n)}function fn(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function r(o){s.once&&e.removeEventListener(t,r),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}const Vs=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function wn(e){let n=typeof e;if(n=="object"){if(Array.isArray(e))return"array";if(e===null)return"null"}return n}function ns(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}let z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),qe=[];for(let e=0;e<z.length;e++)qe[z[e].charCodeAt(0)]=e;qe["-".charCodeAt(0)]=z.indexOf("+");qe["_".charCodeAt(0)]=z.indexOf("/");function ts(e){let n=e.length*3/4;e[e.length-2]=="="?n-=2:e[e.length-1]=="="&&(n-=1);let t=new Uint8Array(n),s=0,r=0,o,l=0;for(let p=0;p<e.length;p++){if(o=qe[e.charCodeAt(p)],o===void 0)switch(e[p]){case"=":r=0;case`
2
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(r){case 0:l=o,r=1;break;case 1:t[s++]=l<<2|(o&48)>>4,l=o,r=2;break;case 2:t[s++]=(l&15)<<4|(o&60)>>2,l=o,r=3;break;case 3:t[s++]=(l&3)<<6|o,r=0;break}}if(r==1)throw Error("invalid base64 string.");return t.subarray(0,s)}function ss(e){let n="",t=0,s,r=0;for(let o=0;o<e.length;o++)switch(s=e[o],t){case 0:n+=z[s>>2],r=(s&3)<<4,t=1;break;case 1:n+=z[r|s>>4],r=(s&15)<<2,t=2;break;case 2:n+=z[r|s>>6],n+=z[s&63],t=0;break}return t&&(n+=z[r],n+="=",t==1&&(n+="=")),n}var Pe;(function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(t,s,r,o,l)=>{(n(s)?s[e.symbol]:s[e.symbol]=[]).push({no:r,wireType:o,data:l})},e.onWrite=(t,s,r)=>{for(let{no:o,wireType:l,data:p}of e.list(s))r.tag(o,l).raw(p)},e.list=(t,s)=>{if(n(t)){let r=t[e.symbol];return s?r.filter(o=>o.no==s):r}return[]},e.last=(t,s)=>e.list(t,s).slice(-1)[0];const n=t=>t&&Array.isArray(t[e.symbol])})(Pe||(Pe={}));var P;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(P||(P={}));function rs(){let e=0,n=0;for(let s=0;s<28;s+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,n]}let t=this.buf[this.pos++];if(e|=(t&15)<<28,n=(t&112)>>4,(t&128)==0)return this.assertBounds(),[e,n];for(let s=3;s<=31;s+=7){let r=this.buf[this.pos++];if(n|=(r&127)<<s,(r&128)==0)return this.assertBounds(),[e,n]}throw new Error("invalid varint")}function Qe(e,n,t){for(let o=0;o<28;o=o+7){const l=e>>>o,p=!(l>>>7==0&&n==0),h=(p?l|128:l)&255;if(t.push(h),!p)return}const s=e>>>28&15|(n&7)<<4,r=n>>3!=0;if(t.push((r?s|128:s)&255),!!r){for(let o=3;o<31;o=o+7){const l=n>>>o,p=l>>>7!=0,h=(p?l|128:l)&255;if(t.push(h),!p)return}t.push(n>>>31&1)}}const Ne=(1<<16)*(1<<16);function et(e){let n=e[0]=="-";n&&(e=e.slice(1));const t=1e6;let s=0,r=0;function o(l,p){const h=Number(e.slice(l,p));r*=t,s=s*t+h,s>=Ne&&(r=r+(s/Ne|0),s=s%Ne)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),[n,s,r]}function rn(e,n){if(n>>>0<=2097151)return""+(Ne*n+(e>>>0));let t=e&16777215,s=(e>>>24|n<<8)>>>0&16777215,r=n>>16&65535,o=t+s*6777216+r*6710656,l=s+r*8147497,p=r*2,h=1e7;o>=h&&(l+=Math.floor(o/h),o%=h),l>=h&&(p+=Math.floor(l/h),l%=h);function T(b,I){let v=b?String(b):"";return I?"0000000".slice(v.length)+v:v}return T(p,0)+T(l,p)+T(o,1)}function Pn(e,n){if(e>=0){for(;e>127;)n.push(e&127|128),e=e>>>7;n.push(e)}else{for(let t=0;t<9;t++)n.push(e&127|128),e=e>>7;n.push(1)}}function os(){let e=this.buf[this.pos++],n=e&127;if((e&128)==0)return this.assertBounds(),n;if(e=this.buf[this.pos++],n|=(e&127)<<7,(e&128)==0)return this.assertBounds(),n;if(e=this.buf[this.pos++],n|=(e&127)<<14,(e&128)==0)return this.assertBounds(),n;if(e=this.buf[this.pos++],n|=(e&127)<<21,(e&128)==0)return this.assertBounds(),n;e=this.buf[this.pos++],n|=(e&15)<<28;for(let t=5;(e&128)!==0&&t<10;t++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),n>>>0}let N;function as(){const e=new DataView(new ArrayBuffer(8));N=globalThis.BigInt!==void 0&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}as();function nt(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const tt=/^-?[0-9]+$/,Le=4294967296,Ee=2147483648;class st{constructor(n,t){this.lo=n|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let n=this.hi*Le+(this.lo>>>0);if(!Number.isSafeInteger(n))throw new Error("cannot convert to safe number");return n}}class M extends st{static from(n){if(N)switch(typeof n){case"string":if(n=="0")return this.ZERO;if(n=="")throw new Error("string is no integer");n=N.C(n);case"number":if(n===0)return this.ZERO;n=N.C(n);case"bigint":if(!n)return this.ZERO;if(n<N.UMIN)throw new Error("signed value for ulong");if(n>N.UMAX)throw new Error("ulong too large");return N.V.setBigUint64(0,n,!0),new M(N.V.getInt32(0,!0),N.V.getInt32(4,!0))}else switch(typeof n){case"string":if(n=="0")return this.ZERO;if(n=n.trim(),!tt.test(n))throw new Error("string is no integer");let[t,s,r]=et(n);if(t)throw new Error("signed value for ulong");return new M(s,r);case"number":if(n==0)return this.ZERO;if(!Number.isSafeInteger(n))throw new Error("number is no integer");if(n<0)throw new Error("signed value for ulong");return new M(n,n/Le)}throw new Error("unknown value "+typeof n)}toString(){return N?this.toBigInt().toString():rn(this.lo,this.hi)}toBigInt(){return nt(N),N.V.setInt32(0,this.lo,!0),N.V.setInt32(4,this.hi,!0),N.V.getBigUint64(0,!0)}}M.ZERO=new M(0,0);class x extends st{static from(n){if(N)switch(typeof n){case"string":if(n=="0")return this.ZERO;if(n=="")throw new Error("string is no integer");n=N.C(n);case"number":if(n===0)return this.ZERO;n=N.C(n);case"bigint":if(!n)return this.ZERO;if(n<N.MIN)throw new Error("signed long too small");if(n>N.MAX)throw new Error("signed long too large");return N.V.setBigInt64(0,n,!0),new x(N.V.getInt32(0,!0),N.V.getInt32(4,!0))}else switch(typeof n){case"string":if(n=="0")return this.ZERO;if(n=n.trim(),!tt.test(n))throw new Error("string is no integer");let[t,s,r]=et(n);if(t){if(r>Ee||r==Ee&&s!=0)throw new Error("signed long too small")}else if(r>=Ee)throw new Error("signed long too large");let o=new x(s,r);return t?o.negate():o;case"number":if(n==0)return this.ZERO;if(!Number.isSafeInteger(n))throw new Error("number is no integer");return n>0?new x(n,n/Le):new x(-n,-n/Le).negate()}throw new Error("unknown value "+typeof n)}isNegative(){return(this.hi&Ee)!==0}negate(){let n=~this.hi,t=this.lo;return t?t=~t+1:n+=1,new x(t,n)}toString(){if(N)return this.toBigInt().toString();if(this.isNegative()){let n=this.negate();return"-"+rn(n.lo,n.hi)}return rn(this.lo,this.hi)}toBigInt(){return nt(N),N.V.setInt32(0,this.lo,!0),N.V.setInt32(4,this.hi,!0),N.V.getBigInt64(0,!0)}}x.ZERO=new x(0,0);const Ln={readUnknownField:!0,readerFactory:e=>new cs(e)};function is(e){return e?Object.assign(Object.assign({},Ln),e):Ln}class cs{constructor(n,t){this.varint64=rs,this.uint32=os,this.buf=n,this.len=n.length,this.pos=0,this.view=new DataView(n.buffer,n.byteOffset,n.byteLength),this.textDecoder=t!=null?t:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let n=this.uint32(),t=n>>>3,s=n&7;if(t<=0||s<0||s>5)throw new Error("illegal tag: field no "+t+" wire type "+s);return[t,s]}skip(n){let t=this.pos;switch(n){case P.Varint:for(;this.buf[this.pos++]&128;);break;case P.Bit64:this.pos+=4;case P.Bit32:this.pos+=4;break;case P.LengthDelimited:let s=this.uint32();this.pos+=s;break;case P.StartGroup:let r;for(;(r=this.tag()[1])!==P.EndGroup;)this.skip(r);break;default:throw new Error("cant skip wire type "+n)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let n=this.uint32();return n>>>1^-(n&1)}int64(){return new x(...this.varint64())}uint64(){return new M(...this.varint64())}sint64(){let[n,t]=this.varint64(),s=-(n&1);return n=(n>>>1|(t&1)<<31)^s,t=t>>>1^s,new x(n,t)}bool(){let[n,t]=this.varint64();return n!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new M(this.sfixed32(),this.sfixed32())}sfixed64(){return new x(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let n=this.uint32(),t=this.pos;return this.pos+=n,this.assertBounds(),this.buf.subarray(t,t+n)}string(){return this.textDecoder.decode(this.bytes())}}function E(e,n){if(!e)throw new Error(n)}const us=34028234663852886e22,ls=-34028234663852886e22,ds=4294967295,ps=2147483647,ms=-2147483648;function Te(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>ps||e<ms)throw new Error("invalid int 32: "+e)}function Ae(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>ds||e<0)throw new Error("invalid uint 32: "+e)}function yn(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(!!Number.isFinite(e)&&(e>us||e<ls))throw new Error("invalid float 32: "+e)}const An={writeUnknownFields:!0,writerFactory:()=>new hs};function fs(e){return e?Object.assign(Object.assign({},An),e):An}class hs{constructor(n){this.stack=[],this.textEncoder=n!=null?n:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let n=0;for(let r=0;r<this.chunks.length;r++)n+=this.chunks[r].length;let t=new Uint8Array(n),s=0;for(let r=0;r<this.chunks.length;r++)t.set(this.chunks[r],s),s+=this.chunks[r].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let n=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(n.byteLength),this.raw(n)}tag(n,t){return this.uint32((n<<3|t)>>>0)}raw(n){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(n),this}uint32(n){for(Ae(n);n>127;)this.buf.push(n&127|128),n=n>>>7;return this.buf.push(n),this}int32(n){return Te(n),Pn(n,this.buf),this}bool(n){return this.buf.push(n?1:0),this}bytes(n){return this.uint32(n.byteLength),this.raw(n)}string(n){let t=this.textEncoder.encode(n);return this.uint32(t.byteLength),this.raw(t)}float(n){yn(n);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,n,!0),this.raw(t)}double(n){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,n,!0),this.raw(t)}fixed32(n){Ae(n);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,n,!0),this.raw(t)}sfixed32(n){Te(n);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,n,!0),this.raw(t)}sint32(n){return Te(n),n=(n<<1^n>>31)>>>0,Pn(n,this.buf),this}sfixed64(n){let t=new Uint8Array(8),s=new DataView(t.buffer),r=x.from(n);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(t)}fixed64(n){let t=new Uint8Array(8),s=new DataView(t.buffer),r=M.from(n);return s.setInt32(0,r.lo,!0),s.setInt32(4,r.hi,!0),this.raw(t)}int64(n){let t=x.from(n);return Qe(t.lo,t.hi,this.buf),this}sint64(n){let t=x.from(n),s=t.hi>>31,r=t.lo<<1^s,o=(t.hi<<1|t.lo>>>31)^s;return Qe(r,o,this.buf),this}uint64(n){let t=M.from(n);return Qe(t.lo,t.hi,this.buf),this}}const Bn={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},Dn={ignoreUnknownFields:!1};function gs(e){return e?Object.assign(Object.assign({},Dn),e):Dn}function ks(e){return e?Object.assign(Object.assign({},Bn),e):Bn}const rt=Symbol.for("protobuf-ts/message-type");function Mn(e){let n=!1;const t=[];for(let s=0;s<e.length;s++){let r=e.charAt(s);r=="_"?n=!0:/\d/.test(r)?(t.push(r),n=!0):n?(t.push(r.toUpperCase()),n=!1):s==0?t.push(r.toLowerCase()):t.push(r)}return t.join("")}var g;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(g||(g={}));var $;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})($||($={}));var Be;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(Be||(Be={}));function Ts(e){var n,t,s,r;return e.localName=(n=e.localName)!==null&&n!==void 0?n:Mn(e.name),e.jsonName=(t=e.jsonName)!==null&&t!==void 0?t:Mn(e.name),e.repeat=(s=e.repeat)!==null&&s!==void 0?s:Be.NO,e.opt=(r=e.opt)!==null&&r!==void 0?r:e.repeat||e.oneof?!1:e.kind=="message",e}function ws(e){if(typeof e!="object"||e===null||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case"undefined":return Object.keys(e).length==1;default:return!1}}class ys{constructor(n){var t;this.fields=(t=n.fields)!==null&&t!==void 0?t:[]}prepare(){if(this.data)return;const n=[],t=[],s=[];for(let r of this.fields)if(r.oneof)s.includes(r.oneof)||(s.push(r.oneof),n.push(r.oneof),t.push(r.oneof));else switch(t.push(r.localName),r.kind){case"scalar":case"enum":(!r.opt||r.repeat)&&n.push(r.localName);break;case"message":r.repeat&&n.push(r.localName);break;case"map":n.push(r.localName);break}this.data={req:n,known:t,oneofs:Object.values(s)}}is(n,t,s=!1){if(t<0)return!0;if(n==null||typeof n!="object")return!1;this.prepare();let r=Object.keys(n),o=this.data;if(r.length<o.req.length||o.req.some(l=>!r.includes(l))||!s&&r.some(l=>!o.known.includes(l)))return!1;if(t<1)return!0;for(const l of o.oneofs){const p=n[l];if(!ws(p))return!1;if(p.oneofKind===void 0)continue;const h=this.fields.find(T=>T.localName===p.oneofKind);if(!h||!this.field(p[p.oneofKind],h,s,t))return!1}for(const l of this.fields)if(l.oneof===void 0&&!this.field(n[l.localName],l,s,t))return!1;return!0}field(n,t,s,r){let o=t.repeat;switch(t.kind){case"scalar":return n===void 0?t.opt:o?this.scalars(n,t.T,r,t.L):this.scalar(n,t.T,t.L);case"enum":return n===void 0?t.opt:o?this.scalars(n,g.INT32,r):this.scalar(n,g.INT32);case"message":return n===void 0?!0:o?this.messages(n,t.T(),s,r):this.message(n,t.T(),s,r);case"map":if(typeof n!="object"||n===null)return!1;if(r<2)return!0;if(!this.mapKeys(n,t.K,r))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(n),t.V.T,r,t.V.L);case"enum":return this.scalars(Object.values(n),g.INT32,r);case"message":return this.messages(Object.values(n),t.V.T(),s,r)}break}return!0}message(n,t,s,r){return s?t.isAssignable(n,r):t.is(n,r)}messages(n,t,s,r){if(!Array.isArray(n))return!1;if(r<2)return!0;if(s){for(let o=0;o<n.length&&o<r;o++)if(!t.isAssignable(n[o],r-1))return!1}else for(let o=0;o<n.length&&o<r;o++)if(!t.is(n[o],r-1))return!1;return!0}scalar(n,t,s){let r=typeof n;switch(t){case g.UINT64:case g.FIXED64:case g.INT64:case g.SFIXED64:case g.SINT64:switch(s){case $.BIGINT:return r=="bigint";case $.NUMBER:return r=="number"&&!isNaN(n);default:return r=="string"}case g.BOOL:return r=="boolean";case g.STRING:return r=="string";case g.BYTES:return n instanceof Uint8Array;case g.DOUBLE:case g.FLOAT:return r=="number"&&!isNaN(n);default:return r=="number"&&Number.isInteger(n)}}scalars(n,t,s,r){if(!Array.isArray(n))return!1;if(s<2)return!0;if(Array.isArray(n)){for(let o=0;o<n.length&&o<s;o++)if(!this.scalar(n[o],t,r))return!1}return!0}mapKeys(n,t,s){let r=Object.keys(n);switch(t){case g.INT32:case g.FIXED32:case g.SFIXED32:case g.SINT32:case g.UINT32:return this.scalars(r.slice(0,s).map(o=>parseInt(o)),t,s);case g.BOOL:return this.scalars(r.slice(0,s).map(o=>o=="true"?!0:o=="false"?!1:o),t,s);default:return this.scalars(r,t,s,$.STRING)}}}function j(e,n){switch(n){case $.BIGINT:return e.toBigInt();case $.NUMBER:return e.toNumber();default:return e.toString()}}class _s{constructor(n){this.info=n}prepare(){var n;if(this.fMap===void 0){this.fMap={};const t=(n=this.info.fields)!==null&&n!==void 0?n:[];for(const s of t)this.fMap[s.name]=s,this.fMap[s.jsonName]=s,this.fMap[s.localName]=s}}assert(n,t,s){if(!n){let r=wn(s);throw(r=="number"||r=="boolean")&&(r=s.toString()),new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${t}`)}}read(n,t,s){this.prepare();const r=[];for(const[o,l]of Object.entries(n)){const p=this.fMap[o];if(!p){if(!s.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`);continue}const h=p.localName;let T;if(p.oneof){if(l===null&&(p.kind!=="enum"||p.T()[0]!=="google.protobuf.NullValue"))continue;if(r.includes(p.oneof))throw new Error(`Multiple members of the oneof group "${p.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(p.oneof),T=t[p.oneof]={oneofKind:h}}else T=t;if(p.kind=="map"){if(l===null)continue;this.assert(ns(l),p.name,l);const b=T[h];for(const[I,v]of Object.entries(l)){this.assert(v!==null,p.name+" map value",null);let D;switch(p.V.kind){case"message":D=p.V.T().internalJsonRead(v,s);break;case"enum":if(D=this.enum(p.V.T(),v,p.name,s.ignoreUnknownFields),D===!1)continue;break;case"scalar":D=this.scalar(v,p.V.T,p.V.L,p.name);break}this.assert(D!==void 0,p.name+" map value",v);let U=I;p.K==g.BOOL&&(U=U=="true"?!0:U=="false"?!1:U),U=this.scalar(U,p.K,$.STRING,p.name).toString(),b[U]=D}}else if(p.repeat){if(l===null)continue;this.assert(Array.isArray(l),p.name,l);const b=T[h];for(const I of l){this.assert(I!==null,p.name,null);let v;switch(p.kind){case"message":v=p.T().internalJsonRead(I,s);break;case"enum":if(v=this.enum(p.T(),I,p.name,s.ignoreUnknownFields),v===!1)continue;break;case"scalar":v=this.scalar(I,p.T,p.L,p.name);break}this.assert(v!==void 0,p.name,l),b.push(v)}}else switch(p.kind){case"message":if(l===null&&p.T().typeName!="google.protobuf.Value"){this.assert(p.oneof===void 0,p.name+" (oneof member)",null);continue}T[h]=p.T().internalJsonRead(l,s,T[h]);break;case"enum":if(l===null)continue;let b=this.enum(p.T(),l,p.name,s.ignoreUnknownFields);if(b===!1)continue;T[h]=b;break;case"scalar":if(l===null)continue;T[h]=this.scalar(l,p.T,p.L,p.name);break}}}enum(n,t,s,r){if(n[0]=="google.protobuf.NullValue"&&E(t===null||t==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${s}, enum ${n[0]} only accepts null.`),t===null)return 0;switch(typeof t){case"number":return E(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${s}, enum can only be integral number, got ${t}.`),t;case"string":let o=t;n[2]&&t.substring(0,n[2].length)===n[2]&&(o=t.substring(n[2].length));let l=n[1][o];return typeof l=="undefined"&&r?!1:(E(typeof l=="number",`Unable to parse field ${this.info.typeName}#${s}, enum ${n[0]} has no value for "${t}".`),l)}E(!1,`Unable to parse field ${this.info.typeName}#${s}, cannot parse enum value from ${typeof t}".`)}scalar(n,t,s,r){let o;try{switch(t){case g.DOUBLE:case g.FLOAT:if(n===null)return 0;if(n==="NaN")return Number.NaN;if(n==="Infinity")return Number.POSITIVE_INFINITY;if(n==="-Infinity")return Number.NEGATIVE_INFINITY;if(n===""){o="empty string";break}if(typeof n=="string"&&n.trim().length!==n.length){o="extra whitespace";break}if(typeof n!="string"&&typeof n!="number")break;let l=Number(n);if(Number.isNaN(l)){o="not a number";break}if(!Number.isFinite(l)){o="too large or small";break}return t==g.FLOAT&&yn(l),l;case g.INT32:case g.FIXED32:case g.SFIXED32:case g.SINT32:case g.UINT32:if(n===null)return 0;let p;if(typeof n=="number"?p=n:n===""?o="empty string":typeof n=="string"&&(n.trim().length!==n.length?o="extra whitespace":p=Number(n)),p===void 0)break;return t==g.UINT32?Ae(p):Te(p),p;case g.INT64:case g.SFIXED64:case g.SINT64:if(n===null)return j(x.ZERO,s);if(typeof n!="number"&&typeof n!="string")break;return j(x.from(n),s);case g.FIXED64:case g.UINT64:if(n===null)return j(M.ZERO,s);if(typeof n!="number"&&typeof n!="string")break;return j(M.from(n),s);case g.BOOL:if(n===null)return!1;if(typeof n!="boolean")break;return n;case g.STRING:if(n===null)return"";if(typeof n!="string"){o="extra whitespace";break}try{encodeURIComponent(n)}catch(h){h="invalid UTF8";break}return n;case g.BYTES:if(n===null||n==="")return new Uint8Array(0);if(typeof n!="string")break;return ts(n)}}catch(l){o=l.message}this.assert(!1,r+(o?" - "+o:""),n)}}class bs{constructor(n){var t;this.fields=(t=n.fields)!==null&&t!==void 0?t:[]}write(n,t){const s={},r=n;for(const o of this.fields){if(!o.oneof){let T=this.field(o,r[o.localName],t);T!==void 0&&(s[t.useProtoFieldName?o.name:o.jsonName]=T);continue}const l=r[o.oneof];if(l.oneofKind!==o.localName)continue;const p=o.kind=="scalar"||o.kind=="enum"?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t;let h=this.field(o,l[o.localName],p);E(h!==void 0),s[t.useProtoFieldName?o.name:o.jsonName]=h}return s}field(n,t,s){let r;if(n.kind=="map"){E(typeof t=="object"&&t!==null);const o={};switch(n.V.kind){case"scalar":for(const[h,T]of Object.entries(t)){const b=this.scalar(n.V.T,T,n.name,!1,!0);E(b!==void 0),o[h.toString()]=b}break;case"message":const l=n.V.T();for(const[h,T]of Object.entries(t)){const b=this.message(l,T,n.name,s);E(b!==void 0),o[h.toString()]=b}break;case"enum":const p=n.V.T();for(const[h,T]of Object.entries(t)){E(T===void 0||typeof T=="number");const b=this.enum(p,T,n.name,!1,!0,s.enumAsInteger);E(b!==void 0),o[h.toString()]=b}break}(s.emitDefaultValues||Object.keys(o).length>0)&&(r=o)}else if(n.repeat){E(Array.isArray(t));const o=[];switch(n.kind){case"scalar":for(let h=0;h<t.length;h++){const T=this.scalar(n.T,t[h],n.name,n.opt,!0);E(T!==void 0),o.push(T)}break;case"enum":const l=n.T();for(let h=0;h<t.length;h++){E(t[h]===void 0||typeof t[h]=="number");const T=this.enum(l,t[h],n.name,n.opt,!0,s.enumAsInteger);E(T!==void 0),o.push(T)}break;case"message":const p=n.T();for(let h=0;h<t.length;h++){const T=this.message(p,t[h],n.name,s);E(T!==void 0),o.push(T)}break}(s.emitDefaultValues||o.length>0||s.emitDefaultValues)&&(r=o)}else switch(n.kind){case"scalar":r=this.scalar(n.T,t,n.name,n.opt,s.emitDefaultValues);break;case"enum":r=this.enum(n.T(),t,n.name,n.opt,s.emitDefaultValues,s.enumAsInteger);break;case"message":r=this.message(n.T(),t,n.name,s);break}return r}enum(n,t,s,r,o,l){if(n[0]=="google.protobuf.NullValue")return!o&&!r?void 0:null;if(t===void 0){E(r);return}if(!(t===0&&!o&&!r))return E(typeof t=="number"),E(Number.isInteger(t)),l||!n[1].hasOwnProperty(t)?t:n[2]?n[2]+n[1][t]:n[1][t]}message(n,t,s,r){return t===void 0?r.emitDefaultValues?null:void 0:n.internalJsonWrite(t,r)}scalar(n,t,s,r,o){if(t===void 0){E(r);return}const l=o||r;switch(n){case g.INT32:case g.SFIXED32:case g.SINT32:return t===0?l?0:void 0:(Te(t),t);case g.FIXED32:case g.UINT32:return t===0?l?0:void 0:(Ae(t),t);case g.FLOAT:yn(t);case g.DOUBLE:return t===0?l?0:void 0:(E(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case g.STRING:return t===""?l?"":void 0:(E(typeof t=="string"),t);case g.BOOL:return t===!1?l?!1:void 0:(E(typeof t=="boolean"),t);case g.UINT64:case g.FIXED64:E(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let p=M.from(t);return p.isZero()&&!l?void 0:p.toString();case g.INT64:case g.SFIXED64:case g.SINT64:E(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let h=x.from(t);return h.isZero()&&!l?void 0:h.toString();case g.BYTES:return E(t instanceof Uint8Array),t.byteLength?ss(t):l?"":void 0}}}function on(e,n=$.STRING){switch(e){case g.BOOL:return!1;case g.UINT64:case g.FIXED64:return j(M.ZERO,n);case g.INT64:case g.SFIXED64:case g.SINT64:return j(x.ZERO,n);case g.DOUBLE:case g.FLOAT:return 0;case g.BYTES:return new Uint8Array(0);case g.STRING:return"";default:return 0}}class vs{constructor(n){this.info=n}prepare(){var n;if(!this.fieldNoToField){const t=(n=this.info.fields)!==null&&n!==void 0?n:[];this.fieldNoToField=new Map(t.map(s=>[s.no,s]))}}read(n,t,s,r){this.prepare();const o=r===void 0?n.len:n.pos+r;for(;n.pos<o;){const[l,p]=n.tag(),h=this.fieldNoToField.get(l);if(!h){let v=s.readUnknownField;if(v=="throw")throw new Error(`Unknown field ${l} (wire type ${p}) for ${this.info.typeName}`);let D=n.skip(p);v!==!1&&(v===!0?Pe.onRead:v)(this.info.typeName,t,l,p,D);continue}let T=t,b=h.repeat,I=h.localName;switch(h.oneof&&(T=T[h.oneof],T.oneofKind!==I&&(T=t[h.oneof]={oneofKind:I})),h.kind){case"scalar":case"enum":let v=h.kind=="enum"?g.INT32:h.T,D=h.kind=="scalar"?h.L:void 0;if(b){let se=T[I];if(p==P.LengthDelimited&&v!=g.STRING&&v!=g.BYTES){let pe=n.uint32()+n.pos;for(;n.pos<pe;)se.push(this.scalar(n,v,D))}else se.push(this.scalar(n,v,D))}else T[I]=this.scalar(n,v,D);break;case"message":if(b){let se=T[I],pe=h.T().internalBinaryRead(n,n.uint32(),s);se.push(pe)}else T[I]=h.T().internalBinaryRead(n,n.uint32(),s,T[I]);break;case"map":let[U,We]=this.mapEntry(h,n,s);T[I][U]=We;break}}}mapEntry(n,t,s){let r=t.uint32(),o=t.pos+r,l,p;for(;t.pos<o;){let[h,T]=t.tag();switch(h){case 1:n.K==g.BOOL?l=t.bool().toString():l=this.scalar(t,n.K,$.STRING);break;case 2:switch(n.V.kind){case"scalar":p=this.scalar(t,n.V.T,n.V.L);break;case"enum":p=t.int32();break;case"message":p=n.V.T().internalBinaryRead(t,t.uint32(),s);break}break;default:throw new Error(`Unknown field ${h} (wire type ${T}) in map entry for ${this.info.typeName}#${n.name}`)}}if(l===void 0){let h=on(n.K);l=n.K==g.BOOL?h.toString():h}if(p===void 0)switch(n.V.kind){case"scalar":p=on(n.V.T,n.V.L);break;case"enum":p=0;break;case"message":p=n.V.T().create();break}return[l,p]}scalar(n,t,s){switch(t){case g.INT32:return n.int32();case g.STRING:return n.string();case g.BOOL:return n.bool();case g.DOUBLE:return n.double();case g.FLOAT:return n.float();case g.INT64:return j(n.int64(),s);case g.UINT64:return j(n.uint64(),s);case g.FIXED64:return j(n.fixed64(),s);case g.FIXED32:return n.fixed32();case g.BYTES:return n.bytes();case g.UINT32:return n.uint32();case g.SFIXED32:return n.sfixed32();case g.SFIXED64:return j(n.sfixed64(),s);case g.SINT32:return n.sint32();case g.SINT64:return j(n.sint64(),s)}}}class Es{constructor(n){this.info=n}prepare(){if(!this.fields){const n=this.info.fields?this.info.fields.concat():[];this.fields=n.sort((t,s)=>t.no-s.no)}}write(n,t,s){this.prepare();for(const o of this.fields){let l,p,h=o.repeat,T=o.localName;if(o.oneof){const b=n[o.oneof];if(b.oneofKind!==T)continue;l=b[T],p=!0}else l=n[T],p=!1;switch(o.kind){case"scalar":case"enum":let b=o.kind=="enum"?g.INT32:o.T;if(h)if(E(Array.isArray(l)),h==Be.PACKED)this.packed(t,b,o.no,l);else for(const I of l)this.scalar(t,b,o.no,I,!0);else l===void 0?E(o.opt):this.scalar(t,b,o.no,l,p||o.opt);break;case"message":if(h){E(Array.isArray(l));for(const I of l)this.message(t,s,o.T(),o.no,I)}else this.message(t,s,o.T(),o.no,l);break;case"map":E(typeof l=="object"&&l!==null);for(const[I,v]of Object.entries(l))this.mapEntry(t,s,o,I,v);break}}let r=s.writeUnknownFields;r!==!1&&(r===!0?Pe.onWrite:r)(this.info.typeName,n,t)}mapEntry(n,t,s,r,o){n.tag(s.no,P.LengthDelimited),n.fork();let l=r;switch(s.K){case g.INT32:case g.FIXED32:case g.UINT32:case g.SFIXED32:case g.SINT32:l=Number.parseInt(r);break;case g.BOOL:E(r=="true"||r=="false"),l=r=="true";break}switch(this.scalar(n,s.K,1,l,!0),s.V.kind){case"scalar":this.scalar(n,s.V.T,2,o,!0);break;case"enum":this.scalar(n,g.INT32,2,o,!0);break;case"message":this.message(n,t,s.V.T(),2,o);break}n.join()}message(n,t,s,r,o){o!==void 0&&(s.internalBinaryWrite(o,n.tag(r,P.LengthDelimited).fork(),t),n.join())}scalar(n,t,s,r,o){let[l,p,h]=this.scalarInfo(t,r);(!h||o)&&(n.tag(s,l),n[p](r))}packed(n,t,s,r){if(!r.length)return;E(t!==g.BYTES&&t!==g.STRING),n.tag(s,P.LengthDelimited),n.fork();let[,o]=this.scalarInfo(t);for(let l=0;l<r.length;l++)n[o](r[l]);n.join()}scalarInfo(n,t){let s=P.Varint,r,o=t===void 0,l=t===0;switch(n){case g.INT32:r="int32";break;case g.STRING:l=o||!t.length,s=P.LengthDelimited,r="string";break;case g.BOOL:l=t===!1,r="bool";break;case g.UINT32:r="uint32";break;case g.DOUBLE:s=P.Bit64,r="double";break;case g.FLOAT:s=P.Bit32,r="float";break;case g.INT64:l=o||x.from(t).isZero(),r="int64";break;case g.UINT64:l=o||M.from(t).isZero(),r="uint64";break;case g.FIXED64:l=o||M.from(t).isZero(),s=P.Bit64,r="fixed64";break;case g.BYTES:l=o||!t.byteLength,s=P.LengthDelimited,r="bytes";break;case g.FIXED32:s=P.Bit32,r="fixed32";break;case g.SFIXED32:s=P.Bit32,r="sfixed32";break;case g.SFIXED64:l=o||x.from(t).isZero(),s=P.Bit64,r="sfixed64";break;case g.SINT32:r="sint32";break;case g.SINT64:l=o||x.from(t).isZero(),r="sint64";break}return[s,r,o||l]}}function Rs(e){const n=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},rt,{value:e});for(let t of e.fields){let s=t.localName;if(!t.opt)if(t.oneof)n[t.oneof]={oneofKind:void 0};else if(t.repeat)n[s]=[];else switch(t.kind){case"scalar":n[s]=on(t.T,t.L);break;case"enum":n[s]=0;break;case"map":n[s]={};break}}return n}function en(e,n,t){let s,r=t,o;for(let l of e.fields){let p=l.localName;if(l.oneof){const h=r[l.oneof];if((h==null?void 0:h.oneofKind)==null)continue;if(s=h[p],o=n[l.oneof],o.oneofKind=h.oneofKind,s==null){delete o[p];continue}}else if(s=r[p],o=n,s==null)continue;switch(l.repeat&&(o[p].length=s.length),l.kind){case"scalar":case"enum":if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=s[T];else o[p]=s;break;case"message":let h=l.T();if(l.repeat)for(let T=0;T<s.length;T++)o[p][T]=h.create(s[T]);else o[p]===void 0?o[p]=h.create(s):h.mergePartial(o[p],s);break;case"map":switch(l.V.kind){case"scalar":case"enum":Object.assign(o[p],s);break;case"message":let T=l.V.T();for(let b of Object.keys(s))o[p][b]=T.create(s[b]);break}break}}}function Os(e,n,t){if(n===t)return!0;if(!n||!t)return!1;for(let s of e.fields){let r=s.localName,o=s.oneof?n[s.oneof][r]:n[r],l=s.oneof?t[s.oneof][r]:t[r];switch(s.kind){case"enum":case"scalar":let p=s.kind=="enum"?g.INT32:s.T;if(!(s.repeat?Fn(p,o,l):ot(p,o,l)))return!1;break;case"map":if(!(s.V.kind=="message"?Un(s.V.T(),Re(o),Re(l)):Fn(s.V.kind=="enum"?g.INT32:s.V.T,Re(o),Re(l))))return!1;break;case"message":let h=s.T();if(!(s.repeat?Un(h,o,l):h.equals(o,l)))return!1;break}}return!0}const Re=Object.values;function ot(e,n,t){if(n===t)return!0;if(e!==g.BYTES)return!1;let s=n,r=t;if(s.length!==r.length)return!1;for(let o=0;o<s.length;o++)if(s[o]!=r[o])return!1;return!0}function Fn(e,n,t){if(n.length!==t.length)return!1;for(let s=0;s<n.length;s++)if(!ot(e,n[s],t[s]))return!1;return!0}function Un(e,n,t){if(n.length!==t.length)return!1;for(let s=0;s<n.length;s++)if(!e.equals(n[s],t[s]))return!1;return!0}const Ss=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));class u{constructor(n,t,s){this.defaultCheckDepth=16,this.typeName=n,this.fields=t.map(Ts),this.options=s!=null?s:{},this.messagePrototype=Object.create(null,Object.assign(Object.assign({},Ss),{[rt]:{value:this}})),this.refTypeCheck=new ys(this),this.refJsonReader=new _s(this),this.refJsonWriter=new bs(this),this.refBinReader=new vs(this),this.refBinWriter=new Es(this)}create(n){let t=Rs(this);return n!==void 0&&en(this,t,n),t}clone(n){let t=this.create();return en(this,t,n),t}equals(n,t){return Os(this,n,t)}is(n,t=this.defaultCheckDepth){return this.refTypeCheck.is(n,t,!1)}isAssignable(n,t=this.defaultCheckDepth){return this.refTypeCheck.is(n,t,!0)}mergePartial(n,t){en(this,n,t)}fromBinary(n,t){let s=is(t);return this.internalBinaryRead(s.readerFactory(n),n.byteLength,s)}fromJson(n,t){return this.internalJsonRead(n,gs(t))}fromJsonString(n,t){let s=JSON.parse(n);return this.fromJson(s,t)}toJson(n,t){return this.internalJsonWrite(n,ks(t))}toJsonString(n,t){var s;let r=this.toJson(n,t);return JSON.stringify(r,null,(s=t==null?void 0:t.prettySpaces)!==null&&s!==void 0?s:0)}toBinary(n,t){let s=fs(t);return this.internalBinaryWrite(n,s.writerFactory(),s).finish()}internalJsonRead(n,t,s){if(n!==null&&typeof n=="object"&&!Array.isArray(n)){let r=s!=null?s:this.create();return this.refJsonReader.read(n,r,t),r}throw new Error(`Unable to parse message ${this.typeName} from JSON ${wn(n)}.`)}internalJsonWrite(n,t){return this.refJsonWriter.write(n,t)}internalBinaryWrite(n,t,s){return this.refBinWriter.write(n,t,s),t}internalBinaryRead(n,t,s,r){let o=r!=null?r:this.create();return this.refBinReader.read(n,o,s,t),o}}var Ns=Object.defineProperty,xs=Object.defineProperties,Is=Object.getOwnPropertyDescriptors,qn=Object.getOwnPropertySymbols,Cs=Object.prototype.hasOwnProperty,Ps=Object.prototype.propertyIsEnumerable,an=(e,n,t)=>n in e?Ns(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Vn=(e,n)=>{for(var t in n||(n={}))Cs.call(n,t)&&an(e,t,n[t]);if(qn)for(var t of qn(n))Ps.call(n,t)&&an(e,t,n[t]);return e},Ls=(e,n)=>xs(e,Is(n)),R=(e,n,t)=>(an(e,typeof n!="symbol"?n+"":n,t),t),at=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)},ie=(e,n,t)=>(at(e,n,"read from private field"),t?t.call(e):n.get(e)),Oe=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},Gn=(e,n,t,s)=>(at(e,n,"write to private field"),s?s.call(e,t):n.set(e,t),t),As=(e,n,t)=>new Promise((s,r)=>{var o=h=>{try{p(t.next(h))}catch(T){r(T)}},l=h=>{try{p(t.throw(h))}catch(T){r(T)}},p=h=>h.done?s(h.value):Promise.resolve(h.value).then(o,l);p((t=t.apply(e,n)).next())}),he=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},De={},Bs={get exports(){return De},set exports(e){De=e}},ce=typeof Reflect=="object"?Reflect:null,jn=ce&&typeof ce.apply=="function"?ce.apply:function(e,n,t){return Function.prototype.apply.call(e,n,t)},xe;ce&&typeof ce.ownKeys=="function"?xe=ce.ownKeys:Object.getOwnPropertySymbols?xe=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:xe=function(e){return Object.getOwnPropertyNames(e)};function Ds(e){console&&console.warn&&console.warn(e)}var it=Number.isNaN||function(e){return e!==e};function O(){O.init.call(this)}Bs.exports=O;De.once=qs;O.EventEmitter=O;O.prototype._events=void 0;O.prototype._eventsCount=0;O.prototype._maxListeners=void 0;var Wn=10;function Ve(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(O,"defaultMaxListeners",{enumerable:!0,get:function(){return Wn},set:function(e){if(typeof e!="number"||e<0||it(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Wn=e}});O.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};O.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||it(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function ct(e){return e._maxListeners===void 0?O.defaultMaxListeners:e._maxListeners}O.prototype.getMaxListeners=function(){return ct(this)};O.prototype.emit=function(e){for(var n=[],t=1;t<arguments.length;t++)n.push(arguments[t]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")jn(p,this,n);else for(var h=p.length,T=mt(p,h),t=0;t<h;++t)jn(T[t],this,n);return!0};function ut(e,n,t,s){var r,o,l;if(Ve(t),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",n,t.listener?t.listener:t),o=e._events),l=o[n]),l===void 0)l=o[n]=t,++e._eventsCount;else if(typeof l=="function"?l=o[n]=s?[t,l]:[l,t]:s?l.unshift(t):l.push(t),r=ct(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=n,p.count=l.length,Ds(p)}return e}O.prototype.addListener=function(e,n){return ut(this,e,n,!1)};O.prototype.on=O.prototype.addListener;O.prototype.prependListener=function(e,n){return ut(this,e,n,!0)};function Ms(){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 lt(e,n,t){var s={fired:!1,wrapFn:void 0,target:e,type:n,listener:t},r=Ms.bind(s);return r.listener=t,s.wrapFn=r,r}O.prototype.once=function(e,n){return Ve(n),this.on(e,lt(this,e,n)),this};O.prototype.prependOnceListener=function(e,n){return Ve(n),this.prependListener(e,lt(this,e,n)),this};O.prototype.removeListener=function(e,n){var t,s,r,o,l;if(Ve(n),s=this._events,s===void 0)return this;if(t=s[e],t===void 0)return this;if(t===n||t.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,t.listener||n));else if(typeof t!="function"){for(r=-1,o=t.length-1;o>=0;o--)if(t[o]===n||t[o].listener===n){l=t[o].listener,r=o;break}if(r<0)return this;r===0?t.shift():Fs(t,r),t.length===1&&(s[e]=t[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||n)}return this};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){var n,t,s;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){var r=Object.keys(t),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=t[e],typeof n=="function")this.removeListener(e,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(e,n[s]);return this};function dt(e,n,t){var s=e._events;if(s===void 0)return[];var r=s[n];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?Us(r):mt(r,r.length)}O.prototype.listeners=function(e){return dt(this,e,!0)};O.prototype.rawListeners=function(e){return dt(this,e,!1)};O.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):pt.call(e,n)};O.prototype.listenerCount=pt;function pt(e){var n=this._events;if(n!==void 0){var t=n[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}O.prototype.eventNames=function(){return this._eventsCount>0?xe(this._events):[]};function mt(e,n){for(var t=new Array(n),s=0;s<n;++s)t[s]=e[s];return t}function Fs(e,n){for(;n+1<e.length;n++)e[n]=e[n+1];e.pop()}function Us(e){for(var n=new Array(e.length),t=0;t<n.length;++t)n[t]=e[t].listener||e[t];return n}function qs(e,n){return new Promise(function(t,s){function r(l){e.removeListener(n,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),t([].slice.call(arguments))}ft(e,n,o,{once:!0}),n!=="error"&&Vs(e,r,{once:!0})})}function Vs(e,n,t){typeof e.on=="function"&&ft(e,"error",n,t)}function ft(e,n,t,s){if(typeof e.on=="function")s.once?e.once(n,t):e.on(n,t);else if(typeof e.addEventListener=="function")e.addEventListener(n,function r(o){s.once&&e.removeEventListener(n,r),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}const Gs=`
3
3
  m=video 9 UDP/TLS/RTP/SAVPF 96
4
4
  a=msid:stream-id track-id
5
5
  m=audio 9 UDP/TLS/RTP/SAVPF 96
6
6
  a=msid:stream-id track-id
7
- `,Wt={track:null,transport:null,rtcpTransport:null,dtmf:{insertDTMF:()=>{},ontonechange:null,canInsertDTMF:!1,toneBuffer:"",addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!0},transform:null,mid:null,getParameters:()=>({}),setParameters:()=>Promise.resolve({}),replaceTrack:()=>Promise.resolve({}),getStats:()=>Promise.resolve(new Map),setStreams:()=>{},setTransform:()=>Promise.resolve()};class Gs extends De{constructor(){super(),R(this,"localDescription",null),R(this,"remoteDescription",null),R(this,"currentLocalDescription",null),R(this,"currentRemoteDescription",null),R(this,"pendingLocalDescription",null),R(this,"pendingRemoteDescription",null),R(this,"signalingState","stable"),R(this,"iceConnectionState","new"),R(this,"iceGatheringState","new"),R(this,"connectionState","new"),R(this,"canTrickleIceCandidates",null),R(this,"sctp",null),R(this,"senders",[]),R(this,"receivers",[]),R(this,"transceivers",[]),R(this,"onicecandidate",null),R(this,"onicecandidateerror",null),R(this,"onconnectionstatechange",null),R(this,"oniceconnectionstatechange",null),R(this,"onicegatheringstatechange",null),R(this,"onsignalingstatechange",null),R(this,"onnegotiationneeded",null),R(this,"ontrack",null),R(this,"ondatachannel",null),R(this,"addEventListener"),R(this,"removeEventListener"),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener}createOffer(){return Promise.resolve({sdp:Vs,type:"offer"})}createAnswer(){return Promise.resolve({})}setLocalDescription(){return this.iceConnectionState="connected",this.iceGatheringState="complete",this.connectionState="connected",this.signalingState="stable",this.emit("iceconnectionstatechange"),Promise.resolve()}setRemoteDescription(){return Promise.resolve()}addIceCandidate(){return Promise.resolve()}getStats(){return Promise.resolve(new Map)}getConfiguration(){return{}}setConfiguration(){}close(){}createDataChannel(){return{close:()=>{},send:()=>{}}}addTrack(){return Wt}removeTrack(){}addTransceiver(){return{stop:()=>{},setDirection:()=>{},setCodecPreferences:()=>{},sender:Wt}}getTransceivers(){return[]}getSenders(){return[]}getReceivers(){return[]}restartIce(){}static generateCertificate(){return Promise.resolve({expires:Date.now(),getFingerprints:()=>[]})}}function js(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hn={exports:{}},L=hn.exports={},Z,X;function it(){throw new Error("setTimeout has not been defined")}function ct(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Z=setTimeout:Z=it}catch(e){Z=it}try{typeof clearTimeout=="function"?X=clearTimeout:X=ct}catch(e){X=ct}})();function gn(e){if(Z===setTimeout)return setTimeout(e,0);if((Z===it||!Z)&&setTimeout)return Z=setTimeout,setTimeout(e,0);try{return Z(e,0)}catch(t){try{return Z.call(null,e,0)}catch(n){return Z.call(this,e,0)}}}function Ws(e){if(X===clearTimeout)return clearTimeout(e);if((X===ct||!X)&&clearTimeout)return X=clearTimeout,clearTimeout(e);try{return X(e)}catch(t){try{return X.call(null,e)}catch(n){return X.call(this,e)}}}var H=[],ue=!1,te,Ie=-1;function Ks(){!ue||!te||(ue=!1,te.length?H=te.concat(H):Ie=-1,H.length&&kn())}function kn(){if(!ue){var e=gn(Ks);ue=!0;for(var t=H.length;t;){for(te=H,H=[];++Ie<t;)te&&te[Ie].run();Ie=-1,t=H.length}te=null,ue=!1,Ws(e)}}L.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];H.push(new Tn(e,t)),H.length===1&&!ue&&gn(kn)};function Tn(e,t){this.fun=e,this.array=t}Tn.prototype.run=function(){this.fun.apply(null,this.array)};L.title="browser";L.browser=!0;L.env={};L.argv=[];L.version="";L.versions={};function Q(){}L.on=Q;L.addListener=Q;L.once=Q;L.off=Q;L.removeListener=Q;L.removeAllListeners=Q;L.emit=Q;L.prependListener=Q;L.prependOnceListener=Q;L.listeners=function(e){return[]};L.binding=function(e){throw new Error("process.binding is not supported")};L.cwd=function(){return"/"};L.chdir=function(e){throw new Error("process.chdir is not supported")};L.umask=function(){return 0};var Js=hn.exports;const tt=js(Js);function Zs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var we={},Xs={get exports(){return we},set exports(e){we=e}};(function(e,t){(function(n,s){s(t)})(he,function(n){var s=typeof window!="undefined"?window:typeof he!="undefined"?he:typeof self!="undefined"?self:{},r=function(i,c){if(c=c.split(":")[0],i=+i,!i)return!1;switch(c){case"http":case"ws":return i!==80;case"https":case"wss":return i!==443;case"ftp":return i!==21;case"gopher":return i!==70;case"file":return!1}return i!==0},o=Object.prototype.hasOwnProperty,l;function p(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch(c){return null}}function h(i){try{return encodeURIComponent(i)}catch(c){return null}}function T(i){for(var c=/([^=?#&]+)=?([^&]*)/g,d={},a;a=c.exec(i);){var m=p(a[1]),f=p(a[2]);m===null||f===null||m in d||(d[m]=f)}return d}function _(i,c){c=c||"";var d=[],a,m;typeof c!="string"&&(c="?");for(m in i)if(o.call(i,m)){if(a=i[m],!a&&(a===null||a===l||isNaN(a))&&(a=""),m=h(m),a=h(a),m===null||a===null)continue;d.push(m+"="+a)}return d.length?c+d.join("&"):""}var I=_,v=T,D={stringify:I,parse:v},U=/[\n\r\t]/g,We=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,se=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,pe=/^[a-zA-Z]:/,Fn=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function Ke(i){return(i||"").toString().replace(Fn,"")}var Je=[["#","hash"],["?","query"],function(i,c){return K(c.protocol)?i.replace(/\\/g,"/"):i},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],vt={hash:1,query:1};function Et(i){var c;typeof window!="undefined"?c=window:typeof s!="undefined"?c=s:typeof self!="undefined"?c=self:c={};var d=c.location||{};i=i||d;var a={},m=typeof i,f;if(i.protocol==="blob:")a=new J(unescape(i.pathname),{});else if(m==="string"){a=new J(i,{});for(f in vt)delete a[f]}else if(m==="object"){for(f in i)f in vt||(a[f]=i[f]);a.slashes===void 0&&(a.slashes=We.test(i.href))}return a}function K(i){return i==="file:"||i==="ftp:"||i==="http:"||i==="https:"||i==="ws:"||i==="wss:"}function Rt(i,c){i=Ke(i),i=i.replace(U,""),c=c||{};var d=se.exec(i),a=d[1]?d[1].toLowerCase():"",m=!!d[2],f=!!d[3],k=0,w;return m?f?(w=d[2]+d[3]+d[4],k=d[2].length+d[3].length):(w=d[2]+d[4],k=d[2].length):f?(w=d[3]+d[4],k=d[3].length):w=d[4],a==="file:"?k>=2&&(w=w.slice(2)):K(a)?w=d[4]:a?m&&(w=w.slice(2)):k>=2&&K(c.protocol)&&(w=d[4]),{protocol:a,slashes:m||K(a),slashesCount:k,rest:w}}function Un(i,c){if(i==="")return c;for(var d=(c||"/").split("/").slice(0,-1).concat(i.split("/")),a=d.length,m=d[a-1],f=!1,k=0;a--;)d[a]==="."?d.splice(a,1):d[a]===".."?(d.splice(a,1),k++):k&&(a===0&&(f=!0),d.splice(a,1),k--);return f&&d.unshift(""),(m==="."||m==="..")&&d.push(""),d.join("/")}function J(i,c,d){if(i=Ke(i),i=i.replace(U,""),!(this instanceof J))return new J(i,c,d);var a,m,f,k,w,b,B=Je.slice(),It=typeof c,y=this,He=0;for(It!=="object"&&It!=="string"&&(d=c,c=null),d&&typeof d!="function"&&(d=D.parse),c=Et(c),m=Rt(i||"",c),a=!m.protocol&&!m.slashes,y.slashes=m.slashes||a&&c.slashes,y.protocol=m.protocol||c.protocol||"",i=m.rest,(m.protocol==="file:"&&(m.slashesCount!==2||pe.test(i))||!m.slashes&&(m.protocol||m.slashesCount<2||!K(y.protocol)))&&(B[3]=[/(.*)/,"pathname"]);He<B.length;He++){if(k=B[He],typeof k=="function"){i=k(i,y);continue}f=k[0],b=k[1],f!==f?y[b]=i:typeof f=="string"?(w=f==="@"?i.lastIndexOf(f):i.indexOf(f),~w&&(typeof k[2]=="number"?(y[b]=i.slice(0,w),i=i.slice(w+k[2])):(y[b]=i.slice(w),i=i.slice(0,w)))):(w=f.exec(i))&&(y[b]=w[1],i=i.slice(0,w.index)),y[b]=y[b]||a&&k[3]&&c[b]||"",k[4]&&(y[b]=y[b].toLowerCase())}d&&(y.query=d(y.query)),a&&c.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||c.pathname!=="")&&(y.pathname=Un(y.pathname,c.pathname)),y.pathname.charAt(0)!=="/"&&K(y.protocol)&&(y.pathname="/"+y.pathname),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(w=y.auth.indexOf(":"),~w?(y.username=y.auth.slice(0,w),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(w+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&K(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString()}function qn(i,c,d){var a=this;switch(i){case"query":typeof c=="string"&&c.length&&(c=(d||D.parse)(c)),a[i]=c;break;case"port":a[i]=c,r(c,a.protocol)?c&&(a.host=a.hostname+":"+c):(a.host=a.hostname,a[i]="");break;case"hostname":a[i]=c,a.port&&(c+=":"+a.port),a.host=c;break;case"host":a[i]=c,/:\d+$/.test(c)?(c=c.split(":"),a.port=c.pop(),a.hostname=c.join(":")):(a.hostname=c,a.port="");break;case"protocol":a.protocol=c.toLowerCase(),a.slashes=!d;break;case"pathname":case"hash":if(c){var m=i==="pathname"?"/":"#";a[i]=c.charAt(0)!==m?m+c:c}else a[i]=c;break;case"username":case"password":a[i]=encodeURIComponent(c);break;case"auth":var f=c.indexOf(":");~f?(a.username=c.slice(0,f),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=c.slice(f+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(c))}for(var k=0;k<Je.length;k++){var w=Je[k];w[4]&&(a[w[1]]=a[w[1]].toLowerCase())}return a.auth=a.password?a.username+":"+a.password:a.username,a.origin=a.protocol!=="file:"&&K(a.protocol)&&a.host?a.protocol+"//"+a.host:"null",a.href=a.toString(),a}function Vn(i){(!i||typeof i!="function")&&(i=D.stringify);var c,d=this,a=d.host,m=d.protocol;m&&m.charAt(m.length-1)!==":"&&(m+=":");var f=m+(d.protocol&&d.slashes||K(d.protocol)?"//":"");return d.username?(f+=d.username,d.password&&(f+=":"+d.password),f+="@"):d.password?(f+=":"+d.password,f+="@"):d.protocol!=="file:"&&K(d.protocol)&&!a&&d.pathname!=="/"&&(f+="@"),a[a.length-1]===":"&&(a+=":"),f+=a+d.pathname,c=typeof d.query=="object"?i(d.query):d.query,c&&(f+=c.charAt(0)!=="?"?"?"+c:c),d.hash&&(f+=d.hash),f}J.prototype={set:qn,toString:Vn},J.extractProtocol=Rt,J.location=Et,J.trimLeft=Ke,J.qs=D;var Ze=J;function me(i,c){setTimeout(function(d){return i.call(d)},4,c)}function _e(i,c){typeof tt!="undefined"&&tt.env.NODE_ENV!=="test"&&console[i].call(null,c)}function Xe(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)||d.push(a)}),d}function Gn(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)&&d.push(a)}),d}var re=function(){this.listeners={}};re.prototype.addEventListener=function(i,c){typeof c=="function"&&(Array.isArray(this.listeners[i])||(this.listeners[i]=[]),Gn(this.listeners[i],function(d){return d===c}).length===0&&this.listeners[i].push(c))},re.prototype.removeEventListener=function(i,c){var d=this.listeners[i];this.listeners[i]=Xe(d,function(a){return a===c})},re.prototype.dispatchEvent=function(i){for(var c=this,d=[],a=arguments.length-1;a-- >0;)d[a]=arguments[a+1];var m=i.type,f=this.listeners[m];return Array.isArray(f)?(f.forEach(function(k){d.length>0?k.apply(c,d):k.call(c,i)}),!0):!1};function ee(i){var c=i.indexOf("?");return c>=0?i.slice(0,c):i}var Y=function(){this.urlMap={}};Y.prototype.attachWebSocket=function(i,c){var d=ee(c),a=this.urlMap[d];if(a&&a.server&&a.websockets.indexOf(i)===-1)return a.websockets.push(i),a.server},Y.prototype.addMembershipToRoom=function(i,c){var d=this.urlMap[ee(i.url)];d&&d.server&&d.websockets.indexOf(i)!==-1&&(d.roomMemberships[c]||(d.roomMemberships[c]=[]),d.roomMemberships[c].push(i))},Y.prototype.attachServer=function(i,c){var d=ee(c),a=this.urlMap[d];if(!a)return this.urlMap[d]={server:i,websockets:[],roomMemberships:{}},i},Y.prototype.serverLookup=function(i){var c=ee(i),d=this.urlMap[c];if(d)return d.server},Y.prototype.websocketsLookup=function(i,c,d){var a=ee(i),m,f=this.urlMap[a];if(m=f?f.websockets:[],c){var k=f.roomMemberships[c];m=k||[]}return d?m.filter(function(w){return w!==d}):m},Y.prototype.removeServer=function(i){delete this.urlMap[ee(i)]},Y.prototype.removeWebSocket=function(i,c){var d=ee(c),a=this.urlMap[d];a&&(a.websockets=Xe(a.websockets,function(m){return m===i}))},Y.prototype.removeMembershipFromRoom=function(i,c){var d=this.urlMap[ee(i.url)],a=d.roomMemberships[c];d&&a!==null&&(d.roomMemberships[c]=Xe(a,function(m){return m===i}))};var C=new Y,q={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,UNSUPPORTED_DATA:1007,POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,MISSING_EXTENSION:1010,INTERNAL_ERROR:1011,SERVICE_RESTART:1012,TRY_AGAIN_LATER:1013,TLS_HANDSHAKE:1015},F={CONSTRUCTOR_ERROR:"Failed to construct 'WebSocket':",CLOSE_ERROR:"Failed to execute 'close' on 'WebSocket':",EVENT:{CONSTRUCT:"Failed to construct 'Event':",MESSAGE:"Failed to construct 'MessageEvent':",CLOSE:"Failed to construct 'CloseEvent':"}},oe=function(){};oe.prototype.stopPropagation=function(){},oe.prototype.stopImmediatePropagation=function(){},oe.prototype.initEvent=function(i,c,d){i===void 0&&(i="undefined"),c===void 0&&(c=!1),d===void 0&&(d=!1),this.type=""+i,this.bubbles=Boolean(c),this.cancelable=Boolean(d)};var jn=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT_ERROR+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT_ERROR+" parameter 2 ('eventInitDict') is not an object.");var m=a.bubbles,f=a.cancelable;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(oe),Wn=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.MESSAGE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.MESSAGE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,k=a.data,w=a.origin,b=a.lastEventId,B=a.ports;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.canncelBubble=!1,this.bubbles=m?Boolean(m):!1,this.origin=""+w,this.ports=typeof B=="undefined"?null:B,this.data=typeof k=="undefined"?null:k,this.lastEventId=""+(b||"")}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(oe),Kn=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.CLOSE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.CLOSE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,k=a.code,w=a.reason,b=a.wasClean;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1,this.code=typeof k=="number"?parseInt(k,10):0,this.reason=""+(w||""),this.wasClean=b?Boolean(b):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(oe);function V(i){var c=i.type,d=i.target,a=new jn(c);return d&&(a.target=d,a.srcElement=d,a.currentTarget=d),a}function fe(i){var c=i.type,d=i.origin,a=i.data,m=i.target,f=new Wn(c,{data:a,origin:d});return m&&(f.target=m,f.srcElement=m,f.currentTarget=m),f}function G(i){var c=i.code,d=i.reason,a=i.type,m=i.target,f=i.wasClean;f||(f=c===q.CLOSE_NORMAL||c===q.CLOSE_NO_STATUS);var k=new Kn(a,{code:c,reason:d,wasClean:f});return m&&(k.target=m,k.srcElement=m,k.currentTarget=m),k}function Ot(i,c,d){i.readyState=A.CLOSING;var a=C.serverLookup(i.url),m=G({type:"close",target:i.target,code:c,reason:d});me(function(){C.removeWebSocket(i,i.url),i.readyState=A.CLOSED,i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function Jn(i,c,d){i.readyState=A.CLOSING;var a=C.serverLookup(i.url),m=G({type:"close",target:i.target,code:c,reason:d,wasClean:!1}),f=V({type:"error",target:i.target});me(function(){C.removeWebSocket(i,i.url),i.readyState=A.CLOSED,i.dispatchEvent(f),i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function ve(i){return Object.prototype.toString.call(i)!=="[object Blob]"&&!(i instanceof ArrayBuffer)&&(i=String(i)),i}var $e=new WeakMap;function St(i){if($e.has(i))return $e.get(i);var c=new Proxy(i,{get:function(d,a){if(a==="close")return function(f){f===void 0&&(f={});var k=f.code||q.CLOSE_NORMAL,w=f.reason||"";Ot(c,k,w)};if(a==="send")return function(f){f=ve(f),i.dispatchEvent(fe({type:"message",data:f,origin:this.url,target:i}))};var m=function(f){return f==="message"?"server::"+f:f};return a==="on"?function(f,k){i.addEventListener(m(f),k)}:a==="off"?function(f,k){i.removeEventListener(m(f),k)}:a==="target"?i:d[a]}});return $e.set(i,c),c}function Zn(i){var c=encodeURIComponent(i).match(/%[89ABab]/g);return i.length+(c?c.length:0)}function Xn(i){var c=new Ze(i),d=c.pathname,a=c.protocol,m=c.hash;if(!i)throw new TypeError(F.CONSTRUCTOR_ERROR+" 1 argument required, but only 0 present.");if(d||(c.pathname="/"),a==="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL '"+c.toString()+"' is invalid.");if(a!=="ws:"&&a!=="wss:")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL's scheme must be either 'ws' or 'wss'. '"+a+"' is not allowed.");if(m!=="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL contains a fragment identifier ('"+m+"'). Fragment identifiers are not allowed in WebSocket URLs.");return c.toString()}function $n(i){if(i===void 0&&(i=[]),!Array.isArray(i)&&typeof i!="string")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+i.toString()+"' is invalid.");typeof i=="string"&&(i=[i]);var c=i.map(function(a){return{count:1,protocol:a}}).reduce(function(a,m){return a[m.protocol]=(a[m.protocol]||0)+m.count,a},{}),d=Object.keys(c).filter(function(a){return c[a]>1});if(d.length>0)throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+d[0]+"' is duplicated.");return i}var A=function(i){function c(a,m){i.call(this),this._onopen=null,this._onmessage=null,this._onerror=null,this._onclose=null,this.url=Xn(a),m=$n(m),this.protocol=m[0]||"",this.binaryType="blob",this.readyState=c.CONNECTING;var f=St(this),k=C.attachWebSocket(f,this.url);me(function(){if(this.readyState===c.CONNECTING)if(k)if(k.options.verifyClient&&typeof k.options.verifyClient=="function"&&!k.options.verifyClient())this.readyState=c.CLOSED,_e("error","WebSocket connection to '"+this.url+"' failed: HTTP Authentication failed; no valid credentials available"),C.removeWebSocket(f,this.url),this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL}));else{if(k.options.selectProtocol&&typeof k.options.selectProtocol=="function"){var w=k.options.selectProtocol(m),b=w!=="",B=m.indexOf(w)!==-1;if(b&&!B){this.readyState=c.CLOSED,_e("error","WebSocket connection to '"+this.url+"' failed: Invalid Sub-Protocol"),C.removeWebSocket(f,this.url),this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL}));return}this.protocol=w}this.readyState=c.OPEN,this.dispatchEvent(V({type:"open",target:this})),k.dispatchEvent(V({type:"connection"}),f)}else this.readyState=c.CLOSED,this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL})),_e("error","WebSocket connection to '"+this.url+"' failed")},this)}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={onopen:{},onmessage:{},onclose:{},onerror:{}};return d.onopen.get=function(){return this._onopen},d.onmessage.get=function(){return this._onmessage},d.onclose.get=function(){return this._onclose},d.onerror.get=function(){return this._onerror},d.onopen.set=function(a){this.removeEventListener("open",this._onopen),this._onopen=a,this.addEventListener("open",a)},d.onmessage.set=function(a){this.removeEventListener("message",this._onmessage),this._onmessage=a,this.addEventListener("message",a)},d.onclose.set=function(a){this.removeEventListener("close",this._onclose),this._onclose=a,this.addEventListener("close",a)},d.onerror.set=function(a){this.removeEventListener("error",this._onerror),this._onerror=a,this.addEventListener("error",a)},c.prototype.send=function(a){var m=this;if(this.readyState===c.CONNECTING)throw new Error("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state");var f=fe({type:"server::message",origin:this.url,data:ve(a)}),k=C.serverLookup(this.url);k&&me(function(){m.dispatchEvent(f,a)},k)},c.prototype.close=function(a,m){if(a!==void 0&&(typeof a!="number"||a!==1e3&&(a<3e3||a>4999)))throw new TypeError(F.CLOSE_ERROR+" The code must be either 1000, or between 3000 and 4999. "+a+" is neither.");if(m!==void 0){var f=Zn(m);if(f>123)throw new SyntaxError(F.CLOSE_ERROR+" The message must not be greater than 123 bytes.")}if(!(this.readyState===c.CLOSING||this.readyState===c.CLOSED)){var k=St(this);this.readyState===c.CONNECTING?Jn(k,a||q.CLOSE_ABNORMAL,m):Ot(k,a||q.CLOSE_NO_STATUS,m)}},Object.defineProperties(c.prototype,d),c}(re);A.CONNECTING=0,A.prototype.CONNECTING=A.CONNECTING,A.OPEN=1,A.prototype.OPEN=A.OPEN,A.CLOSING=2,A.prototype.CLOSING=A.CLOSING,A.CLOSED=3,A.prototype.CLOSED=A.CLOSED;var ae=function(i){function c(a,m){var f=this;a===void 0&&(a="socket.io"),m===void 0&&(m=""),i.call(this),this.binaryType="blob";var k=new Ze(a);k.pathname||(k.pathname="/"),this.url=k.toString(),this.readyState=c.CONNECTING,this.protocol="",this.target=this,typeof m=="string"||typeof m=="object"&&m!==null?this.protocol=m:Array.isArray(m)&&m.length>0&&(this.protocol=m[0]);var w=C.attachWebSocket(this,this.url);me(function(){w?(this.readyState=c.OPEN,w.dispatchEvent(V({type:"connection"}),w,this),w.dispatchEvent(V({type:"connect"}),w,this),this.dispatchEvent(V({type:"connect",target:this}))):(this.readyState=c.CLOSED,this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL})),_e("error","Socket.io connection to '"+this.url+"' failed"))},this),this.addEventListener("close",function(b){f.dispatchEvent(G({type:"disconnect",target:b.target,code:b.code}))})}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={broadcast:{}};return c.prototype.close=function(){if(this.readyState===c.OPEN){var a=C.serverLookup(this.url);return C.removeWebSocket(this,this.url),this.readyState=c.CLOSED,this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL})),a&&a.dispatchEvent(G({type:"disconnect",target:this,code:q.CLOSE_NORMAL}),a),this}},c.prototype.disconnect=function(){return this.close()},c.prototype.emit=function(a){for(var m=[],f=arguments.length-1;f-- >0;)m[f]=arguments[f+1];if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var k=fe({type:a,origin:this.url,data:m}),w=C.serverLookup(this.url);return w&&w.dispatchEvent.apply(w,[k].concat(m)),this},c.prototype.send=function(a){return this.emit("message",a),this},d.broadcast.get=function(){if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var a=this,m=C.serverLookup(this.url);if(!m)throw new Error("SocketIO can not find a server at the specified URL ("+this.url+")");return{emit:function(f,k){return m.emit(f,k,{websockets:C.websocketsLookup(a.url,null,a)}),a},to:function(f){return m.to(f,a)},in:function(f){return m.in(f,a)}}},c.prototype.on=function(a,m){return this.addEventListener(a,m),this},c.prototype.off=function(a,m){this.removeEventListener(a,m)},c.prototype.hasListeners=function(a){var m=this.listeners[a];return Array.isArray(m)?!!m.length:!1},c.prototype.join=function(a){C.addMembershipToRoom(this,a)},c.prototype.leave=function(a){C.removeMembershipFromRoom(this,a)},c.prototype.to=function(a){return this.broadcast.to(a)},c.prototype.in=function(){return this.to.apply(null,arguments)},c.prototype.dispatchEvent=function(a){for(var m=this,f=[],k=arguments.length-1;k-- >0;)f[k]=arguments[k+1];var w=a.type,b=this.listeners[w];if(!Array.isArray(b))return!1;b.forEach(function(B){f.length>0?B.apply(m,f):B.call(m,a.data?a.data:a)})},Object.defineProperties(c.prototype,d),c}(re);ae.CONNECTING=0,ae.OPEN=1,ae.CLOSING=2,ae.CLOSED=3;var Ye=function(i,c){return new ae(i,c)};Ye.connect=function(i,c){return Ye(i,c)};var Yn=function(i){return i.reduce(function(c,d){return c.indexOf(d)>-1?c:c.concat(d)},[])};function Nt(){return typeof window!="undefined"?window:typeof tt=="object"&&typeof Zs=="function"&&typeof he=="object"?he:this}var xt={mock:!0,verifyClient:null,selectProtocol:null},ze=function(i){function c(d,a){a===void 0&&(a=xt),i.call(this);var m=new Ze(d);m.pathname||(m.pathname="/"),this.url=m.toString(),this.originalWebSocket=null;var f=C.attachServer(this,this.url);if(!f)throw this.dispatchEvent(V({type:"error"})),new Error("A mock server is already listening on this url");this.options=Object.assign({},xt,a),this.options.mock&&this.mockWebsocket()}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c.prototype.mockWebsocket=function(){var d=Nt();this.originalWebSocket=d.WebSocket,d.WebSocket=A},c.prototype.restoreWebsocket=function(){var d=Nt();this.originalWebSocket!==null&&(d.WebSocket=this.originalWebSocket),this.originalWebSocket=null},c.prototype.stop=function(d){d===void 0&&(d=function(){}),this.options.mock&&this.restoreWebsocket(),C.removeServer(this.url),typeof d=="function"&&d()},c.prototype.on=function(d,a){this.addEventListener(d,a)},c.prototype.off=function(d,a){this.removeEventListener(d,a)},c.prototype.close=function(d){d===void 0&&(d={});var a=d.code,m=d.reason,f=d.wasClean,k=C.websocketsLookup(this.url);C.removeServer(this.url),k.forEach(function(w){w.readyState=A.CLOSED,w.dispatchEvent(G({type:"close",target:w.target,code:a||q.CLOSE_NORMAL,reason:m||"",wasClean:f}))}),this.dispatchEvent(G({type:"close"}),this)},c.prototype.emit=function(d,a,m){var f=this;m===void 0&&(m={});var k=m.websockets;k||(k=C.websocketsLookup(this.url));var w;typeof m!="object"||arguments.length>3?(a=Array.prototype.slice.call(arguments,1,arguments.length),w=a.map(function(b){return ve(b)})):w=ve(a),k.forEach(function(b){var B=b instanceof ae?a:w;Array.isArray(B)?b.dispatchEvent.apply(b,[fe({type:d,data:B,origin:f.url,target:b.target})].concat(B)):b.dispatchEvent(fe({type:d,data:B,origin:f.url,target:b.target}))})},c.prototype.clients=function(){return C.websocketsLookup(this.url)},c.prototype.to=function(d,a,m){var f=this;m===void 0&&(m=[]);var k=this,w=Yn(m.concat(C.websocketsLookup(this.url,d,a)));return{to:function(b,B){return f.to.call(f,b,B,w)},emit:function(b,B){k.emit(b,B,{websockets:w})}}},c.prototype.in=function(){for(var d=[],a=arguments.length;a--;)d[a]=arguments[a];return this.to.apply(null,d)},c.prototype.simulate=function(d){var a=C.websocketsLookup(this.url);d==="error"&&a.forEach(function(m){m.readyState=A.CLOSED,m.dispatchEvent(V({type:"error",target:m.target}))})},c}(re);ze.of=function(i){return new ze(i)};var zn=ze,Hn=A,Qn=Ye;n.Server=zn,n.WebSocket=Hn,n.SocketIO=Qn,Object.defineProperty(n,"__esModule",{value:!0})})})(Xs,we);var ut={},$s={get exports(){return ut},set exports(e){ut=e}},le=typeof Reflect=="object"?Reflect:null,Kt=le&&typeof le.apply=="function"?le.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ce;le&&typeof le.ownKeys=="function"?Ce=le.ownKeys:Object.getOwnPropertySymbols?Ce=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ce=function(e){return Object.getOwnPropertyNames(e)};function Ys(e){console&&console.warn&&console.warn(e)}var wn=Number.isNaN||function(e){return e!==e};function S(){S.init.call(this)}$s.exports=S;ut.once=er;S.EventEmitter=S;S.prototype._events=void 0;S.prototype._eventsCount=0;S.prototype._maxListeners=void 0;var Jt=10;function Ge(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return Jt},set:function(e){if(typeof e!="number"||e<0||wn(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Jt=e}});S.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};S.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||wn(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function yn(e){return e._maxListeners===void 0?S.defaultMaxListeners:e._maxListeners}S.prototype.getMaxListeners=function(){return yn(this)};S.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")Kt(p,this,t);else for(var h=p.length,T=Rn(p,h),n=0;n<h;++n)Kt(T[n],this,t);return!0};function bn(e,t,n,s){var r,o,l;if(Ge(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l=="function"?l=o[t]=s?[n,l]:[l,n]:s?l.unshift(n):l.push(n),r=yn(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=t,p.count=l.length,Ys(p)}return e}S.prototype.addListener=function(e,t){return bn(this,e,t,!1)};S.prototype.on=S.prototype.addListener;S.prototype.prependListener=function(e,t){return bn(this,e,t,!0)};function zs(){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 _n(e,t,n){var s={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=zs.bind(s);return r.listener=n,s.wrapFn=r,r}S.prototype.once=function(e,t){return Ge(t),this.on(e,_n(this,e,t)),this};S.prototype.prependOnceListener=function(e,t){return Ge(t),this.prependListener(e,_n(this,e,t)),this};S.prototype.removeListener=function(e,t){var n,s,r,o,l;if(Ge(t),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,r=o;break}if(r<0)return this;r===0?n.shift():Hs(n,r),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this};S.prototype.off=S.prototype.removeListener;S.prototype.removeAllListeners=function(e){var t,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var r=Object.keys(n),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(s=t.length-1;s>=0;s--)this.removeListener(e,t[s]);return this};function vn(e,t,n){var s=e._events;if(s===void 0)return[];var r=s[t];return r===void 0?[]:typeof r=="function"?n?[r.listener||r]:[r]:n?Qs(r):Rn(r,r.length)}S.prototype.listeners=function(e){return vn(this,e,!0)};S.prototype.rawListeners=function(e){return vn(this,e,!1)};S.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):En.call(e,t)};S.prototype.listenerCount=En;function En(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}S.prototype.eventNames=function(){return this._eventsCount>0?Ce(this._events):[]};function Rn(e,t){for(var n=new Array(t),s=0;s<t;++s)n[s]=e[s];return n}function Hs(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Qs(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function er(e,t){return new Promise(function(n,s){function r(l){e.removeListener(t,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),n([].slice.call(arguments))}On(e,t,o,{once:!0}),t!=="error"&&tr(e,r,{once:!0})})}function tr(e,t,n){typeof e.on=="function"&&On(e,"error",t,n)}function On(e,t,n,s){if(typeof e.on=="function")s.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function r(o){s.once&&e.removeEventListener(t,r),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}class nr extends u{constructor(){super("message.v1.SocketMessage",[{no:1,name:"event",kind:"scalar",T:13},{no:2,name:"id",kind:"scalar",opt:!0,T:9},{no:3,name:"payload",kind:"scalar",opt:!0,T:12},{no:4,name:"metadata",kind:"scalar",opt:!0,T:12}])}}const Zt=new nr;var Me;(function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER"})(Me||(Me={}));var lt;(function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO"})(lt||(lt={}));class sr extends u{constructor(){super("media.Codec",[{no:1,name:"channels",kind:"scalar",opt:!0,T:5},{no:2,name:"clock_rate",kind:"scalar",T:5},{no:3,name:"mime_type",kind:"scalar",T:9},{no:4,name:"sdp_fmtp_line",kind:"scalar",opt:!0,T:9},{no:5,name:"payload_type",kind:"scalar",opt:!0,T:13}])}}const Sn=new sr;class rr extends u{constructor(){super("media.HeaderExtension",[{no:1,name:"direction",kind:"scalar",opt:!0,T:9},{no:2,name:"uri",kind:"scalar",T:9}])}}const or=new rr;class ar extends u{constructor(){super("media.Fingerprint",[{no:1,name:"algorithm",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}])}}new ar;class ir extends u{constructor(){super("media.SessionDescription",[{no:1,name:"target",kind:"enum",T:()=>["media.Target",Me]},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"sdp",kind:"scalar",T:9}])}}const W=new ir;class cr extends u{constructor(){super("media.ProducerPayload",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"msid",kind:"scalar",T:9},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"mime_type",kind:"scalar",opt:!0,T:9}])}}const ur=new cr;class lr extends u{constructor(){super("media.CreateTransportRequest",[{no:1,name:"consuming",kind:"scalar",T:8},{no:2,name:"force_tcp",kind:"scalar",opt:!0,T:8},{no:3,name:"description",kind:"message",T:()=>W},{no:4,name:"private_ice",kind:"scalar",opt:!0,T:8},{no:5,name:"producers",kind:"message",repeat:1,T:()=>ur}])}}new lr;class dr extends u{constructor(){super("media.AudioActivityRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"energy",kind:"scalar",T:5},{no:3,name:"silent",kind:"scalar",T:8}])}}new dr;class pr extends u{constructor(){super("media.CreateTransportResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W},{no:3,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:4,name:"producer_ids",kind:"scalar",repeat:2,T:9}])}}const Nn=new pr;class mr extends u{constructor(){super("media.RenegotiateRequest",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W}])}}new mr;class fr extends u{constructor(){super("media.RenegotiateResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W}])}}new fr;class hr extends u{constructor(){super("media.NestedScore",[{no:1,name:"encoding_idx",kind:"scalar",T:5},{no:2,name:"rid",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5},{no:4,name:"ssrc",kind:"scalar",T:3,L:0}])}}const gr=new hr;class kr extends u{constructor(){super("media.ProducerTrack",[{no:1,name:"track_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9},{no:3,name:"stream_id",kind:"scalar",T:9}])}}const Tr=new kr;class wr extends u{constructor(){super("media.ProducerEntry",[{no:1,name:"producing_transport_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9}])}}new wr;class yr extends u{constructor(){super("media.ConsumerEntry",[{no:1,name:"consuming_transport_id",kind:"scalar",T:9},{no:2,name:"consumer_id",kind:"scalar",T:9}])}}new yr;class br extends u{constructor(){super("media.ProducerState",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"kind",kind:"enum",T:()=>["media.ProducerKind",lt]},{no:3,name:"pause",kind:"scalar",T:8},{no:4,name:"screen_share",kind:"scalar",T:8},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"producing_transport_id",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"codec",kind:"message",T:()=>Sn}])}}const be=new br;class _r extends u{constructor(){super("media.ConsumerState",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>be},{no:3,name:"producer_track",kind:"message",T:()=>Tr},{no:4,name:"error_code",kind:"scalar",opt:!0,T:9}])}}const vr=new _r;class Er extends u{constructor(){super("media.ProducerIdToConsumerMap",[{no:1,name:"map",kind:"map",K:9,V:{kind:"message",T:()=>vr}}])}}const xn=new Er;class Rr extends u{constructor(){super("media.PeerRtpCapabilitites",[{no:1,name:"sender",kind:"message",T:()=>$t},{no:2,name:"receiver",kind:"message",T:()=>$t}])}}const In=new Rr;class Or extends u{constructor(){super("media.RtpCapability",[{no:1,name:"codecs",kind:"message",repeat:1,T:()=>Sn},{no:2,name:"header_extensions",kind:"message",repeat:1,T:()=>or}])}}const Xt=new Or;class Sr extends u{constructor(){super("media.RtpCapabilitites",[{no:1,name:"audio",kind:"message",T:()=>Xt},{no:2,name:"video",kind:"message",T:()=>Xt}])}}const $t=new Sr;class Nr extends u{constructor(){super("media.PreferredCodec",[{no:1,name:"audio",kind:"scalar",opt:!0,T:9},{no:2,name:"video",kind:"scalar",opt:!0,T:9}])}}const xr=new Nr;class Ir extends u{constructor(){super("media.edge.GeoLocation",[{no:1,name:"latitude",kind:"scalar",T:2},{no:2,name:"longitude",kind:"scalar",T:2},{no:3,name:"region",kind:"scalar",opt:!0,T:9}])}}const Cr=new Ir;class Pr extends u{constructor(){super("media.edge.PeerJoinRequest",[{no:1,name:"display_name",kind:"scalar",opt:!0,T:9},{no:2,name:"prejoined",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:5,name:"preset",kind:"scalar",opt:!0,T:12},{no:6,name:"user_id",kind:"scalar",opt:!0,T:9},{no:7,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:8,name:"location",kind:"message",T:()=>Cr},{no:9,name:"capabilities",kind:"message",T:()=>In}])}}new Pr;class Lr extends u{constructor(){super("media.edge.PeerJoinCompleteRequest",[])}}new Lr;class Ar extends u{constructor(){super("media.edge.PeerLeaveRequest",[{no:1,name:"close_room",kind:"scalar",T:8}])}}new Ar;class Br extends u{constructor(){super("media.edge.ConsumeMultipleProducerRequest",[{no:1,name:"producer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8}])}}new Br;class Dr extends u{constructor(){super("media.edge.ConsumePeerRequest",[{no:1,name:"producing_peer_id",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8},{no:3,name:"producer_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preferred_codec",kind:"message",T:()=>xr},{no:5,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}const Mr=new Dr;class Fr extends u{constructor(){super("media.edge.ConsumePeersRequest",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Mr},{no:2,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Fr;class Ur extends u{constructor(){super("media.edge.ProducerCreateRequest",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"description",kind:"message",T:()=>W},{no:5,name:"msid",kind:"scalar",T:9},{no:6,name:"app_data",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new Ur;class qr extends u{constructor(){super("media.edge.SelectedPeersRequest",[])}}new qr;class Vr extends u{constructor(){super("media.edge.GlobalPeerPinningRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Vr;class Gr extends u{constructor(){super("media.edge.ProducerToggleRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new Gr;class jr extends u{constructor(){super("media.edge.ConsumerToggleRequest",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new jr;class Wr extends u{constructor(){super("media.edge.ProducerCloseRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W},{no:3,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new Wr;class Kr extends u{constructor(){super("media.edge.ConsumerCloseRequest",[{no:1,name:"consumer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"description",kind:"message",T:()=>W},{no:3,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Kr;class Jr extends u{constructor(){super("media.edge.KickPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Jr;class Zr extends u{constructor(){super("media.edge.KickAllPeersRequest",[{no:1,name:"propagate_kick_across_rooms",kind:"scalar",T:8}])}}new Zr;class Xr extends u{constructor(){super("media.edge.PeerDisplayNameEditRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new Xr;class $r extends u{constructor(){super("media.edge.HostMediaControlForPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"audio",kind:"scalar",T:8},{no:3,name:"video",kind:"scalar",T:8},{no:4,name:"scree_share",kind:"scalar",T:8}])}}new $r;class Yr extends u{constructor(){super("media.edge.HostMediaControlForAllPeerRequest",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8}])}}new Yr;class zr extends u{constructor(){super("media.edge.GetRoomStateResponse",[{no:1,name:"display_title",kind:"scalar",T:9},{no:2,name:"locked_mode",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"room_name",kind:"scalar",T:9},{no:5,name:"current_peer_id",kind:"scalar",T:9},{no:6,name:"is_recording",kind:"scalar",opt:!0,T:8},{no:7,name:"recorder_participant_id",kind:"scalar",opt:!0,T:9},{no:8,name:"pinned_peer_ids",kind:"scalar",repeat:2,T:9}])}}const Hr=new zr;class Qr extends u{constructor(){super("media.edge.ErrorResponse",[{no:1,name:"error_message",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:5}])}}new Qr;class eo extends u{constructor(){super("media.edge.EmptyResponse",[])}}new eo;class to extends u{constructor(){super("media.edge.RoomParticipants",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"producer_states",kind:"message",repeat:1,T:()=>be},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"user_id",kind:"scalar",opt:!0,T:9},{no:5,name:"capabilities",kind:"message",T:()=>In}])}}const Cn=new to;class no extends u{constructor(){super("media.edge.SelectedPeersResponse",[{no:1,name:"audio_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"compulsory_peers",kind:"scalar",repeat:2,T:9}])}}const so=new no;class ro extends u{constructor(){super("media.edge.SelectedPeersDiffEntry",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"priority",kind:"scalar",T:5}])}}const oo=new ro;class ao extends u{constructor(){super("media.edge.SelectedPeersDiffResponse",[{no:1,name:"entries",kind:"message",repeat:1,T:()=>oo}])}}new ao;class io extends u{constructor(){super("media.edge.PeerJoinResponse",[])}}new io;class co extends u{constructor(){super("media.edge.PeerJoinCompleteResponse",[{no:1,name:"room_state",kind:"message",T:()=>Hr},{no:2,name:"participants",kind:"message",repeat:1,T:()=>Cn},{no:3,name:"selected_peers",kind:"message",T:()=>so},{no:4,name:"max_preferred_streams",kind:"scalar",T:5}])}}const uo=new co;class lo extends u{constructor(){super("media.edge.PeerLeaveResponse",[{no:1,name:"closed",kind:"scalar",T:8}])}}new lo;class po extends u{constructor(){super("media.edge.ConsumeMultipleProducerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>xn}])}}new po;class mo extends u{constructor(){super("media.edge.ConsumePeerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>xn},{no:3,name:"description",kind:"message",T:()=>W}])}}new mo;class fo extends u{constructor(){super("media.edge.ProducerCreateResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"producer_id",kind:"scalar",T:9},{no:4,name:"description",kind:"message",T:()=>W}])}}const ho=new fo;class go extends u{constructor(){super("media.edge.ProducerScoreResponse",[{no:1,name:"responseid",kind:"scalar",T:9},{no:2,name:"score",kind:"message",T:()=>gr}])}}new go;class ko extends u{constructor(){super("media.edge.ActiveSpeakerResponse",[{no:1,name:"responsepeer_id",kind:"scalar",T:9},{no:2,name:"volume",kind:"scalar",T:5}])}}new ko;class To extends u{constructor(){super("media.edge.NoActiveSpeakerResponse",[])}}new To;class wo extends u{constructor(){super("media.edge.ProducerToggleResponse",[])}}new wo;class yo extends u{constructor(){super("media.edge.ConsumerToggleResponse",[])}}new yo;class bo extends u{constructor(){super("media.edge.ProducerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>W}])}}new bo;class _o extends u{constructor(){super("media.edge.ConsumerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>W}])}}new _o;class vo extends u{constructor(){super("media.edge.GlobalPeerPinningResponse",[])}}new vo;class Eo extends u{constructor(){super("media.edge.KickPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Eo;class Ro extends u{constructor(){super("media.edge.KickAllPeersResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Ro;class Oo extends u{constructor(){super("media.edge.HostMediaControlForPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Oo;class So extends u{constructor(){super("media.edge.HostMediaControlForAllPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new So;class No extends u{constructor(){super("media.edge.PeerDisplayNameEditResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new No;class xo extends u{constructor(){super("media.edge.PeerJoinBroadcastResponse",[{no:1,name:"participant",kind:"message",T:()=>Cn}])}}new xo;class Io extends u{constructor(){super("media.edge.TrackSubscriptionKind",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8}])}}const Yt=new Io;class Co extends u{constructor(){super("media.edge.TrackSubscription",[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"webcam",kind:"message",T:()=>Yt},{no:3,name:"screenshare",kind:"message",T:()=>Yt}])}}const Po=new Co;class Lo extends u{constructor(){super("media.edge.PeerProducingTransportCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"transport_details",kind:"message",T:()=>Nn},{no:3,name:"track_subscriptions",kind:"message",repeat:1,T:()=>Po}])}}new Lo;class Ao extends u{constructor(){super("media.edge.PeerProducerCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>be}])}}new Ao;class Bo extends u{constructor(){super("media.edge.PeerProducerToggleBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>be},{no:3,name:"initiator_participant_id",kind:"scalar",opt:!0,T:9}])}}new Bo;class Do extends u{constructor(){super("media.edge.PeerProducerCloseBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>be}])}}new Do;class Mo extends u{constructor(){super("media.edge.PeerLeaveBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Mo;class Fo extends u{constructor(){super("media.edge.GlobalPeerPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Fo;class Uo extends u{constructor(){super("media.edge.GlobalPeerUnPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Uo;class qo extends u{constructor(){super("media.edge.RecordingStartedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new qo;class Vo extends u{constructor(){super("media.edge.RecordingStoppedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Vo;class Go extends u{constructor(){super("media.edge.PeerDisplayNameEditBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new Go;class jo extends u{constructor(){super("media.edge.PeerPingRequestBroadcastResponse",[{no:1,name:"password",kind:"scalar",T:9}])}}new jo;class Wo extends u{constructor(){super("media.edge.MediaRoomTerminationBroadcastResponse",[{no:1,name:"reason",kind:"scalar",T:9}])}}new Wo;class Ko extends u{constructor(){super("socket.ai.MeetingTranscript",[{no:1,name:"meeting_id",kind:"scalar",T:9},{no:2,name:"transcript",kind:"scalar",T:9},{no:3,name:"is_partial",kind:"scalar",T:8}])}}new Ko;class Jo extends u{constructor(){super("socket.api.BaseSocketHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9}])}}new Jo;class Zo extends u{constructor(){super("socket.api.ErrorMessage",[{no:1,name:"code",kind:"scalar",opt:!0,T:5},{no:2,name:"message",kind:"scalar",T:9}])}}new Zo;var Fe;(function(e){e[e.BROWSER=0]="BROWSER",e[e.TRACK=1]="TRACK",e[e.COMPOSITE=2]="COMPOSITE"})(Fe||(Fe={}));var ye;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ON_STAGE=1]="ON_STAGE",e[e.APPROVED_STAGE=2]="APPROVED_STAGE",e[e.REQUESTED_STAGE=3]="REQUESTED_STAGE",e[e.OFF_STAGE=4]="OFF_STAGE"})(ye||(ye={}));var dt;(function(e){e[e.NONE=0]="NONE",e[e.RECORDER=1]="RECORDER",e[e.LIVESTREAMER=2]="LIVESTREAMER"})(dt||(dt={}));var pt;(function(e){e[e.PEERS=0]="PEERS",e[e.ROOMS=1]="ROOMS"})(pt||(pt={}));var mt;(function(e){e[e.HIVE=0]="HIVE",e[e.CHAT=1]="CHAT",e[e.PING=2]="PING"})(mt||(mt={}));class Xo extends u{constructor(){super("socket.room.PeerFlags",[{no:1,name:"preset_name",kind:"scalar",T:9},{no:2,name:"recorder_type",kind:"scalar",T:9},{no:3,name:"hidden_participant",kind:"scalar",T:8}])}}const $o=new Xo;class Yo extends u{constructor(){super("socket.room.Peer",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",ye,"STAGE_TYPE_"]},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:7,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:8,name:"waitlisted",kind:"scalar",T:8},{no:9,name:"flags",kind:"message",T:()=>$o}])}}const je=new Yo;class zo extends u{constructor(){super("socket.room.PeerInfoResponse",[{no:1,name:"peer",kind:"message",T:()=>je}])}}const zt=new zo;class Ho extends u{constructor(){super("socket.room.PeerStatusUpdate",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",ye,"STAGE_TYPE_"]}])}}new Ho;class Qo extends u{constructor(){super("socket.room.RoomPeersInfoRequest",[{no:1,name:"seach_query",kind:"scalar",T:9},{no:2,name:"limit",kind:"scalar",T:5},{no:3,name:"offset",kind:"scalar",T:5}])}}new Qo;class ea extends u{constructor(){super("socket.room.RoomPeersInfoResponse",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>je}])}}const ta=new ea;class na extends u{constructor(){super("socket.room.RoomPeerCountResponse",[{no:1,name:"count",kind:"scalar",T:4,L:2}])}}new na;class sa extends u{constructor(){super("socket.room.Room",[{no:1,name:"room_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:4,name:"created_at",kind:"scalar",T:4,L:2},{no:5,name:"active_recordings",kind:"message",repeat:1,T:()=>oa},{no:6,name:"room_uuid",kind:"scalar",opt:!0,T:9}])}}const Pn=new sa;class ra extends u{constructor(){super("socket.room.ActiveRecording",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Fe]},{no:3,name:"recording_status",kind:"scalar",T:9}])}}const oa=new ra;class aa extends u{constructor(){super("socket.room.RoomInfoResponse",[{no:1,name:"room",kind:"message",T:()=>Pn}])}}const ia=new aa;class ca extends u{constructor(){super("socket.room.GetPeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9}])}}new ca;class ua extends u{constructor(){super("socket.room.UpdatePeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9}])}}new ua;class la extends u{constructor(){super("socket.room.JoinRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>je},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:5,name:"use_hive",kind:"scalar",opt:!0,T:8},{no:6,name:"preset",kind:"scalar",opt:!0,T:12},{no:7,name:"capabilities",kind:"enum",repeat:1,T:()=>["socket.room.Capabilities",mt,"CAPABILITIES_"]},{no:8,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new la;class da extends u{constructor(){super("socket.room.LeaveRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>je},{no:2,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new da;class pa extends u{constructor(){super("socket.room.UpdateRoomInfoRequest",[{no:1,name:"room",kind:"message",T:()=>Pn}])}}new pa;class ma extends u{constructor(){super("socket.room.GetConnectedRoomsDumpRequest",[])}}new ma;class fa extends u{constructor(){super("socket.room.ServiceError",[{no:1,name:"message",kind:"scalar",opt:!0,T:9},{no:2,name:"code",kind:"scalar",opt:!0,T:9}])}}const yt=new fa;class ha extends u{constructor(){super("socket.room.ConnectedMeetingPeer",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:5,name:"display_picture_url",kind:"scalar",opt:!0,T:9}])}}const ga=new ha;class ka extends u{constructor(){super("socket.room.ConnectedMeetingDump",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>ga}])}}const Ht=new ka;class Ta extends u{constructor(){super("socket.room.GetConnectedRoomsDumpResponse",[{no:1,name:"parent_meeting",kind:"message",T:()=>Ht},{no:2,name:"meetings",kind:"message",repeat:1,T:()=>Ht}])}}const wa=new Ta;class ya extends u{constructor(){super("socket.room.CreateRoomRequestPayload",[{no:1,name:"title",kind:"scalar",opt:!0,T:9}])}}const ba=new ya;class _a extends u{constructor(){super("socket.room.CreateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>ba}])}}new _a;class va extends u{constructor(){super("socket.room.CreateRoomResponsePayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>yt}])}}const Ea=new va;class Ra extends u{constructor(){super("socket.room.CreateConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Ea}])}}new Ra;class Oa extends u{constructor(){super("socket.room.UpdateRoomRequestPayload",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}}const Sa=new Oa;class Na extends u{constructor(){super("socket.room.UpdateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Sa}])}}new Na;class xa extends u{constructor(){super("socket.room.DisableRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9}])}}const Ia=new xa;class Ca extends u{constructor(){super("socket.room.DisableConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Ia}])}}new Ca;class Pa extends u{constructor(){super("socket.room.DisableConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Aa}])}}new Pa;class La extends u{constructor(){super("socket.room.DisableConnectedRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"status",kind:"scalar",opt:!0,T:9},{no:3,name:"title",kind:"scalar",opt:!0,T:9},{no:4,name:"error",kind:"message",T:()=>yt}])}}const Aa=new La;class Ba extends u{constructor(){super("socket.room.MovePeerPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"preset_id",kind:"scalar",opt:!0,T:9}])}}const Da=new Ba;class Ma extends u{constructor(){super("socket.room.MovePeersBetweenRoomsRequest",[{no:1,name:"source_meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"destination_meeting_id",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>Da}])}}new Ma;class Fa extends u{constructor(){super("socket.room.MovedPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>yt}])}}const Ua=new Fa;class qa extends u{constructor(){super("socket.room.MovePeersBetweenRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Ua}])}}new qa;class Va extends u{constructor(){super("socket.room.TransferPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"auth_token",kind:"scalar",opt:!0,T:9}])}}new Va;class Ga extends u{constructor(){super("socket.room.GetAllAddedParticipantsResponse",[{no:1,name:"participants",kind:"message",repeat:1,T:()=>Wa}])}}new Ga;class ja extends u{constructor(){super("socket.room.AddedParticipant",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const Wa=new ja;class Ka extends u{constructor(){super("socket.room.RemoveParticipantsRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Ka;class Ja extends u{constructor(){super("socket.room.BroadcastMessage",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"timestamp",kind:"scalar",T:4,L:2},{no:4,name:"ids",kind:"scalar",repeat:2,T:9},{no:5,name:"broadcast_type",kind:"enum",opt:!0,T:()=>["socket.room.BroadcastType",pt,"BROADCAST_TYPE_"]}])}}new Ja;class Za extends u{constructor(){super("socket.room.AcceptWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Za;class Xa extends u{constructor(){super("socket.room.DenyWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Xa;class $a extends u{constructor(){super("socket.room.WaitingRoomRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"picture",kind:"scalar",opt:!0,T:9},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_name",kind:"scalar",opt:!0,T:9}])}}const Ya=new $a;class za extends u{constructor(){super("socket.room.GetWaitingRoomRequests",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Ya}])}}new za;class Ha extends u{constructor(){super("socket.room.GetRoomStageStateResponse",[{no:1,name:"on_stage_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"approved_stage_peers",kind:"scalar",repeat:2,T:9},{no:3,name:"requested_stage_peers",kind:"scalar",repeat:2,T:9}])}}new Ha;var ft;(function(e){e[e.NONE=0]="NONE",e[e.SKIP=1]="SKIP",e[e.ON_PRIVILEGED_USER_ENTRY=2]="ON_PRIVILEGED_USER_ENTRY",e[e.SKIP_ON_ACCEPT=3]="SKIP_ON_ACCEPT"})(ft||(ft={}));var Ue;(function(e){e[e.NONE=0]="NONE",e[e.ALLOWED=1]="ALLOWED",e[e.NOT_ALLOWED=2]="NOT_ALLOWED",e[e.CAN_REQUEST=3]="CAN_REQUEST"})(Ue||(Ue={}));class Qa extends u{constructor(){super("socket.preset.PollsPermissionUpdate",[{no:1,name:"can_create",kind:"scalar",opt:!0,T:8},{no:2,name:"can_vote",kind:"scalar",opt:!0,T:8},{no:3,name:"can_view",kind:"scalar",opt:!0,T:8}])}}const ei=new Qa;class ti extends u{constructor(){super("socket.preset.PluginsPermissionsUpdate",[{no:1,name:"can_close",kind:"scalar",opt:!0,T:8},{no:2,name:"can_start",kind:"scalar",opt:!0,T:8}])}}const ni=new ti;class si extends u{constructor(){super("socket.preset.PublicChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"text",kind:"scalar",opt:!0,T:8},{no:3,name:"files",kind:"scalar",opt:!0,T:8}])}}const ri=new si;class oi extends u{constructor(){super("socket.preset.PrivateChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"can_receive",kind:"scalar",opt:!0,T:8},{no:3,name:"text",kind:"scalar",opt:!0,T:8},{no:4,name:"files",kind:"scalar",opt:!0,T:8}])}}const ai=new oi;class ii extends u{constructor(){super("socket.preset.ChatPermissionUpdate",[{no:1,name:"public",kind:"message",T:()=>ri},{no:2,name:"private",kind:"message",T:()=>ai}])}}const ci=new ii;class ui extends u{constructor(){super("socket.preset.ConnectedMeetingPermissionUpdate",[{no:1,name:"can_alter_connected_meetings",kind:"scalar",opt:!0,T:8},{no:2,name:"can_switch_to_parent_meeting",kind:"scalar",opt:!0,T:8},{no:3,name:"can_switch_connected_meetings",kind:"scalar",opt:!0,T:8}])}}const li=new ui;class di extends u{constructor(){super("socket.preset.StreamPermission",[{no:1,name:"can_produce",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ue,"STREAM_PERMISSION_TYPE_"]},{no:2,name:"can_consume",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ue,"STREAM_PERMISSION_TYPE_"]}])}}const nt=new di;class pi extends u{constructor(){super("socket.preset.MediaPermissionUpdate",[{no:1,name:"video",kind:"message",T:()=>nt},{no:2,name:"audio",kind:"message",T:()=>nt},{no:3,name:"screenshare",kind:"message",T:()=>nt}])}}const mi=new pi;class fi extends u{constructor(){super("socket.preset.PresetUpdates",[{no:1,name:"polls",kind:"message",T:()=>ei},{no:2,name:"plugins",kind:"message",T:()=>ni},{no:3,name:"chat",kind:"message",T:()=>ci},{no:4,name:"accept_waiting_requests",kind:"scalar",opt:!0,T:8},{no:5,name:"can_accept_production_requests",kind:"scalar",opt:!0,T:8},{no:6,name:"can_edit_display_name",kind:"scalar",opt:!0,T:8},{no:7,name:"can_record",kind:"scalar",opt:!0,T:8},{no:8,name:"can_livestream",kind:"scalar",opt:!0,T:8},{no:9,name:"can_spotlight",kind:"scalar",opt:!0,T:8},{no:10,name:"disable_participant_audio",kind:"scalar",opt:!0,T:8},{no:11,name:"disable_participant_screensharing",kind:"scalar",opt:!0,T:8},{no:12,name:"disable_participant_video",kind:"scalar",opt:!0,T:8},{no:13,name:"kick_participant",kind:"scalar",opt:!0,T:8},{no:14,name:"pin_participant",kind:"scalar",opt:!0,T:8},{no:15,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:16,name:"waiting_room_type",kind:"enum",opt:!0,T:()=>["socket.preset.WaitingRoomType",ft,"WAITING_ROOM_TYPE_"]},{no:17,name:"is_recorder",kind:"scalar",opt:!0,T:8},{no:18,name:"recorder_type",kind:"enum",opt:!0,T:()=>["socket.room.RecorderType",dt,"RECORDER_TYPE_"]},{no:19,name:"hidden_participant",kind:"scalar",opt:!0,T:8},{no:20,name:"show_participant_list",kind:"scalar",opt:!0,T:8},{no:21,name:"can_change_participant_permissions",kind:"scalar",opt:!0,T:8},{no:22,name:"connected_meetings",kind:"message",T:()=>li},{no:23,name:"media",kind:"message",T:()=>mi}])}}const bt=new fi;class hi extends u{constructor(){super("socket.preset.ReadPeersPresetRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new hi;class gi extends u{constructor(){super("socket.preset.PeerPreset",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"preset",kind:"scalar",T:12}])}}const ki=new gi;class Ti extends u{constructor(){super("socket.preset.ReadPeersPresetResponse",[{no:1,name:"peer_presets",kind:"message",repeat:1,T:()=>ki}])}}new Ti;class wi extends u{constructor(){super("socket.preset.UpdatePeerPreset",[{no:1,name:"user_ids",kind:"scalar",T:9},{no:2,name:"patch",kind:"message",T:()=>bt}])}}const Ln=new wi;class yi extends u{constructor(){super("socket.preset.UpdatePeersPresetRequest",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>Ln}])}}new yi;class bi extends u{constructor(){super("socket.preset.UpdatePeersPresetResponse",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>Ln}])}}new bi;class _i extends u{constructor(){super("socket.preset.PeerUserIDMap",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}])}}const vi=new _i;class Ei extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetRequest",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>vi},{no:2,name:"patch",kind:"message",T:()=>bt}])}}new Ei;class Ri extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetResponse",[{no:2,name:"patch",kind:"message",T:()=>bt}])}}new Ri;class Oi extends u{constructor(){super("socket.chat.ChatMessage",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"user_id",kind:"scalar",T:9},{no:4,name:"display_name",kind:"scalar",T:9},{no:5,name:"pinned",kind:"scalar",T:8},{no:6,name:"is_edited",kind:"scalar",T:8},{no:7,name:"payload_type",kind:"scalar",T:5},{no:8,name:"payload",kind:"scalar",T:9},{no:10,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:11,name:"created_at",kind:"scalar",T:4,L:2},{no:12,name:"created_at_ms",kind:"scalar",opt:!0,T:4,L:2},{no:13,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:14,name:"channel_index",kind:"scalar",opt:!0,T:9}])}}const ne=new Oi;class Si extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Si;class Ni extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>ne},{no:2,name:"next",kind:"scalar",T:8}])}}new Ni;class xi extends u{constructor(){super("socket.chat.GetChatMessagesResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>ne}])}}new xi;class Ii extends u{constructor(){super("socket.chat.SendChatMessageToRoomRequest",[{no:1,name:"payload_type",kind:"scalar",T:5},{no:2,name:"payload",kind:"scalar",T:9}])}}new Ii;class Ci extends u{constructor(){super("socket.chat.SendChatMessageToRoomResponse",[{no:1,name:"message",kind:"message",T:()=>ne}])}}new Ci;class Pi extends u{constructor(){super("socket.chat.SendChatMessageToPeersRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new Pi;class Li extends u{constructor(){super("socket.chat.SendChatMessageToPeersResponse",[{no:1,name:"message",kind:"message",T:()=>ne}])}}new Li;class Ai extends u{constructor(){super("socket.chat.SendChatMessageToChannelRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new Ai;class Bi extends u{constructor(){super("socket.chat.SendChatMessageToChannelResponse",[{no:1,name:"message",kind:"message",T:()=>ne}])}}new Bi;class Di extends u{constructor(){super("socket.chat.EditChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",opt:!0,T:5},{no:3,name:"payload",kind:"scalar",opt:!0,T:9},{no:4,name:"pinned",kind:"scalar",opt:!0,T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Di;class Mi extends u{constructor(){super("socket.chat.PinChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Mi;class Fi extends u{constructor(){super("socket.chat.PinChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Fi;class Ui extends u{constructor(){super("socket.chat.EditChatMessageResponse",[{no:1,name:"message",kind:"message",T:()=>ne}])}}new Ui;class qi extends u{constructor(){super("socket.chat.DeleteChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new qi;class Vi extends u{constructor(){super("socket.chat.DeleteChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Vi;class Gi extends u{constructor(){super("socket.chat.SearchChatMessagesRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:6,name:"search_term",kind:"scalar",T:9}])}}new Gi;class ji extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"channel_index",kind:"scalar",T:9}])}}new ji;class Wi extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadResponse",[{no:1,name:"channel_index",kind:"scalar",T:9}])}}new Wi;class Ki extends u{constructor(){super("socket.chat.CreateChatChannelRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8}])}}new Ki;class Ji extends u{constructor(){super("socket.chat.UpdateChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:4,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"scalar",opt:!0,T:9},{no:6,name:"is_direct_message",kind:"scalar",opt:!0,T:8}])}}new Ji;class Zi extends u{constructor(){super("socket.chat.CreateChatChannelResponse",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Zi;class Xi extends u{constructor(){super("socket.chat.GetChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Xi;class $i extends u{constructor(){super("socket.chat.LatestMessageAndUnreadCount",[{no:1,name:"message",kind:"message",T:()=>ne},{no:2,name:"unread_count",kind:"scalar",T:4,L:2}])}}const Yi=new $i;class zi extends u{constructor(){super("socket.chat.ChatChannel",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8},{no:6,name:"latest_message_and_unread_count",kind:"message",T:()=>Yi},{no:7,name:"target_user_ids",kind:"scalar",repeat:2,T:9}])}}const Hi=new zi;class Qi extends u{constructor(){super("socket.chat.GetChatChannelResponse",[{no:1,name:"chat_channels",kind:"message",repeat:1,T:()=>Hi}])}}new Qi;class ec extends u{constructor(){super("socket.chat.ChannelMember",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const tc=new ec;class nc extends u{constructor(){super("socket.chat.GetChatChannelMembersResponse",[{no:1,name:"channel_members",kind:"message",repeat:1,T:()=>tc}])}}new nc;class sc extends u{constructor(){super("socket.plugin.AddPluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new sc;class rc extends u{constructor(){super("socket.plugin.RemovePluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new rc;class oc extends u{constructor(){super("socket.plugin.EnablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new oc;class ac extends u{constructor(){super("socket.plugin.DisablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new ac;class ic extends u{constructor(){super("socket.plugin.EnablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new ic;class cc extends u{constructor(){super("socket.plugin.DisablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new cc;class uc extends u{constructor(){super("socket.plugin.PluginEventToRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new uc;class lc extends u{constructor(){super("socket.plugin.PluginEventToPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"plugin_data",kind:"scalar",T:12}])}}new lc;class dc extends u{constructor(){super("socket.plugin.StoreKeys",[{no:1,name:"store_key",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",opt:!0,T:12}])}}const _t=new dc;class pc extends u{constructor(){super("socket.plugin.PluginStoreInsertKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"insert_keys",kind:"message",repeat:1,T:()=>_t}])}}new pc;class mc extends u{constructor(){super("socket.plugin.PluginStoreGetKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"get_keys",kind:"message",repeat:1,T:()=>_t}])}}new mc;class fc extends u{constructor(){super("socket.plugin.PluginStoreDeleteKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"delete_keys",kind:"message",repeat:1,T:()=>_t}])}}new fc;class hc extends u{constructor(){super("socket.plugin.PluginStoreDeleteRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9}])}}new hc;class gc extends u{constructor(){super("socket.plugin.EnablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"enabled_by",kind:"scalar",T:9}])}}const kc=new gc;class Tc extends u{constructor(){super("socket.plugin.EnablePluginsResponse",[{no:1,name:"plugins",kind:"message",repeat:1,T:()=>kc}])}}new Tc;class wc extends u{constructor(){super("socket.plugin.DisablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"disabled_by",kind:"scalar",T:9}])}}new wc;class yc extends u{constructor(){super("socket.plugin.PluginStoreItem",[{no:1,name:"timestamp",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"store_key",kind:"scalar",T:9},{no:4,name:"payload",kind:"scalar",T:12}])}}const bc=new yc;class _c extends u{constructor(){super("socket.plugin.PluginStoreResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"store_items",kind:"message",repeat:1,T:()=>bc}])}}new _c;class vc extends u{constructor(){super("socket.plugin.PluginEventResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new vc;class Ec extends u{constructor(){super("socket.livestreaming.LiveStreamingEvent",[{no:1,name:"livestream_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",T:9},{no:5,name:"playback_url",kind:"scalar",T:9},{no:6,name:"org_id",kind:"scalar",T:9},{no:7,name:"room_name",kind:"scalar",T:9},{no:8,name:"room_uuid",kind:"scalar",T:9},{no:9,name:"status",kind:"scalar",T:9},{no:10,name:"manual_ingest",kind:"scalar",opt:!0,T:8}])}}new Ec;class Rc extends u{constructor(){super("socket.livestreaming.GetStagePeersResponse",[{no:1,name:"stage_peers",kind:"scalar",repeat:2,T:9}])}}new Rc;class Oc extends u{constructor(){super("socket.livestreaming.StageRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9}])}}const Sc=new Oc;class Nc extends u{constructor(){super("socket.livestreaming.GetStageRequestsResponse",[{no:1,name:"stage_requests",kind:"message",repeat:1,T:()=>Sc}])}}new Nc;class xc extends u{constructor(){super("socket.livestreaming.GrantStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new xc;class Ic extends u{constructor(){super("socket.livestreaming.DenyStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Ic;class Cc extends u{constructor(){super("socket.livestreaming.LeaveStageRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Cc;class Pc extends u{constructor(){super("socket.polls.Poll",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"created_by",kind:"scalar",T:9},{no:3,name:"created_by_user_id",kind:"scalar",T:9},{no:4,name:"question",kind:"scalar",T:9},{no:5,name:"options",kind:"message",repeat:1,T:()=>Ac},{no:6,name:"hide_votes",kind:"scalar",T:8},{no:7,name:"anonymous",kind:"scalar",T:8},{no:8,name:"votes",kind:"scalar",repeat:2,T:9}])}}const An=new Pc;class Lc extends u{constructor(){super("socket.polls.PollOption",[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"count",kind:"scalar",opt:!0,T:4,L:2},{no:3,name:"votes",kind:"message",repeat:1,T:()=>Dc}])}}const Ac=new Lc;class Bc extends u{constructor(){super("socket.polls.PollVote",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}])}}const Dc=new Bc;class Mc extends u{constructor(){super("socket.polls.NewPollRequest",[{no:1,name:"question",kind:"scalar",T:9},{no:2,name:"options",kind:"scalar",repeat:2,T:9},{no:3,name:"anonymous",kind:"scalar",T:8},{no:4,name:"hide_votes",kind:"scalar",T:8},{no:5,name:"created_by",kind:"scalar",opt:!0,T:9},{no:6,name:"created_by_user_id",kind:"scalar",opt:!0,T:9}])}}new Mc;class Fc extends u{constructor(){super("socket.polls.VotePollRequest",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"index",kind:"scalar",T:4,L:2}])}}new Fc;class Uc extends u{constructor(){super("socket.polls.UpdatePollResponse",[{no:1,name:"poll",kind:"message",T:()=>An}])}}new Uc;class qc extends u{constructor(){super("socket.polls.GetPollsResponse",[{no:1,name:"polls",kind:"message",repeat:1,T:()=>An}])}}new qc;class Vc extends u{constructor(){super("socket.recording.RecordingEvent",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Fe]}])}}new Vc;class Gc extends u{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const t=this.create(),n=Date.now();return t.seconds=x.from(Math.floor(n/1e3)).toBigInt(),t.nanos=n%1e3*1e6,t}toDate(t){return new Date(x.from(t.seconds).toNumber()*1e3+Math.ceil(t.nanos/1e6))}fromDate(t){const n=this.create(),s=t.getTime();return n.seconds=x.from(Math.floor(s/1e3)).toBigInt(),n.nanos=s%1e3*1e6,n}internalJsonWrite(t,n){let s=x.from(t.seconds).toNumber()*1e3;if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(t.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let r="Z";if(t.nanos>0){let o=(t.nanos+1e9).toString().substring(1);o.substring(3)==="000000"?r="."+o.substring(0,3)+"Z":o.substring(6)==="000"?r="."+o.substring(0,6)+"Z":r="."+o+"Z"}return new Date(s).toISOString().replace(".000Z",r)}internalJsonRead(t,n,s){if(typeof t!="string")throw new Error("Unable to parse Timestamp from JSON "+Tt(t)+".");let r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let o=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(o))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(o<Date.parse("0001-01-01T00:00:00Z")||o>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return s||(s=this.create()),s.seconds=x.from(o/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}}new Gc;class jc extends u{constructor(){super("common.BaseHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9},{no:9,name:"room_object_id",kind:"scalar",opt:!0,T:9},{no:10,name:"preset",kind:"scalar",opt:!0,T:9}])}}const ht=new jc;class Wc extends u{constructor(){super("common.BulkedHubMessage",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>ht}])}}new Wc;class Kc extends u{constructor(){super("common.CFWorkersResponse",[{no:1,name:"responses",kind:"message",repeat:1,T:()=>ht},{no:2,name:"broadcast_responses",kind:"message",repeat:1,T:()=>ht}])}}new Kc;const Jc=0,Zc=1,Xc=2,$c=3,Yc=4,zc=5,Hc={getPeerInfo:0,updatePeerInfo:1,getRoomPeersInfo:2,joinRoom:3,leaveRoom:4,getRoomInfo:5,updateRoomInfo:6,closeRoom:7,startedLivestream:8,stoppedLivestream:9,erroredLivestream:10,getStagePeers:11,getStageRequests:12,requestStageAccess:13,cancelStageRequest:14,grantStageAccess:15,denyStageAccess:16,roomPeerCount:17,joinStage:18,leaveStage:19,getConnectedRoomsDump:20,createConnectedRooms:21,deleteConnectedRooms:22,movePeers:23,transferPeer:24,movedPeer:25,connectedRoomsUpdated:26,connectedRoomsDeleted:27,getAllAddedParticipants:28,broadcastMessage:29,kick:30,kickAll:31,transcript:32,getWaitingRoomRequests:33,acceptWaitingRoomRequests:34,waitingRoomRequestAccepted:35,denyWaitingRoomRequests:36,waitingRoomRequestDenied:37,peerStageStatusUpdate:38,broadcastToEntity:39,recordingStarted:40,recordingStopped:41,recordingPaused:42,getRoomStageState:43,livestreamingInvoked:44},Qc={getMessages:0,sendMessageToRoom:1,sendMessageToPeers:2,editMessage:3,deleteMessage:4,getPaginatedMessages:5,sendMessageToChannel:6,searchChannelMessages:7,getAllChatChannels:8,markChannelIndexAsRead:9,pinMessage:10},eu={getPlugins:0,addPlugin:1,enablePluginForRoom:2,disablePluginForPeers:3,enablePluginForPeers:4,disablePluginForRoom:5,removePlugin:6,customPluginEventToRoom:7,customPluginEventToPeers:8,storeInsertKeys:9,storeGetKeys:10,storeDeleteKeys:11,storeDelete:12},tu={createPoll:0,getPolls:1,votePoll:2,updatePoll:3},Bn={unknown:0,createWebRTCTransport:1,produce:2,consume:3,toggleProducer:4,toggleConsumer:5,closeProducer:6,closeConsumer:7,joinRoom:16,leaveRoom:17,selectedPeer:18,globalPinPeer:19,selfJoinComplete:20,peerJoinedBroadcast:25,peerLeaveBroadcast:26,peerProducerCreateBroadcast:27,peerProducerToggleBroadcast:28,peerProducerCloseBroadcast:29,globalPeerPinBroadcast:30,recordingStartedBroadcast:31,recordingStoppedBroadcast:32,peerDisplayNameEditBroadcast:33,mediaRoomTerminationBroadcastResponse:36,selectedPeerDiff:40,renegotiateSessionDescription:50,errorResponse:60,kickPeer:90,kickAll:91,changeDisplayName:92,hostControlPeer:93,hostControlAllPeers:94,audioActivity:100},nu={createChatChannel:0,getChatChannel:1,deprecatedGetAllChatChannels:2,getChannelMembers:3,updateChatChannel:4},su={getUserPresets:0,updateUserPreset:1};function de(e,t){return Object.keys(t).reduce((n,s)=>(n[s]=(e<<16)+t[s],n),{})}function Dn(e,t){return Object.keys(e).reduce((n,s)=>(n[s]=t|e[s],n),{})}const Se=de(Jc,Hc);de(Zc,Qc);de(Xc,eu);de($c,tu);de(Yc,nu);const st=Dn(Bn,16777216);Dn(Bn,50331648);de(zc,su);const Mn="ws://localhost:8080/ws";class ru extends we.WebSocket{constructor(t,n){super(Mn,n)}}var ge,gt,ke,kt;class ou{constructor(){Oe(this,ge,void 0),Oe(this,gt,[]),Oe(this,ke,void 0),Oe(this,kt,15e3),R(this,"roomId","roomId"),R(this,"roomUuid","roomUuid"),R(this,"cleanBuffer",t=>t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}init({peerId:t,mockParticipants:n}){Vt(this,ke,t),window.WebSocket=ru,Vt(this,ge,n);const{RTK_MOCK_SERVER:s}=window;if(s)try{s.close()}catch(o){}const r=new we.Server(Mn,{mock:!1});window.RTK_MOCK_SERVER=r,r.on("connection",o=>{ie(this,gt).push(o),this.addConnectionListeners(o)})}addConnectionListeners(t){t.on("message",n=>{if(n==="3")return;const s=Zt.fromBinary(n);let r;switch(s.event){case Se.joinRoom:{r=zt.toBinary(zt.fromJson({peer:{peerId:ie(this,ke),userId:"self-userId",displayName:"name",waitlisted:!1,stageType:ye.ON_STAGE}}));break}case Se.getRoomPeersInfo:{r=ta.toBinary({peers:ie(this,ge).map(h=>Ps(qt({},h),{userId:h.peerId,waitlisted:!1,stageType:1}))});break}case Se.getRoomInfo:{r=ia.toBinary({room:{roomId:this.roomId,title:"title",createdAt:Date.now(),activeRecordings:[],roomUuid:this.roomUuid}});break}case st.createWebRTCTransport:{r=Nn.toBinary({transportId:"transportId",description:{type:"answer",sdp:"sdp",target:Me.PUBLISHER},producerIds:[]});break}case st.selfJoinComplete:{const h=ie(this,ge).map(T=>qt({producerStates:[]},T));r=uo.toBinary({maxPreferredStreams:6,participants:h,selectedPeers:{audioPeers:[],compulsoryPeers:[]},roomState:{displayTitle:"title",lockedMode:!1,roomUuid:this.roomUuid,roomName:this.roomUuid,currentPeerId:ie(this,ke),pinnedPeerIds:[]}});break}case Se.getConnectedRoomsDump:{r=wa.toBinary({parentMeeting:{participants:[]},meetings:[]});break}case st.produce:{r=ho.toBinary({status:!0,producerId:"producer-id"});break}}const o={event:s.event,id:s.id,payload:r},l=Zt.toBinary(o),p=this.cleanBuffer(l);t.send(p)}),setInterval(()=>{t.send("2")},ie(this,kt))}}ge=new WeakMap,gt=new WeakMap,ke=new WeakMap,kt=new WeakMap;function au(e){new ou().init(e),window.RTCPeerConnection=Gs,window.fetch=()=>Ls(this,null,function*(){const t=new window.Response(JSON.stringify({}),{status:200,headers:{"Content-type":"application/json"}});return Promise.resolve(t)})}exports.setupStubs=au;
7
+ `,Kn={track:null,transport:null,rtcpTransport:null,dtmf:{insertDTMF:()=>{},ontonechange:null,canInsertDTMF:!1,toneBuffer:"",addEventListener:()=>{},removeEventListener:()=>{},dispatchEvent:()=>!0},transform:null,mid:null,getParameters:()=>({}),setParameters:()=>Promise.resolve({}),replaceTrack:()=>Promise.resolve({}),getStats:()=>Promise.resolve(new Map),setStreams:()=>{},setTransform:()=>Promise.resolve()};class js extends De{constructor(){super(),R(this,"localDescription",null),R(this,"remoteDescription",null),R(this,"currentLocalDescription",null),R(this,"currentRemoteDescription",null),R(this,"pendingLocalDescription",null),R(this,"pendingRemoteDescription",null),R(this,"signalingState","stable"),R(this,"iceConnectionState","new"),R(this,"iceGatheringState","new"),R(this,"connectionState","new"),R(this,"canTrickleIceCandidates",null),R(this,"sctp",null),R(this,"senders",[]),R(this,"receivers",[]),R(this,"transceivers",[]),R(this,"onicecandidate",null),R(this,"onicecandidateerror",null),R(this,"onconnectionstatechange",null),R(this,"oniceconnectionstatechange",null),R(this,"onicegatheringstatechange",null),R(this,"onsignalingstatechange",null),R(this,"onnegotiationneeded",null),R(this,"ontrack",null),R(this,"ondatachannel",null),R(this,"addEventListener"),R(this,"removeEventListener"),this.addEventListener=this.addListener,this.removeEventListener=this.removeListener}createOffer(){return Promise.resolve({sdp:Gs,type:"offer"})}createAnswer(){return Promise.resolve({})}setLocalDescription(){return this.iceConnectionState="connected",this.iceGatheringState="complete",this.connectionState="connected",this.signalingState="stable",this.emit("iceconnectionstatechange"),Promise.resolve()}setRemoteDescription(){return Promise.resolve()}addIceCandidate(){return Promise.resolve()}getStats(){return Promise.resolve(new Map)}getConfiguration(){return{}}setConfiguration(){}close(){}createDataChannel(){return{close:()=>{},send:()=>{}}}addTrack(){return Kn}removeTrack(){}addTransceiver(){return{stop:()=>{},setDirection:()=>{},setCodecPreferences:()=>{},sender:Kn}}getTransceivers(){return[]}getSenders(){return[]}getReceivers(){return[]}restartIce(){}static generateCertificate(){return Promise.resolve({expires:Date.now(),getFingerprints:()=>[]})}}function Ws(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ht={exports:{}},L=ht.exports={},Z,X;function cn(){throw new Error("setTimeout has not been defined")}function un(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Z=setTimeout:Z=cn}catch(e){Z=cn}try{typeof clearTimeout=="function"?X=clearTimeout:X=un}catch(e){X=un}})();function gt(e){if(Z===setTimeout)return setTimeout(e,0);if((Z===cn||!Z)&&setTimeout)return Z=setTimeout,setTimeout(e,0);try{return Z(e,0)}catch(n){try{return Z.call(null,e,0)}catch(t){return Z.call(this,e,0)}}}function Ks(e){if(X===clearTimeout)return clearTimeout(e);if((X===un||!X)&&clearTimeout)return X=clearTimeout,clearTimeout(e);try{return X(e)}catch(n){try{return X.call(null,e)}catch(t){return X.call(this,e)}}}var H=[],ue=!1,ne,Ie=-1;function Js(){!ue||!ne||(ue=!1,ne.length?H=ne.concat(H):Ie=-1,H.length&&kt())}function kt(){if(!ue){var e=gt(Js);ue=!0;for(var n=H.length;n;){for(ne=H,H=[];++Ie<n;)ne&&ne[Ie].run();Ie=-1,n=H.length}ne=null,ue=!1,Ks(e)}}L.nextTick=function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];H.push(new Tt(e,n)),H.length===1&&!ue&&gt(kt)};function Tt(e,n){this.fun=e,this.array=n}Tt.prototype.run=function(){this.fun.apply(null,this.array)};L.title="browser";L.browser=!0;L.env={};L.argv=[];L.version="";L.versions={};function Q(){}L.on=Q;L.addListener=Q;L.once=Q;L.off=Q;L.removeListener=Q;L.removeAllListeners=Q;L.emit=Q;L.prependListener=Q;L.prependOnceListener=Q;L.listeners=function(e){return[]};L.binding=function(e){throw new Error("process.binding is not supported")};L.cwd=function(){return"/"};L.chdir=function(e){throw new Error("process.chdir is not supported")};L.umask=function(){return 0};var Zs=ht.exports;const nn=Ws(Zs);function Xs(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var we={},$s={get exports(){return we},set exports(e){we=e}};(function(e,n){(function(t,s){s(n)})(he,function(t){var s=typeof window!="undefined"?window:typeof he!="undefined"?he:typeof self!="undefined"?self:{},r=function(i,c){if(c=c.split(":")[0],i=+i,!i)return!1;switch(c){case"http":case"ws":return i!==80;case"https":case"wss":return i!==443;case"ftp":return i!==21;case"gopher":return i!==70;case"file":return!1}return i!==0},o=Object.prototype.hasOwnProperty,l;function p(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch(c){return null}}function h(i){try{return encodeURIComponent(i)}catch(c){return null}}function T(i){for(var c=/([^=?#&]+)=?([^&]*)/g,d={},a;a=c.exec(i);){var m=p(a[1]),f=p(a[2]);m===null||f===null||m in d||(d[m]=f)}return d}function b(i,c){c=c||"";var d=[],a,m;typeof c!="string"&&(c="?");for(m in i)if(o.call(i,m)){if(a=i[m],!a&&(a===null||a===l||isNaN(a))&&(a=""),m=h(m),a=h(a),m===null||a===null)continue;d.push(m+"="+a)}return d.length?c+d.join("&"):""}var I=b,v=T,D={stringify:I,parse:v},U=/[\n\r\t]/g,We=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,se=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,pe=/^[a-zA-Z]:/,Ut=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;function Ke(i){return(i||"").toString().replace(Ut,"")}var Je=[["#","hash"],["?","query"],function(i,c){return K(c.protocol)?i.replace(/\\/g,"/"):i},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],En={hash:1,query:1};function Rn(i){var c;typeof window!="undefined"?c=window:typeof s!="undefined"?c=s:typeof self!="undefined"?c=self:c={};var d=c.location||{};i=i||d;var a={},m=typeof i,f;if(i.protocol==="blob:")a=new J(unescape(i.pathname),{});else if(m==="string"){a=new J(i,{});for(f in En)delete a[f]}else if(m==="object"){for(f in i)f in En||(a[f]=i[f]);a.slashes===void 0&&(a.slashes=We.test(i.href))}return a}function K(i){return i==="file:"||i==="ftp:"||i==="http:"||i==="https:"||i==="ws:"||i==="wss:"}function On(i,c){i=Ke(i),i=i.replace(U,""),c=c||{};var d=se.exec(i),a=d[1]?d[1].toLowerCase():"",m=!!d[2],f=!!d[3],k=0,w;return m?f?(w=d[2]+d[3]+d[4],k=d[2].length+d[3].length):(w=d[2]+d[4],k=d[2].length):f?(w=d[3]+d[4],k=d[3].length):w=d[4],a==="file:"?k>=2&&(w=w.slice(2)):K(a)?w=d[4]:a?m&&(w=w.slice(2)):k>=2&&K(c.protocol)&&(w=d[4]),{protocol:a,slashes:m||K(a),slashesCount:k,rest:w}}function qt(i,c){if(i==="")return c;for(var d=(c||"/").split("/").slice(0,-1).concat(i.split("/")),a=d.length,m=d[a-1],f=!1,k=0;a--;)d[a]==="."?d.splice(a,1):d[a]===".."?(d.splice(a,1),k++):k&&(a===0&&(f=!0),d.splice(a,1),k--);return f&&d.unshift(""),(m==="."||m==="..")&&d.push(""),d.join("/")}function J(i,c,d){if(i=Ke(i),i=i.replace(U,""),!(this instanceof J))return new J(i,c,d);var a,m,f,k,w,_,B=Je.slice(),Cn=typeof c,y=this,He=0;for(Cn!=="object"&&Cn!=="string"&&(d=c,c=null),d&&typeof d!="function"&&(d=D.parse),c=Rn(c),m=On(i||"",c),a=!m.protocol&&!m.slashes,y.slashes=m.slashes||a&&c.slashes,y.protocol=m.protocol||c.protocol||"",i=m.rest,(m.protocol==="file:"&&(m.slashesCount!==2||pe.test(i))||!m.slashes&&(m.protocol||m.slashesCount<2||!K(y.protocol)))&&(B[3]=[/(.*)/,"pathname"]);He<B.length;He++){if(k=B[He],typeof k=="function"){i=k(i,y);continue}f=k[0],_=k[1],f!==f?y[_]=i:typeof f=="string"?(w=f==="@"?i.lastIndexOf(f):i.indexOf(f),~w&&(typeof k[2]=="number"?(y[_]=i.slice(0,w),i=i.slice(w+k[2])):(y[_]=i.slice(w),i=i.slice(0,w)))):(w=f.exec(i))&&(y[_]=w[1],i=i.slice(0,w.index)),y[_]=y[_]||a&&k[3]&&c[_]||"",k[4]&&(y[_]=y[_].toLowerCase())}d&&(y.query=d(y.query)),a&&c.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||c.pathname!=="")&&(y.pathname=qt(y.pathname,c.pathname)),y.pathname.charAt(0)!=="/"&&K(y.protocol)&&(y.pathname="/"+y.pathname),r(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(w=y.auth.indexOf(":"),~w?(y.username=y.auth.slice(0,w),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(w+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&K(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString()}function Vt(i,c,d){var a=this;switch(i){case"query":typeof c=="string"&&c.length&&(c=(d||D.parse)(c)),a[i]=c;break;case"port":a[i]=c,r(c,a.protocol)?c&&(a.host=a.hostname+":"+c):(a.host=a.hostname,a[i]="");break;case"hostname":a[i]=c,a.port&&(c+=":"+a.port),a.host=c;break;case"host":a[i]=c,/:\d+$/.test(c)?(c=c.split(":"),a.port=c.pop(),a.hostname=c.join(":")):(a.hostname=c,a.port="");break;case"protocol":a.protocol=c.toLowerCase(),a.slashes=!d;break;case"pathname":case"hash":if(c){var m=i==="pathname"?"/":"#";a[i]=c.charAt(0)!==m?m+c:c}else a[i]=c;break;case"username":case"password":a[i]=encodeURIComponent(c);break;case"auth":var f=c.indexOf(":");~f?(a.username=c.slice(0,f),a.username=encodeURIComponent(decodeURIComponent(a.username)),a.password=c.slice(f+1),a.password=encodeURIComponent(decodeURIComponent(a.password))):a.username=encodeURIComponent(decodeURIComponent(c))}for(var k=0;k<Je.length;k++){var w=Je[k];w[4]&&(a[w[1]]=a[w[1]].toLowerCase())}return a.auth=a.password?a.username+":"+a.password:a.username,a.origin=a.protocol!=="file:"&&K(a.protocol)&&a.host?a.protocol+"//"+a.host:"null",a.href=a.toString(),a}function Gt(i){(!i||typeof i!="function")&&(i=D.stringify);var c,d=this,a=d.host,m=d.protocol;m&&m.charAt(m.length-1)!==":"&&(m+=":");var f=m+(d.protocol&&d.slashes||K(d.protocol)?"//":"");return d.username?(f+=d.username,d.password&&(f+=":"+d.password),f+="@"):d.password?(f+=":"+d.password,f+="@"):d.protocol!=="file:"&&K(d.protocol)&&!a&&d.pathname!=="/"&&(f+="@"),a[a.length-1]===":"&&(a+=":"),f+=a+d.pathname,c=typeof d.query=="object"?i(d.query):d.query,c&&(f+=c.charAt(0)!=="?"?"?"+c:c),d.hash&&(f+=d.hash),f}J.prototype={set:Vt,toString:Gt},J.extractProtocol=On,J.location=Rn,J.trimLeft=Ke,J.qs=D;var Ze=J;function me(i,c){setTimeout(function(d){return i.call(d)},4,c)}function be(i,c){typeof nn!="undefined"&&nn.env.NODE_ENV!=="test"&&console[i].call(null,c)}function Xe(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)||d.push(a)}),d}function jt(i,c){i===void 0&&(i=[]);var d=[];return i.forEach(function(a){c(a)&&d.push(a)}),d}var re=function(){this.listeners={}};re.prototype.addEventListener=function(i,c){typeof c=="function"&&(Array.isArray(this.listeners[i])||(this.listeners[i]=[]),jt(this.listeners[i],function(d){return d===c}).length===0&&this.listeners[i].push(c))},re.prototype.removeEventListener=function(i,c){var d=this.listeners[i];this.listeners[i]=Xe(d,function(a){return a===c})},re.prototype.dispatchEvent=function(i){for(var c=this,d=[],a=arguments.length-1;a-- >0;)d[a]=arguments[a+1];var m=i.type,f=this.listeners[m];return Array.isArray(f)?(f.forEach(function(k){d.length>0?k.apply(c,d):k.call(c,i)}),!0):!1};function ee(i){var c=i.indexOf("?");return c>=0?i.slice(0,c):i}var Y=function(){this.urlMap={}};Y.prototype.attachWebSocket=function(i,c){var d=ee(c),a=this.urlMap[d];if(a&&a.server&&a.websockets.indexOf(i)===-1)return a.websockets.push(i),a.server},Y.prototype.addMembershipToRoom=function(i,c){var d=this.urlMap[ee(i.url)];d&&d.server&&d.websockets.indexOf(i)!==-1&&(d.roomMemberships[c]||(d.roomMemberships[c]=[]),d.roomMemberships[c].push(i))},Y.prototype.attachServer=function(i,c){var d=ee(c),a=this.urlMap[d];if(!a)return this.urlMap[d]={server:i,websockets:[],roomMemberships:{}},i},Y.prototype.serverLookup=function(i){var c=ee(i),d=this.urlMap[c];if(d)return d.server},Y.prototype.websocketsLookup=function(i,c,d){var a=ee(i),m,f=this.urlMap[a];if(m=f?f.websockets:[],c){var k=f.roomMemberships[c];m=k||[]}return d?m.filter(function(w){return w!==d}):m},Y.prototype.removeServer=function(i){delete this.urlMap[ee(i)]},Y.prototype.removeWebSocket=function(i,c){var d=ee(c),a=this.urlMap[d];a&&(a.websockets=Xe(a.websockets,function(m){return m===i}))},Y.prototype.removeMembershipFromRoom=function(i,c){var d=this.urlMap[ee(i.url)],a=d.roomMemberships[c];d&&a!==null&&(d.roomMemberships[c]=Xe(a,function(m){return m===i}))};var C=new Y,q={CLOSE_NORMAL:1e3,CLOSE_GOING_AWAY:1001,CLOSE_PROTOCOL_ERROR:1002,CLOSE_UNSUPPORTED:1003,CLOSE_NO_STATUS:1005,CLOSE_ABNORMAL:1006,UNSUPPORTED_DATA:1007,POLICY_VIOLATION:1008,CLOSE_TOO_LARGE:1009,MISSING_EXTENSION:1010,INTERNAL_ERROR:1011,SERVICE_RESTART:1012,TRY_AGAIN_LATER:1013,TLS_HANDSHAKE:1015},F={CONSTRUCTOR_ERROR:"Failed to construct 'WebSocket':",CLOSE_ERROR:"Failed to execute 'close' on 'WebSocket':",EVENT:{CONSTRUCT:"Failed to construct 'Event':",MESSAGE:"Failed to construct 'MessageEvent':",CLOSE:"Failed to construct 'CloseEvent':"}},oe=function(){};oe.prototype.stopPropagation=function(){},oe.prototype.stopImmediatePropagation=function(){},oe.prototype.initEvent=function(i,c,d){i===void 0&&(i="undefined"),c===void 0&&(c=!1),d===void 0&&(d=!1),this.type=""+i,this.bubbles=Boolean(c),this.cancelable=Boolean(d)};var Wt=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT_ERROR+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT_ERROR+" parameter 2 ('eventInitDict') is not an object.");var m=a.bubbles,f=a.cancelable;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(oe),Kt=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.MESSAGE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.MESSAGE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,k=a.data,w=a.origin,_=a.lastEventId,B=a.ports;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.canncelBubble=!1,this.bubbles=m?Boolean(m):!1,this.origin=""+w,this.ports=typeof B=="undefined"?null:B,this.data=typeof k=="undefined"?null:k,this.lastEventId=""+(_||"")}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(oe),Jt=function(i){function c(d,a){if(a===void 0&&(a={}),i.call(this),!d)throw new TypeError(F.EVENT.CLOSE+" 1 argument required, but only 0 present.");if(typeof a!="object")throw new TypeError(F.EVENT.CLOSE+" parameter 2 ('eventInitDict') is not an object");var m=a.bubbles,f=a.cancelable,k=a.code,w=a.reason,_=a.wasClean;this.type=""+d,this.timeStamp=Date.now(),this.target=null,this.srcElement=null,this.returnValue=!0,this.isTrusted=!1,this.eventPhase=0,this.defaultPrevented=!1,this.currentTarget=null,this.cancelable=f?Boolean(f):!1,this.cancelBubble=!1,this.bubbles=m?Boolean(m):!1,this.code=typeof k=="number"?parseInt(k,10):0,this.reason=""+(w||""),this.wasClean=_?Boolean(_):!1}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c}(oe);function V(i){var c=i.type,d=i.target,a=new Wt(c);return d&&(a.target=d,a.srcElement=d,a.currentTarget=d),a}function fe(i){var c=i.type,d=i.origin,a=i.data,m=i.target,f=new Kt(c,{data:a,origin:d});return m&&(f.target=m,f.srcElement=m,f.currentTarget=m),f}function G(i){var c=i.code,d=i.reason,a=i.type,m=i.target,f=i.wasClean;f||(f=c===q.CLOSE_NORMAL||c===q.CLOSE_NO_STATUS);var k=new Jt(a,{code:c,reason:d,wasClean:f});return m&&(k.target=m,k.srcElement=m,k.currentTarget=m),k}function Sn(i,c,d){i.readyState=A.CLOSING;var a=C.serverLookup(i.url),m=G({type:"close",target:i.target,code:c,reason:d});me(function(){C.removeWebSocket(i,i.url),i.readyState=A.CLOSED,i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function Zt(i,c,d){i.readyState=A.CLOSING;var a=C.serverLookup(i.url),m=G({type:"close",target:i.target,code:c,reason:d,wasClean:!1}),f=V({type:"error",target:i.target});me(function(){C.removeWebSocket(i,i.url),i.readyState=A.CLOSED,i.dispatchEvent(f),i.dispatchEvent(m),a&&a.dispatchEvent(m,a)},i)}function ve(i){return Object.prototype.toString.call(i)!=="[object Blob]"&&!(i instanceof ArrayBuffer)&&(i=String(i)),i}var $e=new WeakMap;function Nn(i){if($e.has(i))return $e.get(i);var c=new Proxy(i,{get:function(d,a){if(a==="close")return function(f){f===void 0&&(f={});var k=f.code||q.CLOSE_NORMAL,w=f.reason||"";Sn(c,k,w)};if(a==="send")return function(f){f=ve(f),i.dispatchEvent(fe({type:"message",data:f,origin:this.url,target:i}))};var m=function(f){return f==="message"?"server::"+f:f};return a==="on"?function(f,k){i.addEventListener(m(f),k)}:a==="off"?function(f,k){i.removeEventListener(m(f),k)}:a==="target"?i:d[a]}});return $e.set(i,c),c}function Xt(i){var c=encodeURIComponent(i).match(/%[89ABab]/g);return i.length+(c?c.length:0)}function $t(i){var c=new Ze(i),d=c.pathname,a=c.protocol,m=c.hash;if(!i)throw new TypeError(F.CONSTRUCTOR_ERROR+" 1 argument required, but only 0 present.");if(d||(c.pathname="/"),a==="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL '"+c.toString()+"' is invalid.");if(a!=="ws:"&&a!=="wss:")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL's scheme must be either 'ws' or 'wss'. '"+a+"' is not allowed.");if(m!=="")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The URL contains a fragment identifier ('"+m+"'). Fragment identifiers are not allowed in WebSocket URLs.");return c.toString()}function Yt(i){if(i===void 0&&(i=[]),!Array.isArray(i)&&typeof i!="string")throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+i.toString()+"' is invalid.");typeof i=="string"&&(i=[i]);var c=i.map(function(a){return{count:1,protocol:a}}).reduce(function(a,m){return a[m.protocol]=(a[m.protocol]||0)+m.count,a},{}),d=Object.keys(c).filter(function(a){return c[a]>1});if(d.length>0)throw new SyntaxError(F.CONSTRUCTOR_ERROR+" The subprotocol '"+d[0]+"' is duplicated.");return i}var A=function(i){function c(a,m){i.call(this),this._onopen=null,this._onmessage=null,this._onerror=null,this._onclose=null,this.url=$t(a),m=Yt(m),this.protocol=m[0]||"",this.binaryType="blob",this.readyState=c.CONNECTING;var f=Nn(this),k=C.attachWebSocket(f,this.url);me(function(){if(this.readyState===c.CONNECTING)if(k)if(k.options.verifyClient&&typeof k.options.verifyClient=="function"&&!k.options.verifyClient())this.readyState=c.CLOSED,be("error","WebSocket connection to '"+this.url+"' failed: HTTP Authentication failed; no valid credentials available"),C.removeWebSocket(f,this.url),this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL}));else{if(k.options.selectProtocol&&typeof k.options.selectProtocol=="function"){var w=k.options.selectProtocol(m),_=w!=="",B=m.indexOf(w)!==-1;if(_&&!B){this.readyState=c.CLOSED,be("error","WebSocket connection to '"+this.url+"' failed: Invalid Sub-Protocol"),C.removeWebSocket(f,this.url),this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL}));return}this.protocol=w}this.readyState=c.OPEN,this.dispatchEvent(V({type:"open",target:this})),k.dispatchEvent(V({type:"connection"}),f)}else this.readyState=c.CLOSED,this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL})),be("error","WebSocket connection to '"+this.url+"' failed")},this)}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={onopen:{},onmessage:{},onclose:{},onerror:{}};return d.onopen.get=function(){return this._onopen},d.onmessage.get=function(){return this._onmessage},d.onclose.get=function(){return this._onclose},d.onerror.get=function(){return this._onerror},d.onopen.set=function(a){this.removeEventListener("open",this._onopen),this._onopen=a,this.addEventListener("open",a)},d.onmessage.set=function(a){this.removeEventListener("message",this._onmessage),this._onmessage=a,this.addEventListener("message",a)},d.onclose.set=function(a){this.removeEventListener("close",this._onclose),this._onclose=a,this.addEventListener("close",a)},d.onerror.set=function(a){this.removeEventListener("error",this._onerror),this._onerror=a,this.addEventListener("error",a)},c.prototype.send=function(a){var m=this;if(this.readyState===c.CONNECTING)throw new Error("Failed to execute 'send' on 'WebSocket': Still in CONNECTING state");var f=fe({type:"server::message",origin:this.url,data:ve(a)}),k=C.serverLookup(this.url);k&&me(function(){m.dispatchEvent(f,a)},k)},c.prototype.close=function(a,m){if(a!==void 0&&(typeof a!="number"||a!==1e3&&(a<3e3||a>4999)))throw new TypeError(F.CLOSE_ERROR+" The code must be either 1000, or between 3000 and 4999. "+a+" is neither.");if(m!==void 0){var f=Xt(m);if(f>123)throw new SyntaxError(F.CLOSE_ERROR+" The message must not be greater than 123 bytes.")}if(!(this.readyState===c.CLOSING||this.readyState===c.CLOSED)){var k=Nn(this);this.readyState===c.CONNECTING?Zt(k,a||q.CLOSE_ABNORMAL,m):Sn(k,a||q.CLOSE_NO_STATUS,m)}},Object.defineProperties(c.prototype,d),c}(re);A.CONNECTING=0,A.prototype.CONNECTING=A.CONNECTING,A.OPEN=1,A.prototype.OPEN=A.OPEN,A.CLOSING=2,A.prototype.CLOSING=A.CLOSING,A.CLOSED=3,A.prototype.CLOSED=A.CLOSED;var ae=function(i){function c(a,m){var f=this;a===void 0&&(a="socket.io"),m===void 0&&(m=""),i.call(this),this.binaryType="blob";var k=new Ze(a);k.pathname||(k.pathname="/"),this.url=k.toString(),this.readyState=c.CONNECTING,this.protocol="",this.target=this,typeof m=="string"||typeof m=="object"&&m!==null?this.protocol=m:Array.isArray(m)&&m.length>0&&(this.protocol=m[0]);var w=C.attachWebSocket(this,this.url);me(function(){w?(this.readyState=c.OPEN,w.dispatchEvent(V({type:"connection"}),w,this),w.dispatchEvent(V({type:"connect"}),w,this),this.dispatchEvent(V({type:"connect",target:this}))):(this.readyState=c.CLOSED,this.dispatchEvent(V({type:"error",target:this})),this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL})),be("error","Socket.io connection to '"+this.url+"' failed"))},this),this.addEventListener("close",function(_){f.dispatchEvent(G({type:"disconnect",target:_.target,code:_.code}))})}i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c;var d={broadcast:{}};return c.prototype.close=function(){if(this.readyState===c.OPEN){var a=C.serverLookup(this.url);return C.removeWebSocket(this,this.url),this.readyState=c.CLOSED,this.dispatchEvent(G({type:"close",target:this,code:q.CLOSE_NORMAL})),a&&a.dispatchEvent(G({type:"disconnect",target:this,code:q.CLOSE_NORMAL}),a),this}},c.prototype.disconnect=function(){return this.close()},c.prototype.emit=function(a){for(var m=[],f=arguments.length-1;f-- >0;)m[f]=arguments[f+1];if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var k=fe({type:a,origin:this.url,data:m}),w=C.serverLookup(this.url);return w&&w.dispatchEvent.apply(w,[k].concat(m)),this},c.prototype.send=function(a){return this.emit("message",a),this},d.broadcast.get=function(){if(this.readyState!==c.OPEN)throw new Error("SocketIO is already in CLOSING or CLOSED state");var a=this,m=C.serverLookup(this.url);if(!m)throw new Error("SocketIO can not find a server at the specified URL ("+this.url+")");return{emit:function(f,k){return m.emit(f,k,{websockets:C.websocketsLookup(a.url,null,a)}),a},to:function(f){return m.to(f,a)},in:function(f){return m.in(f,a)}}},c.prototype.on=function(a,m){return this.addEventListener(a,m),this},c.prototype.off=function(a,m){this.removeEventListener(a,m)},c.prototype.hasListeners=function(a){var m=this.listeners[a];return Array.isArray(m)?!!m.length:!1},c.prototype.join=function(a){C.addMembershipToRoom(this,a)},c.prototype.leave=function(a){C.removeMembershipFromRoom(this,a)},c.prototype.to=function(a){return this.broadcast.to(a)},c.prototype.in=function(){return this.to.apply(null,arguments)},c.prototype.dispatchEvent=function(a){for(var m=this,f=[],k=arguments.length-1;k-- >0;)f[k]=arguments[k+1];var w=a.type,_=this.listeners[w];if(!Array.isArray(_))return!1;_.forEach(function(B){f.length>0?B.apply(m,f):B.call(m,a.data?a.data:a)})},Object.defineProperties(c.prototype,d),c}(re);ae.CONNECTING=0,ae.OPEN=1,ae.CLOSING=2,ae.CLOSED=3;var Ye=function(i,c){return new ae(i,c)};Ye.connect=function(i,c){return Ye(i,c)};var zt=function(i){return i.reduce(function(c,d){return c.indexOf(d)>-1?c:c.concat(d)},[])};function xn(){return typeof window!="undefined"?window:typeof nn=="object"&&typeof Xs=="function"&&typeof he=="object"?he:this}var In={mock:!0,verifyClient:null,selectProtocol:null},ze=function(i){function c(d,a){a===void 0&&(a=In),i.call(this);var m=new Ze(d);m.pathname||(m.pathname="/"),this.url=m.toString(),this.originalWebSocket=null;var f=C.attachServer(this,this.url);if(!f)throw this.dispatchEvent(V({type:"error"})),new Error("A mock server is already listening on this url");this.options=Object.assign({},In,a),this.options.mock&&this.mockWebsocket()}return i&&(c.__proto__=i),c.prototype=Object.create(i&&i.prototype),c.prototype.constructor=c,c.prototype.mockWebsocket=function(){var d=xn();this.originalWebSocket=d.WebSocket,d.WebSocket=A},c.prototype.restoreWebsocket=function(){var d=xn();this.originalWebSocket!==null&&(d.WebSocket=this.originalWebSocket),this.originalWebSocket=null},c.prototype.stop=function(d){d===void 0&&(d=function(){}),this.options.mock&&this.restoreWebsocket(),C.removeServer(this.url),typeof d=="function"&&d()},c.prototype.on=function(d,a){this.addEventListener(d,a)},c.prototype.off=function(d,a){this.removeEventListener(d,a)},c.prototype.close=function(d){d===void 0&&(d={});var a=d.code,m=d.reason,f=d.wasClean,k=C.websocketsLookup(this.url);C.removeServer(this.url),k.forEach(function(w){w.readyState=A.CLOSED,w.dispatchEvent(G({type:"close",target:w.target,code:a||q.CLOSE_NORMAL,reason:m||"",wasClean:f}))}),this.dispatchEvent(G({type:"close"}),this)},c.prototype.emit=function(d,a,m){var f=this;m===void 0&&(m={});var k=m.websockets;k||(k=C.websocketsLookup(this.url));var w;typeof m!="object"||arguments.length>3?(a=Array.prototype.slice.call(arguments,1,arguments.length),w=a.map(function(_){return ve(_)})):w=ve(a),k.forEach(function(_){var B=_ instanceof ae?a:w;Array.isArray(B)?_.dispatchEvent.apply(_,[fe({type:d,data:B,origin:f.url,target:_.target})].concat(B)):_.dispatchEvent(fe({type:d,data:B,origin:f.url,target:_.target}))})},c.prototype.clients=function(){return C.websocketsLookup(this.url)},c.prototype.to=function(d,a,m){var f=this;m===void 0&&(m=[]);var k=this,w=zt(m.concat(C.websocketsLookup(this.url,d,a)));return{to:function(_,B){return f.to.call(f,_,B,w)},emit:function(_,B){k.emit(_,B,{websockets:w})}}},c.prototype.in=function(){for(var d=[],a=arguments.length;a--;)d[a]=arguments[a];return this.to.apply(null,d)},c.prototype.simulate=function(d){var a=C.websocketsLookup(this.url);d==="error"&&a.forEach(function(m){m.readyState=A.CLOSED,m.dispatchEvent(V({type:"error",target:m.target}))})},c}(re);ze.of=function(i){return new ze(i)};var Ht=ze,Qt=A,es=Ye;t.Server=Ht,t.WebSocket=Qt,t.SocketIO=es,Object.defineProperty(t,"__esModule",{value:!0})})})($s,we);var ln={},Ys={get exports(){return ln},set exports(e){ln=e}},le=typeof Reflect=="object"?Reflect:null,Jn=le&&typeof le.apply=="function"?le.apply:function(e,n,t){return Function.prototype.apply.call(e,n,t)},Ce;le&&typeof le.ownKeys=="function"?Ce=le.ownKeys:Object.getOwnPropertySymbols?Ce=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ce=function(e){return Object.getOwnPropertyNames(e)};function zs(e){console&&console.warn&&console.warn(e)}var wt=Number.isNaN||function(e){return e!==e};function S(){S.init.call(this)}Ys.exports=S;ln.once=nr;S.EventEmitter=S;S.prototype._events=void 0;S.prototype._eventsCount=0;S.prototype._maxListeners=void 0;var Zn=10;function Ge(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(S,"defaultMaxListeners",{enumerable:!0,get:function(){return Zn},set:function(e){if(typeof e!="number"||e<0||wt(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Zn=e}});S.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};S.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||wt(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function yt(e){return e._maxListeners===void 0?S.defaultMaxListeners:e._maxListeners}S.prototype.getMaxListeners=function(){return yt(this)};S.prototype.emit=function(e){for(var n=[],t=1;t<arguments.length;t++)n.push(arguments[t]);var s=e==="error",r=this._events;if(r!==void 0)s=s&&r.error===void 0;else if(!s)return!1;if(s){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var p=r[e];if(p===void 0)return!1;if(typeof p=="function")Jn(p,this,n);else for(var h=p.length,T=Rt(p,h),t=0;t<h;++t)Jn(T[t],this,n);return!0};function _t(e,n,t,s){var r,o,l;if(Ge(t),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",n,t.listener?t.listener:t),o=e._events),l=o[n]),l===void 0)l=o[n]=t,++e._eventsCount;else if(typeof l=="function"?l=o[n]=s?[t,l]:[l,t]:s?l.unshift(t):l.push(t),r=yt(e),r>0&&l.length>r&&!l.warned){l.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=e,p.type=n,p.count=l.length,zs(p)}return e}S.prototype.addListener=function(e,n){return _t(this,e,n,!1)};S.prototype.on=S.prototype.addListener;S.prototype.prependListener=function(e,n){return _t(this,e,n,!0)};function Hs(){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 bt(e,n,t){var s={fired:!1,wrapFn:void 0,target:e,type:n,listener:t},r=Hs.bind(s);return r.listener=t,s.wrapFn=r,r}S.prototype.once=function(e,n){return Ge(n),this.on(e,bt(this,e,n)),this};S.prototype.prependOnceListener=function(e,n){return Ge(n),this.prependListener(e,bt(this,e,n)),this};S.prototype.removeListener=function(e,n){var t,s,r,o,l;if(Ge(n),s=this._events,s===void 0)return this;if(t=s[e],t===void 0)return this;if(t===n||t.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,t.listener||n));else if(typeof t!="function"){for(r=-1,o=t.length-1;o>=0;o--)if(t[o]===n||t[o].listener===n){l=t[o].listener,r=o;break}if(r<0)return this;r===0?t.shift():Qs(t,r),t.length===1&&(s[e]=t[0]),s.removeListener!==void 0&&this.emit("removeListener",e,l||n)}return this};S.prototype.off=S.prototype.removeListener;S.prototype.removeAllListeners=function(e){var n,t,s;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[e]),this;if(arguments.length===0){var r=Object.keys(t),o;for(s=0;s<r.length;++s)o=r[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=t[e],typeof n=="function")this.removeListener(e,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(e,n[s]);return this};function vt(e,n,t){var s=e._events;if(s===void 0)return[];var r=s[n];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?er(r):Rt(r,r.length)}S.prototype.listeners=function(e){return vt(this,e,!0)};S.prototype.rawListeners=function(e){return vt(this,e,!1)};S.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):Et.call(e,n)};S.prototype.listenerCount=Et;function Et(e){var n=this._events;if(n!==void 0){var t=n[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}S.prototype.eventNames=function(){return this._eventsCount>0?Ce(this._events):[]};function Rt(e,n){for(var t=new Array(n),s=0;s<n;++s)t[s]=e[s];return t}function Qs(e,n){for(;n+1<e.length;n++)e[n]=e[n+1];e.pop()}function er(e){for(var n=new Array(e.length),t=0;t<n.length;++t)n[t]=e[t].listener||e[t];return n}function nr(e,n){return new Promise(function(t,s){function r(l){e.removeListener(n,o),s(l)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),t([].slice.call(arguments))}Ot(e,n,o,{once:!0}),n!=="error"&&tr(e,r,{once:!0})})}function tr(e,n,t){typeof e.on=="function"&&Ot(e,"error",n,t)}function Ot(e,n,t,s){if(typeof e.on=="function")s.once?e.once(n,t):e.on(n,t);else if(typeof e.addEventListener=="function")e.addEventListener(n,function r(o){s.once&&e.removeEventListener(n,r),t(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}class sr extends u{constructor(){super("message.v1.SocketMessage",[{no:1,name:"event",kind:"scalar",T:13},{no:2,name:"id",kind:"scalar",opt:!0,T:9},{no:3,name:"payload",kind:"scalar",opt:!0,T:12},{no:4,name:"metadata",kind:"scalar",opt:!0,T:12}])}}const Xn=new sr;var Me;(function(e){e[e.PUBLISHER=0]="PUBLISHER",e[e.SUBSCRIBER=1]="SUBSCRIBER"})(Me||(Me={}));var dn;(function(e){e[e.AUDIO=0]="AUDIO",e[e.VIDEO=1]="VIDEO"})(dn||(dn={}));class rr extends u{constructor(){super("media.Codec",[{no:1,name:"channels",kind:"scalar",opt:!0,T:5},{no:2,name:"clock_rate",kind:"scalar",T:5},{no:3,name:"mime_type",kind:"scalar",T:9},{no:4,name:"sdp_fmtp_line",kind:"scalar",opt:!0,T:9},{no:5,name:"payload_type",kind:"scalar",opt:!0,T:13}])}}const St=new rr;class or extends u{constructor(){super("media.HeaderExtension",[{no:1,name:"direction",kind:"scalar",opt:!0,T:9},{no:2,name:"uri",kind:"scalar",T:9}])}}const ar=new or;class ir extends u{constructor(){super("media.Fingerprint",[{no:1,name:"algorithm",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:9}])}}new ir;class cr extends u{constructor(){super("media.SessionDescription",[{no:1,name:"target",kind:"enum",T:()=>["media.Target",Me]},{no:2,name:"type",kind:"scalar",T:9},{no:3,name:"sdp",kind:"scalar",T:9}])}}const W=new cr;class ur extends u{constructor(){super("media.ProducerPayload",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"msid",kind:"scalar",T:9},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"mime_type",kind:"scalar",opt:!0,T:9}])}}const lr=new ur;class dr extends u{constructor(){super("media.CreateTransportRequest",[{no:1,name:"consuming",kind:"scalar",T:8},{no:2,name:"force_tcp",kind:"scalar",opt:!0,T:8},{no:3,name:"description",kind:"message",T:()=>W},{no:4,name:"private_ice",kind:"scalar",opt:!0,T:8},{no:5,name:"producers",kind:"message",repeat:1,T:()=>lr}])}}new dr;class pr extends u{constructor(){super("media.AudioActivityRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"energy",kind:"scalar",T:5},{no:3,name:"silent",kind:"scalar",T:8}])}}new pr;class mr extends u{constructor(){super("media.CreateTransportResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W},{no:3,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:4,name:"producer_ids",kind:"scalar",repeat:2,T:9}])}}const Nt=new mr;class fr extends u{constructor(){super("media.RenegotiateRequest",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W}])}}new fr;class hr extends u{constructor(){super("media.RenegotiateResponse",[{no:1,name:"transport_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W}])}}new hr;class gr extends u{constructor(){super("media.NestedScore",[{no:1,name:"encoding_idx",kind:"scalar",T:5},{no:2,name:"rid",kind:"scalar",T:9},{no:3,name:"score",kind:"scalar",T:5},{no:4,name:"ssrc",kind:"scalar",T:3,L:0}])}}const kr=new gr;class Tr extends u{constructor(){super("media.ProducerTrack",[{no:1,name:"track_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9},{no:3,name:"stream_id",kind:"scalar",T:9}])}}const wr=new Tr;class yr extends u{constructor(){super("media.ProducerEntry",[{no:1,name:"producing_transport_id",kind:"scalar",T:9},{no:2,name:"producer_id",kind:"scalar",T:9}])}}new yr;class _r extends u{constructor(){super("media.ConsumerEntry",[{no:1,name:"consuming_transport_id",kind:"scalar",T:9},{no:2,name:"consumer_id",kind:"scalar",T:9}])}}new _r;class br extends u{constructor(){super("media.ProducerState",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"kind",kind:"enum",T:()=>["media.ProducerKind",dn]},{no:3,name:"pause",kind:"scalar",T:8},{no:4,name:"screen_share",kind:"scalar",T:8},{no:5,name:"app_data",kind:"scalar",opt:!0,T:9},{no:6,name:"producing_transport_id",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"codec",kind:"message",T:()=>St}])}}const _e=new br;class vr extends u{constructor(){super("media.ConsumerState",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>_e},{no:3,name:"producer_track",kind:"message",T:()=>wr},{no:4,name:"error_code",kind:"scalar",opt:!0,T:9}])}}const Er=new vr;class Rr extends u{constructor(){super("media.ProducerIdToConsumerMap",[{no:1,name:"map",kind:"map",K:9,V:{kind:"message",T:()=>Er}}])}}const xt=new Rr;class Or extends u{constructor(){super("media.PeerRtpCapabilitites",[{no:1,name:"sender",kind:"message",T:()=>Yn},{no:2,name:"receiver",kind:"message",T:()=>Yn}])}}const It=new Or;class Sr extends u{constructor(){super("media.RtpCapability",[{no:1,name:"codecs",kind:"message",repeat:1,T:()=>St},{no:2,name:"header_extensions",kind:"message",repeat:1,T:()=>ar}])}}const $n=new Sr;class Nr extends u{constructor(){super("media.RtpCapabilitites",[{no:1,name:"audio",kind:"message",T:()=>$n},{no:2,name:"video",kind:"message",T:()=>$n}])}}const Yn=new Nr;class xr extends u{constructor(){super("media.PreferredCodec",[{no:1,name:"audio",kind:"scalar",opt:!0,T:9},{no:2,name:"video",kind:"scalar",opt:!0,T:9}])}}const Ir=new xr;class Cr extends u{constructor(){super("media.Simulcast",[{no:1,name:"preferred_rid",kind:"scalar",opt:!0,T:9},{no:2,name:"priority_ordering",kind:"scalar",opt:!0,T:9},{no:3,name:"rid_not_available",kind:"scalar",opt:!0,T:9}])}}const Ct=new Cr;class Pr extends u{constructor(){super("media.edge.GeoLocation",[{no:1,name:"latitude",kind:"scalar",T:2},{no:2,name:"longitude",kind:"scalar",T:2},{no:3,name:"region",kind:"scalar",opt:!0,T:9}])}}const Lr=new Pr;class Ar extends u{constructor(){super("media.edge.PeerJoinRequest",[{no:1,name:"display_name",kind:"scalar",opt:!0,T:9},{no:2,name:"prejoined",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:5,name:"preset",kind:"scalar",opt:!0,T:12},{no:6,name:"user_id",kind:"scalar",opt:!0,T:9},{no:7,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:8,name:"location",kind:"message",T:()=>Lr},{no:9,name:"capabilities",kind:"message",T:()=>It}])}}new Ar;class Br extends u{constructor(){super("media.edge.PeerJoinCompleteRequest",[])}}new Br;class Dr extends u{constructor(){super("media.edge.PeerLeaveRequest",[{no:1,name:"close_room",kind:"scalar",T:8}])}}new Dr;class Mr extends u{constructor(){super("media.edge.ConsumeMultipleProducerRequest",[{no:1,name:"producer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8}])}}new Mr;class Fr extends u{constructor(){super("media.edge.ConsumePeerRequest",[{no:1,name:"producing_peer_id",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",opt:!0,T:8},{no:3,name:"producer_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preferred_codec",kind:"message",T:()=>Ir},{no:5,name:"producing_transport_id",kind:"scalar",opt:!0,T:9},{no:6,name:"simulcast",kind:"message",T:()=>Ct}])}}const Ur=new Fr;class qr extends u{constructor(){super("media.edge.ConsumePeersRequest",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Ur},{no:2,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new qr;class Vr extends u{constructor(){super("media.edge.UpdateConsumerSimulcastConfigRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"simulcast",kind:"message",T:()=>Ct},{no:3,name:"producing_transport_id",kind:"scalar",T:9},{no:4,name:"mid",kind:"scalar",T:9}])}}const Gr=new Vr;class jr extends u{constructor(){super("media.edge.UpdateConsumersSimulcastConfigRequest",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>Gr},{no:2,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new jr;class Wr extends u{constructor(){super("media.edge.ProducerCreateRequest",[{no:1,name:"kind",kind:"scalar",T:9},{no:2,name:"paused",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8},{no:4,name:"description",kind:"message",T:()=>W},{no:5,name:"msid",kind:"scalar",T:9},{no:6,name:"app_data",kind:"scalar",opt:!0,T:9},{no:7,name:"mime_type",kind:"scalar",opt:!0,T:9},{no:8,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new Wr;class Kr extends u{constructor(){super("media.edge.SelectedPeersRequest",[])}}new Kr;class Jr extends u{constructor(){super("media.edge.GlobalPeerPinningRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Jr;class Zr extends u{constructor(){super("media.edge.ProducerToggleRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new Zr;class Xr extends u{constructor(){super("media.edge.ConsumerToggleRequest",[{no:1,name:"consumer_id",kind:"scalar",T:9},{no:2,name:"pause",kind:"scalar",T:8}])}}new Xr;class $r extends u{constructor(){super("media.edge.ProducerCloseRequest",[{no:1,name:"producer_id",kind:"scalar",T:9},{no:2,name:"description",kind:"message",T:()=>W},{no:3,name:"producing_transport_id",kind:"scalar",opt:!0,T:9}])}}new $r;class Yr extends u{constructor(){super("media.edge.ConsumerCloseRequest",[{no:1,name:"consumer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"description",kind:"message",T:()=>W},{no:3,name:"consuming_transport_id",kind:"scalar",opt:!0,T:9}])}}new Yr;class zr extends u{constructor(){super("media.edge.KickPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new zr;class Hr extends u{constructor(){super("media.edge.KickAllPeersRequest",[{no:1,name:"propagate_kick_across_rooms",kind:"scalar",T:8}])}}new Hr;class Qr extends u{constructor(){super("media.edge.PeerDisplayNameEditRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new Qr;class eo extends u{constructor(){super("media.edge.HostMediaControlForPeerRequest",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"audio",kind:"scalar",T:8},{no:3,name:"video",kind:"scalar",T:8},{no:4,name:"scree_share",kind:"scalar",T:8}])}}new eo;class no extends u{constructor(){super("media.edge.HostMediaControlForAllPeerRequest",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8},{no:3,name:"screen_share",kind:"scalar",T:8}])}}new no;class to extends u{constructor(){super("media.edge.GetRoomStateResponse",[{no:1,name:"display_title",kind:"scalar",T:9},{no:2,name:"locked_mode",kind:"scalar",T:8},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"room_name",kind:"scalar",T:9},{no:5,name:"current_peer_id",kind:"scalar",T:9},{no:6,name:"is_recording",kind:"scalar",opt:!0,T:8},{no:7,name:"recorder_participant_id",kind:"scalar",opt:!0,T:9},{no:8,name:"pinned_peer_ids",kind:"scalar",repeat:2,T:9}])}}const so=new to;class ro extends u{constructor(){super("media.edge.ErrorResponse",[{no:1,name:"error_message",kind:"scalar",T:9},{no:2,name:"event_id",kind:"scalar",T:5}])}}new ro;class oo extends u{constructor(){super("media.edge.EmptyResponse",[])}}new oo;class ao extends u{constructor(){super("media.edge.RoomParticipants",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"producer_states",kind:"message",repeat:1,T:()=>_e},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"user_id",kind:"scalar",opt:!0,T:9},{no:5,name:"capabilities",kind:"message",T:()=>It}])}}const Pt=new ao;class io extends u{constructor(){super("media.edge.SelectedPeersResponse",[{no:1,name:"audio_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"compulsory_peers",kind:"scalar",repeat:2,T:9}])}}const co=new io;class uo extends u{constructor(){super("media.edge.SelectedPeersDiffEntry",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"priority",kind:"scalar",T:5}])}}const lo=new uo;class po extends u{constructor(){super("media.edge.SelectedPeersDiffResponse",[{no:1,name:"entries",kind:"message",repeat:1,T:()=>lo}])}}new po;class mo extends u{constructor(){super("media.edge.PeerJoinResponse",[])}}new mo;class fo extends u{constructor(){super("media.edge.PeerJoinCompleteResponse",[{no:1,name:"room_state",kind:"message",T:()=>so},{no:2,name:"participants",kind:"message",repeat:1,T:()=>Pt},{no:3,name:"selected_peers",kind:"message",T:()=>co},{no:4,name:"max_preferred_streams",kind:"scalar",T:5}])}}const ho=new fo;class go extends u{constructor(){super("media.edge.PeerLeaveResponse",[{no:1,name:"closed",kind:"scalar",T:8}])}}new go;class ko extends u{constructor(){super("media.edge.ConsumeMultipleProducerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>xt}])}}new ko;class To extends u{constructor(){super("media.edge.ConsumePeerResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"consumer_ids_map",kind:"message",T:()=>xt},{no:3,name:"description",kind:"message",T:()=>W}])}}new To;class wo extends u{constructor(){super("media.edge.ProducerCreateResponse",[{no:1,name:"status",kind:"scalar",T:8},{no:2,name:"producer_id",kind:"scalar",T:9},{no:4,name:"description",kind:"message",T:()=>W}])}}const yo=new wo;class _o extends u{constructor(){super("media.edge.ProducerScoreResponse",[{no:1,name:"responseid",kind:"scalar",T:9},{no:2,name:"score",kind:"message",T:()=>kr}])}}new _o;class bo extends u{constructor(){super("media.edge.ActiveSpeakerResponse",[{no:1,name:"responsepeer_id",kind:"scalar",T:9},{no:2,name:"volume",kind:"scalar",T:5}])}}new bo;class vo extends u{constructor(){super("media.edge.NoActiveSpeakerResponse",[])}}new vo;class Eo extends u{constructor(){super("media.edge.ProducerToggleResponse",[])}}new Eo;class Ro extends u{constructor(){super("media.edge.ConsumerToggleResponse",[])}}new Ro;class Oo extends u{constructor(){super("media.edge.ProducerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>W}])}}new Oo;class So extends u{constructor(){super("media.edge.ConsumerClosingResponse",[{no:1,name:"description",kind:"message",T:()=>W}])}}new So;class No extends u{constructor(){super("media.edge.GlobalPeerPinningResponse",[])}}new No;class xo extends u{constructor(){super("media.edge.KickPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new xo;class Io extends u{constructor(){super("media.edge.KickAllPeersResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Io;class Co extends u{constructor(){super("media.edge.HostMediaControlForPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Co;class Po extends u{constructor(){super("media.edge.HostMediaControlForAllPeerResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Po;class Lo extends u{constructor(){super("media.edge.PeerDisplayNameEditResponse",[{no:1,name:"status",kind:"scalar",T:9}])}}new Lo;class Ao extends u{constructor(){super("media.edge.PeerJoinBroadcastResponse",[{no:1,name:"participant",kind:"message",T:()=>Pt}])}}new Ao;class Bo extends u{constructor(){super("media.edge.TrackSubscriptionKind",[{no:1,name:"audio",kind:"scalar",T:8},{no:2,name:"video",kind:"scalar",T:8}])}}const zn=new Bo;class Do extends u{constructor(){super("media.edge.TrackSubscription",[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"webcam",kind:"message",T:()=>zn},{no:3,name:"screenshare",kind:"message",T:()=>zn}])}}const Mo=new Do;class Fo extends u{constructor(){super("media.edge.PeerProducingTransportCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"transport_details",kind:"message",T:()=>Nt},{no:3,name:"track_subscriptions",kind:"message",repeat:1,T:()=>Mo}])}}new Fo;class Uo extends u{constructor(){super("media.edge.PeerProducerCreateBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>_e}])}}new Uo;class qo extends u{constructor(){super("media.edge.PeerProducerToggleBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>_e},{no:3,name:"initiator_participant_id",kind:"scalar",opt:!0,T:9}])}}new qo;class Vo extends u{constructor(){super("media.edge.PeerProducerCloseBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"producer_state",kind:"message",T:()=>_e}])}}new Vo;class Go extends u{constructor(){super("media.edge.PeerLeaveBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Go;class jo extends u{constructor(){super("media.edge.GlobalPeerPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new jo;class Wo extends u{constructor(){super("media.edge.GlobalPeerUnPinningBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Wo;class Ko extends u{constructor(){super("media.edge.RecordingStartedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Ko;class Jo extends u{constructor(){super("media.edge.RecordingStoppedBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9}])}}new Jo;class Zo extends u{constructor(){super("media.edge.PeerDisplayNameEditBroadcastResponse",[{no:1,name:"participant_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9}])}}new Zo;class Xo extends u{constructor(){super("media.edge.PeerPingRequestBroadcastResponse",[{no:1,name:"password",kind:"scalar",T:9}])}}new Xo;class $o extends u{constructor(){super("media.edge.MediaRoomTerminationBroadcastResponse",[{no:1,name:"reason",kind:"scalar",T:9}])}}new $o;class Yo extends u{constructor(){super("socket.ai.MeetingTranscript",[{no:1,name:"meeting_id",kind:"scalar",T:9},{no:2,name:"transcript",kind:"scalar",T:9},{no:3,name:"is_partial",kind:"scalar",T:8}])}}new Yo;class zo extends u{constructor(){super("socket.api.BaseSocketHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9}])}}new zo;class Ho extends u{constructor(){super("socket.api.ErrorMessage",[{no:1,name:"code",kind:"scalar",opt:!0,T:5},{no:2,name:"message",kind:"scalar",T:9}])}}new Ho;var Fe;(function(e){e[e.BROWSER=0]="BROWSER",e[e.TRACK=1]="TRACK",e[e.COMPOSITE=2]="COMPOSITE"})(Fe||(Fe={}));var ye;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ON_STAGE=1]="ON_STAGE",e[e.APPROVED_STAGE=2]="APPROVED_STAGE",e[e.REQUESTED_STAGE=3]="REQUESTED_STAGE",e[e.OFF_STAGE=4]="OFF_STAGE"})(ye||(ye={}));var pn;(function(e){e[e.NONE=0]="NONE",e[e.RECORDER=1]="RECORDER",e[e.LIVESTREAMER=2]="LIVESTREAMER"})(pn||(pn={}));var mn;(function(e){e[e.PEERS=0]="PEERS",e[e.ROOMS=1]="ROOMS"})(mn||(mn={}));var fn;(function(e){e[e.HIVE=0]="HIVE",e[e.CHAT=1]="CHAT",e[e.PING=2]="PING"})(fn||(fn={}));class Qo extends u{constructor(){super("socket.room.PeerFlags",[{no:1,name:"preset_name",kind:"scalar",T:9},{no:2,name:"recorder_type",kind:"scalar",T:9},{no:3,name:"hidden_participant",kind:"scalar",T:8}])}}const ea=new Qo;class na extends u{constructor(){super("socket.room.Peer",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",ye,"STAGE_TYPE_"]},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:7,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:8,name:"waitlisted",kind:"scalar",T:8},{no:9,name:"flags",kind:"message",T:()=>ea}])}}const je=new na;class ta extends u{constructor(){super("socket.room.PeerInfoResponse",[{no:1,name:"peer",kind:"message",T:()=>je}])}}const Hn=new ta;class sa extends u{constructor(){super("socket.room.PeerStatusUpdate",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"stage_type",kind:"enum",opt:!0,T:()=>["socket.room.StageType",ye,"STAGE_TYPE_"]}])}}new sa;class ra extends u{constructor(){super("socket.room.RoomPeersInfoRequest",[{no:1,name:"seach_query",kind:"scalar",T:9},{no:2,name:"limit",kind:"scalar",T:5},{no:3,name:"offset",kind:"scalar",T:5}])}}new ra;class oa extends u{constructor(){super("socket.room.RoomPeersInfoResponse",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>je}])}}const aa=new oa;class ia extends u{constructor(){super("socket.room.RoomPeerCountResponse",[{no:1,name:"count",kind:"scalar",T:4,L:2}])}}new ia;class ca extends u{constructor(){super("socket.room.Room",[{no:1,name:"room_id",kind:"scalar",T:9},{no:2,name:"title",kind:"scalar",T:9},{no:4,name:"created_at",kind:"scalar",T:4,L:2},{no:5,name:"active_recordings",kind:"message",repeat:1,T:()=>la},{no:6,name:"room_uuid",kind:"scalar",opt:!0,T:9}])}}const Lt=new ca;class ua extends u{constructor(){super("socket.room.ActiveRecording",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Fe]},{no:3,name:"recording_status",kind:"scalar",T:9}])}}const la=new ua;class da extends u{constructor(){super("socket.room.RoomInfoResponse",[{no:1,name:"room",kind:"message",T:()=>Lt}])}}const pa=new da;class ma extends u{constructor(){super("socket.room.GetPeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9}])}}new ma;class fa extends u{constructor(){super("socket.room.UpdatePeerInfoRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9}])}}new fa;class ha extends u{constructor(){super("socket.room.JoinRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>je},{no:3,name:"room_uuid",kind:"scalar",T:9},{no:4,name:"organization_id",kind:"scalar",opt:!0,T:9},{no:5,name:"use_hive",kind:"scalar",opt:!0,T:8},{no:6,name:"preset",kind:"scalar",opt:!0,T:12},{no:7,name:"capabilities",kind:"enum",repeat:1,T:()=>["socket.room.Capabilities",fn,"CAPABILITIES_"]},{no:8,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new ha;class ga extends u{constructor(){super("socket.room.LeaveRoomRequest",[{no:1,name:"peer",kind:"message",T:()=>je},{no:2,name:"timestamp",kind:"scalar",opt:!0,T:4,L:2}])}}new ga;class ka extends u{constructor(){super("socket.room.UpdateRoomInfoRequest",[{no:1,name:"room",kind:"message",T:()=>Lt}])}}new ka;class Ta extends u{constructor(){super("socket.room.GetConnectedRoomsDumpRequest",[])}}new Ta;class wa extends u{constructor(){super("socket.room.ServiceError",[{no:1,name:"message",kind:"scalar",opt:!0,T:9},{no:2,name:"code",kind:"scalar",opt:!0,T:9}])}}const _n=new wa;class ya extends u{constructor(){super("socket.room.ConnectedMeetingPeer",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:4,name:"preset_id",kind:"scalar",opt:!0,T:9},{no:5,name:"display_picture_url",kind:"scalar",opt:!0,T:9}])}}const _a=new ya;class ba extends u{constructor(){super("socket.room.ConnectedMeetingDump",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>_a}])}}const Qn=new ba;class va extends u{constructor(){super("socket.room.GetConnectedRoomsDumpResponse",[{no:1,name:"parent_meeting",kind:"message",T:()=>Qn},{no:2,name:"meetings",kind:"message",repeat:1,T:()=>Qn}])}}const Ea=new va;class Ra extends u{constructor(){super("socket.room.CreateRoomRequestPayload",[{no:1,name:"title",kind:"scalar",opt:!0,T:9}])}}const Oa=new Ra;class Sa extends u{constructor(){super("socket.room.CreateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Oa}])}}new Sa;class Na extends u{constructor(){super("socket.room.CreateRoomResponsePayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>_n}])}}const xa=new Na;class Ia extends u{constructor(){super("socket.room.CreateConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>xa}])}}new Ia;class Ca extends u{constructor(){super("socket.room.UpdateRoomRequestPayload",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"title",kind:"scalar",opt:!0,T:9}])}}const Pa=new Ca;class La extends u{constructor(){super("socket.room.UpdateConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Pa}])}}new La;class Aa extends u{constructor(){super("socket.room.DisableRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9}])}}const Ba=new Aa;class Da extends u{constructor(){super("socket.room.DisableConnectedRoomsRequest",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Ba}])}}new Da;class Ma extends u{constructor(){super("socket.room.DisableConnectedRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Ua}])}}new Ma;class Fa extends u{constructor(){super("socket.room.DisableConnectedRoomPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"status",kind:"scalar",opt:!0,T:9},{no:3,name:"title",kind:"scalar",opt:!0,T:9},{no:4,name:"error",kind:"message",T:()=>_n}])}}const Ua=new Fa;class qa extends u{constructor(){super("socket.room.MovePeerPayload",[{no:1,name:"id",kind:"scalar",opt:!0,T:9},{no:2,name:"preset_id",kind:"scalar",opt:!0,T:9}])}}const Va=new qa;class Ga extends u{constructor(){super("socket.room.MovePeersBetweenRoomsRequest",[{no:1,name:"source_meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"destination_meeting_id",kind:"scalar",opt:!0,T:9},{no:3,name:"participants",kind:"message",repeat:1,T:()=>Va}])}}new Ga;class ja extends u{constructor(){super("socket.room.MovedPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:3,name:"error",kind:"message",T:()=>_n}])}}const Wa=new ja;class Ka extends u{constructor(){super("socket.room.MovePeersBetweenRoomsResponse",[{no:1,name:"payloads",kind:"message",repeat:1,T:()=>Wa}])}}new Ka;class Ja extends u{constructor(){super("socket.room.TransferPeer",[{no:1,name:"meeting_id",kind:"scalar",opt:!0,T:9},{no:2,name:"auth_token",kind:"scalar",opt:!0,T:9}])}}new Ja;class Za extends u{constructor(){super("socket.room.GetAllAddedParticipantsResponse",[{no:1,name:"participants",kind:"message",repeat:1,T:()=>$a}])}}new Za;class Xa extends u{constructor(){super("socket.room.AddedParticipant",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const $a=new Xa;class Ya extends u{constructor(){super("socket.room.RemoveParticipantsRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new Ya;class za extends u{constructor(){super("socket.room.BroadcastMessage",[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"timestamp",kind:"scalar",T:4,L:2},{no:4,name:"ids",kind:"scalar",repeat:2,T:9},{no:5,name:"broadcast_type",kind:"enum",opt:!0,T:()=>["socket.room.BroadcastType",mn,"BROADCAST_TYPE_"]}])}}new za;class Ha extends u{constructor(){super("socket.room.AcceptWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Ha;class Qa extends u{constructor(){super("socket.room.DenyWaitingRoomRequests",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Qa;class ei extends u{constructor(){super("socket.room.WaitingRoomRequest",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"display_name",kind:"scalar",T:9},{no:4,name:"picture",kind:"scalar",opt:!0,T:9},{no:5,name:"custom_participant_id",kind:"scalar",opt:!0,T:9},{no:6,name:"preset_name",kind:"scalar",opt:!0,T:9}])}}const ni=new ei;class ti extends u{constructor(){super("socket.room.GetWaitingRoomRequests",[{no:1,name:"requests",kind:"message",repeat:1,T:()=>ni}])}}new ti;class si extends u{constructor(){super("socket.room.GetRoomStageStateResponse",[{no:1,name:"on_stage_peers",kind:"scalar",repeat:2,T:9},{no:2,name:"approved_stage_peers",kind:"scalar",repeat:2,T:9},{no:3,name:"requested_stage_peers",kind:"scalar",repeat:2,T:9}])}}new si;var hn;(function(e){e[e.NONE=0]="NONE",e[e.SKIP=1]="SKIP",e[e.ON_PRIVILEGED_USER_ENTRY=2]="ON_PRIVILEGED_USER_ENTRY",e[e.SKIP_ON_ACCEPT=3]="SKIP_ON_ACCEPT"})(hn||(hn={}));var Ue;(function(e){e[e.NONE=0]="NONE",e[e.ALLOWED=1]="ALLOWED",e[e.NOT_ALLOWED=2]="NOT_ALLOWED",e[e.CAN_REQUEST=3]="CAN_REQUEST"})(Ue||(Ue={}));class ri extends u{constructor(){super("socket.preset.PollsPermissionUpdate",[{no:1,name:"can_create",kind:"scalar",opt:!0,T:8},{no:2,name:"can_vote",kind:"scalar",opt:!0,T:8},{no:3,name:"can_view",kind:"scalar",opt:!0,T:8}])}}const oi=new ri;class ai extends u{constructor(){super("socket.preset.PluginsPermissionsUpdate",[{no:1,name:"can_close",kind:"scalar",opt:!0,T:8},{no:2,name:"can_start",kind:"scalar",opt:!0,T:8}])}}const ii=new ai;class ci extends u{constructor(){super("socket.preset.PublicChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"text",kind:"scalar",opt:!0,T:8},{no:3,name:"files",kind:"scalar",opt:!0,T:8}])}}const ui=new ci;class li extends u{constructor(){super("socket.preset.PrivateChatPermission",[{no:1,name:"can_send",kind:"scalar",opt:!0,T:8},{no:2,name:"can_receive",kind:"scalar",opt:!0,T:8},{no:3,name:"text",kind:"scalar",opt:!0,T:8},{no:4,name:"files",kind:"scalar",opt:!0,T:8}])}}const di=new li;class pi extends u{constructor(){super("socket.preset.ChatPermissionUpdate",[{no:1,name:"public",kind:"message",T:()=>ui},{no:2,name:"private",kind:"message",T:()=>di}])}}const mi=new pi;class fi extends u{constructor(){super("socket.preset.ConnectedMeetingPermissionUpdate",[{no:1,name:"can_alter_connected_meetings",kind:"scalar",opt:!0,T:8},{no:2,name:"can_switch_to_parent_meeting",kind:"scalar",opt:!0,T:8},{no:3,name:"can_switch_connected_meetings",kind:"scalar",opt:!0,T:8}])}}const hi=new fi;class gi extends u{constructor(){super("socket.preset.StreamPermission",[{no:1,name:"can_produce",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ue,"STREAM_PERMISSION_TYPE_"]},{no:2,name:"can_consume",kind:"enum",opt:!0,T:()=>["socket.preset.StreamPermissionType",Ue,"STREAM_PERMISSION_TYPE_"]}])}}const tn=new gi;class ki extends u{constructor(){super("socket.preset.MediaPermissionUpdate",[{no:1,name:"video",kind:"message",T:()=>tn},{no:2,name:"audio",kind:"message",T:()=>tn},{no:3,name:"screenshare",kind:"message",T:()=>tn}])}}const Ti=new ki;class wi extends u{constructor(){super("socket.preset.PresetUpdates",[{no:1,name:"polls",kind:"message",T:()=>oi},{no:2,name:"plugins",kind:"message",T:()=>ii},{no:3,name:"chat",kind:"message",T:()=>mi},{no:4,name:"accept_waiting_requests",kind:"scalar",opt:!0,T:8},{no:5,name:"can_accept_production_requests",kind:"scalar",opt:!0,T:8},{no:6,name:"can_edit_display_name",kind:"scalar",opt:!0,T:8},{no:7,name:"can_record",kind:"scalar",opt:!0,T:8},{no:8,name:"can_livestream",kind:"scalar",opt:!0,T:8},{no:9,name:"can_spotlight",kind:"scalar",opt:!0,T:8},{no:10,name:"disable_participant_audio",kind:"scalar",opt:!0,T:8},{no:11,name:"disable_participant_screensharing",kind:"scalar",opt:!0,T:8},{no:12,name:"disable_participant_video",kind:"scalar",opt:!0,T:8},{no:13,name:"kick_participant",kind:"scalar",opt:!0,T:8},{no:14,name:"pin_participant",kind:"scalar",opt:!0,T:8},{no:15,name:"transcription_enabled",kind:"scalar",opt:!0,T:8},{no:16,name:"waiting_room_type",kind:"enum",opt:!0,T:()=>["socket.preset.WaitingRoomType",hn,"WAITING_ROOM_TYPE_"]},{no:17,name:"is_recorder",kind:"scalar",opt:!0,T:8},{no:18,name:"recorder_type",kind:"enum",opt:!0,T:()=>["socket.room.RecorderType",pn,"RECORDER_TYPE_"]},{no:19,name:"hidden_participant",kind:"scalar",opt:!0,T:8},{no:20,name:"show_participant_list",kind:"scalar",opt:!0,T:8},{no:21,name:"can_change_participant_permissions",kind:"scalar",opt:!0,T:8},{no:22,name:"connected_meetings",kind:"message",T:()=>hi},{no:23,name:"media",kind:"message",T:()=>Ti}])}}const bn=new wi;class yi extends u{constructor(){super("socket.preset.ReadPeersPresetRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new yi;class _i extends u{constructor(){super("socket.preset.PeerPreset",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"preset",kind:"scalar",T:12}])}}const bi=new _i;class vi extends u{constructor(){super("socket.preset.ReadPeersPresetResponse",[{no:1,name:"peer_presets",kind:"message",repeat:1,T:()=>bi}])}}new vi;class Ei extends u{constructor(){super("socket.preset.UpdatePeerPreset",[{no:1,name:"user_ids",kind:"scalar",T:9},{no:2,name:"patch",kind:"message",T:()=>bn}])}}const At=new Ei;class Ri extends u{constructor(){super("socket.preset.UpdatePeersPresetRequest",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>At}])}}new Ri;class Oi extends u{constructor(){super("socket.preset.UpdatePeersPresetResponse",[{no:1,name:"update_peers_presets",kind:"message",repeat:1,T:()=>At}])}}new Oi;class Si extends u{constructor(){super("socket.preset.PeerUserIDMap",[{no:1,name:"peer_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9}])}}const Ni=new Si;class xi extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetRequest",[{no:1,name:"peers",kind:"message",repeat:1,T:()=>Ni},{no:2,name:"patch",kind:"message",T:()=>bn}])}}new xi;class Ii extends u{constructor(){super("socket.preset.BulkUpdatePeerPresetResponse",[{no:2,name:"patch",kind:"message",T:()=>bn}])}}new Ii;class Ci extends u{constructor(){super("socket.chat.ChatMessage",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"user_id",kind:"scalar",T:9},{no:4,name:"display_name",kind:"scalar",T:9},{no:5,name:"pinned",kind:"scalar",T:8},{no:6,name:"is_edited",kind:"scalar",T:8},{no:7,name:"payload_type",kind:"scalar",T:5},{no:8,name:"payload",kind:"scalar",T:9},{no:10,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:11,name:"created_at",kind:"scalar",T:4,L:2},{no:12,name:"created_at_ms",kind:"scalar",opt:!0,T:4,L:2},{no:13,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:14,name:"channel_index",kind:"scalar",opt:!0,T:9}])}}const te=new Ci;class Pi extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Pi;class Li extends u{constructor(){super("socket.chat.GetPaginatedChatMessageRoomResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>te},{no:2,name:"next",kind:"scalar",T:8}])}}new Li;class Ai extends u{constructor(){super("socket.chat.GetChatMessagesResponse",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>te}])}}new Ai;class Bi extends u{constructor(){super("socket.chat.SendChatMessageToRoomRequest",[{no:1,name:"payload_type",kind:"scalar",T:5},{no:2,name:"payload",kind:"scalar",T:9}])}}new Bi;class Di extends u{constructor(){super("socket.chat.SendChatMessageToRoomResponse",[{no:1,name:"message",kind:"message",T:()=>te}])}}new Di;class Mi extends u{constructor(){super("socket.chat.SendChatMessageToPeersRequest",[{no:1,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new Mi;class Fi extends u{constructor(){super("socket.chat.SendChatMessageToPeersResponse",[{no:1,name:"message",kind:"message",T:()=>te}])}}new Fi;class Ui extends u{constructor(){super("socket.chat.SendChatMessageToChannelRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",T:5},{no:3,name:"payload",kind:"scalar",T:9}])}}new Ui;class qi extends u{constructor(){super("socket.chat.SendChatMessageToChannelResponse",[{no:1,name:"message",kind:"message",T:()=>te}])}}new qi;class Vi extends u{constructor(){super("socket.chat.EditChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"payload_type",kind:"scalar",opt:!0,T:5},{no:3,name:"payload",kind:"scalar",opt:!0,T:9},{no:4,name:"pinned",kind:"scalar",opt:!0,T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Vi;class Gi extends u{constructor(){super("socket.chat.PinChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Gi;class ji extends u{constructor(){super("socket.chat.PinChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"pinned",kind:"scalar",T:8},{no:3,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new ji;class Wi extends u{constructor(){super("socket.chat.EditChatMessageResponse",[{no:1,name:"message",kind:"message",T:()=>te}])}}new Wi;class Ki extends u{constructor(){super("socket.chat.DeleteChatMessageRequest",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Ki;class Ji extends u{constructor(){super("socket.chat.DeleteChatMessageResponse",[{no:1,name:"chat_id",kind:"scalar",T:9},{no:2,name:"channel_id",kind:"scalar",opt:!0,T:9}])}}new Ji;class Zi extends u{constructor(){super("socket.chat.SearchChatMessagesRequest",[{no:1,name:"time_stamp",kind:"scalar",T:4,L:2},{no:2,name:"size",kind:"scalar",T:5},{no:3,name:"from",kind:"scalar",T:5},{no:4,name:"reversed",kind:"scalar",T:8},{no:5,name:"channel_id",kind:"scalar",opt:!0,T:9},{no:6,name:"search_term",kind:"scalar",T:9}])}}new Zi;class Xi extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadRequest",[{no:1,name:"channel_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"channel_index",kind:"scalar",T:9}])}}new Xi;class $i extends u{constructor(){super("socket.chat.MarkChannelIndexAsReadResponse",[{no:1,name:"channel_index",kind:"scalar",T:9}])}}new $i;class Yi extends u{constructor(){super("socket.chat.CreateChatChannelRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8}])}}new Yi;class zi extends u{constructor(){super("socket.chat.UpdateChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",opt:!0,T:9},{no:3,name:"target_user_ids",kind:"scalar",repeat:2,T:9},{no:4,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:5,name:"visibility",kind:"scalar",opt:!0,T:9},{no:6,name:"is_direct_message",kind:"scalar",opt:!0,T:8}])}}new zi;class Hi extends u{constructor(){super("socket.chat.CreateChatChannelResponse",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Hi;class Qi extends u{constructor(){super("socket.chat.GetChatChannelRequest",[{no:1,name:"chat_channel_id",kind:"scalar",T:9}])}}new Qi;class ec extends u{constructor(){super("socket.chat.LatestMessageAndUnreadCount",[{no:1,name:"message",kind:"message",T:()=>te},{no:2,name:"unread_count",kind:"scalar",T:4,L:2}])}}const nc=new ec;class tc extends u{constructor(){super("socket.chat.ChatChannel",[{no:1,name:"chat_channel_id",kind:"scalar",T:9},{no:2,name:"display_name",kind:"scalar",T:9},{no:3,name:"display_picture_url",kind:"scalar",opt:!0,T:9},{no:4,name:"visibility",kind:"scalar",T:9},{no:5,name:"is_direct_message",kind:"scalar",T:8},{no:6,name:"latest_message_and_unread_count",kind:"message",T:()=>nc},{no:7,name:"target_user_ids",kind:"scalar",repeat:2,T:9}])}}const sc=new tc;class rc extends u{constructor(){super("socket.chat.GetChatChannelResponse",[{no:1,name:"chat_channels",kind:"message",repeat:1,T:()=>sc}])}}new rc;class oc extends u{constructor(){super("socket.chat.ChannelMember",[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",opt:!0,T:9},{no:3,name:"picture",kind:"scalar",opt:!0,T:9},{no:4,name:"custom_participant_id",kind:"scalar",T:9}])}}const ac=new oc;class ic extends u{constructor(){super("socket.chat.GetChatChannelMembersResponse",[{no:1,name:"channel_members",kind:"message",repeat:1,T:()=>ac}])}}new ic;class cc extends u{constructor(){super("socket.plugin.AddPluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new cc;class uc extends u{constructor(){super("socket.plugin.RemovePluginRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"staggered",kind:"scalar",T:8}])}}new uc;class lc extends u{constructor(){super("socket.plugin.EnablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new lc;class dc extends u{constructor(){super("socket.plugin.DisablePluginForRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9}])}}new dc;class pc extends u{constructor(){super("socket.plugin.EnablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new pc;class mc extends u{constructor(){super("socket.plugin.DisablePluginForPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9}])}}new mc;class fc extends u{constructor(){super("socket.plugin.PluginEventToRoomRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new fc;class hc extends u{constructor(){super("socket.plugin.PluginEventToPeersRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"peer_ids",kind:"scalar",repeat:2,T:9},{no:3,name:"plugin_data",kind:"scalar",T:12}])}}new hc;class gc extends u{constructor(){super("socket.plugin.StoreKeys",[{no:1,name:"store_key",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",opt:!0,T:12}])}}const vn=new gc;class kc extends u{constructor(){super("socket.plugin.PluginStoreInsertKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"insert_keys",kind:"message",repeat:1,T:()=>vn}])}}new kc;class Tc extends u{constructor(){super("socket.plugin.PluginStoreGetKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"get_keys",kind:"message",repeat:1,T:()=>vn}])}}new Tc;class wc extends u{constructor(){super("socket.plugin.PluginStoreDeleteKeysRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"delete_keys",kind:"message",repeat:1,T:()=>vn}])}}new wc;class yc extends u{constructor(){super("socket.plugin.PluginStoreDeleteRequest",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9}])}}new yc;class _c extends u{constructor(){super("socket.plugin.EnablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"enabled_by",kind:"scalar",T:9}])}}const bc=new _c;class vc extends u{constructor(){super("socket.plugin.EnablePluginsResponse",[{no:1,name:"plugins",kind:"message",repeat:1,T:()=>bc}])}}new vc;class Ec extends u{constructor(){super("socket.plugin.DisablePluginResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"disabled_by",kind:"scalar",T:9}])}}new Ec;class Rc extends u{constructor(){super("socket.plugin.PluginStoreItem",[{no:1,name:"timestamp",kind:"scalar",T:9},{no:2,name:"peer_id",kind:"scalar",T:9},{no:3,name:"store_key",kind:"scalar",T:9},{no:4,name:"payload",kind:"scalar",T:12}])}}const Oc=new Rc;class Sc extends u{constructor(){super("socket.plugin.PluginStoreResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"store_name",kind:"scalar",T:9},{no:3,name:"store_items",kind:"message",repeat:1,T:()=>Oc}])}}new Sc;class Nc extends u{constructor(){super("socket.plugin.PluginEventResponse",[{no:1,name:"plugin_id",kind:"scalar",T:9},{no:2,name:"plugin_data",kind:"scalar",T:12}])}}new Nc;class xc extends u{constructor(){super("socket.livestreaming.LiveStreamingEvent",[{no:1,name:"livestream_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"meeting_id",kind:"scalar",T:9},{no:5,name:"playback_url",kind:"scalar",T:9},{no:6,name:"org_id",kind:"scalar",T:9},{no:7,name:"room_name",kind:"scalar",T:9},{no:8,name:"room_uuid",kind:"scalar",T:9},{no:9,name:"status",kind:"scalar",T:9},{no:10,name:"manual_ingest",kind:"scalar",opt:!0,T:8}])}}new xc;class Ic extends u{constructor(){super("socket.livestreaming.GetStagePeersResponse",[{no:1,name:"stage_peers",kind:"scalar",repeat:2,T:9}])}}new Ic;class Cc extends u{constructor(){super("socket.livestreaming.StageRequest",[{no:1,name:"display_name",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9}])}}const Pc=new Cc;class Lc extends u{constructor(){super("socket.livestreaming.GetStageRequestsResponse",[{no:1,name:"stage_requests",kind:"message",repeat:1,T:()=>Pc}])}}new Lc;class Ac extends u{constructor(){super("socket.livestreaming.GrantStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Ac;class Bc extends u{constructor(){super("socket.livestreaming.DenyStageAccessRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Bc;class Dc extends u{constructor(){super("socket.livestreaming.LeaveStageRequest",[{no:1,name:"user_ids",kind:"scalar",repeat:2,T:9}])}}new Dc;class Mc extends u{constructor(){super("socket.polls.Poll",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"created_by",kind:"scalar",T:9},{no:3,name:"created_by_user_id",kind:"scalar",T:9},{no:4,name:"question",kind:"scalar",T:9},{no:5,name:"options",kind:"message",repeat:1,T:()=>Uc},{no:6,name:"hide_votes",kind:"scalar",T:8},{no:7,name:"anonymous",kind:"scalar",T:8},{no:8,name:"votes",kind:"scalar",repeat:2,T:9}])}}const Bt=new Mc;class Fc extends u{constructor(){super("socket.polls.PollOption",[{no:1,name:"text",kind:"scalar",T:9},{no:2,name:"count",kind:"scalar",opt:!0,T:4,L:2},{no:3,name:"votes",kind:"message",repeat:1,T:()=>Vc}])}}const Uc=new Fc;class qc extends u{constructor(){super("socket.polls.PollVote",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9}])}}const Vc=new qc;class Gc extends u{constructor(){super("socket.polls.NewPollRequest",[{no:1,name:"question",kind:"scalar",T:9},{no:2,name:"options",kind:"scalar",repeat:2,T:9},{no:3,name:"anonymous",kind:"scalar",T:8},{no:4,name:"hide_votes",kind:"scalar",T:8},{no:5,name:"created_by",kind:"scalar",opt:!0,T:9},{no:6,name:"created_by_user_id",kind:"scalar",opt:!0,T:9}])}}new Gc;class jc extends u{constructor(){super("socket.polls.VotePollRequest",[{no:1,name:"poll_id",kind:"scalar",T:9},{no:2,name:"index",kind:"scalar",T:4,L:2}])}}new jc;class Wc extends u{constructor(){super("socket.polls.UpdatePollResponse",[{no:1,name:"poll",kind:"message",T:()=>Bt}])}}new Wc;class Kc extends u{constructor(){super("socket.polls.GetPollsResponse",[{no:1,name:"polls",kind:"message",repeat:1,T:()=>Bt}])}}new Kc;class Jc extends u{constructor(){super("socket.recording.RecordingEvent",[{no:1,name:"recording_id",kind:"scalar",T:9},{no:2,name:"err_message",kind:"scalar",T:9},{no:3,name:"recording_type",kind:"enum",T:()=>["common.RecordingType",Fe]}])}}new Jc;class Zc extends u{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const n=this.create(),t=Date.now();return n.seconds=x.from(Math.floor(t/1e3)).toBigInt(),n.nanos=t%1e3*1e6,n}toDate(n){return new Date(x.from(n.seconds).toNumber()*1e3+Math.ceil(n.nanos/1e6))}fromDate(n){const t=this.create(),s=n.getTime();return t.seconds=x.from(Math.floor(s/1e3)).toBigInt(),t.nanos=s%1e3*1e6,t}internalJsonWrite(n,t){let s=x.from(n.seconds).toNumber()*1e3;if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(n.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let r="Z";if(n.nanos>0){let o=(n.nanos+1e9).toString().substring(1);o.substring(3)==="000000"?r="."+o.substring(0,3)+"Z":o.substring(6)==="000"?r="."+o.substring(0,6)+"Z":r="."+o+"Z"}return new Date(s).toISOString().replace(".000Z",r)}internalJsonRead(n,t,s){if(typeof n!="string")throw new Error("Unable to parse Timestamp from JSON "+wn(n)+".");let r=n.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let o=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(o))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(o<Date.parse("0001-01-01T00:00:00Z")||o>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return s||(s=this.create()),s.seconds=x.from(o/1e3).toBigInt(),s.nanos=0,r[7]&&(s.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),s}}new Zc;class Xc extends u{constructor(){super("common.BaseHubMessage",[{no:1,name:"event",kind:"scalar",T:5},{no:2,name:"id",kind:"scalar",T:9},{no:3,name:"peer_id",kind:"scalar",T:9},{no:4,name:"room_id",kind:"scalar",T:9},{no:5,name:"user_id",kind:"scalar",T:9},{no:6,name:"payload",kind:"scalar",T:12},{no:7,name:"error",kind:"scalar",opt:!0,T:8},{no:8,name:"sid",kind:"scalar",opt:!0,T:9},{no:9,name:"room_object_id",kind:"scalar",opt:!0,T:9},{no:10,name:"preset",kind:"scalar",opt:!0,T:9},{no:11,name:"use_start_session",kind:"scalar",opt:!0,T:8}])}}const gn=new Xc;class $c extends u{constructor(){super("common.BulkedHubMessage",[{no:1,name:"messages",kind:"message",repeat:1,T:()=>gn}])}}new $c;class Yc extends u{constructor(){super("common.CFWorkersResponse",[{no:1,name:"responses",kind:"message",repeat:1,T:()=>gn},{no:2,name:"broadcast_responses",kind:"message",repeat:1,T:()=>gn}])}}new Yc;const zc=0,Hc=1,Qc=2,eu=3,nu=4,tu=5,su={getPeerInfo:0,updatePeerInfo:1,getRoomPeersInfo:2,joinRoom:3,leaveRoom:4,getRoomInfo:5,updateRoomInfo:6,closeRoom:7,startedLivestream:8,stoppedLivestream:9,erroredLivestream:10,getStagePeers:11,getStageRequests:12,requestStageAccess:13,cancelStageRequest:14,grantStageAccess:15,denyStageAccess:16,roomPeerCount:17,joinStage:18,leaveStage:19,getConnectedRoomsDump:20,createConnectedRooms:21,deleteConnectedRooms:22,movePeers:23,transferPeer:24,movedPeer:25,connectedRoomsUpdated:26,connectedRoomsDeleted:27,getAllAddedParticipants:28,broadcastMessage:29,kick:30,kickAll:31,transcript:32,getWaitingRoomRequests:33,acceptWaitingRoomRequests:34,waitingRoomRequestAccepted:35,denyWaitingRoomRequests:36,waitingRoomRequestDenied:37,peerStageStatusUpdate:38,broadcastToEntity:39,recordingStarted:40,recordingStopped:41,recordingPaused:42,getRoomStageState:43,livestreamingInvoked:44},ru={getMessages:0,sendMessageToRoom:1,sendMessageToPeers:2,editMessage:3,deleteMessage:4,getPaginatedMessages:5,sendMessageToChannel:6,searchChannelMessages:7,getAllChatChannels:8,markChannelIndexAsRead:9,pinMessage:10},ou={getPlugins:0,addPlugin:1,enablePluginForRoom:2,disablePluginForPeers:3,enablePluginForPeers:4,disablePluginForRoom:5,removePlugin:6,customPluginEventToRoom:7,customPluginEventToPeers:8,storeInsertKeys:9,storeGetKeys:10,storeDeleteKeys:11,storeDelete:12},au={createPoll:0,getPolls:1,votePoll:2,updatePoll:3},Dt={unknown:0,createWebRTCTransport:1,produce:2,consume:3,toggleProducer:4,toggleConsumer:5,closeProducer:6,closeConsumer:7,updateConsumersSimulcastConfig:8,joinRoom:16,leaveRoom:17,selectedPeer:18,globalPinPeer:19,selfJoinComplete:20,peerJoinedBroadcast:25,peerLeaveBroadcast:26,peerProducerCreateBroadcast:27,peerProducerToggleBroadcast:28,peerProducerCloseBroadcast:29,globalPeerPinBroadcast:30,recordingStartedBroadcast:31,recordingStoppedBroadcast:32,peerDisplayNameEditBroadcast:33,mediaRoomTerminationBroadcastResponse:36,selectedPeerDiff:40,renegotiateSessionDescription:50,errorResponse:60,kickPeer:90,kickAll:91,changeDisplayName:92,hostControlPeer:93,hostControlAllPeers:94,audioActivity:100},iu={createChatChannel:0,getChatChannel:1,deprecatedGetAllChatChannels:2,getChannelMembers:3,updateChatChannel:4},cu={getUserPresets:0,updateUserPreset:1};function de(e,n){return Object.keys(n).reduce((t,s)=>(t[s]=(e<<16)+n[s],t),{})}function Mt(e,n){return Object.keys(e).reduce((t,s)=>(t[s]=n|e[s],t),{})}const Se=de(zc,su);de(Hc,ru);de(Qc,ou);de(eu,au);de(nu,iu);const sn=Mt(Dt,16777216);Mt(Dt,50331648);de(tu,cu);const Ft="ws://localhost:8080/ws";class uu extends we.WebSocket{constructor(n,t){super(Ft,t)}}var ge,kn,ke,Tn;class lu{constructor(){Oe(this,ge,void 0),Oe(this,kn,[]),Oe(this,ke,void 0),Oe(this,Tn,15e3),R(this,"roomId","roomId"),R(this,"roomUuid","roomUuid"),R(this,"cleanBuffer",n=>n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength))}init({peerId:n,mockParticipants:t}){Gn(this,ke,n),window.WebSocket=uu,Gn(this,ge,t);const{RTK_MOCK_SERVER:s}=window;if(s)try{s.close()}catch(o){}const r=new we.Server(Ft,{mock:!1});window.RTK_MOCK_SERVER=r,r.on("connection",o=>{ie(this,kn).push(o),this.addConnectionListeners(o)})}addConnectionListeners(n){n.on("message",t=>{if(t==="3")return;const s=Xn.fromBinary(t);let r;switch(s.event){case Se.joinRoom:{r=Hn.toBinary(Hn.fromJson({peer:{peerId:ie(this,ke),userId:"self-userId",displayName:"name",waitlisted:!1,stageType:ye.ON_STAGE}}));break}case Se.getRoomPeersInfo:{r=aa.toBinary({peers:ie(this,ge).map(h=>Ls(Vn({},h),{userId:h.peerId,waitlisted:!1,stageType:1}))});break}case Se.getRoomInfo:{r=pa.toBinary({room:{roomId:this.roomId,title:"title",createdAt:Date.now(),activeRecordings:[],roomUuid:this.roomUuid}});break}case sn.createWebRTCTransport:{r=Nt.toBinary({transportId:"transportId",description:{type:"answer",sdp:"sdp",target:Me.PUBLISHER},producerIds:[]});break}case sn.selfJoinComplete:{const h=ie(this,ge).map(T=>Vn({producerStates:[]},T));r=ho.toBinary({maxPreferredStreams:6,participants:h,selectedPeers:{audioPeers:[],compulsoryPeers:[]},roomState:{displayTitle:"title",lockedMode:!1,roomUuid:this.roomUuid,roomName:this.roomUuid,currentPeerId:ie(this,ke),pinnedPeerIds:[]}});break}case Se.getConnectedRoomsDump:{r=Ea.toBinary({parentMeeting:{participants:[]},meetings:[]});break}case sn.produce:{r=yo.toBinary({status:!0,producerId:"producer-id"});break}}const o={event:s.event,id:s.id,payload:r},l=Xn.toBinary(o),p=this.cleanBuffer(l);n.send(p)}),setInterval(()=>{n.send("2")},ie(this,Tn))}}ge=new WeakMap,kn=new WeakMap,ke=new WeakMap,Tn=new WeakMap;function du(e){new lu().init(e),window.RTCPeerConnection=js,window.fetch=()=>As(this,null,function*(){const n=new window.Response(JSON.stringify({}),{status:200,headers:{"Content-type":"application/json"}});return Promise.resolve(n)})}exports.setupStubs=du;