diff --git a/config.toml b/config.toml index 66395f3b..ddcb7972 100644 --- a/config.toml +++ b/config.toml @@ -25,7 +25,7 @@ taxonomies = [ [search] # Options specific to elasticlunr search. # index format can be: elasticlunr_json or elasticlunr_javascript or fuse_json -index_format = "elasticlunr_json" +index_format = "fuse_json" include_title = true # include title of page/section in index include_description = true # include description of page/section in index include_content = true # include rendered content of page/section in index @@ -221,7 +221,7 @@ js_prestyle = true # used to preload: FontAwesome, Katex, external Google Fonts js_switcher = true # The button that allows manually changing between light/dark mode. js_switcher_default = "dark" # default nojs switcher mode: dark, light (make sure to also set $switcherDefault in abridge.scss) -search_library = "elasticlunr" +search_library = "pagefind" stylesheets = ["abridge.css"] webmanifest = "manifest.min.json" # Required for PWAs diff --git a/package_abridge.js b/package_abridge.js index 197e10b2..5e54be55 100644 --- a/package_abridge.js +++ b/package_abridge.js @@ -3,7 +3,7 @@ const path = require("path"); const TOML = require('fast-toml'); const UglifyJS = require('uglify-js'); const jsonminify = require("jsonminify"); -const util = require("util"); +const util = require("util"); const { exec } = require("child_process"); const { exit } = require('process'); const execPromise = util.promisify(exec); @@ -33,7 +33,7 @@ const pwa_BASE_CACHE_FILES = data.extra.pwa_BASE_CACHE_FILES; // This is used to pass arguments to zola via npm, for example: // npm run abridge -- "--base-url https://abridge.pages.dev" -var args = process.argv[2] ? ' '+process.argv[2] : ''; +var args = process.argv[2] ? ' ' + process.argv[2] : ''; // check if abridge is used directly or as a theme. bpath = ''; @@ -41,9 +41,9 @@ if (fs.existsSync('./themes')) { bpath = 'themes/abridge/'; } // cleanup pagefind files from old builds. -_rmRegex(path.join(bpath, "static/js/"),/^wasm.*pagefind$/); -_rmRegex(path.join(bpath, "static/js/"),/^pagefind.*pf_meta$/); -_rmRegex(path.join(bpath, "static/js/"),/^pagefind-entry.*json$/); +_rmRegex(path.join(bpath, "static/js/"), /^wasm.*pagefind$/); +_rmRegex(path.join(bpath, "static/js/"), /^pagefind.*pf_meta$/); +_rmRegex(path.join(bpath, "static/js/"), /^pagefind-entry.*json$/); _rmRecursive(path.join(bpath, "static/js/index")); _rmRecursive(path.join(bpath, "static/js/fragment")); @@ -53,7 +53,7 @@ async function execWrapper(cmd) { console.log(stdout); } if (stderr) { - console.log('ERROR: '+stderr); + console.log('ERROR: ' + stderr); } } @@ -62,81 +62,81 @@ async function abridge() { const { replaceInFileSync } = await import('replace-in-file'); // set index_format for chosen search_library accordingly. if (search_library === 'offline') { - replaceInFileSync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\""}); - args = args + " -u \""+__dirname+"\/public\""//set base_url to the path on disk for offline site. + replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\"" }); + args = args + " -u \"" + __dirname + "\/public\""//set base_url to the path on disk for offline site. } else if (search_library === 'elasticlunrjava') { - replaceInFileSync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\""}); + replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_javascript\"" }); } else if (search_library === 'elasticlunr') { - replaceInFileSync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_json\""}); + replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"elasticlunr_json\"" }); } else if (search_library === 'pagefind') { - replaceInFileSync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\""}); + replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\"" }); } else if (search_library === 'tinysearch') { - replaceInFileSync({files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\""}); + replaceInFileSync({ files: 'config.toml', from: /index_format.*=.*/g, to: "index_format = \"fuse_json\"" }); } console.log('Zola Build to generate files for minification:'); - await execWrapper('zola build'+args); + await execWrapper('zola build' + args); //check that static/js exists, do this after zola build, it will handle creating static if missing. var jsdir = 'static/js'; try { fs.mkdirSync(jsdir); - } catch(e) { + } catch (e) { if (e.code != 'EEXIST') throw e; } base_url = data.base_url; if (base_url.slice(-1) == "/") { - base_url = base_url.slice(0, -1); + base_url = base_url.slice(0, -1); } if (search_library === 'pagefind') { // Generate pagefind index at start, otherwise it happens too late asyncronously. await createPagefindIndex(); // makes program wait for pagefind build execution - _rmRegex(path.join(bpath, "static/js/"),/^pagefind\.js$/);//pagefind temporary intermediate files - _rmRegex(path.join(bpath, "static/js/"),/^pagefind-.*\.js$/);//pagefind temporary intermediate files - _rmRegex(path.join(bpath, "static/js/"),/^pagefind-.*\.css$/);//pagefind temporary intermediate files + _rmRegex(path.join(bpath, "static/js/"), /^pagefind\.js$/);//pagefind temporary intermediate files + _rmRegex(path.join(bpath, "static/js/"), /^pagefind-.*\.js$/);//pagefind temporary intermediate files + _rmRegex(path.join(bpath, "static/js/"), /^pagefind-.*\.css$/);//pagefind temporary intermediate files // This line in pagefind is causing a problem for the PWA: // var e = await (await fetch(this.basePath + "pagefind-entry.json?ts=" + Date.now())).json(); // instead generate an epoch timestamp at build and add it to the filename. var hash = Math.floor(new Date().getTime() / 1000); - fs.renameSync(path.join(bpath, "static/js/pagefind-entry.json"), path.join(bpath, "static/js/pagefind-entry-"+hash+".json")); + fs.renameSync(path.join(__dirname, "static/js/pagefind-entry.json"), path.join(__dirname, "static/js/pagefind-entry-" + hash + ".json")); // original: var e=await(await fetch(this.basePath+"pagefind-entry.json?ts="+Date.now())).json(); // new: var e=await(await fetch(this.basePath+"pagefind-entry-1723268715.json")).json(); // Tricky regex, so I split it into two replaceInFileSync() calls, pull requests welcome if you can improve this. - replaceInFileSync({files: path.join(bpath, "static/js/pagefind_search.js"), from: /pagefind-entry\.json\?ts=/g, to: "pagefind-entry-"+hash+"\.json"}); - replaceInFileSync({files: path.join(bpath, "static/js/pagefind_search.js"), from: /Date.now\(\)/g, to: "\"\""}); + replaceInFileSync({ files: path.join(__dirname, "static/js/pagefind_search.js"), from: /pagefind-entry\.json\?ts=/g, to: "pagefind-entry-" + hash + "\.json" }); + replaceInFileSync({ files: path.join(__dirname, "static/js/pagefind_search.js"), from: /Date.now\(\)/g, to: "\"\"" }); //copy to public so the files are included in the PWA cache list if necessary. - fs.copyFileSync(path.join(bpath, "static/js/pagefind-entry-"+hash+".json"), path.join(bpath, "public/js/pagefind-entry-"+hash+".json")) - _cpRegex(path.join(bpath, "static/js/"),path.join(bpath, "public/js/"),/^pagefind-entry\.json$/); - _cpRegex(path.join(bpath, "static/js/"),path.join(bpath, "public/js/"),/^pagefind.*pf_meta$/); - _cpRegex(path.join(bpath, "static/js/"),path.join(bpath, "public/js/"),/^wasm.*pagefind$/); - _cpRecursive(path.join(bpath, "static/js/index"),path.join(bpath, "public/js/index")); - _cpRecursive(path.join(bpath, "static/js/fragment"),path.join(bpath, "public/js/fragment")); + fs.copyFileSync(path.join(__dirname, "static/js/pagefind-entry-" + hash + ".json"), path.join(__dirname, "public/js/pagefind-entry-" + hash + ".json")) + _cpRegex(path.join(__dirname, "static/js/"), path.join(__dirname, "public/js/"), /^pagefind-entry\.json$/); + _cpRegex(path.join(__dirname, "static/js/"), path.join(__dirname, "public/js/"), /^pagefind.*pf_meta$/); + _cpRegex(path.join(__dirname, "static/js/"), path.join(__dirname, "public/js/"), /^wasm.*pagefind$/); + _cpRecursive(path.join(__dirname, "static/js/index"), path.join(__dirname, "public/js/index")); + _cpRecursive(path.join(__dirname, "static/js/fragment"), path.join(__dirname, "public/js/fragment")); } if (pwa) {// Update pwa settings, file list, and hashes. if (typeof pwa_VER !== 'undefined' && typeof pwa_NORM_TTL !== 'undefined' && typeof pwa_LONG_TTL !== 'undefined' && typeof pwa_TTL_NORM !== 'undefined' && typeof pwa_TTL_LONG !== 'undefined' && typeof pwa_TTL_EXEMPT !== 'undefined') { // update from abridge theme. - fs.copyFileSync(bpath+'static/sw.js', 'static/sw.js'); - fs.copyFileSync(bpath+'static/js/sw_load.js', 'static/js/sw_load.js'); + fs.copyFileSync(bpath + 'static/sw.js', 'static/sw.js'); + fs.copyFileSync(bpath + 'static/js/sw_load.js', 'static/js/sw_load.js'); // Update settings in PWA javascript file, using options parsed from config.toml. sw.min.js?v=3.10.0", "++" if (fs.existsSync('static/js/sw_load.js')) { sw_load_min = '.js?v='; if (js_bundle) { sw_load_min = '.min.js?v='; } - replaceInFileSync({files: 'static/js/sw_load.js', from: /sw.*v=.*/g, to: "sw"+sw_load_min+pwa_VER+"\","}); + replaceInFileSync({ files: 'static/js/sw_load.js', from: /sw.*v=.*/g, to: "sw" + sw_load_min + pwa_VER + "\"," }); } if (fs.existsSync('static/sw.js')) { - replaceInFileSync({files: 'static/sw.js', from: /NORM_TTL.*=.*/g, to: "NORM_TTL = "+pwa_NORM_TTL+";"}); - replaceInFileSync({files: 'static/sw.js', from: /LONG_TTL.*=.*/g, to: "LONG_TTL = "+pwa_LONG_TTL+";"}); - replaceInFileSync({files: 'static/sw.js', from: /TTL_NORM.*=.*/g, to: "TTL_NORM = ["+pwa_TTL_NORM+"];"}); - replaceInFileSync({files: 'static/sw.js', from: /TTL_LONG.*=.*/g, to: "TTL_LONG = ["+pwa_TTL_LONG+"];"}); - replaceInFileSync({files: 'static/sw.js', from: /TTL_EXEMPT.*=.*/g, to: "TTL_EXEMPT = ["+pwa_TTL_EXEMPT+"];"}); + replaceInFileSync({ files: 'static/sw.js', from: /NORM_TTL.*=.*/g, to: "NORM_TTL = " + pwa_NORM_TTL + ";" }); + replaceInFileSync({ files: 'static/sw.js', from: /LONG_TTL.*=.*/g, to: "LONG_TTL = " + pwa_LONG_TTL + ";" }); + replaceInFileSync({ files: 'static/sw.js', from: /TTL_NORM.*=.*/g, to: "TTL_NORM = [" + pwa_TTL_NORM + "];" }); + replaceInFileSync({ files: 'static/sw.js', from: /TTL_LONG.*=.*/g, to: "TTL_LONG = [" + pwa_TTL_LONG + "];" }); + replaceInFileSync({ files: 'static/sw.js', from: /TTL_EXEMPT.*=.*/g, to: "TTL_EXEMPT = [" + pwa_TTL_EXEMPT + "];" }); } if (pwa_cache_all === true) { @@ -146,36 +146,36 @@ async function abridge() { var dir = 'public'; try { fs.mkdirSync(dir); - } catch(e) { + } catch (e) { if (e.code != 'EEXIST') throw e; } const path = './public/'; cache = ''; files = fs.readdirSync(path, { recursive: true, withFileTypes: false }) - .forEach( - (file) => { - // check if is directory, if not then add the path/file - if (!fs.lstatSync(path+file).isDirectory()) { - // format output - item = "/"+file.replace(/index\.html$/i,'');// strip index.html from path - item = item.replace(/\\/g,'/');// replace backslash with forward slash for Windows - item = item.replace(/^\/sw(\.min)?\.js/i,'');// dont cache service worker - item = item.replace(/^\/_headers/i,'');// dont cache the cloudflare _headers file - - // if formatted output is not empty line then append it to cache var - if (item != '') {// skip empty lines - cache = cache+"'"+item+"',"; + .forEach( + (file) => { + // check if is directory, if not then add the path/file + if (!fs.lstatSync(path + file).isDirectory()) { + // format output + item = "/" + file.replace(/index\.html$/i, '');// strip index.html from path + item = item.replace(/\\/g, '/');// replace backslash with forward slash for Windows + item = item.replace(/^\/sw(\.min)?\.js/i, '');// dont cache service worker + item = item.replace(/^\/_headers/i, '');// dont cache the cloudflare _headers file + + // if formatted output is not empty line then append it to cache var + if (item != '') {// skip empty lines + cache = cache + "'" + item + "',"; + } } } - } - ); + ); cache = cache.slice(0, -1)// remove the last comma } else if (pwa_BASE_CACHE_FILES) { cache = pwa_BASE_CACHE_FILES; } cache = cache.split(",").sort().join(",")//sort the cache list, this should help keep the commit history cleaner. - cache = 'this.BASE_CACHE_FILES = ['+cache+'];'; + cache = 'this.BASE_CACHE_FILES = [' + cache + '];'; // update the BASE_CACHE_FILES variable in the sw.js service worker file results = replaceInFileSync({ files: 'static/sw.js', @@ -195,10 +195,10 @@ async function abridge() { minify(['static/js/theme_light.js']); // Something went wrong with minifying katexbundle, so commenting this out for now // minify(['static/js/katex.min.js','static/js/mathtex-script-type.min.js','static/js/katex-auto-render.min.js','static/js/katexoptions.js'],'static/js/katexbundle.min.js'); - minify(['static/js/elasticlunr.min.js','static/js/search.js'],'static/js/search_elasticlunr.min.js'); - minify(['static/js/tinysearch.js'],'static/js/search_tinysearch.min.js'); - minify(['static/js/prestyle.js','static/js/theme_button.js','static/js/email.js','static/js/codecopy.js','static/js/sw_load.js'],'static/js/abridge_nosearch.min.js'); - minify(['static/js/prestyle.js','static/js/theme_button.js','static/js/email.js','static/js/codecopy.js'],'static/js/abridge_nosearch_nopwa.min.js'); + minify(['static/js/elasticlunr.min.js', 'static/js/search.js'], 'static/js/search_elasticlunr.min.js'); + minify(['static/js/tinysearch.js'], 'static/js/search_tinysearch.min.js'); + minify(['static/js/prestyle.js', 'static/js/theme_button.js', 'static/js/email.js', 'static/js/codecopy.js', 'static/js/sw_load.js'], 'static/js/abridge_nosearch.min.js'); + minify(['static/js/prestyle.js', 'static/js/theme_button.js', 'static/js/email.js', 'static/js/codecopy.js'], 'static/js/abridge_nosearch_nopwa.min.js'); minify(['static/js/sw_load.js']); minify(['static/sw.js']); } else if (pwa) { @@ -210,24 +210,24 @@ async function abridge() { if (fs.existsSync('static/manifest.json')) { let out; try { - out = JSON.minify(fs.readFileSync('static/manifest.json', {encoding:"utf-8"})); - } catch(err) { + out = JSON.minify(fs.readFileSync('static/manifest.json', { encoding: "utf-8" })); + } catch (err) { console.log(err); } fs.writeFileSync('static/manifest.min.json', out); } - abridge_bundle = bundle(bpath,js_prestyle,js_switcher,js_email_encode,js_copycode,search_library,index_format,uglyurls,false); - minify(abridge_bundle,'static/js/abridge_nopwa.min.js'); + abridge_bundle = bundle(bpath, js_prestyle, js_switcher, js_email_encode, js_copycode, search_library, index_format, uglyurls, false); + minify(abridge_bundle, 'static/js/abridge_nopwa.min.js'); - abridge_bundle = bundle(bpath,js_prestyle,js_switcher,js_email_encode,js_copycode,search_library,index_format,uglyurls,pwa); - minify(abridge_bundle,'static/js/abridge.min.js'); + abridge_bundle = bundle(bpath, js_prestyle, js_switcher, js_email_encode, js_copycode, search_library, index_format, uglyurls, pwa); + minify(abridge_bundle, 'static/js/abridge.min.js'); // cleanup - _rmRegex(path.join(bpath, "static/js/"),/^pagefind_search\.js$/);//pagefind intermediate file that is now in bundle. + _rmRegex(path.join(bpath, "static/js/"), /^pagefind_search\.js$/);//pagefind intermediate file that is now in bundle. console.log('Zola Build to generate new integrity hashes for the previously minified files:'); - await execWrapper('zola build'+args); + await execWrapper('zola build' + args); } async function _headersWASM() { @@ -236,11 +236,11 @@ async function _headersWASM() { // This function adds wasm-unsafe-eval to the pagefind and tinysearch demos without adding it to the elasticlunr demo. const { replaceInFileSync } = await import('replace-in-file'); if (search_library === 'pagefind') { - replaceInFileSync({files: 'static/_headers', from: /script-src 'self'/g, to: "script-src 'wasm-unsafe-eval' 'self'"}); + replaceInFileSync({ files: 'static/_headers', from: /script-src 'self'/g, to: "script-src 'wasm-unsafe-eval' 'self'" }); } else if (search_library === 'tinysearch') { - replaceInFileSync({files: 'static/_headers', from: /script-src 'self'/g, to: "script-src 'wasm-unsafe-eval' 'self'"}); + replaceInFileSync({ files: 'static/_headers', from: /script-src 'self'/g, to: "script-src 'wasm-unsafe-eval' 'self'" }); } else { - replaceInFileSync({files: 'static/_headers', from: /script-src 'wasm-unsafe-eval' 'self'/g, to: "script-src 'self'"}); + replaceInFileSync({ files: 'static/_headers', from: /script-src 'wasm-unsafe-eval' 'self'/g, to: "script-src 'self'" }); } } @@ -254,7 +254,7 @@ function _rmRecursive(targetFiles) { } } -function _cpRecursive(source,dest) { +function _cpRecursive(source, dest) { try { fs.cpSync(source, dest, { recursive: true }); } catch (error) { @@ -262,7 +262,7 @@ function _cpRecursive(source,dest) { } } -function _rmRegex(path,regex) { +function _rmRegex(path, regex) { try { fs.readdirSync(path).filter(f => regex.test(f)).forEach(f => fs.unlinkSync(path + f)); } catch (error) { @@ -272,7 +272,7 @@ function _rmRegex(path,regex) { } } -function _cpRegex(source,dest,regex) { +function _cpRegex(source, dest, regex) { try { fs.readdirSync(source).filter(f => regex.test(f)).forEach(f => fs.copyFileSync(source + f, dest + f)); } catch (error) { @@ -280,38 +280,38 @@ function _cpRegex(source,dest,regex) { } } -function bundle(bpath,js_prestyle,js_switcher,js_email_encode,js_copycode,search_library,index_format,uglyurls,pwa) { +function bundle(bpath, js_prestyle, js_switcher, js_email_encode, js_copycode, search_library, index_format, uglyurls, pwa) { minify_files = []; if (js_prestyle) { - minify_files.push(bpath+'static/js/prestyle.js'); + minify_files.push(bpath + 'static/js/prestyle.js'); } if (js_switcher) { - minify_files.push(bpath+'static/js/theme_button.js'); + minify_files.push(bpath + 'static/js/theme_button.js'); } if (js_email_encode) { - minify_files.push(bpath+'static/js/email.js'); + minify_files.push(bpath + 'static/js/email.js'); } if (js_copycode) { - minify_files.push(bpath+'static/js/codecopy.js'); + minify_files.push(bpath + 'static/js/codecopy.js'); } if (search_library) { - if ((search_library === 'offline' || (search_library === 'elasticlunrjava' && uglyurls === true))) { - minify_files.push('public/search_index.en.js'); - minify_files.push(bpath+'static/js/elasticlunr.min.js'); - minify_files.push(bpath+'static/js/searchjavaugly.js'); - } else if (search_library === 'elasticlunrjava') { - minify_files.push('public/search_index.en.js'); - minify_files.push(bpath+'static/js/elasticlunr.min.js'); - minify_files.push(bpath+'static/js/searchjava.js'); - } else if (search_library === 'elasticlunr') {//abridge default - minify_files.push(bpath+'static/js/elasticlunr.min.js'); - minify_files.push(bpath+'static/js/search.js'); - } else if (search_library === 'pagefind') { - minify_files.push(bpath+'static/js/pagefind_search.js'); - } else if (search_library === 'tinysearch') { - minify_files.push(bpath+'static/js/tinysearch.js'); - } + if ((search_library === 'offline' || (search_library === 'elasticlunrjava' && uglyurls === true))) { + minify_files.push('public/search_index.en.js'); + minify_files.push(bpath + 'static/js/elasticlunr.min.js'); + minify_files.push(bpath + 'static/js/searchjavaugly.js'); + } else if (search_library === 'elasticlunrjava') { + minify_files.push('public/search_index.en.js'); + minify_files.push(bpath + 'static/js/elasticlunr.min.js'); + minify_files.push(bpath + 'static/js/searchjava.js'); + } else if (search_library === 'elasticlunr') {//abridge default + minify_files.push(bpath + 'static/js/elasticlunr.min.js'); + minify_files.push(bpath + 'static/js/search.js'); + } else if (search_library === 'pagefind') { + minify_files.push(path.join(__dirname, 'static/js/pagefind_search.js')); + } else if (search_library === 'tinysearch') { + minify_files.push(bpath + 'static/js/tinysearch.js'); + } } if (pwa) { minify_files.push('static/js/sw_load.js'); @@ -319,7 +319,7 @@ function bundle(bpath,js_prestyle,js_switcher,js_email_encode,js_copycode,search return minify_files; } -function minify(fileA,outfile) { +function minify(fileA, outfile) { const options = { mangle: true, compress: { @@ -339,10 +339,10 @@ function minify(fileA,outfile) { } } if (!outfile) {// outfile parameter omitted, infer based on input - outfile = fileA[0].slice(0,-2)+'min.js'; + outfile = fileA[0].slice(0, -2) + 'min.js'; } var filesContents = fileA.map(function (file) {// array input to support multiple files - return fs.readFileSync(file, 'utf8'); + return fs.readFileSync(file, 'utf8'); }); result = UglifyJS.minify(filesContents, options); @@ -352,7 +352,7 @@ function minify(fileA,outfile) { async function searchChange(searchOption) { const { replaceInFileSync } = await import('replace-in-file'); - replaceInFileSync({files: 'config.toml', from: /search_library.*=.*/g, to: 'search_library = \"'+searchOption+'\"'}); + replaceInFileSync({ files: 'config.toml', from: /search_library.*=.*/g, to: 'search_library = \"' + searchOption + '\"' }); } if (args === ' offline') { @@ -388,7 +388,7 @@ async function createPagefindIndex() { // Convert each lang in langArray to a promise that performs the desired operations const promises = langArray.map((lang) => (async () => { - const filePath = path.join(__dirname,"public/search_index." + lang + ".json"); + const filePath = path.join(__dirname, "public/search_index." + lang + ".json"); // Read the file content synchronously (consider using async readFile for better performance) const fileContent = fs.readFileSync(filePath); @@ -414,7 +414,7 @@ async function createPagefindIndex() { .then(async () => { // Write the index files to disk const { errors } = await index.writeFiles({ - outputPath: "./static/js/", + outputPath: path.join(__dirname, "./static/js/"), }); if (errors.length > 0) { console.log("Errors: ", errors); @@ -434,7 +434,7 @@ async function createPagefindIndex() { fs.writeFileSync(pagefindPath, pagefindContent); // now insert the CJS into the anonymous function within pagefind.search.js - const pagefind_searchPath = path.join(__dirname, "static/js/pagefind.search.js");//file to insert into + const pagefind_searchPath = path.join(bpath, "static/js/pagefind.search.js");//file to insert into const search_pagefindPath = path.join(__dirname, "static/js/pagefind_search.js");//output let pagefind_searchContent = fs.readFileSync(pagefind_searchPath, "utf8"); // Now insert into pagefind.search.js at this location: //insertHere @@ -463,6 +463,8 @@ async function sync() { const staticFolder = path.join(__dirname, "static/js"); const submoduleFolder = path.join(__dirname, "themes/abridge/static/js"); + fs.mkdirSync(staticFolder, { recursive: true }); + const files = fs.readdirSync(staticFolder); files.forEach((file) => { diff --git a/static/_headers b/static/_headers index ccca3e16..64fe45e0 100644 --- a/static/_headers +++ b/static/_headers @@ -8,7 +8,7 @@ Referrer-Policy: strict-origin-when-cross-origin Strict-Transport-Security: max-age=63072000; includeSubdomains Permissions-Policy: interest-cohort=(), accelerometer=(), ambient-light-sensor=(), battery=(), bluetooth=(), browsing-topics=(), camera=(), display-capture=(), document-domain=(), encrypted-media=(), execution-while-not-rendered=(), execution-while-out-of-viewport=(), fullscreen=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), identity-credentials-get=(), idle-detection=(), magnetometer=(), microphone=(), midi=(), otp-credentials=(), payment=(), picture-in-picture=(), publickey-credentials-create=(), publickey-credentials-get=(), serial=(), storage-access=(), sync-xhr=(), usb=(), web-share=(), window-management=(), xr-spatial-tracking=() - Content-Security-Policy: default-src 'none'; frame-ancestors 'none'; object-src 'none'; base-uri 'self'; manifest-src 'self'; worker-src 'self'; form-action 'self'; connect-src 'self' *.hyvor.com ws://*.hyvor.com; script-src 'self' talk.hyvor.com; img-src 'self' data: talk.hyvor.com cdn.cloudflare.com; frame-src 'self' www.youtube-nocookie.com player.vimeo.com streamable.com www.streamable.com; media-src 'self' data: cdn.cloudflare.com www.youtube-nocookie.com player.vimeo.com; font-src 'self' cdn.cloudflare.com cdn.jsdelivr.net fonts.gstatic.com; style-src 'self' talk.hyvor.com cdn.cloudflare.com cdn.jsdelivr.net fonts.googleapis.com; + Content-Security-Policy: default-src 'none'; frame-ancestors 'none'; object-src 'none'; base-uri 'self'; manifest-src 'self'; worker-src 'self'; form-action 'self'; connect-src 'self' *.hyvor.com ws://*.hyvor.com; script-src 'wasm-unsafe-eval' 'self' talk.hyvor.com; img-src 'self' data: talk.hyvor.com cdn.cloudflare.com; frame-src 'self' www.youtube-nocookie.com player.vimeo.com streamable.com www.streamable.com; media-src 'self' data: cdn.cloudflare.com www.youtube-nocookie.com player.vimeo.com; font-src 'self' cdn.cloudflare.com cdn.jsdelivr.net fonts.gstatic.com; style-src 'self' talk.hyvor.com cdn.cloudflare.com cdn.jsdelivr.net fonts.googleapis.com; /*.js Cache-Control: public, max-age=604800, must-revalidate diff --git a/static/js/abridge.min.js b/static/js/abridge.min.js index 58ebeeae..c7d455d6 100644 --- a/static/js/abridge.min.js +++ b/static/js/abridge.min.js @@ -1 +1,2 @@ -let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),!function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var l,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,C,D,F,k,L,_,N,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i=n&&r-1>=o;)s[n]!==u[o]?s[n]u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length

'.concat(document.getElementById("searchinput").value,"

");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,a=s[p].split(/[\s\n]/),l=8;for(u in a){if(0<(S=a[u]).length){for(var c in n)elasticlunr.stemmer(S).startsWith(n[c])&&(l=40,o=!0);r.push([S,l,i]),l=2}i=i+S.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300"),y=S[2]+S[0].length;40===S[1]||S[0].length<12||/^[\x00-\xff]+$/.test(S[0])?v.push(e.substring(S[2],y)):(x=function(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u")}return v.push("…"),v.join("")}(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)},"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.12.1",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file +let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),window.onload=function(){if(document.body.contains(document.goSearch)){var e=!1;document.goSearch.onsubmit=function(){return goSearchNow()};{async function A(){W()}function I(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),r=t.cloneNode(!0),n=(r.id="results",document.createElement("div")),a='

'.concat(document.getElementById("searchinput").value,"

");return n.innerHTML=a,r.insertBefore(n,r.firstChild),e.innerHTML=r.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function r(e,t){for(var r=new m(31),n=0;n<31;++n)r[n]=t+=1<>>0;return h().set(e,t),p=e.length,t}function w(t,r,e){if(void 0===e){var n=c.encode(t);let e=r(n.length,1)>>>0;return h().subarray(e,e+n.length).set(n),p=n.length,e}let a=t.length,i=r(a,1)>>>0;var s=h();let o=0;for(;o>>0,n=h().subarray(i+o,i+a),r=d(t,n),o+=r.written,i=e(i,a,o,1)>>>0),p=o,i}function y(){return a=null!==a&&0!==a.byteLength?a:new Int32Array(_.memory.buffer)}function b(e,t){return e>>>=0,i.decode(h().subarray(e,e+t))}function l(){var e={wbg:{}};return e}function u(e,t){return _=e.exports,f.__wbindgen_wasm_module=t,a=null,n=null,_}async function f(e){if(void 0!==_)return _;void 0===e&&void 0!==r&&(e=r.replace(/\.js$/,"_bg.wasm"));var t=l(),{instance:e,module:t}=await(async(t,e)=>{if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(e){if("application/wasm"==t.headers.get("Content-Type"))throw e}var r=await t.arrayBuffer();return WebAssembly.instantiate(r,e)}return(r=await WebAssembly.instantiate(t,e))instanceof WebAssembly.Instance?{instance:r,module:t}:r})(await(e="string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL?fetch(e):e),t);return u(e,t)}var g={};let r,_=(void 0!==document&&null!==document.currentScript&&(r=new URL("UNHANDLED",location.href).toString()),void 0),n=null,p=0,c=(g.init_pagefind=function(e){var e=o(e,_.__wbindgen_malloc),t=p;return _.init_pagefind(e,t)>>>0},"undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}}),d="function"==typeof c.encodeInto?function(e,t){return c.encodeInto(e,t)}:function(e,t){var r=c.encode(e);return t.set(r),{read:e.length,written:r.length}},a=(g.set_ranking_weights=function(e,t){var t=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=p;return _.set_ranking_weights(e,t,r)>>>0},g.load_index_chunk=function(e,t){var t=o(t,_.__wbindgen_malloc),r=p;return _.load_index_chunk(e,t,r)>>>0},g.load_filter_chunk=function(e,t){var t=o(t,_.__wbindgen_malloc),r=p;return _.load_filter_chunk(e,t,r)>>>0},g.add_synthetic_filter=function(e,t){var t=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=p;return _.add_synthetic_filter(e,t,r)>>>0},null),i="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&i.decode(),g.request_indexes=function(e,t){let r,n;try{var a=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=p,o=(_.request_indexes(a,e,i,s),y()[a/4+0]),l=y()[a/4+1];return b(r=o,n=l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(r,n,1)}},g.request_filter_indexes=function(e,t){let r,n;try{var a=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=p,o=(_.request_filter_indexes(a,e,i,s),y()[a/4+0]),l=y()[a/4+1];return b(r=o,n=l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(r,n,1)}},g.request_all_filter_indexes=function(e){let t,r;try{var n=_.__wbindgen_add_to_stack_pointer(-16),a=(_.request_all_filter_indexes(n,e),y()[n/4+0]),i=y()[n/4+1];return b(t=a,r=i)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,r,1)}},g.filters=function(e){let t,r;try{var n=_.__wbindgen_add_to_stack_pointer(-16),a=(_.filters(n,e),y()[n/4+0]),i=y()[n/4+1];return b(t=a,r=i)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,r,1)}},g.search=function(e,t,r,n,a){let i,s;try{var o=_.__wbindgen_add_to_stack_pointer(-16),l=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),c=p,d=w(r,_.__wbindgen_malloc,_.__wbindgen_realloc),h=p,u=w(n,_.__wbindgen_malloc,_.__wbindgen_realloc),f=p,g=(_.search(o,e,l,c,d,h,u,f,a),y()[o/4+0]),m=y()[o/4+1];return b(i=g,s=m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(i,s,1)}},s=Object.assign(f,{initSync:function(e){var t;return void 0!==_?_:(t=l(),e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),u(new WebAssembly.Instance(e,t),e))}},g)}var n,j=Uint8Array,m=Uint16Array,c=Uint32Array,O=new j([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),$=new j([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),X=new j([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),H=(g=r(O,2))[0],K=(g[1][H[28]=258]=28,(g=r($,0))[0]),_=new m(32768);for(p=0;p<32768;++p)_[p]=((65280&(n=(61680&(n=(52428&(n=(43690&p)>>>1|(21845&p)<<1))>>>2|(13107&n)<<2))>>>4|(3855&n)<<4))>>>8|(255&n)<<8)>>>1;var J=function(e,t,r){for(var n=e.length,a=0,i=new m(t);a>>l]=c}else for(o=new m(n),a=0;a>>15-e[a]);return o},i=new j(288);for(p=0;p<144;++p)i[p]=8;for(p=144;p<256;++p)i[p]=9;for(p=256;p<280;++p)i[p]=7;for(p=280;p<288;++p)i[p]=8;var p,v=new j(32);for(p=0;p<32;++p)v[p]=5;var Q=J(i,9,1),Z=J(v,5,1),G=function(e){for(var t=e[0],r=1;r>(7&t)&r},Y=function(e,t){var r=t/8|0;return(e[r]|e[1+r]<<8|e[2+r]<<16)>>(7&t)},ee=function(e){return(e+7)/8|0},te=function(e,t,r){null!=r&&r<=e.length||(r=e.length);var n=new(2==e.BYTES_PER_ELEMENT?m:4==e.BYTES_PER_ELEMENT?c:j)(r-(t=null!=t&&0<=t?t:0));return n.set(e.subarray(t,r)),n},U=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],V=function(e,t,r){t=Error(t||U[e]);if(t.code=e,Error.captureStackTrace&&Error.captureStackTrace(t,V),r)return t;throw t},g=new j(0),k="undefined"!=typeof TextDecoder&&new TextDecoder;try{k.decode(g,{stream:!0})}catch(e){}var q=function(e,t){function r(e){var t=a.length;t{31==e[0]&&139==e[1]&&8==e[2]||V(6,"invalid gzip data");var t=e[3],r=10;4&t&&(r+=e[10]|2+(e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);0>>0)),i=void 0,s=n.length;if(!s||i&&i.f&&!i.l)return a||new j(0);var o=!a||i,l=!i||i.i,c=(i=i||{},a=a||new j(3*s),i.f||0),d=i.p||0,h=i.b||0,u=i.l,f=i.d,g=i.m,m=i.n,_=8*s;do{if(!u){c=z(n,d,1);var p=z(n,d+1,3);if(d+=3,!p){var w=ee(d)+4,y=n[w-4]|n[w-3]<<8,b=w+y;if(s>>4)<16)E[P++]=w;else{var S=0,F=0;for(16==w?(F=3+z(n,d,3),d+=2,S=E[P-1]):17==w?(F=3+z(n,d,7),d+=3):18==w&&(F=11+z(n,d,127),d+=7);F--;)E[P++]=S}}var C=E.subarray(0,y),T=E.subarray(y);g=G(C),m=G(T),u=J(C,g,1),f=J(T,m,1)}else V(1);if(_>>4;if(_<(d+=15&S)){l&&V(0);break}if(S||V(2),I<256)a[h++]=I;else{if(256==I){A=d,u=null;break}var U,q=I-254,I=(264>>4,T=(I||V(3),d+=15&I,K[M]);if(3{if(0===e.length)return 0;var r,n=[];for(r of e)n[r.location]=n[r.location]||0,n[r.location]+=r.balanced_score;if(n.length<=t)return 0;let a=n.slice(0,t).reduce((e,t)=>e+t,0),i=a,s=[0];for(let e=0;ea?(a=i,s=[e]):i===a&&s[s.length-1]===e-1&&s.push(e)}return s[Math.floor(s.length/2)]},x=(e,t,r,n,a,i)=>{var s,o=e.includes("​");let l=[];l=o?e.split("​"):e.split(/[\r\n\s]+/g);for(s of n)l[s]?.startsWith("")||(l[s]=`${l[s]}`);e=i??l.length,n=a??0;return(t=enew Promise(e=>setTimeout(e,t)),L=class{constructor(e={}){this.version="1.1.1",this.backend=s,this.decoder=new TextDecoder("utf-8"),this.wasm=null,this.basePath=e.basePath||"/pagefind/",this.primary=e.primary||!1,this.primary&&!e.basePath&&this.initPrimary(),/[^\/]$/.test(this.basePath)&&(this.basePath=this.basePath+"/"),window?.location?.origin&&this.basePath.startsWith(window.location.origin)&&(this.basePath=this.basePath.replace(window.location.origin,"")),this.baseUrl=e.baseUrl||this.defaultBaseUrl(),/^(\/|https?:\/\/)/.test(this.baseUrl)||(this.baseUrl="/"+this.baseUrl),this.indexWeight=e.indexWeight??1,this.excerptLength=e.excerptLength??30,this.mergeFilter=e.mergeFilter??{},this.ranking=e.ranking,this.highlightParam=e.highlightParam??null,this.loaded_chunks={},this.loaded_filters={},this.loaded_fragments={},this.raw_ptr=null,this.searchMeta=null,this.languages=null}initPrimary(){}defaultBaseUrl(){return this.basePath.match(/^(.*\/)_?pagefind/)?.[1]||"/"}async options(e){var t,r,n,a,i=["basePath","baseUrl","indexWeight","excerptLength","mergeFilter","highlightParam","ranking"];for([t,r]of Object.entries(e))"mergeFilter"===t?(n=this.stringifyFilters(r),a=await this.getPtr(),this.raw_ptr=this.backend.add_synthetic_filter(a,n)):"ranking"===t?await this.set_ranking(e.ranking):i.includes(t)&&("basePath"===t&&"string"==typeof r&&(this.basePath=r),"baseUrl"===t&&"string"==typeof r&&(this.baseUrl=r),"indexWeight"===t&&"number"==typeof r&&(this.indexWeight=r),"excerptLength"===t&&"number"==typeof r&&(this.excerptLength=r),"mergeFilter"===t&&"object"==typeof r&&(this.mergeFilter=r),"highlightParam"===t)&&"string"==typeof r&&(this.highlightParam=r)}decompress(e,t=0){return"pagefind_dcd"!==this.decoder.decode(e.slice(0,12))&&(e=q(e),"pagefind_dcd"!==this.decoder.decode(e.slice(0,12)))?e:e.slice(12)}async set_ranking(e){var t;e&&(e={term_similarity:e.termSimilarity??null,page_length:e.pageLength??null,term_saturation:e.termSaturation??null,term_frequency:e.termFrequency??null},t=await this.getPtr(),this.raw_ptr=this.backend.set_ranking_weights(t,JSON.stringify(e)))}async init(e,t){await this.loadEntry();var e=this.findIndex(e),r=e.wasm||"unknown",e=[this.loadMeta(e.hash)];!0===t.load_wasm&&e.push(this.loadWasm(r)),await Promise.all(e),this.raw_ptr=this.backend.init_pagefind(new Uint8Array(this.searchMeta)),Object.keys(this.mergeFilter)?.length&&(t=this.stringifyFilters(this.mergeFilter),r=await this.getPtr(),this.raw_ptr=this.backend.add_synthetic_filter(r,t)),this.ranking&&await this.set_ranking(this.ranking)}async loadEntry(){try{var e=await(await fetch(this.basePath+"pagefind-entry-1728241819.json")).json();this.languages=e.languages,e.version!==this.version&&this.primary}catch(e){throw Error("Failed to load Pagefind metadata")}}findIndex(e){if(this.languages){var t=this.languages[e];if(t)return t;if(t=this.languages[e.split("-")[0]])return t;e=Object.values(this.languages).sort((e,t)=>t.page_count-e.page_count);if(e[0])return e[0]}throw Error("Pagefind Error: No language indexes found.")}async loadMeta(e){try{var t=await(await fetch(this.basePath+`pagefind.${e}.pf_meta`)).arrayBuffer();this.searchMeta=this.decompress(new Uint8Array(t),"Pagefind metadata")}catch(e){}}async loadWasm(e){try{var t=this.basePath+`wasm.${e}.pagefind`,r=await(await fetch(t)).arrayBuffer(),n=this.decompress(new Uint8Array(r),"Pagefind WebAssembly");if(!n)throw Error("No WASM after decompression");this.wasm=await this.backend(n)}catch(e){throw Error(`Failed to load the Pagefind WASM: +`+e?.toString())}}async _loadGenericChunk(e,t){try{var r=await(await fetch(e)).arrayBuffer(),n=this.decompress(new Uint8Array(r),e),a=await this.getPtr();this.raw_ptr=this.backend[t](a,n)}catch(e){}}async loadChunk(e){var t;return this.loaded_chunks[e]||(t=this.basePath+`index/${e}.pf_index`,this.loaded_chunks[e]=this._loadGenericChunk(t,"load_index_chunk")),this.loaded_chunks[e]}async loadFilterChunk(e){var t;return this.loaded_filters[e]||(t=this.basePath+`filter/${e}.pf_filter`,this.loaded_filters[e]=this._loadGenericChunk(t,"load_filter_chunk")),this.loaded_filters[e]}async _loadFragment(e){var t=await(await fetch(this.basePath+`fragment/${e}.pf_fragment`)).arrayBuffer(),t=this.decompress(new Uint8Array(t),"Fragment "+e);return JSON.parse((new TextDecoder).decode(t))}async loadFragment(e,t=[],r){this.loaded_fragments[e]||(this.loaded_fragments[e]=this._loadFragment(e));e=await this.loaded_fragments[e],e.weighted_locations=t,e.locations=t.map(e=>e.location),e.raw_content||(e.raw_content=e.content.replace(//g,">"),e.content=e.content.replace(/\u200B/g,"")),e.raw_url||(e.raw_url=e.url),e.url=this.processedUrl(e.raw_url,r),r=E(t,this.excerptLength);return e.excerpt=x(e.raw_content,r,this.excerptLength,e.locations),e.sub_results=((n,a)=>{var r=n.anchors.filter(e=>/h\d/i.test(e.element)&&e.text?.length&&/\S/.test(e.text)).sort((e,t)=>e.location-t.location);let i=[],s=0,o={title:n.meta.title,url:n.url,weighted_locations:[],locations:[],excerpt:""};var l,c=e=>{var t,r;o.locations.length&&(t=o.weighted_locations.map(e=>({weight:e.weight,balanced_score:e.balanced_score,location:e.location-s})),t=E(t,a)+s,r=e?Math.min(e-t,a):a,o.excerpt=x(n.raw_content??"",t,r,o.locations,s,e),i.push(o))};for(l of n.weighted_locations)if(!r.length||l.location=r[0].location;)e=r.shift();let t=n.url;try{var d,h,u=/^((https?:)?\/\/)/.test(t);t=u?((d=new URL(t)).hash=e.id,""+d):(/^\//.test(t)||(t="/"+t),(h=new URL("https://example.com"+t)).hash=e.id,(""+h).replace(/^https:\/\/example.com/,""))}catch(e){}s=e.location,o={title:e.text,url:t,anchor:e,weighted_locations:[l],locations:[l.location],excerpt:""}}return c(r[0]?.location),i})(e,this.excerptLength),e}fullUrl(e){return/^(https?:)?\/\//.test(e)?e:(this.baseUrl+"/"+e).replace(/\/+/g,"/").replace(/^(https?:\/)/,"$1/")}processedUrl(t,r){t=this.fullUrl(t);if(null===this.highlightParam)return t;r=r.split(/\s+/);try{var e,n=new URL(t);for(e of r)n.searchParams.append(this.highlightParam,e);return n.toString()}catch(e){try{var a,i=new URL("https://example.com"+t);for(a of r)i.searchParams.append(this.highlightParam,a);return i.toString().replace(/^https:\/\/example\.com/,"")}catch(e){return t}}}async getPtr(){for(;null===this.raw_ptr;)await P(50);if(this.raw_ptr)return this.raw_ptr;throw Error("Pagefind: WASM Error (No pointer)")}parseFilters(e){var t={};if(e)for(var r of e.split("__PF_FILTER_DELIM__")){var n,[a,r]=r.split(/:(.*)$/);if(t[a]={},r)for(var i of r.split("__PF_VALUE_DELIM__"))i&&(i=i.match(/^(.*):(\d+)$/))&&([,i,n]=i,t[a][i]=parseInt(n)??n)}return t}stringifyFilters(e={}){return JSON.stringify(e)}stringifySorts(e={}){var t,r,n=Object.entries(e);for([t,r]of n)return n.length,"asc"!==r&&r,t+":"+r;return""}async filters(){var e=await this.getPtr(),t=this.backend.request_all_filter_indexes(e).split(" ").filter(e=>e).map(e=>this.loadFilterChunk(e)),t=(await Promise.all([...t]),e=await this.getPtr(),this.backend.filters(e));return this.parseFilters(t)}async preload(e,t={}){await this.search(e,{...t,preload:!0})}async search(i,t={}){t={verbose:!1,filters:{},sort:{},...t};let s=e=>{t.verbose};s(this.basePath);var e,r,n,a=await this.getPtr(),o=null===i,l=(i=i??"",/^\s*".+"\s*$/.test(i));return l&&s(),i=i.toLowerCase().trim().replace(/[\.`~!@#\$%\^&\*\(\)\{\}\[\]\\\|:;'",<>\/\?\-]/g,"").replace(/\s{2,}/g," ").trim(),s(),i?.length||o?(o=this.stringifySorts(t.sort),s(),r=this.stringifyFilters(t.filters),s(),n=this.backend.request_indexes(a,i),e=this.backend.request_filter_indexes(a,r),n=n.split(" ").filter(e=>e).map(e=>this.loadChunk(e)),e=e.split(" ").filter(e=>e).map(e=>this.loadFilterChunk(e)),await Promise.all([...n,...e]),s(),t.preload?(s(),null):(a=await this.getPtr(),n=this.backend.search(a,i,r,o,l),[e,a,r,o]=(s(),n.split(/:([^:]*):(.*)__PF_UNFILTERED_DELIM__(.*)$/)),l=this.parseFilters(r),r=this.parseFilters(o),s(JSON.stringify(n)),n=(o=a.length?a.split(" "):[]).map(e=>{let[t,r,n]=e.split("@"),a=(s(t),n.length?n.split(",").map(e=>{var[e,t,r]=e.split(">");return{weight:parseInt(e)/24,balanced_score:parseFloat(t),location:parseInt(r)}}):[]);e=a.map(e=>e.location);return{id:t,score:parseFloat(r)*this.indexWeight,words:e,data:async()=>this.loadFragment(t,a,i)}}),s((o.length,o.length)),{results:n,unfilteredResultCount:parseInt(e),filters:l,totalFilters:r,timings:{preload:0,search:0,total:0}})):{results:[],unfilteredResultCount:0,filters:{},totalFilters:{},timings:{preload:0,search:0,total:0}}}},M=class{constructor(e={}){this.backend=s,this.primaryLanguage="unknown",this.searchID=0,this.primary=new L({...e,primary:!0}),this.instances=[this.primary],this.init(e?.language)}async options(e){await this.primary.options(e)}async init(e){var t;document?.querySelector&&(t=document.querySelector("html")?.getAttribute("lang")||"unknown",this.primaryLanguage=t.toLocaleLowerCase()),await this.primary.init(e||this.primaryLanguage,{load_wasm:!0})}async mergeIndex(e,t={}){if(!this.primary.basePath.startsWith(e)){e=new L({primary:!1,basePath:e});for(this.instances.push(e);null===this.primary.wasm;)await P(50);await e.init(t.language||this.primaryLanguage,{load_wasm:!1}),delete t.language,await e.options(t)}}mergeFilters(e){var t,r={};for(t of e)for(var[n,a]of Object.entries(t))if(r[n]){var i,s,o=r[n];for([i,s]of Object.entries(a))o[i]=(o[i]||0)+s}else r[n]=a;return r}async filters(){var e=await Promise.all(this.instances.map(e=>e.filters()));return this.mergeFilters(e)}async preload(t,r={}){await Promise.all(this.instances.map(e=>e.preload(t,r)))}async debouncedSearch(e,t,r){var n=++this.searchID;return this.preload(e,t),await P(r),n!==this.searchID||(r=await this.search(e,t),n!==this.searchID)?null:r}async search(t,r={}){var e=await Promise.all(this.instances.map(e=>e.search(t,r))),n=this.mergeFilters(e.map(e=>e.filters)),a=this.mergeFilters(e.map(e=>e.totalFilters)),i=e.map(e=>e.results).flat().sort((e,t)=>t.score-e.score),s=e.map(e=>e.timings);return{results:i,unfilteredResultCount:e.reduce((e,t)=>e+t.unfilteredResultCount,0),filters:n,totalFilters:a,timings:s}}},S=void 0,F=void 0,W=()=>{S=S||new M(F??{})},C=document.getElementById("suggestions"),T=document.getElementById("searchinput");document.documentElement.getAttribute("lang").substring(0,2),(async e=>{S?await S.options(e):F=e})({basePath:(k="/"==(k=document.querySelector("meta[name='base']").getAttribute("content")).slice(-1)?k.slice(0,-1):k)+"/js/"}),T.addEventListener("input",async function(){var e,r,n,i=this.value.trim(),s=(s=i,W(),await S.search(s,e)),o=C.childNodes,l=s.results.length;i.split(/\s+/),C.classList.remove("d-none");for(n of s.results){var c=await n.data();""!==c.content&&((r=document.createElement("div")).innerHTML="",a=r.querySelector("a"),t=r.querySelector("span:first-child"),d=r.querySelector("span:nth-child(2)"),a.href=c.url,t.textContent=c.meta.title,d.innerHTML=c.excerpt.replace(/\{\{.*?\}\}|—|<(?!\/?mark\b).*?>|<.*?>/g,""),C.appendChild(r))}for(;o.length>l;)C.removeChild(o[0])},!0),C.addEventListener("click",function(){for(;C.lastChild;)C.removeChild(C.lastChild);return!1},!0),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),T.focus(),C.classList.remove("d-none")),27===t.keyCode){T.blur(),C.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var r=C.querySelectorAll("a");if(!C.classList.contains("d-none")&&0!==r.length){var n=[...r],a=n.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),r[e=0{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file diff --git a/static/js/abridge_nopwa.min.js b/static/js/abridge_nopwa.min.js index 9cf16015..0a490158 100644 --- a/static/js/abridge_nopwa.min.js +++ b/static/js/abridge_nopwa.min.js @@ -1 +1,2 @@ -let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),!function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,C,D,F,k,L,_,N,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i=n&&r-1>=o;)s[n]!==u[o]?s[n]u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length

'.concat(document.getElementById("searchinput").value,"

");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(S=l[u]).length){for(var c in n)elasticlunr.stemmer(S).startsWith(n[c])&&(a=40,o=!0);r.push([S,a,i]),a=2}i=i+S.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300"),y=S[2]+S[0].length;40===S[1]||S[0].length<12||/^[\x00-\xff]+$/.test(S[0])?v.push(e.substring(S[2],y)):(x=function(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u")}return v.push("…"),v.join("")}(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)}; \ No newline at end of file +let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),window.onload=function(){if(document.body.contains(document.goSearch)){var e=!1;document.goSearch.onsubmit=function(){return goSearchNow()};{async function A(){B()}function I(){var e=document.querySelector("main"),t=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),n=t.cloneNode(!0),r=(n.id="results",document.createElement("div")),a='

'.concat(document.getElementById("searchinput").value,"

");return r.innerHTML=a,n.insertBefore(r,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function n(e,t){for(var n=new m(31),r=0;r<31;++r)n[r]=t+=1<>>0;return h().set(e,t),p=e.length,t}function w(t,n,e){if(void 0===e){var r=c.encode(t);let e=n(r.length,1)>>>0;return h().subarray(e,e+r.length).set(r),p=r.length,e}let a=t.length,i=n(a,1)>>>0;var s=h();let o=0;for(;o>>0,r=h().subarray(i+o,i+a),n=d(t,r),o+=n.written,i=e(i,a,o,1)>>>0),p=o,i}function y(){return a=null!==a&&0!==a.byteLength?a:new Int32Array(_.memory.buffer)}function b(e,t){return e>>>=0,i.decode(h().subarray(e,e+t))}function l(){var e={wbg:{}};return e}function u(e,t){return _=e.exports,f.__wbindgen_wasm_module=t,a=null,r=null,_}async function f(e){if(void 0!==_)return _;void 0===e&&void 0!==n&&(e=n.replace(/\.js$/,"_bg.wasm"));var t=l(),{instance:e,module:t}=await(async(t,e)=>{if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(e){if("application/wasm"==t.headers.get("Content-Type"))throw e}var n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}return(n=await WebAssembly.instantiate(t,e))instanceof WebAssembly.Instance?{instance:n,module:t}:n})(await(e="string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL?fetch(e):e),t);return u(e,t)}var g={};let n,_=(void 0!==document&&null!==document.currentScript&&(n=new URL("UNHANDLED",location.href).toString()),void 0),r=null,p=0,c=(g.init_pagefind=function(e){var e=o(e,_.__wbindgen_malloc),t=p;return _.init_pagefind(e,t)>>>0},"undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}}),d="function"==typeof c.encodeInto?function(e,t){return c.encodeInto(e,t)}:function(e,t){var n=c.encode(e);return t.set(n),{read:e.length,written:n.length}},a=(g.set_ranking_weights=function(e,t){var t=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=p;return _.set_ranking_weights(e,t,n)>>>0},g.load_index_chunk=function(e,t){var t=o(t,_.__wbindgen_malloc),n=p;return _.load_index_chunk(e,t,n)>>>0},g.load_filter_chunk=function(e,t){var t=o(t,_.__wbindgen_malloc),n=p;return _.load_filter_chunk(e,t,n)>>>0},g.add_synthetic_filter=function(e,t){var t=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=p;return _.add_synthetic_filter(e,t,n)>>>0},null),i="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&i.decode(),g.request_indexes=function(e,t){let n,r;try{var a=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=p,o=(_.request_indexes(a,e,i,s),y()[a/4+0]),l=y()[a/4+1];return b(n=o,r=l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(n,r,1)}},g.request_filter_indexes=function(e,t){let n,r;try{var a=_.__wbindgen_add_to_stack_pointer(-16),i=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=p,o=(_.request_filter_indexes(a,e,i,s),y()[a/4+0]),l=y()[a/4+1];return b(n=o,r=l)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(n,r,1)}},g.request_all_filter_indexes=function(e){let t,n;try{var r=_.__wbindgen_add_to_stack_pointer(-16),a=(_.request_all_filter_indexes(r,e),y()[r/4+0]),i=y()[r/4+1];return b(t=a,n=i)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,n,1)}},g.filters=function(e){let t,n;try{var r=_.__wbindgen_add_to_stack_pointer(-16),a=(_.filters(r,e),y()[r/4+0]),i=y()[r/4+1];return b(t=a,n=i)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,n,1)}},g.search=function(e,t,n,r,a){let i,s;try{var o=_.__wbindgen_add_to_stack_pointer(-16),l=w(t,_.__wbindgen_malloc,_.__wbindgen_realloc),c=p,d=w(n,_.__wbindgen_malloc,_.__wbindgen_realloc),h=p,u=w(r,_.__wbindgen_malloc,_.__wbindgen_realloc),f=p,g=(_.search(o,e,l,c,d,h,u,f,a),y()[o/4+0]),m=y()[o/4+1];return b(i=g,s=m)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(i,s,1)}},s=Object.assign(f,{initSync:function(e){var t;return void 0!==_?_:(t=l(),e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e)),u(new WebAssembly.Instance(e,t),e))}},g)}var r,j=Uint8Array,m=Uint16Array,c=Uint32Array,O=new j([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),$=new j([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),X=new j([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),H=(g=n(O,2))[0],K=(g[1][H[28]=258]=28,(g=n($,0))[0]),_=new m(32768);for(p=0;p<32768;++p)_[p]=((65280&(r=(61680&(r=(52428&(r=(43690&p)>>>1|(21845&p)<<1))>>>2|(13107&r)<<2))>>>4|(3855&r)<<4))>>>8|(255&r)<<8)>>>1;var J=function(e,t,n){for(var r=e.length,a=0,i=new m(t);a>>l]=c}else for(o=new m(r),a=0;a>>15-e[a]);return o},i=new j(288);for(p=0;p<144;++p)i[p]=8;for(p=144;p<256;++p)i[p]=9;for(p=256;p<280;++p)i[p]=7;for(p=280;p<288;++p)i[p]=8;var p,v=new j(32);for(p=0;p<32;++p)v[p]=5;var Q=J(i,9,1),Z=J(v,5,1),G=function(e){for(var t=e[0],n=1;n>(7&t)&n},Y=function(e,t){var n=t/8|0;return(e[n]|e[1+n]<<8|e[2+n]<<16)>>(7&t)},ee=function(e){return(e+7)/8|0},te=function(e,t,n){null!=n&&n<=e.length||(n=e.length);var r=new(2==e.BYTES_PER_ELEMENT?m:4==e.BYTES_PER_ELEMENT?c:j)(n-(t=null!=t&&0<=t?t:0));return r.set(e.subarray(t,n)),r},U=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],V=function(e,t,n){t=Error(t||U[e]);if(t.code=e,Error.captureStackTrace&&Error.captureStackTrace(t,V),n)return t;throw t},g=new j(0),k="undefined"!=typeof TextDecoder&&new TextDecoder;try{k.decode(g,{stream:!0})}catch(e){}var q=function(e,t){function n(e){var t=a.length;t{31==e[0]&&139==e[1]&&8==e[2]||V(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);0>>0)),i=void 0,s=r.length;if(!s||i&&i.f&&!i.l)return a||new j(0);var o=!a||i,l=!i||i.i,c=(i=i||{},a=a||new j(3*s),i.f||0),d=i.p||0,h=i.b||0,u=i.l,f=i.d,g=i.m,m=i.n,_=8*s;do{if(!u){c=z(r,d,1);var p=z(r,d+1,3);if(d+=3,!p){var w=ee(d)+4,y=r[w-4]|r[w-3]<<8,b=w+y;if(s>>4)<16)E[P++]=w;else{var S=0,F=0;for(16==w?(F=3+z(r,d,3),d+=2,S=E[P-1]):17==w?(F=3+z(r,d,7),d+=3):18==w&&(F=11+z(r,d,127),d+=7);F--;)E[P++]=S}}var C=E.subarray(0,y),T=E.subarray(y);g=G(C),m=G(T),u=J(C,g,1),f=J(T,m,1)}else V(1);if(_>>4;if(_<(d+=15&S)){l&&V(0);break}if(S||V(2),I<256)a[h++]=I;else{if(256==I){A=d,u=null;break}var U,q=I-254,I=(264>>4,T=(I||V(3),d+=15&I,K[M]);if(3{if(0===e.length)return 0;var n,r=[];for(n of e)r[n.location]=r[n.location]||0,r[n.location]+=n.balanced_score;if(r.length<=t)return 0;let a=r.slice(0,t).reduce((e,t)=>e+t,0),i=a,s=[0];for(let e=0;ea?(a=i,s=[e]):i===a&&s[s.length-1]===e-1&&s.push(e)}return s[Math.floor(s.length/2)]},x=(e,t,n,r,a,i)=>{var s,o=e.includes("​");let l=[];l=o?e.split("​"):e.split(/[\r\n\s]+/g);for(s of r)l[s]?.startsWith("")||(l[s]=`${l[s]}`);e=i??l.length,r=a??0;return(t=enew Promise(e=>setTimeout(e,t)),L=class{constructor(e={}){this.version="1.1.1",this.backend=s,this.decoder=new TextDecoder("utf-8"),this.wasm=null,this.basePath=e.basePath||"/pagefind/",this.primary=e.primary||!1,this.primary&&!e.basePath&&this.initPrimary(),/[^\/]$/.test(this.basePath)&&(this.basePath=this.basePath+"/"),window?.location?.origin&&this.basePath.startsWith(window.location.origin)&&(this.basePath=this.basePath.replace(window.location.origin,"")),this.baseUrl=e.baseUrl||this.defaultBaseUrl(),/^(\/|https?:\/\/)/.test(this.baseUrl)||(this.baseUrl="/"+this.baseUrl),this.indexWeight=e.indexWeight??1,this.excerptLength=e.excerptLength??30,this.mergeFilter=e.mergeFilter??{},this.ranking=e.ranking,this.highlightParam=e.highlightParam??null,this.loaded_chunks={},this.loaded_filters={},this.loaded_fragments={},this.raw_ptr=null,this.searchMeta=null,this.languages=null}initPrimary(){}defaultBaseUrl(){return this.basePath.match(/^(.*\/)_?pagefind/)?.[1]||"/"}async options(e){var t,n,r,a,i=["basePath","baseUrl","indexWeight","excerptLength","mergeFilter","highlightParam","ranking"];for([t,n]of Object.entries(e))"mergeFilter"===t?(r=this.stringifyFilters(n),a=await this.getPtr(),this.raw_ptr=this.backend.add_synthetic_filter(a,r)):"ranking"===t?await this.set_ranking(e.ranking):i.includes(t)&&("basePath"===t&&"string"==typeof n&&(this.basePath=n),"baseUrl"===t&&"string"==typeof n&&(this.baseUrl=n),"indexWeight"===t&&"number"==typeof n&&(this.indexWeight=n),"excerptLength"===t&&"number"==typeof n&&(this.excerptLength=n),"mergeFilter"===t&&"object"==typeof n&&(this.mergeFilter=n),"highlightParam"===t)&&"string"==typeof n&&(this.highlightParam=n)}decompress(e,t=0){return"pagefind_dcd"!==this.decoder.decode(e.slice(0,12))&&(e=q(e),"pagefind_dcd"!==this.decoder.decode(e.slice(0,12)))?e:e.slice(12)}async set_ranking(e){var t;e&&(e={term_similarity:e.termSimilarity??null,page_length:e.pageLength??null,term_saturation:e.termSaturation??null,term_frequency:e.termFrequency??null},t=await this.getPtr(),this.raw_ptr=this.backend.set_ranking_weights(t,JSON.stringify(e)))}async init(e,t){await this.loadEntry();var e=this.findIndex(e),n=e.wasm||"unknown",e=[this.loadMeta(e.hash)];!0===t.load_wasm&&e.push(this.loadWasm(n)),await Promise.all(e),this.raw_ptr=this.backend.init_pagefind(new Uint8Array(this.searchMeta)),Object.keys(this.mergeFilter)?.length&&(t=this.stringifyFilters(this.mergeFilter),n=await this.getPtr(),this.raw_ptr=this.backend.add_synthetic_filter(n,t)),this.ranking&&await this.set_ranking(this.ranking)}async loadEntry(){try{var e=await(await fetch(this.basePath+"pagefind-entry-1728241819.json")).json();this.languages=e.languages,e.version!==this.version&&this.primary}catch(e){throw Error("Failed to load Pagefind metadata")}}findIndex(e){if(this.languages){var t=this.languages[e];if(t)return t;if(t=this.languages[e.split("-")[0]])return t;e=Object.values(this.languages).sort((e,t)=>t.page_count-e.page_count);if(e[0])return e[0]}throw Error("Pagefind Error: No language indexes found.")}async loadMeta(e){try{var t=await(await fetch(this.basePath+`pagefind.${e}.pf_meta`)).arrayBuffer();this.searchMeta=this.decompress(new Uint8Array(t),"Pagefind metadata")}catch(e){}}async loadWasm(e){try{var t=this.basePath+`wasm.${e}.pagefind`,n=await(await fetch(t)).arrayBuffer(),r=this.decompress(new Uint8Array(n),"Pagefind WebAssembly");if(!r)throw Error("No WASM after decompression");this.wasm=await this.backend(r)}catch(e){throw Error(`Failed to load the Pagefind WASM: +`+e?.toString())}}async _loadGenericChunk(e,t){try{var n=await(await fetch(e)).arrayBuffer(),r=this.decompress(new Uint8Array(n),e),a=await this.getPtr();this.raw_ptr=this.backend[t](a,r)}catch(e){}}async loadChunk(e){var t;return this.loaded_chunks[e]||(t=this.basePath+`index/${e}.pf_index`,this.loaded_chunks[e]=this._loadGenericChunk(t,"load_index_chunk")),this.loaded_chunks[e]}async loadFilterChunk(e){var t;return this.loaded_filters[e]||(t=this.basePath+`filter/${e}.pf_filter`,this.loaded_filters[e]=this._loadGenericChunk(t,"load_filter_chunk")),this.loaded_filters[e]}async _loadFragment(e){var t=await(await fetch(this.basePath+`fragment/${e}.pf_fragment`)).arrayBuffer(),t=this.decompress(new Uint8Array(t),"Fragment "+e);return JSON.parse((new TextDecoder).decode(t))}async loadFragment(e,t=[],n){this.loaded_fragments[e]||(this.loaded_fragments[e]=this._loadFragment(e));e=await this.loaded_fragments[e],e.weighted_locations=t,e.locations=t.map(e=>e.location),e.raw_content||(e.raw_content=e.content.replace(//g,">"),e.content=e.content.replace(/\u200B/g,"")),e.raw_url||(e.raw_url=e.url),e.url=this.processedUrl(e.raw_url,n),n=E(t,this.excerptLength);return e.excerpt=x(e.raw_content,n,this.excerptLength,e.locations),e.sub_results=((r,a)=>{var n=r.anchors.filter(e=>/h\d/i.test(e.element)&&e.text?.length&&/\S/.test(e.text)).sort((e,t)=>e.location-t.location);let i=[],s=0,o={title:r.meta.title,url:r.url,weighted_locations:[],locations:[],excerpt:""};var l,c=e=>{var t,n;o.locations.length&&(t=o.weighted_locations.map(e=>({weight:e.weight,balanced_score:e.balanced_score,location:e.location-s})),t=E(t,a)+s,n=e?Math.min(e-t,a):a,o.excerpt=x(r.raw_content??"",t,n,o.locations,s,e),i.push(o))};for(l of r.weighted_locations)if(!n.length||l.location=n[0].location;)e=n.shift();let t=r.url;try{var d,h,u=/^((https?:)?\/\/)/.test(t);t=u?((d=new URL(t)).hash=e.id,""+d):(/^\//.test(t)||(t="/"+t),(h=new URL("https://example.com"+t)).hash=e.id,(""+h).replace(/^https:\/\/example.com/,""))}catch(e){}s=e.location,o={title:e.text,url:t,anchor:e,weighted_locations:[l],locations:[l.location],excerpt:""}}return c(n[0]?.location),i})(e,this.excerptLength),e}fullUrl(e){return/^(https?:)?\/\//.test(e)?e:(this.baseUrl+"/"+e).replace(/\/+/g,"/").replace(/^(https?:\/)/,"$1/")}processedUrl(t,n){t=this.fullUrl(t);if(null===this.highlightParam)return t;n=n.split(/\s+/);try{var e,r=new URL(t);for(e of n)r.searchParams.append(this.highlightParam,e);return r.toString()}catch(e){try{var a,i=new URL("https://example.com"+t);for(a of n)i.searchParams.append(this.highlightParam,a);return i.toString().replace(/^https:\/\/example\.com/,"")}catch(e){return t}}}async getPtr(){for(;null===this.raw_ptr;)await P(50);if(this.raw_ptr)return this.raw_ptr;throw Error("Pagefind: WASM Error (No pointer)")}parseFilters(e){var t={};if(e)for(var n of e.split("__PF_FILTER_DELIM__")){var r,[a,n]=n.split(/:(.*)$/);if(t[a]={},n)for(var i of n.split("__PF_VALUE_DELIM__"))i&&(i=i.match(/^(.*):(\d+)$/))&&([,i,r]=i,t[a][i]=parseInt(r)??r)}return t}stringifyFilters(e={}){return JSON.stringify(e)}stringifySorts(e={}){var t,n,r=Object.entries(e);for([t,n]of r)return r.length,"asc"!==n&&n,t+":"+n;return""}async filters(){var e=await this.getPtr(),t=this.backend.request_all_filter_indexes(e).split(" ").filter(e=>e).map(e=>this.loadFilterChunk(e)),t=(await Promise.all([...t]),e=await this.getPtr(),this.backend.filters(e));return this.parseFilters(t)}async preload(e,t={}){await this.search(e,{...t,preload:!0})}async search(i,t={}){t={verbose:!1,filters:{},sort:{},...t};let s=e=>{t.verbose};s(this.basePath);var e,n,r,a=await this.getPtr(),o=null===i,l=(i=i??"",/^\s*".+"\s*$/.test(i));return l&&s(),i=i.toLowerCase().trim().replace(/[\.`~!@#\$%\^&\*\(\)\{\}\[\]\\\|:;'",<>\/\?\-]/g,"").replace(/\s{2,}/g," ").trim(),s(),i?.length||o?(o=this.stringifySorts(t.sort),s(),n=this.stringifyFilters(t.filters),s(),r=this.backend.request_indexes(a,i),e=this.backend.request_filter_indexes(a,n),r=r.split(" ").filter(e=>e).map(e=>this.loadChunk(e)),e=e.split(" ").filter(e=>e).map(e=>this.loadFilterChunk(e)),await Promise.all([...r,...e]),s(),t.preload?(s(),null):(a=await this.getPtr(),r=this.backend.search(a,i,n,o,l),[e,a,n,o]=(s(),r.split(/:([^:]*):(.*)__PF_UNFILTERED_DELIM__(.*)$/)),l=this.parseFilters(n),n=this.parseFilters(o),s(JSON.stringify(r)),r=(o=a.length?a.split(" "):[]).map(e=>{let[t,n,r]=e.split("@"),a=(s(t),r.length?r.split(",").map(e=>{var[e,t,n]=e.split(">");return{weight:parseInt(e)/24,balanced_score:parseFloat(t),location:parseInt(n)}}):[]);e=a.map(e=>e.location);return{id:t,score:parseFloat(n)*this.indexWeight,words:e,data:async()=>this.loadFragment(t,a,i)}}),s((o.length,o.length)),{results:r,unfilteredResultCount:parseInt(e),filters:l,totalFilters:n,timings:{preload:0,search:0,total:0}})):{results:[],unfilteredResultCount:0,filters:{},totalFilters:{},timings:{preload:0,search:0,total:0}}}},M=class{constructor(e={}){this.backend=s,this.primaryLanguage="unknown",this.searchID=0,this.primary=new L({...e,primary:!0}),this.instances=[this.primary],this.init(e?.language)}async options(e){await this.primary.options(e)}async init(e){var t;document?.querySelector&&(t=document.querySelector("html")?.getAttribute("lang")||"unknown",this.primaryLanguage=t.toLocaleLowerCase()),await this.primary.init(e||this.primaryLanguage,{load_wasm:!0})}async mergeIndex(e,t={}){if(!this.primary.basePath.startsWith(e)){e=new L({primary:!1,basePath:e});for(this.instances.push(e);null===this.primary.wasm;)await P(50);await e.init(t.language||this.primaryLanguage,{load_wasm:!1}),delete t.language,await e.options(t)}}mergeFilters(e){var t,n={};for(t of e)for(var[r,a]of Object.entries(t))if(n[r]){var i,s,o=n[r];for([i,s]of Object.entries(a))o[i]=(o[i]||0)+s}else n[r]=a;return n}async filters(){var e=await Promise.all(this.instances.map(e=>e.filters()));return this.mergeFilters(e)}async preload(t,n={}){await Promise.all(this.instances.map(e=>e.preload(t,n)))}async debouncedSearch(e,t,n){var r=++this.searchID;return this.preload(e,t),await P(n),r!==this.searchID||(n=await this.search(e,t),r!==this.searchID)?null:n}async search(t,n={}){var e=await Promise.all(this.instances.map(e=>e.search(t,n))),r=this.mergeFilters(e.map(e=>e.filters)),a=this.mergeFilters(e.map(e=>e.totalFilters)),i=e.map(e=>e.results).flat().sort((e,t)=>t.score-e.score),s=e.map(e=>e.timings);return{results:i,unfilteredResultCount:e.reduce((e,t)=>e+t.unfilteredResultCount,0),filters:r,totalFilters:a,timings:s}}},S=void 0,F=void 0,B=()=>{S=S||new M(F??{})},C=document.getElementById("suggestions"),T=document.getElementById("searchinput");document.documentElement.getAttribute("lang").substring(0,2),(async e=>{S?await S.options(e):F=e})({basePath:(k="/"==(k=document.querySelector("meta[name='base']").getAttribute("content")).slice(-1)?k.slice(0,-1):k)+"/js/"}),T.addEventListener("input",async function(){var e,n,r,i=this.value.trim(),s=(s=i,B(),await S.search(s,e)),o=C.childNodes,l=s.results.length;i.split(/\s+/),C.classList.remove("d-none");for(r of s.results){var c=await r.data();""!==c.content&&((n=document.createElement("div")).innerHTML="",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=c.url,t.textContent=c.meta.title,d.innerHTML=c.excerpt.replace(/\{\{.*?\}\}|—|<(?!\/?mark\b).*?>|<.*?>/g,""),C.appendChild(n))}for(;o.length>l;)C.removeChild(o[0])},!0),C.addEventListener("click",function(){for(;C.lastChild;)C.removeChild(C.lastChild);return!1},!0),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),T.focus(),C.classList.remove("d-none")),27===t.keyCode){T.blur(),C.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=C.querySelectorAll("a");if(!C.classList.contains("d-none")&&0!==n.length){var r=[...n],a=r.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),!function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.12.1",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file +let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.12.1",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file diff --git a/static/js/abridge_nosearch_nopwa.min.js b/static/js/abridge_nosearch_nopwa.min.js index a262b382..914a0e9d 100644 --- a/static/js/abridge_nosearch_nopwa.min.js +++ b/static/js/abridge_nosearch_nopwa.min.js @@ -1 +1 @@ -let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),!function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}); \ No newline at end of file +let items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),(()=>{for(var e=document.getElementsByClassName("m-protected"),t=0;t{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{let t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}); \ No newline at end of file diff --git a/static/js/pagefind-entry-1728241819.json b/static/js/pagefind-entry-1728241819.json new file mode 100644 index 00000000..241609de --- /dev/null +++ b/static/js/pagefind-entry-1728241819.json @@ -0,0 +1 @@ +{"version":"1.1.1","languages":{"en":{"hash":"en_3c26f37e1b","wasm":"en","page_count":15},"es":{"hash":"es_ae1ee7146e","wasm":"es","page_count":2},"fr":{"hash":"fr_89c85beeef","wasm":"fr","page_count":10}}} \ No newline at end of file diff --git a/static/js/search_elasticlunr.min.js b/static/js/search_elasticlunr.min.js index f57e3ff1..bd266602 100644 --- a/static/js/search_elasticlunr.min.js +++ b/static/js/search_elasticlunr.min.js @@ -1 +1 @@ -!function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,D,F,C,k,_,N,P,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i=n&&r-1>=o;)s[n]!==u[o]?s[n]u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length

'.concat(document.getElementById("searchinput").value,"

");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=function(e,t){var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(S=l[u]).length){for(var c in n)elasticlunr.stemmer(S).startsWith(n[c])&&(a=40,o=!0);r.push([S,a,i]),a=2}i=i+S.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300"),y=S[2]+S[0].length;40===S[1]||S[0].length<12||/^[\x00-\xff]+$/.test(S[0])?v.push(e.substring(S[2],y)):(x=function(e,t){for(var n="",o=!1,i=0,r=0,s=0,u=0;u")}return v.push("…"),v.join("")}(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)}; \ No newline at end of file +!function(){function g(e){var t=new g.Index;return t.pipeline.add(g.trimmer,g.stopWordFilter,g.stemmer),e&&e.call(t,t),t}var a,c,e,t,d,h,f,p,m,v,y,S,x,b,w,I,E,D,F,C,k,_,N,P,n;g.version="0.9.5",((lunr=g).utils={}).warn=(n=this,function(e){n.console}),g.utils.toString=function(e){return null==e?"":e.toString()},(g.EventEmitter=function(){this.events={}}).prototype.addListener=function(){var e=[].slice.call(arguments),t=e.pop();if("function"!=typeof t)throw new TypeError("last argument must be a function");e.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},g.EventEmitter.prototype.removeListener=function(e,t){this.hasHandler(e)&&-1!=(t=this.events[e].indexOf(t))&&(this.events[e].splice(t,1),0==this.events[e].length)&&delete this.events[e]},g.EventEmitter.prototype.emit=function(e){var t;this.hasHandler(e)&&(t=[].slice.call(arguments,1),this.events[e].forEach(function(e){e.apply(void 0,t)},this))},g.EventEmitter.prototype.hasHandler=function(e){return e in this.events},(g.tokenizer=function(e){var t,n;return arguments.length&&null!=e?Array.isArray(e)?(t=(t=e.filter(function(e){return null!=e})).map(function(e){return g.utils.toString(e).toLowerCase()}),n=[],t.forEach(function(e){e=e.split(g.tokenizer.seperator);n=n.concat(e)},this),n):e.toString().trim().toLowerCase().split(g.tokenizer.seperator):[]}).defaultSeperator=/[\s\-]+/,g.tokenizer.seperator=g.tokenizer.defaultSeperator,g.tokenizer.setSeperator=function(e){null!=e&&"object"==typeof e&&(g.tokenizer.seperator=e)},g.tokenizer.resetSeperator=function(){g.tokenizer.seperator=g.tokenizer.defaultSeperator},g.tokenizer.getSeperator=function(){return g.tokenizer.seperator},(g.Pipeline=function(){this._queue=[]}).registeredFunctions={},g.Pipeline.registerFunction=function(e,t){t in g.Pipeline.registeredFunctions&&g.utils.warn("Overwriting existing registered function: "+t),e.label=t,g.Pipeline.registeredFunctions[t]=e},g.Pipeline.getRegisteredFunction=function(e){return e in g.Pipeline.registeredFunctions!=1?null:g.Pipeline.registeredFunctions[e]},g.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||g.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},g.Pipeline.load=function(e){var n=new g.Pipeline;return e.forEach(function(e){var t=g.Pipeline.getRegisteredFunction(e);if(!t)throw Error("Cannot load un-registered function: "+e);n.add(t)}),n},g.Pipeline.prototype.add=function(){[].slice.call(arguments).forEach(function(e){g.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},g.Pipeline.prototype.after=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(1+e,0,t)},g.Pipeline.prototype.before=function(e,t){g.Pipeline.warnIfFunctionNotRegistered(t);e=this._queue.indexOf(e);if(-1==e)throw Error("Cannot find existingFn");this._queue.splice(e,0,t)},g.Pipeline.prototype.remove=function(e){e=this._queue.indexOf(e);-1!=e&&this._queue.splice(e,1)},g.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,o=this._queue.length,i=0;i{if(null===e||"object"!=typeof e)return e;var t,n=e.constructor();for(t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n})(t):null},g.DocumentStore.prototype.getDoc=function(e){return!1===this.hasDoc(e)?null:this.docs[e]},g.DocumentStore.prototype.hasDoc=function(e){return e in this.docs},g.DocumentStore.prototype.removeDoc=function(e){this.hasDoc(e)&&(delete this.docs[e],delete this.docInfo[e],this.length--)},g.DocumentStore.prototype.addFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&(this.docInfo[e]||(this.docInfo[e]={}),this.docInfo[e][t]=n)},g.DocumentStore.prototype.updateFieldLength=function(e,t,n){null!=e&&0!=this.hasDoc(e)&&this.addFieldLength(e,t,n)},g.DocumentStore.prototype.getFieldLength=function(e,t){return null!=e&&e in this.docs&&t in this.docInfo[e]?this.docInfo[e][t]:0},g.DocumentStore.prototype.toJSON=function(){return{docs:this.docs,docInfo:this.docInfo,length:this.length,save:this._save}},a={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},c={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},d=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,h=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*/,f=/^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$/,p=/^([^aeiou][^aeiouy]*)?[aeiouy]/,m=/^(.+?)(ss|i)es$/,v=/^(.+?)([^s])s$/,y=/^(.+?)eed$/,S=/^(.+?)(ed|ing)$/,x=/.$/,b=/(at|bl|iz)$/,w=/([^aeiouylsz])\1$/,I=RegExp("^"+(t="[^aeiou][^aeiouy]*")+(e="[aeiouy]")+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,D=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,F=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,C=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,_=/^(.+?)e$/,N=/ll$/,P=RegExp("^"+t+e+"[^aeiouwxy]$"),g.Pipeline.registerFunction(g.stemmer=function(e){var t,n,o,i,r,s,u,l;return e.length<3||("y"==(n=e.substr(0,1))&&(e=n.toUpperCase()+e.substr(1)),u=v,(r=m).test(e)?e=e.replace(r,"$1$2"):u.test(e)&&(e=e.replace(u,"$1$2")),u=S,(r=y).test(e)?(l=r.exec(e),(r=d).test(l[1])&&(e=e.replace(r=x,""))):u.test(e)&&(s=(l=u.exec(e))[1],(u=p).test(s))&&(e=s,o=w,i=I,(u=b).test(e)?e+="e":o.test(e)?e=e.replace(r=x,""):i.test(e)&&(e+="e")),(r=E).test(e)&&(e=(s=(l=r.exec(e))[1])+"i"),(r=D).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s))&&(e=s+a[t]),(r=F).test(e)&&(s=(l=r.exec(e))[1],t=l[2],(r=d).test(s))&&(e=s+c[t]),u=k,(r=C).test(e)?(s=(l=r.exec(e))[1],(r=h).test(s)&&(e=s)):u.test(e)&&(s=(l=u.exec(e))[1]+l[2],(u=h).test(s))&&(e=s),(r=_).test(e)&&(s=(l=r.exec(e))[1],u=f,o=P,(r=h).test(s)||u.test(s)&&!o.test(s))&&(e=s),u=h,(r=N).test(e)&&u.test(e)&&(e=e.replace(r=x,"")),"y"==n&&(e=n.toLowerCase()+e.substr(1))),e},"stemmer"),g.stopWordFilter=function(e){return e&&!0!==g.stopWordFilter.stopWords[e]?e:void 0},g.clearStopWords=function(){g.stopWordFilter.stopWords={}},g.addStopWords=function(e){null!=e&&!1!==Array.isArray(e)&&e.forEach(function(e){g.stopWordFilter.stopWords[e]=!0},this)},g.resetStopWords=function(){g.stopWordFilter.stopWords=g.defaultStopWords},g.stopWordFilter.stopWords=g.defaultStopWords={"":!0,a:!0,able:!0,about:!0,across:!0,after:!0,all:!0,almost:!0,also:!0,am:!0,among:!0,an:!0,and:!0,any:!0,are:!0,as:!0,at:!0,be:!0,because:!0,been:!0,but:!0,by:!0,can:!0,cannot:!0,could:!0,dear:!0,did:!0,do:!0,does:!0,either:!0,else:!0,ever:!0,every:!0,for:!0,from:!0,get:!0,got:!0,had:!0,has:!0,have:!0,he:!0,her:!0,hers:!0,him:!0,his:!0,how:!0,however:!0,i:!0,if:!0,in:!0,into:!0,is:!0,it:!0,its:!0,just:!0,least:!0,let:!0,like:!0,likely:!0,may:!0,me:!0,might:!0,most:!0,must:!0,my:!0,neither:!0,no:!0,nor:!0,not:!0,of:!0,off:!0,often:!0,on:!0,only:!0,or:!0,other:!0,our:!0,own:!0,rather:!0,said:!0,say:!0,says:!0,she:!0,should:!0,since:!0,so:!0,some:!0,than:!0,that:!0,the:!0,their:!0,them:!0,then:!0,there:!0,these:!0,they:!0,this:!0,tis:!0,to:!0,too:!0,twas:!0,us:!0,wants:!0,was:!0,we:!0,were:!0,what:!0,when:!0,where:!0,which:!0,while:!0,who:!0,whom:!0,why:!0,will:!0,with:!0,would:!0,yet:!0,you:!0,your:!0},g.Pipeline.registerFunction(g.stopWordFilter,"stopWordFilter"),g.Pipeline.registerFunction(g.trimmer=function(e){if(null==e)throw Error("token should not be undefined");return e.replace(/^\W+/,"").replace(/\W+$/,"")},"trimmer"),(g.InvertedIndex=function(){this.root={docs:{},df:0}}).load=function(e){var t=new this;return t.root=e.root,t},g.InvertedIndex.prototype.addToken=function(e,t,n){for(var n=n||this.root,o=0;o<=e.length-1;){var i=e[o];i in n||(n[i]={docs:{},df:0}),o+=1,n=n[i]}var r=t.ref;n.docs[r]?n.docs[r]={tf:t.tf}:(n.docs[r]={tf:t.tf},n.df+=1)},g.InvertedIndex.prototype.hasToken=function(e){if(!e)return!1;for(var t=this.root,n=0;n=n&&r-1>=o;)s[n]!==u[o]?s[n]u[o]&&o++:(t.add(s[n]),n++,o++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){for(var t,e=this.length

'.concat(document.getElementById("searchinput").value,"

");return o.innerHTML=i,n.insertBefore(o,n.firstChild),e.innerHTML=n.outerHTML,t.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function b(e){return[0,1,2,3,4][Math.ceil(parseInt(e,16).toString(2).length/8)]}var u,r,l,c,h;document.body.contains(document.goSearch)&&(document.goSearch.onsubmit=function(){return goSearchNow()},u=document.getElementById("suggestions"),r=document.getElementById("searchinput"),document.addEventListener("keydown",function(t){if(191===t.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(t.preventDefault(),r.focus(),u.classList.remove("d-none")),27===t.keyCode){r.blur(),u.classList.add("d-none");for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}var n=u.querySelectorAll("a");if(!u.classList.contains("d-none")&&0!==n.length){var o=[...n],i=o.indexOf(document.activeElement);let e=0;38===t.keyCode?(t.preventDefault(),n[e=0",a=n.querySelector("a"),t=n.querySelector("span:first-child"),d=n.querySelector("span:nth-child(2)"),a.href=e.ref,t.textContent=e.doc.title,d.innerHTML=((e,t)=>{var n=t.map(function(e){return elasticlunr.stemmer(e.toLowerCase())}),o=!1,i=0,r=[],s=e.toLowerCase().split(". ");for(p in s){var u,l=s[p].split(/[\s\n]/),a=8;for(u in l){if(0<(v=l[u]).length){for(var c in n)elasticlunr.stemmer(v).startsWith(n[c])&&(a=40,o=!0);r.push([v,a,i]),a=2}i=i+v.length+1}i+=1}if(0===r.length)return void 0!==e.length&&300"),x=v[2]+v[0].length;40===v[1]||v[0].length<12||/^[\x00-\xff]+$/.test(v[0])?S.push(e.substring(v[2],x)):(y=((e,t)=>{for(var n="",o=!1,i=0,r=0,s=0,u=0;u")}return S.push("…"),S.join("")})(e.doc.body,s),u.appendChild(n))});i.length>r;)u.removeChild(i[0])},!0),u.addEventListener("click",function(){for(;u.lastChild;)u.removeChild(u.lastChild);return!1},!0),document.goSearch.onsubmit=e)}; \ No newline at end of file diff --git a/static/js/search_tinysearch.min.js b/static/js/search_tinysearch.min.js index a3516db7..3ed41131 100644 --- a/static/js/search_tinysearch.min.js +++ b/static/js/search_tinysearch.min.js @@ -1 +1 @@ -window.onload=function(){if(document.body.contains(document.goSearch)){document.goSearch.onsubmit=function(){return goSearchNow()};{function n(){var e=document.querySelector("main"),n=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),t=n.cloneNode(!0),o=(t.id="results",document.createElement("div")),r='

'.concat(document.getElementById("searchinput").value,"

");return o.innerHTML=r,t.insertBefore(o,t.firstChild),e.innerHTML=t.outerHTML,n.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function v(){for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}function w(){return e=null!==e&&e.buffer===f.memory.buffer?e:new Uint8Array(f.memory.buffer)}async function o(e){var n=document.querySelector("meta[name='base']").getAttribute("content"),n=("/"==n.slice(-1)&&(n=n.slice(0,-1)),void 0===e&&(e=new URL(n+"/tinysearch_engine_bg.wasm")),{wbg:{}}),{instance:e,module:n}=(n.wbg.__wbindgen_json_parse=function(e,n){return e=JSON.parse((e=e,n=n,t.decode(w().subarray(e,e+n)))),h===g.length&&g.push(g.length+1),n=h,h=g[n],g[n]=e,n},await async function(e,n){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,n)}catch(n){if("application/wasm"==e.headers.get("Content-Type"))throw n}var t=await e.arrayBuffer();return WebAssembly.instantiate(t,n)}return(t=await WebAssembly.instantiate(e,n))instanceof WebAssembly.Instance?{instance:t,module:e}:t}(await(e="string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL?fetch(e):e),n));return f=e.exports,o.__wbindgen_wasm_module=n,f}var i=document.getElementById("searchinput"),r=(document.addEventListener("keydown",function(n){191===n.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(n.preventDefault(),i.focus(),suggestions.classList.remove("d-none")),27===n.keyCode&&(i.blur(),suggestions.classList.add("d-none"),v());var t=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==t.length){var o=[...t],r=o.indexOf(document.activeElement);let e=0;38===n.keyCode?(n.preventDefault(),t[e=0",s=d.querySelector("a"),u=d.querySelector("span:first-child"),l=d.querySelector("span:nth-child(2)"),s.href=m[1]+"?q="+encodeURIComponent(n),u.innerHTML=m[0],l.innerHTML=m[2].replace(RegExp("(^|)("+n+")(|$)","ig"),"$1$2$3"),i.appendChild(d)}}),new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0})),e=(t.decode(),null),g=Array(32).fill(void 0),h=(g.push(void 0,null,!0,!1),g.length),y=0,b=new TextEncoder("utf-8"),p="function"==typeof b.encodeInto?function(e,n){return b.encodeInto(e,n)}:function(e,n){var t=b.encode(e);return n.set(t),{read:e.length,written:t.length}};document.goSearch.onsubmit=n}}}; \ No newline at end of file +window.onload=function(){if(document.body.contains(document.goSearch)){document.goSearch.onsubmit=function(){return goSearchNow()};{function n(){var e=document.querySelector("main"),n=(window.main||(window.main=e.innerHTML),document.getElementById("suggestions")),t=n.cloneNode(!0),o=(t.id="results",document.createElement("div")),r='

'.concat(document.getElementById("searchinput").value,"

");return o.innerHTML=r,t.insertBefore(o,t.firstChild),e.innerHTML=t.outerHTML,n.innerHTML="",document.getElementById("searchinput").value="",document.body.contains(document.closeSearch)&&(document.closeSearch.onsubmit=function(){document.querySelector("main").innerHTML=window.main}),!1}function v(){for(var e=document.getElementById("suggestions");e.firstChild;)e.removeChild(e.firstChild)}function w(){return e=null!==e&&e.buffer===f.memory.buffer?e:new Uint8Array(f.memory.buffer)}async function o(e){var n=document.querySelector("meta[name='base']").getAttribute("content"),n=("/"==n.slice(-1)&&(n=n.slice(0,-1)),void 0===e&&(e=new URL(n+"/tinysearch_engine_bg.wasm")),{wbg:{}}),{instance:e,module:n}=(n.wbg.__wbindgen_json_parse=function(e,n){return e=JSON.parse((e=e,n=n,t.decode(w().subarray(e,e+n)))),h===g.length&&g.push(g.length+1),n=h,h=g[n],g[n]=e,n},await(async(e,n)=>{if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,n)}catch(n){if("application/wasm"==e.headers.get("Content-Type"))throw n}var t=await e.arrayBuffer();return WebAssembly.instantiate(t,n)}return(t=await WebAssembly.instantiate(e,n))instanceof WebAssembly.Instance?{instance:t,module:e}:t})(await(e="string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL?fetch(e):e),n));return f=e.exports,o.__wbindgen_wasm_module=n,f}var a=document.getElementById("searchinput"),r=(document.addEventListener("keydown",function(n){191===n.keyCode&&"INPUT"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName&&(n.preventDefault(),a.focus(),suggestions.classList.remove("d-none")),27===n.keyCode&&(a.blur(),suggestions.classList.add("d-none"),v());var t=suggestions.querySelectorAll("a");if(!suggestions.classList.contains("d-none")&&0!==t.length){var o=[...t],r=o.indexOf(document.activeElement);let e=0;38===n.keyCode?(n.preventDefault(),t[e=0{var e=document.querySelector("meta[name='base']").getAttribute("content");await o((e="/"==e.slice(-1)?e.slice(0,-1):e)+"/tinysearch_engine_bg.wasm")})(),r=!0),document.getElementById("searchinput").onfocus=""};let f,t=(document.getElementById("searchinput").addEventListener("input",function(e){var n=this.value;if(v(),!n)return!1;for(var t,o,r,a=document.getElementById("suggestions"),i=(o=99,t=((t,o,n)=>{if(void 0===n){let e=b.encode(t),n=o(e.length);return w().subarray(n,n+e.length).set(e),y=e.length,n}let r=t.length,a=o(r),i=w(),s=0;for(;s{var n=(e=>g[e])(e);return e<36||(g[e]=h,h=e),n})(f.search(t,r,o))),s=0;s",c=d.querySelector("a"),u=d.querySelector("span:first-child"),l=d.querySelector("span:nth-child(2)"),c.href=m[1]+"?q="+encodeURIComponent(n),u.innerHTML=m[0],l.innerHTML=m[2].replace(RegExp("(^|)("+n+")(|$)","ig"),"$1$2$3"),a.appendChild(d)}}),new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0})),e=(t.decode(),null),g=Array(32).fill(void 0),h=(g.push(void 0,null,!0,!1),g.length),y=0,b=new TextEncoder("utf-8"),p="function"==typeof b.encodeInto?function(e,n){return b.encodeInto(e,n)}:function(e,n){var t=b.encode(e);return n.set(t),{read:e.length,written:t.length}};document.goSearch.onsubmit=n}}}; \ No newline at end of file diff --git a/static/js/wasm.en.pagefind b/static/js/wasm.en.pagefind new file mode 100644 index 00000000..6861ea0b Binary files /dev/null and b/static/js/wasm.en.pagefind differ diff --git a/static/js/wasm.es.pagefind b/static/js/wasm.es.pagefind new file mode 100644 index 00000000..9664a067 Binary files /dev/null and b/static/js/wasm.es.pagefind differ diff --git a/static/js/wasm.fr.pagefind b/static/js/wasm.fr.pagefind new file mode 100644 index 00000000..a7758168 Binary files /dev/null and b/static/js/wasm.fr.pagefind differ diff --git a/static/js/wasm.unknown.pagefind b/static/js/wasm.unknown.pagefind new file mode 100644 index 00000000..a69ccf07 Binary files /dev/null and b/static/js/wasm.unknown.pagefind differ diff --git a/static/sw.js b/static/sw.js index 5fc88fc8..709af738 100644 --- a/static/sw.js +++ b/static/sw.js @@ -5,7 +5,7 @@ class Pwa { const Version = new URL(location).searchParams.get("v"); this.CACHE_VERSION = Version; //this.BASE_CACHE_FILES=['/js/theme.min.js','/js/theme_light.min.js','/abridge.css','/js/abridge.min.js','/','/404.html','/offline/','/manifest.json']; - this.BASE_CACHE_FILES = ['/','/404.html','/about/','/abridge.css','/android-chrome-192x192.png','/android-chrome-512x512.png','/apple-touch-icon.png','/archive/','/atom.xml','/banner.png','/blog/','/blog/page/1/','/browserconfig.xml','/contact/','/elasticlunr.min.js','/es/','/es/archive/','/es/atom.xml','/es/blog/','/es/blog/page/1/','/es/page/1/','/es/tags/','/es/tags/features/','/es/tags/features/atom.xml','/es/tags/shortcodes/','/es/tags/shortcodes/atom.xml','/es/tags/video/','/es/tags/video/atom.xml','/es/video-streaming-sites/overview-embed-streamable/','/favicon-16x16.png','/favicon-32x32.png','/favicon.ico','/favicon.svg','/fonts/KaTeX_AMS-Regular.woff2','/fonts/KaTeX_Caligraphic-Bold.woff2','/fonts/KaTeX_Caligraphic-Regular.woff2','/fonts/KaTeX_Fraktur-Bold.woff2','/fonts/KaTeX_Fraktur-Regular.woff2','/fonts/KaTeX_Main-Bold.woff2','/fonts/KaTeX_Main-BoldItalic.woff2','/fonts/KaTeX_Main-Italic.woff2','/fonts/KaTeX_Main-Regular.woff2','/fonts/KaTeX_Math-BoldItalic.woff2','/fonts/KaTeX_Math-Italic.woff2','/fonts/KaTeX_SansSerif-Bold.woff2','/fonts/KaTeX_SansSerif-Italic.woff2','/fonts/KaTeX_SansSerif-Regular.woff2','/fonts/KaTeX_Script-Regular.woff2','/fonts/KaTeX_Size1-Regular.woff2','/fonts/KaTeX_Size2-Regular.woff2','/fonts/KaTeX_Size3-Regular.woff2','/fonts/KaTeX_Size4-Regular.woff2','/fonts/KaTeX_Typewriter-Regular.woff2','/fonts/Roboto-Bold.woff2','/fonts/Roboto-Italic.woff2','/fonts/Roboto-Mono-Italic.woff2','/fonts/Roboto-Mono.woff2','/fonts/Roboto.woff2','/fr/','/fr/about/','/fr/archive/','/fr/atom.xml','/fr/blog/','/fr/blog/page/1/','/fr/contact/','/fr/offline/','/fr/overview-code-blocks/','/fr/overview-images/','/fr/overview-images/corro.svg','/fr/overview-images/ferris-gesture.png','/fr/overview-images/ferris-gesture.svg','/fr/overview-images/ferris-happy.svg','/fr/overview-images/ferris.svg','/fr/overview-images/img/ferris-gesture.svg','/fr/overview-images/img/ferris.svg','/fr/overview-markdown-and-style/','/fr/overview-math/','/fr/overview-rich-content/','/fr/overview-rich-content/over9000-400.avif','/fr/overview-rich-content/over9000-640.avif','/fr/overview-rich-content/over9000-640.webp','/fr/overview-rich-content/over9000-960.avif','/fr/overview-rich-content/over9000.mp3','/fr/overview-rich-content/over9000.ogg','/fr/overview-rich-content/over9000_av1.mp4','/fr/overview-rich-content/over9000_vp9.webm','/fr/overview-showdata/','/fr/page/1/','/fr/page/2/','/fr/page/3/','/fr/privacy/','/fr/tags/','/fr/tags/audio/','/fr/tags/audio/atom.xml','/fr/tags/data/','/fr/tags/data/atom.xml','/fr/tags/features/','/fr/tags/features/atom.xml','/fr/tags/images/','/fr/tags/images/atom.xml','/fr/tags/markdown/','/fr/tags/markdown/atom.xml','/fr/tags/mathematics/','/fr/tags/mathematics/atom.xml','/fr/tags/shortcodes/','/fr/tags/shortcodes/atom.xml','/fr/tags/video/','/fr/tags/video/atom.xml','/fr/video-streaming-sites/overview-embed-streamable/','/fr/video-streaming-sites/overview-embed-vimeo/','/fr/video-streaming-sites/overview-embed-youtube/','/images/ferris-gesture.svg','/images/ferris.svg','/js/abridge.min.js','/js/abridge_nopwa.min.js','/js/abridge_nosearch.min.js','/js/abridge_nosearch_nopwa.min.js','/js/codecopy.js','/js/elasticlunr.min.js','/js/email.js','/js/katex-auto-render.min.js','/js/katex.min.js','/js/katexbundle.min.js','/js/katexoptions.js','/js/lunr.da.js','/js/lunr.da.min.js','/js/lunr.de.js','/js/lunr.de.min.js','/js/lunr.du.js','/js/lunr.du.min.js','/js/lunr.es.js','/js/lunr.es.min.js','/js/lunr.fi.js','/js/lunr.fi.min.js','/js/lunr.fr.js','/js/lunr.fr.min.js','/js/lunr.hu.js','/js/lunr.hu.min.js','/js/lunr.it.js','/js/lunr.it.min.js','/js/lunr.jp.js','/js/lunr.jp.min.js','/js/lunr.no.js','/js/lunr.no.min.js','/js/lunr.pt.js','/js/lunr.pt.min.js','/js/lunr.ro.js','/js/lunr.ro.min.js','/js/lunr.ru.js','/js/lunr.ru.min.js','/js/lunr.stemmer.support.js','/js/lunr.stemmer.support.min.js','/js/lunr.sv.js','/js/lunr.sv.min.js','/js/lunr.tr.js','/js/lunr.tr.min.js','/js/lunr.zh.js','/js/lunr.zh.min.js','/js/mathtex-script-type.min.js','/js/pagefind.search.js','/js/prestyle.js','/js/search.js','/js/search_elasticlunr.min.js','/js/search_tinysearch.min.js','/js/searchjava.js','/js/searchjavaugly.js','/js/sw_load.js','/js/sw_load.min.js','/js/theme.js','/js/theme.min.js','/js/theme_button.js','/js/theme_light.js','/js/theme_light.min.js','/js/tinysearch.js','/katex.min.css','/m1024.png','/m128.png','/m192.png','/m384.png','/m48.png','/m512.png','/m72.png','/m96.png','/manifest.json','/manifest.min.json','/mstile-150x150.png','/nojs.css','/offline/','/overview-abridge/','/overview-abridge/lighthouse.png','/overview-code-blocks/','/overview-images/','/overview-images/corro.svg','/overview-images/ferris-gesture.png','/overview-images/ferris-gesture.svg','/overview-images/ferris-happy.svg','/overview-images/ferris.svg','/overview-images/img/ferris-gesture.svg','/overview-images/img/ferris.svg','/overview-markdown-and-style/','/overview-math/','/overview-rich-content/','/overview-rich-content/over9000-400.avif','/overview-rich-content/over9000-640.avif','/overview-rich-content/over9000-640.webp','/overview-rich-content/over9000-960.avif','/overview-rich-content/over9000.mp3','/overview-rich-content/over9000.ogg','/overview-rich-content/over9000_av1.mp4','/overview-rich-content/over9000_vp9.webm','/overview-showdata/','/page/1/','/page/2/','/page/3/','/page/4/','/privacy/','/pt/','/pt/page/1/','/robots.txt','/safari-pinned-tab.svg','/search_index.en.json','/search_index.es.json','/search_index.fr.json','/search_index.pt.json','/sitemap.xml','/tags/','/tags/audio/','/tags/audio/atom.xml','/tags/config/','/tags/config/atom.xml','/tags/data/','/tags/data/atom.xml','/tags/features/','/tags/features/atom.xml','/tags/images/','/tags/images/atom.xml','/tags/markdown/','/tags/markdown/atom.xml','/tags/mathematics/','/tags/mathematics/atom.xml','/tags/shortcodes/','/tags/shortcodes/atom.xml','/tags/video/','/tags/video/atom.xml','/tinysearch_engine_bg.wasm','/video-streaming-sites/overview-embed-streamable/','/video-streaming-sites/overview-embed-vimeo/','/video-streaming-sites/overview-embed-youtube/']; + this.BASE_CACHE_FILES = ['/','/404.html','/about/','/abridge.css','/android-chrome-192x192.png','/android-chrome-512x512.png','/apple-touch-icon.png','/archive/','/atom.xml','/banner.png','/blog/','/blog/page/1/','/browserconfig.xml','/contact/','/es/','/es/about/','/es/archive/','/es/atom.xml','/es/blog/','/es/blog/page/1/','/es/contact/','/es/page/1/','/es/privacy/','/es/tags/','/es/tags/features/','/es/tags/features/atom.xml','/es/tags/shortcodes/','/es/tags/shortcodes/atom.xml','/es/tags/video/','/es/tags/video/atom.xml','/es/video-streaming-sites/overview-embed-streamable/','/favicon-16x16.png','/favicon-32x32.png','/favicon.ico','/favicon.svg','/fonts/KaTeX_AMS-Regular.woff2','/fonts/KaTeX_Caligraphic-Bold.woff2','/fonts/KaTeX_Caligraphic-Regular.woff2','/fonts/KaTeX_Fraktur-Bold.woff2','/fonts/KaTeX_Fraktur-Regular.woff2','/fonts/KaTeX_Main-Bold.woff2','/fonts/KaTeX_Main-BoldItalic.woff2','/fonts/KaTeX_Main-Italic.woff2','/fonts/KaTeX_Main-Regular.woff2','/fonts/KaTeX_Math-BoldItalic.woff2','/fonts/KaTeX_Math-Italic.woff2','/fonts/KaTeX_SansSerif-Bold.woff2','/fonts/KaTeX_SansSerif-Italic.woff2','/fonts/KaTeX_SansSerif-Regular.woff2','/fonts/KaTeX_Script-Regular.woff2','/fonts/KaTeX_Size1-Regular.woff2','/fonts/KaTeX_Size2-Regular.woff2','/fonts/KaTeX_Size3-Regular.woff2','/fonts/KaTeX_Size4-Regular.woff2','/fonts/KaTeX_Typewriter-Regular.woff2','/fonts/Roboto-Bold.woff2','/fonts/Roboto-Italic.woff2','/fonts/Roboto-Mono-Italic.woff2','/fonts/Roboto-Mono.woff2','/fonts/Roboto.woff2','/fr/','/fr/about/','/fr/archive/','/fr/atom.xml','/fr/blog/','/fr/blog/page/1/','/fr/contact/','/fr/offline/','/fr/overview-code-blocks/','/fr/overview-images/','/fr/overview-images/corro.svg','/fr/overview-images/ferris-gesture.png','/fr/overview-images/ferris-gesture.svg','/fr/overview-images/ferris-happy.svg','/fr/overview-images/ferris.svg','/fr/overview-images/img/ferris-gesture.svg','/fr/overview-images/img/ferris.svg','/fr/overview-markdown-and-style/','/fr/overview-math/','/fr/overview-rich-content/','/fr/overview-rich-content/over9000-400.avif','/fr/overview-rich-content/over9000-640.avif','/fr/overview-rich-content/over9000-640.webp','/fr/overview-rich-content/over9000-960.avif','/fr/overview-rich-content/over9000.mp3','/fr/overview-rich-content/over9000.ogg','/fr/overview-rich-content/over9000_av1.mp4','/fr/overview-rich-content/over9000_vp9.webm','/fr/overview-showdata/','/fr/page/1/','/fr/page/2/','/fr/page/3/','/fr/privacy/','/fr/tags/','/fr/tags/audio/','/fr/tags/audio/atom.xml','/fr/tags/data/','/fr/tags/data/atom.xml','/fr/tags/features/','/fr/tags/features/atom.xml','/fr/tags/images/','/fr/tags/images/atom.xml','/fr/tags/markdown/','/fr/tags/markdown/atom.xml','/fr/tags/mathematics/','/fr/tags/mathematics/atom.xml','/fr/tags/shortcodes/','/fr/tags/shortcodes/atom.xml','/fr/tags/video/','/fr/tags/video/atom.xml','/fr/video-streaming-sites/overview-embed-streamable/','/fr/video-streaming-sites/overview-embed-vimeo/','/fr/video-streaming-sites/overview-embed-youtube/','/images/ferris-gesture.svg','/images/ferris.svg','/js/abridge.min.js','/js/abridge_nopwa.min.js','/js/abridge_nosearch.min.js','/js/abridge_nosearch_nopwa.min.js','/js/codecopy.js','/js/elasticlunr.min.js','/js/email.js','/js/fragment/en_1ee6ca2.pf_fragment','/js/fragment/en_22f160f.pf_fragment','/js/fragment/en_39cc456.pf_fragment','/js/fragment/en_4254e45.pf_fragment','/js/fragment/en_53cb76b.pf_fragment','/js/fragment/en_58ea47d.pf_fragment','/js/fragment/en_5ad7d88.pf_fragment','/js/fragment/en_607247b.pf_fragment','/js/fragment/en_6f6532b.pf_fragment','/js/fragment/en_85c365d.pf_fragment','/js/fragment/en_8ddff26.pf_fragment','/js/fragment/en_b37b30a.pf_fragment','/js/fragment/en_d3f49b7.pf_fragment','/js/fragment/en_eec2257.pf_fragment','/js/fragment/en_f847339.pf_fragment','/js/fragment/es_82b6e6e.pf_fragment','/js/fragment/es_8da16fd.pf_fragment','/js/fragment/fr_5fb67f0.pf_fragment','/js/fragment/fr_77f673c.pf_fragment','/js/fragment/fr_98dac9a.pf_fragment','/js/fragment/fr_a1cd89a.pf_fragment','/js/fragment/fr_b3d5f99.pf_fragment','/js/fragment/fr_c2595bc.pf_fragment','/js/fragment/fr_db31d0d.pf_fragment','/js/fragment/fr_e048281.pf_fragment','/js/fragment/fr_e0f3a9d.pf_fragment','/js/fragment/fr_f05ab69.pf_fragment','/js/index/en_e77a71e.pf_index','/js/index/es_17dca74.pf_index','/js/index/fr_90a3b27.pf_index','/js/katex-auto-render.min.js','/js/katex.min.js','/js/katexbundle.min.js','/js/katexoptions.js','/js/lunr.da.js','/js/lunr.da.min.js','/js/lunr.de.js','/js/lunr.de.min.js','/js/lunr.du.js','/js/lunr.du.min.js','/js/lunr.es.js','/js/lunr.es.min.js','/js/lunr.fi.js','/js/lunr.fi.min.js','/js/lunr.fr.js','/js/lunr.fr.min.js','/js/lunr.hu.js','/js/lunr.hu.min.js','/js/lunr.it.js','/js/lunr.it.min.js','/js/lunr.jp.js','/js/lunr.jp.min.js','/js/lunr.no.js','/js/lunr.no.min.js','/js/lunr.pt.js','/js/lunr.pt.min.js','/js/lunr.ro.js','/js/lunr.ro.min.js','/js/lunr.ru.js','/js/lunr.ru.min.js','/js/lunr.stemmer.support.js','/js/lunr.stemmer.support.min.js','/js/lunr.sv.js','/js/lunr.sv.min.js','/js/lunr.tr.js','/js/lunr.tr.min.js','/js/lunr.zh.js','/js/lunr.zh.min.js','/js/mathtex-script-type.min.js','/js/pagefind-entry-1728241819.json','/js/pagefind.en_3c26f37e1b.pf_meta','/js/pagefind.es_ae1ee7146e.pf_meta','/js/pagefind.fr_89c85beeef.pf_meta','/js/pagefind.search.js','/js/prestyle.js','/js/search.js','/js/search_elasticlunr.min.js','/js/search_tinysearch.min.js','/js/searchjava.js','/js/searchjavaugly.js','/js/sw_load.js','/js/sw_load.min.js','/js/theme.js','/js/theme.min.js','/js/theme_button.js','/js/theme_light.js','/js/theme_light.min.js','/js/tinysearch.js','/js/wasm.en.pagefind','/js/wasm.es.pagefind','/js/wasm.fr.pagefind','/js/wasm.unknown.pagefind','/katex.min.css','/m1024.png','/m128.png','/m192.png','/m384.png','/m48.png','/m512.png','/m72.png','/m96.png','/manifest.json','/manifest.min.json','/mstile-150x150.png','/nojs.css','/offline/','/overview-abridge/','/overview-abridge/lighthouse.png','/overview-code-blocks/','/overview-images/','/overview-images/corro.svg','/overview-images/ferris-gesture.png','/overview-images/ferris-gesture.svg','/overview-images/ferris-happy.svg','/overview-images/ferris.svg','/overview-images/img/ferris-gesture.svg','/overview-images/img/ferris.svg','/overview-markdown-and-style/','/overview-math/','/overview-rich-content/','/overview-rich-content/over9000-400.avif','/overview-rich-content/over9000-640.avif','/overview-rich-content/over9000-640.webp','/overview-rich-content/over9000-960.avif','/overview-rich-content/over9000.mp3','/overview-rich-content/over9000.ogg','/overview-rich-content/over9000_av1.mp4','/overview-rich-content/over9000_vp9.webm','/overview-showdata/','/page/1/','/page/2/','/page/3/','/page/4/','/privacy/','/pt/','/pt/about/','/pt/contact/','/pt/page/1/','/pt/privacy/','/robots.txt','/safari-pinned-tab.svg','/search_index.en.json','/search_index.es.json','/search_index.fr.json','/search_index.pt.json','/sitemap.xml','/tags/','/tags/audio/','/tags/audio/atom.xml','/tags/config/','/tags/config/atom.xml','/tags/data/','/tags/data/atom.xml','/tags/features/','/tags/features/atom.xml','/tags/images/','/tags/images/atom.xml','/tags/markdown/','/tags/markdown/atom.xml','/tags/mathematics/','/tags/mathematics/atom.xml','/tags/shortcodes/','/tags/shortcodes/atom.xml','/tags/video/','/tags/video/atom.xml','/tinysearch_engine_bg.wasm','/video-streaming-sites/overview-embed-streamable/','/video-streaming-sites/overview-embed-vimeo/','/video-streaming-sites/overview-embed-youtube/']; this.host = `${self.location.protocol}//${self.location.host}`; console.info(`Host: ${this.host}`); this.OFFLINE_PAGE = '/offline/'; diff --git a/static/sw.min.js b/static/sw.min.js index 12172c9b..9c8d8290 100644 --- a/static/sw.min.js +++ b/static/sw.min.js @@ -1 +1 @@ -class Pwa{constructor(e){this.scope=e;var s=new URL(location).searchParams.get("v");this.CACHE_VERSION=s,this.BASE_CACHE_FILES=["/","/404.html","/about/","/abridge.css","/android-chrome-192x192.png","/android-chrome-512x512.png","/apple-touch-icon.png","/archive/","/atom.xml","/banner.png","/blog/","/blog/page/1/","/browserconfig.xml","/contact/","/elasticlunr.min.js","/es/","/es/archive/","/es/atom.xml","/es/blog/","/es/blog/page/1/","/es/page/1/","/es/tags/","/es/tags/features/","/es/tags/features/atom.xml","/es/tags/shortcodes/","/es/tags/shortcodes/atom.xml","/es/tags/video/","/es/tags/video/atom.xml","/es/video-streaming-sites/overview-embed-streamable/","/favicon-16x16.png","/favicon-32x32.png","/favicon.ico","/favicon.svg","/fonts/KaTeX_AMS-Regular.woff2","/fonts/KaTeX_Caligraphic-Bold.woff2","/fonts/KaTeX_Caligraphic-Regular.woff2","/fonts/KaTeX_Fraktur-Bold.woff2","/fonts/KaTeX_Fraktur-Regular.woff2","/fonts/KaTeX_Main-Bold.woff2","/fonts/KaTeX_Main-BoldItalic.woff2","/fonts/KaTeX_Main-Italic.woff2","/fonts/KaTeX_Main-Regular.woff2","/fonts/KaTeX_Math-BoldItalic.woff2","/fonts/KaTeX_Math-Italic.woff2","/fonts/KaTeX_SansSerif-Bold.woff2","/fonts/KaTeX_SansSerif-Italic.woff2","/fonts/KaTeX_SansSerif-Regular.woff2","/fonts/KaTeX_Script-Regular.woff2","/fonts/KaTeX_Size1-Regular.woff2","/fonts/KaTeX_Size2-Regular.woff2","/fonts/KaTeX_Size3-Regular.woff2","/fonts/KaTeX_Size4-Regular.woff2","/fonts/KaTeX_Typewriter-Regular.woff2","/fonts/Roboto-Bold.woff2","/fonts/Roboto-Italic.woff2","/fonts/Roboto-Mono-Italic.woff2","/fonts/Roboto-Mono.woff2","/fonts/Roboto.woff2","/fr/","/fr/about/","/fr/archive/","/fr/atom.xml","/fr/blog/","/fr/blog/page/1/","/fr/contact/","/fr/offline/","/fr/overview-code-blocks/","/fr/overview-images/","/fr/overview-images/corro.svg","/fr/overview-images/ferris-gesture.png","/fr/overview-images/ferris-gesture.svg","/fr/overview-images/ferris-happy.svg","/fr/overview-images/ferris.svg","/fr/overview-images/img/ferris-gesture.svg","/fr/overview-images/img/ferris.svg","/fr/overview-markdown-and-style/","/fr/overview-math/","/fr/overview-rich-content/","/fr/overview-rich-content/over9000-400.avif","/fr/overview-rich-content/over9000-640.avif","/fr/overview-rich-content/over9000-640.webp","/fr/overview-rich-content/over9000-960.avif","/fr/overview-rich-content/over9000.mp3","/fr/overview-rich-content/over9000.ogg","/fr/overview-rich-content/over9000_av1.mp4","/fr/overview-rich-content/over9000_vp9.webm","/fr/overview-showdata/","/fr/page/1/","/fr/page/2/","/fr/page/3/","/fr/privacy/","/fr/tags/","/fr/tags/audio/","/fr/tags/audio/atom.xml","/fr/tags/data/","/fr/tags/data/atom.xml","/fr/tags/features/","/fr/tags/features/atom.xml","/fr/tags/images/","/fr/tags/images/atom.xml","/fr/tags/markdown/","/fr/tags/markdown/atom.xml","/fr/tags/mathematics/","/fr/tags/mathematics/atom.xml","/fr/tags/shortcodes/","/fr/tags/shortcodes/atom.xml","/fr/tags/video/","/fr/tags/video/atom.xml","/fr/video-streaming-sites/overview-embed-streamable/","/fr/video-streaming-sites/overview-embed-vimeo/","/fr/video-streaming-sites/overview-embed-youtube/","/images/ferris-gesture.svg","/images/ferris.svg","/js/abridge.min.js","/js/abridge_nopwa.min.js","/js/abridge_nosearch.min.js","/js/abridge_nosearch_nopwa.min.js","/js/codecopy.js","/js/elasticlunr.min.js","/js/email.js","/js/katex-auto-render.min.js","/js/katex.min.js","/js/katexbundle.min.js","/js/katexoptions.js","/js/lunr.da.js","/js/lunr.da.min.js","/js/lunr.de.js","/js/lunr.de.min.js","/js/lunr.du.js","/js/lunr.du.min.js","/js/lunr.es.js","/js/lunr.es.min.js","/js/lunr.fi.js","/js/lunr.fi.min.js","/js/lunr.fr.js","/js/lunr.fr.min.js","/js/lunr.hu.js","/js/lunr.hu.min.js","/js/lunr.it.js","/js/lunr.it.min.js","/js/lunr.jp.js","/js/lunr.jp.min.js","/js/lunr.no.js","/js/lunr.no.min.js","/js/lunr.pt.js","/js/lunr.pt.min.js","/js/lunr.ro.js","/js/lunr.ro.min.js","/js/lunr.ru.js","/js/lunr.ru.min.js","/js/lunr.stemmer.support.js","/js/lunr.stemmer.support.min.js","/js/lunr.sv.js","/js/lunr.sv.min.js","/js/lunr.tr.js","/js/lunr.tr.min.js","/js/lunr.zh.js","/js/lunr.zh.min.js","/js/mathtex-script-type.min.js","/js/pagefind.search.js","/js/prestyle.js","/js/search.js","/js/search_elasticlunr.min.js","/js/search_tinysearch.min.js","/js/searchjava.js","/js/searchjavaugly.js","/js/sw_load.js","/js/sw_load.min.js","/js/theme.js","/js/theme.min.js","/js/theme_button.js","/js/theme_light.js","/js/theme_light.min.js","/js/tinysearch.js","/katex.min.css","/m1024.png","/m128.png","/m192.png","/m384.png","/m48.png","/m512.png","/m72.png","/m96.png","/manifest.json","/manifest.min.json","/mstile-150x150.png","/nojs.css","/offline/","/overview-abridge/","/overview-abridge/lighthouse.png","/overview-code-blocks/","/overview-images/","/overview-images/corro.svg","/overview-images/ferris-gesture.png","/overview-images/ferris-gesture.svg","/overview-images/ferris-happy.svg","/overview-images/ferris.svg","/overview-images/img/ferris-gesture.svg","/overview-images/img/ferris.svg","/overview-markdown-and-style/","/overview-math/","/overview-rich-content/","/overview-rich-content/over9000-400.avif","/overview-rich-content/over9000-640.avif","/overview-rich-content/over9000-640.webp","/overview-rich-content/over9000-960.avif","/overview-rich-content/over9000.mp3","/overview-rich-content/over9000.ogg","/overview-rich-content/over9000_av1.mp4","/overview-rich-content/over9000_vp9.webm","/overview-showdata/","/page/1/","/page/2/","/page/3/","/page/4/","/privacy/","/pt/","/pt/page/1/","/robots.txt","/safari-pinned-tab.svg","/search_index.en.json","/search_index.es.json","/search_index.fr.json","/search_index.pt.json","/sitemap.xml","/tags/","/tags/audio/","/tags/audio/atom.xml","/tags/config/","/tags/config/atom.xml","/tags/data/","/tags/data/atom.xml","/tags/features/","/tags/features/atom.xml","/tags/images/","/tags/images/atom.xml","/tags/markdown/","/tags/markdown/atom.xml","/tags/mathematics/","/tags/mathematics/atom.xml","/tags/shortcodes/","/tags/shortcodes/atom.xml","/tags/video/","/tags/video/atom.xml","/tinysearch_engine_bg.wasm","/video-streaming-sites/overview-embed-streamable/","/video-streaming-sites/overview-embed-vimeo/","/video-streaming-sites/overview-embed-youtube/"],this.host=e.location.protocol+"//"+e.location.host,this.OFFLINE_PAGE="/offline/",this.NOT_FOUND_PAGE="/404.html",this.CACHE_NAME="content-v"+this.CACHE_VERSION,this.NORM_TTL=0,this.LONG_TTL=0,this.TTL_NORM=["sw.min.js","sw_load.min.js"],this.TTL_LONG=["jpg","jpeg","png","gif","webp","avif","ico","svg","xsl","txt"],this.TTL_EXEMPT=["js","css","otf","eot","ttf","woff","woff2","mp4","webm","mp3","ogg"]}canCache(e){return!e.startsWith("http://localhost")&&e.toString().startsWith(this.host)}getFileExtension(e){e=e.split(".").reverse()[0].split("?")[0];return e.endsWith("/")?"/":e}getFileName(e){e=e.substring(1+e.lastIndexOf("/")).split("?")[0];return e.endsWith("/")?"/":e}getTTL(e){var s;return"string"==typeof e?(s=this.getFileExtension(e),e=this.getFileName(e),~this.TTL_NORM.indexOf(e)?this.NORM_TTL:~this.TTL_LONG.indexOf(s)?this.LONG_TTL:~this.TTL_EXEMPT.indexOf(s)?null:this.NORM_TTL):null}async installServiceWorker(){try{return await caches.open(this.CACHE_NAME).then(e=>e.addAll(this.BASE_CACHE_FILES),e=>{}),this.scope.skipWaiting()}catch(e){}}cleanupLegacyCache(){let r=[this.CACHE_NAME];return new Promise((s,t)=>{caches.keys().then(e=>e.filter(e=>!~r.indexOf(e))).then(e=>{e.length?Promise.all(e.map(e=>caches.delete(e))).then(()=>s()).catch(e=>{t(e)}):s()}).catch(e=>{t(e)})})}async preCacheUrl(s){let t=await caches.open(this.CACHE_NAME);return await t.match(s)?null:fetch(s).then(e=>t.put(s,e.clone()))}register(){this.scope.addEventListener("install",e=>{e.waitUntil(Promise.all([this.installServiceWorker(),this.scope.skipWaiting()]))}),this.scope.addEventListener("activate",s=>{s.waitUntil(Promise.all([this.cleanupLegacyCache(),this.scope.clients.claim(),this.scope.skipWaiting()]).catch(e=>{s.skipWaiting()}))}),this.scope.addEventListener("fetch",o=>{o.respondWith(caches.open(this.CACHE_NAME).then(async s=>{if(!this.canCache(o.request.url))return fetch(o.request);let t=await s.match(o.request);if(t){var r;let e=null;for(r of t.headers.entries())if("date"===r[0]){e=new Date(r[1]);break}if(!e)return t;var i=parseInt(""+((new Date).getTime()-e.getTime())/1e3),a=this.getTTL(o.request.url);if(null===a||a&&ie.status<400?(this.canCache(o.request.url)&&s.put(o.request,e.clone()),e):s.match(this.NOT_FOUND_PAGE)).catch(e=>(o.request.url,t||s.match(this.OFFLINE_PAGE)))}))})}}let pwa=new Pwa(self);pwa.register(); \ No newline at end of file +class Pwa{constructor(e){this.scope=e;var s=new URL(location).searchParams.get("v");this.CACHE_VERSION=s,this.BASE_CACHE_FILES=["/","/404.html","/about/","/abridge.css","/android-chrome-192x192.png","/android-chrome-512x512.png","/apple-touch-icon.png","/archive/","/atom.xml","/banner.png","/blog/","/blog/page/1/","/browserconfig.xml","/contact/","/es/","/es/about/","/es/archive/","/es/atom.xml","/es/blog/","/es/blog/page/1/","/es/contact/","/es/page/1/","/es/privacy/","/es/tags/","/es/tags/features/","/es/tags/features/atom.xml","/es/tags/shortcodes/","/es/tags/shortcodes/atom.xml","/es/tags/video/","/es/tags/video/atom.xml","/es/video-streaming-sites/overview-embed-streamable/","/favicon-16x16.png","/favicon-32x32.png","/favicon.ico","/favicon.svg","/fonts/KaTeX_AMS-Regular.woff2","/fonts/KaTeX_Caligraphic-Bold.woff2","/fonts/KaTeX_Caligraphic-Regular.woff2","/fonts/KaTeX_Fraktur-Bold.woff2","/fonts/KaTeX_Fraktur-Regular.woff2","/fonts/KaTeX_Main-Bold.woff2","/fonts/KaTeX_Main-BoldItalic.woff2","/fonts/KaTeX_Main-Italic.woff2","/fonts/KaTeX_Main-Regular.woff2","/fonts/KaTeX_Math-BoldItalic.woff2","/fonts/KaTeX_Math-Italic.woff2","/fonts/KaTeX_SansSerif-Bold.woff2","/fonts/KaTeX_SansSerif-Italic.woff2","/fonts/KaTeX_SansSerif-Regular.woff2","/fonts/KaTeX_Script-Regular.woff2","/fonts/KaTeX_Size1-Regular.woff2","/fonts/KaTeX_Size2-Regular.woff2","/fonts/KaTeX_Size3-Regular.woff2","/fonts/KaTeX_Size4-Regular.woff2","/fonts/KaTeX_Typewriter-Regular.woff2","/fonts/Roboto-Bold.woff2","/fonts/Roboto-Italic.woff2","/fonts/Roboto-Mono-Italic.woff2","/fonts/Roboto-Mono.woff2","/fonts/Roboto.woff2","/fr/","/fr/about/","/fr/archive/","/fr/atom.xml","/fr/blog/","/fr/blog/page/1/","/fr/contact/","/fr/offline/","/fr/overview-code-blocks/","/fr/overview-images/","/fr/overview-images/corro.svg","/fr/overview-images/ferris-gesture.png","/fr/overview-images/ferris-gesture.svg","/fr/overview-images/ferris-happy.svg","/fr/overview-images/ferris.svg","/fr/overview-images/img/ferris-gesture.svg","/fr/overview-images/img/ferris.svg","/fr/overview-markdown-and-style/","/fr/overview-math/","/fr/overview-rich-content/","/fr/overview-rich-content/over9000-400.avif","/fr/overview-rich-content/over9000-640.avif","/fr/overview-rich-content/over9000-640.webp","/fr/overview-rich-content/over9000-960.avif","/fr/overview-rich-content/over9000.mp3","/fr/overview-rich-content/over9000.ogg","/fr/overview-rich-content/over9000_av1.mp4","/fr/overview-rich-content/over9000_vp9.webm","/fr/overview-showdata/","/fr/page/1/","/fr/page/2/","/fr/page/3/","/fr/privacy/","/fr/tags/","/fr/tags/audio/","/fr/tags/audio/atom.xml","/fr/tags/data/","/fr/tags/data/atom.xml","/fr/tags/features/","/fr/tags/features/atom.xml","/fr/tags/images/","/fr/tags/images/atom.xml","/fr/tags/markdown/","/fr/tags/markdown/atom.xml","/fr/tags/mathematics/","/fr/tags/mathematics/atom.xml","/fr/tags/shortcodes/","/fr/tags/shortcodes/atom.xml","/fr/tags/video/","/fr/tags/video/atom.xml","/fr/video-streaming-sites/overview-embed-streamable/","/fr/video-streaming-sites/overview-embed-vimeo/","/fr/video-streaming-sites/overview-embed-youtube/","/images/ferris-gesture.svg","/images/ferris.svg","/js/abridge.min.js","/js/abridge_nopwa.min.js","/js/abridge_nosearch.min.js","/js/abridge_nosearch_nopwa.min.js","/js/codecopy.js","/js/elasticlunr.min.js","/js/email.js","/js/fragment/en_1ee6ca2.pf_fragment","/js/fragment/en_22f160f.pf_fragment","/js/fragment/en_39cc456.pf_fragment","/js/fragment/en_4254e45.pf_fragment","/js/fragment/en_53cb76b.pf_fragment","/js/fragment/en_58ea47d.pf_fragment","/js/fragment/en_5ad7d88.pf_fragment","/js/fragment/en_607247b.pf_fragment","/js/fragment/en_6f6532b.pf_fragment","/js/fragment/en_85c365d.pf_fragment","/js/fragment/en_8ddff26.pf_fragment","/js/fragment/en_b37b30a.pf_fragment","/js/fragment/en_d3f49b7.pf_fragment","/js/fragment/en_eec2257.pf_fragment","/js/fragment/en_f847339.pf_fragment","/js/fragment/es_82b6e6e.pf_fragment","/js/fragment/es_8da16fd.pf_fragment","/js/fragment/fr_5fb67f0.pf_fragment","/js/fragment/fr_77f673c.pf_fragment","/js/fragment/fr_98dac9a.pf_fragment","/js/fragment/fr_a1cd89a.pf_fragment","/js/fragment/fr_b3d5f99.pf_fragment","/js/fragment/fr_c2595bc.pf_fragment","/js/fragment/fr_db31d0d.pf_fragment","/js/fragment/fr_e048281.pf_fragment","/js/fragment/fr_e0f3a9d.pf_fragment","/js/fragment/fr_f05ab69.pf_fragment","/js/index/en_e77a71e.pf_index","/js/index/es_17dca74.pf_index","/js/index/fr_90a3b27.pf_index","/js/katex-auto-render.min.js","/js/katex.min.js","/js/katexbundle.min.js","/js/katexoptions.js","/js/lunr.da.js","/js/lunr.da.min.js","/js/lunr.de.js","/js/lunr.de.min.js","/js/lunr.du.js","/js/lunr.du.min.js","/js/lunr.es.js","/js/lunr.es.min.js","/js/lunr.fi.js","/js/lunr.fi.min.js","/js/lunr.fr.js","/js/lunr.fr.min.js","/js/lunr.hu.js","/js/lunr.hu.min.js","/js/lunr.it.js","/js/lunr.it.min.js","/js/lunr.jp.js","/js/lunr.jp.min.js","/js/lunr.no.js","/js/lunr.no.min.js","/js/lunr.pt.js","/js/lunr.pt.min.js","/js/lunr.ro.js","/js/lunr.ro.min.js","/js/lunr.ru.js","/js/lunr.ru.min.js","/js/lunr.stemmer.support.js","/js/lunr.stemmer.support.min.js","/js/lunr.sv.js","/js/lunr.sv.min.js","/js/lunr.tr.js","/js/lunr.tr.min.js","/js/lunr.zh.js","/js/lunr.zh.min.js","/js/mathtex-script-type.min.js","/js/pagefind-entry-1728241819.json","/js/pagefind.en_3c26f37e1b.pf_meta","/js/pagefind.es_ae1ee7146e.pf_meta","/js/pagefind.fr_89c85beeef.pf_meta","/js/pagefind.search.js","/js/prestyle.js","/js/search.js","/js/search_elasticlunr.min.js","/js/search_tinysearch.min.js","/js/searchjava.js","/js/searchjavaugly.js","/js/sw_load.js","/js/sw_load.min.js","/js/theme.js","/js/theme.min.js","/js/theme_button.js","/js/theme_light.js","/js/theme_light.min.js","/js/tinysearch.js","/js/wasm.en.pagefind","/js/wasm.es.pagefind","/js/wasm.fr.pagefind","/js/wasm.unknown.pagefind","/katex.min.css","/m1024.png","/m128.png","/m192.png","/m384.png","/m48.png","/m512.png","/m72.png","/m96.png","/manifest.json","/manifest.min.json","/mstile-150x150.png","/nojs.css","/offline/","/overview-abridge/","/overview-abridge/lighthouse.png","/overview-code-blocks/","/overview-images/","/overview-images/corro.svg","/overview-images/ferris-gesture.png","/overview-images/ferris-gesture.svg","/overview-images/ferris-happy.svg","/overview-images/ferris.svg","/overview-images/img/ferris-gesture.svg","/overview-images/img/ferris.svg","/overview-markdown-and-style/","/overview-math/","/overview-rich-content/","/overview-rich-content/over9000-400.avif","/overview-rich-content/over9000-640.avif","/overview-rich-content/over9000-640.webp","/overview-rich-content/over9000-960.avif","/overview-rich-content/over9000.mp3","/overview-rich-content/over9000.ogg","/overview-rich-content/over9000_av1.mp4","/overview-rich-content/over9000_vp9.webm","/overview-showdata/","/page/1/","/page/2/","/page/3/","/page/4/","/privacy/","/pt/","/pt/about/","/pt/contact/","/pt/page/1/","/pt/privacy/","/robots.txt","/safari-pinned-tab.svg","/search_index.en.json","/search_index.es.json","/search_index.fr.json","/search_index.pt.json","/sitemap.xml","/tags/","/tags/audio/","/tags/audio/atom.xml","/tags/config/","/tags/config/atom.xml","/tags/data/","/tags/data/atom.xml","/tags/features/","/tags/features/atom.xml","/tags/images/","/tags/images/atom.xml","/tags/markdown/","/tags/markdown/atom.xml","/tags/mathematics/","/tags/mathematics/atom.xml","/tags/shortcodes/","/tags/shortcodes/atom.xml","/tags/video/","/tags/video/atom.xml","/tinysearch_engine_bg.wasm","/video-streaming-sites/overview-embed-streamable/","/video-streaming-sites/overview-embed-vimeo/","/video-streaming-sites/overview-embed-youtube/"],this.host=e.location.protocol+"//"+e.location.host,this.OFFLINE_PAGE="/offline/",this.NOT_FOUND_PAGE="/404.html",this.CACHE_NAME="content-v"+this.CACHE_VERSION,this.NORM_TTL=0,this.LONG_TTL=0,this.TTL_NORM=["sw.min.js","sw_load.min.js"],this.TTL_LONG=["jpg","jpeg","png","gif","webp","avif","ico","svg","xsl","txt"],this.TTL_EXEMPT=["js","css","otf","eot","ttf","woff","woff2","mp4","webm","mp3","ogg"]}canCache(e){return!e.startsWith("http://localhost")&&e.toString().startsWith(this.host)}getFileExtension(e){e=e.split(".").reverse()[0].split("?")[0];return e.endsWith("/")?"/":e}getFileName(e){e=e.substring(1+e.lastIndexOf("/")).split("?")[0];return e.endsWith("/")?"/":e}getTTL(e){var s;return"string"==typeof e?(s=this.getFileExtension(e),e=this.getFileName(e),~this.TTL_NORM.indexOf(e)?this.NORM_TTL:~this.TTL_LONG.indexOf(s)?this.LONG_TTL:~this.TTL_EXEMPT.indexOf(s)?null:this.NORM_TTL):null}async installServiceWorker(){try{return await caches.open(this.CACHE_NAME).then(e=>e.addAll(this.BASE_CACHE_FILES),e=>{}),this.scope.skipWaiting()}catch(e){}}cleanupLegacyCache(){let r=[this.CACHE_NAME];return new Promise((s,t)=>{caches.keys().then(e=>e.filter(e=>!~r.indexOf(e))).then(e=>{e.length?Promise.all(e.map(e=>caches.delete(e))).then(()=>s()).catch(e=>{t(e)}):s()}).catch(e=>{t(e)})})}async preCacheUrl(s){let t=await caches.open(this.CACHE_NAME);return await t.match(s)?null:fetch(s).then(e=>t.put(s,e.clone()))}register(){this.scope.addEventListener("install",e=>{e.waitUntil(Promise.all([this.installServiceWorker(),this.scope.skipWaiting()]))}),this.scope.addEventListener("activate",s=>{s.waitUntil(Promise.all([this.cleanupLegacyCache(),this.scope.clients.claim(),this.scope.skipWaiting()]).catch(e=>{s.skipWaiting()}))}),this.scope.addEventListener("fetch",i=>{i.respondWith(caches.open(this.CACHE_NAME).then(async s=>{if(!this.canCache(i.request.url))return fetch(i.request);let t=await s.match(i.request);if(t){var r;let e=null;for(r of t.headers.entries())if("date"===r[0]){e=new Date(r[1]);break}if(!e)return t;var a=parseInt(""+((new Date).getTime()-e.getTime())/1e3),n=this.getTTL(i.request.url);if(null===n||n&&ae.status<400?(this.canCache(i.request.url)&&s.put(i.request,e.clone()),e):s.match(this.NOT_FOUND_PAGE)).catch(e=>(i.request.url,t||s.match(this.OFFLINE_PAGE)))}))})}}let pwa=new Pwa(self);pwa.register(); \ No newline at end of file