!function(q,F,k){"use strict";functionD(e){return"function"==typeofe&&"number"!=typeofe.nodeType}F=void0!==F&&F.Math===Math?F:globalThis,q.fn.search=function(R){varS,x=q(this),C=Date.now(),w=[],T=R,A="string"==typeofT,j=[].slice.call(arguments,1);returnx.each(function(){vard=q.isPlainObject(R)?q.extend(!0,{},q.fn.search.settings,R):q.extend({},q.fn.search.settings),f=d.className,c=d.metadata,n=d.regExp,i=d.fields,g=d.selector,h=d.error,e=d.namespace,r="."+e,t=e+"-module",v=q(this),p=v.find(g.prompt),s=v.find(g.searchButton),a=v.find(g.results),o=v.find(g.result),u=(v.find(g.category),this),l=v.data(t),m=!1,y=!1,b={initialize:function(){b.verbose("Initializing module"),b.get.settings(),b.determine.searchFields(),b.bind.events(),b.set.type(),b.create.results(),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),l=b,v.data(t,b)},destroy:function(){b.verbose("Destroying instance"),v.off(r).removeData(t)},refresh:function(){b.debug("Refreshing selector cache"),p=v.find(g.prompt),s=v.find(g.searchButton),v.find(g.category),a=v.find(g.results),o=v.find(g.result)},refreshResults:function(){a=v.find(g.results),o=v.find(g.result)},bind:{events:function(){b.verbose("Binding events to search"),d.automatic&&(v.on(b.get.inputEvent()+r,g.prompt,b.event.input),p.attr("autocomplete",b.is.chrome()?"fomantic-search":"off")),v.on("focus"+r,g.prompt,b.event.focus).on("blur"+r,g.prompt,b.event.blur).on("keydown"+r,g.prompt,b.handleKeyboard).on("click"+r,g.searchButton,b.query).on("mousedown"+r,g.results,b.event.result.mousedown).on("mouseup"+r,g.results,b.event.result.mouseup).on("click"+r,g.result,b.event.result.click)}},determine:{searchFields:function(){R&&void0!==R.searchFields&&(d.searchFields=R.searchFields)}},event:{input:function(){d.searchDelay?(clearTimeout(b.timer),b.timer=setTimeout(function(){b.is.focused()&&b.query()},d.searchDelay)):b.query()},focus:function(){b.set.focus(),d.searchOnFocus&&b.has.minimumCharacters()&&b.query(function(){b.can.show()&&b.showResults()})},blur:function(e){functiont(){b.cancel.query(),b.remove.focus(),b.timer=setTimeout(function(){b.hideResults()},d.hideDelay)}vars=k.activeElement===this;s||(y=!1,b.resultsClicked?(b.debug("Determining if user action caused search to close"),v.one("click.close"+r,g.results,function(e){b.is.inMessage(e)||m?p.trigger("focus"):(m=!1,b.is.animating()||b.is.hidden()||t())})):(b.debug("Input blurred without user action, closing results"),t()))},result:{mousedown:function(){b.resultsClicked=!0},mouseup:function(){b.resultsClicked=!1},click:function(e){b.debug("Search result selected");vart=q(this),s=t.find(g.title).eq(0),n=t.is("a[href]")?t:t.find("a[href]").eq(0),r=n.attr("href")||!1,i=n.attr("target")||!1,s=0<s.length&&s.text(),a=b.get.results(),t=t.data(c.result)||b.get.result(s,a),o=b.get.value();if(D(d.onSelect)&&!1===d.onSelect.call(u,t,a))returnb.debug("Custom onSelect callback cancelled default select action"),void(m=!0);b.hideResults(),s&&b.get.value()===o&&b.set.value(s),r&&(e.preventDefault(),b.verbose("Opening search link found in result",n),"_blank"===i||e.ctrlKey?F.open(r):F.location.href=r)}}},ensureVisible:function(e){vart,s,n;0!==e.length&&(e=(t=e.position().top)+e.outerHeight(!0),s=a.scrollTop(),n=a.height(),t<0?a.scrollTop(s+t):n<e&&a.scrollTop(s+(e-n)))},handleKeyboard:function(e){vart,s=v.find(g.result),n=v.find(g.category),r=s.filter("."+f.active),i=s.index(r),a=s.length,r=0<r.length,o=e.which,c=13,u=38,l=40;if(o===27&&(b.is.visible()?b.hideResults():(b.verbose("Escape key pressed, blurring search field"),p.trigger("blur")),e.stopPropagation(),y=!0),b.is.visible())if(o===c){if(b.verbose("Enter key pressed, selecting active result"),0<s.filter("."+f.active).length)returnb.event.result.click.call(s.filter("."+f.active),e),e.preventDefault(),!1}elseo===u&&r?(b.verbose("Up key pressed, changing active result"),t=i-1<0?i:i-1,n.removeClass(f.active),s.removeClass(f.active).eq(t).addClass(f.active).closest(n).addClass(f.active),b.ensureVisible(s.eq(t)),e.preventDefault()):o===l&&(b.verbose("Downkeypressed,cha