/** * @license * (C) Copyright Contributors to the SearXNG project. * (C) Copyright Contributors to the searx project (2014 - 2021). * SPDX-License-Identifier: AGPL-3.0-or-later */window.searxng=function(p,d){p.Element&&function(i){i.matches=i.matches||i.matchesSelector||i.webkitMatchesSelector||i.msMatchesSelector||function(s){for(var l=this,o=(l.parentNode||l.document).querySelectorAll(s),e=-1;o[++e]&&o[e]!=l;);return!!o[e]}}(Element.prototype);function u(i,s,l){try{i.call(s,l)}catch(o){console.log(o)}}var h=window.searxng||{};h.on=function(i,s,l,o){o=o||!1,typeof i!="string"?i.addEventListener(s,l,o):d.addEventListener(s,function(e){for(var t=e.target||e.srcElement,n=!1;t&&t.matches&&t!==d&&!(n=t.matches(i));)t=t.parentElement;n&&u(l,t,e)},o)},h.ready=function(i){document.readyState!="loading"?i.call(p):p.addEventListener("DOMContentLoaded",i.bind(p))},h.http=function(i,s,l=null){return new Promise(function(o,e){try{var t=new XMLHttpRequest;t.open(i,s,!0),t.timeout=2e4,t.onload=function(){t.status==200?o(t.response,t.responseType):e(Error(t.statusText))},t.onerror=function(){e(Error("Network Error"))},t.onabort=function(){e(Error("Transaction is aborted"))},t.ontimeout=function(){e(Error("Timeout"))},l?t.send(l):t.send()}catch(n){e(n)}})},h.loadStyle=function(i){var s=h.settings.theme_static_path+"/"+i,l="style_"+i.replace(".","_"),o=d.getElementById(l);o===null&&(o=d.createElement("link"),o.setAttribute("id",l),o.setAttribute("rel","stylesheet"),o.setAttribute("type","text/css"),o.setAttribute("href",s),d.body.appendChild(o))},h.loadScript=function(i,s){var l=h.settings.theme_static_path+"/"+i,o="script_"+i.replace(".","_"),e=d.getElementById(o);if(e===null)e=d.createElement("script"),e.setAttribute("id",o),e.setAttribute("src",l),e.onload=s,e.onerror=function(){e.setAttribute("error","1")},d.body.appendChild(e);else if(e.hasAttribute("error"))console.log("callback not executed : script '"+l+"' not loaded.");else try{s.apply(e,[])}catch(t){console.log(t)}},h.insertBefore=function(i,s){s.parentNode.insertBefore(i,s)},h.insertAfter=function(i,s){s.parentNode.insertAfter(i,s.nextSibling)},h.on(".close","click",function(){this.parentNode.classList.add("invisible")});function m(){for(var i of d.getElementsByTagName("body")[0].classList.values())if(i.endsWith("_endpoint"))return i.split("_")[0];return""}return h.endpoint=m(),h}(window,document);searxng.ready(function(){if(searxng.infinite_scroll_supported="IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype,searxng.endpoint!=="results")return;if(!searxng.infinite_scroll_supported){console.log("IntersectionObserver not supported");return}let p=document;var d=p.getElementById("results").classList.contains("only_template_images");function u(){var i=p.createElement("div");return i.classList.add("loader"),i}function h(i,s){i.textContent="",s.forEach(l=>i.appendChild(l))}function m(i){var s=p.querySelector("#pagination form.next_page");if(s){h(p.querySelector("#pagination"),[u()]);var l=new FormData(s);searxng.http("POST",p.querySelector("#search").getAttribute("action"),l).then(function(o){var e=new DOMParser().parseFromString(o,"text/html"),t=e.querySelectorAll("#urls article"),n=e.querySelector("#pagination");p.querySelector("#pagination").remove(),t.length>0&&!d&&p.querySelector("#urls").appendChild(p.createElement("hr")),t.forEach(a=>{p.querySelector("#urls").appendChild(a)}),n&&(p.querySelector("#results").appendChild(n),i())}).catch(function(o){console.log(o);var e=p.createElement("div");e.textContent=searxng.settings.translations.error_loading_next_page,e.classList.add("dialog-error"),e.setAttribute("role","alert"),h(p.querySelector("#pagination"),[e])})}}if(searxng.settings.infinite_scroll&&searxng.infinite_scroll_supported){const i={rootMargin:"20rem"},s="article.result:last-child",l=new IntersectionObserver(o=>{const e=o[0];e.isIntersecting&&(l.unobserve(e.target),m(()=>l.observe(p.querySelector(s),i)))});l.observe(p.querySelector(s),i)}});searxng.ready(function(){function p(r){for(;r!==void 0;){if(r.classList.contains("detail"))return!0;if(r.classList.contains("result"))return!1;r=r.parentNode}return!1}function d(r){for(;r!==void 0;){if(r.classList.contains("result"))return r;r=r.parentNode}}function u(r){return r&&r.classList.contains("result-images")}searxng.on(".result","click",function(r){if(!p(r.target)){s(this)(!0,!0);let f=d(r.target);u(f)&&(r.preventDefault(),searxng.selectImage(f))}}),searxng.on(".result a","focus",function(r){if(!p(r.target)){let f=d(r.target);f&&f.getAttribute("data-vim-selected")===null&&s(f)(!0),u(f)&&searxng.selectImage(f)}},!0);var h={Escape:{key:"ESC",fun:o,des:"remove focus from the focused input",cat:"Control"},c:{key:"c",fun:T,des:"copy url of the selected result to the clipboard",cat:"Results"},h:{key:"h",fun:S,des:"toggle help window",cat:"Other"},i:{key:"i",fun:v,des:"focus on the search input",cat:"Control"},n:{key:"n",fun:t(),des:"go to next page",cat:"Results"},o:{key:"o",fun:b(!1),des:"open search result",cat:"Results"},p:{key:"p",fun:n(),des:"go to previous page",cat:"Results"},r:{key:"r",fun:l,des:"reload page from the server",cat:"Control"},t:{key:"t",fun:b(!0),des:"open the result in a new tab",cat:"Results"}},m={default:Object.assign({ArrowLeft:{key:"←",fun:s("up"),des:"select previous search result",cat:"Results"},ArrowRight:{key:"→",fun:s("down"),des:"select next search result",cat:"Results"}},h),vim:Object.assign({b:{key:"b",fun:c(-window.innerHeight),des:"scroll one page up",cat:"Navigation"},f:{key:"f",fun:c(window.innerHeight),des:"scroll one page down",cat:"Navigation"},u:{key:"u",fun:c(-window.innerHeight/2),des:"scroll half a page up",cat:"Navigation"},d:{key:"d",fun:c(window.innerHeight/2),des:"scroll half a page down",cat:"Navigation"},g:{key:"g",fun:y(-document.body.scrollHeight,"top"),des:"scroll to the top of the page",cat:"Navigation"},v:{key:"v",fun:y(document.body.scrollHeight,"bottom"),des:"scroll to the bottom of the page",cat:"Navigation"},k:{key:"k",fun:s("up"),des:"select previous search result",cat:"Results"},j:{key:"j",fun:s("down"),des:"select next search result",cat:"Results"},y:{key:"y",fun:T,des:"copy url of the selected result to the clipboard",cat:"Results"}},h)},i=m[searxng.settings.hotkeys]||m.default;searxng.on(document,"keydown",function(r){if(Object.prototype.hasOwnProperty.call(i,r.key)&&!r.ctrlKey&&!r.altKey&&!r.shiftKey&&!r.metaKey){var f=r.target.tagName.toLowerCase();r.key==="Escape"?i[r.key].fun(r):(r.target===document.body||f==="a"||f==="button")&&(r.preventDefault(),i[r.key].fun())}});function s(r){return function(f,k){var _=document.querySelector(".result[data-vim-selected]"),E=r;if(_===null){if(_=document.querySelector(".result"),_===null)return;(r==="down"||r==="up")&&(E=_)}var g,w=document.querySelectorAll(".result");if(w=Array.from(w),typeof E!="string")g=E;else switch(E){case"visible":for(var O=document.documentElement.scrollTop||document.body.scrollTop,x=O+document.documentElement.clientHeight,R=0;RO)break}break;case"down":g=w[w.indexOf(_)+1]||_;break;case"up":g=w[w.indexOf(_)-1]||_;break;case"bottom":g=w[w.length-1];break;case"top":default:g=w[0]}if(g){if(_.removeAttribute("data-vim-selected"),g.setAttribute("data-vim-selected","true"),!k){var D=g.querySelector("h3 a")||g.querySelector("a");D!==null&&D.focus()}f||a()}}}function l(){document.location.reload(!0)}function o(r){const f=r.target.tagName.toLowerCase();document.activeElement&&(f==="input"||f==="select"||f==="textarea")?document.activeElement.blur():searxng.closeDetail()}function e(r){return function(){var f=document.querySelector(r);f&&f.click()}}function t(){return e('nav#pagination .next_page button[type="submit"]')}function n(){return e('nav#pagination .previous_page button[type="submit"]')}function a(){var r=document.querySelector(".result[data-vim-selected]");if(r!==null){var f=document.documentElement.scrollTop||document.body.scrollTop,k=document.documentElement.clientHeight,_=r.offsetTop,E=_+r.clientHeight,g=120;if(r.previousElementSibling===null&&E_-g)window.scroll(window.scrollX,_-g);else{var w=f+k;w a")),f!==null){var k=f.getAttribute("href");r?window.open(k):window.location.href=k}}}function M(r){var f={};for(var k in i){var _=i[k];f[_.cat]=f[_.cat]||[],f[_.cat].push(_)}var E=Object.keys(f).sort(function(q,D){return f[D].length-f[q].length});if(E.length!==0){var g='×';g+="

How to navigate SearXNG with hotkeys

",g+="";for(var w=0;w"),g+="",(!R||x)&&(g+="")}g+="
",g+="

"+O[0].cat+"

",g+='
    ';for(var I in O)g+="
  • "+O[I].key+" "+O[I].des+"
  • ";g+="
",g+="
",r.innerHTML=g}}function S(){var r=document.querySelector("#vim-hotkeys-help");if(r==null){r=document.createElement("div"),r.id="vim-hotkeys-help",r.className="dialog-modal",M(r);var f=document.getElementsByTagName("body")[0];f.appendChild(r)}else{r.classList.toggle("invisible");return}}function T(){var r=document.querySelector(".result[data-vim-selected] h3 a");if(r===null)return;const f=r.getAttribute("href");navigator.clipboard.writeText(f)}searxng.scrollPageToSelected=a,searxng.selectNext=s("down"),searxng.selectPrevious=s("up")});(function(p,d,u){u.ready(function(){u.on(".searxng_init_map","click",function(h){this.classList.remove("searxng_init_map");var m=this.dataset.leafletTarget,i=parseFloat(this.dataset.mapLon),s=parseFloat(this.dataset.mapLat),l=parseFloat(this.dataset.mapZoom),o=JSON.parse(this.dataset.mapBoundingbox),e=JSON.parse(this.dataset.mapGeojson);u.loadStyle("css/leaflet.css"),u.loadScript("js/leaflet.js",function(){var t=null;if(o){var n=L.latLng(o[0],o[2]),a=L.latLng(o[1],o[3]);t=L.latLngBounds(n,a)}var c=L.map(m),y="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",v='Map data © OpenStreetMap contributors',b=new L.TileLayer(y,{minZoom:1,maxZoom:19,attribution:v}),M="https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png",S='Wikimedia maps | Maps data © OpenStreetMap contributors',T=new L.TileLayer(M,{minZoom:1,maxZoom:19,attribution:S});t?setTimeout(function(){c.fitBounds(t,{maxZoom:17})},0):i&&s&&(l?c.setView(new L.latLng(s,i),l):c.setView(new L.latLng(s,i),8)),c.addLayer(b);var r={"OSM Mapnik":b,"OSM Wikimedia":T};L.control.layers(r).addTo(c),e&&L.geoJson(e).addTo(c)}),h.preventDefault()})})})(window,document,window.searxng);(function(p,d,u){u.endpoint==="preferences"&&u.ready(function(){let h=null;function m(){h==null&&u.http("GET","engine_descriptions.json").then(function(n){h=JSON.parse(n);for(const[a,c]of Object.entries(h)){let y=d.querySelectorAll('[data-engine-name="'+a+'"] .engine-description');for(const v of y){let b=" ("+u.settings.translations.Source+": "+c[1]+")";v.innerHTML=c[0]+b}}})}function i(n,a){u.on(n,"keyup",c=>{c.code=="Enter"&&a()})}for(const n of d.querySelectorAll('[role="tab"],input[type=checkbox][class~=checkbox-onoff],.category_label'))i(n,()=>{n.click()});for(const n of d.querySelectorAll("[data-engine-name]"))u.on(n,"mouseenter",m);const s=d.querySelectorAll(".enable-all-engines"),l=d.querySelectorAll(".disable-all-engines"),o=d.querySelectorAll("tbody input[type=checkbox][class~=checkbox-onoff]"),e=n=>{for(const a of o)a.offsetParent!==null&&(a.checked=!n)};for(const n of s)u.on(n,"click",()=>e(!0));for(const n of l)u.on(n,"click",()=>e(!1));const t=d.querySelector("#copy-hash");u.on(t,"click",n=>{n.preventDefault(),navigator.clipboard.writeText(t.dataset.hash),t.innerText=t.dataset.copiedText})})})(window,document,window.searxng);(function(p,d,u){u.endpoint==="results"&&u.ready(function(){d.querySelectorAll("#urls img").forEach(l=>l.addEventListener("error",()=>{l.src=window.searxng.settings.theme_static_path+"/img/img_load_error.svg"},{once:!0})),d.querySelector("#search_url button#copy_url")&&(d.querySelector("#search_url button#copy_url").style.display="block"),u.on(".btn-collapse","click",function(){var l=this.getAttribute("data-btn-text-collapsed"),o=this.getAttribute("data-btn-text-not-collapsed"),e=this.getAttribute("data-target"),t=d.querySelector(e),n=this.innerHTML;this.classList.contains("collapsed")?n=n.replace(l,o):n=n.replace(o,l),this.innerHTML=n,this.classList.toggle("collapsed"),t.classList.toggle("invisible")}),u.on(".media-loader","click",function(){var l=this.getAttribute("data-target"),o=d.querySelector(l+" > iframe"),e=o.getAttribute("src");(e==null||e===!1)&&o.setAttribute("src",o.getAttribute("data-src"))}),u.on("#copy_url","click",function(){var l=this.parentElement.querySelector("pre");navigator.clipboard.writeText(l.innerText),this.innerText=this.dataset.copiedText});let h;const m=d.createElement("div");m.classList.add("loader");const i=new Image,s=(l,o)=>{h&&clearTimeout(h),h=setTimeout(()=>{i.src=l},1e3),i.onload=()=>{o(),m.remove()},i.onerror=()=>{m.remove()}};u.selectImage=l=>{if(d.getElementById("results").classList.add("image-detail-open"),window.location.hash="#image-viewer",u.scrollPageToSelected(),!l)return;const o=l.querySelector(".result-images-source img");if(!o)return;const e=o.getAttribute("data-src");if(!e)return;const t=l.querySelector(".image_thumbnail");o.src=t.src,l.querySelector(".detail").appendChild(m),s(e,()=>{o.src=e,o.removeAttribute("data-src")})},u.closeDetail=function(){d.getElementById("results").classList.remove("image-detail-open"),window.location.hash=="#image-viewer"&&window.history.back(),u.scrollPageToSelected()},u.on(".result-detail-close","click",l=>{l.preventDefault(),u.closeDetail()}),u.on(".result-detail-previous","click",l=>{l.preventDefault(),u.selectPrevious(!1)}),u.on(".result-detail-next","click",l=>{l.preventDefault(),u.selectNext(!1)}),window.addEventListener("hashchange",()=>{window.location.hash!="#image-viewer"&&u.closeDetail()}),d.querySelectorAll(".swipe-horizontal").forEach(l=>{l.addEventListener("swiped-left",function(){u.selectNext(!1)}),l.addEventListener("swiped-right",function(){u.selectPrevious(!1)})}),p.addEventListener("scroll",function(){var l=d.getElementById("backToTop"),o=document.documentElement.scrollTop||document.body.scrollTop,e=d.getElementById("results");l!==null&&(o>=100?e.classList.add("scrolling"):e.classList.remove("scrolling"))},!0)})})(window,document,window.searxng);function P(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}function C(p){throw new Error('Could not dynamically require "'+p+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var N={exports:{}},H;function B(){return H||(H=1,function(p,d){(function(u){p.exports=u()})(function(){return function(){function u(h,m,i){function s(e,t){if(!m[e]){if(!h[e]){var n=typeof C=="function"&&C;if(!t&&n)return n(e,!0);if(l)return l(e,!0);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}var c=m[e]={exports:{}};h[e][0].call(c.exports,function(y){var v=h[e][1][y];return s(v||y)},c,c.exports,u,h,m,i)}return m[e].exports}for(var l=typeof C=="function"&&C,o=0;o=b.From&&n.keyCode<=b.To?v=!b.Not:v=b.Not))};for(var c in o.prototype.getEventsByType(e,t)){var y=o.merge({Operator:i.AND},e.KeyboardMappings[c]),v=i.AND==y.Operator;y.Conditions.forEach(a),v===!0&&y.Callback.call(e,n)}},o.prototype.makeRequest=function(e,t,n){var a=Object.getOwnPropertyNames(e.HttpHeaders),c=new XMLHttpRequest,y=e._HttpMethod(),v=e._Url(),b=e._Pre(),M=encodeURIComponent(e._QueryArg())+"="+encodeURIComponent(b);y.match(/^GET$/i)&&(v.indexOf("?")!==-1?v+="&"+M:v+="?"+M),c.open(y,v,!0);for(var S=a.length-1;S>=0;S--)c.setRequestHeader(a[S],e.HttpHeaders[a[S]]);return c.onreadystatechange=function(){c.readyState==4&&c.status==200?(e.$Cache[b]=c.response,t(c.response)):c.status>=400&&n()},c},o.prototype.ajax=function(e,t,n){n===void 0&&(n=!0),e.$AjaxTimer&&window.clearTimeout(e.$AjaxTimer),n===!0?e.$AjaxTimer=window.setTimeout(o.prototype.ajax.bind(null,e,t,!1),e.Delay):(e.Request&&e.Request.abort(),e.Request=t,e.Request.send(e._QueryArg()+"="+e._Pre()))},o.prototype.cache=function(e,t,n){var a=e._Cache(e._Pre());if(a===void 0){var c=o.prototype.makeRequest(e,t,n);o.prototype.ajax(e,c)}else t(a)},o.prototype.destroy=function(e){for(var t in e.$Listeners)e.Input.removeEventListener(t,e.$Listeners[t]);e.DOMResults.parentNode.removeChild(e.DOMResults)},o.merge=function(){for(var e={},t,n=0;n"+e+""}},HttpHeaders:{"Content-type":"application/x-www-form-urlencoded"},Limit:0,MinChars:0,HttpMethod:"GET",QueryArg:"q",Url:null,KeyboardMappings:{Enter:{Conditions:[{Is:13,Not:!1}],Callback:function(e){if(this.DOMResults.getAttribute("class").indexOf("open")!=-1){var t=this.DOMResults.querySelector("li.active");t!==null&&(e.preventDefault(),this._Select(t),this.DOMResults.setAttribute("class","autocomplete"))}},Operator:i.AND,Event:s.KEYDOWN},KeyUpAndDown_down:{Conditions:[{Is:38,Not:!1},{Is:40,Not:!1}],Callback:function(e){e.preventDefault()},Operator:i.OR,Event:s.KEYDOWN},KeyUpAndDown_up:{Conditions:[{Is:38,Not:!1},{Is:40,Not:!1}],Callback:function(e){e.preventDefault();var t=this.DOMResults.querySelector("li:first-child:not(.locked)"),n=this.DOMResults.querySelector("li:last-child:not(.locked)"),a=this.DOMResults.querySelector("li.active");if(a){var c=Array.prototype.indexOf.call(a.parentNode.children,a),y=c+(e.keyCode-39),v=this.DOMResults.getElementsByTagName("li").length;y<0?y=v-1:y>=v&&(y=0),a.classList.remove("active"),a.parentElement.children.item(y).classList.add("active")}else n&&e.keyCode==38?n.classList.add("active"):t&&t.classList.add("active")},Operator:i.OR,Event:s.KEYUP},AlphaNum:{Conditions:[{Is:13,Not:!0},{From:35,To:40,Not:!0}],Callback:function(){var e=this.Input.getAttribute("data-autocomplete-old-value"),t=this._Pre();t!==""&&t.length>=this._MinChars()?((!e||t!=e)&&this.DOMResults.setAttribute("class","autocomplete open"),o.prototype.cache(this,(function(n){this._Render(this._Post(n)),this._Open()}).bind(this),this._Error)):this._Close()},Operator:i.AND,Event:s.KEYUP}},DOMResults:null,Request:null,Input:null,_EmptyMessage:function(){var e="";return this.Input.hasAttribute("data-autocomplete-empty-message")?e=this.Input.getAttribute("data-autocomplete-empty-message"):this.EmptyMessage!==!1?e=this.EmptyMessage:e="",e},_Limit:function(){var e=this.Input.getAttribute("data-autocomplete-limit");return isNaN(e)||e===null?this.Limit:parseInt(e,10)},_MinChars:function(){var e=this.Input.getAttribute("data-autocomplete-minchars");return isNaN(e)||e===null?this.MinChars:parseInt(e,10)},_Highlight:function(e){return e.replace(this.Highlight.getRegex(this._Pre()),this.Highlight.transform)},_HttpMethod:function(){return this.Input.hasAttribute("data-autocomplete-method")?this.Input.getAttribute("data-autocomplete-method"):this.HttpMethod},_QueryArg:function(){return this.Input.hasAttribute("data-autocomplete-param-name")?this.Input.getAttribute("data-autocomplete-param-name"):this.QueryArg},_Url:function(){return this.Input.hasAttribute("data-autocomplete")?this.Input.getAttribute("data-autocomplete"):this.Url},_Blur:function(e){if(e===void 0&&(e=!1),e)this._Close();else{var t=this;setTimeout(function(){t._Blur(!0)},150)}},_Cache:function(e){return this.$Cache[e]},_Focus:function(){var e=this.Input.getAttribute("data-autocomplete-old-value");(!e||this.Input.value!=e)&&this._MinChars()<=this.Input.value.length&&this.DOMResults.setAttribute("class","autocomplete open")},_Open:function(){var e=this;Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"),function(t){t.getAttribute("class")!="locked"&&(t.onclick=function(){e._Select(t)})})},_Close:function(){this.DOMResults.setAttribute("class","autocomplete")},_Position:function(){this.DOMResults.setAttribute("class","autocomplete"),this.DOMResults.setAttribute("style","top:"+(this.Input.offsetTop+this.Input.offsetHeight)+"px;left:"+this.Input.offsetLeft+"px;width:"+this.Input.clientWidth+"px;")},_Render:function(e){var t;typeof e=="string"?t=this._RenderRaw(e):t=this._RenderResponseItems(e),this.DOMResults.hasChildNodes()&&this.DOMResults.removeChild(this.DOMResults.childNodes[0]),this.DOMResults.appendChild(t)},_RenderResponseItems:function(e){var t=document.createElement("ul"),n=document.createElement("li"),a=this._Limit();a<0?e=e.reverse():a===0&&(a=e.length);for(var c=0;c0)this.DOMResults.innerHTML=e;else{var a=this._EmptyMessage();a!==""&&(n.innerHTML=a,n.setAttribute("class","locked"),t.appendChild(n))}return t},_Post:function(e){try{var t=[],n=JSON.parse(e);if(Object.keys(n).length===0)return"";if(Array.isArray(n))for(var a=0;a0){var o=document.getElementById("search");setTimeout(o.submit.bind(o),0)}}function l(o){var e=document.getElementById("clear_search"),t=function(){o.value.length===0?e.classList.add("empty"):e.classList.remove("empty")};t(),e.addEventListener("click",function(n){o.value="",o.focus(),t(),n.preventDefault()}),o.addEventListener("input",t,!1)}u.ready(function(){m=d.getElementById(h),m!==null&&(l(m),u.settings.autocomplete&&(u.autocomplete=A.call(p,{Url:"./autocompleter",EmptyMessage:u.settings.translations.no_item_found,HttpMethod:u.settings.method,HttpHeaders:{"Content-type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},MinChars:u.settings.autocomplete_min,Delay:300,_Position:function(){},_Open:function(){var t=this;Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"),function(n){n.getAttribute("class")!="locked"&&(n.onmousedown=function(){t._Select(n)})})},_Select:function(t){A.defaults._Select.call(this,t);var n=t.closest("form");n&&n.submit()},_MinChars:function(){return this.Input.value.indexOf("!")>-1?0:A.defaults._MinChars.call(this)},KeyboardMappings:Object.assign({},A.defaults.KeyboardMappings,{KeyUpAndDown_up:Object.assign({},A.defaults.KeyboardMappings.KeyUpAndDown_up,{Callback:function(t){A.defaults.KeyboardMappings.KeyUpAndDown_up.Callback.call(this,t);var n=this.DOMResults.querySelector("li.active");n&&A.defaults._Select.call(this,n)}}),Tab:Object.assign({},A.defaults.KeyboardMappings.Enter,{Conditions:[{Is:9,Not:!1}],Callback:function(t){if(this.DOMResults.getAttribute("class").indexOf("open")!=-1){var n=this.DOMResults.querySelector("li.active");n!==null&&(A.defaults._Select.call(this,n),t.preventDefault())}}})})},"#"+h)),A.prototype.ajax=function(t,n,a){a===void 0&&(a=!0),t.$AjaxTimer&&window.clearTimeout(t.$AjaxTimer),a===!0?t.$AjaxTimer=window.setTimeout(A.prototype.ajax.bind(null,t,n,!1),t.Delay):(t.Request&&t.Request.abort(),t.Request=n,t.Request.send(encodeURIComponent(t._QueryArg())+"="+encodeURIComponent(t._Pre())))},!i&&document.querySelector(".index_endpoint")&&m.focus()),m!==null&&u.settings.search_on_category_select&&d.querySelector(".search_filters")!=null&&(u.on(d.getElementById("safesearch"),"change",s),u.on(d.getElementById("time_range"),"change",s),u.on(d.getElementById("language"),"change",s));const o=d.querySelectorAll("button.category_button");for(let t of o)u.on(t,"click",n=>{if(n.shiftKey){n.preventDefault(),t.classList.toggle("selected");return}const a=d.querySelectorAll("button.category_button.selected");for(let c of a)c.classList.remove("selected");t.classList.add("selected")});const e=d.querySelector("#search");e!=null&&u.on(e,"submit",t=>{t.preventDefault();const n=d.querySelector("#selected-categories");if(n){let a=[];for(let c of o)c.classList.contains("selected")&&a.push(c.name.replace("category_",""));n.value=a.join(",")}e.submit()})})})(window,document,window.searxng); //# sourceMappingURL=searxng.min.js.map