From 19ecdbecf0c4027c42868219bc20504f1d364061 Mon Sep 17 00:00:00 2001 From: Virgil Clyne Date: Mon, 22 Apr 2024 16:25:16 +0800 Subject: [PATCH] build: ENV v1.8.3 --- js/BiliBili.Global.request.beta.js | 43 ++++++++++++++++++++++++++--- js/BiliBili.Global.response.beta.js | 43 ++++++++++++++++++++++++++--- js/BiliBili.Global.response.js | 4 +-- js/BiliIntl.Global.request.beta.js | 43 ++++++++++++++++++++++++++--- 4 files changed, 119 insertions(+), 14 deletions(-) diff --git a/js/BiliBili.Global.request.beta.js b/js/BiliBili.Global.request.beta.js index 6568b7a..3c4fb84 100644 --- a/js/BiliBili.Global.request.beta.js +++ b/js/BiliBili.Global.request.beta.js @@ -294,7 +294,7 @@ class $Storage { class ENV { static name = "ENV" - static version = '1.7.4' + static version = '1.8.3' static about() { return console.log(`\n🟧 ${this.name} v${this.version}\n`) } constructor(name, opts) { @@ -309,6 +309,37 @@ class ENV { Object.assign(this, opts); this.log(`\n🚩 开始!\n${name}\n`); } + + environment() { + switch (this.platform()) { + case 'Surge': + $environment.app = 'Surge'; + return $environment + case 'Stash': + $environment.app = 'Stash'; + return $environment + case 'Egern': + $environment.app = 'Egern'; + return $environment + case 'Loon': + let environment = $loon.split(' '); + return { + "device": environment[0], + "ios": environment[1], + "loon-version": environment[2], + "app": "Loon" + }; + case 'Quantumult X': + return { + "app": "Quantumult X" + }; + case 'Node.js': + process.env.app = 'Node.js'; + return process.env + default: + return {} + } + } platform() { if ('undefined' !== typeof $environment && $environment['surge-version']) @@ -390,10 +421,10 @@ class ENV { // 初始化参数 switch (request.constructor) { case Object: - request = { ...request, ...option }; + request = { ...option, ...request }; break; case String: - request = { "url": request, ...option }; + request = { ...option, "url": request }; break; } // 自动判断请求方法 if (!request.method) { @@ -415,9 +446,13 @@ class ENV { case 'Shadowrocket': default: // 转换请求参数 - if (request.policy) { + if (request.timeout) { + request.timeout = parseInt(request.timeout, 10); + if (this.isSurge()) ; else request.timeout = request.timeout * 1000; + } if (request.policy) { if (this.isLoon()) request.node = request.policy; if (this.isStash()) Lodash.set(request, "headers.X-Stash-Selected-Proxy", encodeURI(request.policy)); + if (this.isShadowrocket()) Lodash.set(request, "headers.X-Surge-Proxy", request.policy); } if (typeof request.redirection === "boolean") request["auto-redirect"] = request.redirection; // 转换请求体 if (request.bodyBytes && !request.body) { diff --git a/js/BiliBili.Global.response.beta.js b/js/BiliBili.Global.response.beta.js index eabf3d6..54c26fd 100644 --- a/js/BiliBili.Global.response.beta.js +++ b/js/BiliBili.Global.response.beta.js @@ -294,7 +294,7 @@ class $Storage { class ENV { static name = "ENV" - static version = '1.7.4' + static version = '1.8.3' static about() { return console.log(`\n🟧 ${this.name} v${this.version}\n`) } constructor(name, opts) { @@ -309,6 +309,37 @@ class ENV { Object.assign(this, opts); this.log(`\n🚩 开始!\n${name}\n`); } + + environment() { + switch (this.platform()) { + case 'Surge': + $environment.app = 'Surge'; + return $environment + case 'Stash': + $environment.app = 'Stash'; + return $environment + case 'Egern': + $environment.app = 'Egern'; + return $environment + case 'Loon': + let environment = $loon.split(' '); + return { + "device": environment[0], + "ios": environment[1], + "loon-version": environment[2], + "app": "Loon" + }; + case 'Quantumult X': + return { + "app": "Quantumult X" + }; + case 'Node.js': + process.env.app = 'Node.js'; + return process.env + default: + return {} + } + } platform() { if ('undefined' !== typeof $environment && $environment['surge-version']) @@ -390,10 +421,10 @@ class ENV { // 初始化参数 switch (request.constructor) { case Object: - request = { ...request, ...option }; + request = { ...option, ...request }; break; case String: - request = { "url": request, ...option }; + request = { ...option, "url": request }; break; } // 自动判断请求方法 if (!request.method) { @@ -415,9 +446,13 @@ class ENV { case 'Shadowrocket': default: // 转换请求参数 - if (request.policy) { + if (request.timeout) { + request.timeout = parseInt(request.timeout, 10); + if (this.isSurge()) ; else request.timeout = request.timeout * 1000; + } if (request.policy) { if (this.isLoon()) request.node = request.policy; if (this.isStash()) Lodash.set(request, "headers.X-Stash-Selected-Proxy", encodeURI(request.policy)); + if (this.isShadowrocket()) Lodash.set(request, "headers.X-Surge-Proxy", request.policy); } if (typeof request.redirection === "boolean") request["auto-redirect"] = request.redirection; // 转换请求体 if (request.bodyBytes && !request.body) { diff --git a/js/BiliBili.Global.response.js b/js/BiliBili.Global.response.js index 140673c..986691a 100644 --- a/js/BiliBili.Global.response.js +++ b/js/BiliBili.Global.response.js @@ -1,2 +1,2 @@ -class e{static name="Lodash";static version="1.2.2";static about(){return console.log(`\n🟧 ${this.name} v${this.version}\n`)}static get(e={},t="",s=void 0){Array.isArray(t)||(t=this.toPath(t));const a=t.reduce(((e,t)=>Object(e)[t]),e);return void 0===a?s:a}static set(e={},t="",s){return Array.isArray(t)||(t=this.toPath(t)),t.slice(0,-1).reduce(((e,s,a)=>Object(e[s])===e[s]?e[s]:e[s]=/^\d+$/.test(t[a+1])?[]:{}),e)[t[t.length-1]]=s,e}static unset(e={},t=""){return Array.isArray(t)||(t=this.toPath(t)),t.reduce(((e,s,a)=>a===t.length-1?(delete e[s],!0):Object(e)[s]),e)}static toPath(e){return e.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean)}static escape(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,(e=>t[e]))}static unescape(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&|<|>|"|'/g,(e=>t[e]))}}class t{static name="$Storage";static version="1.0.9";static about(){return console.log(`\n🟧 ${this.name} v${this.version}\n`)}static data=null;static dataFile="box.dat";static#e=/^@(?[^.]+)(?:\.(?.*))?$/;static#t(){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":"undefined"!=typeof Egern?"Egern":void 0}static getItem(t=new String,s=null){let a=s;if(!0===t.startsWith("@")){const{key:s,path:i}=t.match(this.#e)?.groups;t=s;let n=this.getItem(t,{});"object"!=typeof n&&(n={}),a=e.get(n,i);try{a=JSON.parse(a)}catch(e){}}else{switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":a=$persistentStore.read(t);break;case"Quantumult X":a=$prefs.valueForKey(t);break;case"Node.js":this.data=this.#s(this.dataFile),a=this.data?.[t];break;default:a=this.data?.[t]||null}try{a=JSON.parse(a)}catch(e){}}return a??s}static setItem(t=new String,s=new String){let a=!1;if("object"==typeof s)s=JSON.stringify(s);else s=String(s);if(!0===t.startsWith("@")){const{key:i,path:n}=t.match(this.#e)?.groups;t=i;let r=this.getItem(t,{});"object"!=typeof r&&(r={}),e.set(r,n,s),a=this.setItem(t,r)}else switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":a=$persistentStore.write(s,t);break;case"Quantumult X":a=$prefs.setValueForKey(s,t);break;case"Node.js":this.data=this.#s(this.dataFile),this.data[t]=s,this.#a(this.dataFile),a=!0;break;default:a=this.data?.[t]||null}return a}static removeItem(t){let s=!1;if(!0===t.startsWith("@")){const{key:a,path:i}=t.match(this.#e)?.groups;t=a;let n=this.getItem(t);"object"!=typeof n&&(n={}),keyValue=e.unset(n,i),s=this.setItem(t,n)}else switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Node.js":default:s=!1;break;case"Quantumult X":s=$prefs.removeValueForKey(t)}return s}static clear(){let e=!1;switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Node.js":default:e=!1;break;case"Quantumult X":e=$prefs.removeAllValues()}return e}static#s(e){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(e),s=this.path.resolve(process.cwd(),e),a=this.fs.existsSync(t),i=!a&&this.fs.existsSync(s);if(!a&&!i)return{};{const e=a?t:s;try{return JSON.parse(this.fs.readFileSync(e))}catch(e){return{}}}}}static#a(e=this.dataFile){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(e),s=this.path.resolve(process.cwd(),e),a=this.fs.existsSync(t),i=!a&&this.fs.existsSync(s),n=JSON.stringify(this.data);a?this.fs.writeFileSync(t,n):i?this.fs.writeFileSync(s,n):this.fs.writeFileSync(t,n)}}}class s{static name="ENV";static version="1.7.4";static about(){return console.log(`\n🟧 ${this.name} v${this.version}\n`)}constructor(e,t){console.log(`\n🟧 ${s.name} v${s.version}\n`),this.name=e,this.logs=[],this.isMute=!1,this.isMuteLog=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,t),this.log(`\n🚩 开始!\n${e}\n`)}platform(){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":"undefined"!=typeof Egern?"Egern":void 0}isNode(){return"Node.js"===this.platform()}isQuanX(){return"Quantumult X"===this.platform()}isSurge(){return"Surge"===this.platform()}isLoon(){return"Loon"===this.platform()}isShadowrocket(){return"Shadowrocket"===this.platform()}isStash(){return"Stash"===this.platform()}isEgern(){return"Egern"===this.platform()}async getScript(e){return await this.fetch(e).then((e=>e.body))}async runScript(e,s){let a=t.getItem("@chavy_boxjs_userCfgs.httpapi");a=a?.replace?.(/\n/g,"")?.trim();let i=t.getItem("@chavy_boxjs_userCfgs.httpapi_timeout");i=1*i??20,i=s?.timeout??i;const[n,r]=a.split("@"),o={url:`http://${r}/v1/scripting/evaluate`,body:{script_text:e,mock_type:"cron",timeout:i},headers:{"X-Key":n,Accept:"*/*"},timeout:i};await this.fetch(o).then((e=>e.body),(e=>this.logErr(e)))}initGotEnv(e){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,e&&(e.headers=e.headers?e.headers:{},void 0===e.headers.Cookie&&void 0===e.cookieJar&&(e.cookieJar=this.ckjar))}async fetch(t={}||"",s={}){switch(t.constructor){case Object:t={...t,...s};break;case String:t={url:t,...s}}t.method||(t.method="GET",(t.body??t.bodyBytes)&&(t.method="POST")),delete t.headers?.Host,delete t.headers?.[":authority"],delete t.headers?.["Content-Length"],delete t.headers?.["content-length"];const a=t.method.toLocaleLowerCase();switch(this.platform()){case"Loon":case"Surge":case"Stash":case"Egern":case"Shadowrocket":default:return t.policy&&(this.isLoon()&&(t.node=t.policy),this.isStash()&&e.set(t,"headers.X-Stash-Selected-Proxy",encodeURI(t.policy))),"boolean"==typeof t.redirection&&(t["auto-redirect"]=t.redirection),t.bodyBytes&&!t.body&&(t.body=t.bodyBytes,delete t.bodyBytes),await new Promise(((e,s)=>{$httpClient[a](t,((a,i,n)=>{a?s(a):(i.ok=/^2\d\d$/.test(i.status),i.statusCode=i.status,n&&(i.body=n,1==t["binary-mode"]&&(i.bodyBytes=n)),e(i))}))}));case"Quantumult X":return t.policy&&e.set(t,"opts.policy",t.policy),"boolean"==typeof t["auto-redirect"]&&e.set(t,"opts.redirection",t["auto-redirect"]),t.body instanceof ArrayBuffer?(t.bodyBytes=t.body,delete t.body):ArrayBuffer.isView(t.body)?(t.bodyBytes=t.body.buffer.slice(t.body.byteOffset,t.body.byteLength+t.body.byteOffset),delete object.body):t.body&&delete t.bodyBytes,await $task.fetch(t).then((e=>(e.ok=/^2\d\d$/.test(e.statusCode),e.status=e.statusCode,e)),(e=>Promise.reject(e.error)));case"Node.js":let s=require("iconv-lite");this.initGotEnv(t);const{url:i,...n}=t;return await this.got[a](i,n).on("redirect",((e,t)=>{try{if(e.headers["set-cookie"]){const s=e.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),t.cookieJar=this.ckjar}}catch(e){this.logErr(e)}})).then((e=>(e.statusCode=e.status,e.body=s.decode(e.rawBody,this.encoding),e.bodyBytes=e.rawBody,e)),(e=>Promise.reject(e.message)))}}time(e,t=null){const s=t?new Date(t):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(e)&&(e=e.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let t in a)new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?a[t]:("00"+a[t]).substr((""+a[t]).length)));return e}msg(e=name,t="",s="",a){const i=e=>{switch(typeof e){case void 0:return e;case"string":switch(this.platform()){case"Surge":case"Stash":case"Egern":default:return{url:e};case"Loon":case"Shadowrocket":return e;case"Quantumult X":return{"open-url":e};case"Node.js":return}case"object":switch(this.platform()){case"Surge":case"Stash":case"Egern":case"Shadowrocket":default:return{url:e.url||e.openUrl||e["open-url"]};case"Loon":return{openUrl:e.openUrl||e.url||e["open-url"],mediaUrl:e.mediaUrl||e["media-url"]};case"Quantumult X":return{"open-url":e["open-url"]||e.url||e.openUrl,"media-url":e["media-url"]||e.mediaUrl,"update-pasteboard":e["update-pasteboard"]||e.updatePasteboard};case"Node.js":return}default:return}};if(!this.isMute)switch(this.platform()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":default:$notification.post(e,t,s,i(a));break;case"Quantumult X":$notify(e,t,s,i(a));case"Node.js":}if(!this.isMuteLog){let a=["","==============📣系统通知📣=============="];a.push(e),t&&a.push(t),s&&a.push(s),console.log(a.join("\n")),this.logs=this.logs.concat(a)}}log(...e){e.length>0&&(this.logs=[...this.logs,...e]),console.log(e.join(this.logSeparator))}logErr(e){switch(this.platform()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Quantumult X":default:this.log("",`❗️ ${this.name}, 错误!`,e);break;case"Node.js":this.log("",`❗️${this.name}, 错误!`,e.stack)}}wait(e){return new Promise((t=>setTimeout(t,e)))}done(t={}){const s=((new Date).getTime()-this.startTime)/1e3;switch(this.log("",`🚩 ${this.name}, 结束! 🕛 ${s} 秒`,""),this.platform()){case"Surge":t.policy&&e.set(t,"headers.X-Surge-Policy",t.policy),$done(t);break;case"Loon":t.policy&&(t.node=t.policy),$done(t);break;case"Stash":t.policy&&e.set(t,"headers.X-Stash-Selected-Proxy",encodeURI(t.policy)),$done(t);break;case"Egern":case"Shadowrocket":default:$done(t);break;case"Quantumult X":t.policy&&e.set(t,"opts.policy",t.policy),delete t["auto-redirect"],delete t["auto-cookie"],delete t["binary-mode"],delete t.charset,delete t.host,delete t.insecure,delete t.method,delete t.opt,delete t.path,delete t.policy,delete t["policy-descriptor"],delete t.scheme,delete t.sessionIndex,delete t.statusCode,delete t.timeout,t.body instanceof ArrayBuffer?(t.bodyBytes=t.body,delete t.body):ArrayBuffer.isView(t.body)?(t.bodyBytes=t.body.buffer.slice(t.body.byteOffset,t.body.byteLength+t.body.byteOffset),delete t.body):t.body&&delete t.bodyBytes,$done(t);break;case"Node.js":process.exit(1)}}}var a={Switch:!0},i={Settings:a},n={Switch:!0,ForceHost:"1",Locales:["CHN","HKG","TWN"],Proxies:{CHN:"DIRECT",HKG:"🇭🇰香港",MAC:"🇲🇴澳门",TWN:"🇹🇼台湾"}},r={Locale:{CHN:"",HKG:"(僅限港.*地區)",MAC:"(僅限.*澳.*地區)",TWN:"(僅限.*台地區)"},SearchNav:{CHN:{name:"番剧🇨🇳",total:0,pages:0,type:17},HKG:{name:"动画🇭🇰",total:0,pages:0,type:27},MAC:{name:"动画🇲🇴",total:0,pages:0,type:37},TWN:{name:"动画🇹🇼",total:0,pages:0,type:47}}},o={Settings:n,Configs:r},l=Database={Default:Object.freeze({__proto__:null,Settings:a,default:i}),Global:Object.freeze({__proto__:null,Configs:r,Settings:n,default:o})};function c(s,a,i){console.log("☑️ Set Environment Variables","");let{Settings:n,Caches:r,Configs:o}=function(s,a,i){let n=t.getItem(s,i),r={};if("undefined"!=typeof $argument&&Boolean($argument)){let t=Object.fromEntries($argument.split("&").map((e=>e.split("=").map((e=>e.replace(/\"/g,""))))));for(let s in t)e.set(r,s,t[s])}const o={Settings:i?.Default?.Settings||{},Configs:i?.Default?.Configs||{},Caches:{}};Array.isArray(a)||(a=[a]);for(let e of a)o.Settings={...o.Settings,...i?.[e]?.Settings,...r,...n?.[e]?.Settings},o.Configs={...o.Configs,...i?.[e]?.Configs},n?.[e]?.Caches&&"string"==typeof n?.[e]?.Caches&&(n[e].Caches=JSON.parse(n?.[e]?.Caches)),o.Caches={...o.Caches,...n?.[e]?.Caches};return function e(t,s){for(var a in t){var i=t[a];t[a]="object"==typeof i&&null!==i?e(i,s):s(a,i)}return t}(o.Settings,((e,t)=>("true"===t||"false"===t?t=JSON.parse(t):"string"==typeof t&&(t=t.includes(",")?t.split(",").map((e=>l(e))):l(t)),t))),o;function l(e){return e&&!isNaN(e)&&(e=parseInt(e,10)),e}}(s,a,i);return Array.isArray(n?.Locales)||(n.Locales=n.Locales?[n.Locales]:[]),console.log(`✅ Set Environment Variables, Settings: ${typeof n}, Settings内容: ${JSON.stringify(n)}`,""),Array.isArray(r?.ss)||(r.ss=[]),Array.isArray(r?.ep)||(r.ep=[]),r.ss=new Map(r?.ss??[]),r.ep=new Map(r?.ep??[]),{Settings:n,Caches:r,Configs:o}} -/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function h(e){let t=e.length;for(;--t>=0;)e[t]=0}const u=256,d=286,f=30,p=15,g=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]),m=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]),_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),b=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),w=new Array(576);h(w);const y=new Array(60);h(y);const k=new Array(512);h(k);const v=new Array(256);h(v);const I=new Array(29);h(I);const N=new Array(f);function S(e,t,s,a,i){this.static_tree=e,this.extra_bits=t,this.extra_base=s,this.elems=a,this.max_length=i,this.has_stree=e&&e.length}let T,E,x;function A(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}h(N);const O=e=>e<256?k[e]:k[256+(e>>>7)],B=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},U=(e,t,s)=>{e.bi_valid>16-s?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=s-16):(e.bi_buf|=t<{U(e,s[2*t],s[2*t+1])},z=(e,t)=>{let s=0;do{s|=1&e,e>>>=1,s<<=1}while(--t>0);return s>>>1},D=(e,t,s)=>{const a=new Array(16);let i,n,r=0;for(i=1;i<=p;i++)r=r+s[i-1]<<1,a[i]=r;for(n=0;n<=t;n++){let t=e[2*n+1];0!==t&&(e[2*n]=z(a[t]++,t))}},F=e=>{let t;for(t=0;t{e.bi_valid>8?B(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},C=(e,t,s,a)=>{const i=2*t,n=2*s;return e[i]{const a=e.heap[s];let i=s<<1;for(;i<=e.heap_len&&(i{let a,i,n,r,o=0;if(0!==e.sym_next)do{a=255&e.pending_buf[e.sym_buf+o++],a+=(255&e.pending_buf[e.sym_buf+o++])<<8,i=e.pending_buf[e.sym_buf+o++],0===a?R(e,i,t):(n=v[i],R(e,n+u+1,t),r=g[n],0!==r&&(i-=I[n],U(e,i,r)),a--,n=O(a),R(e,n,s),r=m[n],0!==r&&(a-=N[n],U(e,a,r)))}while(o{const s=t.dyn_tree,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,n=t.stat_desc.elems;let r,o,l,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r>1;r>=1;r--)$(e,s,r);l=n;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],$(e,s,1),o=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=o,s[2*l]=s[2*r]+s[2*o],e.depth[l]=(e.depth[r]>=e.depth[o]?e.depth[r]:e.depth[o])+1,s[2*r+1]=s[2*o+1]=l,e.heap[1]=l++,$(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const s=t.dyn_tree,a=t.max_code,i=t.stat_desc.static_tree,n=t.stat_desc.has_stree,r=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,h,u,d,f,g,m=0;for(d=0;d<=p;d++)e.bl_count[d]=0;for(s[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)h=e.heap[c],d=s[2*s[2*h+1]+1]+1,d>l&&(d=l,m++),s[2*h+1]=d,h>a||(e.bl_count[d]++,f=0,h>=o&&(f=r[h-o]),g=s[2*h],e.opt_len+=g*(d+f),n&&(e.static_len+=g*(i[2*h+1]+f)));if(0!==m){do{for(d=l-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(d=l;0!==d;d--)for(h=e.bl_count[d];0!==h;)u=e.heap[--c],u>a||(s[2*u+1]!==d&&(e.opt_len+=(d-s[2*u+1])*s[2*u],s[2*u+1]=d),h--)}})(e,t),D(s,c,e.bl_count)},V=(e,t,s)=>{let a,i,n=-1,r=t[1],o=0,l=7,c=4;for(0===r&&(l=138,c=3),t[2*(s+1)+1]=65535,a=0;a<=s;a++)i=r,r=t[2*(a+1)+1],++o{let a,i,n=-1,r=t[1],o=0,l=7,c=4;for(0===r&&(l=138,c=3),a=0;a<=s;a++)if(i=r,r=t[2*(a+1)+1],!(++o{U(e,0+(a?1:0),3),L(e),B(e,s),B(e,~s),s&&e.pending_buf.set(e.window.subarray(t,t+s),e.pending),e.pending+=s};var P=(e,t,s,a)=>{let i,n,r=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,s=4093624447;for(t=0;t<=31;t++,s>>>=1)if(1&s&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t{let t;for(V(e,e.dyn_ltree,e.l_desc.max_code),V(e,e.dyn_dtree,e.d_desc.max_code),Z(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*b[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,n=e.static_len+3+7>>>3,n<=i&&(i=n)):i=n=s+5,s+4<=i&&-1!==t?K(e,t,s,a):4===e.strategy||n===i?(U(e,2+(a?1:0),3),j(e,w,y)):(U(e,4+(a?1:0),3),((e,t,s,a)=>{let i;for(U(e,t-257,5),U(e,s-1,5),U(e,a-4,4),i=0;i{G||((()=>{let e,t,s,a,i;const n=new Array(16);for(s=0,a=0;a<28;a++)for(I[a]=s,e=0;e<1<>=7;a(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=s,0===t?e.dyn_ltree[2*s]++:(e.matches++,t--,e.dyn_ltree[2*(v[s]+u+1)]++,e.dyn_dtree[2*O(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{U(e,2,3),R(e,256,w),(e=>{16===e.bi_valid?(B(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var H=(e,t,s,a)=>{let i=65535&e|0,n=e>>>16&65535|0,r=0;for(;0!==s;){r=s>2e3?2e3:s,s-=r;do{i=i+t[a++]|0,n=n+i|0}while(--r);i%=65521,n%=65521}return i|n<<16|0};const J=new Uint32Array((()=>{let e,t=[];for(var s=0;s<256;s++){e=s;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[s]=e}return t})());var W=(e,t,s,a)=>{const i=J,n=a+s;e^=-1;for(let s=a;s>>8^i[255&(e^t[s])];return-1^e},Y={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"},q={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:Q,_tr_stored_block:ee,_tr_flush_block:te,_tr_tally:se,_tr_align:ae}=X,{Z_NO_FLUSH:ie,Z_PARTIAL_FLUSH:ne,Z_FULL_FLUSH:re,Z_FINISH:oe,Z_BLOCK:le,Z_OK:ce,Z_STREAM_END:he,Z_STREAM_ERROR:ue,Z_DATA_ERROR:de,Z_BUF_ERROR:fe,Z_DEFAULT_COMPRESSION:pe,Z_FILTERED:ge,Z_HUFFMAN_ONLY:me,Z_RLE:_e,Z_FIXED:be,Z_DEFAULT_STRATEGY:we,Z_UNKNOWN:ye,Z_DEFLATED:ke}=q,ve=258,Ie=262,Ne=42,Se=113,Te=666,Ee=(e,t)=>(e.msg=Y[t],t),xe=e=>2*e-(e>4?9:0),Ae=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Oe=e=>{let t,s,a,i=e.w_size;t=e.hash_size,a=t;do{s=e.head[--a],e.head[a]=s>=i?s-i:0}while(--t);t=i,a=t;do{s=e.prev[--a],e.prev[a]=s>=i?s-i:0}while(--t)};let Be=(e,t,s)=>(t<{const t=e.state;let s=t.pending;s>e.avail_out&&(s=e.avail_out),0!==s&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+s),e.next_out),e.next_out+=s,t.pending_out+=s,e.total_out+=s,e.avail_out-=s,t.pending-=s,0===t.pending&&(t.pending_out=0))},Re=(e,t)=>{te(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ue(e.strm)},ze=(e,t)=>{e.pending_buf[e.pending++]=t},De=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Fe=(e,t,s,a)=>{let i=e.avail_in;return i>a&&(i=a),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),s),1===e.state.wrap?e.adler=H(e.adler,t,i,s):2===e.state.wrap&&(e.adler=W(e.adler,t,i,s)),e.next_in+=i,e.total_in+=i,i)},Le=(e,t)=>{let s,a,i=e.max_chain_length,n=e.strstart,r=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-Ie?e.strstart-(e.w_size-Ie):0,c=e.window,h=e.w_mask,u=e.prev,d=e.strstart+ve;let f=c[n+r-1],p=c[n+r];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(s=t,c[s+r]===p&&c[s+r-1]===f&&c[s]===c[n]&&c[++s]===c[n+1]){n+=2,s++;do{}while(c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&nr){if(e.match_start=t,r=a,a>=o)break;f=c[n+r-1],p=c[n+r]}}}while((t=u[t&h])>l&&0!=--i);return r<=e.lookahead?r:e.lookahead},Ce=e=>{const t=e.w_size;let s,a,i;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ie)&&(e.window.set(e.window.subarray(t,t+t-a),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Oe(e),a+=t),0===e.strm.avail_in)break;if(s=Fe(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=s,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Be(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Be(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let s,a,i,n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r=0,o=e.strm.avail_in;do{if(s=65535,i=e.bi_valid+42>>3,e.strm.avail_outa+e.strm.avail_in&&(s=a+e.strm.avail_in),s>i&&(s=i),s>8,e.pending_buf[e.pending-2]=~s,e.pending_buf[e.pending-1]=~s>>8,Ue(e.strm),a&&(a>s&&(a=s),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,s-=a),s&&(Fe(e.strm,e.strm.output,e.strm.next_out,s),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s)}while(0===r);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_wateri&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),i>e.strm.avail_in&&(i=e.strm.avail_in),i&&(Fe(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=i>e.w_size-e.insert?e.w_size-e.insert:i),e.high_water>3,i=e.pending_buf_size-i>65535?65535:e.pending_buf_size-i,n=i>e.w_size?e.w_size:i,a=e.strstart-e.block_start,(a>=n||(a||t===oe)&&t!==ie&&0===e.strm.avail_in&&a<=i)&&(s=a>i?i:a,r=t===oe&&0===e.strm.avail_in&&s===a?1:0,ee(e,e.block_start,s,r),e.block_start+=s,Ue(e.strm)),r?3:1)},je=(e,t)=>{let s,a;for(;;){if(e.lookahead=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==s&&e.strstart-s<=e.w_size-Ie&&(e.match_length=Le(e,s)),e.match_length>=3)if(a=se(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Be(e,e.ins_h,e.window[e.strstart+1]);else a=se(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(a&&(Re(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2},Ze=(e,t)=>{let s,a,i;for(;;){if(e.lookahead=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==s&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,a=se(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,a&&(Re(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(a=se(e,0,e.window[e.strstart-1]),a&&Re(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(a=se(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2};function Ve(e,t,s,a,i){this.good_length=e,this.max_lazy=t,this.nice_length=s,this.max_chain=a,this.func=i}const Me=[new Ve(0,0,0,0,$e),new Ve(4,4,8,4,je),new Ve(4,5,16,8,je),new Ve(4,6,32,32,je),new Ve(4,4,16,16,Ze),new Ve(8,16,32,32,Ze),new Ve(8,16,128,128,Ze),new Ve(8,32,128,256,Ze),new Ve(32,128,258,1024,Ze),new Ve(32,258,258,4096,Ze)];function Ge(){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=ke,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),Ae(this.dyn_ltree),Ae(this.dyn_dtree),Ae(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),Ae(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Ae(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ke=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Ne&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Se&&t.status!==Te?1:0},Pe=e=>{if(Ke(e))return Ee(e,ue);e.total_in=e.total_out=0,e.data_type=ye;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Ne:Se,e.adler=2===t.wrap?0:1,t.last_flush=-2,Q(t),ce},Xe=e=>{const t=Pe(e);var s;return t===ce&&((s=e.state).window_size=2*s.w_size,Ae(s.head),s.max_lazy_match=Me[s.level].max_lazy,s.good_match=Me[s.level].good_length,s.nice_match=Me[s.level].nice_length,s.max_chain_length=Me[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=2,s.match_available=0,s.ins_h=0),t},He=(e,t,s,a,i,n)=>{if(!e)return ue;let r=1;if(t===pe&&(t=6),a<0?(r=0,a=-a):a>15&&(r=2,a-=16),i<1||i>9||s!==ke||a<8||a>15||t<0||t>9||n<0||n>be||8===a&&1!==r)return Ee(e,ue);8===a&&(a=9);const o=new Ge;return e.state=o,o.strm=e,o.status=Ne,o.wrap=r,o.gzhead=null,o.w_bits=a,o.w_size=1<He(e,t,ke,15,8,we),deflateInit2:He,deflateReset:Xe,deflateResetKeep:Pe,deflateSetHeader:(e,t)=>Ke(e)||2!==e.state.wrap?ue:(e.state.gzhead=t,ce),deflate:(e,t)=>{if(Ke(e)||t>le||t<0)return e?Ee(e,ue):ue;const s=e.state;if(!e.output||0!==e.avail_in&&!e.input||s.status===Te&&t!==oe)return Ee(e,0===e.avail_out?fe:ue);const a=s.last_flush;if(s.last_flush=t,0!==s.pending){if(Ue(e),0===e.avail_out)return s.last_flush=-1,ce}else if(0===e.avail_in&&xe(t)<=xe(a)&&t!==oe)return Ee(e,fe);if(s.status===Te&&0!==e.avail_in)return Ee(e,fe);if(s.status===Ne&&0===s.wrap&&(s.status=Se),s.status===Ne){let t=ke+(s.w_bits-8<<4)<<8,a=-1;if(a=s.strategy>=me||s.level<2?0:s.level<6?1:6===s.level?2:3,t|=a<<6,0!==s.strstart&&(t|=32),t+=31-t%31,De(s,t),0!==s.strstart&&(De(s,e.adler>>>16),De(s,65535&e.adler)),e.adler=1,s.status=Se,Ue(e),0!==s.pending)return s.last_flush=-1,ce}if(57===s.status)if(e.adler=0,ze(s,31),ze(s,139),ze(s,8),s.gzhead)ze(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),ze(s,255&s.gzhead.time),ze(s,s.gzhead.time>>8&255),ze(s,s.gzhead.time>>16&255),ze(s,s.gzhead.time>>24&255),ze(s,9===s.level?2:s.strategy>=me||s.level<2?4:0),ze(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(ze(s,255&s.gzhead.extra.length),ze(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(e.adler=W(e.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69;else if(ze(s,0),ze(s,0),ze(s,0),ze(s,0),ze(s,0),ze(s,9===s.level?2:s.strategy>=me||s.level<2?4:0),ze(s,3),s.status=Se,Ue(e),0!==s.pending)return s.last_flush=-1,ce;if(69===s.status){if(s.gzhead.extra){let t=s.pending,a=(65535&s.gzhead.extra.length)-s.gzindex;for(;s.pending+a>s.pending_buf_size;){let i=s.pending_buf_size-s.pending;if(s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex,s.gzindex+i),s.pending),s.pending=s.pending_buf_size,s.gzhead.hcrc&&s.pending>t&&(e.adler=W(e.adler,s.pending_buf,s.pending-t,t)),s.gzindex+=i,Ue(e),0!==s.pending)return s.last_flush=-1,ce;t=0,a-=i}let i=new Uint8Array(s.gzhead.extra);s.pending_buf.set(i.subarray(s.gzindex,s.gzindex+a),s.pending),s.pending+=a,s.gzhead.hcrc&&s.pending>t&&(e.adler=W(e.adler,s.pending_buf,s.pending-t,t)),s.gzindex=0}s.status=73}if(73===s.status){if(s.gzhead.name){let t,a=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>a&&(e.adler=W(e.adler,s.pending_buf,s.pending-a,a)),Ue(e),0!==s.pending)return s.last_flush=-1,ce;a=0}t=s.gzindexa&&(e.adler=W(e.adler,s.pending_buf,s.pending-a,a)),s.gzindex=0}s.status=91}if(91===s.status){if(s.gzhead.comment){let t,a=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>a&&(e.adler=W(e.adler,s.pending_buf,s.pending-a,a)),Ue(e),0!==s.pending)return s.last_flush=-1,ce;a=0}t=s.gzindexa&&(e.adler=W(e.adler,s.pending_buf,s.pending-a,a))}s.status=103}if(103===s.status){if(s.gzhead.hcrc){if(s.pending+2>s.pending_buf_size&&(Ue(e),0!==s.pending))return s.last_flush=-1,ce;ze(s,255&e.adler),ze(s,e.adler>>8&255),e.adler=0}if(s.status=Se,Ue(e),0!==s.pending)return s.last_flush=-1,ce}if(0!==e.avail_in||0!==s.lookahead||t!==ie&&s.status!==Te){let a=0===s.level?$e(s,t):s.strategy===me?((e,t)=>{let s;for(;;){if(0===e.lookahead&&(Ce(e),0===e.lookahead)){if(t===ie)return 1;break}if(e.match_length=0,s=se(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,s&&(Re(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2})(s,t):s.strategy===_e?((e,t)=>{let s,a,i,n;const r=e.window;for(;;){if(e.lookahead<=ve){if(Ce(e),e.lookahead<=ve&&t===ie)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,a=r[i],a===r[++i]&&a===r[++i]&&a===r[++i])){n=e.strstart+ve;do{}while(a===r[++i]&&a===r[++i]&&a===r[++i]&&a===r[++i]&&a===r[++i]&&a===r[++i]&&a===r[++i]&&a===r[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(s=se(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(s=se(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),s&&(Re(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2})(s,t):Me[s.level].func(s,t);if(3!==a&&4!==a||(s.status=Te),1===a||3===a)return 0===e.avail_out&&(s.last_flush=-1),ce;if(2===a&&(t===ne?ae(s):t!==le&&(ee(s,0,0,!1),t===re&&(Ae(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),Ue(e),0===e.avail_out))return s.last_flush=-1,ce}return t!==oe?ce:s.wrap<=0?he:(2===s.wrap?(ze(s,255&e.adler),ze(s,e.adler>>8&255),ze(s,e.adler>>16&255),ze(s,e.adler>>24&255),ze(s,255&e.total_in),ze(s,e.total_in>>8&255),ze(s,e.total_in>>16&255),ze(s,e.total_in>>24&255)):(De(s,e.adler>>>16),De(s,65535&e.adler)),Ue(e),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?ce:he)},deflateEnd:e=>{if(Ke(e))return ue;const t=e.state.status;return e.state=null,t===Se?Ee(e,de):ce},deflateSetDictionary:(e,t)=>{let s=t.length;if(Ke(e))return ue;const a=e.state,i=a.wrap;if(2===i||1===i&&a.status!==Ne||a.lookahead)return ue;if(1===i&&(e.adler=H(e.adler,t,s,0)),a.wrap=0,s>=a.w_size){0===i&&(Ae(a.head),a.strstart=0,a.block_start=0,a.insert=0);let e=new Uint8Array(a.w_size);e.set(t.subarray(s-a.w_size,s),0),t=e,s=a.w_size}const n=e.avail_in,r=e.next_in,o=e.input;for(e.avail_in=s,e.next_in=0,e.input=t,Ce(a);a.lookahead>=3;){let e=a.strstart,t=a.lookahead-2;do{a.ins_h=Be(a,a.ins_h,a.window[e+3-1]),a.prev[e&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=e,e++}while(--t);a.strstart=e,a.lookahead=2,Ce(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,e.next_in=r,e.input=o,e.avail_in=n,a.wrap=i,ce},deflateInfo:"pako deflate (from Nodeca project)"};const We=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ye={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const s=t.shift();if(s){if("object"!=typeof s)throw new TypeError(s+"must be non-object");for(const t in s)We(s,t)&&(e[t]=s[t])}}return e},flattenChunks:e=>{let t=0;for(let s=0,a=e.length;s=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Qe[254]=Qe[254]=1;var et={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,s,a,i,n,r=e.length,o=0;for(i=0;i>>6,t[n++]=128|63&s):s<65536?(t[n++]=224|s>>>12,t[n++]=128|s>>>6&63,t[n++]=128|63&s):(t[n++]=240|s>>>18,t[n++]=128|s>>>12&63,t[n++]=128|s>>>6&63,t[n++]=128|63&s);return t},buf2string:(e,t)=>{const s=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let a,i;const n=new Array(2*s);for(i=0,a=0;a4)n[i++]=65533,a+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&a1?n[i++]=65533:t<65536?n[i++]=t:(t-=65536,n[i++]=55296|t>>10&1023,n[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&qe)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let s="";for(let a=0;a{(t=t||e.length)>e.length&&(t=e.length);let s=t-1;for(;s>=0&&128==(192&e[s]);)s--;return s<0||0===s?t:s+Qe[e[s]]>t?s:t}};var tt=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 st=Object.prototype.toString,{Z_NO_FLUSH:at,Z_SYNC_FLUSH:it,Z_FULL_FLUSH:nt,Z_FINISH:rt,Z_OK:ot,Z_STREAM_END:lt,Z_DEFAULT_COMPRESSION:ct,Z_DEFAULT_STRATEGY:ht,Z_DEFLATED:ut}=q;function dt(e){this.options=Ye.assign({level:ct,method:ut,chunkSize:16384,windowBits:15,memLevel:8,strategy:ht},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new tt,this.strm.avail_out=0;let s=Je.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(s!==ot)throw new Error(Y[s]);if(t.header&&Je.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?et.string2buf(t.dictionary):"[object ArrayBuffer]"===st.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,s=Je.deflateSetDictionary(this.strm,e),s!==ot)throw new Error(Y[s]);this._dict_set=!0}}function ft(e,t){const s=new dt(t);if(s.push(e,!0),s.err)throw s.msg||Y[s.err];return s.result}dt.prototype.push=function(e,t){const s=this.strm,a=this.options.chunkSize;let i,n;if(this.ended)return!1;for(n=t===~~t?t:!0===t?rt:at,"string"==typeof e?s.input=et.string2buf(e):"[object ArrayBuffer]"===st.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;;)if(0===s.avail_out&&(s.output=new Uint8Array(a),s.next_out=0,s.avail_out=a),(n===it||n===nt)&&s.avail_out<=6)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else{if(i=Je.deflate(s,n),i===lt)return s.next_out>0&&this.onData(s.output.subarray(0,s.next_out)),i=Je.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ot;if(0!==s.avail_out){if(n>0&&s.next_out>0)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else if(0===s.avail_in)break}else this.onData(s.output)}return!0},dt.prototype.onData=function(e){this.chunks.push(e)},dt.prototype.onEnd=function(e){e===ot&&(this.result=Ye.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var pt={Deflate:dt,deflate:ft,deflateRaw:function(e,t){return(t=t||{}).raw=!0,ft(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,ft(e,t)},constants:q};const gt=16209;var mt=function(e,t){let s,a,i,n,r,o,l,c,h,u,d,f,p,g,m,_,b,w,y,k,v,I,N,S;const T=e.state;s=e.next_in,N=e.input,a=s+(e.avail_in-5),i=e.next_out,S=e.output,n=i-(t-e.avail_out),r=i+(e.avail_out-257),o=T.dmax,l=T.wsize,c=T.whave,h=T.wnext,u=T.window,d=T.hold,f=T.bits,p=T.lencode,g=T.distcode,m=(1<>>24,d>>>=w,f-=w,w=b>>>16&255,0===w)S[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=p[(65535&b)+(d&(1<>>=w,f-=w),f<15&&(d+=N[s++]<>>24,d>>>=w,f-=w,w=b>>>16&255,!(16&w)){if(0==(64&w)){b=g[(65535&b)+(d&(1<o){e.msg="invalid distance too far back",T.mode=gt;break e}if(d>>>=w,f-=w,w=i-n,k>w){if(w=k-w,w>c&&T.sane){e.msg="invalid distance too far back",T.mode=gt;break e}if(v=0,I=u,0===h){if(v+=l-w,w2;)S[i++]=I[v++],S[i++]=I[v++],S[i++]=I[v++],y-=3;y&&(S[i++]=I[v++],y>1&&(S[i++]=I[v++]))}else{v=i-k;do{S[i++]=S[v++],S[i++]=S[v++],S[i++]=S[v++],y-=3}while(y>2);y&&(S[i++]=S[v++],y>1&&(S[i++]=S[v++]))}break}}break}}while(s>3,s-=y,f-=y<<3,d&=(1<{const l=o.bits;let c,h,u,d,f,p,g=0,m=0,_=0,b=0,w=0,y=0,k=0,v=0,I=0,N=0,S=null;const T=new Uint16Array(16),E=new Uint16Array(16);let x,A,O,B=null;for(g=0;g<=_t;g++)T[g]=0;for(m=0;m=1&&0===T[b];b--);if(w>b&&(w=b),0===b)return i[n++]=20971520,i[n++]=20971520,o.bits=1,0;for(_=1;_0&&(0===e||1!==b))return-1;for(E[1]=0,g=1;g<_t;g++)E[g+1]=E[g]+T[g];for(m=0;m852||2===e&&I>592)return 1;for(;;){x=g-k,r[m]+1=p?(A=B[r[m]-p],O=S[r[m]-p]):(A=96,O=0),c=1<>k)+h]=x<<24|A<<16|O|0}while(0!==h);for(c=1<>=1;if(0!==c?(N&=c-1,N+=c):N=0,m++,0==--T[g]){if(g===b)break;g=t[s+r[m]]}if(g>w&&(N&d)!==u){for(0===k&&(k=w),f+=_,y=g-k,v=1<852||2===e&&I>592)return 1;u=N&d,i[u]=w<<24|y<<16|f-n|0}}return 0!==N&&(i[f+N]=g-k<<24|64<<16|0),o.bits=w,0};const{Z_FINISH:It,Z_BLOCK:Nt,Z_TREES:St,Z_OK:Tt,Z_STREAM_END:Et,Z_NEED_DICT:xt,Z_STREAM_ERROR:At,Z_DATA_ERROR:Ot,Z_MEM_ERROR:Bt,Z_BUF_ERROR:Ut,Z_DEFLATED:Rt}=q,zt=16180,Dt=16190,Ft=16191,Lt=16192,Ct=16194,$t=16199,jt=16200,Zt=16206,Vt=16209,Mt=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Gt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Kt=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},Pt=e=>{if(Kt(e))return At;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=zt,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Tt},Xt=e=>{if(Kt(e))return At;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Pt(e)},Ht=(e,t)=>{let s;if(Kt(e))return At;const a=e.state;return t<0?(s=0,t=-t):(s=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?At:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=s,a.wbits=t,Xt(e))},Jt=(e,t)=>{if(!e)return At;const s=new Gt;e.state=s,s.strm=e,s.window=null,s.mode=zt;const a=Ht(e,t);return a!==Tt&&(e.state=null),a};let Wt,Yt,qt=!0;const Qt=e=>{if(qt){Wt=new Int32Array(512),Yt=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(vt(1,e.lens,0,288,Wt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;vt(2,e.lens,0,32,Yt,0,e.work,{bits:5}),qt=!1}e.lencode=Wt,e.lenbits=9,e.distcode=Yt,e.distbits=5},es=(e,t,s,a)=>{let i;const n=e.state;return null===n.window&&(n.wsize=1<=n.wsize?(n.window.set(t.subarray(s-n.wsize,s),0),n.wnext=0,n.whave=n.wsize):(i=n.wsize-n.wnext,i>a&&(i=a),n.window.set(t.subarray(s-a,s-a+i),n.wnext),(a-=i)?(n.window.set(t.subarray(s-a,s),0),n.wnext=a,n.whave=n.wsize):(n.wnext+=i,n.wnext===n.wsize&&(n.wnext=0),n.whaveJt(e,15),inflateInit2:Jt,inflate:(e,t)=>{let s,a,i,n,r,o,l,c,h,u,d,f,p,g,m,_,b,w,y,k,v,I,N=0;const S=new Uint8Array(4);let T,E;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Kt(e)||!e.output||!e.input&&0!==e.avail_in)return At;s=e.state,s.mode===Ft&&(s.mode=Lt),r=e.next_out,i=e.output,l=e.avail_out,n=e.next_in,a=e.input,o=e.avail_in,c=s.hold,h=s.bits,u=o,d=l,I=Tt;e:for(;;)switch(s.mode){case zt:if(0===s.wrap){s.mode=Lt;break}for(;h<16;){if(0===o)break e;o--,c+=a[n++]<>>8&255,s.check=W(s.check,S,2,0),c=0,h=0,s.mode=16181;break}if(s.head&&(s.head.done=!1),!(1&s.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",s.mode=Vt;break}if((15&c)!==Rt){e.msg="unknown compression method",s.mode=Vt;break}if(c>>>=4,h-=4,v=8+(15&c),0===s.wbits&&(s.wbits=v),v>15||v>s.wbits){e.msg="invalid window size",s.mode=Vt;break}s.dmax=1<>8&1),512&s.flags&&4&s.wrap&&(S[0]=255&c,S[1]=c>>>8&255,s.check=W(s.check,S,2,0)),c=0,h=0,s.mode=16182;case 16182:for(;h<32;){if(0===o)break e;o--,c+=a[n++]<>>8&255,S[2]=c>>>16&255,S[3]=c>>>24&255,s.check=W(s.check,S,4,0)),c=0,h=0,s.mode=16183;case 16183:for(;h<16;){if(0===o)break e;o--,c+=a[n++]<>8),512&s.flags&&4&s.wrap&&(S[0]=255&c,S[1]=c>>>8&255,s.check=W(s.check,S,2,0)),c=0,h=0,s.mode=16184;case 16184:if(1024&s.flags){for(;h<16;){if(0===o)break e;o--,c+=a[n++]<>>8&255,s.check=W(s.check,S,2,0)),c=0,h=0}else s.head&&(s.head.extra=null);s.mode=16185;case 16185:if(1024&s.flags&&(f=s.length,f>o&&(f=o),f&&(s.head&&(v=s.head.extra_len-s.length,s.head.extra||(s.head.extra=new Uint8Array(s.head.extra_len)),s.head.extra.set(a.subarray(n,n+f),v)),512&s.flags&&4&s.wrap&&(s.check=W(s.check,a,f,n)),o-=f,n+=f,s.length-=f),s.length))break e;s.length=0,s.mode=16186;case 16186:if(2048&s.flags){if(0===o)break e;f=0;do{v=a[n+f++],s.head&&v&&s.length<65536&&(s.head.name+=String.fromCharCode(v))}while(v&&f>9&1,s.head.done=!0),e.adler=s.check=0,s.mode=Ft;break;case 16189:for(;h<32;){if(0===o)break e;o--,c+=a[n++]<>>=7&h,h-=7&h,s.mode=Zt;break}for(;h<3;){if(0===o)break e;o--,c+=a[n++]<>>=1,h-=1,3&c){case 0:s.mode=16193;break;case 1:if(Qt(s),s.mode=$t,t===St){c>>>=2,h-=2;break e}break;case 2:s.mode=16196;break;case 3:e.msg="invalid block type",s.mode=Vt}c>>>=2,h-=2;break;case 16193:for(c>>>=7&h,h-=7&h;h<32;){if(0===o)break e;o--,c+=a[n++]<>>16^65535)){e.msg="invalid stored block lengths",s.mode=Vt;break}if(s.length=65535&c,c=0,h=0,s.mode=Ct,t===St)break e;case Ct:s.mode=16195;case 16195:if(f=s.length,f){if(f>o&&(f=o),f>l&&(f=l),0===f)break e;i.set(a.subarray(n,n+f),r),o-=f,n+=f,l-=f,r+=f,s.length-=f;break}s.mode=Ft;break;case 16196:for(;h<14;){if(0===o)break e;o--,c+=a[n++]<>>=5,h-=5,s.ndist=1+(31&c),c>>>=5,h-=5,s.ncode=4+(15&c),c>>>=4,h-=4,s.nlen>286||s.ndist>30){e.msg="too many length or distance symbols",s.mode=Vt;break}s.have=0,s.mode=16197;case 16197:for(;s.have>>=3,h-=3}for(;s.have<19;)s.lens[x[s.have++]]=0;if(s.lencode=s.lendyn,s.lenbits=7,T={bits:s.lenbits},I=vt(0,s.lens,0,19,s.lencode,0,s.work,T),s.lenbits=T.bits,I){e.msg="invalid code lengths set",s.mode=Vt;break}s.have=0,s.mode=16198;case 16198:for(;s.have>>24,_=N>>>16&255,b=65535&N,!(m<=h);){if(0===o)break e;o--,c+=a[n++]<>>=m,h-=m,s.lens[s.have++]=b;else{if(16===b){for(E=m+2;h>>=m,h-=m,0===s.have){e.msg="invalid bit length repeat",s.mode=Vt;break}v=s.lens[s.have-1],f=3+(3&c),c>>>=2,h-=2}else if(17===b){for(E=m+3;h>>=m,h-=m,v=0,f=3+(7&c),c>>>=3,h-=3}else{for(E=m+7;h>>=m,h-=m,v=0,f=11+(127&c),c>>>=7,h-=7}if(s.have+f>s.nlen+s.ndist){e.msg="invalid bit length repeat",s.mode=Vt;break}for(;f--;)s.lens[s.have++]=v}}if(s.mode===Vt)break;if(0===s.lens[256]){e.msg="invalid code -- missing end-of-block",s.mode=Vt;break}if(s.lenbits=9,T={bits:s.lenbits},I=vt(1,s.lens,0,s.nlen,s.lencode,0,s.work,T),s.lenbits=T.bits,I){e.msg="invalid literal/lengths set",s.mode=Vt;break}if(s.distbits=6,s.distcode=s.distdyn,T={bits:s.distbits},I=vt(2,s.lens,s.nlen,s.ndist,s.distcode,0,s.work,T),s.distbits=T.bits,I){e.msg="invalid distances set",s.mode=Vt;break}if(s.mode=$t,t===St)break e;case $t:s.mode=jt;case jt:if(o>=6&&l>=258){e.next_out=r,e.avail_out=l,e.next_in=n,e.avail_in=o,s.hold=c,s.bits=h,mt(e,d),r=e.next_out,i=e.output,l=e.avail_out,n=e.next_in,a=e.input,o=e.avail_in,c=s.hold,h=s.bits,s.mode===Ft&&(s.back=-1);break}for(s.back=0;N=s.lencode[c&(1<>>24,_=N>>>16&255,b=65535&N,!(m<=h);){if(0===o)break e;o--,c+=a[n++]<>w)],m=N>>>24,_=N>>>16&255,b=65535&N,!(w+m<=h);){if(0===o)break e;o--,c+=a[n++]<>>=w,h-=w,s.back+=w}if(c>>>=m,h-=m,s.back+=m,s.length=b,0===_){s.mode=16205;break}if(32&_){s.back=-1,s.mode=Ft;break}if(64&_){e.msg="invalid literal/length code",s.mode=Vt;break}s.extra=15&_,s.mode=16201;case 16201:if(s.extra){for(E=s.extra;h>>=s.extra,h-=s.extra,s.back+=s.extra}s.was=s.length,s.mode=16202;case 16202:for(;N=s.distcode[c&(1<>>24,_=N>>>16&255,b=65535&N,!(m<=h);){if(0===o)break e;o--,c+=a[n++]<>w)],m=N>>>24,_=N>>>16&255,b=65535&N,!(w+m<=h);){if(0===o)break e;o--,c+=a[n++]<>>=w,h-=w,s.back+=w}if(c>>>=m,h-=m,s.back+=m,64&_){e.msg="invalid distance code",s.mode=Vt;break}s.offset=b,s.extra=15&_,s.mode=16203;case 16203:if(s.extra){for(E=s.extra;h>>=s.extra,h-=s.extra,s.back+=s.extra}if(s.offset>s.dmax){e.msg="invalid distance too far back",s.mode=Vt;break}s.mode=16204;case 16204:if(0===l)break e;if(f=d-l,s.offset>f){if(f=s.offset-f,f>s.whave&&s.sane){e.msg="invalid distance too far back",s.mode=Vt;break}f>s.wnext?(f-=s.wnext,p=s.wsize-f):p=s.wnext-f,f>s.length&&(f=s.length),g=s.window}else g=i,p=r-s.offset,f=s.length;f>l&&(f=l),l-=f,s.length-=f;do{i[r++]=g[p++]}while(--f);0===s.length&&(s.mode=jt);break;case 16205:if(0===l)break e;i[r++]=s.length,l--,s.mode=jt;break;case Zt:if(s.wrap){for(;h<32;){if(0===o)break e;o--,c|=a[n++]<{if(Kt(e))return At;let t=e.state;return t.window&&(t.window=null),e.state=null,Tt},inflateGetHeader:(e,t)=>{if(Kt(e))return At;const s=e.state;return 0==(2&s.wrap)?At:(s.head=t,t.done=!1,Tt)},inflateSetDictionary:(e,t)=>{const s=t.length;let a,i,n;return Kt(e)?At:(a=e.state,0!==a.wrap&&a.mode!==Dt?At:a.mode===Dt&&(i=1,i=H(i,t,s,0),i!==a.check)?Ot:(n=es(e,t,s,s),n?(a.mode=16210,Bt):(a.havedict=1,Tt)))},inflateInfo:"pako inflate (from Nodeca project)"};var ss=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 as=Object.prototype.toString,{Z_NO_FLUSH:is,Z_FINISH:ns,Z_OK:rs,Z_STREAM_END:os,Z_NEED_DICT:ls,Z_STREAM_ERROR:cs,Z_DATA_ERROR:hs,Z_MEM_ERROR:us}=q;function ds(e){this.options=Ye.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new tt,this.strm.avail_out=0;let s=ts.inflateInit2(this.strm,t.windowBits);if(s!==rs)throw new Error(Y[s]);if(this.header=new ss,ts.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=et.string2buf(t.dictionary):"[object ArrayBuffer]"===as.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(s=ts.inflateSetDictionary(this.strm,t.dictionary),s!==rs)))throw new Error(Y[s])}function fs(e,t){const s=new ds(t);if(s.push(e),s.err)throw s.msg||Y[s.err];return s.result}ds.prototype.push=function(e,t){const s=this.strm,a=this.options.chunkSize,i=this.options.dictionary;let n,r,o;if(this.ended)return!1;for(r=t===~~t?t:!0===t?ns:is,"[object ArrayBuffer]"===as.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;;){for(0===s.avail_out&&(s.output=new Uint8Array(a),s.next_out=0,s.avail_out=a),n=ts.inflate(s,r),n===ls&&i&&(n=ts.inflateSetDictionary(s,i),n===rs?n=ts.inflate(s,r):n===hs&&(n=ls));s.avail_in>0&&n===os&&s.state.wrap>0&&0!==e[s.next_in];)ts.inflateReset(s),n=ts.inflate(s,r);switch(n){case cs:case hs:case ls:case us:return this.onEnd(n),this.ended=!0,!1}if(o=s.avail_out,s.next_out&&(0===s.avail_out||n===os))if("string"===this.options.to){let e=et.utf8border(s.output,s.next_out),t=s.next_out-e,i=et.buf2string(s.output,e);s.next_out=t,s.avail_out=a-t,t&&s.output.set(s.output.subarray(e,e+t),0),this.onData(i)}else this.onData(s.output.length===s.next_out?s.output:s.output.subarray(0,s.next_out));if(n!==rs||0!==o){if(n===os)return n=ts.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===s.avail_in)break}}return!0},ds.prototype.onData=function(e){this.chunks.push(e)},ds.prototype.onEnd=function(e){e===rs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ye.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ps={Inflate:ds,inflate:fs,inflateRaw:function(e,t){return(t=t||{}).raw=!0,fs(e,t)},ungzip:fs,constants:q};const{Deflate:gs,deflate:ms,deflateRaw:_s,gzip:bs}=pt,{Inflate:ws,inflate:ys,inflateRaw:ks,ungzip:vs}=ps;var Is={Deflate:gs,deflate:ms,deflateRaw:_s,gzip:bs,Inflate:ws,inflate:ys,inflateRaw:ks,ungzip:vs,constants:q};function Ns(e){let t=typeof e;if("object"==t){if(Array.isArray(e))return"array";if(null===e)return"null"}return t}let Ss="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ts=[];for(let e=0;e>4,0==(128&s))return this.assertBounds(),[e,t];for(let s=3;s<=31;s+=7){let a=this.buf[this.pos++];if(t|=(127&a)<>>a,n=!(i>>>7==0&&0==t),r=255&(n?128|i:i);if(s.push(r),!n)return}const a=e>>>28&15|(7&t)<<4,i=!(t>>3==0);if(s.push(255&(i?128|a:a)),i){for(let e=3;e<31;e+=7){const a=t>>>e,i=!(a>>>7==0),n=255&(i?128|a:a);if(s.push(n),!i)return}s.push(t>>>31&1)}}Ts["-".charCodeAt(0)]=Ss.indexOf("+"),Ts["_".charCodeAt(0)]=Ss.indexOf("/"),function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(s,a,i,n,r)=>{(t(a)?a[e.symbol]:a[e.symbol]=[]).push({no:i,wireType:n,data:r})},e.onWrite=(t,s,a)=>{for(let{no:t,wireType:i,data:n}of e.list(s))a.tag(t,i).raw(n)},e.list=(s,a)=>{if(t(s)){let t=s[e.symbol];return a?t.filter((e=>e.no==a)):t}return[]},e.last=(t,s)=>e.list(t,s).slice(-1)[0];const t=t=>t&&Array.isArray(t[e.symbol])}(Es||(Es={})),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"}(xs||(xs={}));const Bs=4294967296;function Us(e){let t="-"==e[0];t&&(e=e.slice(1));const s=1e6;let a=0,i=0;function n(t,n){const r=Number(e.slice(t,n));i*=s,a=a*s+r,a>=Bs&&(i+=a/Bs|0,a%=Bs)}return n(-24,-18),n(-18,-12),n(-12,-6),n(-6),[t,a,i]}function Rs(e,t){if(t>>>0<=2097151)return""+(Bs*t+(e>>>0));let s=(e>>>24|t<<8)>>>0&16777215,a=t>>16&65535,i=(16777215&e)+6777216*s+6710656*a,n=s+8147497*a,r=2*a,o=1e7;function l(e,t){let s=e?String(e):"";return t?"0000000".slice(s.length)+s:s}return i>=o&&(n+=Math.floor(i/o),i%=o),n>=o&&(r+=Math.floor(n/o),n%=o),l(r,0)+l(n,r)+l(i,1)}function zs(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let s=0;s<9;s++)t.push(127&e|128),e>>=7;t.push(1)}}function Ds(){let e=this.buf[this.pos++],t=127&e;if(0==(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,0==(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,0==(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,0==(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let t=5;0!=(128&e)&&t<10;t++)e=this.buf[this.pos++];if(0!=(128&e))throw new Error("invalid varint");return this.assertBounds(),t>>>0}let Fs;function Ls(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}!function(){const e=new DataView(new ArrayBuffer(8)),t=void 0!==globalThis.BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64;Fs=t?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}();const Cs=/^-?[0-9]+$/,$s=4294967296,js=2147483648;class Zs{constructor(e,t){this.lo=0|e,this.hi=0|t}isZero(){return 0==this.lo&&0==this.hi}toNumber(){let e=this.hi*$s+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}}class Vs extends Zs{static from(e){if(Fs)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=Fs.C(e);case"number":if(0===e)return this.ZERO;e=Fs.C(e);case"bigint":if(!e)return this.ZERO;if(eFs.UMAX)throw new Error("ulong too large");return Fs.V.setBigUint64(0,e,!0),new Vs(Fs.V.getInt32(0,!0),Fs.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!Cs.test(e))throw new Error("string is no integer");let[t,s,a]=Us(e);if(t)throw new Error("signed value for ulong");return new Vs(s,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 Vs(e,e/$s)}throw new Error("unknown value "+typeof e)}toString(){return Fs?this.toBigInt().toString():Rs(this.lo,this.hi)}toBigInt(){return Ls(Fs),Fs.V.setInt32(0,this.lo,!0),Fs.V.setInt32(4,this.hi,!0),Fs.V.getBigUint64(0,!0)}}Vs.ZERO=new Vs(0,0);class Ms extends Zs{static from(e){if(Fs)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=Fs.C(e);case"number":if(0===e)return this.ZERO;e=Fs.C(e);case"bigint":if(!e)return this.ZERO;if(eFs.MAX)throw new Error("signed long too large");return Fs.V.setBigInt64(0,e,!0),new Ms(Fs.V.getInt32(0,!0),Fs.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!Cs.test(e))throw new Error("string is no integer");let[t,s,a]=Us(e);if(t){if(a>js||a==js&&0!=s)throw new Error("signed long too small")}else if(a>=js)throw new Error("signed long too large");let i=new Ms(s,a);return t?i.negate():i;case"number":if(0==e)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new Ms(e,e/$s):new Ms(-e,-e/$s).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return 0!=(this.hi&js)}negate(){let e=~this.hi,t=this.lo;return t?t=1+~t:e+=1,new Ms(t,e)}toString(){if(Fs)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+Rs(e.lo,e.hi)}return Rs(this.lo,this.hi)}toBigInt(){return Ls(Fs),Fs.V.setInt32(0,this.lo,!0),Fs.V.setInt32(4,this.hi,!0),Fs.V.getBigInt64(0,!0)}}Ms.ZERO=new Ms(0,0);const Gs={readUnknownField:!0,readerFactory:e=>new Ks(e)};class Ks{constructor(e,t){this.varint64=As,this.uint32=Ds,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=null!=t?t:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,s=7&e;if(t<=0||s<0||s>5)throw new Error("illegal tag: field no "+t+" wire type "+s);return[t,s]}skip(e){let t=this.pos;switch(e){case xs.Varint:for(;128&this.buf[this.pos++];);break;case xs.Bit64:this.pos+=4;case xs.Bit32:this.pos+=4;break;case xs.LengthDelimited:let t=this.uint32();this.pos+=t;break;case xs.StartGroup:let s;for(;(s=this.tag()[1])!==xs.EndGroup;)this.skip(s);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(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return new Ms(...this.varint64())}uint64(){return new Vs(...this.varint64())}sint64(){let[e,t]=this.varint64(),s=-(1&e);return e=(e>>>1|(1&t)<<31)^s,t=t>>>1^s,new Ms(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new Vs(this.sfixed32(),this.sfixed32())}sfixed64(){return new Ms(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function Ps(e,t){if(!e)throw new Error(t)}function Xs(e){if("number"!=typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int 32: "+e)}function Hs(e){if("number"!=typeof e)throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint 32: "+e)}function Js(e){if("number"!=typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw new Error("invalid float 32: "+e)}const Ws={writeUnknownFields:!0,writerFactory:()=>new Ys};class Ys{constructor(e){this.stack=[],this.textEncoder=null!=e?e:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let t=0;t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Hs(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return Xs(e),zs(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Js(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Hs(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){Xs(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return Xs(e),zs(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),s=new DataView(t.buffer),a=Ms.from(e);return s.setInt32(0,a.lo,!0),s.setInt32(4,a.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),s=new DataView(t.buffer),a=Vs.from(e);return s.setInt32(0,a.lo,!0),s.setInt32(4,a.hi,!0),this.raw(t)}int64(e){let t=Ms.from(e);return Os(t.lo,t.hi,this.buf),this}sint64(e){let t=Ms.from(e),s=t.hi>>31;return Os(t.lo<<1^s,(t.hi<<1|t.lo>>>31)^s,this.buf),this}uint64(e){let t=Vs.from(e);return Os(t.lo,t.hi,this.buf),this}}const qs={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},Qs={ignoreUnknownFields:!1};const ea=Symbol.for("protobuf-ts/message-type");function ta(e){let t=!1;const s=[];for(let a=0;a!a.includes(e))))return!1;if(!s&&a.some((e=>!i.known.includes(e))))return!1;if(t<1)return!0;for(const a of i.oneofs){const i=e[a];if(!ra(i))return!1;if(void 0===i.oneofKind)continue;const n=this.fields.find((e=>e.localName===i.oneofKind));if(!n)return!1;if(!this.field(i[i.oneofKind],n,s,t))return!1}for(const a of this.fields)if(void 0===a.oneof&&!this.field(e[a.localName],a,s,t))return!1;return!0}field(e,t,s,a){let i=t.repeat;switch(t.kind){case"scalar":return void 0===e?t.opt:i?this.scalars(e,t.T,a,t.L):this.scalar(e,t.T,t.L);case"enum":return void 0===e?t.opt:i?this.scalars(e,sa.INT32,a):this.scalar(e,sa.INT32);case"message":return void 0===e||(i?this.messages(e,t.T(),s,a):this.message(e,t.T(),s,a));case"map":if("object"!=typeof e||null===e)return!1;if(a<2)return!0;if(!this.mapKeys(e,t.K,a))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,a,t.V.L);case"enum":return this.scalars(Object.values(e),sa.INT32,a);case"message":return this.messages(Object.values(e),t.V.T(),s,a)}}return!0}message(e,t,s,a){return s?t.isAssignable(e,a):t.is(e,a)}messages(e,t,s,a){if(!Array.isArray(e))return!1;if(a<2)return!0;if(s){for(let s=0;sparseInt(e))),t,s);case sa.BOOL:return this.scalars(a.slice(0,s).map((e=>"true"==e||"false"!=e&&e)),t,s);default:return this.scalars(a,t,s,aa.STRING)}}}function la(e,t){switch(t){case aa.BIGINT:return e.toBigInt();case aa.NUMBER:return e.toNumber();default:return e.toString()}}class ca{constructor(e){this.info=e}prepare(){var e;if(void 0===this.fMap){this.fMap={};const t=null!==(e=this.info.fields)&&void 0!==e?e:[];for(const e of t)this.fMap[e.name]=e,this.fMap[e.jsonName]=e,this.fMap[e.localName]=e}}assert(e,t,s){if(!e){let e=Ns(s);throw"number"!=e&&"boolean"!=e||(e=s.toString()),new Error(`Cannot parse JSON ${e} for ${this.info.typeName}#${t}`)}}read(e,t,s){this.prepare();const a=[];for(const[n,r]of Object.entries(e)){const e=this.fMap[n];if(!e){if(!s.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${n}`);continue}const o=e.localName;let l;if(e.oneof){if(null===r&&("enum"!==e.kind||"google.protobuf.NullValue"!==e.T()[0]))continue;if(a.includes(e.oneof))throw new Error(`Multiple members of the oneof group "${e.oneof}" of ${this.info.typeName} are present in JSON.`);a.push(e.oneof),l=t[e.oneof]={oneofKind:o}}else l=t;if("map"==e.kind){if(null===r)continue;this.assert(null!==(i=r)&&"object"==typeof i&&!Array.isArray(i),e.name,r);const t=l[o];for(const[a,i]of Object.entries(r)){let n;switch(this.assert(null!==i,e.name+" map value",null),e.V.kind){case"message":n=e.V.T().internalJsonRead(i,s);break;case"enum":if(n=this.enum(e.V.T(),i,e.name,s.ignoreUnknownFields),!1===n)continue;break;case"scalar":n=this.scalar(i,e.V.T,e.V.L,e.name)}this.assert(void 0!==n,e.name+" map value",i);let r=a;e.K==sa.BOOL&&(r="true"==r||"false"!=r&&r),r=this.scalar(r,e.K,aa.STRING,e.name).toString(),t[r]=n}}else if(e.repeat){if(null===r)continue;this.assert(Array.isArray(r),e.name,r);const t=l[o];for(const a of r){let i;switch(this.assert(null!==a,e.name,null),e.kind){case"message":i=e.T().internalJsonRead(a,s);break;case"enum":if(i=this.enum(e.T(),a,e.name,s.ignoreUnknownFields),!1===i)continue;break;case"scalar":i=this.scalar(a,e.T,e.L,e.name)}this.assert(void 0!==i,e.name,r),t.push(i)}}else switch(e.kind){case"message":if(null===r&&"google.protobuf.Value"!=e.T().typeName){this.assert(void 0===e.oneof,e.name+" (oneof member)",null);continue}l[o]=e.T().internalJsonRead(r,s,l[o]);break;case"enum":let t=this.enum(e.T(),r,e.name,s.ignoreUnknownFields);if(!1===t)continue;l[o]=t;break;case"scalar":l[o]=this.scalar(r,e.T,e.L,e.name)}}var i}enum(e,t,s,a){if("google.protobuf.NullValue"==e[0]&&Ps(null===t||"NULL_VALUE"===t,`Unable to parse field ${this.info.typeName}#${s}, enum ${e[0]} only accepts null.`),null===t)return 0;switch(typeof t){case"number":return Ps(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${s}, enum can only be integral number, got ${t}.`),t;case"string":let i=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(i=t.substring(e[2].length));let n=e[1][i];return(void 0!==n||!a)&&(Ps("number"==typeof n,`Unable to parse field ${this.info.typeName}#${s}, enum ${e[0]} has no value for "${t}".`),n)}Ps(!1,`Unable to parse field ${this.info.typeName}#${s}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,s,a){let i;try{switch(t){case sa.DOUBLE:case sa.FLOAT:if(null===e)return 0;if("NaN"===e)return Number.NaN;if("Infinity"===e)return Number.POSITIVE_INFINITY;if("-Infinity"===e)return Number.NEGATIVE_INFINITY;if(""===e){i="empty string";break}if("string"==typeof e&&e.trim().length!==e.length){i="extra whitespace";break}if("string"!=typeof e&&"number"!=typeof e)break;let a=Number(e);if(Number.isNaN(a)){i="not a number";break}if(!Number.isFinite(a)){i="too large or small";break}return t==sa.FLOAT&&Js(a),a;case sa.INT32:case sa.FIXED32:case sa.SFIXED32:case sa.SINT32:case sa.UINT32:if(null===e)return 0;let n;if("number"==typeof e?n=e:""===e?i="empty string":"string"==typeof e&&(e.trim().length!==e.length?i="extra whitespace":n=Number(e)),void 0===n)break;return t==sa.UINT32?Hs(n):Xs(n),n;case sa.INT64:case sa.SFIXED64:case sa.SINT64:if(null===e)return la(Ms.ZERO,s);if("number"!=typeof e&&"string"!=typeof e)break;return la(Ms.from(e),s);case sa.FIXED64:case sa.UINT64:if(null===e)return la(Vs.ZERO,s);if("number"!=typeof e&&"string"!=typeof e)break;return la(Vs.from(e),s);case sa.BOOL:if(null===e)return!1;if("boolean"!=typeof e)break;return e;case sa.STRING:if(null===e)return"";if("string"!=typeof e){i="extra whitespace";break}try{encodeURIComponent(e)}catch(i){i="invalid UTF8";break}return e;case sa.BYTES:if(null===e||""===e)return new Uint8Array(0);if("string"!=typeof e)break;return function(e){let t=3*e.length/4;"="==e[e.length-2]?t-=2:"="==e[e.length-1]&&(t-=1);let s,a=new Uint8Array(t),i=0,n=0,r=0;for(let t=0;t>4,r=s,n=2;break;case 2:a[i++]=(15&r)<<4|(60&s)>>2,r=s,n=3;break;case 3:a[i++]=(3&r)<<6|s,n=0}}if(1==n)throw Error("invalid base64 string.");return a.subarray(0,i)}(e)}}catch(e){i=e.message}this.assert(!1,a+(i?" - "+i:""),e)}}class ha{constructor(e){var t;this.fields=null!==(t=e.fields)&&void 0!==t?t:[]}write(e,t){const s={},a=e;for(const e of this.fields){if(!e.oneof){let i=this.field(e,a[e.localName],t);void 0!==i&&(s[t.useProtoFieldName?e.name:e.jsonName]=i);continue}const i=a[e.oneof];if(i.oneofKind!==e.localName)continue;const n="scalar"==e.kind||"enum"==e.kind?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t;let r=this.field(e,i[e.localName],n);Ps(void 0!==r),s[t.useProtoFieldName?e.name:e.jsonName]=r}return s}field(e,t,s){let a;if("map"==e.kind){Ps("object"==typeof t&&null!==t);const i={};switch(e.V.kind){case"scalar":for(const[s,a]of Object.entries(t)){const t=this.scalar(e.V.T,a,e.name,!1,!0);Ps(void 0!==t),i[s.toString()]=t}break;case"message":const a=e.V.T();for(const[n,r]of Object.entries(t)){const t=this.message(a,r,e.name,s);Ps(void 0!==t),i[n.toString()]=t}break;case"enum":const n=e.V.T();for(const[a,r]of Object.entries(t)){Ps(void 0===r||"number"==typeof r);const t=this.enum(n,r,e.name,!1,!0,s.enumAsInteger);Ps(void 0!==t),i[a.toString()]=t}}(s.emitDefaultValues||Object.keys(i).length>0)&&(a=i)}else if(e.repeat){Ps(Array.isArray(t));const i=[];switch(e.kind){case"scalar":for(let s=0;s0||s.emitDefaultValues)&&(a=i)}else switch(e.kind){case"scalar":a=this.scalar(e.T,t,e.name,e.opt,s.emitDefaultValues);break;case"enum":a=this.enum(e.T(),t,e.name,e.opt,s.emitDefaultValues,s.enumAsInteger);break;case"message":a=this.message(e.T(),t,e.name,s)}return a}enum(e,t,s,a,i,n){if("google.protobuf.NullValue"==e[0])return i||a?null:void 0;if(void 0!==t){if(0!==t||i||a)return Ps("number"==typeof t),Ps(Number.isInteger(t)),n||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}else Ps(a)}message(e,t,s,a){return void 0===t?a.emitDefaultValues?null:void 0:e.internalJsonWrite(t,a)}scalar(e,t,s,a,i){if(void 0===t)return void Ps(a);const n=i||a;switch(e){case sa.INT32:case sa.SFIXED32:case sa.SINT32:return 0===t?n?0:void 0:(Xs(t),t);case sa.FIXED32:case sa.UINT32:return 0===t?n?0:void 0:(Hs(t),t);case sa.FLOAT:Js(t);case sa.DOUBLE:return 0===t?n?0:void 0:(Ps("number"==typeof t),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case sa.STRING:return""===t?n?"":void 0:(Ps("string"==typeof t),t);case sa.BOOL:return!1===t?!n&&void 0:(Ps("boolean"==typeof t),t);case sa.UINT64:case sa.FIXED64:Ps("number"==typeof t||"string"==typeof t||"bigint"==typeof t);let e=Vs.from(t);if(e.isZero()&&!n)return;return e.toString();case sa.INT64:case sa.SFIXED64:case sa.SINT64:Ps("number"==typeof t||"string"==typeof t||"bigint"==typeof t);let s=Ms.from(t);if(s.isZero()&&!n)return;return s.toString();case sa.BYTES:return Ps(t instanceof Uint8Array),t.byteLength?function(e){let t,s="",a=0,i=0;for(let n=0;n>2],i=(3&t)<<4,a=1;break;case 1:s+=Ss[i|t>>4],i=(15&t)<<2,a=2;break;case 2:s+=Ss[i|t>>6],s+=Ss[63&t],a=0}return a&&(s+=Ss[i],s+="=",1==a&&(s+="=")),s}(t):n?"":void 0}}}function ua(e,t=aa.STRING){switch(e){case sa.BOOL:return!1;case sa.UINT64:case sa.FIXED64:return la(Vs.ZERO,t);case sa.INT64:case sa.SFIXED64:case sa.SINT64:return la(Ms.ZERO,t);case sa.DOUBLE:case sa.FLOAT:return 0;case sa.BYTES:return new Uint8Array(0);case sa.STRING:return"";default:return 0}}class da{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){const t=null!==(e=this.info.fields)&&void 0!==e?e:[];this.fieldNoToField=new Map(t.map((e=>[e.no,e])))}}read(e,t,s,a){this.prepare();const i=void 0===a?e.len:e.pos+a;for(;e.pose.no-t.no))}}write(e,t,s){this.prepare();for(const a of this.fields){let i,n,r=a.repeat,o=a.localName;if(a.oneof){const t=e[a.oneof];if(t.oneofKind!==o)continue;i=t[o],n=!0}else i=e[o],n=!1;switch(a.kind){case"scalar":case"enum":let e="enum"==a.kind?sa.INT32:a.T;if(r)if(Ps(Array.isArray(i)),r==ia.PACKED)this.packed(t,e,a.no,i);else for(const s of i)this.scalar(t,e,a.no,s,!0);else void 0===i?Ps(a.opt):this.scalar(t,e,a.no,i,n||a.opt);break;case"message":if(r){Ps(Array.isArray(i));for(const e of i)this.message(t,s,a.T(),a.no,e)}else this.message(t,s,a.T(),a.no,i);break;case"map":Ps("object"==typeof i&&null!==i);for(const[e,n]of Object.entries(i))this.mapEntry(t,s,a,e,n)}}let a=s.writeUnknownFields;!1!==a&&(!0===a?Es.onWrite:a)(this.info.typeName,e,t)}mapEntry(e,t,s,a,i){e.tag(s.no,xs.LengthDelimited),e.fork();let n=a;switch(s.K){case sa.INT32:case sa.FIXED32:case sa.UINT32:case sa.SFIXED32:case sa.SINT32:n=Number.parseInt(a);break;case sa.BOOL:Ps("true"==a||"false"==a),n="true"==a}switch(this.scalar(e,s.K,1,n,!0),s.V.kind){case"scalar":this.scalar(e,s.V.T,2,i,!0);break;case"enum":this.scalar(e,sa.INT32,2,i,!0);break;case"message":this.message(e,t,s.V.T(),2,i)}e.join()}message(e,t,s,a,i){void 0!==i&&(s.internalBinaryWrite(i,e.tag(a,xs.LengthDelimited).fork(),t),e.join())}scalar(e,t,s,a,i){let[n,r,o]=this.scalarInfo(t,a);o&&!i||(e.tag(s,n),e[r](a))}packed(e,t,s,a){if(!a.length)return;Ps(t!==sa.BYTES&&t!==sa.STRING),e.tag(s,xs.LengthDelimited),e.fork();let[,i]=this.scalarInfo(t);for(let t=0;t("受限"==e?.badge_info?.text&&(e.badge_info.text="",e.badge_info.bg_color="#FB7299",e.badge_info.bg_color_night="#BB5B76"),e?.rights&&(e.rights.allow_dm=1,e.rights.allow_download=1,e.rights.allow_demand=1,e.rights.area_limit=0),e))),ya.log("🎉 Set Episodes",""),e}function xa(e={seasonTitle:void 0,seasonId:void 0,epId:void 0,mId:void 0,evaluate:void 0}){switch(ya.log("☑️ Detect Locales",`seasonTitle: ${e.seasonTitle}, seasonId: ${e.seasonId}, epId: ${e.epId}, mId: ${e.mId}`,""),e.seasonTitle){case void 0:case null:e.locales=t(e.mId);break;default:e.locales=function(s){ya.log("☑️ Detect Season Title","");let a=[];switch(ya.log([...e.seasonTitle?.matchAll(/[(\uFF08]([^(\uFF08)\uFF09]+)[)\uFF09]/g)]),[...s?.matchAll(/[(\uFF08]([^(\uFF08)\uFF09]+)[)\uFF09]/g)]?.pop()?.[1]){case"僅限港澳台地區":case"限僅港澳台地區":case"港澳台地區":a=["HKG","MAC","TWN"];break;case"僅限港台地區":a=["HKG","TWN"];break;case"僅限港澳地區":case"僅港澳地區":a=["HKG","MAC"];break;case"僅限台灣地區":a=["TWN"];break;case"僅限港澳台及其他地區":a=["HKG","MAC","TWN","SEA"];break;case"僅限港澳及其他地區":a=["HKG","MAC","SEA"];break;default:a=t(e.mId)}return ya.log(`✅ Detect Season Title, locales: ${a}`,""),a}(e.seasonTitle)}return ya.log(`✅ Detect Locales, locales: ${e.locales}`,""),e.locales;function t(t){ya.log("☑️ Detect mId","");let s=[];switch(t){case 928123:s=["CHN"];break;case 11783021:case 1988098633:case 2042149112:s=["HKG","MAC","TWN"];break;case 15773384:s=["CHN"];break;case 4856007:case 98627270:s=["CHN","HKG","MAC","TWN"];break;default:s=function(e,t){ya.log("☑️ Detect Traditional","");let s=[];s=a(e)>0||a(t)>1?["HKG","MAC","TWN"]:["CHN"];return ya.log(`✅ Detect Traditional, locales: ${s}`,""),s;function a(e=[""]){ya.log("☑️ is the Strings Traditional Chinese?","");const t=/[䊷䋙䝼䰾䲁丟並乾亂亞佇馀併來侖侶俁係俔俠倀倆倈倉個們倫偉側偵偽傑傖傘備傭傯傳傴債傷傾僂僅僉僑僕僞僥僨價儀儂億儈儉儐儔儕儘償優儲儷儺儻儼兌兒兗內兩冊冪凈凍凜凱別刪剄則剋剎剗剛剝剮剴創劃劇劉劊劌劍劑勁動務勛勝勞勢勩勱勵勸勻匭匯匱區協卻厙厠厭厲厴參叄叢吒吳吶呂咼員唄唚問啓啞啟啢喎喚喪喬單喲嗆嗇嗊嗎嗚嗩嗶嘆嘍嘔嘖嘗嘜嘩嘮嘯嘰嘵嘸嘽噓噝噠噥噦噯噲噴噸噹嚀嚇嚌嚕嚙嚦嚨嚲嚳嚴嚶囀囁囂囅囈囑囪圇國圍園圓圖團垵埡埰執堅堊堖堝堯報場塊塋塏塒塗塢塤塵塹墊墜墮墳墻墾壇壈壋壓壘壙壚壞壟壠壢壩壯壺壼壽夠夢夾奐奧奩奪奬奮奼妝姍姦娛婁婦婭媧媯媼媽嫗嫵嫻嫿嬀嬈嬋嬌嬙嬡嬤嬪嬰嬸孌孫學孿宮寢實寧審寫寬寵寶將專尋對導尷屆屍屓屜屢層屨屬岡峴島峽崍崗崢崬嵐嶁嶄嶇嶔嶗嶠嶢嶧嶮嶴嶸嶺嶼巋巒巔巰帥師帳帶幀幃幗幘幟幣幫幬幹幺幾庫廁廂廄廈廚廝廟廠廡廢廣廩廬廳弒弳張強彈彌彎彙彞彥後徑從徠復徵徹恆恥悅悞悵悶惡惱惲惻愛愜愨愴愷愾慄態慍慘慚慟慣慤慪慫慮慳慶憂憊憐憑憒憚憤憫憮憲憶懇應懌懍懟懣懨懲懶懷懸懺懼懾戀戇戔戧戩戰戱戲戶拋拾挩挾捨捫掃掄掗掙掛採揀揚換揮損搖搗搵搶摑摜摟摯摳摶摻撈撏撐撓撝撟撣撥撫撲撳撻撾撿擁擄擇擊擋擓擔據擠擬擯擰擱擲擴擷擺擻擼擾攄攆攏攔攖攙攛攜攝攢攣攤攪攬敗敘敵數斂斃斕斬斷時晉晝暈暉暘暢暫曄曆曇曉曏曖曠曨曬書會朧東杴桿梔梘條梟梲棄棖棗棟棧棲棶椏楊楓楨業極榪榮榲榿構槍槤槧槨槳樁樂樅樓標樞樣樸樹樺橈橋機橢橫檁檉檔檜檟檢檣檮檯檳檸檻櫃櫓櫚櫛櫝櫞櫟櫥櫧櫨櫪櫫櫬櫱櫳櫸櫻欄權欏欒欖欞欽歐歟歡歲歷歸歿殘殞殤殨殫殮殯殲殺殻殼毀毆毿氂氈氌氣氫氬氳決沒沖況洶浹涇涼淚淥淪淵淶淺渙減渦測渾湊湞湯溈準溝溫滄滅滌滎滬滯滲滷滸滻滾滿漁漚漢漣漬漲漵漸漿潁潑潔潙潛潤潯潰潷潿澀澆澇澗澠澤澦澩澮澱濁濃濕濘濟濤濫濰濱濺濼濾瀅瀆瀉瀏瀕瀘瀝瀟瀠瀦瀧瀨瀲瀾灃灄灑灕灘灝灠灣灤灧災為烏烴無煉煒煙煢煥煩煬熅熒熗熱熲熾燁燈燉燒燙燜營燦燭燴燼燾爍爐爛爭爲爺爾牆牘牽犖犢犧狀狹狽猙猶猻獁獄獅獎獨獪獫獮獰獲獵獷獸獺獻獼玀現琺琿瑋瑒瑣瑤瑩瑪瑲璉璣璦璫環璽瓊瓏瓔瓚甌產産畝畢異畵當疇疊痙痾瘂瘋瘍瘓瘞瘡瘧瘮瘲瘺瘻療癆癇癉癘癟癢癤癥癧癩癬癭癮癰癱癲發皚皰皸皺盜盞盡監盤盧眥眾睏睜睞瞘瞜瞞瞶瞼矓矚矯硜硤硨硯碩碭碸確碼磑磚磣磧磯磽礆礎礙礦礪礫礬礱祿禍禎禕禡禦禪禮禰禱禿秈稅稈稟種稱穀穌積穎穠穡穢穩穫穭窩窪窮窯窵窶窺竄竅竇竈竊竪競筆筍筧筴箋箏節範築篋篔篤篩篳簀簍簞簡簣簫簹簽簾籃籌籙籜籟籠籩籪籬籮粵糝糞糧糲糴糶糹糾紀紂約紅紆紇紈紉紋納紐紓純紕紖紗紘紙級紛紜紝紡紬細紱紲紳紵紹紺紼紿絀終組絅絆絎結絕絛絝絞絡絢給絨絰統絲絳絶絹綁綃綆綈綉綌綏經綜綞綠綢綣綫綬維綯綰綱網綳綴綸綹綺綻綽綾綿緄緇緊緋緑緒緓緔緗緘緙線緝緞締緡緣緦編緩緬緯緱緲練緶緹緻縈縉縊縋縐縑縕縗縛縝縞縟縣縧縫縭縮縱縲縳縵縶縷縹總績繃繅繆繒織繕繚繞繡繢繩繪繫繭繮繯繰繳繸繹繼繽繾纈纊續纍纏纓纖纘纜缽罈罌罰罵罷羅羆羈羋羥義習翹耬耮聖聞聯聰聲聳聵聶職聹聽聾肅脅脈脛脫脹腎腖腡腦腫腳腸膃膚膠膩膽膾膿臉臍臏臘臚臟臠臢臨臺與興舉舊艙艤艦艫艱艷芻苎苧茲荊莊莖莢莧華萇萊萬萵葉葒著葤葦葯葷蒓蒔蒞蒼蓀蓋蓮蓯蓴蓽蔔蔞蔣蔥蔦蔭蕁蕆蕎蕒蕓蕕蕘蕢蕩蕪蕭蕷薀薈薊薌薔薘薟薦薩薴薺藍藎藝藥藪藴藶藹藺蘄蘆蘇蘊蘋蘚蘞蘢蘭蘺蘿虆處虛虜號虧虯蛺蛻蜆蝕蝟蝦蝸螄螞螢螻螿蟄蟈蟎蟣蟬蟯蟲蟶蟻蠅蠆蠐蠑蠟蠣蠨蠱蠶蠻衆術衕衚衛衝衹袞裊裏補裝裡製複褌褘褲褳褸褻襇襏襖襝襠襤襪襯襲見覎規覓視覘覡覥覦親覬覯覲覷覺覽覿觀觴觶觸訁訂訃計訊訌討訐訒訓訕訖託記訛訝訟訢訣訥訩訪設許訴訶診註詁詆詎詐詒詔評詖詗詘詛詞詠詡詢詣試詩詫詬詭詮詰話該詳詵詼詿誄誅誆誇誌認誑誒誕誘誚語誠誡誣誤誥誦誨說説誰課誶誹誼誾調諂諄談諉請諍諏諑諒論諗諛諜諝諞諢諤諦諧諫諭諮諱諳諶諷諸諺諼諾謀謁謂謄謅謊謎謐謔謖謗謙謚講謝謠謡謨謫謬謭謳謹謾證譎譏譖識譙譚譜譫譯議譴護譸譽譾讀變讎讒讓讕讖讜讞豈豎豐豬豶貓貝貞貟負財貢貧貨販貪貫責貯貰貲貳貴貶買貸貺費貼貽貿賀賁賂賃賄賅資賈賊賑賒賓賕賙賚賜賞賠賡賢賣賤賦賧質賫賬賭賴賵賺賻購賽賾贄贅贇贈贊贋贍贏贐贓贔贖贗贛贜赬趕趙趨趲跡踐踴蹌蹕蹣蹤蹺躂躉躊躋躍躑躒躓躕躚躡躥躦躪軀車軋軌軍軑軒軔軛軟軤軫軲軸軹軺軻軼軾較輅輇輈載輊輒輓輔輕輛輜輝輞輟輥輦輩輪輬輯輳輸輻輾輿轀轂轄轅轆轉轍轎轔轟轡轢轤辦辭辮辯農逕這連進運過達違遙遜遞遠適遲遷選遺遼邁還邇邊邏邐郟郵鄆鄉鄒鄔鄖鄧鄭鄰鄲鄴鄶鄺酇酈醖醜醞醫醬醱釀釁釃釅釋釐釒釓釔釕釗釘釙針釣釤釧釩釵釷釹釺鈀鈁鈃鈄鈈鈉鈍鈎鈐鈑鈒鈔鈕鈞鈣鈥鈦鈧鈮鈰鈳鈴鈷鈸鈹鈺鈽鈾鈿鉀鉅鉈鉉鉋鉍鉑鉕鉗鉚鉛鉞鉢鉤鉦鉬鉭鉶鉸鉺鉻鉿銀銃銅銍銑銓銖銘銚銛銜銠銣銥銦銨銩銪銫銬銱銳銷銹銻銼鋁鋃鋅鋇鋌鋏鋒鋙鋝鋟鋣鋤鋥鋦鋨鋩鋪鋭鋮鋯鋰鋱鋶鋸鋼錁錄錆錇錈錏錐錒錕錘錙錚錛錟錠錡錢錦錨錩錫錮錯録錳錶錸鍀鍁鍃鍆鍇鍈鍋鍍鍔鍘鍚鍛鍠鍤鍥鍩鍬鍰鍵鍶鍺鎂鎄鎇鎊鎔鎖鎘鎛鎡鎢鎣鎦鎧鎩鎪鎬鎮鎰鎲鎳鎵鎸鎿鏃鏇鏈鏌鏍鏐鏑鏗鏘鏜鏝鏞鏟鏡鏢鏤鏨鏰鏵鏷鏹鏽鐃鐋鐐鐒鐓鐔鐘鐙鐝鐠鐦鐧鐨鐫鐮鐲鐳鐵鐶鐸鐺鐿鑄鑊鑌鑒鑔鑕鑞鑠鑣鑥鑭鑰鑱鑲鑷鑹鑼鑽鑾鑿钁長門閂閃閆閈閉開閌閎閏閑間閔閘閡閣閥閨閩閫閬閭閱閲閶閹閻閼閽閾閿闃闆闈闊闋闌闍闐闒闓闔闕闖關闞闠闡闤闥阪陘陝陣陰陳陸陽隉隊階隕際隨險隱隴隸隻雋雖雙雛雜雞離難雲電霢霧霽靂靄靈靚靜靦靨鞀鞏鞝鞽韁韃韉韋韌韍韓韙韜韞韻響頁頂頃項順頇須頊頌頎頏預頑頒頓頗領頜頡頤頦頭頮頰頲頴頷頸頹頻頽顆題額顎顏顒顓顔願顙顛類顢顥顧顫顬顯顰顱顳顴風颭颮颯颱颳颶颸颺颻颼飀飄飆飈飛飠飢飣飥飩飪飫飭飯飲飴飼飽飾飿餃餄餅餉養餌餎餏餑餒餓餕餖餚餛餜餞餡館餱餳餶餷餺餼餾餿饁饃饅饈饉饊饋饌饑饒饗饜饞饢馬馭馮馱馳馴馹駁駐駑駒駔駕駘駙駛駝駟駡駢駭駰駱駸駿騁騂騅騌騍騎騏騖騙騤騫騭騮騰騶騷騸騾驀驁驂驃驄驅驊驌驍驏驕驗驚驛驟驢驤驥驦驪驫骯髏髒體髕髖髮鬆鬍鬚鬢鬥鬧鬩鬮鬱魎魘魚魛魢魨魯魴魷魺鮁鮃鮊鮋鮍鮎鮐鮑鮒鮓鮚鮜鮝鮞鮦鮪鮫鮭鮮鮳鮶鮺鯀鯁鯇鯉鯊鯒鯔鯕鯖鯗鯛鯝鯡鯢鯤鯧鯨鯪鯫鯴鯷鯽鯿鰁鰂鰃鰈鰉鰍鰏鰐鰒鰓鰜鰟鰠鰣鰥鰨鰩鰭鰮鰱鰲鰳鰵鰷鰹鰺鰻鰼鰾鱂鱅鱈鱉鱒鱔鱖鱗鱘鱝鱟鱠鱣鱤鱧鱨鱭鱯鱷鱸鱺鳥鳧鳩鳬鳲鳳鳴鳶鳾鴆鴇鴉鴒鴕鴛鴝鴞鴟鴣鴦鴨鴯鴰鴴鴷鴻鴿鵁鵂鵃鵐鵑鵒鵓鵜鵝鵠鵡鵪鵬鵮鵯鵲鵷鵾鶄鶇鶉鶊鶓鶖鶘鶚鶡鶥鶩鶪鶬鶯鶲鶴鶹鶺鶻鶼鶿鷀鷁鷂鷄鷈鷊鷓鷖鷗鷙鷚鷥鷦鷫鷯鷲鷳鷸鷹鷺鷽鷿鸇鸌鸏鸕鸘鸚鸛鸝鸞鹵鹹鹺鹽麗麥麩麵麽黃黌點黨黲黶黷黽黿鼉鼴齊齋齎齏齒齔齕齗齙齜齟齠齡齦齪齬齲齶齷龍龎龐龔龕龜]/,s=[...e].map((e=>bool=!!e?.match(t))).reduce(((e,t,s,a)=>e+t));return ya.log("✅ is the Strings Traditional Chinese?",`sumEqual: ${s}`,""),s}}(e.seasonTitle,e.evaluate)}return ya.log(`✅ Detect mId, locales: ${s}`,""),s}}function Aa(e={seasonTitle:void 0,seasonId:void 0,epId:void 0,mId:void 0,evaluate:void 0},s=[],a={}){ya.log("☑️ Set Cache",`seasonTitle: ${e.seasonTitle}, seasonId: ${e.seasonId}, epId: ${e.epId}, mId: ${e.mId}`,"");let i=!1;return e.locales?.length>0&&(e.seasonId&&a.ss.set(e.seasonId,e.locales),e.epId&&a.ep.set(e.epId,e.locales),s.forEach((t=>a.ep.set(t?.id,e.locales))),a.ss=Array.from(a.ss).slice(-100),a.ep=Array.from(a.ep).slice(-1e3),i=t.setItem("@BiliBili.Global.Caches",a)),ya.log(`✅ Set Cache, locales: ${e.locales}, isSaved: ${i}`,""),i}ya.log(`⚠ FORMAT: ${Ta}`,""),(async()=>{const{Settings:e,Caches:t,Configs:s}=c("BiliBili","Global",l);switch(ya.log(`⚠ Settings.Switch: ${e?.Switch}`,""),e.Switch){case!0:default:let e={code:0,message:"0",data:{}},s={seasonTitle:ka.searchParams.get("season_title"),seasonId:parseInt(ka.searchParams.get("season_id"),10)||void 0,epId:parseInt(ka.searchParams.get("ep_id"),10)||void 0,mId:parseInt(ka.searchParams.get("mid")||ka.searchParams.get("vmid"),10)||void 0,evaluate:void 0,keyword:ka.searchParams.get("keyword"),locale:ka.searchParams.get("locale"),locales:[],type:"UGC"};switch(Ta){case void 0:case"application/x-www-form-urlencoded":case"text/plain":default:case"application/x-mpegURL":case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"audio/mpegurl":case"text/xml":case"text/html":case"text/plist":case"application/xml":case"application/plist":case"application/x-plist":case"text/vtt":case"application/vtt":break;case"text/json":case"application/json":switch(e=JSON.parse($response.body??"{}"),Ia){case"www.bilibili.com":case"app.bilibili.com":case"app.biliapi.net":break;case"api.bilibili.com":case"api.biliapi.net":switch(Na){case"/pgc/player/api/playurl":case"/pgc/player/web/playurl":case"/pgc/player/web/playurl/html5":case"/pgc/page/bangumi":case"/pgc/page/cinema/tab":s.type="PGC";break;case"/x/player/wbi/playurl":break;case"/x/space/acc/info":case"/x/space/wbi/acc/info":s.mId;break;case"/pgc/view/v2/app/season":let a=e.data;s.seasonTitle=a?.season_title??s.seasonTitle,s.seasonId=a?.season_id??s.seasonId,s.mId=a?.up_info?.mid??s.mId,s.evaluate=a?.evaluate??s.evaluate,s.type="PGC",a?.modules&&(a.modules=function(e=[]){return ya.log("⚠ Set Episodes",""),e=e.map((e=>{switch(e?.style){case"positive":case"section":e.data.episodes=Ea(e?.data?.episodes)}return e})),ya.log("🎉 Set Episodes",""),e}(a?.modules)),s.locales=xa(s),Aa(s,function(e=[]){ya.log("⚠ Get Episodes","");let t=e.flatMap((e=>{switch(e?.style){case"positive":case"section":return e?.data?.episodes;default:return[]}}));return ya.log("🎉 Get Episodes",""),t}(a?.modules),t),a?.dialog&&6010001===a?.dialog?.code&&delete a.dialog,a?.rights&&(a.rights.allow_bp=1,a.rights.allow_download=1,a.rights.allow_demand=1,a.rights.area_limit=0);break;case"/pgc/view/web/season":case"/pgc/view/pc/season":let i=e.result;s.seasonTitle=i.season_title??s.seasonTitle,s.seasonId=i.season_id??s.seasonId,s.mId=i.up_info?.mid??s.mId,s.evaluate=i?.evaluate??s.evaluate,s.type="PGC",(i?.episodes||i?.section)&&(i?.episodes&&(i.episodes=Ea(i.episodes)),i?.section&&(i.section=Ea(i.section))),s.locales=xa(s),Aa(s,i?.episodes,t),i?.rights&&(i.rights.allow_bp=1,i.rights.area_limit=0,i.rights.can_watch=1,i.allow_download=1,i.allow_bp_rank=1)}}$response.body=JSON.stringify(e);break;case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":case"application/grpc":case"application/grpc+proto":case"application/octet-stream":let a=ya.isQuanX()?new Uint8Array($response.bodyBytes??[]):$response.body??new Uint8Array;switch(Ta){case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":break;case"application/grpc":case"application/grpc+proto":let i=a.slice(0,5);switch(e=a.slice(5),i?.[0]){case 0:break;case 1:e=Is.ungzip(e),i[0]=0}switch(Ia){case"grpc.biliapi.net":case"app.bilibili.com":class a extends wa{constructor(){super("bilibili.app.viewunite.common.Owner",[{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"title",kind:"scalar",T:9},{no:4,name:"fans",kind:"scalar",T:9},{no:5,name:"arc_count",kind:"scalar",T:9},{no:6,name:"attention",kind:"scalar",T:5},{no:7,name:"attention_relation",kind:"scalar",T:5},{no:8,name:"pub_location",kind:"scalar",T:9},{no:10,name:"title_url",kind:"scalar",T:9},{no:11,name:"face",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:3,L:2},{no:15,name:"fans_num",kind:"scalar",T:3,L:2},{no:16,name:"assists",kind:"scalar",repeat:1,T:3,L:2}])}}const i=new a;switch(Sa?.[0]){case"bilibili.app.viewunite.v1.View":class a extends wa{constructor(){super("bilibili.app.viewunite.v1.Arc",[{no:1,name:"aid",kind:"scalar",T:3,L:2},{no:2,name:"cid",kind:"scalar",T:3,L:2},{no:3,name:"duration",kind:"scalar",T:3,L:2},{no:5,name:"bvid",kind:"scalar",T:9},{no:6,name:"copyright",kind:"scalar",T:5},{no:7,name:"right",kind:"message",T:()=>o},{no:8,name:"cover",kind:"scalar",T:9},{no:9,name:"type_id",kind:"scalar",T:3,L:2},{no:10,name:"title",kind:"scalar",T:9}])}}const n=new a;class r extends wa{constructor(){super("bilibili.app.viewunite.v1.Rights",[{no:1,name:"only_vip_download",kind:"scalar",T:8},{no:2,name:"no_reprint",kind:"scalar",T:8},{no:3,name:"download",kind:"scalar",T:8}])}}const o=new r;if("View"===Sa?.[1]){class a extends wa{constructor(){super("bilibili.app.viewunite.v1.ViewReply",[{no:2,name:"arc",kind:"message",T:()=>n},{no:4,name:"owner",kind:"message",T:()=>i},{no:10,name:"report",kind:"map",K:9,V:{kind:"scalar",T:9}}])}}const r=new a;let o=r.fromBinary(e);ya.log(`🚧 data: ${JSON.stringify(o)}`,""),e=r.toBinary(o),s.seasonTitle=o?.arc?.title??o?.supplement?.ogv_data?.title??s.seasonTitle,s.seasonId=parseInt(o?.report?.season_id,10)||o?.supplement?.ogv_data?.season_id||s.seasonId,s.mId=parseInt(o?.report?.up_mid,10)||o?.owner?.mid||s.mId,s.locales=xa(s),Aa(s,[],t)}break;case"bilibili.app.playurl.v1.PlayURL":case"bilibili.app.nativeact.v1.NativeAct":case"bilibili.app.interface.v1.Search":case"bilibili.polymer.app.search.v1.Search":Sa?.[1];break;case"bilibili.pgc.gateway.player.v2.PlayURL":s.type="PGC"}}a=function({header:e,body:t},s){console.log("☑️ Add gRPC Header","");const a="gzip"==s?1:"identity"==s||null==s?0:e?.[0]??0,i=function(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}(t.length);"gzip"==s&&(t=pako.gzip(t));let n=new Uint8Array(e.length+t.length);return n.set([a],0),n.set(i,1),n.set(t,5),console.log("✅ Add gRPC Header",""),n}({header:i,body:e})}$response.body=a}ya.log(`🚧 ${ya.name},信息组, infoGroup: ${JSON.stringify(s)}`,"");case!1:}})().catch((e=>ya.logErr(e))).finally((()=>ya.done($response))); +class e{static name="Lodash";static version="1.2.2";static about(){return console.log(`\n🟧 ${this.name} v${this.version}\n`)}static get(e={},t="",s=void 0){Array.isArray(t)||(t=this.toPath(t));const n=t.reduce(((e,t)=>Object(e)[t]),e);return void 0===n?s:n}static set(e={},t="",s){return Array.isArray(t)||(t=this.toPath(t)),t.slice(0,-1).reduce(((e,s,n)=>Object(e[s])===e[s]?e[s]:e[s]=/^\d+$/.test(t[n+1])?[]:{}),e)[t[t.length-1]]=s,e}static unset(e={},t=""){return Array.isArray(t)||(t=this.toPath(t)),t.reduce(((e,s,n)=>n===t.length-1?(delete e[s],!0):Object(e)[s]),e)}static toPath(e){return e.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean)}static escape(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,(e=>t[e]))}static unescape(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&|<|>|"|'/g,(e=>t[e]))}}class t{static name="$Storage";static version="1.0.9";static about(){return console.log(`\n🟧 ${this.name} v${this.version}\n`)}static data=null;static dataFile="box.dat";static#e=/^@(?[^.]+)(?:\.(?.*))?$/;static#t(){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":"undefined"!=typeof Egern?"Egern":void 0}static getItem(t=new String,s=null){let n=s;if(!0===t.startsWith("@")){const{key:s,path:a}=t.match(this.#e)?.groups;t=s;let i=this.getItem(t,{});"object"!=typeof i&&(i={}),n=e.get(i,a);try{n=JSON.parse(n)}catch(e){}}else{switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":n=$persistentStore.read(t);break;case"Quantumult X":n=$prefs.valueForKey(t);break;case"Node.js":this.data=this.#s(this.dataFile),n=this.data?.[t];break;default:n=this.data?.[t]||null}try{n=JSON.parse(n)}catch(e){}}return n??s}static setItem(t=new String,s=new String){let n=!1;if("object"==typeof s)s=JSON.stringify(s);else s=String(s);if(!0===t.startsWith("@")){const{key:a,path:i}=t.match(this.#e)?.groups;t=a;let r=this.getItem(t,{});"object"!=typeof r&&(r={}),e.set(r,i,s),n=this.setItem(t,r)}else switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":n=$persistentStore.write(s,t);break;case"Quantumult X":n=$prefs.setValueForKey(s,t);break;case"Node.js":this.data=this.#s(this.dataFile),this.data[t]=s,this.#n(this.dataFile),n=!0;break;default:n=this.data?.[t]||null}return n}static removeItem(t){let s=!1;if(!0===t.startsWith("@")){const{key:n,path:a}=t.match(this.#e)?.groups;t=n;let i=this.getItem(t);"object"!=typeof i&&(i={}),keyValue=e.unset(i,a),s=this.setItem(t,i)}else switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Node.js":default:s=!1;break;case"Quantumult X":s=$prefs.removeValueForKey(t)}return s}static clear(){let e=!1;switch(this.#t()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Node.js":default:e=!1;break;case"Quantumult X":e=$prefs.removeAllValues()}return e}static#s(e){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(e),s=this.path.resolve(process.cwd(),e),n=this.fs.existsSync(t),a=!n&&this.fs.existsSync(s);if(!n&&!a)return{};{const e=n?t:s;try{return JSON.parse(this.fs.readFileSync(e))}catch(e){return{}}}}}static#n(e=this.dataFile){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(e),s=this.path.resolve(process.cwd(),e),n=this.fs.existsSync(t),a=!n&&this.fs.existsSync(s),i=JSON.stringify(this.data);n?this.fs.writeFileSync(t,i):a?this.fs.writeFileSync(s,i):this.fs.writeFileSync(t,i)}}}class s{static name="ENV";static version="1.8.3";static about(){return console.log(`\n🟧 ${this.name} v${this.version}\n`)}constructor(e,t){console.log(`\n🟧 ${s.name} v${s.version}\n`),this.name=e,this.logs=[],this.isMute=!1,this.isMuteLog=!1,this.logSeparator="\n",this.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,t),this.log(`\n🚩 开始!\n${e}\n`)}environment(){switch(this.platform()){case"Surge":return $environment.app="Surge",$environment;case"Stash":return $environment.app="Stash",$environment;case"Egern":return $environment.app="Egern",$environment;case"Loon":let e=$loon.split(" ");return{device:e[0],ios:e[1],"loon-version":e[2],app:"Loon"};case"Quantumult X":return{app:"Quantumult X"};case"Node.js":return process.env.app="Node.js",process.env;default:return{}}}platform(){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":"undefined"!=typeof Egern?"Egern":void 0}isNode(){return"Node.js"===this.platform()}isQuanX(){return"Quantumult X"===this.platform()}isSurge(){return"Surge"===this.platform()}isLoon(){return"Loon"===this.platform()}isShadowrocket(){return"Shadowrocket"===this.platform()}isStash(){return"Stash"===this.platform()}isEgern(){return"Egern"===this.platform()}async getScript(e){return await this.fetch(e).then((e=>e.body))}async runScript(e,s){let n=t.getItem("@chavy_boxjs_userCfgs.httpapi");n=n?.replace?.(/\n/g,"")?.trim();let a=t.getItem("@chavy_boxjs_userCfgs.httpapi_timeout");a=1*a??20,a=s?.timeout??a;const[i,r]=n.split("@"),o={url:`http://${r}/v1/scripting/evaluate`,body:{script_text:e,mock_type:"cron",timeout:a},headers:{"X-Key":i,Accept:"*/*"},timeout:a};await this.fetch(o).then((e=>e.body),(e=>this.logErr(e)))}initGotEnv(e){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,e&&(e.headers=e.headers?e.headers:{},void 0===e.headers.Cookie&&void 0===e.cookieJar&&(e.cookieJar=this.ckjar))}async fetch(t={}||"",s={}){switch(t.constructor){case Object:t={...s,...t};break;case String:t={...s,url:t}}t.method||(t.method="GET",(t.body??t.bodyBytes)&&(t.method="POST")),delete t.headers?.Host,delete t.headers?.[":authority"],delete t.headers?.["Content-Length"],delete t.headers?.["content-length"];const n=t.method.toLocaleLowerCase();switch(this.platform()){case"Loon":case"Surge":case"Stash":case"Egern":case"Shadowrocket":default:return t.timeout&&(t.timeout=parseInt(t.timeout,10),this.isSurge()||(t.timeout=1e3*t.timeout)),t.policy&&(this.isLoon()&&(t.node=t.policy),this.isStash()&&e.set(t,"headers.X-Stash-Selected-Proxy",encodeURI(t.policy)),this.isShadowrocket()&&e.set(t,"headers.X-Surge-Proxy",t.policy)),"boolean"==typeof t.redirection&&(t["auto-redirect"]=t.redirection),t.bodyBytes&&!t.body&&(t.body=t.bodyBytes,delete t.bodyBytes),await new Promise(((e,s)=>{$httpClient[n](t,((n,a,i)=>{n?s(n):(a.ok=/^2\d\d$/.test(a.status),a.statusCode=a.status,i&&(a.body=i,1==t["binary-mode"]&&(a.bodyBytes=i)),e(a))}))}));case"Quantumult X":return t.policy&&e.set(t,"opts.policy",t.policy),"boolean"==typeof t["auto-redirect"]&&e.set(t,"opts.redirection",t["auto-redirect"]),t.body instanceof ArrayBuffer?(t.bodyBytes=t.body,delete t.body):ArrayBuffer.isView(t.body)?(t.bodyBytes=t.body.buffer.slice(t.body.byteOffset,t.body.byteLength+t.body.byteOffset),delete object.body):t.body&&delete t.bodyBytes,await $task.fetch(t).then((e=>(e.ok=/^2\d\d$/.test(e.statusCode),e.status=e.statusCode,e)),(e=>Promise.reject(e.error)));case"Node.js":let s=require("iconv-lite");this.initGotEnv(t);const{url:a,...i}=t;return await this.got[n](a,i).on("redirect",((e,t)=>{try{if(e.headers["set-cookie"]){const s=e.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),t.cookieJar=this.ckjar}}catch(e){this.logErr(e)}})).then((e=>(e.statusCode=e.status,e.body=s.decode(e.rawBody,this.encoding),e.bodyBytes=e.rawBody,e)),(e=>Promise.reject(e.message)))}}time(e,t=null){const s=t?new Date(t):new Date;let n={"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(e)&&(e=e.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let t in n)new RegExp("("+t+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[t]:("00"+n[t]).substr((""+n[t]).length)));return e}msg(e=name,t="",s="",n){const a=e=>{switch(typeof e){case void 0:return e;case"string":switch(this.platform()){case"Surge":case"Stash":case"Egern":default:return{url:e};case"Loon":case"Shadowrocket":return e;case"Quantumult X":return{"open-url":e};case"Node.js":return}case"object":switch(this.platform()){case"Surge":case"Stash":case"Egern":case"Shadowrocket":default:return{url:e.url||e.openUrl||e["open-url"]};case"Loon":return{openUrl:e.openUrl||e.url||e["open-url"],mediaUrl:e.mediaUrl||e["media-url"]};case"Quantumult X":return{"open-url":e["open-url"]||e.url||e.openUrl,"media-url":e["media-url"]||e.mediaUrl,"update-pasteboard":e["update-pasteboard"]||e.updatePasteboard};case"Node.js":return}default:return}};if(!this.isMute)switch(this.platform()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":default:$notification.post(e,t,s,a(n));break;case"Quantumult X":$notify(e,t,s,a(n));case"Node.js":}if(!this.isMuteLog){let n=["","==============📣系统通知📣=============="];n.push(e),t&&n.push(t),s&&n.push(s),console.log(n.join("\n")),this.logs=this.logs.concat(n)}}log(...e){e.length>0&&(this.logs=[...this.logs,...e]),console.log(e.join(this.logSeparator))}logErr(e){switch(this.platform()){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Quantumult X":default:this.log("",`❗️ ${this.name}, 错误!`,e);break;case"Node.js":this.log("",`❗️${this.name}, 错误!`,e.stack)}}wait(e){return new Promise((t=>setTimeout(t,e)))}done(t={}){const s=((new Date).getTime()-this.startTime)/1e3;switch(this.log("",`🚩 ${this.name}, 结束! 🕛 ${s} 秒`,""),this.platform()){case"Surge":t.policy&&e.set(t,"headers.X-Surge-Policy",t.policy),$done(t);break;case"Loon":t.policy&&(t.node=t.policy),$done(t);break;case"Stash":t.policy&&e.set(t,"headers.X-Stash-Selected-Proxy",encodeURI(t.policy)),$done(t);break;case"Egern":case"Shadowrocket":default:$done(t);break;case"Quantumult X":t.policy&&e.set(t,"opts.policy",t.policy),delete t["auto-redirect"],delete t["auto-cookie"],delete t["binary-mode"],delete t.charset,delete t.host,delete t.insecure,delete t.method,delete t.opt,delete t.path,delete t.policy,delete t["policy-descriptor"],delete t.scheme,delete t.sessionIndex,delete t.statusCode,delete t.timeout,t.body instanceof ArrayBuffer?(t.bodyBytes=t.body,delete t.body):ArrayBuffer.isView(t.body)?(t.bodyBytes=t.body.buffer.slice(t.body.byteOffset,t.body.byteLength+t.body.byteOffset),delete t.body):t.body&&delete t.bodyBytes,$done(t);break;case"Node.js":process.exit(1)}}}var n={Switch:!0},a={Settings:n},i={Switch:!0,ForceHost:"1",Locales:["CHN","HKG","TWN"],Proxies:{CHN:"DIRECT",HKG:"🇭🇰香港",MAC:"🇲🇴澳门",TWN:"🇹🇼台湾"}},r={Locale:{CHN:"",HKG:"(僅限港.*地區)",MAC:"(僅限.*澳.*地區)",TWN:"(僅限.*台地區)"},SearchNav:{CHN:{name:"番剧🇨🇳",total:0,pages:0,type:17},HKG:{name:"动画🇭🇰",total:0,pages:0,type:27},MAC:{name:"动画🇲🇴",total:0,pages:0,type:37},TWN:{name:"动画🇹🇼",total:0,pages:0,type:47}}},o={Settings:i,Configs:r},l=Database={Default:Object.freeze({__proto__:null,Settings:n,default:a}),Global:Object.freeze({__proto__:null,Configs:r,Settings:i,default:o})};function c(s,n,a){console.log("☑️ Set Environment Variables","");let{Settings:i,Caches:r,Configs:o}=function(s,n,a){let i=t.getItem(s,a),r={};if("undefined"!=typeof $argument&&Boolean($argument)){let t=Object.fromEntries($argument.split("&").map((e=>e.split("=").map((e=>e.replace(/\"/g,""))))));for(let s in t)e.set(r,s,t[s])}const o={Settings:a?.Default?.Settings||{},Configs:a?.Default?.Configs||{},Caches:{}};Array.isArray(n)||(n=[n]);for(let e of n)o.Settings={...o.Settings,...a?.[e]?.Settings,...r,...i?.[e]?.Settings},o.Configs={...o.Configs,...a?.[e]?.Configs},i?.[e]?.Caches&&"string"==typeof i?.[e]?.Caches&&(i[e].Caches=JSON.parse(i?.[e]?.Caches)),o.Caches={...o.Caches,...i?.[e]?.Caches};return function e(t,s){for(var n in t){var a=t[n];t[n]="object"==typeof a&&null!==a?e(a,s):s(n,a)}return t}(o.Settings,((e,t)=>("true"===t||"false"===t?t=JSON.parse(t):"string"==typeof t&&(t=t.includes(",")?t.split(",").map((e=>l(e))):l(t)),t))),o;function l(e){return e&&!isNaN(e)&&(e=parseInt(e,10)),e}}(s,n,a);return Array.isArray(i?.Locales)||(i.Locales=i.Locales?[i.Locales]:[]),console.log(`✅ Set Environment Variables, Settings: ${typeof i}, Settings内容: ${JSON.stringify(i)}`,""),Array.isArray(r?.ss)||(r.ss=[]),Array.isArray(r?.ep)||(r.ep=[]),r.ss=new Map(r?.ss??[]),r.ep=new Map(r?.ep??[]),{Settings:i,Caches:r,Configs:o}} +/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function h(e){let t=e.length;for(;--t>=0;)e[t]=0}const u=256,d=286,f=30,p=15,g=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]),m=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]),_=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),b=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),w=new Array(576);h(w);const y=new Array(60);h(y);const k=new Array(512);h(k);const v=new Array(256);h(v);const I=new Array(29);h(I);const S=new Array(f);function N(e,t,s,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=s,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}let T,E,x;function A(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}h(S);const O=e=>e<256?k[e]:k[256+(e>>>7)],B=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},U=(e,t,s)=>{e.bi_valid>16-s?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=s-16):(e.bi_buf|=t<{U(e,s[2*t],s[2*t+1])},z=(e,t)=>{let s=0;do{s|=1&e,e>>>=1,s<<=1}while(--t>0);return s>>>1},D=(e,t,s)=>{const n=new Array(16);let a,i,r=0;for(a=1;a<=p;a++)r=r+s[a-1]<<1,n[a]=r;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=z(n[t]++,t))}},F=e=>{let t;for(t=0;t{e.bi_valid>8?B(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},$=(e,t,s,n)=>{const a=2*t,i=2*s;return e[a]{const n=e.heap[s];let a=s<<1;for(;a<=e.heap_len&&(a{let n,a,i,r,o=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+o++],n+=(255&e.pending_buf[e.sym_buf+o++])<<8,a=e.pending_buf[e.sym_buf+o++],0===n?R(e,a,t):(i=v[a],R(e,i+u+1,t),r=g[i],0!==r&&(a-=I[i],U(e,a,r)),n--,i=O(n),R(e,i,s),r=m[i],0!==r&&(n-=S[i],U(e,n,r)))}while(o{const s=t.dyn_tree,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.elems;let r,o,l,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r>1;r>=1;r--)C(e,s,r);l=i;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],C(e,s,1),o=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=o,s[2*l]=s[2*r]+s[2*o],e.depth[l]=(e.depth[r]>=e.depth[o]?e.depth[r]:e.depth[o])+1,s[2*r+1]=s[2*o+1]=l,e.heap[1]=l++,C(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const s=t.dyn_tree,n=t.max_code,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,r=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length;let c,h,u,d,f,g,m=0;for(d=0;d<=p;d++)e.bl_count[d]=0;for(s[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)h=e.heap[c],d=s[2*s[2*h+1]+1]+1,d>l&&(d=l,m++),s[2*h+1]=d,h>n||(e.bl_count[d]++,f=0,h>=o&&(f=r[h-o]),g=s[2*h],e.opt_len+=g*(d+f),i&&(e.static_len+=g*(a[2*h+1]+f)));if(0!==m){do{for(d=l-1;0===e.bl_count[d];)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(d=l;0!==d;d--)for(h=e.bl_count[d];0!==h;)u=e.heap[--c],u>n||(s[2*u+1]!==d&&(e.opt_len+=(d-s[2*u+1])*s[2*u],s[2*u+1]=d),h--)}})(e,t),D(s,c,e.bl_count)},V=(e,t,s)=>{let n,a,i=-1,r=t[1],o=0,l=7,c=4;for(0===r&&(l=138,c=3),t[2*(s+1)+1]=65535,n=0;n<=s;n++)a=r,r=t[2*(n+1)+1],++o{let n,a,i=-1,r=t[1],o=0,l=7,c=4;for(0===r&&(l=138,c=3),n=0;n<=s;n++)if(a=r,r=t[2*(n+1)+1],!(++o{U(e,0+(n?1:0),3),L(e),B(e,s),B(e,~s),s&&e.pending_buf.set(e.window.subarray(t,t+s),e.pending),e.pending+=s};var K=(e,t,s,n)=>{let a,i,r=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,s=4093624447;for(t=0;t<=31;t++,s>>>=1)if(1&s&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t{let t;for(V(e,e.dyn_ltree,e.l_desc.max_code),V(e,e.dyn_dtree,e.d_desc.max_code),Z(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*b[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),a=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=a&&(a=i)):a=i=s+5,s+4<=a&&-1!==t?G(e,t,s,n):4===e.strategy||i===a?(U(e,2+(n?1:0),3),j(e,w,y)):(U(e,4+(n?1:0),3),((e,t,s,n)=>{let a;for(U(e,t-257,5),U(e,s-1,5),U(e,n-4,4),a=0;a{X||((()=>{let e,t,s,n,a;const i=new Array(16);for(s=0,n=0;n<28;n++)for(I[n]=s,e=0;e<1<>=7;n(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=s,0===t?e.dyn_ltree[2*s]++:(e.matches++,t--,e.dyn_ltree[2*(v[s]+u+1)]++,e.dyn_dtree[2*O(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{U(e,2,3),R(e,256,w),(e=>{16===e.bi_valid?(B(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var H=(e,t,s,n)=>{let a=65535&e|0,i=e>>>16&65535|0,r=0;for(;0!==s;){r=s>2e3?2e3:s,s-=r;do{a=a+t[n++]|0,i=i+a|0}while(--r);a%=65521,i%=65521}return a|i<<16|0};const J=new Uint32Array((()=>{let e,t=[];for(var s=0;s<256;s++){e=s;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[s]=e}return t})());var W=(e,t,s,n)=>{const a=J,i=n+s;e^=-1;for(let s=n;s>>8^a[255&(e^t[s])];return-1^e},Y={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"},q={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:Q,_tr_stored_block:ee,_tr_flush_block:te,_tr_tally:se,_tr_align:ne}=P,{Z_NO_FLUSH:ae,Z_PARTIAL_FLUSH:ie,Z_FULL_FLUSH:re,Z_FINISH:oe,Z_BLOCK:le,Z_OK:ce,Z_STREAM_END:he,Z_STREAM_ERROR:ue,Z_DATA_ERROR:de,Z_BUF_ERROR:fe,Z_DEFAULT_COMPRESSION:pe,Z_FILTERED:ge,Z_HUFFMAN_ONLY:me,Z_RLE:_e,Z_FIXED:be,Z_DEFAULT_STRATEGY:we,Z_UNKNOWN:ye,Z_DEFLATED:ke}=q,ve=258,Ie=262,Se=42,Ne=113,Te=666,Ee=(e,t)=>(e.msg=Y[t],t),xe=e=>2*e-(e>4?9:0),Ae=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Oe=e=>{let t,s,n,a=e.w_size;t=e.hash_size,n=t;do{s=e.head[--n],e.head[n]=s>=a?s-a:0}while(--t);t=a,n=t;do{s=e.prev[--n],e.prev[n]=s>=a?s-a:0}while(--t)};let Be=(e,t,s)=>(t<{const t=e.state;let s=t.pending;s>e.avail_out&&(s=e.avail_out),0!==s&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+s),e.next_out),e.next_out+=s,t.pending_out+=s,e.total_out+=s,e.avail_out-=s,t.pending-=s,0===t.pending&&(t.pending_out=0))},Re=(e,t)=>{te(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ue(e.strm)},ze=(e,t)=>{e.pending_buf[e.pending++]=t},De=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Fe=(e,t,s,n)=>{let a=e.avail_in;return a>n&&(a=n),0===a?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),s),1===e.state.wrap?e.adler=H(e.adler,t,a,s):2===e.state.wrap&&(e.adler=W(e.adler,t,a,s)),e.next_in+=a,e.total_in+=a,a)},Le=(e,t)=>{let s,n,a=e.max_chain_length,i=e.strstart,r=e.prev_length,o=e.nice_match;const l=e.strstart>e.w_size-Ie?e.strstart-(e.w_size-Ie):0,c=e.window,h=e.w_mask,u=e.prev,d=e.strstart+ve;let f=c[i+r-1],p=c[i+r];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(s=t,c[s+r]===p&&c[s+r-1]===f&&c[s]===c[i]&&c[++s]===c[i+1]){i+=2,s++;do{}while(c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&c[++i]===c[++s]&&ir){if(e.match_start=t,r=n,n>=o)break;f=c[i+r-1],p=c[i+r]}}}while((t=u[t&h])>l&&0!=--a);return r<=e.lookahead?r:e.lookahead},$e=e=>{const t=e.w_size;let s,n,a;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ie)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Oe(e),n+=t),0===e.strm.avail_in)break;if(s=Fe(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=s,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Be(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Be(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead{let s,n,a,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r=0,o=e.strm.avail_in;do{if(s=65535,a=e.bi_valid+42>>3,e.strm.avail_outn+e.strm.avail_in&&(s=n+e.strm.avail_in),s>a&&(s=a),s>8,e.pending_buf[e.pending-2]=~s,e.pending_buf[e.pending-1]=~s>>8,Ue(e.strm),n&&(n>s&&(n=s),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,s-=n),s&&(Fe(e.strm,e.strm.output,e.strm.next_out,s),e.strm.next_out+=s,e.strm.avail_out-=s,e.strm.total_out+=s)}while(0===r);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_watera&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Fe(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,i=a>e.w_size?e.w_size:a,n=e.strstart-e.block_start,(n>=i||(n||t===oe)&&t!==ae&&0===e.strm.avail_in&&n<=a)&&(s=n>a?a:n,r=t===oe&&0===e.strm.avail_in&&s===n?1:0,ee(e,e.block_start,s,r),e.block_start+=s,Ue(e.strm)),r?3:1)},je=(e,t)=>{let s,n;for(;;){if(e.lookahead=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==s&&e.strstart-s<=e.w_size-Ie&&(e.match_length=Le(e,s)),e.match_length>=3)if(n=se(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Be(e,e.ins_h,e.window[e.strstart+1]);else n=se(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Re(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2},Ze=(e,t)=>{let s,n,a;for(;;){if(e.lookahead=3&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==s&&e.prev_length4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,n=se(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=Be(e,e.ins_h,e.window[e.strstart+3-1]),s=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Re(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=se(e,0,e.window[e.strstart-1]),n&&Re(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=se(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2};function Ve(e,t,s,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=s,this.max_chain=n,this.func=a}const Me=[new Ve(0,0,0,0,Ce),new Ve(4,4,8,4,je),new Ve(4,5,16,8,je),new Ve(4,6,32,32,je),new Ve(4,4,16,16,Ze),new Ve(8,16,32,32,Ze),new Ve(8,16,128,128,Ze),new Ve(8,32,128,256,Ze),new Ve(32,128,258,1024,Ze),new Ve(32,258,258,4096,Ze)];function Xe(){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=ke,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),Ae(this.dyn_ltree),Ae(this.dyn_dtree),Ae(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),Ae(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Ae(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ge=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Se&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Ne&&t.status!==Te?1:0},Ke=e=>{if(Ge(e))return Ee(e,ue);e.total_in=e.total_out=0,e.data_type=ye;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Se:Ne,e.adler=2===t.wrap?0:1,t.last_flush=-2,Q(t),ce},Pe=e=>{const t=Ke(e);var s;return t===ce&&((s=e.state).window_size=2*s.w_size,Ae(s.head),s.max_lazy_match=Me[s.level].max_lazy,s.good_match=Me[s.level].good_length,s.nice_match=Me[s.level].nice_length,s.max_chain_length=Me[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=2,s.match_available=0,s.ins_h=0),t},He=(e,t,s,n,a,i)=>{if(!e)return ue;let r=1;if(t===pe&&(t=6),n<0?(r=0,n=-n):n>15&&(r=2,n-=16),a<1||a>9||s!==ke||n<8||n>15||t<0||t>9||i<0||i>be||8===n&&1!==r)return Ee(e,ue);8===n&&(n=9);const o=new Xe;return e.state=o,o.strm=e,o.status=Se,o.wrap=r,o.gzhead=null,o.w_bits=n,o.w_size=1<He(e,t,ke,15,8,we),deflateInit2:He,deflateReset:Pe,deflateResetKeep:Ke,deflateSetHeader:(e,t)=>Ge(e)||2!==e.state.wrap?ue:(e.state.gzhead=t,ce),deflate:(e,t)=>{if(Ge(e)||t>le||t<0)return e?Ee(e,ue):ue;const s=e.state;if(!e.output||0!==e.avail_in&&!e.input||s.status===Te&&t!==oe)return Ee(e,0===e.avail_out?fe:ue);const n=s.last_flush;if(s.last_flush=t,0!==s.pending){if(Ue(e),0===e.avail_out)return s.last_flush=-1,ce}else if(0===e.avail_in&&xe(t)<=xe(n)&&t!==oe)return Ee(e,fe);if(s.status===Te&&0!==e.avail_in)return Ee(e,fe);if(s.status===Se&&0===s.wrap&&(s.status=Ne),s.status===Se){let t=ke+(s.w_bits-8<<4)<<8,n=-1;if(n=s.strategy>=me||s.level<2?0:s.level<6?1:6===s.level?2:3,t|=n<<6,0!==s.strstart&&(t|=32),t+=31-t%31,De(s,t),0!==s.strstart&&(De(s,e.adler>>>16),De(s,65535&e.adler)),e.adler=1,s.status=Ne,Ue(e),0!==s.pending)return s.last_flush=-1,ce}if(57===s.status)if(e.adler=0,ze(s,31),ze(s,139),ze(s,8),s.gzhead)ze(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),ze(s,255&s.gzhead.time),ze(s,s.gzhead.time>>8&255),ze(s,s.gzhead.time>>16&255),ze(s,s.gzhead.time>>24&255),ze(s,9===s.level?2:s.strategy>=me||s.level<2?4:0),ze(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(ze(s,255&s.gzhead.extra.length),ze(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(e.adler=W(e.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=69;else if(ze(s,0),ze(s,0),ze(s,0),ze(s,0),ze(s,0),ze(s,9===s.level?2:s.strategy>=me||s.level<2?4:0),ze(s,3),s.status=Ne,Ue(e),0!==s.pending)return s.last_flush=-1,ce;if(69===s.status){if(s.gzhead.extra){let t=s.pending,n=(65535&s.gzhead.extra.length)-s.gzindex;for(;s.pending+n>s.pending_buf_size;){let a=s.pending_buf_size-s.pending;if(s.pending_buf.set(s.gzhead.extra.subarray(s.gzindex,s.gzindex+a),s.pending),s.pending=s.pending_buf_size,s.gzhead.hcrc&&s.pending>t&&(e.adler=W(e.adler,s.pending_buf,s.pending-t,t)),s.gzindex+=a,Ue(e),0!==s.pending)return s.last_flush=-1,ce;t=0,n-=a}let a=new Uint8Array(s.gzhead.extra);s.pending_buf.set(a.subarray(s.gzindex,s.gzindex+n),s.pending),s.pending+=n,s.gzhead.hcrc&&s.pending>t&&(e.adler=W(e.adler,s.pending_buf,s.pending-t,t)),s.gzindex=0}s.status=73}if(73===s.status){if(s.gzhead.name){let t,n=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>n&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),Ue(e),0!==s.pending)return s.last_flush=-1,ce;n=0}t=s.gzindexn&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),s.gzindex=0}s.status=91}if(91===s.status){if(s.gzhead.comment){let t,n=s.pending;do{if(s.pending===s.pending_buf_size){if(s.gzhead.hcrc&&s.pending>n&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n)),Ue(e),0!==s.pending)return s.last_flush=-1,ce;n=0}t=s.gzindexn&&(e.adler=W(e.adler,s.pending_buf,s.pending-n,n))}s.status=103}if(103===s.status){if(s.gzhead.hcrc){if(s.pending+2>s.pending_buf_size&&(Ue(e),0!==s.pending))return s.last_flush=-1,ce;ze(s,255&e.adler),ze(s,e.adler>>8&255),e.adler=0}if(s.status=Ne,Ue(e),0!==s.pending)return s.last_flush=-1,ce}if(0!==e.avail_in||0!==s.lookahead||t!==ae&&s.status!==Te){let n=0===s.level?Ce(s,t):s.strategy===me?((e,t)=>{let s;for(;;){if(0===e.lookahead&&($e(e),0===e.lookahead)){if(t===ae)return 1;break}if(e.match_length=0,s=se(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,s&&(Re(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2})(s,t):s.strategy===_e?((e,t)=>{let s,n,a,i;const r=e.window;for(;;){if(e.lookahead<=ve){if($e(e),e.lookahead<=ve&&t===ae)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(a=e.strstart-1,n=r[a],n===r[++a]&&n===r[++a]&&n===r[++a])){i=e.strstart+ve;do{}while(n===r[++a]&&n===r[++a]&&n===r[++a]&&n===r[++a]&&n===r[++a]&&n===r[++a]&&n===r[++a]&&n===r[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(s=se(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(s=se(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),s&&(Re(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===oe?(Re(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Re(e,!1),0===e.strm.avail_out)?1:2})(s,t):Me[s.level].func(s,t);if(3!==n&&4!==n||(s.status=Te),1===n||3===n)return 0===e.avail_out&&(s.last_flush=-1),ce;if(2===n&&(t===ie?ne(s):t!==le&&(ee(s,0,0,!1),t===re&&(Ae(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),Ue(e),0===e.avail_out))return s.last_flush=-1,ce}return t!==oe?ce:s.wrap<=0?he:(2===s.wrap?(ze(s,255&e.adler),ze(s,e.adler>>8&255),ze(s,e.adler>>16&255),ze(s,e.adler>>24&255),ze(s,255&e.total_in),ze(s,e.total_in>>8&255),ze(s,e.total_in>>16&255),ze(s,e.total_in>>24&255)):(De(s,e.adler>>>16),De(s,65535&e.adler)),Ue(e),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?ce:he)},deflateEnd:e=>{if(Ge(e))return ue;const t=e.state.status;return e.state=null,t===Ne?Ee(e,de):ce},deflateSetDictionary:(e,t)=>{let s=t.length;if(Ge(e))return ue;const n=e.state,a=n.wrap;if(2===a||1===a&&n.status!==Se||n.lookahead)return ue;if(1===a&&(e.adler=H(e.adler,t,s,0)),n.wrap=0,s>=n.w_size){0===a&&(Ae(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(s-n.w_size,s),0),t=e,s=n.w_size}const i=e.avail_in,r=e.next_in,o=e.input;for(e.avail_in=s,e.next_in=0,e.input=t,$e(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=Be(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,$e(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=r,e.input=o,e.avail_in=i,n.wrap=a,ce},deflateInfo:"pako deflate (from Nodeca project)"};const We=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ye={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const s=t.shift();if(s){if("object"!=typeof s)throw new TypeError(s+"must be non-object");for(const t in s)We(s,t)&&(e[t]=s[t])}}return e},flattenChunks:e=>{let t=0;for(let s=0,n=e.length;s=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Qe[254]=Qe[254]=1;var et={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,s,n,a,i,r=e.length,o=0;for(a=0;a>>6,t[i++]=128|63&s):s<65536?(t[i++]=224|s>>>12,t[i++]=128|s>>>6&63,t[i++]=128|63&s):(t[i++]=240|s>>>18,t[i++]=128|s>>>12&63,t[i++]=128|s>>>6&63,t[i++]=128|63&s);return t},buf2string:(e,t)=>{const s=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,a;const i=new Array(2*s);for(a=0,n=0;n4)i[a++]=65533,n+=r-1;else{for(t&=2===r?31:3===r?15:7;r>1&&n1?i[a++]=65533:t<65536?i[a++]=t:(t-=65536,i[a++]=55296|t>>10&1023,i[a++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&qe)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let s="";for(let n=0;n{(t=t||e.length)>e.length&&(t=e.length);let s=t-1;for(;s>=0&&128==(192&e[s]);)s--;return s<0||0===s?t:s+Qe[e[s]]>t?s:t}};var tt=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 st=Object.prototype.toString,{Z_NO_FLUSH:nt,Z_SYNC_FLUSH:at,Z_FULL_FLUSH:it,Z_FINISH:rt,Z_OK:ot,Z_STREAM_END:lt,Z_DEFAULT_COMPRESSION:ct,Z_DEFAULT_STRATEGY:ht,Z_DEFLATED:ut}=q;function dt(e){this.options=Ye.assign({level:ct,method:ut,chunkSize:16384,windowBits:15,memLevel:8,strategy:ht},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new tt,this.strm.avail_out=0;let s=Je.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(s!==ot)throw new Error(Y[s]);if(t.header&&Je.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?et.string2buf(t.dictionary):"[object ArrayBuffer]"===st.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,s=Je.deflateSetDictionary(this.strm,e),s!==ot)throw new Error(Y[s]);this._dict_set=!0}}function ft(e,t){const s=new dt(t);if(s.push(e,!0),s.err)throw s.msg||Y[s.err];return s.result}dt.prototype.push=function(e,t){const s=this.strm,n=this.options.chunkSize;let a,i;if(this.ended)return!1;for(i=t===~~t?t:!0===t?rt:nt,"string"==typeof e?s.input=et.string2buf(e):"[object ArrayBuffer]"===st.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;;)if(0===s.avail_out&&(s.output=new Uint8Array(n),s.next_out=0,s.avail_out=n),(i===at||i===it)&&s.avail_out<=6)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else{if(a=Je.deflate(s,i),a===lt)return s.next_out>0&&this.onData(s.output.subarray(0,s.next_out)),a=Je.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ot;if(0!==s.avail_out){if(i>0&&s.next_out>0)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else if(0===s.avail_in)break}else this.onData(s.output)}return!0},dt.prototype.onData=function(e){this.chunks.push(e)},dt.prototype.onEnd=function(e){e===ot&&(this.result=Ye.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var pt={Deflate:dt,deflate:ft,deflateRaw:function(e,t){return(t=t||{}).raw=!0,ft(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,ft(e,t)},constants:q};const gt=16209;var mt=function(e,t){let s,n,a,i,r,o,l,c,h,u,d,f,p,g,m,_,b,w,y,k,v,I,S,N;const T=e.state;s=e.next_in,S=e.input,n=s+(e.avail_in-5),a=e.next_out,N=e.output,i=a-(t-e.avail_out),r=a+(e.avail_out-257),o=T.dmax,l=T.wsize,c=T.whave,h=T.wnext,u=T.window,d=T.hold,f=T.bits,p=T.lencode,g=T.distcode,m=(1<>>24,d>>>=w,f-=w,w=b>>>16&255,0===w)N[a++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=p[(65535&b)+(d&(1<>>=w,f-=w),f<15&&(d+=S[s++]<>>24,d>>>=w,f-=w,w=b>>>16&255,!(16&w)){if(0==(64&w)){b=g[(65535&b)+(d&(1<o){e.msg="invalid distance too far back",T.mode=gt;break e}if(d>>>=w,f-=w,w=a-i,k>w){if(w=k-w,w>c&&T.sane){e.msg="invalid distance too far back",T.mode=gt;break e}if(v=0,I=u,0===h){if(v+=l-w,w2;)N[a++]=I[v++],N[a++]=I[v++],N[a++]=I[v++],y-=3;y&&(N[a++]=I[v++],y>1&&(N[a++]=I[v++]))}else{v=a-k;do{N[a++]=N[v++],N[a++]=N[v++],N[a++]=N[v++],y-=3}while(y>2);y&&(N[a++]=N[v++],y>1&&(N[a++]=N[v++]))}break}}break}}while(s>3,s-=y,f-=y<<3,d&=(1<{const l=o.bits;let c,h,u,d,f,p,g=0,m=0,_=0,b=0,w=0,y=0,k=0,v=0,I=0,S=0,N=null;const T=new Uint16Array(16),E=new Uint16Array(16);let x,A,O,B=null;for(g=0;g<=_t;g++)T[g]=0;for(m=0;m=1&&0===T[b];b--);if(w>b&&(w=b),0===b)return a[i++]=20971520,a[i++]=20971520,o.bits=1,0;for(_=1;_0&&(0===e||1!==b))return-1;for(E[1]=0,g=1;g<_t;g++)E[g+1]=E[g]+T[g];for(m=0;m852||2===e&&I>592)return 1;for(;;){x=g-k,r[m]+1=p?(A=B[r[m]-p],O=N[r[m]-p]):(A=96,O=0),c=1<>k)+h]=x<<24|A<<16|O|0}while(0!==h);for(c=1<>=1;if(0!==c?(S&=c-1,S+=c):S=0,m++,0==--T[g]){if(g===b)break;g=t[s+r[m]]}if(g>w&&(S&d)!==u){for(0===k&&(k=w),f+=_,y=g-k,v=1<852||2===e&&I>592)return 1;u=S&d,a[u]=w<<24|y<<16|f-i|0}}return 0!==S&&(a[f+S]=g-k<<24|64<<16|0),o.bits=w,0};const{Z_FINISH:It,Z_BLOCK:St,Z_TREES:Nt,Z_OK:Tt,Z_STREAM_END:Et,Z_NEED_DICT:xt,Z_STREAM_ERROR:At,Z_DATA_ERROR:Ot,Z_MEM_ERROR:Bt,Z_BUF_ERROR:Ut,Z_DEFLATED:Rt}=q,zt=16180,Dt=16190,Ft=16191,Lt=16192,$t=16194,Ct=16199,jt=16200,Zt=16206,Vt=16209,Mt=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Xt(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Gt=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},Kt=e=>{if(Gt(e))return At;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=zt,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Tt},Pt=e=>{if(Gt(e))return At;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Kt(e)},Ht=(e,t)=>{let s;if(Gt(e))return At;const n=e.state;return t<0?(s=0,t=-t):(s=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?At:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=s,n.wbits=t,Pt(e))},Jt=(e,t)=>{if(!e)return At;const s=new Xt;e.state=s,s.strm=e,s.window=null,s.mode=zt;const n=Ht(e,t);return n!==Tt&&(e.state=null),n};let Wt,Yt,qt=!0;const Qt=e=>{if(qt){Wt=new Int32Array(512),Yt=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(vt(1,e.lens,0,288,Wt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;vt(2,e.lens,0,32,Yt,0,e.work,{bits:5}),qt=!1}e.lencode=Wt,e.lenbits=9,e.distcode=Yt,e.distbits=5},es=(e,t,s,n)=>{let a;const i=e.state;return null===i.window&&(i.wsize=1<=i.wsize?(i.window.set(t.subarray(s-i.wsize,s),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>n&&(a=n),i.window.set(t.subarray(s-n,s-n+a),i.wnext),(n-=a)?(i.window.set(t.subarray(s-n,s),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whaveJt(e,15),inflateInit2:Jt,inflate:(e,t)=>{let s,n,a,i,r,o,l,c,h,u,d,f,p,g,m,_,b,w,y,k,v,I,S=0;const N=new Uint8Array(4);let T,E;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Gt(e)||!e.output||!e.input&&0!==e.avail_in)return At;s=e.state,s.mode===Ft&&(s.mode=Lt),r=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,n=e.input,o=e.avail_in,c=s.hold,h=s.bits,u=o,d=l,I=Tt;e:for(;;)switch(s.mode){case zt:if(0===s.wrap){s.mode=Lt;break}for(;h<16;){if(0===o)break e;o--,c+=n[i++]<>>8&255,s.check=W(s.check,N,2,0),c=0,h=0,s.mode=16181;break}if(s.head&&(s.head.done=!1),!(1&s.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",s.mode=Vt;break}if((15&c)!==Rt){e.msg="unknown compression method",s.mode=Vt;break}if(c>>>=4,h-=4,v=8+(15&c),0===s.wbits&&(s.wbits=v),v>15||v>s.wbits){e.msg="invalid window size",s.mode=Vt;break}s.dmax=1<>8&1),512&s.flags&&4&s.wrap&&(N[0]=255&c,N[1]=c>>>8&255,s.check=W(s.check,N,2,0)),c=0,h=0,s.mode=16182;case 16182:for(;h<32;){if(0===o)break e;o--,c+=n[i++]<>>8&255,N[2]=c>>>16&255,N[3]=c>>>24&255,s.check=W(s.check,N,4,0)),c=0,h=0,s.mode=16183;case 16183:for(;h<16;){if(0===o)break e;o--,c+=n[i++]<>8),512&s.flags&&4&s.wrap&&(N[0]=255&c,N[1]=c>>>8&255,s.check=W(s.check,N,2,0)),c=0,h=0,s.mode=16184;case 16184:if(1024&s.flags){for(;h<16;){if(0===o)break e;o--,c+=n[i++]<>>8&255,s.check=W(s.check,N,2,0)),c=0,h=0}else s.head&&(s.head.extra=null);s.mode=16185;case 16185:if(1024&s.flags&&(f=s.length,f>o&&(f=o),f&&(s.head&&(v=s.head.extra_len-s.length,s.head.extra||(s.head.extra=new Uint8Array(s.head.extra_len)),s.head.extra.set(n.subarray(i,i+f),v)),512&s.flags&&4&s.wrap&&(s.check=W(s.check,n,f,i)),o-=f,i+=f,s.length-=f),s.length))break e;s.length=0,s.mode=16186;case 16186:if(2048&s.flags){if(0===o)break e;f=0;do{v=n[i+f++],s.head&&v&&s.length<65536&&(s.head.name+=String.fromCharCode(v))}while(v&&f>9&1,s.head.done=!0),e.adler=s.check=0,s.mode=Ft;break;case 16189:for(;h<32;){if(0===o)break e;o--,c+=n[i++]<>>=7&h,h-=7&h,s.mode=Zt;break}for(;h<3;){if(0===o)break e;o--,c+=n[i++]<>>=1,h-=1,3&c){case 0:s.mode=16193;break;case 1:if(Qt(s),s.mode=Ct,t===Nt){c>>>=2,h-=2;break e}break;case 2:s.mode=16196;break;case 3:e.msg="invalid block type",s.mode=Vt}c>>>=2,h-=2;break;case 16193:for(c>>>=7&h,h-=7&h;h<32;){if(0===o)break e;o--,c+=n[i++]<>>16^65535)){e.msg="invalid stored block lengths",s.mode=Vt;break}if(s.length=65535&c,c=0,h=0,s.mode=$t,t===Nt)break e;case $t:s.mode=16195;case 16195:if(f=s.length,f){if(f>o&&(f=o),f>l&&(f=l),0===f)break e;a.set(n.subarray(i,i+f),r),o-=f,i+=f,l-=f,r+=f,s.length-=f;break}s.mode=Ft;break;case 16196:for(;h<14;){if(0===o)break e;o--,c+=n[i++]<>>=5,h-=5,s.ndist=1+(31&c),c>>>=5,h-=5,s.ncode=4+(15&c),c>>>=4,h-=4,s.nlen>286||s.ndist>30){e.msg="too many length or distance symbols",s.mode=Vt;break}s.have=0,s.mode=16197;case 16197:for(;s.have>>=3,h-=3}for(;s.have<19;)s.lens[x[s.have++]]=0;if(s.lencode=s.lendyn,s.lenbits=7,T={bits:s.lenbits},I=vt(0,s.lens,0,19,s.lencode,0,s.work,T),s.lenbits=T.bits,I){e.msg="invalid code lengths set",s.mode=Vt;break}s.have=0,s.mode=16198;case 16198:for(;s.have>>24,_=S>>>16&255,b=65535&S,!(m<=h);){if(0===o)break e;o--,c+=n[i++]<>>=m,h-=m,s.lens[s.have++]=b;else{if(16===b){for(E=m+2;h>>=m,h-=m,0===s.have){e.msg="invalid bit length repeat",s.mode=Vt;break}v=s.lens[s.have-1],f=3+(3&c),c>>>=2,h-=2}else if(17===b){for(E=m+3;h>>=m,h-=m,v=0,f=3+(7&c),c>>>=3,h-=3}else{for(E=m+7;h>>=m,h-=m,v=0,f=11+(127&c),c>>>=7,h-=7}if(s.have+f>s.nlen+s.ndist){e.msg="invalid bit length repeat",s.mode=Vt;break}for(;f--;)s.lens[s.have++]=v}}if(s.mode===Vt)break;if(0===s.lens[256]){e.msg="invalid code -- missing end-of-block",s.mode=Vt;break}if(s.lenbits=9,T={bits:s.lenbits},I=vt(1,s.lens,0,s.nlen,s.lencode,0,s.work,T),s.lenbits=T.bits,I){e.msg="invalid literal/lengths set",s.mode=Vt;break}if(s.distbits=6,s.distcode=s.distdyn,T={bits:s.distbits},I=vt(2,s.lens,s.nlen,s.ndist,s.distcode,0,s.work,T),s.distbits=T.bits,I){e.msg="invalid distances set",s.mode=Vt;break}if(s.mode=Ct,t===Nt)break e;case Ct:s.mode=jt;case jt:if(o>=6&&l>=258){e.next_out=r,e.avail_out=l,e.next_in=i,e.avail_in=o,s.hold=c,s.bits=h,mt(e,d),r=e.next_out,a=e.output,l=e.avail_out,i=e.next_in,n=e.input,o=e.avail_in,c=s.hold,h=s.bits,s.mode===Ft&&(s.back=-1);break}for(s.back=0;S=s.lencode[c&(1<>>24,_=S>>>16&255,b=65535&S,!(m<=h);){if(0===o)break e;o--,c+=n[i++]<>w)],m=S>>>24,_=S>>>16&255,b=65535&S,!(w+m<=h);){if(0===o)break e;o--,c+=n[i++]<>>=w,h-=w,s.back+=w}if(c>>>=m,h-=m,s.back+=m,s.length=b,0===_){s.mode=16205;break}if(32&_){s.back=-1,s.mode=Ft;break}if(64&_){e.msg="invalid literal/length code",s.mode=Vt;break}s.extra=15&_,s.mode=16201;case 16201:if(s.extra){for(E=s.extra;h>>=s.extra,h-=s.extra,s.back+=s.extra}s.was=s.length,s.mode=16202;case 16202:for(;S=s.distcode[c&(1<>>24,_=S>>>16&255,b=65535&S,!(m<=h);){if(0===o)break e;o--,c+=n[i++]<>w)],m=S>>>24,_=S>>>16&255,b=65535&S,!(w+m<=h);){if(0===o)break e;o--,c+=n[i++]<>>=w,h-=w,s.back+=w}if(c>>>=m,h-=m,s.back+=m,64&_){e.msg="invalid distance code",s.mode=Vt;break}s.offset=b,s.extra=15&_,s.mode=16203;case 16203:if(s.extra){for(E=s.extra;h>>=s.extra,h-=s.extra,s.back+=s.extra}if(s.offset>s.dmax){e.msg="invalid distance too far back",s.mode=Vt;break}s.mode=16204;case 16204:if(0===l)break e;if(f=d-l,s.offset>f){if(f=s.offset-f,f>s.whave&&s.sane){e.msg="invalid distance too far back",s.mode=Vt;break}f>s.wnext?(f-=s.wnext,p=s.wsize-f):p=s.wnext-f,f>s.length&&(f=s.length),g=s.window}else g=a,p=r-s.offset,f=s.length;f>l&&(f=l),l-=f,s.length-=f;do{a[r++]=g[p++]}while(--f);0===s.length&&(s.mode=jt);break;case 16205:if(0===l)break e;a[r++]=s.length,l--,s.mode=jt;break;case Zt:if(s.wrap){for(;h<32;){if(0===o)break e;o--,c|=n[i++]<{if(Gt(e))return At;let t=e.state;return t.window&&(t.window=null),e.state=null,Tt},inflateGetHeader:(e,t)=>{if(Gt(e))return At;const s=e.state;return 0==(2&s.wrap)?At:(s.head=t,t.done=!1,Tt)},inflateSetDictionary:(e,t)=>{const s=t.length;let n,a,i;return Gt(e)?At:(n=e.state,0!==n.wrap&&n.mode!==Dt?At:n.mode===Dt&&(a=1,a=H(a,t,s,0),a!==n.check)?Ot:(i=es(e,t,s,s),i?(n.mode=16210,Bt):(n.havedict=1,Tt)))},inflateInfo:"pako inflate (from Nodeca project)"};var ss=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 ns=Object.prototype.toString,{Z_NO_FLUSH:as,Z_FINISH:is,Z_OK:rs,Z_STREAM_END:os,Z_NEED_DICT:ls,Z_STREAM_ERROR:cs,Z_DATA_ERROR:hs,Z_MEM_ERROR:us}=q;function ds(e){this.options=Ye.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new tt,this.strm.avail_out=0;let s=ts.inflateInit2(this.strm,t.windowBits);if(s!==rs)throw new Error(Y[s]);if(this.header=new ss,ts.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=et.string2buf(t.dictionary):"[object ArrayBuffer]"===ns.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(s=ts.inflateSetDictionary(this.strm,t.dictionary),s!==rs)))throw new Error(Y[s])}function fs(e,t){const s=new ds(t);if(s.push(e),s.err)throw s.msg||Y[s.err];return s.result}ds.prototype.push=function(e,t){const s=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let i,r,o;if(this.ended)return!1;for(r=t===~~t?t:!0===t?is:as,"[object ArrayBuffer]"===ns.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;;){for(0===s.avail_out&&(s.output=new Uint8Array(n),s.next_out=0,s.avail_out=n),i=ts.inflate(s,r),i===ls&&a&&(i=ts.inflateSetDictionary(s,a),i===rs?i=ts.inflate(s,r):i===hs&&(i=ls));s.avail_in>0&&i===os&&s.state.wrap>0&&0!==e[s.next_in];)ts.inflateReset(s),i=ts.inflate(s,r);switch(i){case cs:case hs:case ls:case us:return this.onEnd(i),this.ended=!0,!1}if(o=s.avail_out,s.next_out&&(0===s.avail_out||i===os))if("string"===this.options.to){let e=et.utf8border(s.output,s.next_out),t=s.next_out-e,a=et.buf2string(s.output,e);s.next_out=t,s.avail_out=n-t,t&&s.output.set(s.output.subarray(e,e+t),0),this.onData(a)}else this.onData(s.output.length===s.next_out?s.output:s.output.subarray(0,s.next_out));if(i!==rs||0!==o){if(i===os)return i=ts.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===s.avail_in)break}}return!0},ds.prototype.onData=function(e){this.chunks.push(e)},ds.prototype.onEnd=function(e){e===rs&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ye.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ps={Inflate:ds,inflate:fs,inflateRaw:function(e,t){return(t=t||{}).raw=!0,fs(e,t)},ungzip:fs,constants:q};const{Deflate:gs,deflate:ms,deflateRaw:_s,gzip:bs}=pt,{Inflate:ws,inflate:ys,inflateRaw:ks,ungzip:vs}=ps;var Is={Deflate:gs,deflate:ms,deflateRaw:_s,gzip:bs,Inflate:ws,inflate:ys,inflateRaw:ks,ungzip:vs,constants:q};function Ss(e){let t=typeof e;if("object"==t){if(Array.isArray(e))return"array";if(null===e)return"null"}return t}let Ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Ts=[];for(let e=0;e>4,0==(128&s))return this.assertBounds(),[e,t];for(let s=3;s<=31;s+=7){let n=this.buf[this.pos++];if(t|=(127&n)<>>n,i=!(a>>>7==0&&0==t),r=255&(i?128|a:a);if(s.push(r),!i)return}const n=e>>>28&15|(7&t)<<4,a=!(t>>3==0);if(s.push(255&(a?128|n:n)),a){for(let e=3;e<31;e+=7){const n=t>>>e,a=!(n>>>7==0),i=255&(a?128|n:n);if(s.push(i),!a)return}s.push(t>>>31&1)}}Ts["-".charCodeAt(0)]=Ns.indexOf("+"),Ts["_".charCodeAt(0)]=Ns.indexOf("/"),function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(s,n,a,i,r)=>{(t(n)?n[e.symbol]:n[e.symbol]=[]).push({no:a,wireType:i,data:r})},e.onWrite=(t,s,n)=>{for(let{no:t,wireType:a,data:i}of e.list(s))n.tag(t,a).raw(i)},e.list=(s,n)=>{if(t(s)){let t=s[e.symbol];return n?t.filter((e=>e.no==n)):t}return[]},e.last=(t,s)=>e.list(t,s).slice(-1)[0];const t=t=>t&&Array.isArray(t[e.symbol])}(Es||(Es={})),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"}(xs||(xs={}));const Bs=4294967296;function Us(e){let t="-"==e[0];t&&(e=e.slice(1));const s=1e6;let n=0,a=0;function i(t,i){const r=Number(e.slice(t,i));a*=s,n=n*s+r,n>=Bs&&(a+=n/Bs|0,n%=Bs)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),[t,n,a]}function Rs(e,t){if(t>>>0<=2097151)return""+(Bs*t+(e>>>0));let s=(e>>>24|t<<8)>>>0&16777215,n=t>>16&65535,a=(16777215&e)+6777216*s+6710656*n,i=s+8147497*n,r=2*n,o=1e7;function l(e,t){let s=e?String(e):"";return t?"0000000".slice(s.length)+s:s}return a>=o&&(i+=Math.floor(a/o),a%=o),i>=o&&(r+=Math.floor(i/o),i%=o),l(r,0)+l(i,r)+l(a,1)}function zs(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let s=0;s<9;s++)t.push(127&e|128),e>>=7;t.push(1)}}function Ds(){let e=this.buf[this.pos++],t=127&e;if(0==(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,0==(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,0==(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,0==(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let t=5;0!=(128&e)&&t<10;t++)e=this.buf[this.pos++];if(0!=(128&e))throw new Error("invalid varint");return this.assertBounds(),t>>>0}let Fs;function Ls(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}!function(){const e=new DataView(new ArrayBuffer(8)),t=void 0!==globalThis.BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64;Fs=t?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}();const $s=/^-?[0-9]+$/,Cs=4294967296,js=2147483648;class Zs{constructor(e,t){this.lo=0|e,this.hi=0|t}isZero(){return 0==this.lo&&0==this.hi}toNumber(){let e=this.hi*Cs+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}}class Vs extends Zs{static from(e){if(Fs)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=Fs.C(e);case"number":if(0===e)return this.ZERO;e=Fs.C(e);case"bigint":if(!e)return this.ZERO;if(eFs.UMAX)throw new Error("ulong too large");return Fs.V.setBigUint64(0,e,!0),new Vs(Fs.V.getInt32(0,!0),Fs.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!$s.test(e))throw new Error("string is no integer");let[t,s,n]=Us(e);if(t)throw new Error("signed value for ulong");return new Vs(s,n);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 Vs(e,e/Cs)}throw new Error("unknown value "+typeof e)}toString(){return Fs?this.toBigInt().toString():Rs(this.lo,this.hi)}toBigInt(){return Ls(Fs),Fs.V.setInt32(0,this.lo,!0),Fs.V.setInt32(4,this.hi,!0),Fs.V.getBigUint64(0,!0)}}Vs.ZERO=new Vs(0,0);class Ms extends Zs{static from(e){if(Fs)switch(typeof e){case"string":if("0"==e)return this.ZERO;if(""==e)throw new Error("string is no integer");e=Fs.C(e);case"number":if(0===e)return this.ZERO;e=Fs.C(e);case"bigint":if(!e)return this.ZERO;if(eFs.MAX)throw new Error("signed long too large");return Fs.V.setBigInt64(0,e,!0),new Ms(Fs.V.getInt32(0,!0),Fs.V.getInt32(4,!0))}else switch(typeof e){case"string":if("0"==e)return this.ZERO;if(e=e.trim(),!$s.test(e))throw new Error("string is no integer");let[t,s,n]=Us(e);if(t){if(n>js||n==js&&0!=s)throw new Error("signed long too small")}else if(n>=js)throw new Error("signed long too large");let a=new Ms(s,n);return t?a.negate():a;case"number":if(0==e)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new Ms(e,e/Cs):new Ms(-e,-e/Cs).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return 0!=(this.hi&js)}negate(){let e=~this.hi,t=this.lo;return t?t=1+~t:e+=1,new Ms(t,e)}toString(){if(Fs)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+Rs(e.lo,e.hi)}return Rs(this.lo,this.hi)}toBigInt(){return Ls(Fs),Fs.V.setInt32(0,this.lo,!0),Fs.V.setInt32(4,this.hi,!0),Fs.V.getBigInt64(0,!0)}}Ms.ZERO=new Ms(0,0);const Xs={readUnknownField:!0,readerFactory:e=>new Gs(e)};class Gs{constructor(e,t){this.varint64=As,this.uint32=Ds,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=null!=t?t:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,s=7&e;if(t<=0||s<0||s>5)throw new Error("illegal tag: field no "+t+" wire type "+s);return[t,s]}skip(e){let t=this.pos;switch(e){case xs.Varint:for(;128&this.buf[this.pos++];);break;case xs.Bit64:this.pos+=4;case xs.Bit32:this.pos+=4;break;case xs.LengthDelimited:let t=this.uint32();this.pos+=t;break;case xs.StartGroup:let s;for(;(s=this.tag()[1])!==xs.EndGroup;)this.skip(s);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(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return new Ms(...this.varint64())}uint64(){return new Vs(...this.varint64())}sint64(){let[e,t]=this.varint64(),s=-(1&e);return e=(e>>>1|(1&t)<<31)^s,t=t>>>1^s,new Ms(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new Vs(this.sfixed32(),this.sfixed32())}sfixed64(){return new Ms(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}}function Ks(e,t){if(!e)throw new Error(t)}function Ps(e){if("number"!=typeof e)throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw new Error("invalid int 32: "+e)}function Hs(e){if("number"!=typeof e)throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw new Error("invalid uint 32: "+e)}function Js(e){if("number"!=typeof e)throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw new Error("invalid float 32: "+e)}const Ws={writeUnknownFields:!0,writerFactory:()=>new Ys};class Ys{constructor(e){this.stack=[],this.textEncoder=null!=e?e:new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let t=0;t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(Hs(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return Ps(e),zs(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){Js(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){Hs(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){Ps(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return Ps(e),zs(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),s=new DataView(t.buffer),n=Ms.from(e);return s.setInt32(0,n.lo,!0),s.setInt32(4,n.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),s=new DataView(t.buffer),n=Vs.from(e);return s.setInt32(0,n.lo,!0),s.setInt32(4,n.hi,!0),this.raw(t)}int64(e){let t=Ms.from(e);return Os(t.lo,t.hi,this.buf),this}sint64(e){let t=Ms.from(e),s=t.hi>>31;return Os(t.lo<<1^s,(t.hi<<1|t.lo>>>31)^s,this.buf),this}uint64(e){let t=Vs.from(e);return Os(t.lo,t.hi,this.buf),this}}const qs={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},Qs={ignoreUnknownFields:!1};const en=Symbol.for("protobuf-ts/message-type");function tn(e){let t=!1;const s=[];for(let n=0;n!n.includes(e))))return!1;if(!s&&n.some((e=>!a.known.includes(e))))return!1;if(t<1)return!0;for(const n of a.oneofs){const a=e[n];if(!on(a))return!1;if(void 0===a.oneofKind)continue;const i=this.fields.find((e=>e.localName===a.oneofKind));if(!i)return!1;if(!this.field(a[a.oneofKind],i,s,t))return!1}for(const n of this.fields)if(void 0===n.oneof&&!this.field(e[n.localName],n,s,t))return!1;return!0}field(e,t,s,n){let a=t.repeat;switch(t.kind){case"scalar":return void 0===e?t.opt:a?this.scalars(e,t.T,n,t.L):this.scalar(e,t.T,t.L);case"enum":return void 0===e?t.opt:a?this.scalars(e,sn.INT32,n):this.scalar(e,sn.INT32);case"message":return void 0===e||(a?this.messages(e,t.T(),s,n):this.message(e,t.T(),s,n));case"map":if("object"!=typeof e||null===e)return!1;if(n<2)return!0;if(!this.mapKeys(e,t.K,n))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,n,t.V.L);case"enum":return this.scalars(Object.values(e),sn.INT32,n);case"message":return this.messages(Object.values(e),t.V.T(),s,n)}}return!0}message(e,t,s,n){return s?t.isAssignable(e,n):t.is(e,n)}messages(e,t,s,n){if(!Array.isArray(e))return!1;if(n<2)return!0;if(s){for(let s=0;sparseInt(e))),t,s);case sn.BOOL:return this.scalars(n.slice(0,s).map((e=>"true"==e||"false"!=e&&e)),t,s);default:return this.scalars(n,t,s,nn.STRING)}}}function cn(e,t){switch(t){case nn.BIGINT:return e.toBigInt();case nn.NUMBER:return e.toNumber();default:return e.toString()}}class hn{constructor(e){this.info=e}prepare(){var e;if(void 0===this.fMap){this.fMap={};const t=null!==(e=this.info.fields)&&void 0!==e?e:[];for(const e of t)this.fMap[e.name]=e,this.fMap[e.jsonName]=e,this.fMap[e.localName]=e}}assert(e,t,s){if(!e){let e=Ss(s);throw"number"!=e&&"boolean"!=e||(e=s.toString()),new Error(`Cannot parse JSON ${e} for ${this.info.typeName}#${t}`)}}read(e,t,s){this.prepare();const n=[];for(const[i,r]of Object.entries(e)){const e=this.fMap[i];if(!e){if(!s.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${i}`);continue}const o=e.localName;let l;if(e.oneof){if(null===r&&("enum"!==e.kind||"google.protobuf.NullValue"!==e.T()[0]))continue;if(n.includes(e.oneof))throw new Error(`Multiple members of the oneof group "${e.oneof}" of ${this.info.typeName} are present in JSON.`);n.push(e.oneof),l=t[e.oneof]={oneofKind:o}}else l=t;if("map"==e.kind){if(null===r)continue;this.assert(null!==(a=r)&&"object"==typeof a&&!Array.isArray(a),e.name,r);const t=l[o];for(const[n,a]of Object.entries(r)){let i;switch(this.assert(null!==a,e.name+" map value",null),e.V.kind){case"message":i=e.V.T().internalJsonRead(a,s);break;case"enum":if(i=this.enum(e.V.T(),a,e.name,s.ignoreUnknownFields),!1===i)continue;break;case"scalar":i=this.scalar(a,e.V.T,e.V.L,e.name)}this.assert(void 0!==i,e.name+" map value",a);let r=n;e.K==sn.BOOL&&(r="true"==r||"false"!=r&&r),r=this.scalar(r,e.K,nn.STRING,e.name).toString(),t[r]=i}}else if(e.repeat){if(null===r)continue;this.assert(Array.isArray(r),e.name,r);const t=l[o];for(const n of r){let a;switch(this.assert(null!==n,e.name,null),e.kind){case"message":a=e.T().internalJsonRead(n,s);break;case"enum":if(a=this.enum(e.T(),n,e.name,s.ignoreUnknownFields),!1===a)continue;break;case"scalar":a=this.scalar(n,e.T,e.L,e.name)}this.assert(void 0!==a,e.name,r),t.push(a)}}else switch(e.kind){case"message":if(null===r&&"google.protobuf.Value"!=e.T().typeName){this.assert(void 0===e.oneof,e.name+" (oneof member)",null);continue}l[o]=e.T().internalJsonRead(r,s,l[o]);break;case"enum":let t=this.enum(e.T(),r,e.name,s.ignoreUnknownFields);if(!1===t)continue;l[o]=t;break;case"scalar":l[o]=this.scalar(r,e.T,e.L,e.name)}}var a}enum(e,t,s,n){if("google.protobuf.NullValue"==e[0]&&Ks(null===t||"NULL_VALUE"===t,`Unable to parse field ${this.info.typeName}#${s}, enum ${e[0]} only accepts null.`),null===t)return 0;switch(typeof t){case"number":return Ks(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${s}, enum can only be integral number, got ${t}.`),t;case"string":let a=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(a=t.substring(e[2].length));let i=e[1][a];return(void 0!==i||!n)&&(Ks("number"==typeof i,`Unable to parse field ${this.info.typeName}#${s}, enum ${e[0]} has no value for "${t}".`),i)}Ks(!1,`Unable to parse field ${this.info.typeName}#${s}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,s,n){let a;try{switch(t){case sn.DOUBLE:case sn.FLOAT:if(null===e)return 0;if("NaN"===e)return Number.NaN;if("Infinity"===e)return Number.POSITIVE_INFINITY;if("-Infinity"===e)return Number.NEGATIVE_INFINITY;if(""===e){a="empty string";break}if("string"==typeof e&&e.trim().length!==e.length){a="extra whitespace";break}if("string"!=typeof e&&"number"!=typeof e)break;let n=Number(e);if(Number.isNaN(n)){a="not a number";break}if(!Number.isFinite(n)){a="too large or small";break}return t==sn.FLOAT&&Js(n),n;case sn.INT32:case sn.FIXED32:case sn.SFIXED32:case sn.SINT32:case sn.UINT32:if(null===e)return 0;let i;if("number"==typeof e?i=e:""===e?a="empty string":"string"==typeof e&&(e.trim().length!==e.length?a="extra whitespace":i=Number(e)),void 0===i)break;return t==sn.UINT32?Hs(i):Ps(i),i;case sn.INT64:case sn.SFIXED64:case sn.SINT64:if(null===e)return cn(Ms.ZERO,s);if("number"!=typeof e&&"string"!=typeof e)break;return cn(Ms.from(e),s);case sn.FIXED64:case sn.UINT64:if(null===e)return cn(Vs.ZERO,s);if("number"!=typeof e&&"string"!=typeof e)break;return cn(Vs.from(e),s);case sn.BOOL:if(null===e)return!1;if("boolean"!=typeof e)break;return e;case sn.STRING:if(null===e)return"";if("string"!=typeof e){a="extra whitespace";break}try{encodeURIComponent(e)}catch(a){a="invalid UTF8";break}return e;case sn.BYTES:if(null===e||""===e)return new Uint8Array(0);if("string"!=typeof e)break;return function(e){let t=3*e.length/4;"="==e[e.length-2]?t-=2:"="==e[e.length-1]&&(t-=1);let s,n=new Uint8Array(t),a=0,i=0,r=0;for(let t=0;t>4,r=s,i=2;break;case 2:n[a++]=(15&r)<<4|(60&s)>>2,r=s,i=3;break;case 3:n[a++]=(3&r)<<6|s,i=0}}if(1==i)throw Error("invalid base64 string.");return n.subarray(0,a)}(e)}}catch(e){a=e.message}this.assert(!1,n+(a?" - "+a:""),e)}}class un{constructor(e){var t;this.fields=null!==(t=e.fields)&&void 0!==t?t:[]}write(e,t){const s={},n=e;for(const e of this.fields){if(!e.oneof){let a=this.field(e,n[e.localName],t);void 0!==a&&(s[t.useProtoFieldName?e.name:e.jsonName]=a);continue}const a=n[e.oneof];if(a.oneofKind!==e.localName)continue;const i="scalar"==e.kind||"enum"==e.kind?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t;let r=this.field(e,a[e.localName],i);Ks(void 0!==r),s[t.useProtoFieldName?e.name:e.jsonName]=r}return s}field(e,t,s){let n;if("map"==e.kind){Ks("object"==typeof t&&null!==t);const a={};switch(e.V.kind){case"scalar":for(const[s,n]of Object.entries(t)){const t=this.scalar(e.V.T,n,e.name,!1,!0);Ks(void 0!==t),a[s.toString()]=t}break;case"message":const n=e.V.T();for(const[i,r]of Object.entries(t)){const t=this.message(n,r,e.name,s);Ks(void 0!==t),a[i.toString()]=t}break;case"enum":const i=e.V.T();for(const[n,r]of Object.entries(t)){Ks(void 0===r||"number"==typeof r);const t=this.enum(i,r,e.name,!1,!0,s.enumAsInteger);Ks(void 0!==t),a[n.toString()]=t}}(s.emitDefaultValues||Object.keys(a).length>0)&&(n=a)}else if(e.repeat){Ks(Array.isArray(t));const a=[];switch(e.kind){case"scalar":for(let s=0;s0||s.emitDefaultValues)&&(n=a)}else switch(e.kind){case"scalar":n=this.scalar(e.T,t,e.name,e.opt,s.emitDefaultValues);break;case"enum":n=this.enum(e.T(),t,e.name,e.opt,s.emitDefaultValues,s.enumAsInteger);break;case"message":n=this.message(e.T(),t,e.name,s)}return n}enum(e,t,s,n,a,i){if("google.protobuf.NullValue"==e[0])return a||n?null:void 0;if(void 0!==t){if(0!==t||a||n)return Ks("number"==typeof t),Ks(Number.isInteger(t)),i||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}else Ks(n)}message(e,t,s,n){return void 0===t?n.emitDefaultValues?null:void 0:e.internalJsonWrite(t,n)}scalar(e,t,s,n,a){if(void 0===t)return void Ks(n);const i=a||n;switch(e){case sn.INT32:case sn.SFIXED32:case sn.SINT32:return 0===t?i?0:void 0:(Ps(t),t);case sn.FIXED32:case sn.UINT32:return 0===t?i?0:void 0:(Hs(t),t);case sn.FLOAT:Js(t);case sn.DOUBLE:return 0===t?i?0:void 0:(Ks("number"==typeof t),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case sn.STRING:return""===t?i?"":void 0:(Ks("string"==typeof t),t);case sn.BOOL:return!1===t?!i&&void 0:(Ks("boolean"==typeof t),t);case sn.UINT64:case sn.FIXED64:Ks("number"==typeof t||"string"==typeof t||"bigint"==typeof t);let e=Vs.from(t);if(e.isZero()&&!i)return;return e.toString();case sn.INT64:case sn.SFIXED64:case sn.SINT64:Ks("number"==typeof t||"string"==typeof t||"bigint"==typeof t);let s=Ms.from(t);if(s.isZero()&&!i)return;return s.toString();case sn.BYTES:return Ks(t instanceof Uint8Array),t.byteLength?function(e){let t,s="",n=0,a=0;for(let i=0;i>2],a=(3&t)<<4,n=1;break;case 1:s+=Ns[a|t>>4],a=(15&t)<<2,n=2;break;case 2:s+=Ns[a|t>>6],s+=Ns[63&t],n=0}return n&&(s+=Ns[a],s+="=",1==n&&(s+="=")),s}(t):i?"":void 0}}}function dn(e,t=nn.STRING){switch(e){case sn.BOOL:return!1;case sn.UINT64:case sn.FIXED64:return cn(Vs.ZERO,t);case sn.INT64:case sn.SFIXED64:case sn.SINT64:return cn(Ms.ZERO,t);case sn.DOUBLE:case sn.FLOAT:return 0;case sn.BYTES:return new Uint8Array(0);case sn.STRING:return"";default:return 0}}class fn{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){const t=null!==(e=this.info.fields)&&void 0!==e?e:[];this.fieldNoToField=new Map(t.map((e=>[e.no,e])))}}read(e,t,s,n){this.prepare();const a=void 0===n?e.len:e.pos+n;for(;e.pose.no-t.no))}}write(e,t,s){this.prepare();for(const n of this.fields){let a,i,r=n.repeat,o=n.localName;if(n.oneof){const t=e[n.oneof];if(t.oneofKind!==o)continue;a=t[o],i=!0}else a=e[o],i=!1;switch(n.kind){case"scalar":case"enum":let e="enum"==n.kind?sn.INT32:n.T;if(r)if(Ks(Array.isArray(a)),r==an.PACKED)this.packed(t,e,n.no,a);else for(const s of a)this.scalar(t,e,n.no,s,!0);else void 0===a?Ks(n.opt):this.scalar(t,e,n.no,a,i||n.opt);break;case"message":if(r){Ks(Array.isArray(a));for(const e of a)this.message(t,s,n.T(),n.no,e)}else this.message(t,s,n.T(),n.no,a);break;case"map":Ks("object"==typeof a&&null!==a);for(const[e,i]of Object.entries(a))this.mapEntry(t,s,n,e,i)}}let n=s.writeUnknownFields;!1!==n&&(!0===n?Es.onWrite:n)(this.info.typeName,e,t)}mapEntry(e,t,s,n,a){e.tag(s.no,xs.LengthDelimited),e.fork();let i=n;switch(s.K){case sn.INT32:case sn.FIXED32:case sn.UINT32:case sn.SFIXED32:case sn.SINT32:i=Number.parseInt(n);break;case sn.BOOL:Ks("true"==n||"false"==n),i="true"==n}switch(this.scalar(e,s.K,1,i,!0),s.V.kind){case"scalar":this.scalar(e,s.V.T,2,a,!0);break;case"enum":this.scalar(e,sn.INT32,2,a,!0);break;case"message":this.message(e,t,s.V.T(),2,a)}e.join()}message(e,t,s,n,a){void 0!==a&&(s.internalBinaryWrite(a,e.tag(n,xs.LengthDelimited).fork(),t),e.join())}scalar(e,t,s,n,a){let[i,r,o]=this.scalarInfo(t,n);o&&!a||(e.tag(s,i),e[r](n))}packed(e,t,s,n){if(!n.length)return;Ks(t!==sn.BYTES&&t!==sn.STRING),e.tag(s,xs.LengthDelimited),e.fork();let[,a]=this.scalarInfo(t);for(let t=0;t("受限"==e?.badge_info?.text&&(e.badge_info.text="",e.badge_info.bg_color="#FB7299",e.badge_info.bg_color_night="#BB5B76"),e?.rights&&(e.rights.allow_dm=1,e.rights.allow_download=1,e.rights.allow_demand=1,e.rights.area_limit=0),e))),kn.log("🎉 Set Episodes",""),e}function An(e={seasonTitle:void 0,seasonId:void 0,epId:void 0,mId:void 0,evaluate:void 0}){switch(kn.log("☑️ Detect Locales",`seasonTitle: ${e.seasonTitle}, seasonId: ${e.seasonId}, epId: ${e.epId}, mId: ${e.mId}`,""),e.seasonTitle){case void 0:case null:e.locales=t(e.mId);break;default:e.locales=function(s){kn.log("☑️ Detect Season Title","");let n=[];switch(kn.log([...e.seasonTitle?.matchAll(/[(\uFF08]([^(\uFF08)\uFF09]+)[)\uFF09]/g)]),[...s?.matchAll(/[(\uFF08]([^(\uFF08)\uFF09]+)[)\uFF09]/g)]?.pop()?.[1]){case"僅限港澳台地區":case"限僅港澳台地區":case"港澳台地區":n=["HKG","MAC","TWN"];break;case"僅限港台地區":n=["HKG","TWN"];break;case"僅限港澳地區":case"僅港澳地區":n=["HKG","MAC"];break;case"僅限台灣地區":n=["TWN"];break;case"僅限港澳台及其他地區":n=["HKG","MAC","TWN","SEA"];break;case"僅限港澳及其他地區":n=["HKG","MAC","SEA"];break;default:n=t(e.mId)}return kn.log(`✅ Detect Season Title, locales: ${n}`,""),n}(e.seasonTitle)}return kn.log(`✅ Detect Locales, locales: ${e.locales}`,""),e.locales;function t(t){kn.log("☑️ Detect mId","");let s=[];switch(t){case 928123:s=["CHN"];break;case 11783021:case 1988098633:case 2042149112:s=["HKG","MAC","TWN"];break;case 15773384:s=["CHN"];break;case 4856007:case 98627270:s=["CHN","HKG","MAC","TWN"];break;default:s=function(e,t){kn.log("☑️ Detect Traditional","");let s=[];s=n(e)>0||n(t)>1?["HKG","MAC","TWN"]:["CHN"];return kn.log(`✅ Detect Traditional, locales: ${s}`,""),s;function n(e=[""]){kn.log("☑️ is the Strings Traditional Chinese?","");const t=/[䊷䋙䝼䰾䲁丟並乾亂亞佇馀併來侖侶俁係俔俠倀倆倈倉個們倫偉側偵偽傑傖傘備傭傯傳傴債傷傾僂僅僉僑僕僞僥僨價儀儂億儈儉儐儔儕儘償優儲儷儺儻儼兌兒兗內兩冊冪凈凍凜凱別刪剄則剋剎剗剛剝剮剴創劃劇劉劊劌劍劑勁動務勛勝勞勢勩勱勵勸勻匭匯匱區協卻厙厠厭厲厴參叄叢吒吳吶呂咼員唄唚問啓啞啟啢喎喚喪喬單喲嗆嗇嗊嗎嗚嗩嗶嘆嘍嘔嘖嘗嘜嘩嘮嘯嘰嘵嘸嘽噓噝噠噥噦噯噲噴噸噹嚀嚇嚌嚕嚙嚦嚨嚲嚳嚴嚶囀囁囂囅囈囑囪圇國圍園圓圖團垵埡埰執堅堊堖堝堯報場塊塋塏塒塗塢塤塵塹墊墜墮墳墻墾壇壈壋壓壘壙壚壞壟壠壢壩壯壺壼壽夠夢夾奐奧奩奪奬奮奼妝姍姦娛婁婦婭媧媯媼媽嫗嫵嫻嫿嬀嬈嬋嬌嬙嬡嬤嬪嬰嬸孌孫學孿宮寢實寧審寫寬寵寶將專尋對導尷屆屍屓屜屢層屨屬岡峴島峽崍崗崢崬嵐嶁嶄嶇嶔嶗嶠嶢嶧嶮嶴嶸嶺嶼巋巒巔巰帥師帳帶幀幃幗幘幟幣幫幬幹幺幾庫廁廂廄廈廚廝廟廠廡廢廣廩廬廳弒弳張強彈彌彎彙彞彥後徑從徠復徵徹恆恥悅悞悵悶惡惱惲惻愛愜愨愴愷愾慄態慍慘慚慟慣慤慪慫慮慳慶憂憊憐憑憒憚憤憫憮憲憶懇應懌懍懟懣懨懲懶懷懸懺懼懾戀戇戔戧戩戰戱戲戶拋拾挩挾捨捫掃掄掗掙掛採揀揚換揮損搖搗搵搶摑摜摟摯摳摶摻撈撏撐撓撝撟撣撥撫撲撳撻撾撿擁擄擇擊擋擓擔據擠擬擯擰擱擲擴擷擺擻擼擾攄攆攏攔攖攙攛攜攝攢攣攤攪攬敗敘敵數斂斃斕斬斷時晉晝暈暉暘暢暫曄曆曇曉曏曖曠曨曬書會朧東杴桿梔梘條梟梲棄棖棗棟棧棲棶椏楊楓楨業極榪榮榲榿構槍槤槧槨槳樁樂樅樓標樞樣樸樹樺橈橋機橢橫檁檉檔檜檟檢檣檮檯檳檸檻櫃櫓櫚櫛櫝櫞櫟櫥櫧櫨櫪櫫櫬櫱櫳櫸櫻欄權欏欒欖欞欽歐歟歡歲歷歸歿殘殞殤殨殫殮殯殲殺殻殼毀毆毿氂氈氌氣氫氬氳決沒沖況洶浹涇涼淚淥淪淵淶淺渙減渦測渾湊湞湯溈準溝溫滄滅滌滎滬滯滲滷滸滻滾滿漁漚漢漣漬漲漵漸漿潁潑潔潙潛潤潯潰潷潿澀澆澇澗澠澤澦澩澮澱濁濃濕濘濟濤濫濰濱濺濼濾瀅瀆瀉瀏瀕瀘瀝瀟瀠瀦瀧瀨瀲瀾灃灄灑灕灘灝灠灣灤灧災為烏烴無煉煒煙煢煥煩煬熅熒熗熱熲熾燁燈燉燒燙燜營燦燭燴燼燾爍爐爛爭爲爺爾牆牘牽犖犢犧狀狹狽猙猶猻獁獄獅獎獨獪獫獮獰獲獵獷獸獺獻獼玀現琺琿瑋瑒瑣瑤瑩瑪瑲璉璣璦璫環璽瓊瓏瓔瓚甌產産畝畢異畵當疇疊痙痾瘂瘋瘍瘓瘞瘡瘧瘮瘲瘺瘻療癆癇癉癘癟癢癤癥癧癩癬癭癮癰癱癲發皚皰皸皺盜盞盡監盤盧眥眾睏睜睞瞘瞜瞞瞶瞼矓矚矯硜硤硨硯碩碭碸確碼磑磚磣磧磯磽礆礎礙礦礪礫礬礱祿禍禎禕禡禦禪禮禰禱禿秈稅稈稟種稱穀穌積穎穠穡穢穩穫穭窩窪窮窯窵窶窺竄竅竇竈竊竪競筆筍筧筴箋箏節範築篋篔篤篩篳簀簍簞簡簣簫簹簽簾籃籌籙籜籟籠籩籪籬籮粵糝糞糧糲糴糶糹糾紀紂約紅紆紇紈紉紋納紐紓純紕紖紗紘紙級紛紜紝紡紬細紱紲紳紵紹紺紼紿絀終組絅絆絎結絕絛絝絞絡絢給絨絰統絲絳絶絹綁綃綆綈綉綌綏經綜綞綠綢綣綫綬維綯綰綱網綳綴綸綹綺綻綽綾綿緄緇緊緋緑緒緓緔緗緘緙線緝緞締緡緣緦編緩緬緯緱緲練緶緹緻縈縉縊縋縐縑縕縗縛縝縞縟縣縧縫縭縮縱縲縳縵縶縷縹總績繃繅繆繒織繕繚繞繡繢繩繪繫繭繮繯繰繳繸繹繼繽繾纈纊續纍纏纓纖纘纜缽罈罌罰罵罷羅羆羈羋羥義習翹耬耮聖聞聯聰聲聳聵聶職聹聽聾肅脅脈脛脫脹腎腖腡腦腫腳腸膃膚膠膩膽膾膿臉臍臏臘臚臟臠臢臨臺與興舉舊艙艤艦艫艱艷芻苎苧茲荊莊莖莢莧華萇萊萬萵葉葒著葤葦葯葷蒓蒔蒞蒼蓀蓋蓮蓯蓴蓽蔔蔞蔣蔥蔦蔭蕁蕆蕎蕒蕓蕕蕘蕢蕩蕪蕭蕷薀薈薊薌薔薘薟薦薩薴薺藍藎藝藥藪藴藶藹藺蘄蘆蘇蘊蘋蘚蘞蘢蘭蘺蘿虆處虛虜號虧虯蛺蛻蜆蝕蝟蝦蝸螄螞螢螻螿蟄蟈蟎蟣蟬蟯蟲蟶蟻蠅蠆蠐蠑蠟蠣蠨蠱蠶蠻衆術衕衚衛衝衹袞裊裏補裝裡製複褌褘褲褳褸褻襇襏襖襝襠襤襪襯襲見覎規覓視覘覡覥覦親覬覯覲覷覺覽覿觀觴觶觸訁訂訃計訊訌討訐訒訓訕訖託記訛訝訟訢訣訥訩訪設許訴訶診註詁詆詎詐詒詔評詖詗詘詛詞詠詡詢詣試詩詫詬詭詮詰話該詳詵詼詿誄誅誆誇誌認誑誒誕誘誚語誠誡誣誤誥誦誨說説誰課誶誹誼誾調諂諄談諉請諍諏諑諒論諗諛諜諝諞諢諤諦諧諫諭諮諱諳諶諷諸諺諼諾謀謁謂謄謅謊謎謐謔謖謗謙謚講謝謠謡謨謫謬謭謳謹謾證譎譏譖識譙譚譜譫譯議譴護譸譽譾讀變讎讒讓讕讖讜讞豈豎豐豬豶貓貝貞貟負財貢貧貨販貪貫責貯貰貲貳貴貶買貸貺費貼貽貿賀賁賂賃賄賅資賈賊賑賒賓賕賙賚賜賞賠賡賢賣賤賦賧質賫賬賭賴賵賺賻購賽賾贄贅贇贈贊贋贍贏贐贓贔贖贗贛贜赬趕趙趨趲跡踐踴蹌蹕蹣蹤蹺躂躉躊躋躍躑躒躓躕躚躡躥躦躪軀車軋軌軍軑軒軔軛軟軤軫軲軸軹軺軻軼軾較輅輇輈載輊輒輓輔輕輛輜輝輞輟輥輦輩輪輬輯輳輸輻輾輿轀轂轄轅轆轉轍轎轔轟轡轢轤辦辭辮辯農逕這連進運過達違遙遜遞遠適遲遷選遺遼邁還邇邊邏邐郟郵鄆鄉鄒鄔鄖鄧鄭鄰鄲鄴鄶鄺酇酈醖醜醞醫醬醱釀釁釃釅釋釐釒釓釔釕釗釘釙針釣釤釧釩釵釷釹釺鈀鈁鈃鈄鈈鈉鈍鈎鈐鈑鈒鈔鈕鈞鈣鈥鈦鈧鈮鈰鈳鈴鈷鈸鈹鈺鈽鈾鈿鉀鉅鉈鉉鉋鉍鉑鉕鉗鉚鉛鉞鉢鉤鉦鉬鉭鉶鉸鉺鉻鉿銀銃銅銍銑銓銖銘銚銛銜銠銣銥銦銨銩銪銫銬銱銳銷銹銻銼鋁鋃鋅鋇鋌鋏鋒鋙鋝鋟鋣鋤鋥鋦鋨鋩鋪鋭鋮鋯鋰鋱鋶鋸鋼錁錄錆錇錈錏錐錒錕錘錙錚錛錟錠錡錢錦錨錩錫錮錯録錳錶錸鍀鍁鍃鍆鍇鍈鍋鍍鍔鍘鍚鍛鍠鍤鍥鍩鍬鍰鍵鍶鍺鎂鎄鎇鎊鎔鎖鎘鎛鎡鎢鎣鎦鎧鎩鎪鎬鎮鎰鎲鎳鎵鎸鎿鏃鏇鏈鏌鏍鏐鏑鏗鏘鏜鏝鏞鏟鏡鏢鏤鏨鏰鏵鏷鏹鏽鐃鐋鐐鐒鐓鐔鐘鐙鐝鐠鐦鐧鐨鐫鐮鐲鐳鐵鐶鐸鐺鐿鑄鑊鑌鑒鑔鑕鑞鑠鑣鑥鑭鑰鑱鑲鑷鑹鑼鑽鑾鑿钁長門閂閃閆閈閉開閌閎閏閑間閔閘閡閣閥閨閩閫閬閭閱閲閶閹閻閼閽閾閿闃闆闈闊闋闌闍闐闒闓闔闕闖關闞闠闡闤闥阪陘陝陣陰陳陸陽隉隊階隕際隨險隱隴隸隻雋雖雙雛雜雞離難雲電霢霧霽靂靄靈靚靜靦靨鞀鞏鞝鞽韁韃韉韋韌韍韓韙韜韞韻響頁頂頃項順頇須頊頌頎頏預頑頒頓頗領頜頡頤頦頭頮頰頲頴頷頸頹頻頽顆題額顎顏顒顓顔願顙顛類顢顥顧顫顬顯顰顱顳顴風颭颮颯颱颳颶颸颺颻颼飀飄飆飈飛飠飢飣飥飩飪飫飭飯飲飴飼飽飾飿餃餄餅餉養餌餎餏餑餒餓餕餖餚餛餜餞餡館餱餳餶餷餺餼餾餿饁饃饅饈饉饊饋饌饑饒饗饜饞饢馬馭馮馱馳馴馹駁駐駑駒駔駕駘駙駛駝駟駡駢駭駰駱駸駿騁騂騅騌騍騎騏騖騙騤騫騭騮騰騶騷騸騾驀驁驂驃驄驅驊驌驍驏驕驗驚驛驟驢驤驥驦驪驫骯髏髒體髕髖髮鬆鬍鬚鬢鬥鬧鬩鬮鬱魎魘魚魛魢魨魯魴魷魺鮁鮃鮊鮋鮍鮎鮐鮑鮒鮓鮚鮜鮝鮞鮦鮪鮫鮭鮮鮳鮶鮺鯀鯁鯇鯉鯊鯒鯔鯕鯖鯗鯛鯝鯡鯢鯤鯧鯨鯪鯫鯴鯷鯽鯿鰁鰂鰃鰈鰉鰍鰏鰐鰒鰓鰜鰟鰠鰣鰥鰨鰩鰭鰮鰱鰲鰳鰵鰷鰹鰺鰻鰼鰾鱂鱅鱈鱉鱒鱔鱖鱗鱘鱝鱟鱠鱣鱤鱧鱨鱭鱯鱷鱸鱺鳥鳧鳩鳬鳲鳳鳴鳶鳾鴆鴇鴉鴒鴕鴛鴝鴞鴟鴣鴦鴨鴯鴰鴴鴷鴻鴿鵁鵂鵃鵐鵑鵒鵓鵜鵝鵠鵡鵪鵬鵮鵯鵲鵷鵾鶄鶇鶉鶊鶓鶖鶘鶚鶡鶥鶩鶪鶬鶯鶲鶴鶹鶺鶻鶼鶿鷀鷁鷂鷄鷈鷊鷓鷖鷗鷙鷚鷥鷦鷫鷯鷲鷳鷸鷹鷺鷽鷿鸇鸌鸏鸕鸘鸚鸛鸝鸞鹵鹹鹺鹽麗麥麩麵麽黃黌點黨黲黶黷黽黿鼉鼴齊齋齎齏齒齔齕齗齙齜齟齠齡齦齪齬齲齶齷龍龎龐龔龕龜]/,s=[...e].map((e=>bool=!!e?.match(t))).reduce(((e,t,s,n)=>e+t));return kn.log("✅ is the Strings Traditional Chinese?",`sumEqual: ${s}`,""),s}}(e.seasonTitle,e.evaluate)}return kn.log(`✅ Detect mId, locales: ${s}`,""),s}}function On(e={seasonTitle:void 0,seasonId:void 0,epId:void 0,mId:void 0,evaluate:void 0},s=[],n={}){kn.log("☑️ Set Cache",`seasonTitle: ${e.seasonTitle}, seasonId: ${e.seasonId}, epId: ${e.epId}, mId: ${e.mId}`,"");let a=!1;return e.locales?.length>0&&(e.seasonId&&n.ss.set(e.seasonId,e.locales),e.epId&&n.ep.set(e.epId,e.locales),s.forEach((t=>n.ep.set(t?.id,e.locales))),n.ss=Array.from(n.ss).slice(-100),n.ep=Array.from(n.ep).slice(-1e3),a=t.setItem("@BiliBili.Global.Caches",n)),kn.log(`✅ Set Cache, locales: ${e.locales}, isSaved: ${a}`,""),a}kn.log(`⚠ FORMAT: ${En}`,""),(async()=>{const{Settings:e,Caches:t,Configs:s}=c("BiliBili","Global",l);switch(kn.log(`⚠ Settings.Switch: ${e?.Switch}`,""),e.Switch){case!0:default:let e={code:0,message:"0",data:{}},s={seasonTitle:vn.searchParams.get("season_title"),seasonId:parseInt(vn.searchParams.get("season_id"),10)||void 0,epId:parseInt(vn.searchParams.get("ep_id"),10)||void 0,mId:parseInt(vn.searchParams.get("mid")||vn.searchParams.get("vmid"),10)||void 0,evaluate:void 0,keyword:vn.searchParams.get("keyword"),locale:vn.searchParams.get("locale"),locales:[],type:"UGC"};switch(En){case void 0:case"application/x-www-form-urlencoded":case"text/plain":default:case"application/x-mpegURL":case"application/x-mpegurl":case"application/vnd.apple.mpegurl":case"audio/mpegurl":case"text/xml":case"text/html":case"text/plist":case"application/xml":case"application/plist":case"application/x-plist":case"text/vtt":case"application/vtt":break;case"text/json":case"application/json":switch(e=JSON.parse($response.body??"{}"),Sn){case"www.bilibili.com":case"app.bilibili.com":case"app.biliapi.net":break;case"api.bilibili.com":case"api.biliapi.net":switch(Nn){case"/pgc/player/api/playurl":case"/pgc/player/web/playurl":case"/pgc/player/web/playurl/html5":case"/pgc/page/bangumi":case"/pgc/page/cinema/tab":s.type="PGC";break;case"/x/player/wbi/playurl":break;case"/x/space/acc/info":case"/x/space/wbi/acc/info":s.mId;break;case"/pgc/view/v2/app/season":let n=e.data;s.seasonTitle=n?.season_title??s.seasonTitle,s.seasonId=n?.season_id??s.seasonId,s.mId=n?.up_info?.mid??s.mId,s.evaluate=n?.evaluate??s.evaluate,s.type="PGC",n?.modules&&(n.modules=function(e=[]){return kn.log("⚠ Set Episodes",""),e=e.map((e=>{switch(e?.style){case"positive":case"section":e.data.episodes=xn(e?.data?.episodes)}return e})),kn.log("🎉 Set Episodes",""),e}(n?.modules)),s.locales=An(s),On(s,function(e=[]){kn.log("⚠ Get Episodes","");let t=e.flatMap((e=>{switch(e?.style){case"positive":case"section":return e?.data?.episodes;default:return[]}}));return kn.log("🎉 Get Episodes",""),t}(n?.modules),t),n?.dialog&&6010001===n?.dialog?.code&&delete n.dialog,n?.rights&&(n.rights.allow_bp=1,n.rights.allow_download=1,n.rights.allow_demand=1,n.rights.area_limit=0);break;case"/pgc/view/web/season":case"/pgc/view/pc/season":let a=e.result;s.seasonTitle=a.season_title??s.seasonTitle,s.seasonId=a.season_id??s.seasonId,s.mId=a.up_info?.mid??s.mId,s.evaluate=a?.evaluate??s.evaluate,s.type="PGC",(a?.episodes||a?.section)&&(a?.episodes&&(a.episodes=xn(a.episodes)),a?.section&&(a.section=xn(a.section))),s.locales=An(s),On(s,a?.episodes,t),a?.rights&&(a.rights.allow_bp=1,a.rights.area_limit=0,a.rights.can_watch=1,a.allow_download=1,a.allow_bp_rank=1)}}$response.body=JSON.stringify(e);break;case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":case"application/grpc":case"application/grpc+proto":case"application/octet-stream":let n=kn.isQuanX()?new Uint8Array($response.bodyBytes??[]):$response.body??new Uint8Array;switch(En){case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":break;case"application/grpc":case"application/grpc+proto":let a=n.slice(0,5);switch(e=n.slice(5),a?.[0]){case 0:break;case 1:e=Is.ungzip(e),a[0]=0}switch(Sn){case"grpc.biliapi.net":case"app.bilibili.com":class n extends yn{constructor(){super("bilibili.app.viewunite.common.Owner",[{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"title",kind:"scalar",T:9},{no:4,name:"fans",kind:"scalar",T:9},{no:5,name:"arc_count",kind:"scalar",T:9},{no:6,name:"attention",kind:"scalar",T:5},{no:7,name:"attention_relation",kind:"scalar",T:5},{no:8,name:"pub_location",kind:"scalar",T:9},{no:10,name:"title_url",kind:"scalar",T:9},{no:11,name:"face",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:3,L:2},{no:15,name:"fans_num",kind:"scalar",T:3,L:2},{no:16,name:"assists",kind:"scalar",repeat:1,T:3,L:2}])}}const a=new n;switch(Tn?.[0]){case"bilibili.app.viewunite.v1.View":class n extends yn{constructor(){super("bilibili.app.viewunite.v1.Arc",[{no:1,name:"aid",kind:"scalar",T:3,L:2},{no:2,name:"cid",kind:"scalar",T:3,L:2},{no:3,name:"duration",kind:"scalar",T:3,L:2},{no:5,name:"bvid",kind:"scalar",T:9},{no:6,name:"copyright",kind:"scalar",T:5},{no:7,name:"right",kind:"message",T:()=>o},{no:8,name:"cover",kind:"scalar",T:9},{no:9,name:"type_id",kind:"scalar",T:3,L:2},{no:10,name:"title",kind:"scalar",T:9}])}}const i=new n;class r extends yn{constructor(){super("bilibili.app.viewunite.v1.Rights",[{no:1,name:"only_vip_download",kind:"scalar",T:8},{no:2,name:"no_reprint",kind:"scalar",T:8},{no:3,name:"download",kind:"scalar",T:8}])}}const o=new r;if("View"===Tn?.[1]){class n extends yn{constructor(){super("bilibili.app.viewunite.v1.ViewReply",[{no:2,name:"arc",kind:"message",T:()=>i},{no:4,name:"owner",kind:"message",T:()=>a},{no:10,name:"report",kind:"map",K:9,V:{kind:"scalar",T:9}}])}}const r=new n;let o=r.fromBinary(e);kn.log(`🚧 data: ${JSON.stringify(o)}`,""),e=r.toBinary(o),s.seasonTitle=o?.arc?.title??o?.supplement?.ogv_data?.title??s.seasonTitle,s.seasonId=parseInt(o?.report?.season_id,10)||o?.supplement?.ogv_data?.season_id||s.seasonId,s.mId=parseInt(o?.report?.up_mid,10)||o?.owner?.mid||s.mId,s.locales=An(s),On(s,[],t)}break;case"bilibili.app.playurl.v1.PlayURL":case"bilibili.app.nativeact.v1.NativeAct":case"bilibili.app.interface.v1.Search":case"bilibili.polymer.app.search.v1.Search":Tn?.[1];break;case"bilibili.pgc.gateway.player.v2.PlayURL":s.type="PGC"}}n=function({header:e,body:t},s){console.log("☑️ Add gRPC Header","");const n="gzip"==s?1:"identity"==s||null==s?0:e?.[0]??0,a=function(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}(t.length);"gzip"==s&&(t=pako.gzip(t));let i=new Uint8Array(e.length+t.length);return i.set([n],0),i.set(a,1),i.set(t,5),console.log("✅ Add gRPC Header",""),i}({header:a,body:e})}$response.body=n}kn.log(`🚧 ${kn.name},信息组, infoGroup: ${JSON.stringify(s)}`,"");case!1:}})().catch((e=>kn.logErr(e))).finally((()=>kn.done($response))); diff --git a/js/BiliIntl.Global.request.beta.js b/js/BiliIntl.Global.request.beta.js index 662ecd6..ba61747 100644 --- a/js/BiliIntl.Global.request.beta.js +++ b/js/BiliIntl.Global.request.beta.js @@ -294,7 +294,7 @@ class $Storage { class ENV { static name = "ENV" - static version = '1.7.4' + static version = '1.8.3' static about() { return console.log(`\n🟧 ${this.name} v${this.version}\n`) } constructor(name, opts) { @@ -309,6 +309,37 @@ class ENV { Object.assign(this, opts); this.log(`\n🚩 开始!\n${name}\n`); } + + environment() { + switch (this.platform()) { + case 'Surge': + $environment.app = 'Surge'; + return $environment + case 'Stash': + $environment.app = 'Stash'; + return $environment + case 'Egern': + $environment.app = 'Egern'; + return $environment + case 'Loon': + let environment = $loon.split(' '); + return { + "device": environment[0], + "ios": environment[1], + "loon-version": environment[2], + "app": "Loon" + }; + case 'Quantumult X': + return { + "app": "Quantumult X" + }; + case 'Node.js': + process.env.app = 'Node.js'; + return process.env + default: + return {} + } + } platform() { if ('undefined' !== typeof $environment && $environment['surge-version']) @@ -390,10 +421,10 @@ class ENV { // 初始化参数 switch (request.constructor) { case Object: - request = { ...request, ...option }; + request = { ...option, ...request }; break; case String: - request = { "url": request, ...option }; + request = { ...option, "url": request }; break; } // 自动判断请求方法 if (!request.method) { @@ -415,9 +446,13 @@ class ENV { case 'Shadowrocket': default: // 转换请求参数 - if (request.policy) { + if (request.timeout) { + request.timeout = parseInt(request.timeout, 10); + if (this.isSurge()) ; else request.timeout = request.timeout * 1000; + } if (request.policy) { if (this.isLoon()) request.node = request.policy; if (this.isStash()) Lodash.set(request, "headers.X-Stash-Selected-Proxy", encodeURI(request.policy)); + if (this.isShadowrocket()) Lodash.set(request, "headers.X-Surge-Proxy", request.policy); } if (typeof request.redirection === "boolean") request["auto-redirect"] = request.redirection; // 转换请求体 if (request.bodyBytes && !request.body) {