text: (function(t){function e(e){for(var r,o,s=e[0],c=e[1],l=e[2],p=0,d=[];p<s.length;p++)o=s[p],Object.prototype.hasOwnProperty.call(n,o)&&n[o]&&d.push(n[o][0]),n[o]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(t[r]=c[r]);u&&u(e);while(d.length)d.shift()();return a.push.apply(a,l||[]),i()}function i(){for(var t,e=0;e<a.length;e++){for(var i=a[e],r=!0,s=1;s<i.length;s++){var c=i[s];0!==n[c]&&(r=!1)}r&&(a.splice(e--,1),t=o(o.s=i[0]))}return t}var r={},n={app:0},a=[];function o(e){if(r[e])return r[e].exports;var i=r[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=t,o.c=r,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(i,r,function(e){return t[e]}.bind(null,r));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/antiboredom/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],c=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var u=c;a.push([0,"chunk-vendors"]),i()})({0:function(t,e,i){t.exports=i("56d7")},"034f":function(t,e,i){"use strict";i("85ec")},"14ee":function(t,e,i){},2224:function(t,e,i){t.exports=i.p+"img/logo-dark.274c44d4.svg"},"2dae":function(t,e,i){"use strict";i("14ee")},"4df8":function(t,e,i){},"502f":function(t,e,i){"use strict";i("4df8")},"56d7":function(t,e,i){"use strict";i.r(e);i("e260"),i("e6cf"),i("cca6"),i("a79d");var r=i("2b0e"),n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"p-5",staticStyle:{"min-height":"100vh"},attrs:{id:"app"}},[t._m(0),t.items.length?t._e():i("div",{attrs:{id:"welcome"}},[i("Hello",{on:{signalParentForClicked:t.onHelloClicked}})],1),t.items.length?i("div",{staticClass:"mb-5",attrs:{id:"mainPage"}},[i("b-container",[i("b-row",[i("b-col",{staticClass:"mb-3",attrs:{sm:"2"}},[i("Sidebar",{on:{filterTypeChanged:t.onFilterTypeChanged,sortByPriceChanged:t.onSortByPriceChanged}})],1),i("b-col",{attrs:{lg:""}},[i("DataView",{attrs:{items:t.items,filter_by_type:t.filter_by_type,sort_by_price:t.sort_by_price}})],1)],1)],1)],1):t._e()])},a=[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"mb-5",attrs:{id:"logo"}},[r("a",{attrs:{href:"https://github.com/AmyXS/antiboredom"}},[r("img",{attrs:{id:"logoImage",alt:"Antiboredom logo",src:i("2224")}})])])}],o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"body"}},[i("b-container",[i("b-row",{attrs:{"align-v":"center"}},[i("b-col",{staticClass:"mt-5"},[i("div",{staticClass:"mb-3",attrs:{id:"text"}},[i("p",[t._v("Dear god, my mate is so bored.. ")])]),i("b-button",{attrs:{id:"helloBtn"},on:{click:t.signalParentForClicked}},[t._v("WHAT CAN HE DO?")])],1)],1)],1)],1)},s=[],c={name:"Hello",methods:{signalParentForClicked:function(){this.$emit("signalParentForClicked")}}},l=c,u=(i("e1be"),i("2877")),p=Object(u["a"])(l,o,s,!1,null,null,null),d=p.exports,f=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"dataview"}},[i("b-container",[i("b-row",{attrs:{"align-h":"center"}},t._l(t.filteredItems,(function(e){return i("span",{key:e.activity,staticClass:"mb-3"},[i("b-card",{staticClass:"mr-3",staticStyle:{"max-width":"16rem","text-align":"left"},attrs:{"border-variant":"dark",title:e.activity,"img-src":t.getImageURL(e.id),"img-alt":"Image","img-top":""}},[i("b-card-text",[t._v(" Type: "+t._s(e.type)+" "),i("br"),t._v(" Accessibility: "+t._s(e.accessibility)+" "),i("br"),t._v(" Participants: "+t._s(e.participants)+" "),i("br"),t._v(" Price: "+t._s(e.price)+" ")])],1)],1)})),0),i("b-row",{staticClass:"mt-5",attrs:{"align-h":"center"}},[t.items.length?i("b-button",{attrs:{id:"whatElseBtn"},on:{click:t.whatElse}},[t._v("WHAT ELSE?")]):t._e()],1)],1)],1)},b=[],y=(i("4de4"),i("caad"),i("2532"),{name:"DataView",props:["items","filter_by_type","sort_by_price"],methods:{whatElse:function(){this.$parent.getWhatToDoTableData()},getImageURL:function(t){var e="https://placedog.net/500/280/?id=1"+t;return e}},computed:{filteredItems:function(){var t=this,e=this.items.filter((function(e){return!!t.filter_by_type.includes(e.type)}));return"lowToHigh"===this.sort_by_price?e.sort((function(t,e){return t.price-e.price})):"highToLow"===this.sort_by_price&&e.sort((function(t,e){return e.price-t.price})),e}}}),h=y,m=(i("502f"),Object(u["a"])(h,f,b,!1,null,null,null)),g=m.exports,_=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{attrs:{id:"sidebar"}},[i("div",{staticClass:"mb-3",attrs:{id:"filter"}},[i("b-form-group",{attrs:{"label-class":"font-weight-bold",label:"Filter by type"}},[i("b-form-checkbox-group",{attrs:{options:t.filter_by_options,"value-field":"type","text-field":"name",change:t.filterTypeChanged()},model:{value:t.filter_by_type,callback:function(e){t.filter_by_type=e},expression:"filter_by_type"}})],1)],1),i("div",{attrs:{id:"sort"}},[i("b-form-group",{attrs:{"label-class":"font-weight-bold",label:"Sort by price"}},[i("b-form-radio-group",{attrs:{id:"sort-by-price-radio-group",options:t.sort_by_price_options,name:"sort-by-price-options",change:t.sortByPriceChanged()},model:{value:t.sort_by_price,callback:function(e){t.sort_by_price=e},expression:"sort_by_price"}})],1)],1)])},v=[],w={props:["items"],data:function(){return{sort_by_price:"",sort_by_price_options:[{text:"Low to high",value:"lowToHigh"},{text:"High to low",value:"highToLow"}],filter_by_type:["education","recreational","social","diy","charity","cooking","relaxation","music","busywork"],filter_by_options:[{type:"education",name:"Education"},{type:"recreational",name:"Recreational"},{type:"social",name:"Social"},{type:"diy",name:"DIY"},{type:"charity",name:"Charity"},{type:"cooking",name:"Cooking"},{type:"relaxation",name:"Relaxation"},{type:"music",name:"Music"},{type:"busywork",name:"Busywork"}]}},methods:{filterTypeChanged:function(){this.$emit("filterTypeChanged",this.filter_by_type)},sortByPriceChanged:function(){this.$emit("sortByPriceChanged",this.sort_by_price)}}},C=w,T=(i("2dae"),Object(u["a"])(C,_,v,!1,null,null,null)),x=T.exports,k=i("bc3a"),P=i.n(k),O={name:"App",components:{Hello:d,DataView:g,Sidebar:x},data:function(){return{items:[],filter_by_type:[],sort_by_price:"",numItemsToFetch:9}},methods:{onHelloClicked:function(){this.getWhatToDoTableData()},onFilterTypeChanged:function(t){this.filter_by_type=t,console.log("Filter by type changed: "+t)},onSortByPriceChanged:function(t){this.sort_by_price=t,console.log("Sort by price changed: "+t)},itemExists:function(t){for(var e=0;e<this.items.length;e++)if(t.activity==this.items[e].activity)return!0;return!1},getWhatToDoTableData:function(){this.items=[];for(var t=0;t<this.numItemsToFetch;t++)this.getWhatToDo()},getWhatToDo:function(){var t=this;P.a.get("https://www.boredapi.com/api/activity/").then((function(e){var i={activity:e.data.activity,type:e.data.type,price:e.data.price,accessibility:e.data.accessibility,participants:e.data.participants};t.itemExists(i)?t.getWhatToDo():(i["id"]=t.items.length,t.items.push(i))})).catch((function(e){t.errors.push(e)}))}}},S=O,D=(i("034f"),Object(u["a"])(S,n,a,!1,null,null,null)),E=D.exports,j=i("5f5b"),H=i("b1e0");i("f9e3"),i("2dd8");r["default"].use(j["a"]),r["default"].use(H["a"]),r["default"].config.productionTip=!1,new r["default"]({render:function(t){return t(E)}}).$mount("#app")},"85ec":function(t,e,i){},"8d80":function(t,e,i){},e1be:function(t,e,i){"use strict";i("8d80")}});
  //# sourceMappingURL=app.f567c793.js.map