From d16a7ceb1590450730afd423e1a1a409a4fe3b58 Mon Sep 17 00:00:00 2001 From: ChenYFan Date: Sat, 23 Jul 2022 04:58:08 +0000 Subject: [PATCH] deploy: e509217724e9740bc9c73775fdc54421787beb36 --- config.yaml | 9 ++++----- cw.js | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/config.yaml b/config.yaml index 33b8e85..3021a22 100644 --- a/config.yaml +++ b/config.yaml @@ -3,6 +3,7 @@ hotpatch: - https://raw.githubusercontent.com/ChenYFan/ClientWorker/gh-pages/cw.js hotconfig: - https://raw.githubusercontent.com/ChenYFan/ClientWorker/gh-pages/config.yaml +cleaninterval: 1000*20 catch_rules: - rule: _ transform_rules: @@ -34,7 +35,7 @@ catch_rules: - search: _ - replace: docroot/clientworker@2.5.3/doc/docs/.vitepress/dist + replace: docroot/clientworker@2.5.2/doc/docs/.vitepress/dist - search: ^https\:\/\/docroot @@ -65,9 +66,8 @@ catch_rules: preflight: false timeout: 5000 cache: - expire: 1000*60 - delay: 200 - expired_delay: 500 + expire: 1000*10 + delay: 3000 - search: \.html$ header: @@ -120,7 +120,6 @@ catch_rules: timeout: 5000 cache: enable: true - expired_delay: 500 expire: 1000*60*60*24*7 delay: 150 diff --git a/cw.js b/cw.js index a62300b..297754d 100644 --- a/cw.js +++ b/cw.js @@ -1,3 +1,3 @@ -(()=>{var __webpack_modules__={385:e=>{e.exports=function(){function e(e,t){this.namespace=e||"CacheDBDefaultNameSpace",this.prefix=t||"CacheDBDefaultPrefix",this.read=async function(e,t){return t=t||{type:"text"},new Promise(((n,r)=>{caches.open(this.namespace).then((r=>{r.match(new Request(`https://${this.prefix}/${encodeURIComponent(e)}`)).then((e=>{switch(t.type){case"json":return void n(e.json());case"arrayBuffer":return void n(e.arrayBuffer());case"blob":return void n(e.blob());default:return void n(e.text())}})).catch((e=>{n(null)}))}))}))},this.write=async function(e,t,n){return n=n||{type:"text"},new Promise(((r,i)=>{caches.open(this.namespace).then((i=>{i.put(new Request(`https://${this.prefix}/${encodeURIComponent(e)}`),new Response(t,{headers:{"Content-Type":(()=>{switch(n.type){case"json":return"application/json";case"arrayBuffer":case"blob":return"application/octet-stream";default:return"text/plain"}})()}})).then(r(!0)).catch((e=>{r(!1)}))}))}))},this.delete=async function(e){return new Promise(((t,n)=>{caches.open(this.namespace).then((n=>{n.delete(new Request(`https://${this.prefix}/${encodeURIComponent(e)}`)).then(t(!0)).catch((e=>{t(!1)}))}))}))}}return e}()},710:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var js_yaml__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(272),_chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(385),_utils_engine_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(671),_package_json__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(147);const router_cgi=async request=>{const db=new _chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__,urlStr=request.url.toString(),urlObj=new URL(urlStr),pathname=urlObj.pathname,q=e=>urlObj.searchParams.get(e);let config;switch(pathname.split("/")[2]){case"hello":return new Response("Hello ClientWorker!");case"info":return new Response(JSON.stringify({version:_package_json__WEBPACK_IMPORTED_MODULE_3__.i8}),{headers:{"Content-Type":"application/json"}});case"page":return"install"===q("type")?fetch("/404"):new Response("Error, page type not found");case"api":switch(q("type")){case"config":return fetch("/config.yaml").then((e=>e.text())).then((e=>js_yaml__WEBPACK_IMPORTED_MODULE_0__.ZP.load(e))).then((async e=>(await db.write("config",JSON.stringify(e),{type:"json"}),new Response("ok")))).catch((async e=>(await db.write("config",""),new Response(e))));case"clear":return caches.open("ClientWorker_ResponseCache").then((async e=>e.keys().then((async t=>(await Promise.all(t.map((t=>{e.delete(t)}))),new Response("ok"))))));case"hotpatch":if(config=JSON.parse(await db.read("config")),"object"!=typeof config.hotpatch)return new Response("Error, config.hotpatch not found");const hotpatch=config.hotpatch;return await _utils_engine_js__WEBPACK_IMPORTED_MODULE_2__.Z.parallel(hotpatch).then((e=>e.text())).then((async script=>{await db.write("hotpatch",script,{type:"text"}),eval(script)})),new Response("ok");case"hotconfig":if(config=JSON.parse(await db.read("config")),"object"!=typeof config.hotconfig)return new Response("Error, config.hotconfig not found");const hotconfig=config.hotconfig,nConfig=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_2__.Z.parallel(hotconfig).then((e=>e.text())).then((e=>js_yaml__WEBPACK_IMPORTED_MODULE_0__.ZP.load(e))).then((e=>JSON.stringify(e))).catch((e=>""));return nConfig&&await db.write("config",nConfig),new Response("ok");default:return new Response("Error, api type not found")}default:return new Response("Not Found!, Client Worker!")}},__WEBPACK_DEFAULT_EXPORT__=router_cgi},755:(__unused_webpack___webpack_module__,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var _cgi_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(710),_chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(385),_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(70),_utils_engine_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(671),_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(431);self.clientworkerhandle=async request=>{const domain=new URL(new Request("").url).host,db=new _chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__;let tReq=request;const urlStr=tReq.url.toString(),urlObj=new URL(urlStr),pathname=urlObj.pathname;if("cw-cgi"===pathname.split("/")[1])return(0,_cgi_js__WEBPACK_IMPORTED_MODULE_0__.Z)(request);const config=await db.read("config",{type:"json"});if(!config)return fetch(request);let tFetched=!1,EngineFetch=!1,EngineFetchList=[],tRes=new Response;for(let catch_rule of config.catch_rules)if("_"===catch_rule.rule&&(catch_rule.rule=domain),tReq.url.match(new RegExp(catch_rule.rule)))for(let transform_rule of catch_rule.transform_rules){let tSearched=!1;switch("_"===transform_rule.search&&(transform_rule.search=catch_rule.rule),transform_rule.searchin||"url"){case"url":tReq.url.match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"header":tReq.headers.get(transform_rule.searchkey).match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"status":if(!tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not fetched yet,the status rule are ignored`);break}String(tRes.status).match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"statusText":if(!tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not fetched yet,the statusText rule are ignored`);break}tRes.statusText.match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"body":if(!tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not fetched yet,the body rule are ignored`);break}(await tRes.clone().text()).match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} the ${transform_rule.searchin} search rule are not supported`)}switch(transform_rule.replacein||"url"){case"url":if(tFetched&&tSearched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is already fetched,the url transform rule:${transform_rule.search} are ignored`);break}if(void 0!==transform_rule.replace&&tSearched)if("string"==typeof transform_rule.replace)EngineFetch&&_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`EngineFetch Disabled for ${tReq.url},the request will downgrade to normal fetch`),tReq=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{url:tReq.url.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}),EngineFetch=!1;else{if(EngineFetch){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`Replacement cannot be used for ${tReq.url},the request is already powered by fetch-engine `);break}transform_rule.replace.forEach((e=>{"_"!==e?EngineFetchList.push(_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{url:tReq.url.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),e)})):EngineFetchList.push(tReq)})),EngineFetch=!0}break;case"body":tSearched&&(tFetched?tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{body:(await tRes.clone().text()).replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}):tReq=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{body:(await tReq.clone().text()).replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}));break;case"status":"string"==typeof transform_rule.replace&&tSearched&&(tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{status:tRes.status.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}));break;case"statusText":"string"==typeof transform_rule.replace&&tSearched&&(tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{statusText:tRes.statusText.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}));break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} the ${transform_rule.replacein} replace rule are not supported`)}if(tSearched){if("object"==typeof transform_rule.header)for(var header in transform_rule.header)tFetched?tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{headers:{[header]:transform_rule.header[header]}}):tReq=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{headers:{[header]:transform_rule.header[header]}});if(void 0!==transform_rule.action)switch(transform_rule.action){case"fetch":if(tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is already fetched,the fetch action are ignored`);break}if(void 0===transform_rule.fetch){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`Fetch Config is not defined for ${tReq.url}`);break}let fetchConfig={status:transform_rule.fetch.status,mode:transform_rule.fetch.mode,credentials:transform_rule.fetch.credentials,redirect:transform_rule.fetch.redirect,timeout:transform_rule.fetch.timeout,threads:transform_rule.fetch.threads,limit:transform_rule.fetch.limit};if(!transform_rule.fetch.preflight)for(var eReq in tReq=new Request(tReq.url,{method:(method=tReq.method,"GET"===method||"HEAD"===method||"POST"===method?method:"GET"),body:(body=tReq.body,"POST"===tReq.method?body:null)}),delete fetchConfig.credentials,EngineFetchList)EngineFetchList[eReq]=new Request(EngineFetchList[eReq].url,tReq);tRes=await Promise.any([new Promise((async(e,t)=>{let n;if(EngineFetch)switch(transform_rule.fetch.engine||"parallel"){case"classic":n=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.classic(EngineFetchList,fetchConfig);break;case"parallel":n=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.parallel(EngineFetchList,fetchConfig),n=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(n,{url:""});break;case"KFCThursdayVW50":4===(new Date).getDay()&&_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e("VW50! The Best Fetch Engine in the World Said!"),n=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.KFCThursdayVW50(EngineFetchList,fetchConfig);break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`Fetch Engine ${transform_rule.fetch.engine} is not supported`)}else switch(transform_rule.fetch.engine||"fetch"){case"fetch":n=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.fetch(tReq,fetchConfig);break;case"crazy":n=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.crazy(tReq,fetchConfig);break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} the ${transform_rule.fetch.engine} engine are not supported`)}"object"==typeof transform_rule.fetch.cache&&n.status===(transform_rule.fetch.status||200)?(n=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(n,{headers:{ClientWorker_CacheTime:(new Date).getTime()}}),caches.open("ClientWorker_ResponseCache").then((t=>{t.put(tReq,n.clone()).then((()=>{e(n)}))}))):e(n)}))],new Promise((async(resolve,reject)=>{"object"==typeof transform_rule.fetch.cache&&setTimeout((()=>{caches.open("ClientWorker_ResponseCache").then((cache=>{cache.match(tReq).then((cRes=>{cRes?Number(cRes.headers.get("ClientWorker_CacheTime"))+eval(transform_rule.fetch.cache.expire||"0")>(new Date).getTime()?(_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`${tReq.url} is timeout for delay ${transform_rule.fetch.cache.delay},so return by cache`),resolve(cRes)):setTimeout((()=>{_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} is too late to fetch,even though the cache has expired,so return by cache`)}),transform_rule.fetch.cache.expired_delay||2800):_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not cached!And it is too late to fetch!`)}))}))}),transform_rule.fetch.cache.delay||200)}))),tFetched=!0;break;case"redirect":if(void 0===transform_rule.redirect)continue;return"string"==typeof transform_rule.redirect.url?Response.redirect(transform_rule.redirect.url,transform_rule.redirect.status||301):Response.redirect(tReq.url.replace(new RegExp(transform_rule.search),transform_rule.redirect.to),transform_rule.redirect.status||301);case"return":return void 0===transform_rule.return&&(transform_rule.return={}),new Response(transform_rule.return.body||"Error!",{status:transform_rule.return.status||503,headers:transform_rule.return.headers||{}});default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`This Action:${transform_rule.action} is not supported yet`)}}}var body,method;return tFetched||(tRes=EngineFetch?await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.classic(EngineFetchList,fetchConfig||{status:200}):await fetch(tReq)),tRes};var __WEBPACK_DEFAULT_EXPORT__={}},70:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={s:e=>{console.log(`%c[SUCCESS]%c ${e}`,"color:white;background:green;","")},w:e=>{console.log(`%c[WARNING]%c ${e}`,"color:brown;background:yellow;","")},i:e=>{console.log(`%c[INFO]%c ${e}`,"color:white;background:blue;","")},e:e=>{console.log(`%c[ERROR]%c ${e}`,"color:white;background:red;","")},d:e=>{console.log(`%c[DEBUG]%c ${e}`,"color:white;background:black;","")}}},671:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(70),i=n(431);Promise.any||(Promise.any=function(e){return new Promise(((t,n)=>{let r=(e=Array.isArray(e)?e:[]).length,i=[];if(0===r)return n(new AggregateError("All promises were rejected"));e.forEach((e=>{e.then((e=>{t(e)}),(e=>{r--,i.push(e),0===r&&n(new AggregateError(i))}))}))}))});const a={fetch:async(e,t)=>(t=t||{status:200},new Promise(((n,r)=>{const i=Object.prototype.toString.call(e);"[object String]"!==i&&"[object Request]"!==i&&r(`FetchEngine.fetch: req must be a string or Request object,but got ${i}`),setTimeout((()=>{r(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Fetch",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3),fetch(e,{mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then((e=>{n(e)})).catch((e=>{r(e)}))}))),crazy:async(e,t)=>{(t=t||{status:200}).threads=t.threads||4,t.trylimit=t.trylimit||10;const n=Object.prototype.toString.call(e);if("[object String]"!==n&&"[object Request]"!==n)return void r.Z.e(`FetchEngine.fetch: req must be a string or Request object,but got ${n}`);const o=new AbortController,s=await fetch(e,{signal:o.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}),c=s.headers,l=c.get("Content-Length");return s.status!==(t.status||200)?new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Crazy",{status:504,statusText:"504 All Gateways Timeout"}):(o.abort(),!l||l{const a=parseInt(l/t.threads),o=[];for(let n=0;n{let c=1;const l=async()=>{c+=1;const o=i.Z.request(e,{headers:{Range:`bytes=${n*a}-${(n+1)*a-1}`},url:e.url});return fetch(o,{mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then((e=>e.arrayBuffer())).catch((e=>{if(!(c>=t.trylimit))return l();r()}))};o(l())})));Promise.all(o).then((e=>{const t=[];for(let n=0;n{r(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Crazy",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3)})))},KFCThursdayVW50:async(e,t)=>{(t=t||{status:200}).threads=t.threads||4,t.trylimit=t.trylimit||10;const n=Object.prototype.toString.call(e);if("[object String]"===n||"[object Request]"===n)return r.Z.w("FetchEngine.KFCThursdayVW50: reqs is a string or Request object,downgrade to crazy"),a.crazy(e,t);if("[object Array]"!==n)return r.Z.e(`FetchEngine.KFCThursdayVW50: reqs must be a string or Request object or an array,but got ${n}`),Promise.reject(`FetchEngine.KFCThursdayVW50: reqs must be a string or Request object or an array,but got ${n}`);if("[object Array]"===n&&(0===e.length&&(r.Z.e("FetchEngine.KFCThursdayVW50: reqs array is empty"),reject()),1===e.length))return r.Z.w("FetchEngine.KFCThursdayVW50: reqs array is only one,downgrade to crazy"),a.crazy(e[0],t);const o=new AbortController,s=await a.parallel(e,{signal:o.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow",timeout:t.timeout||3e4}),c=s.headers,l=c.get("Content-Length");return s.status!==(t.status||200)&&reject(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine KFCThursdayVW50",{status:504,statusText:"504 All Gateways Timeout"})),o.abort(),!l||l{const s=parseInt(l/t.threads),u=[];for(let n=0;n{let u=1;const p=async()=>{u+=1;const c=[];return e.forEach((e=>{c.push(i.Z.request(e,{headers:{Range:`bytes=${n*s}-${(n+1)*s-1}`},url:e.url}))})),a.parallel(c,{mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow",timeout:t.timeout||3e4,status:206}).then((e=>e.arrayBuffer())).catch((async e=>{if(r.Z.e(`FetchEngine.KFCThursdayVW50: ${await e.text()}`),!(u>=t.trylimit))return p();o()}))};c(p())})));Promise.all(u).then((e=>{const t=[];for(let n=0;n{o(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine KFCThursdayVW50",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||3e4)}))},classic:async(e,t)=>new Promise(((n,i)=>{t=t||{status:200};const o=Object.prototype.toString.call(e);"[object String]"===o||"[object Request]"===o?(r.Z.w(`FetchEngine.classic: reqs should be an array,but got ${o},this request will downgrade to normal fetch`),n(a.fetch(e,t))):"[object Array]"!==o?(r.Z.e(`FetchEngine.classic: reqs must be a string , Request or Array object,but got ${o}`),i()):"[object Array]"===o&&(0===o.length&&(r.Z.e("FetchEngine.classic: reqs array is empty"),i()),1===o.length&&(r.Z.w("FetchEngine.classic: reqs array is only one element,this request will downgrade to normal fetch"),n(a.fetch(e[0],t))));const s=new AbortController,c=async e=>new Response(await e.arrayBuffer(),{status:e.status,headers:e.headers,statusText:e.statusText});Promise.any(e.map((e=>{fetch(e,{signal:s.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then(c).then((e=>{e.status==(t.status||200)&&(s.abort(),n(e))})).catch((e=>{"DOMException: The user aborted a request."==e&&console.log()}))}))),setTimeout((()=>{i(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Classic",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3)})),parallel:async(e,t)=>new Promise(((n,i)=>{t=t||{status:200};const o=Object.prototype.toString.call(e);"[object String]"===o||"[object Request]"===o?(r.Z.w(`FetchEngine.parallel: reqs should be an array,but got ${o},this request will downgrade to normal fetch`),n(a.fetch(e,t))):"[object Array]"!==o?(r.Z.e(`FetchEngine.parallel: reqs must be a string , Request or Array object,but got ${o}`),i()):"[object Array]"===o&&(0===o.length&&(r.Z.e("FetchEngine.parallel: reqs array is empty"),i()),1===o.length&&(r.Z.w("FetchEngine.parallel: reqs array is only one element,this request will downgrade to normal fetch"),n(a.fetch(e[0],t))));const s=new Event("abortOtherInstance"),c=new EventTarget;Promise.any(e.map((async e=>{let r=new AbortController,i=!1;c.addEventListener(s.type,(()=>{i||r.abort()})),fetch(e,{signal:r.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then((e=>{e.status==(t.status||200)&&(i=!0,c.dispatchEvent(s),n(e))})).catch((e=>{"DOMException: The user aborted a request."==e&&console.log()}))}))),setTimeout((()=>{i(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Parallel",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3)}))},o=a},431:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(70);const i={request:(e,t)=>{"navigate"===(e=e.clone()).mode&&r.Z.e("You can't rebuild a POST method with body when it is a navigate request.ClientWorker will ignore it's body");let n=new Request(t.body||e.body,{headers:a(e,t.headers),method:t.method||e.method,mode:"navigate"===e.mode?"same-origin":t.mode||e.mode,credentials:t.credentials||e.credentials,redirect:t.redirect||e.redirect});return t.url&&(n=new Request(t.url,n)),n},response:(e,t)=>{e=e.clone();let n=new Response(t.body||e.body,{headers:a(e,t.headers),status:t.status||e.status,statusText:t.statusText||e.statusText});return t.url&&" "!==t.url&&(n=new Response(t.url,n)),n}},a=(e,t)=>{if(t){const n=new Headers(e.headers);for(let e in t)void 0!==t[e]?n.set(e,t[e]):n.delete(e);return n}return new Headers(e.headers)},o=i},272:(e,t,n)=>{"use strict"; +(()=>{var __webpack_modules__={385:e=>{e.exports=function(){function e(e,t){this.namespace=e||"CacheDBDefaultNameSpace",this.prefix=t||"CacheDBDefaultPrefix",this.read=async function(e,t){return t=t||{type:"text"},new Promise(((n,r)=>{caches.open(this.namespace).then((r=>{r.match(new Request(`https://${this.prefix}/${encodeURIComponent(e)}`)).then((e=>{switch(t.type){case"json":return void n(e.json());case"arrayBuffer":return void n(e.arrayBuffer());case"blob":return void n(e.blob());default:return void n(e.text())}})).catch((e=>{n(null)}))}))}))},this.write=async function(e,t,n){return n=n||{type:"text"},new Promise(((r,i)=>{caches.open(this.namespace).then((i=>{i.put(new Request(`https://${this.prefix}/${encodeURIComponent(e)}`),new Response(t,{headers:{"Content-Type":(()=>{switch(n.type){case"json":return"application/json";case"arrayBuffer":case"blob":return"application/octet-stream";default:return"text/plain"}})()}})).then(r(!0)).catch((e=>{r(!1)}))}))}))},this.delete=async function(e){return new Promise(((t,n)=>{caches.open(this.namespace).then((n=>{n.delete(new Request(`https://${this.prefix}/${encodeURIComponent(e)}`)).then(t(!0)).catch((e=>{t(!1)}))}))}))}}return e}()},710:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>__WEBPACK_DEFAULT_EXPORT__});var js_yaml__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(272),_chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(385),_utils_engine_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(671),_package_json__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(147);const router_cgi=async request=>{const db=new _chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__,urlStr=request.url.toString(),urlObj=new URL(urlStr),pathname=urlObj.pathname,q=e=>urlObj.searchParams.get(e);let config;switch(pathname.split("/")[2]){case"hello":return new Response("Hello ClientWorker!");case"info":return new Response(JSON.stringify({version:_package_json__WEBPACK_IMPORTED_MODULE_3__.i8}),{headers:{"Content-Type":"application/json"}});case"page":return"install"===q("type")?fetch("/404"):new Response("Error, page type not found");case"api":switch(q("type")){case"config":return fetch("/config.yaml").then((e=>e.text())).then((e=>js_yaml__WEBPACK_IMPORTED_MODULE_0__.ZP.load(e))).then((async e=>(await db.write("config",JSON.stringify(e),{type:"json"}),new Response("ok")))).catch((async e=>(await db.write("config",""),new Response(e))));case"clear":return caches.open("ClientWorker_ResponseCache").then((async e=>e.keys().then((async t=>(await Promise.all(t.map((t=>{e.delete(t)}))),new Response("ok"))))));case"hotpatch":if(config=JSON.parse(await db.read("config")),"object"!=typeof config.hotpatch)return new Response("Error, config.hotpatch not found");const hotpatch=config.hotpatch;return await _utils_engine_js__WEBPACK_IMPORTED_MODULE_2__.Z.parallel(hotpatch).then((e=>e.text())).then((async script=>{await db.write("hotpatch",script,{type:"text"}),eval(script)})),new Response("ok");case"hotconfig":if(config=JSON.parse(await db.read("config")),"object"!=typeof config.hotconfig)return new Response("Error, config.hotconfig not found");const hotconfig=config.hotconfig,nConfig=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_2__.Z.parallel(hotconfig).then((e=>e.text())).then((e=>js_yaml__WEBPACK_IMPORTED_MODULE_0__.ZP.load(e))).then((e=>JSON.stringify(e))).catch((e=>""));return nConfig&&await db.write("config",nConfig),new Response("ok");default:return new Response("Error, api type not found")}default:return new Response("Not Found!, Client Worker!")}},__WEBPACK_DEFAULT_EXPORT__=router_cgi},755:(__unused_webpack___webpack_module__,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var _cgi_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(710),_chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(385),_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(70),_utils_engine_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(671),_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(431);self.clientworkerhandle=async request=>{const domain=new URL(new Request("").url).host,db=new _chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_1__;let tReq=request;const urlStr=tReq.url.toString(),urlObj=new URL(urlStr),pathname=urlObj.pathname;if("cw-cgi"===pathname.split("/")[1])return(0,_cgi_js__WEBPACK_IMPORTED_MODULE_0__.Z)(request);const config=await db.read("config",{type:"json"});if(!config)return fetch(request);let tFetched=!1,EngineFetch=!1,EngineFetchList=[],tRes=new Response;for(let catch_rule of config.catch_rules)if("_"===catch_rule.rule&&(catch_rule.rule=domain),tReq.url.match(new RegExp(catch_rule.rule)))for(let transform_rule of catch_rule.transform_rules){let tSearched=!1;switch("_"===transform_rule.search&&(transform_rule.search=catch_rule.rule),transform_rule.searchin||"url"){case"url":tReq.url.match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"header":tReq.headers.get(transform_rule.searchkey).match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"status":if(!tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not fetched yet,the status rule are ignored`);break}String(tRes.status).match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"statusText":if(!tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not fetched yet,the statusText rule are ignored`);break}tRes.statusText.match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;case"body":if(!tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not fetched yet,the body rule are ignored`);break}(await tRes.clone().text()).match(new RegExp(transform_rule.search,transform_rule.searchflags))&&(tSearched=!0);break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} the ${transform_rule.searchin} search rule are not supported`)}switch(transform_rule.replacein||"url"){case"url":if(tFetched&&tSearched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is already fetched,the url transform rule:${transform_rule.search} are ignored`);break}if(void 0!==transform_rule.replace&&tSearched)if("string"==typeof transform_rule.replace)EngineFetch&&_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`EngineFetch Disabled for ${tReq.url},the request will downgrade to normal fetch`),tReq=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{url:tReq.url.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}),EngineFetch=!1;else{if(EngineFetch){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`Replacement cannot be used for ${tReq.url},the request is already powered by fetch-engine `);break}transform_rule.replace.forEach((e=>{"_"!==e?EngineFetchList.push(_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{url:tReq.url.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),e)})):EngineFetchList.push(tReq)})),EngineFetch=!0}break;case"body":tSearched&&(tFetched?tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{body:(await tRes.clone().text()).replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}):tReq=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{body:(await tReq.clone().text()).replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}));break;case"status":"string"==typeof transform_rule.replace&&tSearched&&(tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{status:tRes.status.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}));break;case"statusText":"string"==typeof transform_rule.replace&&tSearched&&(tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{statusText:tRes.statusText.replace(new RegExp(transform_rule.replacekey||transform_rule.search,transform_rule.replaceflags),transform_rule.replace)}));break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} the ${transform_rule.replacein} replace rule are not supported`)}if(tSearched){if("object"==typeof transform_rule.header)for(var header in transform_rule.header)tFetched?tRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(tRes,{headers:{[header]:transform_rule.header[header]}}):tReq=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.request(tReq,{headers:{[header]:transform_rule.header[header]}});if(void 0!==transform_rule.action)switch(transform_rule.action){case"fetch":if(tFetched){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is already fetched,the fetch action are ignored`);break}if(void 0===transform_rule.fetch){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`Fetch Config is not defined for ${tReq.url}`);break}let fetchConfig={status:transform_rule.fetch.status,mode:transform_rule.fetch.mode,credentials:transform_rule.fetch.credentials,redirect:transform_rule.fetch.redirect,timeout:transform_rule.fetch.timeout,threads:transform_rule.fetch.threads,limit:transform_rule.fetch.limit};if(!transform_rule.fetch.preflight)for(var eReq in tReq=new Request(tReq.url,{method:(method=tReq.method,"GET"===method||"HEAD"===method||"POST"===method?method:"GET"),body:(body=tReq.body,"POST"===tReq.method?body:null)}),delete fetchConfig.credentials,EngineFetchList)EngineFetchList[eReq]=new Request(EngineFetchList[eReq].url,tReq);tRes=await new Promise((async(res,rej)=>{const EngineFetcher=()=>{let cRes;return new Promise((async(resolve,reject)=>{if(EngineFetch)switch(transform_rule.fetch.engine||"parallel"){case"classic":cRes=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.classic(EngineFetchList,fetchConfig);break;case"parallel":cRes=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.parallel(EngineFetchList,fetchConfig);break;case"KFCThursdayVW50":4===(new Date).getDay()&&_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e("VW50! The Best Fetch Engine in the World Said!"),cRes=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.KFCThursdayVW50(EngineFetchList,fetchConfig);break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`Fetch Engine ${transform_rule.fetch.engine} is not supported`)}else switch(transform_rule.fetch.engine||"fetch"){case"fetch":cRes=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.fetch(tReq,fetchConfig);break;case"crazy":cRes=await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.crazy(tReq,fetchConfig);break;default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} the ${transform_rule.fetch.engine} engine are not supported`)}"object"==typeof transform_rule.fetch.cache&&cRes.status===(transform_rule.fetch.status||200)?(cRes=_utils_rebuild_js__WEBPACK_IMPORTED_MODULE_4__.Z.response(cRes,{headers:{ClientWorker_ExpireTime:(new Date).getTime()+Number(eval(transform_rule.fetch.cache.expire||"0"))}}),caches.open("ClientWorker_ResponseCache").then((e=>{e.put(tReq,cRes.clone()).then((()=>{resolve(cRes)}))}))):resolve(cRes)}))};"object"==typeof transform_rule.fetch.cache&&caches.open("ClientWorker_ResponseCache").then((e=>{e.match(tReq).then((e=>{if(e){if(Number(e.headers.get("ClientWorker_ExpireTime"))>(new Date).getTime())return _utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`${tReq.url} is fetched from cache`),void res(e);_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is expired.`),res(Promise.any([EngineFetcher(),new Promise((async(t,n)=>{setTimeout((()=>{_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.e(`${tReq.url} is too late to fetch,even though the cache has expired,so return by cache`),t(e)}),transform_rule.fetch.cache.delay||3e3)}))]))}else _utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`${tReq.url} is not cached!And it is too late to fetch!`),res(EngineFetcher())}))}))})),tFetched=!0;break;case"redirect":if(void 0===transform_rule.redirect)continue;return"string"==typeof transform_rule.redirect.url?Response.redirect(transform_rule.redirect.url,transform_rule.redirect.status||301):Response.redirect(tReq.url.replace(new RegExp(transform_rule.search),transform_rule.redirect.to),transform_rule.redirect.status||301);case"return":return void 0===transform_rule.return&&(transform_rule.return={}),new Response(transform_rule.return.body||"Error!",{status:transform_rule.return.status||503,headers:transform_rule.return.headers||{}});default:_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w(`This Action:${transform_rule.action} is not supported yet`)}}}var body,method;return tFetched||(tRes=EngineFetch?await _utils_engine_js__WEBPACK_IMPORTED_MODULE_3__.Z.classic(EngineFetchList,fetchConfig||{status:200}):await fetch(tReq)),tRes};var __WEBPACK_DEFAULT_EXPORT__={}},70:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r={s:e=>{console.log(`%c[SUCCESS]%c ${e}`,"color:white;background:green;","")},w:e=>{console.log(`%c[WARNING]%c ${e}`,"color:brown;background:yellow;","")},i:e=>{console.log(`%c[INFO]%c ${e}`,"color:white;background:blue;","")},e:e=>{console.log(`%c[ERROR]%c ${e}`,"color:white;background:red;","")},d:e=>{console.log(`%c[DEBUG]%c ${e}`,"color:white;background:black;","")}}},671:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(70),i=n(431);Promise.any||(Promise.any=function(e){return new Promise(((t,n)=>{let r=(e=Array.isArray(e)?e:[]).length,i=[];if(0===r)return n(new AggregateError("All promises were rejected"));e.forEach((e=>{e.then((e=>{t(e)}),(e=>{r--,i.push(e),0===r&&n(new AggregateError(i))}))}))}))});const a={fetch:async(e,t)=>(t=t||{status:200},new Promise(((n,r)=>{const i=Object.prototype.toString.call(e);"[object String]"!==i&&"[object Request]"!==i&&r(`FetchEngine.fetch: req must be a string or Request object,but got ${i}`),setTimeout((()=>{r(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Fetch",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3),fetch(e,{mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then((e=>{n(e)})).catch((e=>{r(e)}))}))),crazy:async(e,t)=>{(t=t||{status:200}).threads=t.threads||4,t.trylimit=t.trylimit||10;const n=Object.prototype.toString.call(e);if("[object String]"!==n&&"[object Request]"!==n)return void r.Z.e(`FetchEngine.fetch: req must be a string or Request object,but got ${n}`);const o=new AbortController,s=await fetch(e,{signal:o.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}),c=s.headers,l=c.get("Content-Length");return s.status!==(t.status||200)?new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Crazy",{status:504,statusText:"504 All Gateways Timeout"}):(o.abort(),!l||l{const a=parseInt(l/t.threads),o=[];for(let n=0;n{let c=1;const l=async()=>{c+=1;const o=i.Z.request(e,{headers:{Range:`bytes=${n*a}-${(n+1)*a-1}`},url:e.url});return fetch(o,{mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then((e=>e.arrayBuffer())).catch((e=>{if(!(c>=t.trylimit))return l();r()}))};o(l())})));Promise.all(o).then((e=>{const t=[];for(let n=0;n{r(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Crazy",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3)})))},KFCThursdayVW50:async(e,t)=>{(t=t||{status:200}).threads=t.threads||4,t.trylimit=t.trylimit||10;const n=Object.prototype.toString.call(e);if("[object String]"===n||"[object Request]"===n)return r.Z.w("FetchEngine.KFCThursdayVW50: reqs is a string or Request object,downgrade to crazy"),a.crazy(e,t);if("[object Array]"!==n)return r.Z.e(`FetchEngine.KFCThursdayVW50: reqs must be a string or Request object or an array,but got ${n}`),Promise.reject(`FetchEngine.KFCThursdayVW50: reqs must be a string or Request object or an array,but got ${n}`);if("[object Array]"===n&&(0===e.length&&(r.Z.e("FetchEngine.KFCThursdayVW50: reqs array is empty"),reject()),1===e.length))return r.Z.w("FetchEngine.KFCThursdayVW50: reqs array is only one,downgrade to crazy"),a.crazy(e[0],t);const o=new AbortController,s=await a.parallel(e,{signal:o.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow",timeout:t.timeout||3e4}),c=s.headers,l=c.get("Content-Length");return s.status!==(t.status||200)&&reject(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine KFCThursdayVW50",{status:504,statusText:"504 All Gateways Timeout"})),o.abort(),!l||l{const s=parseInt(l/t.threads),u=[];for(let n=0;n{let u=1;const p=async()=>{u+=1;const c=[];return e.forEach((e=>{c.push(i.Z.request(e,{headers:{Range:`bytes=${n*s}-${(n+1)*s-1}`},url:e.url}))})),a.parallel(c,{mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow",timeout:t.timeout||3e4,status:206}).then((e=>e.arrayBuffer())).catch((async e=>{if(r.Z.e(`FetchEngine.KFCThursdayVW50: ${await e.text()}`),!(u>=t.trylimit))return p();o()}))};c(p())})));Promise.all(u).then((e=>{const t=[];for(let n=0;n{o(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine KFCThursdayVW50",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||3e4)}))},classic:async(e,t)=>new Promise(((n,i)=>{t=t||{status:200};const o=Object.prototype.toString.call(e);"[object String]"===o||"[object Request]"===o?(r.Z.w(`FetchEngine.classic: reqs should be an array,but got ${o},this request will downgrade to normal fetch`),n(a.fetch(e,t))):"[object Array]"!==o?(r.Z.e(`FetchEngine.classic: reqs must be a string , Request or Array object,but got ${o}`),i()):"[object Array]"===o&&(0===o.length&&(r.Z.e("FetchEngine.classic: reqs array is empty"),i()),1===o.length&&(r.Z.w("FetchEngine.classic: reqs array is only one element,this request will downgrade to normal fetch"),n(a.fetch(e[0],t))));const s=new AbortController,c=async e=>new Response(await e.arrayBuffer(),{status:e.status,headers:e.headers,statusText:e.statusText});Promise.any(e.map((e=>{fetch(e,{signal:s.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then(c).then((e=>{e.status==(t.status||200)&&(s.abort(),n(e))})).catch((e=>{"DOMException: The user aborted a request."==e&&console.log()}))}))),setTimeout((()=>{i(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Classic",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3)})),parallel:async(e,t)=>new Promise(((n,o)=>{t=t||{status:200};const s=Object.prototype.toString.call(e);"[object String]"===s||"[object Request]"===s?(r.Z.w(`FetchEngine.parallel: reqs should be an array,but got ${s},this request will downgrade to normal fetch`),n(a.fetch(e,t))):"[object Array]"!==s?(r.Z.e(`FetchEngine.parallel: reqs must be a string , Request or Array object,but got ${s}`),o()):"[object Array]"===s&&(0===s.length&&(r.Z.e("FetchEngine.parallel: reqs array is empty"),o()),1===s.length&&(r.Z.w("FetchEngine.parallel: reqs array is only one element,this request will downgrade to normal fetch"),n(a.fetch(e[0],t))));const c=new Event("abortOtherInstance"),l=new EventTarget;Promise.any(e.map((async e=>{let r=new AbortController,a=!1;l.addEventListener(c.type,(()=>{a||r.abort()})),fetch(e,{signal:r.signal,mode:t.mode,credentials:t.credential,redirect:t.redirect||"follow"}).then((e=>{e.status==(t.status||200)&&(a=!0,l.dispatchEvent(c),n(i.Z.response(e,{url:""})))})).catch((e=>{"DOMException: The user aborted a request."==e&&console.log()}))}))),setTimeout((()=>{o(new Response("504 All GateWays Failed,ClientWorker Show This Page,Engine Parallel",{status:504,statusText:"504 All Gateways Timeout"}))}),t.timeout||5e3)}))},o=a},431:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(70);const i={request:(e,t)=>{"navigate"===(e=e.clone()).mode&&r.Z.e("You can't rebuild a POST method with body when it is a navigate request.ClientWorker will ignore it's body");let n=new Request(e,{headers:a(e,t.headers),method:t.method||e.method,mode:"navigate"===e.mode?"same-origin":t.mode||e.mode,credentials:t.credentials||e.credentials,redirect:t.redirect||e.redirect});return t.url&&(n=new Request(t.url,n)),n},response:(e,t)=>{if("opaque"===e.type)return r.Z.e("You can't rebuild a opaque response.ClientWorker will ignore this build"),e;let n=new Response(e.body,{headers:a(e,t.headers),status:t.status||e.status,statusText:t.statusText||e.statusText});return t.url&&(n=new Response(t.url,n)),n}},a=(e,t)=>{if(t){const n=new Headers(e.headers);for(let e in t)void 0!==t[e]?n.set(e,t[e]):n.delete(e);return n}return new Headers(e.headers)},o=i},272:(e,t,n)=>{"use strict"; /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ -function r(e){return null==e}n.d(t,{ZP:()=>et});var i={isNothing:r,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:r(e)?[]:[e]},repeat:function(e,t){var n,r="";for(n=0;ns&&(t=r-s+(a=" ... ").length),n-r>s&&(n=r+s-(o=" ...").length),{str:a+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+a.length}}function l(e,t){return i.repeat(" ",t-e.length)+e}var u=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,a=[0],o=[],s=-1;n=r.exec(e.buffer);)o.push(n.index),a.push(n.index+n[0].length),e.position<=n.index&&s<0&&(s=a.length-2);s<0&&(s=a.length-1);var u,p,_="",f=Math.min(e.line+t.linesAfter,o.length).toString().length,h=t.maxLength-(t.indent+f+3);for(u=1;u<=t.linesBefore&&!(s-u<0);u++)p=c(e.buffer,a[s-u],o[s-u],e.position-(a[s]-a[s-u]),h),_=i.repeat(" ",t.indent)+l((e.line-u+1).toString(),f)+" | "+p.str+"\n"+_;for(p=c(e.buffer,a[s],o[s],e.position,h),_+=i.repeat(" ",t.indent)+l((e.line+1).toString(),f)+" | "+p.str+"\n",_+=i.repeat("-",t.indent+f+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(s+u>=o.length);u++)p=c(e.buffer,a[s+u],o[s+u],e.position-(a[s]-a[s+u]),h),_+=i.repeat(" ",t.indent)+l((e.line+u+1).toString(),f)+" | "+p.str+"\n";return _.replace(/\n$/,"")},p=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_=["scalar","sequence","mapping"];var f=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===p.indexOf(t))throw new s('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===_.indexOf(this.kind))throw new s('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function h(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function d(e){return this.extend(e)}d.prototype.extend=function(e){var t=[],n=[];if(e instanceof f)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new s("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof f))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new s("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof f))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(d.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=h(r,"implicit"),r.compiledExplicit=h(r,"explicit"),r.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),k=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var T=/^[-+]?[0-9]+e/;var v=new f("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!k.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return n=e.toString(10),T.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),j=w.extend({implicit:[E,A,R,v]}),M=j,P=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),x=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var D=new f("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==P.exec(e)||null!==x.exec(e))},construct:function(e){var t,n,r,i,a,o,s,c,l=0,u=null;if(null===(t=P.exec(e))&&(t=x.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,r,i,a,o,s,l)),u&&c.setTime(c.getTime()-u),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var I=new f("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var L=new f("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,a=q;for(n=0;n64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=q,o=0,s=[];for(t=0;t>16&255),s.push(o>>8&255),s.push(255&o)),o=o<<6|a.indexOf(r.charAt(t));return 0===(n=i%4*6)?(s.push(o>>16&255),s.push(o>>8&255),s.push(255&o)):18===n?(s.push(o>>10&255),s.push(o>>2&255)):12===n&&s.push(o>>4&255),new Uint8Array(s)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",i=0,a=e.length,o=q;for(t=0;t>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]),i=(i<<8)+e[t];return 0===(n=a%3)?(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]):2===n?(r+=o[i>>10&63],r+=o[i>>4&63],r+=o[i<<2&63],r+=o[64]):1===n&&(r+=o[i>>2&63],r+=o[i<<4&63],r+=o[64],r+=o[64]),r}}),F=Object.prototype.hasOwnProperty,S=Object.prototype.toString;var W=new f("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,a,o=[],s=e;for(t=0,n=s.length;t>10),56320+(e-65536&1023))}for(var ae=new Array(256),oe=new Array(256),se=0;se<256;se++)ae[se]=re(se)?1:0,oe[se]=re(se);function ce(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||N,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function le(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=u(n),new s(t,n)}function ue(e,t){throw le(e,t)}function pe(e,t){e.onWarning&&e.onWarning.call(null,le(e,t))}var _e={YAML:function(e,t,n){var r,i,a;null!==e.version&&ue(e,"duplication of %YAML directive"),1!==n.length&&ue(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&ue(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&ue(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,1!==a&&2!==a&&pe(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&ue(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],z.test(r)||ue(e,"ill-formed tag handle (first argument) of the TAG directive"),$.call(e.tagMap,r)&&ue(e,'there is a previously declared suffix for "'+r+'" tag handle'),H.test(i)||ue(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){ue(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function fe(e,t,n,r){var i,a,o,s;if(t1&&(e.result+=i.repeat("\n",t-1))}function we(e,t){var n,r,i=e.tag,a=e.anchor,o=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ue(e,"tab characters must not be used in indentation")),45===r)&&ee(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,me(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Ce(e,t,3,!1,!0),o.push(e.result),me(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)ue(e,"bad indentation of a sequence entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt)&&(m&&(o=e.line,s=e.lineStart,c=e.position),Ce(e,t,4,!0,i)&&(m?d=e.result:g=e.result),m||(de(e,_,f,h,d,g,o,s,c),h=d=g=null),me(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&0!==l)ue(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===a?ue(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?ue(e,"repeat of an indentation width identifier"):(p=t+a-1,u=!0)}if(X(o)){do{o=e.input.charCodeAt(++e.position)}while(X(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!Q(o)&&0!==o)}for(;0!==o;){for(ge(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!u||e.lineIndentp&&(p=e.lineIndent),Q(o))_++;else{if(e.lineIndent0){for(i=o,a=0;i>0;i--)(o=ne(s=e.input.charCodeAt(++e.position)))>=0?a=(a<<4)+o:ue(e,"expected hexadecimal character");e.result+=ie(a),e.position++}else ue(e,"unknown escape sequence");n=r=e.position}else Q(s)?(fe(e,n,r,!0),be(e,me(e,!1,t)),n=r=e.position):e.position===e.lineStart&&ye(e)?ue(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}ue(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?m=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!ee(r)&&!te(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&ue(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),$.call(e.anchorMap,n)||ue(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],me(e,!0,-1),!0}(e)?function(e,t,n){var r,i,a,o,s,c,l,u,p=e.kind,_=e.result;if(ee(u=e.input.charCodeAt(e.position))||te(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(ee(r=e.input.charCodeAt(e.position+1))||n&&te(r)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,o=!1;0!==u;){if(58===u){if(ee(r=e.input.charCodeAt(e.position+1))||n&&te(r))break}else if(35===u){if(ee(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&ye(e)||n&&te(u))break;if(Q(u)){if(s=e.line,c=e.lineStart,l=e.lineIndent,me(e,!1,-1),e.lineIndent>=t){o=!0,u=e.input.charCodeAt(e.position);continue}e.position=a,e.line=s,e.lineStart=c,e.lineIndent=l;break}}o&&(fe(e,i,a,!1),be(e,e.line-s),i=a=e.position,o=!1),X(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return fe(e,i,a,!1),!!e.result||(e.kind=p,e.result=_,!1)}(e,f,1===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||ue(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(m=c&&we(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ue(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),l=0,u=e.implicitTypes.length;l"),null!==e.result&&_.kind!==e.kind&&ue(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+_.kind+'", not "'+e.kind+'"'),_.resolve(e.result,e.tag)?(e.result=_.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ue(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function Oe(e){var t,n,r,i,a=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(me(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!ee(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&ue(e,"directive name must not be less than one character in length");0!==i;){for(;X(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!Q(i));break}if(Q(i))break;for(t=e.position;0!==i&&!ee(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&ge(e),$.call(_e,n)?_e[n](e,n,r):pe(e,'unknown document directive "'+n+'"')}me(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,me(e,!0,-1)):o&&ue(e,"directives end mark is expected"),Ce(e,e.lineIndent-1,4,!1,!0),me(e,!0,-1),e.checkLineBreaks&&Y.test(e.input.slice(a,e.position))&&pe(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ye(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,me(e,!0,-1)):e.position=55296&&r<=56319&&t+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function Be(e){return/^\n* /.test(e)}function Ze(e,t,n,r,i,a,o,s){var c,l,u=0,p=null,_=!1,f=!1,h=-1!==r,d=-1,g=Se(l=Ke(e,0))&&l!==je&&!Fe(l)&&45!==l&&63!==l&&58!==l&&44!==l&&91!==l&&93!==l&&123!==l&&125!==l&&35!==l&&38!==l&&42!==l&&33!==l&&124!==l&&61!==l&&62!==l&&39!==l&&34!==l&&37!==l&&64!==l&&96!==l&&function(e){return!Fe(e)&&58!==e}(Ke(e,e.length-1));if(t||o)for(c=0;c=65536?c+=2:c++){if(!Se(u=Ke(e,c)))return 5;g=g&&Ue(u,p,s),p=u}else{for(c=0;c=65536?c+=2:c++){if(10===(u=Ke(e,c)))_=!0,h&&(f=f||c-d-1>r&&" "!==e[d+1],d=c);else if(!Se(u))return 5;g=g&&Ue(u,p,s),p=u}f=f||h&&c-d-1>r&&" "!==e[d+1]}return _||f?n>9&&Be(e)?5:o?2===a?5:2:f?4:3:!g||o||i(e)?2===a?5:2:1}function Ne(e,t,n,r,i){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Pe.indexOf(t)||xe.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=r||e.flowLevel>-1&&n>=e.flowLevel;switch(Ze(t,c,e.indent,o,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n"+$e(t,e.indent)+Ge(qe(function(e,t){var n,r,i=/(\n+)([^\n]*)/g,a=(s=e.indexOf("\n"),s=-1!==s?s:e.length,i.lastIndex=s,Ye(e.slice(0,s),t)),o="\n"===e[0]||" "===e[0];var s;for(;r=i.exec(e);){var c=r[1],l=r[2];n=" "===l[0],a+=c+(o||n||""===l?"":"\n")+Ye(l,t),o=n}return a}(t,o),a));case 5:return'"'+function(e){for(var t,n="",r=0,i=0;i=65536?i+=2:i++)r=Ke(e,i),!(t=Me[r])&&Se(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||De(r);return n}(t)+'"';default:throw new s("impossible error: invalid scalar style")}}()}function $e(e,t){var n=Be(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function Ge(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Ye(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,a=0,o=0,s=0,c="";n=i.exec(e);)(s=n.index)-a>t&&(r=o>a?o:s,c+="\n"+e.slice(a,r),a=r+1),o=s;return c+="\n",e.length-a>t&&o>a?c+=e.slice(a,o)+"\n"+e.slice(o+1):c+=e.slice(a),c.slice(1)}function Ve(e,t,n,r){var i,a,o,s="",c=e.tag;for(i=0,a=n.length;i tag resolver accepts not "'+l+'" style');r=c.represent[l](t,l)}e.dump=r}return!0}return!1}function He(e,t,n,r,i,a,o){e.tag=null,e.dump=n,ze(e,n,!1)||ze(e,n,!0);var c,l=Te.call(e.dump),u=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var p,_,f="[object Object]"===l||"[object Array]"===l;if(f&&(_=-1!==(p=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||_||2!==e.indent&&t>0)&&(i=!1),_&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(f&&_&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===l)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var i,a,o,c,l,u,p="",_=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new s("sortKeys must be a boolean or a function");for(i=0,a=f.length;i1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,l&&(u+=Le(e,t)),He(e,t+1,c,!0,l)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=_,e.dump=p||"{}"}(e,t,e.dump,i),_&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var r,i,a,o,s,c="",l=e.tag,u=Object.keys(n);for(r=0,i=u.length;r1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),He(e,t,o,!1,!1)&&(c+=s+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),_&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===l)r&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?Ve(e,t-1,e.dump,i):Ve(e,t,e.dump,i),_&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var r,i,a,o="",s=e.tag;for(r=0,i=n.length;r",e.dump=c+" "+e.dump)}return!0}function Je(e,t){var n,r,i=[],a=[];for(Qe(e,i,a),n=0,r=a.length;n{"use strict";e.exports={i8:"2.5.3"}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";var _handle_main_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(755),_package_json__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(147),_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(70),_chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(385);_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`ClientWorker${_package_json__WEBPACK_IMPORTED_MODULE_1__.i8} Started!`);const db=new _chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_3__;db.read("hotpatch").then((script=>{script?(_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s("Hotpatch Loaded!"),eval(script)):_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w("Hotpatch Not Found!")})),addEventListener("fetch",(e=>{e.respondWith(self.clientworkerhandle(e.request))})),addEventListener("install",(function(){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`ClientWorker@${_package_json__WEBPACK_IMPORTED_MODULE_1__.i8} Installed!`),self.skipWaiting()})),addEventListener("activate",(function(){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`ClientWorker@${_package_json__WEBPACK_IMPORTED_MODULE_1__.i8} Activated!`),self.clients.claim()}))})()})(); \ No newline at end of file +function r(e){return null==e}n.d(t,{ZP:()=>et});var i={isNothing:r,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:r(e)?[]:[e]},repeat:function(e,t){var n,r="";for(n=0;ns&&(t=r-s+(a=" ... ").length),n-r>s&&(n=r+s-(o=" ...").length),{str:a+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+a.length}}function l(e,t){return i.repeat(" ",t-e.length)+e}var u=function(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,a=[0],o=[],s=-1;n=r.exec(e.buffer);)o.push(n.index),a.push(n.index+n[0].length),e.position<=n.index&&s<0&&(s=a.length-2);s<0&&(s=a.length-1);var u,p,_="",f=Math.min(e.line+t.linesAfter,o.length).toString().length,h=t.maxLength-(t.indent+f+3);for(u=1;u<=t.linesBefore&&!(s-u<0);u++)p=c(e.buffer,a[s-u],o[s-u],e.position-(a[s]-a[s-u]),h),_=i.repeat(" ",t.indent)+l((e.line-u+1).toString(),f)+" | "+p.str+"\n"+_;for(p=c(e.buffer,a[s],o[s],e.position,h),_+=i.repeat(" ",t.indent)+l((e.line+1).toString(),f)+" | "+p.str+"\n",_+=i.repeat("-",t.indent+f+3+p.pos)+"^\n",u=1;u<=t.linesAfter&&!(s+u>=o.length);u++)p=c(e.buffer,a[s+u],o[s+u],e.position-(a[s]-a[s+u]),h),_+=i.repeat(" ",t.indent)+l((e.line+u+1).toString(),f)+" | "+p.str+"\n";return _.replace(/\n$/,"")},p=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],_=["scalar","sequence","mapping"];var f=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===p.indexOf(t))throw new s('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===_.indexOf(this.kind))throw new s('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function h(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function d(e){return this.extend(e)}d.prototype.extend=function(e){var t=[],n=[];if(e instanceof f)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new s("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof f))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new s("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof f))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(d.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=h(r,"implicit"),r.compiledExplicit=h(r,"explicit"),r.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),k=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var v=/^[-+]?[0-9]+e/;var T=new f("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!k.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return n=e.toString(10),v.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"}),j=w.extend({implicit:[E,A,R,T]}),P=j,M=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),x=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var D=new f("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==M.exec(e)||null!==x.exec(e))},construct:function(e){var t,n,r,i,a,o,s,c,l=0,u=null;if(null===(t=M.exec(e))&&(t=x.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,r,i,a,o,s,l)),u&&c.setTime(c.getTime()-u),c},instanceOf:Date,represent:function(e){return e.toISOString()}});var I=new f("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}}),q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var L=new f("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,a=q;for(n=0;n64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=q,o=0,s=[];for(t=0;t>16&255),s.push(o>>8&255),s.push(255&o)),o=o<<6|a.indexOf(r.charAt(t));return 0===(n=i%4*6)?(s.push(o>>16&255),s.push(o>>8&255),s.push(255&o)):18===n?(s.push(o>>10&255),s.push(o>>2&255)):12===n&&s.push(o>>4&255),new Uint8Array(s)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var t,n,r="",i=0,a=e.length,o=q;for(t=0;t>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]),i=(i<<8)+e[t];return 0===(n=a%3)?(r+=o[i>>18&63],r+=o[i>>12&63],r+=o[i>>6&63],r+=o[63&i]):2===n?(r+=o[i>>10&63],r+=o[i>>4&63],r+=o[i<<2&63],r+=o[64]):1===n&&(r+=o[i>>2&63],r+=o[i<<4&63],r+=o[64],r+=o[64]),r}}),F=Object.prototype.hasOwnProperty,S=Object.prototype.toString;var W=new f("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,a,o=[],s=e;for(t=0,n=s.length;t>10),56320+(e-65536&1023))}for(var ae=new Array(256),oe=new Array(256),se=0;se<256;se++)ae[se]=re(se)?1:0,oe[se]=re(se);function ce(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||N,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function le(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=u(n),new s(t,n)}function ue(e,t){throw le(e,t)}function pe(e,t){e.onWarning&&e.onWarning.call(null,le(e,t))}var _e={YAML:function(e,t,n){var r,i,a;null!==e.version&&ue(e,"duplication of %YAML directive"),1!==n.length&&ue(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&ue(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),a=parseInt(r[2],10),1!==i&&ue(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,1!==a&&2!==a&&pe(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&ue(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],z.test(r)||ue(e,"ill-formed tag handle (first argument) of the TAG directive"),$.call(e.tagMap,r)&&ue(e,'there is a previously declared suffix for "'+r+'" tag handle'),H.test(i)||ue(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){ue(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function fe(e,t,n,r){var i,a,o,s;if(t1&&(e.result+=i.repeat("\n",t-1))}function we(e,t){var n,r,i=e.tag,a=e.anchor,o=[],s=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,ue(e,"tab characters must not be used in indentation")),45===r)&&ee(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,me(e,!0,-1)&&e.lineIndent<=t)o.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Ce(e,t,3,!1,!0),o.push(e.result),me(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)ue(e,"bad indentation of a sequence entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt)&&(m&&(o=e.line,s=e.lineStart,c=e.position),Ce(e,t,4,!0,i)&&(m?d=e.result:g=e.result),m||(de(e,_,f,h,d,g,o,s,c),h=d=g=null),me(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&0!==l)ue(e,"bad indentation of a mapping entry");else if(e.lineIndent=0))break;0===a?ue(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?ue(e,"repeat of an indentation width identifier"):(p=t+a-1,u=!0)}if(X(o)){do{o=e.input.charCodeAt(++e.position)}while(X(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!Q(o)&&0!==o)}for(;0!==o;){for(ge(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!u||e.lineIndentp&&(p=e.lineIndent),Q(o))_++;else{if(e.lineIndent0){for(i=o,a=0;i>0;i--)(o=ne(s=e.input.charCodeAt(++e.position)))>=0?a=(a<<4)+o:ue(e,"expected hexadecimal character");e.result+=ie(a),e.position++}else ue(e,"unknown escape sequence");n=r=e.position}else Q(s)?(fe(e,n,r,!0),be(e,me(e,!1,t)),n=r=e.position):e.position===e.lineStart&&ye(e)?ue(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}ue(e,"unexpected end of the stream within a double quoted scalar")}(e,f)?m=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!ee(r)&&!te(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&ue(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),$.call(e.anchorMap,n)||ue(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],me(e,!0,-1),!0}(e)?function(e,t,n){var r,i,a,o,s,c,l,u,p=e.kind,_=e.result;if(ee(u=e.input.charCodeAt(e.position))||te(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(ee(r=e.input.charCodeAt(e.position+1))||n&&te(r)))return!1;for(e.kind="scalar",e.result="",i=a=e.position,o=!1;0!==u;){if(58===u){if(ee(r=e.input.charCodeAt(e.position+1))||n&&te(r))break}else if(35===u){if(ee(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&ye(e)||n&&te(u))break;if(Q(u)){if(s=e.line,c=e.lineStart,l=e.lineIndent,me(e,!1,-1),e.lineIndent>=t){o=!0,u=e.input.charCodeAt(e.position);continue}e.position=a,e.line=s,e.lineStart=c,e.lineIndent=l;break}}o&&(fe(e,i,a,!1),be(e,e.line-s),i=a=e.position,o=!1),X(u)||(a=e.position+1),u=e.input.charCodeAt(++e.position)}return fe(e,i,a,!1),!!e.result||(e.kind=p,e.result=_,!1)}(e,f,1===n)&&(m=!0,null===e.tag&&(e.tag="?")):(m=!0,null===e.tag&&null===e.anchor||ue(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===d&&(m=c&&we(e,h))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&ue(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),l=0,u=e.implicitTypes.length;l"),null!==e.result&&_.kind!==e.kind&&ue(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+_.kind+'", not "'+e.kind+'"'),_.resolve(e.result,e.tag)?(e.result=_.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):ue(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||m}function Oe(e){var t,n,r,i,a=e.position,o=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(me(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(o=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!ee(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&ue(e,"directive name must not be less than one character in length");0!==i;){for(;X(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!Q(i));break}if(Q(i))break;for(t=e.position;0!==i&&!ee(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&ge(e),$.call(_e,n)?_e[n](e,n,r):pe(e,'unknown document directive "'+n+'"')}me(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,me(e,!0,-1)):o&&ue(e,"directives end mark is expected"),Ce(e,e.lineIndent-1,4,!1,!0),me(e,!0,-1),e.checkLineBreaks&&Y.test(e.input.slice(a,e.position))&&pe(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ye(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,me(e,!0,-1)):e.position=55296&&r<=56319&&t+1=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function Be(e){return/^\n* /.test(e)}function Ze(e,t,n,r,i,a,o,s){var c,l,u=0,p=null,_=!1,f=!1,h=-1!==r,d=-1,g=Se(l=Ke(e,0))&&l!==je&&!Fe(l)&&45!==l&&63!==l&&58!==l&&44!==l&&91!==l&&93!==l&&123!==l&&125!==l&&35!==l&&38!==l&&42!==l&&33!==l&&124!==l&&61!==l&&62!==l&&39!==l&&34!==l&&37!==l&&64!==l&&96!==l&&function(e){return!Fe(e)&&58!==e}(Ke(e,e.length-1));if(t||o)for(c=0;c=65536?c+=2:c++){if(!Se(u=Ke(e,c)))return 5;g=g&&Ue(u,p,s),p=u}else{for(c=0;c=65536?c+=2:c++){if(10===(u=Ke(e,c)))_=!0,h&&(f=f||c-d-1>r&&" "!==e[d+1],d=c);else if(!Se(u))return 5;g=g&&Ue(u,p,s),p=u}f=f||h&&c-d-1>r&&" "!==e[d+1]}return _||f?n>9&&Be(e)?5:o?2===a?5:2:f?4:3:!g||o||i(e)?2===a?5:2:1}function Ne(e,t,n,r,i){e.dump=function(){if(0===t.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==Me.indexOf(t)||xe.test(t)))return 2===e.quotingType?'"'+t+'"':"'"+t+"'";var a=e.indent*Math.max(1,n),o=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),c=r||e.flowLevel>-1&&n>=e.flowLevel;switch(Ze(t,c,e.indent,o,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n"+$e(t,e.indent)+Ge(qe(function(e,t){var n,r,i=/(\n+)([^\n]*)/g,a=(s=e.indexOf("\n"),s=-1!==s?s:e.length,i.lastIndex=s,Ye(e.slice(0,s),t)),o="\n"===e[0]||" "===e[0];var s;for(;r=i.exec(e);){var c=r[1],l=r[2];n=" "===l[0],a+=c+(o||n||""===l?"":"\n")+Ye(l,t),o=n}return a}(t,o),a));case 5:return'"'+function(e){for(var t,n="",r=0,i=0;i=65536?i+=2:i++)r=Ke(e,i),!(t=Pe[r])&&Se(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||De(r);return n}(t)+'"';default:throw new s("impossible error: invalid scalar style")}}()}function $e(e,t){var n=Be(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function Ge(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function Ye(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,a=0,o=0,s=0,c="";n=i.exec(e);)(s=n.index)-a>t&&(r=o>a?o:s,c+="\n"+e.slice(a,r),a=r+1),o=s;return c+="\n",e.length-a>t&&o>a?c+=e.slice(a,o)+"\n"+e.slice(o+1):c+=e.slice(a),c.slice(1)}function Ve(e,t,n,r){var i,a,o,s="",c=e.tag;for(i=0,a=n.length;i tag resolver accepts not "'+l+'" style');r=c.represent[l](t,l)}e.dump=r}return!0}return!1}function He(e,t,n,r,i,a,o){e.tag=null,e.dump=n,ze(e,n,!1)||ze(e,n,!0);var c,l=ve.call(e.dump),u=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var p,_,f="[object Object]"===l||"[object Array]"===l;if(f&&(_=-1!==(p=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||_||2!==e.indent&&t>0)&&(i=!1),_&&e.usedDuplicates[p])e.dump="*ref_"+p;else{if(f&&_&&!e.usedDuplicates[p]&&(e.usedDuplicates[p]=!0),"[object Object]"===l)r&&0!==Object.keys(e.dump).length?(!function(e,t,n,r){var i,a,o,c,l,u,p="",_=e.tag,f=Object.keys(n);if(!0===e.sortKeys)f.sort();else if("function"==typeof e.sortKeys)f.sort(e.sortKeys);else if(e.sortKeys)throw new s("sortKeys must be a boolean or a function");for(i=0,a=f.length;i1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,l&&(u+=Le(e,t)),He(e,t+1,c,!0,l)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",p+=u+=e.dump));e.tag=_,e.dump=p||"{}"}(e,t,e.dump,i),_&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var r,i,a,o,s,c="",l=e.tag,u=Object.keys(n);for(r=0,i=u.length;r1024&&(s+="? "),s+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),He(e,t,o,!1,!1)&&(c+=s+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,t,e.dump),_&&(e.dump="&ref_"+p+" "+e.dump));else if("[object Array]"===l)r&&0!==e.dump.length?(e.noArrayIndent&&!o&&t>0?Ve(e,t-1,e.dump,i):Ve(e,t,e.dump,i),_&&(e.dump="&ref_"+p+e.dump)):(!function(e,t,n){var r,i,a,o="",s=e.tag;for(r=0,i=n.length;r",e.dump=c+" "+e.dump)}return!0}function Je(e,t){var n,r,i=[],a=[];for(Qe(e,i,a),n=0,r=a.length;n{"use strict";e.exports={i8:"2.6.0"}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";var _handle_main_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(755),_package_json__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(147),_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(70),_chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(385);_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`ClientWorker${_package_json__WEBPACK_IMPORTED_MODULE_1__.i8} Started!`);const db=new _chenyfan_cache_db__WEBPACK_IMPORTED_MODULE_3__;db.read("hotpatch").then((script=>{script?(_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s("Hotpatch Loaded!"),eval(script)):_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.w("Hotpatch Not Found!")})),db.read("config").then((config=>{config=JSON.parse(config)||{},setInterval((()=>{_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`ClientWorker@${_package_json__WEBPACK_IMPORTED_MODULE_1__.i8} Start to Clean Expired Cache!`),caches.open("ClientWorker_ResponseCache").then((e=>{e.keys().then((t=>{t.forEach((t=>{e.match(t).then((n=>{Number(n.headers.get("ClientWorker_ExpireTime"))<=(new Date).getTime()&&e.delete(t)}))}))}))}))}),eval(config.cleaninterval)||6e4)})),addEventListener("fetch",(e=>{e.respondWith(self.clientworkerhandle(e.request))})),addEventListener("install",(function(){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`ClientWorker@${_package_json__WEBPACK_IMPORTED_MODULE_1__.i8} Installed!`),self.skipWaiting()})),addEventListener("activate",(function(){_utils_cons_js__WEBPACK_IMPORTED_MODULE_2__.Z.s(`ClientWorker@${_package_json__WEBPACK_IMPORTED_MODULE_1__.i8} Activated!`),self.clients.claim()}))})()})(); \ No newline at end of file