diff --git a/client/simple/package-lock.json b/client/simple/package-lock.json index c36699cd1..7d0101c95 100644 --- a/client/simple/package-lock.json +++ b/client/simple/package-lock.json @@ -15,9 +15,9 @@ "swiped-events": "1.2.0" }, "devDependencies": { - "@biomejs/biome": "2.5.2", - "@types/node": "^26.1.0", - "browserslist": "^4.28.4", + "@biomejs/biome": "2.5.3", + "@types/node": "^26.1.1", + "browserslist": "^4.28.6", "browserslist-to-esbuild": "^2.1.1", "edge.js": "^6.5.1", "less": "^4.6.7", @@ -27,9 +27,9 @@ "stylelint": "^17.14.0", "stylelint-config-standard-less": "^4.1.0", "stylelint-prettier": "^5.0.3", - "svgo": "^4.0.1", + "svgo": "^4.0.2", "typescript": "~7.0.2", - "vite": "^8.1.3", + "vite": "^8.1.4", "vite-bundle-analyzer": "^1.3.8" } }, @@ -69,9 +69,9 @@ } }, "node_modules/@biomejs/biome": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.2.tgz", - "integrity": "sha512-VQ3RCqr7JmDIX+w6stWYl+g/3bYofN3q2wDBHUKKc/c7i5QWrFKFBZYCYPWTE6agsUPMIZZe6/CMmVUfUAhkKA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-2.5.3.tgz", + "integrity": "sha512-MrJswFdei9EfDwwUy2tQrPDpK0AO+RmMFvBoaaJ6ayBc3sUbHdCE+XG5N8vp+5So41ZupZJQm0roHFFhMGVD7A==", "dev": true, "license": "MIT OR Apache-2.0", "bin": { @@ -85,20 +85,20 @@ "url": "https://opencollective.com/biome" }, "optionalDependencies": { - "@biomejs/cli-darwin-arm64": "2.5.2", - "@biomejs/cli-darwin-x64": "2.5.2", - "@biomejs/cli-linux-arm64": "2.5.2", - "@biomejs/cli-linux-arm64-musl": "2.5.2", - "@biomejs/cli-linux-x64": "2.5.2", - "@biomejs/cli-linux-x64-musl": "2.5.2", - "@biomejs/cli-win32-arm64": "2.5.2", - "@biomejs/cli-win32-x64": "2.5.2" + "@biomejs/cli-darwin-arm64": "2.5.3", + "@biomejs/cli-darwin-x64": "2.5.3", + "@biomejs/cli-linux-arm64": "2.5.3", + "@biomejs/cli-linux-arm64-musl": "2.5.3", + "@biomejs/cli-linux-x64": "2.5.3", + "@biomejs/cli-linux-x64-musl": "2.5.3", + "@biomejs/cli-win32-arm64": "2.5.3", + "@biomejs/cli-win32-x64": "2.5.3" } }, "node_modules/@biomejs/cli-darwin-arm64": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.2.tgz", - "integrity": "sha512-e7P3P7EkwFc/KiX2AHw4YDLIBOMfG9CPCAwy52k5Bp0dfhkozx9hf6wCmIr2QeXy2XeccJ3V/Sg+hDmzYEqxSg==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.5.3.tgz", + "integrity": "sha512-QhYP9muVQ0nUO5zztFuPbEwi4+94sJWVjaZds9aMi1l/KNZBiUjdiSUrGHsTaMGDXrYl+r4AS2sUKfgH3w+V3g==", "cpu": [ "arm64" ], @@ -113,9 +113,9 @@ } }, "node_modules/@biomejs/cli-darwin-x64": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.2.tgz", - "integrity": "sha512-ymzMvjC1Jg0b9K0D26ZdARqFQXs7MocfLC5FOCGfkC0Ss+ACUJkX5364ZM5nT4NLZanHRZNVrZEy+Ibwcvux/g==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.5.3.tgz", + "integrity": "sha512-NC1Ss13UaW7QZX+y8j44bF7AP0jSJdBl6iRhe0MAkvaSqZy+mWg3GaXsrb+eSoHoGDBtaXWEbMVV0iVN2cZ7cQ==", "cpu": [ "x64" ], @@ -130,9 +130,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.2.tgz", - "integrity": "sha512-t7sseOmqND57uUWTwlawU6BYj+J06T/9EkydzBhkrgw/FK3QVhjU2wsJR0frljrKZ0/I8A/rYw7284QgqjQfIQ==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.5.3.tgz", + "integrity": "sha512-ksx1KWeyYW18ILL04msF/J4ZBtBDN33znYK8Z/aNv/vlBVxL9/g3mGP+omgHJKy4+KWbK87vcmmpmurfNjSgiA==", "cpu": [ "arm64" ], @@ -150,9 +150,9 @@ } }, "node_modules/@biomejs/cli-linux-arm64-musl": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.2.tgz", - "integrity": "sha512-w+ANG0ZvTu9IeEg9QnstoOnk6L0fpwJifW6aHR18+cb5Z39bkANItYjAfMrnvce5tmMK+IQ6nPX7/kQFdam5iw==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.5.3.tgz", + "integrity": "sha512-fccix0w6xp6csCXgxeC0dU/3ecgRQal0y+cv2SP9ajNlhe7Yrk2Ug7UDe2j9AT9ZDYitkXpvUKgZjjuoYeP4Vg==", "cpu": [ "arm64" ], @@ -170,9 +170,9 @@ } }, "node_modules/@biomejs/cli-linux-x64": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.2.tgz", - "integrity": "sha512-M/lOZrewzTCRDINbjhQ1gYYru37KlD3kJBQwwKCG0ckz5E9IZwIoJ3X0wBwRXA+yBDIwWUuPBHS67HzJY4dTfA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-2.5.3.tgz", + "integrity": "sha512-yMkJtilsgvILDcVkh187aVLTb64xYsrxYajx5kym+r1ULkO5HUOfu9AYKLGQbOVLwJtT2utNw7hhFNg+17mUYA==", "cpu": [ "x64" ], @@ -190,9 +190,9 @@ } }, "node_modules/@biomejs/cli-linux-x64-musl": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.2.tgz", - "integrity": "sha512-VArNLAzND063tF+XY0yPyM+DyahpzOMzOAvb7qs259nhjJWRjvjZdssuA+Rfl+l07+NOesKZ0Xu2yFrXyBMtzw==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.5.3.tgz", + "integrity": "sha512-O/yU9YKRUiHhmcjF2f38PSjseVk3G4VLWYc0G2HWpzdBVREV6G8IGWIVEFf7MFPfWIzNUIvPsEjeAZQIOgnLcQ==", "cpu": [ "x64" ], @@ -210,9 +210,9 @@ } }, "node_modules/@biomejs/cli-win32-arm64": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.2.tgz", - "integrity": "sha512-kbjFFKyZlzYnAuw7sRy5qDoFG6zrP40UK08oPQsWK0ct3NMnGSt+Bs1iviEEyEIP57N5MrykGXdO/wRiaR4lww==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.5.3.tgz", + "integrity": "sha512-cX5z+GYwRcqEok0AH3KSfQGgqYd0Nomfp6Fbe1uiTtELE38hdH2k842wQ9wLNaF/JJ7r4rjJQ4VR+ce+fRmQbw==", "cpu": [ "arm64" ], @@ -227,9 +227,9 @@ } }, "node_modules/@biomejs/cli-win32-x64": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.2.tgz", - "integrity": "sha512-4InchVpdVmdkkkgjQqKpgvyu+VPnoF/7RPSw5YATgEVpt2j72wcCAeV5TwaE9ZGJUZWZn7v2CwSAj6CrMJEx8A==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-2.5.3.tgz", + "integrity": "sha512-ExSaJWi4/u6+GXCszlSKpWSjKNbDseAYqqkCznsCsZ/4uidZ/BEqsCc5/3ctlq6dfIubdIIRSVLC/PG9xPl70Q==", "cpu": [ "x64" ], @@ -1648,9 +1648,9 @@ } }, "node_modules/@types/node": { - "version": "26.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.0.tgz", - "integrity": "sha512-O0A1G3xPGy4w7AgQdAQYUlQ+BKk2Oovw8eRpofyp5KdBZULnbe+WqaOVNrm705SHphCiG4XHsACrSmPu1f+Kgw==", + "version": "26.1.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", + "integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==", "dev": true, "license": "MIT", "dependencies": { @@ -2107,9 +2107,9 @@ } }, "node_modules/baseline-browser-mapping": { - "version": "2.10.41", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.41.tgz", - "integrity": "sha512-WwS7MHhqGHHlaVsqRZnhvCEMS0owDX+SxRlve7JkuH7My1Ara3ZriTmCQupPfYjxMZ8I/tgxtJYr2t7taHaH4A==", + "version": "2.10.43", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.43.tgz", + "integrity": "sha512-AjYpR78kDWAY3Efj+cDTFH9t9SCoL7OoTp1BOb0mQV7S+6CiLwnWM3FyxhJtdPufDFKzmCSFoUncKjWgJEZTCQ==", "dev": true, "license": "Apache-2.0", "bin": { @@ -2140,9 +2140,9 @@ } }, "node_modules/browserslist": { - "version": "4.28.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.4.tgz", - "integrity": "sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==", + "version": "4.28.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", + "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", "dev": true, "funding": [ { @@ -2160,10 +2160,10 @@ ], "license": "MIT", "dependencies": { - "baseline-browser-mapping": "^2.10.38", - "caniuse-lite": "^1.0.30001799", - "electron-to-chromium": "^1.5.376", - "node-releases": "^2.0.48", + "baseline-browser-mapping": "^2.10.42", + "caniuse-lite": "^1.0.30001803", + "electron-to-chromium": "^1.5.389", + "node-releases": "^2.0.51", "update-browserslist-db": "^1.2.3" }, "bin": { @@ -2217,9 +2217,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001800", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001800.tgz", - "integrity": "sha512-MMHtuAz9Ys840zAY5F4k6fV5GaivZ9sPk+nz0mY+GYVzRBnYkN0mpqkSR92oWRQ19yQWo4HvBV/FnC16AJX8MA==", + "version": "1.0.30001805", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001805.tgz", + "integrity": "sha512-52noaS3DubycKSXaU30TwPGIp+POyQSUVa5jBEq3vkRkY0kjyb3LQgvhU6WGyCcyXqVLWO0Cw0Q6BSdD0kUfVA==", "dev": true, "funding": [ { @@ -2635,9 +2635,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.385", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.385.tgz", - "integrity": "sha512-78sa/M08MNAYHQfjoWMvOlKQqZ0ElhSm/L5HNUc96VZ3b+KvDVnngFm8sYQy0XrhTRgAhggHr5abA7yTvRdo4Q==", + "version": "1.5.389", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", + "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==", "dev": true, "license": "ISC" }, @@ -3770,9 +3770,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.50", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.50.tgz", - "integrity": "sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg==", + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", "dev": true, "license": "MIT", "engines": { @@ -4728,9 +4728,9 @@ "dev": true }, "node_modules/svgo": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.1.tgz", - "integrity": "sha512-XDpWUOPC6FEibaLzjfe0ucaV0YrOjYotGJO1WpF0Zd+n6ZGEQUsSugaoLq9QkEZtAfQIxT42UChcssDVPP3+/w==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.2.tgz", + "integrity": "sha512-ekx94z1rRc5LDi6oSUaeRnYhd0UOJxdtQCL2rF8xpWxD3TPAsISWOrxezqGovqS38GRZOdpDfvQe3ts6F7nsng==", "dev": true, "license": "MIT", "dependencies": { @@ -5003,16 +5003,16 @@ "license": "MIT" }, "node_modules/vite": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.3.tgz", - "integrity": "sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==", + "version": "8.1.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.4.tgz", + "integrity": "sha512-bTT9PsdWO+MQMNG9ZXIP/qM9wGh37DFxTV/sPq9cFpHr3w4jkgef032PkAL9jAqhk3Nz8NQw3O8n6/xFkqO4QQ==", "dev": true, "license": "MIT", "dependencies": { "lightningcss": "^1.32.0", - "picomatch": "^4.0.4", + "picomatch": "^4.0.5", "postcss": "^8.5.16", - "rolldown": "~1.1.3", + "rolldown": "~1.1.4", "tinyglobby": "^0.2.17" }, "bin": { @@ -5091,9 +5091,9 @@ } }, "node_modules/vite/node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { diff --git a/client/simple/package.json b/client/simple/package.json index d4776c4d8..06e0c56ba 100644 --- a/client/simple/package.json +++ b/client/simple/package.json @@ -29,9 +29,9 @@ "swiped-events": "1.2.0" }, "devDependencies": { - "@biomejs/biome": "2.5.2", - "@types/node": "^26.1.0", - "browserslist": "^4.28.4", + "@biomejs/biome": "2.5.3", + "@types/node": "^26.1.1", + "browserslist": "^4.28.6", "browserslist-to-esbuild": "^2.1.1", "edge.js": "^6.5.1", "less": "^4.6.7", @@ -41,9 +41,9 @@ "stylelint": "^17.14.0", "stylelint-config-standard-less": "^4.1.0", "stylelint-prettier": "^5.0.3", - "svgo": "^4.0.1", + "svgo": "^4.0.2", "typescript": "~7.0.2", - "vite": "^8.1.3", + "vite": "^8.1.4", "vite-bundle-analyzer": "^1.3.8" } } diff --git a/searx/static/themes/simple/sxng-core.min.js b/searx/static/themes/simple/sxng-core.min.js index e05b2668f..a70162f10 100644 --- a/searx/static/themes/simple/sxng-core.min.js +++ b/searx/static/themes/simple/sxng-core.min.js @@ -1,3 +1,3 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./chunk/BnnvKC7b.min.js","./sxng-mapview.min.css","./chunk/DpvWr1cn.min.js","./chunk/DK4yUVpy.min.js","./chunk/DcK-mo-Y.min.js","./chunk/C8c7HJzp.min.js","./chunk/C93hSkpT.min.js","./chunk/5Ako-qGW.min.js","./chunk/DvCYLbJr.min.js","./chunk/od7pNHfk.min.js","./chunk/e2-9fzwE.min.js"])))=>i.map(i=>d[i]); -var e=class{id;constructor(e){this.id=e,queueMicrotask(()=>this.invoke())}async invoke(){try{console.debug(`[PLUGIN] ${this.id}: Running...`);let e=await this.run();if(!e)return;console.debug(`[PLUGIN] ${this.id}: Running post-exec...`),await this.post(e)}catch(e){console.error(`[PLUGIN] ${this.id}:`,e)}finally{console.debug(`[PLUGIN] ${this.id}: Done.`)}}},t={index:`index`,results:`results`,preferences:`preferences`,unknown:`unknown`},n={closeDetail:void 0,scrollPageToSelected:void 0,selectImage:void 0,selectNext:void 0,selectPrevious:void 0},r=()=>{let e=document.querySelector(`meta[name="endpoint"]`)?.getAttribute(`content`);return e&&e in t?e:t.unknown},i=()=>{let e=document.querySelector(`script[client_settings]`)?.getAttribute(`client_settings`);if(!e)return{};try{return JSON.parse(atob(e))}catch(e){return console.error(`Failed to load client_settings:`,e),{}}},a=async(e,t,n)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),n?.timeout??3e4),a=await fetch(t,{body:n?.body,method:e,signal:r.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw Error(a.statusText);return a},o=(e,t,n,r)=>{if(typeof t!=`string`){t.addEventListener(e,n,r);return}document.addEventListener(e,e=>{for(let r of e.composedPath())if(r instanceof HTMLElement&&r.matches(t)){try{n.call(r,e)}catch(e){console.error(e)}break}},r)},s=(e,t)=>{for(let e of t?.on??[])if(!e)return;document.readyState===`loading`?o(`DOMContentLoaded`,document,e,{once:!0}):e()},c=r(),l=i(),u=(e,t)=>{d(t)&&e()},d=e=>{switch(e.on){case`global`:return!0;case`endpoint`:return!!e.where.includes(c)}},f=`modulepreload`,p=function(e,t){return new URL(e,t).href},m={},h=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=p(t,n),t=s(t),t in m)return;m[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:f,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};s(()=>{document.documentElement.classList.remove(`no-js`),document.documentElement.classList.add(`js`),o(`click`,`.close`,function(){this.parentNode?.classList.add(`invisible`)}),o(`click`,`.searxng_init_map`,async function(e){e.preventDefault(),this.classList.remove(`searxng_init_map`),u(()=>h(async()=>{let{default:e}=await import(`./chunk/BnnvKC7b.min.js`);return{default:e}},__vite__mapDeps([0,1]),import.meta.url).then(({default:e})=>new e(this)),{on:`endpoint`,where:[t.results]})}),l.plugins?.includes(`infiniteScroll`)&&u(()=>h(async()=>{let{default:e}=await import(`./chunk/DpvWr1cn.min.js`);return{default:e}},__vite__mapDeps([2,3,4]),import.meta.url).then(({default:e})=>new e),{on:`endpoint`,where:[t.results]}),l.plugins?.includes(`calculator`)&&u(()=>h(async()=>{let{default:e}=await import(`./chunk/C8c7HJzp.min.js`);return{default:e}},__vite__mapDeps([5,4,3]),import.meta.url).then(({default:e})=>new e),{on:`endpoint`,where:[t.results]})}),s(()=>{h(()=>import(`./chunk/C93hSkpT.min.js`),__vite__mapDeps([6,3]),import.meta.url),h(()=>import(`./chunk/5Ako-qGW.min.js`),__vite__mapDeps([7,4,3]),import.meta.url),l.autocomplete&&h(()=>import(`./chunk/DvCYLbJr.min.js`),__vite__mapDeps([8,3]),import.meta.url)},{on:[c===t.index]}),s(()=>{h(()=>import(`./chunk/C93hSkpT.min.js`),__vite__mapDeps([6,3]),import.meta.url),h(()=>import(`./chunk/od7pNHfk.min.js`),__vite__mapDeps([9,3]),import.meta.url),h(()=>import(`./chunk/5Ako-qGW.min.js`),__vite__mapDeps([7,4,3]),import.meta.url),l.autocomplete&&h(()=>import(`./chunk/DvCYLbJr.min.js`),__vite__mapDeps([8,3]),import.meta.url)},{on:[c===t.results]}),s(()=>{h(()=>import(`./chunk/e2-9fzwE.min.js`),__vite__mapDeps([10,3]),import.meta.url)},{on:[c===t.preferences]});export{e as a,l as i,o as n,n as r,a as t}; +var e=class{id;constructor(e){this.id=e,queueMicrotask(()=>this.invoke())}async invoke(){try{console.debug(`[PLUGIN] ${this.id}: Running...`);let e=await this.run();if(!e)return;console.debug(`[PLUGIN] ${this.id}: Running post-exec...`),await this.post(e)}catch(e){console.error(`[PLUGIN] ${this.id}:`,e)}finally{console.debug(`[PLUGIN] ${this.id}: Done.`)}}},t={index:`index`,results:`results`,preferences:`preferences`,unknown:`unknown`},n={closeDetail:void 0,scrollPageToSelected:void 0,selectImage:void 0,selectNext:void 0,selectPrevious:void 0},r=()=>{let e=document.querySelector(`meta[name="endpoint"]`)?.getAttribute(`content`);return e&&e in t?e:t.unknown},i=()=>{let e=document.querySelector(`script[client_settings]`)?.getAttribute(`client_settings`);if(!e)return{};try{return JSON.parse(atob(e))}catch(e){return console.error(`Failed to load client_settings:`,e),{}}},a=async(e,t,n)=>{let r=new AbortController,i=setTimeout(()=>r.abort(),n?.timeout??3e4),a=await fetch(t,{body:n?.body,method:e,signal:r.signal}).finally(()=>clearTimeout(i));if(!a.ok)throw Error(a.statusText);return a},o=(e,t,n,r)=>{if(typeof t!=`string`){t.addEventListener(e,n,r);return}document.addEventListener(e,e=>{for(let r of e.composedPath())if(r instanceof HTMLElement&&r.matches(t)){try{n.call(r,e)}catch(e){console.error(e)}break}},r)},s=(e,t)=>{for(let e of t?.on??[])if(!e)return;document.readyState===`loading`?o(`DOMContentLoaded`,document,e,{once:!0}):e()},c=r(),l=i(),u=(e,t)=>{d(t)&&e()},d=e=>{switch(e.on){case`global`:return!0;case`endpoint`:return!!e.where.includes(c)}},f=`modulepreload`,p=function(e,t){return new URL(e,t).href},m={},h=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=p(t,n),t=s(t),t in m)return;m[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:f,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};s(()=>{document.documentElement.classList.remove(`no-js`),document.documentElement.classList.add(`js`),o(`click`,`.close`,function(){this.parentNode?.classList.add(`invisible`)}),o(`click`,`.searxng_init_map`,async function(e){e.preventDefault(),this.classList.remove(`searxng_init_map`),u(()=>h(async()=>{let{default:e}=await import(`./chunk/BnnvKC7b.min.js`);return{default:e}},__vite__mapDeps([0,1]),import.meta.url).then(({default:e})=>new e(this)),{on:`endpoint`,where:[t.results]})}),l.plugins?.includes(`infiniteScroll`)&&u(()=>h(async()=>{let{default:e}=await import(`./chunk/DpvWr1cn.min.js`);return{default:e}},__vite__mapDeps([2,3,4]),import.meta.url).then(({default:e})=>new e),{on:`endpoint`,where:[t.results]}),l.plugins?.includes(`calculator`)&&u(()=>h(async()=>{let{default:e}=await import(`./chunk/C8c7HJzp.min.js`);return{default:e}},__vite__mapDeps([5,4,3]),import.meta.url).then(({default:e})=>new e),{on:`endpoint`,where:[t.results]})}),s(()=>{h(()=>import(`./chunk/C93hSkpT.min.js`),__vite__mapDeps([6,3]),import.meta.url),h(()=>import(`./chunk/5Ako-qGW.min.js`),__vite__mapDeps([7,4,3]),import.meta.url),l.autocomplete&&h(()=>import(`./chunk/DvCYLbJr.min.js`),__vite__mapDeps([8,3]),import.meta.url)},{on:[c===t.index]}),s(()=>{h(()=>import(`./chunk/C93hSkpT.min.js`),__vite__mapDeps([6,3]),import.meta.url),h(()=>import(`./chunk/od7pNHfk.min.js`),__vite__mapDeps([9,3]),import.meta.url),h(()=>import(`./chunk/5Ako-qGW.min.js`),__vite__mapDeps([7,4,3]),import.meta.url),l.autocomplete&&h(()=>import(`./chunk/DvCYLbJr.min.js`),__vite__mapDeps([8,3]),import.meta.url)},{on:[c===t.results]}),s(()=>{h(()=>import(`./chunk/e2-9fzwE.min.js`),__vite__mapDeps([10,3]),import.meta.url)},{on:[c===t.preferences]});export{e as a,l as i,o as n,n as r,a as t}; //# sourceMappingURL=sxng-core.min.js.map \ No newline at end of file diff --git a/searx/static/themes/simple/sxng-core.min.js.map b/searx/static/themes/simple/sxng-core.min.js.map index 770c4027b..294604400 100644 --- a/searx/static/themes/simple/sxng-core.min.js.map +++ b/searx/static/themes/simple/sxng-core.min.js.map @@ -1 +1 @@ -{"version":3,"mappings":";AAYA,IAAsB,EAAtB,KAA6B,CAI3B,GAMA,YAAsB,EAAY,CAChC,KAAK,GAAK,EAEV,mBAAqB,KAAK,OAAO,CAAC,CACpC,CAEA,MAAc,QAAwB,CACpC,GAAI,CACF,QAAQ,MAAM,YAAY,KAAK,GAAG,aAAa,EAC/C,IAAM,EAAS,MAAM,KAAK,IAAI,EAC9B,GAAI,CAAC,EAAQ,OAEb,QAAQ,MAAM,YAAY,KAAK,GAAG,uBAAuB,EAEzD,MAAY,KAAK,KAAK,CAAuD,CAC/E,OAAS,EAAO,CACd,QAAQ,MAAM,YAAY,KAAK,GAAG,GAAI,CAAK,CAC7C,QAAU,CACR,QAAQ,MAAM,YAAY,KAAK,GAAG,QAAQ,CAC5C,CACF,CAuBF,EC9Ba,EAAY,CACvB,MAAO,QACP,QAAS,UACT,YAAa,cACb,QAAS,SACX,EAEa,EAAU,CACrB,YAAa,OACb,qBAAsB,OACtB,YAAa,OACb,WAAY,OACZ,eAAgB,MAClB,EAEM,MAAmC,CACvC,IAAM,EAAe,SAAS,cAAc,uBAAuB,CAAC,EAAE,aAAa,SAAS,EAM5F,OAJI,GAAgB,KAAgB,EAC3B,EAGF,EAAU,OACnB,EAEM,MAA8B,CAClC,IAAM,EAAW,SAAS,cAAc,yBAAyB,CAAC,EAAE,aAAa,iBAAiB,EAClG,GAAI,CAAC,EAAU,MAAO,CAAC,EAEvB,GAAI,CACF,OAAO,KAA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simple/src/js/toolkit.ts","../../../../client/simple/src/js/loader.ts","../../../../client/simple/src/js/router.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\n/**\n * Base class for client-side plugins.\n *\n * @remarks\n * Handle conditional loading of the plugin in:\n *\n * - client/simple/src/js/router.ts\n *\n * @abstract\n */\nexport abstract class Plugin {\n /**\n * Plugin name.\n */\n protected readonly id: string;\n\n /**\n * @remarks\n * Don't hold references of this instance outside the class.\n */\n protected constructor(id: string) {\n this.id = id;\n\n queueMicrotask(() => this.invoke());\n }\n\n private async invoke(): Promise {\n try {\n console.debug(`[PLUGIN] ${this.id}: Running...`);\n const result = await this.run();\n if (!result) return;\n\n console.debug(`[PLUGIN] ${this.id}: Running post-exec...`);\n // @ts-expect-error\n void (await this.post(result as NonNullable>>));\n } catch (error) {\n console.error(`[PLUGIN] ${this.id}:`, error);\n } finally {\n console.debug(`[PLUGIN] ${this.id}: Done.`);\n }\n }\n\n /**\n * Plugin goes here.\n *\n * @remarks\n * The plugin is already loaded at this point. If you wish to execute\n * conditions to exit early, consider moving the logic to:\n *\n * - client/simple/src/js/router.ts\n *\n * ...to avoid unnecessarily loading this plugin on the client.\n */\n protected abstract run(): Promise;\n\n /**\n * Post-execution hook.\n *\n * @remarks\n * The hook is only executed if `#run()` returns a truthy value.\n */\n // @ts-expect-error\n protected abstract post(result: NonNullable>>): Promise;\n}\n","// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport type { KeyBindingLayout } from \"./main/keyboard.ts\";\n\n// synced with searx/webapp.py get_client_settings\ntype Settings = {\n plugins?: string[];\n autocomplete?: string;\n autocomplete_min?: number;\n doi_resolver?: string;\n favicon_resolver?: string;\n hotkeys?: KeyBindingLayout;\n method?: \"GET\" | \"POST\";\n query_in_title?: boolean;\n results_on_new_tab?: boolean;\n safesearch?: 0 | 1 | 2;\n search_on_category_select?: boolean;\n theme?: string;\n theme_static_path?: string;\n translations?: Record;\n url_formatting?: \"pretty\" | \"full\" | \"host\";\n};\n\ntype HTTPOptions = {\n body?: BodyInit;\n timeout?: number;\n};\n\ntype ReadyOptions = {\n // all values must be truthy for the callback to be executed\n on?: (boolean | undefined)[];\n};\n\nexport type EndpointsKeys = keyof typeof Endpoints;\n\nexport const Endpoints = {\n index: \"index\",\n results: \"results\",\n preferences: \"preferences\",\n unknown: \"unknown\"\n} as const;\n\nexport const mutable = {\n closeDetail: undefined as (() => void) | undefined,\n scrollPageToSelected: undefined as (() => void) | undefined,\n selectImage: undefined as ((resultElement: HTMLElement) => void) | undefined,\n selectNext: undefined as ((openDetailView?: boolean) => void) | undefined,\n selectPrevious: undefined as ((openDetailView?: boolean) => void) | undefined\n};\n\nconst getEndpoint = (): EndpointsKeys => {\n const metaEndpoint = document.querySelector('meta[name=\"endpoint\"]')?.getAttribute(\"content\");\n\n if (metaEndpoint && metaEndpoint in Endpoints) {\n return metaEndpoint as EndpointsKeys;\n }\n\n return Endpoints.unknown;\n};\n\nconst getSettings = (): Settings => {\n const settings = document.querySelector(\"script[client_settings]\")?.getAttribute(\"client_settings\");\n if (!settings) return {};\n\n try {\n return JSON.parse(atob(settings));\n } catch (error) {\n console.error(\"Failed to load client_settings:\", error);\n return {};\n }\n};\n\nexport const http = async (method: string, url: string | URL, options?: HTTPOptions): Promise => {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), options?.timeout ?? 30_000);\n\n const res = await fetch(url, {\n body: options?.body,\n method: method,\n signal: controller.signal\n }).finally(() => clearTimeout(timeoutId));\n if (!res.ok) {\n throw new Error(res.statusText);\n }\n\n return res;\n};\n\nexport const listen = (\n type: string | K,\n target: string | Document | E,\n listener: (this: E, event: DocumentEventMap[K]) => void | Promise,\n options?: AddEventListenerOptions\n): void => {\n if (typeof target !== \"string\") {\n target.addEventListener(type, listener as EventListener, options);\n return;\n }\n\n document.addEventListener(\n type,\n (event: Event) => {\n for (const node of event.composedPath()) {\n if (node instanceof HTMLElement && node.matches(target)) {\n try {\n listener.call(node as E, event as DocumentEventMap[K]);\n } catch (error) {\n console.error(error);\n }\n break;\n }\n }\n },\n options\n );\n};\n\nexport const ready = (callback: () => void, options?: ReadyOptions): void => {\n for (const condition of options?.on ?? []) {\n if (!condition) {\n return;\n }\n }\n\n if (document.readyState === \"loading\") {\n listen(\"DOMContentLoaded\", document, callback, { once: true });\n } else {\n callback();\n }\n};\n\nexport const endpoint: EndpointsKeys = getEndpoint();\nexport const settings: Settings = getSettings();\n","// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport type { Plugin } from \"./Plugin.ts\";\nimport { type EndpointsKeys, endpoint } from \"./toolkit.ts\";\n\ntype Options =\n | {\n on: \"global\";\n }\n | {\n on: \"endpoint\";\n where: EndpointsKeys[];\n };\n\nexport const load = (instance: () => Promise, options: Options): void => {\n if (!check(options)) return;\n\n void instance();\n};\n\nconst check = (options: Options): boolean => {\n // biome-ignore lint/style/useDefaultSwitchClause: options is typed\n switch (options.on) {\n case \"global\": {\n return true;\n }\n case \"endpoint\": {\n if (!options.where.includes(endpoint)) {\n // not on the expected endpoint\n return false;\n }\n\n return true;\n }\n }\n};\n","// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { load } from \"./loader.ts\";\nimport { Endpoints, endpoint, listen, ready, settings } from \"./toolkit.ts\";\n\nready(() => {\n document.documentElement.classList.remove(\"no-js\");\n document.documentElement.classList.add(\"js\");\n\n listen(\"click\", \".close\", function (this: HTMLElement) {\n (this.parentNode as HTMLElement)?.classList.add(\"invisible\");\n });\n\n listen(\"click\", \".searxng_init_map\", async function (this: HTMLElement, event: Event) {\n event.preventDefault();\n this.classList.remove(\"searxng_init_map\");\n\n load(() => import(\"./plugin/MapView.ts\").then(({ default: Plugin }) => new Plugin(this)), {\n on: \"endpoint\",\n where: [Endpoints.results]\n });\n });\n\n if (settings.plugins?.includes(\"infiniteScroll\")) {\n load(() => import(\"./plugin/InfiniteScroll.ts\").then(({ default: Plugin }) => new Plugin()), {\n on: \"endpoint\",\n where: [Endpoints.results]\n });\n }\n\n if (settings.plugins?.includes(\"calculator\")) {\n load(() => import(\"./plugin/Calculator.ts\").then(({ default: Plugin }) => new Plugin()), {\n on: \"endpoint\",\n where: [Endpoints.results]\n });\n }\n});\n\nready(\n () => {\n void import(\"./main/keyboard.ts\");\n void import(\"./main/search.ts\");\n\n if (settings.autocomplete) {\n void import(\"./main/autocomplete.ts\");\n }\n },\n { on: [endpoint === Endpoints.index] }\n);\n\nready(\n () => {\n void import(\"./main/keyboard.ts\");\n void import(\"./main/results.ts\");\n void import(\"./main/search.ts\");\n\n if (settings.autocomplete) {\n void import(\"./main/autocomplete.ts\");\n }\n },\n { on: [endpoint === Endpoints.results] }\n);\n\nready(\n () => {\n void import(\"./main/preferences.ts\");\n },\n { on: [endpoint === Endpoints.preferences] }\n);\n"],"file":"sxng-core.min.js"} \ No newline at end of file +{"version":3,"mappings":";AAYA,IAAsB,EAAtB,KAA6B,CAI3B,GAMA,YAAsB,EAAY,CAChC,KAAK,GAAK,EAEV,mBAAqB,KAAK,OAAO,CAAC,CACpC,CAEA,MAAc,QAAwB,CACpC,GAAI,CACF,QAAQ,MAAM,YAAY,KAAK,GAAG,aAAa,EAC/C,IAAM,EAAS,MAAM,KAAK,IAAI,EAC9B,GAAI,CAAC,EAAQ,OAEb,QAAQ,MAAM,YAAY,KAAK,GAAG,uBAAuB,EAEzD,MAAY,KAAK,KAAK,CAAuD,CAC/E,OAAS,EAAO,CACd,QAAQ,MAAM,YAAY,KAAK,GAAG,GAAI,CAAK,CAC7C,QAAU,CACR,QAAQ,MAAM,YAAY,KAAK,GAAG,QAAQ,CAC5C,CACF,CAuBF,EC9Ba,EAAY,CACvB,MAAO,QACP,QAAS,UACT,YAAa,cACb,QAAS,SACX,EAEa,EAAU,CACrB,YAAa,OACb,qBAAsB,OACtB,YAAa,OACb,WAAY,OACZ,eAAgB,MAClB,EAEM,MAAmC,CACvC,IAAM,EAAe,SAAS,cAAc,uBAAuB,CAAC,EAAE,aAAa,SAAS,EAM5F,OAJI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I,CAAC,IAAa,EAAU,OAAO,CAAE,CACzC,EAEA,MACQ,CACJ,MAAK,OAAO,mEACd,EACA,CAAE,GAAI,CAAC,IAAa,EAAU,WAAW,CAAE,CAC7C","names":[],"ignoreList":[],"sources":["../../../../client/simple/src/js/Plugin.ts","../../../../client/simple/src/js/toolkit.ts","../../../../client/simple/src/js/loader.ts","../../../../client/simple/src/js/router.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n\n/**\n * Base class for client-side plugins.\n *\n * @remarks\n * Handle conditional loading of the plugin in:\n *\n * - client/simple/src/js/router.ts\n *\n * @abstract\n */\nexport abstract class Plugin {\n /**\n * Plugin name.\n */\n protected readonly id: string;\n\n /**\n * @remarks\n * Don't hold references of this instance outside the class.\n */\n protected constructor(id: string) {\n this.id = id;\n\n queueMicrotask(() => this.invoke());\n }\n\n private async invoke(): Promise {\n try {\n console.debug(`[PLUGIN] ${this.id}: Running...`);\n const result = await this.run();\n if (!result) return;\n\n console.debug(`[PLUGIN] ${this.id}: Running post-exec...`);\n // @ts-expect-error\n void (await this.post(result as NonNullable>>));\n } catch (error) {\n console.error(`[PLUGIN] ${this.id}:`, error);\n } finally {\n console.debug(`[PLUGIN] ${this.id}: Done.`);\n }\n }\n\n /**\n * Plugin goes here.\n *\n * @remarks\n * The plugin is already loaded at this point. If you wish to execute\n * conditions to exit early, consider moving the logic to:\n *\n * - client/simple/src/js/router.ts\n *\n * ...to avoid unnecessarily loading this plugin on the client.\n */\n protected abstract run(): Promise;\n\n /**\n * Post-execution hook.\n *\n * @remarks\n * The hook is only executed if `#run()` returns a truthy value.\n */\n // @ts-expect-error\n protected abstract post(result: NonNullable>>): Promise;\n}\n","// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport type { KeyBindingLayout } from \"./main/keyboard.ts\";\n\n// synced with searx/webapp.py get_client_settings\ntype Settings = {\n plugins?: string[];\n autocomplete?: string;\n autocomplete_min?: number;\n doi_resolver?: string;\n favicon_resolver?: string;\n hotkeys?: KeyBindingLayout;\n method?: \"GET\" | \"POST\";\n query_in_title?: boolean;\n results_on_new_tab?: boolean;\n safesearch?: 0 | 1 | 2;\n search_on_category_select?: boolean;\n theme?: string;\n theme_static_path?: string;\n translations?: Record;\n url_formatting?: \"pretty\" | \"full\" | \"host\";\n};\n\ntype HTTPOptions = {\n body?: BodyInit;\n timeout?: number;\n};\n\ntype ReadyOptions = {\n // all values must be truthy for the callback to be executed\n on?: (boolean | undefined)[];\n};\n\nexport type EndpointsKeys = keyof typeof Endpoints;\n\nexport const Endpoints = {\n index: \"index\",\n results: \"results\",\n preferences: \"preferences\",\n unknown: \"unknown\"\n} as const;\n\nexport const mutable = {\n closeDetail: undefined as (() => void) | undefined,\n scrollPageToSelected: undefined as (() => void) | undefined,\n selectImage: undefined as ((resultElement: HTMLElement) => void) | undefined,\n selectNext: undefined as ((openDetailView?: boolean) => void) | undefined,\n selectPrevious: undefined as ((openDetailView?: boolean) => void) | undefined\n};\n\nconst getEndpoint = (): EndpointsKeys => {\n const metaEndpoint = document.querySelector('meta[name=\"endpoint\"]')?.getAttribute(\"content\");\n\n if (metaEndpoint && metaEndpoint in Endpoints) {\n return metaEndpoint as EndpointsKeys;\n }\n\n return Endpoints.unknown;\n};\n\nconst getSettings = (): Settings => {\n const settings = document.querySelector(\"script[client_settings]\")?.getAttribute(\"client_settings\");\n if (!settings) return {};\n\n try {\n return JSON.parse(atob(settings));\n } catch (error) {\n console.error(\"Failed to load client_settings:\", error);\n return {};\n }\n};\n\nexport const http = async (method: string, url: string | URL, options?: HTTPOptions): Promise => {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), options?.timeout ?? 30_000);\n\n const res = await fetch(url, {\n body: options?.body,\n method: method,\n signal: controller.signal\n }).finally(() => clearTimeout(timeoutId));\n if (!res.ok) {\n throw new Error(res.statusText);\n }\n\n return res;\n};\n\nexport const listen = (\n type: string | K,\n target: string | Document | E,\n listener: (this: E, event: DocumentEventMap[K]) => void | Promise,\n options?: AddEventListenerOptions\n): void => {\n if (typeof target !== \"string\") {\n target.addEventListener(type, listener as EventListener, options);\n return;\n }\n\n document.addEventListener(\n type,\n (event: Event) => {\n for (const node of event.composedPath()) {\n if (node instanceof HTMLElement && node.matches(target)) {\n try {\n listener.call(node as E, event as DocumentEventMap[K]);\n } catch (error) {\n console.error(error);\n }\n break;\n }\n }\n },\n options\n );\n};\n\nexport const ready = (callback: () => void, options?: ReadyOptions): void => {\n for (const condition of options?.on ?? []) {\n if (!condition) {\n return;\n }\n }\n\n if (document.readyState === \"loading\") {\n listen(\"DOMContentLoaded\", document, callback, { once: true });\n } else {\n callback();\n }\n};\n\nexport const endpoint: EndpointsKeys = getEndpoint();\nexport const settings: Settings = getSettings();\n","// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport type { Plugin } from \"./Plugin.ts\";\nimport { type EndpointsKeys, endpoint } from \"./toolkit.ts\";\n\ntype Options =\n | {\n on: \"global\";\n }\n | {\n on: \"endpoint\";\n where: EndpointsKeys[];\n };\n\nexport const load = (instance: () => Promise, options: Options): void => {\n if (!check(options)) return;\n\n void instance();\n};\n\nconst check = (options: Options): boolean => {\n // biome-ignore lint/style/useDefaultSwitchClause: options is typed\n switch (options.on) {\n case \"global\": {\n return true;\n }\n case \"endpoint\": {\n if (!options.where.includes(endpoint)) {\n // not on the expected endpoint\n return false;\n }\n\n return true;\n }\n }\n};\n","// SPDX-License-Identifier: AGPL-3.0-or-later\n\nimport { load } from \"./loader.ts\";\nimport { Endpoints, endpoint, listen, ready, settings } from \"./toolkit.ts\";\n\nready(() => {\n document.documentElement.classList.remove(\"no-js\");\n document.documentElement.classList.add(\"js\");\n\n listen(\"click\", \".close\", function (this: HTMLElement) {\n (this.parentNode as HTMLElement)?.classList.add(\"invisible\");\n });\n\n listen(\"click\", \".searxng_init_map\", async function (this: HTMLElement, event: Event) {\n event.preventDefault();\n this.classList.remove(\"searxng_init_map\");\n\n load(() => import(\"./plugin/MapView.ts\").then(({ default: Plugin }) => new Plugin(this)), {\n on: \"endpoint\",\n where: [Endpoints.results]\n });\n });\n\n if (settings.plugins?.includes(\"infiniteScroll\")) {\n load(() => import(\"./plugin/InfiniteScroll.ts\").then(({ default: Plugin }) => new Plugin()), {\n on: \"endpoint\",\n where: [Endpoints.results]\n });\n }\n\n if (settings.plugins?.includes(\"calculator\")) {\n load(() => import(\"./plugin/Calculator.ts\").then(({ default: Plugin }) => new Plugin()), {\n on: \"endpoint\",\n where: [Endpoints.results]\n });\n }\n});\n\nready(\n () => {\n void import(\"./main/keyboard.ts\");\n void import(\"./main/search.ts\");\n\n if (settings.autocomplete) {\n void import(\"./main/autocomplete.ts\");\n }\n },\n { on: [endpoint === Endpoints.index] }\n);\n\nready(\n () => {\n void import(\"./main/keyboard.ts\");\n void import(\"./main/results.ts\");\n void import(\"./main/search.ts\");\n\n if (settings.autocomplete) {\n void import(\"./main/autocomplete.ts\");\n }\n },\n { on: [endpoint === Endpoints.results] }\n);\n\nready(\n () => {\n void import(\"./main/preferences.ts\");\n },\n { on: [endpoint === Endpoints.preferences] }\n);\n"],"file":"sxng-core.min.js"} \ No newline at end of file