// Build: 2023/9/5 22:23:15 (()=>{console.time=function(n){this._times=this._times||{},this._times[n]=Date.now()};console.timeEnd=function(n){if(this._times&&this._times[n]){let e=Date.now()-this._times[n];console.log(`${n}: ${e}ms`),delete this._times[n]}else console.log(`Timer with label ${n} does not exist.`)};function Kn(n){"use strict";function e(){}function t(){}var r=String.fromCharCode,i={}.toString,s=i.call(n.SharedArrayBuffer),l=i(),o=n.Uint8Array,a=o||Array,f=o?ArrayBuffer:a,u=f.isView||function(E){return E&&"length"in E},p=i.call(f.prototype);f=t.prototype;var g=n.TextEncoder,d=new(o?Uint16Array:a)(32);e.prototype.decode=function(E){if(!u(E)){var S=i.call(E);if(S!==p&&S!==s&&S!==l)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");E=o?new a(E):E||[]}for(var B=S="",k=0,N=E.length|0,K=N-32|0,U,T,V=0,z=0,L,C=0,R=-1;k>4){case 15:if(L=E[k=k+1|0]&255,L>>6!==2||247>6===2?z+4|0:24,T=T+256&768;case 13:case 12:L=E[k=k+1|0]&255,V<<=6,V|=(T&31)<<6|L&63,z=z+7|0,k>6===2&&V>>z&&1114112>V?(T=V,V=V-65536|0,0<=V&&(R=(V>>10)+55296|0,T=(V&1023)+56320|0,31>C?(d[C]=R,C=C+1|0,R=-1):(L=R,R=T,T=L))):(T>>=8,k=k-T-1|0,T=65533),V=z=0,U=k<=K?32:N-k|0;default:d[C]=T;continue;case 11:case 10:case 9:case 8:}d[C]=65533}if(B+=r(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15],d[16],d[17],d[18],d[19],d[20],d[21],d[22],d[23],d[24],d[25],d[26],d[27],d[28],d[29],d[30],d[31]),32>C&&(B=B.slice(0,C-32|0)),k>>31,R=-1,B.length=U)B[N]=U;else{if(2047>=U)B[N]=192|U>>6;else{e:{if(55296<=U)if(56319>=U){var T=E.charCodeAt(k=k+1|0)|0;if(56320<=T&&57343>=T){if(U=(U<<10)+T-56613888|0,65535>18,B[N=N+1|0]=128|U>>12&63,B[N=N+1|0]=128|U>>6&63,B[N=N+1|0]=128|U&63;continue}break e}U=65533}else 57343>=U&&(U=65533);!K&&k<<1>12,B[N=N+1|0]=128|U>>6&63}B[N=N+1|0]=128|U&63}}return o?B.subarray(0,N):B.slice(0,N)},n.TextDecoder=e,n.TextEncoder=t}var y=Kn(globalThis);var P=Uint8Array,ie=Uint16Array,Jn=Int32Array,tn=new P([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nn=new P([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yn=new P([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rn=function(n,e){for(var t=new ie(31),r=0;r<31;++r)t[r]=e+=1<>1|(I&21845)<<1,J=(J&52428)>>2|(J&13107)<<2,J=(J&61680)>>4|(J&3855)<<4,Ce[I]=((J&65280)>>8|(J&255)<<8)>>1;var J,I,fe=function(n,e,t){for(var r=n.length,i=0,s=new ie(e);i>a]=f}else for(o=new ie(r),i=0;i>15-n[i]);return o},ue=new P(288);for(I=0;I<144;++I)ue[I]=8;var I;for(I=144;I<256;++I)ue[I]=9;var I;for(I=256;I<280;++I)ue[I]=7;var I;for(I=280;I<288;++I)ue[I]=8;var I,ln=new P(32);for(I=0;I<32;++I)ln[I]=5;var I;var qn=fe(ue,9,1);var Hn=fe(ln,5,1),Le=function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},M=function(n,e,t){var r=e/8|0;return(n[r]|n[r+1]<<8)>>(e&7)&t},De=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},Qn=function(n){return(n+7)/8|0},er=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var r=new P(t-e);return r.set(n.subarray(e,t)),r};var tr=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],G=function(n,e,t){var r=new Error(e||tr[n]);if(r.code=n,Error.captureStackTrace&&Error.captureStackTrace(r,G),!t)throw r;return r},nr=function(n,e,t,r){var i=n.length,s=r?r.length:0;if(!i||e.f&&!e.l)return t||new P(0);var l=!t||e.i!=2,o=e.i;t||(t=new P(i*3));var a=function(Ht){var Qt=t.length;if(Ht>Qt){var en=new P(Math.max(Qt*2,Ht));en.set(t),t=en}},f=e.f||0,u=e.p||0,p=e.b||0,g=e.l,d=e.d,E=e.m,S=e.n,B=i*8;do{if(!g){f=M(n,u,1);var k=M(n,u+1,3);if(u+=3,k)if(k==1)g=qn,d=Hn,E=9,S=5;else if(k==2){var T=M(n,u,31)+257,V=M(n,u+10,15)+4,z=T+M(n,u+5,31)+1;u+=14;for(var L=new P(z),C=new P(19),R=0;R>4;if(N<16)L[R++]=N;else{var ne=0,ye=0;for(N==16?(ye=3+M(n,u,3),u+=2,ne=L[R-1]):N==17?(ye=3+M(n,u,7),u+=3):N==18&&(ye=11+M(n,u,127),u+=7);ye--;)L[R++]=ne}}var Xt=L.subarray(0,T),_=L.subarray(T);E=Le(Xt),S=Le(_),g=fe(Xt,E,1),d=fe(_,S,1)}else G(1);else{var N=Qn(u)+4,K=n[N-4]|n[N-3]<<8,U=N+K;if(U>i){o&&G(0);break}l&&a(p+K),t.set(n.subarray(N,U),p),e.b=p+=K,e.p=u=U*8,e.f=f;continue}if(u>B){o&&G(0);break}}l&&a(p+131072);for(var Gn=(1<>4;if(u+=ne&15,u>B){o&&G(0);break}if(ne||G(2),re<256)t[p++]=re;else if(re==256){Fe=u,g=null;break}else{var Zt=re-254;if(re>264){var R=re-257,le=tn[R];Zt=M(n,u,(1<>4;Re||G(3),u+=Re&15;var _=Zn[Se];if(Se>3){var le=nn[Se];_+=De(n,u)&(1<B){o&&G(0);break}l&&a(p+131072);var Ve=p+Zt;if(p<_){var qt=s-_,jn=Math.min(_,Ve);for(qt+p<0&&G(3);p>3&1)+(e>>4&1);r>0;r-=!n[t++]);return t+(e&2)},sr=function(n){var e=n.length;return(n[e-4]|n[e-3]<<8|n[e-2]<<16|n[e-1]<<24)>>>0};function fn(n,e){var t=ir(n);return t+8>n.length&&G(6,"invalid gzip data"),nr(n.subarray(t,-8),{i:2},e&&e.out||new P(sr(n)),e&&e.dictionary)}var or=typeof TextDecoder<"u"&&new TextDecoder,ar=0;try{or.decode(rr,{stream:!0}),ar=1}catch{}function Q(n){let e=typeof n;if(e=="object"){if(Array.isArray(n))return"array";if(n===null)return"null"}return e}function se(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}var Y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),ve=[];for(let n=0;n>4,l=s,i=2;break;case 2:t[r++]=(l&15)<<4|(s&60)>>2,l=s,i=3;break;case 3:t[r++]=(l&3)<<6|s,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,r)}function hn(n){let e="",t=0,r,i=0;for(let s=0;s>2],i=(r&3)<<4,t=1;break;case 1:e+=Y[i|r>>4],i=(r&15)<<2,t=2;break;case 2:e+=Y[i|r>>6],e+=Y[r&63],t=0;break}return t&&(e+=Y[i],e+="=",t==1&&(e+="=")),e}var m;(function(n){n.symbol=Symbol.for("protobuf-ts/unknown"),n.onRead=(t,r,i,s,l)=>{(e(r)?r[n.symbol]:r[n.symbol]=[]).push({no:i,wireType:s,data:l})},n.onWrite=(t,r,i)=>{for(let{no:s,wireType:l,data:o}of n.list(r))i.tag(s,l).raw(o)},n.list=(t,r)=>{if(e(t)){let i=t[n.symbol];return r?i.filter(s=>s.no==r):i}return[]},n.last=(t,r)=>n.list(t,r).slice(-1)[0];let e=t=>t&&Array.isArray(t[n.symbol])})(m||(m={}));var c;(function(n){n[n.Varint=0]="Varint",n[n.Bit64=1]="Bit64",n[n.LengthDelimited=2]="LengthDelimited",n[n.StartGroup=3]="StartGroup",n[n.EndGroup=4]="EndGroup",n[n.Bit32=5]="Bit32"})(c||(c={}));function cn(){let n=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(n|=(i&127)<>4,!(t&128))return this.assertBounds(),[n,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<>>s,o=!(!(l>>>7)&&e==0),a=(o?l|128:l)&255;if(t.push(a),!o)return}let r=n>>>28&15|(e&7)<<4,i=!!(e>>3);if(t.push((i?r|128:r)&255),!!i){for(let s=3;s<31;s=s+7){let l=e>>>s,o=!!(l>>>7),a=(o?l|128:l)&255;if(t.push(a),!o)return}t.push(e>>>31&1)}}var be=65536*65536;function We(n){let e=n[0]=="-";e&&(n=n.slice(1));let t=1e6,r=0,i=0;function s(l,o){let a=Number(n.slice(l,o));i*=t,r=r*t+a,r>=be&&(i=i+(r/be|0),r=r%be)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),[e,r,i]}function Ne(n,e){if(e<=2097151)return""+(be*e+(n>>>0));let t=n&16777215,r=(n>>>24|e<<8)>>>0&16777215,i=e>>16&65535,s=t+r*6777216+i*6710656,l=r+i*8147497,o=i*2,a=1e7;s>=a&&(l+=Math.floor(s/a),s%=a),l>=a&&(o+=Math.floor(l/a),l%=a);function f(u,p){let g=u?String(u):"";return p?"0000000".slice(g.length)+g:g}return f(o,0)+f(l,o)+f(s,1)}function $e(n,e){if(n>=0){for(;n>127;)e.push(n&127|128),n=n>>>7;e.push(n)}else{for(let t=0;t<9;t++)e.push(n&127|128),n=n>>7;e.push(1)}}function mn(){let n=this.buf[this.pos++],e=n&127;if(!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<7,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<14,!(n&128))return this.assertBounds(),e;if(n=this.buf[this.pos++],e|=(n&127)<<21,!(n&128))return this.assertBounds(),e;n=this.buf[this.pos++],e|=(n&15)<<28;for(let t=5;n&128&&t<10;t++)n=this.buf[this.pos++];if(n&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function lr(){let n=new DataView(new ArrayBuffer(8));return globalThis.BigInt!==void 0&&typeof n.getBigInt64=="function"&&typeof n.getBigUint64=="function"&&typeof n.setBigInt64=="function"&&typeof n.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:n}:void 0}var A=lr();function pn(n){if(!n)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}var dn=/^-?[0-9]+$/,Ee=65536*65536,xe=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*Ee+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}},F=class extends xe{static from(e){if(A)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=A.C(e);case"number":if(e===0)return this.ZERO;e=A.C(e);case"bigint":if(!e)return this.ZERO;if(eA.UMAX)throw new Error("ulong too large");return A.V.setBigUint64(0,e,!0),new F(A.V.getInt32(0,!0),A.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!dn.test(e))throw new Error("string is no integer");let[t,r,i]=We(e);if(t)throw new Error("signed value");return new F(r,i);case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");if(e<0)throw new Error("signed value for ulong");return new F(e,e/Ee)}throw new Error("unknown value "+typeof e)}toString(){return A?this.toBigInt().toString():Ne(this.lo,this.hi)}toBigInt(){return pn(A),A.V.setInt32(0,this.lo,!0),A.V.setInt32(4,this.hi,!0),A.V.getBigUint64(0,!0)}};F.ZERO=new F(0,0);var O=class extends xe{static from(e){if(A)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=A.C(e);case"number":if(e===0)return this.ZERO;e=A.C(e);case"bigint":if(!e)return this.ZERO;if(eA.MAX)throw new Error("ulong too large");return A.V.setBigInt64(0,e,!0),new O(A.V.getInt32(0,!0),A.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!dn.test(e))throw new Error("string is no integer");let[t,r,i]=We(e),s=new O(r,i);return t?s.negate():s;case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new O(e,e/Ee):new O(-e,-e/Ee).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return(this.hi&2147483648)!==0}negate(){let e=~this.hi,t=this.lo;return t?t=~t+1:e+=1,new O(t,e)}toString(){if(A)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+Ne(e.lo,e.hi)}return Ne(this.lo,this.hi)}toBigInt(){return pn(A),A.V.setInt32(0,this.lo,!0),A.V.setInt32(4,this.hi,!0),A.V.getBigInt64(0,!0)}};O.ZERO=new O(0,0);var gn={readUnknownField:!0,readerFactory:n=>new Pe(n)};function wn(n){return n?Object.assign(Object.assign({},gn),n):gn}var Pe=class{constructor(e,t){this.varint64=cn,this.uint32=mn,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,r=e&7;if(t<=0||r<0||r>5)throw new Error("illegal tag: field no "+t+" wire type "+r);return[t,r]}skip(e){let t=this.pos;switch(e){case c.Varint:for(;this.buf[this.pos++]&128;);break;case c.Bit64:this.pos+=4;case c.Bit32:this.pos+=4;break;case c.LengthDelimited:let r=this.uint32();this.pos+=r;break;case c.StartGroup:let i;for(;(i=this.tag()[1])!==c.EndGroup;)this.skip(i);break;default:throw new Error("cant skip wire type "+e)}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 e=this.uint32();return e>>>1^-(e&1)}int64(){return new O(...this.varint64())}uint64(){return new F(...this.varint64())}sint64(){let[e,t]=this.varint64(),r=-(e&1);return e=(e>>>1|(t&1)<<31)^r,t=t>>>1^r,new O(e,t)}bool(){let[e,t]=this.varint64();return e!==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 F(this.sfixed32(),this.sfixed32())}sfixed64(){return new O(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 e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}};function x(n,e){if(!n)throw new Error(e)}var fr=34028234663852886e22,ur=-34028234663852886e22,hr=4294967295,cr=2147483647,mr=-2147483648;function Z(n){if(typeof n!="number")throw new Error("invalid int 32: "+typeof n);if(!Number.isInteger(n)||n>cr||nhr||n<0)throw new Error("invalid uint 32: "+n)}function oe(n){if(typeof n!="number")throw new Error("invalid float 32: "+typeof n);if(Number.isFinite(n)&&(n>fr||nnew _e};function vn(n){return n?Object.assign(Object.assign({},yn),n):yn}var _e=class{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let i=0;i>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(ee(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return Z(e),$e(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){oe(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){ee(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){Z(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return Z(e),e=(e<<1^e>>31)>>>0,$e(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=O.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),r=new DataView(t.buffer),i=F.from(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(t)}int64(e){let t=O.from(e);return ke(t.lo,t.hi,this.buf),this}sint64(e){let t=O.from(e),r=t.hi>>31,i=t.lo<<1^r,s=(t.hi<<1|t.lo>>>31)^r;return ke(i,s,this.buf),this}uint64(e){let t=F.from(e);return ke(t.lo,t.hi,this.buf),this}};var bn={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},kn={ignoreUnknownFields:!1};function Me(n){return n?Object.assign(Object.assign({},kn),n):kn}function he(n){return n?Object.assign(Object.assign({},bn),n):bn}var v=Symbol.for("protobuf-ts/message-type");function Ge(n){let e=!1,t=[];for(let r=0;r!i.includes(l))||!r&&i.some(l=>!s.known.includes(l)))return!1;if(t<1)return!0;for(let l of s.oneofs){let o=e[l];if(!En(o))return!1;if(o.oneofKind===void 0)continue;let a=this.fields.find(f=>f.localName===o.oneofKind);if(!a||!this.field(o[o.oneofKind],a,r,t))return!1}for(let l of this.fields)if(l.oneof===void 0&&!this.field(e[l.localName],l,r,t))return!1;return!0}field(e,t,r,i){let s=t.repeat;switch(t.kind){case"scalar":return e===void 0?t.opt:s?this.scalars(e,t.T,i,t.L):this.scalar(e,t.T,t.L);case"enum":return e===void 0?t.opt:s?this.scalars(e,h.INT32,i):this.scalar(e,h.INT32);case"message":return e===void 0?!0:s?this.messages(e,t.T(),r,i):this.message(e,t.T(),r,i);case"map":if(typeof e!="object"||e===null)return!1;if(i<2)return!0;if(!this.mapKeys(e,t.K,i))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,i,t.V.L);case"enum":return this.scalars(Object.values(e),h.INT32,i);case"message":return this.messages(Object.values(e),t.V.T(),r,i)}break}return!0}message(e,t,r,i){return r?t.isAssignable(e,i):t.is(e,i)}messages(e,t,r,i){if(!Array.isArray(e))return!1;if(i<2)return!0;if(r){for(let s=0;sparseInt(s)),t,r);case h.BOOL:return this.scalars(i.slice(0,r).map(s=>s=="true"?!0:s=="false"?!1:s),t,r);default:return this.scalars(i,t,r,W.STRING)}}};function $(n,e){switch(e){case W.BIGINT:return n.toBigInt();case W.NUMBER:return n.toNumber();default:return n.toString()}}var Be=class{constructor(e){this.info=e}prepare(){var e;if(this.fMap===void 0){this.fMap={};let t=(e=this.info.fields)!==null&&e!==void 0?e:[];for(let r of t)this.fMap[r.name]=r,this.fMap[r.jsonName]=r,this.fMap[r.localName]=r}}assert(e,t,r){if(!e){let i=Q(r);throw(i=="number"||i=="boolean")&&(i=r.toString()),new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${t}`)}}read(e,t,r){this.prepare();let i=[];for(let[s,l]of Object.entries(e)){let o=this.fMap[s];if(!o){if(!r.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${s}`);continue}let a=o.localName,f;if(o.oneof){if(i.includes(o.oneof))throw new Error(`Multiple members of the oneof group "${o.oneof}" of ${this.info.typeName} are present in JSON.`);i.push(o.oneof),f=t[o.oneof]={oneofKind:a}}else f=t;if(o.kind=="map"){if(l===null)continue;this.assert(se(l),o.name,l);let u=f[a];for(let[p,g]of Object.entries(l)){this.assert(g!==null,o.name+" map value",null);let d;switch(o.V.kind){case"message":d=o.V.T().internalJsonRead(g,r);break;case"enum":if(d=this.enum(o.V.T(),g,o.name,r.ignoreUnknownFields),d===!1)continue;break;case"scalar":d=this.scalar(g,o.V.T,o.V.L,o.name);break}this.assert(d!==void 0,o.name+" map value",g);let E=p;o.K==h.BOOL&&(E=E=="true"?!0:E=="false"?!1:E),E=this.scalar(E,o.K,W.STRING,o.name).toString(),u[E]=d}}else if(o.repeat){if(l===null)continue;this.assert(Array.isArray(l),o.name,l);let u=f[a];for(let p of l){this.assert(p!==null,o.name,null);let g;switch(o.kind){case"message":g=o.T().internalJsonRead(p,r);break;case"enum":if(g=this.enum(o.T(),p,o.name,r.ignoreUnknownFields),g===!1)continue;break;case"scalar":g=this.scalar(p,o.T,o.L,o.name);break}this.assert(g!==void 0,o.name,l),u.push(g)}}else switch(o.kind){case"message":if(l===null&&o.T().typeName!="google.protobuf.Value"){this.assert(o.oneof===void 0,o.name+" (oneof member)",null);continue}f[a]=o.T().internalJsonRead(l,r,f[a]);break;case"enum":let u=this.enum(o.T(),l,o.name,r.ignoreUnknownFields);if(u===!1)continue;f[a]=u;break;case"scalar":f[a]=this.scalar(l,o.T,o.L,o.name);break}}}enum(e,t,r,i){if(e[0]=="google.protobuf.NullValue"&&x(t===null,`Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case"number":return x(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${r}, enum can only be integral number, got ${t}.`),t;case"string":let s=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(s=t.substring(e[2].length));let l=e[1][s];return typeof l>"u"&&i?!1:(x(typeof l=="number",`Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} has no value for "${t}".`),l)}x(!1,`Unable to parse field ${this.info.typeName}#${r}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,r,i){let s;try{switch(t){case h.DOUBLE:case h.FLOAT:if(e===null)return 0;if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""){s="empty string";break}if(typeof e=="string"&&e.trim().length!==e.length){s="extra whitespace";break}if(typeof e!="string"&&typeof e!="number")break;let l=Number(e);if(Number.isNaN(l)){s="not a number";break}if(!Number.isFinite(l)){s="too large or small";break}return t==h.FLOAT&&oe(l),l;case h.INT32:case h.FIXED32:case h.SFIXED32:case h.SINT32:case h.UINT32:if(e===null)return 0;let o;if(typeof e=="number"?o=e:e===""?s="empty string":typeof e=="string"&&(e.trim().length!==e.length?s="extra whitespace":o=Number(e)),o===void 0)break;return t==h.UINT32?ee(o):Z(o),o;case h.INT64:case h.SFIXED64:case h.SINT64:if(e===null)return $(O.ZERO,r);if(typeof e!="number"&&typeof e!="string")break;return $(O.from(e),r);case h.FIXED64:case h.UINT64:if(e===null)return $(F.ZERO,r);if(typeof e!="number"&&typeof e!="string")break;return $(F.from(e),r);case h.BOOL:if(e===null)return!1;if(typeof e!="boolean")break;return e;case h.STRING:if(e===null)return"";if(typeof e!="string"){s="extra whitespace";break}try{encodeURIComponent(e)}catch(a){a="invalid UTF8";break}return e;case h.BYTES:if(e===null||e==="")return new Uint8Array(0);if(typeof e!="string")break;return un(e)}}catch(l){s=l.message}this.assert(!1,i+(s?" - "+s:""),e)}};var Oe=class{constructor(e){var t;this.fields=(t=e.fields)!==null&&t!==void 0?t:[]}write(e,t){let r={},i=e;for(let s of this.fields){if(!s.oneof){let f=this.field(s,i[s.localName],t);f!==void 0&&(r[t.useProtoFieldName?s.name:s.jsonName]=f);continue}let l=i[s.oneof];if(l.oneofKind!==s.localName)continue;let o=s.kind=="scalar"||s.kind=="enum"?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,a=this.field(s,l[s.localName],o);x(a!==void 0),r[t.useProtoFieldName?s.name:s.jsonName]=a}return r}field(e,t,r){let i;if(e.kind=="map"){x(typeof t=="object"&&t!==null);let s={};switch(e.V.kind){case"scalar":for(let[a,f]of Object.entries(t)){let u=this.scalar(e.V.T,f,e.name,!1,!0);x(u!==void 0),s[a.toString()]=u}break;case"message":let l=e.V.T();for(let[a,f]of Object.entries(t)){let u=this.message(l,f,e.name,r);x(u!==void 0),s[a.toString()]=u}break;case"enum":let o=e.V.T();for(let[a,f]of Object.entries(t)){x(f===void 0||typeof f=="number");let u=this.enum(o,f,e.name,!1,!0,r.enumAsInteger);x(u!==void 0),s[a.toString()]=u}break}(r.emitDefaultValues||Object.keys(s).length>0)&&(i=s)}else if(e.repeat){x(Array.isArray(t));let s=[];switch(e.kind){case"scalar":for(let a=0;a0||r.emitDefaultValues)&&(i=s)}else switch(e.kind){case"scalar":i=this.scalar(e.T,t,e.name,e.opt,r.emitDefaultValues);break;case"enum":i=this.enum(e.T(),t,e.name,e.opt,r.emitDefaultValues,r.enumAsInteger);break;case"message":i=this.message(e.T(),t,e.name,r);break}return i}enum(e,t,r,i,s,l){if(e[0]=="google.protobuf.NullValue")return null;if(t===void 0){x(i);return}if(!(t===0&&!s&&!i))return x(typeof t=="number"),x(Number.isInteger(t)),l||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,r,i){return t===void 0?i.emitDefaultValues?null:void 0:e.internalJsonWrite(t,i)}scalar(e,t,r,i,s){if(t===void 0){x(i);return}let l=s||i;switch(e){case h.INT32:case h.SFIXED32:case h.SINT32:return t===0?l?0:void 0:(Z(t),t);case h.FIXED32:case h.UINT32:return t===0?l?0:void 0:(ee(t),t);case h.FLOAT:oe(t);case h.DOUBLE:return t===0?l?0:void 0:(x(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case h.STRING:return t===""?l?"":void 0:(x(typeof t=="string"),t);case h.BOOL:return t===!1?l?!1:void 0:(x(typeof t=="boolean"),t);case h.UINT64:case h.FIXED64:x(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let o=F.from(t);return o.isZero()&&!l?void 0:o.toString();case h.INT64:case h.SFIXED64:case h.SINT64:x(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let a=O.from(t);return a.isZero()&&!l?void 0:a.toString();case h.BYTES:return x(t instanceof Uint8Array),t.byteLength?hn(t):l?"":void 0}}};function me(n,e=W.STRING){switch(n){case h.BOOL:return!1;case h.UINT64:case h.FIXED64:return $(F.ZERO,e);case h.INT64:case h.SFIXED64:case h.SINT64:return $(O.ZERO,e);case h.DOUBLE:case h.FLOAT:return 0;case h.BYTES:return new Uint8Array(0);case h.STRING:return"";default:return 0}}var Te=class{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){let t=(e=this.info.fields)!==null&&e!==void 0?e:[];this.fieldNoToField=new Map(t.map(r=>[r.no,r]))}}read(e,t,r,i){this.prepare();let s=i===void 0?e.len:e.pos+i;for(;e.post.no-r.no)}}write(e,t,r){this.prepare();for(let s of this.fields){let l,o,a=s.repeat,f=s.localName;if(s.oneof){let u=e[s.oneof];if(u.oneofKind!==f)continue;l=u[f],o=!0}else l=e[f],o=!1;switch(s.kind){case"scalar":case"enum":let u=s.kind=="enum"?h.INT32:s.T;if(a)if(x(Array.isArray(l)),a==ce.PACKED)this.packed(t,u,s.no,l);else for(let p of l)this.scalar(t,u,s.no,p,!0);else l===void 0?x(s.opt):this.scalar(t,u,s.no,l,o||s.opt);break;case"message":if(a){x(Array.isArray(l));for(let p of l)this.message(t,r,s.T(),s.no,p)}else this.message(t,r,s.T(),s.no,l);break;case"map":x(typeof l=="object"&&l!==null);for(let[p,g]of Object.entries(l))this.mapEntry(t,r,s,p,g);break}}let i=r.writeUnknownFields;i!==!1&&(i===!0?m.onWrite:i)(this.info.typeName,e,t)}mapEntry(e,t,r,i,s){e.tag(r.no,c.LengthDelimited),e.fork();let l=i;switch(r.K){case h.INT32:case h.FIXED32:case h.UINT32:case h.SFIXED32:case h.SINT32:l=Number.parseInt(i);break;case h.BOOL:x(i=="true"||i=="false"),l=i=="true";break}switch(this.scalar(e,r.K,1,l,!0),r.V.kind){case"scalar":this.scalar(e,r.V.T,2,s,!0);break;case"enum":this.scalar(e,h.INT32,2,s,!0);break;case"message":this.message(e,t,r.V.T(),2,s);break}e.join()}message(e,t,r,i,s){s!==void 0&&(r.internalBinaryWrite(s,e.tag(i,c.LengthDelimited).fork(),t),e.join())}scalar(e,t,r,i,s){let[l,o,a]=this.scalarInfo(t,i);(!a||s)&&(e.tag(r,l),e[o](i))}packed(e,t,r,i){if(!i.length)return;x(t!==h.BYTES&&t!==h.STRING),e.tag(r,c.LengthDelimited),e.fork();let[,s]=this.scalarInfo(t);for(let l=0;lte}])}create(e){let t={commandDms:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posze}])}create(e){let t={};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posnew An(n,e,t),Surge:(n,e,t)=>new Un(n,e,t)};var Xe=class extends H{getFn(n,e,t){let r=Xe.clientAdapter[e]||e;return super.getFn(n,r,t)}setFn(n,e,t,r){let i=Xe.clientAdapter[e]||e;return super.setFn(n,i,t,r)}init(){try{this.request=this.createProxy($request),this.response=this.createProxy($response)}catch(n){this.log(n.toString())}}getVal(n){return $persistentStore.read(n)}setVal(n,e){$persistentStore.write(n,e)}msg(n=this.name,e="",t="",r){$notification.post(n,e,t,{url:r??""})}async fetch(n){return await new Promise((e,t)=>{let{method:r,body:i,bodyBytes:s,...l}=n,o=s??i,a=o instanceof Uint8Array;$httpClient[r.toLowerCase()]({...l,body:o,"binary-mode":a},(f,u,p)=>{f&&t(f);let g=a?"bodyBytes":"body";e({status:u.status,headers:u.headers,[g]:p})})})}done(n){let e=n.response??n,t,r;e.bodyBytes?(t=e.bodyBytes,delete e.bodyBytes,r={...n},r.response?r.response.body=t:r.body=t):r=n,$done(r)}},Un=Xe;Un.clientAdapter={bodyBytes:"body"};var q=class extends H{static transferBodyBytes(n,e){return n instanceof ArrayBuffer?e==="Uint8Array"?new Uint8Array(n):n:n instanceof Uint8Array&&e==="ArrayBuffer"?n.buffer.slice(n.byteOffset,n.byteLength+n.byteOffset):n}init(){try{this.request=this.createProxy($request),this.response=this.createProxy($response)}catch(n){this.log(n.toString())}}getFn(n,e,t){let r=q.clientAdapter[e]||e,i=super.getFn(n,r,t);return e==="bodyBytes"&&(i=q.transferBodyBytes(i,"Uint8Array")),i}setFn(n,e,t,r){let i=q.clientAdapter[e]||e,s=t;return e==="bodyBytes"&&(s=q.transferBodyBytes(s,"Uint8Array")),super.setFn(n,i,s,r)}getVal(n){return $prefs.valueForKey(n)?.replace(/\0/g,"")}setVal(n,e){$prefs.setValueForKey(n,e)}msg(n=this.name,e="",t="",r){$notify(n,e,t,{"open-url":r??""})}async fetch(n){return await new Promise(e=>{let t={url:"",method:"GET"};for(let[r,i]of Object.entries(n))r==="id"?t.sessionIndex=i:r==="bodyBytes"?t.bodyBytes=q.transferBodyBytes(i,"ArrayBuffer"):t[r]=i;n.bodyBytes&&delete t.body,$task.fetch(t).then(r=>{let i={status:200,headers:{}};for(let[s,l]of Object.entries(r))s==="sessionIndex"?i.id=l:s==="bodyBytes"?i.bodyBytes=q.transferBodyBytes(l,"Uint8Array"):s==="statusCode"?i.status=l:i[s]=l;e(i)})})}done(n){let e=n.response??n,t={};for(let[r,i]of Object.entries(e))r==="status"?t.status=`HTTP/1.1 ${i}`:r==="bodyBytes"?t.bodyBytes=q.transferBodyBytes(i,"ArrayBuffer"):t[r]=i;$done(t)}},An=q;An.clientAdapter={id:"sessionIndex",status:"statusCode"};var pr=H.getInstance("Bilibili Helper",{debug:!1});function dr(n){let e=gr(n.length),t=new Uint8Array(5+n.length);return t[0]=0,t.set(e,1),t.set(n,5),t}function gr(n){let e=new ArrayBuffer(4);return new DataView(e).setUint32(0,n,!1),new Uint8Array(e)}function X(n,e){let t=n.toBinary(e);pr.done({bodyBytes:dr(t)})}var He=class extends b{constructor(){super("ModeStatus",[{no:1,name:"modes",kind:"message",repeat:1,T:()=>Ze}])}create(e){let t={modes:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posqe}])}create(e){let t={id:0,name:"",f4:0};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posf.typeName===i);if(!l)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+e.typeUrl+"' to JSON. The specified type "+i+" is not available in the type registry.");let o=l.fromBinary(e.value,{readUnknownField:!1}),a=l.internalJsonWrite(o,s);return(i.startsWith("google.protobuf.")||!se(a))&&(a={value:a}),a["@type"]=e.typeUrl,a}internalJsonRead(e,t,r){var i;if(!se(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+Q(e)+".");if(typeof e["@type"]!="string"||e["@type"]=="")return this.create();let s=this.typeUrlToName(e["@type"]),l=(i=t?.typeRegistry)===null||i===void 0?void 0:i.find(a=>a.typeName==s);if(!l)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+s+" is not available in the type registry.");let o;if(s.startsWith("google.protobuf.")&&e.hasOwnProperty("value"))o=l.fromJson(e.value,t);else{let a=Object.assign({},e);delete a["@type"],o=l.fromJson(a,t)}return r===void 0&&(r=this.create()),r.typeUrl=e["@type"],r.value=l.toBinary(o),r}typeNameToUrl(e){if(!e.length)throw new Error("invalid type name: "+e);return"type.googleapis.com/"+e}typeUrlToName(e){if(!e.length)throw new Error("invalid type url: "+e);let t=e.lastIndexOf("/"),r=t>0?e.substring(t+1):e;if(!r.length)throw new Error("invalid type url: "+e);return r}create(e){let t={typeUrl:"",value:new Uint8Array(0)};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posD}])}create(e){let t={};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posD}])}create(e){let t={};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posj},{no:4,name:"duration",kind:"scalar",T:3,L:0},{no:5,name:"aid",kind:"scalar",T:3,L:0}])}create(e){let t={duration:0n,aid:0n};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posj},{no:31,name:"cm_config",kind:"message",T:()=>rt},{no:41,name:"cm_ipad",kind:"message",T:()=>it}])}create(e){let t={cms:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posj}])}create(e){let t={};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posct}])}create(e){let t={items:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.pos["DynamicType",ae]},{no:2,name:"item_type",kind:"enum",T:()=>["DynamicType",ae]},{no:5,name:"has_fold",kind:"scalar",T:5},{no:6,name:"server_info",kind:"scalar",T:9}])}create(e){let t={cardType:0,itemType:0,hasFold:0,serverInfo:""};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posgt},{no:2,name:"update_num",kind:"scalar",T:3,L:0},{no:3,name:"history_offset",kind:"scalar",T:9},{no:4,name:"update_baseline",kind:"scalar",T:9},{no:5,name:"has_more",kind:"scalar",T:8}])}create(e){let t={list:[],updateNum:0n,historyOffset:"",updateBaseline:"",hasMore:!1};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.poswt},{no:3,name:"topic_list",kind:"message",T:()=>yt}])}create(e){let t={};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posxt}])}create(e){let t={};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.poste}])}create(e){let t={commandDms:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.pos["viewunite.v1.RelateCardType",ge]}])}create(e){let t={relateCardType:0};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posTt}])}create(e){let t={cards:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.pos["viewunite.v1.ModuleType",de]},{no:22,name:"relates",kind:"message",oneof:"data",T:()=>Ut}])}create(e){let t={type:0,data:{oneofKind:void 0}};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posAt}])}create(e){let t={title:"",modules:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.pos["viewunite.v1.TabType",Lt]},{no:2,name:"introduction",kind:"message",oneof:"tab",T:()=>Ft}])}create(e){let t={tabType:0,tab:{oneofKind:void 0}};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posRt}])}create(e){let t={tabModule:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posD},{no:2,name:"ads_control",kind:"message",T:()=>D},{no:3,name:"source_content",kind:"message",repeat:1,T:()=>D}])}create(e){let t={sourceContent:[]};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posSt},{no:7,name:"cm",kind:"message",T:()=>Vt}])}create(e){let t={};return globalThis.Object.defineProperty(t,v,{enumerable:!1,value:this}),e!==void 0&&w(this,t,e),t}internalBinaryRead(e,t,r,i){let s=i??this.create(),l=e.pos+t;for(;e.posr.name==="teenagers");t?.f5?.f1&&(t.f5.f1=0,X(tt,e))}function Sn(n){let e=ft.fromBinary(n);delete e.cmConfig,delete e.cmIpad,e.cms.length=0,X(ft,e)}function Vn(n){let e=ht.fromBinary(n);delete e.cm,X(ht,e)}function Ln(n){let e=dt.fromBinary(n);e.items=e.items.filter(t=>!t.linktype.endsWith("_ad")),X(dt,e)}function Dn(n){let e=Et.fromBinary(n);delete e.topicList,e.dynamicList.list=e.dynamicList.list.filter(t=>t.cardType!==ae.ad),X(Et,e)}function Cn(n){let e=Ot.fromBinary(n);delete e.dm,X(Ot,e)}function Wn(n){let e=zt.fromBinary(n);delete e.cm,e.tab.tabModule.forEach(t=>{if(t.tab.oneofKind!=="introduction")return;let r=t.tab.introduction.modules.find(i=>i.type===de.RELATED_RECOMMEND);r?.data?.oneofKind!=="relates"||!r.data.relates.cards||(r.data.relates.cards=r.data.relates.cards.filter(i=>i.relateCardType===ge.AV))}),X(zt,e)}var wr=/(?.+):\/\/(?[^/]+)\/?(?[^?]+)?\??(?.*)?/,we=class{constructor(e=""){if(this.name="URL v1.0.2",!e)throw new Error("Empty URL");this.parse(e)}parse(e){let{scheme:t,host:r,path:i="",params:s}=e.match(wr)?.groups??{};this.scheme=t,this.host=r,this.path=i,this.params=s?s.split("&").reduce((l,o)=>{let[a,f]=o.split("=");return l[a]=f,l},{}):{}}toString(){let e=this.scheme+"://"+this.host+"/"+this.path;return this.params&&(e+="?"+Object.entries(this.params).reduce((t,[r,i],s)=>t+(s?"&":"")+r+"="+i,"")),e}};var Kt=H.getInstance("Bilibili Helper",{debug:!1}),yr=Kt.request.url,Pn=Kt.response.bodyBytes,vr=new we(yr).path,br=typeof $utils=="object"&&typeof $utils?.ungzip=="function"?$utils.ungzip:fn,kr=Pn.slice(0,5),jt=Pn.slice(5);kr[0]&&(jt=br(jt));var $n={"v1.DM/DmView":Fn,"v1.Teenagers/ModeStatus":Rn,"v1.Reply/MainList":Vn,"v1.Search/SearchAll":Ln,"v2.Dynamic/DynAll":Dn,"viewunite.v1.View/View":Wn,"view.v1.View/ViewProgress":Cn,"view.v1.View/View":Sn};for(let n in $n)if(vr.endsWith(n)){$n[n](jt);break}Kt.exit();})();