text: ﻿(function(){var n,t=this;n=function(){function n(){var n=this;this.auctions=ko.observableArray([]),this.categories=ko.observableArray([]),this.errorMessage=ko.observable(""),this.selectedCategory=ko.observable(),this.searchQuery=ko.observable(""),this.currentPage=ko.observable(0),this.pageSize=ko.observable(5),this.hasError=ko.computed(function(){return n.errorMessage().length>0}),this.hasSearchQuery=ko.computed(function(){return n.searchQuery()}),this.hasResults=ko.computed(function(){return n.auctions().length>0}),this.resultsCount=ko.computed(function(){return n.auctions().length}),this.load=function(t){return n.auctions(t.Auctions||[]),n.searchQuery(t.SearchQuery||"")},this.search=function(){return $.ajax("/search",{type:"POST",data:{query:n.searchQuery(),page:n.currentPage,size:n.pageSize},error:function(){return n.errorMessage("Error retrieving results")},success:function(t){return n.load(t)}})}}return n}(),window.SearchViewModel=n,$(function(){return $("#search .search-query").data("source",function(n,t){var i;return i=$("#search [name=category]").val(),$.getJSON("/autocomplete",{query:n,category:i},t)})})}).call(this)