webpackJsonp([12],{WwiI:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s("4KzK"),a={data:function(){return{response:{}}},computed:{dataToFetch:function(){var t=this,e=t.$route.params.searchQuery,s=t.$route.query.type;return{results:function(){return Object(r["s"])({type:s||"album,artist,track",searchQuery:e})}}},getStageImage:function(){var t,e=this,s=e.response.results,r=s.tracks,a=s.albums,i=s.artists;return r?t=r.items[0].album.images:a?t=a.items[0].images:i&&(t=i.items[0].images),t}},methods:{getCount:function(t){var e=this,s=e.response.results[t],r=s.items.length;return r.toLocaleString()},getTotalCount:function(t){var e=this,s=e.response.results[t],r=s.total;return r.toLocaleString()}}},i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("api-request",{staticClass:"o-view__parent",attrs:{resource:t.dataToFetch},model:{value:t.response,callback:function(e){t.response=e},expression:"response"}},[t.response.results?s("ma-stage",{attrs:{image:t.getStageImage,subtitle:t.$tc("search",1),title:t.$t("resultsfor")+' "'+t.$route.params.searchQuery+'"'}}):t._e(),t.response.results?s("div",{staticClass:"o-view__content"},[t.response.results.tracks?s("ma-section",{attrs:{title:t.$tc("track",0),subtitle:t.$t("showingxresults",{count:t.getCount("tracks"),total:t.getTotalCount("tracks")})}},t._l(t.response.results.tracks.items,function(t,e){return s("ma-list",{key:t.id,attrs:{slot:"list",trackId:t.id,image:t.album.images,title:t.name,artists:t.artists,album:t.album,explicit:t.explicit,popularity:t.popularity,duration:t.duration_ms,index:e},slot:"list"})})):t._e(),t.response.results.albums?s("ma-section",{attrs:{title:t.$tc("album",0),subtitle:t.$t("showingxresults",{count:t.getCount("albums"),total:t.getTotalCount("albums")})}},t._l(t.response.results.albums.items,function(t){return s("ma-box",{key:t.id,attrs:{slot:"boxes",type:t.type,primaryid:t.id,secondaryid:t.artists[0].id,image:t.images,title:t.name,artists:t.artists},slot:"boxes"})})):t._e(),t.response.results.artists?s("ma-section",{attrs:{title:t.$tc("artist",0),subtitle:t.$t("showingxresults",{count:t.getCount("artists"),total:t.getTotalCount("artists")})}},t._l(t.response.results.artists.items,function(t){return s("ma-box",{key:t.id,attrs:{slot:"boxes",type:t.type,title:t.name,image:t.images,primaryid:t.id},slot:"boxes"})})):t._e()],1):t._e()],1)},o=[],n=s("XyMi"),u=!1,l=null,c=null,m=null,p=Object(n["a"])(a,i,o,u,l,c,m);e["default"]=p.exports}});
//# sourceMappingURL=search0.12.aceb3ef4.js.map