From 03420f1f654f8df537dc52c058d4fe1c86c782cb Mon Sep 17 00:00:00 2001 From: sve1r Date: Sat, 10 Jun 2023 22:15:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201.=20=E4=BF=AE=E5=A4=8D=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/AdBlock/Bilibili/BiliBili.js | 120 +- Scripts/AdBlock/Bilibili/BiliBili.min.js | 1 - Scripts/AdBlock/Bilibili/BiliBili.response.js | 10942 +++++++++++++++- .../AdBlock/Bilibili/BiliBili.response.min.js | 10926 ++++++++++++++- Scripts/Unlock/BiliBili.proto.js | 5738 ++++---- 5 files changed, 23539 insertions(+), 4188 deletions(-) diff --git a/Scripts/AdBlock/Bilibili/BiliBili.js b/Scripts/AdBlock/Bilibili/BiliBili.js index ccd6bd9..1dacdc0 100644 --- a/Scripts/AdBlock/Bilibili/BiliBili.js +++ b/Scripts/AdBlock/Bilibili/BiliBili.js @@ -1,4 +1,4 @@ -const version = "V2.0.117"; +const version = 'V2.0.117'; let body = $response.body; if (body) { @@ -10,7 +10,7 @@ if (body) { (t.result.cards = t.result.cards.filter((t) => 2 != t.type)), (body = JSON.stringify(t)); } catch (i) { - console.log("bilibili recommend:" + i); + console.log('bilibili recommend:' + i); } break; case /^https?:\/\/app\.bilibili\.com\/x\/resource\/show\/skin\?/.test( @@ -20,7 +20,7 @@ if (body) { let a = JSON.parse(body); delete a.data?.common_equip, (body = JSON.stringify(a)); } catch (e) { - console.log("bilibili skin:" + e); + console.log('bilibili skin:' + e); } break; case /^https:\/\/app\.bilibili\.com\/x\/v2\/feed\/index\?/.test( @@ -30,15 +30,15 @@ if (body) { let s = JSON.parse(body), l = []; for (let o of s.data.items) - if (!o.hasOwnProperty("banner_item")) { + if (!o.hasOwnProperty('banner_item')) { if ( !( - !o.hasOwnProperty("ad_info") && - -1 === o.card_goto?.indexOf("ad") && + !o.hasOwnProperty('ad_info') && + -1 === o.card_goto?.indexOf('ad') && [ - "small_cover_v2", - "large_cover_v1", - "large_cover_single_v9", + 'small_cover_v2', + 'large_cover_v1', + 'large_cover_single_v9', ].includes(o.card_type) ) ) @@ -47,7 +47,7 @@ if (body) { } (s.data.items = l), (body = JSON.stringify(s)); } catch (d) { - console.log("bilibili index:" + d); + console.log('bilibili index:' + d); } break; case /^https?:\/\/app\.bilibili\.com\/x\/v2\/feed\/index\/story\?/.test( @@ -57,12 +57,12 @@ if (body) { let r = JSON.parse(body), b = []; for (let p of r.data.items) - p.hasOwnProperty("ad_info") || - -1 !== p.card_goto.indexOf("ad") || + p.hasOwnProperty('ad_info') || + -1 !== p.card_goto.indexOf('ad') || b.push(p); (r.data.items = b), (body = JSON.stringify(r)); } catch (c) { - console.log("bilibili Story:" + c); + console.log('bilibili Story:' + c); } break; case /^https?:\/\/app\.bilibili\.com\/x\/v\d\/account\/teenagers\/status\?/.test( @@ -72,7 +72,7 @@ if (body) { let n = JSON.parse(body); (n.data.teenagers_status = 0), (body = JSON.stringify(n)); } catch (y) { - console.log("bilibili teenagers:" + y); + console.log('bilibili teenagers:' + y); } break; case /^https?:\/\/app\.bilibili\.com\/x\/resource\/show\/tab/.test( @@ -86,48 +86,48 @@ if (body) { f.push( { id: 39, - name: "直播", - uri: "bilibili://live/home", - tab_id: "直播tab", + name: '直播', + uri: 'bilibili://live/home', + tab_id: '直播tab', pos: 1, }, { id: 40, - name: "推荐", - uri: "bilibili://pegasus/promo", - tab_id: "推荐tab", + name: '推荐', + uri: 'bilibili://pegasus/promo', + tab_id: '推荐tab', pos: 2, default_selected: 1, } ), - -1 == JSON.stringify(h.data.tab).indexOf("pgc/home") + -1 == JSON.stringify(h.data.tab).indexOf('pgc/home') ? f.push({ id: 774, - name: "番剧", - uri: "bilibili://following/home_activity_tab/6544", - tab_id: "bangumi", + name: '番剧', + uri: 'bilibili://following/home_activity_tab/6544', + tab_id: 'bangumi', pos: 3, }) : f.push({ id: 545, - name: "番剧", - uri: "bilibili://pgc/home", - tab_id: "bangumi", + name: '番剧', + uri: 'bilibili://pgc/home', + tab_id: 'bangumi', pos: 3, }), f.push( { id: 41, - name: "热门", - uri: "bilibili://pegasus/hottopic", - tab_id: "hottopic", + name: '热门', + uri: 'bilibili://pegasus/hottopic', + tab_id: 'hottopic', pos: 4, }, { id: 151, - name: "影视", - uri: "bilibili://pgc/cinema-tab", - tab_id: "film", + name: '影视', + uri: 'bilibili://pgc/cinema-tab', + tab_id: 'film', pos: 5, } ), @@ -138,10 +138,10 @@ if (body) { (h.data.top = [ { id: 481, - icon: "http://i0.hdslb.com/bfs/archive/d43047538e72c9ed8fd8e4e34415fbe3a4f632cb.png", - name: "消息", - uri: "bilibili://link/im_home", - tab_id: "消息Top", + icon: 'http://i0.hdslb.com/bfs/archive/d43047538e72c9ed8fd8e4e34415fbe3a4f632cb.png', + name: '消息', + uri: 'bilibili://link/im_home', + tab_id: '消息Top', pos: 1, }, ]), @@ -152,7 +152,7 @@ if (body) { } body = JSON.stringify(h); } catch (g) { - console.log("bilibili tabprocess:" + g); + console.log('bilibili tabprocess:' + g); } break; case /^https?:\/\/app\.bilibili\.com\/x\/v2\/account\/mine/.test( @@ -171,15 +171,15 @@ if (body) { delete v.data.sections_v2[i].be_up_title, delete v.data.sections_v2[i].tip_icon, delete v.data.sections_v2[i].tip_title, - ("创作中心" == v.data.sections_v2[i].title || - "創作中心" == v.data.sections_v2[i].title) && + ('创作中心' == v.data.sections_v2[i].title || + '創作中心' == v.data.sections_v2[i].title) && (delete v.data.sections_v2[i].title, delete v.data.sections_v2[i].type); }), delete v.data.vip_section_v2, delete v.data.vip_section, - v.data.hasOwnProperty("live_tip") && (v.data.live_tip = {}), - v.data.hasOwnProperty("answer") && (v.data.answer = {}), + v.data.hasOwnProperty('live_tip') && (v.data.live_tip = {}), + v.data.hasOwnProperty('answer') && (v.data.answer = {}), v.data.vip.status || ((v.data.vip_type = 2), (v.data.vip.type = 2), @@ -188,7 +188,7 @@ if (body) { (v.data.vip.due_date = 466982416e4)), (body = JSON.stringify(v)); } catch (_) { - console.log("bilibili mypage:" + _); + console.log('bilibili mypage:' + _); } break; case /^https?:\/\/api\.live\.bilibili\.com\/xlive\/app-room\/v1\/index\/getInfoByRoom/.test( @@ -204,7 +204,7 @@ if (body) { x.data.new_tab_info.outer_list.filter((t) => 33 != t.biz_id)), (body = JSON.stringify(x)); } catch (k) { - console.log("bilibili live broadcast:" + k); + console.log('bilibili live broadcast:' + k); } break; case /^https?:\/\/app\.bilibili\.com\/x\/resource\/top\/activity/.test( @@ -212,10 +212,10 @@ if (body) { ): try { let w = JSON.parse(body); - w.data && ((w.data.hash = "ddgksf2013"), (w.data.online.icon = "")), + w.data && ((w.data.hash = 'ddgksf2013'), (w.data.online.icon = '')), (body = JSON.stringify(w)); } catch (O) { - console.log("bilibili right corner:" + O); + console.log('bilibili right corner:' + O); } break; case /ecommerce-user\/get_shopping_info\?/.test($request.url): @@ -231,7 +231,7 @@ if (body) { }), (body = JSON.stringify(P)); } catch (W) { - console.log("bilibili shopping info:" + W); + console.log('bilibili shopping info:' + W); } break; case /^https?:\/\/app\.bilibili\.com\/x\/v2\/search\/square/.test( @@ -240,13 +240,13 @@ if (body) { try { let j = JSON.parse(body); (j.data = { - type: "history", - title: "搜索历史", + type: 'history', + title: '搜索历史', search_hotword_revision: 2, }), (body = JSON.stringify(j)); } catch (q) { - console.log("bilibili hot search:" + q); + console.log('bilibili hot search:' + q); } break; case /https?:\/\/app\.bilibili\.com\/x\/v2\/account\/myinfo\?/.test( @@ -261,25 +261,25 @@ if (body) { (E.data.vip.due_date = 466982416e4)), (body = JSON.stringify(E)); } catch (z) { - console.log("bilibili 1080p:" + z); + console.log('bilibili 1080p:' + z); } break; case /pgc\/page\/(bangumi|cinema\/tab\?)/.test($request.url): try { let B = JSON.parse(body); B.result.modules.forEach((t) => { - t.style.startsWith("banner") && - (t.items = t.items.filter((t) => -1 != t.link.indexOf("play"))), - t.style.startsWith("function") && + t.style.startsWith('banner') && + (t.items = t.items.filter((t) => -1 != t.link.indexOf('play'))), + t.style.startsWith('function') && ((t.items = t.items.filter( - (t) => -1 == t.blink.indexOf("bilibili.com") + (t) => -1 == t.blink.indexOf('bilibili.com') )), [1283, 241, 1441, 1284].includes(t.module_id) && (t.items = [])), - t.style.startsWith("tip") && (t.items = []); + t.style.startsWith('tip') && (t.items = []); }), (body = JSON.stringify(B)); } catch (I) { - console.log("bilibili fanju:" + I); + console.log('bilibili fanju:' + I); } break; case /^https:\/\/app\.bilibili\.com\/x\/v2\/splash\/list/.test( @@ -294,7 +294,7 @@ if (body) { (S.end_time = 2240150400); body = JSON.stringify(R); } catch (T) { - console.log("bilibili openad:" + T); + console.log('bilibili openad:' + T); } break; case /^https:\/\/api\.live\.bilibili\.com\/xlive\/app-interface\/v2\/index\/feed/.test( @@ -305,11 +305,11 @@ if (body) { A.data && A.data.card_list && (A.data.card_list = A.data.card_list.filter( - (t) => "banner_v1" != t.card_type + (t) => 'banner_v1' != t.card_type )), (body = JSON.stringify(A)); } catch (C) { - console.log("bilibili xlive:" + C); + console.log('bilibili xlive:' + C); } break; default: diff --git a/Scripts/AdBlock/Bilibili/BiliBili.min.js b/Scripts/AdBlock/Bilibili/BiliBili.min.js index 0a57282..17219af 100644 --- a/Scripts/AdBlock/Bilibili/BiliBili.min.js +++ b/Scripts/AdBlock/Bilibili/BiliBili.min.js @@ -1,4 +1,3 @@ - const version = 'V2.0.117'; let body=$response.body;if(body){switch(!0){case/pgc\/season\/app\/related\/recommend\?/.test($request.url):try{let t=JSON.parse(body);t.result?.cards?.length&&(t.result.cards=t.result.cards.filter(t=>2!=t.type)),body=JSON.stringify(t)}catch(i){console.log("bilibili recommend:"+i)}break;case/^https?:\/\/app\.bilibili\.com\/x\/resource\/show\/skin\?/.test($request.url):try{let a=JSON.parse(body);delete a.data?.common_equip,body=JSON.stringify(a)}catch(e){console.log("bilibili skin:"+e)}break;case/^https:\/\/app\.bilibili\.com\/x\/v2\/feed\/index\?/.test($request.url):try{let s=JSON.parse(body),l=[];for(let o of s.data.items)if(!o.hasOwnProperty("banner_item")){if(!(!o.hasOwnProperty("ad_info")&&-1===o.card_goto?.indexOf("ad")&&["small_cover_v2","large_cover_v1","large_cover_single_v9"].includes(o.card_type)))continue;else l.push(o)}s.data.items=l,body=JSON.stringify(s)}catch(d){console.log("bilibili index:"+d)}break;case/^https?:\/\/app\.bilibili\.com\/x\/v2\/feed\/index\/story\?/.test($request.url):try{let r=JSON.parse(body),b=[];for(let p of r.data.items)p.hasOwnProperty("ad_info")||-1!==p.card_goto.indexOf("ad")||b.push(p);r.data.items=b,body=JSON.stringify(r)}catch(c){console.log("bilibili Story:"+c)}break;case/^https?:\/\/app\.bilibili\.com\/x\/v\d\/account\/teenagers\/status\?/.test($request.url):try{let n=JSON.parse(body);n.data.teenagers_status=0,body=JSON.stringify(n)}catch(y){console.log("bilibili teenagers:"+y)}break;case/^https?:\/\/app\.bilibili\.com\/x\/resource\/show\/tab/.test($request.url):try{let u=new Set([177,178,179,181,102,104,106,486,488,489]),h=JSON.parse(body);if(h.data?.tab){var f=[];f.push({id:39,name:"直播",uri:"bilibili://live/home",tab_id:"直播tab",pos:1},{id:40,name:"推荐",uri:"bilibili://pegasus/promo",tab_id:"推荐tab",pos:2,default_selected:1}),-1==JSON.stringify(h.data.tab).indexOf("pgc/home")?f.push({id:774,name:"番剧",uri:"bilibili://following/home_activity_tab/6544",tab_id:"bangumi",pos:3}):f.push({id:545,name:"番剧",uri:"bilibili://pgc/home",tab_id:"bangumi",pos:3}),f.push({id:41,name:"热门",uri:"bilibili://pegasus/hottopic",tab_id:"hottopic",pos:4},{id:151,name:"影视",uri:"bilibili://pgc/cinema-tab",tab_id:"film",pos:5}),h.data.tab=f}if(h.data.top&&(h.data.top=[{id:481,icon:"http://i0.hdslb.com/bfs/archive/d43047538e72c9ed8fd8e4e34415fbe3a4f632cb.png",name:"消息",uri:"bilibili://link/im_home",tab_id:"消息Top",pos:1}]),h.data.bottom){let m=h.data.bottom.filter(t=>u.has(t.id));h.data.bottom=m}body=JSON.stringify(h)}catch(g){console.log("bilibili tabprocess:"+g)}break;case/^https?:\/\/app\.bilibili\.com\/x\/v2\/account\/mine/.test($request.url):try{let v=JSON.parse(body),$=new Set([396,397,398,399,407,410,402,404,425,426,427,428,430,432,433,434,494,495,496,497,500,501]);v.data.sections_v2.forEach((t,i)=>{let a=t.items.filter(t=>$.has(t.id));v.data.sections_v2[i].items=a,v.data.sections_v2[i].button={},delete v.data.sections_v2[i].be_up_title,delete v.data.sections_v2[i].tip_icon,delete v.data.sections_v2[i].tip_title,("创作中心"==v.data.sections_v2[i].title||"創作中心"==v.data.sections_v2[i].title)&&(delete v.data.sections_v2[i].title,delete v.data.sections_v2[i].type)}),delete v.data.vip_section_v2,delete v.data.vip_section,v.data.hasOwnProperty("live_tip")&&(v.data.live_tip={}),v.data.hasOwnProperty("answer")&&(v.data.answer={}),v.data.vip.status||(v.data.vip_type=2,v.data.vip.type=2,v.data.vip.status=1,v.data.vip.vip_pay_type=1,v.data.vip.due_date=466982416e4),body=JSON.stringify(v)}catch(_){console.log("bilibili mypage:"+_)}break;case/^https?:\/\/api\.live\.bilibili\.com\/xlive\/app-room\/v1\/index\/getInfoByRoom/.test($request.url):try{let x=JSON.parse(body);x.data.activity_banner_info=null,x.data?.shopping_info&&(x.data.shopping_info={is_show:0}),x.data?.new_tab_info?.outer_list&&x.data.new_tab_info.outer_list.length&&(x.data.new_tab_info.outer_list=x.data.new_tab_info.outer_list.filter(t=>33!=t.biz_id)),body=JSON.stringify(x)}catch(k){console.log("bilibili live broadcast:"+k)}break;case/^https?:\/\/app\.bilibili\.com\/x\/resource\/top\/activity/.test($request.url):try{let w=JSON.parse(body);w.data&&(w.data.hash="ddgksf2013",w.data.online.icon=""),body=JSON.stringify(w)}catch(O){console.log("bilibili right corner:"+O)}break;case/ecommerce-user\/get_shopping_info\?/.test($request.url):try{let P=JSON.parse(body);P.data&&(P.data={shopping_card_detail:{},bubbles_detail:{},recommend_card_detail:{},selected_goods:{},h5jump_popup:[]}),body=JSON.stringify(P)}catch(W){console.log("bilibili shopping info:"+W)}break;case/^https?:\/\/app\.bilibili\.com\/x\/v2\/search\/square/.test($request.url):try{let j=JSON.parse(body);j.data={type:"history",title:"搜索历史",search_hotword_revision:2},body=JSON.stringify(j)}catch(q){console.log("bilibili hot search:"+q)}break;case/https?:\/\/app\.bilibili\.com\/x\/v2\/account\/myinfo\?/.test($request.url):try{let E=JSON.parse(body);E.data.vip.status||(E.data.vip.type=2,E.data.vip.status=1,E.data.vip.vip_pay_type=1,E.data.vip.due_date=466982416e4),body=JSON.stringify(E)}catch(z){console.log("bilibili 1080p:"+z)}break;case/pgc\/page\/(bangumi|cinema\/tab\?)/.test($request.url):try{let B=JSON.parse(body);B.result.modules.forEach(t=>{t.style.startsWith("banner")&&(t.items=t.items.filter(t=>-1!=t.link.indexOf("play"))),t.style.startsWith("function")&&(t.items=t.items.filter(t=>-1==t.blink.indexOf("bilibili.com")),[1283,241,1441,1284].includes(t.module_id)&&(t.items=[])),t.style.startsWith("tip")&&(t.items=[])}),body=JSON.stringify(B)}catch(I){console.log("bilibili fanju:"+I)}break;case/^https:\/\/app\.bilibili\.com\/x\/v2\/splash\/list/.test($request.url):try{let R=JSON.parse(body);if(R.data&&R.data.list)for(let S of R.data.list)S.duration=0,S.begin_time=2240150400,S.end_time=2240150400;body=JSON.stringify(R)}catch(T){console.log("bilibili openad:"+T)}break;case/^https:\/\/api\.live\.bilibili\.com\/xlive\/app-interface\/v2\/index\/feed/.test($request.url):try{let A=JSON.parse(body);A.data&&A.data.card_list&&(A.data.card_list=A.data.card_list.filter(t=>"banner_v1"!=t.card_type)),body=JSON.stringify(A)}catch(C){console.log("bilibili xlive:"+C)}break;default:$done({})}$done({body})}else $done({}); \ No newline at end of file diff --git a/Scripts/AdBlock/Bilibili/BiliBili.response.js b/Scripts/AdBlock/Bilibili/BiliBili.response.js index 01a8de1..094f9a5 100644 --- a/Scripts/AdBlock/Bilibili/BiliBili.response.js +++ b/Scripts/AdBlock/Bilibili/BiliBili.response.js @@ -2,611 +2,10197 @@ WEBSITE: https://biliuniverse.io README: https://github.com/BiliUniverse */ -const $ = new Env("📺 BiliBili: 🛡️ ADBlock v0.3.0(2) response"); +const $ = new Env('📺 BiliBili: 🛡️ ADBlock v0.3.1(1) response'); const URL = new URLs(); const DataBase = { - "ADBlock":{ - "Settings":{ - "Switch":true, - "Detail":{"splash":true,"feed":true,"activity":false,"story":true,"cinema":true,"view":true,"search":true,"xlive":true,"Hot_search":true,"Hot_topics":true,"Most_visited":true,"Dynamic_adcard":true} - } - }, - "Default": { - "Settings":{"Switch":true} - } + ADBlock: { + Settings: { + Switch: true, + Detail: { + splash: true, + feed: true, + activity: false, + story: true, + cinema: true, + view: true, + search: true, + commandDms: false, + colorfulDms: false, + MainList: true, + xlive: true, + Hot_search: true, + Hot_topics: true, + Most_visited: true, + Dynamic_adcard: true, + }, + }, + }, + Default: { + Settings: { Switch: true }, + }, }; /***************** Processing *****************/ (async () => { - const { Settings, Caches, Configs } = setENV("BiliBili", "ADBlock", DataBase); - switch (Settings?.Switch) { - case true: - default: - let url = URL.parse($request?.url); - const METHOD = $request?.method, HOST = url?.host, PATH = url?.path, PATHs = PATH.split("/"); - // 解析格式 - const FORMAT = ($response?.headers?.["Content-Type"] ?? $response?.headers?.["content-type"])?.split(";")?.[0]; - $.log(`⚠ ${$.name}`, `METHOD: ${METHOD}`, `HOST: ${HOST}`, `PATH: ${PATH}`, `PATHs: ${PATHs}`, `FORMAT: ${FORMAT}`, ""); - // 创建空数据 - let body = { "code": 0, "message": "0", "data": {} }; - // 格式判断 - switch (FORMAT) { - case undefined: // 视为无body - break; - case "application/x-www-form-urlencoded": - case "text/plain": - case "text/html": - default: - break; - case "text/xml": - case "text/plist": - case "application/xml": - case "application/plist": - case "application/x-plist": - break; - case "text/json": - case "application/json": - body = JSON.parse($response.body); - // 解析链接 - switch (HOST) { - case "www.bilibili.com": - break; - case "app.bilibili.com": - case "app.biliapi.net": - switch (PATH) { - case "x/v2/splash/show": // 开屏页 - case "x/v2/splash/list": // 开屏页 - case "x/v2/splash/brand/list": // 开屏页 - case "x/v2/splash/event/list2": // 开屏页 - switch (Settings?.Detail?.splash) { - case true: - default: - const item = ["account", "event_list", "preload", "show"]; - if (body.data) { - item.forEach((i) => { - delete body.data[i]; - }); - $.log(`🎉 ${$.name}`, "开屏页广告去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置开屏页广告不去除"); - break; - }; - break; - case "x/v2/feed/index": // 推荐页 - switch (Settings?.Detail?.feed) { - case true: - default: - if (body.data.items?.length) { - let params = url?.params;//区分pad与phone - body.data.items = await Promise.all(body.data.items.map(async item => { - const { card_type: cardType, card_goto: cardGoto } = item; - if (cardType && cardGoto) { - if (['banner_v8', 'banner_ipad_v8'].includes(cardType) && cardGoto === 'banner') { - switch (Settings?.Detail?.activity) { - case true: - default: - Caches.banner_hash = item.hash; - $.setjson(Caches, "@BiliBili.ADBlock.Caches"); // 获取banner_hash,无此字段会有活动页且此字段无法伪造. - $.log(`🎉 ${$.name}`, "推荐页活动大图去除"); - return undefined; - case false: - if (item.banner_item) { - item.banner_item = item.banner_item.filter(i => { - if (i.type === 'ad') { - $.log(`🎉 ${$.name}`, "推荐页大图广告去除"); - return false; - } - return true; - }); - } - break; - } - } else if (['cm_v2', 'cm_v1'].includes(cardType) && ['ad_web_s', 'ad_av', 'ad_web_gif'].includes(cardGoto)) { - // ad_player大视频广告 ad_web_gif大gif广告 ad_web_s普通小广告 ad_av创作推广广告 ad_inline_3d 上方大的视频3d广告 ad_inline_eggs 上方大的视频广告 - $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); - if (params.device !== "phone") { - return undefined;//pad直接去除 - } else { - await fixPosition().then(result => item = result);//小广告补位 - } - } else if (cardType === 'cm_v2' && ['ad_player', 'ad_inline_3d', 'ad_inline_eggs'].includes(cardGoto)) { - $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); - return undefined;//大广告直接去除 - } else if (cardType === 'small_cover_v10' && cardGoto === 'game') { - $.log(`🎉 ${$.name}`, "游戏广告去除"); - if (params.device !== "phone") { - return undefined;//pad直接去除 - } else { - await fixPosition().then(result => item = result);//小广告补位 - } - } else if (cardType === 'cm_double_v9' && cardGoto === 'ad_inline_av') { - $.log(`🎉 ${$.name}`, "大视频广告去除"); - return undefined;//大广告直接去除 - } - } - return item; - })); - body.data.items = body.data.items.filter(fix => fix !== undefined); - } - async function fixPosition() { - let itemsCache = $.getdata("@BiliBili.Index.Caches",""); - let singleItem = {}; - if (itemsCache.length > 0) { - singleItem = itemsCache.pop(); - $.log(`🎉 ${$.name}`, "推荐页空缺位填充成功"); - } else {//重新获取填充位 - const myRequest = { - url: $request.url, - headers: $request.heders - } - await $.http.get(myRequest).then(response => { - try { - const body = $.toObj(response.body) - if (body?.code === 0 && body?.message === "0") { - body.data.items = body.data.items.map(item => { - const { card_type: cardType, card_goto: cardGoto } = item; - if (cardType && cardGoto) { - if (cardType === 'banner_v8' && cardGoto === 'banner') { - return undefined; - } else if (cardType === 'cm_v2' && ['ad_web_s', 'ad_av', 'ad_web_gif', 'ad_player', 'ad_inline_3d', 'ad_inline_eggs'].includes(cardGoto)) { - return undefined; - } else if (cardType === 'small_cover_v10' && cardGoto === 'game') { - return undefined; - } else if (cardType === 'cm_double_v9' && cardGoto === 'ad_inline_av') { - return undefined; - } else if (cardType === 'large_cover_v9' && cardGoto === 'inline_av_v2') {//补位不需要大视频 - return undefined; - } - } - return item; - }).filter(fix => fix !== undefined); - $.setdata(body.data.items, "@BiliBili.Index.Caches"); - $.log(`🎉 ${$.name}`, "推荐页缓存数组补充成功"); - } else { - $.log(`🚧 ${$.name}`, "访问推荐页尝试填补失败"); - } - } catch (e) { - $.logErr(e, response) - } - }) - itemsCache = $.getdata("@BiliBili.Index.Caches",""); - if (itemsCache.length > 0) { - singleItem = itemsCache.pop(); - $.log(`🎉 ${$.name}`, "推荐页空缺位填充成功"); - } - } - $.setdata(itemsCache, "@BiliBili.Index.Caches"); - return singleItem; - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置推荐页广告不去除"); - break; - }; - break; - case "x/v2/feed/index/story": // 首页短视频流 - switch (Settings?.Detail?.story) { - case true: - default: - if (body.data?.items) { - // vertical_live 直播内容 - // vertical_pgc 大会员专享 - body.data.items = body.data.items.filter((i) => !( - i.hasOwnProperty("ad_info") || - ["vertical_ad_av", "vertical_pgc"].includes(i.card_goto) - ) - ); - $.log(`🎉 ${$.name}`, "首页短视频流广告去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置首页短视频流广告不去除"); - break; - }; - break; - case "x/v2/search/square": // 搜索页 - switch (Settings?.Detail?.Hot_search) { - case true: - default: - body.data = body.data.filter((i) => !(i.type === "trending")); - $.log(`🎉 ${$.name}`, "搜索页热搜内容去除"); - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置搜索页热搜内容不去除"); - break; - } - break; - }; - break; - case "api.bilibili.com": - case "api.biliapi.net": - switch (PATH) { - case "pgc/player/api/playurl": // 番剧-播放地址-api - case "pgc/player/web/playurl": // 番剧-播放地址-web - case "pgc/player/web/playurl/html5": // 番剧-播放地址-web-HTML5 - break; - case "pgc/view/v2/app/season": // 番剧页面-内容-app - break; - case "pgc/view/web/season": // 番剧-内容-web - case "pgc/view/pc/season": // 番剧-内容-pc - break; - case "pgc/page/bangumi": // 追番页 - case "pgc/page/cinema/tab": // 观影页 - switch (Settings?.Detail?.cinema) { - case true: - default: - if (body.result?.modules) { - body.result.modules.forEach((i) => { - if (i.style.startsWith("banner")) { - i.items = i.items.filter((j) => j.link.includes("play")); - } else if (i.style.startsWith("function")) { - i.items = i.items.filter((j) => j.blink.startsWith("bilibili")); - } else if ([241, 1283, 1284, 1441].includes(i.module_id)) { - i.items = []; - } else if (i.style.startsWith("tip")) { - i.items = []; - } - }); - $.log(`🎉 ${$.name}`, "观影页广告去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置观影页广告不去除"); - break; - }; - break; - case "x/player/wbi/playurl": // UGC-用户生产内容-播放地址 - break; - case "x/space/acc/info": // 用户空间-账号信息-pc - case "x/space/wbi/acc/info": // 用户空间-账号信息-wbi - switch (url.params?.vmid || url.params?.mid) { - case "11783021": // 哔哩哔哩番剧出差 - case "1988098633": // b站_戲劇咖 - case "2042149112": // b站_綜藝咖 - break; - default: - break; - }; - break; - }; - break; - case "api.live.bilibili.com": - switch (PATH) { - case "xlive/app-room/v1/index/getInfoByRoom": // 直播 - switch (Settings?.Detail?.xlive) { - case true: - default: - if (body.data?.activity_banner_info) { - body.data.activity_banner_info = null; - $.log(`🎉 ${$.name}`, "直播banner广告去除"); - } - if (body.data?.shopping_info) { - body.data.shopping_info = { - is_show: 0 - }; - $.log(`🎉 ${$.name}`, "直播购物广告去除"); - } - if (body.data?.new_tab_info?.outer_list?.length > 0) { - body.data.new_tab_info.outer_list = - body.data.new_tab_info.outer_list.filter((i) => i.biz_id !== 33); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置直播页广告不去除"); - break; - }; - break; - }; - break; - }; - $response.body = JSON.stringify(body); - break; - case "application/x-protobuf": - case "application/grpc": - case "application/grpc+proto": - case "applecation/octet-stream": - let rawBody = $.isQuanX() ? new Uint8Array($response.bodyBytes) : $response.body; - //$.log(`🚧 ${$.name}`, `isBuffer? ${ArrayBuffer.isView(rawBody)}: ${JSON.stringify(rawBody)}`, ""); - /****************** initialization start *******************/ - // timostamm/protobuf-ts - !function(i){"use strict";function _(n,e,i){return e<=n&&n<=i}"undefined"!=typeof module&&module.exports&&!i["encoding-indexes"]&&(i["encoding-indexes"]=require("./encoding-indexes.js")["encoding-indexes"]);var l=Math.floor;function s(n){if(void 0===n)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function u(n){return 0<=n&&n<=127}var a=u,b=-1;function c(n){this.tokens=[].slice.call(n),this.tokens.reverse()}c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():b},prepend:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.pop());else this.tokens.push(n)},push:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(n)}};var w=-1;function m(n,e){if(n)throw TypeError("Decoder error");return e||65533}function f(n){throw TypeError("The code point "+n+" could not be encoded.")}function r(n){return n=String(n).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(d,n)?d[n]:null}var t,o,n=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],d={},h=(n.forEach(function(n){n.encodings.forEach(function(e){e.labels.forEach(function(n){d[n]=e})})}),{}),g={};function y(n,e){return e&&e[n]||null}function p(n,e){e=e.indexOf(n);return-1===e?null:e}function v(n){if("encoding-indexes"in i)return i["encoding-indexes"][n];throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?")}var x="utf-8";function O(n,e){if(!(this instanceof O))throw TypeError("Called as a function. Did you forget 'new'?");n=void 0!==n?String(n):x,e=s(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var i=r(n);if(null===i||"replacement"===i.name)throw RangeError("Unknown encoding: "+n);if(g[i.name])return(n=this)._encoding=i,Boolean(e.fatal)&&(n._error_mode="fatal"),Boolean(e.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal="fatal"===n._error_mode,this.ignoreBOM=n._ignoreBOM),n;throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?")}function k(n,e){if(!(this instanceof k))throw TypeError("Called as a function. Did you forget 'new'?");e=s(e),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(e.fatal)?"fatal":"replacement";if(Boolean(e.NONSTANDARD_allowLegacyEncoding)){e=r(n=void 0!==n?String(n):x);if(null===e||"replacement"===e.name)throw RangeError("Unknown encoding: "+n);if(!h[e.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");this._encoding=e}else this._encoding=r("utf-8"),void 0!==n&&"console"in i&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=this._encoding.name.toLowerCase()),this}function e(n){var r=n.fatal,t=0,o=0,s=0,l=128,a=191;this.handler=function(n,e){if(e===b&&0!==s)return s=0,m(r);if(e===b)return w;if(0===s){if(_(e,0,127))return e;if(_(e,194,223))s=1,t=31&e;else if(_(e,224,239))224===e&&(l=160),237===e&&(a=159),s=2,t=15&e;else{if(!_(e,240,244))return m(r);240===e&&(l=144),244===e&&(a=143),s=3,t=7&e}return null}var i;return _(e,l,a)?(l=128,a=191,t=t<<6|63&e,(o+=1)!==s?null:(i=t,t=s=o=0,i)):(t=s=o=0,l=128,a=191,n.prepend(e),m(r))}}function E(n){n.fatal;this.handler=function(n,e){if(e===b)return w;if(a(e))return e;_(e,128,2047)?(i=1,r=192):_(e,2048,65535)?(i=2,r=224):_(e,65536,1114111)&&(i=3,r=240);for(var i,r,t=[(e>>6*i)+r];0>6*(i-1)),--i;return t}}function j(i,n){var r=n.fatal;this.handler=function(n,e){return e===b?w:u(e)?e:null===(e=i[e-128])?m(r):e}}function B(r,n){n.fatal;this.handler=function(n,e){var i;return e===b?w:a(e)?e:(null===(i=p(e,r))&&f(e),i+128)}}function S(n){var o=n.fatal,s=0,l=0,a=0;this.handler=function(n,e){var i,r,t;return e===b&&0===s&&0===l&&0===a?w:(e!==b||0===s&&0===l&&0===a||(a=l=s=0,m(o)),0!==a?(i=null,_(e,48,57)&&(i=function(n){if(39419>8,n=255&n;return e?[i,n]:[n,i]}function L(r,n){var t=n.fatal,o=null,s=null;this.handler=function(n,e){var i;return e!==b||null===o&&null===s?e===b&&null===o&&null===s?w:null===o?(o=e,null):(e=r?(o<<8)+e:(e<<8)+o,(o=null)!==s?(i=s,s=null,_(e,56320,57343)?65536+1024*(i-55296)+(e-56320):(n.prepend(A(e,r)),m(t))):_(e,55296,56319)?(s=e,null):_(e,56320,57343)?m(t):e):m(t)}}function M(r,n){n.fatal;this.handler=function(n,e){var i;return e===b?w:_(e,0,65535)?A(e,r):(i=A(55296+(e-65536>>10),r),e=A(56320+(e-65536&1023),r),i.concat(e))}}function N(n){n.fatal;this.handler=function(n,e){return e===b?w:u(e)?e:63360+e-128}}function q(n){n.fatal;this.handler=function(n,e){return e===b?w:a(e)?e:_(e,63360,63487)?e-63360+128:f(e)}}Object.defineProperty&&(Object.defineProperty(O.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(O.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(O.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),O.prototype.decode=function(n,e){n="object"==typeof n&&n instanceof ArrayBuffer?new Uint8Array(n):"object"==typeof n&&"buffer"in n&&n.buffer instanceof ArrayBuffer?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(0);e=s(e),this._do_not_flush||(this._decoder=g[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(e.stream);for(var i,r=new c(n),t=[];;){var o=r.read();if(o===b)break;if((i=this._decoder.handler(r,o))===w)break;null!==i&&(Array.isArray(i)?t.push.apply(t,i):t.push(i))}if(!this._do_not_flush){for(;(i=this._decoder.handler(r,r.read()))!==w&&(null!==i&&(Array.isArray(i)?t.push.apply(t,i):t.push(i)),!r.endOfStream()););this._decoder=null}return function(n){e=["UTF-8","UTF-16LE","UTF-16BE"],i=this._encoding.name,-1===e.indexOf(i)||this._ignoreBOM||this._BOMseen||(0>10),56320+(1023&s)))}return t}.call(this,t)},Object.defineProperty&&Object.defineProperty(k.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),k.prototype.encode=function(n,e){n=void 0===n?"":String(n),e=s(e),this._do_not_flush||(this._encoder=h[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(e.stream);for(var i,r=new c(function(n){for(var e=String(n),i=e.length,r=0,t=[];rr in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r=r||{})__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r));function varint64read(){let r=0,t=0;for(let e=0;e<28;e+=7){var a=this.buf[this.pos++];if(r|=(127&a)<>4,0==(128&e))return this.assertBounds(),[r,t];for(let e=3;e<=31;e+=7){var n=this.buf[this.pos++];if(t|=(127&n)<>>e,s=!(n>>>7==0&&0==t);if(a.push(255&(s?128|n:n)),!s)return}var e=r>>>28&15|(7&t)<<4,i=!(t>>3==0);if(a.push(255&(i?128|e:e)),i){for(let e=3;e<31;e+=7){var o=t>>>e,l=!(o>>>7==0);if(a.push(255&(l?128|o:o)),!l)return}a.push(t>>>31&1)}}const TWO_PWR_32_DBL$1=4294967296;function int64fromString(t){var e="-"==t[0];e&&(t=t.slice(1));let a=0,n=0;function r(e,r){e=Number(t.slice(e,r));n*=1e6,(a=1e6*a+e)>=TWO_PWR_32_DBL$1&&(n+=a/TWO_PWR_32_DBL$1|0,a%=TWO_PWR_32_DBL$1)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),[e,a,n]}function int64toString(e,r){if(r<=2097151)return""+(TWO_PWR_32_DBL$1*r+e);var t=(e>>>24|r<<8)>>>0&16777215,r=r>>16&65535;let a=(16777215&e)+6777216*t+6710656*r,n=t+8147497*r,s=2*r;e=1e7;function i(e,r){e=e?String(e):"";return r?"0000000".slice(e.length)+e:e}return a>=e&&(n+=Math.floor(a/e),a%=e),n>=e&&(s+=Math.floor(n/e),n%=e),i(s,0)+i(n,s)+i(a,1)}function varint32write(r,t){if(0<=r){for(;127>>=7;t.push(r)}else{for(let e=0;e<9;e++)t.push(127&r|128),r>>=7;t.push(1)}}function varint32read(){let r=this.buf[this.pos++];var e=127&r;if(0==(128&r))return this.assertBounds(),e;if(e|=(127&(r=this.buf[this.pos++]))<<7,0==(128&r))return this.assertBounds(),e;if(e|=(127&(r=this.buf[this.pos++]))<<14,0==(128&r))return this.assertBounds(),e;if(e|=(127&(r=this.buf[this.pos++]))<<21,0==(128&r))return this.assertBounds(),e;e|=(15&(r=this.buf[this.pos++]))<<28;for(let e=5;0!=(128&r)&&e<10;e++)r=this.buf[this.pos++];if(0!=(128&r))throw new Error("invalid varint");return this.assertBounds(),e>>>0}function detectBi(){var e=new DataView(new ArrayBuffer(8));return void 0!==globalThis.BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}const BI=detectBi();function assertBi(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const RE_DECIMAL_STR=/^-?[0-9]+$/,TWO_PWR_32_DBL=4294967296;class SharedPbLong{constructor(e,r){this.lo=0|e,this.hi=0|r}isZero(){return 0==this.lo&&0==this.hi}toNumber(){var e=this.hi*TWO_PWR_32_DBL+(this.lo>>>0);if(Number.isSafeInteger(e))return e;throw new Error("cannot convert to safe number")}}const _PbULong=class extends SharedPbLong{static from(e){if(BI)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=BI.C(e);case"number":if(0===e)return this.ZERO;e=BI.C(e);case"bigint":if(!e)return this.ZERO;if(eBI.UMAX)throw new Error("ulong too large");return BI.V.setBigUint64(0,e,!0),new _PbULong(BI.V.getInt32(0,!0),BI.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!RE_DECIMAL_STR.test(e))throw new Error("string is no integer");var[r,t,a]=int64fromString(e);if(r)throw new Error("signed value");return new _PbULong(t,a);case"number":if(0==e)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 _PbULong(e,e/TWO_PWR_32_DBL)}throw new Error("unknown value "+typeof e)}toString(){return BI?this.toBigInt().toString():int64toString(this.lo,this.hi)}toBigInt(){return assertBi(BI),BI.V.setInt32(0,this.lo,!0),BI.V.setInt32(4,this.hi,!0),BI.V.getBigUint64(0,!0)}};let PbULong=_PbULong;PbULong.ZERO=new _PbULong(0,0);const _PbLong=class extends SharedPbLong{static from(e){if(BI)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=BI.C(e);case"number":if(0===e)return this.ZERO;e=BI.C(e);case"bigint":if(!e)return this.ZERO;if(eBI.MAX)throw new Error("ulong too large");return BI.V.setBigInt64(0,e,!0),new _PbLong(BI.V.getInt32(0,!0),BI.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;var r,t,a;if(e=e.trim(),RE_DECIMAL_STR.test(e))return[r,a,t]=int64fromString(e),a=new _PbLong(a,t),r?a.negate():a;throw new Error("string is no integer");case"number":if(0==e)return this.ZERO;if(Number.isSafeInteger(e))return 0>>3,e=7&e;if(r<=0||e<0||5this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){var e=this.uint32();return e>>>1^-(1&e)}int64(){return new PbLong(...this.varint64())}uint64(){return new PbULong(...this.varint64())}sint64(){var[e,r]=this.varint64(),t=-(1&e),e=(e>>>1|(1&r)<<31)^t,r=r>>>1^t;return new PbLong(e,r)}bool(){var[e,r]=this.varint64();return 0!==e||0!==r}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new PbULong(this.sfixed32(),this.sfixed32())}sfixed64(){return new PbLong(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(){var e=this.uint32(),r=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(r,r+e)}string(){return this.textDecoder.decode(this.bytes())}}function assert(e,r){if(!e)throw new Error(r)}const FLOAT32_MAX=34028234663852886e22,FLOAT32_MIN=-34028234663852886e22,UINT32_MAX=4294967295,INT32_MAX=2147483647,INT32_MIN=-2147483648;function assertInt32(e){if("number"!=typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>INT32_MAX||eUINT32_MAX||e<0)throw new Error("invalid uint 32: "+e)}function assertFloat32(e){if("number"!=typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>FLOAT32_MAX||e>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(assertUInt32(e);127>>=7;return this.buf.push(e),this}int32(e){return assertInt32(e),varint32write(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){e=this.textEncoder.encode(e);return this.uint32(e.byteLength),this.raw(e)}float(e){assertFloat32(e);var r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,e,!0),this.raw(r)}double(e){var r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,e,!0),this.raw(r)}fixed32(e){assertUInt32(e);var r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,e,!0),this.raw(r)}sfixed32(e){assertInt32(e);var r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,e,!0),this.raw(r)}sint32(e){return assertInt32(e),varint32write(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){var r=new Uint8Array(8),t=new DataView(r.buffer),e=PbLong.from(e);return t.setInt32(0,e.lo,!0),t.setInt32(4,e.hi,!0),this.raw(r)}fixed64(e){var r=new Uint8Array(8),t=new DataView(r.buffer),e=PbULong.from(e);return t.setInt32(0,e.lo,!0),t.setInt32(4,e.hi,!0),this.raw(r)}int64(e){e=PbLong.from(e);return varint64write(e.lo,e.hi,this.buf),this}sint64(e){var e=PbLong.from(e),r=e.hi>>31;return varint64write(e.lo<<1^r,(e.hi<<1|e.lo>>>31)^r,this.buf),this}uint64(e){e=PbULong.from(e);return varint64write(e.lo,e.hi,this.buf),this}}function binaryWriteOptions(e){return e?__spreadValues(__spreadValues({},defaultsWrite$1),e):defaultsWrite$1}function binaryReadOptions(e){return e?__spreadValues(__spreadValues({},defaultsRead$1),e):defaultsRead$1}!function(i){i.symbol=Symbol.for("protobuf-ts/unknown"),i.onRead=(e,r,t,a,n)=>{(s(r)?r[i.symbol]:r[i.symbol]=[]).push({no:t,wireType:a,data:n})},i.onWrite=(e,r,t)=>{for(var{no:a,wireType:n,data:s}of i.list(r))t.tag(a,n).raw(s)},i.list=(e,r)=>s(e)?(e=e[i.symbol],r?e.filter((e=>e.no==r)):e):[],i.last=(e,r)=>i.list(e,r).slice(-1)[0];const s=e=>e&&Array.isArray(e[i.symbol])}(UnknownFieldHandler=UnknownFieldHandler||{});const defaultsRead$1={readUnknownField:!0,readerFactory:e=>new BinaryReader(e)},defaultsWrite$1={writeUnknownFields:!0,writerFactory:()=>new BinaryWriter},MESSAGE_TYPE=(!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"}(WireType=WireType||{}),Symbol.for("protobuf-ts/message-type"));function lowerCamelCase(r){let t=!1;var a=[];for(let e=0;e!r.includes(e))))return!1;if(!n&&r.some((e=>!t.known.includes(e))))return!1;if(!(a<1)){for(const i of t.oneofs){const o=e[i];if(!isOneofGroup(o))return!1;if(void 0!==o.oneofKind){var s=this.fields.find((e=>e.localName===o.oneofKind));if(!s)return!1;if(!this.field(o[o.oneofKind],s,n,a))return!1}}for(const l of this.fields)if(void 0===l.oneof&&!this.field(e[l.localName],l,n,a))return!1}}return!0}field(e,r,t,a){var n=r.repeat;switch(r.kind){case"scalar":return void 0===e?r.opt:n?this.scalars(e,r.T,a,r.L):this.scalar(e,r.T,r.L);case"enum":return void 0===e?r.opt:n?this.scalars(e,ScalarType.INT32,a):this.scalar(e,ScalarType.INT32);case"message":return void 0===e?!0:n?this.messages(e,r.T(),t,a):this.message(e,r.T(),t,a);case"map":if("object"!=typeof e||null===e)return!1;if(a<2)return!0;if(!this.mapKeys(e,r.K,a))return!1;switch(r.V.kind){case"scalar":return this.scalars(Object.values(e),r.V.T,a,r.V.L);case"enum":return this.scalars(Object.values(e),ScalarType.INT32,a);case"message":return this.messages(Object.values(e),r.V.T(),t,a)}}return!0}message(e,r,t,a){return t?r.isAssignable(e,a):r.is(e,a)}messages(r,t,e,a){if(!Array.isArray(r))return!1;if(!(a<2))if(e){for(let e=0;eparseInt(e))),r,t);case ScalarType.BOOL:return this.scalars(a.slice(0,t).map((e=>"true"==e||"false"!=e&&e)),r,t);default:return this.scalars(a,r,t,LongType.STRING)}}}function typeofJsonValue(e){var r=typeof e;if("object"==r){if(Array.isArray(e))return"array";if(null===e)return"null"}return r}function isJsonObject(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}let encTable="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),decTable=[];for(let e=0;e>4,i=s,n=2;break;case 2:t[a++]=(15&i)<<4|(60&s)>>2,i=s,n=3;break;case 3:t[a++]=(3&i)<<6|s,n=0}}if(1==n)throw Error("invalid base64 string.");return t.subarray(0,a)}function base64encode(r){let t="",a=0,n,s=0;for(let e=0;e>2],s=(3&n)<<4,a=1;break;case 1:t+=encTable[s|n>>4],s=(15&n)<<2,a=2;break;case 2:t=(t+=encTable[s|n>>6])+encTable[63&n],a=0}return a&&(t=t+encTable[s]+"=",1==a&&(t+="=")),t}function reflectionLongConvert(e,r){switch(r){case LongType.BIGINT:return e.toBigInt();case LongType.NUMBER:return e.toNumber();default:return e.toString()}}decTable["-".charCodeAt(0)]=encTable.indexOf("+"),decTable["_".charCodeAt(0)]=encTable.indexOf("/");class ReflectionJsonReader{constructor(e){this.info=e}prepare(){var e;if(void 0===this.fMap){this.fMap={};for(const r of null!=(e=this.info.fields)?e:[])this.fMap[r.name]=r,this.fMap[r.jsonName]=r,this.fMap[r.localName]=r}}assert(e,r,t){if(!e){let e=typeofJsonValue(t);throw"number"!=e&&"boolean"!=e||(e=t.toString()),new Error(`Cannot parse JSON ${e} for ${this.info.typeName}#`+r)}}read(e,r,t){this.prepare();var a,n,s=[];for([a,n]of Object.entries(e)){var i=this.fMap[a];if(!i){if(t.ignoreUnknownFields)continue;throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: `+a)}var o=i.localName;let e;if(i.oneof){if(s.includes(i.oneof))throw new Error(`Multiple members of the oneof group "${i.oneof}" of ${this.info.typeName} are present in JSON.`);s.push(i.oneof),e=r[i.oneof]={oneofKind:o}}else e=r;if("map"==i.kind){if(null!==n){this.assert(isJsonObject(n),i.name,n);var l,c,u=e[o];for([l,c]of Object.entries(n)){this.assert(null!==c,i.name+" map value",null);let e;switch(i.V.kind){case"message":e=i.V.T().internalJsonRead(c,t);break;case"enum":if(!1===(e=this.enum(i.V.T(),c,i.name,t.ignoreUnknownFields)))continue;break;case"scalar":e=this.scalar(c,i.V.T,i.V.L,i.name)}this.assert(void 0!==e,i.name+" map value",c);let r=l;i.K==ScalarType.BOOL&&(r="true"==r||"false"!=r&&r),u[r=this.scalar(r,i.K,LongType.STRING,i.name).toString()]=e}}}else if(i.repeat){if(null!==n){this.assert(Array.isArray(n),i.name,n);var f=e[o];for(const p of n){this.assert(null!==p,i.name,null);let e;switch(i.kind){case"message":e=i.T().internalJsonRead(p,t);break;case"enum":if(!1===(e=this.enum(i.T(),p,i.name,t.ignoreUnknownFields)))continue;break;case"scalar":e=this.scalar(p,i.T,i.L,i.name)}this.assert(void 0!==e,i.name,n),f.push(e)}}}else switch(i.kind){case"message":null===n&&"google.protobuf.Value"!=i.T().typeName?this.assert(void 0===i.oneof,i.name+" (oneof member)",null):e[o]=i.T().internalJsonRead(n,t,e[o]);break;case"enum":var h=this.enum(i.T(),n,i.name,t.ignoreUnknownFields);!1!==h&&(e[o]=h);break;case"scalar":e[o]=this.scalar(n,i.T,i.L,i.name)}}}enum(r,t,a,n){if("google.protobuf.NullValue"==r[0]&&assert(null===t,`Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} only accepts null.`),null===t)return 0;switch(typeof t){case"number":return assert(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${a}, enum can only be integral number, got ${t}.`),t;case"string":let e=t;r[2]&&t.substring(0,r[2].length)===r[2]&&(e=t.substring(r[2].length));var s=r[1][e];return void 0===s&&n?!1:(assert("number"==typeof s,`Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} has no value for "${t}".`),s)}assert(!1,`Unable to parse field ${this.info.typeName}#${a}, cannot parse enum value from ${typeof t}".`)}scalar(r,t,a,e){let n;try{switch(t){case ScalarType.DOUBLE:case ScalarType.FLOAT:if(null===r)return 0;if("NaN"===r)return Number.NaN;if("Infinity"===r)return Number.POSITIVE_INFINITY;if("-Infinity"===r)return Number.NEGATIVE_INFINITY;if(""===r)n="empty string";else if("string"==typeof r&&r.trim().length!==r.length)n="extra whitespace";else if("string"==typeof r||"number"==typeof r){var s=Number(r);if(Number.isNaN(s))n="not a number";else{if(Number.isFinite(s))return t==ScalarType.FLOAT&&assertFloat32(s),s;n="too large or small"}}break;case ScalarType.INT32:case ScalarType.FIXED32:case ScalarType.SFIXED32:case ScalarType.SINT32:case ScalarType.UINT32:if(null===r)return 0;let e;if("number"==typeof r?e=r:""===r?n="empty string":"string"==typeof r&&(r.trim().length!==r.length?n="extra whitespace":e=Number(r)),void 0===e)break;return(t==ScalarType.UINT32?assertUInt32:assertInt32)(e),e;case ScalarType.INT64:case ScalarType.SFIXED64:case ScalarType.SINT64:if(null===r)return reflectionLongConvert(PbLong.ZERO,a);if("number"!=typeof r&&"string"!=typeof r)break;return reflectionLongConvert(PbLong.from(r),a);case ScalarType.FIXED64:case ScalarType.UINT64:if(null===r)return reflectionLongConvert(PbULong.ZERO,a);if("number"!=typeof r&&"string"!=typeof r)break;return reflectionLongConvert(PbULong.from(r),a);case ScalarType.BOOL:if(null===r)return!1;if("boolean"!=typeof r)break;return r;case ScalarType.STRING:if(null===r)return"";if("string"!=typeof r){n="extra whitespace";break}try{encodeURIComponent(r)}catch(e){0;break}return r;case ScalarType.BYTES:if(null===r||""===r)return new Uint8Array(0);if("string"!=typeof r)break;return base64decode(r)}}catch(e){n=e.message}this.assert(!1,e+(n?" - "+n:""),r)}}class ReflectionJsonWriter{constructor(e){this.fields=null!=(e=e.fields)?e:[]}write(e,r){var t,a,n={},s=e;for(const i of this.fields)i.oneof?(t=s[i.oneof]).oneofKind===i.localName&&(a="scalar"==i.kind||"enum"==i.kind?__spreadProps(__spreadValues({},r),{emitDefaultValues:!0}):r,assert(void 0!==(t=this.field(i,t[i.localName],a))),n[r.useProtoFieldName?i.name:i.jsonName]=t):void 0!==(a=this.field(i,s[i.localName],r))&&(n[r.useProtoFieldName?i.name:i.jsonName]=a);return n}field(r,t,a){let e=void 0;if("map"==r.kind){assert("object"==typeof t&&null!==t);var n={};switch(r.V.kind){case"scalar":for(var[s,i]of Object.entries(t)){i=this.scalar(r.V.T,i,r.name,!1,!0);assert(void 0!==i),n[s.toString()]=i}break;case"message":var o,l,c=r.V.T();for([o,l]of Object.entries(t)){var u=this.message(c,l,r.name,a);assert(void 0!==u),n[o.toString()]=u}break;case"enum":var f,h,p=r.V.T();for([f,h]of Object.entries(t)){assert(void 0===h||"number"==typeof h);var d=this.enum(p,h,r.name,!1,!0,a.enumAsInteger);assert(void 0!==d),n[f.toString()]=d}}(a.emitDefaultValues||0[e.no,e]))))}read(a,n,s,e){this.prepare();for(var r=void 0===e?a.len:a.pos+e;a.pose.no-r.no)))}write(n,s,i){this.prepare();for(const f of this.fields){let e,r,t=f.repeat,a=f.localName;if(f.oneof){var o=n[f.oneof];if(o.oneofKind!==a)continue;e=o[a],r=!0}else e=n[a],r=!1;switch(f.kind){case"scalar":case"enum":var l="enum"==f.kind?ScalarType.INT32:f.T;if(t)if(assert(Array.isArray(e)),t==RepeatType.PACKED)this.packed(s,l,f.no,e);else for(const h of e)this.scalar(s,l,f.no,h,!0);else void 0===e?assert(f.opt):this.scalar(s,l,f.no,e,r||f.opt);break;case"message":if(t){assert(Array.isArray(e));for(const p of e)this.message(s,i,f.T(),f.no,p)}else this.message(s,i,f.T(),f.no,e);break;case"map":assert("object"==typeof e&&null!==e);for(var[c,u]of Object.entries(e))this.mapEntry(s,i,f,c,u)}}var e=i.writeUnknownFields;!1!==e&&(!0===e?UnknownFieldHandler.onWrite:e)(this.info.typeName,n,s)}mapEntry(e,r,t,a,n){e.tag(t.no,WireType.LengthDelimited),e.fork();let s=a;switch(t.K){case ScalarType.INT32:case ScalarType.FIXED32:case ScalarType.UINT32:case ScalarType.SFIXED32:case ScalarType.SINT32:s=Number.parseInt(a);break;case ScalarType.BOOL:assert("true"==a||"false"==a),s="true"==a}switch(this.scalar(e,t.K,1,s,!0),t.V.kind){case"scalar":this.scalar(e,t.V.T,2,n,!0);break;case"enum":this.scalar(e,ScalarType.INT32,2,n,!0);break;case"message":this.message(e,r,t.V.T(),2,n)}e.join()}message(e,r,t,a,n){void 0!==n&&(t.internalBinaryWrite(n,e.tag(a,WireType.LengthDelimited).fork(),r),e.join())}scalar(e,r,t,a,n){var[r,s,i]=this.scalarInfo(r,a);i&&!n||(e.tag(t,r),e[s](a))}packed(r,e,t,a){if(a.length){assert(e!==ScalarType.BYTES&&e!==ScalarType.STRING),r.tag(t,WireType.LengthDelimited),r.fork();var[,n]=this.scalarInfo(e);for(let e=0;e=0;)t[e]=0}const a=256,i=286,n=30,s=15,r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);const _=new Array(60);e(_);const f=new Array(512);e(f);const c=new Array(256);e(c);const u=new Array(29);e(u);const w=new Array(n);function b(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let g,p,m;function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(w);const v=t=>t<256?f[t]:f[256+(t>>>7)],y=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{x(t,a[2*e],a[2*e+1])},A=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=(t,e,a)=>{const i=new Array(16);let n,r,l=0;for(n=1;n<=s;n++)i[n]=l=l+a[n-1]<<1;for(r=0;r<=e;r++){let e=t[2*r+1];0!==e&&(t[2*r]=A(i[e]++,e))}},R=t=>{let e;for(e=0;e{t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},U=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let n,s,o,h,d=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===n?z(t,s,e):(o=c[s],z(t,o+a+1,e),h=r[o],0!==h&&(s-=u[o],x(t,s,h)),n--,o=v(n),z(t,o,i),h=l[o],0!==h&&(n-=w[o],x(t,n,h)))}while(d{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,r=e.stat_desc.elems;let l,o,h,d=-1;for(t.heap_len=0,t.heap_max=573,l=0;l>1;l>=1;l--)S(t,a,l);h=r;do{l=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=l,t.heap[--t.heap_max]=o,a[2*h]=a[2*l]+a[2*o],t.depth[h]=(t.depth[l]>=t.depth[o]?t.depth[l]:t.depth[o])+1,a[2*l+1]=a[2*o+1]=h,t.heap[1]=h++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,h=e.stat_desc.max_length;let d,_,f,c,u,w,b=0;for(c=0;c<=s;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)_=t.heap[d],c=a[2*a[2*_+1]+1]+1,c>h&&(c=h,b++),a[2*_+1]=c,_>i||(t.bl_count[c]++,u=0,_>=o&&(u=l[_-o]),w=a[2*_],t.opt_len+=w*(c+u),r&&(t.static_len+=w*(n[2*_+1]+u)));if(0!==b){do{for(c=h-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[h]--,b-=2}while(b>0);for(c=h;0!==c;c--)for(_=t.bl_count[c];0!==_;)f=t.heap[--d],f>i||(a[2*f+1]!==c&&(t.opt_len+=(c-a[2*f+1])*a[2*f],a[2*f+1]=c),_--)}})(t,e),E(a,d,t.bl_count)},O=(t,e,a)=>{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++l{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++l{x(t,0+(i?1:0),3),((t,e,a,i)=>{Z(t),i&&(y(t,a),y(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var N={_tr_init:t=>{F||((()=>{let t,e,a,h,k;const v=new Array(16);for(a=0,h=0;h<28;h++)for(u[h]=a,t=0;t<1<>=7;h{let s,r,l=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=i+5,i+4<=s&&-1!==e?L(t,e,i,n):4===t.strategy||r===s?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),((t,e,a,i)=>{let n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(c[i]+a+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{x(t,2,3),z(t,256,d),(t=>{16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var B=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const C=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var M=(t,e,a,i)=>{const n=C,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:K,_tr_stored_block:P,_tr_flush_block:Y,_tr_tally:G,_tr_align:X}=N,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:lt,Z_FIXED:ot,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:dt,Z_DEFLATED:_t}=j,ft=258,ct=262,ut=103,wt=113,bt=666,gt=(t,e)=>(t.msg=H[e],e),pt=t=>(t<<1)-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let kt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=(t,e)=>{Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vt(t.strm)},xt=(t,e)=>{t.pending_buf[t.pending++]=e},zt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=B(t.adler,e,n,a):2===t.state.wrap&&(t.adler=M(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},Et=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,l=t.nice_match;const o=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),l>t.lookahead&&(l=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=l)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>o&&0!=--n);return r<=t.lookahead?r:t.lookahead},Rt=t=>{const e=t.w_size;let a,i,n,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ct)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,a=i;do{n=t.head[--a],t.head[a]=n>=e?n-e:0}while(--i);i=e,a=i;do{n=t.prev[--a],t.prev[a]=n>=e?n-e:0}while(--i);s+=e}if(0===t.strm.avail_in)break;if(i=At(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=kt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=kt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,i;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=kt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=G(t,0,t.window[t.strstart-1]),i&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Dt=[new St(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Rt(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Zt),new St(4,5,16,8,Zt),new St(4,6,32,32,Zt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Tt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ot=t=>{if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},It=t=>{const e=Ot(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Dt[a.level].max_lazy,a.good_match=Dt[a.level].good_length,a.nice_match=Dt[a.level].nice_length,a.max_chain_length=Dt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ft=(t,e,a,i,n,s)=>{if(!t)return et;let r=1;if(e===nt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||s<0||s>ot)return gt(t,et);8===i&&(i=9);const l=new Tt;return t.state=l,l.strm=t,l.wrap=r,l.gzhead=null,l.w_bits=i,l.w_size=1<Ft(t,e,_t,15,8,ht),deflateInit2:Ft,deflateReset:It,deflateResetKeep:Ot,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et,deflate:(t,e)=>{let a,i;if(!t||!t.state||e>V||e<0)return t?gt(t,et):et;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;const s=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,3),n.status=wt);else{let e=_t+(n.w_bits-8<<4)<<8,a=-1;a=n.strategy>=rt||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=a<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=wt,zt(n,e),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ut)}else n.status=ut;if(n.status===ut&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&vt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(vt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(s)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){let a=n.strategy===rt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Rt(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===lt?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=ft){if(Rt(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+ft;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):Dt[n.level].func(n,e);if(3!==a&&4!==a||(n.status=bt),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===a&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),vt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),vt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:t=>{if(!t||!t.state)return et;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ut&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return et;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Rt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=kt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Rt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};const Nt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Bt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Nt(a,e)&&(t[e]=a[e])}}return t},Ct=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ht[254]=Ht[254]=1;var jt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,l=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Kt=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Yt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_SYNC_FLUSH:Wt,Z_FULL_FLUSH:qt,Z_FINISH:Jt,Z_OK:Qt,Z_STREAM_END:Vt,Z_DEFAULT_COMPRESSION:$t,Z_DEFAULT_STRATEGY:te,Z_DEFLATED:ee}=j;function ae(t){this.options=Bt({level:$t,method:ee,chunkSize:16384,windowBits:15,memLevel:8,strategy:te},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Lt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Qt)throw new Error(H[a]);if(e.header&&Lt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?jt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Lt.deflateSetDictionary(this.strm,t),a!==Qt)throw new Error(H[a]);this._dict_set=!0}}function ie(t,e){const a=new ae(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ae.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Jt:Xt,"string"==typeof t?a.input=jt(t):"[object ArrayBuffer]"===Gt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Wt||s===qt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Lt.deflate(a,s),n===Vt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Lt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},ae.prototype.onData=function(t){this.chunks.push(t)},ae.prototype.onEnd=function(t){t===Qt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ne={Deflate:ae,deflate:ie,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ie(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ie(t,e)},constants:j};var se=function(t,e){let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),l=E.dmax,o=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,b=(1<>>24,f>>>=m,c-=m,m=p>>>16&255,0===m)A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=u[(65535&p)+(f&(1<>>=m,c-=m),c<15&&(f+=z[a++]<>>24,f>>>=m,c-=m,m=p>>>16&255,!(16&m)){if(0==(64&m)){p=w[(65535&p)+(f&(1<l){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,c-=m,m=n-s,v>m){if(m=v-m,m>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=o-m,m2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const o=l.bits;let h,d,_,f,c,u,w=0,b=0,g=0,p=0,m=0,k=0,v=0,y=0,x=0,z=0,A=null,E=0;const R=new Uint16Array(16),Z=new Uint16Array(16);let U,S,D,T=null,O=0;for(w=0;w<=re;w++)R[w]=0;for(b=0;b=1&&0===R[p];p--);if(m>p&&(m=p),0===p)return n[s++]=20971520,n[s++]=20971520,l.bits=1,0;for(g=1;g0&&(0===t||1!==p))return-1;for(Z[1]=0,w=1;w852||2===t&&x>592)return 1;for(;;){U=w-v,r[b]u?(S=T[O+r[b]],D=A[E+r[b]]):(S=96,D=0),h=1<>v)+d]=U<<24|S<<16|D|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,b++,0==--R[w]){if(w===p)break;w=e[a+r[b]]}if(w>m&&(z&f)!==_){for(0===v&&(v=m),c+=g,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=m<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),l.bits=m,0};const{Z_FINISH:fe,Z_BLOCK:ce,Z_TREES:ue,Z_OK:we,Z_STREAM_END:be,Z_NEED_DICT:ge,Z_STREAM_ERROR:pe,Z_DATA_ERROR:me,Z_MEM_ERROR:ke,Z_BUF_ERROR:ve,Z_DEFLATED:ye}=j,xe=12,ze=30,Ae=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ee(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Re=t=>{if(!t||!t.state)return pe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,we},Ze=t=>{if(!t||!t.state)return pe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Re(t)},Ue=(t,e)=>{let a;if(!t||!t.state)return pe;const i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pe:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Ze(t))},Se=(t,e)=>{if(!t)return pe;const a=new Ee;t.state=a,a.window=null;const i=Ue(t,e);return i!==we&&(t.state=null),i};let De,Te,Oe=!0;const Ie=t=>{if(Oe){De=new Int32Array(512),Te=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(_e(1,t.lens,0,288,De,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;_e(2,t.lens,0,32,Te,0,t.work,{bits:5}),Oe=!1}t.lencode=De,t.lenbits=9,t.distcode=Te,t.distbits=5},Fe=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whaveSe(t,15),inflateInit2:Se,inflate:(t,e)=>{let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return pe;a=t.state,a.mode===xe&&(a.mode=13),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,_=l,f=o,x=we;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=ze;break}if((15&h)!==ye){t.msg="unknown compression method",a.mode=ze;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=ze;break}a.dmax=1<>8&1),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=M(a.check,A,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>8),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&(c=a.length,c>l&&(c=l),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&(a.check=M(a.check,i,c,s)),l-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===l)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=xe;break;case 10:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===l)break t;l--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=14;break;case 1:if(Ie(a),a.mode=20,e===ue){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=ze}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===l)break t;l--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ze;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===ue)break t;case 15:a.mode=16;case 16:if(c=a.length,c){if(c>l&&(c=l),c>o&&(c=o),0===c)break t;n.set(i.subarray(s,s+c),r),l-=c,s+=c,o-=c,r+=c,a.length-=c;break}a.mode=xe;break;case 17:for(;d<14;){if(0===l)break t;l--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ze;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=_e(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=ze;break}a.have=0,a.mode=19;case 19:for(;a.have>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(R=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=ze;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===p){for(R=b+3;d>>=b,d-=b,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=b+7;d>>=b,d-=b,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ze;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===ze)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ze;break}if(a.lenbits=9,E={bits:a.lenbits},x=_e(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=ze;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=_e(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=ze;break}if(a.mode=20,e===ue)break t;case 20:a.mode=21;case 21:if(l>=6&&o>=258){t.next_out=r,t.avail_out=o,t.next_in=s,t.avail_in=l,a.hold=h,a.bits=d,se(t,f),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,a.mode===xe&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=xe;break}if(64&g){t.msg="invalid literal/length code",a.mode=ze;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;z=a.distcode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=ze;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ze;break}a.mode=25;case 25:if(0===o)break t;if(c=f-o,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ze;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>o&&(c=o),o-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=21);break;case 26:if(0===o)break t;n[r++]=a.length,o--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===l)break t;l--,h|=i[s++]<{if(!t||!t.state)return pe;let e=t.state;return e.window&&(e.window=null),t.state=null,we},inflateGetHeader:(t,e)=>{if(!t||!t.state)return pe;const a=t.state;return 0==(2&a.wrap)?pe:(a.head=e,e.done=!1,we)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?pe:11===i.mode&&(n=1,n=B(n,e,a,0),n!==i.check)?me:(s=Fe(t,e,a,a),s?(i.mode=31,ke):(i.havedict=1,we))):pe},inflateInfo:"pako inflate (from Nodeca project)"};var Ne=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Be=Object.prototype.toString,{Z_NO_FLUSH:Ce,Z_FINISH:Me,Z_OK:He,Z_STREAM_END:je,Z_NEED_DICT:Ke,Z_STREAM_ERROR:Pe,Z_DATA_ERROR:Ye,Z_MEM_ERROR:Ge}=j;function Xe(t){this.options=Bt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Le.inflateInit2(this.strm,e.windowBits);if(a!==He)throw new Error(H[a]);if(this.header=new Ne,Le.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=jt(e.dictionary):"[object ArrayBuffer]"===Be.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Le.inflateSetDictionary(this.strm,e.dictionary),a!==He)))throw new Error(H[a])}function We(t,e){const a=new Xe(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}Xe.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,l;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Me:Ce,"[object ArrayBuffer]"===Be.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Le.inflate(a,r),s===Ke&&n&&(s=Le.inflateSetDictionary(a,n),s===He?s=Le.inflate(a,r):s===Ye&&(s=Ke));a.avail_in>0&&s===je&&a.state.wrap>0&&0!==t[a.next_in];)Le.inflateReset(a),s=Le.inflate(a,r);switch(s){case Pe:case Ye:case Ke:case Ge:return this.onEnd(s),this.ended=!0,!1}if(l=a.avail_out,a.next_out&&(0===a.avail_out||s===je))if("string"===this.options.to){let t=Pt(a.output,a.next_out),e=a.next_out-t,n=Kt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==He||0!==l){if(s===je)return s=Le.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Xe.prototype.onData=function(t){this.chunks.push(t)},Xe.prototype.onEnd=function(t){t===He&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Xe,inflate:We,inflateRaw:function(t,e){return(e=e||{}).raw=!0,We(t,e)},ungzip:We,constants:j};const{Deflate:Je,deflate:Qe,deflateRaw:Ve,gzip:$e}=ne,{Inflate:ta,inflate:ea,inflateRaw:aa,ungzip:ia}=qe;var na=Je,sa=Qe,ra=Ve,la=$e,oa=ta,ha=ea,da=aa,_a=ia,fa=j,ca={Deflate:na,deflate:sa,deflateRaw:ra,gzip:la,Inflate:oa,inflate:ha,inflateRaw:da,ungzip:_a,constants:fa};t.Deflate=na,t.Inflate=oa,t.constants=fa,t.default=ca,t.deflate=sa,t.deflateRaw=ra,t.gzip=la,t.inflate=ha,t.inflateRaw=da,t.ungzip=_a,Object.defineProperty(t,"__esModule",{value:!0})})); - /****************** initialization finish ******************/ - // 先拆分B站gRPC校验头和protobuf数据体 - let header = rawBody.slice(0, 5); - body = rawBody.slice(5); - // 处理response压缩protobuf数据体 - switch (header?.[0]) { - case 0: // unGzip - break; - case 1: // Gzip - body = pako.ungzip(body); - header[0] = 0; // unGzip - break; - }; - // 解析链接并处理protobuf数据 - switch (HOST) { - case "grpc.biliapi.net": // HTTP/2 - case "app.bilibili.com": // HTTP/1.1 - /****************** initialization start *******************/ - // google.protobuf.Any - class Any$Type extends MessageType{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(message,type){return{typeUrl:this.typeNameToUrl(type.typeName),value:type.toBinary(message),}}unpack(any,type,options){if(!this.contains(any,type))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+any.typeUrl+"' as "+type.typeName+".");return type.fromBinary(any.value,options)}contains(any,type){if(!any.typeUrl.length)return false;let wants=typeof type=="string"?type:type.typeName;let has=this.typeUrlToName(any.typeUrl);return wants===has}internalJsonWrite(any,options){if(any.typeUrl==="")return{};let typeName=this.typeUrlToName(any.typeUrl);let opt=jsonWriteOptions(options);let type=opt.typeRegistry?.find(t=>t.typeName===typeName);if(!type)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+any.typeUrl+"' to JSON. The specified type "+typeName+" is not available in the type registry.");let value=type.fromBinary(any.value,{readUnknownField:false});let json=type.internalJsonWrite(value,opt);if(typeName.startsWith("google.protobuf.")||!isJsonObject(json))json={value:json};json["@type"]=any.typeUrl;return json}internalJsonRead(json,options,target){if(!isJsonObject(json))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+typeofJsonValue(json)+".");if(typeof json["@type"]!="string"||json["@type"]=="")return this.create();let typeName=this.typeUrlToName(json["@type"]);let type=options?.typeRegistry?.find(t=>t.typeName==typeName);if(!type)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+typeName+" is not available in the type registry.");let value;if(typeName.startsWith("google.protobuf.")&&json.hasOwnProperty("value"))value=type.fromJson(json["value"],options);else{let copy=Object.assign({},json);delete copy["@type"];value=type.fromJson(copy,options)}if(target===undefined)target=this.create();target.typeUrl=json["@type"];target.value=type.toBinary(value);return target}typeNameToUrl(name){if(!name.length)throw new Error("invalid type name: "+name);return"type.googleapis.com/"+name}typeUrlToName(url){if(!url.length)throw new Error("invalid type url: "+url);let slash=url.lastIndexOf("/");let name=slash>0?url.substring(slash+1):url;if(!name.length)throw new Error("invalid type url: "+url);return name}create(value){const message={typeUrl:"",value:new Uint8Array(0)};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posPlayArcConf}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posArcConf}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posExtraContent}])}create(value){const message={isSupport:false,disabled:false};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posDynamicList},{no:2,name:"up_list",kind:"message",T:()=>CardVideoUpList},{no:3,name:"topic_list",kind:"message",T:()=>TopicList}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posCardVideoUpList}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posDynamicItem}])}create(value){const message={list:[]};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos["DynamicType",DynamicType]}])}create(value){const message={cardType:0};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos { - if (item.cardType !== 15) { - return true; - } - $.log(`🎉 ${$.name}`, "动态综合页广告动态去除"); - return false; - } - ); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置动态综合页广告动态不去除"); - break; - } - body = DynAllReply.toBinary(data); - break; - case "DynVideo": // 动态视频页 - data = DynVideoReply.fromBinary(body); - switch (Settings?.Detail?.Most_visited) { - case true: - default: - if (data.videoUpList) { - data.videoUpList = null; - $.log(`🎉 ${$.name}`, "动态视频页最常访问去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置动态视频页最常访问不去除"); - break; - } - body = DynVideoReply.toBinary(data); - break; - } - break; - case "bilibili.app.view.v1.View": // 视频 - switch (PATHs?.[1]) { - case "View": // 视频播放页 - /****************** initialization start *******************/ - // protobuf/bilibili/app/view/view.proto - class ViewReply$Type extends MessageType{constructor(){super("ViewReply",[{no:6,name:"t_icon",kind:"map",K:9,V:{kind:"message",T:()=>TIcon}},{no:10,name:"relates",kind:"message",repeat:1,T:()=>Relate},{no:30,name:"cms",kind:"message",repeat:1,T:()=>CM},{no:31,name:"cm_config",kind:"message",T:()=>CMConfig}])}create(value){const message={tIcon:{},relates:[],cms:[]};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posAny}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posAny}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posCM}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos { - if (item.goto === "cm") { - $.log(`🎉 ${$.name}`, "播放页关联推荐广告去除"); - return false; - } - return true; - }); - } - const adsControlValue = data.cmConfig?.adsControl?.value; - if (Boolean(adsControlValue) && Object.values(adsControlValue).length !== 0) { - data.cmConfig = null; - $.log(`🎉 ${$.name}`, "up主推荐广告弹幕去除"); - } - for (const i in data.tIcon) { - if (data.tIcon[i] === null) { - // 解决tIcon的null is not an object问题 - // console.log(`tIconMap:${i}`); - delete data.tIcon[i]; - } - } - body = ViewReply.toBinary(data); - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置播放页广告不去除"); - break; - }; - break; - } - break; - case "bilibili.community.service.dm.v1.DM": //弹幕配置 - switch (PATHs?.[1]) { - case "DmView": // 弹幕 - //待补充 - break; - } - break; - case "bilibili.pgc.gateway.player.v2.PlayURL": // 番剧 - /****************** initialization start *******************/ - /****************** initialization finish *******************/ - switch (PATHs?.[1]) { - case "PlayView": { // 播放地址 - /****************** initialization start *******************/ - /****************** initialization finish *******************/ - break; - }; - case "PlayConf": // 播放配置 - break; - }; - break; - case "bilibili.app.nativeact.v1.NativeAct": // 活动-节目、动画、韩综(港澳台) - switch (PATHs?.[1]) { - case "Index": // 首页 - break; - }; - break; - case "bilibili.app.interface.v1.Search": // 搜索框 - switch (PATHs?.[1]) { - case "Suggest3": // 搜索建议 - break; - }; - break; - case "bilibili.polymer.app.search.v1.Search": // 搜索结果 - /****************** initialization start *******************/ - /****************** initialization finish *******************/ - switch (PATHs?.[1]) { - case "SearchAll": { // 全部结果(综合) - /****************** initialization start *******************/ - class SearchAllResponse$Type extends MessageType{constructor(){super("SearchAllResponse",[{no:4,name:"item",kind:"message",repeat:1,T:()=>Item}])}create(value){const message={item:[]};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posSearchAdCard}])}create(value){const message={cardItem:{oneofKind:undefined}};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos !(i.cardItem?.oneofKind === "cm")); - $.log(`🎉 ${$.name}`, "搜索页广告去除"); - body = SearchAllResponse.toBinary(data); - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置搜索页广告不去除"); - break; - } - break; - }; - case "SearchByType": { // 分类结果(番剧、用户、影视、专栏) - break; - }; - }; - break; - }; - break; - }; - // protobuf部分处理完后,重新计算并添加B站gRPC校验头 - rawBody = newRawBody({ header, body }); // gzip压缩有问题,别用 - break; - }; - // 写入二进制数据 - if ($.isQuanX()) $response.bodyBytes = rawBody - else $response.body = rawBody; - break; - }; - break; - case "false": - break; - }; + const { Settings, Caches, Configs } = setENV('BiliBili', 'ADBlock', DataBase); + switch (Settings?.Switch) { + case true: + default: + let url = URL.parse($request?.url); + const METHOD = $request?.method, + HOST = url?.host, + PATH = url?.path, + PATHs = PATH.split('/'); + // 解析格式 + const FORMAT = ( + $response?.headers?.['Content-Type'] ?? + $response?.headers?.['content-type'] + )?.split(';')?.[0]; + $.log( + `⚠ ${$.name}`, + `METHOD: ${METHOD}`, + `HOST: ${HOST}`, + `PATH: ${PATH}`, + `PATHs: ${PATHs}`, + `FORMAT: ${FORMAT}`, + '' + ); + // 创建空数据 + let body = { code: 0, message: '0', data: {} }; + // 格式判断 + switch (FORMAT) { + case undefined: // 视为无body + break; + case 'application/x-www-form-urlencoded': + case 'text/plain': + case 'text/html': + default: + break; + case 'text/xml': + case 'text/plist': + case 'application/xml': + case 'application/plist': + case 'application/x-plist': + break; + case 'text/json': + case 'application/json': + body = JSON.parse($response.body); + // 解析链接 + switch (HOST) { + case 'www.bilibili.com': + break; + case 'app.bilibili.com': + case 'app.biliapi.net': + switch (PATH) { + case 'x/v2/splash/show': // 开屏页 + case 'x/v2/splash/list': // 开屏页 + case 'x/v2/splash/brand/list': // 开屏页 + case 'x/v2/splash/event/list2': // 开屏页 + switch (Settings?.Detail?.splash) { + case true: + default: + const item = ['account', 'event_list', 'preload', 'show']; + if (body.data) { + item.forEach((i) => { + delete body.data[i]; + }); + $.log(`🎉 ${$.name}`, '开屏页广告去除'); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置开屏页广告不去除'); + break; + } + break; + case 'x/v2/feed/index': // 推荐页 + switch (Settings?.Detail?.feed) { + case true: + default: + if (body.data.items?.length) { + let params = url?.params; //区分pad与phone + body.data.items = await Promise.all( + body.data.items.map(async (item) => { + const { card_type: cardType, card_goto: cardGoto } = + item; + if (cardType && cardGoto) { + if ( + ['banner_v8', 'banner_ipad_v8'].includes( + cardType + ) && + cardGoto === 'banner' + ) { + switch (Settings?.Detail?.activity) { + case true: + default: + Caches.banner_hash = item.hash; + $.setjson( + Caches, + '@BiliBili.ADBlock.Caches' + ); // 获取banner_hash,无此字段会有活动页且此字段无法伪造. + $.log(`🎉 ${$.name}`, '推荐页活动大图去除'); + return undefined; + case false: + if (item.banner_item) { + item.banner_item = + item.banner_item.filter((i) => { + if (i.type === 'ad') { + $.log( + `🎉 ${$.name}`, + '推荐页大图广告去除' + ); + return false; + } + return true; + }); + } + break; + } + } else if ( + ['cm_v2', 'cm_v1'].includes(cardType) && + ['ad_web_s', 'ad_av', 'ad_web_gif'].includes( + cardGoto + ) + ) { + // ad_player大视频广告 ad_web_gif大gif广告 ad_web_s普通小广告 ad_av创作推广广告 ad_inline_3d 上方大的视频3d广告 ad_inline_eggs 上方大的视频广告 + $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); + if (params.device !== 'phone') { + return undefined; //pad直接去除 + } else { + await fixPosition().then( + (result) => (item = result) + ); //小广告补位 + } + } else if ( + cardType === 'cm_v2' && + [ + 'ad_player', + 'ad_inline_3d', + 'ad_inline_eggs', + ].includes(cardGoto) + ) { + $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); + return undefined; //大广告直接去除 + } else if ( + cardType === 'small_cover_v10' && + cardGoto === 'game' + ) { + $.log(`🎉 ${$.name}`, '游戏广告去除'); + if (params.device !== 'phone') { + return undefined; //pad直接去除 + } else { + await fixPosition().then( + (result) => (item = result) + ); //小广告补位 + } + } else if ( + cardType === 'cm_double_v9' && + cardGoto === 'ad_inline_av' + ) { + $.log(`🎉 ${$.name}`, '大视频广告去除'); + return undefined; //大广告直接去除 + } + } + return item; + }) + ); + body.data.items = body.data.items.filter( + (fix) => fix !== undefined + ); + } + async function fixPosition() { + let itemsCache = $.getdata( + '@BiliBili.Index.Caches', + '' + ); + let singleItem = {}; + if (itemsCache && itemsCache.length > 0) { + singleItem = itemsCache.pop(); + $.log(`🎉 ${$.name}`, '推荐页空缺位填充成功'); + } else { + //重新获取填充位 + const myRequest = { + url: $request.url, + headers: $request.heders, + }; + await $.http.get(myRequest).then((response) => { + try { + const body = $.toObj(response.body); + if (body?.code === 0 && body?.message === '0') { + body.data.items = body.data.items + .map((item) => { + const { + card_type: cardType, + card_goto: cardGoto, + } = item; + if (cardType && cardGoto) { + if ( + cardType === 'banner_v8' && + cardGoto === 'banner' + ) { + return undefined; + } else if ( + cardType === 'cm_v2' && + [ + 'ad_web_s', + 'ad_av', + 'ad_web_gif', + 'ad_player', + 'ad_inline_3d', + 'ad_inline_eggs', + ].includes(cardGoto) + ) { + return undefined; + } else if ( + cardType === 'small_cover_v10' && + cardGoto === 'game' + ) { + return undefined; + } else if ( + cardType === 'cm_double_v9' && + cardGoto === 'ad_inline_av' + ) { + return undefined; + } else if ( + cardType === 'large_cover_v9' && + cardGoto === 'inline_av_v2' + ) { + //补位不需要大视频 + return undefined; + } + } + return item; + }) + .filter((fix) => fix !== undefined); + $.setdata( + body.data.items, + '@BiliBili.Index.Caches' + ); + $.log(`🎉 ${$.name}`, '推荐页缓存数组补充成功'); + } else { + $.log(`🚧 ${$.name}`, '访问推荐页尝试填补失败'); + } + } catch (e) { + $.logErr(e, response); + } + }); + itemsCache = $.getdata('@BiliBili.Index.Caches', ''); + if (itemsCache.length > 0) { + singleItem = itemsCache.pop(); + $.log(`🎉 ${$.name}`, '推荐页空缺位填充成功'); + } + } + $.setdata(itemsCache, '@BiliBili.Index.Caches'); + return singleItem; + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置推荐页广告不去除'); + break; + } + break; + case 'x/v2/feed/index/story': // 首页短视频流 + switch (Settings?.Detail?.story) { + case true: + default: + if (body.data?.items) { + // vertical_live 直播内容 + // vertical_pgc 大会员专享 + body.data.items = body.data.items.filter( + (i) => + !( + i.hasOwnProperty('ad_info') || + ['vertical_ad_av', 'vertical_pgc'].includes( + i.card_goto + ) + ) + ); + $.log(`🎉 ${$.name}`, '首页短视频流广告去除'); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置首页短视频流广告不去除'); + break; + } + break; + case 'x/v2/search/square': // 搜索页 + switch (Settings?.Detail?.Hot_search) { + case true: + default: + body.data = body.data.filter( + (i) => !(i.type === 'trending') + ); + $.log(`🎉 ${$.name}`, '搜索页热搜内容去除'); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置搜索页热搜内容不去除'); + break; + } + break; + } + break; + case 'api.bilibili.com': + case 'api.biliapi.net': + switch (PATH) { + case 'pgc/player/api/playurl': // 番剧-播放地址-api + case 'pgc/player/web/playurl': // 番剧-播放地址-web + case 'pgc/player/web/playurl/html5': // 番剧-播放地址-web-HTML5 + break; + case 'pgc/view/v2/app/season': // 番剧页面-内容-app + break; + case 'pgc/view/web/season': // 番剧-内容-web + case 'pgc/view/pc/season': // 番剧-内容-pc + break; + case 'pgc/page/bangumi': // 追番页 + case 'pgc/page/cinema/tab': // 观影页 + switch (Settings?.Detail?.cinema) { + case true: + default: + if (body.result?.modules) { + body.result.modules.forEach((i) => { + if (i.style.startsWith('banner')) { + i.items = i.items.filter((j) => + j.link.includes('play') + ); + } else if (i.style.startsWith('function')) { + i.items = i.items.filter((j) => + j.blink.startsWith('bilibili') + ); + } else if ( + [241, 1283, 1284, 1441].includes(i.module_id) + ) { + i.items = []; + } else if (i.style.startsWith('tip')) { + i.items = []; + } + }); + $.log(`🎉 ${$.name}`, '观影页广告去除'); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置观影页广告不去除'); + break; + } + break; + case 'x/player/wbi/playurl': // UGC-用户生产内容-播放地址 + break; + case 'x/web-interface/wbi/index/top/feed/rcmd': // web首页 + switch (Settings?.Detail?.feed) { + case true: + default: + body.data.item = body.data.item.filter( + (i) => !(i.goto === 'ad') + ); + $.log(`🎉 ${$.name}`, '首页广告内容去除'); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置首页广告不去除'); + break; + } + break; + case 'x/space/acc/info': // 用户空间-账号信息-pc + case 'x/space/wbi/acc/info': // 用户空间-账号信息-wbi + switch (url.params?.vmid || url.params?.mid) { + case '11783021': // 哔哩哔哩番剧出差 + case '1988098633': // b站_戲劇咖 + case '2042149112': // b站_綜藝咖 + break; + default: + break; + } + break; + } + break; + case 'api.live.bilibili.com': + switch (PATH) { + case 'xlive/app-room/v1/index/getInfoByRoom': // 直播 + switch (Settings?.Detail?.xlive) { + case true: + default: + if (body.data?.activity_banner_info) { + body.data.activity_banner_info = null; + $.log(`🎉 ${$.name}`, '直播banner广告去除'); + } + if (body.data?.shopping_info) { + body.data.shopping_info = { + is_show: 0, + }; + $.log(`🎉 ${$.name}`, '直播购物广告去除'); + } + if (body.data?.new_tab_info?.outer_list?.length > 0) { + body.data.new_tab_info.outer_list = + body.data.new_tab_info.outer_list.filter( + (i) => i.biz_id !== 33 + ); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置直播页广告不去除'); + break; + } + break; + } + break; + } + $response.body = JSON.stringify(body); + break; + case 'application/x-protobuf': + case 'application/grpc': + case 'application/grpc+proto': + case 'applecation/octet-stream': + let rawBody = $.isQuanX() + ? new Uint8Array($response.bodyBytes) + : $response.body; + //$.log(`🚧 ${$.name}`, `isBuffer? ${ArrayBuffer.isView(rawBody)}: ${JSON.stringify(rawBody)}`, ""); + /****************** initialization start *******************/ + // timostamm/protobuf-ts + !(function (i) { + 'use strict'; + function _(n, e, i) { + return e <= n && n <= i; + } + 'undefined' != typeof module && + module.exports && + !i['encoding-indexes'] && + (i['encoding-indexes'] = require('./encoding-indexes.js')[ + 'encoding-indexes' + ]); + var l = Math.floor; + function s(n) { + if (void 0 === n) return {}; + if (n === Object(n)) return n; + throw TypeError('Could not convert argument to dictionary'); + } + function u(n) { + return 0 <= n && n <= 127; + } + var a = u, + b = -1; + function c(n) { + (this.tokens = [].slice.call(n)), this.tokens.reverse(); + } + c.prototype = { + endOfStream: function () { + return !this.tokens.length; + }, + read: function () { + return this.tokens.length ? this.tokens.pop() : b; + }, + prepend: function (n) { + if (Array.isArray(n)) + for (var e = n; e.length; ) this.tokens.push(e.pop()); + else this.tokens.push(n); + }, + push: function (n) { + if (Array.isArray(n)) + for (var e = n; e.length; ) this.tokens.unshift(e.shift()); + else this.tokens.unshift(n); + }, + }; + var w = -1; + function m(n, e) { + if (n) throw TypeError('Decoder error'); + return e || 65533; + } + function f(n) { + throw TypeError('The code point ' + n + ' could not be encoded.'); + } + function r(n) { + return ( + (n = String(n).trim().toLowerCase()), + Object.prototype.hasOwnProperty.call(d, n) ? d[n] : null + ); + } + var t, + o, + n = [ + { + encodings: [ + { + labels: ['unicode-1-1-utf-8', 'utf-8', 'utf8'], + name: 'UTF-8', + }, + ], + heading: 'The Encoding', + }, + { + encodings: [ + { + labels: ['866', 'cp866', 'csibm866', 'ibm866'], + name: 'IBM866', + }, + { + labels: [ + 'csisolatin2', + 'iso-8859-2', + 'iso-ir-101', + 'iso8859-2', + 'iso88592', + 'iso_8859-2', + 'iso_8859-2:1987', + 'l2', + 'latin2', + ], + name: 'ISO-8859-2', + }, + { + labels: [ + 'csisolatin3', + 'iso-8859-3', + 'iso-ir-109', + 'iso8859-3', + 'iso88593', + 'iso_8859-3', + 'iso_8859-3:1988', + 'l3', + 'latin3', + ], + name: 'ISO-8859-3', + }, + { + labels: [ + 'csisolatin4', + 'iso-8859-4', + 'iso-ir-110', + 'iso8859-4', + 'iso88594', + 'iso_8859-4', + 'iso_8859-4:1988', + 'l4', + 'latin4', + ], + name: 'ISO-8859-4', + }, + { + labels: [ + 'csisolatincyrillic', + 'cyrillic', + 'iso-8859-5', + 'iso-ir-144', + 'iso8859-5', + 'iso88595', + 'iso_8859-5', + 'iso_8859-5:1988', + ], + name: 'ISO-8859-5', + }, + { + labels: [ + 'arabic', + 'asmo-708', + 'csiso88596e', + 'csiso88596i', + 'csisolatinarabic', + 'ecma-114', + 'iso-8859-6', + 'iso-8859-6-e', + 'iso-8859-6-i', + 'iso-ir-127', + 'iso8859-6', + 'iso88596', + 'iso_8859-6', + 'iso_8859-6:1987', + ], + name: 'ISO-8859-6', + }, + { + labels: [ + 'csisolatingreek', + 'ecma-118', + 'elot_928', + 'greek', + 'greek8', + 'iso-8859-7', + 'iso-ir-126', + 'iso8859-7', + 'iso88597', + 'iso_8859-7', + 'iso_8859-7:1987', + 'sun_eu_greek', + ], + name: 'ISO-8859-7', + }, + { + labels: [ + 'csiso88598e', + 'csisolatinhebrew', + 'hebrew', + 'iso-8859-8', + 'iso-8859-8-e', + 'iso-ir-138', + 'iso8859-8', + 'iso88598', + 'iso_8859-8', + 'iso_8859-8:1988', + 'visual', + ], + name: 'ISO-8859-8', + }, + { + labels: ['csiso88598i', 'iso-8859-8-i', 'logical'], + name: 'ISO-8859-8-I', + }, + { + labels: [ + 'csisolatin6', + 'iso-8859-10', + 'iso-ir-157', + 'iso8859-10', + 'iso885910', + 'l6', + 'latin6', + ], + name: 'ISO-8859-10', + }, + { + labels: ['iso-8859-13', 'iso8859-13', 'iso885913'], + name: 'ISO-8859-13', + }, + { + labels: ['iso-8859-14', 'iso8859-14', 'iso885914'], + name: 'ISO-8859-14', + }, + { + labels: [ + 'csisolatin9', + 'iso-8859-15', + 'iso8859-15', + 'iso885915', + 'iso_8859-15', + 'l9', + ], + name: 'ISO-8859-15', + }, + { labels: ['iso-8859-16'], name: 'ISO-8859-16' }, + { + labels: ['cskoi8r', 'koi', 'koi8', 'koi8-r', 'koi8_r'], + name: 'KOI8-R', + }, + { labels: ['koi8-ru', 'koi8-u'], name: 'KOI8-U' }, + { + labels: [ + 'csmacintosh', + 'mac', + 'macintosh', + 'x-mac-roman', + ], + name: 'macintosh', + }, + { + labels: [ + 'dos-874', + 'iso-8859-11', + 'iso8859-11', + 'iso885911', + 'tis-620', + 'windows-874', + ], + name: 'windows-874', + }, + { + labels: ['cp1250', 'windows-1250', 'x-cp1250'], + name: 'windows-1250', + }, + { + labels: ['cp1251', 'windows-1251', 'x-cp1251'], + name: 'windows-1251', + }, + { + labels: [ + 'ansi_x3.4-1968', + 'ascii', + 'cp1252', + 'cp819', + 'csisolatin1', + 'ibm819', + 'iso-8859-1', + 'iso-ir-100', + 'iso8859-1', + 'iso88591', + 'iso_8859-1', + 'iso_8859-1:1987', + 'l1', + 'latin1', + 'us-ascii', + 'windows-1252', + 'x-cp1252', + ], + name: 'windows-1252', + }, + { + labels: ['cp1253', 'windows-1253', 'x-cp1253'], + name: 'windows-1253', + }, + { + labels: [ + 'cp1254', + 'csisolatin5', + 'iso-8859-9', + 'iso-ir-148', + 'iso8859-9', + 'iso88599', + 'iso_8859-9', + 'iso_8859-9:1989', + 'l5', + 'latin5', + 'windows-1254', + 'x-cp1254', + ], + name: 'windows-1254', + }, + { + labels: ['cp1255', 'windows-1255', 'x-cp1255'], + name: 'windows-1255', + }, + { + labels: ['cp1256', 'windows-1256', 'x-cp1256'], + name: 'windows-1256', + }, + { + labels: ['cp1257', 'windows-1257', 'x-cp1257'], + name: 'windows-1257', + }, + { + labels: ['cp1258', 'windows-1258', 'x-cp1258'], + name: 'windows-1258', + }, + { + labels: ['x-mac-cyrillic', 'x-mac-ukrainian'], + name: 'x-mac-cyrillic', + }, + ], + heading: 'Legacy single-byte encodings', + }, + { + encodings: [ + { + labels: [ + 'chinese', + 'csgb2312', + 'csiso58gb231280', + 'gb2312', + 'gb_2312', + 'gb_2312-80', + 'gbk', + 'iso-ir-58', + 'x-gbk', + ], + name: 'GBK', + }, + { labels: ['gb18030'], name: 'gb18030' }, + ], + heading: 'Legacy multi-byte Chinese (simplified) encodings', + }, + { + encodings: [ + { + labels: [ + 'big5', + 'big5-hkscs', + 'cn-big5', + 'csbig5', + 'x-x-big5', + ], + name: 'Big5', + }, + ], + heading: 'Legacy multi-byte Chinese (traditional) encodings', + }, + { + encodings: [ + { + labels: ['cseucpkdfmtjapanese', 'euc-jp', 'x-euc-jp'], + name: 'EUC-JP', + }, + { + labels: ['csiso2022jp', 'iso-2022-jp'], + name: 'ISO-2022-JP', + }, + { + labels: [ + 'csshiftjis', + 'ms932', + 'ms_kanji', + 'shift-jis', + 'shift_jis', + 'sjis', + 'windows-31j', + 'x-sjis', + ], + name: 'Shift_JIS', + }, + ], + heading: 'Legacy multi-byte Japanese encodings', + }, + { + encodings: [ + { + labels: [ + 'cseuckr', + 'csksc56011987', + 'euc-kr', + 'iso-ir-149', + 'korean', + 'ks_c_5601-1987', + 'ks_c_5601-1989', + 'ksc5601', + 'ksc_5601', + 'windows-949', + ], + name: 'EUC-KR', + }, + ], + heading: 'Legacy multi-byte Korean encodings', + }, + { + encodings: [ + { + labels: [ + 'csiso2022kr', + 'hz-gb-2312', + 'iso-2022-cn', + 'iso-2022-cn-ext', + 'iso-2022-kr', + ], + name: 'replacement', + }, + { labels: ['utf-16be'], name: 'UTF-16BE' }, + { labels: ['utf-16', 'utf-16le'], name: 'UTF-16LE' }, + { labels: ['x-user-defined'], name: 'x-user-defined' }, + ], + heading: 'Legacy miscellaneous encodings', + }, + ], + d = {}, + h = + (n.forEach(function (n) { + n.encodings.forEach(function (e) { + e.labels.forEach(function (n) { + d[n] = e; + }); + }); + }), + {}), + g = {}; + function y(n, e) { + return (e && e[n]) || null; + } + function p(n, e) { + e = e.indexOf(n); + return -1 === e ? null : e; + } + function v(n) { + if ('encoding-indexes' in i) return i['encoding-indexes'][n]; + throw Error( + 'Indexes missing. Did you forget to include encoding-indexes.js first?' + ); + } + var x = 'utf-8'; + function O(n, e) { + if (!(this instanceof O)) + throw TypeError("Called as a function. Did you forget 'new'?"); + (n = void 0 !== n ? String(n) : x), + (e = s(e)), + (this._encoding = null), + (this._decoder = null), + (this._ignoreBOM = !1), + (this._BOMseen = !1), + (this._error_mode = 'replacement'), + (this._do_not_flush = !1); + var i = r(n); + if (null === i || 'replacement' === i.name) + throw RangeError('Unknown encoding: ' + n); + if (g[i.name]) + return ( + ((n = this)._encoding = i), + Boolean(e.fatal) && (n._error_mode = 'fatal'), + Boolean(e.ignoreBOM) && (n._ignoreBOM = !0), + Object.defineProperty || + ((this.encoding = n._encoding.name.toLowerCase()), + (this.fatal = 'fatal' === n._error_mode), + (this.ignoreBOM = n._ignoreBOM)), + n + ); + throw Error( + 'Decoder not present. Did you forget to include encoding-indexes.js first?' + ); + } + function k(n, e) { + if (!(this instanceof k)) + throw TypeError("Called as a function. Did you forget 'new'?"); + (e = s(e)), + (this._encoding = null), + (this._encoder = null), + (this._do_not_flush = !1), + (this._fatal = Boolean(e.fatal) ? 'fatal' : 'replacement'); + if (Boolean(e.NONSTANDARD_allowLegacyEncoding)) { + e = r((n = void 0 !== n ? String(n) : x)); + if (null === e || 'replacement' === e.name) + throw RangeError('Unknown encoding: ' + n); + if (!h[e.name]) + throw Error( + 'Encoder not present. Did you forget to include encoding-indexes.js first?' + ); + this._encoding = e; + } else + (this._encoding = r('utf-8')), + void 0 !== n && + 'console' in i && + console.warn( + 'TextEncoder constructor called with encoding label, which is ignored.' + ); + return ( + Object.defineProperty || + (this.encoding = this._encoding.name.toLowerCase()), + this + ); + } + function e(n) { + var r = n.fatal, + t = 0, + o = 0, + s = 0, + l = 128, + a = 191; + this.handler = function (n, e) { + if (e === b && 0 !== s) return (s = 0), m(r); + if (e === b) return w; + if (0 === s) { + if (_(e, 0, 127)) return e; + if (_(e, 194, 223)) (s = 1), (t = 31 & e); + else if (_(e, 224, 239)) + 224 === e && (l = 160), + 237 === e && (a = 159), + (s = 2), + (t = 15 & e); + else { + if (!_(e, 240, 244)) return m(r); + 240 === e && (l = 144), + 244 === e && (a = 143), + (s = 3), + (t = 7 & e); + } + return null; + } + var i; + return _(e, l, a) + ? ((l = 128), + (a = 191), + (t = (t << 6) | (63 & e)), + (o += 1) !== s ? null : ((i = t), (t = s = o = 0), i)) + : ((t = s = o = 0), (l = 128), (a = 191), n.prepend(e), m(r)); + }; + } + function E(n) { + n.fatal; + this.handler = function (n, e) { + if (e === b) return w; + if (a(e)) return e; + _(e, 128, 2047) + ? ((i = 1), (r = 192)) + : _(e, 2048, 65535) + ? ((i = 2), (r = 224)) + : _(e, 65536, 1114111) && ((i = 3), (r = 240)); + for (var i, r, t = [(e >> (6 * i)) + r]; 0 < i; ) + t.push(128 | (63 & (e >> (6 * (i - 1))))), --i; + return t; + }; + } + function j(i, n) { + var r = n.fatal; + this.handler = function (n, e) { + return e === b + ? w + : u(e) + ? e + : null === (e = i[e - 128]) + ? m(r) + : e; + }; + } + function B(r, n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) + ? e + : (null === (i = p(e, r)) && f(e), i + 128); + }; + } + function S(n) { + var o = n.fatal, + s = 0, + l = 0, + a = 0; + this.handler = function (n, e) { + var i, r, t; + return e === b && 0 === s && 0 === l && 0 === a + ? w + : (e !== b || + (0 === s && 0 === l && 0 === a) || + ((a = l = s = 0), m(o)), + 0 !== a + ? ((i = null), + _(e, 48, 57) && + (i = (function (n) { + if ((39419 < n && n < 189e3) || 1237575 < n) + return null; + if (7457 === n) return 59335; + for ( + var e = 0, i = 0, r = v('gb18030-ranges'), t = 0; + t < r.length; + ++t + ) { + var o = r[t]; + if (!(o[0] <= n)) break; + (e = o[0]), (i = o[1]); + } + return i + n - e; + })( + 10 * (126 * (10 * (s - 129) + l - 48) + a - 129) + + e - + 48 + )), + (r = [l, a, e]), + (a = l = s = 0), + null === i ? (n.prepend(r), m(o)) : i) + : 0 !== l + ? _(e, 129, 254) + ? ((a = e), null) + : (n.prepend([l, e]), (l = s = 0), m(o)) + : 0 !== s + ? _(e, 48, 57) + ? ((l = e), null) + : ((r = s), + (s = 0), + (t = null) === + (i = + null === + (t = + _(e, 64, 126) || _(e, 128, 254) + ? 190 * (r - 129) + (e - (e < 127 ? 64 : 65)) + : t) + ? null + : y(t, v('gb18030'))) && + u(e) && + n.prepend(e), + null === i ? m(o) : i) + : u(e) + ? e + : 128 === e + ? 8364 + : _(e, 129, 254) + ? ((s = e), null) + : m(o)); + }; + } + function T(n, t) { + n.fatal; + this.handler = function (n, e) { + var i, r; + return e === b + ? w + : a(e) + ? e + : 58853 === e + ? f(e) + : t && 8364 === e + ? 128 + : null !== (i = p(e, v('gb18030'))) + ? ((r = i % 190), [l(i / 190) + 129, r + (r < 63 ? 64 : 65)]) + : t + ? f(e) + : ((i = (function (n) { + if (59335 === n) return 7457; + for ( + var e = 0, i = 0, r = v('gb18030-ranges'), t = 0; + t < r.length; + ++t + ) { + var o = r[t]; + if (!(o[1] <= n)) break; + (e = o[1]), (i = o[0]); + } + return i + n - e; + })(e)), + [ + (r = l(i / 10 / 126 / 10)) + 129, + (e = l((i -= 10 * r * 126 * 10) / 10 / 126)) + 48, + (r = l((i -= 10 * e * 126) / 10)) + 129, + 48 + (i - 10 * r), + ]); + }; + } + function I(n) { + var t = n.fatal, + o = 0; + this.handler = function (n, e) { + if (e === b && 0 !== o) return (o = 0), m(t); + if (e === b && 0 === o) return w; + if (0 === o) + return u(e) ? e : _(e, 129, 254) ? ((o = e), null) : m(t); + var i = o, + r = null; + switch ( + ((o = 0), + (r = + _(e, 64, 126) || _(e, 161, 254) + ? 157 * (i - 129) + (e - (e < 127 ? 64 : 98)) + : r)) + ) { + case 1133: + return [202, 772]; + case 1135: + return [202, 780]; + case 1164: + return [234, 772]; + case 1166: + return [234, 780]; + } + i = null === r ? null : y(r, v('big5')); + return ( + null === i && u(e) && n.prepend(e), null === i ? m(t) : i + ); + }; + } + function U(n) { + n.fatal; + this.handler = function (n, e) { + var i, r; + return e === b + ? w + : a(e) + ? e + : ((i = e), + (r = o = + o || + v('big5').map(function (n, e) { + return e < 5024 ? null : n; + })), + null === + (i = + 9552 === i || + 9566 === i || + 9569 === i || + 9578 === i || + 21313 === i || + 21317 === i + ? r.lastIndexOf(i) + : p(i, r)) || (r = l(i / 157) + 129) < 161 + ? f(e) + : [r, (e = i % 157) + (e < 63 ? 64 : 98)]); + }; + } + function C(n) { + var t = n.fatal, + o = !1, + s = 0; + this.handler = function (n, e) { + var i, r; + return e === b && 0 !== s + ? ((s = 0), m(t)) + : e === b && 0 === s + ? w + : 142 === s && _(e, 161, 223) + ? ((s = 0), 65216 + e) + : 143 === s && _(e, 161, 254) + ? ((o = !0), (s = e), null) + : 0 !== s + ? ((i = s), + (s = 0), + (r = null), + _(i, 161, 254) && + _(e, 161, 254) && + (r = y( + 94 * (i - 161) + (e - 161), + v(o ? 'jis0212' : 'jis0208') + )), + (o = !1), + _(e, 161, 254) || n.prepend(e), + null === r ? m(t) : r) + : u(e) + ? e + : 142 === e || 143 === e || _(e, 161, 254) + ? ((s = e), null) + : m(t); + }; + } + function P(n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) + ? e + : 165 === e + ? 92 + : 8254 === e + ? 126 + : _(e, 65377, 65439) + ? [142, e - 65377 + 161] + : null === (i = p((e = 8722 === e ? 65293 : e), v('jis0208'))) + ? f(e) + : [l(i / 94) + 161, (i % 94) + 161]; + }; + } + function D(n) { + var t = n.fatal, + o = 0, + s = 1, + l = 2, + a = 3, + u = 4, + c = 5, + f = 6, + d = o, + h = o, + g = 0, + p = !1; + this.handler = function (n, e) { + switch (d) { + default: + case o: + return 27 === e + ? ((d = c), null) + : _(e, 0, 127) && 14 !== e && 15 !== e && 27 !== e + ? ((p = !1), e) + : e === b + ? w + : ((p = !1), m(t)); + case s: + return 27 === e + ? ((d = c), null) + : 92 === e + ? ((p = !1), 165) + : 126 === e + ? ((p = !1), 8254) + : _(e, 0, 127) && + 14 !== e && + 15 !== e && + 27 !== e && + 92 !== e && + 126 !== e + ? ((p = !1), e) + : e === b + ? w + : ((p = !1), m(t)); + case l: + return 27 === e + ? ((d = c), null) + : _(e, 33, 95) + ? ((p = !1), 65344 + e) + : e === b + ? w + : ((p = !1), m(t)); + case a: + return 27 === e + ? ((d = c), null) + : _(e, 33, 126) + ? ((p = !1), (g = e), (d = u), null) + : e === b + ? w + : ((p = !1), m(t)); + case u: + if (27 === e) d = c; + else { + if (_(e, 33, 126)) + return ( + (d = a), + null === (i = y(94 * (g - 33) + e - 33, v('jis0208'))) + ? m(t) + : i + ); + e === b ? ((d = a), n.prepend(e)) : (d = a); + } + return m(t); + case c: + return 36 === e || 40 === e + ? ((g = e), (d = f), null) + : (n.prepend(e), (p = !1), (d = h), m(t)); + case f: + var i = g, + r = ((g = 0), null); + return (40 === i && 66 === e && (r = o), + 40 === i && 74 === e && (r = s), + 40 === i && 73 === e && (r = l), + null !== (r = 36 !== i || (64 !== e && 66 !== e) ? r : a)) + ? ((d = r), (r = p), (p = !0), r ? m(t) : null) + : (n.prepend([i, e]), (p = !1), (d = h), m(t)); + } + }; + } + function F(n) { + n.fatal; + var r = 0, + t = 1, + o = 2, + s = r; + this.handler = function (n, e) { + if (e === b && s !== r) + return n.prepend(e), (s = r), [27, 40, 66]; + if (e === b && s === r) return w; + if ( + !((s !== r && s !== t) || (14 !== e && 15 !== e && 27 !== e)) + ) + return f(65533); + if (s === r && a(e)) return e; + if ( + s === t && + ((a(e) && 92 !== e && 126 !== e) || 165 == e || 8254 == e) + ) { + if (a(e)) return e; + if (165 === e) return 92; + if (8254 === e) return 126; + } + var i; + return a(e) && s !== r + ? (n.prepend(e), (s = r), [27, 40, 66]) + : (165 !== e && 8254 !== e) || s === t + ? null === (i = p((e = 8722 === e ? 65293 : e), v('jis0208'))) + ? f(e) + : s !== o + ? (n.prepend(e), (s = o), [27, 36, 66]) + : [l(i / 94) + 33, (i % 94) + 33] + : (n.prepend(e), (s = t), [27, 40, 74]); + }; + } + function J(n) { + var t = n.fatal, + o = 0; + this.handler = function (n, e) { + var i, r; + return e === b && 0 !== o + ? ((o = 0), m(t)) + : e === b && 0 === o + ? w + : 0 !== o + ? ((r = o), + (i = null), + (o = 0), + (_(e, 64, 126) || _(e, 128, 252)) && + (i = + 188 * (r - (r < 160 ? 129 : 193)) + + e - + (e < 127 ? 64 : 65)), + _(i, 8836, 10715) + ? 48508 + i + : (null === + (r = null === i ? null : y(i, v('jis0208'))) && + u(e) && + n.prepend(e), + null === r ? m(t) : r)) + : u(e) || 128 === e + ? e + : _(e, 161, 223) + ? 65216 + e + : _(e, 129, 159) || _(e, 224, 252) + ? ((o = e), null) + : m(t); + }; + } + function K(n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) || 128 === e + ? e + : 165 === e + ? 92 + : 8254 === e + ? 126 + : _(e, 65377, 65439) + ? e - 65377 + 161 + : ((i = e = 8722 === e ? 65293 : e), + null === + (i = (t = + t || + v('jis0208').map(function (n, e) { + return _(e, 8272, 8835) ? null : n; + })).indexOf(i)) + ? f(e) + : [ + (e = l(i / 188)) + (e < 31 ? 129 : 193), + (e = i % 188) + (e < 63 ? 64 : 65), + ]); + }; + } + function R(n) { + var t = n.fatal, + o = 0; + this.handler = function (n, e) { + var i, r; + return e === b && 0 !== o + ? ((o = 0), m(t)) + : e === b && 0 === o + ? w + : 0 !== o + ? ((r = o), + (o = 0), + (r = + (i = null) === + (i = _(e, 65, 254) ? 190 * (r - 129) + (e - 65) : i) + ? null + : y(i, v('euc-kr'))), + null === i && u(e) && n.prepend(e), + null === r ? m(t) : r) + : u(e) + ? e + : _(e, 129, 254) + ? ((o = e), null) + : m(t); + }; + } + function G(n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) + ? e + : null === (i = p(e, v('euc-kr'))) + ? f(e) + : [l(i / 190) + 129, (i % 190) + 65]; + }; + } + function A(n, e) { + var i = n >> 8, + n = 255 & n; + return e ? [i, n] : [n, i]; + } + function L(r, n) { + var t = n.fatal, + o = null, + s = null; + this.handler = function (n, e) { + var i; + return e !== b || (null === o && null === s) + ? e === b && null === o && null === s + ? w + : null === o + ? ((o = e), null) + : ((e = r ? (o << 8) + e : (e << 8) + o), + (o = null) !== s + ? ((i = s), + (s = null), + _(e, 56320, 57343) + ? 65536 + 1024 * (i - 55296) + (e - 56320) + : (n.prepend(A(e, r)), m(t))) + : _(e, 55296, 56319) + ? ((s = e), null) + : _(e, 56320, 57343) + ? m(t) + : e) + : m(t); + }; + } + function M(r, n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : _(e, 0, 65535) + ? A(e, r) + : ((i = A(55296 + ((e - 65536) >> 10), r)), + (e = A(56320 + ((e - 65536) & 1023), r)), + i.concat(e)); + }; + } + function N(n) { + n.fatal; + this.handler = function (n, e) { + return e === b ? w : u(e) ? e : 63360 + e - 128; + }; + } + function q(n) { + n.fatal; + this.handler = function (n, e) { + return e === b + ? w + : a(e) + ? e + : _(e, 63360, 63487) + ? e - 63360 + 128 + : f(e); + }; + } + Object.defineProperty && + (Object.defineProperty(O.prototype, 'encoding', { + get: function () { + return this._encoding.name.toLowerCase(); + }, + }), + Object.defineProperty(O.prototype, 'fatal', { + get: function () { + return 'fatal' === this._error_mode; + }, + }), + Object.defineProperty(O.prototype, 'ignoreBOM', { + get: function () { + return this._ignoreBOM; + }, + })), + (O.prototype.decode = function (n, e) { + n = + 'object' == typeof n && n instanceof ArrayBuffer + ? new Uint8Array(n) + : 'object' == typeof n && + 'buffer' in n && + n.buffer instanceof ArrayBuffer + ? new Uint8Array(n.buffer, n.byteOffset, n.byteLength) + : new Uint8Array(0); + (e = s(e)), + this._do_not_flush || + ((this._decoder = g[this._encoding.name]({ + fatal: 'fatal' === this._error_mode, + })), + (this._BOMseen = !1)), + (this._do_not_flush = Boolean(e.stream)); + for (var i, r = new c(n), t = []; ; ) { + var o = r.read(); + if (o === b) break; + if ((i = this._decoder.handler(r, o)) === w) break; + null !== i && + (Array.isArray(i) ? t.push.apply(t, i) : t.push(i)); + } + if (!this._do_not_flush) { + for ( + ; + (i = this._decoder.handler(r, r.read())) !== w && + (null !== i && + (Array.isArray(i) ? t.push.apply(t, i) : t.push(i)), + !r.endOfStream()); + + ); + this._decoder = null; + } + return function (n) { + (e = ['UTF-8', 'UTF-16LE', 'UTF-16BE']), + (i = this._encoding.name), + -1 === e.indexOf(i) || + this._ignoreBOM || + this._BOMseen || + (0 < n.length && 65279 === n[0] + ? ((this._BOMseen = !0), n.shift()) + : 0 < n.length && (this._BOMseen = !0)); + for (var e, i, r = n, t = '', o = 0; o < r.length; ++o) { + var s = r[o]; + s <= 65535 + ? (t += String.fromCharCode(s)) + : ((s -= 65536), + (t += String.fromCharCode( + 55296 + (s >> 10), + 56320 + (1023 & s) + ))); + } + return t; + }.call(this, t); + }), + Object.defineProperty && + Object.defineProperty(k.prototype, 'encoding', { + get: function () { + return this._encoding.name.toLowerCase(); + }, + }), + (k.prototype.encode = function (n, e) { + (n = void 0 === n ? '' : String(n)), + (e = s(e)), + this._do_not_flush || + (this._encoder = h[this._encoding.name]({ + fatal: 'fatal' === this._fatal, + })), + (this._do_not_flush = Boolean(e.stream)); + for ( + var i, + r = new c( + (function (n) { + for ( + var e = String(n), i = e.length, r = 0, t = []; + r < i; + + ) { + var o, + s = e.charCodeAt(r); + s < 55296 || 57343 < s + ? t.push(s) + : 56320 <= s && s <= 57343 + ? t.push(65533) + : 55296 <= s && + s <= 56319 && + (r !== i - 1 && + 56320 <= (o = e.charCodeAt(r + 1)) && + o <= 57343 + ? (t.push( + 65536 + ((1023 & s) << 10) + (1023 & o) + ), + (r += 1)) + : t.push(65533)), + (r += 1); + } + return t; + })(n) + ), + t = []; + ; + + ) { + var o = r.read(); + if (o === b) break; + if ((i = this._encoder.handler(r, o)) === w) break; + Array.isArray(i) ? t.push.apply(t, i) : t.push(i); + } + if (!this._do_not_flush) { + for (;;) { + if ((i = this._encoder.handler(r, r.read())) === w) break; + Array.isArray(i) ? t.push.apply(t, i) : t.push(i); + } + this._encoder = null; + } + return new Uint8Array(t); + }), + (h['UTF-8'] = function (n) { + return new E(n); + }), + (g['UTF-8'] = function (n) { + return new e(n); + }), + 'encoding-indexes' in i && + n.forEach(function (n) { + 'Legacy single-byte encodings' === n.heading && + n.encodings.forEach(function (n) { + var n = n.name, + e = v(n.toLowerCase()); + (g[n] = function (n) { + return new j(e, n); + }), + (h[n] = function (n) { + return new B(e, n); + }); + }); + }), + (g.GBK = function (n) { + return new S(n); + }), + (h.GBK = function (n) { + return new T(n, !0); + }), + (h.gb18030 = function (n) { + return new T(n); + }), + (g.gb18030 = function (n) { + return new S(n); + }), + (h.Big5 = function (n) { + return new U(n); + }), + (g.Big5 = function (n) { + return new I(n); + }), + (h['EUC-JP'] = function (n) { + return new P(n); + }), + (g['EUC-JP'] = function (n) { + return new C(n); + }), + (h['ISO-2022-JP'] = function (n) { + return new F(n); + }), + (g['ISO-2022-JP'] = function (n) { + return new D(n); + }), + (h.Shift_JIS = function (n) { + return new K(n); + }), + (g.Shift_JIS = function (n) { + return new J(n); + }), + (h['EUC-KR'] = function (n) { + return new G(n); + }), + (g['EUC-KR'] = function (n) { + return new R(n); + }), + (h['UTF-16BE'] = function (n) { + return new M(!0, n); + }), + (g['UTF-16BE'] = function (n) { + return new L(!0, n); + }), + (h['UTF-16LE'] = function (n) { + return new M(!1, n); + }), + (g['UTF-16LE'] = function (n) { + return new L(!1, n); + }), + (h['x-user-defined'] = function (n) { + return new q(n); + }), + (g['x-user-defined'] = function (n) { + return new N(n); + }), + i.TextEncoder || (i.TextEncoder = k), + i.TextDecoder || (i.TextDecoder = O), + 'undefined' != typeof module && + module.exports && + (module.exports = { + TextEncoder: i.TextEncoder, + TextDecoder: i.TextDecoder, + EncodingIndexes: i['encoding-indexes'], + }); + })(this || {}); + // @protobuf-ts/runtime + var UnknownFieldHandler, + WireType, + ScalarType, + LongType, + RepeatType, + __defProp = Object.defineProperty, + __defProps = Object.defineProperties, + __getOwnPropDescs = Object.getOwnPropertyDescriptors, + __getOwnPropSymbols = Object.getOwnPropertySymbols, + __hasOwnProp = Object.prototype.hasOwnProperty, + __propIsEnum = Object.prototype.propertyIsEnumerable, + __defNormalProp = (e, r, t) => + r in e + ? __defProp(e, r, { + enumerable: !0, + configurable: !0, + writable: !0, + value: t, + }) + : (e[r] = t), + __spreadValues = (e, r) => { + for (var t in (r = r || {})) + __hasOwnProp.call(r, t) && __defNormalProp(e, t, r[t]); + if (__getOwnPropSymbols) + for (var t of __getOwnPropSymbols(r)) + __propIsEnum.call(r, t) && __defNormalProp(e, t, r[t]); + return e; + }, + __spreadProps = (e, r) => __defProps(e, __getOwnPropDescs(r)); + function varint64read() { + let r = 0, + t = 0; + for (let e = 0; e < 28; e += 7) { + var a = this.buf[this.pos++]; + if (((r |= (127 & a) << e), 0 == (128 & a))) + return this.assertBounds(), [r, t]; + } + var e = this.buf[this.pos++]; + if (((r |= (15 & e) << 28), (t = (112 & e) >> 4), 0 == (128 & e))) + return this.assertBounds(), [r, t]; + for (let e = 3; e <= 31; e += 7) { + var n = this.buf[this.pos++]; + if (((t |= (127 & n) << e), 0 == (128 & n))) + return this.assertBounds(), [r, t]; + } + throw new Error('invalid varint'); + } + function varint64write(r, t, a) { + for (let e = 0; e < 28; e += 7) { + var n = r >>> e, + s = !(n >>> 7 == 0 && 0 == t); + if ((a.push(255 & (s ? 128 | n : n)), !s)) return; + } + var e = ((r >>> 28) & 15) | ((7 & t) << 4), + i = !(t >> 3 == 0); + if ((a.push(255 & (i ? 128 | e : e)), i)) { + for (let e = 3; e < 31; e += 7) { + var o = t >>> e, + l = !(o >>> 7 == 0); + if ((a.push(255 & (l ? 128 | o : o)), !l)) return; + } + a.push((t >>> 31) & 1); + } + } + const TWO_PWR_32_DBL$1 = 4294967296; + function int64fromString(t) { + var e = '-' == t[0]; + e && (t = t.slice(1)); + let a = 0, + n = 0; + function r(e, r) { + e = Number(t.slice(e, r)); + (n *= 1e6), + (a = 1e6 * a + e) >= TWO_PWR_32_DBL$1 && + ((n += (a / TWO_PWR_32_DBL$1) | 0), (a %= TWO_PWR_32_DBL$1)); + } + return r(-24, -18), r(-18, -12), r(-12, -6), r(-6), [e, a, n]; + } + function int64toString(e, r) { + if (r <= 2097151) return '' + (TWO_PWR_32_DBL$1 * r + e); + var t = (((e >>> 24) | (r << 8)) >>> 0) & 16777215, + r = (r >> 16) & 65535; + let a = (16777215 & e) + 6777216 * t + 6710656 * r, + n = t + 8147497 * r, + s = 2 * r; + e = 1e7; + function i(e, r) { + e = e ? String(e) : ''; + return r ? '0000000'.slice(e.length) + e : e; + } + return ( + a >= e && ((n += Math.floor(a / e)), (a %= e)), + n >= e && ((s += Math.floor(n / e)), (n %= e)), + i(s, 0) + i(n, s) + i(a, 1) + ); + } + function varint32write(r, t) { + if (0 <= r) { + for (; 127 < r; ) t.push((127 & r) | 128), (r >>>= 7); + t.push(r); + } else { + for (let e = 0; e < 9; e++) t.push((127 & r) | 128), (r >>= 7); + t.push(1); + } + } + function varint32read() { + let r = this.buf[this.pos++]; + var e = 127 & r; + if (0 == (128 & r)) return this.assertBounds(), e; + if ( + ((e |= (127 & (r = this.buf[this.pos++])) << 7), 0 == (128 & r)) + ) + return this.assertBounds(), e; + if ( + ((e |= (127 & (r = this.buf[this.pos++])) << 14), 0 == (128 & r)) + ) + return this.assertBounds(), e; + if ( + ((e |= (127 & (r = this.buf[this.pos++])) << 21), 0 == (128 & r)) + ) + return this.assertBounds(), e; + e |= (15 & (r = this.buf[this.pos++])) << 28; + for (let e = 5; 0 != (128 & r) && e < 10; e++) + r = this.buf[this.pos++]; + if (0 != (128 & r)) throw new Error('invalid varint'); + return this.assertBounds(), e >>> 0; + } + function detectBi() { + var e = new DataView(new ArrayBuffer(8)); + return void 0 !== globalThis.BigInt && + 'function' == typeof e.getBigInt64 && + 'function' == typeof e.getBigUint64 && + 'function' == typeof e.setBigInt64 && + 'function' == typeof e.setBigUint64 + ? { + MIN: BigInt('-9223372036854775808'), + MAX: BigInt('9223372036854775807'), + UMIN: BigInt('0'), + UMAX: BigInt('18446744073709551615'), + C: BigInt, + V: e, + } + : void 0; + } + const BI = detectBi(); + function assertBi(e) { + if (!e) + throw new Error( + 'BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support' + ); + } + const RE_DECIMAL_STR = /^-?[0-9]+$/, + TWO_PWR_32_DBL = 4294967296; + class SharedPbLong { + constructor(e, r) { + (this.lo = 0 | e), (this.hi = 0 | r); + } + isZero() { + return 0 == this.lo && 0 == this.hi; + } + toNumber() { + var e = this.hi * TWO_PWR_32_DBL + (this.lo >>> 0); + if (Number.isSafeInteger(e)) return e; + throw new Error('cannot convert to safe number'); + } + } + const _PbULong = class extends SharedPbLong { + static from(e) { + if (BI) + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + if ('' == e) throw new Error('string is no integer'); + e = BI.C(e); + case 'number': + if (0 === e) return this.ZERO; + e = BI.C(e); + case 'bigint': + if (!e) return this.ZERO; + if (e < BI.UMIN) throw new Error('signed value for ulong'); + if (e > BI.UMAX) throw new Error('ulong too large'); + return ( + BI.V.setBigUint64(0, e, !0), + new _PbULong(BI.V.getInt32(0, !0), BI.V.getInt32(4, !0)) + ); + } + else + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + if (((e = e.trim()), !RE_DECIMAL_STR.test(e))) + throw new Error('string is no integer'); + var [r, t, a] = int64fromString(e); + if (r) throw new Error('signed value'); + return new _PbULong(t, a); + case 'number': + if (0 == e) 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 _PbULong(e, e / TWO_PWR_32_DBL); + } + throw new Error('unknown value ' + typeof e); + } + toString() { + return BI + ? this.toBigInt().toString() + : int64toString(this.lo, this.hi); + } + toBigInt() { + return ( + assertBi(BI), + BI.V.setInt32(0, this.lo, !0), + BI.V.setInt32(4, this.hi, !0), + BI.V.getBigUint64(0, !0) + ); + } + }; + let PbULong = _PbULong; + PbULong.ZERO = new _PbULong(0, 0); + const _PbLong = class extends SharedPbLong { + static from(e) { + if (BI) + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + if ('' == e) throw new Error('string is no integer'); + e = BI.C(e); + case 'number': + if (0 === e) return this.ZERO; + e = BI.C(e); + case 'bigint': + if (!e) return this.ZERO; + if (e < BI.MIN) throw new Error('ulong too small'); + if (e > BI.MAX) throw new Error('ulong too large'); + return ( + BI.V.setBigInt64(0, e, !0), + new _PbLong(BI.V.getInt32(0, !0), BI.V.getInt32(4, !0)) + ); + } + else + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + var r, t, a; + if (((e = e.trim()), RE_DECIMAL_STR.test(e))) + return ( + ([r, a, t] = int64fromString(e)), + (a = new _PbLong(a, t)), + r ? a.negate() : a + ); + throw new Error('string is no integer'); + case 'number': + if (0 == e) return this.ZERO; + if (Number.isSafeInteger(e)) + return 0 < e + ? new _PbLong(e, e / TWO_PWR_32_DBL) + : new _PbLong(-e, -e / TWO_PWR_32_DBL).negate(); + throw new Error('number is no integer'); + } + throw new Error('unknown value ' + typeof e); + } + isNegative() { + return 0 != (2147483648 & this.hi); + } + negate() { + let e = ~this.hi, + r = this.lo; + return r ? (r = 1 + ~r) : (e += 1), new _PbLong(r, e); + } + toString() { + var e; + return BI + ? this.toBigInt().toString() + : this.isNegative() + ? '-' + int64toString((e = this.negate()).lo, e.hi) + : int64toString(this.lo, this.hi); + } + toBigInt() { + return ( + assertBi(BI), + BI.V.setInt32(0, this.lo, !0), + BI.V.setInt32(4, this.hi, !0), + BI.V.getBigInt64(0, !0) + ); + } + }; + let PbLong = _PbLong; + PbLong.ZERO = new _PbLong(0, 0); + class BinaryReader { + constructor(e, r) { + (this.varint64 = varint64read), + (this.uint32 = varint32read), + (this.buf = e), + (this.len = e.length), + (this.pos = 0), + (this.view = new DataView( + e.buffer, + e.byteOffset, + e.byteLength + )), + (this.textDecoder = + null != r ? r : new TextDecoder('utf-8', { fatal: !0 })); + } + tag() { + var e = this.uint32(), + r = e >>> 3, + e = 7 & e; + if (r <= 0 || e < 0 || 5 < e) + throw new Error( + 'illegal tag: field no ' + r + ' wire type ' + e + ); + return [r, e]; + } + skip(e) { + var r, + t = this.pos; + switch (e) { + case WireType.Varint: + for (; 128 & this.buf[this.pos++]; ); + break; + case WireType.Bit64: + this.pos += 4; + case WireType.Bit32: + this.pos += 4; + break; + case WireType.LengthDelimited: + var a = this.uint32(); + this.pos += a; + break; + case WireType.StartGroup: + for (; (r = this.tag()[1]) !== WireType.EndGroup; ) + this.skip(r); + 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 0 | this.uint32(); + } + sint32() { + var e = this.uint32(); + return (e >>> 1) ^ -(1 & e); + } + int64() { + return new PbLong(...this.varint64()); + } + uint64() { + return new PbULong(...this.varint64()); + } + sint64() { + var [e, r] = this.varint64(), + t = -(1 & e), + e = ((e >>> 1) | ((1 & r) << 31)) ^ t, + r = (r >>> 1) ^ t; + return new PbLong(e, r); + } + bool() { + var [e, r] = this.varint64(); + return 0 !== e || 0 !== r; + } + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, !0); + } + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, !0); + } + fixed64() { + return new PbULong(this.sfixed32(), this.sfixed32()); + } + sfixed64() { + return new PbLong(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() { + var e = this.uint32(), + r = this.pos; + return ( + (this.pos += e), + this.assertBounds(), + this.buf.subarray(r, r + e) + ); + } + string() { + return this.textDecoder.decode(this.bytes()); + } + } + function assert(e, r) { + if (!e) throw new Error(r); + } + const FLOAT32_MAX = 34028234663852886e22, + FLOAT32_MIN = -34028234663852886e22, + UINT32_MAX = 4294967295, + INT32_MAX = 2147483647, + INT32_MIN = -2147483648; + function assertInt32(e) { + if ('number' != typeof e) + throw new Error('invalid int 32: ' + typeof e); + if (!Number.isInteger(e) || e > INT32_MAX || e < INT32_MIN) + throw new Error('invalid int 32: ' + e); + } + function assertUInt32(e) { + if ('number' != typeof e) + throw new Error('invalid uint 32: ' + typeof e); + if (!Number.isInteger(e) || e > UINT32_MAX || e < 0) + throw new Error('invalid uint 32: ' + e); + } + function assertFloat32(e) { + if ('number' != typeof e) + throw new Error('invalid float 32: ' + typeof e); + if (Number.isFinite(e) && (e > FLOAT32_MAX || e < FLOAT32_MIN)) + throw new Error('invalid float 32: ' + e); + } + class BinaryWriter { + constructor(e) { + (this.stack = []), + (this.textEncoder = null != e ? e : new TextEncoder()), + (this.chunks = []), + (this.buf = []); + } + finish() { + this.chunks.push(new Uint8Array(this.buf)); + let r = 0; + for (let e = 0; e < this.chunks.length; e++) + r += this.chunks[e].length; + var t = new Uint8Array(r); + let a = 0; + for (let e = 0; e < this.chunks.length; e++) + t.set(this.chunks[e], a), (a += this.chunks[e].length); + return (this.chunks = []), t; + } + fork() { + return ( + this.stack.push({ chunks: this.chunks, buf: this.buf }), + (this.chunks = []), + (this.buf = []), + this + ); + } + join() { + var e = this.finish(), + r = this.stack.pop(); + if (r) + return ( + (this.chunks = r.chunks), + (this.buf = r.buf), + this.uint32(e.byteLength), + this.raw(e) + ); + throw new Error('invalid state, fork stack empty'); + } + tag(e, r) { + return this.uint32(((e << 3) | r) >>> 0); + } + raw(e) { + return ( + this.buf.length && + (this.chunks.push(new Uint8Array(this.buf)), (this.buf = [])), + this.chunks.push(e), + this + ); + } + uint32(e) { + for (assertUInt32(e); 127 < e; ) + this.buf.push((127 & e) | 128), (e >>>= 7); + return this.buf.push(e), this; + } + int32(e) { + return assertInt32(e), varint32write(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) { + e = this.textEncoder.encode(e); + return this.uint32(e.byteLength), this.raw(e); + } + float(e) { + assertFloat32(e); + var r = new Uint8Array(4); + return new DataView(r.buffer).setFloat32(0, e, !0), this.raw(r); + } + double(e) { + var r = new Uint8Array(8); + return new DataView(r.buffer).setFloat64(0, e, !0), this.raw(r); + } + fixed32(e) { + assertUInt32(e); + var r = new Uint8Array(4); + return new DataView(r.buffer).setUint32(0, e, !0), this.raw(r); + } + sfixed32(e) { + assertInt32(e); + var r = new Uint8Array(4); + return new DataView(r.buffer).setInt32(0, e, !0), this.raw(r); + } + sint32(e) { + return ( + assertInt32(e), + varint32write((e = ((e << 1) ^ (e >> 31)) >>> 0), this.buf), + this + ); + } + sfixed64(e) { + var r = new Uint8Array(8), + t = new DataView(r.buffer), + e = PbLong.from(e); + return ( + t.setInt32(0, e.lo, !0), t.setInt32(4, e.hi, !0), this.raw(r) + ); + } + fixed64(e) { + var r = new Uint8Array(8), + t = new DataView(r.buffer), + e = PbULong.from(e); + return ( + t.setInt32(0, e.lo, !0), t.setInt32(4, e.hi, !0), this.raw(r) + ); + } + int64(e) { + e = PbLong.from(e); + return varint64write(e.lo, e.hi, this.buf), this; + } + sint64(e) { + var e = PbLong.from(e), + r = e.hi >> 31; + return ( + varint64write( + (e.lo << 1) ^ r, + ((e.hi << 1) | (e.lo >>> 31)) ^ r, + this.buf + ), + this + ); + } + uint64(e) { + e = PbULong.from(e); + return varint64write(e.lo, e.hi, this.buf), this; + } + } + function binaryWriteOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsWrite$1), e) + : defaultsWrite$1; + } + function binaryReadOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsRead$1), e) + : defaultsRead$1; + } + !(function (i) { + (i.symbol = Symbol.for('protobuf-ts/unknown')), + (i.onRead = (e, r, t, a, n) => { + (s(r) ? r[i.symbol] : (r[i.symbol] = [])).push({ + no: t, + wireType: a, + data: n, + }); + }), + (i.onWrite = (e, r, t) => { + for (var { no: a, wireType: n, data: s } of i.list(r)) + t.tag(a, n).raw(s); + }), + (i.list = (e, r) => + s(e) + ? ((e = e[i.symbol]), r ? e.filter((e) => e.no == r) : e) + : []), + (i.last = (e, r) => i.list(e, r).slice(-1)[0]); + const s = (e) => e && Array.isArray(e[i.symbol]); + })((UnknownFieldHandler = UnknownFieldHandler || {})); + const defaultsRead$1 = { + readUnknownField: !0, + readerFactory: (e) => new BinaryReader(e), + }, + defaultsWrite$1 = { + writeUnknownFields: !0, + writerFactory: () => new BinaryWriter(), + }, + MESSAGE_TYPE = + (!(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'); + })((WireType = WireType || {})), + Symbol.for('protobuf-ts/message-type')); + function lowerCamelCase(r) { + let t = !1; + var a = []; + for (let e = 0; e < r.length; e++) { + var n = r.charAt(e); + '_' == n + ? (t = !0) + : /\d/.test(n) + ? (a.push(n), (t = !0)) + : t + ? (a.push(n.toUpperCase()), (t = !1)) + : 0 == e + ? a.push(n.toLowerCase()) + : a.push(n); + } + return a.join(''); + } + function normalizeFieldInfo(e) { + var r; + return ( + (e.localName = + null != (r = e.localName) ? r : lowerCamelCase(e.name)), + (e.jsonName = + null != (r = e.jsonName) ? r : lowerCamelCase(e.name)), + (e.repeat = null != (r = e.repeat) ? r : 0), + (e.opt = + null != (r = e.opt) + ? r + : !e.repeat && !e.oneof && 'message' == e.kind), + e + ); + } + function isOneofGroup(e) { + if ( + 'object' != typeof e || + null === e || + !e.hasOwnProperty('oneofKind') + ) + return !1; + switch (typeof e.oneofKind) { + case 'string': + return void 0 === e[e.oneofKind] + ? !1 + : 2 == Object.keys(e).length; + case 'undefined': + return 1 == Object.keys(e).length; + default: + return !1; + } + } + !(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'); + })((ScalarType = ScalarType || {})), + (function (e) { + (e[(e.BIGINT = 0)] = 'BIGINT'), + (e[(e.STRING = 1)] = 'STRING'), + (e[(e.NUMBER = 2)] = 'NUMBER'); + })((LongType = LongType || {})), + (function (e) { + (e[(e.NO = 0)] = 'NO'), + (e[(e.PACKED = 1)] = 'PACKED'), + (e[(e.UNPACKED = 2)] = 'UNPACKED'); + })((RepeatType = RepeatType || {})); + class ReflectionTypeCheck { + constructor(e) { + this.fields = null != (e = e.fields) ? e : []; + } + prepare() { + if (!this.data) { + var e, + r = [], + t = [], + a = []; + for (e of this.fields) + if (e.oneof) + a.includes(e.oneof) || + (a.push(e.oneof), r.push(e.oneof), t.push(e.oneof)); + else + switch ((t.push(e.localName), e.kind)) { + case 'scalar': + case 'enum': + (e.opt && !e.repeat) || r.push(e.localName); + break; + case 'message': + e.repeat && r.push(e.localName); + break; + case 'map': + r.push(e.localName); + } + this.data = { req: r, known: t, oneofs: Object.values(a) }; + } + } + is(e, a, n = !1) { + if (!(a < 0)) { + if (null == e || 'object' != typeof e) return !1; + this.prepare(); + let r = Object.keys(e), + t = this.data; + if ( + r.length < t.req.length || + t.req.some((e) => !r.includes(e)) + ) + return !1; + if (!n && r.some((e) => !t.known.includes(e))) return !1; + if (!(a < 1)) { + for (const i of t.oneofs) { + const o = e[i]; + if (!isOneofGroup(o)) return !1; + if (void 0 !== o.oneofKind) { + var s = this.fields.find( + (e) => e.localName === o.oneofKind + ); + if (!s) return !1; + if (!this.field(o[o.oneofKind], s, n, a)) return !1; + } + } + for (const l of this.fields) + if ( + void 0 === l.oneof && + !this.field(e[l.localName], l, n, a) + ) + return !1; + } + } + return !0; + } + field(e, r, t, a) { + var n = r.repeat; + switch (r.kind) { + case 'scalar': + return void 0 === e + ? r.opt + : n + ? this.scalars(e, r.T, a, r.L) + : this.scalar(e, r.T, r.L); + case 'enum': + return void 0 === e + ? r.opt + : n + ? this.scalars(e, ScalarType.INT32, a) + : this.scalar(e, ScalarType.INT32); + case 'message': + return void 0 === e + ? !0 + : n + ? this.messages(e, r.T(), t, a) + : this.message(e, r.T(), t, a); + case 'map': + if ('object' != typeof e || null === e) return !1; + if (a < 2) return !0; + if (!this.mapKeys(e, r.K, a)) return !1; + switch (r.V.kind) { + case 'scalar': + return this.scalars(Object.values(e), r.V.T, a, r.V.L); + case 'enum': + return this.scalars( + Object.values(e), + ScalarType.INT32, + a + ); + case 'message': + return this.messages(Object.values(e), r.V.T(), t, a); + } + } + return !0; + } + message(e, r, t, a) { + return t ? r.isAssignable(e, a) : r.is(e, a); + } + messages(r, t, e, a) { + if (!Array.isArray(r)) return !1; + if (!(a < 2)) + if (e) { + for (let e = 0; e < r.length && e < a; e++) + if (!t.isAssignable(r[e], a - 1)) return !1; + } else + for (let e = 0; e < r.length && e < a; e++) + if (!t.is(r[e], a - 1)) return !1; + return !0; + } + scalar(e, r, t) { + var a = typeof e; + switch (r) { + case ScalarType.UINT64: + case ScalarType.FIXED64: + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + switch (t) { + case LongType.BIGINT: + return 'bigint' == a; + case LongType.NUMBER: + return 'number' == a && !isNaN(e); + default: + return 'string' == a; + } + case ScalarType.BOOL: + return 'boolean' == a; + case ScalarType.STRING: + return 'string' == a; + case ScalarType.BYTES: + return e instanceof Uint8Array; + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + return 'number' == a && !isNaN(e); + default: + return 'number' == a && Number.isInteger(e); + } + } + scalars(r, t, a, n) { + if (!Array.isArray(r)) return !1; + if (!(a < 2) && Array.isArray(r)) + for (let e = 0; e < r.length && e < a; e++) + if (!this.scalar(r[e], t, n)) return !1; + return !0; + } + mapKeys(e, r, t) { + var a = Object.keys(e); + switch (r) { + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + case ScalarType.UINT32: + return this.scalars( + a.slice(0, t).map((e) => parseInt(e)), + r, + t + ); + case ScalarType.BOOL: + return this.scalars( + a + .slice(0, t) + .map((e) => 'true' == e || ('false' != e && e)), + r, + t + ); + default: + return this.scalars(a, r, t, LongType.STRING); + } + } + } + function typeofJsonValue(e) { + var r = typeof e; + if ('object' == r) { + if (Array.isArray(e)) return 'array'; + if (null === e) return 'null'; + } + return r; + } + function isJsonObject(e) { + return null !== e && 'object' == typeof e && !Array.isArray(e); + } + let encTable = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split( + '' + ), + decTable = []; + for (let e = 0; e < encTable.length; e++) + decTable[encTable[e].charCodeAt(0)] = e; + function base64decode(r) { + let e = (3 * r.length) / 4, + t = + ('=' == r[r.length - 2] + ? (e -= 2) + : '=' == r[r.length - 1] && --e, + new Uint8Array(e)), + a = 0, + n = 0, + s, + i = 0; + for (let e = 0; e < r.length; e++) { + if (void 0 === (s = decTable[r.charCodeAt(e)])) + switch (r[e]) { + case '=': + n = 0; + case '\n': + case '\r': + case '\t': + case ' ': + continue; + default: + throw Error('invalid base64 string.'); + } + switch (n) { + case 0: + (i = s), (n = 1); + break; + case 1: + (t[a++] = (i << 2) | ((48 & s) >> 4)), (i = s), (n = 2); + break; + case 2: + (t[a++] = ((15 & i) << 4) | ((60 & s) >> 2)), + (i = s), + (n = 3); + break; + case 3: + (t[a++] = ((3 & i) << 6) | s), (n = 0); + } + } + if (1 == n) throw Error('invalid base64 string.'); + return t.subarray(0, a); + } + function base64encode(r) { + let t = '', + a = 0, + n, + s = 0; + for (let e = 0; e < r.length; e++) + switch (((n = r[e]), a)) { + case 0: + (t += encTable[n >> 2]), (s = (3 & n) << 4), (a = 1); + break; + case 1: + (t += encTable[s | (n >> 4)]), (s = (15 & n) << 2), (a = 2); + break; + case 2: + (t = (t += encTable[s | (n >> 6)]) + encTable[63 & n]), + (a = 0); + } + return a && ((t = t + encTable[s] + '='), 1 == a && (t += '=')), t; + } + function reflectionLongConvert(e, r) { + switch (r) { + case LongType.BIGINT: + return e.toBigInt(); + case LongType.NUMBER: + return e.toNumber(); + default: + return e.toString(); + } + } + (decTable['-'.charCodeAt(0)] = encTable.indexOf('+')), + (decTable['_'.charCodeAt(0)] = encTable.indexOf('/')); + class ReflectionJsonReader { + constructor(e) { + this.info = e; + } + prepare() { + var e; + if (void 0 === this.fMap) { + this.fMap = {}; + for (const r of null != (e = this.info.fields) ? e : []) + (this.fMap[r.name] = r), + (this.fMap[r.jsonName] = r), + (this.fMap[r.localName] = r); + } + } + assert(e, r, t) { + if (!e) { + let e = typeofJsonValue(t); + throw ( + (('number' != e && 'boolean' != e) || (e = t.toString()), + new Error( + `Cannot parse JSON ${e} for ${this.info.typeName}#` + r + )) + ); + } + } + read(e, r, t) { + this.prepare(); + var a, + n, + s = []; + for ([a, n] of Object.entries(e)) { + var i = this.fMap[a]; + if (!i) { + if (t.ignoreUnknownFields) continue; + throw new Error( + `Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ` + + a + ); + } + var o = i.localName; + let e; + if (i.oneof) { + if (s.includes(i.oneof)) + throw new Error( + `Multiple members of the oneof group "${i.oneof}" of ${this.info.typeName} are present in JSON.` + ); + s.push(i.oneof), (e = r[i.oneof] = { oneofKind: o }); + } else e = r; + if ('map' == i.kind) { + if (null !== n) { + this.assert(isJsonObject(n), i.name, n); + var l, + c, + u = e[o]; + for ([l, c] of Object.entries(n)) { + this.assert(null !== c, i.name + ' map value', null); + let e; + switch (i.V.kind) { + case 'message': + e = i.V.T().internalJsonRead(c, t); + break; + case 'enum': + if ( + !1 === + (e = this.enum( + i.V.T(), + c, + i.name, + t.ignoreUnknownFields + )) + ) + continue; + break; + case 'scalar': + e = this.scalar(c, i.V.T, i.V.L, i.name); + } + this.assert(void 0 !== e, i.name + ' map value', c); + let r = l; + i.K == ScalarType.BOOL && + (r = 'true' == r || ('false' != r && r)), + (u[ + (r = this.scalar( + r, + i.K, + LongType.STRING, + i.name + ).toString()) + ] = e); + } + } + } else if (i.repeat) { + if (null !== n) { + this.assert(Array.isArray(n), i.name, n); + var f = e[o]; + for (const p of n) { + this.assert(null !== p, i.name, null); + let e; + switch (i.kind) { + case 'message': + e = i.T().internalJsonRead(p, t); + break; + case 'enum': + if ( + !1 === + (e = this.enum( + i.T(), + p, + i.name, + t.ignoreUnknownFields + )) + ) + continue; + break; + case 'scalar': + e = this.scalar(p, i.T, i.L, i.name); + } + this.assert(void 0 !== e, i.name, n), f.push(e); + } + } + } else + switch (i.kind) { + case 'message': + null === n && 'google.protobuf.Value' != i.T().typeName + ? this.assert( + void 0 === i.oneof, + i.name + ' (oneof member)', + null + ) + : (e[o] = i.T().internalJsonRead(n, t, e[o])); + break; + case 'enum': + var h = this.enum( + i.T(), + n, + i.name, + t.ignoreUnknownFields + ); + !1 !== h && (e[o] = h); + break; + case 'scalar': + e[o] = this.scalar(n, i.T, i.L, i.name); + } + } + } + enum(r, t, a, n) { + if ( + ('google.protobuf.NullValue' == r[0] && + assert( + null === t, + `Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} only accepts null.` + ), + null === t) + ) + return 0; + switch (typeof t) { + case 'number': + return ( + assert( + Number.isInteger(t), + `Unable to parse field ${this.info.typeName}#${a}, enum can only be integral number, got ${t}.` + ), + t + ); + case 'string': + let e = t; + r[2] && + t.substring(0, r[2].length) === r[2] && + (e = t.substring(r[2].length)); + var s = r[1][e]; + return void 0 === s && n + ? !1 + : (assert( + 'number' == typeof s, + `Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} has no value for "${t}".` + ), + s); + } + assert( + !1, + `Unable to parse field ${ + this.info.typeName + }#${a}, cannot parse enum value from ${typeof t}".` + ); + } + scalar(r, t, a, e) { + let n; + try { + switch (t) { + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + if (null === r) return 0; + if ('NaN' === r) return Number.NaN; + if ('Infinity' === r) return Number.POSITIVE_INFINITY; + if ('-Infinity' === r) return Number.NEGATIVE_INFINITY; + if ('' === r) n = 'empty string'; + else if ( + 'string' == typeof r && + r.trim().length !== r.length + ) + n = 'extra whitespace'; + else if ('string' == typeof r || 'number' == typeof r) { + var s = Number(r); + if (Number.isNaN(s)) n = 'not a number'; + else { + if (Number.isFinite(s)) + return t == ScalarType.FLOAT && assertFloat32(s), s; + n = 'too large or small'; + } + } + break; + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + case ScalarType.UINT32: + if (null === r) return 0; + let e; + if ( + ('number' == typeof r + ? (e = r) + : '' === r + ? (n = 'empty string') + : 'string' == typeof r && + (r.trim().length !== r.length + ? (n = 'extra whitespace') + : (e = Number(r))), + void 0 === e) + ) + break; + return ( + (t == ScalarType.UINT32 ? assertUInt32 : assertInt32)(e), + e + ); + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + if (null === r) + return reflectionLongConvert(PbLong.ZERO, a); + if ('number' != typeof r && 'string' != typeof r) break; + return reflectionLongConvert(PbLong.from(r), a); + case ScalarType.FIXED64: + case ScalarType.UINT64: + if (null === r) + return reflectionLongConvert(PbULong.ZERO, a); + if ('number' != typeof r && 'string' != typeof r) break; + return reflectionLongConvert(PbULong.from(r), a); + case ScalarType.BOOL: + if (null === r) return !1; + if ('boolean' != typeof r) break; + return r; + case ScalarType.STRING: + if (null === r) return ''; + if ('string' != typeof r) { + n = 'extra whitespace'; + break; + } + try { + encodeURIComponent(r); + } catch (e) { + 0; + break; + } + return r; + case ScalarType.BYTES: + if (null === r || '' === r) return new Uint8Array(0); + if ('string' != typeof r) break; + return base64decode(r); + } + } catch (e) { + n = e.message; + } + this.assert(!1, e + (n ? ' - ' + n : ''), r); + } + } + class ReflectionJsonWriter { + constructor(e) { + this.fields = null != (e = e.fields) ? e : []; + } + write(e, r) { + var t, + a, + n = {}, + s = e; + for (const i of this.fields) + i.oneof + ? (t = s[i.oneof]).oneofKind === i.localName && + ((a = + 'scalar' == i.kind || 'enum' == i.kind + ? __spreadProps(__spreadValues({}, r), { + emitDefaultValues: !0, + }) + : r), + assert(void 0 !== (t = this.field(i, t[i.localName], a))), + (n[r.useProtoFieldName ? i.name : i.jsonName] = t)) + : void 0 !== (a = this.field(i, s[i.localName], r)) && + (n[r.useProtoFieldName ? i.name : i.jsonName] = a); + return n; + } + field(r, t, a) { + let e = void 0; + if ('map' == r.kind) { + assert('object' == typeof t && null !== t); + var n = {}; + switch (r.V.kind) { + case 'scalar': + for (var [s, i] of Object.entries(t)) { + i = this.scalar(r.V.T, i, r.name, !1, !0); + assert(void 0 !== i), (n[s.toString()] = i); + } + break; + case 'message': + var o, + l, + c = r.V.T(); + for ([o, l] of Object.entries(t)) { + var u = this.message(c, l, r.name, a); + assert(void 0 !== u), (n[o.toString()] = u); + } + break; + case 'enum': + var f, + h, + p = r.V.T(); + for ([f, h] of Object.entries(t)) { + assert(void 0 === h || 'number' == typeof h); + var d = this.enum(p, h, r.name, !1, !0, a.enumAsInteger); + assert(void 0 !== d), (n[f.toString()] = d); + } + } + (a.emitDefaultValues || 0 < Object.keys(n).length) && (e = n); + } else if (r.repeat) { + assert(Array.isArray(t)); + var y = []; + switch (r.kind) { + case 'scalar': + for (let e = 0; e < t.length; e++) { + var T = this.scalar(r.T, t[e], r.name, r.opt, !0); + assert(void 0 !== T), y.push(T); + } + break; + case 'enum': + var g = r.T(); + for (let e = 0; e < t.length; e++) { + assert(void 0 === t[e] || 'number' == typeof t[e]); + var b = this.enum( + g, + t[e], + r.name, + r.opt, + !0, + a.enumAsInteger + ); + assert(void 0 !== b), y.push(b); + } + break; + case 'message': + var m = r.T(); + for (let e = 0; e < t.length; e++) { + var w = this.message(m, t[e], r.name, a); + assert(void 0 !== w), y.push(w); + } + } + (a.emitDefaultValues || 0 < y.length || a.emitDefaultValues) && + (e = y); + } else + switch (r.kind) { + case 'scalar': + e = this.scalar(r.T, t, r.name, r.opt, a.emitDefaultValues); + break; + case 'enum': + e = this.enum( + r.T(), + t, + r.name, + r.opt, + a.emitDefaultValues, + a.enumAsInteger + ); + break; + case 'message': + e = this.message(r.T(), t, r.name, a); + } + return e; + } + enum(e, r, t, a, n, s) { + if ('google.protobuf.NullValue' == e[0]) return null; + if (void 0 === r) assert(a); + else if (0 !== r || n || a) + return ( + assert('number' == typeof r), + assert(Number.isInteger(r)), + s || !e[1].hasOwnProperty(r) + ? r + : e[2] + ? e[2] + e[1][r] + : e[1][r] + ); + } + message(e, r, t, a) { + return void 0 === r + ? a.emitDefaultValues + ? null + : void 0 + : e.internalJsonWrite(r, a); + } + scalar(e, r, t, a, n) { + if (void 0 === r) assert(a); + else { + var s = n || a; + switch (e) { + case ScalarType.INT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + return 0 === r ? (s ? 0 : void 0) : (assertInt32(r), r); + case ScalarType.FIXED32: + case ScalarType.UINT32: + return 0 === r ? (s ? 0 : void 0) : (assertUInt32(r), r); + case ScalarType.FLOAT: + assertFloat32(r); + case ScalarType.DOUBLE: + return 0 === r + ? s + ? 0 + : void 0 + : (assert('number' == typeof r), + Number.isNaN(r) + ? 'NaN' + : r === Number.POSITIVE_INFINITY + ? 'Infinity' + : r === Number.NEGATIVE_INFINITY + ? '-Infinity' + : r); + case ScalarType.STRING: + return '' === r + ? s + ? '' + : void 0 + : (assert('string' == typeof r), r); + case ScalarType.BOOL: + return !1 === r + ? !s && void 0 + : (assert('boolean' == typeof r), r); + case ScalarType.UINT64: + case ScalarType.FIXED64: + assert( + 'number' == typeof r || + 'string' == typeof r || + 'bigint' == typeof r + ); + var i = PbULong.from(r); + return i.isZero() && !s ? void 0 : i.toString(); + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + assert( + 'number' == typeof r || + 'string' == typeof r || + 'bigint' == typeof r + ); + i = PbLong.from(r); + return i.isZero() && !s ? void 0 : i.toString(); + case ScalarType.BYTES: + return (assert(r instanceof Uint8Array), r.byteLength) + ? base64encode(r) + : s + ? '' + : void 0; + } + } + } + } + function reflectionScalarDefault(e, r = LongType.STRING) { + switch (e) { + case ScalarType.BOOL: + return !1; + case ScalarType.UINT64: + case ScalarType.FIXED64: + return reflectionLongConvert(PbULong.ZERO, r); + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + return reflectionLongConvert(PbLong.ZERO, r); + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + return 0; + case ScalarType.BYTES: + return new Uint8Array(0); + case ScalarType.STRING: + return ''; + default: + return 0; + } + } + class ReflectionBinaryReader { + constructor(e) { + this.info = e; + } + prepare() { + var e; + this.fieldNoToField || + ((e = null != (e = this.info.fields) ? e : []), + (this.fieldNoToField = new Map(e.map((e) => [e.no, e])))); + } + read(a, n, s, e) { + this.prepare(); + for (var r = void 0 === e ? a.len : a.pos + e; a.pos < r; ) { + var [t, i] = a.tag(), + o = this.fieldNoToField.get(t); + if (o) { + let e = n, + r = o.repeat, + t = o.localName; + switch ( + (o.oneof && + (e = e[o.oneof]).oneofKind !== t && + (e = n[o.oneof] = { oneofKind: t }), + o.kind) + ) { + case 'scalar': + case 'enum': + var l = 'enum' == o.kind ? ScalarType.INT32 : o.T, + c = 'scalar' == o.kind ? o.L : void 0; + if (r) { + var u = e[t]; + if ( + i == WireType.LengthDelimited && + l != ScalarType.STRING && + l != ScalarType.BYTES + ) + for (var f = a.uint32() + a.pos; a.pos < f; ) + u.push(this.scalar(a, l, c)); + else u.push(this.scalar(a, l, c)); + } else e[t] = this.scalar(a, l, c); + break; + case 'message': + r + ? ((h = e[t]), + (p = o.T().internalBinaryRead(a, a.uint32(), s)), + h.push(p)) + : (e[t] = o + .T() + .internalBinaryRead(a, a.uint32(), s, e[t])); + break; + case 'map': + var [h, p] = this.mapEntry(o, a, s); + e[t][h] = p; + } + } else { + var d = s.readUnknownField; + if ('throw' == d) + throw new Error( + `Unknown field ${t} (wire type ${i}) for ` + + this.info.typeName + ); + var y = a.skip(i); + !1 !== d && + (!0 === d ? UnknownFieldHandler.onRead : d)( + this.info.typeName, + n, + t, + i, + y + ); + } + } + } + mapEntry(e, r, t) { + var a = r.uint32(), + n = r.pos + a; + let s = void 0, + i = void 0; + for (; r.pos < n; ) { + var [o, l] = r.tag(); + switch (o) { + case 1: + s = + e.K == ScalarType.BOOL + ? r.bool().toString() + : this.scalar(r, e.K, LongType.STRING); + break; + case 2: + switch (e.V.kind) { + case 'scalar': + i = this.scalar(r, e.V.T, e.V.L); + break; + case 'enum': + i = r.int32(); + break; + case 'message': + i = e.V.T().internalBinaryRead(r, r.uint32(), t); + } + break; + default: + throw new Error( + `Unknown field ${o} (wire type ${l}) in map entry for ${this.info.typeName}#` + + e.name + ); + } + } + if ( + (void 0 === s && + ((a = reflectionScalarDefault(e.K)), + (s = e.K == ScalarType.BOOL ? a.toString() : a)), + void 0 === i) + ) + switch (e.V.kind) { + case 'scalar': + i = reflectionScalarDefault(e.V.T, e.V.L); + break; + case 'enum': + i = 0; + break; + case 'message': + i = e.V.T().create(); + } + return [s, i]; + } + scalar(e, r, t) { + switch (r) { + case ScalarType.INT32: + return e.int32(); + case ScalarType.STRING: + return e.string(); + case ScalarType.BOOL: + return e.bool(); + case ScalarType.DOUBLE: + return e.double(); + case ScalarType.FLOAT: + return e.float(); + case ScalarType.INT64: + return reflectionLongConvert(e.int64(), t); + case ScalarType.UINT64: + return reflectionLongConvert(e.uint64(), t); + case ScalarType.FIXED64: + return reflectionLongConvert(e.fixed64(), t); + case ScalarType.FIXED32: + return e.fixed32(); + case ScalarType.BYTES: + return e.bytes(); + case ScalarType.UINT32: + return e.uint32(); + case ScalarType.SFIXED32: + return e.sfixed32(); + case ScalarType.SFIXED64: + return reflectionLongConvert(e.sfixed64(), t); + case ScalarType.SINT32: + return e.sint32(); + case ScalarType.SINT64: + return reflectionLongConvert(e.sint64(), t); + } + } + } + class ReflectionBinaryWriter { + constructor(e) { + this.info = e; + } + prepare() { + var e; + this.fields || + ((e = this.info.fields ? this.info.fields.concat() : []), + (this.fields = e.sort((e, r) => e.no - r.no))); + } + write(n, s, i) { + this.prepare(); + for (const f of this.fields) { + let e, + r, + t = f.repeat, + a = f.localName; + if (f.oneof) { + var o = n[f.oneof]; + if (o.oneofKind !== a) continue; + (e = o[a]), (r = !0); + } else (e = n[a]), (r = !1); + switch (f.kind) { + case 'scalar': + case 'enum': + var l = 'enum' == f.kind ? ScalarType.INT32 : f.T; + if (t) + if ((assert(Array.isArray(e)), t == RepeatType.PACKED)) + this.packed(s, l, f.no, e); + else for (const h of e) this.scalar(s, l, f.no, h, !0); + else + void 0 === e + ? assert(f.opt) + : this.scalar(s, l, f.no, e, r || f.opt); + break; + case 'message': + if (t) { + assert(Array.isArray(e)); + for (const p of e) this.message(s, i, f.T(), f.no, p); + } else this.message(s, i, f.T(), f.no, e); + break; + case 'map': + assert('object' == typeof e && null !== e); + for (var [c, u] of Object.entries(e)) + this.mapEntry(s, i, f, c, u); + } + } + var e = i.writeUnknownFields; + !1 !== e && + (!0 === e ? UnknownFieldHandler.onWrite : e)( + this.info.typeName, + n, + s + ); + } + mapEntry(e, r, t, a, n) { + e.tag(t.no, WireType.LengthDelimited), e.fork(); + let s = a; + switch (t.K) { + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.UINT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + s = Number.parseInt(a); + break; + case ScalarType.BOOL: + assert('true' == a || 'false' == a), (s = 'true' == a); + } + switch ((this.scalar(e, t.K, 1, s, !0), t.V.kind)) { + case 'scalar': + this.scalar(e, t.V.T, 2, n, !0); + break; + case 'enum': + this.scalar(e, ScalarType.INT32, 2, n, !0); + break; + case 'message': + this.message(e, r, t.V.T(), 2, n); + } + e.join(); + } + message(e, r, t, a, n) { + void 0 !== n && + (t.internalBinaryWrite( + n, + e.tag(a, WireType.LengthDelimited).fork(), + r + ), + e.join()); + } + scalar(e, r, t, a, n) { + var [r, s, i] = this.scalarInfo(r, a); + (i && !n) || (e.tag(t, r), e[s](a)); + } + packed(r, e, t, a) { + if (a.length) { + assert(e !== ScalarType.BYTES && e !== ScalarType.STRING), + r.tag(t, WireType.LengthDelimited), + r.fork(); + var [, n] = this.scalarInfo(e); + for (let e = 0; e < a.length; e++) r[n](a[e]); + r.join(); + } + } + scalarInfo(e, r) { + let t = WireType.Varint, + a; + var n = void 0 === r; + let s = 0 === r; + switch (e) { + case ScalarType.INT32: + a = 'int32'; + break; + case ScalarType.STRING: + (s = n || !r.length), + (t = WireType.LengthDelimited), + (a = 'string'); + break; + case ScalarType.BOOL: + (s = !1 === r), (a = 'bool'); + break; + case ScalarType.UINT32: + a = 'uint32'; + break; + case ScalarType.DOUBLE: + (t = WireType.Bit64), (a = 'double'); + break; + case ScalarType.FLOAT: + (t = WireType.Bit32), (a = 'float'); + break; + case ScalarType.INT64: + (s = n || PbLong.from(r).isZero()), (a = 'int64'); + break; + case ScalarType.UINT64: + (s = n || PbULong.from(r).isZero()), (a = 'uint64'); + break; + case ScalarType.FIXED64: + (s = n || PbULong.from(r).isZero()), + (t = WireType.Bit64), + (a = 'fixed64'); + break; + case ScalarType.BYTES: + (s = n || !r.byteLength), + (t = WireType.LengthDelimited), + (a = 'bytes'); + break; + case ScalarType.FIXED32: + (t = WireType.Bit32), (a = 'fixed32'); + break; + case ScalarType.SFIXED32: + (t = WireType.Bit32), (a = 'sfixed32'); + break; + case ScalarType.SFIXED64: + (s = n || PbLong.from(r).isZero()), + (t = WireType.Bit64), + (a = 'sfixed64'); + break; + case ScalarType.SINT32: + a = 'sint32'; + break; + case ScalarType.SINT64: + (s = n || PbLong.from(r).isZero()), (a = 'sint64'); + } + return [t, a, n || s]; + } + } + function reflectionCreate(e) { + var r, + t = {}; + Object.defineProperty(t, MESSAGE_TYPE, { + enumerable: !1, + value: e, + }); + for (r of e.fields) { + var a = r.localName; + if (!r.opt) + if (r.oneof) t[r.oneof] = { oneofKind: void 0 }; + else if (r.repeat) t[a] = []; + else + switch (r.kind) { + case 'scalar': + t[a] = reflectionScalarDefault(r.T, r.L); + break; + case 'enum': + t[a] = 0; + break; + case 'map': + t[a] = {}; + } + } + return t; + } + function reflectionMergePartial(e, r, t) { + let a, + n = t, + s; + for (var i of e.fields) { + var o = i.localName; + if (i.oneof) { + var l = n[i.oneof]; + if (void 0 === l) continue; + if ( + ((a = l[o]), + ((s = r[i.oneof]).oneofKind = l.oneofKind), + void 0 === a) + ) { + delete s[o]; + continue; + } + } else if (((a = n[o]), (s = r), void 0 === a)) continue; + switch (i.kind) { + case 'scalar': + case 'enum': + i.repeat ? (s[o] = a.concat()) : (s[o] = a); + break; + case 'message': + var c = i.T(); + if (i.repeat) + for (let e = 0; e < a.length; e++) s[o][e] = c.create(a[e]); + else + void 0 === s[o] + ? (s[o] = c.create(a)) + : c.mergePartial(s[o], a); + break; + case 'map': + switch (i.V.kind) { + case 'scalar': + case 'enum': + Object.assign(s[o], a); + break; + case 'message': + var u, + f = i.V.T(); + for (u of Object.keys(a)) s[o][u] = f.create(a[u]); + } + } + } + } + const defaultsWrite = { + emitDefaultValues: !1, + enumAsInteger: !1, + useProtoFieldName: !1, + prettySpaces: 0, + }, + defaultsRead = { ignoreUnknownFields: !1 }; + function jsonReadOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsRead), e) + : defaultsRead; + } + function jsonWriteOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsWrite), e) + : defaultsWrite; + } + function reflectionEquals(e, r, t) { + if (r !== t) { + if (!r || !t) return !1; + for (var a of e.fields) { + var n = a.localName, + s = (a.oneof ? r[a.oneof] : r)[n], + i = (a.oneof ? t[a.oneof] : t)[n]; + switch (a.kind) { + case 'enum': + case 'scalar': + var o = 'enum' == a.kind ? ScalarType.INT32 : a.T; + if ((a.repeat ? repeatedPrimitiveEq : primitiveEq)(o, s, i)) + break; + return !1; + case 'map': + if ( + 'message' == a.V.kind + ? repeatedMsgEq( + a.V.T(), + objectValues(s), + objectValues(i) + ) + : repeatedPrimitiveEq( + 'enum' == a.V.kind ? ScalarType.INT32 : a.V.T, + objectValues(s), + objectValues(i) + ) + ) + break; + return !1; + case 'message': + o = a.T(); + if (a.repeat ? repeatedMsgEq(o, s, i) : o.equals(s, i)) + break; + return !1; + } + } + } + return !0; + } + const objectValues = Object.values; + function primitiveEq(e, r, t) { + if (r !== t) { + if (e !== ScalarType.BYTES) return !1; + var a = r, + n = t; + if (a.length !== n.length) return !1; + for (let e = 0; e < a.length; e++) if (a[e] != n[e]) return !1; + } + return !0; + } + function repeatedPrimitiveEq(r, t, a) { + if (t.length !== a.length) return !1; + for (let e = 0; e < t.length; e++) + if (!primitiveEq(r, t[e], a[e])) return !1; + return !0; + } + function repeatedMsgEq(r, t, a) { + if (t.length !== a.length) return !1; + for (let e = 0; e < t.length; e++) + if (!r.equals(t[e], a[e])) return !1; + return !0; + } + class MessageType { + constructor(e, r, t) { + (this.defaultCheckDepth = 16), + (this.typeName = e), + (this.fields = r.map(normalizeFieldInfo)), + (this.options = null != t ? t : {}), + (this.refTypeCheck = new ReflectionTypeCheck(this)), + (this.refJsonReader = new ReflectionJsonReader(this)), + (this.refJsonWriter = new ReflectionJsonWriter(this)), + (this.refBinReader = new ReflectionBinaryReader(this)), + (this.refBinWriter = new ReflectionBinaryWriter(this)); + } + create(e) { + var r = reflectionCreate(this); + return void 0 !== e && reflectionMergePartial(this, r, e), r; + } + clone(e) { + var r = this.create(); + return reflectionMergePartial(this, r, e), r; + } + equals(e, r) { + return reflectionEquals(this, e, r); + } + is(e, r = this.defaultCheckDepth) { + return this.refTypeCheck.is(e, r, !1); + } + isAssignable(e, r = this.defaultCheckDepth) { + return this.refTypeCheck.is(e, r, !0); + } + mergePartial(e, r) { + reflectionMergePartial(this, e, r); + } + fromBinary(e, r) { + r = binaryReadOptions(r); + return this.internalBinaryRead( + r.readerFactory(e), + e.byteLength, + r + ); + } + fromJson(e, r) { + return this.internalJsonRead(e, jsonReadOptions(r)); + } + fromJsonString(e, r) { + e = JSON.parse(e); + return this.fromJson(e, r); + } + toJson(e, r) { + return this.internalJsonWrite(e, jsonWriteOptions(r)); + } + toJsonString(e, r) { + var e = this.toJson(e, r); + return JSON.stringify( + e, + null, + null != (e = null == r ? void 0 : r.prettySpaces) ? e : 0 + ); + } + toBinary(e, r) { + r = binaryWriteOptions(r); + return this.internalBinaryWrite(e, r.writerFactory(), r).finish(); + } + internalJsonRead(e, r, t) { + if (null === e || 'object' != typeof e || Array.isArray(e)) + throw new Error( + `Unable to parse message ${ + this.typeName + } from JSON ${typeofJsonValue(e)}.` + ); + return ( + (t = null != t ? t : this.create()), + this.refJsonReader.read(e, t, r), + t + ); + } + internalJsonWrite(e, r) { + return this.refJsonWriter.write(e, r); + } + internalBinaryWrite(e, r, t) { + return this.refBinWriter.write(e, r, t), r; + } + internalBinaryRead(e, r, t, a) { + a = null != a ? a : this.create(); + return this.refBinReader.read(e, a, t, r), a; + } + } + /****************** initialization finish ******************/ + switch (FORMAT) { + case 'application/x-protobuf': + break; + case 'application/grpc': + case 'application/grpc+proto': + /****************** initialization start *******************/ + // pako 2.0.4 + !(function (t, e) { + 'object' == typeof exports && 'undefined' != typeof module + ? e(exports) + : 'function' == typeof define && define.amd + ? define(['exports'], e) + : e( + ((t = + 'undefined' != typeof globalThis + ? globalThis + : t || self).pako = {}) + ); + })(this, function (t) { + 'use strict'; + function e(t) { + let e = t.length; + for (; --e >= 0; ) t[e] = 0; + } + const a = 256, + i = 286, + n = 30, + s = 15, + r = new Uint8Array([ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 5, 5, 5, 5, 0, + ]), + l = new Uint8Array([ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, + 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, + ]), + o = new Uint8Array([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7, + ]), + h = new Uint8Array([ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, + 1, 15, + ]), + d = new Array(576); + e(d); + const _ = new Array(60); + e(_); + const f = new Array(512); + e(f); + const c = new Array(256); + e(c); + const u = new Array(29); + e(u); + const w = new Array(n); + function b(t, e, a, i, n) { + (this.static_tree = t), + (this.extra_bits = e), + (this.extra_base = a), + (this.elems = i), + (this.max_length = n), + (this.has_stree = t && t.length); + } + let g, p, m; + function k(t, e) { + (this.dyn_tree = t), + (this.max_code = 0), + (this.stat_desc = e); + } + e(w); + const v = (t) => (t < 256 ? f[t] : f[256 + (t >>> 7)]), + y = (t, e) => { + (t.pending_buf[t.pending++] = 255 & e), + (t.pending_buf[t.pending++] = (e >>> 8) & 255); + }, + x = (t, e, a) => { + t.bi_valid > 16 - a + ? ((t.bi_buf |= (e << t.bi_valid) & 65535), + y(t, t.bi_buf), + (t.bi_buf = e >> (16 - t.bi_valid)), + (t.bi_valid += a - 16)) + : ((t.bi_buf |= (e << t.bi_valid) & 65535), + (t.bi_valid += a)); + }, + z = (t, e, a) => { + x(t, a[2 * e], a[2 * e + 1]); + }, + A = (t, e) => { + let a = 0; + do { + (a |= 1 & t), (t >>>= 1), (a <<= 1); + } while (--e > 0); + return a >>> 1; + }, + E = (t, e, a) => { + const i = new Array(16); + let n, + r, + l = 0; + for (n = 1; n <= s; n++) i[n] = l = (l + a[n - 1]) << 1; + for (r = 0; r <= e; r++) { + let e = t[2 * r + 1]; + 0 !== e && (t[2 * r] = A(i[e]++, e)); + } + }, + R = (t) => { + let e; + for (e = 0; e < i; e++) t.dyn_ltree[2 * e] = 0; + for (e = 0; e < n; e++) t.dyn_dtree[2 * e] = 0; + for (e = 0; e < 19; e++) t.bl_tree[2 * e] = 0; + (t.dyn_ltree[512] = 1), + (t.opt_len = t.static_len = 0), + (t.last_lit = t.matches = 0); + }, + Z = (t) => { + t.bi_valid > 8 + ? y(t, t.bi_buf) + : t.bi_valid > 0 && + (t.pending_buf[t.pending++] = t.bi_buf), + (t.bi_buf = 0), + (t.bi_valid = 0); + }, + U = (t, e, a, i) => { + const n = 2 * e, + s = 2 * a; + return t[n] < t[s] || (t[n] === t[s] && i[e] <= i[a]); + }, + S = (t, e, a) => { + const i = t.heap[a]; + let n = a << 1; + for ( + ; + n <= t.heap_len && + (n < t.heap_len && + U(e, t.heap[n + 1], t.heap[n], t.depth) && + n++, + !U(e, i, t.heap[n], t.depth)); + + ) + (t.heap[a] = t.heap[n]), (a = n), (n <<= 1); + t.heap[a] = i; + }, + D = (t, e, i) => { + let n, + s, + o, + h, + d = 0; + if (0 !== t.last_lit) + do { + (n = + (t.pending_buf[t.d_buf + 2 * d] << 8) | + t.pending_buf[t.d_buf + 2 * d + 1]), + (s = t.pending_buf[t.l_buf + d]), + d++, + 0 === n + ? z(t, s, e) + : ((o = c[s]), + z(t, o + a + 1, e), + (h = r[o]), + 0 !== h && ((s -= u[o]), x(t, s, h)), + n--, + (o = v(n)), + z(t, o, i), + (h = l[o]), + 0 !== h && ((n -= w[o]), x(t, n, h))); + } while (d < t.last_lit); + z(t, 256, e); + }, + T = (t, e) => { + const a = e.dyn_tree, + i = e.stat_desc.static_tree, + n = e.stat_desc.has_stree, + r = e.stat_desc.elems; + let l, + o, + h, + d = -1; + for (t.heap_len = 0, t.heap_max = 573, l = 0; l < r; l++) + 0 !== a[2 * l] + ? ((t.heap[++t.heap_len] = d = l), (t.depth[l] = 0)) + : (a[2 * l + 1] = 0); + for (; t.heap_len < 2; ) + (h = t.heap[++t.heap_len] = d < 2 ? ++d : 0), + (a[2 * h] = 1), + (t.depth[h] = 0), + t.opt_len--, + n && (t.static_len -= i[2 * h + 1]); + for (e.max_code = d, l = t.heap_len >> 1; l >= 1; l--) + S(t, a, l); + h = r; + do { + (l = t.heap[1]), + (t.heap[1] = t.heap[t.heap_len--]), + S(t, a, 1), + (o = t.heap[1]), + (t.heap[--t.heap_max] = l), + (t.heap[--t.heap_max] = o), + (a[2 * h] = a[2 * l] + a[2 * o]), + (t.depth[h] = + (t.depth[l] >= t.depth[o] ? t.depth[l] : t.depth[o]) + + 1), + (a[2 * l + 1] = a[2 * o + 1] = h), + (t.heap[1] = h++), + S(t, a, 1); + } while (t.heap_len >= 2); + (t.heap[--t.heap_max] = t.heap[1]), + ((t, e) => { + const a = e.dyn_tree, + i = e.max_code, + n = e.stat_desc.static_tree, + r = e.stat_desc.has_stree, + l = e.stat_desc.extra_bits, + o = e.stat_desc.extra_base, + h = e.stat_desc.max_length; + let d, + _, + f, + c, + u, + w, + b = 0; + for (c = 0; c <= s; c++) t.bl_count[c] = 0; + for ( + a[2 * t.heap[t.heap_max] + 1] = 0, d = t.heap_max + 1; + d < 573; + d++ + ) + (_ = t.heap[d]), + (c = a[2 * a[2 * _ + 1] + 1] + 1), + c > h && ((c = h), b++), + (a[2 * _ + 1] = c), + _ > i || + (t.bl_count[c]++, + (u = 0), + _ >= o && (u = l[_ - o]), + (w = a[2 * _]), + (t.opt_len += w * (c + u)), + r && (t.static_len += w * (n[2 * _ + 1] + u))); + if (0 !== b) { + do { + for (c = h - 1; 0 === t.bl_count[c]; ) c--; + t.bl_count[c]--, + (t.bl_count[c + 1] += 2), + t.bl_count[h]--, + (b -= 2); + } while (b > 0); + for (c = h; 0 !== c; c--) + for (_ = t.bl_count[c]; 0 !== _; ) + (f = t.heap[--d]), + f > i || + (a[2 * f + 1] !== c && + ((t.opt_len += + (c - a[2 * f + 1]) * a[2 * f]), + (a[2 * f + 1] = c)), + _--); + } + })(t, e), + E(a, d, t.bl_count); + }, + O = (t, e, a) => { + let i, + n, + s = -1, + r = e[1], + l = 0, + o = 7, + h = 4; + for ( + 0 === r && ((o = 138), (h = 3)), + e[2 * (a + 1) + 1] = 65535, + i = 0; + i <= a; + i++ + ) + (n = r), + (r = e[2 * (i + 1) + 1]), + (++l < o && n === r) || + (l < h + ? (t.bl_tree[2 * n] += l) + : 0 !== n + ? (n !== s && t.bl_tree[2 * n]++, t.bl_tree[32]++) + : l <= 10 + ? t.bl_tree[34]++ + : t.bl_tree[36]++, + (l = 0), + (s = n), + 0 === r + ? ((o = 138), (h = 3)) + : n === r + ? ((o = 6), (h = 3)) + : ((o = 7), (h = 4))); + }, + I = (t, e, a) => { + let i, + n, + s = -1, + r = e[1], + l = 0, + o = 7, + h = 4; + for (0 === r && ((o = 138), (h = 3)), i = 0; i <= a; i++) + if ( + ((n = r), + (r = e[2 * (i + 1) + 1]), + !(++l < o && n === r)) + ) { + if (l < h) + do { + z(t, n, t.bl_tree); + } while (0 != --l); + else + 0 !== n + ? (n !== s && (z(t, n, t.bl_tree), l--), + z(t, 16, t.bl_tree), + x(t, l - 3, 2)) + : l <= 10 + ? (z(t, 17, t.bl_tree), x(t, l - 3, 3)) + : (z(t, 18, t.bl_tree), x(t, l - 11, 7)); + (l = 0), + (s = n), + 0 === r + ? ((o = 138), (h = 3)) + : n === r + ? ((o = 6), (h = 3)) + : ((o = 7), (h = 4)); + } + }; + let F = !1; + const L = (t, e, a, i) => { + x(t, 0 + (i ? 1 : 0), 3), + ((t, e, a, i) => { + Z(t), + i && (y(t, a), y(t, ~a)), + t.pending_buf.set( + t.window.subarray(e, e + a), + t.pending + ), + (t.pending += a); + })(t, e, a, !0); + }; + var N = { + _tr_init: (t) => { + F || + ((() => { + let t, e, a, h, k; + const v = new Array(16); + for (a = 0, h = 0; h < 28; h++) + for (u[h] = a, t = 0; t < 1 << r[h]; t++) c[a++] = h; + for (c[a - 1] = h, k = 0, h = 0; h < 16; h++) + for (w[h] = k, t = 0; t < 1 << l[h]; t++) f[k++] = h; + for (k >>= 7; h < n; h++) + for (w[h] = k << 7, t = 0; t < 1 << (l[h] - 7); t++) + f[256 + k++] = h; + for (e = 0; e <= s; e++) v[e] = 0; + for (t = 0; t <= 143; ) (d[2 * t + 1] = 8), t++, v[8]++; + for (; t <= 255; ) (d[2 * t + 1] = 9), t++, v[9]++; + for (; t <= 279; ) (d[2 * t + 1] = 7), t++, v[7]++; + for (; t <= 287; ) (d[2 * t + 1] = 8), t++, v[8]++; + for (E(d, 287, v), t = 0; t < n; t++) + (_[2 * t + 1] = 5), (_[2 * t] = A(t, 5)); + (g = new b(d, r, 257, i, s)), + (p = new b(_, l, 0, n, s)), + (m = new b(new Array(0), o, 0, 19, 7)); + })(), + (F = !0)), + (t.l_desc = new k(t.dyn_ltree, g)), + (t.d_desc = new k(t.dyn_dtree, p)), + (t.bl_desc = new k(t.bl_tree, m)), + (t.bi_buf = 0), + (t.bi_valid = 0), + R(t); + }, + _tr_stored_block: L, + _tr_flush_block: (t, e, i, n) => { + let s, + r, + l = 0; + t.level > 0 + ? (2 === t.strm.data_type && + (t.strm.data_type = ((t) => { + let e, + i = 4093624447; + for (e = 0; e <= 31; e++, i >>>= 1) + if (1 & i && 0 !== t.dyn_ltree[2 * e]) return 0; + if ( + 0 !== t.dyn_ltree[18] || + 0 !== t.dyn_ltree[20] || + 0 !== t.dyn_ltree[26] + ) + return 1; + for (e = 32; e < a; e++) + if (0 !== t.dyn_ltree[2 * e]) return 1; + return 0; + })(t)), + T(t, t.l_desc), + T(t, t.d_desc), + (l = ((t) => { + let e; + for ( + O(t, t.dyn_ltree, t.l_desc.max_code), + O(t, t.dyn_dtree, t.d_desc.max_code), + T(t, t.bl_desc), + e = 18; + e >= 3 && 0 === t.bl_tree[2 * h[e] + 1]; + e-- + ); + return (t.opt_len += 3 * (e + 1) + 5 + 5 + 4), e; + })(t)), + (s = (t.opt_len + 3 + 7) >>> 3), + (r = (t.static_len + 3 + 7) >>> 3), + r <= s && (s = r)) + : (s = r = i + 5), + i + 4 <= s && -1 !== e + ? L(t, e, i, n) + : 4 === t.strategy || r === s + ? (x(t, 2 + (n ? 1 : 0), 3), D(t, d, _)) + : (x(t, 4 + (n ? 1 : 0), 3), + ((t, e, a, i) => { + let n; + for ( + x(t, e - 257, 5), + x(t, a - 1, 5), + x(t, i - 4, 4), + n = 0; + n < i; + n++ + ) + x(t, t.bl_tree[2 * h[n] + 1], 3); + I(t, t.dyn_ltree, e - 1), I(t, t.dyn_dtree, a - 1); + })( + t, + t.l_desc.max_code + 1, + t.d_desc.max_code + 1, + l + 1 + ), + D(t, t.dyn_ltree, t.dyn_dtree)), + R(t), + n && Z(t); + }, + _tr_tally: (t, e, i) => ( + (t.pending_buf[t.d_buf + 2 * t.last_lit] = (e >>> 8) & 255), + (t.pending_buf[t.d_buf + 2 * t.last_lit + 1] = 255 & e), + (t.pending_buf[t.l_buf + t.last_lit] = 255 & i), + t.last_lit++, + 0 === e + ? t.dyn_ltree[2 * i]++ + : (t.matches++, + e--, + t.dyn_ltree[2 * (c[i] + a + 1)]++, + t.dyn_dtree[2 * v(e)]++), + t.last_lit === t.lit_bufsize - 1 + ), + _tr_align: (t) => { + x(t, 2, 3), + z(t, 256, d), + ((t) => { + 16 === t.bi_valid + ? (y(t, t.bi_buf), (t.bi_buf = 0), (t.bi_valid = 0)) + : t.bi_valid >= 8 && + ((t.pending_buf[t.pending++] = 255 & t.bi_buf), + (t.bi_buf >>= 8), + (t.bi_valid -= 8)); + })(t); + }, + }; + var B = (t, e, a, i) => { + let n = (65535 & t) | 0, + s = ((t >>> 16) & 65535) | 0, + r = 0; + for (; 0 !== a; ) { + (r = a > 2e3 ? 2e3 : a), (a -= r); + do { + (n = (n + e[i++]) | 0), (s = (s + n) | 0); + } while (--r); + (n %= 65521), (s %= 65521); + } + return n | (s << 16) | 0; + }; + const C = new Uint32Array( + (() => { + let t, + e = []; + for (var a = 0; a < 256; a++) { + t = a; + for (var i = 0; i < 8; i++) + t = 1 & t ? 3988292384 ^ (t >>> 1) : t >>> 1; + e[a] = t; + } + return e; + })() + ); + var M = (t, e, a, i) => { + const n = C, + s = i + a; + t ^= -1; + for (let a = i; a < s; a++) + t = (t >>> 8) ^ n[255 & (t ^ e[a])]; + return -1 ^ t; + }, + H = { + 2: 'need dictionary', + 1: 'stream end', + 0: '', + '-1': 'file error', + '-2': 'stream error', + '-3': 'data error', + '-4': 'insufficient memory', + '-5': 'buffer error', + '-6': 'incompatible version', + }, + j = { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + Z_BINARY: 0, + Z_TEXT: 1, + Z_UNKNOWN: 2, + Z_DEFLATED: 8, + }; + const { + _tr_init: K, + _tr_stored_block: P, + _tr_flush_block: Y, + _tr_tally: G, + _tr_align: X, + } = N, + { + Z_NO_FLUSH: W, + Z_PARTIAL_FLUSH: q, + Z_FULL_FLUSH: J, + Z_FINISH: Q, + Z_BLOCK: V, + Z_OK: $, + Z_STREAM_END: tt, + Z_STREAM_ERROR: et, + Z_DATA_ERROR: at, + Z_BUF_ERROR: it, + Z_DEFAULT_COMPRESSION: nt, + Z_FILTERED: st, + Z_HUFFMAN_ONLY: rt, + Z_RLE: lt, + Z_FIXED: ot, + Z_DEFAULT_STRATEGY: ht, + Z_UNKNOWN: dt, + Z_DEFLATED: _t, + } = j, + ft = 258, + ct = 262, + ut = 103, + wt = 113, + bt = 666, + gt = (t, e) => ((t.msg = H[e]), e), + pt = (t) => (t << 1) - (t > 4 ? 9 : 0), + mt = (t) => { + let e = t.length; + for (; --e >= 0; ) t[e] = 0; + }; + let kt = (t, e, a) => ((e << t.hash_shift) ^ a) & t.hash_mask; + const vt = (t) => { + const e = t.state; + let a = e.pending; + a > t.avail_out && (a = t.avail_out), + 0 !== a && + (t.output.set( + e.pending_buf.subarray( + e.pending_out, + e.pending_out + a + ), + t.next_out + ), + (t.next_out += a), + (e.pending_out += a), + (t.total_out += a), + (t.avail_out -= a), + (e.pending -= a), + 0 === e.pending && (e.pending_out = 0)); + }, + yt = (t, e) => { + Y( + t, + t.block_start >= 0 ? t.block_start : -1, + t.strstart - t.block_start, + e + ), + (t.block_start = t.strstart), + vt(t.strm); + }, + xt = (t, e) => { + t.pending_buf[t.pending++] = e; + }, + zt = (t, e) => { + (t.pending_buf[t.pending++] = (e >>> 8) & 255), + (t.pending_buf[t.pending++] = 255 & e); + }, + At = (t, e, a, i) => { + let n = t.avail_in; + return ( + n > i && (n = i), + 0 === n + ? 0 + : ((t.avail_in -= n), + e.set(t.input.subarray(t.next_in, t.next_in + n), a), + 1 === t.state.wrap + ? (t.adler = B(t.adler, e, n, a)) + : 2 === t.state.wrap && + (t.adler = M(t.adler, e, n, a)), + (t.next_in += n), + (t.total_in += n), + n) + ); + }, + Et = (t, e) => { + let a, + i, + n = t.max_chain_length, + s = t.strstart, + r = t.prev_length, + l = t.nice_match; + const o = + t.strstart > t.w_size - ct + ? t.strstart - (t.w_size - ct) + : 0, + h = t.window, + d = t.w_mask, + _ = t.prev, + f = t.strstart + ft; + let c = h[s + r - 1], + u = h[s + r]; + t.prev_length >= t.good_match && (n >>= 2), + l > t.lookahead && (l = t.lookahead); + do { + if ( + ((a = e), + h[a + r] === u && + h[a + r - 1] === c && + h[a] === h[s] && + h[++a] === h[s + 1]) + ) { + (s += 2), a++; + do {} while ( + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + s < f + ); + if (((i = ft - (f - s)), (s = f - ft), i > r)) { + if (((t.match_start = e), (r = i), i >= l)) break; + (c = h[s + r - 1]), (u = h[s + r]); + } + } + } while ((e = _[e & d]) > o && 0 != --n); + return r <= t.lookahead ? r : t.lookahead; + }, + Rt = (t) => { + const e = t.w_size; + let a, i, n, s, r; + do { + if ( + ((s = t.window_size - t.lookahead - t.strstart), + t.strstart >= e + (e - ct)) + ) { + t.window.set(t.window.subarray(e, e + e), 0), + (t.match_start -= e), + (t.strstart -= e), + (t.block_start -= e), + (i = t.hash_size), + (a = i); + do { + (n = t.head[--a]), (t.head[a] = n >= e ? n - e : 0); + } while (--i); + (i = e), (a = i); + do { + (n = t.prev[--a]), (t.prev[a] = n >= e ? n - e : 0); + } while (--i); + s += e; + } + if (0 === t.strm.avail_in) break; + if ( + ((i = At( + t.strm, + t.window, + t.strstart + t.lookahead, + s + )), + (t.lookahead += i), + t.lookahead + t.insert >= 3) + ) + for ( + r = t.strstart - t.insert, + t.ins_h = t.window[r], + t.ins_h = kt(t, t.ins_h, t.window[r + 1]); + t.insert && + ((t.ins_h = kt(t, t.ins_h, t.window[r + 3 - 1])), + (t.prev[r & t.w_mask] = t.head[t.ins_h]), + (t.head[t.ins_h] = r), + r++, + t.insert--, + !(t.lookahead + t.insert < 3)); + + ); + } while (t.lookahead < ct && 0 !== t.strm.avail_in); + }, + Zt = (t, e) => { + let a, i; + for (;;) { + if (t.lookahead < ct) { + if ((Rt(t), t.lookahead < ct && e === W)) return 1; + if (0 === t.lookahead) break; + } + if ( + ((a = 0), + t.lookahead >= 3 && + ((t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart)), + 0 !== a && + t.strstart - a <= t.w_size - ct && + (t.match_length = Et(t, a)), + t.match_length >= 3) + ) + if ( + ((i = G( + t, + t.strstart - t.match_start, + t.match_length - 3 + )), + (t.lookahead -= t.match_length), + t.match_length <= t.max_lazy_match && + t.lookahead >= 3) + ) { + t.match_length--; + do { + t.strstart++, + (t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = + t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart); + } while (0 != --t.match_length); + t.strstart++; + } else + (t.strstart += t.match_length), + (t.match_length = 0), + (t.ins_h = t.window[t.strstart]), + (t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 1] + )); + else + (i = G(t, 0, t.window[t.strstart])), + t.lookahead--, + t.strstart++; + if (i && (yt(t, !1), 0 === t.strm.avail_out)) return 1; + } + return ( + (t.insert = t.strstart < 2 ? t.strstart : 2), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + }, + Ut = (t, e) => { + let a, i, n; + for (;;) { + if (t.lookahead < ct) { + if ((Rt(t), t.lookahead < ct && e === W)) return 1; + if (0 === t.lookahead) break; + } + if ( + ((a = 0), + t.lookahead >= 3 && + ((t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart)), + (t.prev_length = t.match_length), + (t.prev_match = t.match_start), + (t.match_length = 2), + 0 !== a && + t.prev_length < t.max_lazy_match && + t.strstart - a <= t.w_size - ct && + ((t.match_length = Et(t, a)), + t.match_length <= 5 && + (t.strategy === st || + (3 === t.match_length && + t.strstart - t.match_start > 4096)) && + (t.match_length = 2)), + t.prev_length >= 3 && t.match_length <= t.prev_length) + ) { + (n = t.strstart + t.lookahead - 3), + (i = G( + t, + t.strstart - 1 - t.prev_match, + t.prev_length - 3 + )), + (t.lookahead -= t.prev_length - 1), + (t.prev_length -= 2); + do { + ++t.strstart <= n && + ((t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = + t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart)); + } while (0 != --t.prev_length); + if ( + ((t.match_available = 0), + (t.match_length = 2), + t.strstart++, + i && (yt(t, !1), 0 === t.strm.avail_out)) + ) + return 1; + } else if (t.match_available) { + if ( + ((i = G(t, 0, t.window[t.strstart - 1])), + i && yt(t, !1), + t.strstart++, + t.lookahead--, + 0 === t.strm.avail_out) + ) + return 1; + } else + (t.match_available = 1), t.strstart++, t.lookahead--; + } + return ( + t.match_available && + ((i = G(t, 0, t.window[t.strstart - 1])), + (t.match_available = 0)), + (t.insert = t.strstart < 2 ? t.strstart : 2), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + }; + function St(t, e, a, i, n) { + (this.good_length = t), + (this.max_lazy = e), + (this.nice_length = a), + (this.max_chain = i), + (this.func = n); + } + const Dt = [ + new St(0, 0, 0, 0, (t, e) => { + let a = 65535; + for ( + a > t.pending_buf_size - 5 && + (a = t.pending_buf_size - 5); + ; + + ) { + if (t.lookahead <= 1) { + if ((Rt(t), 0 === t.lookahead && e === W)) return 1; + if (0 === t.lookahead) break; + } + (t.strstart += t.lookahead), (t.lookahead = 0); + const i = t.block_start + a; + if ( + (0 === t.strstart || t.strstart >= i) && + ((t.lookahead = t.strstart - i), + (t.strstart = i), + yt(t, !1), + 0 === t.strm.avail_out) + ) + return 1; + if ( + t.strstart - t.block_start >= t.w_size - ct && + (yt(t, !1), 0 === t.strm.avail_out) + ) + return 1; + } + return ( + (t.insert = 0), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : (t.strstart > t.block_start && + (yt(t, !1), t.strm.avail_out), + 1) + ); + }), + new St(4, 4, 8, 4, Zt), + new St(4, 5, 16, 8, Zt), + new St(4, 6, 32, 32, Zt), + new St(4, 4, 16, 16, Ut), + new St(8, 16, 32, 32, Ut), + new St(8, 16, 128, 128, Ut), + new St(8, 32, 128, 256, Ut), + new St(32, 128, 258, 1024, Ut), + new St(32, 258, 258, 4096, Ut), + ]; + function Tt() { + (this.strm = null), + (this.status = 0), + (this.pending_buf = null), + (this.pending_buf_size = 0), + (this.pending_out = 0), + (this.pending = 0), + (this.wrap = 0), + (this.gzhead = null), + (this.gzindex = 0), + (this.method = _t), + (this.last_flush = -1), + (this.w_size = 0), + (this.w_bits = 0), + (this.w_mask = 0), + (this.window = null), + (this.window_size = 0), + (this.prev = null), + (this.head = null), + (this.ins_h = 0), + (this.hash_size = 0), + (this.hash_bits = 0), + (this.hash_mask = 0), + (this.hash_shift = 0), + (this.block_start = 0), + (this.match_length = 0), + (this.prev_match = 0), + (this.match_available = 0), + (this.strstart = 0), + (this.match_start = 0), + (this.lookahead = 0), + (this.prev_length = 0), + (this.max_chain_length = 0), + (this.max_lazy_match = 0), + (this.level = 0), + (this.strategy = 0), + (this.good_match = 0), + (this.nice_match = 0), + (this.dyn_ltree = new Uint16Array(1146)), + (this.dyn_dtree = new Uint16Array(122)), + (this.bl_tree = new Uint16Array(78)), + mt(this.dyn_ltree), + mt(this.dyn_dtree), + mt(this.bl_tree), + (this.l_desc = null), + (this.d_desc = null), + (this.bl_desc = null), + (this.bl_count = new Uint16Array(16)), + (this.heap = new Uint16Array(573)), + mt(this.heap), + (this.heap_len = 0), + (this.heap_max = 0), + (this.depth = new Uint16Array(573)), + mt(this.depth), + (this.l_buf = 0), + (this.lit_bufsize = 0), + (this.last_lit = 0), + (this.d_buf = 0), + (this.opt_len = 0), + (this.static_len = 0), + (this.matches = 0), + (this.insert = 0), + (this.bi_buf = 0), + (this.bi_valid = 0); + } + const Ot = (t) => { + if (!t || !t.state) return gt(t, et); + (t.total_in = t.total_out = 0), (t.data_type = dt); + const e = t.state; + return ( + (e.pending = 0), + (e.pending_out = 0), + e.wrap < 0 && (e.wrap = -e.wrap), + (e.status = e.wrap ? 42 : wt), + (t.adler = 2 === e.wrap ? 0 : 1), + (e.last_flush = W), + K(e), + $ + ); + }, + It = (t) => { + const e = Ot(t); + var a; + return ( + e === $ && + (((a = t.state).window_size = 2 * a.w_size), + mt(a.head), + (a.max_lazy_match = Dt[a.level].max_lazy), + (a.good_match = Dt[a.level].good_length), + (a.nice_match = Dt[a.level].nice_length), + (a.max_chain_length = Dt[a.level].max_chain), + (a.strstart = 0), + (a.block_start = 0), + (a.lookahead = 0), + (a.insert = 0), + (a.match_length = a.prev_length = 2), + (a.match_available = 0), + (a.ins_h = 0)), + e + ); + }, + Ft = (t, e, a, i, n, s) => { + if (!t) return et; + let r = 1; + if ( + (e === nt && (e = 6), + i < 0 + ? ((r = 0), (i = -i)) + : i > 15 && ((r = 2), (i -= 16)), + n < 1 || + n > 9 || + a !== _t || + i < 8 || + i > 15 || + e < 0 || + e > 9 || + s < 0 || + s > ot) + ) + return gt(t, et); + 8 === i && (i = 9); + const l = new Tt(); + return ( + (t.state = l), + (l.strm = t), + (l.wrap = r), + (l.gzhead = null), + (l.w_bits = i), + (l.w_size = 1 << l.w_bits), + (l.w_mask = l.w_size - 1), + (l.hash_bits = n + 7), + (l.hash_size = 1 << l.hash_bits), + (l.hash_mask = l.hash_size - 1), + (l.hash_shift = ~~((l.hash_bits + 3 - 1) / 3)), + (l.window = new Uint8Array(2 * l.w_size)), + (l.head = new Uint16Array(l.hash_size)), + (l.prev = new Uint16Array(l.w_size)), + (l.lit_bufsize = 1 << (n + 6)), + (l.pending_buf_size = 4 * l.lit_bufsize), + (l.pending_buf = new Uint8Array(l.pending_buf_size)), + (l.d_buf = 1 * l.lit_bufsize), + (l.l_buf = 3 * l.lit_bufsize), + (l.level = e), + (l.strategy = s), + (l.method = a), + It(t) + ); + }; + var Lt = { + deflateInit: (t, e) => Ft(t, e, _t, 15, 8, ht), + deflateInit2: Ft, + deflateReset: It, + deflateResetKeep: Ot, + deflateSetHeader: (t, e) => + t && t.state + ? 2 !== t.state.wrap + ? et + : ((t.state.gzhead = e), $) + : et, + deflate: (t, e) => { + let a, i; + if (!t || !t.state || e > V || e < 0) + return t ? gt(t, et) : et; + const n = t.state; + if ( + !t.output || + (!t.input && 0 !== t.avail_in) || + (n.status === bt && e !== Q) + ) + return gt(t, 0 === t.avail_out ? it : et); + n.strm = t; + const s = n.last_flush; + if (((n.last_flush = e), 42 === n.status)) + if (2 === n.wrap) + (t.adler = 0), + xt(n, 31), + xt(n, 139), + xt(n, 8), + n.gzhead + ? (xt( + n, + (n.gzhead.text ? 1 : 0) + + (n.gzhead.hcrc ? 2 : 0) + + (n.gzhead.extra ? 4 : 0) + + (n.gzhead.name ? 8 : 0) + + (n.gzhead.comment ? 16 : 0) + ), + xt(n, 255 & n.gzhead.time), + xt(n, (n.gzhead.time >> 8) & 255), + xt(n, (n.gzhead.time >> 16) & 255), + xt(n, (n.gzhead.time >> 24) & 255), + xt( + n, + 9 === n.level + ? 2 + : n.strategy >= rt || n.level < 2 + ? 4 + : 0 + ), + xt(n, 255 & n.gzhead.os), + n.gzhead.extra && + n.gzhead.extra.length && + (xt(n, 255 & n.gzhead.extra.length), + xt(n, (n.gzhead.extra.length >> 8) & 255)), + n.gzhead.hcrc && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending, + 0 + )), + (n.gzindex = 0), + (n.status = 69)) + : (xt(n, 0), + xt(n, 0), + xt(n, 0), + xt(n, 0), + xt(n, 0), + xt( + n, + 9 === n.level + ? 2 + : n.strategy >= rt || n.level < 2 + ? 4 + : 0 + ), + xt(n, 3), + (n.status = wt)); + else { + let e = (_t + ((n.w_bits - 8) << 4)) << 8, + a = -1; + (a = + n.strategy >= rt || n.level < 2 + ? 0 + : n.level < 6 + ? 1 + : 6 === n.level + ? 2 + : 3), + (e |= a << 6), + 0 !== n.strstart && (e |= 32), + (e += 31 - (e % 31)), + (n.status = wt), + zt(n, e), + 0 !== n.strstart && + (zt(n, t.adler >>> 16), zt(n, 65535 & t.adler)), + (t.adler = 1); + } + if (69 === n.status) + if (n.gzhead.extra) { + for ( + a = n.pending; + n.gzindex < (65535 & n.gzhead.extra.length) && + (n.pending !== n.pending_buf_size || + (n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + vt(t), + (a = n.pending), + n.pending !== n.pending_buf_size)); + + ) + xt(n, 255 & n.gzhead.extra[n.gzindex]), n.gzindex++; + n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + n.gzindex === n.gzhead.extra.length && + ((n.gzindex = 0), (n.status = 73)); + } else n.status = 73; + if (73 === n.status) + if (n.gzhead.name) { + a = n.pending; + do { + if ( + n.pending === n.pending_buf_size && + (n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + vt(t), + (a = n.pending), + n.pending === n.pending_buf_size) + ) { + i = 1; + break; + } + (i = + n.gzindex < n.gzhead.name.length + ? 255 & n.gzhead.name.charCodeAt(n.gzindex++) + : 0), + xt(n, i); + } while (0 !== i); + n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + 0 === i && ((n.gzindex = 0), (n.status = 91)); + } else n.status = 91; + if (91 === n.status) + if (n.gzhead.comment) { + a = n.pending; + do { + if ( + n.pending === n.pending_buf_size && + (n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + vt(t), + (a = n.pending), + n.pending === n.pending_buf_size) + ) { + i = 1; + break; + } + (i = + n.gzindex < n.gzhead.comment.length + ? 255 & n.gzhead.comment.charCodeAt(n.gzindex++) + : 0), + xt(n, i); + } while (0 !== i); + n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + 0 === i && (n.status = ut); + } else n.status = ut; + if ( + (n.status === ut && + (n.gzhead.hcrc + ? (n.pending + 2 > n.pending_buf_size && vt(t), + n.pending + 2 <= n.pending_buf_size && + (xt(n, 255 & t.adler), + xt(n, (t.adler >> 8) & 255), + (t.adler = 0), + (n.status = wt))) + : (n.status = wt)), + 0 !== n.pending) + ) { + if ((vt(t), 0 === t.avail_out)) + return (n.last_flush = -1), $; + } else if (0 === t.avail_in && pt(e) <= pt(s) && e !== Q) + return gt(t, it); + if (n.status === bt && 0 !== t.avail_in) return gt(t, it); + if ( + 0 !== t.avail_in || + 0 !== n.lookahead || + (e !== W && n.status !== bt) + ) { + let a = + n.strategy === rt + ? ((t, e) => { + let a; + for (;;) { + if ( + 0 === t.lookahead && + (Rt(t), 0 === t.lookahead) + ) { + if (e === W) return 1; + break; + } + if ( + ((t.match_length = 0), + (a = G(t, 0, t.window[t.strstart])), + t.lookahead--, + t.strstart++, + a && (yt(t, !1), 0 === t.strm.avail_out)) + ) + return 1; + } + return ( + (t.insert = 0), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && + (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + })(n, e) + : n.strategy === lt + ? ((t, e) => { + let a, i, n, s; + const r = t.window; + for (;;) { + if (t.lookahead <= ft) { + if ((Rt(t), t.lookahead <= ft && e === W)) + return 1; + if (0 === t.lookahead) break; + } + if ( + ((t.match_length = 0), + t.lookahead >= 3 && + t.strstart > 0 && + ((n = t.strstart - 1), + (i = r[n]), + i === r[++n] && + i === r[++n] && + i === r[++n])) + ) { + s = t.strstart + ft; + do {} while ( + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + n < s + ); + (t.match_length = ft - (s - n)), + t.match_length > t.lookahead && + (t.match_length = t.lookahead); + } + if ( + (t.match_length >= 3 + ? ((a = G(t, 1, t.match_length - 3)), + (t.lookahead -= t.match_length), + (t.strstart += t.match_length), + (t.match_length = 0)) + : ((a = G(t, 0, t.window[t.strstart])), + t.lookahead--, + t.strstart++), + a && (yt(t, !1), 0 === t.strm.avail_out)) + ) + return 1; + } + return ( + (t.insert = 0), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && + (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + })(n, e) + : Dt[n.level].func(n, e); + if ( + ((3 !== a && 4 !== a) || (n.status = bt), + 1 === a || 3 === a) + ) + return 0 === t.avail_out && (n.last_flush = -1), $; + if ( + 2 === a && + (e === q + ? X(n) + : e !== V && + (P(n, 0, 0, !1), + e === J && + (mt(n.head), + 0 === n.lookahead && + ((n.strstart = 0), + (n.block_start = 0), + (n.insert = 0)))), + vt(t), + 0 === t.avail_out) + ) + return (n.last_flush = -1), $; + } + return e !== Q + ? $ + : n.wrap <= 0 + ? tt + : (2 === n.wrap + ? (xt(n, 255 & t.adler), + xt(n, (t.adler >> 8) & 255), + xt(n, (t.adler >> 16) & 255), + xt(n, (t.adler >> 24) & 255), + xt(n, 255 & t.total_in), + xt(n, (t.total_in >> 8) & 255), + xt(n, (t.total_in >> 16) & 255), + xt(n, (t.total_in >> 24) & 255)) + : (zt(n, t.adler >>> 16), zt(n, 65535 & t.adler)), + vt(t), + n.wrap > 0 && (n.wrap = -n.wrap), + 0 !== n.pending ? $ : tt); + }, + deflateEnd: (t) => { + if (!t || !t.state) return et; + const e = t.state.status; + return 42 !== e && + 69 !== e && + 73 !== e && + 91 !== e && + e !== ut && + e !== wt && + e !== bt + ? gt(t, et) + : ((t.state = null), e === wt ? gt(t, at) : $); + }, + deflateSetDictionary: (t, e) => { + let a = e.length; + if (!t || !t.state) return et; + const i = t.state, + n = i.wrap; + if (2 === n || (1 === n && 42 !== i.status) || i.lookahead) + return et; + if ( + (1 === n && (t.adler = B(t.adler, e, a, 0)), + (i.wrap = 0), + a >= i.w_size) + ) { + 0 === n && + (mt(i.head), + (i.strstart = 0), + (i.block_start = 0), + (i.insert = 0)); + let t = new Uint8Array(i.w_size); + t.set(e.subarray(a - i.w_size, a), 0), + (e = t), + (a = i.w_size); + } + const s = t.avail_in, + r = t.next_in, + l = t.input; + for ( + t.avail_in = a, t.next_in = 0, t.input = e, Rt(i); + i.lookahead >= 3; + + ) { + let t = i.strstart, + e = i.lookahead - 2; + do { + (i.ins_h = kt(i, i.ins_h, i.window[t + 3 - 1])), + (i.prev[t & i.w_mask] = i.head[i.ins_h]), + (i.head[i.ins_h] = t), + t++; + } while (--e); + (i.strstart = t), (i.lookahead = 2), Rt(i); + } + return ( + (i.strstart += i.lookahead), + (i.block_start = i.strstart), + (i.insert = i.lookahead), + (i.lookahead = 0), + (i.match_length = i.prev_length = 2), + (i.match_available = 0), + (t.next_in = r), + (t.input = l), + (t.avail_in = s), + (i.wrap = n), + $ + ); + }, + deflateInfo: 'pako deflate (from Nodeca project)', + }; + const Nt = (t, e) => Object.prototype.hasOwnProperty.call(t, e); + var Bt = function (t) { + const e = Array.prototype.slice.call(arguments, 1); + for (; e.length; ) { + const a = e.shift(); + if (a) { + if ('object' != typeof a) + throw new TypeError(a + 'must be non-object'); + for (const e in a) Nt(a, e) && (t[e] = a[e]); + } + } + return t; + }, + Ct = (t) => { + let e = 0; + for (let a = 0, i = t.length; a < i; a++) e += t[a].length; + const a = new Uint8Array(e); + for (let e = 0, i = 0, n = t.length; e < n; e++) { + let n = t[e]; + a.set(n, i), (i += n.length); + } + return a; + }; + let Mt = !0; + try { + String.fromCharCode.apply(null, new Uint8Array(1)); + } catch (t) { + Mt = !1; + } + const Ht = new Uint8Array(256); + for (let t = 0; t < 256; t++) + Ht[t] = + t >= 252 + ? 6 + : t >= 248 + ? 5 + : t >= 240 + ? 4 + : t >= 224 + ? 3 + : t >= 192 + ? 2 + : 1; + Ht[254] = Ht[254] = 1; + var jt = (t) => { + if ( + 'function' == typeof TextEncoder && + TextEncoder.prototype.encode + ) + return new TextEncoder().encode(t); + let e, + a, + i, + n, + s, + r = t.length, + l = 0; + for (n = 0; n < r; n++) + (a = t.charCodeAt(n)), + 55296 == (64512 & a) && + n + 1 < r && + ((i = t.charCodeAt(n + 1)), + 56320 == (64512 & i) && + ((a = 65536 + ((a - 55296) << 10) + (i - 56320)), + n++)), + (l += a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4); + for (e = new Uint8Array(l), s = 0, n = 0; s < l; n++) + (a = t.charCodeAt(n)), + 55296 == (64512 & a) && + n + 1 < r && + ((i = t.charCodeAt(n + 1)), + 56320 == (64512 & i) && + ((a = 65536 + ((a - 55296) << 10) + (i - 56320)), + n++)), + a < 128 + ? (e[s++] = a) + : a < 2048 + ? ((e[s++] = 192 | (a >>> 6)), + (e[s++] = 128 | (63 & a))) + : a < 65536 + ? ((e[s++] = 224 | (a >>> 12)), + (e[s++] = 128 | ((a >>> 6) & 63)), + (e[s++] = 128 | (63 & a))) + : ((e[s++] = 240 | (a >>> 18)), + (e[s++] = 128 | ((a >>> 12) & 63)), + (e[s++] = 128 | ((a >>> 6) & 63)), + (e[s++] = 128 | (63 & a))); + return e; + }, + Kt = (t, e) => { + const a = e || t.length; + if ( + 'function' == typeof TextDecoder && + TextDecoder.prototype.decode + ) + return new TextDecoder().decode(t.subarray(0, e)); + let i, n; + const s = new Array(2 * a); + for (n = 0, i = 0; i < a; ) { + let e = t[i++]; + if (e < 128) { + s[n++] = e; + continue; + } + let r = Ht[e]; + if (r > 4) (s[n++] = 65533), (i += r - 1); + else { + for ( + e &= 2 === r ? 31 : 3 === r ? 15 : 7; + r > 1 && i < a; + + ) + (e = (e << 6) | (63 & t[i++])), r--; + r > 1 + ? (s[n++] = 65533) + : e < 65536 + ? (s[n++] = e) + : ((e -= 65536), + (s[n++] = 55296 | ((e >> 10) & 1023)), + (s[n++] = 56320 | (1023 & e))); + } + } + return ((t, e) => { + if (e < 65534 && t.subarray && Mt) + return String.fromCharCode.apply( + null, + t.length === e ? t : t.subarray(0, e) + ); + let a = ''; + for (let i = 0; i < e; i++) + a += String.fromCharCode(t[i]); + return a; + })(s, n); + }, + Pt = (t, e) => { + (e = e || t.length) > t.length && (e = t.length); + let a = e - 1; + for (; a >= 0 && 128 == (192 & t[a]); ) a--; + return a < 0 || 0 === a ? e : a + Ht[t[a]] > e ? a : e; + }; + var Yt = function () { + (this.input = null), + (this.next_in = 0), + (this.avail_in = 0), + (this.total_in = 0), + (this.output = null), + (this.next_out = 0), + (this.avail_out = 0), + (this.total_out = 0), + (this.msg = ''), + (this.state = null), + (this.data_type = 2), + (this.adler = 0); + }; + const Gt = Object.prototype.toString, + { + Z_NO_FLUSH: Xt, + Z_SYNC_FLUSH: Wt, + Z_FULL_FLUSH: qt, + Z_FINISH: Jt, + Z_OK: Qt, + Z_STREAM_END: Vt, + Z_DEFAULT_COMPRESSION: $t, + Z_DEFAULT_STRATEGY: te, + Z_DEFLATED: ee, + } = j; + function ae(t) { + this.options = Bt( + { + level: $t, + method: ee, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: te, + }, + t || {} + ); + let e = this.options; + e.raw && e.windowBits > 0 + ? (e.windowBits = -e.windowBits) + : e.gzip && + e.windowBits > 0 && + e.windowBits < 16 && + (e.windowBits += 16), + (this.err = 0), + (this.msg = ''), + (this.ended = !1), + (this.chunks = []), + (this.strm = new Yt()), + (this.strm.avail_out = 0); + let a = Lt.deflateInit2( + this.strm, + e.level, + e.method, + e.windowBits, + e.memLevel, + e.strategy + ); + if (a !== Qt) throw new Error(H[a]); + if ( + (e.header && Lt.deflateSetHeader(this.strm, e.header), + e.dictionary) + ) { + let t; + if ( + ((t = + 'string' == typeof e.dictionary + ? jt(e.dictionary) + : '[object ArrayBuffer]' === Gt.call(e.dictionary) + ? new Uint8Array(e.dictionary) + : e.dictionary), + (a = Lt.deflateSetDictionary(this.strm, t)), + a !== Qt) + ) + throw new Error(H[a]); + this._dict_set = !0; + } + } + function ie(t, e) { + const a = new ae(e); + if ((a.push(t, !0), a.err)) throw a.msg || H[a.err]; + return a.result; + } + (ae.prototype.push = function (t, e) { + const a = this.strm, + i = this.options.chunkSize; + let n, s; + if (this.ended) return !1; + for ( + s = e === ~~e ? e : !0 === e ? Jt : Xt, + 'string' == typeof t + ? (a.input = jt(t)) + : '[object ArrayBuffer]' === Gt.call(t) + ? (a.input = new Uint8Array(t)) + : (a.input = t), + a.next_in = 0, + a.avail_in = a.input.length; + ; + + ) + if ( + (0 === a.avail_out && + ((a.output = new Uint8Array(i)), + (a.next_out = 0), + (a.avail_out = i)), + (s === Wt || s === qt) && a.avail_out <= 6) + ) + this.onData(a.output.subarray(0, a.next_out)), + (a.avail_out = 0); + else { + if (((n = Lt.deflate(a, s)), n === Vt)) + return ( + a.next_out > 0 && + this.onData(a.output.subarray(0, a.next_out)), + (n = Lt.deflateEnd(this.strm)), + this.onEnd(n), + (this.ended = !0), + n === Qt + ); + if (0 !== a.avail_out) { + if (s > 0 && a.next_out > 0) + this.onData(a.output.subarray(0, a.next_out)), + (a.avail_out = 0); + else if (0 === a.avail_in) break; + } else this.onData(a.output); + } + return !0; + }), + (ae.prototype.onData = function (t) { + this.chunks.push(t); + }), + (ae.prototype.onEnd = function (t) { + t === Qt && (this.result = Ct(this.chunks)), + (this.chunks = []), + (this.err = t), + (this.msg = this.strm.msg); + }); + var ne = { + Deflate: ae, + deflate: ie, + deflateRaw: function (t, e) { + return ((e = e || {}).raw = !0), ie(t, e); + }, + gzip: function (t, e) { + return ((e = e || {}).gzip = !0), ie(t, e); + }, + constants: j, + }; + var se = function (t, e) { + let a, + i, + n, + s, + r, + l, + o, + h, + d, + _, + f, + c, + u, + w, + b, + g, + p, + m, + k, + v, + y, + x, + z, + A; + const E = t.state; + (a = t.next_in), + (z = t.input), + (i = a + (t.avail_in - 5)), + (n = t.next_out), + (A = t.output), + (s = n - (e - t.avail_out)), + (r = n + (t.avail_out - 257)), + (l = E.dmax), + (o = E.wsize), + (h = E.whave), + (d = E.wnext), + (_ = E.window), + (f = E.hold), + (c = E.bits), + (u = E.lencode), + (w = E.distcode), + (b = (1 << E.lenbits) - 1), + (g = (1 << E.distbits) - 1); + t: do { + c < 15 && + ((f += z[a++] << c), + (c += 8), + (f += z[a++] << c), + (c += 8)), + (p = u[f & b]); + e: for (;;) { + if ( + ((m = p >>> 24), + (f >>>= m), + (c -= m), + (m = (p >>> 16) & 255), + 0 === m) + ) + A[n++] = 65535 & p; + else { + if (!(16 & m)) { + if (0 == (64 & m)) { + p = u[(65535 & p) + (f & ((1 << m) - 1))]; + continue e; + } + if (32 & m) { + E.mode = 12; + break t; + } + (t.msg = 'invalid literal/length code'), + (E.mode = 30); + break t; + } + (k = 65535 & p), + (m &= 15), + m && + (c < m && ((f += z[a++] << c), (c += 8)), + (k += f & ((1 << m) - 1)), + (f >>>= m), + (c -= m)), + c < 15 && + ((f += z[a++] << c), + (c += 8), + (f += z[a++] << c), + (c += 8)), + (p = w[f & g]); + a: for (;;) { + if ( + ((m = p >>> 24), + (f >>>= m), + (c -= m), + (m = (p >>> 16) & 255), + !(16 & m)) + ) { + if (0 == (64 & m)) { + p = w[(65535 & p) + (f & ((1 << m) - 1))]; + continue a; + } + (t.msg = 'invalid distance code'), (E.mode = 30); + break t; + } + if ( + ((v = 65535 & p), + (m &= 15), + c < m && + ((f += z[a++] << c), + (c += 8), + c < m && ((f += z[a++] << c), (c += 8))), + (v += f & ((1 << m) - 1)), + v > l) + ) { + (t.msg = 'invalid distance too far back'), + (E.mode = 30); + break t; + } + if (((f >>>= m), (c -= m), (m = n - s), v > m)) { + if (((m = v - m), m > h && E.sane)) { + (t.msg = 'invalid distance too far back'), + (E.mode = 30); + break t; + } + if (((y = 0), (x = _), 0 === d)) { + if (((y += o - m), m < k)) { + k -= m; + do { + A[n++] = _[y++]; + } while (--m); + (y = n - v), (x = A); + } + } else if (d < m) { + if (((y += o + d - m), (m -= d), m < k)) { + k -= m; + do { + A[n++] = _[y++]; + } while (--m); + if (((y = 0), d < k)) { + (m = d), (k -= m); + do { + A[n++] = _[y++]; + } while (--m); + (y = n - v), (x = A); + } + } + } else if (((y += d - m), m < k)) { + k -= m; + do { + A[n++] = _[y++]; + } while (--m); + (y = n - v), (x = A); + } + for (; k > 2; ) + (A[n++] = x[y++]), + (A[n++] = x[y++]), + (A[n++] = x[y++]), + (k -= 3); + k && + ((A[n++] = x[y++]), k > 1 && (A[n++] = x[y++])); + } else { + y = n - v; + do { + (A[n++] = A[y++]), + (A[n++] = A[y++]), + (A[n++] = A[y++]), + (k -= 3); + } while (k > 2); + k && + ((A[n++] = A[y++]), k > 1 && (A[n++] = A[y++])); + } + break; + } + } + break; + } + } while (a < i && n < r); + (k = c >> 3), + (a -= k), + (c -= k << 3), + (f &= (1 << c) - 1), + (t.next_in = a), + (t.next_out = n), + (t.avail_in = a < i ? i - a + 5 : 5 - (a - i)), + (t.avail_out = n < r ? r - n + 257 : 257 - (n - r)), + (E.hold = f), + (E.bits = c); + }; + const re = 15, + le = new Uint16Array([ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, + 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0, + ]), + oe = new Uint8Array([ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, + 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, + 78, + ]), + he = new Uint16Array([ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0, + ]), + de = new Uint8Array([ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, + 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, + 64, 64, + ]); + var _e = (t, e, a, i, n, s, r, l) => { + const o = l.bits; + let h, + d, + _, + f, + c, + u, + w = 0, + b = 0, + g = 0, + p = 0, + m = 0, + k = 0, + v = 0, + y = 0, + x = 0, + z = 0, + A = null, + E = 0; + const R = new Uint16Array(16), + Z = new Uint16Array(16); + let U, + S, + D, + T = null, + O = 0; + for (w = 0; w <= re; w++) R[w] = 0; + for (b = 0; b < i; b++) R[e[a + b]]++; + for (m = o, p = re; p >= 1 && 0 === R[p]; p--); + if ((m > p && (m = p), 0 === p)) + return ( + (n[s++] = 20971520), (n[s++] = 20971520), (l.bits = 1), 0 + ); + for (g = 1; g < p && 0 === R[g]; g++); + for (m < g && (m = g), y = 1, w = 1; w <= re; w++) + if (((y <<= 1), (y -= R[w]), y < 0)) return -1; + if (y > 0 && (0 === t || 1 !== p)) return -1; + for (Z[1] = 0, w = 1; w < re; w++) Z[w + 1] = Z[w] + R[w]; + for (b = 0; b < i; b++) + 0 !== e[a + b] && (r[Z[e[a + b]]++] = b); + if ( + (0 === t + ? ((A = T = r), (u = 19)) + : 1 === t + ? ((A = le), (E -= 257), (T = oe), (O -= 257), (u = 256)) + : ((A = he), (T = de), (u = -1)), + (z = 0), + (b = 0), + (w = g), + (c = s), + (k = m), + (v = 0), + (_ = -1), + (x = 1 << m), + (f = x - 1), + (1 === t && x > 852) || (2 === t && x > 592)) + ) + return 1; + for (;;) { + (U = w - v), + r[b] < u + ? ((S = 0), (D = r[b])) + : r[b] > u + ? ((S = T[O + r[b]]), (D = A[E + r[b]])) + : ((S = 96), (D = 0)), + (h = 1 << (w - v)), + (d = 1 << k), + (g = d); + do { + (d -= h), + (n[c + (z >> v) + d] = (U << 24) | (S << 16) | D | 0); + } while (0 !== d); + for (h = 1 << (w - 1); z & h; ) h >>= 1; + if ( + (0 !== h ? ((z &= h - 1), (z += h)) : (z = 0), + b++, + 0 == --R[w]) + ) { + if (w === p) break; + w = e[a + r[b]]; + } + if (w > m && (z & f) !== _) { + for ( + 0 === v && (v = m), c += g, k = w - v, y = 1 << k; + k + v < p && ((y -= R[k + v]), !(y <= 0)); + + ) + k++, (y <<= 1); + if ( + ((x += 1 << k), + (1 === t && x > 852) || (2 === t && x > 592)) + ) + return 1; + (_ = z & f), (n[_] = (m << 24) | (k << 16) | (c - s) | 0); + } + } + return ( + 0 !== z && (n[c + z] = ((w - v) << 24) | (64 << 16) | 0), + (l.bits = m), + 0 + ); + }; + const { + Z_FINISH: fe, + Z_BLOCK: ce, + Z_TREES: ue, + Z_OK: we, + Z_STREAM_END: be, + Z_NEED_DICT: ge, + Z_STREAM_ERROR: pe, + Z_DATA_ERROR: me, + Z_MEM_ERROR: ke, + Z_BUF_ERROR: ve, + Z_DEFLATED: ye, + } = j, + xe = 12, + ze = 30, + Ae = (t) => + ((t >>> 24) & 255) + + ((t >>> 8) & 65280) + + ((65280 & t) << 8) + + ((255 & t) << 24); + function Ee() { + (this.mode = 0), + (this.last = !1), + (this.wrap = 0), + (this.havedict = !1), + (this.flags = 0), + (this.dmax = 0), + (this.check = 0), + (this.total = 0), + (this.head = null), + (this.wbits = 0), + (this.wsize = 0), + (this.whave = 0), + (this.wnext = 0), + (this.window = null), + (this.hold = 0), + (this.bits = 0), + (this.length = 0), + (this.offset = 0), + (this.extra = 0), + (this.lencode = null), + (this.distcode = null), + (this.lenbits = 0), + (this.distbits = 0), + (this.ncode = 0), + (this.nlen = 0), + (this.ndist = 0), + (this.have = 0), + (this.next = null), + (this.lens = new Uint16Array(320)), + (this.work = new Uint16Array(288)), + (this.lendyn = null), + (this.distdyn = null), + (this.sane = 0), + (this.back = 0), + (this.was = 0); + } + const Re = (t) => { + if (!t || !t.state) return pe; + const e = t.state; + return ( + (t.total_in = t.total_out = e.total = 0), + (t.msg = ''), + e.wrap && (t.adler = 1 & e.wrap), + (e.mode = 1), + (e.last = 0), + (e.havedict = 0), + (e.dmax = 32768), + (e.head = null), + (e.hold = 0), + (e.bits = 0), + (e.lencode = e.lendyn = new Int32Array(852)), + (e.distcode = e.distdyn = new Int32Array(592)), + (e.sane = 1), + (e.back = -1), + we + ); + }, + Ze = (t) => { + if (!t || !t.state) return pe; + const e = t.state; + return (e.wsize = 0), (e.whave = 0), (e.wnext = 0), Re(t); + }, + Ue = (t, e) => { + let a; + if (!t || !t.state) return pe; + const i = t.state; + return ( + e < 0 + ? ((a = 0), (e = -e)) + : ((a = 1 + (e >> 4)), e < 48 && (e &= 15)), + e && (e < 8 || e > 15) + ? pe + : (null !== i.window && + i.wbits !== e && + (i.window = null), + (i.wrap = a), + (i.wbits = e), + Ze(t)) + ); + }, + Se = (t, e) => { + if (!t) return pe; + const a = new Ee(); + (t.state = a), (a.window = null); + const i = Ue(t, e); + return i !== we && (t.state = null), i; + }; + let De, + Te, + Oe = !0; + const Ie = (t) => { + if (Oe) { + (De = new Int32Array(512)), (Te = new Int32Array(32)); + let e = 0; + for (; e < 144; ) t.lens[e++] = 8; + for (; e < 256; ) t.lens[e++] = 9; + for (; e < 280; ) t.lens[e++] = 7; + for (; e < 288; ) t.lens[e++] = 8; + for ( + _e(1, t.lens, 0, 288, De, 0, t.work, { bits: 9 }), + e = 0; + e < 32; + + ) + t.lens[e++] = 5; + _e(2, t.lens, 0, 32, Te, 0, t.work, { bits: 5 }), + (Oe = !1); + } + (t.lencode = De), + (t.lenbits = 9), + (t.distcode = Te), + (t.distbits = 5); + }, + Fe = (t, e, a, i) => { + let n; + const s = t.state; + return ( + null === s.window && + ((s.wsize = 1 << s.wbits), + (s.wnext = 0), + (s.whave = 0), + (s.window = new Uint8Array(s.wsize))), + i >= s.wsize + ? (s.window.set(e.subarray(a - s.wsize, a), 0), + (s.wnext = 0), + (s.whave = s.wsize)) + : ((n = s.wsize - s.wnext), + n > i && (n = i), + s.window.set(e.subarray(a - i, a - i + n), s.wnext), + (i -= n) + ? (s.window.set(e.subarray(a - i, a), 0), + (s.wnext = i), + (s.whave = s.wsize)) + : ((s.wnext += n), + s.wnext === s.wsize && (s.wnext = 0), + s.whave < s.wsize && (s.whave += n))), + 0 + ); + }; + var Le = { + inflateReset: Ze, + inflateReset2: Ue, + inflateResetKeep: Re, + inflateInit: (t) => Se(t, 15), + inflateInit2: Se, + inflate: (t, e) => { + let a, + i, + n, + s, + r, + l, + o, + h, + d, + _, + f, + c, + u, + w, + b, + g, + p, + m, + k, + v, + y, + x, + z = 0; + const A = new Uint8Array(4); + let E, R; + const Z = new Uint8Array([ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, + 1, 15, + ]); + if ( + !t || + !t.state || + !t.output || + (!t.input && 0 !== t.avail_in) + ) + return pe; + (a = t.state), + a.mode === xe && (a.mode = 13), + (r = t.next_out), + (n = t.output), + (o = t.avail_out), + (s = t.next_in), + (i = t.input), + (l = t.avail_in), + (h = a.hold), + (d = a.bits), + (_ = l), + (f = o), + (x = we); + t: for (;;) + switch (a.mode) { + case 1: + if (0 === a.wrap) { + a.mode = 13; + break; + } + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (2 & a.wrap && 35615 === h) { + (a.check = 0), + (A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0)), + (h = 0), + (d = 0), + (a.mode = 2); + break; + } + if ( + ((a.flags = 0), + a.head && (a.head.done = !1), + !(1 & a.wrap) || (((255 & h) << 8) + (h >> 8)) % 31) + ) { + (t.msg = 'incorrect header check'), (a.mode = ze); + break; + } + if ((15 & h) !== ye) { + (t.msg = 'unknown compression method'), + (a.mode = ze); + break; + } + if ( + ((h >>>= 4), + (d -= 4), + (y = 8 + (15 & h)), + 0 === a.wbits) + ) + a.wbits = y; + else if (y > a.wbits) { + (t.msg = 'invalid window size'), (a.mode = ze); + break; + } + (a.dmax = 1 << a.wbits), + (t.adler = a.check = 1), + (a.mode = 512 & h ? 10 : xe), + (h = 0), + (d = 0); + break; + case 2: + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (((a.flags = h), (255 & a.flags) !== ye)) { + (t.msg = 'unknown compression method'), + (a.mode = ze); + break; + } + if (57344 & a.flags) { + (t.msg = 'unknown header flags set'), (a.mode = ze); + break; + } + a.head && (a.head.text = (h >> 8) & 1), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0))), + (h = 0), + (d = 0), + (a.mode = 3); + case 3: + for (; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + a.head && (a.head.time = h), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (A[2] = (h >>> 16) & 255), + (A[3] = (h >>> 24) & 255), + (a.check = M(a.check, A, 4, 0))), + (h = 0), + (d = 0), + (a.mode = 4); + case 4: + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + a.head && + ((a.head.xflags = 255 & h), (a.head.os = h >> 8)), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0))), + (h = 0), + (d = 0), + (a.mode = 5); + case 5: + if (1024 & a.flags) { + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.length = h), + a.head && (a.head.extra_len = h), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0))), + (h = 0), + (d = 0); + } else a.head && (a.head.extra = null); + a.mode = 6; + case 6: + if ( + 1024 & a.flags && + ((c = a.length), + c > l && (c = l), + c && + (a.head && + ((y = a.head.extra_len - a.length), + a.head.extra || + (a.head.extra = new Uint8Array( + a.head.extra_len + )), + a.head.extra.set(i.subarray(s, s + c), y)), + 512 & a.flags && (a.check = M(a.check, i, c, s)), + (l -= c), + (s += c), + (a.length -= c)), + a.length) + ) + break t; + (a.length = 0), (a.mode = 7); + case 7: + if (2048 & a.flags) { + if (0 === l) break t; + c = 0; + do { + (y = i[s + c++]), + a.head && + y && + a.length < 65536 && + (a.head.name += String.fromCharCode(y)); + } while (y && c < l); + if ( + (512 & a.flags && (a.check = M(a.check, i, c, s)), + (l -= c), + (s += c), + y) + ) + break t; + } else a.head && (a.head.name = null); + (a.length = 0), (a.mode = 8); + case 8: + if (4096 & a.flags) { + if (0 === l) break t; + c = 0; + do { + (y = i[s + c++]), + a.head && + y && + a.length < 65536 && + (a.head.comment += String.fromCharCode(y)); + } while (y && c < l); + if ( + (512 & a.flags && (a.check = M(a.check, i, c, s)), + (l -= c), + (s += c), + y) + ) + break t; + } else a.head && (a.head.comment = null); + a.mode = 9; + case 9: + if (512 & a.flags) { + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (h !== (65535 & a.check)) { + (t.msg = 'header crc mismatch'), (a.mode = ze); + break; + } + (h = 0), (d = 0); + } + a.head && + ((a.head.hcrc = (a.flags >> 9) & 1), + (a.head.done = !0)), + (t.adler = a.check = 0), + (a.mode = xe); + break; + case 10: + for (; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (t.adler = a.check = Ae(h)), + (h = 0), + (d = 0), + (a.mode = 11); + case 11: + if (0 === a.havedict) + return ( + (t.next_out = r), + (t.avail_out = o), + (t.next_in = s), + (t.avail_in = l), + (a.hold = h), + (a.bits = d), + ge + ); + (t.adler = a.check = 1), (a.mode = xe); + case xe: + if (e === ce || e === ue) break t; + case 13: + if (a.last) { + (h >>>= 7 & d), (d -= 7 & d), (a.mode = 27); + break; + } + for (; d < 3; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + switch ( + ((a.last = 1 & h), (h >>>= 1), (d -= 1), 3 & h) + ) { + case 0: + a.mode = 14; + break; + case 1: + if ((Ie(a), (a.mode = 20), e === ue)) { + (h >>>= 2), (d -= 2); + break t; + } + break; + case 2: + a.mode = 17; + break; + case 3: + (t.msg = 'invalid block type'), (a.mode = ze); + } + (h >>>= 2), (d -= 2); + break; + case 14: + for (h >>>= 7 & d, d -= 7 & d; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if ((65535 & h) != ((h >>> 16) ^ 65535)) { + (t.msg = 'invalid stored block lengths'), + (a.mode = ze); + break; + } + if ( + ((a.length = 65535 & h), + (h = 0), + (d = 0), + (a.mode = 15), + e === ue) + ) + break t; + case 15: + a.mode = 16; + case 16: + if (((c = a.length), c)) { + if ((c > l && (c = l), c > o && (c = o), 0 === c)) + break t; + n.set(i.subarray(s, s + c), r), + (l -= c), + (s += c), + (o -= c), + (r += c), + (a.length -= c); + break; + } + a.mode = xe; + break; + case 17: + for (; d < 14; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if ( + ((a.nlen = 257 + (31 & h)), + (h >>>= 5), + (d -= 5), + (a.ndist = 1 + (31 & h)), + (h >>>= 5), + (d -= 5), + (a.ncode = 4 + (15 & h)), + (h >>>= 4), + (d -= 4), + a.nlen > 286 || a.ndist > 30) + ) { + (t.msg = 'too many length or distance symbols'), + (a.mode = ze); + break; + } + (a.have = 0), (a.mode = 18); + case 18: + for (; a.have < a.ncode; ) { + for (; d < 3; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.lens[Z[a.have++]] = 7 & h), (h >>>= 3), (d -= 3); + } + for (; a.have < 19; ) a.lens[Z[a.have++]] = 0; + if ( + ((a.lencode = a.lendyn), + (a.lenbits = 7), + (E = { bits: a.lenbits }), + (x = _e(0, a.lens, 0, 19, a.lencode, 0, a.work, E)), + (a.lenbits = E.bits), + x) + ) { + (t.msg = 'invalid code lengths set'), (a.mode = ze); + break; + } + (a.have = 0), (a.mode = 19); + case 19: + for (; a.have < a.nlen + a.ndist; ) { + for ( + ; + (z = a.lencode[h & ((1 << a.lenbits) - 1)]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (p < 16) + (h >>>= b), (d -= b), (a.lens[a.have++] = p); + else { + if (16 === p) { + for (R = b + 2; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (((h >>>= b), (d -= b), 0 === a.have)) { + (t.msg = 'invalid bit length repeat'), + (a.mode = ze); + break; + } + (y = a.lens[a.have - 1]), + (c = 3 + (3 & h)), + (h >>>= 2), + (d -= 2); + } else if (17 === p) { + for (R = b + 3; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= b), + (d -= b), + (y = 0), + (c = 3 + (7 & h)), + (h >>>= 3), + (d -= 3); + } else { + for (R = b + 7; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= b), + (d -= b), + (y = 0), + (c = 11 + (127 & h)), + (h >>>= 7), + (d -= 7); + } + if (a.have + c > a.nlen + a.ndist) { + (t.msg = 'invalid bit length repeat'), + (a.mode = ze); + break; + } + for (; c--; ) a.lens[a.have++] = y; + } + } + if (a.mode === ze) break; + if (0 === a.lens[256]) { + (t.msg = 'invalid code -- missing end-of-block'), + (a.mode = ze); + break; + } + if ( + ((a.lenbits = 9), + (E = { bits: a.lenbits }), + (x = _e( + 1, + a.lens, + 0, + a.nlen, + a.lencode, + 0, + a.work, + E + )), + (a.lenbits = E.bits), + x) + ) { + (t.msg = 'invalid literal/lengths set'), + (a.mode = ze); + break; + } + if ( + ((a.distbits = 6), + (a.distcode = a.distdyn), + (E = { bits: a.distbits }), + (x = _e( + 2, + a.lens, + a.nlen, + a.ndist, + a.distcode, + 0, + a.work, + E + )), + (a.distbits = E.bits), + x) + ) { + (t.msg = 'invalid distances set'), (a.mode = ze); + break; + } + if (((a.mode = 20), e === ue)) break t; + case 20: + a.mode = 21; + case 21: + if (l >= 6 && o >= 258) { + (t.next_out = r), + (t.avail_out = o), + (t.next_in = s), + (t.avail_in = l), + (a.hold = h), + (a.bits = d), + se(t, f), + (r = t.next_out), + (n = t.output), + (o = t.avail_out), + (s = t.next_in), + (i = t.input), + (l = t.avail_in), + (h = a.hold), + (d = a.bits), + a.mode === xe && (a.back = -1); + break; + } + for ( + a.back = 0; + (z = a.lencode[h & ((1 << a.lenbits) - 1)]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (g && 0 == (240 & g)) { + for ( + m = b, k = g, v = p; + (z = + a.lencode[ + v + ((h & ((1 << (m + k)) - 1)) >> m) + ]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(m + b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= m), (d -= m), (a.back += m); + } + if ( + ((h >>>= b), + (d -= b), + (a.back += b), + (a.length = p), + 0 === g) + ) { + a.mode = 26; + break; + } + if (32 & g) { + (a.back = -1), (a.mode = xe); + break; + } + if (64 & g) { + (t.msg = 'invalid literal/length code'), + (a.mode = ze); + break; + } + (a.extra = 15 & g), (a.mode = 22); + case 22: + if (a.extra) { + for (R = a.extra; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.length += h & ((1 << a.extra) - 1)), + (h >>>= a.extra), + (d -= a.extra), + (a.back += a.extra); + } + (a.was = a.length), (a.mode = 23); + case 23: + for ( + ; + (z = a.distcode[h & ((1 << a.distbits) - 1)]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (0 == (240 & g)) { + for ( + m = b, k = g, v = p; + (z = + a.distcode[ + v + ((h & ((1 << (m + k)) - 1)) >> m) + ]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(m + b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= m), (d -= m), (a.back += m); + } + if (((h >>>= b), (d -= b), (a.back += b), 64 & g)) { + (t.msg = 'invalid distance code'), (a.mode = ze); + break; + } + (a.offset = p), (a.extra = 15 & g), (a.mode = 24); + case 24: + if (a.extra) { + for (R = a.extra; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.offset += h & ((1 << a.extra) - 1)), + (h >>>= a.extra), + (d -= a.extra), + (a.back += a.extra); + } + if (a.offset > a.dmax) { + (t.msg = 'invalid distance too far back'), + (a.mode = ze); + break; + } + a.mode = 25; + case 25: + if (0 === o) break t; + if (((c = f - o), a.offset > c)) { + if (((c = a.offset - c), c > a.whave && a.sane)) { + (t.msg = 'invalid distance too far back'), + (a.mode = ze); + break; + } + c > a.wnext + ? ((c -= a.wnext), (u = a.wsize - c)) + : (u = a.wnext - c), + c > a.length && (c = a.length), + (w = a.window); + } else (w = n), (u = r - a.offset), (c = a.length); + c > o && (c = o), (o -= c), (a.length -= c); + do { + n[r++] = w[u++]; + } while (--c); + 0 === a.length && (a.mode = 21); + break; + case 26: + if (0 === o) break t; + (n[r++] = a.length), o--, (a.mode = 21); + break; + case 27: + if (a.wrap) { + for (; d < 32; ) { + if (0 === l) break t; + l--, (h |= i[s++] << d), (d += 8); + } + if ( + ((f -= o), + (t.total_out += f), + (a.total += f), + f && + (t.adler = a.check = + a.flags + ? M(a.check, n, f, r - f) + : B(a.check, n, f, r - f)), + (f = o), + (a.flags ? h : Ae(h)) !== a.check) + ) { + (t.msg = 'incorrect data check'), (a.mode = ze); + break; + } + (h = 0), (d = 0); + } + a.mode = 28; + case 28: + if (a.wrap && a.flags) { + for (; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (h !== (4294967295 & a.total)) { + (t.msg = 'incorrect length check'), (a.mode = ze); + break; + } + (h = 0), (d = 0); + } + a.mode = 29; + case 29: + x = be; + break t; + case ze: + x = me; + break t; + case 31: + return ke; + case 32: + default: + return pe; + } + return ( + (t.next_out = r), + (t.avail_out = o), + (t.next_in = s), + (t.avail_in = l), + (a.hold = h), + (a.bits = d), + (a.wsize || + (f !== t.avail_out && + a.mode < ze && + (a.mode < 27 || e !== fe))) && + Fe(t, t.output, t.next_out, f - t.avail_out), + (_ -= t.avail_in), + (f -= t.avail_out), + (t.total_in += _), + (t.total_out += f), + (a.total += f), + a.wrap && + f && + (t.adler = a.check = + a.flags + ? M(a.check, n, f, t.next_out - f) + : B(a.check, n, f, t.next_out - f)), + (t.data_type = + a.bits + + (a.last ? 64 : 0) + + (a.mode === xe ? 128 : 0) + + (20 === a.mode || 15 === a.mode ? 256 : 0)), + ((0 === _ && 0 === f) || e === fe) && + x === we && + (x = ve), + x + ); + }, + inflateEnd: (t) => { + if (!t || !t.state) return pe; + let e = t.state; + return e.window && (e.window = null), (t.state = null), we; + }, + inflateGetHeader: (t, e) => { + if (!t || !t.state) return pe; + const a = t.state; + return 0 == (2 & a.wrap) + ? pe + : ((a.head = e), (e.done = !1), we); + }, + inflateSetDictionary: (t, e) => { + const a = e.length; + let i, n, s; + return t && t.state + ? ((i = t.state), + 0 !== i.wrap && 11 !== i.mode + ? pe + : 11 === i.mode && + ((n = 1), (n = B(n, e, a, 0)), n !== i.check) + ? me + : ((s = Fe(t, e, a, a)), + s ? ((i.mode = 31), ke) : ((i.havedict = 1), we))) + : pe; + }, + inflateInfo: 'pako inflate (from Nodeca project)', + }; + var Ne = function () { + (this.text = 0), + (this.time = 0), + (this.xflags = 0), + (this.os = 0), + (this.extra = null), + (this.extra_len = 0), + (this.name = ''), + (this.comment = ''), + (this.hcrc = 0), + (this.done = !1); + }; + const Be = Object.prototype.toString, + { + Z_NO_FLUSH: Ce, + Z_FINISH: Me, + Z_OK: He, + Z_STREAM_END: je, + Z_NEED_DICT: Ke, + Z_STREAM_ERROR: Pe, + Z_DATA_ERROR: Ye, + Z_MEM_ERROR: Ge, + } = j; + function Xe(t) { + this.options = Bt( + { chunkSize: 65536, windowBits: 15, to: '' }, + t || {} + ); + const e = this.options; + e.raw && + e.windowBits >= 0 && + e.windowBits < 16 && + ((e.windowBits = -e.windowBits), + 0 === e.windowBits && (e.windowBits = -15)), + !(e.windowBits >= 0 && e.windowBits < 16) || + (t && t.windowBits) || + (e.windowBits += 32), + e.windowBits > 15 && + e.windowBits < 48 && + 0 == (15 & e.windowBits) && + (e.windowBits |= 15), + (this.err = 0), + (this.msg = ''), + (this.ended = !1), + (this.chunks = []), + (this.strm = new Yt()), + (this.strm.avail_out = 0); + let a = Le.inflateInit2(this.strm, e.windowBits); + if (a !== He) throw new Error(H[a]); + if ( + ((this.header = new Ne()), + Le.inflateGetHeader(this.strm, this.header), + e.dictionary && + ('string' == typeof e.dictionary + ? (e.dictionary = jt(e.dictionary)) + : '[object ArrayBuffer]' === Be.call(e.dictionary) && + (e.dictionary = new Uint8Array(e.dictionary)), + e.raw && + ((a = Le.inflateSetDictionary(this.strm, e.dictionary)), + a !== He))) + ) + throw new Error(H[a]); + } + function We(t, e) { + const a = new Xe(e); + if ((a.push(t), a.err)) throw a.msg || H[a.err]; + return a.result; + } + (Xe.prototype.push = function (t, e) { + const a = this.strm, + i = this.options.chunkSize, + n = this.options.dictionary; + let s, r, l; + if (this.ended) return !1; + for ( + r = e === ~~e ? e : !0 === e ? Me : Ce, + '[object ArrayBuffer]' === Be.call(t) + ? (a.input = new Uint8Array(t)) + : (a.input = t), + a.next_in = 0, + a.avail_in = a.input.length; + ; + + ) { + for ( + 0 === a.avail_out && + ((a.output = new Uint8Array(i)), + (a.next_out = 0), + (a.avail_out = i)), + s = Le.inflate(a, r), + s === Ke && + n && + ((s = Le.inflateSetDictionary(a, n)), + s === He + ? (s = Le.inflate(a, r)) + : s === Ye && (s = Ke)); + a.avail_in > 0 && + s === je && + a.state.wrap > 0 && + 0 !== t[a.next_in]; + + ) + Le.inflateReset(a), (s = Le.inflate(a, r)); + switch (s) { + case Pe: + case Ye: + case Ke: + case Ge: + return this.onEnd(s), (this.ended = !0), !1; + } + if ( + ((l = a.avail_out), + a.next_out && (0 === a.avail_out || s === je)) + ) + if ('string' === this.options.to) { + let t = Pt(a.output, a.next_out), + e = a.next_out - t, + n = Kt(a.output, t); + (a.next_out = e), + (a.avail_out = i - e), + e && a.output.set(a.output.subarray(t, t + e), 0), + this.onData(n); + } else + this.onData( + a.output.length === a.next_out + ? a.output + : a.output.subarray(0, a.next_out) + ); + if (s !== He || 0 !== l) { + if (s === je) + return ( + (s = Le.inflateEnd(this.strm)), + this.onEnd(s), + (this.ended = !0), + !0 + ); + if (0 === a.avail_in) break; + } + } + return !0; + }), + (Xe.prototype.onData = function (t) { + this.chunks.push(t); + }), + (Xe.prototype.onEnd = function (t) { + t === He && + ('string' === this.options.to + ? (this.result = this.chunks.join('')) + : (this.result = Ct(this.chunks))), + (this.chunks = []), + (this.err = t), + (this.msg = this.strm.msg); + }); + var qe = { + Inflate: Xe, + inflate: We, + inflateRaw: function (t, e) { + return ((e = e || {}).raw = !0), We(t, e); + }, + ungzip: We, + constants: j, + }; + const { + Deflate: Je, + deflate: Qe, + deflateRaw: Ve, + gzip: $e, + } = ne, + { Inflate: ta, inflate: ea, inflateRaw: aa, ungzip: ia } = qe; + var na = Je, + sa = Qe, + ra = Ve, + la = $e, + oa = ta, + ha = ea, + da = aa, + _a = ia, + fa = j, + ca = { + Deflate: na, + deflate: sa, + deflateRaw: ra, + gzip: la, + Inflate: oa, + inflate: ha, + inflateRaw: da, + ungzip: _a, + constants: fa, + }; + (t.Deflate = na), + (t.Inflate = oa), + (t.constants = fa), + (t.default = ca), + (t.deflate = sa), + (t.deflateRaw = ra), + (t.gzip = la), + (t.inflate = ha), + (t.inflateRaw = da), + (t.ungzip = _a), + Object.defineProperty(t, '__esModule', { value: !0 }); + }); + /****************** initialization finish ******************/ + // 先拆分B站gRPC校验头和protobuf数据体 + let header = rawBody.slice(0, 5); + body = rawBody.slice(5); + // 处理response压缩protobuf数据体 + switch (header?.[0]) { + case 0: // unGzip + break; + case 1: // Gzip + body = pako.ungzip(body); + header[0] = 0; // unGzip + break; + } + // 解析链接并处理protobuf数据 + switch (HOST) { + case 'grpc.biliapi.net': // HTTP/2 + case 'app.bilibili.com': // HTTP/1.1 + /****************** initialization start *******************/ + // google.protobuf.Any + class Any$Type extends MessageType { + constructor() { + super('google.protobuf.Any', [ + { no: 1, name: 'type_url', kind: 'scalar', T: 9 }, + { no: 2, name: 'value', kind: 'scalar', T: 12 }, + ]); + } + pack(message, type) { + return { + typeUrl: this.typeNameToUrl(type.typeName), + value: type.toBinary(message), + }; + } + unpack(any, type, options) { + if (!this.contains(any, type)) + throw new Error( + "Cannot unpack google.protobuf.Any with typeUrl '" + + any.typeUrl + + "' as " + + type.typeName + + '.' + ); + return type.fromBinary(any.value, options); + } + contains(any, type) { + if (!any.typeUrl.length) return false; + let wants = + typeof type == 'string' ? type : type.typeName; + let has = this.typeUrlToName(any.typeUrl); + return wants === has; + } + internalJsonWrite(any, options) { + if (any.typeUrl === '') return {}; + let typeName = this.typeUrlToName(any.typeUrl); + let opt = jsonWriteOptions(options); + let type = opt.typeRegistry?.find( + (t) => t.typeName === typeName + ); + if (!type) + throw new globalThis.Error( + "Unable to convert google.protobuf.Any with typeUrl '" + + any.typeUrl + + "' to JSON. The specified type " + + typeName + + ' is not available in the type registry.' + ); + let value = type.fromBinary(any.value, { + readUnknownField: false, + }); + let json = type.internalJsonWrite(value, opt); + if ( + typeName.startsWith('google.protobuf.') || + !isJsonObject(json) + ) + json = { value: json }; + json['@type'] = any.typeUrl; + return json; + } + internalJsonRead(json, options, target) { + if (!isJsonObject(json)) + throw new globalThis.Error( + 'Unable to parse google.protobuf.Any from JSON ' + + typeofJsonValue(json) + + '.' + ); + if ( + typeof json['@type'] != 'string' || + json['@type'] == '' + ) + return this.create(); + let typeName = this.typeUrlToName(json['@type']); + let type = options?.typeRegistry?.find( + (t) => t.typeName == typeName + ); + if (!type) + throw new globalThis.Error( + 'Unable to parse google.protobuf.Any from JSON. The specified type ' + + typeName + + ' is not available in the type registry.' + ); + let value; + if ( + typeName.startsWith('google.protobuf.') && + json.hasOwnProperty('value') + ) + value = type.fromJson(json['value'], options); + else { + let copy = Object.assign({}, json); + delete copy['@type']; + value = type.fromJson(copy, options); + } + if (target === undefined) target = this.create(); + target.typeUrl = json['@type']; + target.value = type.toBinary(value); + return target; + } + typeNameToUrl(name) { + if (!name.length) + throw new Error('invalid type name: ' + name); + return 'type.googleapis.com/' + name; + } + typeUrlToName(url) { + if (!url.length) + throw new Error('invalid type url: ' + url); + let slash = url.lastIndexOf('/'); + let name = slash > 0 ? url.substring(slash + 1) : url; + if (!name.length) + throw new Error('invalid type url: ' + url); + return name; + } + create(value) { + const message = { typeUrl: '', value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.typeUrl !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.typeUrl); + if (message.value.length) + writer + .tag(2, WireType.LengthDelimited) + .bytes(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Any = new Any$Type(); + // CM 广告 + class CM$Type extends MessageType { + constructor() { + super('CM', [ + { + no: 1, + name: 'source_content', + kind: 'message', + T: () => Any, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.sourceContent = Any.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sourceContent + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.sourceContent) + Any.internalBinaryWrite( + message.sourceContent, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CM = new CM$Type(); + /****************** initialization finish ******************/ + switch (PATHs?.[0]) { + case 'bilibili.app.playurl.v1.PlayURL': // 投稿视频 + switch (PATHs?.[1]) { + case 'PlayView': // 播放地址 + /****************** initialization start *******************/ + // protobuf/bilibili/app/playurl/playurl.proto + class PlayViewReply$Type extends MessageType { + constructor() { + super('PlayViewReply', [ + { + no: 5, + name: 'play_arc', + kind: 'message', + T: () => PlayArcConf, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 5: + message.playArc = + PlayArcConf.internalBinaryRead( + reader, + reader.uint32(), + options, + message.playArc + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.playArc) + PlayArcConf.internalBinaryWrite( + message.playArc, + writer + .tag(5, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const PlayViewReply = new PlayViewReply$Type(); + class PlayArcConf$Type extends MessageType { + constructor() { + super('PlayArcConf', [ + { + no: 1, + name: 'background_play_conf', + kind: 'message', + T: () => ArcConf, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.backgroundPlayConf = + ArcConf.internalBinaryRead( + reader, + reader.uint32(), + options, + message.backgroundPlayConf + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.backgroundPlayConf) + ArcConf.internalBinaryWrite( + message.backgroundPlayConf, + writer + .tag(1, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const PlayArcConf = new PlayArcConf$Type(); + class ArcConf$Type extends MessageType { + constructor() { + super('ArcConf', [ + { + no: 1, + name: 'is_support', + kind: 'scalar', + T: 8, + }, + { + no: 2, + name: 'disabled', + kind: 'scalar', + T: 8, + }, + { + no: 3, + name: 'extra_content', + kind: 'message', + T: () => ExtraContent, + }, + ]); + } + create(value) { + const message = { + isSupport: false, + disabled: false, + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.isSupport = reader.bool(); + break; + case 2: + message.disabled = reader.bool(); + break; + case 3: + message.extraContent = + ExtraContent.internalBinaryRead( + reader, + reader.uint32(), + options, + message.extraContent + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.isSupport !== false) + writer + .tag(1, WireType.Varint) + .bool(message.isSupport); + if (message.disabled !== false) + writer + .tag(2, WireType.Varint) + .bool(message.disabled); + if (message.extraContent) + ExtraContent.internalBinaryWrite( + message.extraContent, + writer + .tag(3, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ArcConf = new ArcConf$Type(); + class ExtraContent$Type extends MessageType { + constructor() { + super('ExtraContent', [ + { + no: 1, + name: 'disabled_reason', + kind: 'scalar', + T: 9, + }, + { + no: 2, + name: 'disabled_code', + kind: 'scalar', + T: 3, + L: 0, + }, + ]); + } + create(value) { + const message = { + disabledReason: '', + disabledCode: 0n, + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.disabledReason = reader.string(); + break; + case 2: + message.disabledCode = reader + .int64() + .toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.disabledReason !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.disabledReason); + if (message.disabledCode !== 0n) + writer + .tag(2, WireType.Varint) + .int64(message.disabledCode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ExtraContent = new ExtraContent$Type(); + /****************** initialization finish ******************/ + let data = PlayViewReply.fromBinary(body); + const oldBackgroundConf = + data.playArc?.backgroundPlayConf; + if ( + oldBackgroundConf && + (!oldBackgroundConf.isSupport || + oldBackgroundConf.disabled) + ) { + $.log(`🎉 ${$.name}`, '后台播放限制去除'); + data.playArc.backgroundPlayConf.isSupport = true; + data.playArc.backgroundPlayConf.disabled = false; + data.playArc.backgroundPlayConf.extraContent = null; + } else { + $.log(`🚧 ${$.name}`, '无后台播放限制'); + } + body = PlayViewReply.toBinary(data); + break; + case 'PlayConf': // 播放配置 + break; + } + break; + case 'bilibili.app.dynamic.v2.Dynamic': // 动态 + /****************** initialization start *******************/ + // protobuf/bilibili/app/dynamic/dynamic.proto + var DynamicType; + (function (DynamicType) { + DynamicType[(DynamicType['dyn_none'] = 0)] = 'dyn_none'; + DynamicType[(DynamicType['ad'] = 15)] = 'ad'; + })(DynamicType || (DynamicType = {})); + class DynAllReply$Type extends MessageType { + constructor() { + super('DynAllReply', [ + { + no: 1, + name: 'dynamic_list', + kind: 'message', + T: () => DynamicList, + }, + { + no: 2, + name: 'up_list', + kind: 'message', + T: () => CardVideoUpList, + }, + { + no: 3, + name: 'topic_list', + kind: 'message', + T: () => TopicList, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.dynamicList = + DynamicList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dynamicList + ); + break; + case 2: + message.upList = + CardVideoUpList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.upList + ); + break; + case 3: + message.topicList = + TopicList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.topicList + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.dynamicList) + DynamicList.internalBinaryWrite( + message.dynamicList, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + if (message.upList) + CardVideoUpList.internalBinaryWrite( + message.upList, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join(); + if (message.topicList) + TopicList.internalBinaryWrite( + message.topicList, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynAllReply = new DynAllReply$Type(); + class DynVideoReply$Type extends MessageType { + constructor() { + super('DynVideoReply', [ + { + no: 2, + name: 'video_up_list', + kind: 'message', + T: () => CardVideoUpList, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 2: + message.videoUpList = + CardVideoUpList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.videoUpList + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.videoUpList) + CardVideoUpList.internalBinaryWrite( + message.videoUpList, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynVideoReply = new DynVideoReply$Type(); + class DynamicList$Type extends MessageType { + constructor() { + super('DynamicList', [ + { + no: 1, + name: 'list', + kind: 'message', + repeat: 1, + T: () => DynamicItem, + }, + ]); + } + create(value) { + const message = { list: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.list.push( + DynamicItem.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.list.length; i++) + DynamicItem.internalBinaryWrite( + message.list[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynamicList = new DynamicList$Type(); + class CardVideoUpList$Type extends MessageType { + constructor() { + super('CardVideoUpList', [ + { no: 1, name: 'title', kind: 'scalar', T: 9 }, + ]); + } + create(value) { + const message = { title: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.title = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.title !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.title); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CardVideoUpList = new CardVideoUpList$Type(); + class TopicList$Type extends MessageType { + constructor() { + super('TopicList', [ + { no: 1, name: 'title', kind: 'scalar', T: 9 }, + ]); + } + create(value) { + const message = { title: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.title = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.title !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.title); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TopicList = new TopicList$Type(); + class DynamicItem$Type extends MessageType { + constructor() { + super('DynamicItem', [ + { + no: 1, + name: 'card_type', + kind: 'enum', + T: () => ['DynamicType', DynamicType], + }, + ]); + } + create(value) { + const message = { cardType: 0 }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.cardType = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cardType !== 0) + writer + .tag(1, WireType.Varint) + .int32(message.cardType); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynamicItem = new DynamicItem$Type(); + /****************** initialization finish ******************/ + switch (PATHs?.[1]) { + case 'DynAll': // 动态综合页 + data = DynAllReply.fromBinary(body); + switch (Settings?.Detail?.Hot_topics) { + case true: + default: + if (data.topicList) { + data.topicList = null; + $.log(`🎉 ${$.name}`, '动态综合页热门话题去除'); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态综合页热门话题不去除' + ); + break; + } + switch (Settings?.Detail?.Most_visited) { + case true: + default: + if (data.upList) { + data.upList = null; + $.log(`🎉 ${$.name}`, '动态综合页最常访问去除'); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态综合页最常访问不去除' + ); + break; + } + switch (Settings?.Detail?.Dynamic_adcard) { + case true: + default: + if (data.dynamicList?.list?.length) { + data.dynamicList.list = + data.dynamicList.list.filter((item) => { + if (item.cardType !== 15) { + return true; + } + $.log( + `🎉 ${$.name}`, + '动态综合页广告动态去除' + ); + return false; + }); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态综合页广告动态不去除' + ); + break; + } + body = DynAllReply.toBinary(data); + break; + case 'DynVideo': // 动态视频页 + data = DynVideoReply.fromBinary(body); + switch (Settings?.Detail?.Most_visited) { + case true: + default: + if (data.videoUpList) { + data.videoUpList = null; + $.log(`🎉 ${$.name}`, '动态视频页最常访问去除'); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态视频页最常访问不去除' + ); + break; + } + body = DynVideoReply.toBinary(data); + break; + } + break; + case 'bilibili.app.view.v1.View': // 视频 + switch (PATHs?.[1]) { + case 'View': // 视频播放页 + /****************** initialization start *******************/ + // protobuf/bilibili/app/view/view.proto + class ViewReply$Type extends MessageType { + constructor() { + super('ViewReply', [ + { + no: 6, + name: 't_icon', + kind: 'map', + K: 9, + V: { kind: 'message', T: () => TIcon }, + }, + { + no: 10, + name: 'relates', + kind: 'message', + repeat: 1, + T: () => Relate, + }, + { + no: 30, + name: 'cms', + kind: 'message', + repeat: 1, + T: () => CM, + }, + { + no: 31, + name: 'cm_config', + kind: 'message', + T: () => CMConfig, + }, + { + no: 41, + name: 'cm_ipad', + kind: 'message', + T: () => CmIpad, + }, + ]); + } + create(value) { + const message = { + tIcon: {}, + relates: [], + cms: [], + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 6: + this.binaryReadMap6( + message.tIcon, + reader, + options + ); + break; + case 10: + message.relates.push( + Relate.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + case 30: + message.cms.push( + CM.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + case 31: + message.cmConfig = + CMConfig.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cmConfig + ); + break; + case 41: + message.cmIpad = CmIpad.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cmIpad + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + binaryReadMap6(map, reader, options) { + let len = reader.uint32(), + end = reader.pos + len, + key, + val; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = TIcon.internalBinaryRead( + reader, + reader.uint32(), + options + ); + break; + default: + throw new globalThis.Error( + 'unknown map entry field for field ViewReply.t_icon' + ); + } + } + map[key ?? ''] = val ?? TIcon.create(); + } + internalBinaryWrite(message, writer, options) { + for (let k of Object.keys(message.tIcon)) { + writer + .tag(6, WireType.LengthDelimited) + .fork() + .tag(1, WireType.LengthDelimited) + .string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + TIcon.internalBinaryWrite( + message.tIcon[k], + writer, + options + ); + writer.join().join(); + } + for (let i = 0; i < message.relates.length; i++) + Relate.internalBinaryWrite( + message.relates[i], + writer + .tag(10, WireType.LengthDelimited) + .fork(), + options + ).join(); + for (let i = 0; i < message.cms.length; i++) + CM.internalBinaryWrite( + message.cms[i], + writer + .tag(30, WireType.LengthDelimited) + .fork(), + options + ).join(); + if (message.cmConfig) + CMConfig.internalBinaryWrite( + message.cmConfig, + writer + .tag(31, WireType.LengthDelimited) + .fork(), + options + ).join(); + if (message.cmIpad) + CmIpad.internalBinaryWrite( + message.cmIpad, + writer + .tag(41, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ViewReply = new ViewReply$Type(); + class CM$Type extends MessageType { + constructor() { + super('CM', [ + { + no: 1, + name: 'source_content', + kind: 'message', + T: () => Any, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.sourceContent = + Any.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sourceContent + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.sourceContent) + Any.internalBinaryWrite( + message.sourceContent, + writer + .tag(1, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CM = new CM$Type(); + class CMConfig$Type extends MessageType { + constructor() { + super('CMConfig', [ + { + no: 1, + name: 'ads_control', + kind: 'message', + T: () => Any, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.adsControl = Any.internalBinaryRead( + reader, + reader.uint32(), + options, + message.adsControl + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.adsControl) + Any.internalBinaryWrite( + message.adsControl, + writer + .tag(1, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CMConfig = new CMConfig$Type(); + class CmIpad$Type extends MessageType { + constructor() { + super('CmIpad', [ + { + no: 5, + name: 'aid', + kind: 'scalar', + T: 3, + L: 0, + }, + ]); + } + create(value) { + const message = { aid: 0n }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 5: + message.aid = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.aid !== 0n) + writer + .tag(5, WireType.Varint) + .int64(message.aid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CmIpad = new CmIpad$Type(); + class TIcon$Type extends MessageType { + constructor() { + super('TIcon', [ + { no: 1, name: 'icon', kind: 'scalar', T: 9 }, + ]); + } + create(value) { + const message = { icon: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.icon = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.icon !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.icon); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TIcon = new TIcon$Type(); + class Relate$Type extends MessageType { + constructor() { + super('Relate', [ + { + no: 28, + name: 'cm', + kind: 'message', + T: () => CM, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 28: + message.cm = CM.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cm + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cm) + CM.internalBinaryWrite( + message.cm, + writer + .tag(28, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Relate = new Relate$Type(); + /****************** initialization finish ******************/ + switch (Settings?.Detail?.view) { + case true: + default: + let data = ViewReply.fromBinary(body); + if (data.cms?.length) { + data.cms = []; + $.log(`🎉 ${$.name}`, '播放页广告卡片去除'); + } + if (data.relates?.length) { + data.relates = data.relates.filter((item) => { + if (item.cm) { + $.log( + `🎉 ${$.name}`, + '播放页关联推荐广告去除' + ); + return false; + } + return true; + }); + } + if (data.cmConfig || data.cmIpad) { + delete data.cmConfig; + delete data.cmIpad; + $.log(`🎉 ${$.name}`, '播放页定制tab去除'); + } + for (const i in data.tIcon) { + if (data.tIcon[i] === null) { + // 解决tIcon的null is not an object问题 + // console.log(`tIconMap:${i}`); + delete data.tIcon[i]; + } + } + body = ViewReply.toBinary(data); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置播放页广告不去除'); + break; + } + break; + case 'TFInfo': + /****************** initialization start *******************/ + // protobuf/bilibili/app/view/view.proto + class TFInfoReply$Type extends MessageType { + constructor() { + super('TFInfoReply', [ + { + no: 1, + name: 'tipsId', + kind: 'scalar', + T: 3, + L: 0, + }, + { + no: 2, + name: 'tfToast', + kind: 'message', + T: () => TFToast, + }, + { + no: 3, + name: 'tfPanelCustomized', + kind: 'message', + T: () => TFPanelCustomized, + }, + ]); + } + create(value) { + const message = { tipsId: 0n }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.tipsId = reader.int64().toBigInt(); + break; + case 2: + message.tfToast = + TFToast.internalBinaryRead( + reader, + reader.uint32(), + options, + message.tfToast + ); + break; + case 3: + message.tfPanelCustomized = + TFPanelCustomized.internalBinaryRead( + reader, + reader.uint32(), + options, + message.tfPanelCustomized + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.tipsId !== 0n) + writer + .tag(1, WireType.Varint) + .int64(message.tipsId); + if (message.tfToast) + TFToast.internalBinaryWrite( + message.tfToast, + writer + .tag(2, WireType.LengthDelimited) + .fork(), + options + ).join(); + if (message.tfPanelCustomized) + TFPanelCustomized.internalBinaryWrite( + message.tfPanelCustomized, + writer + .tag(3, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TFInfoReply = new TFInfoReply$Type(); + class TFToast$Type extends MessageType { + constructor() { + super('TFToast', [ + { + no: 1, + name: 'btnText', + kind: 'scalar', + T: 9, + }, + ]); + } + create(value) { + const message = { btnText: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.btnText = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.btnText !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.btnText); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TFToast = new TFToast$Type(); + class TFPanelCustomized$Type extends MessageType { + constructor() { + super('TFPanelCustomized', [ + { + no: 2, + name: 'rightBtnText', + kind: 'scalar', + T: 9, + }, + ]); + } + create(value) { + const message = { rightBtnText: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 2: + message.rightBtnText = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.rightBtnText !== '') + writer + .tag(2, WireType.LengthDelimited) + .string(message.rightBtnText); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TFPanelCustomized = + new TFPanelCustomized$Type(); + /****************** initialization finish ******************/ + let data = TFInfoReply.fromBinary(body); + $.log(data.tipsId); + if (data?.tipsId) { + delete data.tfToast; + delete data.tfPanelCustomized; + $.log(`🎉 ${$.name}`, '播放页办卡免流广告去除'); + } + body = TFInfoReply.toBinary(data); + break; + } + break; + case 'bilibili.app.interface.v1.Teenagers': // 青少年模式 + class ModeStatus$Type extends MessageType { + constructor() { + super('ModeStatus', [ + { + no: 1, + name: 'modes', + kind: 'message', + repeat: 1, + T: () => Mode, + }, + ]); + } + create(value) { + const message = { modes: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.modes.push( + Mode.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.modes.length; i++) + Mode.internalBinaryWrite( + message.modes[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ModeStatus = new ModeStatus$Type(); + class Mode$Type extends MessageType { + constructor() { + super('Mode', [ + { no: 2, name: 'name', kind: 'scalar', T: 9 }, + { no: 5, name: 'f5', kind: 'message', T: () => F5 }, + ]); + } + create(value) { + const message = { name: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 2: + message.name = reader.string(); + break; + case 5: + message.f5 = F5.internalBinaryRead( + reader, + reader.uint32(), + options, + message.f5 + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.name !== '') + writer + .tag(2, WireType.LengthDelimited) + .string(message.name); + if (message.f5) + F5.internalBinaryWrite( + message.f5, + writer.tag(5, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Mode = new Mode$Type(); + class F5$Type extends MessageType { + constructor() { + super('F5', [ + { no: 1, name: 'f1', kind: 'scalar', T: 5 }, + ]); + } + create(value) { + const message = { f1: 0 }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.f1 = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.f1 !== 0) + writer.tag(1, WireType.Varint).int32(message.f1); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const F5 = new F5$Type(); + switch (PATHs?.[1]) { + case 'ModeStatus': // 青少年模式 + data = ModeStatus.fromBinary(body); + data.modes = data.modes.map((mode) => { + if (mode?.name === 'teenagers') { + if (mode?.f5?.f1) { + mode.f5.f1 = 0; + $.log(`🎉 ${$.name}`, '青少年模式弹窗去除'); + } + } + return mode; + }); + body = ModeStatus.toBinary(data); + break; + } + break; + case 'bilibili.community.service.dm.v1.DM': //弹幕 + class CommandDm$Type extends MessageType { + constructor() { + super('CommandDm', [ + { no: 1, name: 'id', kind: 'scalar', T: 3, L: 0 }, + ]); + } + create(value) { + const message = { id: 0n }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.id = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.id !== 0n) + writer.tag(1, WireType.Varint).int64(message.id); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CommandDm = new CommandDm$Type(); + class DmView$Type extends MessageType { + constructor() { + super('DmView', [ + { + no: 1, + name: 'commandDms', + kind: 'message', + repeat: 1, + T: () => CommandDm, + }, + ]); + } + create(value) { + const message = { commandDms: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.commandDms.push( + CommandDm.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.commandDms.length; i++) + CommandDm.internalBinaryWrite( + message.commandDms[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DmView = new DmView$Type(); + class DmViewReply$Type extends MessageType { + constructor() { + super('DmViewReply', [ + { + no: 22, + name: 'dmView', + kind: 'message', + T: () => DmView, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 22: + message.dmView = DmView.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dmView + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.dmView) + DmView.internalBinaryWrite( + message.dmView, + writer.tag(22, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DmViewReply = new DmViewReply$Type(); + class DmSegMobileReply$Type extends MessageType { + constructor() { + super('DmSegMobileReply', [ + { + no: 1, + name: 'elems', + kind: 'message', + repeat: 1, + T: () => DanmakuElem, + }, + ]); + } + create(value) { + const message = { elems: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.elems.push( + DanmakuElem.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.elems.length; i++) + DanmakuElem.internalBinaryWrite( + message.elems[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DmSegMobileReply = new DmSegMobileReply$Type(); + class DanmakuElem$Type extends MessageType { + constructor() { + super('DanmakuElem', [ + { no: 24, name: 'colorful', kind: 'scalar', T: 5 }, + ]); + } + create(value) { + const message = { colorful: 0 }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 24: + message.colorful = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.colorful !== 0) + writer + .tag(24, WireType.Varint) + .int32(message.colorful); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DanmakuElem = new DanmakuElem$Type(); + switch (PATHs?.[1]) { + case 'DmView': // 弹幕配置 + switch (Settings?.Detail?.commandDms) { + case true: + let data = DmViewReply.fromBinary(body); + if (data.dmView?.commandDms?.length) { + data.dmView.commandDms.length = 0; + $.log(`🎉 ${$.name}`, '交互式弹幕去除'); + } + body = DmViewReply.toBinary(data); + break; + case false: + default: + $.log(`🎉 ${$.name}`, '用户设置交互式弹幕不去除'); + break; + } + break; + case 'DmSegMobile': // 弹幕列表 + switch (Settings?.Detail?.colorfulDms) { + case true: + let data = DmSegMobileReply.fromBinary(body); + data.elems = data.elems.map((ele) => { + if (ele?.colorful === 60001) { + ele.colorful = 0; + } + return ele; + }); + $.log(`🎉 ${$.name}`, '会员弹幕已替换为普通弹幕'); + body = DmSegMobileReply.toBinary(data); + break; + case false: + default: + $.log(`🎉 ${$.name}`, '用户设置会员弹幕不修改'); + break; + } + break; + } + break; + case 'bilibili.main.community.reply.v1.Reply': + class MainListReply$Type extends MessageType { + constructor() { + super('MainListReply', [ + { + no: 11, + name: 'cm', + kind: 'message', + T: () => CM, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 11: + message.cm = CM.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cm + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cm) + CM.internalBinaryWrite( + message.cm, + writer.tag(11, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const MainListReply = new MainListReply$Type(); + switch (PATHs?.[1]) { + case 'MainList': + switch (Settings?.Detail?.MainList) { + case true: + default: + let data = MainListReply.fromBinary(body); + delete data.cm; + body = MainListReply.toBinary(data); + $.log(`🎉 ${$.name}`, '评论列表广告去除'); + break; + case false: + $.log( + `🎉 ${$.name}`, + '用户设置评论列表广告不去除' + ); + break; + } + break; + } + break; + case 'bilibili.pgc.gateway.player.v2.PlayURL': // 番剧 + /****************** initialization start *******************/ + /****************** initialization finish *******************/ + switch (PATHs?.[1]) { + case 'PlayView': // 播放地址 + /****************** initialization start *******************/ + /****************** initialization finish *******************/ + break; + case 'PlayConf': // 播放配置 + break; + } + break; + case 'bilibili.app.nativeact.v1.NativeAct': // 活动-节目、动画、韩综(港澳台) + switch (PATHs?.[1]) { + case 'Index': // 首页 + break; + } + break; + case 'bilibili.app.interface.v1.Search': // 搜索框 + switch (PATHs?.[1]) { + case 'Suggest3': // 搜索建议 + break; + } + break; + case 'bilibili.polymer.app.search.v1.Search': // 搜索结果 + /****************** initialization start *******************/ + /****************** initialization finish *******************/ + switch (PATHs?.[1]) { + case 'SearchAll': { + // 全部结果(综合) + /****************** initialization start *******************/ + class SearchAllResponse$Type extends MessageType { + constructor() { + super('SearchAllResponse', [ + { + no: 4, + name: 'item', + kind: 'message', + repeat: 1, + T: () => Item, + }, + ]); + } + create(value) { + const message = { item: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 4: + message.item.push( + Item.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.item.length; i++) + Item.internalBinaryWrite( + message.item[i], + writer + .tag(4, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const SearchAllResponse = + new SearchAllResponse$Type(); + class Item$Type extends MessageType { + constructor() { + super('Item', [ + { + no: 25, + name: 'cm', + kind: 'message', + oneof: 'cardItem', + T: () => SearchAdCard, + }, + ]); + } + create(value) { + const message = { + cardItem: { oneofKind: undefined }, + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 25: + message.cardItem = { + oneofKind: 'cm', + cm: SearchAdCard.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cardItem.cm + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cardItem.oneofKind === 'cm') + SearchAdCard.internalBinaryWrite( + message.cardItem.cm, + writer + .tag(25, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Item = new Item$Type(); + class SearchAdCard$Type extends MessageType { + constructor() { + super('SearchAdCard', [ + { + no: 1, + name: 'json_str', + kind: 'scalar', + T: 9, + }, + ]); + } + create(value) { + const message = { jsonStr: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.jsonStr = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.jsonStr !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.jsonStr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const SearchAdCard = new SearchAdCard$Type(); + /****************** initialization finish *******************/ + switch (Settings?.Detail?.search) { + case true: + default: + let data = SearchAllResponse.fromBinary(body); + data.item = data.item.filter( + (i) => !(i.cardItem?.oneofKind === 'cm') + ); + $.log(`🎉 ${$.name}`, '搜索页广告去除'); + body = SearchAllResponse.toBinary(data); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置搜索页广告不去除'); + break; + } + break; + } + case 'SearchByType': { + // 分类结果(番剧、用户、影视、专栏) + break; + } + } + break; + } + break; + } + // protobuf部分处理完后,重新计算并添加B站gRPC校验头 + rawBody = newRawBody({ header, body }); // gzip压缩有问题,别用 + break; + } + // 写入二进制数据 + if ($.isQuanX()) $response.bodyBytes = rawBody; + else $response.body = rawBody; + break; + } + break; + case false: + break; + } })() - .catch((e) => $.logErr(e)) - .finally(() => { - switch ($response) { - default: { // 有回复数据,返回回复数据 - const FORMAT = ($response?.headers?.["Content-Type"] ?? $response?.headers?.["content-type"])?.split(";")?.[0]; - $.log(`🎉 ${$.name}, finally`, `$response`, `FORMAT: ${FORMAT}`, ""); - //$.log(`🚧 ${$.name}, finally`, `$response: ${JSON.stringify($response)}`, ""); - if ($response?.headers?.["Content-Encoding"]) $response.headers["Content-Encoding"] = "identity"; - if ($response?.headers?.["content-encoding"]) $response.headers["content-encoding"] = "identity"; - if ($.isQuanX()) { - switch (FORMAT) { - case undefined: // 视为无body - // 返回普通数据 - $.done({ headers: $response.headers }); - break; - case "application/x-www-form-urlencoded": - case "text/plain": - case "text/html": - case "text/xml": - case "text/plist": - case "application/xml": - case "application/plist": - case "application/x-plist": - case "text/json": - case "application/json": - default: - // 返回普通数据 - $.done({ headers: $response.headers, body: $response.body }); - break; - case "application/x-protobuf": - case "application/grpc": - case "application/grpc+proto": - case "applecation/octet-stream": - // 返回二进制数据 - //$.log(`${$response.bodyBytes.byteLength}---${$response.bodyBytes.buffer.byteLength}`); - $.done({ headers: $response.headers, bodyBytes: $response.bodyBytes.buffer.slice($response.bodyBytes.byteOffset, $response.bodyBytes.byteLength + $response.bodyBytes.byteOffset) }); - break; - }; - } else $.done($response); - break; - }; - case undefined: { // 无回复数据 - break; - }; - }; - }) + .catch((e) => $.logErr(e)) + .finally(() => { + switch ($response) { + default: { + // 有回复数据,返回回复数据 + const FORMAT = ( + $response?.headers?.['Content-Type'] ?? + $response?.headers?.['content-type'] + )?.split(';')?.[0]; + $.log(`🎉 ${$.name}, finally`, `$response`, `FORMAT: ${FORMAT}`, ''); + //$.log(`🚧 ${$.name}, finally`, `$response: ${JSON.stringify($response)}`, ""); + if ($response?.headers?.['Content-Encoding']) + $response.headers['Content-Encoding'] = 'identity'; + if ($response?.headers?.['content-encoding']) + $response.headers['content-encoding'] = 'identity'; + if ($.isQuanX()) { + switch (FORMAT) { + case undefined: // 视为无body + // 返回普通数据 + $.done({ headers: $response.headers }); + break; + case 'application/x-www-form-urlencoded': + case 'text/plain': + case 'text/html': + case 'text/xml': + case 'text/plist': + case 'application/xml': + case 'application/plist': + case 'application/x-plist': + case 'text/json': + case 'application/json': + default: + // 返回普通数据 + $.done({ headers: $response.headers, body: $response.body }); + break; + case 'application/x-protobuf': + case 'application/grpc': + case 'application/grpc+proto': + case 'applecation/octet-stream': + // 返回二进制数据 + //$.log(`${$response.bodyBytes.byteLength}---${$response.bodyBytes.buffer.byteLength}`); + $.done({ + headers: $response.headers, + bodyBytes: $response.bodyBytes.buffer.slice( + $response.bodyBytes.byteOffset, + $response.bodyBytes.byteLength + + $response.bodyBytes.byteOffset + ), + }); + break; + } + } else $.done($response); + break; + } + case undefined: { + // 无回复数据 + break; + } + } + }); /***************** Function *****************/ /** @@ -618,25 +10204,38 @@ const DataBase = { * @return {Object} { Settings, Caches, Configs } */ function setENV(name, platform, database) { - //$.log(`☑️ ${$.name}, Set Environment Variables`, ""); - let { Settings, Caches, Configs } = getENV(name, platform, database); - /***************** Prase *****************/ - traverseObject(Settings, (key, value) => { - if (value === "true" || value === "false") value = JSON.parse(value); // 字符串转Boolean - else if (typeof value === "string") { - if (value?.includes(",")) value = value.split(","); // 字符串转数组 - else if (!isNaN(value)) value = parseInt(value, 10) // 字符串转数字 - }; - return value; - }); - $.log(`✅ ${$.name}, Set Environment Variables`, `Settings: ${typeof Settings}`, `Settings内容: ${JSON.stringify(Settings)}`, ""); - /***************** Caches *****************/ - //$.log(`✅ ${$.name}, Set Environment Variables`, `Caches: ${typeof Caches}`, `Caches内容: ${JSON.stringify(Caches)}`, ""); - /***************** Configs *****************/ - return { Settings, Caches, Configs }; + //$.log(`☑️ ${$.name}, Set Environment Variables`, ""); + let { Settings, Caches, Configs } = getENV(name, platform, database); + /***************** Prase *****************/ + traverseObject(Settings, (key, value) => { + if (value === 'true' || value === 'false') + value = JSON.parse(value); // 字符串转Boolean + else if (typeof value === 'string') { + if (value?.includes(',')) value = value.split(','); // 字符串转数组 + else if (!isNaN(value)) value = parseInt(value, 10); // 字符串转数字 + } + return value; + }); + $.log( + `✅ ${$.name}, Set Environment Variables`, + `Settings: ${typeof Settings}`, + `Settings内容: ${JSON.stringify(Settings)}`, + '' + ); + /***************** Caches *****************/ + //$.log(`✅ ${$.name}, Set Environment Variables`, `Caches: ${typeof Caches}`, `Caches内容: ${JSON.stringify(Caches)}`, ""); + /***************** Configs *****************/ + return { Settings, Caches, Configs }; - function traverseObject(o,c){for(var t in o){var n=o[t];o[t]="object"==typeof n&&null!==n?traverseObject(n,c):c(t,n)}return o} -}; + function traverseObject(o, c) { + for (var t in o) { + var n = o[t]; + o[t] = + 'object' == typeof n && null !== n ? traverseObject(n, c) : c(t, n); + } + return o; + } +} /** * Create New Raw Body @@ -647,27 +10246,34 @@ function setENV(name, platform, database) { * @return {ArrayBuffer} new raw Body with Checksum Header */ function newRawBody({ header, body }, encoding = undefined) { - //$.log(`⚠ ${$.name}, Create New Raw Body`, ""); - // Header: 1位:是否校验数据 (0或者1) + 4位:校验值(数据长度) - const flag = (encoding == "gzip") ? 1 : (encoding == "identity") ? 0 : (encoding == undefined) ? 0 : header?.[0] ?? 0; // encoding flag - const checksum = Checksum(body.length); // 校验值为未压缩情况下的数据长度, 不是压缩后的长度 - if (encoding == "gzip") body = pako.gzip(body); // gzip压缩(有问题,别压) - let rawBody = new Uint8Array(header.length + body.length); - rawBody.set([flag], 0) // 0位:Encoding类型,当为1的时候, app会校验1-4位的校验值是否正确 - rawBody.set(checksum, 1) // 1-4位: 校验值(4位) - rawBody.set(body, 5); // 5-end位:protobuf数据 - //$.log(`🎉 ${$.name}, Create New Raw Body`, ""); - return rawBody; + //$.log(`⚠ ${$.name}, Create New Raw Body`, ""); + // Header: 1位:是否校验数据 (0或者1) + 4位:校验值(数据长度) + const flag = + encoding == 'gzip' + ? 1 + : encoding == 'identity' + ? 0 + : encoding == undefined + ? 0 + : header?.[0] ?? 0; // encoding flag + const checksum = Checksum(body.length); // 校验值为未压缩情况下的数据长度, 不是压缩后的长度 + if (encoding == 'gzip') body = pako.gzip(body); // gzip压缩(有问题,别压) + let rawBody = new Uint8Array(header.length + body.length); + rawBody.set([flag], 0); // 0位:Encoding类型,当为1的时候, app会校验1-4位的校验值是否正确 + rawBody.set(checksum, 1); // 1-4位: 校验值(4位) + rawBody.set(body, 5); // 5-end位:protobuf数据 + //$.log(`🎉 ${$.name}, Create New Raw Body`, ""); + return rawBody; - // 计算校验和 (B站为数据本体字节数) - function Checksum(num) { - let arr = new ArrayBuffer(4); // an Int32 takes 4 bytes - let view = new DataView(arr); - // 首位填充计算过的新数据长度 - view.setUint32(0, num, false); // byteOffset = 0; litteEndian = false - return new Uint8Array(arr); - }; -}; + // 计算校验和 (B站为数据本体字节数) + function Checksum(num) { + let arr = new ArrayBuffer(4); // an Int32 takes 4 bytes + let view = new DataView(arr); + // 首位填充计算过的新数据长度 + view.setUint32(0, num, false); // byteOffset = 0; litteEndian = false + return new Uint8Array(arr); + } +} /***************** Env *****************/ // prettier-ignore @@ -675,7 +10281,42 @@ function newRawBody({ header, body }, encoding = undefined) { function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,a)=>{s.call(this,t,(t,s,r)=>{t?a(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const a=this.getdata(t);if(a)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,a)=>e(a))})}runScript(t,e){return new Promise(s=>{let a=this.getdata("@chavy_boxjs_userCfgs.httpapi");a=a?a.replace(/\n/g,"").trim():a;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[i,o]=a.split("@"),n={url:`http://${o}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":i,Accept:"*/*"},timeout:r};this.post(n,(t,e,a)=>s(a))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),a=!s&&this.fs.existsSync(e);if(!s&&!a)return{};{const a=s?t:e;try{return JSON.parse(this.fs.readFileSync(a))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),a=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):a?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const a=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of a)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,a)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[a+1])>>0==+e[a+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,a]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,a,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,a,r]=/^@(.*?)\.(.*?)$/.exec(e),i=this.getval(a),o=a?"null"===i?null:i||"{}":"{}";try{const e=JSON.parse(o);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),a)}catch(e){const i={};this.lodash_set(i,r,t),s=this.setval(JSON.stringify(i),a)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueForKey(t,e);case"Node.js":return this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0;default:return this.data&&this.data[e]||null}}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){switch(t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"],delete t.headers["content-type"],delete t.headers["content-length"]),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,a)=>{!t&&s&&(s.body=a,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,a)});break;case"Quantumult X":this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:a,headers:r,body:i,bodyBytes:o}=t;e(null,{status:s,statusCode:a,headers:r,body:i,bodyBytes:o},i,o)},t=>e(t&&t.error||"UndefinedError"));break;case"Node.js":let s=require("iconv-lite");this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:a,statusCode:r,headers:i,rawBody:o}=t,n=s.decode(o,this.encoding);e(null,{status:a,statusCode:r,headers:i,rawBody:o,body:n},n)},t=>{const{message:a,response:r}=t;e(a,r,r&&s.decode(r.rawBody,this.encoding))})}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";switch(t.body&&t.headers&&!t.headers["Content-Type"]&&!t.headers["content-type"]&&(t.headers["content-type"]="application/x-www-form-urlencoded"),t.headers&&(delete t.headers["Content-Length"],delete t.headers["content-length"]),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](t,(t,s,a)=>{!t&&s&&(s.body=a,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,a)});break;case"Quantumult X":t.method=s,this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:a,headers:r,body:i,bodyBytes:o}=t;e(null,{status:s,statusCode:a,headers:r,body:i,bodyBytes:o},i,o)},t=>e(t&&t.error||"UndefinedError"));break;case"Node.js":let a=require("iconv-lite");this.initGotEnv(t);const{url:r,...i}=t;this.got[s](r,i).then(t=>{const{statusCode:s,statusCode:r,headers:i,rawBody:o}=t,n=a.decode(o,this.encoding);e(null,{status:s,statusCode:r,headers:i,rawBody:o,body:n},n)},t=>{const{message:s,response:r}=t;e(s,r,r&&a.decode(r.rawBody,this.encoding))})}}time(t,e=null){const s=e?new Date(e):new Date;let a={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in a)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?a[e]:("00"+a[e]).substr((""+a[e]).length)));return t}queryStr(t){let e="";for(const s in t){let a=t[s];null!=a&&""!==a&&("object"==typeof a&&(a=JSON.stringify(a)),e+=`${s}=${a}&`)}return e=e.substring(0,e.length-1),e}msg(e=t,s="",a="",r){const i=t=>{switch(typeof t){case void 0:return t;case"string":switch(this.getEnv()){case"Surge":case"Stash":default:return{url:t};case"Loon":case"Shadowrocket":return t;case"Quantumult X":return{"open-url":t};case"Node.js":return}case"object":switch(this.getEnv()){case"Surge":case"Stash":case"Shadowrocket":default:{let e=t.url||t.openUrl||t["open-url"];return{url:e}}case"Loon":{let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}case"Quantumult X":{let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl,a=t["update-pasteboard"]||t.updatePasteboard;return{"open-url":e,"media-url":s,"update-pasteboard":a}}case"Node.js":return}default:return}};if(!this.isMute)switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:$notification.post(e,s,a,i(r));break;case"Quantumult X":$notify(e,s,a,i(r));break;case"Node.js":}if(!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),a&&t.push(a),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t);break;case"Node.js":this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack)}}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;switch(this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:$done(t);break;case"Node.js":process.exit(1)}}}(t,e)} // https://github.com/DualSubs/URL/blob/main/URLs.embedded.min.js -function URLs(s){return new class{constructor(s=[]){this.name="URL v1.0.2",this.opts=s,this.json={scheme:"",host:"",path:"",params:{}}}parse(s){let t=s.match(/(?.+):\/\/(?[^/]+)\/?(?[^?]+)?\??(?.*)?/)?.groups??null;return t?.path||(t.path=""),t?.params&&(t.params=Object.fromEntries(t.params.split("&").map((s=>s.split("="))))),t}stringify(s=this.json){return s?.params?s.scheme+"://"+s.host+"/"+s.path+"?"+Object.entries(s.params).map((s=>s.join("="))).join("&"):s.scheme+"://"+s.host+"/"+s.path}}(s)} +function URLs(s) { + return new (class { + constructor(s = []) { + (this.name = 'URL v1.0.2'), + (this.opts = s), + (this.json = { scheme: '', host: '', path: '', params: {} }); + } + parse(s) { + let t = + s.match( + /(?.+):\/\/(?[^/]+)\/?(?[^?]+)?\??(?.*)?/ + )?.groups ?? null; + return ( + t?.path || (t.path = ''), + t?.params && + (t.params = Object.fromEntries( + t.params.split('&').map((s) => s.split('=')) + )), + t + ); + } + stringify(s = this.json) { + return s?.params + ? s.scheme + + '://' + + s.host + + '/' + + s.path + + '?' + + Object.entries(s.params) + .map((s) => s.join('=')) + .join('&') + : s.scheme + '://' + s.host + '/' + s.path; + } + })(s); +} /** * Get Environment Variables @@ -686,4 +10327,29 @@ function URLs(s){return new class{constructor(s=[]){this.name="URL v1.0.2",this. * @param {Object} n - Default Database * @return {Object} { Settings, Caches, Configs } */ -function getENV(t,e,n){let i=$.getjson(t,n),s={};if("undefined"!=typeof $argument&&Boolean($argument)){let t=Object.fromEntries($argument.split("&").map((t=>t.split("="))));for(let e in t)l(s,e,t[e])}let g={...n?.Default?.Settings,...n?.[e]?.Settings,...i?.[e]?.Settings,...s},f={...n?.Default?.Configs,...n?.[e]?.Configs,...i?.[e]?.Configs},o=i?.[e]?.Caches||{};return"string"==typeof o&&(o=JSON.parse(o)),{Settings:g,Caches:o,Configs:f};function l(t,e,n){e.split(".").reduce(((t,i,s)=>t[i]=e.split(".").length===++s?n:t[i]||{}),t)}} \ No newline at end of file +function getENV(t, e, n) { + let i = $.getjson(t, n), + s = {}; + if ('undefined' != typeof $argument && Boolean($argument)) { + let t = Object.fromEntries($argument.split('&').map((t) => t.split('='))); + for (let e in t) l(s, e, t[e]); + } + let g = { + ...n?.Default?.Settings, + ...n?.[e]?.Settings, + ...i?.[e]?.Settings, + ...s, + }, + f = { ...n?.Default?.Configs, ...n?.[e]?.Configs, ...i?.[e]?.Configs }, + o = i?.[e]?.Caches || {}; + return ( + 'string' == typeof o && (o = JSON.parse(o)), + { Settings: g, Caches: o, Configs: f } + ); + function l(t, e, n) { + e.split('.').reduce( + (t, i, s) => (t[i] = e.split('.').length === ++s ? n : t[i] || {}), + t + ); + } +} diff --git a/Scripts/AdBlock/Bilibili/BiliBili.response.min.js b/Scripts/AdBlock/Bilibili/BiliBili.response.min.js index d32ff99..094f9a5 100644 --- a/Scripts/AdBlock/Bilibili/BiliBili.response.min.js +++ b/Scripts/AdBlock/Bilibili/BiliBili.response.min.js @@ -2,611 +2,10197 @@ WEBSITE: https://biliuniverse.io README: https://github.com/BiliUniverse */ -const $ = new Env("📺 BiliBili: 🛡️ ADBlock v0.3.0(2) response"); +const $ = new Env('📺 BiliBili: 🛡️ ADBlock v0.3.1(1) response'); const URL = new URLs(); const DataBase = { - "ADBlock":{ - "Settings":{ - "Switch":true, - "Detail":{"splash":true,"feed":true,"activity":false,"story":true,"cinema":true,"view":true,"search":true,"xlive":true,"Hot_search":true,"Hot_topics":true,"Most_visited":true,"Dynamic_adcard":true} - } - }, - "Default": { - "Settings":{"Switch":true} - } + ADBlock: { + Settings: { + Switch: true, + Detail: { + splash: true, + feed: true, + activity: false, + story: true, + cinema: true, + view: true, + search: true, + commandDms: false, + colorfulDms: false, + MainList: true, + xlive: true, + Hot_search: true, + Hot_topics: true, + Most_visited: true, + Dynamic_adcard: true, + }, + }, + }, + Default: { + Settings: { Switch: true }, + }, }; /***************** Processing *****************/ (async () => { - const { Settings, Caches, Configs } = setENV("BiliBili", "ADBlock", DataBase); - switch (Settings?.Switch) { - case true: - default: - let url = URL.parse($request?.url); - const METHOD = $request?.method, HOST = url?.host, PATH = url?.path, PATHs = PATH.split("/"); - // 解析格式 - const FORMAT = ($response?.headers?.["Content-Type"] ?? $response?.headers?.["content-type"])?.split(";")?.[0]; - $.log(`⚠ ${$.name}`, `METHOD: ${METHOD}`, `HOST: ${HOST}`, `PATH: ${PATH}`, `PATHs: ${PATHs}`, `FORMAT: ${FORMAT}`, ""); - // 创建空数据 - let body = { "code": 0, "message": "0", "data": {} }; - // 格式判断 - switch (FORMAT) { - case undefined: // 视为无body - break; - case "application/x-www-form-urlencoded": - case "text/plain": - case "text/html": - default: - break; - case "text/xml": - case "text/plist": - case "application/xml": - case "application/plist": - case "application/x-plist": - break; - case "text/json": - case "application/json": - body = JSON.parse($response.body); - // 解析链接 - switch (HOST) { - case "www.bilibili.com": - break; - case "app.bilibili.com": - case "app.biliapi.net": - switch (PATH) { - case "x/v2/splash/show": // 开屏页 - case "x/v2/splash/list": // 开屏页 - case "x/v2/splash/brand/list": // 开屏页 - case "x/v2/splash/event/list2": // 开屏页 - switch (Settings?.Detail?.splash) { - case true: - default: - const item = ["account", "event_list", "preload", "show"]; - if (body.data) { - item.forEach((i) => { - delete body.data[i]; - }); - $.log(`🎉 ${$.name}`, "开屏页广告去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置开屏页广告不去除"); - break; - }; - break; - case "x/v2/feed/index": // 推荐页 - switch (Settings?.Detail?.feed) { - case true: - default: - if (body.data.items?.length) { - let params = url?.params;//区分pad与phone - body.data.items = await Promise.all(body.data.items.map(async item => { - const { card_type: cardType, card_goto: cardGoto } = item; - if (cardType && cardGoto) { - if (['banner_v8', 'banner_ipad_v8'].includes(cardType) && cardGoto === 'banner') { - switch (Settings?.Detail?.activity) { - case true: - default: - Caches.banner_hash = item.hash; - $.setjson(Caches, "@BiliBili.ADBlock.Caches"); // 获取banner_hash,无此字段会有活动页且此字段无法伪造. - $.log(`🎉 ${$.name}`, "推荐页活动大图去除"); - return undefined; - case false: - if (item.banner_item) { - item.banner_item = item.banner_item.filter(i => { - if (i.type === 'ad') { - $.log(`🎉 ${$.name}`, "推荐页大图广告去除"); - return false; - } - return true; - }); - } - break; - } - } else if (['cm_v2', 'cm_v1'].includes(cardType) && ['ad_web_s', 'ad_av', 'ad_web_gif'].includes(cardGoto)) { - // ad_player大视频广告 ad_web_gif大gif广告 ad_web_s普通小广告 ad_av创作推广广告 ad_inline_3d 上方大的视频3d广告 ad_inline_eggs 上方大的视频广告 - $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); - if (params.device !== "phone") { - return undefined;//pad直接去除 - } else { - await fixPosition().then(result => item = result);//小广告补位 - } - } else if (cardType === 'cm_v2' && ['ad_player', 'ad_inline_3d', 'ad_inline_eggs'].includes(cardGoto)) { - $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); - return undefined;//大广告直接去除 - } else if (cardType === 'small_cover_v10' && cardGoto === 'game') { - $.log(`🎉 ${$.name}`, "游戏广告去除"); - if (params.device !== "phone") { - return undefined;//pad直接去除 - } else { - await fixPosition().then(result => item = result);//小广告补位 - } - } else if (cardType === 'cm_double_v9' && cardGoto === 'ad_inline_av') { - $.log(`🎉 ${$.name}`, "大视频广告去除"); - return undefined;//大广告直接去除 - } - } - return item; - })); - body.data.items = body.data.items.filter(fix => fix !== undefined); - } - async function fixPosition() { - let itemsCache = $.getdata("@BiliBili.Index.Caches",""); - let singleItem = {}; - if (itemsCache.length > 0) { - singleItem = itemsCache.pop(); - $.log(`🎉 ${$.name}`, "推荐页空缺位填充成功"); - } else {//重新获取填充位 - const myRequest = { - url: $request.url, - headers: $request.heders - } - await $.http.get(myRequest).then(response => { - try { - const body = $.toObj(response.body) - if (body?.code === 0 && body?.message === "0") { - body.data.items = body.data.items.map(item => { - const { card_type: cardType, card_goto: cardGoto } = item; - if (cardType && cardGoto) { - if (cardType === 'banner_v8' && cardGoto === 'banner') { - return undefined; - } else if (cardType === 'cm_v2' && ['ad_web_s', 'ad_av', 'ad_web_gif', 'ad_player', 'ad_inline_3d', 'ad_inline_eggs'].includes(cardGoto)) { - return undefined; - } else if (cardType === 'small_cover_v10' && cardGoto === 'game') { - return undefined; - } else if (cardType === 'cm_double_v9' && cardGoto === 'ad_inline_av') { - return undefined; - } else if (cardType === 'large_cover_v9' && cardGoto === 'inline_av_v2') {//补位不需要大视频 - return undefined; - } - } - return item; - }).filter(fix => fix !== undefined); - $.setdata(body.data.items, "@BiliBili.Index.Caches"); - $.log(`🎉 ${$.name}`, "推荐页缓存数组补充成功"); - } else { - $.log(`🚧 ${$.name}`, "访问推荐页尝试填补失败"); - } - } catch (e) { - $.logErr(e, response) - } - }) - itemsCache = $.getdata("@BiliBili.Index.Caches",""); - if (itemsCache.length > 0) { - singleItem = itemsCache.pop(); - $.log(`🎉 ${$.name}`, "推荐页空缺位填充成功"); - } - } - $.setdata(itemsCache, "@BiliBili.Index.Caches"); - return singleItem; - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置推荐页广告不去除"); - break; - }; - break; - case "x/v2/feed/index/story": // 首页短视频流 - switch (Settings?.Detail?.story) { - case true: - default: - if (body.data?.items) { - // vertical_live 直播内容 - // vertical_pgc 大会员专享 - body.data.items = body.data.items.filter((i) => !( - i.hasOwnProperty("ad_info") || - ["vertical_ad_av", "vertical_pgc"].includes(i.card_goto) - ) - ); - $.log(`🎉 ${$.name}`, "首页短视频流广告去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置首页短视频流广告不去除"); - break; - }; - break; - case "x/v2/search/square": // 搜索页 - switch (Settings?.Detail?.Hot_search) { - case true: - default: - body.data = body.data.filter((i) => !(i.type === "trending")); - $.log(`🎉 ${$.name}`, "搜索页热搜内容去除"); - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置搜索页热搜内容不去除"); - break; - } - break; - }; - break; - case "api.bilibili.com": - case "api.biliapi.net": - switch (PATH) { - case "pgc/player/api/playurl": // 番剧-播放地址-api - case "pgc/player/web/playurl": // 番剧-播放地址-web - case "pgc/player/web/playurl/html5": // 番剧-播放地址-web-HTML5 - break; - case "pgc/view/v2/app/season": // 番剧页面-内容-app - break; - case "pgc/view/web/season": // 番剧-内容-web - case "pgc/view/pc/season": // 番剧-内容-pc - break; - case "pgc/page/bangumi": // 追番页 - case "pgc/page/cinema/tab": // 观影页 - switch (Settings?.Detail?.cinema) { - case true: - default: - if (body.result?.modules) { - body.result.modules.forEach((i) => { - if (i.style.startsWith("banner")) { - i.items = i.items.filter((j) => j.link.includes("play")); - } else if (i.style.startsWith("function")) { - i.items = i.items.filter((j) => j.blink.startsWith("bilibili")); - } else if ([241, 1283, 1284, 1441].includes(i.module_id)) { - i.items = []; - } else if (i.style.startsWith("tip")) { - i.items = []; - } - }); - $.log(`🎉 ${$.name}`, "观影页广告去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置观影页广告不去除"); - break; - }; - break; - case "x/player/wbi/playurl": // UGC-用户生产内容-播放地址 - break; - case "x/space/acc/info": // 用户空间-账号信息-pc - case "x/space/wbi/acc/info": // 用户空间-账号信息-wbi - switch (url.params?.vmid || url.params?.mid) { - case "11783021": // 哔哩哔哩番剧出差 - case "1988098633": // b站_戲劇咖 - case "2042149112": // b站_綜藝咖 - break; - default: - break; - }; - break; - }; - break; - case "api.live.bilibili.com": - switch (PATH) { - case "xlive/app-room/v1/index/getInfoByRoom": // 直播 - switch (Settings?.Detail?.xlive) { - case true: - default: - if (body.data?.activity_banner_info) { - body.data.activity_banner_info = null; - $.log(`🎉 ${$.name}`, "直播banner广告去除"); - } - if (body.data?.shopping_info) { - body.data.shopping_info = { - is_show: 0 - }; - $.log(`🎉 ${$.name}`, "直播购物广告去除"); - } - if (body.data?.new_tab_info?.outer_list?.length > 0) { - body.data.new_tab_info.outer_list = - body.data.new_tab_info.outer_list.filter((i) => i.biz_id !== 33); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置直播页广告不去除"); - break; - }; - break; - }; - break; - }; - $response.body = JSON.stringify(body); - break; - case "application/x-protobuf": - case "application/grpc": - case "application/grpc+proto": - case "applecation/octet-stream": - let rawBody = $.isQuanX() ? new Uint8Array($response.bodyBytes) : $response.body; - //$.log(`🚧 ${$.name}`, `isBuffer? ${ArrayBuffer.isView(rawBody)}: ${JSON.stringify(rawBody)}`, ""); - /****************** initialization start *******************/ - // timostamm/protobuf-ts - !function(i){"use strict";function _(n,e,i){return e<=n&&n<=i}"undefined"!=typeof module&&module.exports&&!i["encoding-indexes"]&&(i["encoding-indexes"]=require("./encoding-indexes.js")["encoding-indexes"]);var l=Math.floor;function s(n){if(void 0===n)return{};if(n===Object(n))return n;throw TypeError("Could not convert argument to dictionary")}function u(n){return 0<=n&&n<=127}var a=u,b=-1;function c(n){this.tokens=[].slice.call(n),this.tokens.reverse()}c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():b},prepend:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.push(e.pop());else this.tokens.push(n)},push:function(n){if(Array.isArray(n))for(var e=n;e.length;)this.tokens.unshift(e.shift());else this.tokens.unshift(n)}};var w=-1;function m(n,e){if(n)throw TypeError("Decoder error");return e||65533}function f(n){throw TypeError("The code point "+n+" could not be encoded.")}function r(n){return n=String(n).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(d,n)?d[n]:null}var t,o,n=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],d={},h=(n.forEach(function(n){n.encodings.forEach(function(e){e.labels.forEach(function(n){d[n]=e})})}),{}),g={};function y(n,e){return e&&e[n]||null}function p(n,e){e=e.indexOf(n);return-1===e?null:e}function v(n){if("encoding-indexes"in i)return i["encoding-indexes"][n];throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?")}var x="utf-8";function O(n,e){if(!(this instanceof O))throw TypeError("Called as a function. Did you forget 'new'?");n=void 0!==n?String(n):x,e=s(e),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var i=r(n);if(null===i||"replacement"===i.name)throw RangeError("Unknown encoding: "+n);if(g[i.name])return(n=this)._encoding=i,Boolean(e.fatal)&&(n._error_mode="fatal"),Boolean(e.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal="fatal"===n._error_mode,this.ignoreBOM=n._ignoreBOM),n;throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?")}function k(n,e){if(!(this instanceof k))throw TypeError("Called as a function. Did you forget 'new'?");e=s(e),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(e.fatal)?"fatal":"replacement";if(Boolean(e.NONSTANDARD_allowLegacyEncoding)){e=r(n=void 0!==n?String(n):x);if(null===e||"replacement"===e.name)throw RangeError("Unknown encoding: "+n);if(!h[e.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");this._encoding=e}else this._encoding=r("utf-8"),void 0!==n&&"console"in i&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=this._encoding.name.toLowerCase()),this}function e(n){var r=n.fatal,t=0,o=0,s=0,l=128,a=191;this.handler=function(n,e){if(e===b&&0!==s)return s=0,m(r);if(e===b)return w;if(0===s){if(_(e,0,127))return e;if(_(e,194,223))s=1,t=31&e;else if(_(e,224,239))224===e&&(l=160),237===e&&(a=159),s=2,t=15&e;else{if(!_(e,240,244))return m(r);240===e&&(l=144),244===e&&(a=143),s=3,t=7&e}return null}var i;return _(e,l,a)?(l=128,a=191,t=t<<6|63&e,(o+=1)!==s?null:(i=t,t=s=o=0,i)):(t=s=o=0,l=128,a=191,n.prepend(e),m(r))}}function E(n){n.fatal;this.handler=function(n,e){if(e===b)return w;if(a(e))return e;_(e,128,2047)?(i=1,r=192):_(e,2048,65535)?(i=2,r=224):_(e,65536,1114111)&&(i=3,r=240);for(var i,r,t=[(e>>6*i)+r];0>6*(i-1)),--i;return t}}function j(i,n){var r=n.fatal;this.handler=function(n,e){return e===b?w:u(e)?e:null===(e=i[e-128])?m(r):e}}function B(r,n){n.fatal;this.handler=function(n,e){var i;return e===b?w:a(e)?e:(null===(i=p(e,r))&&f(e),i+128)}}function S(n){var o=n.fatal,s=0,l=0,a=0;this.handler=function(n,e){var i,r,t;return e===b&&0===s&&0===l&&0===a?w:(e!==b||0===s&&0===l&&0===a||(a=l=s=0,m(o)),0!==a?(i=null,_(e,48,57)&&(i=function(n){if(39419>8,n=255&n;return e?[i,n]:[n,i]}function L(r,n){var t=n.fatal,o=null,s=null;this.handler=function(n,e){var i;return e!==b||null===o&&null===s?e===b&&null===o&&null===s?w:null===o?(o=e,null):(e=r?(o<<8)+e:(e<<8)+o,(o=null)!==s?(i=s,s=null,_(e,56320,57343)?65536+1024*(i-55296)+(e-56320):(n.prepend(A(e,r)),m(t))):_(e,55296,56319)?(s=e,null):_(e,56320,57343)?m(t):e):m(t)}}function M(r,n){n.fatal;this.handler=function(n,e){var i;return e===b?w:_(e,0,65535)?A(e,r):(i=A(55296+(e-65536>>10),r),e=A(56320+(e-65536&1023),r),i.concat(e))}}function N(n){n.fatal;this.handler=function(n,e){return e===b?w:u(e)?e:63360+e-128}}function q(n){n.fatal;this.handler=function(n,e){return e===b?w:a(e)?e:_(e,63360,63487)?e-63360+128:f(e)}}Object.defineProperty&&(Object.defineProperty(O.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(O.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(O.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),O.prototype.decode=function(n,e){n="object"==typeof n&&n instanceof ArrayBuffer?new Uint8Array(n):"object"==typeof n&&"buffer"in n&&n.buffer instanceof ArrayBuffer?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(0);e=s(e),this._do_not_flush||(this._decoder=g[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(e.stream);for(var i,r=new c(n),t=[];;){var o=r.read();if(o===b)break;if((i=this._decoder.handler(r,o))===w)break;null!==i&&(Array.isArray(i)?t.push.apply(t,i):t.push(i))}if(!this._do_not_flush){for(;(i=this._decoder.handler(r,r.read()))!==w&&(null!==i&&(Array.isArray(i)?t.push.apply(t,i):t.push(i)),!r.endOfStream()););this._decoder=null}return function(n){e=["UTF-8","UTF-16LE","UTF-16BE"],i=this._encoding.name,-1===e.indexOf(i)||this._ignoreBOM||this._BOMseen||(0>10),56320+(1023&s)))}return t}.call(this,t)},Object.defineProperty&&Object.defineProperty(k.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),k.prototype.encode=function(n,e){n=void 0===n?"":String(n),e=s(e),this._do_not_flush||(this._encoder=h[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(e.stream);for(var i,r=new c(function(n){for(var e=String(n),i=e.length,r=0,t=[];rr in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r=r||{})__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e},__spreadProps=(e,r)=>__defProps(e,__getOwnPropDescs(r));function varint64read(){let r=0,t=0;for(let e=0;e<28;e+=7){var a=this.buf[this.pos++];if(r|=(127&a)<>4,0==(128&e))return this.assertBounds(),[r,t];for(let e=3;e<=31;e+=7){var n=this.buf[this.pos++];if(t|=(127&n)<>>e,s=!(n>>>7==0&&0==t);if(a.push(255&(s?128|n:n)),!s)return}var e=r>>>28&15|(7&t)<<4,i=!(t>>3==0);if(a.push(255&(i?128|e:e)),i){for(let e=3;e<31;e+=7){var o=t>>>e,l=!(o>>>7==0);if(a.push(255&(l?128|o:o)),!l)return}a.push(t>>>31&1)}}const TWO_PWR_32_DBL$1=4294967296;function int64fromString(t){var e="-"==t[0];e&&(t=t.slice(1));let a=0,n=0;function r(e,r){e=Number(t.slice(e,r));n*=1e6,(a=1e6*a+e)>=TWO_PWR_32_DBL$1&&(n+=a/TWO_PWR_32_DBL$1|0,a%=TWO_PWR_32_DBL$1)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),[e,a,n]}function int64toString(e,r){if(r<=2097151)return""+(TWO_PWR_32_DBL$1*r+e);var t=(e>>>24|r<<8)>>>0&16777215,r=r>>16&65535;let a=(16777215&e)+6777216*t+6710656*r,n=t+8147497*r,s=2*r;e=1e7;function i(e,r){e=e?String(e):"";return r?"0000000".slice(e.length)+e:e}return a>=e&&(n+=Math.floor(a/e),a%=e),n>=e&&(s+=Math.floor(n/e),n%=e),i(s,0)+i(n,s)+i(a,1)}function varint32write(r,t){if(0<=r){for(;127>>=7;t.push(r)}else{for(let e=0;e<9;e++)t.push(127&r|128),r>>=7;t.push(1)}}function varint32read(){let r=this.buf[this.pos++];var e=127&r;if(0==(128&r))return this.assertBounds(),e;if(e|=(127&(r=this.buf[this.pos++]))<<7,0==(128&r))return this.assertBounds(),e;if(e|=(127&(r=this.buf[this.pos++]))<<14,0==(128&r))return this.assertBounds(),e;if(e|=(127&(r=this.buf[this.pos++]))<<21,0==(128&r))return this.assertBounds(),e;e|=(15&(r=this.buf[this.pos++]))<<28;for(let e=5;0!=(128&r)&&e<10;e++)r=this.buf[this.pos++];if(0!=(128&r))throw new Error("invalid varint");return this.assertBounds(),e>>>0}function detectBi(){var e=new DataView(new ArrayBuffer(8));return void 0!==globalThis.BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}const BI=detectBi();function assertBi(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const RE_DECIMAL_STR=/^-?[0-9]+$/,TWO_PWR_32_DBL=4294967296;class SharedPbLong{constructor(e,r){this.lo=0|e,this.hi=0|r}isZero(){return 0==this.lo&&0==this.hi}toNumber(){var e=this.hi*TWO_PWR_32_DBL+(this.lo>>>0);if(Number.isSafeInteger(e))return e;throw new Error("cannot convert to safe number")}}const _PbULong=class extends SharedPbLong{static from(e){if(BI)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=BI.C(e);case"number":if(0===e)return this.ZERO;e=BI.C(e);case"bigint":if(!e)return this.ZERO;if(eBI.UMAX)throw new Error("ulong too large");return BI.V.setBigUint64(0,e,!0),new _PbULong(BI.V.getInt32(0,!0),BI.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!RE_DECIMAL_STR.test(e))throw new Error("string is no integer");var[r,t,a]=int64fromString(e);if(r)throw new Error("signed value");return new _PbULong(t,a);case"number":if(0==e)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 _PbULong(e,e/TWO_PWR_32_DBL)}throw new Error("unknown value "+typeof e)}toString(){return BI?this.toBigInt().toString():int64toString(this.lo,this.hi)}toBigInt(){return assertBi(BI),BI.V.setInt32(0,this.lo,!0),BI.V.setInt32(4,this.hi,!0),BI.V.getBigUint64(0,!0)}};let PbULong=_PbULong;PbULong.ZERO=new _PbULong(0,0);const _PbLong=class extends SharedPbLong{static from(e){if(BI)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=BI.C(e);case"number":if(0===e)return this.ZERO;e=BI.C(e);case"bigint":if(!e)return this.ZERO;if(eBI.MAX)throw new Error("ulong too large");return BI.V.setBigInt64(0,e,!0),new _PbLong(BI.V.getInt32(0,!0),BI.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;var r,t,a;if(e=e.trim(),RE_DECIMAL_STR.test(e))return[r,a,t]=int64fromString(e),a=new _PbLong(a,t),r?a.negate():a;throw new Error("string is no integer");case"number":if(0==e)return this.ZERO;if(Number.isSafeInteger(e))return 0>>3,e=7&e;if(r<=0||e<0||5this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){var e=this.uint32();return e>>>1^-(1&e)}int64(){return new PbLong(...this.varint64())}uint64(){return new PbULong(...this.varint64())}sint64(){var[e,r]=this.varint64(),t=-(1&e),e=(e>>>1|(1&r)<<31)^t,r=r>>>1^t;return new PbLong(e,r)}bool(){var[e,r]=this.varint64();return 0!==e||0!==r}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new PbULong(this.sfixed32(),this.sfixed32())}sfixed64(){return new PbLong(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(){var e=this.uint32(),r=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(r,r+e)}string(){return this.textDecoder.decode(this.bytes())}}function assert(e,r){if(!e)throw new Error(r)}const FLOAT32_MAX=34028234663852886e22,FLOAT32_MIN=-34028234663852886e22,UINT32_MAX=4294967295,INT32_MAX=2147483647,INT32_MIN=-2147483648;function assertInt32(e){if("number"!=typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>INT32_MAX||eUINT32_MAX||e<0)throw new Error("invalid uint 32: "+e)}function assertFloat32(e){if("number"!=typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>FLOAT32_MAX||e>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(assertUInt32(e);127>>=7;return this.buf.push(e),this}int32(e){return assertInt32(e),varint32write(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){e=this.textEncoder.encode(e);return this.uint32(e.byteLength),this.raw(e)}float(e){assertFloat32(e);var r=new Uint8Array(4);return new DataView(r.buffer).setFloat32(0,e,!0),this.raw(r)}double(e){var r=new Uint8Array(8);return new DataView(r.buffer).setFloat64(0,e,!0),this.raw(r)}fixed32(e){assertUInt32(e);var r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,e,!0),this.raw(r)}sfixed32(e){assertInt32(e);var r=new Uint8Array(4);return new DataView(r.buffer).setInt32(0,e,!0),this.raw(r)}sint32(e){return assertInt32(e),varint32write(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){var r=new Uint8Array(8),t=new DataView(r.buffer),e=PbLong.from(e);return t.setInt32(0,e.lo,!0),t.setInt32(4,e.hi,!0),this.raw(r)}fixed64(e){var r=new Uint8Array(8),t=new DataView(r.buffer),e=PbULong.from(e);return t.setInt32(0,e.lo,!0),t.setInt32(4,e.hi,!0),this.raw(r)}int64(e){e=PbLong.from(e);return varint64write(e.lo,e.hi,this.buf),this}sint64(e){var e=PbLong.from(e),r=e.hi>>31;return varint64write(e.lo<<1^r,(e.hi<<1|e.lo>>>31)^r,this.buf),this}uint64(e){e=PbULong.from(e);return varint64write(e.lo,e.hi,this.buf),this}}function binaryWriteOptions(e){return e?__spreadValues(__spreadValues({},defaultsWrite$1),e):defaultsWrite$1}function binaryReadOptions(e){return e?__spreadValues(__spreadValues({},defaultsRead$1),e):defaultsRead$1}!function(i){i.symbol=Symbol.for("protobuf-ts/unknown"),i.onRead=(e,r,t,a,n)=>{(s(r)?r[i.symbol]:r[i.symbol]=[]).push({no:t,wireType:a,data:n})},i.onWrite=(e,r,t)=>{for(var{no:a,wireType:n,data:s}of i.list(r))t.tag(a,n).raw(s)},i.list=(e,r)=>s(e)?(e=e[i.symbol],r?e.filter((e=>e.no==r)):e):[],i.last=(e,r)=>i.list(e,r).slice(-1)[0];const s=e=>e&&Array.isArray(e[i.symbol])}(UnknownFieldHandler=UnknownFieldHandler||{});const defaultsRead$1={readUnknownField:!0,readerFactory:e=>new BinaryReader(e)},defaultsWrite$1={writeUnknownFields:!0,writerFactory:()=>new BinaryWriter},MESSAGE_TYPE=(!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"}(WireType=WireType||{}),Symbol.for("protobuf-ts/message-type"));function lowerCamelCase(r){let t=!1;var a=[];for(let e=0;e!r.includes(e))))return!1;if(!n&&r.some((e=>!t.known.includes(e))))return!1;if(!(a<1)){for(const i of t.oneofs){const o=e[i];if(!isOneofGroup(o))return!1;if(void 0!==o.oneofKind){var s=this.fields.find((e=>e.localName===o.oneofKind));if(!s)return!1;if(!this.field(o[o.oneofKind],s,n,a))return!1}}for(const l of this.fields)if(void 0===l.oneof&&!this.field(e[l.localName],l,n,a))return!1}}return!0}field(e,r,t,a){var n=r.repeat;switch(r.kind){case"scalar":return void 0===e?r.opt:n?this.scalars(e,r.T,a,r.L):this.scalar(e,r.T,r.L);case"enum":return void 0===e?r.opt:n?this.scalars(e,ScalarType.INT32,a):this.scalar(e,ScalarType.INT32);case"message":return void 0===e?!0:n?this.messages(e,r.T(),t,a):this.message(e,r.T(),t,a);case"map":if("object"!=typeof e||null===e)return!1;if(a<2)return!0;if(!this.mapKeys(e,r.K,a))return!1;switch(r.V.kind){case"scalar":return this.scalars(Object.values(e),r.V.T,a,r.V.L);case"enum":return this.scalars(Object.values(e),ScalarType.INT32,a);case"message":return this.messages(Object.values(e),r.V.T(),t,a)}}return!0}message(e,r,t,a){return t?r.isAssignable(e,a):r.is(e,a)}messages(r,t,e,a){if(!Array.isArray(r))return!1;if(!(a<2))if(e){for(let e=0;eparseInt(e))),r,t);case ScalarType.BOOL:return this.scalars(a.slice(0,t).map((e=>"true"==e||"false"!=e&&e)),r,t);default:return this.scalars(a,r,t,LongType.STRING)}}}function typeofJsonValue(e){var r=typeof e;if("object"==r){if(Array.isArray(e))return"array";if(null===e)return"null"}return r}function isJsonObject(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}let encTable="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),decTable=[];for(let e=0;e>4,i=s,n=2;break;case 2:t[a++]=(15&i)<<4|(60&s)>>2,i=s,n=3;break;case 3:t[a++]=(3&i)<<6|s,n=0}}if(1==n)throw Error("invalid base64 string.");return t.subarray(0,a)}function base64encode(r){let t="",a=0,n,s=0;for(let e=0;e>2],s=(3&n)<<4,a=1;break;case 1:t+=encTable[s|n>>4],s=(15&n)<<2,a=2;break;case 2:t=(t+=encTable[s|n>>6])+encTable[63&n],a=0}return a&&(t=t+encTable[s]+"=",1==a&&(t+="=")),t}function reflectionLongConvert(e,r){switch(r){case LongType.BIGINT:return e.toBigInt();case LongType.NUMBER:return e.toNumber();default:return e.toString()}}decTable["-".charCodeAt(0)]=encTable.indexOf("+"),decTable["_".charCodeAt(0)]=encTable.indexOf("/");class ReflectionJsonReader{constructor(e){this.info=e}prepare(){var e;if(void 0===this.fMap){this.fMap={};for(const r of null!=(e=this.info.fields)?e:[])this.fMap[r.name]=r,this.fMap[r.jsonName]=r,this.fMap[r.localName]=r}}assert(e,r,t){if(!e){let e=typeofJsonValue(t);throw"number"!=e&&"boolean"!=e||(e=t.toString()),new Error(`Cannot parse JSON ${e} for ${this.info.typeName}#`+r)}}read(e,r,t){this.prepare();var a,n,s=[];for([a,n]of Object.entries(e)){var i=this.fMap[a];if(!i){if(t.ignoreUnknownFields)continue;throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: `+a)}var o=i.localName;let e;if(i.oneof){if(s.includes(i.oneof))throw new Error(`Multiple members of the oneof group "${i.oneof}" of ${this.info.typeName} are present in JSON.`);s.push(i.oneof),e=r[i.oneof]={oneofKind:o}}else e=r;if("map"==i.kind){if(null!==n){this.assert(isJsonObject(n),i.name,n);var l,c,u=e[o];for([l,c]of Object.entries(n)){this.assert(null!==c,i.name+" map value",null);let e;switch(i.V.kind){case"message":e=i.V.T().internalJsonRead(c,t);break;case"enum":if(!1===(e=this.enum(i.V.T(),c,i.name,t.ignoreUnknownFields)))continue;break;case"scalar":e=this.scalar(c,i.V.T,i.V.L,i.name)}this.assert(void 0!==e,i.name+" map value",c);let r=l;i.K==ScalarType.BOOL&&(r="true"==r||"false"!=r&&r),u[r=this.scalar(r,i.K,LongType.STRING,i.name).toString()]=e}}}else if(i.repeat){if(null!==n){this.assert(Array.isArray(n),i.name,n);var f=e[o];for(const p of n){this.assert(null!==p,i.name,null);let e;switch(i.kind){case"message":e=i.T().internalJsonRead(p,t);break;case"enum":if(!1===(e=this.enum(i.T(),p,i.name,t.ignoreUnknownFields)))continue;break;case"scalar":e=this.scalar(p,i.T,i.L,i.name)}this.assert(void 0!==e,i.name,n),f.push(e)}}}else switch(i.kind){case"message":null===n&&"google.protobuf.Value"!=i.T().typeName?this.assert(void 0===i.oneof,i.name+" (oneof member)",null):e[o]=i.T().internalJsonRead(n,t,e[o]);break;case"enum":var h=this.enum(i.T(),n,i.name,t.ignoreUnknownFields);!1!==h&&(e[o]=h);break;case"scalar":e[o]=this.scalar(n,i.T,i.L,i.name)}}}enum(r,t,a,n){if("google.protobuf.NullValue"==r[0]&&assert(null===t,`Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} only accepts null.`),null===t)return 0;switch(typeof t){case"number":return assert(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${a}, enum can only be integral number, got ${t}.`),t;case"string":let e=t;r[2]&&t.substring(0,r[2].length)===r[2]&&(e=t.substring(r[2].length));var s=r[1][e];return void 0===s&&n?!1:(assert("number"==typeof s,`Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} has no value for "${t}".`),s)}assert(!1,`Unable to parse field ${this.info.typeName}#${a}, cannot parse enum value from ${typeof t}".`)}scalar(r,t,a,e){let n;try{switch(t){case ScalarType.DOUBLE:case ScalarType.FLOAT:if(null===r)return 0;if("NaN"===r)return Number.NaN;if("Infinity"===r)return Number.POSITIVE_INFINITY;if("-Infinity"===r)return Number.NEGATIVE_INFINITY;if(""===r)n="empty string";else if("string"==typeof r&&r.trim().length!==r.length)n="extra whitespace";else if("string"==typeof r||"number"==typeof r){var s=Number(r);if(Number.isNaN(s))n="not a number";else{if(Number.isFinite(s))return t==ScalarType.FLOAT&&assertFloat32(s),s;n="too large or small"}}break;case ScalarType.INT32:case ScalarType.FIXED32:case ScalarType.SFIXED32:case ScalarType.SINT32:case ScalarType.UINT32:if(null===r)return 0;let e;if("number"==typeof r?e=r:""===r?n="empty string":"string"==typeof r&&(r.trim().length!==r.length?n="extra whitespace":e=Number(r)),void 0===e)break;return(t==ScalarType.UINT32?assertUInt32:assertInt32)(e),e;case ScalarType.INT64:case ScalarType.SFIXED64:case ScalarType.SINT64:if(null===r)return reflectionLongConvert(PbLong.ZERO,a);if("number"!=typeof r&&"string"!=typeof r)break;return reflectionLongConvert(PbLong.from(r),a);case ScalarType.FIXED64:case ScalarType.UINT64:if(null===r)return reflectionLongConvert(PbULong.ZERO,a);if("number"!=typeof r&&"string"!=typeof r)break;return reflectionLongConvert(PbULong.from(r),a);case ScalarType.BOOL:if(null===r)return!1;if("boolean"!=typeof r)break;return r;case ScalarType.STRING:if(null===r)return"";if("string"!=typeof r){n="extra whitespace";break}try{encodeURIComponent(r)}catch(e){0;break}return r;case ScalarType.BYTES:if(null===r||""===r)return new Uint8Array(0);if("string"!=typeof r)break;return base64decode(r)}}catch(e){n=e.message}this.assert(!1,e+(n?" - "+n:""),r)}}class ReflectionJsonWriter{constructor(e){this.fields=null!=(e=e.fields)?e:[]}write(e,r){var t,a,n={},s=e;for(const i of this.fields)i.oneof?(t=s[i.oneof]).oneofKind===i.localName&&(a="scalar"==i.kind||"enum"==i.kind?__spreadProps(__spreadValues({},r),{emitDefaultValues:!0}):r,assert(void 0!==(t=this.field(i,t[i.localName],a))),n[r.useProtoFieldName?i.name:i.jsonName]=t):void 0!==(a=this.field(i,s[i.localName],r))&&(n[r.useProtoFieldName?i.name:i.jsonName]=a);return n}field(r,t,a){let e=void 0;if("map"==r.kind){assert("object"==typeof t&&null!==t);var n={};switch(r.V.kind){case"scalar":for(var[s,i]of Object.entries(t)){i=this.scalar(r.V.T,i,r.name,!1,!0);assert(void 0!==i),n[s.toString()]=i}break;case"message":var o,l,c=r.V.T();for([o,l]of Object.entries(t)){var u=this.message(c,l,r.name,a);assert(void 0!==u),n[o.toString()]=u}break;case"enum":var f,h,p=r.V.T();for([f,h]of Object.entries(t)){assert(void 0===h||"number"==typeof h);var d=this.enum(p,h,r.name,!1,!0,a.enumAsInteger);assert(void 0!==d),n[f.toString()]=d}}(a.emitDefaultValues||0[e.no,e]))))}read(a,n,s,e){this.prepare();for(var r=void 0===e?a.len:a.pos+e;a.pose.no-r.no)))}write(n,s,i){this.prepare();for(const f of this.fields){let e,r,t=f.repeat,a=f.localName;if(f.oneof){var o=n[f.oneof];if(o.oneofKind!==a)continue;e=o[a],r=!0}else e=n[a],r=!1;switch(f.kind){case"scalar":case"enum":var l="enum"==f.kind?ScalarType.INT32:f.T;if(t)if(assert(Array.isArray(e)),t==RepeatType.PACKED)this.packed(s,l,f.no,e);else for(const h of e)this.scalar(s,l,f.no,h,!0);else void 0===e?assert(f.opt):this.scalar(s,l,f.no,e,r||f.opt);break;case"message":if(t){assert(Array.isArray(e));for(const p of e)this.message(s,i,f.T(),f.no,p)}else this.message(s,i,f.T(),f.no,e);break;case"map":assert("object"==typeof e&&null!==e);for(var[c,u]of Object.entries(e))this.mapEntry(s,i,f,c,u)}}var e=i.writeUnknownFields;!1!==e&&(!0===e?UnknownFieldHandler.onWrite:e)(this.info.typeName,n,s)}mapEntry(e,r,t,a,n){e.tag(t.no,WireType.LengthDelimited),e.fork();let s=a;switch(t.K){case ScalarType.INT32:case ScalarType.FIXED32:case ScalarType.UINT32:case ScalarType.SFIXED32:case ScalarType.SINT32:s=Number.parseInt(a);break;case ScalarType.BOOL:assert("true"==a||"false"==a),s="true"==a}switch(this.scalar(e,t.K,1,s,!0),t.V.kind){case"scalar":this.scalar(e,t.V.T,2,n,!0);break;case"enum":this.scalar(e,ScalarType.INT32,2,n,!0);break;case"message":this.message(e,r,t.V.T(),2,n)}e.join()}message(e,r,t,a,n){void 0!==n&&(t.internalBinaryWrite(n,e.tag(a,WireType.LengthDelimited).fork(),r),e.join())}scalar(e,r,t,a,n){var[r,s,i]=this.scalarInfo(r,a);i&&!n||(e.tag(t,r),e[s](a))}packed(r,e,t,a){if(a.length){assert(e!==ScalarType.BYTES&&e!==ScalarType.STRING),r.tag(t,WireType.LengthDelimited),r.fork();var[,n]=this.scalarInfo(e);for(let e=0;e=0;)t[e]=0}const a=256,i=286,n=30,s=15,r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),o=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),h=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=new Array(576);e(d);const _=new Array(60);e(_);const f=new Array(512);e(f);const c=new Array(256);e(c);const u=new Array(29);e(u);const w=new Array(n);function b(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let g,p,m;function k(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(w);const v=t=>t<256?f[t]:f[256+(t>>>7)],y=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<{x(t,a[2*e],a[2*e+1])},A=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},E=(t,e,a)=>{const i=new Array(16);let n,r,l=0;for(n=1;n<=s;n++)i[n]=l=l+a[n-1]<<1;for(r=0;r<=e;r++){let e=t[2*r+1];0!==e&&(t[2*r]=A(i[e]++,e))}},R=t=>{let e;for(e=0;e{t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},U=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n{let n,s,o,h,d=0;if(0!==t.last_lit)do{n=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===n?z(t,s,e):(o=c[s],z(t,o+a+1,e),h=r[o],0!==h&&(s-=u[o],x(t,s,h)),n--,o=v(n),z(t,o,i),h=l[o],0!==h&&(n-=w[o],x(t,n,h)))}while(d{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,r=e.stat_desc.elems;let l,o,h,d=-1;for(t.heap_len=0,t.heap_max=573,l=0;l>1;l>=1;l--)S(t,a,l);h=r;do{l=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=l,t.heap[--t.heap_max]=o,a[2*h]=a[2*l]+a[2*o],t.depth[h]=(t.depth[l]>=t.depth[o]?t.depth[l]:t.depth[o])+1,a[2*l+1]=a[2*o+1]=h,t.heap[1]=h++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,l=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,h=e.stat_desc.max_length;let d,_,f,c,u,w,b=0;for(c=0;c<=s;c++)t.bl_count[c]=0;for(a[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)_=t.heap[d],c=a[2*a[2*_+1]+1]+1,c>h&&(c=h,b++),a[2*_+1]=c,_>i||(t.bl_count[c]++,u=0,_>=o&&(u=l[_-o]),w=a[2*_],t.opt_len+=w*(c+u),r&&(t.static_len+=w*(n[2*_+1]+u)));if(0!==b){do{for(c=h-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[h]--,b-=2}while(b>0);for(c=h;0!==c;c--)for(_=t.bl_count[c];0!==_;)f=t.heap[--d],f>i||(a[2*f+1]!==c&&(t.opt_len+=(c-a[2*f+1])*a[2*f],a[2*f+1]=c),_--)}})(t,e),E(a,d,t.bl_count)},O=(t,e,a)=>{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++l{let i,n,s=-1,r=e[1],l=0,o=7,h=4;for(0===r&&(o=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++l{x(t,0+(i?1:0),3),((t,e,a,i)=>{Z(t),i&&(y(t,a),y(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a})(t,e,a,!0)};var N={_tr_init:t=>{F||((()=>{let t,e,a,h,k;const v=new Array(16);for(a=0,h=0;h<28;h++)for(u[h]=a,t=0;t<1<>=7;h{let s,r,l=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e{let e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),T(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=i+5,i+4<=s&&-1!==e?L(t,e,i,n):4===t.strategy||r===s?(x(t,2+(n?1:0),3),D(t,d,_)):(x(t,4+(n?1:0),3),((t,e,a,i)=>{let n;for(x(t,e-257,5),x(t,a-1,5),x(t,i-4,4),n=0;n(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(c[i]+a+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{x(t,2,3),z(t,256,d),(t=>{16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var B=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const C=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var M=(t,e,a,i)=>{const n=C,s=i+a;t^=-1;for(let a=i;a>>8^n[255&(t^e[a])];return-1^t},H={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:K,_tr_stored_block:P,_tr_flush_block:Y,_tr_tally:G,_tr_align:X}=N,{Z_NO_FLUSH:W,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:V,Z_OK:$,Z_STREAM_END:tt,Z_STREAM_ERROR:et,Z_DATA_ERROR:at,Z_BUF_ERROR:it,Z_DEFAULT_COMPRESSION:nt,Z_FILTERED:st,Z_HUFFMAN_ONLY:rt,Z_RLE:lt,Z_FIXED:ot,Z_DEFAULT_STRATEGY:ht,Z_UNKNOWN:dt,Z_DEFLATED:_t}=j,ft=258,ct=262,ut=103,wt=113,bt=666,gt=(t,e)=>(t.msg=H[e],e),pt=t=>(t<<1)-(t>4?9:0),mt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let kt=(t,e,a)=>(e<{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},yt=(t,e)=>{Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vt(t.strm)},xt=(t,e)=>{t.pending_buf[t.pending++]=e},zt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=B(t.adler,e,n,a):2===t.state.wrap&&(t.adler=M(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},Et=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,l=t.nice_match;const o=t.strstart>t.w_size-ct?t.strstart-(t.w_size-ct):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ft;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),l>t.lookahead&&(l=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&sr){if(t.match_start=e,r=i,i>=l)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>o&&0!=--n);return r<=t.lookahead?r:t.lookahead},Rt=t=>{const e=t.w_size;let a,i,n,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-ct)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,a=i;do{n=t.head[--a],t.head[a]=n>=e?n-e:0}while(--i);i=e,a=i;do{n=t.prev[--a],t.prev[a]=n>=e?n-e:0}while(--i);s+=e}if(0===t.strm.avail_in)break;if(i=At(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=kt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=kt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead{let a,i;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-ct&&(t.match_length=Et(t,a)),t.match_length>=3)if(i=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=kt(t,t.ins_h,t.window[t.strstart+1]);else i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2},Ut=(t,e)=>{let a,i,n;for(;;){if(t.lookahead=3&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=kt(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(yt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=G(t,0,t.window[t.strstart-1]),i&&yt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2};function St(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const Dt=[new St(0,0,0,0,((t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Rt(t),0===t.lookahead&&e===W)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const i=t.block_start+a;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,yt(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-ct&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(yt(t,!1),t.strm.avail_out),1)})),new St(4,4,8,4,Zt),new St(4,5,16,8,Zt),new St(4,6,32,32,Zt),new St(4,4,16,16,Ut),new St(8,16,32,32,Ut),new St(8,16,128,128,Ut),new St(8,32,128,256,Ut),new St(32,128,258,1024,Ut),new St(32,258,258,4096,Ut)];function Tt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_t,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),mt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ot=t=>{if(!t||!t.state)return gt(t,et);t.total_in=t.total_out=0,t.data_type=dt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:wt,t.adler=2===e.wrap?0:1,e.last_flush=W,K(e),$},It=t=>{const e=Ot(t);var a;return e===$&&((a=t.state).window_size=2*a.w_size,mt(a.head),a.max_lazy_match=Dt[a.level].max_lazy,a.good_match=Dt[a.level].good_length,a.nice_match=Dt[a.level].nice_length,a.max_chain_length=Dt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ft=(t,e,a,i,n,s)=>{if(!t)return et;let r=1;if(e===nt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==_t||i<8||i>15||e<0||e>9||s<0||s>ot)return gt(t,et);8===i&&(i=9);const l=new Tt;return t.state=l,l.strm=t,l.wrap=r,l.gzhead=null,l.w_bits=i,l.w_size=1<Ft(t,e,_t,15,8,ht),deflateInit2:Ft,deflateReset:It,deflateResetKeep:Ot,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?et:(t.state.gzhead=e,$):et,deflate:(t,e)=>{let a,i;if(!t||!t.state||e>V||e<0)return t?gt(t,et):et;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return gt(t,0===t.avail_out?it:et);n.strm=t;const s=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=M(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=rt||n.level<2?4:0),xt(n,3),n.status=wt);else{let e=_t+(n.w_bits-8<<4)<<8,a=-1;a=n.strategy>=rt||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=a<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=wt,zt(n,e),0!==n.strstart&&(zt(n,t.adler>>>16),zt(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),vt(t),a=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindexa&&(t.adler=M(t.adler,n.pending_buf,n.pending-a,a)),0===i&&(n.status=ut)}else n.status=ut;if(n.status===ut&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&vt(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=wt)):n.status=wt),0!==n.pending){if(vt(t),0===t.avail_out)return n.last_flush=-1,$}else if(0===t.avail_in&&pt(e)<=pt(s)&&e!==Q)return gt(t,it);if(n.status===bt&&0!==t.avail_in)return gt(t,it);if(0!==t.avail_in||0!==n.lookahead||e!==W&&n.status!==bt){let a=n.strategy===rt?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(Rt(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_length=0,a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===lt?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=ft){if(Rt(t),t.lookahead<=ft&&e===W)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+ft;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(yt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(yt(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(yt(t,!1),0===t.strm.avail_out)?1:2})(n,e):Dt[n.level].func(n,e);if(3!==a&&4!==a||(n.status=bt),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),$;if(2===a&&(e===q?X(n):e!==V&&(P(n,0,0,!1),e===J&&(mt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),vt(t),0===t.avail_out))return n.last_flush=-1,$}return e!==Q?$:n.wrap<=0?tt:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(zt(n,t.adler>>>16),zt(n,65535&t.adler)),vt(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?$:tt)},deflateEnd:t=>{if(!t||!t.state)return et;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==ut&&e!==wt&&e!==bt?gt(t,et):(t.state=null,e===wt?gt(t,at):$)},deflateSetDictionary:(t,e)=>{let a=e.length;if(!t||!t.state)return et;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return et;if(1===n&&(t.adler=B(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Rt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=kt(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,Rt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=l,t.avail_in=s,i.wrap=n,$},deflateInfo:"pako deflate (from Nodeca project)"};const Nt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Bt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Nt(a,e)&&(t[e]=a[e])}}return t},Ct=t=>{let e=0;for(let a=0,i=t.length;a=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Ht[254]=Ht[254]=1;var jt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,l=0;for(n=0;n>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},Kt=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Mt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Ht[t[a]]>e?a:e};var Yt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_SYNC_FLUSH:Wt,Z_FULL_FLUSH:qt,Z_FINISH:Jt,Z_OK:Qt,Z_STREAM_END:Vt,Z_DEFAULT_COMPRESSION:$t,Z_DEFAULT_STRATEGY:te,Z_DEFLATED:ee}=j;function ae(t){this.options=Bt({level:$t,method:ee,chunkSize:16384,windowBits:15,memLevel:8,strategy:te},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Lt.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Qt)throw new Error(H[a]);if(e.header&&Lt.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?jt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=Lt.deflateSetDictionary(this.strm,t),a!==Qt)throw new Error(H[a]);this._dict_set=!0}}function ie(t,e){const a=new ae(e);if(a.push(t,!0),a.err)throw a.msg||H[a.err];return a.result}ae.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Jt:Xt,"string"==typeof t?a.input=jt(t):"[object ArrayBuffer]"===Gt.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===Wt||s===qt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=Lt.deflate(a,s),n===Vt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=Lt.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},ae.prototype.onData=function(t){this.chunks.push(t)},ae.prototype.onEnd=function(t){t===Qt&&(this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var ne={Deflate:ae,deflate:ie,deflateRaw:function(t,e){return(e=e||{}).raw=!0,ie(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,ie(t,e)},constants:j};var se=function(t,e){let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),l=E.dmax,o=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,b=(1<>>24,f>>>=m,c-=m,m=p>>>16&255,0===m)A[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=u[(65535&p)+(f&(1<>>=m,c-=m),c<15&&(f+=z[a++]<>>24,f>>>=m,c-=m,m=p>>>16&255,!(16&m)){if(0==(64&m)){p=w[(65535&p)+(f&(1<l){t.msg="invalid distance too far back",E.mode=30;break t}if(f>>>=m,c-=m,m=n-s,v>m){if(m=v-m,m>h&&E.sane){t.msg="invalid distance too far back",E.mode=30;break t}if(y=0,x=_,0===d){if(y+=o-m,m2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a>3,a-=k,c-=k<<3,f&=(1<{const o=l.bits;let h,d,_,f,c,u,w=0,b=0,g=0,p=0,m=0,k=0,v=0,y=0,x=0,z=0,A=null,E=0;const R=new Uint16Array(16),Z=new Uint16Array(16);let U,S,D,T=null,O=0;for(w=0;w<=re;w++)R[w]=0;for(b=0;b=1&&0===R[p];p--);if(m>p&&(m=p),0===p)return n[s++]=20971520,n[s++]=20971520,l.bits=1,0;for(g=1;g0&&(0===t||1!==p))return-1;for(Z[1]=0,w=1;w852||2===t&&x>592)return 1;for(;;){U=w-v,r[b]u?(S=T[O+r[b]],D=A[E+r[b]]):(S=96,D=0),h=1<>v)+d]=U<<24|S<<16|D|0}while(0!==d);for(h=1<>=1;if(0!==h?(z&=h-1,z+=h):z=0,b++,0==--R[w]){if(w===p)break;w=e[a+r[b]]}if(w>m&&(z&f)!==_){for(0===v&&(v=m),c+=g,k=w-v,y=1<852||2===t&&x>592)return 1;_=z&f,n[_]=m<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),l.bits=m,0};const{Z_FINISH:fe,Z_BLOCK:ce,Z_TREES:ue,Z_OK:we,Z_STREAM_END:be,Z_NEED_DICT:ge,Z_STREAM_ERROR:pe,Z_DATA_ERROR:me,Z_MEM_ERROR:ke,Z_BUF_ERROR:ve,Z_DEFLATED:ye}=j,xe=12,ze=30,Ae=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Ee(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Re=t=>{if(!t||!t.state)return pe;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,we},Ze=t=>{if(!t||!t.state)return pe;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Re(t)},Ue=(t,e)=>{let a;if(!t||!t.state)return pe;const i=t.state;return e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?pe:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,Ze(t))},Se=(t,e)=>{if(!t)return pe;const a=new Ee;t.state=a,a.window=null;const i=Ue(t,e);return i!==we&&(t.state=null),i};let De,Te,Oe=!0;const Ie=t=>{if(Oe){De=new Int32Array(512),Te=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(_e(1,t.lens,0,288,De,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;_e(2,t.lens,0,32,Te,0,t.work,{bits:5}),Oe=!1}t.lencode=De,t.lenbits=9,t.distcode=Te,t.distbits=5},Fe=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whaveSe(t,15),inflateInit2:Se,inflate:(t,e)=>{let a,i,n,s,r,l,o,h,d,_,f,c,u,w,b,g,p,m,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return pe;a=t.state,a.mode===xe&&(a.mode=13),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,_=l,f=o,x=we;t:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=ze;break}if((15&h)!==ye){t.msg="unknown compression method",a.mode=ze;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits)a.wbits=y;else if(y>a.wbits){t.msg="invalid window size",a.mode=ze;break}a.dmax=1<>8&1),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=M(a.check,A,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>8),512&a.flags&&(A[0]=255&h,A[1]=h>>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===l)break t;l--,h+=i[s++]<>>8&255,a.check=M(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&(c=a.length,c>l&&(c=l),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&(a.check=M(a.check,i,c,s)),l-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===l)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=xe;break;case 10:for(;d<32;){if(0===l)break t;l--,h+=i[s++]<>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===l)break t;l--,h+=i[s++]<>>=1,d-=1,3&h){case 0:a.mode=14;break;case 1:if(Ie(a),a.mode=20,e===ue){h>>>=2,d-=2;break t}break;case 2:a.mode=17;break;case 3:t.msg="invalid block type",a.mode=ze}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===l)break t;l--,h+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",a.mode=ze;break}if(a.length=65535&h,h=0,d=0,a.mode=15,e===ue)break t;case 15:a.mode=16;case 16:if(c=a.length,c){if(c>l&&(c=l),c>o&&(c=o),0===c)break t;n.set(i.subarray(s,s+c),r),l-=c,s+=c,o-=c,r+=c,a.length-=c;break}a.mode=xe;break;case 17:for(;d<14;){if(0===l)break t;l--,h+=i[s++]<>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=ze;break}a.have=0,a.mode=18;case 18:for(;a.have>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=_e(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=ze;break}a.have=0,a.mode=19;case 19:for(;a.have>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=b,d-=b,a.lens[a.have++]=p;else{if(16===p){for(R=b+2;d>>=b,d-=b,0===a.have){t.msg="invalid bit length repeat",a.mode=ze;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===p){for(R=b+3;d>>=b,d-=b,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=b+7;d>>=b,d-=b,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=ze;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===ze)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=ze;break}if(a.lenbits=9,E={bits:a.lenbits},x=_e(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=ze;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=_e(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=ze;break}if(a.mode=20,e===ue)break t;case 20:a.mode=21;case 21:if(l>=6&&o>=258){t.next_out=r,t.avail_out=o,t.next_in=s,t.avail_in=l,a.hold=h,a.bits=d,se(t,f),r=t.next_out,n=t.output,o=t.avail_out,s=t.next_in,i=t.input,l=t.avail_in,h=a.hold,d=a.bits,a.mode===xe&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,a.length=p,0===g){a.mode=26;break}if(32&g){a.back=-1,a.mode=xe;break}if(64&g){t.msg="invalid literal/length code",a.mode=ze;break}a.extra=15&g,a.mode=22;case 22:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;z=a.distcode[h&(1<>>24,g=z>>>16&255,p=65535&z,!(b<=d);){if(0===l)break t;l--,h+=i[s++]<>m)],b=z>>>24,g=z>>>16&255,p=65535&z,!(m+b<=d);){if(0===l)break t;l--,h+=i[s++]<>>=m,d-=m,a.back+=m}if(h>>>=b,d-=b,a.back+=b,64&g){t.msg="invalid distance code",a.mode=ze;break}a.offset=p,a.extra=15&g,a.mode=24;case 24:if(a.extra){for(R=a.extra;d>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=ze;break}a.mode=25;case 25:if(0===o)break t;if(c=f-o,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=ze;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>o&&(c=o),o-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=21);break;case 26:if(0===o)break t;n[r++]=a.length,o--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===l)break t;l--,h|=i[s++]<{if(!t||!t.state)return pe;let e=t.state;return e.window&&(e.window=null),t.state=null,we},inflateGetHeader:(t,e)=>{if(!t||!t.state)return pe;const a=t.state;return 0==(2&a.wrap)?pe:(a.head=e,e.done=!1,we)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return t&&t.state?(i=t.state,0!==i.wrap&&11!==i.mode?pe:11===i.mode&&(n=1,n=B(n,e,a,0),n!==i.check)?me:(s=Fe(t,e,a,a),s?(i.mode=31,ke):(i.havedict=1,we))):pe},inflateInfo:"pako inflate (from Nodeca project)"};var Ne=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Be=Object.prototype.toString,{Z_NO_FLUSH:Ce,Z_FINISH:Me,Z_OK:He,Z_STREAM_END:je,Z_NEED_DICT:Ke,Z_STREAM_ERROR:Pe,Z_DATA_ERROR:Ye,Z_MEM_ERROR:Ge}=j;function Xe(t){this.options=Bt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Yt,this.strm.avail_out=0;let a=Le.inflateInit2(this.strm,e.windowBits);if(a!==He)throw new Error(H[a]);if(this.header=new Ne,Le.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=jt(e.dictionary):"[object ArrayBuffer]"===Be.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Le.inflateSetDictionary(this.strm,e.dictionary),a!==He)))throw new Error(H[a])}function We(t,e){const a=new Xe(e);if(a.push(t),a.err)throw a.msg||H[a.err];return a.result}Xe.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,l;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Me:Ce,"[object ArrayBuffer]"===Be.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Le.inflate(a,r),s===Ke&&n&&(s=Le.inflateSetDictionary(a,n),s===He?s=Le.inflate(a,r):s===Ye&&(s=Ke));a.avail_in>0&&s===je&&a.state.wrap>0&&0!==t[a.next_in];)Le.inflateReset(a),s=Le.inflate(a,r);switch(s){case Pe:case Ye:case Ke:case Ge:return this.onEnd(s),this.ended=!0,!1}if(l=a.avail_out,a.next_out&&(0===a.avail_out||s===je))if("string"===this.options.to){let t=Pt(a.output,a.next_out),e=a.next_out-t,n=Kt(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==He||0!==l){if(s===je)return s=Le.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},Xe.prototype.onData=function(t){this.chunks.push(t)},Xe.prototype.onEnd=function(t){t===He&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Xe,inflate:We,inflateRaw:function(t,e){return(e=e||{}).raw=!0,We(t,e)},ungzip:We,constants:j};const{Deflate:Je,deflate:Qe,deflateRaw:Ve,gzip:$e}=ne,{Inflate:ta,inflate:ea,inflateRaw:aa,ungzip:ia}=qe;var na=Je,sa=Qe,ra=Ve,la=$e,oa=ta,ha=ea,da=aa,_a=ia,fa=j,ca={Deflate:na,deflate:sa,deflateRaw:ra,gzip:la,Inflate:oa,inflate:ha,inflateRaw:da,ungzip:_a,constants:fa};t.Deflate=na,t.Inflate=oa,t.constants=fa,t.default=ca,t.deflate=sa,t.deflateRaw=ra,t.gzip=la,t.inflate=ha,t.inflateRaw=da,t.ungzip=_a,Object.defineProperty(t,"__esModule",{value:!0})})); - /****************** initialization finish ******************/ - // 先拆分B站gRPC校验头和protobuf数据体 - let header = rawBody.slice(0, 5); - body = rawBody.slice(5); - // 处理response压缩protobuf数据体 - switch (header?.[0]) { - case 0: // unGzip - break; - case 1: // Gzip - body = pako.ungzip(body); - header[0] = 0; // unGzip - break; - }; - // 解析链接并处理protobuf数据 - switch (HOST) { - case "grpc.biliapi.net": // HTTP/2 - case "app.bilibili.com": // HTTP/1.1 - /****************** initialization start *******************/ - // google.protobuf.Any - class Any$Type extends MessageType{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(message,type){return{typeUrl:this.typeNameToUrl(type.typeName),value:type.toBinary(message),}}unpack(any,type,options){if(!this.contains(any,type))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+any.typeUrl+"' as "+type.typeName+".");return type.fromBinary(any.value,options)}contains(any,type){if(!any.typeUrl.length)return false;let wants=typeof type=="string"?type:type.typeName;let has=this.typeUrlToName(any.typeUrl);return wants===has}internalJsonWrite(any,options){if(any.typeUrl==="")return{};let typeName=this.typeUrlToName(any.typeUrl);let opt=jsonWriteOptions(options);let type=opt.typeRegistry?.find(t=>t.typeName===typeName);if(!type)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+any.typeUrl+"' to JSON. The specified type "+typeName+" is not available in the type registry.");let value=type.fromBinary(any.value,{readUnknownField:false});let json=type.internalJsonWrite(value,opt);if(typeName.startsWith("google.protobuf.")||!isJsonObject(json))json={value:json};json["@type"]=any.typeUrl;return json}internalJsonRead(json,options,target){if(!isJsonObject(json))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+typeofJsonValue(json)+".");if(typeof json["@type"]!="string"||json["@type"]=="")return this.create();let typeName=this.typeUrlToName(json["@type"]);let type=options?.typeRegistry?.find(t=>t.typeName==typeName);if(!type)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+typeName+" is not available in the type registry.");let value;if(typeName.startsWith("google.protobuf.")&&json.hasOwnProperty("value"))value=type.fromJson(json["value"],options);else{let copy=Object.assign({},json);delete copy["@type"];value=type.fromJson(copy,options)}if(target===undefined)target=this.create();target.typeUrl=json["@type"];target.value=type.toBinary(value);return target}typeNameToUrl(name){if(!name.length)throw new Error("invalid type name: "+name);return"type.googleapis.com/"+name}typeUrlToName(url){if(!url.length)throw new Error("invalid type url: "+url);let slash=url.lastIndexOf("/");let name=slash>0?url.substring(slash+1):url;if(!name.length)throw new Error("invalid type url: "+url);return name}create(value){const message={typeUrl:"",value:new Uint8Array(0)};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posPlayArcConf}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posArcConf}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posExtraContent}])}create(value){const message={isSupport:false,disabled:false};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posDynamicList},{no:2,name:"up_list",kind:"message",T:()=>CardVideoUpList},{no:3,name:"topic_list",kind:"message",T:()=>TopicList}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posCardVideoUpList}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posDynamicItem}])}create(value){const message={list:[]};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos["DynamicType",DynamicType]}])}create(value){const message={cardType:0};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos { - if (item.cardType !== 15) { - return true; - } - $.log(`🎉 ${$.name}`, "动态综合页广告动态去除"); - return false; - } - ); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置动态综合页广告动态不去除"); - break; - } - body = DynAllReply.toBinary(data); - break; - case "DynVideo": // 动态视频页 - data = DynVideoReply.fromBinary(body); - switch (Settings?.Detail?.Most_visited) { - case true: - default: - if (data.videoUpList) { - data.videoUpList = null; - $.log(`🎉 ${$.name}`, "动态视频页最常访问去除"); - } - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置动态视频页最常访问不去除"); - break; - } - body = DynVideoReply.toBinary(data); - break; - } - break; - case "bilibili.app.view.v1.View": // 视频 - switch (PATHs?.[1]) { - case "View": // 视频播放页 - /****************** initialization start *******************/ - // protobuf/bilibili/app/view/view.proto - class ViewReply$Type extends MessageType{constructor(){super("ViewReply",[{no:6,name:"t_icon",kind:"map",K:9,V:{kind:"message",T:()=>TIcon}},{no:10,name:"relates",kind:"message",repeat:1,T:()=>Relate},{no:30,name:"cms",kind:"message",repeat:1,T:()=>CM},{no:31,name:"cm_config",kind:"message",T:()=>CMConfig}])}create(value){const message={tIcon:{},relates:[],cms:[]};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posAny}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posAny}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posCM}])}create(value){const message={};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos { - if (item.goto === "cm") { - $.log(`🎉 ${$.name}`, "播放页关联推荐广告去除"); - return false; - } - return true; - }); - } - const adsControlValue = data.cmConfig?.adsControl?.value; - if (Boolean(adsControlValue) && Object.values(adsControlValue).length !== 0) { - data.cmConfig = null; - $.log(`🎉 ${$.name}`, "up主推荐广告弹幕去除"); - } - for (const i in data.tIcon) { - if (data.tIcon[i] === null) { - // 解决tIcon的null is not an object问题 - // console.log(`tIconMap:${i}`); - delete data.tIcon[i]; - } - } - body = ViewReply.toBinary(data); - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置播放页广告不去除"); - break; - }; - break; - } - break; - case "bilibili.community.service.dm.v1.DM": //弹幕配置 - switch (PATHs?.[1]) { - case "DmView": // 弹幕 - //待补充 - break; - } - break; - case "bilibili.pgc.gateway.player.v2.PlayURL": // 番剧 - /****************** initialization start *******************/ - /****************** initialization finish *******************/ - switch (PATHs?.[1]) { - case "PlayView": { // 播放地址 - /****************** initialization start *******************/ - /****************** initialization finish *******************/ - break; - }; - case "PlayConf": // 播放配置 - break; - }; - break; - case "bilibili.app.nativeact.v1.NativeAct": // 活动-节目、动画、韩综(港澳台) - switch (PATHs?.[1]) { - case "Index": // 首页 - break; - }; - break; - case "bilibili.app.interface.v1.Search": // 搜索框 - switch (PATHs?.[1]) { - case "Suggest3": // 搜索建议 - break; - }; - break; - case "bilibili.polymer.app.search.v1.Search": // 搜索结果 - /****************** initialization start *******************/ - /****************** initialization finish *******************/ - switch (PATHs?.[1]) { - case "SearchAll": { // 全部结果(综合) - /****************** initialization start *******************/ - class SearchAllResponse$Type extends MessageType{constructor(){super("SearchAllResponse",[{no:4,name:"item",kind:"message",repeat:1,T:()=>Item}])}create(value){const message={item:[]};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.posSearchAdCard}])}create(value){const message={cardItem:{oneofKind:undefined}};globalThis.Object.defineProperty(message,MESSAGE_TYPE,{enumerable:false,value:this});if(value!==undefined)reflectionMergePartial(this,message,value);return message}internalBinaryRead(reader,length,options,target){let message=target??this.create(),end=reader.pos+length;while(reader.pos !(i.cardItem?.oneofKind === "cm")); - $.log(`🎉 ${$.name}`, "搜索页广告去除"); - body = SearchAllResponse.toBinary(data); - break; - case false: - $.log(`🚧 ${$.name}`, "用户设置搜索页广告不去除"); - break; - } - break; - }; - case "SearchByType": { // 分类结果(番剧、用户、影视、专栏) - break; - }; - }; - break; - }; - break; - }; - // protobuf部分处理完后,重新计算并添加B站gRPC校验头 - rawBody = newRawBody({ header, body }); // gzip压缩有问题,别用 - break; - }; - // 写入二进制数据 - if ($.isQuanX()) $response.bodyBytes = rawBody - else $response.body = rawBody; - break; - }; - break; - case "false": - break; - }; + const { Settings, Caches, Configs } = setENV('BiliBili', 'ADBlock', DataBase); + switch (Settings?.Switch) { + case true: + default: + let url = URL.parse($request?.url); + const METHOD = $request?.method, + HOST = url?.host, + PATH = url?.path, + PATHs = PATH.split('/'); + // 解析格式 + const FORMAT = ( + $response?.headers?.['Content-Type'] ?? + $response?.headers?.['content-type'] + )?.split(';')?.[0]; + $.log( + `⚠ ${$.name}`, + `METHOD: ${METHOD}`, + `HOST: ${HOST}`, + `PATH: ${PATH}`, + `PATHs: ${PATHs}`, + `FORMAT: ${FORMAT}`, + '' + ); + // 创建空数据 + let body = { code: 0, message: '0', data: {} }; + // 格式判断 + switch (FORMAT) { + case undefined: // 视为无body + break; + case 'application/x-www-form-urlencoded': + case 'text/plain': + case 'text/html': + default: + break; + case 'text/xml': + case 'text/plist': + case 'application/xml': + case 'application/plist': + case 'application/x-plist': + break; + case 'text/json': + case 'application/json': + body = JSON.parse($response.body); + // 解析链接 + switch (HOST) { + case 'www.bilibili.com': + break; + case 'app.bilibili.com': + case 'app.biliapi.net': + switch (PATH) { + case 'x/v2/splash/show': // 开屏页 + case 'x/v2/splash/list': // 开屏页 + case 'x/v2/splash/brand/list': // 开屏页 + case 'x/v2/splash/event/list2': // 开屏页 + switch (Settings?.Detail?.splash) { + case true: + default: + const item = ['account', 'event_list', 'preload', 'show']; + if (body.data) { + item.forEach((i) => { + delete body.data[i]; + }); + $.log(`🎉 ${$.name}`, '开屏页广告去除'); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置开屏页广告不去除'); + break; + } + break; + case 'x/v2/feed/index': // 推荐页 + switch (Settings?.Detail?.feed) { + case true: + default: + if (body.data.items?.length) { + let params = url?.params; //区分pad与phone + body.data.items = await Promise.all( + body.data.items.map(async (item) => { + const { card_type: cardType, card_goto: cardGoto } = + item; + if (cardType && cardGoto) { + if ( + ['banner_v8', 'banner_ipad_v8'].includes( + cardType + ) && + cardGoto === 'banner' + ) { + switch (Settings?.Detail?.activity) { + case true: + default: + Caches.banner_hash = item.hash; + $.setjson( + Caches, + '@BiliBili.ADBlock.Caches' + ); // 获取banner_hash,无此字段会有活动页且此字段无法伪造. + $.log(`🎉 ${$.name}`, '推荐页活动大图去除'); + return undefined; + case false: + if (item.banner_item) { + item.banner_item = + item.banner_item.filter((i) => { + if (i.type === 'ad') { + $.log( + `🎉 ${$.name}`, + '推荐页大图广告去除' + ); + return false; + } + return true; + }); + } + break; + } + } else if ( + ['cm_v2', 'cm_v1'].includes(cardType) && + ['ad_web_s', 'ad_av', 'ad_web_gif'].includes( + cardGoto + ) + ) { + // ad_player大视频广告 ad_web_gif大gif广告 ad_web_s普通小广告 ad_av创作推广广告 ad_inline_3d 上方大的视频3d广告 ad_inline_eggs 上方大的视频广告 + $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); + if (params.device !== 'phone') { + return undefined; //pad直接去除 + } else { + await fixPosition().then( + (result) => (item = result) + ); //小广告补位 + } + } else if ( + cardType === 'cm_v2' && + [ + 'ad_player', + 'ad_inline_3d', + 'ad_inline_eggs', + ].includes(cardGoto) + ) { + $.log(`🎉 ${$.name}`, `${cardGoto}广告去除`); + return undefined; //大广告直接去除 + } else if ( + cardType === 'small_cover_v10' && + cardGoto === 'game' + ) { + $.log(`🎉 ${$.name}`, '游戏广告去除'); + if (params.device !== 'phone') { + return undefined; //pad直接去除 + } else { + await fixPosition().then( + (result) => (item = result) + ); //小广告补位 + } + } else if ( + cardType === 'cm_double_v9' && + cardGoto === 'ad_inline_av' + ) { + $.log(`🎉 ${$.name}`, '大视频广告去除'); + return undefined; //大广告直接去除 + } + } + return item; + }) + ); + body.data.items = body.data.items.filter( + (fix) => fix !== undefined + ); + } + async function fixPosition() { + let itemsCache = $.getdata( + '@BiliBili.Index.Caches', + '' + ); + let singleItem = {}; + if (itemsCache && itemsCache.length > 0) { + singleItem = itemsCache.pop(); + $.log(`🎉 ${$.name}`, '推荐页空缺位填充成功'); + } else { + //重新获取填充位 + const myRequest = { + url: $request.url, + headers: $request.heders, + }; + await $.http.get(myRequest).then((response) => { + try { + const body = $.toObj(response.body); + if (body?.code === 0 && body?.message === '0') { + body.data.items = body.data.items + .map((item) => { + const { + card_type: cardType, + card_goto: cardGoto, + } = item; + if (cardType && cardGoto) { + if ( + cardType === 'banner_v8' && + cardGoto === 'banner' + ) { + return undefined; + } else if ( + cardType === 'cm_v2' && + [ + 'ad_web_s', + 'ad_av', + 'ad_web_gif', + 'ad_player', + 'ad_inline_3d', + 'ad_inline_eggs', + ].includes(cardGoto) + ) { + return undefined; + } else if ( + cardType === 'small_cover_v10' && + cardGoto === 'game' + ) { + return undefined; + } else if ( + cardType === 'cm_double_v9' && + cardGoto === 'ad_inline_av' + ) { + return undefined; + } else if ( + cardType === 'large_cover_v9' && + cardGoto === 'inline_av_v2' + ) { + //补位不需要大视频 + return undefined; + } + } + return item; + }) + .filter((fix) => fix !== undefined); + $.setdata( + body.data.items, + '@BiliBili.Index.Caches' + ); + $.log(`🎉 ${$.name}`, '推荐页缓存数组补充成功'); + } else { + $.log(`🚧 ${$.name}`, '访问推荐页尝试填补失败'); + } + } catch (e) { + $.logErr(e, response); + } + }); + itemsCache = $.getdata('@BiliBili.Index.Caches', ''); + if (itemsCache.length > 0) { + singleItem = itemsCache.pop(); + $.log(`🎉 ${$.name}`, '推荐页空缺位填充成功'); + } + } + $.setdata(itemsCache, '@BiliBili.Index.Caches'); + return singleItem; + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置推荐页广告不去除'); + break; + } + break; + case 'x/v2/feed/index/story': // 首页短视频流 + switch (Settings?.Detail?.story) { + case true: + default: + if (body.data?.items) { + // vertical_live 直播内容 + // vertical_pgc 大会员专享 + body.data.items = body.data.items.filter( + (i) => + !( + i.hasOwnProperty('ad_info') || + ['vertical_ad_av', 'vertical_pgc'].includes( + i.card_goto + ) + ) + ); + $.log(`🎉 ${$.name}`, '首页短视频流广告去除'); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置首页短视频流广告不去除'); + break; + } + break; + case 'x/v2/search/square': // 搜索页 + switch (Settings?.Detail?.Hot_search) { + case true: + default: + body.data = body.data.filter( + (i) => !(i.type === 'trending') + ); + $.log(`🎉 ${$.name}`, '搜索页热搜内容去除'); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置搜索页热搜内容不去除'); + break; + } + break; + } + break; + case 'api.bilibili.com': + case 'api.biliapi.net': + switch (PATH) { + case 'pgc/player/api/playurl': // 番剧-播放地址-api + case 'pgc/player/web/playurl': // 番剧-播放地址-web + case 'pgc/player/web/playurl/html5': // 番剧-播放地址-web-HTML5 + break; + case 'pgc/view/v2/app/season': // 番剧页面-内容-app + break; + case 'pgc/view/web/season': // 番剧-内容-web + case 'pgc/view/pc/season': // 番剧-内容-pc + break; + case 'pgc/page/bangumi': // 追番页 + case 'pgc/page/cinema/tab': // 观影页 + switch (Settings?.Detail?.cinema) { + case true: + default: + if (body.result?.modules) { + body.result.modules.forEach((i) => { + if (i.style.startsWith('banner')) { + i.items = i.items.filter((j) => + j.link.includes('play') + ); + } else if (i.style.startsWith('function')) { + i.items = i.items.filter((j) => + j.blink.startsWith('bilibili') + ); + } else if ( + [241, 1283, 1284, 1441].includes(i.module_id) + ) { + i.items = []; + } else if (i.style.startsWith('tip')) { + i.items = []; + } + }); + $.log(`🎉 ${$.name}`, '观影页广告去除'); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置观影页广告不去除'); + break; + } + break; + case 'x/player/wbi/playurl': // UGC-用户生产内容-播放地址 + break; + case 'x/web-interface/wbi/index/top/feed/rcmd': // web首页 + switch (Settings?.Detail?.feed) { + case true: + default: + body.data.item = body.data.item.filter( + (i) => !(i.goto === 'ad') + ); + $.log(`🎉 ${$.name}`, '首页广告内容去除'); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置首页广告不去除'); + break; + } + break; + case 'x/space/acc/info': // 用户空间-账号信息-pc + case 'x/space/wbi/acc/info': // 用户空间-账号信息-wbi + switch (url.params?.vmid || url.params?.mid) { + case '11783021': // 哔哩哔哩番剧出差 + case '1988098633': // b站_戲劇咖 + case '2042149112': // b站_綜藝咖 + break; + default: + break; + } + break; + } + break; + case 'api.live.bilibili.com': + switch (PATH) { + case 'xlive/app-room/v1/index/getInfoByRoom': // 直播 + switch (Settings?.Detail?.xlive) { + case true: + default: + if (body.data?.activity_banner_info) { + body.data.activity_banner_info = null; + $.log(`🎉 ${$.name}`, '直播banner广告去除'); + } + if (body.data?.shopping_info) { + body.data.shopping_info = { + is_show: 0, + }; + $.log(`🎉 ${$.name}`, '直播购物广告去除'); + } + if (body.data?.new_tab_info?.outer_list?.length > 0) { + body.data.new_tab_info.outer_list = + body.data.new_tab_info.outer_list.filter( + (i) => i.biz_id !== 33 + ); + } + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置直播页广告不去除'); + break; + } + break; + } + break; + } + $response.body = JSON.stringify(body); + break; + case 'application/x-protobuf': + case 'application/grpc': + case 'application/grpc+proto': + case 'applecation/octet-stream': + let rawBody = $.isQuanX() + ? new Uint8Array($response.bodyBytes) + : $response.body; + //$.log(`🚧 ${$.name}`, `isBuffer? ${ArrayBuffer.isView(rawBody)}: ${JSON.stringify(rawBody)}`, ""); + /****************** initialization start *******************/ + // timostamm/protobuf-ts + !(function (i) { + 'use strict'; + function _(n, e, i) { + return e <= n && n <= i; + } + 'undefined' != typeof module && + module.exports && + !i['encoding-indexes'] && + (i['encoding-indexes'] = require('./encoding-indexes.js')[ + 'encoding-indexes' + ]); + var l = Math.floor; + function s(n) { + if (void 0 === n) return {}; + if (n === Object(n)) return n; + throw TypeError('Could not convert argument to dictionary'); + } + function u(n) { + return 0 <= n && n <= 127; + } + var a = u, + b = -1; + function c(n) { + (this.tokens = [].slice.call(n)), this.tokens.reverse(); + } + c.prototype = { + endOfStream: function () { + return !this.tokens.length; + }, + read: function () { + return this.tokens.length ? this.tokens.pop() : b; + }, + prepend: function (n) { + if (Array.isArray(n)) + for (var e = n; e.length; ) this.tokens.push(e.pop()); + else this.tokens.push(n); + }, + push: function (n) { + if (Array.isArray(n)) + for (var e = n; e.length; ) this.tokens.unshift(e.shift()); + else this.tokens.unshift(n); + }, + }; + var w = -1; + function m(n, e) { + if (n) throw TypeError('Decoder error'); + return e || 65533; + } + function f(n) { + throw TypeError('The code point ' + n + ' could not be encoded.'); + } + function r(n) { + return ( + (n = String(n).trim().toLowerCase()), + Object.prototype.hasOwnProperty.call(d, n) ? d[n] : null + ); + } + var t, + o, + n = [ + { + encodings: [ + { + labels: ['unicode-1-1-utf-8', 'utf-8', 'utf8'], + name: 'UTF-8', + }, + ], + heading: 'The Encoding', + }, + { + encodings: [ + { + labels: ['866', 'cp866', 'csibm866', 'ibm866'], + name: 'IBM866', + }, + { + labels: [ + 'csisolatin2', + 'iso-8859-2', + 'iso-ir-101', + 'iso8859-2', + 'iso88592', + 'iso_8859-2', + 'iso_8859-2:1987', + 'l2', + 'latin2', + ], + name: 'ISO-8859-2', + }, + { + labels: [ + 'csisolatin3', + 'iso-8859-3', + 'iso-ir-109', + 'iso8859-3', + 'iso88593', + 'iso_8859-3', + 'iso_8859-3:1988', + 'l3', + 'latin3', + ], + name: 'ISO-8859-3', + }, + { + labels: [ + 'csisolatin4', + 'iso-8859-4', + 'iso-ir-110', + 'iso8859-4', + 'iso88594', + 'iso_8859-4', + 'iso_8859-4:1988', + 'l4', + 'latin4', + ], + name: 'ISO-8859-4', + }, + { + labels: [ + 'csisolatincyrillic', + 'cyrillic', + 'iso-8859-5', + 'iso-ir-144', + 'iso8859-5', + 'iso88595', + 'iso_8859-5', + 'iso_8859-5:1988', + ], + name: 'ISO-8859-5', + }, + { + labels: [ + 'arabic', + 'asmo-708', + 'csiso88596e', + 'csiso88596i', + 'csisolatinarabic', + 'ecma-114', + 'iso-8859-6', + 'iso-8859-6-e', + 'iso-8859-6-i', + 'iso-ir-127', + 'iso8859-6', + 'iso88596', + 'iso_8859-6', + 'iso_8859-6:1987', + ], + name: 'ISO-8859-6', + }, + { + labels: [ + 'csisolatingreek', + 'ecma-118', + 'elot_928', + 'greek', + 'greek8', + 'iso-8859-7', + 'iso-ir-126', + 'iso8859-7', + 'iso88597', + 'iso_8859-7', + 'iso_8859-7:1987', + 'sun_eu_greek', + ], + name: 'ISO-8859-7', + }, + { + labels: [ + 'csiso88598e', + 'csisolatinhebrew', + 'hebrew', + 'iso-8859-8', + 'iso-8859-8-e', + 'iso-ir-138', + 'iso8859-8', + 'iso88598', + 'iso_8859-8', + 'iso_8859-8:1988', + 'visual', + ], + name: 'ISO-8859-8', + }, + { + labels: ['csiso88598i', 'iso-8859-8-i', 'logical'], + name: 'ISO-8859-8-I', + }, + { + labels: [ + 'csisolatin6', + 'iso-8859-10', + 'iso-ir-157', + 'iso8859-10', + 'iso885910', + 'l6', + 'latin6', + ], + name: 'ISO-8859-10', + }, + { + labels: ['iso-8859-13', 'iso8859-13', 'iso885913'], + name: 'ISO-8859-13', + }, + { + labels: ['iso-8859-14', 'iso8859-14', 'iso885914'], + name: 'ISO-8859-14', + }, + { + labels: [ + 'csisolatin9', + 'iso-8859-15', + 'iso8859-15', + 'iso885915', + 'iso_8859-15', + 'l9', + ], + name: 'ISO-8859-15', + }, + { labels: ['iso-8859-16'], name: 'ISO-8859-16' }, + { + labels: ['cskoi8r', 'koi', 'koi8', 'koi8-r', 'koi8_r'], + name: 'KOI8-R', + }, + { labels: ['koi8-ru', 'koi8-u'], name: 'KOI8-U' }, + { + labels: [ + 'csmacintosh', + 'mac', + 'macintosh', + 'x-mac-roman', + ], + name: 'macintosh', + }, + { + labels: [ + 'dos-874', + 'iso-8859-11', + 'iso8859-11', + 'iso885911', + 'tis-620', + 'windows-874', + ], + name: 'windows-874', + }, + { + labels: ['cp1250', 'windows-1250', 'x-cp1250'], + name: 'windows-1250', + }, + { + labels: ['cp1251', 'windows-1251', 'x-cp1251'], + name: 'windows-1251', + }, + { + labels: [ + 'ansi_x3.4-1968', + 'ascii', + 'cp1252', + 'cp819', + 'csisolatin1', + 'ibm819', + 'iso-8859-1', + 'iso-ir-100', + 'iso8859-1', + 'iso88591', + 'iso_8859-1', + 'iso_8859-1:1987', + 'l1', + 'latin1', + 'us-ascii', + 'windows-1252', + 'x-cp1252', + ], + name: 'windows-1252', + }, + { + labels: ['cp1253', 'windows-1253', 'x-cp1253'], + name: 'windows-1253', + }, + { + labels: [ + 'cp1254', + 'csisolatin5', + 'iso-8859-9', + 'iso-ir-148', + 'iso8859-9', + 'iso88599', + 'iso_8859-9', + 'iso_8859-9:1989', + 'l5', + 'latin5', + 'windows-1254', + 'x-cp1254', + ], + name: 'windows-1254', + }, + { + labels: ['cp1255', 'windows-1255', 'x-cp1255'], + name: 'windows-1255', + }, + { + labels: ['cp1256', 'windows-1256', 'x-cp1256'], + name: 'windows-1256', + }, + { + labels: ['cp1257', 'windows-1257', 'x-cp1257'], + name: 'windows-1257', + }, + { + labels: ['cp1258', 'windows-1258', 'x-cp1258'], + name: 'windows-1258', + }, + { + labels: ['x-mac-cyrillic', 'x-mac-ukrainian'], + name: 'x-mac-cyrillic', + }, + ], + heading: 'Legacy single-byte encodings', + }, + { + encodings: [ + { + labels: [ + 'chinese', + 'csgb2312', + 'csiso58gb231280', + 'gb2312', + 'gb_2312', + 'gb_2312-80', + 'gbk', + 'iso-ir-58', + 'x-gbk', + ], + name: 'GBK', + }, + { labels: ['gb18030'], name: 'gb18030' }, + ], + heading: 'Legacy multi-byte Chinese (simplified) encodings', + }, + { + encodings: [ + { + labels: [ + 'big5', + 'big5-hkscs', + 'cn-big5', + 'csbig5', + 'x-x-big5', + ], + name: 'Big5', + }, + ], + heading: 'Legacy multi-byte Chinese (traditional) encodings', + }, + { + encodings: [ + { + labels: ['cseucpkdfmtjapanese', 'euc-jp', 'x-euc-jp'], + name: 'EUC-JP', + }, + { + labels: ['csiso2022jp', 'iso-2022-jp'], + name: 'ISO-2022-JP', + }, + { + labels: [ + 'csshiftjis', + 'ms932', + 'ms_kanji', + 'shift-jis', + 'shift_jis', + 'sjis', + 'windows-31j', + 'x-sjis', + ], + name: 'Shift_JIS', + }, + ], + heading: 'Legacy multi-byte Japanese encodings', + }, + { + encodings: [ + { + labels: [ + 'cseuckr', + 'csksc56011987', + 'euc-kr', + 'iso-ir-149', + 'korean', + 'ks_c_5601-1987', + 'ks_c_5601-1989', + 'ksc5601', + 'ksc_5601', + 'windows-949', + ], + name: 'EUC-KR', + }, + ], + heading: 'Legacy multi-byte Korean encodings', + }, + { + encodings: [ + { + labels: [ + 'csiso2022kr', + 'hz-gb-2312', + 'iso-2022-cn', + 'iso-2022-cn-ext', + 'iso-2022-kr', + ], + name: 'replacement', + }, + { labels: ['utf-16be'], name: 'UTF-16BE' }, + { labels: ['utf-16', 'utf-16le'], name: 'UTF-16LE' }, + { labels: ['x-user-defined'], name: 'x-user-defined' }, + ], + heading: 'Legacy miscellaneous encodings', + }, + ], + d = {}, + h = + (n.forEach(function (n) { + n.encodings.forEach(function (e) { + e.labels.forEach(function (n) { + d[n] = e; + }); + }); + }), + {}), + g = {}; + function y(n, e) { + return (e && e[n]) || null; + } + function p(n, e) { + e = e.indexOf(n); + return -1 === e ? null : e; + } + function v(n) { + if ('encoding-indexes' in i) return i['encoding-indexes'][n]; + throw Error( + 'Indexes missing. Did you forget to include encoding-indexes.js first?' + ); + } + var x = 'utf-8'; + function O(n, e) { + if (!(this instanceof O)) + throw TypeError("Called as a function. Did you forget 'new'?"); + (n = void 0 !== n ? String(n) : x), + (e = s(e)), + (this._encoding = null), + (this._decoder = null), + (this._ignoreBOM = !1), + (this._BOMseen = !1), + (this._error_mode = 'replacement'), + (this._do_not_flush = !1); + var i = r(n); + if (null === i || 'replacement' === i.name) + throw RangeError('Unknown encoding: ' + n); + if (g[i.name]) + return ( + ((n = this)._encoding = i), + Boolean(e.fatal) && (n._error_mode = 'fatal'), + Boolean(e.ignoreBOM) && (n._ignoreBOM = !0), + Object.defineProperty || + ((this.encoding = n._encoding.name.toLowerCase()), + (this.fatal = 'fatal' === n._error_mode), + (this.ignoreBOM = n._ignoreBOM)), + n + ); + throw Error( + 'Decoder not present. Did you forget to include encoding-indexes.js first?' + ); + } + function k(n, e) { + if (!(this instanceof k)) + throw TypeError("Called as a function. Did you forget 'new'?"); + (e = s(e)), + (this._encoding = null), + (this._encoder = null), + (this._do_not_flush = !1), + (this._fatal = Boolean(e.fatal) ? 'fatal' : 'replacement'); + if (Boolean(e.NONSTANDARD_allowLegacyEncoding)) { + e = r((n = void 0 !== n ? String(n) : x)); + if (null === e || 'replacement' === e.name) + throw RangeError('Unknown encoding: ' + n); + if (!h[e.name]) + throw Error( + 'Encoder not present. Did you forget to include encoding-indexes.js first?' + ); + this._encoding = e; + } else + (this._encoding = r('utf-8')), + void 0 !== n && + 'console' in i && + console.warn( + 'TextEncoder constructor called with encoding label, which is ignored.' + ); + return ( + Object.defineProperty || + (this.encoding = this._encoding.name.toLowerCase()), + this + ); + } + function e(n) { + var r = n.fatal, + t = 0, + o = 0, + s = 0, + l = 128, + a = 191; + this.handler = function (n, e) { + if (e === b && 0 !== s) return (s = 0), m(r); + if (e === b) return w; + if (0 === s) { + if (_(e, 0, 127)) return e; + if (_(e, 194, 223)) (s = 1), (t = 31 & e); + else if (_(e, 224, 239)) + 224 === e && (l = 160), + 237 === e && (a = 159), + (s = 2), + (t = 15 & e); + else { + if (!_(e, 240, 244)) return m(r); + 240 === e && (l = 144), + 244 === e && (a = 143), + (s = 3), + (t = 7 & e); + } + return null; + } + var i; + return _(e, l, a) + ? ((l = 128), + (a = 191), + (t = (t << 6) | (63 & e)), + (o += 1) !== s ? null : ((i = t), (t = s = o = 0), i)) + : ((t = s = o = 0), (l = 128), (a = 191), n.prepend(e), m(r)); + }; + } + function E(n) { + n.fatal; + this.handler = function (n, e) { + if (e === b) return w; + if (a(e)) return e; + _(e, 128, 2047) + ? ((i = 1), (r = 192)) + : _(e, 2048, 65535) + ? ((i = 2), (r = 224)) + : _(e, 65536, 1114111) && ((i = 3), (r = 240)); + for (var i, r, t = [(e >> (6 * i)) + r]; 0 < i; ) + t.push(128 | (63 & (e >> (6 * (i - 1))))), --i; + return t; + }; + } + function j(i, n) { + var r = n.fatal; + this.handler = function (n, e) { + return e === b + ? w + : u(e) + ? e + : null === (e = i[e - 128]) + ? m(r) + : e; + }; + } + function B(r, n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) + ? e + : (null === (i = p(e, r)) && f(e), i + 128); + }; + } + function S(n) { + var o = n.fatal, + s = 0, + l = 0, + a = 0; + this.handler = function (n, e) { + var i, r, t; + return e === b && 0 === s && 0 === l && 0 === a + ? w + : (e !== b || + (0 === s && 0 === l && 0 === a) || + ((a = l = s = 0), m(o)), + 0 !== a + ? ((i = null), + _(e, 48, 57) && + (i = (function (n) { + if ((39419 < n && n < 189e3) || 1237575 < n) + return null; + if (7457 === n) return 59335; + for ( + var e = 0, i = 0, r = v('gb18030-ranges'), t = 0; + t < r.length; + ++t + ) { + var o = r[t]; + if (!(o[0] <= n)) break; + (e = o[0]), (i = o[1]); + } + return i + n - e; + })( + 10 * (126 * (10 * (s - 129) + l - 48) + a - 129) + + e - + 48 + )), + (r = [l, a, e]), + (a = l = s = 0), + null === i ? (n.prepend(r), m(o)) : i) + : 0 !== l + ? _(e, 129, 254) + ? ((a = e), null) + : (n.prepend([l, e]), (l = s = 0), m(o)) + : 0 !== s + ? _(e, 48, 57) + ? ((l = e), null) + : ((r = s), + (s = 0), + (t = null) === + (i = + null === + (t = + _(e, 64, 126) || _(e, 128, 254) + ? 190 * (r - 129) + (e - (e < 127 ? 64 : 65)) + : t) + ? null + : y(t, v('gb18030'))) && + u(e) && + n.prepend(e), + null === i ? m(o) : i) + : u(e) + ? e + : 128 === e + ? 8364 + : _(e, 129, 254) + ? ((s = e), null) + : m(o)); + }; + } + function T(n, t) { + n.fatal; + this.handler = function (n, e) { + var i, r; + return e === b + ? w + : a(e) + ? e + : 58853 === e + ? f(e) + : t && 8364 === e + ? 128 + : null !== (i = p(e, v('gb18030'))) + ? ((r = i % 190), [l(i / 190) + 129, r + (r < 63 ? 64 : 65)]) + : t + ? f(e) + : ((i = (function (n) { + if (59335 === n) return 7457; + for ( + var e = 0, i = 0, r = v('gb18030-ranges'), t = 0; + t < r.length; + ++t + ) { + var o = r[t]; + if (!(o[1] <= n)) break; + (e = o[1]), (i = o[0]); + } + return i + n - e; + })(e)), + [ + (r = l(i / 10 / 126 / 10)) + 129, + (e = l((i -= 10 * r * 126 * 10) / 10 / 126)) + 48, + (r = l((i -= 10 * e * 126) / 10)) + 129, + 48 + (i - 10 * r), + ]); + }; + } + function I(n) { + var t = n.fatal, + o = 0; + this.handler = function (n, e) { + if (e === b && 0 !== o) return (o = 0), m(t); + if (e === b && 0 === o) return w; + if (0 === o) + return u(e) ? e : _(e, 129, 254) ? ((o = e), null) : m(t); + var i = o, + r = null; + switch ( + ((o = 0), + (r = + _(e, 64, 126) || _(e, 161, 254) + ? 157 * (i - 129) + (e - (e < 127 ? 64 : 98)) + : r)) + ) { + case 1133: + return [202, 772]; + case 1135: + return [202, 780]; + case 1164: + return [234, 772]; + case 1166: + return [234, 780]; + } + i = null === r ? null : y(r, v('big5')); + return ( + null === i && u(e) && n.prepend(e), null === i ? m(t) : i + ); + }; + } + function U(n) { + n.fatal; + this.handler = function (n, e) { + var i, r; + return e === b + ? w + : a(e) + ? e + : ((i = e), + (r = o = + o || + v('big5').map(function (n, e) { + return e < 5024 ? null : n; + })), + null === + (i = + 9552 === i || + 9566 === i || + 9569 === i || + 9578 === i || + 21313 === i || + 21317 === i + ? r.lastIndexOf(i) + : p(i, r)) || (r = l(i / 157) + 129) < 161 + ? f(e) + : [r, (e = i % 157) + (e < 63 ? 64 : 98)]); + }; + } + function C(n) { + var t = n.fatal, + o = !1, + s = 0; + this.handler = function (n, e) { + var i, r; + return e === b && 0 !== s + ? ((s = 0), m(t)) + : e === b && 0 === s + ? w + : 142 === s && _(e, 161, 223) + ? ((s = 0), 65216 + e) + : 143 === s && _(e, 161, 254) + ? ((o = !0), (s = e), null) + : 0 !== s + ? ((i = s), + (s = 0), + (r = null), + _(i, 161, 254) && + _(e, 161, 254) && + (r = y( + 94 * (i - 161) + (e - 161), + v(o ? 'jis0212' : 'jis0208') + )), + (o = !1), + _(e, 161, 254) || n.prepend(e), + null === r ? m(t) : r) + : u(e) + ? e + : 142 === e || 143 === e || _(e, 161, 254) + ? ((s = e), null) + : m(t); + }; + } + function P(n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) + ? e + : 165 === e + ? 92 + : 8254 === e + ? 126 + : _(e, 65377, 65439) + ? [142, e - 65377 + 161] + : null === (i = p((e = 8722 === e ? 65293 : e), v('jis0208'))) + ? f(e) + : [l(i / 94) + 161, (i % 94) + 161]; + }; + } + function D(n) { + var t = n.fatal, + o = 0, + s = 1, + l = 2, + a = 3, + u = 4, + c = 5, + f = 6, + d = o, + h = o, + g = 0, + p = !1; + this.handler = function (n, e) { + switch (d) { + default: + case o: + return 27 === e + ? ((d = c), null) + : _(e, 0, 127) && 14 !== e && 15 !== e && 27 !== e + ? ((p = !1), e) + : e === b + ? w + : ((p = !1), m(t)); + case s: + return 27 === e + ? ((d = c), null) + : 92 === e + ? ((p = !1), 165) + : 126 === e + ? ((p = !1), 8254) + : _(e, 0, 127) && + 14 !== e && + 15 !== e && + 27 !== e && + 92 !== e && + 126 !== e + ? ((p = !1), e) + : e === b + ? w + : ((p = !1), m(t)); + case l: + return 27 === e + ? ((d = c), null) + : _(e, 33, 95) + ? ((p = !1), 65344 + e) + : e === b + ? w + : ((p = !1), m(t)); + case a: + return 27 === e + ? ((d = c), null) + : _(e, 33, 126) + ? ((p = !1), (g = e), (d = u), null) + : e === b + ? w + : ((p = !1), m(t)); + case u: + if (27 === e) d = c; + else { + if (_(e, 33, 126)) + return ( + (d = a), + null === (i = y(94 * (g - 33) + e - 33, v('jis0208'))) + ? m(t) + : i + ); + e === b ? ((d = a), n.prepend(e)) : (d = a); + } + return m(t); + case c: + return 36 === e || 40 === e + ? ((g = e), (d = f), null) + : (n.prepend(e), (p = !1), (d = h), m(t)); + case f: + var i = g, + r = ((g = 0), null); + return (40 === i && 66 === e && (r = o), + 40 === i && 74 === e && (r = s), + 40 === i && 73 === e && (r = l), + null !== (r = 36 !== i || (64 !== e && 66 !== e) ? r : a)) + ? ((d = r), (r = p), (p = !0), r ? m(t) : null) + : (n.prepend([i, e]), (p = !1), (d = h), m(t)); + } + }; + } + function F(n) { + n.fatal; + var r = 0, + t = 1, + o = 2, + s = r; + this.handler = function (n, e) { + if (e === b && s !== r) + return n.prepend(e), (s = r), [27, 40, 66]; + if (e === b && s === r) return w; + if ( + !((s !== r && s !== t) || (14 !== e && 15 !== e && 27 !== e)) + ) + return f(65533); + if (s === r && a(e)) return e; + if ( + s === t && + ((a(e) && 92 !== e && 126 !== e) || 165 == e || 8254 == e) + ) { + if (a(e)) return e; + if (165 === e) return 92; + if (8254 === e) return 126; + } + var i; + return a(e) && s !== r + ? (n.prepend(e), (s = r), [27, 40, 66]) + : (165 !== e && 8254 !== e) || s === t + ? null === (i = p((e = 8722 === e ? 65293 : e), v('jis0208'))) + ? f(e) + : s !== o + ? (n.prepend(e), (s = o), [27, 36, 66]) + : [l(i / 94) + 33, (i % 94) + 33] + : (n.prepend(e), (s = t), [27, 40, 74]); + }; + } + function J(n) { + var t = n.fatal, + o = 0; + this.handler = function (n, e) { + var i, r; + return e === b && 0 !== o + ? ((o = 0), m(t)) + : e === b && 0 === o + ? w + : 0 !== o + ? ((r = o), + (i = null), + (o = 0), + (_(e, 64, 126) || _(e, 128, 252)) && + (i = + 188 * (r - (r < 160 ? 129 : 193)) + + e - + (e < 127 ? 64 : 65)), + _(i, 8836, 10715) + ? 48508 + i + : (null === + (r = null === i ? null : y(i, v('jis0208'))) && + u(e) && + n.prepend(e), + null === r ? m(t) : r)) + : u(e) || 128 === e + ? e + : _(e, 161, 223) + ? 65216 + e + : _(e, 129, 159) || _(e, 224, 252) + ? ((o = e), null) + : m(t); + }; + } + function K(n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) || 128 === e + ? e + : 165 === e + ? 92 + : 8254 === e + ? 126 + : _(e, 65377, 65439) + ? e - 65377 + 161 + : ((i = e = 8722 === e ? 65293 : e), + null === + (i = (t = + t || + v('jis0208').map(function (n, e) { + return _(e, 8272, 8835) ? null : n; + })).indexOf(i)) + ? f(e) + : [ + (e = l(i / 188)) + (e < 31 ? 129 : 193), + (e = i % 188) + (e < 63 ? 64 : 65), + ]); + }; + } + function R(n) { + var t = n.fatal, + o = 0; + this.handler = function (n, e) { + var i, r; + return e === b && 0 !== o + ? ((o = 0), m(t)) + : e === b && 0 === o + ? w + : 0 !== o + ? ((r = o), + (o = 0), + (r = + (i = null) === + (i = _(e, 65, 254) ? 190 * (r - 129) + (e - 65) : i) + ? null + : y(i, v('euc-kr'))), + null === i && u(e) && n.prepend(e), + null === r ? m(t) : r) + : u(e) + ? e + : _(e, 129, 254) + ? ((o = e), null) + : m(t); + }; + } + function G(n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : a(e) + ? e + : null === (i = p(e, v('euc-kr'))) + ? f(e) + : [l(i / 190) + 129, (i % 190) + 65]; + }; + } + function A(n, e) { + var i = n >> 8, + n = 255 & n; + return e ? [i, n] : [n, i]; + } + function L(r, n) { + var t = n.fatal, + o = null, + s = null; + this.handler = function (n, e) { + var i; + return e !== b || (null === o && null === s) + ? e === b && null === o && null === s + ? w + : null === o + ? ((o = e), null) + : ((e = r ? (o << 8) + e : (e << 8) + o), + (o = null) !== s + ? ((i = s), + (s = null), + _(e, 56320, 57343) + ? 65536 + 1024 * (i - 55296) + (e - 56320) + : (n.prepend(A(e, r)), m(t))) + : _(e, 55296, 56319) + ? ((s = e), null) + : _(e, 56320, 57343) + ? m(t) + : e) + : m(t); + }; + } + function M(r, n) { + n.fatal; + this.handler = function (n, e) { + var i; + return e === b + ? w + : _(e, 0, 65535) + ? A(e, r) + : ((i = A(55296 + ((e - 65536) >> 10), r)), + (e = A(56320 + ((e - 65536) & 1023), r)), + i.concat(e)); + }; + } + function N(n) { + n.fatal; + this.handler = function (n, e) { + return e === b ? w : u(e) ? e : 63360 + e - 128; + }; + } + function q(n) { + n.fatal; + this.handler = function (n, e) { + return e === b + ? w + : a(e) + ? e + : _(e, 63360, 63487) + ? e - 63360 + 128 + : f(e); + }; + } + Object.defineProperty && + (Object.defineProperty(O.prototype, 'encoding', { + get: function () { + return this._encoding.name.toLowerCase(); + }, + }), + Object.defineProperty(O.prototype, 'fatal', { + get: function () { + return 'fatal' === this._error_mode; + }, + }), + Object.defineProperty(O.prototype, 'ignoreBOM', { + get: function () { + return this._ignoreBOM; + }, + })), + (O.prototype.decode = function (n, e) { + n = + 'object' == typeof n && n instanceof ArrayBuffer + ? new Uint8Array(n) + : 'object' == typeof n && + 'buffer' in n && + n.buffer instanceof ArrayBuffer + ? new Uint8Array(n.buffer, n.byteOffset, n.byteLength) + : new Uint8Array(0); + (e = s(e)), + this._do_not_flush || + ((this._decoder = g[this._encoding.name]({ + fatal: 'fatal' === this._error_mode, + })), + (this._BOMseen = !1)), + (this._do_not_flush = Boolean(e.stream)); + for (var i, r = new c(n), t = []; ; ) { + var o = r.read(); + if (o === b) break; + if ((i = this._decoder.handler(r, o)) === w) break; + null !== i && + (Array.isArray(i) ? t.push.apply(t, i) : t.push(i)); + } + if (!this._do_not_flush) { + for ( + ; + (i = this._decoder.handler(r, r.read())) !== w && + (null !== i && + (Array.isArray(i) ? t.push.apply(t, i) : t.push(i)), + !r.endOfStream()); + + ); + this._decoder = null; + } + return function (n) { + (e = ['UTF-8', 'UTF-16LE', 'UTF-16BE']), + (i = this._encoding.name), + -1 === e.indexOf(i) || + this._ignoreBOM || + this._BOMseen || + (0 < n.length && 65279 === n[0] + ? ((this._BOMseen = !0), n.shift()) + : 0 < n.length && (this._BOMseen = !0)); + for (var e, i, r = n, t = '', o = 0; o < r.length; ++o) { + var s = r[o]; + s <= 65535 + ? (t += String.fromCharCode(s)) + : ((s -= 65536), + (t += String.fromCharCode( + 55296 + (s >> 10), + 56320 + (1023 & s) + ))); + } + return t; + }.call(this, t); + }), + Object.defineProperty && + Object.defineProperty(k.prototype, 'encoding', { + get: function () { + return this._encoding.name.toLowerCase(); + }, + }), + (k.prototype.encode = function (n, e) { + (n = void 0 === n ? '' : String(n)), + (e = s(e)), + this._do_not_flush || + (this._encoder = h[this._encoding.name]({ + fatal: 'fatal' === this._fatal, + })), + (this._do_not_flush = Boolean(e.stream)); + for ( + var i, + r = new c( + (function (n) { + for ( + var e = String(n), i = e.length, r = 0, t = []; + r < i; + + ) { + var o, + s = e.charCodeAt(r); + s < 55296 || 57343 < s + ? t.push(s) + : 56320 <= s && s <= 57343 + ? t.push(65533) + : 55296 <= s && + s <= 56319 && + (r !== i - 1 && + 56320 <= (o = e.charCodeAt(r + 1)) && + o <= 57343 + ? (t.push( + 65536 + ((1023 & s) << 10) + (1023 & o) + ), + (r += 1)) + : t.push(65533)), + (r += 1); + } + return t; + })(n) + ), + t = []; + ; + + ) { + var o = r.read(); + if (o === b) break; + if ((i = this._encoder.handler(r, o)) === w) break; + Array.isArray(i) ? t.push.apply(t, i) : t.push(i); + } + if (!this._do_not_flush) { + for (;;) { + if ((i = this._encoder.handler(r, r.read())) === w) break; + Array.isArray(i) ? t.push.apply(t, i) : t.push(i); + } + this._encoder = null; + } + return new Uint8Array(t); + }), + (h['UTF-8'] = function (n) { + return new E(n); + }), + (g['UTF-8'] = function (n) { + return new e(n); + }), + 'encoding-indexes' in i && + n.forEach(function (n) { + 'Legacy single-byte encodings' === n.heading && + n.encodings.forEach(function (n) { + var n = n.name, + e = v(n.toLowerCase()); + (g[n] = function (n) { + return new j(e, n); + }), + (h[n] = function (n) { + return new B(e, n); + }); + }); + }), + (g.GBK = function (n) { + return new S(n); + }), + (h.GBK = function (n) { + return new T(n, !0); + }), + (h.gb18030 = function (n) { + return new T(n); + }), + (g.gb18030 = function (n) { + return new S(n); + }), + (h.Big5 = function (n) { + return new U(n); + }), + (g.Big5 = function (n) { + return new I(n); + }), + (h['EUC-JP'] = function (n) { + return new P(n); + }), + (g['EUC-JP'] = function (n) { + return new C(n); + }), + (h['ISO-2022-JP'] = function (n) { + return new F(n); + }), + (g['ISO-2022-JP'] = function (n) { + return new D(n); + }), + (h.Shift_JIS = function (n) { + return new K(n); + }), + (g.Shift_JIS = function (n) { + return new J(n); + }), + (h['EUC-KR'] = function (n) { + return new G(n); + }), + (g['EUC-KR'] = function (n) { + return new R(n); + }), + (h['UTF-16BE'] = function (n) { + return new M(!0, n); + }), + (g['UTF-16BE'] = function (n) { + return new L(!0, n); + }), + (h['UTF-16LE'] = function (n) { + return new M(!1, n); + }), + (g['UTF-16LE'] = function (n) { + return new L(!1, n); + }), + (h['x-user-defined'] = function (n) { + return new q(n); + }), + (g['x-user-defined'] = function (n) { + return new N(n); + }), + i.TextEncoder || (i.TextEncoder = k), + i.TextDecoder || (i.TextDecoder = O), + 'undefined' != typeof module && + module.exports && + (module.exports = { + TextEncoder: i.TextEncoder, + TextDecoder: i.TextDecoder, + EncodingIndexes: i['encoding-indexes'], + }); + })(this || {}); + // @protobuf-ts/runtime + var UnknownFieldHandler, + WireType, + ScalarType, + LongType, + RepeatType, + __defProp = Object.defineProperty, + __defProps = Object.defineProperties, + __getOwnPropDescs = Object.getOwnPropertyDescriptors, + __getOwnPropSymbols = Object.getOwnPropertySymbols, + __hasOwnProp = Object.prototype.hasOwnProperty, + __propIsEnum = Object.prototype.propertyIsEnumerable, + __defNormalProp = (e, r, t) => + r in e + ? __defProp(e, r, { + enumerable: !0, + configurable: !0, + writable: !0, + value: t, + }) + : (e[r] = t), + __spreadValues = (e, r) => { + for (var t in (r = r || {})) + __hasOwnProp.call(r, t) && __defNormalProp(e, t, r[t]); + if (__getOwnPropSymbols) + for (var t of __getOwnPropSymbols(r)) + __propIsEnum.call(r, t) && __defNormalProp(e, t, r[t]); + return e; + }, + __spreadProps = (e, r) => __defProps(e, __getOwnPropDescs(r)); + function varint64read() { + let r = 0, + t = 0; + for (let e = 0; e < 28; e += 7) { + var a = this.buf[this.pos++]; + if (((r |= (127 & a) << e), 0 == (128 & a))) + return this.assertBounds(), [r, t]; + } + var e = this.buf[this.pos++]; + if (((r |= (15 & e) << 28), (t = (112 & e) >> 4), 0 == (128 & e))) + return this.assertBounds(), [r, t]; + for (let e = 3; e <= 31; e += 7) { + var n = this.buf[this.pos++]; + if (((t |= (127 & n) << e), 0 == (128 & n))) + return this.assertBounds(), [r, t]; + } + throw new Error('invalid varint'); + } + function varint64write(r, t, a) { + for (let e = 0; e < 28; e += 7) { + var n = r >>> e, + s = !(n >>> 7 == 0 && 0 == t); + if ((a.push(255 & (s ? 128 | n : n)), !s)) return; + } + var e = ((r >>> 28) & 15) | ((7 & t) << 4), + i = !(t >> 3 == 0); + if ((a.push(255 & (i ? 128 | e : e)), i)) { + for (let e = 3; e < 31; e += 7) { + var o = t >>> e, + l = !(o >>> 7 == 0); + if ((a.push(255 & (l ? 128 | o : o)), !l)) return; + } + a.push((t >>> 31) & 1); + } + } + const TWO_PWR_32_DBL$1 = 4294967296; + function int64fromString(t) { + var e = '-' == t[0]; + e && (t = t.slice(1)); + let a = 0, + n = 0; + function r(e, r) { + e = Number(t.slice(e, r)); + (n *= 1e6), + (a = 1e6 * a + e) >= TWO_PWR_32_DBL$1 && + ((n += (a / TWO_PWR_32_DBL$1) | 0), (a %= TWO_PWR_32_DBL$1)); + } + return r(-24, -18), r(-18, -12), r(-12, -6), r(-6), [e, a, n]; + } + function int64toString(e, r) { + if (r <= 2097151) return '' + (TWO_PWR_32_DBL$1 * r + e); + var t = (((e >>> 24) | (r << 8)) >>> 0) & 16777215, + r = (r >> 16) & 65535; + let a = (16777215 & e) + 6777216 * t + 6710656 * r, + n = t + 8147497 * r, + s = 2 * r; + e = 1e7; + function i(e, r) { + e = e ? String(e) : ''; + return r ? '0000000'.slice(e.length) + e : e; + } + return ( + a >= e && ((n += Math.floor(a / e)), (a %= e)), + n >= e && ((s += Math.floor(n / e)), (n %= e)), + i(s, 0) + i(n, s) + i(a, 1) + ); + } + function varint32write(r, t) { + if (0 <= r) { + for (; 127 < r; ) t.push((127 & r) | 128), (r >>>= 7); + t.push(r); + } else { + for (let e = 0; e < 9; e++) t.push((127 & r) | 128), (r >>= 7); + t.push(1); + } + } + function varint32read() { + let r = this.buf[this.pos++]; + var e = 127 & r; + if (0 == (128 & r)) return this.assertBounds(), e; + if ( + ((e |= (127 & (r = this.buf[this.pos++])) << 7), 0 == (128 & r)) + ) + return this.assertBounds(), e; + if ( + ((e |= (127 & (r = this.buf[this.pos++])) << 14), 0 == (128 & r)) + ) + return this.assertBounds(), e; + if ( + ((e |= (127 & (r = this.buf[this.pos++])) << 21), 0 == (128 & r)) + ) + return this.assertBounds(), e; + e |= (15 & (r = this.buf[this.pos++])) << 28; + for (let e = 5; 0 != (128 & r) && e < 10; e++) + r = this.buf[this.pos++]; + if (0 != (128 & r)) throw new Error('invalid varint'); + return this.assertBounds(), e >>> 0; + } + function detectBi() { + var e = new DataView(new ArrayBuffer(8)); + return void 0 !== globalThis.BigInt && + 'function' == typeof e.getBigInt64 && + 'function' == typeof e.getBigUint64 && + 'function' == typeof e.setBigInt64 && + 'function' == typeof e.setBigUint64 + ? { + MIN: BigInt('-9223372036854775808'), + MAX: BigInt('9223372036854775807'), + UMIN: BigInt('0'), + UMAX: BigInt('18446744073709551615'), + C: BigInt, + V: e, + } + : void 0; + } + const BI = detectBi(); + function assertBi(e) { + if (!e) + throw new Error( + 'BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support' + ); + } + const RE_DECIMAL_STR = /^-?[0-9]+$/, + TWO_PWR_32_DBL = 4294967296; + class SharedPbLong { + constructor(e, r) { + (this.lo = 0 | e), (this.hi = 0 | r); + } + isZero() { + return 0 == this.lo && 0 == this.hi; + } + toNumber() { + var e = this.hi * TWO_PWR_32_DBL + (this.lo >>> 0); + if (Number.isSafeInteger(e)) return e; + throw new Error('cannot convert to safe number'); + } + } + const _PbULong = class extends SharedPbLong { + static from(e) { + if (BI) + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + if ('' == e) throw new Error('string is no integer'); + e = BI.C(e); + case 'number': + if (0 === e) return this.ZERO; + e = BI.C(e); + case 'bigint': + if (!e) return this.ZERO; + if (e < BI.UMIN) throw new Error('signed value for ulong'); + if (e > BI.UMAX) throw new Error('ulong too large'); + return ( + BI.V.setBigUint64(0, e, !0), + new _PbULong(BI.V.getInt32(0, !0), BI.V.getInt32(4, !0)) + ); + } + else + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + if (((e = e.trim()), !RE_DECIMAL_STR.test(e))) + throw new Error('string is no integer'); + var [r, t, a] = int64fromString(e); + if (r) throw new Error('signed value'); + return new _PbULong(t, a); + case 'number': + if (0 == e) 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 _PbULong(e, e / TWO_PWR_32_DBL); + } + throw new Error('unknown value ' + typeof e); + } + toString() { + return BI + ? this.toBigInt().toString() + : int64toString(this.lo, this.hi); + } + toBigInt() { + return ( + assertBi(BI), + BI.V.setInt32(0, this.lo, !0), + BI.V.setInt32(4, this.hi, !0), + BI.V.getBigUint64(0, !0) + ); + } + }; + let PbULong = _PbULong; + PbULong.ZERO = new _PbULong(0, 0); + const _PbLong = class extends SharedPbLong { + static from(e) { + if (BI) + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + if ('' == e) throw new Error('string is no integer'); + e = BI.C(e); + case 'number': + if (0 === e) return this.ZERO; + e = BI.C(e); + case 'bigint': + if (!e) return this.ZERO; + if (e < BI.MIN) throw new Error('ulong too small'); + if (e > BI.MAX) throw new Error('ulong too large'); + return ( + BI.V.setBigInt64(0, e, !0), + new _PbLong(BI.V.getInt32(0, !0), BI.V.getInt32(4, !0)) + ); + } + else + switch (typeof e) { + case 'string': + if ('0' == e) return this.ZERO; + var r, t, a; + if (((e = e.trim()), RE_DECIMAL_STR.test(e))) + return ( + ([r, a, t] = int64fromString(e)), + (a = new _PbLong(a, t)), + r ? a.negate() : a + ); + throw new Error('string is no integer'); + case 'number': + if (0 == e) return this.ZERO; + if (Number.isSafeInteger(e)) + return 0 < e + ? new _PbLong(e, e / TWO_PWR_32_DBL) + : new _PbLong(-e, -e / TWO_PWR_32_DBL).negate(); + throw new Error('number is no integer'); + } + throw new Error('unknown value ' + typeof e); + } + isNegative() { + return 0 != (2147483648 & this.hi); + } + negate() { + let e = ~this.hi, + r = this.lo; + return r ? (r = 1 + ~r) : (e += 1), new _PbLong(r, e); + } + toString() { + var e; + return BI + ? this.toBigInt().toString() + : this.isNegative() + ? '-' + int64toString((e = this.negate()).lo, e.hi) + : int64toString(this.lo, this.hi); + } + toBigInt() { + return ( + assertBi(BI), + BI.V.setInt32(0, this.lo, !0), + BI.V.setInt32(4, this.hi, !0), + BI.V.getBigInt64(0, !0) + ); + } + }; + let PbLong = _PbLong; + PbLong.ZERO = new _PbLong(0, 0); + class BinaryReader { + constructor(e, r) { + (this.varint64 = varint64read), + (this.uint32 = varint32read), + (this.buf = e), + (this.len = e.length), + (this.pos = 0), + (this.view = new DataView( + e.buffer, + e.byteOffset, + e.byteLength + )), + (this.textDecoder = + null != r ? r : new TextDecoder('utf-8', { fatal: !0 })); + } + tag() { + var e = this.uint32(), + r = e >>> 3, + e = 7 & e; + if (r <= 0 || e < 0 || 5 < e) + throw new Error( + 'illegal tag: field no ' + r + ' wire type ' + e + ); + return [r, e]; + } + skip(e) { + var r, + t = this.pos; + switch (e) { + case WireType.Varint: + for (; 128 & this.buf[this.pos++]; ); + break; + case WireType.Bit64: + this.pos += 4; + case WireType.Bit32: + this.pos += 4; + break; + case WireType.LengthDelimited: + var a = this.uint32(); + this.pos += a; + break; + case WireType.StartGroup: + for (; (r = this.tag()[1]) !== WireType.EndGroup; ) + this.skip(r); + 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 0 | this.uint32(); + } + sint32() { + var e = this.uint32(); + return (e >>> 1) ^ -(1 & e); + } + int64() { + return new PbLong(...this.varint64()); + } + uint64() { + return new PbULong(...this.varint64()); + } + sint64() { + var [e, r] = this.varint64(), + t = -(1 & e), + e = ((e >>> 1) | ((1 & r) << 31)) ^ t, + r = (r >>> 1) ^ t; + return new PbLong(e, r); + } + bool() { + var [e, r] = this.varint64(); + return 0 !== e || 0 !== r; + } + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, !0); + } + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, !0); + } + fixed64() { + return new PbULong(this.sfixed32(), this.sfixed32()); + } + sfixed64() { + return new PbLong(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() { + var e = this.uint32(), + r = this.pos; + return ( + (this.pos += e), + this.assertBounds(), + this.buf.subarray(r, r + e) + ); + } + string() { + return this.textDecoder.decode(this.bytes()); + } + } + function assert(e, r) { + if (!e) throw new Error(r); + } + const FLOAT32_MAX = 34028234663852886e22, + FLOAT32_MIN = -34028234663852886e22, + UINT32_MAX = 4294967295, + INT32_MAX = 2147483647, + INT32_MIN = -2147483648; + function assertInt32(e) { + if ('number' != typeof e) + throw new Error('invalid int 32: ' + typeof e); + if (!Number.isInteger(e) || e > INT32_MAX || e < INT32_MIN) + throw new Error('invalid int 32: ' + e); + } + function assertUInt32(e) { + if ('number' != typeof e) + throw new Error('invalid uint 32: ' + typeof e); + if (!Number.isInteger(e) || e > UINT32_MAX || e < 0) + throw new Error('invalid uint 32: ' + e); + } + function assertFloat32(e) { + if ('number' != typeof e) + throw new Error('invalid float 32: ' + typeof e); + if (Number.isFinite(e) && (e > FLOAT32_MAX || e < FLOAT32_MIN)) + throw new Error('invalid float 32: ' + e); + } + class BinaryWriter { + constructor(e) { + (this.stack = []), + (this.textEncoder = null != e ? e : new TextEncoder()), + (this.chunks = []), + (this.buf = []); + } + finish() { + this.chunks.push(new Uint8Array(this.buf)); + let r = 0; + for (let e = 0; e < this.chunks.length; e++) + r += this.chunks[e].length; + var t = new Uint8Array(r); + let a = 0; + for (let e = 0; e < this.chunks.length; e++) + t.set(this.chunks[e], a), (a += this.chunks[e].length); + return (this.chunks = []), t; + } + fork() { + return ( + this.stack.push({ chunks: this.chunks, buf: this.buf }), + (this.chunks = []), + (this.buf = []), + this + ); + } + join() { + var e = this.finish(), + r = this.stack.pop(); + if (r) + return ( + (this.chunks = r.chunks), + (this.buf = r.buf), + this.uint32(e.byteLength), + this.raw(e) + ); + throw new Error('invalid state, fork stack empty'); + } + tag(e, r) { + return this.uint32(((e << 3) | r) >>> 0); + } + raw(e) { + return ( + this.buf.length && + (this.chunks.push(new Uint8Array(this.buf)), (this.buf = [])), + this.chunks.push(e), + this + ); + } + uint32(e) { + for (assertUInt32(e); 127 < e; ) + this.buf.push((127 & e) | 128), (e >>>= 7); + return this.buf.push(e), this; + } + int32(e) { + return assertInt32(e), varint32write(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) { + e = this.textEncoder.encode(e); + return this.uint32(e.byteLength), this.raw(e); + } + float(e) { + assertFloat32(e); + var r = new Uint8Array(4); + return new DataView(r.buffer).setFloat32(0, e, !0), this.raw(r); + } + double(e) { + var r = new Uint8Array(8); + return new DataView(r.buffer).setFloat64(0, e, !0), this.raw(r); + } + fixed32(e) { + assertUInt32(e); + var r = new Uint8Array(4); + return new DataView(r.buffer).setUint32(0, e, !0), this.raw(r); + } + sfixed32(e) { + assertInt32(e); + var r = new Uint8Array(4); + return new DataView(r.buffer).setInt32(0, e, !0), this.raw(r); + } + sint32(e) { + return ( + assertInt32(e), + varint32write((e = ((e << 1) ^ (e >> 31)) >>> 0), this.buf), + this + ); + } + sfixed64(e) { + var r = new Uint8Array(8), + t = new DataView(r.buffer), + e = PbLong.from(e); + return ( + t.setInt32(0, e.lo, !0), t.setInt32(4, e.hi, !0), this.raw(r) + ); + } + fixed64(e) { + var r = new Uint8Array(8), + t = new DataView(r.buffer), + e = PbULong.from(e); + return ( + t.setInt32(0, e.lo, !0), t.setInt32(4, e.hi, !0), this.raw(r) + ); + } + int64(e) { + e = PbLong.from(e); + return varint64write(e.lo, e.hi, this.buf), this; + } + sint64(e) { + var e = PbLong.from(e), + r = e.hi >> 31; + return ( + varint64write( + (e.lo << 1) ^ r, + ((e.hi << 1) | (e.lo >>> 31)) ^ r, + this.buf + ), + this + ); + } + uint64(e) { + e = PbULong.from(e); + return varint64write(e.lo, e.hi, this.buf), this; + } + } + function binaryWriteOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsWrite$1), e) + : defaultsWrite$1; + } + function binaryReadOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsRead$1), e) + : defaultsRead$1; + } + !(function (i) { + (i.symbol = Symbol.for('protobuf-ts/unknown')), + (i.onRead = (e, r, t, a, n) => { + (s(r) ? r[i.symbol] : (r[i.symbol] = [])).push({ + no: t, + wireType: a, + data: n, + }); + }), + (i.onWrite = (e, r, t) => { + for (var { no: a, wireType: n, data: s } of i.list(r)) + t.tag(a, n).raw(s); + }), + (i.list = (e, r) => + s(e) + ? ((e = e[i.symbol]), r ? e.filter((e) => e.no == r) : e) + : []), + (i.last = (e, r) => i.list(e, r).slice(-1)[0]); + const s = (e) => e && Array.isArray(e[i.symbol]); + })((UnknownFieldHandler = UnknownFieldHandler || {})); + const defaultsRead$1 = { + readUnknownField: !0, + readerFactory: (e) => new BinaryReader(e), + }, + defaultsWrite$1 = { + writeUnknownFields: !0, + writerFactory: () => new BinaryWriter(), + }, + MESSAGE_TYPE = + (!(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'); + })((WireType = WireType || {})), + Symbol.for('protobuf-ts/message-type')); + function lowerCamelCase(r) { + let t = !1; + var a = []; + for (let e = 0; e < r.length; e++) { + var n = r.charAt(e); + '_' == n + ? (t = !0) + : /\d/.test(n) + ? (a.push(n), (t = !0)) + : t + ? (a.push(n.toUpperCase()), (t = !1)) + : 0 == e + ? a.push(n.toLowerCase()) + : a.push(n); + } + return a.join(''); + } + function normalizeFieldInfo(e) { + var r; + return ( + (e.localName = + null != (r = e.localName) ? r : lowerCamelCase(e.name)), + (e.jsonName = + null != (r = e.jsonName) ? r : lowerCamelCase(e.name)), + (e.repeat = null != (r = e.repeat) ? r : 0), + (e.opt = + null != (r = e.opt) + ? r + : !e.repeat && !e.oneof && 'message' == e.kind), + e + ); + } + function isOneofGroup(e) { + if ( + 'object' != typeof e || + null === e || + !e.hasOwnProperty('oneofKind') + ) + return !1; + switch (typeof e.oneofKind) { + case 'string': + return void 0 === e[e.oneofKind] + ? !1 + : 2 == Object.keys(e).length; + case 'undefined': + return 1 == Object.keys(e).length; + default: + return !1; + } + } + !(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'); + })((ScalarType = ScalarType || {})), + (function (e) { + (e[(e.BIGINT = 0)] = 'BIGINT'), + (e[(e.STRING = 1)] = 'STRING'), + (e[(e.NUMBER = 2)] = 'NUMBER'); + })((LongType = LongType || {})), + (function (e) { + (e[(e.NO = 0)] = 'NO'), + (e[(e.PACKED = 1)] = 'PACKED'), + (e[(e.UNPACKED = 2)] = 'UNPACKED'); + })((RepeatType = RepeatType || {})); + class ReflectionTypeCheck { + constructor(e) { + this.fields = null != (e = e.fields) ? e : []; + } + prepare() { + if (!this.data) { + var e, + r = [], + t = [], + a = []; + for (e of this.fields) + if (e.oneof) + a.includes(e.oneof) || + (a.push(e.oneof), r.push(e.oneof), t.push(e.oneof)); + else + switch ((t.push(e.localName), e.kind)) { + case 'scalar': + case 'enum': + (e.opt && !e.repeat) || r.push(e.localName); + break; + case 'message': + e.repeat && r.push(e.localName); + break; + case 'map': + r.push(e.localName); + } + this.data = { req: r, known: t, oneofs: Object.values(a) }; + } + } + is(e, a, n = !1) { + if (!(a < 0)) { + if (null == e || 'object' != typeof e) return !1; + this.prepare(); + let r = Object.keys(e), + t = this.data; + if ( + r.length < t.req.length || + t.req.some((e) => !r.includes(e)) + ) + return !1; + if (!n && r.some((e) => !t.known.includes(e))) return !1; + if (!(a < 1)) { + for (const i of t.oneofs) { + const o = e[i]; + if (!isOneofGroup(o)) return !1; + if (void 0 !== o.oneofKind) { + var s = this.fields.find( + (e) => e.localName === o.oneofKind + ); + if (!s) return !1; + if (!this.field(o[o.oneofKind], s, n, a)) return !1; + } + } + for (const l of this.fields) + if ( + void 0 === l.oneof && + !this.field(e[l.localName], l, n, a) + ) + return !1; + } + } + return !0; + } + field(e, r, t, a) { + var n = r.repeat; + switch (r.kind) { + case 'scalar': + return void 0 === e + ? r.opt + : n + ? this.scalars(e, r.T, a, r.L) + : this.scalar(e, r.T, r.L); + case 'enum': + return void 0 === e + ? r.opt + : n + ? this.scalars(e, ScalarType.INT32, a) + : this.scalar(e, ScalarType.INT32); + case 'message': + return void 0 === e + ? !0 + : n + ? this.messages(e, r.T(), t, a) + : this.message(e, r.T(), t, a); + case 'map': + if ('object' != typeof e || null === e) return !1; + if (a < 2) return !0; + if (!this.mapKeys(e, r.K, a)) return !1; + switch (r.V.kind) { + case 'scalar': + return this.scalars(Object.values(e), r.V.T, a, r.V.L); + case 'enum': + return this.scalars( + Object.values(e), + ScalarType.INT32, + a + ); + case 'message': + return this.messages(Object.values(e), r.V.T(), t, a); + } + } + return !0; + } + message(e, r, t, a) { + return t ? r.isAssignable(e, a) : r.is(e, a); + } + messages(r, t, e, a) { + if (!Array.isArray(r)) return !1; + if (!(a < 2)) + if (e) { + for (let e = 0; e < r.length && e < a; e++) + if (!t.isAssignable(r[e], a - 1)) return !1; + } else + for (let e = 0; e < r.length && e < a; e++) + if (!t.is(r[e], a - 1)) return !1; + return !0; + } + scalar(e, r, t) { + var a = typeof e; + switch (r) { + case ScalarType.UINT64: + case ScalarType.FIXED64: + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + switch (t) { + case LongType.BIGINT: + return 'bigint' == a; + case LongType.NUMBER: + return 'number' == a && !isNaN(e); + default: + return 'string' == a; + } + case ScalarType.BOOL: + return 'boolean' == a; + case ScalarType.STRING: + return 'string' == a; + case ScalarType.BYTES: + return e instanceof Uint8Array; + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + return 'number' == a && !isNaN(e); + default: + return 'number' == a && Number.isInteger(e); + } + } + scalars(r, t, a, n) { + if (!Array.isArray(r)) return !1; + if (!(a < 2) && Array.isArray(r)) + for (let e = 0; e < r.length && e < a; e++) + if (!this.scalar(r[e], t, n)) return !1; + return !0; + } + mapKeys(e, r, t) { + var a = Object.keys(e); + switch (r) { + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + case ScalarType.UINT32: + return this.scalars( + a.slice(0, t).map((e) => parseInt(e)), + r, + t + ); + case ScalarType.BOOL: + return this.scalars( + a + .slice(0, t) + .map((e) => 'true' == e || ('false' != e && e)), + r, + t + ); + default: + return this.scalars(a, r, t, LongType.STRING); + } + } + } + function typeofJsonValue(e) { + var r = typeof e; + if ('object' == r) { + if (Array.isArray(e)) return 'array'; + if (null === e) return 'null'; + } + return r; + } + function isJsonObject(e) { + return null !== e && 'object' == typeof e && !Array.isArray(e); + } + let encTable = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split( + '' + ), + decTable = []; + for (let e = 0; e < encTable.length; e++) + decTable[encTable[e].charCodeAt(0)] = e; + function base64decode(r) { + let e = (3 * r.length) / 4, + t = + ('=' == r[r.length - 2] + ? (e -= 2) + : '=' == r[r.length - 1] && --e, + new Uint8Array(e)), + a = 0, + n = 0, + s, + i = 0; + for (let e = 0; e < r.length; e++) { + if (void 0 === (s = decTable[r.charCodeAt(e)])) + switch (r[e]) { + case '=': + n = 0; + case '\n': + case '\r': + case '\t': + case ' ': + continue; + default: + throw Error('invalid base64 string.'); + } + switch (n) { + case 0: + (i = s), (n = 1); + break; + case 1: + (t[a++] = (i << 2) | ((48 & s) >> 4)), (i = s), (n = 2); + break; + case 2: + (t[a++] = ((15 & i) << 4) | ((60 & s) >> 2)), + (i = s), + (n = 3); + break; + case 3: + (t[a++] = ((3 & i) << 6) | s), (n = 0); + } + } + if (1 == n) throw Error('invalid base64 string.'); + return t.subarray(0, a); + } + function base64encode(r) { + let t = '', + a = 0, + n, + s = 0; + for (let e = 0; e < r.length; e++) + switch (((n = r[e]), a)) { + case 0: + (t += encTable[n >> 2]), (s = (3 & n) << 4), (a = 1); + break; + case 1: + (t += encTable[s | (n >> 4)]), (s = (15 & n) << 2), (a = 2); + break; + case 2: + (t = (t += encTable[s | (n >> 6)]) + encTable[63 & n]), + (a = 0); + } + return a && ((t = t + encTable[s] + '='), 1 == a && (t += '=')), t; + } + function reflectionLongConvert(e, r) { + switch (r) { + case LongType.BIGINT: + return e.toBigInt(); + case LongType.NUMBER: + return e.toNumber(); + default: + return e.toString(); + } + } + (decTable['-'.charCodeAt(0)] = encTable.indexOf('+')), + (decTable['_'.charCodeAt(0)] = encTable.indexOf('/')); + class ReflectionJsonReader { + constructor(e) { + this.info = e; + } + prepare() { + var e; + if (void 0 === this.fMap) { + this.fMap = {}; + for (const r of null != (e = this.info.fields) ? e : []) + (this.fMap[r.name] = r), + (this.fMap[r.jsonName] = r), + (this.fMap[r.localName] = r); + } + } + assert(e, r, t) { + if (!e) { + let e = typeofJsonValue(t); + throw ( + (('number' != e && 'boolean' != e) || (e = t.toString()), + new Error( + `Cannot parse JSON ${e} for ${this.info.typeName}#` + r + )) + ); + } + } + read(e, r, t) { + this.prepare(); + var a, + n, + s = []; + for ([a, n] of Object.entries(e)) { + var i = this.fMap[a]; + if (!i) { + if (t.ignoreUnknownFields) continue; + throw new Error( + `Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ` + + a + ); + } + var o = i.localName; + let e; + if (i.oneof) { + if (s.includes(i.oneof)) + throw new Error( + `Multiple members of the oneof group "${i.oneof}" of ${this.info.typeName} are present in JSON.` + ); + s.push(i.oneof), (e = r[i.oneof] = { oneofKind: o }); + } else e = r; + if ('map' == i.kind) { + if (null !== n) { + this.assert(isJsonObject(n), i.name, n); + var l, + c, + u = e[o]; + for ([l, c] of Object.entries(n)) { + this.assert(null !== c, i.name + ' map value', null); + let e; + switch (i.V.kind) { + case 'message': + e = i.V.T().internalJsonRead(c, t); + break; + case 'enum': + if ( + !1 === + (e = this.enum( + i.V.T(), + c, + i.name, + t.ignoreUnknownFields + )) + ) + continue; + break; + case 'scalar': + e = this.scalar(c, i.V.T, i.V.L, i.name); + } + this.assert(void 0 !== e, i.name + ' map value', c); + let r = l; + i.K == ScalarType.BOOL && + (r = 'true' == r || ('false' != r && r)), + (u[ + (r = this.scalar( + r, + i.K, + LongType.STRING, + i.name + ).toString()) + ] = e); + } + } + } else if (i.repeat) { + if (null !== n) { + this.assert(Array.isArray(n), i.name, n); + var f = e[o]; + for (const p of n) { + this.assert(null !== p, i.name, null); + let e; + switch (i.kind) { + case 'message': + e = i.T().internalJsonRead(p, t); + break; + case 'enum': + if ( + !1 === + (e = this.enum( + i.T(), + p, + i.name, + t.ignoreUnknownFields + )) + ) + continue; + break; + case 'scalar': + e = this.scalar(p, i.T, i.L, i.name); + } + this.assert(void 0 !== e, i.name, n), f.push(e); + } + } + } else + switch (i.kind) { + case 'message': + null === n && 'google.protobuf.Value' != i.T().typeName + ? this.assert( + void 0 === i.oneof, + i.name + ' (oneof member)', + null + ) + : (e[o] = i.T().internalJsonRead(n, t, e[o])); + break; + case 'enum': + var h = this.enum( + i.T(), + n, + i.name, + t.ignoreUnknownFields + ); + !1 !== h && (e[o] = h); + break; + case 'scalar': + e[o] = this.scalar(n, i.T, i.L, i.name); + } + } + } + enum(r, t, a, n) { + if ( + ('google.protobuf.NullValue' == r[0] && + assert( + null === t, + `Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} only accepts null.` + ), + null === t) + ) + return 0; + switch (typeof t) { + case 'number': + return ( + assert( + Number.isInteger(t), + `Unable to parse field ${this.info.typeName}#${a}, enum can only be integral number, got ${t}.` + ), + t + ); + case 'string': + let e = t; + r[2] && + t.substring(0, r[2].length) === r[2] && + (e = t.substring(r[2].length)); + var s = r[1][e]; + return void 0 === s && n + ? !1 + : (assert( + 'number' == typeof s, + `Unable to parse field ${this.info.typeName}#${a}, enum ${r[0]} has no value for "${t}".` + ), + s); + } + assert( + !1, + `Unable to parse field ${ + this.info.typeName + }#${a}, cannot parse enum value from ${typeof t}".` + ); + } + scalar(r, t, a, e) { + let n; + try { + switch (t) { + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + if (null === r) return 0; + if ('NaN' === r) return Number.NaN; + if ('Infinity' === r) return Number.POSITIVE_INFINITY; + if ('-Infinity' === r) return Number.NEGATIVE_INFINITY; + if ('' === r) n = 'empty string'; + else if ( + 'string' == typeof r && + r.trim().length !== r.length + ) + n = 'extra whitespace'; + else if ('string' == typeof r || 'number' == typeof r) { + var s = Number(r); + if (Number.isNaN(s)) n = 'not a number'; + else { + if (Number.isFinite(s)) + return t == ScalarType.FLOAT && assertFloat32(s), s; + n = 'too large or small'; + } + } + break; + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + case ScalarType.UINT32: + if (null === r) return 0; + let e; + if ( + ('number' == typeof r + ? (e = r) + : '' === r + ? (n = 'empty string') + : 'string' == typeof r && + (r.trim().length !== r.length + ? (n = 'extra whitespace') + : (e = Number(r))), + void 0 === e) + ) + break; + return ( + (t == ScalarType.UINT32 ? assertUInt32 : assertInt32)(e), + e + ); + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + if (null === r) + return reflectionLongConvert(PbLong.ZERO, a); + if ('number' != typeof r && 'string' != typeof r) break; + return reflectionLongConvert(PbLong.from(r), a); + case ScalarType.FIXED64: + case ScalarType.UINT64: + if (null === r) + return reflectionLongConvert(PbULong.ZERO, a); + if ('number' != typeof r && 'string' != typeof r) break; + return reflectionLongConvert(PbULong.from(r), a); + case ScalarType.BOOL: + if (null === r) return !1; + if ('boolean' != typeof r) break; + return r; + case ScalarType.STRING: + if (null === r) return ''; + if ('string' != typeof r) { + n = 'extra whitespace'; + break; + } + try { + encodeURIComponent(r); + } catch (e) { + 0; + break; + } + return r; + case ScalarType.BYTES: + if (null === r || '' === r) return new Uint8Array(0); + if ('string' != typeof r) break; + return base64decode(r); + } + } catch (e) { + n = e.message; + } + this.assert(!1, e + (n ? ' - ' + n : ''), r); + } + } + class ReflectionJsonWriter { + constructor(e) { + this.fields = null != (e = e.fields) ? e : []; + } + write(e, r) { + var t, + a, + n = {}, + s = e; + for (const i of this.fields) + i.oneof + ? (t = s[i.oneof]).oneofKind === i.localName && + ((a = + 'scalar' == i.kind || 'enum' == i.kind + ? __spreadProps(__spreadValues({}, r), { + emitDefaultValues: !0, + }) + : r), + assert(void 0 !== (t = this.field(i, t[i.localName], a))), + (n[r.useProtoFieldName ? i.name : i.jsonName] = t)) + : void 0 !== (a = this.field(i, s[i.localName], r)) && + (n[r.useProtoFieldName ? i.name : i.jsonName] = a); + return n; + } + field(r, t, a) { + let e = void 0; + if ('map' == r.kind) { + assert('object' == typeof t && null !== t); + var n = {}; + switch (r.V.kind) { + case 'scalar': + for (var [s, i] of Object.entries(t)) { + i = this.scalar(r.V.T, i, r.name, !1, !0); + assert(void 0 !== i), (n[s.toString()] = i); + } + break; + case 'message': + var o, + l, + c = r.V.T(); + for ([o, l] of Object.entries(t)) { + var u = this.message(c, l, r.name, a); + assert(void 0 !== u), (n[o.toString()] = u); + } + break; + case 'enum': + var f, + h, + p = r.V.T(); + for ([f, h] of Object.entries(t)) { + assert(void 0 === h || 'number' == typeof h); + var d = this.enum(p, h, r.name, !1, !0, a.enumAsInteger); + assert(void 0 !== d), (n[f.toString()] = d); + } + } + (a.emitDefaultValues || 0 < Object.keys(n).length) && (e = n); + } else if (r.repeat) { + assert(Array.isArray(t)); + var y = []; + switch (r.kind) { + case 'scalar': + for (let e = 0; e < t.length; e++) { + var T = this.scalar(r.T, t[e], r.name, r.opt, !0); + assert(void 0 !== T), y.push(T); + } + break; + case 'enum': + var g = r.T(); + for (let e = 0; e < t.length; e++) { + assert(void 0 === t[e] || 'number' == typeof t[e]); + var b = this.enum( + g, + t[e], + r.name, + r.opt, + !0, + a.enumAsInteger + ); + assert(void 0 !== b), y.push(b); + } + break; + case 'message': + var m = r.T(); + for (let e = 0; e < t.length; e++) { + var w = this.message(m, t[e], r.name, a); + assert(void 0 !== w), y.push(w); + } + } + (a.emitDefaultValues || 0 < y.length || a.emitDefaultValues) && + (e = y); + } else + switch (r.kind) { + case 'scalar': + e = this.scalar(r.T, t, r.name, r.opt, a.emitDefaultValues); + break; + case 'enum': + e = this.enum( + r.T(), + t, + r.name, + r.opt, + a.emitDefaultValues, + a.enumAsInteger + ); + break; + case 'message': + e = this.message(r.T(), t, r.name, a); + } + return e; + } + enum(e, r, t, a, n, s) { + if ('google.protobuf.NullValue' == e[0]) return null; + if (void 0 === r) assert(a); + else if (0 !== r || n || a) + return ( + assert('number' == typeof r), + assert(Number.isInteger(r)), + s || !e[1].hasOwnProperty(r) + ? r + : e[2] + ? e[2] + e[1][r] + : e[1][r] + ); + } + message(e, r, t, a) { + return void 0 === r + ? a.emitDefaultValues + ? null + : void 0 + : e.internalJsonWrite(r, a); + } + scalar(e, r, t, a, n) { + if (void 0 === r) assert(a); + else { + var s = n || a; + switch (e) { + case ScalarType.INT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + return 0 === r ? (s ? 0 : void 0) : (assertInt32(r), r); + case ScalarType.FIXED32: + case ScalarType.UINT32: + return 0 === r ? (s ? 0 : void 0) : (assertUInt32(r), r); + case ScalarType.FLOAT: + assertFloat32(r); + case ScalarType.DOUBLE: + return 0 === r + ? s + ? 0 + : void 0 + : (assert('number' == typeof r), + Number.isNaN(r) + ? 'NaN' + : r === Number.POSITIVE_INFINITY + ? 'Infinity' + : r === Number.NEGATIVE_INFINITY + ? '-Infinity' + : r); + case ScalarType.STRING: + return '' === r + ? s + ? '' + : void 0 + : (assert('string' == typeof r), r); + case ScalarType.BOOL: + return !1 === r + ? !s && void 0 + : (assert('boolean' == typeof r), r); + case ScalarType.UINT64: + case ScalarType.FIXED64: + assert( + 'number' == typeof r || + 'string' == typeof r || + 'bigint' == typeof r + ); + var i = PbULong.from(r); + return i.isZero() && !s ? void 0 : i.toString(); + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + assert( + 'number' == typeof r || + 'string' == typeof r || + 'bigint' == typeof r + ); + i = PbLong.from(r); + return i.isZero() && !s ? void 0 : i.toString(); + case ScalarType.BYTES: + return (assert(r instanceof Uint8Array), r.byteLength) + ? base64encode(r) + : s + ? '' + : void 0; + } + } + } + } + function reflectionScalarDefault(e, r = LongType.STRING) { + switch (e) { + case ScalarType.BOOL: + return !1; + case ScalarType.UINT64: + case ScalarType.FIXED64: + return reflectionLongConvert(PbULong.ZERO, r); + case ScalarType.INT64: + case ScalarType.SFIXED64: + case ScalarType.SINT64: + return reflectionLongConvert(PbLong.ZERO, r); + case ScalarType.DOUBLE: + case ScalarType.FLOAT: + return 0; + case ScalarType.BYTES: + return new Uint8Array(0); + case ScalarType.STRING: + return ''; + default: + return 0; + } + } + class ReflectionBinaryReader { + constructor(e) { + this.info = e; + } + prepare() { + var e; + this.fieldNoToField || + ((e = null != (e = this.info.fields) ? e : []), + (this.fieldNoToField = new Map(e.map((e) => [e.no, e])))); + } + read(a, n, s, e) { + this.prepare(); + for (var r = void 0 === e ? a.len : a.pos + e; a.pos < r; ) { + var [t, i] = a.tag(), + o = this.fieldNoToField.get(t); + if (o) { + let e = n, + r = o.repeat, + t = o.localName; + switch ( + (o.oneof && + (e = e[o.oneof]).oneofKind !== t && + (e = n[o.oneof] = { oneofKind: t }), + o.kind) + ) { + case 'scalar': + case 'enum': + var l = 'enum' == o.kind ? ScalarType.INT32 : o.T, + c = 'scalar' == o.kind ? o.L : void 0; + if (r) { + var u = e[t]; + if ( + i == WireType.LengthDelimited && + l != ScalarType.STRING && + l != ScalarType.BYTES + ) + for (var f = a.uint32() + a.pos; a.pos < f; ) + u.push(this.scalar(a, l, c)); + else u.push(this.scalar(a, l, c)); + } else e[t] = this.scalar(a, l, c); + break; + case 'message': + r + ? ((h = e[t]), + (p = o.T().internalBinaryRead(a, a.uint32(), s)), + h.push(p)) + : (e[t] = o + .T() + .internalBinaryRead(a, a.uint32(), s, e[t])); + break; + case 'map': + var [h, p] = this.mapEntry(o, a, s); + e[t][h] = p; + } + } else { + var d = s.readUnknownField; + if ('throw' == d) + throw new Error( + `Unknown field ${t} (wire type ${i}) for ` + + this.info.typeName + ); + var y = a.skip(i); + !1 !== d && + (!0 === d ? UnknownFieldHandler.onRead : d)( + this.info.typeName, + n, + t, + i, + y + ); + } + } + } + mapEntry(e, r, t) { + var a = r.uint32(), + n = r.pos + a; + let s = void 0, + i = void 0; + for (; r.pos < n; ) { + var [o, l] = r.tag(); + switch (o) { + case 1: + s = + e.K == ScalarType.BOOL + ? r.bool().toString() + : this.scalar(r, e.K, LongType.STRING); + break; + case 2: + switch (e.V.kind) { + case 'scalar': + i = this.scalar(r, e.V.T, e.V.L); + break; + case 'enum': + i = r.int32(); + break; + case 'message': + i = e.V.T().internalBinaryRead(r, r.uint32(), t); + } + break; + default: + throw new Error( + `Unknown field ${o} (wire type ${l}) in map entry for ${this.info.typeName}#` + + e.name + ); + } + } + if ( + (void 0 === s && + ((a = reflectionScalarDefault(e.K)), + (s = e.K == ScalarType.BOOL ? a.toString() : a)), + void 0 === i) + ) + switch (e.V.kind) { + case 'scalar': + i = reflectionScalarDefault(e.V.T, e.V.L); + break; + case 'enum': + i = 0; + break; + case 'message': + i = e.V.T().create(); + } + return [s, i]; + } + scalar(e, r, t) { + switch (r) { + case ScalarType.INT32: + return e.int32(); + case ScalarType.STRING: + return e.string(); + case ScalarType.BOOL: + return e.bool(); + case ScalarType.DOUBLE: + return e.double(); + case ScalarType.FLOAT: + return e.float(); + case ScalarType.INT64: + return reflectionLongConvert(e.int64(), t); + case ScalarType.UINT64: + return reflectionLongConvert(e.uint64(), t); + case ScalarType.FIXED64: + return reflectionLongConvert(e.fixed64(), t); + case ScalarType.FIXED32: + return e.fixed32(); + case ScalarType.BYTES: + return e.bytes(); + case ScalarType.UINT32: + return e.uint32(); + case ScalarType.SFIXED32: + return e.sfixed32(); + case ScalarType.SFIXED64: + return reflectionLongConvert(e.sfixed64(), t); + case ScalarType.SINT32: + return e.sint32(); + case ScalarType.SINT64: + return reflectionLongConvert(e.sint64(), t); + } + } + } + class ReflectionBinaryWriter { + constructor(e) { + this.info = e; + } + prepare() { + var e; + this.fields || + ((e = this.info.fields ? this.info.fields.concat() : []), + (this.fields = e.sort((e, r) => e.no - r.no))); + } + write(n, s, i) { + this.prepare(); + for (const f of this.fields) { + let e, + r, + t = f.repeat, + a = f.localName; + if (f.oneof) { + var o = n[f.oneof]; + if (o.oneofKind !== a) continue; + (e = o[a]), (r = !0); + } else (e = n[a]), (r = !1); + switch (f.kind) { + case 'scalar': + case 'enum': + var l = 'enum' == f.kind ? ScalarType.INT32 : f.T; + if (t) + if ((assert(Array.isArray(e)), t == RepeatType.PACKED)) + this.packed(s, l, f.no, e); + else for (const h of e) this.scalar(s, l, f.no, h, !0); + else + void 0 === e + ? assert(f.opt) + : this.scalar(s, l, f.no, e, r || f.opt); + break; + case 'message': + if (t) { + assert(Array.isArray(e)); + for (const p of e) this.message(s, i, f.T(), f.no, p); + } else this.message(s, i, f.T(), f.no, e); + break; + case 'map': + assert('object' == typeof e && null !== e); + for (var [c, u] of Object.entries(e)) + this.mapEntry(s, i, f, c, u); + } + } + var e = i.writeUnknownFields; + !1 !== e && + (!0 === e ? UnknownFieldHandler.onWrite : e)( + this.info.typeName, + n, + s + ); + } + mapEntry(e, r, t, a, n) { + e.tag(t.no, WireType.LengthDelimited), e.fork(); + let s = a; + switch (t.K) { + case ScalarType.INT32: + case ScalarType.FIXED32: + case ScalarType.UINT32: + case ScalarType.SFIXED32: + case ScalarType.SINT32: + s = Number.parseInt(a); + break; + case ScalarType.BOOL: + assert('true' == a || 'false' == a), (s = 'true' == a); + } + switch ((this.scalar(e, t.K, 1, s, !0), t.V.kind)) { + case 'scalar': + this.scalar(e, t.V.T, 2, n, !0); + break; + case 'enum': + this.scalar(e, ScalarType.INT32, 2, n, !0); + break; + case 'message': + this.message(e, r, t.V.T(), 2, n); + } + e.join(); + } + message(e, r, t, a, n) { + void 0 !== n && + (t.internalBinaryWrite( + n, + e.tag(a, WireType.LengthDelimited).fork(), + r + ), + e.join()); + } + scalar(e, r, t, a, n) { + var [r, s, i] = this.scalarInfo(r, a); + (i && !n) || (e.tag(t, r), e[s](a)); + } + packed(r, e, t, a) { + if (a.length) { + assert(e !== ScalarType.BYTES && e !== ScalarType.STRING), + r.tag(t, WireType.LengthDelimited), + r.fork(); + var [, n] = this.scalarInfo(e); + for (let e = 0; e < a.length; e++) r[n](a[e]); + r.join(); + } + } + scalarInfo(e, r) { + let t = WireType.Varint, + a; + var n = void 0 === r; + let s = 0 === r; + switch (e) { + case ScalarType.INT32: + a = 'int32'; + break; + case ScalarType.STRING: + (s = n || !r.length), + (t = WireType.LengthDelimited), + (a = 'string'); + break; + case ScalarType.BOOL: + (s = !1 === r), (a = 'bool'); + break; + case ScalarType.UINT32: + a = 'uint32'; + break; + case ScalarType.DOUBLE: + (t = WireType.Bit64), (a = 'double'); + break; + case ScalarType.FLOAT: + (t = WireType.Bit32), (a = 'float'); + break; + case ScalarType.INT64: + (s = n || PbLong.from(r).isZero()), (a = 'int64'); + break; + case ScalarType.UINT64: + (s = n || PbULong.from(r).isZero()), (a = 'uint64'); + break; + case ScalarType.FIXED64: + (s = n || PbULong.from(r).isZero()), + (t = WireType.Bit64), + (a = 'fixed64'); + break; + case ScalarType.BYTES: + (s = n || !r.byteLength), + (t = WireType.LengthDelimited), + (a = 'bytes'); + break; + case ScalarType.FIXED32: + (t = WireType.Bit32), (a = 'fixed32'); + break; + case ScalarType.SFIXED32: + (t = WireType.Bit32), (a = 'sfixed32'); + break; + case ScalarType.SFIXED64: + (s = n || PbLong.from(r).isZero()), + (t = WireType.Bit64), + (a = 'sfixed64'); + break; + case ScalarType.SINT32: + a = 'sint32'; + break; + case ScalarType.SINT64: + (s = n || PbLong.from(r).isZero()), (a = 'sint64'); + } + return [t, a, n || s]; + } + } + function reflectionCreate(e) { + var r, + t = {}; + Object.defineProperty(t, MESSAGE_TYPE, { + enumerable: !1, + value: e, + }); + for (r of e.fields) { + var a = r.localName; + if (!r.opt) + if (r.oneof) t[r.oneof] = { oneofKind: void 0 }; + else if (r.repeat) t[a] = []; + else + switch (r.kind) { + case 'scalar': + t[a] = reflectionScalarDefault(r.T, r.L); + break; + case 'enum': + t[a] = 0; + break; + case 'map': + t[a] = {}; + } + } + return t; + } + function reflectionMergePartial(e, r, t) { + let a, + n = t, + s; + for (var i of e.fields) { + var o = i.localName; + if (i.oneof) { + var l = n[i.oneof]; + if (void 0 === l) continue; + if ( + ((a = l[o]), + ((s = r[i.oneof]).oneofKind = l.oneofKind), + void 0 === a) + ) { + delete s[o]; + continue; + } + } else if (((a = n[o]), (s = r), void 0 === a)) continue; + switch (i.kind) { + case 'scalar': + case 'enum': + i.repeat ? (s[o] = a.concat()) : (s[o] = a); + break; + case 'message': + var c = i.T(); + if (i.repeat) + for (let e = 0; e < a.length; e++) s[o][e] = c.create(a[e]); + else + void 0 === s[o] + ? (s[o] = c.create(a)) + : c.mergePartial(s[o], a); + break; + case 'map': + switch (i.V.kind) { + case 'scalar': + case 'enum': + Object.assign(s[o], a); + break; + case 'message': + var u, + f = i.V.T(); + for (u of Object.keys(a)) s[o][u] = f.create(a[u]); + } + } + } + } + const defaultsWrite = { + emitDefaultValues: !1, + enumAsInteger: !1, + useProtoFieldName: !1, + prettySpaces: 0, + }, + defaultsRead = { ignoreUnknownFields: !1 }; + function jsonReadOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsRead), e) + : defaultsRead; + } + function jsonWriteOptions(e) { + return e + ? __spreadValues(__spreadValues({}, defaultsWrite), e) + : defaultsWrite; + } + function reflectionEquals(e, r, t) { + if (r !== t) { + if (!r || !t) return !1; + for (var a of e.fields) { + var n = a.localName, + s = (a.oneof ? r[a.oneof] : r)[n], + i = (a.oneof ? t[a.oneof] : t)[n]; + switch (a.kind) { + case 'enum': + case 'scalar': + var o = 'enum' == a.kind ? ScalarType.INT32 : a.T; + if ((a.repeat ? repeatedPrimitiveEq : primitiveEq)(o, s, i)) + break; + return !1; + case 'map': + if ( + 'message' == a.V.kind + ? repeatedMsgEq( + a.V.T(), + objectValues(s), + objectValues(i) + ) + : repeatedPrimitiveEq( + 'enum' == a.V.kind ? ScalarType.INT32 : a.V.T, + objectValues(s), + objectValues(i) + ) + ) + break; + return !1; + case 'message': + o = a.T(); + if (a.repeat ? repeatedMsgEq(o, s, i) : o.equals(s, i)) + break; + return !1; + } + } + } + return !0; + } + const objectValues = Object.values; + function primitiveEq(e, r, t) { + if (r !== t) { + if (e !== ScalarType.BYTES) return !1; + var a = r, + n = t; + if (a.length !== n.length) return !1; + for (let e = 0; e < a.length; e++) if (a[e] != n[e]) return !1; + } + return !0; + } + function repeatedPrimitiveEq(r, t, a) { + if (t.length !== a.length) return !1; + for (let e = 0; e < t.length; e++) + if (!primitiveEq(r, t[e], a[e])) return !1; + return !0; + } + function repeatedMsgEq(r, t, a) { + if (t.length !== a.length) return !1; + for (let e = 0; e < t.length; e++) + if (!r.equals(t[e], a[e])) return !1; + return !0; + } + class MessageType { + constructor(e, r, t) { + (this.defaultCheckDepth = 16), + (this.typeName = e), + (this.fields = r.map(normalizeFieldInfo)), + (this.options = null != t ? t : {}), + (this.refTypeCheck = new ReflectionTypeCheck(this)), + (this.refJsonReader = new ReflectionJsonReader(this)), + (this.refJsonWriter = new ReflectionJsonWriter(this)), + (this.refBinReader = new ReflectionBinaryReader(this)), + (this.refBinWriter = new ReflectionBinaryWriter(this)); + } + create(e) { + var r = reflectionCreate(this); + return void 0 !== e && reflectionMergePartial(this, r, e), r; + } + clone(e) { + var r = this.create(); + return reflectionMergePartial(this, r, e), r; + } + equals(e, r) { + return reflectionEquals(this, e, r); + } + is(e, r = this.defaultCheckDepth) { + return this.refTypeCheck.is(e, r, !1); + } + isAssignable(e, r = this.defaultCheckDepth) { + return this.refTypeCheck.is(e, r, !0); + } + mergePartial(e, r) { + reflectionMergePartial(this, e, r); + } + fromBinary(e, r) { + r = binaryReadOptions(r); + return this.internalBinaryRead( + r.readerFactory(e), + e.byteLength, + r + ); + } + fromJson(e, r) { + return this.internalJsonRead(e, jsonReadOptions(r)); + } + fromJsonString(e, r) { + e = JSON.parse(e); + return this.fromJson(e, r); + } + toJson(e, r) { + return this.internalJsonWrite(e, jsonWriteOptions(r)); + } + toJsonString(e, r) { + var e = this.toJson(e, r); + return JSON.stringify( + e, + null, + null != (e = null == r ? void 0 : r.prettySpaces) ? e : 0 + ); + } + toBinary(e, r) { + r = binaryWriteOptions(r); + return this.internalBinaryWrite(e, r.writerFactory(), r).finish(); + } + internalJsonRead(e, r, t) { + if (null === e || 'object' != typeof e || Array.isArray(e)) + throw new Error( + `Unable to parse message ${ + this.typeName + } from JSON ${typeofJsonValue(e)}.` + ); + return ( + (t = null != t ? t : this.create()), + this.refJsonReader.read(e, t, r), + t + ); + } + internalJsonWrite(e, r) { + return this.refJsonWriter.write(e, r); + } + internalBinaryWrite(e, r, t) { + return this.refBinWriter.write(e, r, t), r; + } + internalBinaryRead(e, r, t, a) { + a = null != a ? a : this.create(); + return this.refBinReader.read(e, a, t, r), a; + } + } + /****************** initialization finish ******************/ + switch (FORMAT) { + case 'application/x-protobuf': + break; + case 'application/grpc': + case 'application/grpc+proto': + /****************** initialization start *******************/ + // pako 2.0.4 + !(function (t, e) { + 'object' == typeof exports && 'undefined' != typeof module + ? e(exports) + : 'function' == typeof define && define.amd + ? define(['exports'], e) + : e( + ((t = + 'undefined' != typeof globalThis + ? globalThis + : t || self).pako = {}) + ); + })(this, function (t) { + 'use strict'; + function e(t) { + let e = t.length; + for (; --e >= 0; ) t[e] = 0; + } + const a = 256, + i = 286, + n = 30, + s = 15, + r = new Uint8Array([ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 5, 5, 5, 5, 0, + ]), + l = new Uint8Array([ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, + 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, + ]), + o = new Uint8Array([ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7, + ]), + h = new Uint8Array([ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, + 1, 15, + ]), + d = new Array(576); + e(d); + const _ = new Array(60); + e(_); + const f = new Array(512); + e(f); + const c = new Array(256); + e(c); + const u = new Array(29); + e(u); + const w = new Array(n); + function b(t, e, a, i, n) { + (this.static_tree = t), + (this.extra_bits = e), + (this.extra_base = a), + (this.elems = i), + (this.max_length = n), + (this.has_stree = t && t.length); + } + let g, p, m; + function k(t, e) { + (this.dyn_tree = t), + (this.max_code = 0), + (this.stat_desc = e); + } + e(w); + const v = (t) => (t < 256 ? f[t] : f[256 + (t >>> 7)]), + y = (t, e) => { + (t.pending_buf[t.pending++] = 255 & e), + (t.pending_buf[t.pending++] = (e >>> 8) & 255); + }, + x = (t, e, a) => { + t.bi_valid > 16 - a + ? ((t.bi_buf |= (e << t.bi_valid) & 65535), + y(t, t.bi_buf), + (t.bi_buf = e >> (16 - t.bi_valid)), + (t.bi_valid += a - 16)) + : ((t.bi_buf |= (e << t.bi_valid) & 65535), + (t.bi_valid += a)); + }, + z = (t, e, a) => { + x(t, a[2 * e], a[2 * e + 1]); + }, + A = (t, e) => { + let a = 0; + do { + (a |= 1 & t), (t >>>= 1), (a <<= 1); + } while (--e > 0); + return a >>> 1; + }, + E = (t, e, a) => { + const i = new Array(16); + let n, + r, + l = 0; + for (n = 1; n <= s; n++) i[n] = l = (l + a[n - 1]) << 1; + for (r = 0; r <= e; r++) { + let e = t[2 * r + 1]; + 0 !== e && (t[2 * r] = A(i[e]++, e)); + } + }, + R = (t) => { + let e; + for (e = 0; e < i; e++) t.dyn_ltree[2 * e] = 0; + for (e = 0; e < n; e++) t.dyn_dtree[2 * e] = 0; + for (e = 0; e < 19; e++) t.bl_tree[2 * e] = 0; + (t.dyn_ltree[512] = 1), + (t.opt_len = t.static_len = 0), + (t.last_lit = t.matches = 0); + }, + Z = (t) => { + t.bi_valid > 8 + ? y(t, t.bi_buf) + : t.bi_valid > 0 && + (t.pending_buf[t.pending++] = t.bi_buf), + (t.bi_buf = 0), + (t.bi_valid = 0); + }, + U = (t, e, a, i) => { + const n = 2 * e, + s = 2 * a; + return t[n] < t[s] || (t[n] === t[s] && i[e] <= i[a]); + }, + S = (t, e, a) => { + const i = t.heap[a]; + let n = a << 1; + for ( + ; + n <= t.heap_len && + (n < t.heap_len && + U(e, t.heap[n + 1], t.heap[n], t.depth) && + n++, + !U(e, i, t.heap[n], t.depth)); + + ) + (t.heap[a] = t.heap[n]), (a = n), (n <<= 1); + t.heap[a] = i; + }, + D = (t, e, i) => { + let n, + s, + o, + h, + d = 0; + if (0 !== t.last_lit) + do { + (n = + (t.pending_buf[t.d_buf + 2 * d] << 8) | + t.pending_buf[t.d_buf + 2 * d + 1]), + (s = t.pending_buf[t.l_buf + d]), + d++, + 0 === n + ? z(t, s, e) + : ((o = c[s]), + z(t, o + a + 1, e), + (h = r[o]), + 0 !== h && ((s -= u[o]), x(t, s, h)), + n--, + (o = v(n)), + z(t, o, i), + (h = l[o]), + 0 !== h && ((n -= w[o]), x(t, n, h))); + } while (d < t.last_lit); + z(t, 256, e); + }, + T = (t, e) => { + const a = e.dyn_tree, + i = e.stat_desc.static_tree, + n = e.stat_desc.has_stree, + r = e.stat_desc.elems; + let l, + o, + h, + d = -1; + for (t.heap_len = 0, t.heap_max = 573, l = 0; l < r; l++) + 0 !== a[2 * l] + ? ((t.heap[++t.heap_len] = d = l), (t.depth[l] = 0)) + : (a[2 * l + 1] = 0); + for (; t.heap_len < 2; ) + (h = t.heap[++t.heap_len] = d < 2 ? ++d : 0), + (a[2 * h] = 1), + (t.depth[h] = 0), + t.opt_len--, + n && (t.static_len -= i[2 * h + 1]); + for (e.max_code = d, l = t.heap_len >> 1; l >= 1; l--) + S(t, a, l); + h = r; + do { + (l = t.heap[1]), + (t.heap[1] = t.heap[t.heap_len--]), + S(t, a, 1), + (o = t.heap[1]), + (t.heap[--t.heap_max] = l), + (t.heap[--t.heap_max] = o), + (a[2 * h] = a[2 * l] + a[2 * o]), + (t.depth[h] = + (t.depth[l] >= t.depth[o] ? t.depth[l] : t.depth[o]) + + 1), + (a[2 * l + 1] = a[2 * o + 1] = h), + (t.heap[1] = h++), + S(t, a, 1); + } while (t.heap_len >= 2); + (t.heap[--t.heap_max] = t.heap[1]), + ((t, e) => { + const a = e.dyn_tree, + i = e.max_code, + n = e.stat_desc.static_tree, + r = e.stat_desc.has_stree, + l = e.stat_desc.extra_bits, + o = e.stat_desc.extra_base, + h = e.stat_desc.max_length; + let d, + _, + f, + c, + u, + w, + b = 0; + for (c = 0; c <= s; c++) t.bl_count[c] = 0; + for ( + a[2 * t.heap[t.heap_max] + 1] = 0, d = t.heap_max + 1; + d < 573; + d++ + ) + (_ = t.heap[d]), + (c = a[2 * a[2 * _ + 1] + 1] + 1), + c > h && ((c = h), b++), + (a[2 * _ + 1] = c), + _ > i || + (t.bl_count[c]++, + (u = 0), + _ >= o && (u = l[_ - o]), + (w = a[2 * _]), + (t.opt_len += w * (c + u)), + r && (t.static_len += w * (n[2 * _ + 1] + u))); + if (0 !== b) { + do { + for (c = h - 1; 0 === t.bl_count[c]; ) c--; + t.bl_count[c]--, + (t.bl_count[c + 1] += 2), + t.bl_count[h]--, + (b -= 2); + } while (b > 0); + for (c = h; 0 !== c; c--) + for (_ = t.bl_count[c]; 0 !== _; ) + (f = t.heap[--d]), + f > i || + (a[2 * f + 1] !== c && + ((t.opt_len += + (c - a[2 * f + 1]) * a[2 * f]), + (a[2 * f + 1] = c)), + _--); + } + })(t, e), + E(a, d, t.bl_count); + }, + O = (t, e, a) => { + let i, + n, + s = -1, + r = e[1], + l = 0, + o = 7, + h = 4; + for ( + 0 === r && ((o = 138), (h = 3)), + e[2 * (a + 1) + 1] = 65535, + i = 0; + i <= a; + i++ + ) + (n = r), + (r = e[2 * (i + 1) + 1]), + (++l < o && n === r) || + (l < h + ? (t.bl_tree[2 * n] += l) + : 0 !== n + ? (n !== s && t.bl_tree[2 * n]++, t.bl_tree[32]++) + : l <= 10 + ? t.bl_tree[34]++ + : t.bl_tree[36]++, + (l = 0), + (s = n), + 0 === r + ? ((o = 138), (h = 3)) + : n === r + ? ((o = 6), (h = 3)) + : ((o = 7), (h = 4))); + }, + I = (t, e, a) => { + let i, + n, + s = -1, + r = e[1], + l = 0, + o = 7, + h = 4; + for (0 === r && ((o = 138), (h = 3)), i = 0; i <= a; i++) + if ( + ((n = r), + (r = e[2 * (i + 1) + 1]), + !(++l < o && n === r)) + ) { + if (l < h) + do { + z(t, n, t.bl_tree); + } while (0 != --l); + else + 0 !== n + ? (n !== s && (z(t, n, t.bl_tree), l--), + z(t, 16, t.bl_tree), + x(t, l - 3, 2)) + : l <= 10 + ? (z(t, 17, t.bl_tree), x(t, l - 3, 3)) + : (z(t, 18, t.bl_tree), x(t, l - 11, 7)); + (l = 0), + (s = n), + 0 === r + ? ((o = 138), (h = 3)) + : n === r + ? ((o = 6), (h = 3)) + : ((o = 7), (h = 4)); + } + }; + let F = !1; + const L = (t, e, a, i) => { + x(t, 0 + (i ? 1 : 0), 3), + ((t, e, a, i) => { + Z(t), + i && (y(t, a), y(t, ~a)), + t.pending_buf.set( + t.window.subarray(e, e + a), + t.pending + ), + (t.pending += a); + })(t, e, a, !0); + }; + var N = { + _tr_init: (t) => { + F || + ((() => { + let t, e, a, h, k; + const v = new Array(16); + for (a = 0, h = 0; h < 28; h++) + for (u[h] = a, t = 0; t < 1 << r[h]; t++) c[a++] = h; + for (c[a - 1] = h, k = 0, h = 0; h < 16; h++) + for (w[h] = k, t = 0; t < 1 << l[h]; t++) f[k++] = h; + for (k >>= 7; h < n; h++) + for (w[h] = k << 7, t = 0; t < 1 << (l[h] - 7); t++) + f[256 + k++] = h; + for (e = 0; e <= s; e++) v[e] = 0; + for (t = 0; t <= 143; ) (d[2 * t + 1] = 8), t++, v[8]++; + for (; t <= 255; ) (d[2 * t + 1] = 9), t++, v[9]++; + for (; t <= 279; ) (d[2 * t + 1] = 7), t++, v[7]++; + for (; t <= 287; ) (d[2 * t + 1] = 8), t++, v[8]++; + for (E(d, 287, v), t = 0; t < n; t++) + (_[2 * t + 1] = 5), (_[2 * t] = A(t, 5)); + (g = new b(d, r, 257, i, s)), + (p = new b(_, l, 0, n, s)), + (m = new b(new Array(0), o, 0, 19, 7)); + })(), + (F = !0)), + (t.l_desc = new k(t.dyn_ltree, g)), + (t.d_desc = new k(t.dyn_dtree, p)), + (t.bl_desc = new k(t.bl_tree, m)), + (t.bi_buf = 0), + (t.bi_valid = 0), + R(t); + }, + _tr_stored_block: L, + _tr_flush_block: (t, e, i, n) => { + let s, + r, + l = 0; + t.level > 0 + ? (2 === t.strm.data_type && + (t.strm.data_type = ((t) => { + let e, + i = 4093624447; + for (e = 0; e <= 31; e++, i >>>= 1) + if (1 & i && 0 !== t.dyn_ltree[2 * e]) return 0; + if ( + 0 !== t.dyn_ltree[18] || + 0 !== t.dyn_ltree[20] || + 0 !== t.dyn_ltree[26] + ) + return 1; + for (e = 32; e < a; e++) + if (0 !== t.dyn_ltree[2 * e]) return 1; + return 0; + })(t)), + T(t, t.l_desc), + T(t, t.d_desc), + (l = ((t) => { + let e; + for ( + O(t, t.dyn_ltree, t.l_desc.max_code), + O(t, t.dyn_dtree, t.d_desc.max_code), + T(t, t.bl_desc), + e = 18; + e >= 3 && 0 === t.bl_tree[2 * h[e] + 1]; + e-- + ); + return (t.opt_len += 3 * (e + 1) + 5 + 5 + 4), e; + })(t)), + (s = (t.opt_len + 3 + 7) >>> 3), + (r = (t.static_len + 3 + 7) >>> 3), + r <= s && (s = r)) + : (s = r = i + 5), + i + 4 <= s && -1 !== e + ? L(t, e, i, n) + : 4 === t.strategy || r === s + ? (x(t, 2 + (n ? 1 : 0), 3), D(t, d, _)) + : (x(t, 4 + (n ? 1 : 0), 3), + ((t, e, a, i) => { + let n; + for ( + x(t, e - 257, 5), + x(t, a - 1, 5), + x(t, i - 4, 4), + n = 0; + n < i; + n++ + ) + x(t, t.bl_tree[2 * h[n] + 1], 3); + I(t, t.dyn_ltree, e - 1), I(t, t.dyn_dtree, a - 1); + })( + t, + t.l_desc.max_code + 1, + t.d_desc.max_code + 1, + l + 1 + ), + D(t, t.dyn_ltree, t.dyn_dtree)), + R(t), + n && Z(t); + }, + _tr_tally: (t, e, i) => ( + (t.pending_buf[t.d_buf + 2 * t.last_lit] = (e >>> 8) & 255), + (t.pending_buf[t.d_buf + 2 * t.last_lit + 1] = 255 & e), + (t.pending_buf[t.l_buf + t.last_lit] = 255 & i), + t.last_lit++, + 0 === e + ? t.dyn_ltree[2 * i]++ + : (t.matches++, + e--, + t.dyn_ltree[2 * (c[i] + a + 1)]++, + t.dyn_dtree[2 * v(e)]++), + t.last_lit === t.lit_bufsize - 1 + ), + _tr_align: (t) => { + x(t, 2, 3), + z(t, 256, d), + ((t) => { + 16 === t.bi_valid + ? (y(t, t.bi_buf), (t.bi_buf = 0), (t.bi_valid = 0)) + : t.bi_valid >= 8 && + ((t.pending_buf[t.pending++] = 255 & t.bi_buf), + (t.bi_buf >>= 8), + (t.bi_valid -= 8)); + })(t); + }, + }; + var B = (t, e, a, i) => { + let n = (65535 & t) | 0, + s = ((t >>> 16) & 65535) | 0, + r = 0; + for (; 0 !== a; ) { + (r = a > 2e3 ? 2e3 : a), (a -= r); + do { + (n = (n + e[i++]) | 0), (s = (s + n) | 0); + } while (--r); + (n %= 65521), (s %= 65521); + } + return n | (s << 16) | 0; + }; + const C = new Uint32Array( + (() => { + let t, + e = []; + for (var a = 0; a < 256; a++) { + t = a; + for (var i = 0; i < 8; i++) + t = 1 & t ? 3988292384 ^ (t >>> 1) : t >>> 1; + e[a] = t; + } + return e; + })() + ); + var M = (t, e, a, i) => { + const n = C, + s = i + a; + t ^= -1; + for (let a = i; a < s; a++) + t = (t >>> 8) ^ n[255 & (t ^ e[a])]; + return -1 ^ t; + }, + H = { + 2: 'need dictionary', + 1: 'stream end', + 0: '', + '-1': 'file error', + '-2': 'stream error', + '-3': 'data error', + '-4': 'insufficient memory', + '-5': 'buffer error', + '-6': 'incompatible version', + }, + j = { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_MEM_ERROR: -4, + Z_BUF_ERROR: -5, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + Z_BINARY: 0, + Z_TEXT: 1, + Z_UNKNOWN: 2, + Z_DEFLATED: 8, + }; + const { + _tr_init: K, + _tr_stored_block: P, + _tr_flush_block: Y, + _tr_tally: G, + _tr_align: X, + } = N, + { + Z_NO_FLUSH: W, + Z_PARTIAL_FLUSH: q, + Z_FULL_FLUSH: J, + Z_FINISH: Q, + Z_BLOCK: V, + Z_OK: $, + Z_STREAM_END: tt, + Z_STREAM_ERROR: et, + Z_DATA_ERROR: at, + Z_BUF_ERROR: it, + Z_DEFAULT_COMPRESSION: nt, + Z_FILTERED: st, + Z_HUFFMAN_ONLY: rt, + Z_RLE: lt, + Z_FIXED: ot, + Z_DEFAULT_STRATEGY: ht, + Z_UNKNOWN: dt, + Z_DEFLATED: _t, + } = j, + ft = 258, + ct = 262, + ut = 103, + wt = 113, + bt = 666, + gt = (t, e) => ((t.msg = H[e]), e), + pt = (t) => (t << 1) - (t > 4 ? 9 : 0), + mt = (t) => { + let e = t.length; + for (; --e >= 0; ) t[e] = 0; + }; + let kt = (t, e, a) => ((e << t.hash_shift) ^ a) & t.hash_mask; + const vt = (t) => { + const e = t.state; + let a = e.pending; + a > t.avail_out && (a = t.avail_out), + 0 !== a && + (t.output.set( + e.pending_buf.subarray( + e.pending_out, + e.pending_out + a + ), + t.next_out + ), + (t.next_out += a), + (e.pending_out += a), + (t.total_out += a), + (t.avail_out -= a), + (e.pending -= a), + 0 === e.pending && (e.pending_out = 0)); + }, + yt = (t, e) => { + Y( + t, + t.block_start >= 0 ? t.block_start : -1, + t.strstart - t.block_start, + e + ), + (t.block_start = t.strstart), + vt(t.strm); + }, + xt = (t, e) => { + t.pending_buf[t.pending++] = e; + }, + zt = (t, e) => { + (t.pending_buf[t.pending++] = (e >>> 8) & 255), + (t.pending_buf[t.pending++] = 255 & e); + }, + At = (t, e, a, i) => { + let n = t.avail_in; + return ( + n > i && (n = i), + 0 === n + ? 0 + : ((t.avail_in -= n), + e.set(t.input.subarray(t.next_in, t.next_in + n), a), + 1 === t.state.wrap + ? (t.adler = B(t.adler, e, n, a)) + : 2 === t.state.wrap && + (t.adler = M(t.adler, e, n, a)), + (t.next_in += n), + (t.total_in += n), + n) + ); + }, + Et = (t, e) => { + let a, + i, + n = t.max_chain_length, + s = t.strstart, + r = t.prev_length, + l = t.nice_match; + const o = + t.strstart > t.w_size - ct + ? t.strstart - (t.w_size - ct) + : 0, + h = t.window, + d = t.w_mask, + _ = t.prev, + f = t.strstart + ft; + let c = h[s + r - 1], + u = h[s + r]; + t.prev_length >= t.good_match && (n >>= 2), + l > t.lookahead && (l = t.lookahead); + do { + if ( + ((a = e), + h[a + r] === u && + h[a + r - 1] === c && + h[a] === h[s] && + h[++a] === h[s + 1]) + ) { + (s += 2), a++; + do {} while ( + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + h[++s] === h[++a] && + s < f + ); + if (((i = ft - (f - s)), (s = f - ft), i > r)) { + if (((t.match_start = e), (r = i), i >= l)) break; + (c = h[s + r - 1]), (u = h[s + r]); + } + } + } while ((e = _[e & d]) > o && 0 != --n); + return r <= t.lookahead ? r : t.lookahead; + }, + Rt = (t) => { + const e = t.w_size; + let a, i, n, s, r; + do { + if ( + ((s = t.window_size - t.lookahead - t.strstart), + t.strstart >= e + (e - ct)) + ) { + t.window.set(t.window.subarray(e, e + e), 0), + (t.match_start -= e), + (t.strstart -= e), + (t.block_start -= e), + (i = t.hash_size), + (a = i); + do { + (n = t.head[--a]), (t.head[a] = n >= e ? n - e : 0); + } while (--i); + (i = e), (a = i); + do { + (n = t.prev[--a]), (t.prev[a] = n >= e ? n - e : 0); + } while (--i); + s += e; + } + if (0 === t.strm.avail_in) break; + if ( + ((i = At( + t.strm, + t.window, + t.strstart + t.lookahead, + s + )), + (t.lookahead += i), + t.lookahead + t.insert >= 3) + ) + for ( + r = t.strstart - t.insert, + t.ins_h = t.window[r], + t.ins_h = kt(t, t.ins_h, t.window[r + 1]); + t.insert && + ((t.ins_h = kt(t, t.ins_h, t.window[r + 3 - 1])), + (t.prev[r & t.w_mask] = t.head[t.ins_h]), + (t.head[t.ins_h] = r), + r++, + t.insert--, + !(t.lookahead + t.insert < 3)); + + ); + } while (t.lookahead < ct && 0 !== t.strm.avail_in); + }, + Zt = (t, e) => { + let a, i; + for (;;) { + if (t.lookahead < ct) { + if ((Rt(t), t.lookahead < ct && e === W)) return 1; + if (0 === t.lookahead) break; + } + if ( + ((a = 0), + t.lookahead >= 3 && + ((t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart)), + 0 !== a && + t.strstart - a <= t.w_size - ct && + (t.match_length = Et(t, a)), + t.match_length >= 3) + ) + if ( + ((i = G( + t, + t.strstart - t.match_start, + t.match_length - 3 + )), + (t.lookahead -= t.match_length), + t.match_length <= t.max_lazy_match && + t.lookahead >= 3) + ) { + t.match_length--; + do { + t.strstart++, + (t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = + t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart); + } while (0 != --t.match_length); + t.strstart++; + } else + (t.strstart += t.match_length), + (t.match_length = 0), + (t.ins_h = t.window[t.strstart]), + (t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 1] + )); + else + (i = G(t, 0, t.window[t.strstart])), + t.lookahead--, + t.strstart++; + if (i && (yt(t, !1), 0 === t.strm.avail_out)) return 1; + } + return ( + (t.insert = t.strstart < 2 ? t.strstart : 2), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + }, + Ut = (t, e) => { + let a, i, n; + for (;;) { + if (t.lookahead < ct) { + if ((Rt(t), t.lookahead < ct && e === W)) return 1; + if (0 === t.lookahead) break; + } + if ( + ((a = 0), + t.lookahead >= 3 && + ((t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart)), + (t.prev_length = t.match_length), + (t.prev_match = t.match_start), + (t.match_length = 2), + 0 !== a && + t.prev_length < t.max_lazy_match && + t.strstart - a <= t.w_size - ct && + ((t.match_length = Et(t, a)), + t.match_length <= 5 && + (t.strategy === st || + (3 === t.match_length && + t.strstart - t.match_start > 4096)) && + (t.match_length = 2)), + t.prev_length >= 3 && t.match_length <= t.prev_length) + ) { + (n = t.strstart + t.lookahead - 3), + (i = G( + t, + t.strstart - 1 - t.prev_match, + t.prev_length - 3 + )), + (t.lookahead -= t.prev_length - 1), + (t.prev_length -= 2); + do { + ++t.strstart <= n && + ((t.ins_h = kt( + t, + t.ins_h, + t.window[t.strstart + 3 - 1] + )), + (a = t.prev[t.strstart & t.w_mask] = + t.head[t.ins_h]), + (t.head[t.ins_h] = t.strstart)); + } while (0 != --t.prev_length); + if ( + ((t.match_available = 0), + (t.match_length = 2), + t.strstart++, + i && (yt(t, !1), 0 === t.strm.avail_out)) + ) + return 1; + } else if (t.match_available) { + if ( + ((i = G(t, 0, t.window[t.strstart - 1])), + i && yt(t, !1), + t.strstart++, + t.lookahead--, + 0 === t.strm.avail_out) + ) + return 1; + } else + (t.match_available = 1), t.strstart++, t.lookahead--; + } + return ( + t.match_available && + ((i = G(t, 0, t.window[t.strstart - 1])), + (t.match_available = 0)), + (t.insert = t.strstart < 2 ? t.strstart : 2), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + }; + function St(t, e, a, i, n) { + (this.good_length = t), + (this.max_lazy = e), + (this.nice_length = a), + (this.max_chain = i), + (this.func = n); + } + const Dt = [ + new St(0, 0, 0, 0, (t, e) => { + let a = 65535; + for ( + a > t.pending_buf_size - 5 && + (a = t.pending_buf_size - 5); + ; + + ) { + if (t.lookahead <= 1) { + if ((Rt(t), 0 === t.lookahead && e === W)) return 1; + if (0 === t.lookahead) break; + } + (t.strstart += t.lookahead), (t.lookahead = 0); + const i = t.block_start + a; + if ( + (0 === t.strstart || t.strstart >= i) && + ((t.lookahead = t.strstart - i), + (t.strstart = i), + yt(t, !1), + 0 === t.strm.avail_out) + ) + return 1; + if ( + t.strstart - t.block_start >= t.w_size - ct && + (yt(t, !1), 0 === t.strm.avail_out) + ) + return 1; + } + return ( + (t.insert = 0), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : (t.strstart > t.block_start && + (yt(t, !1), t.strm.avail_out), + 1) + ); + }), + new St(4, 4, 8, 4, Zt), + new St(4, 5, 16, 8, Zt), + new St(4, 6, 32, 32, Zt), + new St(4, 4, 16, 16, Ut), + new St(8, 16, 32, 32, Ut), + new St(8, 16, 128, 128, Ut), + new St(8, 32, 128, 256, Ut), + new St(32, 128, 258, 1024, Ut), + new St(32, 258, 258, 4096, Ut), + ]; + function Tt() { + (this.strm = null), + (this.status = 0), + (this.pending_buf = null), + (this.pending_buf_size = 0), + (this.pending_out = 0), + (this.pending = 0), + (this.wrap = 0), + (this.gzhead = null), + (this.gzindex = 0), + (this.method = _t), + (this.last_flush = -1), + (this.w_size = 0), + (this.w_bits = 0), + (this.w_mask = 0), + (this.window = null), + (this.window_size = 0), + (this.prev = null), + (this.head = null), + (this.ins_h = 0), + (this.hash_size = 0), + (this.hash_bits = 0), + (this.hash_mask = 0), + (this.hash_shift = 0), + (this.block_start = 0), + (this.match_length = 0), + (this.prev_match = 0), + (this.match_available = 0), + (this.strstart = 0), + (this.match_start = 0), + (this.lookahead = 0), + (this.prev_length = 0), + (this.max_chain_length = 0), + (this.max_lazy_match = 0), + (this.level = 0), + (this.strategy = 0), + (this.good_match = 0), + (this.nice_match = 0), + (this.dyn_ltree = new Uint16Array(1146)), + (this.dyn_dtree = new Uint16Array(122)), + (this.bl_tree = new Uint16Array(78)), + mt(this.dyn_ltree), + mt(this.dyn_dtree), + mt(this.bl_tree), + (this.l_desc = null), + (this.d_desc = null), + (this.bl_desc = null), + (this.bl_count = new Uint16Array(16)), + (this.heap = new Uint16Array(573)), + mt(this.heap), + (this.heap_len = 0), + (this.heap_max = 0), + (this.depth = new Uint16Array(573)), + mt(this.depth), + (this.l_buf = 0), + (this.lit_bufsize = 0), + (this.last_lit = 0), + (this.d_buf = 0), + (this.opt_len = 0), + (this.static_len = 0), + (this.matches = 0), + (this.insert = 0), + (this.bi_buf = 0), + (this.bi_valid = 0); + } + const Ot = (t) => { + if (!t || !t.state) return gt(t, et); + (t.total_in = t.total_out = 0), (t.data_type = dt); + const e = t.state; + return ( + (e.pending = 0), + (e.pending_out = 0), + e.wrap < 0 && (e.wrap = -e.wrap), + (e.status = e.wrap ? 42 : wt), + (t.adler = 2 === e.wrap ? 0 : 1), + (e.last_flush = W), + K(e), + $ + ); + }, + It = (t) => { + const e = Ot(t); + var a; + return ( + e === $ && + (((a = t.state).window_size = 2 * a.w_size), + mt(a.head), + (a.max_lazy_match = Dt[a.level].max_lazy), + (a.good_match = Dt[a.level].good_length), + (a.nice_match = Dt[a.level].nice_length), + (a.max_chain_length = Dt[a.level].max_chain), + (a.strstart = 0), + (a.block_start = 0), + (a.lookahead = 0), + (a.insert = 0), + (a.match_length = a.prev_length = 2), + (a.match_available = 0), + (a.ins_h = 0)), + e + ); + }, + Ft = (t, e, a, i, n, s) => { + if (!t) return et; + let r = 1; + if ( + (e === nt && (e = 6), + i < 0 + ? ((r = 0), (i = -i)) + : i > 15 && ((r = 2), (i -= 16)), + n < 1 || + n > 9 || + a !== _t || + i < 8 || + i > 15 || + e < 0 || + e > 9 || + s < 0 || + s > ot) + ) + return gt(t, et); + 8 === i && (i = 9); + const l = new Tt(); + return ( + (t.state = l), + (l.strm = t), + (l.wrap = r), + (l.gzhead = null), + (l.w_bits = i), + (l.w_size = 1 << l.w_bits), + (l.w_mask = l.w_size - 1), + (l.hash_bits = n + 7), + (l.hash_size = 1 << l.hash_bits), + (l.hash_mask = l.hash_size - 1), + (l.hash_shift = ~~((l.hash_bits + 3 - 1) / 3)), + (l.window = new Uint8Array(2 * l.w_size)), + (l.head = new Uint16Array(l.hash_size)), + (l.prev = new Uint16Array(l.w_size)), + (l.lit_bufsize = 1 << (n + 6)), + (l.pending_buf_size = 4 * l.lit_bufsize), + (l.pending_buf = new Uint8Array(l.pending_buf_size)), + (l.d_buf = 1 * l.lit_bufsize), + (l.l_buf = 3 * l.lit_bufsize), + (l.level = e), + (l.strategy = s), + (l.method = a), + It(t) + ); + }; + var Lt = { + deflateInit: (t, e) => Ft(t, e, _t, 15, 8, ht), + deflateInit2: Ft, + deflateReset: It, + deflateResetKeep: Ot, + deflateSetHeader: (t, e) => + t && t.state + ? 2 !== t.state.wrap + ? et + : ((t.state.gzhead = e), $) + : et, + deflate: (t, e) => { + let a, i; + if (!t || !t.state || e > V || e < 0) + return t ? gt(t, et) : et; + const n = t.state; + if ( + !t.output || + (!t.input && 0 !== t.avail_in) || + (n.status === bt && e !== Q) + ) + return gt(t, 0 === t.avail_out ? it : et); + n.strm = t; + const s = n.last_flush; + if (((n.last_flush = e), 42 === n.status)) + if (2 === n.wrap) + (t.adler = 0), + xt(n, 31), + xt(n, 139), + xt(n, 8), + n.gzhead + ? (xt( + n, + (n.gzhead.text ? 1 : 0) + + (n.gzhead.hcrc ? 2 : 0) + + (n.gzhead.extra ? 4 : 0) + + (n.gzhead.name ? 8 : 0) + + (n.gzhead.comment ? 16 : 0) + ), + xt(n, 255 & n.gzhead.time), + xt(n, (n.gzhead.time >> 8) & 255), + xt(n, (n.gzhead.time >> 16) & 255), + xt(n, (n.gzhead.time >> 24) & 255), + xt( + n, + 9 === n.level + ? 2 + : n.strategy >= rt || n.level < 2 + ? 4 + : 0 + ), + xt(n, 255 & n.gzhead.os), + n.gzhead.extra && + n.gzhead.extra.length && + (xt(n, 255 & n.gzhead.extra.length), + xt(n, (n.gzhead.extra.length >> 8) & 255)), + n.gzhead.hcrc && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending, + 0 + )), + (n.gzindex = 0), + (n.status = 69)) + : (xt(n, 0), + xt(n, 0), + xt(n, 0), + xt(n, 0), + xt(n, 0), + xt( + n, + 9 === n.level + ? 2 + : n.strategy >= rt || n.level < 2 + ? 4 + : 0 + ), + xt(n, 3), + (n.status = wt)); + else { + let e = (_t + ((n.w_bits - 8) << 4)) << 8, + a = -1; + (a = + n.strategy >= rt || n.level < 2 + ? 0 + : n.level < 6 + ? 1 + : 6 === n.level + ? 2 + : 3), + (e |= a << 6), + 0 !== n.strstart && (e |= 32), + (e += 31 - (e % 31)), + (n.status = wt), + zt(n, e), + 0 !== n.strstart && + (zt(n, t.adler >>> 16), zt(n, 65535 & t.adler)), + (t.adler = 1); + } + if (69 === n.status) + if (n.gzhead.extra) { + for ( + a = n.pending; + n.gzindex < (65535 & n.gzhead.extra.length) && + (n.pending !== n.pending_buf_size || + (n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + vt(t), + (a = n.pending), + n.pending !== n.pending_buf_size)); + + ) + xt(n, 255 & n.gzhead.extra[n.gzindex]), n.gzindex++; + n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + n.gzindex === n.gzhead.extra.length && + ((n.gzindex = 0), (n.status = 73)); + } else n.status = 73; + if (73 === n.status) + if (n.gzhead.name) { + a = n.pending; + do { + if ( + n.pending === n.pending_buf_size && + (n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + vt(t), + (a = n.pending), + n.pending === n.pending_buf_size) + ) { + i = 1; + break; + } + (i = + n.gzindex < n.gzhead.name.length + ? 255 & n.gzhead.name.charCodeAt(n.gzindex++) + : 0), + xt(n, i); + } while (0 !== i); + n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + 0 === i && ((n.gzindex = 0), (n.status = 91)); + } else n.status = 91; + if (91 === n.status) + if (n.gzhead.comment) { + a = n.pending; + do { + if ( + n.pending === n.pending_buf_size && + (n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + vt(t), + (a = n.pending), + n.pending === n.pending_buf_size) + ) { + i = 1; + break; + } + (i = + n.gzindex < n.gzhead.comment.length + ? 255 & n.gzhead.comment.charCodeAt(n.gzindex++) + : 0), + xt(n, i); + } while (0 !== i); + n.gzhead.hcrc && + n.pending > a && + (t.adler = M( + t.adler, + n.pending_buf, + n.pending - a, + a + )), + 0 === i && (n.status = ut); + } else n.status = ut; + if ( + (n.status === ut && + (n.gzhead.hcrc + ? (n.pending + 2 > n.pending_buf_size && vt(t), + n.pending + 2 <= n.pending_buf_size && + (xt(n, 255 & t.adler), + xt(n, (t.adler >> 8) & 255), + (t.adler = 0), + (n.status = wt))) + : (n.status = wt)), + 0 !== n.pending) + ) { + if ((vt(t), 0 === t.avail_out)) + return (n.last_flush = -1), $; + } else if (0 === t.avail_in && pt(e) <= pt(s) && e !== Q) + return gt(t, it); + if (n.status === bt && 0 !== t.avail_in) return gt(t, it); + if ( + 0 !== t.avail_in || + 0 !== n.lookahead || + (e !== W && n.status !== bt) + ) { + let a = + n.strategy === rt + ? ((t, e) => { + let a; + for (;;) { + if ( + 0 === t.lookahead && + (Rt(t), 0 === t.lookahead) + ) { + if (e === W) return 1; + break; + } + if ( + ((t.match_length = 0), + (a = G(t, 0, t.window[t.strstart])), + t.lookahead--, + t.strstart++, + a && (yt(t, !1), 0 === t.strm.avail_out)) + ) + return 1; + } + return ( + (t.insert = 0), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && + (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + })(n, e) + : n.strategy === lt + ? ((t, e) => { + let a, i, n, s; + const r = t.window; + for (;;) { + if (t.lookahead <= ft) { + if ((Rt(t), t.lookahead <= ft && e === W)) + return 1; + if (0 === t.lookahead) break; + } + if ( + ((t.match_length = 0), + t.lookahead >= 3 && + t.strstart > 0 && + ((n = t.strstart - 1), + (i = r[n]), + i === r[++n] && + i === r[++n] && + i === r[++n])) + ) { + s = t.strstart + ft; + do {} while ( + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + i === r[++n] && + n < s + ); + (t.match_length = ft - (s - n)), + t.match_length > t.lookahead && + (t.match_length = t.lookahead); + } + if ( + (t.match_length >= 3 + ? ((a = G(t, 1, t.match_length - 3)), + (t.lookahead -= t.match_length), + (t.strstart += t.match_length), + (t.match_length = 0)) + : ((a = G(t, 0, t.window[t.strstart])), + t.lookahead--, + t.strstart++), + a && (yt(t, !1), 0 === t.strm.avail_out)) + ) + return 1; + } + return ( + (t.insert = 0), + e === Q + ? (yt(t, !0), 0 === t.strm.avail_out ? 3 : 4) + : t.last_lit && + (yt(t, !1), 0 === t.strm.avail_out) + ? 1 + : 2 + ); + })(n, e) + : Dt[n.level].func(n, e); + if ( + ((3 !== a && 4 !== a) || (n.status = bt), + 1 === a || 3 === a) + ) + return 0 === t.avail_out && (n.last_flush = -1), $; + if ( + 2 === a && + (e === q + ? X(n) + : e !== V && + (P(n, 0, 0, !1), + e === J && + (mt(n.head), + 0 === n.lookahead && + ((n.strstart = 0), + (n.block_start = 0), + (n.insert = 0)))), + vt(t), + 0 === t.avail_out) + ) + return (n.last_flush = -1), $; + } + return e !== Q + ? $ + : n.wrap <= 0 + ? tt + : (2 === n.wrap + ? (xt(n, 255 & t.adler), + xt(n, (t.adler >> 8) & 255), + xt(n, (t.adler >> 16) & 255), + xt(n, (t.adler >> 24) & 255), + xt(n, 255 & t.total_in), + xt(n, (t.total_in >> 8) & 255), + xt(n, (t.total_in >> 16) & 255), + xt(n, (t.total_in >> 24) & 255)) + : (zt(n, t.adler >>> 16), zt(n, 65535 & t.adler)), + vt(t), + n.wrap > 0 && (n.wrap = -n.wrap), + 0 !== n.pending ? $ : tt); + }, + deflateEnd: (t) => { + if (!t || !t.state) return et; + const e = t.state.status; + return 42 !== e && + 69 !== e && + 73 !== e && + 91 !== e && + e !== ut && + e !== wt && + e !== bt + ? gt(t, et) + : ((t.state = null), e === wt ? gt(t, at) : $); + }, + deflateSetDictionary: (t, e) => { + let a = e.length; + if (!t || !t.state) return et; + const i = t.state, + n = i.wrap; + if (2 === n || (1 === n && 42 !== i.status) || i.lookahead) + return et; + if ( + (1 === n && (t.adler = B(t.adler, e, a, 0)), + (i.wrap = 0), + a >= i.w_size) + ) { + 0 === n && + (mt(i.head), + (i.strstart = 0), + (i.block_start = 0), + (i.insert = 0)); + let t = new Uint8Array(i.w_size); + t.set(e.subarray(a - i.w_size, a), 0), + (e = t), + (a = i.w_size); + } + const s = t.avail_in, + r = t.next_in, + l = t.input; + for ( + t.avail_in = a, t.next_in = 0, t.input = e, Rt(i); + i.lookahead >= 3; + + ) { + let t = i.strstart, + e = i.lookahead - 2; + do { + (i.ins_h = kt(i, i.ins_h, i.window[t + 3 - 1])), + (i.prev[t & i.w_mask] = i.head[i.ins_h]), + (i.head[i.ins_h] = t), + t++; + } while (--e); + (i.strstart = t), (i.lookahead = 2), Rt(i); + } + return ( + (i.strstart += i.lookahead), + (i.block_start = i.strstart), + (i.insert = i.lookahead), + (i.lookahead = 0), + (i.match_length = i.prev_length = 2), + (i.match_available = 0), + (t.next_in = r), + (t.input = l), + (t.avail_in = s), + (i.wrap = n), + $ + ); + }, + deflateInfo: 'pako deflate (from Nodeca project)', + }; + const Nt = (t, e) => Object.prototype.hasOwnProperty.call(t, e); + var Bt = function (t) { + const e = Array.prototype.slice.call(arguments, 1); + for (; e.length; ) { + const a = e.shift(); + if (a) { + if ('object' != typeof a) + throw new TypeError(a + 'must be non-object'); + for (const e in a) Nt(a, e) && (t[e] = a[e]); + } + } + return t; + }, + Ct = (t) => { + let e = 0; + for (let a = 0, i = t.length; a < i; a++) e += t[a].length; + const a = new Uint8Array(e); + for (let e = 0, i = 0, n = t.length; e < n; e++) { + let n = t[e]; + a.set(n, i), (i += n.length); + } + return a; + }; + let Mt = !0; + try { + String.fromCharCode.apply(null, new Uint8Array(1)); + } catch (t) { + Mt = !1; + } + const Ht = new Uint8Array(256); + for (let t = 0; t < 256; t++) + Ht[t] = + t >= 252 + ? 6 + : t >= 248 + ? 5 + : t >= 240 + ? 4 + : t >= 224 + ? 3 + : t >= 192 + ? 2 + : 1; + Ht[254] = Ht[254] = 1; + var jt = (t) => { + if ( + 'function' == typeof TextEncoder && + TextEncoder.prototype.encode + ) + return new TextEncoder().encode(t); + let e, + a, + i, + n, + s, + r = t.length, + l = 0; + for (n = 0; n < r; n++) + (a = t.charCodeAt(n)), + 55296 == (64512 & a) && + n + 1 < r && + ((i = t.charCodeAt(n + 1)), + 56320 == (64512 & i) && + ((a = 65536 + ((a - 55296) << 10) + (i - 56320)), + n++)), + (l += a < 128 ? 1 : a < 2048 ? 2 : a < 65536 ? 3 : 4); + for (e = new Uint8Array(l), s = 0, n = 0; s < l; n++) + (a = t.charCodeAt(n)), + 55296 == (64512 & a) && + n + 1 < r && + ((i = t.charCodeAt(n + 1)), + 56320 == (64512 & i) && + ((a = 65536 + ((a - 55296) << 10) + (i - 56320)), + n++)), + a < 128 + ? (e[s++] = a) + : a < 2048 + ? ((e[s++] = 192 | (a >>> 6)), + (e[s++] = 128 | (63 & a))) + : a < 65536 + ? ((e[s++] = 224 | (a >>> 12)), + (e[s++] = 128 | ((a >>> 6) & 63)), + (e[s++] = 128 | (63 & a))) + : ((e[s++] = 240 | (a >>> 18)), + (e[s++] = 128 | ((a >>> 12) & 63)), + (e[s++] = 128 | ((a >>> 6) & 63)), + (e[s++] = 128 | (63 & a))); + return e; + }, + Kt = (t, e) => { + const a = e || t.length; + if ( + 'function' == typeof TextDecoder && + TextDecoder.prototype.decode + ) + return new TextDecoder().decode(t.subarray(0, e)); + let i, n; + const s = new Array(2 * a); + for (n = 0, i = 0; i < a; ) { + let e = t[i++]; + if (e < 128) { + s[n++] = e; + continue; + } + let r = Ht[e]; + if (r > 4) (s[n++] = 65533), (i += r - 1); + else { + for ( + e &= 2 === r ? 31 : 3 === r ? 15 : 7; + r > 1 && i < a; + + ) + (e = (e << 6) | (63 & t[i++])), r--; + r > 1 + ? (s[n++] = 65533) + : e < 65536 + ? (s[n++] = e) + : ((e -= 65536), + (s[n++] = 55296 | ((e >> 10) & 1023)), + (s[n++] = 56320 | (1023 & e))); + } + } + return ((t, e) => { + if (e < 65534 && t.subarray && Mt) + return String.fromCharCode.apply( + null, + t.length === e ? t : t.subarray(0, e) + ); + let a = ''; + for (let i = 0; i < e; i++) + a += String.fromCharCode(t[i]); + return a; + })(s, n); + }, + Pt = (t, e) => { + (e = e || t.length) > t.length && (e = t.length); + let a = e - 1; + for (; a >= 0 && 128 == (192 & t[a]); ) a--; + return a < 0 || 0 === a ? e : a + Ht[t[a]] > e ? a : e; + }; + var Yt = function () { + (this.input = null), + (this.next_in = 0), + (this.avail_in = 0), + (this.total_in = 0), + (this.output = null), + (this.next_out = 0), + (this.avail_out = 0), + (this.total_out = 0), + (this.msg = ''), + (this.state = null), + (this.data_type = 2), + (this.adler = 0); + }; + const Gt = Object.prototype.toString, + { + Z_NO_FLUSH: Xt, + Z_SYNC_FLUSH: Wt, + Z_FULL_FLUSH: qt, + Z_FINISH: Jt, + Z_OK: Qt, + Z_STREAM_END: Vt, + Z_DEFAULT_COMPRESSION: $t, + Z_DEFAULT_STRATEGY: te, + Z_DEFLATED: ee, + } = j; + function ae(t) { + this.options = Bt( + { + level: $t, + method: ee, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: te, + }, + t || {} + ); + let e = this.options; + e.raw && e.windowBits > 0 + ? (e.windowBits = -e.windowBits) + : e.gzip && + e.windowBits > 0 && + e.windowBits < 16 && + (e.windowBits += 16), + (this.err = 0), + (this.msg = ''), + (this.ended = !1), + (this.chunks = []), + (this.strm = new Yt()), + (this.strm.avail_out = 0); + let a = Lt.deflateInit2( + this.strm, + e.level, + e.method, + e.windowBits, + e.memLevel, + e.strategy + ); + if (a !== Qt) throw new Error(H[a]); + if ( + (e.header && Lt.deflateSetHeader(this.strm, e.header), + e.dictionary) + ) { + let t; + if ( + ((t = + 'string' == typeof e.dictionary + ? jt(e.dictionary) + : '[object ArrayBuffer]' === Gt.call(e.dictionary) + ? new Uint8Array(e.dictionary) + : e.dictionary), + (a = Lt.deflateSetDictionary(this.strm, t)), + a !== Qt) + ) + throw new Error(H[a]); + this._dict_set = !0; + } + } + function ie(t, e) { + const a = new ae(e); + if ((a.push(t, !0), a.err)) throw a.msg || H[a.err]; + return a.result; + } + (ae.prototype.push = function (t, e) { + const a = this.strm, + i = this.options.chunkSize; + let n, s; + if (this.ended) return !1; + for ( + s = e === ~~e ? e : !0 === e ? Jt : Xt, + 'string' == typeof t + ? (a.input = jt(t)) + : '[object ArrayBuffer]' === Gt.call(t) + ? (a.input = new Uint8Array(t)) + : (a.input = t), + a.next_in = 0, + a.avail_in = a.input.length; + ; + + ) + if ( + (0 === a.avail_out && + ((a.output = new Uint8Array(i)), + (a.next_out = 0), + (a.avail_out = i)), + (s === Wt || s === qt) && a.avail_out <= 6) + ) + this.onData(a.output.subarray(0, a.next_out)), + (a.avail_out = 0); + else { + if (((n = Lt.deflate(a, s)), n === Vt)) + return ( + a.next_out > 0 && + this.onData(a.output.subarray(0, a.next_out)), + (n = Lt.deflateEnd(this.strm)), + this.onEnd(n), + (this.ended = !0), + n === Qt + ); + if (0 !== a.avail_out) { + if (s > 0 && a.next_out > 0) + this.onData(a.output.subarray(0, a.next_out)), + (a.avail_out = 0); + else if (0 === a.avail_in) break; + } else this.onData(a.output); + } + return !0; + }), + (ae.prototype.onData = function (t) { + this.chunks.push(t); + }), + (ae.prototype.onEnd = function (t) { + t === Qt && (this.result = Ct(this.chunks)), + (this.chunks = []), + (this.err = t), + (this.msg = this.strm.msg); + }); + var ne = { + Deflate: ae, + deflate: ie, + deflateRaw: function (t, e) { + return ((e = e || {}).raw = !0), ie(t, e); + }, + gzip: function (t, e) { + return ((e = e || {}).gzip = !0), ie(t, e); + }, + constants: j, + }; + var se = function (t, e) { + let a, + i, + n, + s, + r, + l, + o, + h, + d, + _, + f, + c, + u, + w, + b, + g, + p, + m, + k, + v, + y, + x, + z, + A; + const E = t.state; + (a = t.next_in), + (z = t.input), + (i = a + (t.avail_in - 5)), + (n = t.next_out), + (A = t.output), + (s = n - (e - t.avail_out)), + (r = n + (t.avail_out - 257)), + (l = E.dmax), + (o = E.wsize), + (h = E.whave), + (d = E.wnext), + (_ = E.window), + (f = E.hold), + (c = E.bits), + (u = E.lencode), + (w = E.distcode), + (b = (1 << E.lenbits) - 1), + (g = (1 << E.distbits) - 1); + t: do { + c < 15 && + ((f += z[a++] << c), + (c += 8), + (f += z[a++] << c), + (c += 8)), + (p = u[f & b]); + e: for (;;) { + if ( + ((m = p >>> 24), + (f >>>= m), + (c -= m), + (m = (p >>> 16) & 255), + 0 === m) + ) + A[n++] = 65535 & p; + else { + if (!(16 & m)) { + if (0 == (64 & m)) { + p = u[(65535 & p) + (f & ((1 << m) - 1))]; + continue e; + } + if (32 & m) { + E.mode = 12; + break t; + } + (t.msg = 'invalid literal/length code'), + (E.mode = 30); + break t; + } + (k = 65535 & p), + (m &= 15), + m && + (c < m && ((f += z[a++] << c), (c += 8)), + (k += f & ((1 << m) - 1)), + (f >>>= m), + (c -= m)), + c < 15 && + ((f += z[a++] << c), + (c += 8), + (f += z[a++] << c), + (c += 8)), + (p = w[f & g]); + a: for (;;) { + if ( + ((m = p >>> 24), + (f >>>= m), + (c -= m), + (m = (p >>> 16) & 255), + !(16 & m)) + ) { + if (0 == (64 & m)) { + p = w[(65535 & p) + (f & ((1 << m) - 1))]; + continue a; + } + (t.msg = 'invalid distance code'), (E.mode = 30); + break t; + } + if ( + ((v = 65535 & p), + (m &= 15), + c < m && + ((f += z[a++] << c), + (c += 8), + c < m && ((f += z[a++] << c), (c += 8))), + (v += f & ((1 << m) - 1)), + v > l) + ) { + (t.msg = 'invalid distance too far back'), + (E.mode = 30); + break t; + } + if (((f >>>= m), (c -= m), (m = n - s), v > m)) { + if (((m = v - m), m > h && E.sane)) { + (t.msg = 'invalid distance too far back'), + (E.mode = 30); + break t; + } + if (((y = 0), (x = _), 0 === d)) { + if (((y += o - m), m < k)) { + k -= m; + do { + A[n++] = _[y++]; + } while (--m); + (y = n - v), (x = A); + } + } else if (d < m) { + if (((y += o + d - m), (m -= d), m < k)) { + k -= m; + do { + A[n++] = _[y++]; + } while (--m); + if (((y = 0), d < k)) { + (m = d), (k -= m); + do { + A[n++] = _[y++]; + } while (--m); + (y = n - v), (x = A); + } + } + } else if (((y += d - m), m < k)) { + k -= m; + do { + A[n++] = _[y++]; + } while (--m); + (y = n - v), (x = A); + } + for (; k > 2; ) + (A[n++] = x[y++]), + (A[n++] = x[y++]), + (A[n++] = x[y++]), + (k -= 3); + k && + ((A[n++] = x[y++]), k > 1 && (A[n++] = x[y++])); + } else { + y = n - v; + do { + (A[n++] = A[y++]), + (A[n++] = A[y++]), + (A[n++] = A[y++]), + (k -= 3); + } while (k > 2); + k && + ((A[n++] = A[y++]), k > 1 && (A[n++] = A[y++])); + } + break; + } + } + break; + } + } while (a < i && n < r); + (k = c >> 3), + (a -= k), + (c -= k << 3), + (f &= (1 << c) - 1), + (t.next_in = a), + (t.next_out = n), + (t.avail_in = a < i ? i - a + 5 : 5 - (a - i)), + (t.avail_out = n < r ? r - n + 257 : 257 - (n - r)), + (E.hold = f), + (E.bits = c); + }; + const re = 15, + le = new Uint16Array([ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, + 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0, + ]), + oe = new Uint8Array([ + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, + 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, + 78, + ]), + he = new Uint16Array([ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577, 0, 0, + ]), + de = new Uint8Array([ + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, + 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, + 64, 64, + ]); + var _e = (t, e, a, i, n, s, r, l) => { + const o = l.bits; + let h, + d, + _, + f, + c, + u, + w = 0, + b = 0, + g = 0, + p = 0, + m = 0, + k = 0, + v = 0, + y = 0, + x = 0, + z = 0, + A = null, + E = 0; + const R = new Uint16Array(16), + Z = new Uint16Array(16); + let U, + S, + D, + T = null, + O = 0; + for (w = 0; w <= re; w++) R[w] = 0; + for (b = 0; b < i; b++) R[e[a + b]]++; + for (m = o, p = re; p >= 1 && 0 === R[p]; p--); + if ((m > p && (m = p), 0 === p)) + return ( + (n[s++] = 20971520), (n[s++] = 20971520), (l.bits = 1), 0 + ); + for (g = 1; g < p && 0 === R[g]; g++); + for (m < g && (m = g), y = 1, w = 1; w <= re; w++) + if (((y <<= 1), (y -= R[w]), y < 0)) return -1; + if (y > 0 && (0 === t || 1 !== p)) return -1; + for (Z[1] = 0, w = 1; w < re; w++) Z[w + 1] = Z[w] + R[w]; + for (b = 0; b < i; b++) + 0 !== e[a + b] && (r[Z[e[a + b]]++] = b); + if ( + (0 === t + ? ((A = T = r), (u = 19)) + : 1 === t + ? ((A = le), (E -= 257), (T = oe), (O -= 257), (u = 256)) + : ((A = he), (T = de), (u = -1)), + (z = 0), + (b = 0), + (w = g), + (c = s), + (k = m), + (v = 0), + (_ = -1), + (x = 1 << m), + (f = x - 1), + (1 === t && x > 852) || (2 === t && x > 592)) + ) + return 1; + for (;;) { + (U = w - v), + r[b] < u + ? ((S = 0), (D = r[b])) + : r[b] > u + ? ((S = T[O + r[b]]), (D = A[E + r[b]])) + : ((S = 96), (D = 0)), + (h = 1 << (w - v)), + (d = 1 << k), + (g = d); + do { + (d -= h), + (n[c + (z >> v) + d] = (U << 24) | (S << 16) | D | 0); + } while (0 !== d); + for (h = 1 << (w - 1); z & h; ) h >>= 1; + if ( + (0 !== h ? ((z &= h - 1), (z += h)) : (z = 0), + b++, + 0 == --R[w]) + ) { + if (w === p) break; + w = e[a + r[b]]; + } + if (w > m && (z & f) !== _) { + for ( + 0 === v && (v = m), c += g, k = w - v, y = 1 << k; + k + v < p && ((y -= R[k + v]), !(y <= 0)); + + ) + k++, (y <<= 1); + if ( + ((x += 1 << k), + (1 === t && x > 852) || (2 === t && x > 592)) + ) + return 1; + (_ = z & f), (n[_] = (m << 24) | (k << 16) | (c - s) | 0); + } + } + return ( + 0 !== z && (n[c + z] = ((w - v) << 24) | (64 << 16) | 0), + (l.bits = m), + 0 + ); + }; + const { + Z_FINISH: fe, + Z_BLOCK: ce, + Z_TREES: ue, + Z_OK: we, + Z_STREAM_END: be, + Z_NEED_DICT: ge, + Z_STREAM_ERROR: pe, + Z_DATA_ERROR: me, + Z_MEM_ERROR: ke, + Z_BUF_ERROR: ve, + Z_DEFLATED: ye, + } = j, + xe = 12, + ze = 30, + Ae = (t) => + ((t >>> 24) & 255) + + ((t >>> 8) & 65280) + + ((65280 & t) << 8) + + ((255 & t) << 24); + function Ee() { + (this.mode = 0), + (this.last = !1), + (this.wrap = 0), + (this.havedict = !1), + (this.flags = 0), + (this.dmax = 0), + (this.check = 0), + (this.total = 0), + (this.head = null), + (this.wbits = 0), + (this.wsize = 0), + (this.whave = 0), + (this.wnext = 0), + (this.window = null), + (this.hold = 0), + (this.bits = 0), + (this.length = 0), + (this.offset = 0), + (this.extra = 0), + (this.lencode = null), + (this.distcode = null), + (this.lenbits = 0), + (this.distbits = 0), + (this.ncode = 0), + (this.nlen = 0), + (this.ndist = 0), + (this.have = 0), + (this.next = null), + (this.lens = new Uint16Array(320)), + (this.work = new Uint16Array(288)), + (this.lendyn = null), + (this.distdyn = null), + (this.sane = 0), + (this.back = 0), + (this.was = 0); + } + const Re = (t) => { + if (!t || !t.state) return pe; + const e = t.state; + return ( + (t.total_in = t.total_out = e.total = 0), + (t.msg = ''), + e.wrap && (t.adler = 1 & e.wrap), + (e.mode = 1), + (e.last = 0), + (e.havedict = 0), + (e.dmax = 32768), + (e.head = null), + (e.hold = 0), + (e.bits = 0), + (e.lencode = e.lendyn = new Int32Array(852)), + (e.distcode = e.distdyn = new Int32Array(592)), + (e.sane = 1), + (e.back = -1), + we + ); + }, + Ze = (t) => { + if (!t || !t.state) return pe; + const e = t.state; + return (e.wsize = 0), (e.whave = 0), (e.wnext = 0), Re(t); + }, + Ue = (t, e) => { + let a; + if (!t || !t.state) return pe; + const i = t.state; + return ( + e < 0 + ? ((a = 0), (e = -e)) + : ((a = 1 + (e >> 4)), e < 48 && (e &= 15)), + e && (e < 8 || e > 15) + ? pe + : (null !== i.window && + i.wbits !== e && + (i.window = null), + (i.wrap = a), + (i.wbits = e), + Ze(t)) + ); + }, + Se = (t, e) => { + if (!t) return pe; + const a = new Ee(); + (t.state = a), (a.window = null); + const i = Ue(t, e); + return i !== we && (t.state = null), i; + }; + let De, + Te, + Oe = !0; + const Ie = (t) => { + if (Oe) { + (De = new Int32Array(512)), (Te = new Int32Array(32)); + let e = 0; + for (; e < 144; ) t.lens[e++] = 8; + for (; e < 256; ) t.lens[e++] = 9; + for (; e < 280; ) t.lens[e++] = 7; + for (; e < 288; ) t.lens[e++] = 8; + for ( + _e(1, t.lens, 0, 288, De, 0, t.work, { bits: 9 }), + e = 0; + e < 32; + + ) + t.lens[e++] = 5; + _e(2, t.lens, 0, 32, Te, 0, t.work, { bits: 5 }), + (Oe = !1); + } + (t.lencode = De), + (t.lenbits = 9), + (t.distcode = Te), + (t.distbits = 5); + }, + Fe = (t, e, a, i) => { + let n; + const s = t.state; + return ( + null === s.window && + ((s.wsize = 1 << s.wbits), + (s.wnext = 0), + (s.whave = 0), + (s.window = new Uint8Array(s.wsize))), + i >= s.wsize + ? (s.window.set(e.subarray(a - s.wsize, a), 0), + (s.wnext = 0), + (s.whave = s.wsize)) + : ((n = s.wsize - s.wnext), + n > i && (n = i), + s.window.set(e.subarray(a - i, a - i + n), s.wnext), + (i -= n) + ? (s.window.set(e.subarray(a - i, a), 0), + (s.wnext = i), + (s.whave = s.wsize)) + : ((s.wnext += n), + s.wnext === s.wsize && (s.wnext = 0), + s.whave < s.wsize && (s.whave += n))), + 0 + ); + }; + var Le = { + inflateReset: Ze, + inflateReset2: Ue, + inflateResetKeep: Re, + inflateInit: (t) => Se(t, 15), + inflateInit2: Se, + inflate: (t, e) => { + let a, + i, + n, + s, + r, + l, + o, + h, + d, + _, + f, + c, + u, + w, + b, + g, + p, + m, + k, + v, + y, + x, + z = 0; + const A = new Uint8Array(4); + let E, R; + const Z = new Uint8Array([ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, + 1, 15, + ]); + if ( + !t || + !t.state || + !t.output || + (!t.input && 0 !== t.avail_in) + ) + return pe; + (a = t.state), + a.mode === xe && (a.mode = 13), + (r = t.next_out), + (n = t.output), + (o = t.avail_out), + (s = t.next_in), + (i = t.input), + (l = t.avail_in), + (h = a.hold), + (d = a.bits), + (_ = l), + (f = o), + (x = we); + t: for (;;) + switch (a.mode) { + case 1: + if (0 === a.wrap) { + a.mode = 13; + break; + } + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (2 & a.wrap && 35615 === h) { + (a.check = 0), + (A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0)), + (h = 0), + (d = 0), + (a.mode = 2); + break; + } + if ( + ((a.flags = 0), + a.head && (a.head.done = !1), + !(1 & a.wrap) || (((255 & h) << 8) + (h >> 8)) % 31) + ) { + (t.msg = 'incorrect header check'), (a.mode = ze); + break; + } + if ((15 & h) !== ye) { + (t.msg = 'unknown compression method'), + (a.mode = ze); + break; + } + if ( + ((h >>>= 4), + (d -= 4), + (y = 8 + (15 & h)), + 0 === a.wbits) + ) + a.wbits = y; + else if (y > a.wbits) { + (t.msg = 'invalid window size'), (a.mode = ze); + break; + } + (a.dmax = 1 << a.wbits), + (t.adler = a.check = 1), + (a.mode = 512 & h ? 10 : xe), + (h = 0), + (d = 0); + break; + case 2: + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (((a.flags = h), (255 & a.flags) !== ye)) { + (t.msg = 'unknown compression method'), + (a.mode = ze); + break; + } + if (57344 & a.flags) { + (t.msg = 'unknown header flags set'), (a.mode = ze); + break; + } + a.head && (a.head.text = (h >> 8) & 1), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0))), + (h = 0), + (d = 0), + (a.mode = 3); + case 3: + for (; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + a.head && (a.head.time = h), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (A[2] = (h >>> 16) & 255), + (A[3] = (h >>> 24) & 255), + (a.check = M(a.check, A, 4, 0))), + (h = 0), + (d = 0), + (a.mode = 4); + case 4: + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + a.head && + ((a.head.xflags = 255 & h), (a.head.os = h >> 8)), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0))), + (h = 0), + (d = 0), + (a.mode = 5); + case 5: + if (1024 & a.flags) { + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.length = h), + a.head && (a.head.extra_len = h), + 512 & a.flags && + ((A[0] = 255 & h), + (A[1] = (h >>> 8) & 255), + (a.check = M(a.check, A, 2, 0))), + (h = 0), + (d = 0); + } else a.head && (a.head.extra = null); + a.mode = 6; + case 6: + if ( + 1024 & a.flags && + ((c = a.length), + c > l && (c = l), + c && + (a.head && + ((y = a.head.extra_len - a.length), + a.head.extra || + (a.head.extra = new Uint8Array( + a.head.extra_len + )), + a.head.extra.set(i.subarray(s, s + c), y)), + 512 & a.flags && (a.check = M(a.check, i, c, s)), + (l -= c), + (s += c), + (a.length -= c)), + a.length) + ) + break t; + (a.length = 0), (a.mode = 7); + case 7: + if (2048 & a.flags) { + if (0 === l) break t; + c = 0; + do { + (y = i[s + c++]), + a.head && + y && + a.length < 65536 && + (a.head.name += String.fromCharCode(y)); + } while (y && c < l); + if ( + (512 & a.flags && (a.check = M(a.check, i, c, s)), + (l -= c), + (s += c), + y) + ) + break t; + } else a.head && (a.head.name = null); + (a.length = 0), (a.mode = 8); + case 8: + if (4096 & a.flags) { + if (0 === l) break t; + c = 0; + do { + (y = i[s + c++]), + a.head && + y && + a.length < 65536 && + (a.head.comment += String.fromCharCode(y)); + } while (y && c < l); + if ( + (512 & a.flags && (a.check = M(a.check, i, c, s)), + (l -= c), + (s += c), + y) + ) + break t; + } else a.head && (a.head.comment = null); + a.mode = 9; + case 9: + if (512 & a.flags) { + for (; d < 16; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (h !== (65535 & a.check)) { + (t.msg = 'header crc mismatch'), (a.mode = ze); + break; + } + (h = 0), (d = 0); + } + a.head && + ((a.head.hcrc = (a.flags >> 9) & 1), + (a.head.done = !0)), + (t.adler = a.check = 0), + (a.mode = xe); + break; + case 10: + for (; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (t.adler = a.check = Ae(h)), + (h = 0), + (d = 0), + (a.mode = 11); + case 11: + if (0 === a.havedict) + return ( + (t.next_out = r), + (t.avail_out = o), + (t.next_in = s), + (t.avail_in = l), + (a.hold = h), + (a.bits = d), + ge + ); + (t.adler = a.check = 1), (a.mode = xe); + case xe: + if (e === ce || e === ue) break t; + case 13: + if (a.last) { + (h >>>= 7 & d), (d -= 7 & d), (a.mode = 27); + break; + } + for (; d < 3; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + switch ( + ((a.last = 1 & h), (h >>>= 1), (d -= 1), 3 & h) + ) { + case 0: + a.mode = 14; + break; + case 1: + if ((Ie(a), (a.mode = 20), e === ue)) { + (h >>>= 2), (d -= 2); + break t; + } + break; + case 2: + a.mode = 17; + break; + case 3: + (t.msg = 'invalid block type'), (a.mode = ze); + } + (h >>>= 2), (d -= 2); + break; + case 14: + for (h >>>= 7 & d, d -= 7 & d; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if ((65535 & h) != ((h >>> 16) ^ 65535)) { + (t.msg = 'invalid stored block lengths'), + (a.mode = ze); + break; + } + if ( + ((a.length = 65535 & h), + (h = 0), + (d = 0), + (a.mode = 15), + e === ue) + ) + break t; + case 15: + a.mode = 16; + case 16: + if (((c = a.length), c)) { + if ((c > l && (c = l), c > o && (c = o), 0 === c)) + break t; + n.set(i.subarray(s, s + c), r), + (l -= c), + (s += c), + (o -= c), + (r += c), + (a.length -= c); + break; + } + a.mode = xe; + break; + case 17: + for (; d < 14; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if ( + ((a.nlen = 257 + (31 & h)), + (h >>>= 5), + (d -= 5), + (a.ndist = 1 + (31 & h)), + (h >>>= 5), + (d -= 5), + (a.ncode = 4 + (15 & h)), + (h >>>= 4), + (d -= 4), + a.nlen > 286 || a.ndist > 30) + ) { + (t.msg = 'too many length or distance symbols'), + (a.mode = ze); + break; + } + (a.have = 0), (a.mode = 18); + case 18: + for (; a.have < a.ncode; ) { + for (; d < 3; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.lens[Z[a.have++]] = 7 & h), (h >>>= 3), (d -= 3); + } + for (; a.have < 19; ) a.lens[Z[a.have++]] = 0; + if ( + ((a.lencode = a.lendyn), + (a.lenbits = 7), + (E = { bits: a.lenbits }), + (x = _e(0, a.lens, 0, 19, a.lencode, 0, a.work, E)), + (a.lenbits = E.bits), + x) + ) { + (t.msg = 'invalid code lengths set'), (a.mode = ze); + break; + } + (a.have = 0), (a.mode = 19); + case 19: + for (; a.have < a.nlen + a.ndist; ) { + for ( + ; + (z = a.lencode[h & ((1 << a.lenbits) - 1)]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (p < 16) + (h >>>= b), (d -= b), (a.lens[a.have++] = p); + else { + if (16 === p) { + for (R = b + 2; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (((h >>>= b), (d -= b), 0 === a.have)) { + (t.msg = 'invalid bit length repeat'), + (a.mode = ze); + break; + } + (y = a.lens[a.have - 1]), + (c = 3 + (3 & h)), + (h >>>= 2), + (d -= 2); + } else if (17 === p) { + for (R = b + 3; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= b), + (d -= b), + (y = 0), + (c = 3 + (7 & h)), + (h >>>= 3), + (d -= 3); + } else { + for (R = b + 7; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= b), + (d -= b), + (y = 0), + (c = 11 + (127 & h)), + (h >>>= 7), + (d -= 7); + } + if (a.have + c > a.nlen + a.ndist) { + (t.msg = 'invalid bit length repeat'), + (a.mode = ze); + break; + } + for (; c--; ) a.lens[a.have++] = y; + } + } + if (a.mode === ze) break; + if (0 === a.lens[256]) { + (t.msg = 'invalid code -- missing end-of-block'), + (a.mode = ze); + break; + } + if ( + ((a.lenbits = 9), + (E = { bits: a.lenbits }), + (x = _e( + 1, + a.lens, + 0, + a.nlen, + a.lencode, + 0, + a.work, + E + )), + (a.lenbits = E.bits), + x) + ) { + (t.msg = 'invalid literal/lengths set'), + (a.mode = ze); + break; + } + if ( + ((a.distbits = 6), + (a.distcode = a.distdyn), + (E = { bits: a.distbits }), + (x = _e( + 2, + a.lens, + a.nlen, + a.ndist, + a.distcode, + 0, + a.work, + E + )), + (a.distbits = E.bits), + x) + ) { + (t.msg = 'invalid distances set'), (a.mode = ze); + break; + } + if (((a.mode = 20), e === ue)) break t; + case 20: + a.mode = 21; + case 21: + if (l >= 6 && o >= 258) { + (t.next_out = r), + (t.avail_out = o), + (t.next_in = s), + (t.avail_in = l), + (a.hold = h), + (a.bits = d), + se(t, f), + (r = t.next_out), + (n = t.output), + (o = t.avail_out), + (s = t.next_in), + (i = t.input), + (l = t.avail_in), + (h = a.hold), + (d = a.bits), + a.mode === xe && (a.back = -1); + break; + } + for ( + a.back = 0; + (z = a.lencode[h & ((1 << a.lenbits) - 1)]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (g && 0 == (240 & g)) { + for ( + m = b, k = g, v = p; + (z = + a.lencode[ + v + ((h & ((1 << (m + k)) - 1)) >> m) + ]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(m + b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= m), (d -= m), (a.back += m); + } + if ( + ((h >>>= b), + (d -= b), + (a.back += b), + (a.length = p), + 0 === g) + ) { + a.mode = 26; + break; + } + if (32 & g) { + (a.back = -1), (a.mode = xe); + break; + } + if (64 & g) { + (t.msg = 'invalid literal/length code'), + (a.mode = ze); + break; + } + (a.extra = 15 & g), (a.mode = 22); + case 22: + if (a.extra) { + for (R = a.extra; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.length += h & ((1 << a.extra) - 1)), + (h >>>= a.extra), + (d -= a.extra), + (a.back += a.extra); + } + (a.was = a.length), (a.mode = 23); + case 23: + for ( + ; + (z = a.distcode[h & ((1 << a.distbits) - 1)]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (0 == (240 & g)) { + for ( + m = b, k = g, v = p; + (z = + a.distcode[ + v + ((h & ((1 << (m + k)) - 1)) >> m) + ]), + (b = z >>> 24), + (g = (z >>> 16) & 255), + (p = 65535 & z), + !(m + b <= d); + + ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (h >>>= m), (d -= m), (a.back += m); + } + if (((h >>>= b), (d -= b), (a.back += b), 64 & g)) { + (t.msg = 'invalid distance code'), (a.mode = ze); + break; + } + (a.offset = p), (a.extra = 15 & g), (a.mode = 24); + case 24: + if (a.extra) { + for (R = a.extra; d < R; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + (a.offset += h & ((1 << a.extra) - 1)), + (h >>>= a.extra), + (d -= a.extra), + (a.back += a.extra); + } + if (a.offset > a.dmax) { + (t.msg = 'invalid distance too far back'), + (a.mode = ze); + break; + } + a.mode = 25; + case 25: + if (0 === o) break t; + if (((c = f - o), a.offset > c)) { + if (((c = a.offset - c), c > a.whave && a.sane)) { + (t.msg = 'invalid distance too far back'), + (a.mode = ze); + break; + } + c > a.wnext + ? ((c -= a.wnext), (u = a.wsize - c)) + : (u = a.wnext - c), + c > a.length && (c = a.length), + (w = a.window); + } else (w = n), (u = r - a.offset), (c = a.length); + c > o && (c = o), (o -= c), (a.length -= c); + do { + n[r++] = w[u++]; + } while (--c); + 0 === a.length && (a.mode = 21); + break; + case 26: + if (0 === o) break t; + (n[r++] = a.length), o--, (a.mode = 21); + break; + case 27: + if (a.wrap) { + for (; d < 32; ) { + if (0 === l) break t; + l--, (h |= i[s++] << d), (d += 8); + } + if ( + ((f -= o), + (t.total_out += f), + (a.total += f), + f && + (t.adler = a.check = + a.flags + ? M(a.check, n, f, r - f) + : B(a.check, n, f, r - f)), + (f = o), + (a.flags ? h : Ae(h)) !== a.check) + ) { + (t.msg = 'incorrect data check'), (a.mode = ze); + break; + } + (h = 0), (d = 0); + } + a.mode = 28; + case 28: + if (a.wrap && a.flags) { + for (; d < 32; ) { + if (0 === l) break t; + l--, (h += i[s++] << d), (d += 8); + } + if (h !== (4294967295 & a.total)) { + (t.msg = 'incorrect length check'), (a.mode = ze); + break; + } + (h = 0), (d = 0); + } + a.mode = 29; + case 29: + x = be; + break t; + case ze: + x = me; + break t; + case 31: + return ke; + case 32: + default: + return pe; + } + return ( + (t.next_out = r), + (t.avail_out = o), + (t.next_in = s), + (t.avail_in = l), + (a.hold = h), + (a.bits = d), + (a.wsize || + (f !== t.avail_out && + a.mode < ze && + (a.mode < 27 || e !== fe))) && + Fe(t, t.output, t.next_out, f - t.avail_out), + (_ -= t.avail_in), + (f -= t.avail_out), + (t.total_in += _), + (t.total_out += f), + (a.total += f), + a.wrap && + f && + (t.adler = a.check = + a.flags + ? M(a.check, n, f, t.next_out - f) + : B(a.check, n, f, t.next_out - f)), + (t.data_type = + a.bits + + (a.last ? 64 : 0) + + (a.mode === xe ? 128 : 0) + + (20 === a.mode || 15 === a.mode ? 256 : 0)), + ((0 === _ && 0 === f) || e === fe) && + x === we && + (x = ve), + x + ); + }, + inflateEnd: (t) => { + if (!t || !t.state) return pe; + let e = t.state; + return e.window && (e.window = null), (t.state = null), we; + }, + inflateGetHeader: (t, e) => { + if (!t || !t.state) return pe; + const a = t.state; + return 0 == (2 & a.wrap) + ? pe + : ((a.head = e), (e.done = !1), we); + }, + inflateSetDictionary: (t, e) => { + const a = e.length; + let i, n, s; + return t && t.state + ? ((i = t.state), + 0 !== i.wrap && 11 !== i.mode + ? pe + : 11 === i.mode && + ((n = 1), (n = B(n, e, a, 0)), n !== i.check) + ? me + : ((s = Fe(t, e, a, a)), + s ? ((i.mode = 31), ke) : ((i.havedict = 1), we))) + : pe; + }, + inflateInfo: 'pako inflate (from Nodeca project)', + }; + var Ne = function () { + (this.text = 0), + (this.time = 0), + (this.xflags = 0), + (this.os = 0), + (this.extra = null), + (this.extra_len = 0), + (this.name = ''), + (this.comment = ''), + (this.hcrc = 0), + (this.done = !1); + }; + const Be = Object.prototype.toString, + { + Z_NO_FLUSH: Ce, + Z_FINISH: Me, + Z_OK: He, + Z_STREAM_END: je, + Z_NEED_DICT: Ke, + Z_STREAM_ERROR: Pe, + Z_DATA_ERROR: Ye, + Z_MEM_ERROR: Ge, + } = j; + function Xe(t) { + this.options = Bt( + { chunkSize: 65536, windowBits: 15, to: '' }, + t || {} + ); + const e = this.options; + e.raw && + e.windowBits >= 0 && + e.windowBits < 16 && + ((e.windowBits = -e.windowBits), + 0 === e.windowBits && (e.windowBits = -15)), + !(e.windowBits >= 0 && e.windowBits < 16) || + (t && t.windowBits) || + (e.windowBits += 32), + e.windowBits > 15 && + e.windowBits < 48 && + 0 == (15 & e.windowBits) && + (e.windowBits |= 15), + (this.err = 0), + (this.msg = ''), + (this.ended = !1), + (this.chunks = []), + (this.strm = new Yt()), + (this.strm.avail_out = 0); + let a = Le.inflateInit2(this.strm, e.windowBits); + if (a !== He) throw new Error(H[a]); + if ( + ((this.header = new Ne()), + Le.inflateGetHeader(this.strm, this.header), + e.dictionary && + ('string' == typeof e.dictionary + ? (e.dictionary = jt(e.dictionary)) + : '[object ArrayBuffer]' === Be.call(e.dictionary) && + (e.dictionary = new Uint8Array(e.dictionary)), + e.raw && + ((a = Le.inflateSetDictionary(this.strm, e.dictionary)), + a !== He))) + ) + throw new Error(H[a]); + } + function We(t, e) { + const a = new Xe(e); + if ((a.push(t), a.err)) throw a.msg || H[a.err]; + return a.result; + } + (Xe.prototype.push = function (t, e) { + const a = this.strm, + i = this.options.chunkSize, + n = this.options.dictionary; + let s, r, l; + if (this.ended) return !1; + for ( + r = e === ~~e ? e : !0 === e ? Me : Ce, + '[object ArrayBuffer]' === Be.call(t) + ? (a.input = new Uint8Array(t)) + : (a.input = t), + a.next_in = 0, + a.avail_in = a.input.length; + ; + + ) { + for ( + 0 === a.avail_out && + ((a.output = new Uint8Array(i)), + (a.next_out = 0), + (a.avail_out = i)), + s = Le.inflate(a, r), + s === Ke && + n && + ((s = Le.inflateSetDictionary(a, n)), + s === He + ? (s = Le.inflate(a, r)) + : s === Ye && (s = Ke)); + a.avail_in > 0 && + s === je && + a.state.wrap > 0 && + 0 !== t[a.next_in]; + + ) + Le.inflateReset(a), (s = Le.inflate(a, r)); + switch (s) { + case Pe: + case Ye: + case Ke: + case Ge: + return this.onEnd(s), (this.ended = !0), !1; + } + if ( + ((l = a.avail_out), + a.next_out && (0 === a.avail_out || s === je)) + ) + if ('string' === this.options.to) { + let t = Pt(a.output, a.next_out), + e = a.next_out - t, + n = Kt(a.output, t); + (a.next_out = e), + (a.avail_out = i - e), + e && a.output.set(a.output.subarray(t, t + e), 0), + this.onData(n); + } else + this.onData( + a.output.length === a.next_out + ? a.output + : a.output.subarray(0, a.next_out) + ); + if (s !== He || 0 !== l) { + if (s === je) + return ( + (s = Le.inflateEnd(this.strm)), + this.onEnd(s), + (this.ended = !0), + !0 + ); + if (0 === a.avail_in) break; + } + } + return !0; + }), + (Xe.prototype.onData = function (t) { + this.chunks.push(t); + }), + (Xe.prototype.onEnd = function (t) { + t === He && + ('string' === this.options.to + ? (this.result = this.chunks.join('')) + : (this.result = Ct(this.chunks))), + (this.chunks = []), + (this.err = t), + (this.msg = this.strm.msg); + }); + var qe = { + Inflate: Xe, + inflate: We, + inflateRaw: function (t, e) { + return ((e = e || {}).raw = !0), We(t, e); + }, + ungzip: We, + constants: j, + }; + const { + Deflate: Je, + deflate: Qe, + deflateRaw: Ve, + gzip: $e, + } = ne, + { Inflate: ta, inflate: ea, inflateRaw: aa, ungzip: ia } = qe; + var na = Je, + sa = Qe, + ra = Ve, + la = $e, + oa = ta, + ha = ea, + da = aa, + _a = ia, + fa = j, + ca = { + Deflate: na, + deflate: sa, + deflateRaw: ra, + gzip: la, + Inflate: oa, + inflate: ha, + inflateRaw: da, + ungzip: _a, + constants: fa, + }; + (t.Deflate = na), + (t.Inflate = oa), + (t.constants = fa), + (t.default = ca), + (t.deflate = sa), + (t.deflateRaw = ra), + (t.gzip = la), + (t.inflate = ha), + (t.inflateRaw = da), + (t.ungzip = _a), + Object.defineProperty(t, '__esModule', { value: !0 }); + }); + /****************** initialization finish ******************/ + // 先拆分B站gRPC校验头和protobuf数据体 + let header = rawBody.slice(0, 5); + body = rawBody.slice(5); + // 处理response压缩protobuf数据体 + switch (header?.[0]) { + case 0: // unGzip + break; + case 1: // Gzip + body = pako.ungzip(body); + header[0] = 0; // unGzip + break; + } + // 解析链接并处理protobuf数据 + switch (HOST) { + case 'grpc.biliapi.net': // HTTP/2 + case 'app.bilibili.com': // HTTP/1.1 + /****************** initialization start *******************/ + // google.protobuf.Any + class Any$Type extends MessageType { + constructor() { + super('google.protobuf.Any', [ + { no: 1, name: 'type_url', kind: 'scalar', T: 9 }, + { no: 2, name: 'value', kind: 'scalar', T: 12 }, + ]); + } + pack(message, type) { + return { + typeUrl: this.typeNameToUrl(type.typeName), + value: type.toBinary(message), + }; + } + unpack(any, type, options) { + if (!this.contains(any, type)) + throw new Error( + "Cannot unpack google.protobuf.Any with typeUrl '" + + any.typeUrl + + "' as " + + type.typeName + + '.' + ); + return type.fromBinary(any.value, options); + } + contains(any, type) { + if (!any.typeUrl.length) return false; + let wants = + typeof type == 'string' ? type : type.typeName; + let has = this.typeUrlToName(any.typeUrl); + return wants === has; + } + internalJsonWrite(any, options) { + if (any.typeUrl === '') return {}; + let typeName = this.typeUrlToName(any.typeUrl); + let opt = jsonWriteOptions(options); + let type = opt.typeRegistry?.find( + (t) => t.typeName === typeName + ); + if (!type) + throw new globalThis.Error( + "Unable to convert google.protobuf.Any with typeUrl '" + + any.typeUrl + + "' to JSON. The specified type " + + typeName + + ' is not available in the type registry.' + ); + let value = type.fromBinary(any.value, { + readUnknownField: false, + }); + let json = type.internalJsonWrite(value, opt); + if ( + typeName.startsWith('google.protobuf.') || + !isJsonObject(json) + ) + json = { value: json }; + json['@type'] = any.typeUrl; + return json; + } + internalJsonRead(json, options, target) { + if (!isJsonObject(json)) + throw new globalThis.Error( + 'Unable to parse google.protobuf.Any from JSON ' + + typeofJsonValue(json) + + '.' + ); + if ( + typeof json['@type'] != 'string' || + json['@type'] == '' + ) + return this.create(); + let typeName = this.typeUrlToName(json['@type']); + let type = options?.typeRegistry?.find( + (t) => t.typeName == typeName + ); + if (!type) + throw new globalThis.Error( + 'Unable to parse google.protobuf.Any from JSON. The specified type ' + + typeName + + ' is not available in the type registry.' + ); + let value; + if ( + typeName.startsWith('google.protobuf.') && + json.hasOwnProperty('value') + ) + value = type.fromJson(json['value'], options); + else { + let copy = Object.assign({}, json); + delete copy['@type']; + value = type.fromJson(copy, options); + } + if (target === undefined) target = this.create(); + target.typeUrl = json['@type']; + target.value = type.toBinary(value); + return target; + } + typeNameToUrl(name) { + if (!name.length) + throw new Error('invalid type name: ' + name); + return 'type.googleapis.com/' + name; + } + typeUrlToName(url) { + if (!url.length) + throw new Error('invalid type url: ' + url); + let slash = url.lastIndexOf('/'); + let name = slash > 0 ? url.substring(slash + 1) : url; + if (!name.length) + throw new Error('invalid type url: ' + url); + return name; + } + create(value) { + const message = { typeUrl: '', value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.typeUrl = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.typeUrl !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.typeUrl); + if (message.value.length) + writer + .tag(2, WireType.LengthDelimited) + .bytes(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Any = new Any$Type(); + // CM 广告 + class CM$Type extends MessageType { + constructor() { + super('CM', [ + { + no: 1, + name: 'source_content', + kind: 'message', + T: () => Any, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { + enumerable: false, + value: this, + }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.sourceContent = Any.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sourceContent + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.sourceContent) + Any.internalBinaryWrite( + message.sourceContent, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CM = new CM$Type(); + /****************** initialization finish ******************/ + switch (PATHs?.[0]) { + case 'bilibili.app.playurl.v1.PlayURL': // 投稿视频 + switch (PATHs?.[1]) { + case 'PlayView': // 播放地址 + /****************** initialization start *******************/ + // protobuf/bilibili/app/playurl/playurl.proto + class PlayViewReply$Type extends MessageType { + constructor() { + super('PlayViewReply', [ + { + no: 5, + name: 'play_arc', + kind: 'message', + T: () => PlayArcConf, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 5: + message.playArc = + PlayArcConf.internalBinaryRead( + reader, + reader.uint32(), + options, + message.playArc + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.playArc) + PlayArcConf.internalBinaryWrite( + message.playArc, + writer + .tag(5, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const PlayViewReply = new PlayViewReply$Type(); + class PlayArcConf$Type extends MessageType { + constructor() { + super('PlayArcConf', [ + { + no: 1, + name: 'background_play_conf', + kind: 'message', + T: () => ArcConf, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.backgroundPlayConf = + ArcConf.internalBinaryRead( + reader, + reader.uint32(), + options, + message.backgroundPlayConf + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.backgroundPlayConf) + ArcConf.internalBinaryWrite( + message.backgroundPlayConf, + writer + .tag(1, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const PlayArcConf = new PlayArcConf$Type(); + class ArcConf$Type extends MessageType { + constructor() { + super('ArcConf', [ + { + no: 1, + name: 'is_support', + kind: 'scalar', + T: 8, + }, + { + no: 2, + name: 'disabled', + kind: 'scalar', + T: 8, + }, + { + no: 3, + name: 'extra_content', + kind: 'message', + T: () => ExtraContent, + }, + ]); + } + create(value) { + const message = { + isSupport: false, + disabled: false, + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.isSupport = reader.bool(); + break; + case 2: + message.disabled = reader.bool(); + break; + case 3: + message.extraContent = + ExtraContent.internalBinaryRead( + reader, + reader.uint32(), + options, + message.extraContent + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.isSupport !== false) + writer + .tag(1, WireType.Varint) + .bool(message.isSupport); + if (message.disabled !== false) + writer + .tag(2, WireType.Varint) + .bool(message.disabled); + if (message.extraContent) + ExtraContent.internalBinaryWrite( + message.extraContent, + writer + .tag(3, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ArcConf = new ArcConf$Type(); + class ExtraContent$Type extends MessageType { + constructor() { + super('ExtraContent', [ + { + no: 1, + name: 'disabled_reason', + kind: 'scalar', + T: 9, + }, + { + no: 2, + name: 'disabled_code', + kind: 'scalar', + T: 3, + L: 0, + }, + ]); + } + create(value) { + const message = { + disabledReason: '', + disabledCode: 0n, + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.disabledReason = reader.string(); + break; + case 2: + message.disabledCode = reader + .int64() + .toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.disabledReason !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.disabledReason); + if (message.disabledCode !== 0n) + writer + .tag(2, WireType.Varint) + .int64(message.disabledCode); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ExtraContent = new ExtraContent$Type(); + /****************** initialization finish ******************/ + let data = PlayViewReply.fromBinary(body); + const oldBackgroundConf = + data.playArc?.backgroundPlayConf; + if ( + oldBackgroundConf && + (!oldBackgroundConf.isSupport || + oldBackgroundConf.disabled) + ) { + $.log(`🎉 ${$.name}`, '后台播放限制去除'); + data.playArc.backgroundPlayConf.isSupport = true; + data.playArc.backgroundPlayConf.disabled = false; + data.playArc.backgroundPlayConf.extraContent = null; + } else { + $.log(`🚧 ${$.name}`, '无后台播放限制'); + } + body = PlayViewReply.toBinary(data); + break; + case 'PlayConf': // 播放配置 + break; + } + break; + case 'bilibili.app.dynamic.v2.Dynamic': // 动态 + /****************** initialization start *******************/ + // protobuf/bilibili/app/dynamic/dynamic.proto + var DynamicType; + (function (DynamicType) { + DynamicType[(DynamicType['dyn_none'] = 0)] = 'dyn_none'; + DynamicType[(DynamicType['ad'] = 15)] = 'ad'; + })(DynamicType || (DynamicType = {})); + class DynAllReply$Type extends MessageType { + constructor() { + super('DynAllReply', [ + { + no: 1, + name: 'dynamic_list', + kind: 'message', + T: () => DynamicList, + }, + { + no: 2, + name: 'up_list', + kind: 'message', + T: () => CardVideoUpList, + }, + { + no: 3, + name: 'topic_list', + kind: 'message', + T: () => TopicList, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.dynamicList = + DynamicList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dynamicList + ); + break; + case 2: + message.upList = + CardVideoUpList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.upList + ); + break; + case 3: + message.topicList = + TopicList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.topicList + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.dynamicList) + DynamicList.internalBinaryWrite( + message.dynamicList, + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + if (message.upList) + CardVideoUpList.internalBinaryWrite( + message.upList, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join(); + if (message.topicList) + TopicList.internalBinaryWrite( + message.topicList, + writer.tag(3, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynAllReply = new DynAllReply$Type(); + class DynVideoReply$Type extends MessageType { + constructor() { + super('DynVideoReply', [ + { + no: 2, + name: 'video_up_list', + kind: 'message', + T: () => CardVideoUpList, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 2: + message.videoUpList = + CardVideoUpList.internalBinaryRead( + reader, + reader.uint32(), + options, + message.videoUpList + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.videoUpList) + CardVideoUpList.internalBinaryWrite( + message.videoUpList, + writer.tag(2, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynVideoReply = new DynVideoReply$Type(); + class DynamicList$Type extends MessageType { + constructor() { + super('DynamicList', [ + { + no: 1, + name: 'list', + kind: 'message', + repeat: 1, + T: () => DynamicItem, + }, + ]); + } + create(value) { + const message = { list: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.list.push( + DynamicItem.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.list.length; i++) + DynamicItem.internalBinaryWrite( + message.list[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynamicList = new DynamicList$Type(); + class CardVideoUpList$Type extends MessageType { + constructor() { + super('CardVideoUpList', [ + { no: 1, name: 'title', kind: 'scalar', T: 9 }, + ]); + } + create(value) { + const message = { title: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.title = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.title !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.title); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CardVideoUpList = new CardVideoUpList$Type(); + class TopicList$Type extends MessageType { + constructor() { + super('TopicList', [ + { no: 1, name: 'title', kind: 'scalar', T: 9 }, + ]); + } + create(value) { + const message = { title: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.title = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.title !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.title); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TopicList = new TopicList$Type(); + class DynamicItem$Type extends MessageType { + constructor() { + super('DynamicItem', [ + { + no: 1, + name: 'card_type', + kind: 'enum', + T: () => ['DynamicType', DynamicType], + }, + ]); + } + create(value) { + const message = { cardType: 0 }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.cardType = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cardType !== 0) + writer + .tag(1, WireType.Varint) + .int32(message.cardType); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DynamicItem = new DynamicItem$Type(); + /****************** initialization finish ******************/ + switch (PATHs?.[1]) { + case 'DynAll': // 动态综合页 + data = DynAllReply.fromBinary(body); + switch (Settings?.Detail?.Hot_topics) { + case true: + default: + if (data.topicList) { + data.topicList = null; + $.log(`🎉 ${$.name}`, '动态综合页热门话题去除'); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态综合页热门话题不去除' + ); + break; + } + switch (Settings?.Detail?.Most_visited) { + case true: + default: + if (data.upList) { + data.upList = null; + $.log(`🎉 ${$.name}`, '动态综合页最常访问去除'); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态综合页最常访问不去除' + ); + break; + } + switch (Settings?.Detail?.Dynamic_adcard) { + case true: + default: + if (data.dynamicList?.list?.length) { + data.dynamicList.list = + data.dynamicList.list.filter((item) => { + if (item.cardType !== 15) { + return true; + } + $.log( + `🎉 ${$.name}`, + '动态综合页广告动态去除' + ); + return false; + }); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态综合页广告动态不去除' + ); + break; + } + body = DynAllReply.toBinary(data); + break; + case 'DynVideo': // 动态视频页 + data = DynVideoReply.fromBinary(body); + switch (Settings?.Detail?.Most_visited) { + case true: + default: + if (data.videoUpList) { + data.videoUpList = null; + $.log(`🎉 ${$.name}`, '动态视频页最常访问去除'); + } + break; + case false: + $.log( + `🚧 ${$.name}`, + '用户设置动态视频页最常访问不去除' + ); + break; + } + body = DynVideoReply.toBinary(data); + break; + } + break; + case 'bilibili.app.view.v1.View': // 视频 + switch (PATHs?.[1]) { + case 'View': // 视频播放页 + /****************** initialization start *******************/ + // protobuf/bilibili/app/view/view.proto + class ViewReply$Type extends MessageType { + constructor() { + super('ViewReply', [ + { + no: 6, + name: 't_icon', + kind: 'map', + K: 9, + V: { kind: 'message', T: () => TIcon }, + }, + { + no: 10, + name: 'relates', + kind: 'message', + repeat: 1, + T: () => Relate, + }, + { + no: 30, + name: 'cms', + kind: 'message', + repeat: 1, + T: () => CM, + }, + { + no: 31, + name: 'cm_config', + kind: 'message', + T: () => CMConfig, + }, + { + no: 41, + name: 'cm_ipad', + kind: 'message', + T: () => CmIpad, + }, + ]); + } + create(value) { + const message = { + tIcon: {}, + relates: [], + cms: [], + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 6: + this.binaryReadMap6( + message.tIcon, + reader, + options + ); + break; + case 10: + message.relates.push( + Relate.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + case 30: + message.cms.push( + CM.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + case 31: + message.cmConfig = + CMConfig.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cmConfig + ); + break; + case 41: + message.cmIpad = CmIpad.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cmIpad + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + binaryReadMap6(map, reader, options) { + let len = reader.uint32(), + end = reader.pos + len, + key, + val; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = TIcon.internalBinaryRead( + reader, + reader.uint32(), + options + ); + break; + default: + throw new globalThis.Error( + 'unknown map entry field for field ViewReply.t_icon' + ); + } + } + map[key ?? ''] = val ?? TIcon.create(); + } + internalBinaryWrite(message, writer, options) { + for (let k of Object.keys(message.tIcon)) { + writer + .tag(6, WireType.LengthDelimited) + .fork() + .tag(1, WireType.LengthDelimited) + .string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + TIcon.internalBinaryWrite( + message.tIcon[k], + writer, + options + ); + writer.join().join(); + } + for (let i = 0; i < message.relates.length; i++) + Relate.internalBinaryWrite( + message.relates[i], + writer + .tag(10, WireType.LengthDelimited) + .fork(), + options + ).join(); + for (let i = 0; i < message.cms.length; i++) + CM.internalBinaryWrite( + message.cms[i], + writer + .tag(30, WireType.LengthDelimited) + .fork(), + options + ).join(); + if (message.cmConfig) + CMConfig.internalBinaryWrite( + message.cmConfig, + writer + .tag(31, WireType.LengthDelimited) + .fork(), + options + ).join(); + if (message.cmIpad) + CmIpad.internalBinaryWrite( + message.cmIpad, + writer + .tag(41, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ViewReply = new ViewReply$Type(); + class CM$Type extends MessageType { + constructor() { + super('CM', [ + { + no: 1, + name: 'source_content', + kind: 'message', + T: () => Any, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.sourceContent = + Any.internalBinaryRead( + reader, + reader.uint32(), + options, + message.sourceContent + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.sourceContent) + Any.internalBinaryWrite( + message.sourceContent, + writer + .tag(1, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CM = new CM$Type(); + class CMConfig$Type extends MessageType { + constructor() { + super('CMConfig', [ + { + no: 1, + name: 'ads_control', + kind: 'message', + T: () => Any, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.adsControl = Any.internalBinaryRead( + reader, + reader.uint32(), + options, + message.adsControl + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.adsControl) + Any.internalBinaryWrite( + message.adsControl, + writer + .tag(1, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CMConfig = new CMConfig$Type(); + class CmIpad$Type extends MessageType { + constructor() { + super('CmIpad', [ + { + no: 5, + name: 'aid', + kind: 'scalar', + T: 3, + L: 0, + }, + ]); + } + create(value) { + const message = { aid: 0n }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 5: + message.aid = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.aid !== 0n) + writer + .tag(5, WireType.Varint) + .int64(message.aid); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CmIpad = new CmIpad$Type(); + class TIcon$Type extends MessageType { + constructor() { + super('TIcon', [ + { no: 1, name: 'icon', kind: 'scalar', T: 9 }, + ]); + } + create(value) { + const message = { icon: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.icon = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.icon !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.icon); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TIcon = new TIcon$Type(); + class Relate$Type extends MessageType { + constructor() { + super('Relate', [ + { + no: 28, + name: 'cm', + kind: 'message', + T: () => CM, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 28: + message.cm = CM.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cm + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cm) + CM.internalBinaryWrite( + message.cm, + writer + .tag(28, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Relate = new Relate$Type(); + /****************** initialization finish ******************/ + switch (Settings?.Detail?.view) { + case true: + default: + let data = ViewReply.fromBinary(body); + if (data.cms?.length) { + data.cms = []; + $.log(`🎉 ${$.name}`, '播放页广告卡片去除'); + } + if (data.relates?.length) { + data.relates = data.relates.filter((item) => { + if (item.cm) { + $.log( + `🎉 ${$.name}`, + '播放页关联推荐广告去除' + ); + return false; + } + return true; + }); + } + if (data.cmConfig || data.cmIpad) { + delete data.cmConfig; + delete data.cmIpad; + $.log(`🎉 ${$.name}`, '播放页定制tab去除'); + } + for (const i in data.tIcon) { + if (data.tIcon[i] === null) { + // 解决tIcon的null is not an object问题 + // console.log(`tIconMap:${i}`); + delete data.tIcon[i]; + } + } + body = ViewReply.toBinary(data); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置播放页广告不去除'); + break; + } + break; + case 'TFInfo': + /****************** initialization start *******************/ + // protobuf/bilibili/app/view/view.proto + class TFInfoReply$Type extends MessageType { + constructor() { + super('TFInfoReply', [ + { + no: 1, + name: 'tipsId', + kind: 'scalar', + T: 3, + L: 0, + }, + { + no: 2, + name: 'tfToast', + kind: 'message', + T: () => TFToast, + }, + { + no: 3, + name: 'tfPanelCustomized', + kind: 'message', + T: () => TFPanelCustomized, + }, + ]); + } + create(value) { + const message = { tipsId: 0n }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.tipsId = reader.int64().toBigInt(); + break; + case 2: + message.tfToast = + TFToast.internalBinaryRead( + reader, + reader.uint32(), + options, + message.tfToast + ); + break; + case 3: + message.tfPanelCustomized = + TFPanelCustomized.internalBinaryRead( + reader, + reader.uint32(), + options, + message.tfPanelCustomized + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.tipsId !== 0n) + writer + .tag(1, WireType.Varint) + .int64(message.tipsId); + if (message.tfToast) + TFToast.internalBinaryWrite( + message.tfToast, + writer + .tag(2, WireType.LengthDelimited) + .fork(), + options + ).join(); + if (message.tfPanelCustomized) + TFPanelCustomized.internalBinaryWrite( + message.tfPanelCustomized, + writer + .tag(3, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TFInfoReply = new TFInfoReply$Type(); + class TFToast$Type extends MessageType { + constructor() { + super('TFToast', [ + { + no: 1, + name: 'btnText', + kind: 'scalar', + T: 9, + }, + ]); + } + create(value) { + const message = { btnText: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.btnText = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.btnText !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.btnText); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TFToast = new TFToast$Type(); + class TFPanelCustomized$Type extends MessageType { + constructor() { + super('TFPanelCustomized', [ + { + no: 2, + name: 'rightBtnText', + kind: 'scalar', + T: 9, + }, + ]); + } + create(value) { + const message = { rightBtnText: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 2: + message.rightBtnText = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.rightBtnText !== '') + writer + .tag(2, WireType.LengthDelimited) + .string(message.rightBtnText); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const TFPanelCustomized = + new TFPanelCustomized$Type(); + /****************** initialization finish ******************/ + let data = TFInfoReply.fromBinary(body); + $.log(data.tipsId); + if (data?.tipsId) { + delete data.tfToast; + delete data.tfPanelCustomized; + $.log(`🎉 ${$.name}`, '播放页办卡免流广告去除'); + } + body = TFInfoReply.toBinary(data); + break; + } + break; + case 'bilibili.app.interface.v1.Teenagers': // 青少年模式 + class ModeStatus$Type extends MessageType { + constructor() { + super('ModeStatus', [ + { + no: 1, + name: 'modes', + kind: 'message', + repeat: 1, + T: () => Mode, + }, + ]); + } + create(value) { + const message = { modes: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.modes.push( + Mode.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.modes.length; i++) + Mode.internalBinaryWrite( + message.modes[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const ModeStatus = new ModeStatus$Type(); + class Mode$Type extends MessageType { + constructor() { + super('Mode', [ + { no: 2, name: 'name', kind: 'scalar', T: 9 }, + { no: 5, name: 'f5', kind: 'message', T: () => F5 }, + ]); + } + create(value) { + const message = { name: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 2: + message.name = reader.string(); + break; + case 5: + message.f5 = F5.internalBinaryRead( + reader, + reader.uint32(), + options, + message.f5 + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.name !== '') + writer + .tag(2, WireType.LengthDelimited) + .string(message.name); + if (message.f5) + F5.internalBinaryWrite( + message.f5, + writer.tag(5, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Mode = new Mode$Type(); + class F5$Type extends MessageType { + constructor() { + super('F5', [ + { no: 1, name: 'f1', kind: 'scalar', T: 5 }, + ]); + } + create(value) { + const message = { f1: 0 }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.f1 = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.f1 !== 0) + writer.tag(1, WireType.Varint).int32(message.f1); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const F5 = new F5$Type(); + switch (PATHs?.[1]) { + case 'ModeStatus': // 青少年模式 + data = ModeStatus.fromBinary(body); + data.modes = data.modes.map((mode) => { + if (mode?.name === 'teenagers') { + if (mode?.f5?.f1) { + mode.f5.f1 = 0; + $.log(`🎉 ${$.name}`, '青少年模式弹窗去除'); + } + } + return mode; + }); + body = ModeStatus.toBinary(data); + break; + } + break; + case 'bilibili.community.service.dm.v1.DM': //弹幕 + class CommandDm$Type extends MessageType { + constructor() { + super('CommandDm', [ + { no: 1, name: 'id', kind: 'scalar', T: 3, L: 0 }, + ]); + } + create(value) { + const message = { id: 0n }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.id = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.id !== 0n) + writer.tag(1, WireType.Varint).int64(message.id); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const CommandDm = new CommandDm$Type(); + class DmView$Type extends MessageType { + constructor() { + super('DmView', [ + { + no: 1, + name: 'commandDms', + kind: 'message', + repeat: 1, + T: () => CommandDm, + }, + ]); + } + create(value) { + const message = { commandDms: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.commandDms.push( + CommandDm.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.commandDms.length; i++) + CommandDm.internalBinaryWrite( + message.commandDms[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DmView = new DmView$Type(); + class DmViewReply$Type extends MessageType { + constructor() { + super('DmViewReply', [ + { + no: 22, + name: 'dmView', + kind: 'message', + T: () => DmView, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 22: + message.dmView = DmView.internalBinaryRead( + reader, + reader.uint32(), + options, + message.dmView + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.dmView) + DmView.internalBinaryWrite( + message.dmView, + writer.tag(22, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DmViewReply = new DmViewReply$Type(); + class DmSegMobileReply$Type extends MessageType { + constructor() { + super('DmSegMobileReply', [ + { + no: 1, + name: 'elems', + kind: 'message', + repeat: 1, + T: () => DanmakuElem, + }, + ]); + } + create(value) { + const message = { elems: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.elems.push( + DanmakuElem.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.elems.length; i++) + DanmakuElem.internalBinaryWrite( + message.elems[i], + writer.tag(1, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DmSegMobileReply = new DmSegMobileReply$Type(); + class DanmakuElem$Type extends MessageType { + constructor() { + super('DanmakuElem', [ + { no: 24, name: 'colorful', kind: 'scalar', T: 5 }, + ]); + } + create(value) { + const message = { colorful: 0 }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 24: + message.colorful = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.colorful !== 0) + writer + .tag(24, WireType.Varint) + .int32(message.colorful); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const DanmakuElem = new DanmakuElem$Type(); + switch (PATHs?.[1]) { + case 'DmView': // 弹幕配置 + switch (Settings?.Detail?.commandDms) { + case true: + let data = DmViewReply.fromBinary(body); + if (data.dmView?.commandDms?.length) { + data.dmView.commandDms.length = 0; + $.log(`🎉 ${$.name}`, '交互式弹幕去除'); + } + body = DmViewReply.toBinary(data); + break; + case false: + default: + $.log(`🎉 ${$.name}`, '用户设置交互式弹幕不去除'); + break; + } + break; + case 'DmSegMobile': // 弹幕列表 + switch (Settings?.Detail?.colorfulDms) { + case true: + let data = DmSegMobileReply.fromBinary(body); + data.elems = data.elems.map((ele) => { + if (ele?.colorful === 60001) { + ele.colorful = 0; + } + return ele; + }); + $.log(`🎉 ${$.name}`, '会员弹幕已替换为普通弹幕'); + body = DmSegMobileReply.toBinary(data); + break; + case false: + default: + $.log(`🎉 ${$.name}`, '用户设置会员弹幕不修改'); + break; + } + break; + } + break; + case 'bilibili.main.community.reply.v1.Reply': + class MainListReply$Type extends MessageType { + constructor() { + super('MainListReply', [ + { + no: 11, + name: 'cm', + kind: 'message', + T: () => CM, + }, + ]); + } + create(value) { + const message = {}; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader, length, options, target) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 11: + message.cm = CM.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cm + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cm) + CM.internalBinaryWrite( + message.cm, + writer.tag(11, WireType.LengthDelimited).fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const MainListReply = new MainListReply$Type(); + switch (PATHs?.[1]) { + case 'MainList': + switch (Settings?.Detail?.MainList) { + case true: + default: + let data = MainListReply.fromBinary(body); + delete data.cm; + body = MainListReply.toBinary(data); + $.log(`🎉 ${$.name}`, '评论列表广告去除'); + break; + case false: + $.log( + `🎉 ${$.name}`, + '用户设置评论列表广告不去除' + ); + break; + } + break; + } + break; + case 'bilibili.pgc.gateway.player.v2.PlayURL': // 番剧 + /****************** initialization start *******************/ + /****************** initialization finish *******************/ + switch (PATHs?.[1]) { + case 'PlayView': // 播放地址 + /****************** initialization start *******************/ + /****************** initialization finish *******************/ + break; + case 'PlayConf': // 播放配置 + break; + } + break; + case 'bilibili.app.nativeact.v1.NativeAct': // 活动-节目、动画、韩综(港澳台) + switch (PATHs?.[1]) { + case 'Index': // 首页 + break; + } + break; + case 'bilibili.app.interface.v1.Search': // 搜索框 + switch (PATHs?.[1]) { + case 'Suggest3': // 搜索建议 + break; + } + break; + case 'bilibili.polymer.app.search.v1.Search': // 搜索结果 + /****************** initialization start *******************/ + /****************** initialization finish *******************/ + switch (PATHs?.[1]) { + case 'SearchAll': { + // 全部结果(综合) + /****************** initialization start *******************/ + class SearchAllResponse$Type extends MessageType { + constructor() { + super('SearchAllResponse', [ + { + no: 4, + name: 'item', + kind: 'message', + repeat: 1, + T: () => Item, + }, + ]); + } + create(value) { + const message = { item: [] }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 4: + message.item.push( + Item.internalBinaryRead( + reader, + reader.uint32(), + options + ) + ); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + for (let i = 0; i < message.item.length; i++) + Item.internalBinaryWrite( + message.item[i], + writer + .tag(4, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const SearchAllResponse = + new SearchAllResponse$Type(); + class Item$Type extends MessageType { + constructor() { + super('Item', [ + { + no: 25, + name: 'cm', + kind: 'message', + oneof: 'cardItem', + T: () => SearchAdCard, + }, + ]); + } + create(value) { + const message = { + cardItem: { oneofKind: undefined }, + }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 25: + message.cardItem = { + oneofKind: 'cm', + cm: SearchAdCard.internalBinaryRead( + reader, + reader.uint32(), + options, + message.cardItem.cm + ), + }; + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.cardItem.oneofKind === 'cm') + SearchAdCard.internalBinaryWrite( + message.cardItem.cm, + writer + .tag(25, WireType.LengthDelimited) + .fork(), + options + ).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const Item = new Item$Type(); + class SearchAdCard$Type extends MessageType { + constructor() { + super('SearchAdCard', [ + { + no: 1, + name: 'json_str', + kind: 'scalar', + T: 9, + }, + ]); + } + create(value) { + const message = { jsonStr: '' }; + globalThis.Object.defineProperty( + message, + MESSAGE_TYPE, + { enumerable: false, value: this } + ); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead( + reader, + length, + options, + target + ) { + let message = target ?? this.create(), + end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + message.jsonStr = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === 'throw') + throw new globalThis.Error( + `Unknown field ${fieldNo}(wire type ${wireType})for ${this.typeName}` + ); + let d = reader.skip(wireType); + if (u !== false) + (u === true + ? UnknownFieldHandler.onRead + : u)( + this.typeName, + message, + fieldNo, + wireType, + d + ); + } + } + return message; + } + internalBinaryWrite(message, writer, options) { + if (message.jsonStr !== '') + writer + .tag(1, WireType.LengthDelimited) + .string(message.jsonStr); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)( + this.typeName, + message, + writer + ); + return writer; + } + } + const SearchAdCard = new SearchAdCard$Type(); + /****************** initialization finish *******************/ + switch (Settings?.Detail?.search) { + case true: + default: + let data = SearchAllResponse.fromBinary(body); + data.item = data.item.filter( + (i) => !(i.cardItem?.oneofKind === 'cm') + ); + $.log(`🎉 ${$.name}`, '搜索页广告去除'); + body = SearchAllResponse.toBinary(data); + break; + case false: + $.log(`🚧 ${$.name}`, '用户设置搜索页广告不去除'); + break; + } + break; + } + case 'SearchByType': { + // 分类结果(番剧、用户、影视、专栏) + break; + } + } + break; + } + break; + } + // protobuf部分处理完后,重新计算并添加B站gRPC校验头 + rawBody = newRawBody({ header, body }); // gzip压缩有问题,别用 + break; + } + // 写入二进制数据 + if ($.isQuanX()) $response.bodyBytes = rawBody; + else $response.body = rawBody; + break; + } + break; + case false: + break; + } })() - .catch((e) => $.logErr(e)) - .finally(() => { - switch ($response) { - default: { // 有回复数据,返回回复数据 - const FORMAT = ($response?.headers?.["Content-Type"] ?? $response?.headers?.["content-type"])?.split(";")?.[0]; - $.log(`🎉 ${$.name}, finally`, `$response`, `FORMAT: ${FORMAT}`, ""); - //$.log(`🚧 ${$.name}, finally`, `$response: ${JSON.stringify($response)}`, ""); - if ($response?.headers?.["Content-Encoding"]) $response.headers["Content-Encoding"] = "identity"; - if ($response?.headers?.["content-encoding"]) $response.headers["content-encoding"] = "identity"; - if ($.isQuanX()) { - switch (FORMAT) { - case undefined: // 视为无body - // 返回普通数据 - $.done({ headers: $response.headers }); - break; - case "application/x-www-form-urlencoded": - case "text/plain": - case "text/html": - case "text/xml": - case "text/plist": - case "application/xml": - case "application/plist": - case "application/x-plist": - case "text/json": - case "application/json": - default: - // 返回普通数据 - $.done({ headers: $response.headers, body: $response.body }); - break; - case "application/x-protobuf": - case "application/grpc": - case "application/grpc+proto": - case "applecation/octet-stream": - // 返回二进制数据 - //$.log(`${$response.bodyBytes.byteLength}---${$response.bodyBytes.buffer.byteLength}`); - $.done({ headers: $response.headers, bodyBytes: $response.bodyBytes.buffer.slice($response.bodyBytes.byteOffset, $response.bodyBytes.byteLength + $response.bodyBytes.byteOffset) }); - break; - }; - } else $.done($response); - break; - }; - case undefined: { // 无回复数据 - break; - }; - }; - }) + .catch((e) => $.logErr(e)) + .finally(() => { + switch ($response) { + default: { + // 有回复数据,返回回复数据 + const FORMAT = ( + $response?.headers?.['Content-Type'] ?? + $response?.headers?.['content-type'] + )?.split(';')?.[0]; + $.log(`🎉 ${$.name}, finally`, `$response`, `FORMAT: ${FORMAT}`, ''); + //$.log(`🚧 ${$.name}, finally`, `$response: ${JSON.stringify($response)}`, ""); + if ($response?.headers?.['Content-Encoding']) + $response.headers['Content-Encoding'] = 'identity'; + if ($response?.headers?.['content-encoding']) + $response.headers['content-encoding'] = 'identity'; + if ($.isQuanX()) { + switch (FORMAT) { + case undefined: // 视为无body + // 返回普通数据 + $.done({ headers: $response.headers }); + break; + case 'application/x-www-form-urlencoded': + case 'text/plain': + case 'text/html': + case 'text/xml': + case 'text/plist': + case 'application/xml': + case 'application/plist': + case 'application/x-plist': + case 'text/json': + case 'application/json': + default: + // 返回普通数据 + $.done({ headers: $response.headers, body: $response.body }); + break; + case 'application/x-protobuf': + case 'application/grpc': + case 'application/grpc+proto': + case 'applecation/octet-stream': + // 返回二进制数据 + //$.log(`${$response.bodyBytes.byteLength}---${$response.bodyBytes.buffer.byteLength}`); + $.done({ + headers: $response.headers, + bodyBytes: $response.bodyBytes.buffer.slice( + $response.bodyBytes.byteOffset, + $response.bodyBytes.byteLength + + $response.bodyBytes.byteOffset + ), + }); + break; + } + } else $.done($response); + break; + } + case undefined: { + // 无回复数据 + break; + } + } + }); /***************** Function *****************/ /** @@ -618,25 +10204,38 @@ const DataBase = { * @return {Object} { Settings, Caches, Configs } */ function setENV(name, platform, database) { - //$.log(`☑️ ${$.name}, Set Environment Variables`, ""); - let { Settings, Caches, Configs } = getENV(name, platform, database); - /***************** Prase *****************/ - traverseObject(Settings, (key, value) => { - if (value === "true" || value === "false") value = JSON.parse(value); // 字符串转Boolean - else if (typeof value === "string") { - if (value?.includes(",")) value = value.split(","); // 字符串转数组 - else if (!isNaN(value)) value = parseInt(value, 10) // 字符串转数字 - }; - return value; - }); - $.log(`✅ ${$.name}, Set Environment Variables`, `Settings: ${typeof Settings}`, `Settings内容: ${JSON.stringify(Settings)}`, ""); - /***************** Caches *****************/ - //$.log(`✅ ${$.name}, Set Environment Variables`, `Caches: ${typeof Caches}`, `Caches内容: ${JSON.stringify(Caches)}`, ""); - /***************** Configs *****************/ - return { Settings, Caches, Configs }; + //$.log(`☑️ ${$.name}, Set Environment Variables`, ""); + let { Settings, Caches, Configs } = getENV(name, platform, database); + /***************** Prase *****************/ + traverseObject(Settings, (key, value) => { + if (value === 'true' || value === 'false') + value = JSON.parse(value); // 字符串转Boolean + else if (typeof value === 'string') { + if (value?.includes(',')) value = value.split(','); // 字符串转数组 + else if (!isNaN(value)) value = parseInt(value, 10); // 字符串转数字 + } + return value; + }); + $.log( + `✅ ${$.name}, Set Environment Variables`, + `Settings: ${typeof Settings}`, + `Settings内容: ${JSON.stringify(Settings)}`, + '' + ); + /***************** Caches *****************/ + //$.log(`✅ ${$.name}, Set Environment Variables`, `Caches: ${typeof Caches}`, `Caches内容: ${JSON.stringify(Caches)}`, ""); + /***************** Configs *****************/ + return { Settings, Caches, Configs }; - function traverseObject(o,c){for(var t in o){var n=o[t];o[t]="object"==typeof n&&null!==n?traverseObject(n,c):c(t,n)}return o} -}; + function traverseObject(o, c) { + for (var t in o) { + var n = o[t]; + o[t] = + 'object' == typeof n && null !== n ? traverseObject(n, c) : c(t, n); + } + return o; + } +} /** * Create New Raw Body @@ -646,7 +10245,35 @@ function setENV(name, platform, database) { * @param {String} type - encoding type * @return {ArrayBuffer} new raw Body with Checksum Header */ -function newRawBody({header,body},encoding=undefined){const flag=(encoding=="gzip")?1:(encoding=="identity")?0:(encoding==undefined)?0:header?.[0]??0;const checksum=Checksum(body.length);if(encoding=="gzip")body=pako.gzip(body);let rawBody=new Uint8Array(header.length+body.length);rawBody.set([flag],0)rawBody.set(checksum,1)rawBody.set(body,5);return rawBody;function Checksum(num){let arr=new ArrayBuffer(4);let view=new DataView(arr);view.setUint32(0,num,false);return new Uint8Array(arr)}}; +function newRawBody({ header, body }, encoding = undefined) { + //$.log(`⚠ ${$.name}, Create New Raw Body`, ""); + // Header: 1位:是否校验数据 (0或者1) + 4位:校验值(数据长度) + const flag = + encoding == 'gzip' + ? 1 + : encoding == 'identity' + ? 0 + : encoding == undefined + ? 0 + : header?.[0] ?? 0; // encoding flag + const checksum = Checksum(body.length); // 校验值为未压缩情况下的数据长度, 不是压缩后的长度 + if (encoding == 'gzip') body = pako.gzip(body); // gzip压缩(有问题,别压) + let rawBody = new Uint8Array(header.length + body.length); + rawBody.set([flag], 0); // 0位:Encoding类型,当为1的时候, app会校验1-4位的校验值是否正确 + rawBody.set(checksum, 1); // 1-4位: 校验值(4位) + rawBody.set(body, 5); // 5-end位:protobuf数据 + //$.log(`🎉 ${$.name}, Create New Raw Body`, ""); + return rawBody; + + // 计算校验和 (B站为数据本体字节数) + function Checksum(num) { + let arr = new ArrayBuffer(4); // an Int32 takes 4 bytes + let view = new DataView(arr); + // 首位填充计算过的新数据长度 + view.setUint32(0, num, false); // byteOffset = 0; litteEndian = false + return new Uint8Array(arr); + } +} /***************** Env *****************/ // prettier-ignore @@ -654,7 +10281,42 @@ function newRawBody({header,body},encoding=undefined){const flag=(encoding=="gzi function Env(t,e){class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,a)=>{s.call(this,t,(t,s,r)=>{t?a(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const a=this.getdata(t);if(a)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,a)=>e(a))})}runScript(t,e){return new Promise(s=>{let a=this.getdata("@chavy_boxjs_userCfgs.httpapi");a=a?a.replace(/\n/g,"").trim():a;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[i,o]=a.split("@"),n={url:`http://${o}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":i,Accept:"*/*"},timeout:r};this.post(n,(t,e,a)=>s(a))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),a=!s&&this.fs.existsSync(e);if(!s&&!a)return{};{const a=s?t:e;try{return JSON.parse(this.fs.readFileSync(a))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),a=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):a?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const a=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of a)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,a)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[a+1])>>0==+e[a+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,a]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,a,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,a,r]=/^@(.*?)\.(.*?)$/.exec(e),i=this.getval(a),o=a?"null"===i?null:i||"{}":"{}";try{const e=JSON.parse(o);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),a)}catch(e){const i={};this.lodash_set(i,r,t),s=this.setval(JSON.stringify(i),a)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueForKey(t,e);case"Node.js":return this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0;default:return this.data&&this.data[e]||null}}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){switch(t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"],delete t.headers["content-type"],delete t.headers["content-length"]),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,a)=>{!t&&s&&(s.body=a,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,a)});break;case"Quantumult X":this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:a,headers:r,body:i,bodyBytes:o}=t;e(null,{status:s,statusCode:a,headers:r,body:i,bodyBytes:o},i,o)},t=>e(t&&t.error||"UndefinedError"));break;case"Node.js":let s=require("iconv-lite");this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:a,statusCode:r,headers:i,rawBody:o}=t,n=s.decode(o,this.encoding);e(null,{status:a,statusCode:r,headers:i,rawBody:o,body:n},n)},t=>{const{message:a,response:r}=t;e(a,r,r&&s.decode(r.rawBody,this.encoding))})}}post(t,e=(()=>{})){const s=t.method?t.method.toLocaleLowerCase():"post";switch(t.body&&t.headers&&!t.headers["Content-Type"]&&!t.headers["content-type"]&&(t.headers["content-type"]="application/x-www-form-urlencoded"),t.headers&&(delete t.headers["Content-Length"],delete t.headers["content-length"]),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[s](t,(t,s,a)=>{!t&&s&&(s.body=a,s.statusCode=s.status?s.status:s.statusCode,s.status=s.statusCode),e(t,s,a)});break;case"Quantumult X":t.method=s,this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:a,headers:r,body:i,bodyBytes:o}=t;e(null,{status:s,statusCode:a,headers:r,body:i,bodyBytes:o},i,o)},t=>e(t&&t.error||"UndefinedError"));break;case"Node.js":let a=require("iconv-lite");this.initGotEnv(t);const{url:r,...i}=t;this.got[s](r,i).then(t=>{const{statusCode:s,statusCode:r,headers:i,rawBody:o}=t,n=a.decode(o,this.encoding);e(null,{status:s,statusCode:r,headers:i,rawBody:o,body:n},n)},t=>{const{message:s,response:r}=t;e(s,r,r&&a.decode(r.rawBody,this.encoding))})}}time(t,e=null){const s=e?new Date(e):new Date;let a={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in a)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?a[e]:("00"+a[e]).substr((""+a[e]).length)));return t}queryStr(t){let e="";for(const s in t){let a=t[s];null!=a&&""!==a&&("object"==typeof a&&(a=JSON.stringify(a)),e+=`${s}=${a}&`)}return e=e.substring(0,e.length-1),e}msg(e=t,s="",a="",r){const i=t=>{switch(typeof t){case void 0:return t;case"string":switch(this.getEnv()){case"Surge":case"Stash":default:return{url:t};case"Loon":case"Shadowrocket":return t;case"Quantumult X":return{"open-url":t};case"Node.js":return}case"object":switch(this.getEnv()){case"Surge":case"Stash":case"Shadowrocket":default:{let e=t.url||t.openUrl||t["open-url"];return{url:e}}case"Loon":{let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}case"Quantumult X":{let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl,a=t["update-pasteboard"]||t.updatePasteboard;return{"open-url":e,"media-url":s,"update-pasteboard":a}}case"Node.js":return}default:return}};if(!this.isMute)switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":default:$notification.post(e,s,a,i(r));break;case"Quantumult X":$notify(e,s,a,i(r));break;case"Node.js":}if(!this.isMuteLog){let t=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t.push(e),s&&t.push(s),a&&t.push(a),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t);break;case"Node.js":this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack)}}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;switch(this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":case"Quantumult X":default:$done(t);break;case"Node.js":process.exit(1)}}}(t,e)} // https://github.com/DualSubs/URL/blob/main/URLs.embedded.min.js -function URLs(s){return new class{constructor(s=[]){this.name="URL v1.0.2",this.opts=s,this.json={scheme:"",host:"",path:"",params:{}}}parse(s){let t=s.match(/(?.+):\/\/(?[^/]+)\/?(?[^?]+)?\??(?.*)?/)?.groups??null;return t?.path||(t.path=""),t?.params&&(t.params=Object.fromEntries(t.params.split("&").map((s=>s.split("="))))),t}stringify(s=this.json){return s?.params?s.scheme+"://"+s.host+"/"+s.path+"?"+Object.entries(s.params).map((s=>s.join("="))).join("&"):s.scheme+"://"+s.host+"/"+s.path}}(s)} +function URLs(s) { + return new (class { + constructor(s = []) { + (this.name = 'URL v1.0.2'), + (this.opts = s), + (this.json = { scheme: '', host: '', path: '', params: {} }); + } + parse(s) { + let t = + s.match( + /(?.+):\/\/(?[^/]+)\/?(?[^?]+)?\??(?.*)?/ + )?.groups ?? null; + return ( + t?.path || (t.path = ''), + t?.params && + (t.params = Object.fromEntries( + t.params.split('&').map((s) => s.split('=')) + )), + t + ); + } + stringify(s = this.json) { + return s?.params + ? s.scheme + + '://' + + s.host + + '/' + + s.path + + '?' + + Object.entries(s.params) + .map((s) => s.join('=')) + .join('&') + : s.scheme + '://' + s.host + '/' + s.path; + } + })(s); +} /** * Get Environment Variables @@ -665,5 +10327,29 @@ function URLs(s){return new class{constructor(s=[]){this.name="URL v1.0.2",this. * @param {Object} n - Default Database * @return {Object} { Settings, Caches, Configs } */ -function getENV(t,e,n){let i=$.getjson(t,n),s={};if("undefined"!=typeof $argument&&Boolean($argument)){let t=Object.fromEntries($argument.split("&").map((t=>t.split("="))));for(let e in t)l(s,e,t[e])}let g={...n?.Default?.Settings,...n?.[e]?.Settings,...i?.[e]?.Settings,...s},f={...n?.Default?.Configs,...n?.[e]?.Configs,...i?.[e]?.Configs},o=i?.[e]?.Caches||{};return"string"==typeof o&&(o=JSON.parse(o)),{Settings:g,Caches:o,Configs:f};function l(t,e,n){e.split(".").reduce(((t,i,s)=>t[i]=e.split(".").length===++s?n:t[i]||{}),t)}} - +function getENV(t, e, n) { + let i = $.getjson(t, n), + s = {}; + if ('undefined' != typeof $argument && Boolean($argument)) { + let t = Object.fromEntries($argument.split('&').map((t) => t.split('='))); + for (let e in t) l(s, e, t[e]); + } + let g = { + ...n?.Default?.Settings, + ...n?.[e]?.Settings, + ...i?.[e]?.Settings, + ...s, + }, + f = { ...n?.Default?.Configs, ...n?.[e]?.Configs, ...i?.[e]?.Configs }, + o = i?.[e]?.Caches || {}; + return ( + 'string' == typeof o && (o = JSON.parse(o)), + { Settings: g, Caches: o, Configs: f } + ); + function l(t, e, n) { + e.split('.').reduce( + (t, i, s) => (t[i] = e.split('.').length === ++s ? n : t[i] || {}), + t + ); + } +} diff --git a/Scripts/Unlock/BiliBili.proto.js b/Scripts/Unlock/BiliBili.proto.js index 13d3a17..ad286c7 100644 --- a/Scripts/Unlock/BiliBili.proto.js +++ b/Scripts/Unlock/BiliBili.proto.js @@ -12,11 +12,11 @@ > 脚本声明:若有侵犯原作者权利,请邮箱联系删除 ***********************************************/ -const version = "V2.0.21"; +const version = 'V2.0.21'; let protobuf; !(function (g) { - "use strict"; + 'use strict'; !(function (r, e, t) { var i = (function t(i) { var n = e[i]; @@ -26,12 +26,12 @@ let protobuf; ); })(t[0]); (protobuf = i.util.global.protobuf = i), - "function" == typeof define && + 'function' == typeof define && define.amd && - define(["long"], function (t) { + define(['long'], function (t) { return t && t.isLong && ((i.util.Long = t), i.configure()), i; }), - "object" == typeof module && + 'object' == typeof module && module && module.exports && (module.exports = i); @@ -74,7 +74,7 @@ let protobuf; n.length = function (t) { var i = t.length; if (!i) return 0; - for (var n = 0; 1 < --i % 4 && "=" == (t[0 | i] || ""); ) ++n; + for (var n = 0; 1 < --i % 4 && '=' == (t[0 | i] || ''); ) ++n; return Math.ceil(3 * t.length) / 4 - n; }; for (var f = Array(64), h = Array(123), r = 0; r < 64; ) @@ -110,11 +110,11 @@ let protobuf; e ? (u && e.push(String.fromCharCode.apply(String, s.slice(0, u))), - e.join("")) + e.join('')) : String.fromCharCode.apply(String, s.slice(0, u)) ); }; - var c = "invalid encoding"; + var c = 'invalid encoding'; (n.decode = function (t, i, n) { for (var r, e = n, s = 0, u = 0; u < t.length; ) { var o = t.charCodeAt(u++); @@ -150,14 +150,14 @@ let protobuf; 3: [ function (t, i, n) { function a(i, n) { - "string" == typeof i && ((n = i), (i = g)); + 'string' == typeof i && ((n = i), (i = g)); var h = []; function f(t) { - if ("string" != typeof t) { + if ('string' != typeof t) { var i = c(); if ( - (a.verbose && console.log("codegen: " + i), - (i = "return " + i), + (a.verbose && console.log('codegen: ' + i), + (i = 'return ' + i), t) ) { for ( @@ -180,32 +180,32 @@ let protobuf; (t = t.replace(/%([%dfijs])/g, function (t, i) { var n = u[o++]; switch (i) { - case "d": - case "f": - return "" + +("" + n); - case "i": - return "" + Math.floor(n); - case "j": + case 'd': + case 'f': + return '' + +('' + n); + case 'i': + return '' + Math.floor(n); + case 'j': return JSON.stringify(n); - case "s": - return "" + n; + case 's': + return '' + n; } - return "%"; + return '%'; })), o !== u.length) ) - throw Error("parameter count mismatch"); + throw Error('parameter count mismatch'); return h.push(t), f; } function c(t) { return ( - "function " + - (t || n || "") + - "(" + - ((i && i.join(",")) || "") + - "){\n " + - h.join("\n ") + - "\n}" + 'function ' + + (t || n || '') + + '(' + + ((i && i.join(',')) || '') + + '){\n ' + + h.join('\n ') + + '\n}' ); } return (f.toString = c), f; @@ -249,18 +249,18 @@ let protobuf; function (t, i, n) { i.exports = o; var s = t(1), - u = t(7)("fs"); + u = t(7)('fs'); function o(n, r, e) { return ( - (r = "function" == typeof r ? ((e = r), {}) : r || {}), + (r = 'function' == typeof r ? ((e = r), {}) : r || {}), e ? !r.xhr && u && u.readFile ? u.readFile(n, function (t, i) { - return t && "undefined" != typeof XMLHttpRequest + return t && 'undefined' != typeof XMLHttpRequest ? o.xhr(n, r, e) : t ? e(t) - : e(null, r.binary ? i : i.toString("utf8")); + : e(null, r.binary ? i : i.toString('utf8')); }) : o.xhr(n, r, e) : s(o, this, n, r) @@ -271,23 +271,23 @@ let protobuf; (e.onreadystatechange = function () { if (4 !== e.readyState) return g; if (0 !== e.status && 200 !== e.status) - return r(Error("status " + e.status)); + return r(Error('status ' + e.status)); if (n.binary) { if (!(t = e.response)) for (var t = [], i = 0; i < e.responseText.length; ++i) t.push(255 & e.responseText.charCodeAt(i)); return r( null, - "undefined" != typeof Uint8Array ? new Uint8Array(t) : t + 'undefined' != typeof Uint8Array ? new Uint8Array(t) : t ); } return r(null, e.responseText); }), n.binary && - ("overrideMimeType" in e && - e.overrideMimeType("text/plain; charset=x-user-defined"), - (e.responseType = "arraybuffer")), - e.open("GET", t), + ('overrideMimeType' in e && + e.overrideMimeType('text/plain; charset=x-user-defined'), + (e.responseType = 'arraybuffer')), + e.open('GET', t), e.send(); }; }, @@ -462,7 +462,7 @@ let protobuf; ); } return ( - "undefined" != typeof Float32Array + 'undefined' != typeof Float32Array ? ((o = new Float32Array([-0])), (h = new Uint8Array(o.buffer)), (a = 128 === h[3]), @@ -474,7 +474,7 @@ let protobuf; (t.writeFloatBE = i.bind(null, w)), (t.readFloatLE = n.bind(null, g)), (t.readFloatBE = n.bind(null, j))), - "undefined" != typeof Float64Array + 'undefined' != typeof Float64Array ? ((f = new Float64Array([-0])), (c = new Uint8Array(f.buffer)), (a = 128 === c[7]), @@ -521,7 +521,7 @@ let protobuf; function (t, i, n) { function r(t) { try { - var i = eval("require")(t); + var i = eval('require')(t); if (i && (i.length || Object.keys(i).length)) return i; } catch (t) {} return null; @@ -536,30 +536,30 @@ let protobuf; return /^(?:\/|\w+:)/.test(t); }), r = (n.normalize = function (t) { - var i = (t = t.replace(/\\/g, "/").replace(/\/{2,}/g, "/")).split( - "/" + var i = (t = t.replace(/\\/g, '/').replace(/\/{2,}/g, '/')).split( + '/' ), n = e(t), - t = ""; - n && (t = i.shift() + "/"); + t = ''; + n && (t = i.shift() + '/'); for (var r = 0; r < i.length; ) - ".." === i[r] - ? 0 < r && ".." !== i[r - 1] + '..' === i[r] + ? 0 < r && '..' !== i[r - 1] ? i.splice(--r, 2) : n ? i.splice(r, 1) : ++r - : "." === i[r] + : '.' === i[r] ? i.splice(r, 1) : ++r; - return t + i.join("/"); + return t + i.join('/'); }); n.resolve = function (t, i, n) { return ( n || (i = r(i)), !e(i) && - (t = (t = n ? t : r(t)).replace(/(?:\/|^)[^/]+$/, "")).length - ? r(t + "/" + i) + (t = (t = n ? t : r(t)).replace(/(?:\/|^)[^/]+$/, '')).length + ? r(t + '/' + i) : i ); }; @@ -597,7 +597,7 @@ let protobuf; return n; }), (n.read = function (t, i, n) { - if (n - i < 1) return ""; + if (n - i < 1) return ''; for (var r, e = null, s = [], u = 0; i < n; ) (r = t[i++]) < 128 ? (s[u++] = r) @@ -620,7 +620,7 @@ let protobuf; return e ? (u && e.push(String.fromCharCode.apply(String, s.slice(0, u))), - e.join("")) + e.join('')) : String.fromCharCode.apply(String, s.slice(0, u)); }), (n.write = function (t, i, n) { @@ -653,7 +653,7 @@ let protobuf; var e = !1; if (i.resolvedType) if (i.resolvedType instanceof l) { - t("switch(d%s){", r); + t('switch(d%s){', r); for ( var s = i.resolvedType.values, u = Object.keys(s), o = 0; o < u.length; @@ -661,81 +661,81 @@ let protobuf; ) s[u[o]] !== i.typeDefault || e || - (t("default:")( + (t('default:')( 'if(typeof(d%s)==="number"){m%s=d%s;break}', r, r, r ), - i.repeated || t("break"), + i.repeated || t('break'), (e = !0)), - t("case%j:", u[o])("case %i:", s[u[o]])( - "m%s=%j", + t('case%j:', u[o])('case %i:', s[u[o]])( + 'm%s=%j', r, s[u[o]] - )("break"); - t("}"); + )('break'); + t('}'); } else t('if(typeof d%s!=="object")', r)( - "throw TypeError(%j)", - i.fullName + ": object expected" - )("m%s=types[%i].fromObject(d%s)", r, n, r); + 'throw TypeError(%j)', + i.fullName + ': object expected' + )('m%s=types[%i].fromObject(d%s)', r, n, r); else { var h = !1; switch (i.type) { - case "double": - case "float": - t("m%s=Number(d%s)", r, r); + case 'double': + case 'float': + t('m%s=Number(d%s)', r, r); break; - case "uint32": - case "fixed32": - t("m%s=d%s>>>0", r, r); + case 'uint32': + case 'fixed32': + t('m%s=d%s>>>0', r, r); break; - case "int32": - case "sint32": - case "sfixed32": - t("m%s=d%s|0", r, r); + case 'int32': + case 'sint32': + case 'sfixed32': + t('m%s=d%s|0', r, r); break; - case "uint64": + case 'uint64': h = !0; - case "int64": - case "sint64": - case "fixed64": - case "sfixed64": - t("if(util.Long)")( - "(m%s=util.Long.fromValue(d%s)).unsigned=%j", + case 'int64': + case 'sint64': + case 'fixed64': + case 'sfixed64': + t('if(util.Long)')( + '(m%s=util.Long.fromValue(d%s)).unsigned=%j', r, r, h )('else if(typeof d%s==="string")', r)( - "m%s=parseInt(d%s,10)", + 'm%s=parseInt(d%s,10)', r, r )('else if(typeof d%s==="number")', r)( - "m%s=d%s", + 'm%s=d%s', r, r )('else if(typeof d%s==="object")', r)( - "m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)", + 'm%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)', r, r, r, - h ? "true" : "" + h ? 'true' : '' ); break; - case "bytes": + case 'bytes': t('if(typeof d%s==="string")', r)( - "util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)", + 'util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)', r, r, r - )("else if(d%s.length >= 0)", r)("m%s=d%s", r, r); + )('else if(d%s.length >= 0)', r)('m%s=d%s', r, r); break; - case "string": - t("m%s=String(d%s)", r, r); + case 'string': + t('m%s=String(d%s)', r, r); break; - case "bool": - t("m%s=Boolean(d%s)", r, r); + case 'bool': + t('m%s=Boolean(d%s)', r, r); } } return t; @@ -744,7 +744,7 @@ let protobuf; if (i.resolvedType) i.resolvedType instanceof l ? t( - "d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s", + 'd%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s', r, n, r, @@ -753,38 +753,38 @@ let protobuf; r, r ) - : t("d%s=types[%i].toObject(m%s,o)", r, n, r); + : t('d%s=types[%i].toObject(m%s,o)', r, n, r); else { var e = !1; switch (i.type) { - case "double": - case "float": - t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s", r, r, r, r); + case 'double': + case 'float': + t('d%s=o.json&&!isFinite(m%s)?String(m%s):m%s', r, r, r, r); break; - case "uint64": + case 'uint64': e = !0; - case "int64": - case "sint64": - case "fixed64": - case "sfixed64": + case 'int64': + case 'sint64': + case 'fixed64': + case 'sfixed64': t('if(typeof m%s==="number")', r)( - "d%s=o.longs===String?String(m%s):m%s", + 'd%s=o.longs===String?String(m%s):m%s', r, r, r - )("else")( - "d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s", + )('else')( + 'd%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s', r, r, r, r, - e ? "true" : "", + e ? 'true' : '', r ); break; - case "bytes": + case 'bytes': t( - "d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s", + 'd%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s', r, r, r, @@ -793,7 +793,7 @@ let protobuf; ); break; default: - t("d%s=m%s", r, r); + t('d%s=m%s', r, r); } } return t; @@ -801,42 +801,42 @@ let protobuf; (n.fromObject = function (t) { var i = t.fieldsArray, n = d.codegen( - ["d"], - t.name + "$fromObject" - )("if(d instanceof this.ctor)")("return d"); - if (!i.length) return n("return new this.ctor"); - n("var m=new this.ctor"); + ['d'], + t.name + '$fromObject' + )('if(d instanceof this.ctor)')('return d'); + if (!i.length) return n('return new this.ctor'); + n('var m=new this.ctor'); for (var r = 0; r < i.length; ++r) { var e = i[r].resolve(), s = d.safeProp(e.name); e.map - ? (n("if(d%s){", s)('if(typeof d%s!=="object")', s)( - "throw TypeError(%j)", - e.fullName + ": object expected" - )("m%s={}", s)( - "for(var ks=Object.keys(d%s),i=0;i>>3){"); + ? ',k,value' + : '') + )('while(r.pos>>3){'); for (var n = 0; n < t.fieldsArray.length; ++n) { var r = t.i[n].resolve(), - e = r.resolvedType instanceof o ? "int32" : r.type, - s = "m" + f.safeProp(r.name); - i("case %i: {", r.id), + e = r.resolvedType instanceof o ? 'int32' : r.type, + s = 'm' + f.safeProp(r.name); + i('case %i: {', r.id), r.map - ? (i("if(%s===util.emptyObject)", s)("%s={}", s)( - "var c2 = r.uint32()+r.pos" + ? (i('if(%s===util.emptyObject)', s)('%s={}', s)( + 'var c2 = r.uint32()+r.pos' ), h.defaults[r.keyType] !== g - ? i("k=%j", h.defaults[r.keyType]) - : i("k=null"), + ? i('k=%j', h.defaults[r.keyType]) + : i('k=null'), h.defaults[e] !== g - ? i("value=%j", h.defaults[e]) - : i("value=null"), - i("while(r.pos>>3){" + ? i('value=%j', h.defaults[e]) + : i('value=null'), + i('while(r.pos>>3){' )( - "case 1: k=r.%s(); break", + 'case 1: k=r.%s(); break', r.keyType - )("case 2:"), + )('case 2:'), h.basic[e] === g - ? i("value=types[%i].decode(r,r.uint32())", n) - : i("value=r.%s()", e), - i("break")("default:")("r.skipType(tag2&7)")("break")("}")( - "}" + ? i('value=types[%i].decode(r,r.uint32())', n) + : i('value=r.%s()', e), + i('break')('default:')('r.skipType(tag2&7)')('break')('}')( + '}' ), h.long[r.keyType] !== g ? i( '%s[typeof k==="object"?util.longToHash(k):k]=value', s ) - : i("%s[k]=value", s)) + : i('%s[k]=value', s)) : r.repeated - ? (i("if(!(%s&&%s.length))", s, s)("%s=[]", s), + ? (i('if(!(%s&&%s.length))', s, s)('%s=[]', s), h.packed[e] !== g && - i("if((t&7)===2){")("var c2=r.uint32()+r.pos")( - "while(r.pos>> 0, 8 | c.mapKey[s.keyType], s.keyType ), h === g ? n( - "types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()", + 'types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()', u, i ) - : n(".uint32(%i).%s(%s[ks[i]]).ldelim()", 16 | h, o, i), - n("}")("}")) + : n('.uint32(%i).%s(%s[ks[i]]).ldelim()', 16 | h, o, i), + n('}')('}')) : s.repeated - ? (n("if(%s!=null&&%s.length){", i, i), + ? (n('if(%s!=null&&%s.length){', i, i), s.packed && c.packed[o] !== g - ? n("w.uint32(%i).fork()", ((s.id << 3) | 2) >>> 0)( - "for(var i=0;i<%s.length;++i)", + ? n('w.uint32(%i).fork()', ((s.id << 3) | 2) >>> 0)( + 'for(var i=0;i<%s.length;++i)', i )( - "w.%s(%s[i])", + 'w.%s(%s[i])', o, i - )("w.ldelim()") - : (n("for(var i=0;i<%s.length;++i)", i), + )('w.ldelim()') + : (n('for(var i=0;i<%s.length;++i)', i), h === g - ? l(n, s, u, i + "[i]") + ? l(n, s, u, i + '[i]') : n( - "w.uint32(%i).%s(%s[i])", + 'w.uint32(%i).%s(%s[i])', ((s.id << 3) | h) >>> 0, o, i )), - n("}")) + n('}')) : (s.optional && n( - "if(%s!=null&&Object.hasOwnProperty.call(m,%j))", + 'if(%s!=null&&Object.hasOwnProperty.call(m,%j))', i, s.name ), h === g ? l(n, s, u, i) : n( - "w.uint32(%i).%s(%s)", + 'w.uint32(%i).%s(%s)', ((s.id << 3) | h) >>> 0, o, i )); } - return n("return w"); + return n('return w'); }; var f = t(14), c = t(32), @@ -1117,14 +1117,14 @@ let protobuf; function l(t, i, n, r) { i.resolvedType.group ? t( - "types[%i].encode(%s,w.uint32(%i)).uint32(%i)", + 'types[%i].encode(%s,w.uint32(%i)).uint32(%i)', n, r, ((i.id << 3) | 3) >>> 0, ((i.id << 3) | 4) >>> 0 ) : t( - "types[%i].encode(%s,w.uint32(%i).fork()).ldelim()", + 'types[%i].encode(%s,w.uint32(%i).fork()).ldelim()', n, r, ((i.id << 3) | 2) >>> 0 @@ -1139,12 +1139,12 @@ let protobuf; var h = t(22), r = ((((s.prototype = Object.create(h.prototype)).constructor = - s).className = "Enum"), + s).className = 'Enum'), t(21)), e = t(33); function s(t, i, n, r, e, s) { - if ((h.call(this, t, n), i && "object" != typeof i)) - throw TypeError("values must be an object"); + if ((h.call(this, t, n), i && 'object' != typeof i)) + throw TypeError('values must be an object'); if ( ((this.valuesById = {}), (this.values = Object.create(this.valuesById)), @@ -1155,7 +1155,7 @@ let protobuf; i) ) for (var u = Object.keys(i), o = 0; o < u.length; ++o) - "number" == typeof i[u[o]] && + 'number' == typeof i[u[o]] && (this.valuesById[(this.values[u[o]] = i[u[o]])] = u[o]); } (s.fromJSON = function (t, i) { @@ -1165,32 +1165,32 @@ let protobuf; (s.prototype.toJSON = function (t) { t = !!t && !!t.keepComments; return e.toObject([ - "options", + 'options', this.options, - "valuesOptions", + 'valuesOptions', this.valuesOptions, - "values", + 'values', this.values, - "reserved", + 'reserved', this.reserved && this.reserved.length ? this.reserved : g, - "comment", + 'comment', t ? this.comment : g, - "comments", + 'comments', t ? this.comments : g, ]); }), (s.prototype.add = function (t, i, n, r) { - if (!e.isString(t)) throw TypeError("name must be a string"); - if (!e.isInteger(i)) throw TypeError("id must be an integer"); + if (!e.isString(t)) throw TypeError('name must be a string'); + if (!e.isInteger(i)) throw TypeError('id must be an integer'); if (this.values[t] !== g) throw Error("duplicate name '" + t + "' in " + this); if (this.isReservedId(i)) - throw Error("id " + i + " is reserved in " + this); + throw Error('id ' + i + ' is reserved in ' + this); if (this.isReservedName(t)) throw Error("name '" + t + "' is reserved in " + this); if (this.valuesById[i] !== g) { if (!this.options || !this.options.allow_alias) - throw Error("duplicate id " + i + " in " + this); + throw Error('duplicate id ' + i + ' in ' + this); this.values[t] = i; } else this.valuesById[(this.values[t] = i)] = t; return ( @@ -1202,7 +1202,7 @@ let protobuf; ); }), (s.prototype.remove = function (t) { - if (!e.isString(t)) throw TypeError("name must be a string"); + if (!e.isString(t)) throw TypeError('name must be a string'); var i = this.values[t]; if (null == i) throw Error("name '" + t + "' does not exist in " + this); @@ -1230,7 +1230,7 @@ let protobuf; o = t(22), e = ((((u.prototype = Object.create(o.prototype)).constructor = - u).className = "Field"), + u).className = 'Field'), t(14)), h = t(32), f = t(33), @@ -1243,29 +1243,29 @@ let protobuf; o.call(this, t, s), !f.isInteger(i) || i < 0) ) - throw TypeError("id must be a non-negative integer"); - if (!f.isString(n)) throw TypeError("type must be a string"); + throw TypeError('id must be a non-negative integer'); + if (!f.isString(n)) throw TypeError('type must be a string'); if (r !== g && !c.test((r = r.toString().toLowerCase()))) - throw TypeError("rule must be a string rule"); + throw TypeError('rule must be a string rule'); if (e !== g && !f.isString(e)) - throw TypeError("extend must be a string"); + throw TypeError('extend must be a string'); (this.rule = - (r = "proto3_optional" === r ? "optional" : r) && "optional" !== r + (r = 'proto3_optional' === r ? 'optional' : r) && 'optional' !== r ? r : g), (this.type = n), (this.id = i), (this.extend = e || g), - (this.required = "required" === r), + (this.required = 'required' === r), (this.optional = !this.required), - (this.repeated = "repeated" === r), + (this.repeated = 'repeated' === r), (this.map = !1), (this.message = null), (this.partOf = null), (this.typeDefault = null), (this.defaultValue = null), (this.long = !!f.Long && h.long[n] !== g), - (this.bytes = "bytes" === n), + (this.bytes = 'bytes' === n), (this.resolvedType = null), (this.extensionField = null), (this.declaringField = null), @@ -1283,34 +1283,34 @@ let protobuf; i.comment ); }), - Object.defineProperty(u.prototype, "packed", { + Object.defineProperty(u.prototype, 'packed', { get: function () { return ( - null === this.n && (this.n = !1 !== this.getOption("packed")), + null === this.n && (this.n = !1 !== this.getOption('packed')), this.n ); }, }), (u.prototype.setOption = function (t, i, n) { return ( - "packed" === t && (this.n = null), + 'packed' === t && (this.n = null), o.prototype.setOption.call(this, t, i, n) ); }), (u.prototype.toJSON = function (t) { t = !!t && !!t.keepComments; return f.toObject([ - "rule", - ("optional" !== this.rule && this.rule) || g, - "type", + 'rule', + ('optional' !== this.rule && this.rule) || g, + 'type', this.type, - "id", + 'id', this.id, - "extend", + 'extend', this.extend, - "options", + 'options', this.options, - "comment", + 'comment', t ? this.comment : g, ]); }), @@ -1335,7 +1335,7 @@ let protobuf; null != this.options.default && ((this.typeDefault = this.options.default), this.resolvedType instanceof e && - "string" == typeof this.typeDefault && + 'string' == typeof this.typeDefault && (this.typeDefault = this.resolvedType.values[this.typeDefault])), this.options && @@ -1348,11 +1348,11 @@ let protobuf; this.long ? ((this.typeDefault = f.Long.fromNumber( this.typeDefault, - "u" == (this.type[0] || "") + 'u' == (this.type[0] || '') )), Object.freeze && Object.freeze(this.typeDefault)) : this.bytes && - "string" == typeof this.typeDefault && + 'string' == typeof this.typeDefault && (f.base64.test(this.typeDefault) ? f.base64.decode( this.typeDefault, @@ -1378,9 +1378,9 @@ let protobuf; }), (u.d = function (n, r, e, s) { return ( - "function" == typeof r + 'function' == typeof r ? (r = f.decorateType(r).name) - : r && "object" == typeof r && (r = f.decorateEnum(r).name), + : r && 'object' == typeof r && (r = f.decorateEnum(r).name), function (t, i) { f.decorateType(t.constructor).add( new u(i, n, r, e, { default: s }) @@ -1397,10 +1397,10 @@ let protobuf; 16: [ function (t, i, n) { var r = (i.exports = t(17)); - (r.build = "light"), + (r.build = 'light'), (r.load = function (t, i, n) { return (i = - "function" == typeof i + 'function' == typeof i ? ((n = i), new r.Root()) : i || new r.Root()).load(t, n); }), @@ -1458,7 +1458,7 @@ let protobuf; function e() { r.util.r(), r.Writer.r(r.BufferWriter), r.Reader.r(r.BufferReader); } - (r.build = "minimal"), + (r.build = 'minimal'), (r.Writer = t(38)), (r.BufferWriter = t(39)), (r.Reader = t(24)), @@ -1477,12 +1477,12 @@ let protobuf; var u = t(15), r = ((((s.prototype = Object.create(u.prototype)).constructor = - s).className = "MapField"), + s).className = 'MapField'), t(32)), o = t(33); function s(t, i, n, r, e, s) { if ((u.call(this, t, i, r, g, g, e, s), !o.isString(n))) - throw TypeError("keyType must be a string"); + throw TypeError('keyType must be a string'); (this.keyType = n), (this.resolvedKeyType = null), (this.map = !0); } (s.fromJSON = function (t, i) { @@ -1491,31 +1491,31 @@ let protobuf; (s.prototype.toJSON = function (t) { t = !!t && !!t.keepComments; return o.toObject([ - "keyType", + 'keyType', this.keyType, - "type", + 'type', this.type, - "id", + 'id', this.id, - "extend", + 'extend', this.extend, - "options", + 'options', this.options, - "comment", + 'comment', t ? this.comment : g, ]); }), (s.prototype.resolve = function () { if (this.resolved) return this; if (r.mapKey[this.keyType] === g) - throw Error("invalid key type: " + this.keyType); + throw Error('invalid key type: ' + this.keyType); return u.prototype.resolve.call(this); }), (s.d = function (n, r, e) { return ( - "function" == typeof e + 'function' == typeof e ? (e = o.decorateType(e).name) - : e && "object" == typeof e && (e = o.decorateEnum(e).name), + : e && 'object' == typeof e && (e = o.decorateEnum(e).name), function (t, i) { o.decorateType(t.constructor).add(new s(i, n, r, e)); } @@ -1569,7 +1569,7 @@ let protobuf; var f = t(22), c = ((((r.prototype = Object.create(f.prototype)).constructor = - r).className = "Method"), + r).className = 'Method'), t(33)); function r(t, i, n, r, e, s, u, o, h) { if ( @@ -1578,12 +1578,12 @@ let protobuf; : c.isObject(s) && ((u = s), (s = g)), i !== g && !c.isString(i)) ) - throw TypeError("type must be a string"); - if (!c.isString(n)) throw TypeError("requestType must be a string"); + throw TypeError('type must be a string'); + if (!c.isString(n)) throw TypeError('requestType must be a string'); if (!c.isString(r)) - throw TypeError("responseType must be a string"); + throw TypeError('responseType must be a string'); f.call(this, t, u), - (this.type = i || "rpc"), + (this.type = i || 'rpc'), (this.requestType = n), (this.requestStream = !!e || g), (this.responseType = r), @@ -1609,21 +1609,21 @@ let protobuf; (r.prototype.toJSON = function (t) { t = !!t && !!t.keepComments; return c.toObject([ - "type", - ("rpc" !== this.type && this.type) || g, - "requestType", + 'type', + ('rpc' !== this.type && this.type) || g, + 'requestType', this.requestType, - "requestStream", + 'requestStream', this.requestStream, - "responseType", + 'responseType', this.responseType, - "responseStream", + 'responseStream', this.responseStream, - "options", + 'options', this.options, - "comment", + 'comment', t ? this.comment : g, - "parsedOptions", + 'parsedOptions', this.parsedOptions, ]); }), @@ -1650,7 +1650,7 @@ let protobuf; r = t(22), o = ((((a.prototype = Object.create(r.prototype)).constructor = - a).className = "Namespace"), + a).className = 'Namespace'), t(15)), h = t(33), f = t(23); @@ -1673,7 +1673,7 @@ let protobuf; (a.isReservedId = function (t, i) { if (t) for (var n = 0; n < t.length; ++n) - if ("string" != typeof t[n] && t[n][0] <= i && t[n][1] > i) + if ('string' != typeof t[n] && t[n][0] <= i && t[n][1] > i) return !0; return !1; }), @@ -1682,16 +1682,16 @@ let protobuf; for (var n = 0; n < t.length; ++n) if (t[n] === i) return !0; return !1; }), - Object.defineProperty(a.prototype, "nestedArray", { + Object.defineProperty(a.prototype, 'nestedArray', { get: function () { return this.e || (this.e = h.toArray(this.nested)); }, }), (a.prototype.toJSON = function (t) { return h.toObject([ - "options", + 'options', this.options, - "nested", + 'nested', c(this.nestedArray, t), ]); }), @@ -1719,7 +1719,7 @@ let protobuf; (a.prototype.getEnum = function (t) { if (this.nested && this.nested[t] instanceof u) return this.nested[t].values; - throw Error("no such enum: " + t); + throw Error('no such enum: ' + t); }), (a.prototype.add = function (t) { if ( @@ -1732,7 +1732,7 @@ let protobuf; t instanceof a ) ) - throw TypeError("object must be a valid nested object"); + throw TypeError('object must be a valid nested object'); if (this.nested) { var i = this.get(t.name); if (i) { @@ -1753,9 +1753,9 @@ let protobuf; }), (a.prototype.remove = function (t) { if (!(t instanceof r)) - throw TypeError("object must be a ReflectionObject"); + throw TypeError('object must be a ReflectionObject'); if (t.parent !== this) - throw Error(t + " is not a member of " + this); + throw Error(t + ' is not a member of ' + this); return ( delete this.nested[t.name], Object.keys(this.nested).length || (this.nested = g), @@ -1764,15 +1764,15 @@ let protobuf; ); }), (a.prototype.define = function (t, i) { - if (h.isString(t)) t = t.split("."); - else if (!Array.isArray(t)) throw TypeError("illegal path"); - if (t && t.length && "" === t[0]) - throw Error("path must be relative"); + if (h.isString(t)) t = t.split('.'); + else if (!Array.isArray(t)) throw TypeError('illegal path'); + if (t && t.length && '' === t[0]) + throw Error('path must be relative'); for (var n = this; 0 < t.length; ) { var r = t.shift(); if (n.nested && n.nested[r]) { if (!((n = n.nested[r]) instanceof a)) - throw Error("path conflicts with non-namespace objects"); + throw Error('path conflicts with non-namespace objects'); } else n.add((n = new a(r))); } return i && n.addJSON(i), n; @@ -1784,15 +1784,15 @@ let protobuf; }), (a.prototype.lookup = function (t, i, n) { if ( - ("boolean" == typeof i + ('boolean' == typeof i ? ((n = i), (i = g)) : i && !Array.isArray(i) && (i = [i]), h.isString(t) && t.length) ) { - if ("." === t) return this.root; - t = t.split("."); + if ('.' === t) return this.root; + t = t.split('.'); } else if (!t.length) return this; - if ("" === t[0]) return this.root.lookup(t.slice(1), i); + if ('' === t[0]) return this.root.lookup(t.slice(1), i); var r = this.get(t[0]); if (r) { if (1 === t.length) { @@ -1813,7 +1813,7 @@ let protobuf; (a.prototype.lookupType = function (t) { var i = this.lookup(t, [e]); if (i) return i; - throw Error("no such type: " + t); + throw Error('no such type: ' + t); }), (a.prototype.lookupEnum = function (t) { var i = this.lookup(t, [u]); @@ -1838,13 +1838,13 @@ let protobuf; ], 22: [ function (t, i, n) { - (i.exports = e).className = "ReflectionObject"; + (i.exports = e).className = 'ReflectionObject'; var r, u = t(33); function e(t, i) { - if (!u.isString(t)) throw TypeError("name must be a string"); + if (!u.isString(t)) throw TypeError('name must be a string'); if (i && !u.isObject(i)) - throw TypeError("options must be an object"); + throw TypeError('options must be an object'); (this.options = i), (this.parsedOptions = null), (this.name = t), @@ -1864,7 +1864,7 @@ let protobuf; get: function () { for (var t = [this.name], i = this.parent; i; ) t.unshift(i.name), (i = i.parent); - return t.join("."); + return t.join('.'); }, }, }), @@ -1926,7 +1926,7 @@ let protobuf; (e.prototype.toString = function () { var t = this.constructor.className, i = this.fullName; - return i.length ? t + " " + i : t; + return i.length ? t + ' ' + i : t; }), (e.r = function (t) { r = t; @@ -1940,7 +1940,7 @@ let protobuf; var e = t(22), r = ((((u.prototype = Object.create(e.prototype)).constructor = - u).className = "OneOf"), + u).className = 'OneOf'), t(15)), s = t(33); function u(t, i, n, r) { @@ -1949,7 +1949,7 @@ let protobuf; e.call(this, t, n), i !== g && !Array.isArray(i)) ) - throw TypeError("fieldNames must be an Array"); + throw TypeError('fieldNames must be an Array'); (this.oneof = i || []), (this.fieldsArray = []), (this.comment = r); } function o(t) { @@ -1963,11 +1963,11 @@ let protobuf; (u.prototype.toJSON = function (t) { t = !!t && !!t.keepComments; return s.toObject([ - "options", + 'options', this.options, - "oneof", + 'oneof', this.oneof, - "comment", + 'comment', t ? this.comment : g, ]); }), @@ -1980,12 +1980,12 @@ let protobuf; o((t.partOf = this)), this ); - throw TypeError("field must be a Field"); + throw TypeError('field must be a Field'); }), (u.prototype.remove = function (t) { - if (!(t instanceof r)) throw TypeError("field must be a Field"); + if (!(t instanceof r)) throw TypeError('field must be a Field'); var i = this.fieldsArray.indexOf(t); - if (i < 0) throw Error(t + " is not a member of " + this); + if (i < 0) throw Error(t + ' is not a member of ' + this); return ( this.fieldsArray.splice(i, 1), -1 < (i = this.oneof.indexOf(t.name)) && @@ -2034,7 +2034,7 @@ let protobuf; u = e.utf8; function o(t, i) { return RangeError( - "index out of range: " + t.pos + " + " + (i || 1) + " > " + t.len + 'index out of range: ' + t.pos + ' + ' + (i || 1) + ' > ' + t.len ); } function h(t) { @@ -2051,15 +2051,15 @@ let protobuf; } var c, a = - "undefined" != typeof Uint8Array + 'undefined' != typeof Uint8Array ? function (t) { if (t instanceof Uint8Array || Array.isArray(t)) return new h(t); - throw Error("illegal buffer"); + throw Error('illegal buffer'); } : function (t) { if (Array.isArray(t)) return new h(t); - throw Error("illegal buffer"); + throw Error('illegal buffer'); }; function l() { var t = new s(0, 0), @@ -2111,7 +2111,7 @@ let protobuf; ) return t; } - throw Error("invalid varint encoding"); + throw Error('invalid varint encoding'); } function d(t, i) { return ( @@ -2198,7 +2198,7 @@ let protobuf; return u.read(t, 0, t.length); }), (h.prototype.skip = function (t) { - if ("number" == typeof t) { + if ('number' == typeof t) { if (this.pos + t > this.len) throw o(this, t); this.pos += t; } else @@ -2226,14 +2226,14 @@ let protobuf; break; default: throw Error( - "invalid wire type " + t + " at offset " + this.pos + 'invalid wire type ' + t + ' at offset ' + this.pos ); } return this; }), (h.r = function (t) { (r = t), (h.create = f()), r.r(); - var i = e.Long ? "toLong" : "toNumber"; + var i = e.Long ? 'toLong' : 'toNumber'; e.merge(h.prototype, { int64: function () { return l.call(this)[i](!1); @@ -2276,7 +2276,7 @@ let protobuf; (this.pos = Math.min(this.pos + t, this.len)) ) : this.buf.toString( - "utf-8", + 'utf-8', this.pos, (this.pos = Math.min(this.pos + t, this.len)) ); @@ -2294,13 +2294,13 @@ let protobuf; e = t(21), s = ((((h.prototype = Object.create(e.prototype)).constructor = - h).className = "Root"), + h).className = 'Root'), t(15)), u = t(14), o = t(23), b = t(33); function h(t) { - e.call(this, "", t), (this.deferred = []), (this.files = []); + e.call(this, '', t), (this.deferred = []), (this.files = []); } function p() {} (h.fromJSON = function (t, i) { @@ -2313,7 +2313,7 @@ let protobuf; (h.prototype.resolvePath = b.path.resolve), (h.prototype.fetch = b.fetch), (h.prototype.load = function t(i, s, e) { - "function" == typeof s && ((e = s), (s = g)); + 'function' == typeof s && ((e = s), (s = g)); var u = this; if (!e) return b.asPromise(t, u, i, s); var o = e === p; @@ -2325,7 +2325,7 @@ let protobuf; } } function f(t) { - var i = t.lastIndexOf("google/protobuf/"); + var i = t.lastIndexOf('google/protobuf/'); if (-1 < i) { t = t.substring(i); if (t in v) return t; @@ -2336,7 +2336,7 @@ let protobuf; try { if ( (b.isString(i) && - "{" == (i[0] || "") && + '{' == (i[0] || '') && (i = JSON.parse(i)), b.isString(i)) ) { @@ -2372,7 +2372,7 @@ let protobuf; else if (o) { var t; try { - t = b.fs.readFileSync(n).toString("utf8"); + t = b.fs.readFileSync(n).toString('utf8'); } catch (t) { return void (r || h(t)); } @@ -2386,24 +2386,24 @@ let protobuf; var l = 0; b.isString(i) && (i = [i]); for (var n, r = 0; r < i.length; ++r) - (n = u.resolvePath("", i[r])) && a(n); + (n = u.resolvePath('', i[r])) && a(n); return o ? u : (l || h(null, u), g); }), (h.prototype.loadSync = function (t, i) { if (b.isNode) return this.load(t, i, p); - throw Error("not supported"); + throw Error('not supported'); }), (h.prototype.resolveAll = function () { if (this.deferred.length) throw Error( - "unresolvable extensions: " + + 'unresolvable extensions: ' + this.deferred .map(function (t) { return ( "'extend " + t.extend + "' in " + t.parent.fullName ); }) - .join(", ") + .join(', ') ); return e.prototype.resolveAll.call(this); }); @@ -2480,8 +2480,8 @@ let protobuf; i.exports = r; var o = t(35); function r(t, i, n) { - if ("function" != typeof t) - throw TypeError("rpcImpl must be a function"); + if ('function' != typeof t) + throw TypeError('rpcImpl must be a function'); o.EventEmitter.call(this), (this.rpcImpl = t), (this.requestDelimited = !!i), @@ -2490,40 +2490,40 @@ let protobuf; (((r.prototype = Object.create( o.EventEmitter.prototype )).constructor = r).prototype.rpcCall = function t(n, i, r, e, s) { - if (!e) throw TypeError("request must be specified"); + if (!e) throw TypeError('request must be specified'); var u = this; if (!s) return o.asPromise(t, u, n, i, r, e); if (!u.rpcImpl) return ( setTimeout(function () { - s(Error("already ended")); + s(Error('already ended')); }, 0), g ); try { return u.rpcImpl( n, - i[u.requestDelimited ? "encodeDelimited" : "encode"]( + i[u.requestDelimited ? 'encodeDelimited' : 'encode']( e ).finish(), function (t, i) { - if (t) return u.emit("error", t, n), s(t); + if (t) return u.emit('error', t, n), s(t); if (null === i) return u.end(!0), g; if (!(i instanceof r)) try { i = - r[u.responseDelimited ? "decodeDelimited" : "decode"]( + r[u.responseDelimited ? 'decodeDelimited' : 'decode']( i ); } catch (t) { - return u.emit("error", t, n), s(t); + return u.emit('error', t, n), s(t); } - return u.emit("data", i, n), s(null, i); + return u.emit('data', i, n), s(null, i); } ); } catch (t) { return ( - u.emit("error", t, n), + u.emit('error', t, n), setTimeout(function () { s(t); }, 0), @@ -2536,7 +2536,7 @@ let protobuf; this.rpcImpl && (t || this.rpcImpl(null, null, null), (this.rpcImpl = null), - this.emit("end").off()), + this.emit('end').off()), this ); }); @@ -2549,7 +2549,7 @@ let protobuf; var r = t(21), s = ((((u.prototype = Object.create(r.prototype)).constructor = - u).className = "Service"), + u).className = 'Service'), t(20)), o = t(33), h = t(28); @@ -2570,17 +2570,17 @@ let protobuf; var i = r.prototype.toJSON.call(this, t), n = !!t && !!t.keepComments; return o.toObject([ - "options", + 'options', (i && i.options) || g, - "methods", + 'methods', r.arrayToJSON(this.methodsArray, t) || {}, - "nested", + 'nested', (i && i.nested) || g, - "comment", + 'comment', n ? this.comment : g, ]); }), - Object.defineProperty(u.prototype, "methodsArray", { + Object.defineProperty(u.prototype, 'methodsArray', { get: function () { return this.f || (this.f = o.toArray(this.methods)); }, @@ -2603,7 +2603,7 @@ let protobuf; (u.prototype.remove = function (t) { if (t instanceof s) { if (this.methods[t.name] !== t) - throw Error(t + " is not a member of " + this); + throw Error(t + ' is not a member of ' + this); return delete this.methods[t.name], (t.parent = null), e(this); } return r.prototype.remove.call(this, t); @@ -2616,11 +2616,11 @@ let protobuf; ) { var u = o .lcFirst((r = this.f[s]).resolve().name) - .replace(/[^$\w_]/g, ""); + .replace(/[^$\w_]/g, ''); e[u] = o.codegen( - ["r", "c"], - o.isReserved(u) ? u + "_" : u - )("return this.rpcCall(m,q,s,r,c)")({ + ['r', 'c'], + o.isReserved(u) ? u + '_' : u + )('return this.rpcCall(m,q,s,r,c)')({ m: r, q: r.resolvedRequestType.ctor, s: r.resolvedResponseType.ctor, @@ -2637,7 +2637,7 @@ let protobuf; var u = t(21), o = ((((w.prototype = Object.create(u.prototype)).constructor = - w).className = "Type"), + w).className = 'Type'), t(14)), h = t(23), f = t(15), @@ -2686,7 +2686,7 @@ let protobuf; var n = this.fields[t[i]], r = n.id; if (this.c[r]) - throw Error("duplicate id " + r + " in " + this); + throw Error('duplicate id ' + r + ' in ' + this); this.c[r] = n; } } @@ -2733,16 +2733,16 @@ let protobuf; }), (w.generateConstructor = function (t) { for ( - var i, n = d.codegen(["p"], t.name), r = 0; + var i, n = d.codegen(['p'], t.name), r = 0; r < t.fieldsArray.length; ++r ) (i = t.i[r]).map - ? n("this%s={}", d.safeProp(i.name)) - : i.repeated && n("this%s=[]", d.safeProp(i.name)); + ? n('this%s={}', d.safeProp(i.name)) + : i.repeated && n('this%s=[]', d.safeProp(i.name)); return n( - "if(p)for(var ks=Object.keys(p),i=0;i>> 0; + var i = (t = e.isString(t) ? e.v(t, 'base64') : t).length >>> 0; return ( this.uint32(i), i && this.p(s.writeBytesBuffer, i, t), this ); @@ -3882,16 +3882,16 @@ let protobuf; ); })(); !(function (t, e) { - "object" == typeof exports && "undefined" != typeof module + 'object' == typeof exports && 'undefined' != typeof module ? e(exports) - : "function" == typeof define && define.amd - ? define(["exports"], e) + : 'function' == typeof define && define.amd + ? define(['exports'], e) : e( - ((t = "undefined" != typeof globalThis ? globalThis : t || self).pako = + ((t = 'undefined' != typeof globalThis ? globalThis : t || self).pako = {}) ); })(this, function (t) { - "use strict"; + 'use strict'; function e(t) { let e = t.length; for (; --e >= 0; ) t[e] = 0; @@ -4343,15 +4343,15 @@ let protobuf; return -1 ^ t; }, H = { - 2: "need dictionary", - 1: "stream end", - 0: "", - "-1": "file error", - "-2": "stream error", - "-3": "data error", - "-4": "insufficient memory", - "-5": "buffer error", - "-6": "incompatible version", + 2: 'need dictionary', + 1: 'stream end', + 0: '', + '-1': 'file error', + '-2': 'stream error', + '-3': 'data error', + '-4': 'insufficient memory', + '-5': 'buffer error', + '-6': 'incompatible version', }, j = { Z_NO_FLUSH: 0, @@ -5222,7 +5222,7 @@ let protobuf; $ ); }, - deflateInfo: "pako deflate (from Nodeca project)", + deflateInfo: 'pako deflate (from Nodeca project)', }; const Nt = (t, e) => Object.prototype.hasOwnProperty.call(t, e); var Bt = function (t) { @@ -5230,8 +5230,8 @@ let protobuf; for (; e.length; ) { const a = e.shift(); if (a) { - if ("object" != typeof a) - throw new TypeError(a + "must be non-object"); + if ('object' != typeof a) + throw new TypeError(a + 'must be non-object'); for (const e in a) Nt(a, e) && (t[e] = a[e]); } } @@ -5269,7 +5269,7 @@ let protobuf; : 1; Ht[254] = Ht[254] = 1; var jt = (t) => { - if ("function" == typeof TextEncoder && TextEncoder.prototype.encode) + if ('function' == typeof TextEncoder && TextEncoder.prototype.encode) return new TextEncoder().encode(t); let e, a, @@ -5309,7 +5309,7 @@ let protobuf; }, Kt = (t, e) => { const a = e || t.length; - if ("function" == typeof TextDecoder && TextDecoder.prototype.decode) + if ('function' == typeof TextDecoder && TextDecoder.prototype.decode) return new TextDecoder().decode(t.subarray(0, e)); let i, n; const s = new Array(2 * a); @@ -5339,7 +5339,7 @@ let protobuf; null, t.length === e ? t : t.subarray(0, e) ); - let a = ""; + let a = ''; for (let i = 0; i < e; i++) a += String.fromCharCode(t[i]); return a; })(s, n); @@ -5359,7 +5359,7 @@ let protobuf; (this.next_out = 0), (this.avail_out = 0), (this.total_out = 0), - (this.msg = ""), + (this.msg = ''), (this.state = null), (this.data_type = 2), (this.adler = 0); @@ -5393,7 +5393,7 @@ let protobuf; ? (e.windowBits = -e.windowBits) : e.gzip && e.windowBits > 0 && e.windowBits < 16 && (e.windowBits += 16), (this.err = 0), - (this.msg = ""), + (this.msg = ''), (this.ended = !1), (this.chunks = []), (this.strm = new Yt()), @@ -5411,9 +5411,9 @@ let protobuf; let t; if ( ((t = - "string" == typeof e.dictionary + 'string' == typeof e.dictionary ? jt(e.dictionary) - : "[object ArrayBuffer]" === Gt.call(e.dictionary) + : '[object ArrayBuffer]' === Gt.call(e.dictionary) ? new Uint8Array(e.dictionary) : e.dictionary), (a = Lt.deflateSetDictionary(this.strm, t)), @@ -5435,9 +5435,9 @@ let protobuf; if (this.ended) return !1; for ( s = e === ~~e ? e : !0 === e ? Jt : Xt, - "string" == typeof t + 'string' == typeof t ? (a.input = jt(t)) - : "[object ArrayBuffer]" === Gt.call(t) + : '[object ArrayBuffer]' === Gt.call(t) ? (a.input = new Uint8Array(t)) : (a.input = t), a.next_in = 0, @@ -5531,7 +5531,7 @@ let protobuf; E.mode = 12; break t; } - (t.msg = "invalid literal/length code"), (E.mode = 30); + (t.msg = 'invalid literal/length code'), (E.mode = 30); break t; } (k = 65535 & p), @@ -5556,7 +5556,7 @@ let protobuf; p = w[(65535 & p) + (f & ((1 << m) - 1))]; continue a; } - (t.msg = "invalid distance code"), (E.mode = 30); + (t.msg = 'invalid distance code'), (E.mode = 30); break t; } if ( @@ -5569,12 +5569,12 @@ let protobuf; (v += f & ((1 << m) - 1)), v > l) ) { - (t.msg = "invalid distance too far back"), (E.mode = 30); + (t.msg = 'invalid distance too far back'), (E.mode = 30); break t; } if (((f >>>= m), (c -= m), (m = n - s), v > m)) { if (((m = v - m), m > h && E.sane)) { - (t.msg = "invalid distance too far back"), (E.mode = 30); + (t.msg = 'invalid distance too far back'), (E.mode = 30); break t; } if (((y = 0), (x = _), 0 === d)) { @@ -5808,7 +5808,7 @@ let protobuf; const e = t.state; return ( (t.total_in = t.total_out = e.total = 0), - (t.msg = ""), + (t.msg = ''), e.wrap && (t.adler = 1 & e.wrap), (e.mode = 1), (e.last = 0), @@ -5969,17 +5969,17 @@ let protobuf; a.head && (a.head.done = !1), !(1 & a.wrap) || (((255 & h) << 8) + (h >> 8)) % 31) ) { - (t.msg = "incorrect header check"), (a.mode = ze); + (t.msg = 'incorrect header check'), (a.mode = ze); break; } if ((15 & h) !== ye) { - (t.msg = "unknown compression method"), (a.mode = ze); + (t.msg = 'unknown compression method'), (a.mode = ze); break; } if (((h >>>= 4), (d -= 4), (y = 8 + (15 & h)), 0 === a.wbits)) a.wbits = y; else if (y > a.wbits) { - (t.msg = "invalid window size"), (a.mode = ze); + (t.msg = 'invalid window size'), (a.mode = ze); break; } (a.dmax = 1 << a.wbits), @@ -5994,11 +5994,11 @@ let protobuf; l--, (h += i[s++] << d), (d += 8); } if (((a.flags = h), (255 & a.flags) !== ye)) { - (t.msg = "unknown compression method"), (a.mode = ze); + (t.msg = 'unknown compression method'), (a.mode = ze); break; } if (57344 & a.flags) { - (t.msg = "unknown header flags set"), (a.mode = ze); + (t.msg = 'unknown header flags set'), (a.mode = ze); break; } a.head && (a.head.text = (h >> 8) & 1), @@ -6119,7 +6119,7 @@ let protobuf; l--, (h += i[s++] << d), (d += 8); } if (h !== (65535 & a.check)) { - (t.msg = "header crc mismatch"), (a.mode = ze); + (t.msg = 'header crc mismatch'), (a.mode = ze); break; } (h = 0), (d = 0); @@ -6171,7 +6171,7 @@ let protobuf; a.mode = 17; break; case 3: - (t.msg = "invalid block type"), (a.mode = ze); + (t.msg = 'invalid block type'), (a.mode = ze); } (h >>>= 2), (d -= 2); break; @@ -6181,7 +6181,7 @@ let protobuf; l--, (h += i[s++] << d), (d += 8); } if ((65535 & h) != ((h >>> 16) ^ 65535)) { - (t.msg = "invalid stored block lengths"), (a.mode = ze); + (t.msg = 'invalid stored block lengths'), (a.mode = ze); break; } if ( @@ -6224,7 +6224,7 @@ let protobuf; (d -= 4), a.nlen > 286 || a.ndist > 30) ) { - (t.msg = "too many length or distance symbols"), (a.mode = ze); + (t.msg = 'too many length or distance symbols'), (a.mode = ze); break; } (a.have = 0), (a.mode = 18); @@ -6245,7 +6245,7 @@ let protobuf; (a.lenbits = E.bits), x) ) { - (t.msg = "invalid code lengths set"), (a.mode = ze); + (t.msg = 'invalid code lengths set'), (a.mode = ze); break; } (a.have = 0), (a.mode = 19); @@ -6271,7 +6271,7 @@ let protobuf; l--, (h += i[s++] << d), (d += 8); } if (((h >>>= b), (d -= b), 0 === a.have)) { - (t.msg = "invalid bit length repeat"), (a.mode = ze); + (t.msg = 'invalid bit length repeat'), (a.mode = ze); break; } (y = a.lens[a.have - 1]), @@ -6302,7 +6302,7 @@ let protobuf; (d -= 7); } if (a.have + c > a.nlen + a.ndist) { - (t.msg = "invalid bit length repeat"), (a.mode = ze); + (t.msg = 'invalid bit length repeat'), (a.mode = ze); break; } for (; c--; ) a.lens[a.have++] = y; @@ -6310,7 +6310,7 @@ let protobuf; } if (a.mode === ze) break; if (0 === a.lens[256]) { - (t.msg = "invalid code -- missing end-of-block"), (a.mode = ze); + (t.msg = 'invalid code -- missing end-of-block'), (a.mode = ze); break; } if ( @@ -6320,7 +6320,7 @@ let protobuf; (a.lenbits = E.bits), x) ) { - (t.msg = "invalid literal/lengths set"), (a.mode = ze); + (t.msg = 'invalid literal/lengths set'), (a.mode = ze); break; } if ( @@ -6331,7 +6331,7 @@ let protobuf; (a.distbits = E.bits), x) ) { - (t.msg = "invalid distances set"), (a.mode = ze); + (t.msg = 'invalid distances set'), (a.mode = ze); break; } if (((a.mode = 20), e === ue)) break t; @@ -6395,7 +6395,7 @@ let protobuf; break; } if (64 & g) { - (t.msg = "invalid literal/length code"), (a.mode = ze); + (t.msg = 'invalid literal/length code'), (a.mode = ze); break; } (a.extra = 15 & g), (a.mode = 22); @@ -6440,7 +6440,7 @@ let protobuf; (h >>>= m), (d -= m), (a.back += m); } if (((h >>>= b), (d -= b), (a.back += b), 64 & g)) { - (t.msg = "invalid distance code"), (a.mode = ze); + (t.msg = 'invalid distance code'), (a.mode = ze); break; } (a.offset = p), (a.extra = 15 & g), (a.mode = 24); @@ -6456,7 +6456,7 @@ let protobuf; (a.back += a.extra); } if (a.offset > a.dmax) { - (t.msg = "invalid distance too far back"), (a.mode = ze); + (t.msg = 'invalid distance too far back'), (a.mode = ze); break; } a.mode = 25; @@ -6464,7 +6464,7 @@ let protobuf; if (0 === o) break t; if (((c = f - o), a.offset > c)) { if (((c = a.offset - c), c > a.whave && a.sane)) { - (t.msg = "invalid distance too far back"), (a.mode = ze); + (t.msg = 'invalid distance too far back'), (a.mode = ze); break; } c > a.wnext @@ -6501,7 +6501,7 @@ let protobuf; (f = o), (a.flags ? h : Ae(h)) !== a.check) ) { - (t.msg = "incorrect data check"), (a.mode = ze); + (t.msg = 'incorrect data check'), (a.mode = ze); break; } (h = 0), (d = 0); @@ -6514,7 +6514,7 @@ let protobuf; l--, (h += i[s++] << d), (d += 8); } if (h !== (4294967295 & a.total)) { - (t.msg = "incorrect length check"), (a.mode = ze); + (t.msg = 'incorrect length check'), (a.mode = ze); break; } (h = 0), (d = 0); @@ -6585,7 +6585,7 @@ let protobuf; s ? ((i.mode = 31), ke) : ((i.havedict = 1), we))) : pe; }, - inflateInfo: "pako inflate (from Nodeca project)", + inflateInfo: 'pako inflate (from Nodeca project)', }; var Ne = function () { (this.text = 0), @@ -6594,8 +6594,8 @@ let protobuf; (this.os = 0), (this.extra = null), (this.extra_len = 0), - (this.name = ""), - (this.comment = ""), + (this.name = ''), + (this.comment = ''), (this.hcrc = 0), (this.done = !1); }; @@ -6611,7 +6611,7 @@ let protobuf; Z_MEM_ERROR: Ge, } = j; function Xe(t) { - this.options = Bt({ chunkSize: 65536, windowBits: 15, to: "" }, t || {}); + this.options = Bt({ chunkSize: 65536, windowBits: 15, to: '' }, t || {}); const e = this.options; e.raw && e.windowBits >= 0 && @@ -6626,7 +6626,7 @@ let protobuf; 0 == (15 & e.windowBits) && (e.windowBits |= 15), (this.err = 0), - (this.msg = ""), + (this.msg = ''), (this.ended = !1), (this.chunks = []), (this.strm = new Yt()), @@ -6637,9 +6637,9 @@ let protobuf; ((this.header = new Ne()), Le.inflateGetHeader(this.strm, this.header), e.dictionary && - ("string" == typeof e.dictionary + ('string' == typeof e.dictionary ? (e.dictionary = jt(e.dictionary)) - : "[object ArrayBuffer]" === Be.call(e.dictionary) && + : '[object ArrayBuffer]' === Be.call(e.dictionary) && (e.dictionary = new Uint8Array(e.dictionary)), e.raw && ((a = Le.inflateSetDictionary(this.strm, e.dictionary)), a !== He))) @@ -6659,7 +6659,7 @@ let protobuf; if (this.ended) return !1; for ( r = e === ~~e ? e : !0 === e ? Me : Ce, - "[object ArrayBuffer]" === Be.call(t) + '[object ArrayBuffer]' === Be.call(t) ? (a.input = new Uint8Array(t)) : (a.input = t), a.next_in = 0, @@ -6687,7 +6687,7 @@ let protobuf; return this.onEnd(s), (this.ended = !0), !1; } if (((l = a.avail_out), a.next_out && (0 === a.avail_out || s === je))) - if ("string" === this.options.to) { + if ('string' === this.options.to) { let t = Pt(a.output, a.next_out), e = a.next_out - t, n = Kt(a.output, t); @@ -6716,8 +6716,8 @@ let protobuf; }), (Xe.prototype.onEnd = function (t) { t === He && - ("string" === this.options.to - ? (this.result = this.chunks.join("")) + ('string' === this.options.to + ? (this.result = this.chunks.join('')) : (this.result = Ct(this.chunks))), (this.chunks = []), (this.err = t), @@ -6764,7 +6764,7 @@ let protobuf; (t.inflate = ha), (t.inflateRaw = da), (t.ungzip = _a), - Object.defineProperty(t, "__esModule", { value: !0 }); + Object.defineProperty(t, '__esModule', { value: !0 }); }); const biliJson = { nested: { @@ -6773,27 +6773,27 @@ const biliJson = { ad: { nested: { v1: { - options: { java_package: "com.smile.bilibili.model" }, + options: { java_package: 'com.smile.bilibili.model' }, nested: { AdDto: { fields: { - creativeId: { type: "int64", id: 1 }, - adCb: { type: "string", id: 2 }, - cmMark: { type: "int32", id: 4 }, - topViewId: { type: "int64", id: 5 }, - creativeType: { type: "int32", id: 6 }, - cardType: { type: "int32", id: 7 }, - creativeStyle: { type: "int32", id: 8 }, - isAd: { type: "bool", id: 9 }, + creativeId: { type: 'int64', id: 1 }, + adCb: { type: 'string', id: 2 }, + cmMark: { type: 'int32', id: 4 }, + topViewId: { type: 'int64', id: 5 }, + creativeType: { type: 'int32', id: 6 }, + cardType: { type: 'int32', id: 7 }, + creativeStyle: { type: 'int32', id: 8 }, + isAd: { type: 'bool', id: 9 }, }, }, SourceContentDto: { - fields: { adContent: { type: "AdDto", id: 9 } }, + fields: { adContent: { type: 'AdDto', id: 9 } }, }, AdsControlDto: { fields: { - hasDanmu: { type: "int32", id: 1 }, - cids: { rule: "repeated", type: "int64", id: 2 }, + hasDanmu: { type: 'int32', id: 1 }, + cids: { rule: 'repeated', type: 'int64', id: 2 }, }, }, }, @@ -6805,113 +6805,113 @@ const biliJson = { archive: { nested: { v1: { - options: { java_package: "com.smile.bilibili.model" }, + options: { java_package: 'com.smile.bilibili.model' }, nested: { Arc: { fields: { - aid: { type: "int64", id: 1 }, - videos: { type: "int64", id: 2 }, - typeId: { type: "int32", id: 3 }, - typeName: { type: "string", id: 4 }, - copyright: { type: "int32", id: 5 }, - pic: { type: "string", id: 6 }, - title: { type: "string", id: 7 }, - pubdate: { type: "int64", id: 8 }, - ctime: { type: "int64", id: 9 }, - desc: { type: "string", id: 10 }, - state: { type: "int32", id: 11 }, - access: { type: "int32", id: 12 }, - attribute: { type: "int32", id: 13 }, - tag: { type: "string", id: 14 }, - tags: { rule: "repeated", type: "string", id: 15 }, - duration: { type: "int64", id: 16 }, - missionId: { type: "int64", id: 17 }, - orderId: { type: "int64", id: 18 }, - redirectUrl: { type: "string", id: 19 }, - forward: { type: "int64", id: 20 }, - rights: { type: "Rights", id: 21 }, - author: { type: "Author", id: 22 }, - stat: { type: "Stat", id: 23 }, - reportResult: { type: "string", id: 24 }, - dynamic: { type: "string", id: 25 }, - firstCid: { type: "int64", id: 26 }, - dimension: { type: "Dimension", id: 27 }, + aid: { type: 'int64', id: 1 }, + videos: { type: 'int64', id: 2 }, + typeId: { type: 'int32', id: 3 }, + typeName: { type: 'string', id: 4 }, + copyright: { type: 'int32', id: 5 }, + pic: { type: 'string', id: 6 }, + title: { type: 'string', id: 7 }, + pubdate: { type: 'int64', id: 8 }, + ctime: { type: 'int64', id: 9 }, + desc: { type: 'string', id: 10 }, + state: { type: 'int32', id: 11 }, + access: { type: 'int32', id: 12 }, + attribute: { type: 'int32', id: 13 }, + tag: { type: 'string', id: 14 }, + tags: { rule: 'repeated', type: 'string', id: 15 }, + duration: { type: 'int64', id: 16 }, + missionId: { type: 'int64', id: 17 }, + orderId: { type: 'int64', id: 18 }, + redirectUrl: { type: 'string', id: 19 }, + forward: { type: 'int64', id: 20 }, + rights: { type: 'Rights', id: 21 }, + author: { type: 'Author', id: 22 }, + stat: { type: 'Stat', id: 23 }, + reportResult: { type: 'string', id: 24 }, + dynamic: { type: 'string', id: 25 }, + firstCid: { type: 'int64', id: 26 }, + dimension: { type: 'Dimension', id: 27 }, staffInfo: { - rule: "repeated", - type: "StaffInfo", + rule: 'repeated', + type: 'StaffInfo', id: 28, }, - seasonId: { type: "int64", id: 29 }, - attributeV2: { type: "int64", id: 30 }, - shortLinkV2: { type: "string", id: 40 }, - upFromV2: { type: "int32", id: 41 }, - firstFrame: { type: "string", id: 42 }, + seasonId: { type: 'int64', id: 29 }, + attributeV2: { type: 'int64', id: 30 }, + shortLinkV2: { type: 'string', id: 40 }, + upFromV2: { type: 'int32', id: 41 }, + firstFrame: { type: 'string', id: 42 }, }, }, Rights: { fields: { - bp: { type: "int32", id: 1 }, - elec: { type: "int32", id: 2 }, - download: { type: "int32", id: 3 }, - movie: { type: "int32", id: 4 }, - pay: { type: "int32", id: 5 }, - hd5: { type: "int32", id: 6 }, - noReprint: { type: "int32", id: 7 }, - autoplay: { type: "int32", id: 8 }, - ugcPay: { type: "int32", id: 9 }, - isCooperation: { type: "int32", id: 10 }, - ugcPayPreview: { type: "int32", id: 11 }, - noBackground: { type: "int32", id: 12 }, + bp: { type: 'int32', id: 1 }, + elec: { type: 'int32', id: 2 }, + download: { type: 'int32', id: 3 }, + movie: { type: 'int32', id: 4 }, + pay: { type: 'int32', id: 5 }, + hd5: { type: 'int32', id: 6 }, + noReprint: { type: 'int32', id: 7 }, + autoplay: { type: 'int32', id: 8 }, + ugcPay: { type: 'int32', id: 9 }, + isCooperation: { type: 'int32', id: 10 }, + ugcPayPreview: { type: 'int32', id: 11 }, + noBackground: { type: 'int32', id: 12 }, }, }, Author: { fields: { - mid: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - face: { type: "string", id: 3 }, + mid: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + face: { type: 'string', id: 3 }, }, }, Stat: { fields: { - aid: { type: "int64", id: 1 }, - view: { type: "int32", id: 2 }, - danmaku: { type: "int32", id: 3 }, - reply: { type: "int32", id: 4 }, - fav: { type: "int32", id: 5 }, - coin: { type: "int32", id: 6 }, - share: { type: "int32", id: 7 }, - nowRank: { type: "int32", id: 8 }, - hisRank: { type: "int32", id: 9 }, - like: { type: "int32", id: 10 }, - dislike: { type: "int32", id: 11 }, + aid: { type: 'int64', id: 1 }, + view: { type: 'int32', id: 2 }, + danmaku: { type: 'int32', id: 3 }, + reply: { type: 'int32', id: 4 }, + fav: { type: 'int32', id: 5 }, + coin: { type: 'int32', id: 6 }, + share: { type: 'int32', id: 7 }, + nowRank: { type: 'int32', id: 8 }, + hisRank: { type: 'int32', id: 9 }, + like: { type: 'int32', id: 10 }, + dislike: { type: 'int32', id: 11 }, }, }, StaffInfo: { fields: { - mid: { type: "int64", id: 1 }, - title: { type: "string", id: 2 }, - attribute: { type: "int64", id: 3 }, + mid: { type: 'int64', id: 1 }, + title: { type: 'string', id: 2 }, + attribute: { type: 'int64', id: 3 }, }, }, Dimension: { fields: { - width: { type: "int64", id: 1 }, - height: { type: "int64", id: 2 }, - rotate: { type: "int64", id: 3 }, + width: { type: 'int64', id: 1 }, + height: { type: 'int64', id: 2 }, + rotate: { type: 'int64', id: 3 }, }, }, Page: { fields: { - cid: { type: "int64", id: 1 }, - page: { type: "int32", id: 2 }, - from: { type: "string", id: 3 }, - part: { type: "string", id: 4 }, - duration: { type: "int64", id: 5 }, - vid: { type: "string", id: 6 }, - desc: { type: "string", id: 7 }, - webLink: { type: "string", id: 8 }, - dimension: { type: "Dimension", id: 9 }, - firstFrame: { type: "string", id: 10 }, + cid: { type: 'int64', id: 1 }, + page: { type: 'int32', id: 2 }, + from: { type: 'string', id: 3 }, + part: { type: 'string', id: 4 }, + duration: { type: 'int64', id: 5 }, + vid: { type: 'string', id: 6 }, + desc: { type: 'string', id: 7 }, + webLink: { type: 'string', id: 8 }, + dimension: { type: 'Dimension', id: 9 }, + firstFrame: { type: 'string', id: 10 }, }, }, }, @@ -6921,17 +6921,17 @@ const biliJson = { dynamic: { nested: { v2: { - options: { java_package: "com.smile.bilibili.model" }, + options: { java_package: 'com.smile.bilibili.model' }, nested: { AdditionalButton: { fields: { - type: { type: "AddButtonType", id: 1 }, - jumpStyle: { type: "AdditionalButtonStyle", id: 2 }, - jumpUrl: { type: "string", id: 3 }, - uncheck: { type: "AdditionalButtonStyle", id: 4 }, - check: { type: "AdditionalButtonStyle", id: 5 }, - status: { type: "AdditionalButtonStatus", id: 6 }, - clickType: { type: "AdditionalButtonClickType", id: 7 }, + type: { type: 'AddButtonType', id: 1 }, + jumpStyle: { type: 'AdditionalButtonStyle', id: 2 }, + jumpUrl: { type: 'string', id: 3 }, + uncheck: { type: 'AdditionalButtonStyle', id: 4 }, + check: { type: 'AdditionalButtonStyle', id: 5 }, + status: { type: 'AdditionalButtonStatus', id: 6 }, + clickType: { type: 'AdditionalButtonClickType', id: 7 }, }, }, AddButtonType: { @@ -6945,24 +6945,24 @@ const biliJson = { }, AdditionalButtonInteractive: { fields: { - popups: { type: "string", id: 1 }, - confirm: { type: "string", id: 2 }, - cancel: { type: "string", id: 3 }, - desc: { type: "string", id: 4 }, + popups: { type: 'string', id: 1 }, + confirm: { type: 'string', id: 2 }, + cancel: { type: 'string', id: 3 }, + desc: { type: 'string', id: 4 }, }, }, AdditionalButtonStyle: { fields: { - icon: { type: "string", id: 1 }, - text: { type: "string", id: 2 }, + icon: { type: 'string', id: 1 }, + text: { type: 'string', id: 2 }, interactive: { - type: "AdditionalButtonInteractive", + type: 'AdditionalButtonInteractive', id: 3, }, - bgStyle: { type: "AddButtonBgStyle", id: 4 }, - toast: { type: "string", id: 5 }, - disable: { type: "DisableState", id: 6 }, - share: { type: "AdditionalButtonShare", id: 7 }, + bgStyle: { type: 'AddButtonBgStyle', id: 4 }, + toast: { type: 'string', id: 5 }, + disable: { type: 'DisableState', id: 6 }, + share: { type: 'AdditionalButtonShare', id: 7 }, }, }, AddButtonBgStyle: { @@ -6971,9 +6971,9 @@ const biliJson = { DisableState: { values: { highlight: 0, gary: 1 } }, AdditionalButtonShare: { fields: { - show: { type: "AdditionalShareShowType", id: 1 }, - icon: { type: "string", id: 2 }, - text: { type: "string", id: 3 }, + show: { type: 'AdditionalShareShowType', id: 1 }, + icon: { type: 'string', id: 2 }, + text: { type: 'string', id: 3 }, }, }, AdditionalShareShowType: { @@ -6981,16 +6981,16 @@ const biliJson = { }, AdditionalPGC: { fields: { - headText: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - imageUrl: { type: "string", id: 3 }, - descText1: { type: "string", id: 4 }, - descText2: { type: "string", id: 5 }, - url: { type: "string", id: 6 }, - button: { type: "AdditionalButton", id: 7 }, - headIcon: { type: "string", id: 8 }, - style: { type: "ImageStyle", id: 9 }, - type: { type: "string", id: 10 }, + headText: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + imageUrl: { type: 'string', id: 3 }, + descText1: { type: 'string', id: 4 }, + descText2: { type: 'string', id: 5 }, + url: { type: 'string', id: 6 }, + button: { type: 'AdditionalButton', id: 7 }, + headIcon: { type: 'string', id: 8 }, + style: { type: 'ImageStyle', id: 9 }, + type: { type: 'string', id: 10 }, }, }, ImageStyle: { @@ -7011,87 +7011,87 @@ const biliJson = { }, AdditionCommon: { fields: { - headText: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - imageUrl: { type: "string", id: 3 }, - descText1: { type: "string", id: 4 }, - descText2: { type: "string", id: 5 }, - url: { type: "string", id: 6 }, - button: { type: "AdditionalButton", id: 7 }, - headIcon: { type: "string", id: 8 }, - style: { type: "ImageStyle", id: 9 }, - type: { type: "string", id: 10 }, - cardType: { type: "string", id: 11 }, + headText: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + imageUrl: { type: 'string', id: 3 }, + descText1: { type: 'string', id: 4 }, + descText2: { type: 'string', id: 5 }, + url: { type: 'string', id: 6 }, + button: { type: 'AdditionalButton', id: 7 }, + headIcon: { type: 'string', id: 8 }, + style: { type: 'ImageStyle', id: 9 }, + type: { type: 'string', id: 10 }, + cardType: { type: 'string', id: 11 }, }, }, AdditionEsport: { - oneofs: { item: { oneof: ["additionEsportMoba"] } }, + oneofs: { item: { oneof: ['additionEsportMoba'] } }, fields: { - style: { type: "EspaceStyle", id: 1 }, + style: { type: 'EspaceStyle', id: 1 }, additionEsportMoba: { - type: "AdditionEsportMoba", + type: 'AdditionEsportMoba', id: 2, }, - type: { type: "string", id: 3 }, - cardType: { type: "string", id: 4 }, + type: { type: 'string', id: 3 }, + cardType: { type: 'string', id: 4 }, }, }, AdditionEsportMoba: { fields: { - headText: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + headText: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, matchTeam: { - rule: "repeated", - type: "MatchTeam", + rule: 'repeated', + type: 'MatchTeam', id: 3, }, additionEsportMobaStatus: { - type: "AdditionEsportMobaStatus", + type: 'AdditionEsportMobaStatus', id: 4, }, - uri: { type: "string", id: 5 }, - button: { type: "AdditionalButton", id: 6 }, - subTitle: { type: "string", id: 7 }, - type: { type: "string", id: 10 }, - cardType: { type: "string", id: 11 }, - headIcon: { type: "string", id: 12 }, + uri: { type: 'string', id: 5 }, + button: { type: 'AdditionalButton', id: 6 }, + subTitle: { type: 'string', id: 7 }, + type: { type: 'string', id: 10 }, + cardType: { type: 'string', id: 11 }, + headIcon: { type: 'string', id: 12 }, }, }, AdditionEsportMobaStatus: { fields: { additionEsportMobaStatusDesc: { - rule: "repeated", - type: "AdditionEsportMobaStatusDesc", + rule: 'repeated', + type: 'AdditionEsportMobaStatusDesc', id: 1, }, - title: { type: "string", id: 2 }, - status: { type: "int32", id: 3 }, - color: { type: "string", id: 4 }, - nightColor: { type: "string", id: 5 }, + title: { type: 'string', id: 2 }, + status: { type: 'int32', id: 3 }, + color: { type: 'string', id: 4 }, + nightColor: { type: 'string', id: 5 }, }, }, AdditionEsportMobaStatusDesc: { fields: { - title: { type: "string", id: 1 }, - color: { type: "string", id: 2 }, - nightColor: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + color: { type: 'string', id: 2 }, + nightColor: { type: 'string', id: 3 }, }, }, AdditionGoods: { fields: { - rcmdDesc: { type: "string", id: 1 }, + rcmdDesc: { type: 'string', id: 1 }, goodsItems: { - rule: "repeated", - type: "GoodsItem", + rule: 'repeated', + type: 'GoodsItem', id: 2, }, - cardType: { type: "string", id: 3 }, - icon: { type: "string", id: 4 }, - uri: { type: "string", id: 5 }, - sourceType: { type: "int32", id: 6 }, - jumpType: { type: "GoodsJumpType", id: 7 }, - appName: { type: "string", id: 8 }, - adMarkIcon: { type: "string", id: 9 }, + cardType: { type: 'string', id: 3 }, + icon: { type: 'string', id: 4 }, + uri: { type: 'string', id: 5 }, + sourceType: { type: 'int32', id: 6 }, + jumpType: { type: 'GoodsJumpType', id: 7 }, + appName: { type: 'string', id: 8 }, + adMarkIcon: { type: 'string', id: 9 }, }, }, GoodsJumpType: { @@ -7099,41 +7099,41 @@ const biliJson = { }, AdditionUgc: { fields: { - headText: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - cover: { type: "string", id: 3 }, - descText1: { type: "string", id: 4 }, - descText2: { type: "string", id: 5 }, - uri: { type: "string", id: 6 }, - duration: { type: "string", id: 7 }, - lineFeed: { type: "bool", id: 8 }, - cardType: { type: "string", id: 9 }, + headText: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + cover: { type: 'string', id: 3 }, + descText1: { type: 'string', id: 4 }, + descText2: { type: 'string', id: 5 }, + uri: { type: 'string', id: 6 }, + duration: { type: 'string', id: 7 }, + lineFeed: { type: 'bool', id: 8 }, + cardType: { type: 'string', id: 9 }, }, }, AdditionUP: { fields: { - title: { type: "string", id: 1 }, - descText1: { type: "HighlightText", id: 2 }, - descText2: { type: "string", id: 3 }, - url: { type: "string", id: 4 }, - button: { type: "AdditionalButton", id: 5 }, - cardType: { type: "string", id: 6 }, - reserveTotal: { type: "int64", id: 7 }, - actSkin: { type: "AdditionalActSkin", id: 8 }, - rid: { type: "int64", id: 9 }, + title: { type: 'string', id: 1 }, + descText1: { type: 'HighlightText', id: 2 }, + descText2: { type: 'string', id: 3 }, + url: { type: 'string', id: 4 }, + button: { type: 'AdditionalButton', id: 5 }, + cardType: { type: 'string', id: 6 }, + reserveTotal: { type: 'int64', id: 7 }, + actSkin: { type: 'AdditionalActSkin', id: 8 }, + rid: { type: 'int64', id: 9 }, lotteryType: { - type: "ReserveRelationLotteryType", + type: 'ReserveRelationLotteryType', id: 10, }, - descText3: { type: "HighlightText", id: 11 }, - upMid: { type: "int64", id: 12 }, - userInfo: { type: "AdditionUserInfo", id: 13 }, - dynamicId: { type: "string", id: 14 }, - showText2: { type: "bool", id: 15 }, - dynType: { type: "int64", id: 16 }, - businessId: { type: "string", id: 17 }, - badgeText: { type: "string", id: 18 }, - isPremiere: { type: "bool", id: 19 }, + descText3: { type: 'HighlightText', id: 11 }, + upMid: { type: 'int64', id: 12 }, + userInfo: { type: 'AdditionUserInfo', id: 13 }, + dynamicId: { type: 'string', id: 14 }, + showText2: { type: 'bool', id: 15 }, + dynType: { type: 'int64', id: 16 }, + businessId: { type: 'string', id: 17 }, + badgeText: { type: 'string', id: 18 }, + isPremiere: { type: 'bool', id: 19 }, }, }, ReserveRelationLotteryType: { @@ -7144,85 +7144,85 @@ const biliJson = { }, AdditionalActSkin: { fields: { - svga: { type: "string", id: 1 }, - lastImage: { type: "string", id: 2 }, - playTimes: { type: "int64", id: 3 }, + svga: { type: 'string', id: 1 }, + lastImage: { type: 'string', id: 2 }, + playTimes: { type: 'int64', id: 3 }, }, }, AdditionUserInfo: { fields: { - name: { type: "string", id: 1 }, - face: { type: "string", id: 2 }, + name: { type: 'string', id: 1 }, + face: { type: 'string', id: 2 }, }, }, AdditionVote: { fields: { - imageUrl: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - text1: { type: "string", id: 3 }, - buttonText: { type: "string", id: 4 }, - url: { type: "string", id: 5 }, + imageUrl: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + text1: { type: 'string', id: 3 }, + buttonText: { type: 'string', id: 4 }, + url: { type: 'string', id: 5 }, }, }, AdditionVote2: { oneofs: { item: { oneof: [ - "additionVoteWord", - "additionVotePic", - "additionVoteDefaule", + 'additionVoteWord', + 'additionVotePic', + 'additionVoteDefaule', ], }, }, fields: { - additionVoteType: { type: "AdditionVoteType", id: 1 }, - voteId: { type: "int64", id: 2 }, - title: { type: "string", id: 3 }, - label: { type: "string", id: 4 }, - deadline: { type: "int64", id: 5 }, - openText: { type: "string", id: 6 }, - closeText: { type: "string", id: 7 }, - votedText: { type: "string", id: 8 }, - state: { type: "AdditionVoteState", id: 9 }, - additionVoteWord: { type: "AdditionVoteWord", id: 10 }, - additionVotePic: { type: "AdditionVotePic", id: 11 }, + additionVoteType: { type: 'AdditionVoteType', id: 1 }, + voteId: { type: 'int64', id: 2 }, + title: { type: 'string', id: 3 }, + label: { type: 'string', id: 4 }, + deadline: { type: 'int64', id: 5 }, + openText: { type: 'string', id: 6 }, + closeText: { type: 'string', id: 7 }, + votedText: { type: 'string', id: 8 }, + state: { type: 'AdditionVoteState', id: 9 }, + additionVoteWord: { type: 'AdditionVoteWord', id: 10 }, + additionVotePic: { type: 'AdditionVotePic', id: 11 }, additionVoteDefaule: { - type: "AdditionVoteDefaule", + type: 'AdditionVoteDefaule', id: 12, }, - bizType: { type: "int32", id: 13 }, - total: { type: "int64", id: 14 }, - cardType: { type: "string", id: 15 }, - tips: { type: "string", id: 16 }, - uri: { type: "string", id: 17 }, - isVoted: { type: "bool", id: 18 }, - choiceCnt: { type: "int32", id: 19 }, - defauleSelectShare: { type: "bool", id: 20 }, + bizType: { type: 'int32', id: 13 }, + total: { type: 'int64', id: 14 }, + cardType: { type: 'string', id: 15 }, + tips: { type: 'string', id: 16 }, + uri: { type: 'string', id: 17 }, + isVoted: { type: 'bool', id: 18 }, + choiceCnt: { type: 'int32', id: 19 }, + defauleSelectShare: { type: 'bool', id: 20 }, }, }, AdditionVoteDefaule: { fields: { - cover: { rule: "repeated", type: "string", id: 1 }, + cover: { rule: 'repeated', type: 'string', id: 1 }, }, }, AdditionVotePic: { fields: { item: { - rule: "repeated", - type: "AdditionVotePicItem", + rule: 'repeated', + type: 'AdditionVotePicItem', id: 1, }, }, }, AdditionVotePicItem: { fields: { - optIdx: { type: "int32", id: 1 }, - cover: { type: "string", id: 2 }, - isVote: { type: "bool", id: 3 }, - total: { type: "int32", id: 4 }, - persent: { type: "double", id: 5 }, - title: { type: "string", id: 6 }, - isMaxOption: { type: "bool", id: 7 }, + optIdx: { type: 'int32', id: 1 }, + cover: { type: 'string', id: 2 }, + isVote: { type: 'bool', id: 3 }, + total: { type: 'int32', id: 4 }, + persent: { type: 'double', id: 5 }, + title: { type: 'string', id: 6 }, + isMaxOption: { type: 'bool', id: 7 }, }, }, AdditionVoteState: { @@ -7243,77 +7243,77 @@ const biliJson = { AdditionVoteWord: { fields: { item: { - rule: "repeated", - type: "AdditionVoteWordItem", + rule: 'repeated', + type: 'AdditionVoteWordItem', id: 1, }, }, }, AdditionVoteWordItem: { fields: { - optIdx: { type: "int32", id: 1 }, - title: { type: "string", id: 2 }, - isVote: { type: "bool", id: 3 }, - total: { type: "int32", id: 4 }, - persent: { type: "double", id: 5 }, - isMaxOption: { type: "bool", id: 6 }, + optIdx: { type: 'int32', id: 1 }, + title: { type: 'string', id: 2 }, + isVote: { type: 'bool', id: 3 }, + total: { type: 'int32', id: 4 }, + persent: { type: 'double', id: 5 }, + isMaxOption: { type: 'bool', id: 6 }, }, }, CardVideoUpList: { fields: { - title: { type: "string", id: 1 }, - list: { rule: "repeated", type: "UpListItem", id: 2 }, - footprint: { type: "string", id: 3 }, - showLiveNum: { type: "int32", id: 4 }, - moreLabel: { type: "UpListMoreLabel", id: 5 }, - titleSwitch: { type: "int32", id: 6 }, - showMoreLabel: { type: "bool", id: 7 }, - showInPersonal: { type: "bool", id: 8 }, - showMoreButton: { type: "bool", id: 9 }, + title: { type: 'string', id: 1 }, + list: { rule: 'repeated', type: 'UpListItem', id: 2 }, + footprint: { type: 'string', id: 3 }, + showLiveNum: { type: 'int32', id: 4 }, + moreLabel: { type: 'UpListMoreLabel', id: 5 }, + titleSwitch: { type: 'int32', id: 6 }, + showMoreLabel: { type: 'bool', id: 7 }, + showInPersonal: { type: 'bool', id: 8 }, + showMoreButton: { type: 'bool', id: 9 }, }, }, CmtShowItem: { fields: { - uid: { type: "int64", id: 1 }, - uname: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, - comment: { type: "string", id: 4 }, + uid: { type: 'int64', id: 1 }, + uname: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, + comment: { type: 'string', id: 4 }, }, }, DecoCardFan: { fields: { - isFan: { type: "int32", id: 1 }, - number: { type: "int32", id: 2 }, - numberStr: { type: "string", id: 3 }, - color: { type: "string", id: 4 }, + isFan: { type: 'int32', id: 1 }, + number: { type: 'int32', id: 2 }, + numberStr: { type: 'string', id: 3 }, + color: { type: 'string', id: 4 }, }, }, DecorateCard: { fields: { - id: { type: "int64", id: 1 }, - cardUrl: { type: "string", id: 2 }, - jumpUrl: { type: "string", id: 3 }, - fan: { type: "DecoCardFan", id: 4 }, + id: { type: 'int64', id: 1 }, + cardUrl: { type: 'string', id: 2 }, + jumpUrl: { type: 'string', id: 3 }, + fan: { type: 'DecoCardFan', id: 4 }, }, }, Description: { fields: { - text: { type: "string", id: 1 }, - type: { type: "DescType", id: 2 }, - uri: { type: "string", id: 3 }, - emojiType: { type: "EmojiType", id: 4 }, - goodsType: { type: "string", id: 5 }, - iconUrl: { type: "string", id: 6 }, - iconName: { type: "string", id: 7 }, - rid: { type: "string", id: 8 }, - goods: { type: "ModuleDescGoods", id: 9 }, - origText: { type: "string", id: 10 }, - emojiSize: { type: "int32", id: 11 }, - emojiSizeSpec: { type: "EmojiSizeSpec", id: 12 }, + text: { type: 'string', id: 1 }, + type: { type: 'DescType', id: 2 }, + uri: { type: 'string', id: 3 }, + emojiType: { type: 'EmojiType', id: 4 }, + goodsType: { type: 'string', id: 5 }, + iconUrl: { type: 'string', id: 6 }, + iconName: { type: 'string', id: 7 }, + rid: { type: 'string', id: 8 }, + goods: { type: 'ModuleDescGoods', id: 9 }, + origText: { type: 'string', id: 10 }, + emojiSize: { type: 'int32', id: 11 }, + emojiSizeSpec: { type: 'EmojiSizeSpec', id: 12 }, }, }, EmojiSizeSpec: { - fields: { width: { type: "int64", id: 1 } }, + fields: { width: { type: 'int64', id: 1 } }, }, EmojiType: { values: { @@ -7348,94 +7348,94 @@ const biliJson = { }, Dimension: { fields: { - height: { type: "int64", id: 1 }, - width: { type: "int64", id: 2 }, - rotate: { type: "int64", id: 3 }, - forceHorizontal: { type: "bool", id: 4 }, + height: { type: 'int64', id: 1 }, + width: { type: 'int64', id: 2 }, + rotate: { type: 'int64', id: 3 }, + forceHorizontal: { type: 'bool', id: 4 }, }, }, DynAllReply: { fields: { - dynamicList: { type: "DynamicList", id: 1 }, - upList: { type: "CardVideoUpList", id: 2 }, - topicList: { type: "TopicList", id: 3 }, - unfollow: { type: "Unfollow", id: 4 }, - regionRcmd: { type: "DynRegionRcmd", id: 5 }, - config: { type: "Config", id: 6 }, + dynamicList: { type: 'DynamicList', id: 1 }, + upList: { type: 'CardVideoUpList', id: 2 }, + topicList: { type: 'TopicList', id: 3 }, + unfollow: { type: 'Unfollow', id: 4 }, + regionRcmd: { type: 'DynRegionRcmd', id: 5 }, + config: { type: 'Config', id: 6 }, }, }, Config: { fields: { - storyVerticalExp: { type: "bool", id: 1 }, - detailViewBits: { type: "int64", id: 2 }, + storyVerticalExp: { type: 'bool', id: 1 }, + detailViewBits: { type: 'int64', id: 2 }, }, }, DynRegionRcmd: { fields: { items: { - rule: "repeated", - type: "DynRegionRcmdItem", + rule: 'repeated', + type: 'DynRegionRcmdItem', id: 1, }, - opts: { type: "RcmdOption", id: 2 }, + opts: { type: 'RcmdOption', id: 2 }, }, }, RcmdOption: { - fields: { showTitle: { type: "bool", id: 1 } }, + fields: { showTitle: { type: 'bool', id: 1 } }, }, DynRegionRcmdItem: { fields: { - rid: { type: "int64", id: 1 }, - title: { type: "string", id: 2 }, - items: { rule: "repeated", type: "ModuleRcmd", id: 3 }, + rid: { type: 'int64', id: 1 }, + title: { type: 'string', id: 2 }, + items: { rule: 'repeated', type: 'ModuleRcmd', id: 3 }, }, }, ModuleRcmd: { fields: { - author: { type: "RcmdAuthor", id: 1 }, - items: { rule: "repeated", type: "RcmdItem", id: 2 }, - serverInfo: { type: "string", id: 3 }, + author: { type: 'RcmdAuthor', id: 1 }, + items: { rule: 'repeated', type: 'RcmdItem', id: 2 }, + serverInfo: { type: 'string', id: 3 }, }, }, RcmdAuthor: { fields: { - author: { type: "UserInfo", id: 1 }, - desc: { type: "string", id: 2 }, - relation: { type: "Relation", id: 3 }, + author: { type: 'UserInfo', id: 1 }, + desc: { type: 'string', id: 2 }, + relation: { type: 'Relation', id: 3 }, }, }, RcmdItem: { - oneofs: { item: { oneof: ["rcmdArchive"] } }, + oneofs: { item: { oneof: ['rcmdArchive'] } }, fields: { - type: { type: "RcmdType", id: 1 }, - rcmdArchive: { type: "RcmdArchive", id: 2 }, + type: { type: 'RcmdType', id: 1 }, + rcmdArchive: { type: 'RcmdArchive', id: 2 }, }, }, RcmdArchive: { fields: { - title: { type: "string", id: 1 }, - cover: { type: "string", id: 2 }, - coverLeftIcon1: { type: "CoverIcon", id: 3 }, - coverLeftText1: { type: "string", id: 4 }, - uri: { type: "string", id: 5 }, - isPgc: { type: "bool", id: 6 }, - aid: { type: "int64", id: 7 }, - badge: { type: "IconBadge", id: 8 }, - coverLeftIcon2: { type: "CoverIcon", id: 9 }, - coverLeftText2: { type: "string", id: 10 }, - coverLeftIcon3: { type: "CoverIcon", id: 11 }, - coverLeftText3: { type: "string", id: 12 }, - desc: { type: "string", id: 13 }, - trackId: { type: "string", id: 14 }, - rcmdReason: { type: "RcmdReason", id: 15 }, + title: { type: 'string', id: 1 }, + cover: { type: 'string', id: 2 }, + coverLeftIcon1: { type: 'CoverIcon', id: 3 }, + coverLeftText1: { type: 'string', id: 4 }, + uri: { type: 'string', id: 5 }, + isPgc: { type: 'bool', id: 6 }, + aid: { type: 'int64', id: 7 }, + badge: { type: 'IconBadge', id: 8 }, + coverLeftIcon2: { type: 'CoverIcon', id: 9 }, + coverLeftText2: { type: 'string', id: 10 }, + coverLeftIcon3: { type: 'CoverIcon', id: 11 }, + coverLeftText3: { type: 'string', id: 12 }, + desc: { type: 'string', id: 13 }, + trackId: { type: 'string', id: 14 }, + rcmdReason: { type: 'RcmdReason', id: 15 }, }, }, RcmdReason: { fields: { - campusName: { type: "string", id: 1 }, - style: { type: "RcmdReasonStyle", id: 2 }, - rcmdReason: { type: "string", id: 3 }, - upName: { type: "string", id: 4 }, + campusName: { type: 'string', id: 1 }, + style: { type: 'RcmdReasonStyle', id: 2 }, + rcmdReason: { type: 'string', id: 3 }, + upName: { type: 'string', id: 4 }, }, }, RcmdReasonStyle: { @@ -7456,19 +7456,19 @@ const biliJson = { }, IconBadge: { fields: { - iconBgUrl: { type: "string", id: 1 }, - text: { type: "string", id: 2 }, + iconBgUrl: { type: 'string', id: 1 }, + text: { type: 'string', id: 2 }, }, }, RcmdType: { values: { rcmd_archive: 0, rcmd_dynamic: 1 } }, DynamicItem: { fields: { - cardType: { type: "DynamicType", id: 1 }, - itemType: { type: "DynamicType", id: 2 }, - modules: { rule: "repeated", type: "Module", id: 3 }, - extend: { type: "Extend", id: 4 }, - hasFold: { type: "int32", id: 5 }, - serverInfo: { type: "string", id: 6 }, + cardType: { type: 'DynamicType', id: 1 }, + itemType: { type: 'DynamicType', id: 2 }, + modules: { rule: 'repeated', type: 'Module', id: 3 }, + extend: { type: 'Extend', id: 4 }, + hasFold: { type: 'int32', id: 5 }, + serverInfo: { type: 'string', id: 6 }, }, }, DynamicType: { @@ -7504,11 +7504,11 @@ const biliJson = { }, DynamicList: { fields: { - list: { rule: "repeated", type: "DynamicItem", id: 1 }, - updateNum: { type: "int64", id: 2 }, - historyOffset: { type: "string", id: 3 }, - updateBaseline: { type: "string", id: 4 }, - hasMore: { type: "bool", id: 5 }, + list: { rule: 'repeated', type: 'DynamicItem', id: 1 }, + updateNum: { type: 'int64', id: 2 }, + historyOffset: { type: 'string', id: 3 }, + updateBaseline: { type: 'string', id: 4 }, + hasMore: { type: 'bool', id: 5 }, }, }, DynExtendType: { @@ -7565,128 +7565,128 @@ const biliJson = { EspaceStyle: { values: { moba: 0 } }, Extend: { fields: { - dynIdStr: { type: "string", id: 1 }, - businessId: { type: "string", id: 2 }, - origDynIdStr: { type: "string", id: 3 }, - origName: { type: "string", id: 4 }, - origImgUrl: { type: "string", id: 5 }, + dynIdStr: { type: 'string', id: 1 }, + businessId: { type: 'string', id: 2 }, + origDynIdStr: { type: 'string', id: 3 }, + origName: { type: 'string', id: 4 }, + origImgUrl: { type: 'string', id: 5 }, origDesc: { - rule: "repeated", - type: "Description", + rule: 'repeated', + type: 'Description', id: 6, }, - desc: { rule: "repeated", type: "Description", id: 7 }, - origDynType: { type: "DynamicType", id: 8 }, - shareType: { type: "string", id: 9 }, - shareScene: { type: "string", id: 10 }, - isFastShare: { type: "bool", id: 11 }, - rType: { type: "int32", id: 12 }, - dynType: { type: "int64", id: 13 }, - uid: { type: "int64", id: 14 }, - cardUrl: { type: "string", id: 15 }, - sourceContent: { type: "google.protobuf.Any", id: 16 }, - origFace: { type: "string", id: 17 }, - reply: { type: "ExtendReply", id: 18 }, - trackId: { type: "string", id: 19 }, - opusSummary: { type: "ModuleOpusSummary", id: 20 }, - onlyFansProperty: { type: "OnlyFansProperty", id: 21 }, - featureGate: { type: "DynFeatureGate", id: 22 }, - isInAudit: { type: "bool", id: 23 }, + desc: { rule: 'repeated', type: 'Description', id: 7 }, + origDynType: { type: 'DynamicType', id: 8 }, + shareType: { type: 'string', id: 9 }, + shareScene: { type: 'string', id: 10 }, + isFastShare: { type: 'bool', id: 11 }, + rType: { type: 'int32', id: 12 }, + dynType: { type: 'int64', id: 13 }, + uid: { type: 'int64', id: 14 }, + cardUrl: { type: 'string', id: 15 }, + sourceContent: { type: 'google.protobuf.Any', id: 16 }, + origFace: { type: 'string', id: 17 }, + reply: { type: 'ExtendReply', id: 18 }, + trackId: { type: 'string', id: 19 }, + opusSummary: { type: 'ModuleOpusSummary', id: 20 }, + onlyFansProperty: { type: 'OnlyFansProperty', id: 21 }, + featureGate: { type: 'DynFeatureGate', id: 22 }, + isInAudit: { type: 'bool', id: 23 }, }, }, ExtendReply: { fields: { - uri: { type: "string", id: 1 }, + uri: { type: 'string', id: 1 }, params: { - rule: "repeated", - type: "ExtendReplyParam", + rule: 'repeated', + type: 'ExtendReplyParam', id: 2, }, }, }, ExtendReplyParam: { fields: { - key: { type: "string", id: 1 }, - value: { type: "string", id: 2 }, + key: { type: 'string', id: 1 }, + value: { type: 'string', id: 2 }, }, }, ExtInfoCommon: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, - poiType: { type: "int32", id: 4 }, - type: { type: "DynExtendType", id: 5 }, - subModule: { type: "string", id: 6 }, - actionText: { type: "string", id: 7 }, - actionUrl: { type: "string", id: 8 }, - rid: { type: "int64", id: 9 }, - isShowLight: { type: "bool", id: 10 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, + poiType: { type: 'int32', id: 4 }, + type: { type: 'DynExtendType', id: 5 }, + subModule: { type: 'string', id: 6 }, + actionText: { type: 'string', id: 7 }, + actionUrl: { type: 'string', id: 8 }, + rid: { type: 'int64', id: 9 }, + isShowLight: { type: 'bool', id: 10 }, }, }, ExtInfoGame: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, }, }, ExtInfoHot: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, }, }, ExtInfoLBS: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, - poiType: { type: "int32", id: 4 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, + poiType: { type: 'int32', id: 4 }, }, }, ExtInfoOGV: { fields: { - infoOgv: { rule: "repeated", type: "InfoOGV", id: 1 }, + infoOgv: { rule: 'repeated', type: 'InfoOGV', id: 1 }, }, }, ExtInfoTopic: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, }, }, GoodsItem: { fields: { - cover: { type: "string", id: 1 }, - schemaPackageName: { type: "string", id: 2 }, - sourceType: { type: "int32", id: 3 }, - jumpUrl: { type: "string", id: 4 }, - jumpDesc: { type: "string", id: 5 }, - title: { type: "string", id: 6 }, - brief: { type: "string", id: 7 }, - price: { type: "string", id: 8 }, - itemId: { type: "int64", id: 9 }, - schemaUrl: { type: "string", id: 10 }, + cover: { type: 'string', id: 1 }, + schemaPackageName: { type: 'string', id: 2 }, + sourceType: { type: 'int32', id: 3 }, + jumpUrl: { type: 'string', id: 4 }, + jumpDesc: { type: 'string', id: 5 }, + title: { type: 'string', id: 6 }, + brief: { type: 'string', id: 7 }, + price: { type: 'string', id: 8 }, + itemId: { type: 'int64', id: 9 }, + schemaUrl: { type: 'string', id: 10 }, openWhiteList: { - rule: "repeated", - type: "string", + rule: 'repeated', + type: 'string', id: 11, }, - userWebV2: { type: "bool", id: 12 }, - adMark: { type: "string", id: 13 }, - appName: { type: "string", id: 14 }, - jumpType: { type: "GoodsJumpType", id: 15 }, + userWebV2: { type: 'bool', id: 12 }, + adMark: { type: 'string', id: 13 }, + appName: { type: 'string', id: 14 }, + jumpType: { type: 'GoodsJumpType', id: 15 }, }, }, HighlightText: { fields: { - text: { type: "string", id: 1 }, - textStyle: { type: "HighlightTextStyle", id: 2 }, - jumpUrl: { type: "string", id: 3 }, - icon: { type: "string", id: 4 }, + text: { type: 'string', id: 1 }, + textStyle: { type: 'HighlightTextStyle', id: 2 }, + jumpUrl: { type: 'string', id: 3 }, + icon: { type: 'string', id: 4 }, }, }, HighlightTextStyle: { @@ -7694,30 +7694,30 @@ const biliJson = { }, InfoOGV: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, - subModule: { type: "string", id: 4 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, + subModule: { type: 'string', id: 4 }, }, }, InteractionItem: { fields: { - iconType: { type: "LocalIconType", id: 1 }, - desc: { rule: "repeated", type: "Description", id: 2 }, - uri: { type: "string", id: 3 }, - dynamicId: { type: "string", id: 4 }, - commentMid: { type: "int64", id: 6 }, + iconType: { type: 'LocalIconType', id: 1 }, + desc: { rule: 'repeated', type: 'Description', id: 2 }, + uri: { type: 'string', id: 3 }, + dynamicId: { type: 'string', id: 4 }, + commentMid: { type: 'int64', id: 6 }, faces: { - rule: "repeated", - type: "InteractionFace", + rule: 'repeated', + type: 'InteractionFace', id: 7, }, - stat: { type: "InteractionStat", id: 8 }, - icon: { type: "string", id: 9 }, - tailIcon: { type: "string", id: 10 }, + stat: { type: 'InteractionStat', id: 8 }, + icon: { type: 'string', id: 9 }, + tailIcon: { type: 'string', id: 10 }, tailDesc: { - rule: "repeated", - type: "Description", + rule: 'repeated', + type: 'Description', id: 11, }, }, @@ -7733,42 +7733,42 @@ const biliJson = { }, InteractionFace: { fields: { - mid: { type: "int64", id: 1 }, - face: { type: "string", id: 2 }, + mid: { type: 'int64', id: 1 }, + face: { type: 'string', id: 2 }, }, }, InteractionStat: { fields: { - like: { type: "int64", id: 1 }, - forward: { type: "int64", id: 2 }, + like: { type: 'int64', id: 1 }, + forward: { type: 'int64', id: 2 }, }, }, LikeAnimation: { fields: { - begin: { type: "string", id: 1 }, - proc: { type: "string", id: 2 }, - end: { type: "string", id: 3 }, - likeIconId: { type: "int64", id: 4 }, + begin: { type: 'string', id: 1 }, + proc: { type: 'string', id: 2 }, + end: { type: 'string', id: 3 }, + likeIconId: { type: 'int64', id: 4 }, }, }, LikeInfo: { fields: { - animation: { type: "LikeAnimation", id: 1 }, - isLike: { type: "bool", id: 2 }, + animation: { type: 'LikeAnimation', id: 1 }, + isLike: { type: 'bool', id: 2 }, }, }, LikeUser: { fields: { - uid: { type: "int64", id: 1 }, - uname: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, + uid: { type: 'int64', id: 1 }, + uname: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, }, }, LiveInfo: { fields: { - isLiving: { type: "int32", id: 1 }, - uri: { type: "string", id: 2 }, - liveState: { type: "LiveState", id: 3 }, + isLiving: { type: 'int32', id: 1 }, + uri: { type: 'string', id: 2 }, + liveState: { type: 'LiveState', id: 3 }, }, }, LiveState: { @@ -7776,63 +7776,63 @@ const biliJson = { }, MatchTeam: { fields: { - id: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - cover: { type: "string", id: 3 }, - color: { type: "string", id: 4 }, - nightColor: { type: "string", id: 5 }, + id: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + cover: { type: 'string', id: 3 }, + color: { type: 'string', id: 4 }, + nightColor: { type: 'string', id: 5 }, }, }, MdlDynApplet: { fields: { - id: { type: "int64", id: 1 }, - uri: { type: "string", id: 2 }, - title: { type: "string", id: 4 }, - subTitle: { type: "string", id: 5 }, - cover: { type: "string", id: 6 }, - icon: { type: "string", id: 7 }, - label: { type: "string", id: 8 }, - buttonTitle: { type: "string", id: 9 }, + id: { type: 'int64', id: 1 }, + uri: { type: 'string', id: 2 }, + title: { type: 'string', id: 4 }, + subTitle: { type: 'string', id: 5 }, + cover: { type: 'string', id: 6 }, + icon: { type: 'string', id: 7 }, + label: { type: 'string', id: 8 }, + buttonTitle: { type: 'string', id: 9 }, }, }, MdlDynArchive: { fields: { - title: { type: "string", id: 1 }, - cover: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, - coverLeftText1: { type: "string", id: 4 }, - coverLeftText2: { type: "string", id: 5 }, - coverLeftText3: { type: "string", id: 6 }, - avid: { type: "int64", id: 7 }, - cid: { type: "int64", id: 8 }, - mediaType: { type: "MediaType", id: 9 }, - dimension: { type: "Dimension", id: 10 }, - badge: { rule: "repeated", type: "VideoBadge", id: 11 }, - canPlay: { type: "bool", id: 12 }, - stype: { type: "VideoType", id: 13 }, - isPGC: { type: "bool", id: 14 }, - inlineURL: { type: "string", id: 15 }, - episodeId: { type: "int64", id: 16 }, - subType: { type: "int32", id: 17 }, - pgcSeasonId: { type: "int64", id: 18 }, - playIcon: { type: "string", id: 19 }, - duration: { type: "int64", id: 20 }, - jumpUrl: { type: "string", id: 21 }, - isPreview: { type: "bool", id: 22 }, + title: { type: 'string', id: 1 }, + cover: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, + coverLeftText1: { type: 'string', id: 4 }, + coverLeftText2: { type: 'string', id: 5 }, + coverLeftText3: { type: 'string', id: 6 }, + avid: { type: 'int64', id: 7 }, + cid: { type: 'int64', id: 8 }, + mediaType: { type: 'MediaType', id: 9 }, + dimension: { type: 'Dimension', id: 10 }, + badge: { rule: 'repeated', type: 'VideoBadge', id: 11 }, + canPlay: { type: 'bool', id: 12 }, + stype: { type: 'VideoType', id: 13 }, + isPGC: { type: 'bool', id: 14 }, + inlineURL: { type: 'string', id: 15 }, + episodeId: { type: 'int64', id: 16 }, + subType: { type: 'int32', id: 17 }, + pgcSeasonId: { type: 'int64', id: 18 }, + playIcon: { type: 'string', id: 19 }, + duration: { type: 'int64', id: 20 }, + jumpUrl: { type: 'string', id: 21 }, + isPreview: { type: 'bool', id: 22 }, badgeCategory: { - rule: "repeated", - type: "VideoBadge", + rule: 'repeated', + type: 'VideoBadge', id: 23, }, - isFeature: { type: "bool", id: 24 }, - reserveType: { type: "ReserveType", id: 25 }, - bvid: { type: "string", id: 26 }, - view: { type: "int32", id: 27 }, - showPremiereBadge: { type: "bool", id: 28 }, - premiereCard: { type: "bool", id: 29 }, - showProgress: { type: "bool", id: 30 }, - partDuration: { type: "int64", id: 31 }, - partProgress: { type: "int64", id: 32 }, + isFeature: { type: 'bool', id: 24 }, + reserveType: { type: 'ReserveType', id: 25 }, + bvid: { type: 'string', id: 26 }, + view: { type: 'int32', id: 27 }, + showPremiereBadge: { type: 'bool', id: 28 }, + premiereCard: { type: 'bool', id: 29 }, + showProgress: { type: 'bool', id: 30 }, + partDuration: { type: 'int64', id: 31 }, + partProgress: { type: 'int64', id: 32 }, }, }, MediaType: { @@ -7857,28 +7857,28 @@ const biliJson = { }, MdlDynArticle: { fields: { - id: { type: "int64", id: 1 }, - uri: { type: "string", id: 2 }, - title: { type: "string", id: 3 }, - desc: { type: "string", id: 4 }, - covers: { rule: "repeated", type: "string", id: 5 }, - label: { type: "string", id: 6 }, - templateID: { type: "int32", id: 7 }, + id: { type: 'int64', id: 1 }, + uri: { type: 'string', id: 2 }, + title: { type: 'string', id: 3 }, + desc: { type: 'string', id: 4 }, + covers: { rule: 'repeated', type: 'string', id: 5 }, + label: { type: 'string', id: 6 }, + templateID: { type: 'int32', id: 7 }, }, }, MdlDynCommon: { fields: { - oid: { type: "int64", id: 1 }, - uri: { type: "string", id: 2 }, - title: { type: "string", id: 3 }, - desc: { type: "string", id: 4 }, - cover: { type: "string", id: 5 }, - label: { type: "string", id: 6 }, - bizType: { type: "int32", id: 7 }, - sketchID: { type: "int64", id: 8 }, - style: { type: "MdlDynCommonType", id: 9 }, - badge: { rule: "repeated", type: "VideoBadge", id: 10 }, - button: { type: "AdditionalButton", id: 11 }, + oid: { type: 'int64', id: 1 }, + uri: { type: 'string', id: 2 }, + title: { type: 'string', id: 3 }, + desc: { type: 'string', id: 4 }, + cover: { type: 'string', id: 5 }, + label: { type: 'string', id: 6 }, + bizType: { type: 'int32', id: 7 }, + sketchID: { type: 'int64', id: 8 }, + style: { type: 'MdlDynCommonType', id: 9 }, + badge: { rule: 'repeated', type: 'VideoBadge', id: 10 }, + button: { type: 'AdditionalButton', id: 11 }, }, }, MdlDynCommonType: { @@ -7890,74 +7890,74 @@ const biliJson = { }, MdlDynCourBatch: { fields: { - title: { type: "string", id: 1 }, - cover: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, - text1: { type: "string", id: 4 }, - text2: { type: "string", id: 5 }, - badge: { type: "VideoBadge", id: 6 }, - playIcon: { type: "string", id: 7 }, - canPlay: { type: "bool", id: 8 }, - isPreview: { type: "bool", id: 9 }, - coverLeftText1: { type: "string", id: 10 }, - coverLeftText2: { type: "string", id: 11 }, - coverLeftText3: { type: "string", id: 12 }, - avid: { type: "int64", id: 13 }, - cid: { type: "int64", id: 14 }, - epid: { type: "int64", id: 15 }, - duration: { type: "int64", id: 16 }, - seasonId: { type: "int64", id: 17 }, + title: { type: 'string', id: 1 }, + cover: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, + text1: { type: 'string', id: 4 }, + text2: { type: 'string', id: 5 }, + badge: { type: 'VideoBadge', id: 6 }, + playIcon: { type: 'string', id: 7 }, + canPlay: { type: 'bool', id: 8 }, + isPreview: { type: 'bool', id: 9 }, + coverLeftText1: { type: 'string', id: 10 }, + coverLeftText2: { type: 'string', id: 11 }, + coverLeftText3: { type: 'string', id: 12 }, + avid: { type: 'int64', id: 13 }, + cid: { type: 'int64', id: 14 }, + epid: { type: 'int64', id: 15 }, + duration: { type: 'int64', id: 16 }, + seasonId: { type: 'int64', id: 17 }, }, }, MdlDynCourSeason: { fields: { - title: { type: "string", id: 1 }, - cover: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, - text1: { type: "string", id: 4 }, - desc: { type: "string", id: 5 }, - badge: { type: "VideoBadge", id: 6 }, - playIcon: { type: "string", id: 7 }, - canPlay: { type: "bool", id: 8 }, - isPreview: { type: "bool", id: 9 }, - avid: { type: "int64", id: 10 }, - cid: { type: "int64", id: 11 }, - epid: { type: "int64", id: 12 }, - duration: { type: "int64", id: 13 }, - seasonId: { type: "int64", id: 14 }, + title: { type: 'string', id: 1 }, + cover: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, + text1: { type: 'string', id: 4 }, + desc: { type: 'string', id: 5 }, + badge: { type: 'VideoBadge', id: 6 }, + playIcon: { type: 'string', id: 7 }, + canPlay: { type: 'bool', id: 8 }, + isPreview: { type: 'bool', id: 9 }, + avid: { type: 'int64', id: 10 }, + cid: { type: 'int64', id: 11 }, + epid: { type: 'int64', id: 12 }, + duration: { type: 'int64', id: 13 }, + seasonId: { type: 'int64', id: 14 }, }, }, MdlDynDraw: { fields: { items: { - rule: "repeated", - type: "MdlDynDrawItem", + rule: 'repeated', + type: 'MdlDynDrawItem', id: 1, }, - uri: { type: "string", id: 2 }, - id: { type: "int64", id: 3 }, - isDrawFirst: { type: "bool", id: 4 }, - isBigCover: { type: "bool", id: 5 }, - isArticleCover: { type: "bool", id: 6 }, + uri: { type: 'string', id: 2 }, + id: { type: 'int64', id: 3 }, + isDrawFirst: { type: 'bool', id: 4 }, + isBigCover: { type: 'bool', id: 5 }, + isArticleCover: { type: 'bool', id: 6 }, }, }, MdlDynDrawItem: { fields: { - src: { type: "string", id: 1 }, - width: { type: "int64", id: 2 }, - height: { type: "int64", id: 3 }, - size: { type: "float", id: 4 }, + src: { type: 'string', id: 1 }, + width: { type: 'int64', id: 2 }, + height: { type: 'int64', id: 3 }, + size: { type: 'float', id: 4 }, tags: { - rule: "repeated", - type: "MdlDynDrawTag", + rule: 'repeated', + type: 'MdlDynDrawTag', id: 5, }, }, }, MdlDynDrawTag: { fields: { - type: { type: "MdlDynDrawTagType", id: 1 }, - item: { type: "MdlDynDrawTagItem", id: 2 }, + type: { type: 'MdlDynDrawTagType', id: 1 }, + item: { type: 'MdlDynDrawTagItem', id: 2 }, }, }, MdlDynDrawTagType: { @@ -7972,103 +7972,103 @@ const biliJson = { }, MdlDynDrawTagItem: { fields: { - url: { type: "string", id: 1 }, - text: { type: "string", id: 2 }, - x: { type: "int64", id: 3 }, - y: { type: "int64", id: 4 }, - orientation: { type: "int32", id: 5 }, - source: { type: "int32", id: 6 }, - itemId: { type: "int64", id: 7 }, - mid: { type: "int64", id: 8 }, - tid: { type: "int64", id: 9 }, - poi: { type: "string", id: 10 }, - schemaUrl: { type: "string", id: 11 }, + url: { type: 'string', id: 1 }, + text: { type: 'string', id: 2 }, + x: { type: 'int64', id: 3 }, + y: { type: 'int64', id: 4 }, + orientation: { type: 'int32', id: 5 }, + source: { type: 'int32', id: 6 }, + itemId: { type: 'int64', id: 7 }, + mid: { type: 'int64', id: 8 }, + tid: { type: 'int64', id: 9 }, + poi: { type: 'string', id: 10 }, + schemaUrl: { type: 'string', id: 11 }, }, }, MdlDynForward: { fields: { - item: { type: "DynamicItem", id: 1 }, - rtype: { type: "int32", id: 2 }, + item: { type: 'DynamicItem', id: 1 }, + rtype: { type: 'int32', id: 2 }, }, }, MdlDynLive: { fields: { - id: { type: "int64", id: 1 }, - uri: { type: "string", id: 2 }, - title: { type: "string", id: 3 }, - cover: { type: "string", id: 4 }, - coverLabel: { type: "string", id: 5 }, - coverLabel2: { type: "string", id: 6 }, - liveState: { type: "LiveState", id: 7 }, - badge: { type: "VideoBadge", id: 8 }, - reserveType: { type: "ReserveType", id: 9 }, + id: { type: 'int64', id: 1 }, + uri: { type: 'string', id: 2 }, + title: { type: 'string', id: 3 }, + cover: { type: 'string', id: 4 }, + coverLabel: { type: 'string', id: 5 }, + coverLabel2: { type: 'string', id: 6 }, + liveState: { type: 'LiveState', id: 7 }, + badge: { type: 'VideoBadge', id: 8 }, + reserveType: { type: 'ReserveType', id: 9 }, }, }, MdlDynLiveRcmd: { fields: { - content: { type: "string", id: 1 }, - reserveType: { type: "ReserveType", id: 2 }, - pendant: { type: "LivePendant", id: 3 }, + content: { type: 'string', id: 1 }, + reserveType: { type: 'ReserveType', id: 2 }, + pendant: { type: 'LivePendant', id: 3 }, }, }, LivePendant: { fields: { - text: { type: "string", id: 1 }, - icon: { type: "string", id: 2 }, - pendantId: { type: "int64", id: 3 }, + text: { type: 'string', id: 1 }, + icon: { type: 'string', id: 2 }, + pendantId: { type: 'int64', id: 3 }, }, }, MdlDynMedialist: { fields: { - id: { type: "int64", id: 1 }, - uri: { type: "string", id: 2 }, - title: { type: "string", id: 3 }, - subTitle: { type: "string", id: 4 }, - cover: { type: "string", id: 5 }, - coverType: { type: "int32", id: 6 }, - badge: { type: "VideoBadge", id: 7 }, - coverBottomRightIcon: { type: "string", id: 8 }, + id: { type: 'int64', id: 1 }, + uri: { type: 'string', id: 2 }, + title: { type: 'string', id: 3 }, + subTitle: { type: 'string', id: 4 }, + cover: { type: 'string', id: 5 }, + coverType: { type: 'int32', id: 6 }, + badge: { type: 'VideoBadge', id: 7 }, + coverBottomRightIcon: { type: 'string', id: 8 }, }, }, MdlDynMusic: { fields: { - id: { type: "int64", id: 1 }, - uri: { type: "string", id: 2 }, - upId: { type: "int64", id: 3 }, - title: { type: "string", id: 4 }, - cover: { type: "string", id: 5 }, - label1: { type: "string", id: 6 }, - upper: { type: "string", id: 7 }, + id: { type: 'int64', id: 1 }, + uri: { type: 'string', id: 2 }, + upId: { type: 'int64', id: 3 }, + title: { type: 'string', id: 4 }, + cover: { type: 'string', id: 5 }, + label1: { type: 'string', id: 6 }, + upper: { type: 'string', id: 7 }, }, }, MdlDynPGC: { fields: { - title: { type: "string", id: 1 }, - cover: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, - coverLeftText1: { type: "string", id: 4 }, - coverLeftText2: { type: "string", id: 5 }, - coverLeftText3: { type: "string", id: 6 }, - cid: { type: "int64", id: 7 }, - seasonId: { type: "int64", id: 8 }, - epid: { type: "int64", id: 9 }, - aid: { type: "int64", id: 10 }, - mediaType: { type: "MediaType", id: 11 }, - subType: { type: "VideoSubType", id: 12 }, - isPreview: { type: "bool", id: 13 }, - dimension: { type: "Dimension", id: 14 }, - badge: { rule: "repeated", type: "VideoBadge", id: 15 }, - canPlay: { type: "bool", id: 16 }, - season: { type: "PGCSeason", id: 17 }, - playIcon: { type: "string", id: 18 }, - duration: { type: "int64", id: 19 }, - jumpUrl: { type: "string", id: 20 }, + title: { type: 'string', id: 1 }, + cover: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, + coverLeftText1: { type: 'string', id: 4 }, + coverLeftText2: { type: 'string', id: 5 }, + coverLeftText3: { type: 'string', id: 6 }, + cid: { type: 'int64', id: 7 }, + seasonId: { type: 'int64', id: 8 }, + epid: { type: 'int64', id: 9 }, + aid: { type: 'int64', id: 10 }, + mediaType: { type: 'MediaType', id: 11 }, + subType: { type: 'VideoSubType', id: 12 }, + isPreview: { type: 'bool', id: 13 }, + dimension: { type: 'Dimension', id: 14 }, + badge: { rule: 'repeated', type: 'VideoBadge', id: 15 }, + canPlay: { type: 'bool', id: 16 }, + season: { type: 'PGCSeason', id: 17 }, + playIcon: { type: 'string', id: 18 }, + duration: { type: 'int64', id: 19 }, + jumpUrl: { type: 'string', id: 20 }, badgeCategory: { - rule: "repeated", - type: "VideoBadge", + rule: 'repeated', + type: 'VideoBadge', id: 21, }, - isFeature: { type: "bool", id: 22 }, + isFeature: { type: 'bool', id: 22 }, }, }, VideoSubType: { @@ -8083,24 +8083,24 @@ const biliJson = { }, MdlDynSubscription: { fields: { - id: { type: "int64", id: 1 }, - adId: { type: "int64", id: 2 }, - uri: { type: "string", id: 3 }, - title: { type: "string", id: 4 }, - cover: { type: "string", id: 5 }, - adTitle: { type: "string", id: 6 }, - badge: { type: "VideoBadge", id: 7 }, - tips: { type: "string", id: 8 }, + id: { type: 'int64', id: 1 }, + adId: { type: 'int64', id: 2 }, + uri: { type: 'string', id: 3 }, + title: { type: 'string', id: 4 }, + cover: { type: 'string', id: 5 }, + adTitle: { type: 'string', id: 6 }, + badge: { type: 'VideoBadge', id: 7 }, + tips: { type: 'string', id: 8 }, }, }, MdlDynSubscriptionNew: { oneofs: { - item: { oneof: ["dynSubscription", "dynLiveRcmd"] }, + item: { oneof: ['dynSubscription', 'dynLiveRcmd'] }, }, fields: { - style: { type: "MdlDynSubscriptionNewStyle", id: 1 }, - dynSubscription: { type: "MdlDynSubscription", id: 2 }, - dynLiveRcmd: { type: "MdlDynLiveRcmd", id: 3 }, + style: { type: 'MdlDynSubscriptionNewStyle', id: 1 }, + dynSubscription: { type: 'MdlDynSubscription', id: 2 }, + dynLiveRcmd: { type: 'MdlDynLiveRcmd', id: 3 }, }, }, MdlDynSubscriptionNewStyle: { @@ -8112,277 +8112,277 @@ const biliJson = { }, MdlDynUGCSeason: { fields: { - title: { type: "string", id: 1 }, - cover: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, - coverLeftText1: { type: "string", id: 4 }, - coverLeftText2: { type: "string", id: 5 }, - coverLeftText3: { type: "string", id: 6 }, - id: { type: "int64", id: 7 }, - inlineURL: { type: "string", id: 8 }, - canPlay: { type: "bool", id: 9 }, - playIcon: { type: "string", id: 10 }, - avid: { type: "int64", id: 11 }, - cid: { type: "int64", id: 12 }, - dimension: { type: "Dimension", id: 13 }, - duration: { type: "int64", id: 14 }, - jumpUrl: { type: "string", id: 15 }, - badge: { rule: "repeated", type: "VideoBadge", id: 16 }, + title: { type: 'string', id: 1 }, + cover: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, + coverLeftText1: { type: 'string', id: 4 }, + coverLeftText2: { type: 'string', id: 5 }, + coverLeftText3: { type: 'string', id: 6 }, + id: { type: 'int64', id: 7 }, + inlineURL: { type: 'string', id: 8 }, + canPlay: { type: 'bool', id: 9 }, + playIcon: { type: 'string', id: 10 }, + avid: { type: 'int64', id: 11 }, + cid: { type: 'int64', id: 12 }, + dimension: { type: 'Dimension', id: 13 }, + duration: { type: 'int64', id: 14 }, + jumpUrl: { type: 'string', id: 15 }, + badge: { rule: 'repeated', type: 'VideoBadge', id: 16 }, }, }, Module: { oneofs: { moduleItem: { oneof: [ - "moduleAuthor", - "moduleDispute", - "moduleDesc", - "moduleDynamic", - "moduleLikeUser", - "moduleExtend", - "moduleAdditional", - "moduleStat", - "moduleFold", - "moduleComment", - "moduleInteraction", - "moduleAuthorForward", - "moduleAd", - "moduleBanner", - "moduleItemNull", - "moduleShareInfo", - "moduleRecommend", - "moduleTop", - "moduleButtom", - "moduleStat1", - "moduleStory", - "moduleTopic", - "moduleTopicDetailsExt", - "moduleTopTag", - "moduleTopicBrief", - "moduleTitle", - "moduleButton", - "moduleNotice", - "moduleOpusSummary", - "moduleCopyright", - "moduleParagraph", - "moduleBlocked", + 'moduleAuthor', + 'moduleDispute', + 'moduleDesc', + 'moduleDynamic', + 'moduleLikeUser', + 'moduleExtend', + 'moduleAdditional', + 'moduleStat', + 'moduleFold', + 'moduleComment', + 'moduleInteraction', + 'moduleAuthorForward', + 'moduleAd', + 'moduleBanner', + 'moduleItemNull', + 'moduleShareInfo', + 'moduleRecommend', + 'moduleTop', + 'moduleButtom', + 'moduleStat1', + 'moduleStory', + 'moduleTopic', + 'moduleTopicDetailsExt', + 'moduleTopTag', + 'moduleTopicBrief', + 'moduleTitle', + 'moduleButton', + 'moduleNotice', + 'moduleOpusSummary', + 'moduleCopyright', + 'moduleParagraph', + 'moduleBlocked', ], }, }, fields: { - moduleType: { type: "DynModuleType", id: 1 }, - moduleAuthor: { type: "ModuleAuthor", id: 2 }, - moduleDispute: { type: "ModuleDispute", id: 3 }, - moduleDesc: { type: "ModuleDesc", id: 4 }, - moduleDynamic: { type: "ModuleDynamic", id: 5 }, - moduleLikeUser: { type: "ModuleLikeUser", id: 6 }, - moduleExtend: { type: "ModuleExtend", id: 7 }, - moduleAdditional: { type: "ModuleAdditional", id: 8 }, - moduleStat: { type: "ModuleStat", id: 9 }, - moduleFold: { type: "ModuleFold", id: 10 }, - moduleComment: { type: "ModuleComment", id: 11 }, + moduleType: { type: 'DynModuleType', id: 1 }, + moduleAuthor: { type: 'ModuleAuthor', id: 2 }, + moduleDispute: { type: 'ModuleDispute', id: 3 }, + moduleDesc: { type: 'ModuleDesc', id: 4 }, + moduleDynamic: { type: 'ModuleDynamic', id: 5 }, + moduleLikeUser: { type: 'ModuleLikeUser', id: 6 }, + moduleExtend: { type: 'ModuleExtend', id: 7 }, + moduleAdditional: { type: 'ModuleAdditional', id: 8 }, + moduleStat: { type: 'ModuleStat', id: 9 }, + moduleFold: { type: 'ModuleFold', id: 10 }, + moduleComment: { type: 'ModuleComment', id: 11 }, moduleInteraction: { - type: "ModuleInteraction", + type: 'ModuleInteraction', id: 12, }, moduleAuthorForward: { - type: "ModuleAuthorForward", + type: 'ModuleAuthorForward', id: 13, }, - moduleAd: { type: "ModuleAd", id: 14 }, - moduleBanner: { type: "ModuleBanner", id: 15 }, - moduleItemNull: { type: "ModuleItemNull", id: 16 }, - moduleShareInfo: { type: "ModuleShareInfo", id: 17 }, - moduleRecommend: { type: "ModuleRecommend", id: 18 }, - moduleTop: { type: "ModuleTop", id: 19 }, - moduleButtom: { type: "ModuleButtom", id: 20 }, - moduleStat1: { type: "ModuleStat", id: 21 }, - moduleStory: { type: "ModuleStory", id: 22 }, - moduleTopic: { type: "ModuleTopic", id: 23 }, + moduleAd: { type: 'ModuleAd', id: 14 }, + moduleBanner: { type: 'ModuleBanner', id: 15 }, + moduleItemNull: { type: 'ModuleItemNull', id: 16 }, + moduleShareInfo: { type: 'ModuleShareInfo', id: 17 }, + moduleRecommend: { type: 'ModuleRecommend', id: 18 }, + moduleTop: { type: 'ModuleTop', id: 19 }, + moduleButtom: { type: 'ModuleButtom', id: 20 }, + moduleStat1: { type: 'ModuleStat', id: 21 }, + moduleStory: { type: 'ModuleStory', id: 22 }, + moduleTopic: { type: 'ModuleTopic', id: 23 }, moduleTopicDetailsExt: { - type: "ModuleTopicDetailsExt", + type: 'ModuleTopicDetailsExt', id: 24, }, - moduleTopTag: { type: "ModuleTopTag", id: 25 }, - moduleTopicBrief: { type: "ModuleTopicBrief", id: 26 }, - moduleTitle: { type: "ModuleTitle", id: 27 }, - moduleButton: { type: "ModuleButton", id: 28 }, - moduleNotice: { type: "ModuleNotice", id: 29 }, + moduleTopTag: { type: 'ModuleTopTag', id: 25 }, + moduleTopicBrief: { type: 'ModuleTopicBrief', id: 26 }, + moduleTitle: { type: 'ModuleTitle', id: 27 }, + moduleButton: { type: 'ModuleButton', id: 28 }, + moduleNotice: { type: 'ModuleNotice', id: 29 }, moduleOpusSummary: { - type: "ModuleOpusSummary", + type: 'ModuleOpusSummary', id: 30, }, - moduleCopyright: { type: "ModuleCopyright", id: 31 }, - moduleParagraph: { type: "ModuleParagraph", id: 32 }, - moduleBlocked: { type: "ModuleBlocked", id: 33 }, + moduleCopyright: { type: 'ModuleCopyright', id: 31 }, + moduleParagraph: { type: 'ModuleParagraph', id: 32 }, + moduleBlocked: { type: 'ModuleBlocked', id: 33 }, }, }, ModuleButton: { - fields: { btn: { type: "IconButton", id: 1 } }, + fields: { btn: { type: 'IconButton', id: 1 } }, }, ModuleTitle: { fields: { - title: { type: "string", id: 1 }, - rightBtn: { type: "IconButton", id: 2 }, - titleStyle: { type: "int32", id: 3 }, + title: { type: 'string', id: 1 }, + rightBtn: { type: 'IconButton', id: 2 }, + titleStyle: { type: 'int32', id: 3 }, }, }, IconButton: { fields: { - text: { type: "string", id: 1 }, - iconHead: { type: "string", id: 2 }, - iconTail: { type: "string", id: 3 }, - jumpUri: { type: "string", id: 4 }, - routerAction: { type: "RouterAction", id: 5 }, + text: { type: 'string', id: 1 }, + iconHead: { type: 'string', id: 2 }, + iconTail: { type: 'string', id: 3 }, + jumpUri: { type: 'string', id: 4 }, + routerAction: { type: 'RouterAction', id: 5 }, }, }, RouterAction: { values: { OPEN: 0, EMBED: 1 } }, ModuleTopicBrief: { - fields: { topic: { type: "TopicItem", id: 1 } }, + fields: { topic: { type: 'TopicItem', id: 1 } }, }, TopicItem: { fields: { - topicId: { type: "int64", id: 1 }, - topicName: { type: "string", id: 2 }, - url: { type: "string", id: 3 }, - desc: { type: "string", id: 4 }, - desc2: { type: "string", id: 5 }, - rcmdDesc: { type: "string", id: 6 }, - button: { type: "IconButton", id: 7 }, + topicId: { type: 'int64', id: 1 }, + topicName: { type: 'string', id: 2 }, + url: { type: 'string', id: 3 }, + desc: { type: 'string', id: 4 }, + desc2: { type: 'string', id: 5 }, + rcmdDesc: { type: 'string', id: 6 }, + button: { type: 'IconButton', id: 7 }, }, }, ModuleTopicDetailsExt: { - fields: { commentGuide: { type: "string", id: 1 } }, + fields: { commentGuide: { type: 'string', id: 1 } }, }, ModuleTopTag: { - fields: { tagName: { type: "string", id: 1 } }, + fields: { tagName: { type: 'string', id: 1 } }, }, ModuleTopic: { fields: { - id: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - url: { type: "string", id: 3 }, + id: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + url: { type: 'string', id: 3 }, }, }, ModuleTop: { fields: { tpList: { - rule: "repeated", - type: "ThreePointItem", + rule: 'repeated', + type: 'ThreePointItem', id: 1, }, - archive: { type: "MdlDynArchive", id: 2 }, - author: { type: "ModuleAuthor", id: 3 }, - hiddenNavBar: { type: "bool", id: 4 }, + archive: { type: 'MdlDynArchive', id: 2 }, + author: { type: 'ModuleAuthor', id: 3 }, + hiddenNavBar: { type: 'bool', id: 4 }, }, }, ModuleButtom: { fields: { - moduleStat: { type: "ModuleStat", id: 1 }, - commentBox: { type: "bool", id: 2 }, - commentBoxMsg: { type: "string", id: 3 }, + moduleStat: { type: 'ModuleStat', id: 1 }, + commentBox: { type: 'bool', id: 2 }, + commentBoxMsg: { type: 'string', id: 3 }, interactionIcons: { - rule: "repeated", - type: "int32", + rule: 'repeated', + type: 'int32', id: 4, }, faces: { - rule: "repeated", - type: "InteractionFace", + rule: 'repeated', + type: 'InteractionFace', id: 5, }, }, }, ModuleStory: { fields: { - title: { type: "string", id: 1 }, - items: { rule: "repeated", type: "StoryItem", id: 2 }, - showPublishEntrance: { type: "bool", id: 3 }, - foldState: { type: "int64", id: 4 }, - uri: { type: "string", id: 5 }, - cover: { type: "string", id: 6 }, - publishText: { type: "string", id: 7 }, + title: { type: 'string', id: 1 }, + items: { rule: 'repeated', type: 'StoryItem', id: 2 }, + showPublishEntrance: { type: 'bool', id: 3 }, + foldState: { type: 'int64', id: 4 }, + uri: { type: 'string', id: 5 }, + cover: { type: 'string', id: 6 }, + publishText: { type: 'string', id: 7 }, }, }, StoryItem: { - oneofs: { item: { oneof: ["storyArchive"] } }, + oneofs: { item: { oneof: ['storyArchive'] } }, fields: { - author: { type: "UserInfo", id: 1 }, - desc: { type: "string", id: 2 }, - status: { type: "int64", id: 3 }, - type: { type: "RcmdType", id: 4 }, - storyArchive: { type: "StoryArchive", id: 5 }, + author: { type: 'UserInfo', id: 1 }, + desc: { type: 'string', id: 2 }, + status: { type: 'int64', id: 3 }, + type: { type: 'RcmdType', id: 4 }, + storyArchive: { type: 'StoryArchive', id: 5 }, }, }, StoryArchive: { fields: { - cover: { type: "string", id: 1 }, - aid: { type: "int64", id: 2 }, - uri: { type: "string", id: 3 }, - dimension: { type: "Dimension", id: 4 }, + cover: { type: 'string', id: 1 }, + aid: { type: 'int64', id: 2 }, + uri: { type: 'string', id: 3 }, + dimension: { type: 'Dimension', id: 4 }, }, }, ModuleAd: { fields: { - sourceContent: { type: "google.protobuf.Any", id: 1 }, - moduleAuthor: { type: "ModuleAuthor", id: 2 }, - adContentType: { type: "int32", id: 3 }, - coverLeftText1: { type: "string", id: 4 }, - coverLeftText2: { type: "string", id: 5 }, - coverLeftText3: { type: "string", id: 6 }, + sourceContent: { type: 'google.protobuf.Any', id: 1 }, + moduleAuthor: { type: 'ModuleAuthor', id: 2 }, + adContentType: { type: 'int32', id: 3 }, + coverLeftText1: { type: 'string', id: 4 }, + coverLeftText2: { type: 'string', id: 5 }, + coverLeftText3: { type: 'string', id: 6 }, }, }, ModuleAdditional: { oneofs: { item: { oneof: [ - "pgc", - "goods", - "vote", - "common", - "esport", - "vote2", - "ugc", - "up", + 'pgc', + 'goods', + 'vote', + 'common', + 'esport', + 'vote2', + 'ugc', + 'up', ], }, }, fields: { - type: { type: "AdditionalType", id: 1 }, - pgc: { type: "AdditionalPGC", id: 2 }, - goods: { type: "AdditionGoods", id: 3 }, - vote: { type: "AdditionVote", id: 4 }, - common: { type: "AdditionCommon", id: 5 }, - esport: { type: "AdditionEsport", id: 6 }, - vote2: { type: "AdditionVote2", id: 8 }, - ugc: { type: "AdditionUgc", id: 9 }, - up: { type: "AdditionUP", id: 10 }, - rid: { type: "int64", id: 7 }, - needWriteCalender: { type: "bool", id: 11 }, + type: { type: 'AdditionalType', id: 1 }, + pgc: { type: 'AdditionalPGC', id: 2 }, + goods: { type: 'AdditionGoods', id: 3 }, + vote: { type: 'AdditionVote', id: 4 }, + common: { type: 'AdditionCommon', id: 5 }, + esport: { type: 'AdditionEsport', id: 6 }, + vote2: { type: 'AdditionVote2', id: 8 }, + ugc: { type: 'AdditionUgc', id: 9 }, + up: { type: 'AdditionUP', id: 10 }, + rid: { type: 'int64', id: 7 }, + needWriteCalender: { type: 'bool', id: 11 }, }, }, ModuleAuthor: { fields: { - mid: { type: "int64", id: 1 }, - ptimeLabelText: { type: "string", id: 2 }, - author: { type: "UserInfo", id: 3 }, - decorateCard: { type: "DecorateCard", id: 4 }, - uri: { type: "string", id: 5 }, + mid: { type: 'int64', id: 1 }, + ptimeLabelText: { type: 'string', id: 2 }, + author: { type: 'UserInfo', id: 3 }, + decorateCard: { type: 'DecorateCard', id: 4 }, + uri: { type: 'string', id: 5 }, tpList: { - rule: "repeated", - type: "ThreePointItem", + rule: 'repeated', + type: 'ThreePointItem', id: 6, }, - badgeType: { type: "ModuleAuthorBadgeType", id: 7 }, - badgeButton: { type: "ModuleAuthorBadgeButton", id: 8 }, - attend: { type: "int32", id: 9 }, - relation: { type: "Relation", id: 10 }, - weight: { type: "Weight", id: 11 }, - showFollow: { type: "bool", id: 12 }, - isTop: { type: "bool", id: 13 }, - ptimeLocationText: { type: "string", id: 14 }, - showLevel: { type: "bool", id: 15 }, - onlyFans: { type: "OnlyFans", id: 16 }, + badgeType: { type: 'ModuleAuthorBadgeType', id: 7 }, + badgeButton: { type: 'ModuleAuthorBadgeButton', id: 8 }, + attend: { type: 'int32', id: 9 }, + relation: { type: 'Relation', id: 10 }, + weight: { type: 'Weight', id: 11 }, + showFollow: { type: 'bool', id: 12 }, + isTop: { type: 'bool', id: 13 }, + ptimeLocationText: { type: 'string', id: 14 }, + showLevel: { type: 'bool', id: 15 }, + onlyFans: { type: 'OnlyFans', id: 16 }, }, }, ModuleAuthorBadgeType: { @@ -8395,31 +8395,31 @@ const biliJson = { }, Weight: { fields: { - title: { type: "string", id: 1 }, - items: { rule: "repeated", type: "WeightItem", id: 2 }, - icon: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + items: { rule: 'repeated', type: 'WeightItem', id: 2 }, + icon: { type: 'string', id: 3 }, }, }, WeightItem: { oneofs: { - item: { oneof: ["weightButton", "weightDislike"] }, + item: { oneof: ['weightButton', 'weightDislike'] }, }, fields: { - type: { type: "WeightType", id: 1 }, - weightButton: { type: "WeightButton", id: 2 }, - weightDislike: { type: "WeightDislike", id: 3 }, + type: { type: 'WeightType', id: 1 }, + weightButton: { type: 'WeightButton', id: 2 }, + weightDislike: { type: 'WeightDislike', id: 3 }, }, }, WeightDislike: { fields: { - feedBackType: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + feedBackType: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, }, }, WeightButton: { fields: { - jumpUrl: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + jumpUrl: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, }, }, WeightType: { @@ -8431,46 +8431,46 @@ const biliJson = { }, ModuleAuthorBadgeButton: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - state: { type: "int32", id: 3 }, - id: { type: "int64", id: 4 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + state: { type: 'int32', id: 3 }, + id: { type: 'int64', id: 4 }, }, }, ModuleAuthorForward: { fields: { title: { - rule: "repeated", - type: "ModuleAuthorForwardTitle", + rule: 'repeated', + type: 'ModuleAuthorForwardTitle', id: 1, }, - url: { type: "string", id: 2 }, - uid: { type: "int64", id: 3 }, - ptimeLabelText: { type: "string", id: 4 }, - showFollow: { type: "bool", id: 5 }, - faceUrl: { type: "string", id: 6 }, - relation: { type: "Relation", id: 7 }, + url: { type: 'string', id: 2 }, + uid: { type: 'int64', id: 3 }, + ptimeLabelText: { type: 'string', id: 4 }, + showFollow: { type: 'bool', id: 5 }, + faceUrl: { type: 'string', id: 6 }, + relation: { type: 'Relation', id: 7 }, tpList: { - rule: "repeated", - type: "ThreePointItem", + rule: 'repeated', + type: 'ThreePointItem', id: 8, }, }, }, ModuleAuthorForwardTitle: { fields: { - text: { type: "string", id: 1 }, - url: { type: "string", id: 2 }, + text: { type: 'string', id: 1 }, + url: { type: 'string', id: 2 }, }, }, ModuleBanner: { - oneofs: { item: { oneof: ["user"] } }, + oneofs: { item: { oneof: ['user'] } }, fields: { - title: { type: "string", id: 1 }, - type: { type: "ModuleBannerType", id: 2 }, - user: { type: "ModuleBannerUser", id: 3 }, - dislikeText: { type: "string", id: 4 }, - dislikeIcon: { type: "string", id: 5 }, + title: { type: 'string', id: 1 }, + type: { type: 'ModuleBannerType', id: 2 }, + user: { type: 'ModuleBannerUser', id: 3 }, + dislikeText: { type: 'string', id: 4 }, + dislikeIcon: { type: 'string', id: 5 }, }, }, ModuleBannerType: { @@ -8482,141 +8482,141 @@ const biliJson = { ModuleBannerUser: { fields: { list: { - rule: "repeated", - type: "ModuleBannerUserItem", + rule: 'repeated', + type: 'ModuleBannerUserItem', id: 1, }, }, }, ModuleBannerUserItem: { fields: { - face: { type: "string", id: 1 }, - name: { type: "string", id: 2 }, - uid: { type: "int64", id: 3 }, - liveState: { type: "LiveState", id: 4 }, - official: { type: "OfficialVerify", id: 5 }, - vip: { type: "VipInfo", id: 6 }, - label: { type: "string", id: 7 }, - button: { type: "AdditionalButton", id: 8 }, - uri: { type: "string", id: 9 }, - relation: { type: "Relation", id: 10 }, + face: { type: 'string', id: 1 }, + name: { type: 'string', id: 2 }, + uid: { type: 'int64', id: 3 }, + liveState: { type: 'LiveState', id: 4 }, + official: { type: 'OfficialVerify', id: 5 }, + vip: { type: 'VipInfo', id: 6 }, + label: { type: 'string', id: 7 }, + button: { type: 'AdditionalButton', id: 8 }, + uri: { type: 'string', id: 9 }, + relation: { type: 'Relation', id: 10 }, }, }, ModuleComment: { fields: { cmtShowItem: { - rule: "repeated", - type: "CmtShowItem", + rule: 'repeated', + type: 'CmtShowItem', id: 1, }, }, }, ModuleDesc: { fields: { - desc: { rule: "repeated", type: "Description", id: 1 }, - jumpUri: { type: "string", id: 2 }, - text: { type: "string", id: 3 }, + desc: { rule: 'repeated', type: 'Description', id: 1 }, + jumpUri: { type: 'string', id: 2 }, + text: { type: 'string', id: 3 }, }, }, ModuleDescGoods: { fields: { - sourceType: { type: "int32", id: 1 }, - jumpUrl: { type: "string", id: 2 }, - schemaUrl: { type: "string", id: 3 }, - itemId: { type: "int64", id: 4 }, + sourceType: { type: 'int32', id: 1 }, + jumpUrl: { type: 'string', id: 2 }, + schemaUrl: { type: 'string', id: 3 }, + itemId: { type: 'int64', id: 4 }, openWhiteList: { - rule: "repeated", - type: "string", + rule: 'repeated', + type: 'string', id: 5, }, - userWebV2: { type: "bool", id: 6 }, - adMark: { type: "string", id: 7 }, - schemaPackageName: { type: "string", id: 8 }, - goodsJumpType: { type: "GoodsJumpType", id: 9 }, - appName: { type: "string", id: 10 }, + userWebV2: { type: 'bool', id: 6 }, + adMark: { type: 'string', id: 7 }, + schemaPackageName: { type: 'string', id: 8 }, + goodsJumpType: { type: 'GoodsJumpType', id: 9 }, + appName: { type: 'string', id: 10 }, }, }, ModuleDispute: { fields: { - title: { type: "string", id: 1 }, - desc: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + desc: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, }, }, ModuleDynamic: { oneofs: { moduleItem: { oneof: [ - "dynArchive", - "dynPgc", - "dynCourSeason", - "dynCourBatch", - "dynForward", - "dynDraw", - "dynArticle", - "dynMusic", - "dynCommon", - "dynCommonLive", - "dynMedialist", - "dynApplet", - "dynSubscription", - "dynLiveRcmd", - "dynUgcSeason", - "dynSubscriptionNew", - "mdlDynCourUp", - "mdlDynTopicSet", + 'dynArchive', + 'dynPgc', + 'dynCourSeason', + 'dynCourBatch', + 'dynForward', + 'dynDraw', + 'dynArticle', + 'dynMusic', + 'dynCommon', + 'dynCommonLive', + 'dynMedialist', + 'dynApplet', + 'dynSubscription', + 'dynLiveRcmd', + 'dynUgcSeason', + 'dynSubscriptionNew', + 'mdlDynCourUp', + 'mdlDynTopicSet', ], }, }, fields: { - type: { type: "ModuleDynamicType", id: 1 }, - dynArchive: { type: "MdlDynArchive", id: 2 }, - dynPgc: { type: "MdlDynPGC", id: 3 }, - dynCourSeason: { type: "MdlDynCourSeason", id: 4 }, - dynCourBatch: { type: "MdlDynCourBatch", id: 5 }, - dynForward: { type: "MdlDynForward", id: 6 }, - dynDraw: { type: "MdlDynDraw", id: 7 }, - dynArticle: { type: "MdlDynArticle", id: 8 }, - dynMusic: { type: "MdlDynMusic", id: 9 }, - dynCommon: { type: "MdlDynCommon", id: 10 }, - dynCommonLive: { type: "MdlDynLive", id: 11 }, - dynMedialist: { type: "MdlDynMedialist", id: 12 }, - dynApplet: { type: "MdlDynApplet", id: 13 }, - dynSubscription: { type: "MdlDynSubscription", id: 14 }, - dynLiveRcmd: { type: "MdlDynLiveRcmd", id: 15 }, - dynUgcSeason: { type: "MdlDynUGCSeason", id: 16 }, + type: { type: 'ModuleDynamicType', id: 1 }, + dynArchive: { type: 'MdlDynArchive', id: 2 }, + dynPgc: { type: 'MdlDynPGC', id: 3 }, + dynCourSeason: { type: 'MdlDynCourSeason', id: 4 }, + dynCourBatch: { type: 'MdlDynCourBatch', id: 5 }, + dynForward: { type: 'MdlDynForward', id: 6 }, + dynDraw: { type: 'MdlDynDraw', id: 7 }, + dynArticle: { type: 'MdlDynArticle', id: 8 }, + dynMusic: { type: 'MdlDynMusic', id: 9 }, + dynCommon: { type: 'MdlDynCommon', id: 10 }, + dynCommonLive: { type: 'MdlDynLive', id: 11 }, + dynMedialist: { type: 'MdlDynMedialist', id: 12 }, + dynApplet: { type: 'MdlDynApplet', id: 13 }, + dynSubscription: { type: 'MdlDynSubscription', id: 14 }, + dynLiveRcmd: { type: 'MdlDynLiveRcmd', id: 15 }, + dynUgcSeason: { type: 'MdlDynUGCSeason', id: 16 }, dynSubscriptionNew: { - type: "MdlDynSubscriptionNew", + type: 'MdlDynSubscriptionNew', id: 17, }, - mdlDynCourUp: { type: "MdlDynCourUp", id: 18 }, - mdlDynTopicSet: { type: "MdlDynTopicSet", id: 19 }, + mdlDynCourUp: { type: 'MdlDynCourUp', id: 18 }, + mdlDynTopicSet: { type: 'MdlDynTopicSet', id: 19 }, }, }, MdlDynTopicSet: { fields: { - topics: { rule: "repeated", type: "TopicItem", id: 1 }, - moreBtn: { type: "IconButton", id: 2 }, - topicSetId: { type: "int64", id: 3 }, - pushId: { type: "int64", id: 4 }, + topics: { rule: 'repeated', type: 'TopicItem', id: 1 }, + moreBtn: { type: 'IconButton', id: 2 }, + topicSetId: { type: 'int64', id: 3 }, + pushId: { type: 'int64', id: 4 }, }, }, MdlDynCourUp: { fields: { - title: { type: "string", id: 1 }, - desc: { type: "string", id: 2 }, - cover: { type: "string", id: 3 }, - uri: { type: "string", id: 4 }, - text1: { type: "string", id: 5 }, - badge: { type: "VideoBadge", id: 6 }, - playIcon: { type: "string", id: 7 }, - canPlay: { type: "bool", id: 8 }, - isPreview: { type: "bool", id: 9 }, - avid: { type: "int64", id: 10 }, - cid: { type: "int64", id: 11 }, - epid: { type: "int64", id: 12 }, - duration: { type: "int64", id: 13 }, - seasonId: { type: "int64", id: 14 }, + title: { type: 'string', id: 1 }, + desc: { type: 'string', id: 2 }, + cover: { type: 'string', id: 3 }, + uri: { type: 'string', id: 4 }, + text1: { type: 'string', id: 5 }, + badge: { type: 'VideoBadge', id: 6 }, + playIcon: { type: 'string', id: 7 }, + canPlay: { type: 'bool', id: 8 }, + isPreview: { type: 'bool', id: 9 }, + avid: { type: 'int64', id: 10 }, + cid: { type: 'int64', id: 11 }, + epid: { type: 'int64', id: 12 }, + duration: { type: 'int64', id: 13 }, + seasonId: { type: 'int64', id: 14 }, }, }, ModuleDynamicType: { @@ -8644,48 +8644,48 @@ const biliJson = { ModuleExtend: { fields: { extend: { - rule: "repeated", - type: "ModuleExtendItem", + rule: 'repeated', + type: 'ModuleExtendItem', id: 1, }, - uri: { type: "string", id: 2 }, + uri: { type: 'string', id: 2 }, }, }, ModuleExtendItem: { oneofs: { extend: { oneof: [ - "extInfoTopic", - "extInfoLbs", - "extInfoHot", - "extInfoGame", - "extInfoCommon", - "extInfoOgv", + 'extInfoTopic', + 'extInfoLbs', + 'extInfoHot', + 'extInfoGame', + 'extInfoCommon', + 'extInfoOgv', ], }, }, fields: { - type: { type: "DynExtendType", id: 1 }, - extInfoTopic: { type: "ExtInfoTopic", id: 2 }, - extInfoLbs: { type: "ExtInfoLBS", id: 3 }, - extInfoHot: { type: "ExtInfoHot", id: 4 }, - extInfoGame: { type: "ExtInfoGame", id: 5 }, - extInfoCommon: { type: "ExtInfoCommon", id: 6 }, - extInfoOgv: { type: "ExtInfoOGV", id: 7 }, + type: { type: 'DynExtendType', id: 1 }, + extInfoTopic: { type: 'ExtInfoTopic', id: 2 }, + extInfoLbs: { type: 'ExtInfoLBS', id: 3 }, + extInfoHot: { type: 'ExtInfoHot', id: 4 }, + extInfoGame: { type: 'ExtInfoGame', id: 5 }, + extInfoCommon: { type: 'ExtInfoCommon', id: 6 }, + extInfoOgv: { type: 'ExtInfoOGV', id: 7 }, }, }, ModuleFold: { fields: { - foldType: { type: "FoldType", id: 1 }, - text: { type: "string", id: 2 }, - foldIds: { type: "string", id: 3 }, + foldType: { type: 'FoldType', id: 1 }, + text: { type: 'string', id: 2 }, + foldIds: { type: 'string', id: 3 }, foldUsers: { - rule: "repeated", - type: "UserInfo", + rule: 'repeated', + type: 'UserInfo', id: 4, }, topicMergedResource: { - type: "TopicMergedResource", + type: 'TopicMergedResource', id: 5, }, }, @@ -8703,96 +8703,96 @@ const biliJson = { ModuleInteraction: { fields: { interactionItem: { - rule: "repeated", - type: "InteractionItem", + rule: 'repeated', + type: 'InteractionItem', id: 1, }, }, }, ModuleItemNull: { fields: { - icon: { type: "string", id: 1 }, - text: { type: "string", id: 2 }, + icon: { type: 'string', id: 1 }, + text: { type: 'string', id: 2 }, }, }, ModuleLikeUser: { fields: { likeUsers: { - rule: "repeated", - type: "LikeUser", + rule: 'repeated', + type: 'LikeUser', id: 1, }, - displayText: { type: "string", id: 2 }, + displayText: { type: 'string', id: 2 }, }, }, ModuleRecommend: { fields: { - moduleTitle: { type: "string", id: 1 }, - image: { type: "string", id: 2 }, - tag: { type: "string", id: 3 }, - title: { type: "string", id: 4 }, - jumpUrl: { type: "string", id: 5 }, - ad: { type: "string", id: 6 }, + moduleTitle: { type: 'string', id: 1 }, + image: { type: 'string', id: 2 }, + tag: { type: 'string', id: 3 }, + title: { type: 'string', id: 4 }, + jumpUrl: { type: 'string', id: 5 }, + ad: { type: 'string', id: 6 }, }, }, ModuleShareInfo: { fields: { - title: { type: "string", id: 1 }, + title: { type: 'string', id: 1 }, shareChannels: { - rule: "repeated", - type: "ShareChannel", + rule: 'repeated', + type: 'ShareChannel', id: 2, }, - shareOrigin: { type: "string", id: 3 }, - oid: { type: "string", id: 4 }, - sid: { type: "string", id: 5 }, + shareOrigin: { type: 'string', id: 3 }, + oid: { type: 'string', id: 4 }, + sid: { type: 'string', id: 5 }, }, }, ModuleStat: { fields: { - repost: { type: "int64", id: 1 }, - like: { type: "int64", id: 2 }, - reply: { type: "int64", id: 3 }, - likeInfo: { type: "LikeInfo", id: 4 }, - noComment: { type: "bool", id: 5 }, - noForward: { type: "bool", id: 6 }, - replyUrl: { type: "string", id: 7 }, - noCommentText: { type: "string", id: 8 }, - noForwardText: { type: "string", id: 9 }, - favorite: { type: "int64", id: 10 }, - isFavorite: { type: "bool", id: 11 }, + repost: { type: 'int64', id: 1 }, + like: { type: 'int64', id: 2 }, + reply: { type: 'int64', id: 3 }, + likeInfo: { type: 'LikeInfo', id: 4 }, + noComment: { type: 'bool', id: 5 }, + noForward: { type: 'bool', id: 6 }, + replyUrl: { type: 'string', id: 7 }, + noCommentText: { type: 'string', id: 8 }, + noForwardText: { type: 'string', id: 9 }, + favorite: { type: 'int64', id: 10 }, + isFavorite: { type: 'bool', id: 11 }, }, }, Nameplate: { fields: { - nid: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - image: { type: "string", id: 3 }, - imageSmall: { type: "string", id: 4 }, - level: { type: "string", id: 5 }, - condition: { type: "string", id: 6 }, + nid: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + image: { type: 'string', id: 3 }, + imageSmall: { type: 'string', id: 4 }, + level: { type: 'string', id: 5 }, + condition: { type: 'string', id: 6 }, }, }, OfficialVerify: { fields: { - type: { type: "int32", id: 1 }, - desc: { type: "string", id: 2 }, - isAtten: { type: "int32", id: 3 }, + type: { type: 'int32', id: 1 }, + desc: { type: 'string', id: 2 }, + isAtten: { type: 'int32', id: 3 }, }, }, PGCSeason: { fields: { - isFinish: { type: "int32", id: 1 }, - title: { type: "string", id: 2 }, - type: { type: "int32", id: 3 }, + isFinish: { type: 'int32', id: 1 }, + title: { type: 'string', id: 2 }, + type: { type: 'int32', id: 3 }, }, }, Relation: { fields: { - status: { type: "RelationStatus", id: 1 }, - isFollow: { type: "int32", id: 2 }, - isFollowed: { type: "int32", id: 3 }, - title: { type: "string", id: 4 }, + status: { type: 'RelationStatus', id: 1 }, + isFollow: { type: 'int32', id: 2 }, + isFollowed: { type: 'int32', id: 3 }, + title: { type: 'string', id: 4 }, }, }, RelationStatus: { @@ -8807,29 +8807,29 @@ const biliJson = { }, ShareChannel: { fields: { - name: { type: "string", id: 1 }, - image: { type: "string", id: 2 }, - channel: { type: "string", id: 3 }, - reserve: { type: "ShareReserve", id: 4 }, + name: { type: 'string', id: 1 }, + image: { type: 'string', id: 2 }, + channel: { type: 'string', id: 3 }, + reserve: { type: 'ShareReserve', id: 4 }, }, }, ShareReserve: { fields: { - title: { type: "string", id: 1 }, - desc: { type: "string", id: 2 }, - qrCodeIcon: { type: "string", id: 3 }, - qrCodeText: { type: "string", id: 4 }, - qrCodeUrl: { type: "string", id: 5 }, - userInfo: { type: "AdditionUserInfo", id: 6 }, + title: { type: 'string', id: 1 }, + desc: { type: 'string', id: 2 }, + qrCodeIcon: { type: 'string', id: 3 }, + qrCodeText: { type: 'string', id: 4 }, + qrCodeUrl: { type: 'string', id: 5 }, + userInfo: { type: 'AdditionUserInfo', id: 6 }, }, }, ThreePointAttention: { fields: { - attentionIcon: { type: "string", id: 1 }, - attentionText: { type: "string", id: 2 }, - notAttentionIcon: { type: "string", id: 3 }, - notAttentionText: { type: "string", id: 4 }, - status: { type: "ThreePointAttentionStatus", id: 5 }, + attentionIcon: { type: 'string', id: 1 }, + attentionText: { type: 'string', id: 2 }, + notAttentionIcon: { type: 'string', id: 3 }, + notAttentionText: { type: 'string', id: 4 }, + status: { type: 'ThreePointAttentionStatus', id: 5 }, }, }, ThreePointAttentionStatus: { @@ -8837,168 +8837,168 @@ const biliJson = { }, ThreePointAutoPlay: { fields: { - openIcon: { type: "string", id: 1 }, - openText: { type: "string", id: 2 }, - closeIcon: { type: "string", id: 3 }, - closeText: { type: "string", id: 4 }, - openTextV2: { type: "string", id: 5 }, - closeTextV2: { type: "string", id: 6 }, - onlyIcon: { type: "string", id: 7 }, - onlyText: { type: "string", id: 8 }, - openIconV2: { type: "string", id: 9 }, - closeIconV2: { type: "string", id: 10 }, + openIcon: { type: 'string', id: 1 }, + openText: { type: 'string', id: 2 }, + closeIcon: { type: 'string', id: 3 }, + closeText: { type: 'string', id: 4 }, + openTextV2: { type: 'string', id: 5 }, + closeTextV2: { type: 'string', id: 6 }, + onlyIcon: { type: 'string', id: 7 }, + onlyText: { type: 'string', id: 8 }, + openIconV2: { type: 'string', id: 9 }, + closeIconV2: { type: 'string', id: 10 }, }, }, ThreePointDefault: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - uri: { type: "string", id: 3 }, - id: { type: "string", id: 4 }, - toast: { type: "ThreePointDefaultToast", id: 5 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + uri: { type: 'string', id: 3 }, + id: { type: 'string', id: 4 }, + toast: { type: 'ThreePointDefaultToast', id: 5 }, }, }, ThreePointDefaultToast: { fields: { - title: { type: "string", id: 1 }, - desc: { type: "string", id: 2 }, + title: { type: 'string', id: 1 }, + desc: { type: 'string', id: 2 }, }, }, ThreePointDislike: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, }, }, ThreePointFavorite: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - id: { type: "int64", id: 3 }, - isFavourite: { type: "bool", id: 4 }, - cancelIcon: { type: "string", id: 5 }, - cancelTitle: { type: "string", id: 6 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + id: { type: 'int64', id: 3 }, + isFavourite: { type: 'bool', id: 4 }, + cancelIcon: { type: 'string', id: 5 }, + cancelTitle: { type: 'string', id: 6 }, }, }, ThreePointItem: { oneofs: { item: { oneof: [ - "default", - "autoPlayer", - "share", - "attention", - "wait", - "dislike", - "favorite", - "threePointTop", - "threePointComment", - "threePointHide", - "threePointTopicIrrelevant", - "threePointDynEdit", - "threePointDynCoin", + 'default', + 'autoPlayer', + 'share', + 'attention', + 'wait', + 'dislike', + 'favorite', + 'threePointTop', + 'threePointComment', + 'threePointHide', + 'threePointTopicIrrelevant', + 'threePointDynEdit', + 'threePointDynCoin', ], }, }, fields: { - type: { type: "ThreePointType", id: 1 }, - default: { type: "ThreePointDefault", id: 2 }, - autoPlayer: { type: "ThreePointAutoPlay", id: 3 }, - share: { type: "ThreePointShare", id: 4 }, - attention: { type: "ThreePointAttention", id: 5 }, - wait: { type: "ThreePointWait", id: 6 }, - dislike: { type: "ThreePointDislike", id: 7 }, - favorite: { type: "ThreePointFavorite", id: 8 }, - threePointTop: { type: "ThreePointTop", id: 9 }, + type: { type: 'ThreePointType', id: 1 }, + default: { type: 'ThreePointDefault', id: 2 }, + autoPlayer: { type: 'ThreePointAutoPlay', id: 3 }, + share: { type: 'ThreePointShare', id: 4 }, + attention: { type: 'ThreePointAttention', id: 5 }, + wait: { type: 'ThreePointWait', id: 6 }, + dislike: { type: 'ThreePointDislike', id: 7 }, + favorite: { type: 'ThreePointFavorite', id: 8 }, + threePointTop: { type: 'ThreePointTop', id: 9 }, threePointComment: { - type: "ThreePointComment", + type: 'ThreePointComment', id: 10, }, - threePointHide: { type: "ThreePointHide", id: 11 }, + threePointHide: { type: 'ThreePointHide', id: 11 }, threePointTopicIrrelevant: { - type: "ThreePointTopicIrrelevant", + type: 'ThreePointTopicIrrelevant', id: 12, }, threePointDynEdit: { - type: "ThreePointDynEdit", + type: 'ThreePointDynEdit', id: 13, }, threePointDynCoin: { - type: "ThreePointDynCoin", + type: 'ThreePointDynCoin', id: 14, }, }, }, ThreePointTopicIrrelevant: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - toast: { type: "string", id: 3 }, - topicId: { type: "int64", id: 4 }, - resId: { type: "int64", id: 5 }, - resType: { type: "int64", id: 6 }, - reason: { type: "string", id: 7 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + toast: { type: 'string', id: 3 }, + topicId: { type: 'int64', id: 4 }, + resId: { type: 'int64', id: 5 }, + resType: { type: 'int64', id: 6 }, + reason: { type: 'string', id: 7 }, }, }, ThreePointHide: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, interactive: { - type: "ThreePointHideInteractive", + type: 'ThreePointHideInteractive', id: 3, }, - blookFid: { type: "int64", id: 4 }, - blookType: { type: "string", id: 5 }, + blookFid: { type: 'int64', id: 4 }, + blookType: { type: 'string', id: 5 }, }, }, ThreePointHideInteractive: { fields: { - title: { type: "string", id: 1 }, - confirm: { type: "string", id: 2 }, - cancel: { type: "string", id: 3 }, - toast: { type: "string", id: 4 }, + title: { type: 'string', id: 1 }, + confirm: { type: 'string', id: 2 }, + cancel: { type: 'string', id: 3 }, + toast: { type: 'string', id: 4 }, }, }, ThreePointComment: { fields: { - upSelection: { type: "CommentDetail", id: 1 }, - upClose: { type: "CommentDetail", id: 2 }, - icon: { type: "string", id: 3 }, - title: { type: "string", id: 4 }, + upSelection: { type: 'CommentDetail', id: 1 }, + upClose: { type: 'CommentDetail', id: 2 }, + icon: { type: 'string', id: 3 }, + title: { type: 'string', id: 4 }, }, }, CommentDetail: { fields: { - canModify: { type: "bool", id: 1 }, - status: { type: "int64", id: 2 }, + canModify: { type: 'bool', id: 1 }, + status: { type: 'int64', id: 2 }, }, }, ThreePointTop: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - type: { type: "TopType", id: 3 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + type: { type: 'TopType', id: 3 }, }, }, TopType: { values: { top_none: 0, top_cancel: 1 } }, ThreePointShare: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, channel: { - rule: "repeated", - type: "ThreePointShareChannel", + rule: 'repeated', + type: 'ThreePointShareChannel', id: 3, }, - channelName: { type: "string", id: 4 }, - reserve: { type: "ShareReserve", id: 5 }, + channelName: { type: 'string', id: 4 }, + reserve: { type: 'ShareReserve', id: 5 }, }, }, ThreePointShareChannel: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, }, }, ThreePointType: { @@ -9027,95 +9027,95 @@ const biliJson = { }, ThreePointWait: { fields: { - additionIcon: { type: "string", id: 1 }, - additionText: { type: "string", id: 2 }, - noAdditionIcon: { type: "string", id: 3 }, - noAdditionText: { type: "string", id: 4 }, - id: { type: "int64", id: 5 }, + additionIcon: { type: 'string', id: 1 }, + additionText: { type: 'string', id: 2 }, + noAdditionIcon: { type: 'string', id: 3 }, + noAdditionText: { type: 'string', id: 4 }, + id: { type: 'int64', id: 5 }, }, }, TopicButton: { fields: { - icon: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, - jumpUri: { type: "string", id: 3 }, - redDot: { type: "bool", id: 4 }, + icon: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, + jumpUri: { type: 'string', id: 3 }, + redDot: { type: 'bool', id: 4 }, }, }, TopicList: { fields: { - title: { type: "string", id: 1 }, + title: { type: 'string', id: 1 }, topicListItem: { - rule: "repeated", - type: "TopicListItem", + rule: 'repeated', + type: 'TopicListItem', id: 2, }, - actButton: { type: "TopicButton", id: 3 }, - moreButton: { type: "TopicButton", id: 4 }, - serverInfo: { type: "string", id: 5 }, - subTitle: { type: "string", id: 6 }, - expStyle: { type: "int32", id: 7 }, - titleIcon: { type: "string", id: 8 }, + actButton: { type: 'TopicButton', id: 3 }, + moreButton: { type: 'TopicButton', id: 4 }, + serverInfo: { type: 'string', id: 5 }, + subTitle: { type: 'string', id: 6 }, + expStyle: { type: 'int32', id: 7 }, + titleIcon: { type: 'string', id: 8 }, }, }, TopicListItem: { fields: { - icon: { type: "string", id: 1 }, - iconTitle: { type: "string", id: 2 }, - topicId: { type: "int64", id: 3 }, - topicName: { type: "string", id: 4 }, - url: { type: "string", id: 5 }, - pos: { type: "int64", id: 6 }, - serverInfo: { type: "string", id: 7 }, - headIconUrl: { type: "string", id: 8 }, - upMid: { type: "int64", id: 9 }, - tailIconUrl: { type: "string", id: 10 }, - extension: { type: "string", id: 11 }, - position: { type: "int64", id: 12 }, + icon: { type: 'string', id: 1 }, + iconTitle: { type: 'string', id: 2 }, + topicId: { type: 'int64', id: 3 }, + topicName: { type: 'string', id: 4 }, + url: { type: 'string', id: 5 }, + pos: { type: 'int64', id: 6 }, + serverInfo: { type: 'string', id: 7 }, + headIconUrl: { type: 'string', id: 8 }, + upMid: { type: 'int64', id: 9 }, + tailIconUrl: { type: 'string', id: 10 }, + extension: { type: 'string', id: 11 }, + position: { type: 'int64', id: 12 }, }, }, Unfollow: { fields: { - title: { type: "string", id: 1 }, + title: { type: 'string', id: 1 }, list: { - rule: "repeated", - type: "UnfollowUserItem", + rule: 'repeated', + type: 'UnfollowUserItem', id: 2, }, - trackId: { type: "string", id: 3 }, + trackId: { type: 'string', id: 3 }, }, }, UnfollowUserItem: { fields: { - hasUpdate: { type: "bool", id: 1 }, - face: { type: "string", id: 2 }, - name: { type: "string", id: 3 }, - uid: { type: "int64", id: 4 }, - pos: { type: "int32", id: 5 }, - liveState: { type: "LiveState", id: 6 }, - official: { type: "OfficialVerify", id: 7 }, - vip: { type: "VipInfo", id: 8 }, - sign: { type: "string", id: 9 }, - label: { type: "string", id: 10 }, - button: { type: "AdditionalButton", id: 11 }, - uri: { type: "string", id: 12 }, + hasUpdate: { type: 'bool', id: 1 }, + face: { type: 'string', id: 2 }, + name: { type: 'string', id: 3 }, + uid: { type: 'int64', id: 4 }, + pos: { type: 'int32', id: 5 }, + liveState: { type: 'LiveState', id: 6 }, + official: { type: 'OfficialVerify', id: 7 }, + vip: { type: 'VipInfo', id: 8 }, + sign: { type: 'string', id: 9 }, + label: { type: 'string', id: 10 }, + button: { type: 'AdditionalButton', id: 11 }, + uri: { type: 'string', id: 12 }, }, }, UpListItem: { fields: { - hasUpdate: { type: "bool", id: 1 }, - face: { type: "string", id: 2 }, - name: { type: "string", id: 3 }, - uid: { type: "int64", id: 4 }, - pos: { type: "int64", id: 5 }, - userItemType: { type: "UserItemType", id: 6 }, - displayStyleDay: { type: "UserItemStyle", id: 7 }, - displayStyleNight: { type: "UserItemStyle", id: 8 }, - styleId: { type: "int64", id: 9 }, - liveState: { type: "LiveState", id: 10 }, - separator: { type: "bool", id: 11 }, - uri: { type: "string", id: 12 }, - isRecall: { type: "bool", id: 13 }, + hasUpdate: { type: 'bool', id: 1 }, + face: { type: 'string', id: 2 }, + name: { type: 'string', id: 3 }, + uid: { type: 'int64', id: 4 }, + pos: { type: 'int64', id: 5 }, + userItemType: { type: 'UserItemType', id: 6 }, + displayStyleDay: { type: 'UserItemStyle', id: 7 }, + displayStyleNight: { type: 'UserItemStyle', id: 8 }, + styleId: { type: 'int64', id: 9 }, + liveState: { type: 'LiveState', id: 10 }, + separator: { type: 'bool', id: 11 }, + uri: { type: 'string', id: 12 }, + isRecall: { type: 'bool', id: 13 }, }, }, UserItemType: { @@ -9131,87 +9131,87 @@ const biliJson = { }, UpListMoreLabel: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, }, }, UserInfo: { fields: { - mid: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - face: { type: "string", id: 3 }, - official: { type: "OfficialVerify", id: 4 }, - vip: { type: "VipInfo", id: 5 }, - live: { type: "LiveInfo", id: 6 }, - uri: { type: "string", id: 7 }, - pendant: { type: "UserPendant", id: 8 }, - nameplate: { type: "Nameplate", id: 9 }, - level: { type: "int32", id: 10 }, - sign: { type: "string", id: 11 }, - faceNft: { type: "int32", id: 12 }, - faceNftNew: { type: "int32", id: 13 }, - nftInfo: { type: "NFTInfo", id: 14 }, - isSeniorMember: { type: "int32", id: 15 }, + mid: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + face: { type: 'string', id: 3 }, + official: { type: 'OfficialVerify', id: 4 }, + vip: { type: 'VipInfo', id: 5 }, + live: { type: 'LiveInfo', id: 6 }, + uri: { type: 'string', id: 7 }, + pendant: { type: 'UserPendant', id: 8 }, + nameplate: { type: 'Nameplate', id: 9 }, + level: { type: 'int32', id: 10 }, + sign: { type: 'string', id: 11 }, + faceNft: { type: 'int32', id: 12 }, + faceNftNew: { type: 'int32', id: 13 }, + nftInfo: { type: 'NFTInfo', id: 14 }, + isSeniorMember: { type: 'int32', id: 15 }, avatar: { - type: "bilibili.dagw.component.avatar.v1.AvatarItem", + type: 'bilibili.dagw.component.avatar.v1.AvatarItem', id: 16, }, }, }, UserItemStyle: { fields: { - rectText: { type: "string", id: 1 }, - rectTextColor: { type: "string", id: 2 }, - rectIcon: { type: "string", id: 3 }, - rectBgColor: { type: "string", id: 4 }, - outerAnimation: { type: "string", id: 5 }, + rectText: { type: 'string', id: 1 }, + rectTextColor: { type: 'string', id: 2 }, + rectIcon: { type: 'string', id: 3 }, + rectBgColor: { type: 'string', id: 4 }, + outerAnimation: { type: 'string', id: 5 }, }, }, UserPendant: { fields: { - pid: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - image: { type: "string", id: 3 }, - expire: { type: "int64", id: 4 }, + pid: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + image: { type: 'string', id: 3 }, + expire: { type: 'int64', id: 4 }, }, }, VideoBadge: { fields: { - text: { type: "string", id: 1 }, - textColor: { type: "string", id: 2 }, - textColorNight: { type: "string", id: 3 }, - bgColor: { type: "string", id: 4 }, - bgColorNight: { type: "string", id: 5 }, - borderColor: { type: "string", id: 6 }, - borderColorNight: { type: "string", id: 7 }, - bgStyle: { type: "int32", id: 8 }, - bgAlpha: { type: "int32", id: 9 }, - bgAlphaNight: { type: "int32", id: 10 }, + text: { type: 'string', id: 1 }, + textColor: { type: 'string', id: 2 }, + textColorNight: { type: 'string', id: 3 }, + bgColor: { type: 'string', id: 4 }, + bgColorNight: { type: 'string', id: 5 }, + borderColor: { type: 'string', id: 6 }, + borderColorNight: { type: 'string', id: 7 }, + bgStyle: { type: 'int32', id: 8 }, + bgAlpha: { type: 'int32', id: 9 }, + bgAlphaNight: { type: 'int32', id: 10 }, }, }, VipInfo: { fields: { - type: { type: "int32", id: 1 }, - status: { type: "int32", id: 2 }, - dueDate: { type: "int64", id: 3 }, - label: { type: "VipLabel", id: 4 }, - themeType: { type: "int32", id: 5 }, - avatarSubscript: { type: "int32", id: 6 }, - nicknameColor: { type: "string", id: 7 }, + type: { type: 'int32', id: 1 }, + status: { type: 'int32', id: 2 }, + dueDate: { type: 'int64', id: 3 }, + label: { type: 'VipLabel', id: 4 }, + themeType: { type: 'int32', id: 5 }, + avatarSubscript: { type: 'int32', id: 6 }, + nicknameColor: { type: 'string', id: 7 }, }, }, VipLabel: { fields: { - path: { type: "string", id: 1 }, - text: { type: "string", id: 2 }, - labelTheme: { type: "string", id: 3 }, + path: { type: 'string', id: 1 }, + text: { type: 'string', id: 2 }, + labelTheme: { type: 'string', id: 3 }, }, }, NFTInfo: { fields: { - regionType: { type: "NFTRegionType", id: 1 }, - regionIcon: { type: "string", id: 2 }, - regionShowStatus: { type: "NFTShowStatus", id: 3 }, + regionType: { type: 'NFTRegionType', id: 1 }, + regionIcon: { type: 'string', id: 2 }, + regionShowStatus: { type: 'NFTShowStatus', id: 3 }, }, }, NFTRegionType: { @@ -9230,27 +9230,27 @@ const biliJson = { }, ModuleOpusSummary: { fields: { - title: { type: "Paragraph", id: 1 }, - summary: { type: "Paragraph", id: 2 }, - summaryJumpBtnText: { type: "string", id: 3 }, + title: { type: 'Paragraph', id: 1 }, + summary: { type: 'Paragraph', id: 2 }, + summaryJumpBtnText: { type: 'string', id: 3 }, covers: { - rule: "repeated", - type: "MdlDynDrawItem", + rule: 'repeated', + type: 'MdlDynDrawItem', id: 4, }, }, }, Paragraph: { oneofs: { - content: { oneof: ["text", "pic", "line", "card"] }, + content: { oneof: ['text', 'pic', 'line', 'card'] }, }, fields: { - paraType: { type: "ParagraphType", id: 1 }, - paraFormat: { type: "ParagraphFormat", id: 2 }, - text: { type: "TextParagraph", id: 3 }, - pic: { type: "PicParagraph", id: 4 }, - line: { type: "LineParagraph", id: 5 }, - card: { type: "CardParagraph", id: 6 }, + paraType: { type: 'ParagraphType', id: 1 }, + paraFormat: { type: 'ParagraphFormat', id: 2 }, + text: { type: 'TextParagraph', id: 3 }, + pic: { type: 'PicParagraph', id: 4 }, + line: { type: 'LineParagraph', id: 5 }, + card: { type: 'CardParagraph', id: 6 }, }, }, ParagraphType: { @@ -9267,8 +9267,8 @@ const biliJson = { }, ParagraphFormat: { fields: { - align: { type: "ParagraphAlign", id: 1 }, - listFormat: { type: "ListFormat", id: 2 }, + align: { type: 'ParagraphAlign', id: 1 }, + listFormat: { type: 'ListFormat', id: 2 }, }, }, ParagraphAlign: { @@ -9276,24 +9276,24 @@ const biliJson = { }, ListFormat: { fields: { - level: { type: "int32", id: 1 }, - order: { type: "int32", id: 2 }, - theme: { type: "string", id: 3 }, + level: { type: 'int32', id: 1 }, + order: { type: 'int32', id: 2 }, + theme: { type: 'string', id: 3 }, }, }, TextParagraph: { fields: { - nodes: { rule: "repeated", type: "TextNode", id: 1 }, + nodes: { rule: 'repeated', type: 'TextNode', id: 1 }, }, }, TextNode: { - oneofs: { text: { oneof: ["word", "emote", "link"] } }, + oneofs: { text: { oneof: ['word', 'emote', 'link'] } }, fields: { - nodeType: { type: "TextNodeType", id: 1 }, - rawText: { type: "string", id: 2 }, - word: { type: "WordNode", id: 3 }, - emote: { type: "EmoteNode", id: 4 }, - link: { type: "LinkNode", id: 5 }, + nodeType: { type: 'TextNodeType', id: 1 }, + rawText: { type: 'string', id: 2 }, + word: { type: 'WordNode', id: 3 }, + emote: { type: 'EmoteNode', id: 4 }, + link: { type: 'LinkNode', id: 5 }, }, }, TextNodeType: { @@ -9307,50 +9307,50 @@ const biliJson = { }, WordNode: { fields: { - words: { type: "string", id: 1 }, - fontSize: { type: "double", id: 2 }, - color: { type: "Colors", id: 3 }, - style: { type: "WordNodeStyle", id: 4 }, + words: { type: 'string', id: 1 }, + fontSize: { type: 'double', id: 2 }, + color: { type: 'Colors', id: 3 }, + style: { type: 'WordNodeStyle', id: 4 }, }, }, Colors: { fields: { - colorDay: { type: "string", id: 1 }, - colorNight: { type: "string", id: 2 }, + colorDay: { type: 'string', id: 1 }, + colorNight: { type: 'string', id: 2 }, }, }, WordNodeStyle: { fields: { - bold: { type: "bool", id: 1 }, - italic: { type: "bool", id: 2 }, - strikethrough: { type: "bool", id: 3 }, - underline: { type: "bool", id: 4 }, + bold: { type: 'bool', id: 1 }, + italic: { type: 'bool', id: 2 }, + strikethrough: { type: 'bool', id: 3 }, + underline: { type: 'bool', id: 4 }, }, }, EmoteNode: { fields: { - rawText: { type: "WordNode", id: 1 }, - emoteUrl: { type: "string", id: 2 }, - emoteWidth: { type: "EmoteSize", id: 3 }, + rawText: { type: 'WordNode', id: 1 }, + emoteUrl: { type: 'string', id: 2 }, + emoteWidth: { type: 'EmoteSize', id: 3 }, }, }, EmoteSize: { fields: { - width: { type: "double", id: 1 }, - emojiSize: { type: "int32", id: 2 }, + width: { type: 'double', id: 1 }, + emojiSize: { type: 'int32', id: 2 }, }, }, LinkNode: { fields: { - showText: { type: "WordNode", id: 1 }, - link: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, - iconSuffix: { type: "string", id: 4 }, - linkType: { type: "string", id: 5 }, - linkTypeEnum: { type: "LinkNodeType", id: 6 }, - bizId: { type: "string", id: 7 }, - timestamp: { type: "int64", id: 8 }, - goodsItem: { type: "GoodsItem", id: 9 }, + showText: { type: 'WordNode', id: 1 }, + link: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, + iconSuffix: { type: 'string', id: 4 }, + linkType: { type: 'string', id: 5 }, + linkTypeEnum: { type: 'LinkNodeType', id: 6 }, + bizId: { type: 'string', id: 7 }, + timestamp: { type: 'int64', id: 8 }, + goodsItem: { type: 'GoodsItem', id: 9 }, }, }, LinkNodeType: { @@ -9387,66 +9387,66 @@ const biliJson = { }, PicParagraph: { fields: { - pics: { type: "MdlDynDraw", id: 1 }, - style: { type: "PicParagraphStyle", id: 2 }, + pics: { type: 'MdlDynDraw', id: 1 }, + style: { type: 'PicParagraphStyle', id: 2 }, }, }, PicParagraphStyle: { values: { INVALID3: 0, NINE_CELL: 1, BIG_SCROLL: 2 }, }, LineParagraph: { - fields: { pic: { type: "MdlDynDrawItem", id: 1 } }, + fields: { pic: { type: 'MdlDynDrawItem', id: 1 } }, }, CardParagraph: { fields: { - additionalCard: { type: "ModuleAdditional", id: 1 }, + additionalCard: { type: 'ModuleAdditional', id: 1 }, }, }, OnlyFansProperty: { fields: { - hasPrivilege: { type: "bool", id: 1 }, - isOnlyFans: { type: "bool", id: 2 }, + hasPrivilege: { type: 'bool', id: 1 }, + isOnlyFans: { type: 'bool', id: 2 }, }, }, DynFeatureGate: { - fields: { enhancedInteraction: { type: "bool", id: 1 } }, + fields: { enhancedInteraction: { type: 'bool', id: 1 } }, }, ModuleNotice: { fields: { - identity: { type: "string", id: 1 }, - icon: { type: "string", id: 2 }, - title: { type: "string", id: 3 }, - url: { type: "string", id: 4 }, - noticeType: { type: "int32", id: 5 }, + identity: { type: 'string', id: 1 }, + icon: { type: 'string', id: 2 }, + title: { type: 'string', id: 3 }, + url: { type: 'string', id: 4 }, + noticeType: { type: 'int32', id: 5 }, }, }, ModuleCopyright: { fields: { - leftText: { type: "string", id: 1 }, - rightText: { type: "string", id: 2 }, + leftText: { type: 'string', id: 1 }, + rightText: { type: 'string', id: 2 }, }, }, ModuleParagraph: { fields: { - paragraph: { type: "Paragraph", id: 1 }, - isArticleTitle: { type: "bool", id: 2 }, - paraSpacing: { type: "ParaSpacing", id: 3 }, + paragraph: { type: 'Paragraph', id: 1 }, + isArticleTitle: { type: 'bool', id: 2 }, + paraSpacing: { type: 'ParaSpacing', id: 3 }, }, }, ParaSpacing: { fields: { - spacingBeforePara: { type: "double", id: 1 }, - spacingAfterPara: { type: "double", id: 2 }, - lineSpacing: { type: "double", id: 3 }, + spacingBeforePara: { type: 'double', id: 1 }, + spacingAfterPara: { type: 'double', id: 2 }, + lineSpacing: { type: 'double', id: 3 }, }, }, ModuleBlocked: { fields: { - icon: { type: "ImageSet", id: 1 }, - bgImg: { type: "ImageSet", id: 2 }, - hintMessage: { type: "string", id: 3 }, - actBtn: { type: "IconButton", id: 4 }, - blockStyle: { type: "MdlBlockedStyle", id: 5 }, + icon: { type: 'ImageSet', id: 1 }, + bgImg: { type: 'ImageSet', id: 2 }, + hintMessage: { type: 'string', id: 3 }, + actBtn: { type: 'IconButton', id: 4 }, + blockStyle: { type: 'MdlBlockedStyle', id: 5 }, }, }, MdlBlockedStyle: { @@ -9457,36 +9457,36 @@ const biliJson = { }, ImageSet: { fields: { - imgDay: { type: "string", id: 1 }, - imgDark: { type: "string", id: 2 }, + imgDay: { type: 'string', id: 1 }, + imgDark: { type: 'string', id: 2 }, }, }, OnlyFans: { fields: { - isOnlyFans: { type: "bool", id: 1 }, - badge: { type: "IconBadge", id: 2 }, + isOnlyFans: { type: 'bool', id: 1 }, + badge: { type: 'IconBadge', id: 2 }, }, }, TopicMergedResource: { fields: { - mergeType: { type: "int32", id: 1 }, - mergedResCnt: { type: "int32", id: 2 }, + mergeType: { type: 'int32', id: 1 }, + mergedResCnt: { type: 'int32', id: 2 }, }, }, ThreePointDynCoin: { fields: { - hadCoin: { type: "bool", id: 1 }, - coinNum: { type: "int64", id: 2 }, - coinBusiness: { type: "string", id: 3 }, - oid: { type: "int64", id: 4 }, + hadCoin: { type: 'bool', id: 1 }, + coinNum: { type: 'int64', id: 2 }, + coinBusiness: { type: 'string', id: 3 }, + oid: { type: 'int64', id: 4 }, }, }, ThreePointDynEdit: { fields: { - dynId: { type: "int64", id: 1 }, - originId: { type: "int64", id: 2 }, - isOriginDeleted: { type: "bool", id: 3 }, - url: { type: "string", id: 4 }, + dynId: { type: 'int64', id: 1 }, + originId: { type: 'int64', id: 2 }, + isOriginDeleted: { type: 'bool', id: 3 }, + url: { type: 'string', id: 4 }, }, }, }, @@ -9496,79 +9496,79 @@ const biliJson = { playurl: { nested: { v1: { - options: { java_package: "com.smile.bilibili.model" }, + options: { java_package: 'com.smile.bilibili.model' }, nested: { PlayViewReply: { fields: { - videoInfo: { type: "VideoInfo", id: 1 }, - playConf: { type: "PlayAbilityConf", id: 2 }, - upgradeLimit: { type: "UpgradeLimit", id: 3 }, - chronos: { type: "Chronos", id: 4 }, - playArc: { type: "PlayArcConf", id: 5 }, - event: { type: "Event", id: 6 }, - ab: { type: "AB", id: 7 }, - playLimit: { type: "PlayLimit", id: 8 }, + videoInfo: { type: 'VideoInfo', id: 1 }, + playConf: { type: 'PlayAbilityConf', id: 2 }, + upgradeLimit: { type: 'UpgradeLimit', id: 3 }, + chronos: { type: 'Chronos', id: 4 }, + playArc: { type: 'PlayArcConf', id: 5 }, + event: { type: 'Event', id: 6 }, + ab: { type: 'AB', id: 7 }, + playLimit: { type: 'PlayLimit', id: 8 }, }, }, VideoInfo: { fields: { - quality: { type: "int32", id: 1 }, - format: { type: "string", id: 2 }, - timelength: { type: "int64", id: 3 }, - videoCodecid: { type: "int32", id: 4 }, - streamList: { rule: "repeated", type: "Stream", id: 5 }, + quality: { type: 'int32', id: 1 }, + format: { type: 'string', id: 2 }, + timelength: { type: 'int64', id: 3 }, + videoCodecid: { type: 'int32', id: 4 }, + streamList: { rule: 'repeated', type: 'Stream', id: 5 }, dashAudio: { - rule: "repeated", - type: "DashItem", + rule: 'repeated', + type: 'DashItem', id: 6, }, - dolby: { type: "DolbyItem", id: 7 }, - volume: { type: "VolumeInfo", id: 8 }, - lossLessItem: { type: "LossLessItem", id: 9 }, + dolby: { type: 'DolbyItem', id: 7 }, + volume: { type: 'VolumeInfo', id: 8 }, + lossLessItem: { type: 'LossLessItem', id: 9 }, }, }, LossLessItem: { fields: { - isLosslessAudio: { type: "bool", id: 1 }, - audio: { type: "DashItem", id: 2 }, - needVip: { type: "bool", id: 3 }, + isLosslessAudio: { type: 'bool', id: 1 }, + audio: { type: 'DashItem', id: 2 }, + needVip: { type: 'bool', id: 3 }, }, }, Stream: { oneofs: { - content: { oneof: ["dashVideo", "segmentVideo"] }, + content: { oneof: ['dashVideo', 'segmentVideo'] }, }, fields: { - streamInfo: { type: "StreamInfo", id: 1 }, - dashVideo: { type: "DashVideo", id: 2 }, - segmentVideo: { type: "SegmentVideo", id: 3 }, + streamInfo: { type: 'StreamInfo', id: 1 }, + dashVideo: { type: 'DashVideo', id: 2 }, + segmentVideo: { type: 'SegmentVideo', id: 3 }, }, }, StreamInfo: { fields: { - quality: { type: "int32", id: 1 }, - format: { type: "string", id: 2 }, - description: { type: "string", id: 3 }, - errCode: { type: "PlayErr", id: 4 }, - limit: { type: "StreamLimit", id: 5 }, - needVip: { type: "bool", id: 6 }, - needLogin: { type: "bool", id: 7 }, - intact: { type: "bool", id: 8 }, - noRexcode: { type: "bool", id: 9 }, - attribute: { type: "int64", id: 10 }, - newDescription: { type: "string", id: 11 }, - displayDesc: { type: "string", id: 12 }, - superscript: { type: "string", id: 13 }, - vipFree: { type: "bool", id: 14 }, - subtitle: { type: "string", id: 15 }, - scheme: { type: "Scheme", id: 16 }, - supportDrm: { type: "bool", id: 17 }, + quality: { type: 'int32', id: 1 }, + format: { type: 'string', id: 2 }, + description: { type: 'string', id: 3 }, + errCode: { type: 'PlayErr', id: 4 }, + limit: { type: 'StreamLimit', id: 5 }, + needVip: { type: 'bool', id: 6 }, + needLogin: { type: 'bool', id: 7 }, + intact: { type: 'bool', id: 8 }, + noRexcode: { type: 'bool', id: 9 }, + attribute: { type: 'int64', id: 10 }, + newDescription: { type: 'string', id: 11 }, + displayDesc: { type: 'string', id: 12 }, + superscript: { type: 'string', id: 13 }, + vipFree: { type: 'bool', id: 14 }, + subtitle: { type: 'string', id: 15 }, + scheme: { type: 'Scheme', id: 16 }, + supportDrm: { type: 'bool', id: 17 }, }, }, Scheme: { fields: { - actionType: { type: "ActionType", id: 1 }, - toast: { type: "string", id: 2 }, + actionType: { type: 'ActionType', id: 1 }, + toast: { type: 'string', id: 2 }, }, }, ActionType: { values: { UNKNOWN: 0, SHOW_TOAST: 1 } }, @@ -9577,117 +9577,117 @@ const biliJson = { }, StreamLimit: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - msg: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + msg: { type: 'string', id: 3 }, }, }, DashVideo: { fields: { - baseUrl: { type: "string", id: 1 }, - backupUrl: { rule: "repeated", type: "string", id: 2 }, - bandwidth: { type: "int32", id: 3 }, - codecid: { type: "int32", id: 4 }, - md5: { type: "string", id: 5 }, - size: { type: "int64", id: 6 }, - audioId: { type: "int32", id: 7 }, - noRexcode: { type: "bool", id: 8 }, - frameRate: { type: "string", id: 9 }, - width: { type: "int32", id: 10 }, - height: { type: "int32", id: 11 }, - widevinePssh: { type: "string", id: 12 }, + baseUrl: { type: 'string', id: 1 }, + backupUrl: { rule: 'repeated', type: 'string', id: 2 }, + bandwidth: { type: 'int32', id: 3 }, + codecid: { type: 'int32', id: 4 }, + md5: { type: 'string', id: 5 }, + size: { type: 'int64', id: 6 }, + audioId: { type: 'int32', id: 7 }, + noRexcode: { type: 'bool', id: 8 }, + frameRate: { type: 'string', id: 9 }, + width: { type: 'int32', id: 10 }, + height: { type: 'int32', id: 11 }, + widevinePssh: { type: 'string', id: 12 }, }, }, SegmentVideo: { fields: { segment: { - rule: "repeated", - type: "ResponseUrl", + rule: 'repeated', + type: 'ResponseUrl', id: 1, }, }, }, ResponseUrl: { fields: { - order: { type: "int32", id: 1 }, - length: { type: "int64", id: 2 }, - size: { type: "int64", id: 3 }, - url: { type: "string", id: 4 }, - backupUrl: { rule: "repeated", type: "string", id: 5 }, - md5: { type: "string", id: 6 }, + order: { type: 'int32', id: 1 }, + length: { type: 'int64', id: 2 }, + size: { type: 'int64', id: 3 }, + url: { type: 'string', id: 4 }, + backupUrl: { rule: 'repeated', type: 'string', id: 5 }, + md5: { type: 'string', id: 6 }, }, }, DashItem: { fields: { - id: { type: "int32", id: 1 }, - baseUrl: { type: "string", id: 2 }, - backupUrl: { rule: "repeated", type: "string", id: 3 }, - bandwidth: { type: "int32", id: 4 }, - codecid: { type: "int32", id: 5 }, - md5: { type: "string", id: 6 }, - size: { type: "int64", id: 7 }, - frameRate: { type: "string", id: 8 }, - widevinePssh: { type: "string", id: 9 }, + id: { type: 'int32', id: 1 }, + baseUrl: { type: 'string', id: 2 }, + backupUrl: { rule: 'repeated', type: 'string', id: 3 }, + bandwidth: { type: 'int32', id: 4 }, + codecid: { type: 'int32', id: 5 }, + md5: { type: 'string', id: 6 }, + size: { type: 'int64', id: 7 }, + frameRate: { type: 'string', id: 8 }, + widevinePssh: { type: 'string', id: 9 }, }, }, DolbyItem: { fields: { - type: { type: "Type", id: 1 }, - audio: { rule: "repeated", type: "DashItem", id: 2 }, + type: { type: 'Type', id: 1 }, + audio: { rule: 'repeated', type: 'DashItem', id: 2 }, }, }, Type: { values: { NONE: 0, COMMON: 1, ATMOS: 2 } }, VolumeInfo: { fields: { - measuredI: { type: "double", id: 1 }, - measuredLra: { type: "double", id: 2 }, - measuredTp: { type: "double", id: 3 }, - measuredThreshold: { type: "double", id: 4 }, - targetOffset: { type: "double", id: 5 }, - targetI: { type: "double", id: 6 }, - targetTp: { type: "double", id: 7 }, + measuredI: { type: 'double', id: 1 }, + measuredLra: { type: 'double', id: 2 }, + measuredTp: { type: 'double', id: 3 }, + measuredThreshold: { type: 'double', id: 4 }, + targetOffset: { type: 'double', id: 5 }, + targetI: { type: 'double', id: 6 }, + targetTp: { type: 'double', id: 7 }, }, }, PlayAbilityConf: { fields: { - backgroundPlayConf: { type: "CloudConf", id: 1 }, - flipConf: { type: "CloudConf", id: 2 }, - castConf: { type: "CloudConf", id: 3 }, - feedbackConf: { type: "CloudConf", id: 4 }, - subtitleConf: { type: "CloudConf", id: 5 }, - playbackRateConf: { type: "CloudConf", id: 6 }, - timeUpConf: { type: "CloudConf", id: 7 }, - playbackModeConf: { type: "CloudConf", id: 8 }, - scaleModeConf: { type: "CloudConf", id: 9 }, - likeConf: { type: "CloudConf", id: 10 }, - dislikeConf: { type: "CloudConf", id: 11 }, - coinConf: { type: "CloudConf", id: 12 }, - elecConf: { type: "CloudConf", id: 13 }, - shareConf: { type: "CloudConf", id: 14 }, - screenShotConf: { type: "CloudConf", id: 15 }, - lockScreenConf: { type: "CloudConf", id: 16 }, - recommendConf: { type: "CloudConf", id: 17 }, - playbackSpeedConf: { type: "CloudConf", id: 18 }, - definitionConf: { type: "CloudConf", id: 19 }, - selectionsConf: { type: "CloudConf", id: 20 }, - nextConf: { type: "CloudConf", id: 21 }, - editDmConf: { type: "CloudConf", id: 22 }, - smallWindowConf: { type: "CloudConf", id: 23 }, - shakeConf: { type: "CloudConf", id: 24 }, - outerDmConf: { type: "CloudConf", id: 25 }, - innerDmConf: { type: "CloudConf", id: 26 }, - panoramaConf: { type: "CloudConf", id: 27 }, - dolbyConf: { type: "CloudConf", id: 28 }, - colorFilterConf: { type: "CloudConf", id: 29 }, - lossLessConf: { type: "CloudConf", id: 30 }, + backgroundPlayConf: { type: 'CloudConf', id: 1 }, + flipConf: { type: 'CloudConf', id: 2 }, + castConf: { type: 'CloudConf', id: 3 }, + feedbackConf: { type: 'CloudConf', id: 4 }, + subtitleConf: { type: 'CloudConf', id: 5 }, + playbackRateConf: { type: 'CloudConf', id: 6 }, + timeUpConf: { type: 'CloudConf', id: 7 }, + playbackModeConf: { type: 'CloudConf', id: 8 }, + scaleModeConf: { type: 'CloudConf', id: 9 }, + likeConf: { type: 'CloudConf', id: 10 }, + dislikeConf: { type: 'CloudConf', id: 11 }, + coinConf: { type: 'CloudConf', id: 12 }, + elecConf: { type: 'CloudConf', id: 13 }, + shareConf: { type: 'CloudConf', id: 14 }, + screenShotConf: { type: 'CloudConf', id: 15 }, + lockScreenConf: { type: 'CloudConf', id: 16 }, + recommendConf: { type: 'CloudConf', id: 17 }, + playbackSpeedConf: { type: 'CloudConf', id: 18 }, + definitionConf: { type: 'CloudConf', id: 19 }, + selectionsConf: { type: 'CloudConf', id: 20 }, + nextConf: { type: 'CloudConf', id: 21 }, + editDmConf: { type: 'CloudConf', id: 22 }, + smallWindowConf: { type: 'CloudConf', id: 23 }, + shakeConf: { type: 'CloudConf', id: 24 }, + outerDmConf: { type: 'CloudConf', id: 25 }, + innerDmConf: { type: 'CloudConf', id: 26 }, + panoramaConf: { type: 'CloudConf', id: 27 }, + dolbyConf: { type: 'CloudConf', id: 28 }, + colorFilterConf: { type: 'CloudConf', id: 29 }, + lossLessConf: { type: 'CloudConf', id: 30 }, }, }, CloudConf: { fields: { - show: { type: "bool", id: 1 }, - confType: { type: "ConfType", id: 2 }, - fieldValue: { type: "FieldValue", id: 3 }, - confValue: { type: "ConfValue", id: 4 }, + show: { type: 'bool', id: 1 }, + confType: { type: 'ConfType', id: 2 }, + fieldValue: { type: 'FieldValue', id: 3 }, + confValue: { type: 'ConfValue', id: 4 }, }, }, ConfType: { @@ -9726,111 +9726,111 @@ const biliJson = { }, }, FieldValue: { - oneofs: { value: { oneof: ["switch"] } }, - fields: { switch: { type: "bool", id: 1 } }, + oneofs: { value: { oneof: ['switch'] } }, + fields: { switch: { type: 'bool', id: 1 } }, }, ConfValue: { - oneofs: { value: { oneof: ["switch", "selected"] } }, + oneofs: { value: { oneof: ['switch', 'selected'] } }, fields: { - switch: { type: "bool", id: 1 }, - selected: { type: "int64", id: 2 }, + switch: { type: 'bool', id: 1 }, + selected: { type: 'int64', id: 2 }, }, }, UpgradeLimit: { fields: { - code: { type: "int32", id: 1 }, - message: { type: "string", id: 2 }, - image: { type: "string", id: 3 }, - button: { type: "UpgradeButton", id: 4 }, + code: { type: 'int32', id: 1 }, + message: { type: 'string', id: 2 }, + image: { type: 'string', id: 3 }, + button: { type: 'UpgradeButton', id: 4 }, }, }, UpgradeButton: { fields: { - title: { type: "string", id: 1 }, - link: { type: "string", id: 2 }, + title: { type: 'string', id: 1 }, + link: { type: 'string', id: 2 }, }, }, Chronos: { fields: { - md5: { type: "string", id: 1 }, - file: { type: "string", id: 2 }, + md5: { type: 'string', id: 1 }, + file: { type: 'string', id: 2 }, }, }, PlayArcConf: { fields: { - backgroundPlayConf: { type: "ArcConf", id: 1 }, - flipConf: { type: "ArcConf", id: 2 }, - castConf: { type: "ArcConf", id: 3 }, - feedbackConf: { type: "ArcConf", id: 4 }, - subtitleConf: { type: "ArcConf", id: 5 }, - playbackRateConf: { type: "ArcConf", id: 6 }, - timeUpConf: { type: "ArcConf", id: 7 }, - playbackModeConf: { type: "ArcConf", id: 8 }, - scaleModeConf: { type: "ArcConf", id: 9 }, - likeConf: { type: "ArcConf", id: 10 }, - dislikeConf: { type: "ArcConf", id: 11 }, - coinConf: { type: "ArcConf", id: 12 }, - elecConf: { type: "ArcConf", id: 13 }, - shareConf: { type: "ArcConf", id: 14 }, - screenShotConf: { type: "ArcConf", id: 15 }, - lockScreenConf: { type: "ArcConf", id: 16 }, - recommendConf: { type: "ArcConf", id: 17 }, - playbackSpeedConf: { type: "ArcConf", id: 18 }, - definitionConf: { type: "ArcConf", id: 19 }, - selectionsConf: { type: "ArcConf", id: 20 }, - nextConf: { type: "ArcConf", id: 21 }, - editDmConf: { type: "ArcConf", id: 22 }, - smallWindowConf: { type: "ArcConf", id: 23 }, - shakeConf: { type: "ArcConf", id: 24 }, - outerDmConf: { type: "ArcConf", id: 25 }, - innerDmConf: { type: "ArcConf", id: 26 }, - panoramaConf: { type: "ArcConf", id: 27 }, - dolbyConf: { type: "ArcConf", id: 28 }, - screenRecordingConf: { type: "ArcConf", id: 29 }, - colorFilterConf: { type: "ArcConf", id: 30 }, - lossLessConf: { type: "ArcConf", id: 31 }, + backgroundPlayConf: { type: 'ArcConf', id: 1 }, + flipConf: { type: 'ArcConf', id: 2 }, + castConf: { type: 'ArcConf', id: 3 }, + feedbackConf: { type: 'ArcConf', id: 4 }, + subtitleConf: { type: 'ArcConf', id: 5 }, + playbackRateConf: { type: 'ArcConf', id: 6 }, + timeUpConf: { type: 'ArcConf', id: 7 }, + playbackModeConf: { type: 'ArcConf', id: 8 }, + scaleModeConf: { type: 'ArcConf', id: 9 }, + likeConf: { type: 'ArcConf', id: 10 }, + dislikeConf: { type: 'ArcConf', id: 11 }, + coinConf: { type: 'ArcConf', id: 12 }, + elecConf: { type: 'ArcConf', id: 13 }, + shareConf: { type: 'ArcConf', id: 14 }, + screenShotConf: { type: 'ArcConf', id: 15 }, + lockScreenConf: { type: 'ArcConf', id: 16 }, + recommendConf: { type: 'ArcConf', id: 17 }, + playbackSpeedConf: { type: 'ArcConf', id: 18 }, + definitionConf: { type: 'ArcConf', id: 19 }, + selectionsConf: { type: 'ArcConf', id: 20 }, + nextConf: { type: 'ArcConf', id: 21 }, + editDmConf: { type: 'ArcConf', id: 22 }, + smallWindowConf: { type: 'ArcConf', id: 23 }, + shakeConf: { type: 'ArcConf', id: 24 }, + outerDmConf: { type: 'ArcConf', id: 25 }, + innerDmConf: { type: 'ArcConf', id: 26 }, + panoramaConf: { type: 'ArcConf', id: 27 }, + dolbyConf: { type: 'ArcConf', id: 28 }, + screenRecordingConf: { type: 'ArcConf', id: 29 }, + colorFilterConf: { type: 'ArcConf', id: 30 }, + lossLessConf: { type: 'ArcConf', id: 31 }, }, }, ArcConf: { fields: { - isSupport: { type: "bool", id: 1 }, - disabled: { type: "bool", id: 2 }, - extraContent: { type: "ExtraContent", id: 3 }, + isSupport: { type: 'bool', id: 1 }, + disabled: { type: 'bool', id: 2 }, + extraContent: { type: 'ExtraContent', id: 3 }, unsupportScene: { - rule: "repeated", - type: "int64", + rule: 'repeated', + type: 'int64', id: 4, }, }, }, ExtraContent: { fields: { - disabledReason: { type: "string", id: 1 }, - disabledCode: { type: "int64", id: 2 }, + disabledReason: { type: 'string', id: 1 }, + disabledCode: { type: 'int64', id: 2 }, }, }, - Event: { fields: { shake: { type: "Shake", id: 1 } } }, - Shake: { fields: { file: { type: "string", id: 1 } } }, + Event: { fields: { shake: { type: 'Shake', id: 1 } } }, + Shake: { fields: { file: { type: 'string', id: 1 } } }, AB: { fields: { - glance: { type: "Glance", id: 1 }, - group: { type: "Group", id: 2 }, + glance: { type: 'Glance', id: 1 }, + group: { type: 'Group', id: 2 }, }, }, Group: { values: { UnknownGroup: 0, A: 1, B: 2, C: 3 } }, Glance: { fields: { - canWatch: { type: "bool", id: 1 }, - times: { type: "int64", id: 2 }, - duration: { type: "int64", id: 3 }, + canWatch: { type: 'bool', id: 1 }, + times: { type: 'int64', id: 2 }, + duration: { type: 'int64', id: 3 }, }, }, PlayLimit: { fields: { - code: { type: "PlayLimitCode", id: 1 }, - message: { type: "string", id: 2 }, - subMessage: { type: "string", id: 3 }, - button: { type: "ButtonStyle", id: 4 }, + code: { type: 'PlayLimitCode', id: 1 }, + message: { type: 'string', id: 2 }, + subMessage: { type: 'string', id: 3 }, + button: { type: 'ButtonStyle', id: 4 }, }, }, PlayLimitCode: { @@ -9838,10 +9838,10 @@ const biliJson = { }, ButtonStyle: { fields: { - text: { type: "string", id: 1 }, - textColor: { type: "string", id: 2 }, - bgColor: { type: "string", id: 3 }, - jumpLink: { type: "string", id: 4 }, + text: { type: 'string', id: 1 }, + textColor: { type: 'string', id: 2 }, + bgColor: { type: 'string', id: 3 }, + jumpLink: { type: 'string', id: 4 }, }, }, }, @@ -9851,141 +9851,141 @@ const biliJson = { view: { nested: { v1: { - options: { java_package: "com.smile.bilibili.model" }, + options: { java_package: 'com.smile.bilibili.model' }, nested: { ViewReply: { fields: { - arc: { type: "bilibili.app.archive.v1.Arc", id: 1 }, - pages: { rule: "repeated", type: "ViewPage", id: 2 }, - ownerExt: { type: "OnwerExt", id: 3 }, - reqUser: { type: "ReqUser", id: 4 }, - tag: { rule: "repeated", type: "Tag", id: 5 }, - tIcon: { keyType: "string", type: "TIcon", id: 6 }, - season: { type: "Season", id: 7 }, - elecRank: { type: "ElecRank", id: 8 }, - history: { type: "History", id: 9 }, - relates: { rule: "repeated", type: "Relate", id: 10 }, - dislike: { type: "Dislike", id: 11 }, - playerIcon: { type: "PlayerIcon", id: 12 }, - vipActive: { type: "string", id: 13 }, - bvid: { type: "string", id: 14 }, - honor: { type: "Honor", id: 15 }, + arc: { type: 'bilibili.app.archive.v1.Arc', id: 1 }, + pages: { rule: 'repeated', type: 'ViewPage', id: 2 }, + ownerExt: { type: 'OnwerExt', id: 3 }, + reqUser: { type: 'ReqUser', id: 4 }, + tag: { rule: 'repeated', type: 'Tag', id: 5 }, + tIcon: { keyType: 'string', type: 'TIcon', id: 6 }, + season: { type: 'Season', id: 7 }, + elecRank: { type: 'ElecRank', id: 8 }, + history: { type: 'History', id: 9 }, + relates: { rule: 'repeated', type: 'Relate', id: 10 }, + dislike: { type: 'Dislike', id: 11 }, + playerIcon: { type: 'PlayerIcon', id: 12 }, + vipActive: { type: 'string', id: 13 }, + bvid: { type: 'string', id: 14 }, + honor: { type: 'Honor', id: 15 }, relateTab: { - rule: "repeated", - type: "RelateTab", + rule: 'repeated', + type: 'RelateTab', id: 16, }, - activityUrl: { type: "string", id: 17 }, - bgm: { rule: "repeated", type: "Bgm", id: 18 }, - staff: { rule: "repeated", type: "Staff", id: 19 }, - argueMsg: { type: "string", id: 20 }, - shortLink: { type: "string", id: 21 }, - playParam: { type: "int32", id: 22 }, - label: { type: "Label", id: 23 }, - ugcSeason: { type: "UgcSeason", id: 24 }, - config: { type: "Config", id: 25 }, - shareSubtitle: { type: "string", id: 26 }, - interaction: { type: "Interaction", id: 27 }, - ecode: { type: "ECode", id: 28 }, - customConfig: { type: "CustomConfig", id: 29 }, - cms: { rule: "repeated", type: "CM", id: 30 }, - cmConfig: { type: "CMConfig", id: 31 }, - tab: { type: "Tab", id: 32 }, - rank: { type: "Rank", id: 33 }, + activityUrl: { type: 'string', id: 17 }, + bgm: { rule: 'repeated', type: 'Bgm', id: 18 }, + staff: { rule: 'repeated', type: 'Staff', id: 19 }, + argueMsg: { type: 'string', id: 20 }, + shortLink: { type: 'string', id: 21 }, + playParam: { type: 'int32', id: 22 }, + label: { type: 'Label', id: 23 }, + ugcSeason: { type: 'UgcSeason', id: 24 }, + config: { type: 'Config', id: 25 }, + shareSubtitle: { type: 'string', id: 26 }, + interaction: { type: 'Interaction', id: 27 }, + ecode: { type: 'ECode', id: 28 }, + customConfig: { type: 'CustomConfig', id: 29 }, + cms: { rule: 'repeated', type: 'CM', id: 30 }, + cmConfig: { type: 'CMConfig', id: 31 }, + tab: { type: 'Tab', id: 32 }, + rank: { type: 'Rank', id: 33 }, tfPanelCustomized: { - type: "TFPanelCustomized", + type: 'TFPanelCustomized', id: 34, }, - upAct: { type: "UpAct", id: 35 }, - userGarb: { type: "UserGarb", id: 36 }, - activitySeason: { type: "ActivitySeason", id: 37 }, - badgeUrl: { type: "string", id: 38 }, - liveOrderInfo: { type: "LiveOrderInfo", id: 39 }, - descV2: { rule: "repeated", type: "DescV2", id: 40 }, - cmIpad: { type: "CmIpad", id: 41 }, + upAct: { type: 'UpAct', id: 35 }, + userGarb: { type: 'UserGarb', id: 36 }, + activitySeason: { type: 'ActivitySeason', id: 37 }, + badgeUrl: { type: 'string', id: 38 }, + liveOrderInfo: { type: 'LiveOrderInfo', id: 39 }, + descV2: { rule: 'repeated', type: 'DescV2', id: 40 }, + cmIpad: { type: 'CmIpad', id: 41 }, sticker: { - rule: "repeated", - type: "ViewMaterial", + rule: 'repeated', + type: 'ViewMaterial', id: 42, }, - upLikeImg: { type: "UpLikeImg", id: 43 }, - likeCustom: { type: "LikeCustom", id: 44 }, - descTag: { rule: "repeated", type: "Tag", id: 45 }, - specialCell: { type: "SpecialCell", id: 46 }, - online: { type: "Online", id: 47 }, - cmUnderPlayer: { type: "google.protobuf.Any", id: 48 }, + upLikeImg: { type: 'UpLikeImg', id: 43 }, + likeCustom: { type: 'LikeCustom', id: 44 }, + descTag: { rule: 'repeated', type: 'Tag', id: 45 }, + specialCell: { type: 'SpecialCell', id: 46 }, + online: { type: 'Online', id: 47 }, + cmUnderPlayer: { type: 'google.protobuf.Any', id: 48 }, videoSource: { - rule: "repeated", - type: "ViewMaterial", + rule: 'repeated', + type: 'ViewMaterial', id: 49, }, specialCellNew: { - rule: "repeated", - type: "SpecialCell", + rule: 'repeated', + type: 'SpecialCell', id: 50, }, - premiere: { type: "PremiereResource", id: 51 }, - refreshSpecialCell: { type: "bool", id: 52 }, - materialLeft: { type: "MaterialLeft", id: 53 }, - notesCount: { type: "int64", id: 54 }, - pullAction: { type: "PullClientAction", id: 55 }, - arcExtra: { type: "ArcExtra", id: 56 }, - pagination: { type: "PaginationReply", id: 57 }, - likeAnimation: { type: "LikeAnimation", id: 58 }, - replyPreface: { type: "ReplyStyle", id: 59 }, - refreshPage: { type: "RefreshPage", id: 60 }, - controlConfig: { type: "ControlConfig", id: 62 }, - upViewMaterial: { type: "UpViewMaterial", id: 63 }, - userRelation: { type: "UserRelation", id: 64 }, - coinStyle: { type: "CoinStyle", id: 65 }, - rabbitYear: { type: "RabbitYear", id: 66 }, + premiere: { type: 'PremiereResource', id: 51 }, + refreshSpecialCell: { type: 'bool', id: 52 }, + materialLeft: { type: 'MaterialLeft', id: 53 }, + notesCount: { type: 'int64', id: 54 }, + pullAction: { type: 'PullClientAction', id: 55 }, + arcExtra: { type: 'ArcExtra', id: 56 }, + pagination: { type: 'PaginationReply', id: 57 }, + likeAnimation: { type: 'LikeAnimation', id: 58 }, + replyPreface: { type: 'ReplyStyle', id: 59 }, + refreshPage: { type: 'RefreshPage', id: 60 }, + controlConfig: { type: 'ControlConfig', id: 62 }, + upViewMaterial: { type: 'UpViewMaterial', id: 63 }, + userRelation: { type: 'UserRelation', id: 64 }, + coinStyle: { type: 'CoinStyle', id: 65 }, + rabbitYear: { type: 'RabbitYear', id: 66 }, }, }, MaterialLeft: { fields: { - icon: { type: "string", id: 1 }, - text: { type: "string", id: 2 }, - url: { type: "string", id: 3 }, - leftType: { type: "string", id: 4 }, - param: { type: "string", id: 5 }, - operationalType: { type: "string", id: 6 }, - staticIcon: { type: "string", id: 7 }, + icon: { type: 'string', id: 1 }, + text: { type: 'string', id: 2 }, + url: { type: 'string', id: 3 }, + leftType: { type: 'string', id: 4 }, + param: { type: 'string', id: 5 }, + operationalType: { type: 'string', id: 6 }, + staticIcon: { type: 'string', id: 7 }, }, }, PremiereResource: { fields: { - premiere: { type: "Premiere", id: 1 }, - reserve: { type: "PremiereReserve", id: 2 }, - text: { type: "PremiereText", id: 3 }, + premiere: { type: 'Premiere', id: 1 }, + reserve: { type: 'PremiereReserve', id: 2 }, + text: { type: 'PremiereText', id: 3 }, }, }, PremiereText: { fields: { - title: { type: "string", id: 1 }, - subtitle_: { type: "string", id: 2 }, - onlineText_: { type: "string", id: 3 }, - onlineIcon_: { type: "string", id: 4 }, - onlineIconDark_: { type: "string", id: 5 }, - introTitle: { type: "string", id: 6 }, - introIcon: { type: "string", id: 7 }, - guidancePulldown: { type: "string", id: 8 }, - guidanceEntry: { type: "string", id: 9 }, - introIconNight: { type: "string", id: 10 }, + title: { type: 'string', id: 1 }, + subtitle_: { type: 'string', id: 2 }, + onlineText_: { type: 'string', id: 3 }, + onlineIcon_: { type: 'string', id: 4 }, + onlineIconDark_: { type: 'string', id: 5 }, + introTitle: { type: 'string', id: 6 }, + introIcon: { type: 'string', id: 7 }, + guidancePulldown: { type: 'string', id: 8 }, + guidanceEntry: { type: 'string', id: 9 }, + introIconNight: { type: 'string', id: 10 }, }, }, PremiereReserve: { fields: { - reserveId: { type: "int64", id: 1 }, - count: { type: "int64", id: 2 }, - isFollow: { type: "bool", id: 3 }, + reserveId: { type: 'int64', id: 1 }, + count: { type: 'int64', id: 2 }, + isFollow: { type: 'bool', id: 3 }, }, }, Premiere: { fields: { - premiereState: { type: "PremiereState", id: 1 }, - serviceTime: { type: "int64", id: 3 }, - startTime: { type: "int64", id: 2 }, - roomId: { type: "int64", id: 4 }, + premiereState: { type: 'PremiereState', id: 1 }, + serviceTime: { type: 'int64', id: 3 }, + startTime: { type: 'int64', id: 2 }, + roomId: { type: 'int64', id: 4 }, }, }, PremiereState: { @@ -9998,75 +9998,75 @@ const biliJson = { }, Online: { fields: { - onlineShow: { type: "bool", id: 1 }, - playerOnlineLogo: { type: "string", id: 2 }, + onlineShow: { type: 'bool', id: 1 }, + playerOnlineLogo: { type: 'string', id: 2 }, }, }, SpecialCell: { fields: { - icon: { type: "string", id: 1 }, - iconNight: { type: "string", id: 2 }, - text: { type: "string", id: 3 }, - textColor: { type: "string", id: 4 }, - textColorNight: { type: "string", id: 5 }, - jumpUrl: { type: "string", id: 6 }, - cellType: { type: "string", id: 7 }, - cellBgcolor: { type: "string", id: 8 }, - cellBgcolorNight: { type: "string", id: 9 }, - param: { type: "string", id: 10 }, - pageTitle: { type: "string", id: 11 }, - jumpType: { type: "string", id: 12 }, - endIcon: { type: "string", id: 13 }, - endIconNight: { type: "string", id: 14 }, - notesCount: { type: "int64", id: 15 }, - cellFluid: { type: "CellFluid", id: 16 }, + icon: { type: 'string', id: 1 }, + iconNight: { type: 'string', id: 2 }, + text: { type: 'string', id: 3 }, + textColor: { type: 'string', id: 4 }, + textColorNight: { type: 'string', id: 5 }, + jumpUrl: { type: 'string', id: 6 }, + cellType: { type: 'string', id: 7 }, + cellBgcolor: { type: 'string', id: 8 }, + cellBgcolorNight: { type: 'string', id: 9 }, + param: { type: 'string', id: 10 }, + pageTitle: { type: 'string', id: 11 }, + jumpType: { type: 'string', id: 12 }, + endIcon: { type: 'string', id: 13 }, + endIconNight: { type: 'string', id: 14 }, + notesCount: { type: 'int64', id: 15 }, + cellFluid: { type: 'CellFluid', id: 16 }, }, }, LikeCustom: { fields: { - likeSwitch: { type: "bool", id: 1 }, - fullToHalfProgress: { type: "int64", id: 2 }, - nonFullProgress: { type: "int64", id: 3 }, - updateCount: { type: "int64", id: 4 }, - immediatelyUpgrade: { type: "bool", id: 5 }, - likeComment: { type: "LikeComment", id: 6 }, + likeSwitch: { type: 'bool', id: 1 }, + fullToHalfProgress: { type: 'int64', id: 2 }, + nonFullProgress: { type: 'int64', id: 3 }, + updateCount: { type: 'int64', id: 4 }, + immediatelyUpgrade: { type: 'bool', id: 5 }, + likeComment: { type: 'LikeComment', id: 6 }, }, }, UpLikeImg: { fields: { - preImg: { type: "string", id: 1 }, - sucImg: { type: "string", id: 2 }, - content: { type: "string", id: 3 }, - type: { type: "int64", id: 4 }, + preImg: { type: 'string', id: 1 }, + sucImg: { type: 'string', id: 2 }, + content: { type: 'string', id: 3 }, + type: { type: 'int64', id: 4 }, }, }, ViewMaterial: { fields: { - oid: { type: "int64", id: 1 }, - mid: { type: "int64", id: 2 }, - title: { type: "string", id: 3 }, - author: { type: "string", id: 4 }, - jumpUrl: { type: "string", id: 5 }, + oid: { type: 'int64', id: 1 }, + mid: { type: 'int64', id: 2 }, + title: { type: 'string', id: 3 }, + author: { type: 'string', id: 4 }, + jumpUrl: { type: 'string', id: 5 }, }, }, CmIpad: { fields: { - cm: { type: "CM", id: 1 }, + cm: { type: 'CM', id: 1 }, author: { - type: "bilibili.app.archive.v1.Author", + type: 'bilibili.app.archive.v1.Author', id: 2, }, - stat: { type: "bilibili.app.archive.v1.Stat", id: 3 }, - duration: { type: "int64", id: 4 }, - aid: { type: "int64", id: 5 }, + stat: { type: 'bilibili.app.archive.v1.Stat', id: 3 }, + duration: { type: 'int64', id: 4 }, + aid: { type: 'int64', id: 5 }, }, }, DescV2: { fields: { - text: { type: "string", id: 1 }, - type: { type: "DescType", id: 2 }, - uri: { type: "string", id: 3 }, - rid: { type: "int64", id: 4 }, + text: { type: 'string', id: 1 }, + type: { type: 'DescType', id: 2 }, + uri: { type: 'string', id: 3 }, + rid: { type: 'int64', id: 4 }, }, }, DescType: { @@ -10078,399 +10078,399 @@ const biliJson = { }, LiveOrderInfo: { fields: { - sid: { type: "int64", id: 1 }, - text: { type: "string", id: 2 }, - livePlanStartTime: { type: "int64", id: 3 }, - isFollow: { type: "bool", id: 4 }, - followCount: { type: "int64", id: 5 }, - style: { type: "string", id: 6 }, + sid: { type: 'int64', id: 1 }, + text: { type: 'string', id: 2 }, + livePlanStartTime: { type: 'int64', id: 3 }, + isFollow: { type: 'bool', id: 4 }, + followCount: { type: 'int64', id: 5 }, + style: { type: 'string', id: 6 }, }, }, Season: { fields: { - allowDownload: { type: "string", id: 1 }, - seasonId: { type: "int64", id: 2 }, - isJump: { type: "int32", id: 3 }, - title: { type: "string", id: 4 }, - cover: { type: "string", id: 5 }, - isFinish: { type: "int32", id: 6 }, - newestEpId: { type: "int64", id: 7 }, - newestEpIndex: { type: "string", id: 8 }, - totalCount: { type: "int64", id: 9 }, - weekday: { type: "int32", id: 10 }, - userSeason: { type: "UserSeason", id: 11 }, - player: { type: "SeasonPlayer", id: 12 }, - ogvPlayurl: { type: "string", id: 13 }, + allowDownload: { type: 'string', id: 1 }, + seasonId: { type: 'int64', id: 2 }, + isJump: { type: 'int32', id: 3 }, + title: { type: 'string', id: 4 }, + cover: { type: 'string', id: 5 }, + isFinish: { type: 'int32', id: 6 }, + newestEpId: { type: 'int64', id: 7 }, + newestEpIndex: { type: 'string', id: 8 }, + totalCount: { type: 'int64', id: 9 }, + weekday: { type: 'int32', id: 10 }, + userSeason: { type: 'UserSeason', id: 11 }, + player: { type: 'SeasonPlayer', id: 12 }, + ogvPlayurl: { type: 'string', id: 13 }, }, }, SeasonPlayer: { fields: { - aid: { type: "int64", id: 1 }, - vid: { type: "string", id: 2 }, - cid: { type: "int64", id: 3 }, - from: { type: "string", id: 4 }, + aid: { type: 'int64', id: 1 }, + vid: { type: 'string', id: 2 }, + cid: { type: 'int64', id: 3 }, + from: { type: 'string', id: 4 }, }, }, UserSeason: { - fields: { attention: { type: "string", id: 1 } }, + fields: { attention: { type: 'string', id: 1 } }, }, Tag: { fields: { - id: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - likes: { type: "int64", id: 3 }, - hates: { type: "int64", id: 4 }, - liked: { type: "int32", id: 5 }, - hated: { type: "int32", id: 6 }, - uri: { type: "string", id: 7 }, - tagType: { type: "string", id: 8 }, + id: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + likes: { type: 'int64', id: 3 }, + hates: { type: 'int64', id: 4 }, + liked: { type: 'int32', id: 5 }, + hated: { type: 'int32', id: 6 }, + uri: { type: 'string', id: 7 }, + tagType: { type: 'string', id: 8 }, }, }, - TIcon: { fields: { icon: { type: "string", id: 1 } } }, + TIcon: { fields: { icon: { type: 'string', id: 1 } } }, ECode: { values: { DEFAULT: 0, CODE404: 1 } }, ViewPage: { fields: { - page: { type: "bilibili.app.archive.v1.Page", id: 1 }, - audio: { type: "Audio", id: 2 }, - dm: { type: "DM", id: 3 }, - downloadTitle: { type: "string", id: 4 }, - downloadSubtitle: { type: "string", id: 5 }, + page: { type: 'bilibili.app.archive.v1.Page', id: 1 }, + audio: { type: 'Audio', id: 2 }, + dm: { type: 'DM', id: 3 }, + downloadTitle: { type: 'string', id: 4 }, + downloadSubtitle: { type: 'string', id: 5 }, }, }, Audio: { fields: { - title: { type: "string", id: 1 }, - coverUrl: { type: "string", id: 2 }, - songId: { type: "int64", id: 3 }, - playCount: { type: "int64", id: 4 }, - replyCount: { type: "int64", id: 5 }, - upperId: { type: "int64", id: 6 }, - entrance: { type: "string", id: 7 }, - songAttr: { type: "int64", id: 8 }, + title: { type: 'string', id: 1 }, + coverUrl: { type: 'string', id: 2 }, + songId: { type: 'int64', id: 3 }, + playCount: { type: 'int64', id: 4 }, + replyCount: { type: 'int64', id: 5 }, + upperId: { type: 'int64', id: 6 }, + entrance: { type: 'string', id: 7 }, + songAttr: { type: 'int64', id: 8 }, }, }, DM: { fields: { - closed: { type: "bool", id: 1 }, - realName: { type: "bool", id: 2 }, - count: { type: "int64", id: 3 }, + closed: { type: 'bool', id: 1 }, + realName: { type: 'bool', id: 2 }, + count: { type: 'int64', id: 3 }, }, }, OnwerExt: { fields: { - officialVerify: { type: "OfficialVerify", id: 1 }, - live: { type: "Live", id: 2 }, - vip: { type: "Vip", id: 3 }, - assists: { rule: "repeated", type: "int64", id: 4 }, - fans: { type: "int64", id: 5 }, - arcCount: { type: "string", id: 6 }, - nftFaceIcon: { type: "NftFaceIcon", id: 7 }, + officialVerify: { type: 'OfficialVerify', id: 1 }, + live: { type: 'Live', id: 2 }, + vip: { type: 'Vip', id: 3 }, + assists: { rule: 'repeated', type: 'int64', id: 4 }, + fans: { type: 'int64', id: 5 }, + arcCount: { type: 'string', id: 6 }, + nftFaceIcon: { type: 'NftFaceIcon', id: 7 }, }, }, OfficialVerify: { fields: { - type: { type: "int32", id: 1 }, - desc: { type: "string", id: 2 }, + type: { type: 'int32', id: 1 }, + desc: { type: 'string', id: 2 }, }, }, Live: { fields: { - mid: { type: "int64", id: 1 }, - roomid: { type: "int64", id: 2 }, - uri: { type: "string", id: 3 }, - endpageUri: { type: "string", id: 4 }, + mid: { type: 'int64', id: 1 }, + roomid: { type: 'int64', id: 2 }, + uri: { type: 'string', id: 3 }, + endpageUri: { type: 'string', id: 4 }, }, }, Vip: { fields: { - type: { type: "int32", id: 1 }, - dueDate: { type: "int64", id: 2 }, - dueRemark: { type: "string", id: 3 }, - accessStatus: { type: "int32", id: 4 }, - vipStatus: { type: "int32", id: 5 }, - vipStatusWarn: { type: "string", id: 6 }, - themeType: { type: "int32", id: 7 }, - label: { type: "VipLabel", id: 8 }, + type: { type: 'int32', id: 1 }, + dueDate: { type: 'int64', id: 2 }, + dueRemark: { type: 'string', id: 3 }, + accessStatus: { type: 'int32', id: 4 }, + vipStatus: { type: 'int32', id: 5 }, + vipStatusWarn: { type: 'string', id: 6 }, + themeType: { type: 'int32', id: 7 }, + label: { type: 'VipLabel', id: 8 }, }, }, VipLabel: { fields: { - path: { type: "string", id: 1 }, - text: { type: "string", id: 2 }, - labelTheme: { type: "string", id: 3 }, + path: { type: 'string', id: 1 }, + text: { type: 'string', id: 2 }, + labelTheme: { type: 'string', id: 3 }, }, }, ReqUser: { fields: { - attention: { type: "int32", id: 1 }, - guestAttention: { type: "int32", id: 2 }, - favorite: { type: "int32", id: 3 }, - like: { type: "int32", id: 4 }, - dislike: { type: "int32", id: 5 }, - coin: { type: "int32", id: 6 }, - attentionLevel: { type: "int32", id: 7 }, - favSeason: { type: "int32", id: 8 }, - elecPlusBtn: { type: "Button", id: 9 }, + attention: { type: 'int32', id: 1 }, + guestAttention: { type: 'int32', id: 2 }, + favorite: { type: 'int32', id: 3 }, + like: { type: 'int32', id: 4 }, + dislike: { type: 'int32', id: 5 }, + coin: { type: 'int32', id: 6 }, + attentionLevel: { type: 'int32', id: 7 }, + favSeason: { type: 'int32', id: 8 }, + elecPlusBtn: { type: 'Button', id: 9 }, }, }, ElecRank: { fields: { - list: { rule: "repeated", type: "ElecRankItem", id: 1 }, - count: { type: "int64", id: 2 }, - text: { type: "string", id: 3 }, + list: { rule: 'repeated', type: 'ElecRankItem', id: 1 }, + count: { type: 'int64', id: 2 }, + text: { type: 'string', id: 3 }, }, }, ElecRankItem: { fields: { - avatar: { type: "string", id: 1 }, - nickname: { type: "string", id: 2 }, - message: { type: "string", id: 3 }, - mid: { type: "int64", id: 4 }, + avatar: { type: 'string', id: 1 }, + nickname: { type: 'string', id: 2 }, + message: { type: 'string', id: 3 }, + mid: { type: 'int64', id: 4 }, }, }, History: { fields: { - cid: { type: "int64", id: 1 }, - progress: { type: "int64", id: 2 }, + cid: { type: 'int64', id: 1 }, + progress: { type: 'int64', id: 2 }, }, }, Relate: { fields: { - aid: { type: "int64", id: 1 }, - pic: { type: "string", id: 2 }, - title: { type: "string", id: 3 }, + aid: { type: 'int64', id: 1 }, + pic: { type: 'string', id: 2 }, + title: { type: 'string', id: 3 }, author: { - type: "bilibili.app.archive.v1.Author", + type: 'bilibili.app.archive.v1.Author', id: 4, }, - stat: { type: "bilibili.app.archive.v1.Stat", id: 5 }, - duration: { type: "int64", id: 6 }, - goto: { type: "string", id: 7 }, - param: { type: "string", id: 8 }, - uri: { type: "string", id: 9 }, - jumpUrl: { type: "string", id: 10 }, - rating: { type: "double", id: 11 }, - reserve: { type: "string", id: 12 }, - from: { type: "string", id: 13 }, - desc: { type: "string", id: 14 }, - rcmdReason: { type: "string", id: 15 }, - badge: { type: "string", id: 16 }, - cid: { type: "int64", id: 17 }, - seasonType: { type: "int32", id: 18 }, - ratingCount: { type: "int32", id: 19 }, - tagName: { type: "string", id: 20 }, - packInfo: { type: "PackInfo", id: 21 }, - notice: { type: "Notice", id: 22 }, - button: { type: "Button", id: 23 }, - trackid: { type: "string", id: 24 }, - newCard: { type: "int32", id: 25 }, - rcmdReasonStyle: { type: "ReasonStyle", id: 26 }, - coverGif: { type: "string", id: 27 }, - cm: { type: "CM", id: 28 }, - reserveStatus: { type: "int64", id: 29 }, - rcmdReasonExtra_: { type: "string", id: 30 }, - recThreePoint: { type: "RecThreePoint", id: 31 }, - uniqueId: { type: "string", id: 32 }, - materialId: { type: "int64", id: 33 }, - fromSourceType: { type: "int64", id: 34 }, - fromSourceId: { type: "string", id: 35 }, + stat: { type: 'bilibili.app.archive.v1.Stat', id: 5 }, + duration: { type: 'int64', id: 6 }, + goto: { type: 'string', id: 7 }, + param: { type: 'string', id: 8 }, + uri: { type: 'string', id: 9 }, + jumpUrl: { type: 'string', id: 10 }, + rating: { type: 'double', id: 11 }, + reserve: { type: 'string', id: 12 }, + from: { type: 'string', id: 13 }, + desc: { type: 'string', id: 14 }, + rcmdReason: { type: 'string', id: 15 }, + badge: { type: 'string', id: 16 }, + cid: { type: 'int64', id: 17 }, + seasonType: { type: 'int32', id: 18 }, + ratingCount: { type: 'int32', id: 19 }, + tagName: { type: 'string', id: 20 }, + packInfo: { type: 'PackInfo', id: 21 }, + notice: { type: 'Notice', id: 22 }, + button: { type: 'Button', id: 23 }, + trackid: { type: 'string', id: 24 }, + newCard: { type: 'int32', id: 25 }, + rcmdReasonStyle: { type: 'ReasonStyle', id: 26 }, + coverGif: { type: 'string', id: 27 }, + cm: { type: 'CM', id: 28 }, + reserveStatus: { type: 'int64', id: 29 }, + rcmdReasonExtra_: { type: 'string', id: 30 }, + recThreePoint: { type: 'RecThreePoint', id: 31 }, + uniqueId: { type: 'string', id: 32 }, + materialId: { type: 'int64', id: 33 }, + fromSourceType: { type: 'int64', id: 34 }, + fromSourceId: { type: 'string', id: 35 }, dimension: { - type: "bilibili.app.archive.v1.Dimension", + type: 'bilibili.app.archive.v1.Dimension', id: 36, }, - cover: { type: "string", id: 37 }, - badgeStyle: { type: "ReasonStyle", id: 38 }, - powerIconStyle: { type: "PowerIconStyle", id: 39 }, - reserveStatusText: { type: "string", id: 40 }, - dislikeReportData: { type: "string", id: 41 }, - firstFrame: { type: "string", id: 43 }, - gameRecommendReason: { type: "string", id: 44 }, - wikiInfoGame: { type: "WikiInfo", id: 45 }, - liveInfo: { type: "LiveInfo", id: 46 }, + cover: { type: 'string', id: 37 }, + badgeStyle: { type: 'ReasonStyle', id: 38 }, + powerIconStyle: { type: 'PowerIconStyle', id: 39 }, + reserveStatusText: { type: 'string', id: 40 }, + dislikeReportData: { type: 'string', id: 41 }, + firstFrame: { type: 'string', id: 43 }, + gameRecommendReason: { type: 'string', id: 44 }, + wikiInfoGame: { type: 'WikiInfo', id: 45 }, + liveInfo: { type: 'LiveInfo', id: 46 }, }, }, PowerIconStyle: { fields: { - iconUrl: { type: "string", id: 1 }, - iconNightUrl: { type: "string", id: 2 }, - iconWidth: { type: "int64", id: 3 }, - iconHeight: { type: "int64", id: 4 }, + iconUrl: { type: 'string', id: 1 }, + iconNightUrl: { type: 'string', id: 2 }, + iconWidth: { type: 'int64', id: 3 }, + iconHeight: { type: 'int64', id: 4 }, }, }, RecThreePoint: { fields: { - dislike: { type: "RecDislike", id: 1 }, - feedback: { type: "RecDislike", id: 2 }, - watchLater: { type: "bool", id: 3 }, + dislike: { type: 'RecDislike', id: 1 }, + feedback: { type: 'RecDislike', id: 2 }, + watchLater: { type: 'bool', id: 3 }, }, }, RecDislike: { fields: { - title: { type: "string", id: 1 }, - subTitle: { type: "string", id: 2 }, - closedSubTitle: { type: "string", id: 3 }, - pasteText: { type: "string", id: 4 }, - closedPasteText: { type: "string", id: 5 }, + title: { type: 'string', id: 1 }, + subTitle: { type: 'string', id: 2 }, + closedSubTitle: { type: 'string', id: 3 }, + pasteText: { type: 'string', id: 4 }, + closedPasteText: { type: 'string', id: 5 }, dislikeReason: { - rule: "repeated", - type: "DislikeReasons", + rule: 'repeated', + type: 'DislikeReasons', id: 6, }, - toast: { type: "string", id: 7 }, - closedToast: { type: "string", id: 8 }, + toast: { type: 'string', id: 7 }, + closedToast: { type: 'string', id: 8 }, }, }, PackInfo: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, }, }, Notice: { fields: { - title: { type: "string", id: 1 }, - desc: { type: "string", id: 2 }, + title: { type: 'string', id: 1 }, + desc: { type: 'string', id: 2 }, }, }, Button: { fields: { - title: { type: "string", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, + title: { type: 'string', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, }, }, ReasonStyle: { fields: { - text: { type: "string", id: 1 }, - textColor: { type: "string", id: 2 }, - bgColor: { type: "string", id: 3 }, - borderColor: { type: "string", id: 4 }, - textColorNight: { type: "string", id: 5 }, - bgColorNight: { type: "string", id: 6 }, - borderColorNight: { type: "string", id: 7 }, - bgStyle: { type: "int32", id: 8 }, - selected: { type: "int32", id: 9 }, + text: { type: 'string', id: 1 }, + textColor: { type: 'string', id: 2 }, + bgColor: { type: 'string', id: 3 }, + borderColor: { type: 'string', id: 4 }, + textColorNight: { type: 'string', id: 5 }, + bgColorNight: { type: 'string', id: 6 }, + borderColorNight: { type: 'string', id: 7 }, + bgStyle: { type: 'int32', id: 8 }, + selected: { type: 'int32', id: 9 }, }, }, CM: { fields: { - sourceContent: { type: "google.protobuf.Any", id: 1 }, + sourceContent: { type: 'google.protobuf.Any', id: 1 }, }, }, Dislike: { fields: { - title: { type: "string", id: 1 }, - subtitle: { type: "string", id: 2 }, + title: { type: 'string', id: 1 }, + subtitle: { type: 'string', id: 2 }, reasons: { - rule: "repeated", - type: "DislikeReasons", + rule: 'repeated', + type: 'DislikeReasons', id: 3, }, }, }, DislikeReasons: { fields: { - id: { type: "int64", id: 1 }, - mid: { type: "int64", id: 2 }, - rid: { type: "int32", id: 3 }, - tagId: { type: "int64", id: 4 }, - name: { type: "string", id: 5 }, + id: { type: 'int64', id: 1 }, + mid: { type: 'int64', id: 2 }, + rid: { type: 'int32', id: 3 }, + tagId: { type: 'int64', id: 4 }, + name: { type: 'string', id: 5 }, }, }, PlayerIcon: { fields: { - url1: { type: "string", id: 1 }, - hash1: { type: "string", id: 2 }, - url2: { type: "string", id: 3 }, - hash2: { type: "string", id: 4 }, - dragLeftPng: { type: "string", id: 5 }, - middlePng: { type: "string", id: 6 }, - dragRightPng: { type: "string", id: 7 }, - dragData: { type: "IconData", id: 8 }, - nodragData: { type: "IconData", id: 9 }, + url1: { type: 'string', id: 1 }, + hash1: { type: 'string', id: 2 }, + url2: { type: 'string', id: 3 }, + hash2: { type: 'string', id: 4 }, + dragLeftPng: { type: 'string', id: 5 }, + middlePng: { type: 'string', id: 6 }, + dragRightPng: { type: 'string', id: 7 }, + dragData: { type: 'IconData', id: 8 }, + nodragData: { type: 'IconData', id: 9 }, }, }, Honor: { fields: { - icon: { type: "string", id: 1 }, - iconNight: { type: "string", id: 2 }, - text: { type: "string", id: 3 }, - textExtra: { type: "string", id: 4 }, - textColor: { type: "string", id: 5 }, - textColorNight: { type: "string", id: 6 }, - bgColor: { type: "string", id: 7 }, - bgColorNight: { type: "string", id: 8 }, - url: { type: "string", id: 9 }, - urlText: { type: "string", id: 10 }, - category: { type: "string", id: 11 }, + icon: { type: 'string', id: 1 }, + iconNight: { type: 'string', id: 2 }, + text: { type: 'string', id: 3 }, + textExtra: { type: 'string', id: 4 }, + textColor: { type: 'string', id: 5 }, + textColorNight: { type: 'string', id: 6 }, + bgColor: { type: 'string', id: 7 }, + bgColorNight: { type: 'string', id: 8 }, + url: { type: 'string', id: 9 }, + urlText: { type: 'string', id: 10 }, + category: { type: 'string', id: 11 }, }, }, RelateTab: { fields: { - id: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + id: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, }, }, Bgm: { fields: { - sid: { type: "int64", id: 1 }, - mid: { type: "int64", id: 2 }, - title: { type: "string", id: 3 }, - author: { type: "string", id: 4 }, - jumpUrl: { type: "string", id: 5 }, - cover: { type: "string", id: 6 }, + sid: { type: 'int64', id: 1 }, + mid: { type: 'int64', id: 2 }, + title: { type: 'string', id: 3 }, + author: { type: 'string', id: 4 }, + jumpUrl: { type: 'string', id: 5 }, + cover: { type: 'string', id: 6 }, }, }, Staff: { fields: { - mid: { type: "int64", id: 1 }, - title: { type: "string", id: 2 }, - face: { type: "string", id: 3 }, - name: { type: "string", id: 4 }, - officialVerify: { type: "OfficialVerify", id: 5 }, - vip: { type: "Vip", id: 6 }, - attention: { type: "int32", id: 7 }, - labelStyle: { type: "int32", id: 8 }, + mid: { type: 'int64', id: 1 }, + title: { type: 'string', id: 2 }, + face: { type: 'string', id: 3 }, + name: { type: 'string', id: 4 }, + officialVerify: { type: 'OfficialVerify', id: 5 }, + vip: { type: 'Vip', id: 6 }, + attention: { type: 'int32', id: 7 }, + labelStyle: { type: 'int32', id: 8 }, }, }, Label: { fields: { - type: { type: "int32", id: 1 }, - uri: { type: "string", id: 2 }, - icon: { type: "string", id: 3 }, - iconNight: { type: "string", id: 4 }, - iconWidth: { type: "int64", id: 5 }, - iconHeight: { type: "int64", id: 6 }, - lottie: { type: "string", id: 7 }, - lottieNight: { type: "string", id: 8 }, + type: { type: 'int32', id: 1 }, + uri: { type: 'string', id: 2 }, + icon: { type: 'string', id: 3 }, + iconNight: { type: 'string', id: 4 }, + iconWidth: { type: 'int64', id: 5 }, + iconHeight: { type: 'int64', id: 6 }, + lottie: { type: 'string', id: 7 }, + lottieNight: { type: 'string', id: 8 }, }, }, UgcSeason: { fields: { - id: { type: "int64", id: 1 }, - title: { type: "string", id: 2 }, - cover: { type: "string", id: 3 }, - intro: { type: "string", id: 4 }, - sections: { rule: "repeated", type: "Section", id: 5 }, - stat: { type: "UgcSeasonStat", id: 6 }, - labelText: { type: "string", id: 7 }, - labelTextColor: { type: "string", id: 8 }, - labelBgColor: { type: "string", id: 9 }, - labelTextNightColor: { type: "string", id: 10 }, - labelBgNightColor: { type: "string", id: 11 }, - descRight: { type: "string", id: 12 }, - epCount: { type: "int64", id: 13 }, - seasonType: { type: "SeasonType", id: 14 }, - showContinualButton: { type: "bool", id: 15 }, - epNum: { type: "int64", id: 16 }, - seasonPay: { type: "bool", id: 17 }, - goodsInfo: { type: "GoodsInfo", id: 18 }, - payButton: { type: "ButtonStyle", id: 19 }, - labelTextNew: { type: "string", id: 20 }, - activity: { type: "UgcSeasonActivity", id: 21 }, + id: { type: 'int64', id: 1 }, + title: { type: 'string', id: 2 }, + cover: { type: 'string', id: 3 }, + intro: { type: 'string', id: 4 }, + sections: { rule: 'repeated', type: 'Section', id: 5 }, + stat: { type: 'UgcSeasonStat', id: 6 }, + labelText: { type: 'string', id: 7 }, + labelTextColor: { type: 'string', id: 8 }, + labelBgColor: { type: 'string', id: 9 }, + labelTextNightColor: { type: 'string', id: 10 }, + labelBgNightColor: { type: 'string', id: 11 }, + descRight: { type: 'string', id: 12 }, + epCount: { type: 'int64', id: 13 }, + seasonType: { type: 'SeasonType', id: 14 }, + showContinualButton: { type: 'bool', id: 15 }, + epNum: { type: 'int64', id: 16 }, + seasonPay: { type: 'bool', id: 17 }, + goodsInfo: { type: 'GoodsInfo', id: 18 }, + payButton: { type: 'ButtonStyle', id: 19 }, + labelTextNew: { type: 'string', id: 20 }, + activity: { type: 'UgcSeasonActivity', id: 21 }, seasonAbility: { - rule: "repeated", - type: "string", + rule: 'repeated', + type: 'string', id: 22, }, }, @@ -10478,129 +10478,129 @@ const biliJson = { SeasonType: { values: { Unknown: 0, Base: 1, Good: 2 } }, Section: { fields: { - id: { type: "int64", id: 1 }, - title: { type: "string", id: 2 }, - type: { type: "int64", id: 3 }, - episodes: { rule: "repeated", type: "Episode", id: 4 }, + id: { type: 'int64', id: 1 }, + title: { type: 'string', id: 2 }, + type: { type: 'int64', id: 3 }, + episodes: { rule: 'repeated', type: 'Episode', id: 4 }, }, }, Episode: { fields: { - id: { type: "int64", id: 1 }, - aid: { type: "int64", id: 2 }, - cid: { type: "int64", id: 3 }, - title: { type: "string", id: 4 }, - cover: { type: "string", id: 5 }, - coverRightText: { type: "string", id: 6 }, - page: { type: "bilibili.app.archive.v1.Page", id: 7 }, - stat: { type: "bilibili.app.archive.v1.Stat", id: 8 }, - bvid: { type: "string", id: 9 }, + id: { type: 'int64', id: 1 }, + aid: { type: 'int64', id: 2 }, + cid: { type: 'int64', id: 3 }, + title: { type: 'string', id: 4 }, + cover: { type: 'string', id: 5 }, + coverRightText: { type: 'string', id: 6 }, + page: { type: 'bilibili.app.archive.v1.Page', id: 7 }, + stat: { type: 'bilibili.app.archive.v1.Stat', id: 8 }, + bvid: { type: 'string', id: 9 }, author: { - type: "bilibili.app.archive.v1.Author", + type: 'bilibili.app.archive.v1.Author', id: 10, }, - authorDesc: { type: "string", id: 11 }, - firstFrame: { type: "string", id: 16 }, + authorDesc: { type: 'string', id: 11 }, + firstFrame: { type: 'string', id: 16 }, }, }, UgcSeasonStat: { fields: { - seasonId: { type: "int64", id: 1 }, - view: { type: "int32", id: 2 }, - danmaku: { type: "int32", id: 3 }, - reply: { type: "int32", id: 4 }, - fav: { type: "int32", id: 5 }, - coin: { type: "int32", id: 6 }, - share: { type: "int32", id: 7 }, - nowRank: { type: "int32", id: 8 }, - hisRank: { type: "int32", id: 9 }, - like: { type: "int32", id: 10 }, + seasonId: { type: 'int64', id: 1 }, + view: { type: 'int32', id: 2 }, + danmaku: { type: 'int32', id: 3 }, + reply: { type: 'int32', id: 4 }, + fav: { type: 'int32', id: 5 }, + coin: { type: 'int32', id: 6 }, + share: { type: 'int32', id: 7 }, + nowRank: { type: 'int32', id: 8 }, + hisRank: { type: 'int32', id: 9 }, + like: { type: 'int32', id: 10 }, }, }, Config: { fields: { - relatesTitle: { type: "string", id: 1 }, - relatesStyle: { type: "int32", id: 2 }, - relateGifExp: { type: "int32", id: 3 }, - endPageHalf: { type: "int32", id: 4 }, - endPageFull: { type: "int32", id: 5 }, - autoSwindow: { type: "bool", id: 6 }, - popupInfo_: { type: "bool", id: 7 }, - abtestSmallWindow: { type: "string", id: 8 }, - recThreePointStyle: { type: "int32", id: 9 }, - isAbsoluteTime: { type: "bool", id: 10 }, - newSwindow: { type: "bool", id: 11 }, - relatesBiserial: { type: "bool", id: 12 }, - listenerConf: { type: "ListenerConfig", id: 13 }, - relatesFeedStyle: { type: "string", id: 14 }, - relatesFeedPopup: { type: "bool", id: 15 }, - relatesHasNext: { type: "bool", id: 16 }, - localPlay: { type: "int32", id: 17 }, - playStory: { type: "bool", id: 18 }, - arcPlayStory: { type: "bool", id: 19 }, - storyIcon: { type: "string", id: 20 }, - landscapeStory: { type: "bool", id: 21 }, - arcLandscapeStory: { type: "bool", id: 22 }, - landscapeIcon: { type: "string", id: 23 }, - showListenButton: { type: "bool", id: 24 }, - validShowM: { type: "int64", id: 25 }, - validShowN: { type: "int64", id: 26 }, - dmTreasureBoxControl: { type: "bool", id: 27 }, + relatesTitle: { type: 'string', id: 1 }, + relatesStyle: { type: 'int32', id: 2 }, + relateGifExp: { type: 'int32', id: 3 }, + endPageHalf: { type: 'int32', id: 4 }, + endPageFull: { type: 'int32', id: 5 }, + autoSwindow: { type: 'bool', id: 6 }, + popupInfo_: { type: 'bool', id: 7 }, + abtestSmallWindow: { type: 'string', id: 8 }, + recThreePointStyle: { type: 'int32', id: 9 }, + isAbsoluteTime: { type: 'bool', id: 10 }, + newSwindow: { type: 'bool', id: 11 }, + relatesBiserial: { type: 'bool', id: 12 }, + listenerConf: { type: 'ListenerConfig', id: 13 }, + relatesFeedStyle: { type: 'string', id: 14 }, + relatesFeedPopup: { type: 'bool', id: 15 }, + relatesHasNext: { type: 'bool', id: 16 }, + localPlay: { type: 'int32', id: 17 }, + playStory: { type: 'bool', id: 18 }, + arcPlayStory: { type: 'bool', id: 19 }, + storyIcon: { type: 'string', id: 20 }, + landscapeStory: { type: 'bool', id: 21 }, + arcLandscapeStory: { type: 'bool', id: 22 }, + landscapeIcon: { type: 'string', id: 23 }, + showListenButton: { type: 'bool', id: 24 }, + validShowM: { type: 'int64', id: 25 }, + validShowN: { type: 'int64', id: 26 }, + dmTreasureBoxControl: { type: 'bool', id: 27 }, }, }, ListenerConfig: { fields: { - jumpStyle: { type: "int64", id: 1 }, - guideBar: { type: "ListenerGuideBar", id: 2 }, + jumpStyle: { type: 'int64', id: 1 }, + guideBar: { type: 'ListenerGuideBar', id: 2 }, }, }, ListenerGuideBar: { fields: { - showStrategy: { type: "int64", id: 1 }, - icon: { type: "string", id: 2 }, - text: { type: "string", id: 3 }, - btnText: { type: "string", id: 4 }, - showTime: { type: "int64", id: 5 }, - backgroundTime: { type: "int64", id: 6 }, + showStrategy: { type: 'int64', id: 1 }, + icon: { type: 'string', id: 2 }, + text: { type: 'string', id: 3 }, + btnText: { type: 'string', id: 4 }, + showTime: { type: 'int64', id: 5 }, + backgroundTime: { type: 'int64', id: 6 }, }, }, Interaction: { fields: { - historyNode: { type: "Node", id: 1 }, - graphVersion: { type: "int64", id: 2 }, - msg: { type: "string", id: 3 }, - evaluation: { type: "string", id: 4 }, - mark: { type: "int64", id: 5 }, + historyNode: { type: 'Node', id: 1 }, + graphVersion: { type: 'int64', id: 2 }, + msg: { type: 'string', id: 3 }, + evaluation: { type: 'string', id: 4 }, + mark: { type: 'int64', id: 5 }, }, }, Node: { fields: { - nodeId: { type: "int64", id: 1 }, - title: { type: "string", id: 2 }, - cid: { type: "int64", id: 3 }, + nodeId: { type: 'int64', id: 1 }, + title: { type: 'string', id: 2 }, + cid: { type: 'int64', id: 3 }, }, }, CustomConfig: { - fields: { redirectUrl: { type: "string", id: 1 } }, + fields: { redirectUrl: { type: 'string', id: 1 } }, }, CMConfig: { fields: { - adsControl: { type: "google.protobuf.Any", id: 1 }, + adsControl: { type: 'google.protobuf.Any', id: 1 }, }, }, Tab: { fields: { - background: { type: "string", id: 1 }, - otype: { type: "TabOtype", id: 2 }, - oid: { type: "int64", id: 3 }, - uri: { type: "string", id: 4 }, - style: { type: "TabStyle", id: 5 }, - text: { type: "string", id: 6 }, - textColor: { type: "string", id: 7 }, - textColorSelected: { type: "string", id: 8 }, - pic: { type: "string", id: 9 }, - id: { type: "int64", id: 10 }, - adTabInfo: { type: "google.protobuf.Any", id: 11 }, + background: { type: 'string', id: 1 }, + otype: { type: 'TabOtype', id: 2 }, + oid: { type: 'int64', id: 3 }, + uri: { type: 'string', id: 4 }, + style: { type: 'TabStyle', id: 5 }, + text: { type: 'string', id: 6 }, + textColor: { type: 'string', id: 7 }, + textColorSelected: { type: 'string', id: 8 }, + pic: { type: 'string', id: 9 }, + id: { type: 'int64', id: 10 }, + adTabInfo: { type: 'google.protobuf.Any', id: 11 }, }, }, TabOtype: { @@ -10609,118 +10609,118 @@ const biliJson = { TabStyle: { values: { UnknownStyle: 0, Text: 1, Pic: 2 } }, Rank: { fields: { - icon: { type: "string", id: 1 }, - iconNight: { type: "string", id: 2 }, - text: { type: "string", id: 3 }, + icon: { type: 'string', id: 1 }, + iconNight: { type: 'string', id: 2 }, + text: { type: 'string', id: 3 }, }, }, TFPanelCustomized: { fields: { - rightBtnImg: { type: "string", id: 1 }, - rightBtnText: { type: "string", id: 2 }, - rightBtnTextColor: { type: "string", id: 3 }, - rightBtnLink: { type: "string", id: 4 }, - mainLabel: { type: "string", id: 5 }, - operator: { type: "string", id: 6 }, + rightBtnImg: { type: 'string', id: 1 }, + rightBtnText: { type: 'string', id: 2 }, + rightBtnTextColor: { type: 'string', id: 3 }, + rightBtnLink: { type: 'string', id: 4 }, + mainLabel: { type: 'string', id: 5 }, + operator: { type: 'string', id: 6 }, subPanel: { - keyType: "string", - type: "subTFPanel", + keyType: 'string', + type: 'subTFPanel', id: 7, }, }, }, subTFPanel: { fields: { - rightBtnImg: { type: "string", id: 1 }, - rightBtnText: { type: "string", id: 2 }, - rightBtnTextColor: { type: "string", id: 3 }, - rightBtnLink: { type: "string", id: 4 }, - mainLabel: { type: "string", id: 5 }, - operator: { type: "string", id: 6 }, + rightBtnImg: { type: 'string', id: 1 }, + rightBtnText: { type: 'string', id: 2 }, + rightBtnTextColor: { type: 'string', id: 3 }, + rightBtnLink: { type: 'string', id: 4 }, + mainLabel: { type: 'string', id: 5 }, + operator: { type: 'string', id: 6 }, }, }, UpAct: { fields: { - sid: { type: "int64", id: 1 }, - mid: { type: "int64", id: 2 }, - title: { type: "string", id: 3 }, - statement: { type: "string", id: 4 }, - image: { type: "string", id: 5 }, - url: { type: "string", id: 6 }, - button: { type: "string", id: 7 }, + sid: { type: 'int64', id: 1 }, + mid: { type: 'int64', id: 2 }, + title: { type: 'string', id: 3 }, + statement: { type: 'string', id: 4 }, + image: { type: 'string', id: 5 }, + url: { type: 'string', id: 6 }, + button: { type: 'string', id: 7 }, }, }, UserGarb: { fields: { - urlImageAniCut: { type: "string", id: 1 }, - likeToast: { type: "string", id: 2 }, + urlImageAniCut: { type: 'string', id: 1 }, + likeToast: { type: 'string', id: 2 }, }, }, ActivitySeason: { fields: { - arc: { type: "bilibili.app.archive.v1.Arc", id: 1 }, - pages: { rule: "repeated", type: "ViewPage", id: 2 }, - ownerExt: { type: "OnwerExt", id: 3 }, - reqUser: { type: "ReqUser", id: 4 }, - elecRank: { type: "ElecRank", id: 5 }, - history: { type: "History", id: 6 }, - bvid: { type: "string", id: 7 }, - honor: { type: "Honor", id: 8 }, - staff: { rule: "repeated", type: "Staff", id: 9 }, - ugcSeason: { type: "UgcSeason", id: 10 }, - tab: { type: "Tab", id: 11 }, - rank: { type: "Rank", id: 12 }, - order: { type: "Order", id: 13 }, - supportDislike: { type: "bool", id: 14 }, - operationRelate: { type: "OperationRelate", id: 15 }, - activityResource: { type: "ActivityResource", id: 16 }, - shortLink: { type: "string", id: 17 }, - label: { type: "Label", id: 18 }, - dislike: { type: "Dislike", id: 19 }, - playerIcon: { type: "PlayerIcon", id: 20 }, - shareSubtitle: { type: "string", id: 21 }, - cmConfig: { type: "CMConfig", id: 22 }, + arc: { type: 'bilibili.app.archive.v1.Arc', id: 1 }, + pages: { rule: 'repeated', type: 'ViewPage', id: 2 }, + ownerExt: { type: 'OnwerExt', id: 3 }, + reqUser: { type: 'ReqUser', id: 4 }, + elecRank: { type: 'ElecRank', id: 5 }, + history: { type: 'History', id: 6 }, + bvid: { type: 'string', id: 7 }, + honor: { type: 'Honor', id: 8 }, + staff: { rule: 'repeated', type: 'Staff', id: 9 }, + ugcSeason: { type: 'UgcSeason', id: 10 }, + tab: { type: 'Tab', id: 11 }, + rank: { type: 'Rank', id: 12 }, + order: { type: 'Order', id: 13 }, + supportDislike: { type: 'bool', id: 14 }, + operationRelate: { type: 'OperationRelate', id: 15 }, + activityResource: { type: 'ActivityResource', id: 16 }, + shortLink: { type: 'string', id: 17 }, + label: { type: 'Label', id: 18 }, + dislike: { type: 'Dislike', id: 19 }, + playerIcon: { type: 'PlayerIcon', id: 20 }, + shareSubtitle: { type: 'string', id: 21 }, + cmConfig: { type: 'CMConfig', id: 22 }, tfPanelCustomized: { - type: "TFPanelCustomized", + type: 'TFPanelCustomized', id: 23, }, - argueMsg: { type: "string", id: 24 }, - ecode: { type: "ECode", id: 25 }, - customConfig: { type: "CustomConfig", id: 26 }, - badgeUrl: { type: "string", id: 27 }, - descV2: { rule: "repeated", type: "DescV2", id: 28 }, - config: { type: "Config", id: 29 }, - online: { type: "Online", id: 30 }, - arcExtra: { type: "ArcExtra", id: 31 }, - replyPreface: { type: "ReplyStyle", id: 32 }, - upLikeImg: { type: "UpLikeImg", id: 33 }, + argueMsg: { type: 'string', id: 24 }, + ecode: { type: 'ECode', id: 25 }, + customConfig: { type: 'CustomConfig', id: 26 }, + badgeUrl: { type: 'string', id: 27 }, + descV2: { rule: 'repeated', type: 'DescV2', id: 28 }, + config: { type: 'Config', id: 29 }, + online: { type: 'Online', id: 30 }, + arcExtra: { type: 'ArcExtra', id: 31 }, + replyPreface: { type: 'ReplyStyle', id: 32 }, + upLikeImg: { type: 'UpLikeImg', id: 33 }, specialCellNew: { - rule: "repeated", - type: "SpecialCell", + rule: 'repeated', + type: 'SpecialCell', id: 34, }, - likeAnimation: { type: "LikeAnimation", id: 35 }, - userGarb: { type: "UserGarb", id: 36 }, - controlConfig: { type: "ControlConfig", id: 37 }, - coinStyle: { type: "CoinStyle", id: 38 }, - rabbitYear: { type: "RabbitYear", id: 39 }, + likeAnimation: { type: 'LikeAnimation', id: 35 }, + userGarb: { type: 'UserGarb', id: 36 }, + controlConfig: { type: 'ControlConfig', id: 37 }, + coinStyle: { type: 'CoinStyle', id: 38 }, + rabbitYear: { type: 'RabbitYear', id: 39 }, }, }, Order: { oneofs: { - orderParam: { oneof: ["reserve", "favSeason"] }, + orderParam: { oneof: ['reserve', 'favSeason'] }, }, fields: { - status: { type: "bool", id: 1 }, - title: { type: "string", id: 2 }, - buttonTitle: { type: "string", id: 3 }, - buttonSelectedTitle: { type: "string", id: 4 }, - seasonStatView: { type: "int64", id: 5 }, - seasonStatDanmaku: { type: "int64", id: 6 }, - orderType: { type: "BizType", id: 7 }, - reserve: { type: "BizReserveActivityParam", id: 8 }, - favSeason: { type: "BizFavSeasonParam", id: 9 }, - intro: { type: "string", id: 10 }, + status: { type: 'bool', id: 1 }, + title: { type: 'string', id: 2 }, + buttonTitle: { type: 'string', id: 3 }, + buttonSelectedTitle: { type: 'string', id: 4 }, + seasonStatView: { type: 'int64', id: 5 }, + seasonStatDanmaku: { type: 'int64', id: 6 }, + orderType: { type: 'BizType', id: 7 }, + reserve: { type: 'BizReserveActivityParam', id: 8 }, + favSeason: { type: 'BizFavSeasonParam', id: 9 }, + intro: { type: 'string', id: 10 }, }, }, BizType: { @@ -10735,58 +10735,58 @@ const biliJson = { }, BizReserveActivityParam: { fields: { - activityId: { type: "int64", id: 1 }, - from: { type: "string", id: 2 }, - type: { type: "string", id: 3 }, - oid: { type: "int64", id: 4 }, - reserveId: { type: "int64", id: 5 }, + activityId: { type: 'int64', id: 1 }, + from: { type: 'string', id: 2 }, + type: { type: 'string', id: 3 }, + oid: { type: 'int64', id: 4 }, + reserveId: { type: 'int64', id: 5 }, }, }, BizFavSeasonParam: { - fields: { seasonId: { type: "int64", id: 1 } }, + fields: { seasonId: { type: 'int64', id: 1 } }, }, OperationRelate: { fields: { - title: { type: "string", id: 1 }, + title: { type: 'string', id: 1 }, relateItem: { - rule: "repeated", - type: "RelateItem", + rule: 'repeated', + type: 'RelateItem', id: 2, }, aiRelateItem: { - rule: "repeated", - type: "Relate", + rule: 'repeated', + type: 'Relate', id: 3, }, }, }, RelateItem: { fields: { - url: { type: "string", id: 1 }, - cover: { type: "string", id: 2 }, - useDefaultBrowser: { type: "bool", id: 3 }, + url: { type: 'string', id: 1 }, + cover: { type: 'string', id: 2 }, + useDefaultBrowser: { type: 'bool', id: 3 }, }, }, ActivityResource: { fields: { - modPoolName: { type: "string", id: 1 }, - modResourceName: { type: "string", id: 2 }, - bgColor: { type: "string", id: 3 }, - selectedBgColor: { type: "string", id: 4 }, - textColor: { type: "string", id: 5 }, - lightTextColor: { type: "string", id: 6 }, - darkTextColor: { type: "string", id: 7 }, - dividerColor: { type: "string", id: 8 }, + modPoolName: { type: 'string', id: 1 }, + modResourceName: { type: 'string', id: 2 }, + bgColor: { type: 'string', id: 3 }, + selectedBgColor: { type: 'string', id: 4 }, + textColor: { type: 'string', id: 5 }, + lightTextColor: { type: 'string', id: 6 }, + darkTextColor: { type: 'string', id: 7 }, + dividerColor: { type: 'string', id: 8 }, }, }, GoodsInfo: { fields: { - goodsId: { type: "string", id: 1 }, - category: { type: "Category", id: 2 }, - goodsPrice: { type: "int64", id: 3 }, - payState: { type: "PayState", id: 4 }, - goodsName: { type: "string", id: 5 }, - priceFmt: { type: "string", id: 6 }, + goodsId: { type: 'string', id: 1 }, + category: { type: 'Category', id: 2 }, + goodsPrice: { type: 'int64', id: 3 }, + payState: { type: 'PayState', id: 4 }, + goodsName: { type: 'string', id: 5 }, + priceFmt: { type: 'string', id: 6 }, }, }, Category: { @@ -10797,211 +10797,211 @@ const biliJson = { }, ButtonStyle: { fields: { - text: { type: "string", id: 1 }, - textColor: { type: "string", id: 2 }, - textColorNight: { type: "string", id: 3 }, - bgColor: { type: "string", id: 4 }, - bgColorNight: { type: "string", id: 5 }, - jumpLink: { type: "string", id: 6 }, + text: { type: 'string', id: 1 }, + textColor: { type: 'string', id: 2 }, + textColorNight: { type: 'string', id: 3 }, + bgColor: { type: 'string', id: 4 }, + bgColorNight: { type: 'string', id: 5 }, + jumpLink: { type: 'string', id: 6 }, }, }, UgcSeasonActivity: { fields: { - type: { type: "int32", id: 1 }, - oid: { type: "int64", id: 2 }, - activityId: { type: "int64", id: 3 }, - title: { type: "string", id: 4 }, - intro: { type: "string", id: 5 }, - dayCount: { type: "int32", id: 6 }, - userCount: { type: "int32", id: 7 }, - joinDeadline: { type: "int64", id: 8 }, - activityDeadline: { type: "int64", id: 9 }, - checkinViewTime: { type: "int32", id: 10 }, - newActivity: { type: "bool", id: 11 }, - userActivity: { type: "UserActivity", id: 12 }, - seasonShow: { type: "SeasonShow", id: 13 }, + type: { type: 'int32', id: 1 }, + oid: { type: 'int64', id: 2 }, + activityId: { type: 'int64', id: 3 }, + title: { type: 'string', id: 4 }, + intro: { type: 'string', id: 5 }, + dayCount: { type: 'int32', id: 6 }, + userCount: { type: 'int32', id: 7 }, + joinDeadline: { type: 'int64', id: 8 }, + activityDeadline: { type: 'int64', id: 9 }, + checkinViewTime: { type: 'int32', id: 10 }, + newActivity: { type: 'bool', id: 11 }, + userActivity: { type: 'UserActivity', id: 12 }, + seasonShow: { type: 'SeasonShow', id: 13 }, }, }, UserActivity: { fields: { - userState: { type: "int32", id: 1 }, - lastCheckinDate: { type: "int64", id: 2 }, - checkinToday: { type: "int32", id: 3 }, - userDayCount: { type: "int32", id: 4 }, - userViewTime: { type: "int32", id: 5 }, - portrait: { type: "string", id: 6 }, + userState: { type: 'int32', id: 1 }, + lastCheckinDate: { type: 'int64', id: 2 }, + checkinToday: { type: 'int32', id: 3 }, + userDayCount: { type: 'int32', id: 4 }, + userViewTime: { type: 'int32', id: 5 }, + portrait: { type: 'string', id: 6 }, }, }, SeasonShow: { fields: { - buttonText: { type: "string", id: 1 }, - joinText: { type: "string", id: 2 }, - ruleText: { type: "string", id: 3 }, - checkinText: { type: "string", id: 4 }, - checkinPrompt: { type: "string", id: 5 }, + buttonText: { type: 'string', id: 1 }, + joinText: { type: 'string', id: 2 }, + ruleText: { type: 'string', id: 3 }, + checkinText: { type: 'string', id: 4 }, + checkinPrompt: { type: 'string', id: 5 }, }, }, PullClientAction: { fields: { - type: { type: "string", id: 1 }, - pullAction: { type: "bool", id: 2 }, - params: { type: "string", id: 3 }, + type: { type: 'string', id: 1 }, + pullAction: { type: 'bool', id: 2 }, + params: { type: 'string', id: 3 }, }, }, ArcExtra: { - fields: { arcPubLocation: { type: "string", id: 1 } }, + fields: { arcPubLocation: { type: 'string', id: 1 } }, }, PaginationReply: { fields: { - next: { type: "string", id: 1 }, - prev: { type: "string", id: 2 }, + next: { type: 'string', id: 1 }, + prev: { type: 'string', id: 2 }, }, }, LikeAnimation: { fields: { - likeIcon: { type: "string", id: 1 }, - likedIcon: { type: "string", id: 2 }, - likeAnimation: { type: "string", id: 3 }, + likeIcon: { type: 'string', id: 1 }, + likedIcon: { type: 'string', id: 2 }, + likeAnimation: { type: 'string', id: 3 }, }, }, ReplyStyle: { fields: { - badgeUrl: { type: "string", id: 1 }, - badgeText: { type: "string", id: 2 }, - badgeType: { type: "int64", id: 3 }, + badgeUrl: { type: 'string', id: 1 }, + badgeText: { type: 'string', id: 2 }, + badgeType: { type: 'int64', id: 3 }, }, }, RefreshPage: { fields: { - refreshable: { type: "int32", id: 1 }, - refreshIcon: { type: "int32", id: 2 }, - refreshText: { type: "string", id: 3 }, - refreshShow: { type: "float", id: 4 }, + refreshable: { type: 'int32', id: 1 }, + refreshIcon: { type: 'int32', id: 2 }, + refreshText: { type: 'string', id: 3 }, + refreshShow: { type: 'float', id: 4 }, }, }, ControlConfig: { fields: { - likeShow: { type: "Control", id: 1 }, - dislikeShow: { type: "Control", id: 2 }, - coinShow: { type: "Control", id: 3 }, - favShow: { type: "Control", id: 4 }, - shareShow: { type: "Control", id: 5 }, - toastShow: { type: "Control", id: 6 }, - materialShow: { type: "Control", id: 7 }, - danmuShow: { type: "Control", id: 8 }, + likeShow: { type: 'Control', id: 1 }, + dislikeShow: { type: 'Control', id: 2 }, + coinShow: { type: 'Control', id: 3 }, + favShow: { type: 'Control', id: 4 }, + shareShow: { type: 'Control', id: 5 }, + toastShow: { type: 'Control', id: 6 }, + materialShow: { type: 'Control', id: 7 }, + danmuShow: { type: 'Control', id: 8 }, }, }, - Control: { fields: { limit: { type: "bool", id: 1 } } }, + Control: { fields: { limit: { type: 'bool', id: 1 } } }, WikiInfo: { fields: { - wikiLabel: { type: "string", id: 1 }, - wikiUrl: { type: "string", id: 2 }, + wikiLabel: { type: 'string', id: 1 }, + wikiUrl: { type: 'string', id: 2 }, }, }, LiveInfo: { fields: { - areaName: { type: "string", id: 1 }, - watchedShow: { type: "int64", id: 2 }, - liveStatus: { type: "int64", id: 3 }, - iconType: { type: "int64", id: 4 }, + areaName: { type: 'string', id: 1 }, + watchedShow: { type: 'int64', id: 2 }, + liveStatus: { type: 'int64', id: 3 }, + iconType: { type: 'int64', id: 4 }, }, }, LikeComment: { fields: { - reply: { type: "string", id: 1 }, - title: { type: "string", id: 2 }, + reply: { type: 'string', id: 1 }, + title: { type: 'string', id: 2 }, }, }, UpViewMaterial: { fields: { - likeInfo: { type: "InteractArea", id: 1 }, - dataCenterInfo: { type: "string", id: 2 }, + likeInfo: { type: 'InteractArea', id: 1 }, + dataCenterInfo: { type: 'string', id: 2 }, }, }, InteractArea: { fields: { - list: { rule: "repeated", type: "User", id: 1 }, - text: { type: "string", id: 2 }, + list: { rule: 'repeated', type: 'User', id: 1 }, + text: { type: 'string', id: 2 }, }, }, User: { fields: { - mid: { type: "int64", id: 1 }, - name: { type: "string", id: 2 }, - face: { type: "string", id: 3 }, - follower: { type: "int64", id: 4 }, - isAttention: { type: "int64", id: 5 }, - isInterrelation: { type: "int64", id: 6 }, - isFollow: { type: "int64", id: 7 }, - interactDesc: { type: "string", id: 8 }, + mid: { type: 'int64', id: 1 }, + name: { type: 'string', id: 2 }, + face: { type: 'string', id: 3 }, + follower: { type: 'int64', id: 4 }, + isAttention: { type: 'int64', id: 5 }, + isInterrelation: { type: 'int64', id: 6 }, + isFollow: { type: 'int64', id: 7 }, + interactDesc: { type: 'string', id: 8 }, }, }, UserRelation: { - fields: { likeInfo: { type: "InteractArea", id: 1 } }, + fields: { likeInfo: { type: 'InteractArea', id: 1 } }, }, CoinStyle: { fields: { - coinAppZipIcon: { type: "string", id: 1 }, - coinAppIcon1: { type: "string", id: 2 }, - coinAppIcon2: { type: "string", id: 3 }, - coinAppIcon3: { type: "string", id: 4 }, - coinAppIcon4: { type: "string", id: 5 }, + coinAppZipIcon: { type: 'string', id: 1 }, + coinAppIcon1: { type: 'string', id: 2 }, + coinAppIcon2: { type: 'string', id: 3 }, + coinAppIcon3: { type: 'string', id: 4 }, + coinAppIcon4: { type: 'string', id: 5 }, }, }, RabbitYear: { fields: { - playerAutomate: { type: "PlayerAutomate", id: 1 }, - dmSummon: { type: "DmSummon", id: 2 }, - halfScreen: { type: "HalfScreen", id: 3 }, - specialDm: { type: "SpecialDm", id: 4 }, + playerAutomate: { type: 'PlayerAutomate', id: 1 }, + dmSummon: { type: 'DmSummon', id: 2 }, + halfScreen: { type: 'HalfScreen', id: 3 }, + specialDm: { type: 'SpecialDm', id: 4 }, }, }, PlayerAutomate: { fields: { - dailyMax: { type: "int64", id: 1 }, - url: { type: "string", id: 2 }, + dailyMax: { type: 'int64', id: 1 }, + url: { type: 'string', id: 2 }, }, }, DmSummon: { fields: { - title: { rule: "repeated", type: "string", id: 1 }, - url: { type: "string", id: 2 }, - errMsg: { type: "string", id: 3 }, - longContent: { type: "string", id: 4 }, - shortContent: { type: "string", id: 5 }, + title: { rule: 'repeated', type: 'string', id: 1 }, + url: { type: 'string', id: 2 }, + errMsg: { type: 'string', id: 3 }, + longContent: { type: 'string', id: 4 }, + shortContent: { type: 'string', id: 5 }, }, }, HalfScreen: { fields: { - dailyMax: { type: "int64", id: 1 }, - url: { type: "string", id: 2 }, + dailyMax: { type: 'int64', id: 1 }, + url: { type: 'string', id: 2 }, }, }, SpecialDm: { fields: { - start: { type: "int64", id: 1 }, - end: { type: "int64", id: 2 }, - isDisplay: { type: "bool", id: 3 }, + start: { type: 'int64', id: 1 }, + end: { type: 'int64', id: 2 }, + isDisplay: { type: 'bool', id: 3 }, }, }, CellFluid: { fields: { - topBaseColor: { type: "string", id: 1 }, - topSplitColor: { type: "string", id: 2 }, - topTextColor: { type: "string", id: 3 }, + topBaseColor: { type: 'string', id: 1 }, + topSplitColor: { type: 'string', id: 2 }, + topTextColor: { type: 'string', id: 3 }, }, }, NftFaceIcon: { fields: { - regionType: { type: "int32", id: 1 }, - icon: { type: "string", id: 2 }, - showStatus: { type: "int32", id: 3 }, + regionType: { type: 'int32', id: 1 }, + icon: { type: 'string', id: 2 }, + showStatus: { type: 'int32', id: 3 }, }, }, IconData: { fields: { - metaJson: { type: "string", id: 1 }, - spritsImg: { type: "string", id: 2 }, + metaJson: { type: 'string', id: 1 }, + spritsImg: { type: 'string', id: 2 }, }, }, }, @@ -11017,35 +11017,35 @@ const biliJson = { avatar: { nested: { common: { - options: { java_package: "com.smile.bilibili.model" }, + options: { java_package: 'com.smile.bilibili.model' }, nested: { SizeSpec: { fields: { - width: { type: "double", id: 1 }, - height: { type: "double", id: 2 }, + width: { type: 'double', id: 1 }, + height: { type: 'double', id: 2 }, }, }, MaskProperty: { fields: { - generalSpec: { type: "LayerGeneralSpec", id: 1 }, - maskSrc: { type: "ResourceSource", id: 2 }, + generalSpec: { type: 'LayerGeneralSpec', id: 1 }, + maskSrc: { type: 'ResourceSource', id: 2 }, }, }, LayerGeneralSpec: { fields: { - posSpec: { type: "PositionSpec", id: 1 }, - sizeSpec: { type: "SizeSpec", id: 2 }, - renderSpec: { type: "BasicRenderSpec", id: 3 }, + posSpec: { type: 'PositionSpec', id: 1 }, + sizeSpec: { type: 'SizeSpec', id: 2 }, + renderSpec: { type: 'BasicRenderSpec', id: 3 }, }, }, BasicRenderSpec: { - fields: { opacity: { type: "double", id: 1 } }, + fields: { opacity: { type: 'double', id: 1 } }, }, PositionSpec: { fields: { - coordinatePos: { type: "CoordinatePos", id: 1 }, - axisX: { type: "double", id: 2 }, - axisY: { type: "double", id: 3 }, + coordinatePos: { type: 'CoordinatePos', id: 1 }, + axisX: { type: 'double', id: 2 }, + axisY: { type: 'double', id: 3 }, }, }, CoordinatePos: { @@ -11057,14 +11057,14 @@ const biliJson = { }, ResourceSource: { oneofs: { - res: { oneof: ["remoteRes", "local", "draw"] }, + res: { oneof: ['remoteRes', 'local', 'draw'] }, }, fields: { - srcType: { type: "SourceType", id: 1 }, - placeholder: { type: "LocalRes", id: 2 }, - remoteRes: { type: "RemoteRes", id: 3 }, - local: { type: "LocalRes", id: 4 }, - draw: { type: "NativeDrawRes", id: 5 }, + srcType: { type: 'SourceType', id: 1 }, + placeholder: { type: 'LocalRes', id: 2 }, + remoteRes: { type: 'RemoteRes', id: 3 }, + local: { type: 'LocalRes', id: 4 }, + draw: { type: 'NativeDrawRes', id: 5 }, }, }, SourceType: { @@ -11088,16 +11088,16 @@ const biliJson = { }, RemoteRes: { fields: { - url: { type: "string", id: 1 }, - bfsStyle: { type: "string", id: 2 }, + url: { type: 'string', id: 1 }, + bfsStyle: { type: 'string', id: 2 }, }, }, NativeDrawRes: { fields: { - drawType: { type: "NativeDraw", id: 1 }, - fillMode: { type: "FillMode", id: 2 }, - colorConfig: { type: "ColorConfig", id: 3 }, - edgeWeight: { type: "double", id: 4 }, + drawType: { type: 'NativeDraw', id: 1 }, + fillMode: { type: 'FillMode', id: 2 }, + colorConfig: { type: 'ColorConfig', id: 3 }, + edgeWeight: { type: 'double', id: 4 }, }, }, NativeDraw: { @@ -11116,63 +11116,63 @@ const biliJson = { }, ColorConfig: { fields: { - isDarkModeAware: { type: "bool", id: 1 }, - day: { type: "ColorSpec", id: 2 }, - night: { type: "ColorSpec", id: 3 }, + isDarkModeAware: { type: 'bool', id: 1 }, + day: { type: 'ColorSpec', id: 2 }, + night: { type: 'ColorSpec', id: 3 }, }, }, ColorSpec: { - fields: { argb: { type: "string", id: 1 } }, + fields: { argb: { type: 'string', id: 1 } }, }, }, }, v1: { - options: { java_package: "com.smile.bilibili.model" }, + options: { java_package: 'com.smile.bilibili.model' }, nested: { AvatarItem: { fields: { containerSize: { - type: "bilibili.dagw.component.avatar.common.SizeSpec", + type: 'bilibili.dagw.component.avatar.common.SizeSpec', id: 1, }, layers: { - rule: "repeated", - type: "LayerGroup", + rule: 'repeated', + type: 'LayerGroup', id: 2, }, - fallbackLayers: { type: "LayerGroup", id: 3 }, - mid: { type: "int64", id: 4 }, + fallbackLayers: { type: 'LayerGroup', id: 3 }, + mid: { type: 'int64', id: 4 }, }, }, LayerGroup: { fields: { - groupId: { type: "string", id: 1 }, - layers: { rule: "repeated", type: "Layer", id: 2 }, + groupId: { type: 'string', id: 1 }, + layers: { rule: 'repeated', type: 'Layer', id: 2 }, groupMask: { - type: "bilibili.dagw.component.avatar.common.MaskProperty", + type: 'bilibili.dagw.component.avatar.common.MaskProperty', id: 3, }, - isCriticalGroup: { type: "bool", id: 4 }, + isCriticalGroup: { type: 'bool', id: 4 }, }, }, Layer: { fields: { - layerId: { type: "string", id: 1 }, - visible: { type: "bool", id: 2 }, + layerId: { type: 'string', id: 1 }, + visible: { type: 'bool', id: 2 }, generalSpec: { - type: "bilibili.dagw.component.avatar.common.LayerGeneralSpec", + type: 'bilibili.dagw.component.avatar.common.LayerGeneralSpec', id: 3, }, - layerConfig: { type: "LayerConfig", id: 4 }, - resource: { type: "BasicLayerResource", id: 5 }, + layerConfig: { type: 'LayerConfig', id: 4 }, + resource: { type: 'BasicLayerResource', id: 5 }, }, }, LayerConfig: { fields: { - isCritical: { type: "bool", id: 2 }, - allowOverPaint: { type: "bool", id: 3 }, + isCritical: { type: 'bool', id: 2 }, + allowOverPaint: { type: 'bool', id: 3 }, layerMask: { - type: "bilibili.dagw.component.avatar.common.MaskProperty", + type: 'bilibili.dagw.component.avatar.common.MaskProperty', id: 4, }, }, @@ -11189,95 +11189,95 @@ const biliJson = { GeneralConfig: { fields: { webCssStyle: { - keyType: "string", - type: "string", + keyType: 'string', + type: 'string', id: 1, }, }, }, GyroConfig: { - fields: { gyroscope: { type: "NFTImageV2", id: 1 } }, + fields: { gyroscope: { type: 'NFTImageV2', id: 1 } }, }, NFTImageV2: { fields: { gyroscope: { - rule: "repeated", - type: "GyroscopeEntityV2", + rule: 'repeated', + type: 'GyroscopeEntityV2', id: 1, }, }, }, GyroscopeEntityV2: { fields: { - displayType: { type: "string", id: 1 }, + displayType: { type: 'string', id: 1 }, contents: { - rule: "repeated", - type: "GyroscopeContentV2", + rule: 'repeated', + type: 'GyroscopeContentV2', id: 2, }, }, }, GyroscopeContentV2: { fields: { - fileUrl: { type: "string", id: 1 }, - scale: { type: "float", id: 2 }, + fileUrl: { type: 'string', id: 1 }, + scale: { type: 'float', id: 2 }, physicalOrientation: { - rule: "repeated", - type: "PhysicalOrientationV2", + rule: 'repeated', + type: 'PhysicalOrientationV2', id: 3, }, }, }, PhysicalOrientationV2: { fields: { - type: { type: "string", id: 1 }, - angle: { rule: "repeated", type: "float", id: 2 }, + type: { type: 'string', id: 1 }, + angle: { rule: 'repeated', type: 'float', id: 2 }, animations: { - rule: "repeated", - type: "PhysicalOrientationAnimation", + rule: 'repeated', + type: 'PhysicalOrientationAnimation', id: 3, }, }, }, PhysicalOrientationAnimation: { fields: { - type: { type: "string", id: 1 }, - value: { rule: "repeated", type: "float", id: 2 }, - bezier: { type: "string", id: 3 }, + type: { type: 'string', id: 1 }, + value: { rule: 'repeated', type: 'float', id: 2 }, + bezier: { type: 'string', id: 3 }, }, }, CommentDoubleClickConfig: { fields: { - interaction: { type: "Interaction", id: 1 }, - animationScale: { type: "double", id: 2 }, + interaction: { type: 'Interaction', id: 1 }, + animationScale: { type: 'double', id: 2 }, }, }, Interaction: { fields: { - nftId: { type: "string", id: 1 }, - enabled: { type: "bool", id: 2 }, - itype: { type: "string", id: 3 }, - metadataUrl: { type: "string", id: 4 }, + nftId: { type: 'string', id: 1 }, + enabled: { type: 'bool', id: 2 }, + itype: { type: 'string', id: 3 }, + metadataUrl: { type: 'string', id: 4 }, }, }, LiveAnimeConfig: { - fields: { isLive: { type: "bool", id: 1 } }, + fields: { isLive: { type: 'bool', id: 1 } }, }, BasicLayerResource: { oneofs: { payload: { oneof: [ - "resImage", - "resAnimation", - "resNativeDraw", + 'resImage', + 'resAnimation', + 'resNativeDraw', ], }, }, fields: { - resType: { type: "ResType", id: 1 }, - resImage: { type: "ResImage", id: 2 }, - resAnimation: { type: "ResAnimation", id: 3 }, - resNativeDraw: { type: "ResNativeDraw", id: 4 }, + resType: { type: 'ResType', id: 1 }, + resImage: { type: 'ResImage', id: 2 }, + resAnimation: { type: 'ResAnimation', id: 3 }, + resNativeDraw: { type: 'ResNativeDraw', id: 4 }, }, }, ResType: { @@ -11293,7 +11293,7 @@ const biliJson = { ResImage: { fields: { imageSrc: { - type: "bilibili.dagw.component.avatar.common.ResourceSource", + type: 'bilibili.dagw.component.avatar.common.ResourceSource', id: 1, }, }, @@ -11301,7 +11301,7 @@ const biliJson = { ResAnimation: { fields: { webpSrc: { - type: "bilibili.dagw.component.avatar.common.ResourceSource", + type: 'bilibili.dagw.component.avatar.common.ResourceSource', id: 1, }, }, @@ -11309,7 +11309,7 @@ const biliJson = { ResNativeDraw: { fields: { drawSrc: { - type: "bilibili.dagw.component.avatar.common.ResourceSource", + type: 'bilibili.dagw.component.avatar.common.ResourceSource', id: 1, }, }, @@ -11330,8 +11330,8 @@ const biliJson = { nested: { Any: { fields: { - type_url: { type: "string", id: 1 }, - value: { type: "bytes", id: 2 }, + type_url: { type: 'string', id: 1 }, + value: { type: 'bytes', id: 2 }, }, }, }, @@ -11344,35 +11344,35 @@ let isDebug = !1; const url = $request.url, method = $request.method; let headers = $response.headers; -const isQuanX = "undefined" != typeof $task, +const isQuanX = 'undefined' != typeof $task, binaryBody = isQuanX ? new Uint8Array($response.bodyBytes) : $response.body; -let gzipStrName = "grpc-encoding"; -headers[gzipStrName] || (gzipStrName = "Grpc-Encoding"); -const isGzipCompress = "gzip" === headers[gzipStrName]; +let gzipStrName = 'grpc-encoding'; +headers[gzipStrName] || (gzipStrName = 'Grpc-Encoding'); +const isGzipCompress = 'gzip' === headers[gzipStrName]; log(`isGzipCompress:${isGzipCompress}`); const unGzipBody = isGzipCompress ? pako.ungzip(binaryBody.slice(5)) : binaryBody.slice(5); -headers[gzipStrName] = "identity"; +headers[gzipStrName] = 'identity'; let body; const biliRoot = protobuf.Root.fromJSON(biliJson); let needProcessFlag = !1; if ( - ("POST" !== method && - $notification.post(notifyTitle, "method mistake:", method), - url.includes("Dynamic/DynAll")) + ('POST' !== method && + $notification.post(notifyTitle, 'method mistake:', method), + url.includes('Dynamic/DynAll')) ) { - log("Dynamic page Dynamic/DynAll"); - let e = biliRoot.lookupType("bilibili.app.dynamic.DynAllReply"), + log('Dynamic page Dynamic/DynAll'); + let e = biliRoot.lookupType('bilibili.app.dynamic.DynAllReply'), i = e.decode(unGzipBody); if ( (i.topicList && - ((needProcessFlag = !0), (i.topicList = null), log("Delete topicList")), + ((needProcessFlag = !0), (i.topicList = null), log('Delete topicList')), i.upList, i.dynamicList?.list?.length) ) { let o = 0, - l = RegExp("红包|拼多多|京东|天猫|淘宝|抽奖"); + l = RegExp('红包|拼多多|京东|天猫|淘宝|抽奖'); (i.dynamicList.list = i.dynamicList.list.filter( (e) => !( @@ -11383,31 +11383,31 @@ if ( )), o && ((needProcessFlag = !0), - log("Number of dynamic page advertisements:" + o)); + log('Number of dynamic page advertisements:' + o)); } needProcessFlag && (body = processNewBody(e.encode(i).finish())); -} else if (url.includes("View/View")) { - log("Video playback page View/View"); - let t = biliRoot.lookupType("bilibili.app.view.ViewReply"), +} else if (url.includes('View/View')) { + log('Video playback page View/View'); + let t = biliRoot.lookupType('bilibili.app.view.ViewReply'), n = t.decode(unGzipBody), s = [ - "cmIpad", - "specialCellNew", - "specialCell", - "activityUrl", - "1reqUser", - "materialLeft", - "refreshSpecialCell", + 'cmIpad', + 'specialCellNew', + 'specialCell', + 'activityUrl', + '1reqUser', + 'materialLeft', + 'refreshSpecialCell', ]; if ( (s.forEach((e) => { n[e] && - ((n[e] = null), (needProcessFlag = !0), log("Remove advertising")); + ((n[e] = null), (needProcessFlag = !0), log('Remove advertising')); }), n.cms?.length) ) { let a = 0, - d = biliRoot.lookupType("bilibili.ad.v1.SourceContentDto"); + d = biliRoot.lookupType('bilibili.ad.v1.SourceContentDto'); for (let r = 0; r < n.cms.length; r++) { let c = n.cms[r]; if (c.sourceContent?.value) { @@ -11421,13 +11421,13 @@ if ( } if (n.relates?.length) { let p = 0; - (n.relates = n.relates.filter((e) => "cm" !== e.goto || (p++, !1))), + (n.relates = n.relates.filter((e) => 'cm' !== e.goto || (p++, !1))), log(`Related recommendation advertisement:${p}`), p && (needProcessFlag = !0); } let g = n.cmConfig?.adsControl?.value; if (g) { - let u = biliRoot.lookupType("bilibili.ad.v1.AdsControlDto"), + let u = biliRoot.lookupType('bilibili.ad.v1.AdsControlDto'), b = u.decode(g); (b?.hasDanmu === 1 || b?.cids?.length > 0) && (log(`Up danmu advertisement. ${b?.hasDanmu}, ${b?.cids}`), @@ -11439,9 +11439,9 @@ if ( for (let f in m) null === m[f] && (log(`tIconMap:${f}`), delete m[f]); body = processNewBody(t.encode(n).finish()); } -} else if (url.includes("PlayURL/PlayView")) { - log("PlayURL/PlayView"); - let h = biliRoot.lookupType("bilibili.app.playurl.PlayViewReply"), +} else if (url.includes('PlayURL/PlayView')) { + log('PlayURL/PlayView'); + let h = biliRoot.lookupType('bilibili.app.playurl.PlayViewReply'), P = h.decode(unGzipBody), w = P.playArc?.backgroundPlayConf; w && @@ -11451,7 +11451,7 @@ if ( (P.playArc.backgroundPlayConf.extraContent = null), (needProcessFlag = !0), (body = processNewBody(h.encode(P).finish()))); -} else $notification.post("bilibili-proto", "path mistake:", url); +} else $notification.post('bilibili-proto', 'path mistake:', url); function processNewBody(e) { let i = e.length, o = new Uint8Array(5 + i); @@ -11475,4 +11475,4 @@ needProcessFlag headers, }) : $done({ body, headers })) - : (log("no deal with"), $done({})); + : (log('no deal with'), $done({}));