sinzmise-cetastories-en 2.0.0-1731236813758 → 2.0.0-1731239057774
Sign up to get free protection for your applications and to get access to all the features.
- package/archives/2023/12/index.html +1 -1
- package/archives/2023/index.html +1 -1
- package/archives/index.html +1 -1
- package/atom.xml +2 -2
- package/baidu_verify_codeva-NA6uDlCuZg.html +1 -1
- package/categories/Test/index.html +1 -1
- package/categories/index.html +1 -1
- package/content.json +1 -1
- package/games +2 -2
- package/google8073542809160a67.html +1 -1
- package/index.html +1 -1
- package/maps/sw.js.map +1 -1
- package/package.json +1 -1
- package/posts/46521/index.html +1 -1
- package/sw.js +1 -1
- package/tags/Test/index.html +1 -1
- package/tags/index.html +1 -1
package/maps/sw.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"../sw.js","names":["prefix","cacheSuffixVersion","CACHE_NAME","PreCachlist","NPMMirror","NPMPackage","NPMPackageVersion","debug","handleFetch","async","event","url","request","test","NetworkOnly","CacheFirst","CacheAlways","cdn","gh","jsdelivr","fastly","gcore","testingcf","test1","storisinz","webcache","combine","npm","unpkg","eleme","cdnjs","baomitu","bytedance","sustech","cdn_match_list","type","key","push","_console","console","color","black","red","green","yellow","blue","magenta","cyan","white","add","arr","fi","length","first","other","concat","createlog","util","args","log","apply","creategroup","groupCollapsed","colorUtils","bold","str","colorHash","wait","error","warn","ready","info","createChalk","name","firstToUpperCase","strArr","createChalkBg","createChalkGroup","chalk","group","end","groupEnd","bg","Object","keys","forEach","toLowerCase","replace","L","toUpperCase","i","self","logger","generate_uuid","c","r","Math","random","toString","db","read","config","Promise","resolve","reject","caches","open","then","cache","match","Request","encodeURIComponent","res","text","catch","write","value","put","Response","compareVersion","a","b","v1","split","v2","len","max","num1","parseInt","num2","mirrors","getLocalVersion","mirror_time","setNewestVersion","f","fetch","FetchEngine","json","version","stack","setInterval","setTimeout","installFunction","index","response","addEventListener","skipWaiting","waitUntil","all","map","includes","delete","clients","claim","respondWith","URL","pathname","resp","CacheRuntime","matchCache","matchCDN","method","protocol","clone","req","nav","navigator","saveData","effectiveType","connection","mozConnection","webkitConnection","urls","pathType","pathTestRes","RegExp","location","origin","fullPath","item","exec","ext","pop","contentType","getContentType","arrayBuffer","buffer","headers","endsWith","list","indexOf","progress","status","createPromiseAny","any","promises","Array","isArray","errs","AggregateError","p","err","fetchAny","reqs","controller","AbortController","signal","abort","fetchParallel","abortEvent","Event","eventTarget","EventTarget","tagged","dispatchEvent","e"],"sources":["sw.js"],"mappings":"AACA,MAAMA,OAAS,0BACTC,mBAAqB,+BACrBC,WAAaF,OAAS,KAAOC,mBAC7BE,YAAc,CAClB,iBACA,aACA,sBAEF,IAAIC,WAAY,EAChB,MAAMC,WAAa,0BACnB,IAAIC,kBAAoB,SACpBC,OAAQ,EAEZ,MAAMC,YAAcC,MAAOC,IACzB,MAAMC,EAAMD,EAAME,QAAQD,IAC1B,MAAI,iBAAiBE,KAAKF,IAEf,uBAAuBE,KAAKF,IAE5B,cAAcE,KAAKF,IAEnB,6BAA6BE,KAAKF,GALpCG,YAAYJ,GAOV,UAAUG,KAAKF,GACjBI,WAAWL,GACT,yBAAyBG,KAAKF,IAE9B,kBAAkBE,KAAKF,IAEvB,mBAAmBE,KAAKF,IAExB,4BAA4BE,KAAKF,IAEjC,gBAAgBE,KAAKF,IAErB,qBAAqBE,KAAKF,IAE1B,aAAaE,KAAKF,IAElB,gEAAgEE,KAAKF,IAErE,gBAAgBE,KAAKF,GAfvBK,YAAYN,GAkBZK,WAAWL,EACpB,EAEIO,IAAM,CACVC,GAAI,CACFC,SAAU,8BACVC,OAAQ,iCACRC,MAAO,gCACPC,UAAW,oCACXC,MAAO,gCACPC,UAAW,oCACXC,SAAU,+BAEZC,QAAS,CACPP,SAAU,mCACVC,OAAQ,sCACRC,MAAO,qCACPC,UAAW,yCACXC,MAAO,qCACPC,UAAW,0CAEbG,IAAK,CACHR,SAAU,+BACVC,OAAQ,kCACRC,MAAO,iCACPC,UAAW,qCACXC,MAAO,iCACPK,MAAO,oBACPC,MAAO,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ACH,MAAO,gCACT,IAAK,MACH,MAAO,gBACT,IAAK,MACH,MAAO,oBACT,IAAK,MACH,MAAO,iBACT,IAAK,OACH,MAAO,aACT,IAAK,MAEL,IAAK,OAEL,IAAK,OACH,MAAO,eACT,IAAK,KAEL,IAAK,MACH,MAAO,cACT,IAAK,MAEL,IAAK,OAEL,IAAK,MACH,MAAO,aAGX","ignoreList":[],"sourcesContent":["// 全站打包上传 npm,sw 并发请求 cdn\nconst prefix = 'sinzmise-cetastories-en';\nconst cacheSuffixVersion = '00000018-0.36280778211976106';\nconst CACHE_NAME = prefix + '-v' + cacheSuffixVersion;\nconst PreCachlist = [\n \"/css/style.css\",\n \"/js/app.js\",\n \"/js/search/hexo.js\",\n];\nlet NPMMirror = true;\nconst NPMPackage = \"sinzmise-cetastories-en\";\nlet NPMPackageVersion = \"latest\";\nlet debug = true;\n// location.hostname == 'localhost' && (debug = true) && (NPMMirror = false);\nconst handleFetch = async (event) => {\n const url = event.request.url;\n if (/hm\\.baidu\\.com/.test(url)) {\n return NetworkOnly(event)\n } else if (/collect-perf\\.51\\.la/.test(url)) {\n return NetworkOnly(event)\n } else if (/sdk\\.51\\.la/.test(url)) {\n return NetworkOnly(event)\n } else if (/www\\.google-analytics\\.com/.test(url)) {\n return NetworkOnly(event)\n } else if (/@latest/.test(url)) {\n return CacheFirst(event)\n } else if (/cdnjs\\.cloudflare\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/music\\.126\\.net/.test(url)) {\n return CacheAlways(event)\n } else if (/qqmusic\\.qq\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/jsd\\.cdn\\.storisinz\\.site/.test(url)) {\n return CacheAlways(event)\n } else if (/jsdelivr\\.net/.test(url)) {\n return CacheAlways(event)\n } else if (/npm\\.elemecdn\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/unpkg\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/.*\\.(?:png|jpg|jpeg|svg|gif|webp|ico|eot|ttf|woff|woff2|mp3)$/.test(url)) {\n return CacheAlways(event)\n } else if (/.*\\.(css|js)$/.test(url)) {\n return CacheAlways(event)\n } else {\n return CacheFirst(event)\n }\n}\nconst cdn = {\n gh: {\n jsdelivr: 'https://cdn.jsdelivr.net/gh',\n fastly: 'https://fastly.jsdelivr.net/gh',\n gcore: 'https://gcore.jsdelivr.net/gh',\n testingcf: 'https://testingcf.jsdelivr.net/gh',\n test1: 'https://test1.jsdelivr.net/gh',\n storisinz: 'https://jsd.cdn.storisinz.site/gh',\n webcache: 'https://code.webcache.cn/gh',\n },\n combine: {\n jsdelivr: 'https://cdn.jsdelivr.net/combine',\n fastly: 'https://fastly.jsdelivr.net/combine',\n gcore: 'https://gcore.jsdelivr.net/combine',\n testingcf: 'https://testingcf.jsdelivr.net/combine',\n test1: 'https://test1.jsdelivr.net/combine',\n storisinz: 'https://jsd.cdn.storisinz.site/combine',\n },\n npm: {\n jsdelivr: 'https://cdn.jsdelivr.net/npm',\n fastly: 'https://fastly.jsdelivr.net/npm',\n gcore: 'https://gcore.jsdelivr.net/npm',\n testingcf: 'https://testingcf.jsdelivr.net/npm',\n test1: 'https://test1.jsdelivr.net/npm',\n unpkg: 'https://unpkg.com',\n eleme: 'https://npm.elemecdn.com',\n storisinz: 'https://jsd.cdn.storisinz.site/npm',\n webcache: 'https://npm.webcache.cn',\n },\n cdnjs: {\n cdnjs: 'https://cdnjs.cloudflare.com/ajax/libs',\n baomitu: 'https://lib.baomitu.com',\n bytedance: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M',\n sustech: 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs',\n webcache: 'https://cdnjs.webstatic.cn/ajax/libs',\n }\n}\nconst cdn_match_list = []\nfor (const type in cdn) {\n for (const key in cdn[type]) {\n cdn_match_list.push({ type: type, key: cdn[type][key] })\n }\n}\nconst _console = console;\nconst color = {\n black: '#000000',\n red: '#FF0000',\n green: '#008000',\n yellow: '#FFFF00',\n blue: '#0000FF',\n magenta: '#FF00FF',\n cyan: '#00FFFF',\n white: '#FFFFFF',\n};\nconst add = (...arr) => {\n let fi = [\n []\n ];\n for (let key = 0; key < arr.length; key++) {\n const [first, ...other] = arr[key];\n fi[0] += first;\n fi = fi.concat(other);\n }\n return fi;\n};\nconst createlog = (util) => (...args) => {\n // const fun = _console[util] ? _console[util] : _console.log;\n const fun = util == \"error\" ? _console[util] : _console.log;\n fun.apply(void 0, args);\n};\nconst creategroup = (util) => (...args) => {\n const fun = _console.groupCollapsed;\n fun.apply(void 0, args);\n};\nconst colorUtils = {\n bold: (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return `${str};font-weight: bold;`;\n }\n for (let key = 1; key < str.length; key++) {\n str[key] += `;font-weight: bold;`;\n }\n return str;\n }\n};\nconst colorHash = {\n log: 'black',\n wait: 'cyan',\n error: 'red',\n warn: 'yellow',\n ready: 'green',\n info: 'blue',\n event: 'magenta',\n};\nconst createChalk = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n createlog(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n createlog(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst createChalkBg = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n createlog(name)(...add(colorUtils.bold(colorUtils[`bg${firstToUpperCase(colorHash[name])}`](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n createlog(name)(...add(colorUtils.bold(colorUtils[`bg${firstToUpperCase(colorHash[name])}`](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst createChalkGroup = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n creategroup(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n creategroup(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst chalk = {\n group: {\n end: _console.groupEnd\n },\n bg: {}\n};\nObject.keys(colorHash).forEach(key => {\n chalk[key] = createChalk(key);\n chalk.group[key] = createChalkGroup(key);\n chalk.bg[key] = createChalkBg(key);\n});\nconst firstToUpperCase = (str) => str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());\nObject.keys(color).forEach(key => {\n colorUtils[key] = (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return [`%c${str}`, `color:${color[key]}`];\n }\n for (let i = 1; i < str.length; i++) {\n str[i] += `;color:${color[key]}`;\n }\n return str;\n };\n colorUtils[`bg${firstToUpperCase(key)}`] = (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return [`%c${str}`, `padding: 2px 4px; border-radius: 3px; color: ${key === 'white' ? '#000' : '#fff'}; font-weight: bold; background:${color[key]};`];\n }\n for (let i = 1; i < str.length; i++) {\n str[i] += `;padding: 2px 4px; border-radius: 3px; font-weight: bold; background:${color[key]};`;\n }\n return str;\n };\n});\nself.logger = {\n add,\n ...chalk,\n ...colorUtils,\n};\n\nif (!debug) {\n logger = {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n group: {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n end: () => { },\n },\n bg: {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n }\n };\n console.log = () => { };\n}\n\nconst generate_uuid = () => {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\nself.db = {\n read: (key, config) => {\n if (!config) { config = { type: \"text\" } }\n return new Promise((resolve, reject) => {\n caches.open(CACHE_NAME).then(cache => {\n cache.match(new Request(`https://LOCALCACHE/${encodeURIComponent(key)}`)).then(function (res) {\n if (!res) resolve(null)\n res.text().then(text => resolve(text))\n }).catch(() => {\n resolve(null)\n })\n })\n })\n },\n write: (key, value) => {\n return new Promise((resolve, reject) => {\n caches.open(CACHE_NAME).then(function (cache) {\n cache.put(new Request(`https://LOCALCACHE/${encodeURIComponent(key)}`), new Response(value));\n resolve()\n }).catch(() => {\n reject()\n })\n })\n }\n}\nconst compareVersion = (a, b) => {\n let v1 = a.split('.');\n let v2 = b.split('.');\n const len = Math.max(v1.length, v2.length);\n while (v1.length < len) {\n v1.push('0');\n }\n while (v2.length < len) {\n v2.push('0');\n }\n for (let i = 0; i < len; i++) {\n const num1 = parseInt(v1[i]);\n const num2 = parseInt(v2[i]);\n if (num1 > num2) {\n return a;\n } else if (num1 < num2) {\n return b;\n }\n }\n return a;\n}\n\nconst mirrors = [\n `https://registry.npmjs.org/${NPMPackage}/latest`,\n `https://mirrors.cloud.tencent.com/npm/${NPMPackage}/latest`\n]\nconst getLocalVersion = async () => {\n NPMPackageVersion = await db.read('blog_version') || NPMPackageVersion\n logger.bg.info(`Local Version: ${NPMPackage}@${NPMPackageVersion}`)\n}\nlet mirror_time = 0;\nconst setNewestVersion = async () => {\n if (!NPMMirror) {\n return\n }\n let f = null;\n if (!(mirror_time % (mirrors.length + 1))) {\n f = FetchEngine(mirrors);\n } else {\n f = fetch(mirrors[(mirror_time % (mirrors.length + 1)) - 1]);\n }\n mirror_time++;\n return f\n .then(res => res.json())\n .then(async res => {\n if (!res.version) throw ('No Version Found!')\n NPMPackageVersion = compareVersion(res.version, await db.read('blog_version') || NPMPackageVersion)\n logger.bg.ready(`${NPMPackage}@${NPMPackageVersion}`)\n await db.write('blog_version', NPMPackageVersion)\n })\n .catch(error => {\n logger.error('[Set Newest Version] ' + (error.stack || error))\n })\n}\nsetInterval(async () => {\n await setNewestVersion()\n}, 60 * 1000);\nsetTimeout(async () => {\n await setNewestVersion()\n}, 5000)\nconst installFunction = async () => {\n await getLocalVersion();\n return caches.open(CACHE_NAME + \"-precache\")\n .then(async function (cache) {\n if (!await db.read('uuid')) {\n await db.write('uuid', generate_uuid())\n }\n if (PreCachlist.length) {\n logger.group.event(`Precaching ${PreCachlist.length} files.`);\n let index = 0;\n PreCachlist.forEach(function (url) {\n cache.match(new Request(url)).then(function (response) {\n if (response) {\n logger.ready(`Precaching ${url}`);\n } else {\n logger.wait(`Precaching ${url}`);\n cache.add(new Request(url));\n }\n index++;\n if (index === PreCachlist.length) {\n logger.ready(`Precached ${PreCachlist.length} files.`);\n logger.group.end();\n }\n })\n })\n }\n }).catch((error) => {\n logger.error('[install] ' + (error.stack || error));\n })\n}\nself.addEventListener('install', async function (event) {\n logger.bg.event(\"service worker install event listening\");\n try {\n self.skipWaiting();\n event.waitUntil(installFunction());\n logger.bg.ready('service worker install sucess!');\n } catch (error) {\n logger.error('[install] ' + (error.stack || error));\n }\n});\nself.addEventListener('activate', async event => {\n logger.bg.event(\"service worker activate event listening\");\n try {\n event.waitUntil(\n caches.keys().then((keys) => {\n return Promise.all(keys.map((key) => {\n if (!key.includes(cacheSuffixVersion)) {\n caches.delete(key);\n logger.bg.ready('Deleted Outdated Cache: ' + key);\n }\n }));\n }).catch((error) => {\n logger.error('[activate] ' + (error.stack || error));\n })\n );\n await self.clients.claim()\n logger.bg.ready('service worker activate sucess!');\n } catch (error) {\n logger.error('[activate] ' + (error.stack || error));\n }\n})\nself.addEventListener('fetch', async event => {\n event.respondWith(\n handleFetch(event).catch((error) => {\n logger.error('[fetch] ' + event.request.url + '\\n[error] ' + (error.stack || error));\n })\n )\n});\n\n\nconst NetworkOnly = async (event) => {\n logger.group.info('NetworkOnly: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n logger.group.end();\n return fetch(event.request)\n}\nconst CacheFirst = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('CacheFirst: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n event.waitUntil(CacheRuntime(event.request))\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\nconst CacheAlways = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('CacheAlways: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\n\nconst matchCache = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\nasync function CacheRuntime(request) {\n const url = new URL(request.url);\n let response = await matchCDN(request);\n if (!response) {\n response = await fetch(request).catch(() => null)\n }\n logger.group.event(`Cache Runtime ${url.pathname}`);\n logger.wait(`Caching url: ${request.url}`);\n console.log(response);\n\n if (request.method === \"GET\" && (url.protocol == \"https:\")) {\n const cache = await caches.open(CACHE_NAME + \"-runtime\");\n cache.put(request, response.clone()).catch(error => {\n logger.error('[Cache Runtime] ' + (error.stack || error));\n if (error.name === 'QuotaExceededError') {\n caches.delete(CACHE_NAME + \"-runtime\");\n logger.ready(\"deleted cache\")\n }\n })\n logger.ready(`Cached url: ${request.url}`);\n } else {\n logger.warn(`Not Cached url: ${request.url}`);\n }\n logger.group.end();\n return response;\n}\n\nconst matchCDN = async (req) => {\n const nav = navigator\n const { saveData, effectiveType } = nav.connection || nav.mozConnection || nav.webkitConnection || {}\n if (saveData || /2g/.test(effectiveType)) {\n logger.warn(\"Slow Network: Transparent Proxy\");\n return fetch(req);\n }\n const urls = []\n let urlObj = new URL(req.url)\n let pathType = urlObj.pathname.split('/')[1]\n let pathTestRes = \"\";\n\n if (NPMMirror && new RegExp(location.origin).test(req.url)) {\n logger.group.ready(`Match NPM Mirror: ` + req.url);\n for (const key in cdn.npm) {\n let url = cdn.npm[key] + \"/\" + NPMPackage + \"@\" + NPMPackageVersion + req.url.replace(location.origin, '')\n url = fullPath(fullPath(url))\n console.log(url);\n urls.push(url)\n }\n logger.group.end()\n }\n if (!urls.length) {\n for (const item of cdn_match_list) {\n if (new RegExp(item.key).test(req.url)) {\n pathType = item.type\n pathTestRes = new RegExp(item.key).exec(req.url)[0]\n break;\n }\n }\n for (const type in cdn) {\n if (type === pathType) {\n logger.group.ready(`Match CDN ${pathType}: ` + req.url);\n for (const key in cdn[type]) {\n const url = cdn[type][key] + req.url.replace(pathTestRes, '')\n console.log(url);\n urls.push(url)\n }\n logger.group.end()\n }\n }\n }\n\n let res;\n if (urls.length)\n res = FetchEngine(urls)\n else\n res = fetch(req)\n if (res && NPMMirror && new RegExp(location.origin).test(req.url)) {\n const ext = fullPath(fullPath(req.url)).split('.').pop()\n const contentType = getContentType(ext)\n res = res\n .then(res => res.arrayBuffer())\n .then(buffer => new Response(buffer, {\n headers: {\n \"Content-Type\": contentType\n }\n }))\n .catch(() => null)\n }\n return res\n}\n\nconst fullPath = (url) => {\n url = url.split('?')[0].split('#')[0]\n if (url.endsWith('/')) {\n url += 'index.html'\n } else {\n const list = url.split('/')\n const last = list[list.length - 1]\n if (last.indexOf('.') === -1) {\n url += '.html'\n }\n }\n return url\n}\nasync function progress(res) {\n return new Response(await res.arrayBuffer(), {\n status: res.status,\n headers: res.headers\n })\n}\n\nfunction createPromiseAny() {\n Promise.any = function (promises) {\n return new Promise((resolve, reject) => {\n promises = Array.isArray(promises) ? promises : []\n let len = promises.length\n let errs = []\n if (len === 0) return reject(new AggregateError('All promises were rejected'))\n promises.forEach((p) => {\n if (p instanceof Promise) {\n p.then(\n (res) => resolve(res),\n (err) => {\n len--\n errs.push(err)\n if (len === 0) reject(new AggregateError(errs))\n }\n )\n } else {\n reject(p)\n }\n })\n })\n }\n}\n\nfunction fetchAny(reqs) {\n const controller = new AbortController()\n\n return reqs.map(req => {\n return new Promise((resolve, reject) => {\n fetch(req, {\n signal: controller.signal\n })\n .then(progress)\n .then(res => {\n controller.abort()\n if (res.status !== 200)\n reject(null)\n else\n resolve(res)\n })\n .catch(() => reject(null))\n })\n })\n}\n\nfunction fetchParallel(reqs) {\n const abortEvent = new Event(\"abortOtherInstance\")\n const eventTarget = new EventTarget();\n\n return reqs.map(async req => {\n const controller = new AbortController();\n let tagged = false;\n eventTarget.addEventListener(abortEvent.type, () => {\n if (!tagged) controller.abort();\n })\n return new Promise((resolve, reject) => {\n fetch(req, {\n signal: controller.signal,\n }).then(res => {\n tagged = true;\n eventTarget.dispatchEvent(abortEvent)\n if (res.status !== 200)\n reject(null)\n else\n resolve(res)\n }).catch(() => reject(null))\n })\n });\n}\n\nconst FetchEngine = (reqs) => {\n if (!Promise.any) createPromiseAny();\n return Promise.any(fetchParallel(reqs)).then(res => res)\n .catch((e) => {\n if (e == \"AggregateError: All promises were rejected\") {\n return Promise.any(fetchAny(reqs))\n .then((res) => res)\n .catch(() => null);\n }\n return null;\n });\n};\n\nconst getContentType = (ext) => {\n switch (ext) {\n case 'js':\n return 'text/javascript'\n case 'html':\n return 'text/html'\n case 'css':\n return 'text/css'\n case 'json':\n return 'application/json'\n case 'webp':\n return 'image/webp'\n case 'jpg':\n return 'image/jpg'\n case 'jpeg':\n return 'image/jpeg'\n case 'png':\n return 'image/png'\n case 'gif':\n return 'image/gif'\n case 'xml':\n return 'text/xml'\n case 'xsl':\n return 'text/xml'\n case 'webmanifest':\n return 'text/webmanifest'\n case 'map':\n return 'application/json'\n case 'bcmap':\n return 'image/vnd.wap.wbmp'\n case 'wbmp':\n return 'image/vnd.wap.wbmp'\n case 'bmp':\n return 'image/bmp'\n case 'ico':\n return 'image/vnd.microsoft.icon'\n case 'tiff':\n return 'image/tiff'\n case 'tif':\n return 'image/tiff'\n case 'svg':\n return 'image/svg+xml'\n case 'svgz':\n return 'image/svg+xml'\n case 'woff':\n return 'application/font-woff'\n case 'woff2':\n return 'application/font-woff2'\n case 'ttf':\n return 'application/font-ttf'\n case 'otf':\n return 'application/font-otf'\n case 'eot':\n return 'application/vnd.ms-fontobject'\n case 'zip':\n return 'application/zip'\n case 'tar':\n return 'application/x-tar'\n case 'gz':\n return 'application/gzip'\n case 'bz2':\n return 'application/x-bzip2'\n case 'rar':\n return 'application/x-rar-compressed'\n case '7z':\n return 'application/x-7z-compressed'\n case 'doc':\n return 'application/msword'\n case 'docx':\n return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n case 'xls':\n return 'application/vnd.ms-excel'\n case 'xlsx':\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n case 'ppt':\n return 'application/vnd.ms-powerpoint'\n case 'pptx':\n return 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n case 'pdf':\n return 'application/pdf'\n case 'txt':\n return 'text/plain'\n case 'rtf':\n return 'application/rtf'\n case 'mp3':\n return 'audio/mpeg'\n case 'wav':\n return 'audio/x-wav'\n case 'ogg':\n return 'audio/ogg'\n case 'mp4':\n return 'video/mp4'\n case 'm4v':\n return 'video/x-m4v'\n case 'mov':\n return 'video/quicktime'\n case 'avi':\n return 'video/x-msvideo'\n case 'wmv':\n return 'video/x-ms-wmv'\n case 'flv':\n return 'video/x-flv'\n case 'swf':\n return 'application/x-shockwave-flash'\n case 'mpg':\n return 'video/mpeg'\n case 'mpeg':\n return 'video/mpeg'\n case 'mpe':\n return 'video/mpeg'\n case 'mpv':\n return 'video/mpeg'\n case 'm2v':\n return 'video/mpeg'\n case 'm4a':\n return 'audio/mp4'\n case 'aac':\n return 'audio/aac'\n case 'm3u':\n return 'audio/x-mpegurl'\n case 'm3u8':\n return 'application/vnd.apple.mpegurl'\n case 'pls':\n return 'audio/x-scpls'\n case 'cue':\n return 'application/x-cue'\n case 'wma':\n return 'audio/x-ms-wma'\n case 'flac':\n return 'audio/flac'\n case 'aif':\n return 'audio/x-aiff'\n case 'aiff':\n return 'audio/x-aiff'\n case 'aifc':\n return 'audio/x-aiff'\n case 'au':\n return 'audio/basic'\n case 'snd':\n return 'audio/basic'\n case 'mid':\n return 'audio/midi'\n case 'midi':\n return 'audio/midi'\n case 'kar':\n return 'audio/midi'\n default:\n return 'text/plain'\n }\n}"]}
|
1
|
+
{"version":3,"file":"../sw.js","names":["prefix","cacheSuffixVersion","CACHE_NAME","PreCachlist","NPMMirror","NPMPackage","NPMPackageVersion","debug","handleFetch","async","event","url","request","test","NetworkOnly","CacheFirst","CacheAlways","cdn","gh","jsdelivr","fastly","gcore","testingcf","test1","storisinz","webcache","combine","npm","unpkg","eleme","cdnjs","baomitu","bytedance","sustech","cdn_match_list","type","key","push","_console","console","color","black","red","green","yellow","blue","magenta","cyan","white","add","arr","fi","length","first","other","concat","createlog","util","args","log","apply","creategroup","groupCollapsed","colorUtils","bold","str","colorHash","wait","error","warn","ready","info","createChalk","name","firstToUpperCase","strArr","createChalkBg","createChalkGroup","chalk","group","end","groupEnd","bg","Object","keys","forEach","toLowerCase","replace","L","toUpperCase","i","self","logger","generate_uuid","c","r","Math","random","toString","db","read","config","Promise","resolve","reject","caches","open","then","cache","match","Request","encodeURIComponent","res","text","catch","write","value","put","Response","compareVersion","a","b","v1","split","v2","len","max","num1","parseInt","num2","mirrors","getLocalVersion","mirror_time","setNewestVersion","f","fetch","FetchEngine","json","version","stack","setInterval","setTimeout","installFunction","index","response","addEventListener","skipWaiting","waitUntil","all","map","includes","delete","clients","claim","respondWith","URL","pathname","resp","CacheRuntime","matchCache","matchCDN","method","protocol","clone","req","nav","navigator","saveData","effectiveType","connection","mozConnection","webkitConnection","urls","pathType","pathTestRes","RegExp","location","origin","fullPath","item","exec","ext","pop","contentType","getContentType","arrayBuffer","buffer","headers","endsWith","list","indexOf","progress","status","createPromiseAny","any","promises","Array","isArray","errs","AggregateError","p","err","fetchAny","reqs","controller","AbortController","signal","abort","fetchParallel","abortEvent","Event","eventTarget","EventTarget","tagged","dispatchEvent","e"],"sources":["sw.js"],"mappings":"AACA,MAAMA,OAAS,0BACTC,mBAAqB,+BACrBC,WAAaF,OAAS,KAAOC,mBAC7BE,YAAc,CAClB,iBACA,aACA,sBAEF,IAAIC,WAAY,EAChB,MAAMC,WAAa,0BACnB,IAAIC,kBAAoB,SACpBC,OAAQ,EAEZ,MAAMC,YAAcC,MAAOC,IACzB,MAAMC,EAAMD,EAAME,QAAQD,IAC1B,MAAI,iBAAiBE,KAAKF,IAEf,uBAAuBE,KAAKF,IAE5B,cAAcE,KAAKF,IAEnB,6BAA6BE,KAAKF,GALpCG,YAAYJ,GAOV,UAAUG,KAAKF,GACjBI,WAAWL,GACT,yBAAyBG,KAAKF,IAE9B,kBAAkBE,KAAKF,IAEvB,mBAAmBE,KAAKF,IAExB,4BAA4BE,KAAKF,IAEjC,gBAAgBE,KAAKF,IAErB,qBAAqBE,KAAKF,IAE1B,aAAaE,KAAKF,IAElB,gEAAgEE,KAAKF,IAErE,gBAAgBE,KAAKF,GAfvBK,YAAYN,GAkBZK,WAAWL,EACpB,EAEIO,IAAM,CACVC,GAAI,CACFC,SAAU,8BACVC,OAAQ,iCACRC,MAAO,gCACPC,UAAW,oCACXC,MAAO,gCACPC,UAAW,oCACXC,SAAU,+BAEZC,QAAS,CACPP,SAAU,mCACVC,OAAQ,sCACRC,MAAO,qCACPC,UAAW,yCACXC,MAAO,qCACPC,UAAW,0CAEbG,IAAK,CACHR,SAAU,+BACVC,OAAQ,kCACRC,MAAO,iCACPC,UAAW,qCACXC,MAAO,iCACPK,MAAO,oBACPC,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AAK,OACH,MAAO,gCACT,IAAK,MACH,MAAO,gBACT,IAAK,MACH,MAAO,oBACT,IAAK,MACH,MAAO,iBACT,IAAK,OACH,MAAO,aACT,IAAK,MAEL,IAAK,OAEL,IAAK,OACH,MAAO,eACT,IAAK,KAEL,IAAK,MACH,MAAO,cACT,IAAK,MAEL,IAAK,OAEL,IAAK,MACH,MAAO,aAGX","ignoreList":[],"sourcesContent":["// 全站打包上传 npm,sw 并发请求 cdn\nconst prefix = 'sinzmise-cetastories-en';\nconst cacheSuffixVersion = '00000018-0.11511192688136829';\nconst CACHE_NAME = prefix + '-v' + cacheSuffixVersion;\nconst PreCachlist = [\n \"/css/style.css\",\n \"/js/app.js\",\n \"/js/search/hexo.js\",\n];\nlet NPMMirror = true;\nconst NPMPackage = \"sinzmise-cetastories-en\";\nlet NPMPackageVersion = \"latest\";\nlet debug = true;\n// location.hostname == 'localhost' && (debug = true) && (NPMMirror = false);\nconst handleFetch = async (event) => {\n const url = event.request.url;\n if (/hm\\.baidu\\.com/.test(url)) {\n return NetworkOnly(event)\n } else if (/collect-perf\\.51\\.la/.test(url)) {\n return NetworkOnly(event)\n } else if (/sdk\\.51\\.la/.test(url)) {\n return NetworkOnly(event)\n } else if (/www\\.google-analytics\\.com/.test(url)) {\n return NetworkOnly(event)\n } else if (/@latest/.test(url)) {\n return CacheFirst(event)\n } else if (/cdnjs\\.cloudflare\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/music\\.126\\.net/.test(url)) {\n return CacheAlways(event)\n } else if (/qqmusic\\.qq\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/jsd\\.cdn\\.storisinz\\.site/.test(url)) {\n return CacheAlways(event)\n } else if (/jsdelivr\\.net/.test(url)) {\n return CacheAlways(event)\n } else if (/npm\\.elemecdn\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/unpkg\\.com/.test(url)) {\n return CacheAlways(event)\n } else if (/.*\\.(?:png|jpg|jpeg|svg|gif|webp|ico|eot|ttf|woff|woff2|mp3)$/.test(url)) {\n return CacheAlways(event)\n } else if (/.*\\.(css|js)$/.test(url)) {\n return CacheAlways(event)\n } else {\n return CacheFirst(event)\n }\n}\nconst cdn = {\n gh: {\n jsdelivr: 'https://cdn.jsdelivr.net/gh',\n fastly: 'https://fastly.jsdelivr.net/gh',\n gcore: 'https://gcore.jsdelivr.net/gh',\n testingcf: 'https://testingcf.jsdelivr.net/gh',\n test1: 'https://test1.jsdelivr.net/gh',\n storisinz: 'https://jsd.cdn.storisinz.site/gh',\n webcache: 'https://code.webcache.cn/gh',\n },\n combine: {\n jsdelivr: 'https://cdn.jsdelivr.net/combine',\n fastly: 'https://fastly.jsdelivr.net/combine',\n gcore: 'https://gcore.jsdelivr.net/combine',\n testingcf: 'https://testingcf.jsdelivr.net/combine',\n test1: 'https://test1.jsdelivr.net/combine',\n storisinz: 'https://jsd.cdn.storisinz.site/combine',\n },\n npm: {\n jsdelivr: 'https://cdn.jsdelivr.net/npm',\n fastly: 'https://fastly.jsdelivr.net/npm',\n gcore: 'https://gcore.jsdelivr.net/npm',\n testingcf: 'https://testingcf.jsdelivr.net/npm',\n test1: 'https://test1.jsdelivr.net/npm',\n unpkg: 'https://unpkg.com',\n eleme: 'https://npm.elemecdn.com',\n storisinz: 'https://jsd.cdn.storisinz.site/npm',\n webcache: 'https://npm.webcache.cn',\n },\n cdnjs: {\n cdnjs: 'https://cdnjs.cloudflare.com/ajax/libs',\n baomitu: 'https://lib.baomitu.com',\n bytedance: 'https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M',\n sustech: 'https://mirrors.sustech.edu.cn/cdnjs/ajax/libs',\n webcache: 'https://cdnjs.webstatic.cn/ajax/libs',\n }\n}\nconst cdn_match_list = []\nfor (const type in cdn) {\n for (const key in cdn[type]) {\n cdn_match_list.push({ type: type, key: cdn[type][key] })\n }\n}\nconst _console = console;\nconst color = {\n black: '#000000',\n red: '#FF0000',\n green: '#008000',\n yellow: '#FFFF00',\n blue: '#0000FF',\n magenta: '#FF00FF',\n cyan: '#00FFFF',\n white: '#FFFFFF',\n};\nconst add = (...arr) => {\n let fi = [\n []\n ];\n for (let key = 0; key < arr.length; key++) {\n const [first, ...other] = arr[key];\n fi[0] += first;\n fi = fi.concat(other);\n }\n return fi;\n};\nconst createlog = (util) => (...args) => {\n // const fun = _console[util] ? _console[util] : _console.log;\n const fun = util == \"error\" ? _console[util] : _console.log;\n fun.apply(void 0, args);\n};\nconst creategroup = (util) => (...args) => {\n const fun = _console.groupCollapsed;\n fun.apply(void 0, args);\n};\nconst colorUtils = {\n bold: (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return `${str};font-weight: bold;`;\n }\n for (let key = 1; key < str.length; key++) {\n str[key] += `;font-weight: bold;`;\n }\n return str;\n }\n};\nconst colorHash = {\n log: 'black',\n wait: 'cyan',\n error: 'red',\n warn: 'yellow',\n ready: 'green',\n info: 'blue',\n event: 'magenta',\n};\nconst createChalk = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n createlog(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n createlog(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst createChalkBg = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n createlog(name)(...add(colorUtils.bold(colorUtils[`bg${firstToUpperCase(colorHash[name])}`](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n createlog(name)(...add(colorUtils.bold(colorUtils[`bg${firstToUpperCase(colorHash[name])}`](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst createChalkGroup = (name) => (...str) => {\n if (typeof str[0] === 'object') {\n creategroup(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), ...str));\n return;\n }\n let strArr = str;\n if (typeof str === 'string' || typeof str === 'number') {\n strArr = colorUtils[colorHash[name]](str);\n }\n creategroup(name)(...add(colorUtils.bold(colorUtils[colorHash[name]](`[${firstToUpperCase(name)}] `)), strArr));\n};\nconst chalk = {\n group: {\n end: _console.groupEnd\n },\n bg: {}\n};\nObject.keys(colorHash).forEach(key => {\n chalk[key] = createChalk(key);\n chalk.group[key] = createChalkGroup(key);\n chalk.bg[key] = createChalkBg(key);\n});\nconst firstToUpperCase = (str) => str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());\nObject.keys(color).forEach(key => {\n colorUtils[key] = (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return [`%c${str}`, `color:${color[key]}`];\n }\n for (let i = 1; i < str.length; i++) {\n str[i] += `;color:${color[key]}`;\n }\n return str;\n };\n colorUtils[`bg${firstToUpperCase(key)}`] = (str) => {\n if (typeof str === 'string' || typeof str === 'number') {\n return [`%c${str}`, `padding: 2px 4px; border-radius: 3px; color: ${key === 'white' ? '#000' : '#fff'}; font-weight: bold; background:${color[key]};`];\n }\n for (let i = 1; i < str.length; i++) {\n str[i] += `;padding: 2px 4px; border-radius: 3px; font-weight: bold; background:${color[key]};`;\n }\n return str;\n };\n});\nself.logger = {\n add,\n ...chalk,\n ...colorUtils,\n};\n\nif (!debug) {\n logger = {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n group: {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n end: () => { },\n },\n bg: {\n log: () => { },\n wait: () => { },\n error: () => { },\n warn: () => { },\n ready: () => { },\n info: () => { },\n event: () => { },\n }\n };\n console.log = () => { };\n}\n\nconst generate_uuid = () => {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\nself.db = {\n read: (key, config) => {\n if (!config) { config = { type: \"text\" } }\n return new Promise((resolve, reject) => {\n caches.open(CACHE_NAME).then(cache => {\n cache.match(new Request(`https://LOCALCACHE/${encodeURIComponent(key)}`)).then(function (res) {\n if (!res) resolve(null)\n res.text().then(text => resolve(text))\n }).catch(() => {\n resolve(null)\n })\n })\n })\n },\n write: (key, value) => {\n return new Promise((resolve, reject) => {\n caches.open(CACHE_NAME).then(function (cache) {\n cache.put(new Request(`https://LOCALCACHE/${encodeURIComponent(key)}`), new Response(value));\n resolve()\n }).catch(() => {\n reject()\n })\n })\n }\n}\nconst compareVersion = (a, b) => {\n let v1 = a.split('.');\n let v2 = b.split('.');\n const len = Math.max(v1.length, v2.length);\n while (v1.length < len) {\n v1.push('0');\n }\n while (v2.length < len) {\n v2.push('0');\n }\n for (let i = 0; i < len; i++) {\n const num1 = parseInt(v1[i]);\n const num2 = parseInt(v2[i]);\n if (num1 > num2) {\n return a;\n } else if (num1 < num2) {\n return b;\n }\n }\n return a;\n}\n\nconst mirrors = [\n `https://registry.npmjs.org/${NPMPackage}/latest`,\n `https://mirrors.cloud.tencent.com/npm/${NPMPackage}/latest`\n]\nconst getLocalVersion = async () => {\n NPMPackageVersion = await db.read('blog_version') || NPMPackageVersion\n logger.bg.info(`Local Version: ${NPMPackage}@${NPMPackageVersion}`)\n}\nlet mirror_time = 0;\nconst setNewestVersion = async () => {\n if (!NPMMirror) {\n return\n }\n let f = null;\n if (!(mirror_time % (mirrors.length + 1))) {\n f = FetchEngine(mirrors);\n } else {\n f = fetch(mirrors[(mirror_time % (mirrors.length + 1)) - 1]);\n }\n mirror_time++;\n return f\n .then(res => res.json())\n .then(async res => {\n if (!res.version) throw ('No Version Found!')\n NPMPackageVersion = compareVersion(res.version, await db.read('blog_version') || NPMPackageVersion)\n logger.bg.ready(`${NPMPackage}@${NPMPackageVersion}`)\n await db.write('blog_version', NPMPackageVersion)\n })\n .catch(error => {\n logger.error('[Set Newest Version] ' + (error.stack || error))\n })\n}\nsetInterval(async () => {\n await setNewestVersion()\n}, 60 * 1000);\nsetTimeout(async () => {\n await setNewestVersion()\n}, 5000)\nconst installFunction = async () => {\n await getLocalVersion();\n return caches.open(CACHE_NAME + \"-precache\")\n .then(async function (cache) {\n if (!await db.read('uuid')) {\n await db.write('uuid', generate_uuid())\n }\n if (PreCachlist.length) {\n logger.group.event(`Precaching ${PreCachlist.length} files.`);\n let index = 0;\n PreCachlist.forEach(function (url) {\n cache.match(new Request(url)).then(function (response) {\n if (response) {\n logger.ready(`Precaching ${url}`);\n } else {\n logger.wait(`Precaching ${url}`);\n cache.add(new Request(url));\n }\n index++;\n if (index === PreCachlist.length) {\n logger.ready(`Precached ${PreCachlist.length} files.`);\n logger.group.end();\n }\n })\n })\n }\n }).catch((error) => {\n logger.error('[install] ' + (error.stack || error));\n })\n}\nself.addEventListener('install', async function (event) {\n logger.bg.event(\"service worker install event listening\");\n try {\n self.skipWaiting();\n event.waitUntil(installFunction());\n logger.bg.ready('service worker install sucess!');\n } catch (error) {\n logger.error('[install] ' + (error.stack || error));\n }\n});\nself.addEventListener('activate', async event => {\n logger.bg.event(\"service worker activate event listening\");\n try {\n event.waitUntil(\n caches.keys().then((keys) => {\n return Promise.all(keys.map((key) => {\n if (!key.includes(cacheSuffixVersion)) {\n caches.delete(key);\n logger.bg.ready('Deleted Outdated Cache: ' + key);\n }\n }));\n }).catch((error) => {\n logger.error('[activate] ' + (error.stack || error));\n })\n );\n await self.clients.claim()\n logger.bg.ready('service worker activate sucess!');\n } catch (error) {\n logger.error('[activate] ' + (error.stack || error));\n }\n})\nself.addEventListener('fetch', async event => {\n event.respondWith(\n handleFetch(event).catch((error) => {\n logger.error('[fetch] ' + event.request.url + '\\n[error] ' + (error.stack || error));\n })\n )\n});\n\n\nconst NetworkOnly = async (event) => {\n logger.group.info('NetworkOnly: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n logger.group.end();\n return fetch(event.request)\n}\nconst CacheFirst = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('CacheFirst: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n event.waitUntil(CacheRuntime(event.request))\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\nconst CacheAlways = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('CacheAlways: ' + new URL(event.request.url).pathname);\n logger.wait('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\n\nconst matchCache = async (event) => {\n return caches.match(event.request).then(function (resp) {\n logger.group.info('service worker fetch: ' + event.request.url)\n if (resp) {\n logger.group.ready(`Cache Hit`);\n console.log(resp)\n logger.group.end();\n logger.group.end();\n return resp;\n } else {\n logger.warn(`Cache Miss`);\n logger.group.end();\n return CacheRuntime(event.request)\n }\n })\n}\nasync function CacheRuntime(request) {\n const url = new URL(request.url);\n let response = await matchCDN(request);\n if (!response) {\n response = await fetch(request).catch(() => null)\n }\n logger.group.event(`Cache Runtime ${url.pathname}`);\n logger.wait(`Caching url: ${request.url}`);\n console.log(response);\n\n if (request.method === \"GET\" && (url.protocol == \"https:\")) {\n const cache = await caches.open(CACHE_NAME + \"-runtime\");\n cache.put(request, response.clone()).catch(error => {\n logger.error('[Cache Runtime] ' + (error.stack || error));\n if (error.name === 'QuotaExceededError') {\n caches.delete(CACHE_NAME + \"-runtime\");\n logger.ready(\"deleted cache\")\n }\n })\n logger.ready(`Cached url: ${request.url}`);\n } else {\n logger.warn(`Not Cached url: ${request.url}`);\n }\n logger.group.end();\n return response;\n}\n\nconst matchCDN = async (req) => {\n const nav = navigator\n const { saveData, effectiveType } = nav.connection || nav.mozConnection || nav.webkitConnection || {}\n if (saveData || /2g/.test(effectiveType)) {\n logger.warn(\"Slow Network: Transparent Proxy\");\n return fetch(req);\n }\n const urls = []\n let urlObj = new URL(req.url)\n let pathType = urlObj.pathname.split('/')[1]\n let pathTestRes = \"\";\n\n if (NPMMirror && new RegExp(location.origin).test(req.url)) {\n logger.group.ready(`Match NPM Mirror: ` + req.url);\n for (const key in cdn.npm) {\n let url = cdn.npm[key] + \"/\" + NPMPackage + \"@\" + NPMPackageVersion + req.url.replace(location.origin, '')\n url = fullPath(fullPath(url))\n console.log(url);\n urls.push(url)\n }\n logger.group.end()\n }\n if (!urls.length) {\n for (const item of cdn_match_list) {\n if (new RegExp(item.key).test(req.url)) {\n pathType = item.type\n pathTestRes = new RegExp(item.key).exec(req.url)[0]\n break;\n }\n }\n for (const type in cdn) {\n if (type === pathType) {\n logger.group.ready(`Match CDN ${pathType}: ` + req.url);\n for (const key in cdn[type]) {\n const url = cdn[type][key] + req.url.replace(pathTestRes, '')\n console.log(url);\n urls.push(url)\n }\n logger.group.end()\n }\n }\n }\n\n let res;\n if (urls.length)\n res = FetchEngine(urls)\n else\n res = fetch(req)\n if (res && NPMMirror && new RegExp(location.origin).test(req.url)) {\n const ext = fullPath(fullPath(req.url)).split('.').pop()\n const contentType = getContentType(ext)\n res = res\n .then(res => res.arrayBuffer())\n .then(buffer => new Response(buffer, {\n headers: {\n \"Content-Type\": contentType\n }\n }))\n .catch(() => null)\n }\n return res\n}\n\nconst fullPath = (url) => {\n url = url.split('?')[0].split('#')[0]\n if (url.endsWith('/')) {\n url += 'index.html'\n } else {\n const list = url.split('/')\n const last = list[list.length - 1]\n if (last.indexOf('.') === -1) {\n url += '.html'\n }\n }\n return url\n}\nasync function progress(res) {\n return new Response(await res.arrayBuffer(), {\n status: res.status,\n headers: res.headers\n })\n}\n\nfunction createPromiseAny() {\n Promise.any = function (promises) {\n return new Promise((resolve, reject) => {\n promises = Array.isArray(promises) ? promises : []\n let len = promises.length\n let errs = []\n if (len === 0) return reject(new AggregateError('All promises were rejected'))\n promises.forEach((p) => {\n if (p instanceof Promise) {\n p.then(\n (res) => resolve(res),\n (err) => {\n len--\n errs.push(err)\n if (len === 0) reject(new AggregateError(errs))\n }\n )\n } else {\n reject(p)\n }\n })\n })\n }\n}\n\nfunction fetchAny(reqs) {\n const controller = new AbortController()\n\n return reqs.map(req => {\n return new Promise((resolve, reject) => {\n fetch(req, {\n signal: controller.signal\n })\n .then(progress)\n .then(res => {\n controller.abort()\n if (res.status !== 200)\n reject(null)\n else\n resolve(res)\n })\n .catch(() => reject(null))\n })\n })\n}\n\nfunction fetchParallel(reqs) {\n const abortEvent = new Event(\"abortOtherInstance\")\n const eventTarget = new EventTarget();\n\n return reqs.map(async req => {\n const controller = new AbortController();\n let tagged = false;\n eventTarget.addEventListener(abortEvent.type, () => {\n if (!tagged) controller.abort();\n })\n return new Promise((resolve, reject) => {\n fetch(req, {\n signal: controller.signal,\n }).then(res => {\n tagged = true;\n eventTarget.dispatchEvent(abortEvent)\n if (res.status !== 200)\n reject(null)\n else\n resolve(res)\n }).catch(() => reject(null))\n })\n });\n}\n\nconst FetchEngine = (reqs) => {\n if (!Promise.any) createPromiseAny();\n return Promise.any(fetchParallel(reqs)).then(res => res)\n .catch((e) => {\n if (e == \"AggregateError: All promises were rejected\") {\n return Promise.any(fetchAny(reqs))\n .then((res) => res)\n .catch(() => null);\n }\n return null;\n });\n};\n\nconst getContentType = (ext) => {\n switch (ext) {\n case 'js':\n return 'text/javascript'\n case 'html':\n return 'text/html'\n case 'css':\n return 'text/css'\n case 'json':\n return 'application/json'\n case 'webp':\n return 'image/webp'\n case 'jpg':\n return 'image/jpg'\n case 'jpeg':\n return 'image/jpeg'\n case 'png':\n return 'image/png'\n case 'gif':\n return 'image/gif'\n case 'xml':\n return 'text/xml'\n case 'xsl':\n return 'text/xml'\n case 'webmanifest':\n return 'text/webmanifest'\n case 'map':\n return 'application/json'\n case 'bcmap':\n return 'image/vnd.wap.wbmp'\n case 'wbmp':\n return 'image/vnd.wap.wbmp'\n case 'bmp':\n return 'image/bmp'\n case 'ico':\n return 'image/vnd.microsoft.icon'\n case 'tiff':\n return 'image/tiff'\n case 'tif':\n return 'image/tiff'\n case 'svg':\n return 'image/svg+xml'\n case 'svgz':\n return 'image/svg+xml'\n case 'woff':\n return 'application/font-woff'\n case 'woff2':\n return 'application/font-woff2'\n case 'ttf':\n return 'application/font-ttf'\n case 'otf':\n return 'application/font-otf'\n case 'eot':\n return 'application/vnd.ms-fontobject'\n case 'zip':\n return 'application/zip'\n case 'tar':\n return 'application/x-tar'\n case 'gz':\n return 'application/gzip'\n case 'bz2':\n return 'application/x-bzip2'\n case 'rar':\n return 'application/x-rar-compressed'\n case '7z':\n return 'application/x-7z-compressed'\n case 'doc':\n return 'application/msword'\n case 'docx':\n return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'\n case 'xls':\n return 'application/vnd.ms-excel'\n case 'xlsx':\n return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n case 'ppt':\n return 'application/vnd.ms-powerpoint'\n case 'pptx':\n return 'application/vnd.openxmlformats-officedocument.presentationml.presentation'\n case 'pdf':\n return 'application/pdf'\n case 'txt':\n return 'text/plain'\n case 'rtf':\n return 'application/rtf'\n case 'mp3':\n return 'audio/mpeg'\n case 'wav':\n return 'audio/x-wav'\n case 'ogg':\n return 'audio/ogg'\n case 'mp4':\n return 'video/mp4'\n case 'm4v':\n return 'video/x-m4v'\n case 'mov':\n return 'video/quicktime'\n case 'avi':\n return 'video/x-msvideo'\n case 'wmv':\n return 'video/x-ms-wmv'\n case 'flv':\n return 'video/x-flv'\n case 'swf':\n return 'application/x-shockwave-flash'\n case 'mpg':\n return 'video/mpeg'\n case 'mpeg':\n return 'video/mpeg'\n case 'mpe':\n return 'video/mpeg'\n case 'mpv':\n return 'video/mpeg'\n case 'm2v':\n return 'video/mpeg'\n case 'm4a':\n return 'audio/mp4'\n case 'aac':\n return 'audio/aac'\n case 'm3u':\n return 'audio/x-mpegurl'\n case 'm3u8':\n return 'application/vnd.apple.mpegurl'\n case 'pls':\n return 'audio/x-scpls'\n case 'cue':\n return 'application/x-cue'\n case 'wma':\n return 'audio/x-ms-wma'\n case 'flac':\n return 'audio/flac'\n case 'aif':\n return 'audio/x-aiff'\n case 'aiff':\n return 'audio/x-aiff'\n case 'aifc':\n return 'audio/x-aiff'\n case 'au':\n return 'audio/basic'\n case 'snd':\n return 'audio/basic'\n case 'mid':\n return 'audio/midi'\n case 'midi':\n return 'audio/midi'\n case 'kar':\n return 'audio/midi'\n default:\n return 'text/plain'\n }\n}"]}
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"sinzmise-cetastories-en","version":"2.0.0-
|
1
|
+
{"name":"sinzmise-cetastories-en","version":"2.0.0-1731239057774"}
|