{"version":3,"file":"cardcategories.min.js","sources":["cardcategories.js"],"sourcesContent":["$(document).ready(function ()\n{\n var app = new Vue(\n {\n el: \"#body-container\",\n data:\n {\n search: \"\",\n categories: model.categories,\n searchResults: []\n },\n created: function()\n {\n if (this.categories && this.categories.length && this.categories.length > 0)\n {\n for (var i = 0; i < this.categories.length; i++)\n {\n this.searchResults.push(this.categories[i]);\n }\n }\n },\n mounted: function()\n {\n clearLoading();\n },\n computed:\n {\n hasCategories: function ()\n {\n return this.categories && this.categories.length && this.categories.length > 0;\n },\n\n hasResults: function ()\n {\n return this.searchResults.length > 0;\n },\n },\n methods:\n {\n filterList: debounce(function()\n {\n var searchFor = \"\";\n var filtered = null;\n \n if (this.search && this.search !== \"\")\n {\n searchFor = this.search.toLowerCase();\n\n filtered = this.categories.filter(function(item)\n {\n return item.name.toLowerCase().indexOf(searchFor) !== -1;\n });\n\n this.searchResults.splice(0, this.searchResults.length);\n\n if (filtered.length > 0)\n {\n for (var i = 0; i < filtered.length; i++)\n {\n this.searchResults.push(filtered[i]);\n }\n }\n }\n else\n {\n this.showAll();\n } \n }, 250),\n\n showAll: function()\n {\n this.searchResults.splice(0, this.searchResults.length);\n\n for (var i = 0; i < this.categories.length; i++)\n {\n this.searchResults.push(this.categories[i]);\n } \n }\n }\n });\n});\n"],"names":["$","document","ready","Vue","el","data","search","categories","model","searchResults","created","this","length","i","push","mounted","clearLoading","computed","hasCategories","hasResults","methods","filterList","debounce","searchFor","filtered","toLowerCase","filter","item","name","indexOf","splice","showAll"],"mappings":"AAAAA,EAAEC,UAAUC,MAAM,WAEN,IAAIC,IACZ,CACEC,GAAI,kBACJC,KACA,CACEC,OAAQ,GACRC,WAAYC,MAAMD,WAClBE,cAAe,IAEjBC,QAAS,WAEP,GAAIC,KAAKJ,YAAcI,KAAKJ,WAAWK,QAAmC,EAAzBD,KAAKJ,WAAWK,OAE/D,IAAK,IAAIC,EAAI,EAAGA,EAAIF,KAAKJ,WAAWK,OAAQC,IAE1CF,KAAKF,cAAcK,KAAKH,KAAKJ,WAAWM,KAI9CE,QAAS,WAEPC,gBAEFC,SACA,CACEC,cAAe,WAEb,OAAOP,KAAKJ,YAAcI,KAAKJ,WAAWK,QAAmC,EAAzBD,KAAKJ,WAAWK,QAGtEO,WAAY,WAEV,OAAmC,EAA5BR,KAAKF,cAAcG,SAG9BQ,QACA,CACEC,WAAYC,SAAS,WAEnB,IAAIC,EACAC,EAEJ,GAAIb,KAAKL,QAA0B,KAAhBK,KAAKL,QAWtB,GATAiB,EAAYZ,KAAKL,OAAOmB,cAExBD,EAAWb,KAAKJ,WAAWmB,OAAO,SAASC,GAErC,OAAuD,IAAhDA,EAAKC,KAAKH,cAAcI,QAAQN,KAG7CZ,KAAKF,cAAcqB,OAAO,EAAGnB,KAAKF,cAAcG,QAE1B,EAAlBY,EAASZ,OAEX,IAAK,IAAIC,EAAI,EAAGA,EAAIW,EAASZ,OAAQC,IAEnCF,KAAKF,cAAcK,KAAKU,EAASX,SAMrCF,KAAKoB,WAEN,KAEHA,QAAS,WAEPpB,KAAKF,cAAcqB,OAAO,EAAGnB,KAAKF,cAAcG,QAEhD,IAAK,IAAIC,EAAI,EAAGA,EAAIF,KAAKJ,WAAWK,OAAQC,IAE1CF,KAAKF,cAAcK,KAAKH,KAAKJ,WAAWM"}