text: (function(e){function t(t){for(var c,o,l=t[0],i=t[1],u=t[2],d=0,b=[];d<l.length;d++)o=l[d],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&b.push(r[o][0]),r[o]=0;for(c in i)Object.prototype.hasOwnProperty.call(i,c)&&(e[c]=i[c]);s&&s(t);while(b.length)b.shift()();return a.push.apply(a,u||[]),n()}function n(){for(var e,t=0;t<a.length;t++){for(var n=a[t],c=!0,l=1;l<n.length;l++){var i=n[l];0!==r[i]&&(c=!1)}c&&(a.splice(t--,1),e=o(o.s=n[0]))}return e}var c={},r={app:0},a=[];function o(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=c,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)o.d(n,c,function(t){return e[t]}.bind(null,c));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/ResourcesAppVue/";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],i=l.push.bind(l);l.push=t,l=l.slice();for(var u=0;u<l.length;u++)t(l[u]);var s=i;a.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"0523":function(e,t,n){"use strict";n("f4ea")},"0e61":function(e,t,n){"use strict";n("cd38")},"11cf":function(e,t,n){"use strict";n("a3b5")},"27c6":function(e,t,n){},"2e15":function(e,t,n){"use strict";n("43ef")},4366:function(e,t,n){"use strict";n("9101")},"43ef":function(e,t,n){},"4bb9":function(e,t,n){"use strict";n("cd77")},"4cc5":function(e,t,n){"use strict";n("27c6")},"4f6c":function(e,t,n){"use strict";n("576c")},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var c=n("7a23");function r(e,t,n,r,a,o){var l=Object(c["n"])("the-header"),i=Object(c["n"])("main-content");return Object(c["i"])(),Object(c["e"])(c["a"],null,[Object(c["h"])(l),Object(c["h"])(i)],64)}var a=Object(c["t"])("data-v-5803b81d");Object(c["k"])("data-v-5803b81d");var o=Object(c["h"])("h1",null,"ResourcesApp with Vue",-1),l=Object(c["h"])("p",null,"the official",-1);Object(c["j"])();var i=a((function(e,t){return Object(c["i"])(),Object(c["e"])("header",null,[o,l])}));n("4f6c");const u={};u.render=i,u.__scopeId="data-v-5803b81d";var s=u;function d(e,t,n,r,a,o){var l=Object(c["n"])("main-menu");return Object(c["i"])(),Object(c["e"])(c["a"],null,[Object(c["h"])(l,{current:o.handleChangeCurrentComponent,onscreen:a.currentComponent,onSearchResource:o.handleFilterResource,handleDeleteAll:o.handleDeleteAllResources},null,8,["current","onscreen","onSearchResource","handleDeleteAll"]),Object(c["h"])("main",null,[(Object(c["i"])(),Object(c["e"])(c["b"],null,[(Object(c["i"])(),Object(c["e"])(Object(c["o"])(a.currentComponent),{onNewResource:o.handleAddNewResource},null,8,["onNewResource"]))],1024))])],64)}n("c740"),n("a434"),n("159b"),n("caad"),n("2532"),n("9911");var b=Object(c["t"])("data-v-e714b9e4"),h=b((function(e,t,n,r,a,o){var l=Object(c["n"])("single-resource");return Object(c["i"])(),Object(c["e"])("ul",null,[(Object(c["i"])(!0),Object(c["e"])(c["a"],null,Object(c["l"])(o.resourceData,(function(t){return Object(c["i"])(),Object(c["e"])(l,{key:t.id,ident:t.id,company:t.company,text:t.text,link:t.link,active:t.active,deleteItem:e.handleDeleteItem},null,8,["ident","company","text","link","active","deleteItem"])})),128))])})),j=Object(c["t"])("data-v-9dad526e");Object(c["k"])("data-v-9dad526e");var p={key:0},f={class:"info"},O={class:"link"};Object(c["j"])();var v=j((function(e,t,n,r,a,o){var l=Object(c["n"])("base-card");return n.active?(Object(c["i"])(),Object(c["e"])("li",p,[Object(c["h"])(l,null,{default:j((function(){return[Object(c["h"])("div",f,[Object(c["h"])("h2",null,Object(c["p"])(n.company),1),Object(c["h"])("p",null,Object(c["p"])(n.text),1),Object(c["h"])("button",O,[Object(c["h"])("a",{href:n.link},"View Resource",8,["href"])])]),Object(c["h"])("button",{class:"delete",onClick:t[1]||(t[1]=function(e){return o.handleDeleteItm(n.ident)})}," delete ")]})),_:1})])):Object(c["f"])("",!0)})),m={inject:["handleDeleteItm"],props:["company","text","link","ident","active"],data:function(){return{}}};n("0e61");m.render=v,m.__scopeId="data-v-9dad526e";var I=m,y={components:{SingleResource:I},inject:["resourceData"],data:function(){return{}}};n("0523");y.render=h,y.__scopeId="data-v-e714b9e4";var C=y,k=Object(c["t"])("data-v-1e1eb55d");Object(c["k"])("data-v-1e1eb55d");var g=Object(c["h"])("h3",null,[Object(c["h"])("span",null,"New"),Object(c["g"])(" Resource")],-1),w=Object(c["g"])(" Company name: "),V=Object(c["g"])(" Description: "),_=Object(c["g"])(" Link: "),D=Object(c["h"])("button",{type:"submit"},"Submit",-1);Object(c["j"])();var R=k((function(e,t,n,r,a,o){var l=Object(c["n"])("base-card"),i=Object(c["n"])("validation-message");return Object(c["i"])(),Object(c["e"])(c["a"],null,[Object(c["h"])(l,null,{default:k((function(){return[Object(c["h"])("section",null,[g,Object(c["h"])("form",{onSubmit:t[4]||(t[4]=Object(c["s"])((function(){return o.handleAddNewResource&&o.handleAddNewResource.apply(o,arguments)}),["prevent"])),action:"#"},[Object(c["h"])("label",null,[w,Object(c["r"])(Object(c["h"])("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=function(e){return a.nameInputVal=e}),placeholder:"company...",maxlength:"30"},null,512),[[c["q"],a.nameInputVal]])]),Object(c["h"])("label",null,[V,Object(c["r"])(Object(c["h"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(e){return a.descriptionInputVal=e}),placeholder:"describe it...",maxlength:"50"},null,512),[[c["q"],a.descriptionInputVal]])]),Object(c["h"])("label",null,[_,Object(c["r"])(Object(c["h"])("input",{type:"text","onUpdate:modelValue":t[3]||(t[3]=function(e){return a.linkInputVal=e}),placeholder:"link...",maxlength:"25"},null,512),[[c["q"],a.linkInputVal]])]),D],32)])]})),_:1}),(Object(c["i"])(),Object(c["e"])(c["c"],{to:"body"},[a.isSthIncorrect?(Object(c["i"])(),Object(c["e"])(i,{key:0,handleIsCorrect:o.handleIsCorrect},null,8,["handleIsCorrect"])):Object(c["f"])("",!0)]))],64)})),x=Object(c["t"])("data-v-89755af4");Object(c["k"])("data-v-89755af4");var A=Object(c["h"])("p",null,[Object(c["g"])(" All fields need to be filled properly. Company name should have at least "),Object(c["h"])("span",null,"5 chars"),Object(c["g"])(". Description at least "),Object(c["h"])("span",null,"15 chars"),Object(c["g"])(". The link should start with "),Object(c["h"])("span",null,"https://www.")],-1);Object(c["j"])();var S=x((function(e,t,n,r,a,o){var l=Object(c["n"])("modal-backdrop");return Object(c["i"])(),Object(c["e"])(l,null,{default:x((function(){return[Object(c["h"])("article",null,[A,Object(c["h"])("button",{onClick:t[1]||(t[1]=Object(c["s"])((function(){return o.handleCloseMessage&&o.handleCloseMessage.apply(o,arguments)}),["left"]))},"OK")])]})),_:1})})),M={props:["handleIsCorrect"],methods:{handleCloseMessage:function(){this.handleIsCorrect()}}};n("c253");M.render=S,M.__scopeId="data-v-89755af4";var N=M,T={components:{ValidationMessage:N},emits:["new-resource"],data:function(){return{nameInputVal:"",descriptionInputVal:"",linkInputVal:"",nameIsCorrect:!1,descriptionIsCorrect:!1,linkIsCorrect:!1,isSthIncorrect:!1}},methods:{handleAddNewResource:function(){if(this.nameInputVal.length>=5&&(this.nameIsCorrect=!0),this.descriptionInputVal.length>15&&(this.descriptionIsCorrect=!0),/^https:\/\/www./.test(this.linkInputVal)&&(this.linkIsCorrect=!0),console.log(this.nameIsCorrect,this.descriptionIsCorrect,this.linkIsCorrect),this.nameIsCorrect&&this.descriptionIsCorrect&&this.linkIsCorrect){var e={id:Math.floor(1e3*Math.random()),company:this.nameInputVal,text:this.descriptionInputVal,link:this.linkInputVal,active:!0};this.$emit("new-resource",e),this.nameInputVal="",this.descriptionInputVal="",this.linkInputVal=""}else this.isSthIncorrect=!0},handleIsCorrect:function(){this.isSthIncorrect=!1}}};n("4bb9");T.render=R,T.__scopeId="data-v-1e1eb55d";var P=T,$=(n("b0c0"),Object(c["t"])("data-v-4c3c462e"));Object(c["k"])("data-v-4c3c462e");var q={class:"buttons"},F=Object(c["h"])("i",{class:"fas fa-trash"},null,-1);Object(c["j"])();var L=$((function(e,t,n,r,a,o){var l=Object(c["n"])("base-card"),i=Object(c["n"])("remove-confirmation");return Object(c["i"])(),Object(c["e"])(c["a"],null,[Object(c["h"])("nav",null,[Object(c["h"])(l,null,{default:$((function(){return[Object(c["h"])("div",q,[(Object(c["i"])(!0),Object(c["e"])(c["a"],null,Object(c["l"])(a.menuCategories,(function(e){return Object(c["i"])(),Object(c["e"])("button",{key:e,onClick:Object(c["s"])((function(t){return n.current(e.handler)}),["left"]),class:o.handleSetActiveClass(e.handler)},Object(c["p"])(e.name),11,["onClick"])})),128)),Object(c["h"])("button",{onClick:t[1]||(t[1]=Object(c["s"])((function(e){return o.handleToggleModalVisibility(!0)}),["left"])),class:"trash"},[F])]),Object(c["h"])("input",{onInput:t[2]||(t[2]=function(){return o.handleSearchResource&&o.handleSearchResource.apply(o,arguments)}),type:"text",maxlength:"30",placeholder:"search..."},null,32)]})),_:1})]),(Object(c["i"])(),Object(c["e"])(c["c"],{to:"body"},[a.showModal?(Object(c["i"])(),Object(c["e"])(i,{key:0,deleteAll:n.handleDeleteAll,handleVisibility:o.handleToggleModalVisibility},null,8,["deleteAll","handleVisibility"])):Object(c["f"])("",!0)]))],64)})),U=Object(c["t"])("data-v-621e9a11");Object(c["k"])("data-v-621e9a11");var G=Object(c["h"])("p",null,"Are you sure you wanna delete all items?",-1);Object(c["j"])();var J=U((function(e,t,n,r,a,o){var l=Object(c["n"])("modal-backdrop");return Object(c["i"])(),Object(c["e"])(l,null,{default:U((function(){return[Object(c["h"])("article",null,[G,Object(c["h"])("div",null,[Object(c["h"])("button",{onClick:t[1]||(t[1]=Object(c["s"])((function(){return o.handleConfirmation&&o.handleConfirmation.apply(o,arguments)}),["left"]))},"Yes"),Object(c["h"])("button",{onClick:t[2]||(t[2]=Object(c["s"])((function(e){return n.handleVisibility(!1)}),["left"]))},"No")])])]})),_:1})})),Y={props:["deleteAll","handleVisibility"],methods:{handleConfirmation:function(){this.deleteAll(),this.handleVisibility(!1)}}};n("2e15");Y.render=J,Y.__scopeId="data-v-621e9a11";var E=Y,H={components:{RemoveConfirmation:E},props:["current","onscreen","handleFilter","handleDeleteAll"],data:function(){return{menuCategories:[{name:"stored resources",handler:"stored-resources"},{name:"add resource",handler:"add-resources"}],inputVal:"",showModal:!1}},methods:{handleSetActiveClass:function(e){return this.onscreen===e?"active":null},handleSearchResource:function(e){this.$emit("search-resource",e.target.value)},handleToggleModalVisibility:function(e){this.showModal=e}}};n("4366");H.render=L,H.__scopeId="data-v-4c3c462e";var K=H,z={components:{AddResources:P,StoredResources:C,MainMenu:K},provide:function(){return{resourceData:this.resourcesData,handleDeleteItm:this.handleDeleteItem}},data:function(){return{currentComponent:"stored-resources",resourcesData:[{id:1,company:"Google",text:"You need to know how to google",link:"https://www.onet.pl",active:!0},{id:2,company:"Official Guide",text:"The official Vue.js documentation",link:"https://www.onet.pl",active:!0}]}},methods:{handleChangeCurrentComponent:function(e){this.currentComponent=e},handleDeleteItem:function(e){var t=this.resourcesData.findIndex((function(t){return t.id===e}));this.resourcesData.splice(t,1)},handleAddNewResource:function(e){this.resourcesData.push(e)},handleFilterResource:function(e){this.resourcesData.forEach((function(t){t.company.toLowerCase().includes(e.toLowerCase())?t.active=!0:t.active=!1}))},handleDeleteAllResources:function(){this.resourcesData.length=0}}};z.render=d;var B=z,Q={components:{TheHeader:s,MainContent:B},data:function(){return{}}};n("a833");Q.render=r;var W=Q,X=Object(c["t"])("data-v-6f2bb7b8");Object(c["k"])("data-v-6f2bb7b8");var Z={class:"card"};Object(c["j"])();var ee=X((function(e,t){return Object(c["i"])(),Object(c["e"])("section",Z,[Object(c["m"])(e.$slots,"default",{},void 0,!0)])}));n("4cc5");const te={};te.render=ee,te.__scopeId="data-v-6f2bb7b8";var ne=te,ce=Object(c["t"])("data-v-0df29097");Object(c["k"])("data-v-0df29097");var re={class:"modal"};Object(c["j"])();var ae=ce((function(e,t){return Object(c["i"])(),Object(c["e"])("div",re,[Object(c["m"])(e.$slots,"default",{},void 0,!0)])}));n("11cf");const oe={};oe.render=ae,oe.__scopeId="data-v-0df29097";var le=oe,ie=Object(c["d"])(W);ie.component("base-card",ne),ie.component("modal-backdrop",le),ie.mount("#app")},"576c":function(e,t,n){},9101:function(e,t,n){},a3b5:function(e,t,n){},a833:function(e,t,n){"use strict";n("f3b0")},c253:function(e,t,n){"use strict";n("eddb")},cd38:function(e,t,n){},cd77:function(e,t,n){},eddb:function(e,t,n){},f3b0:function(e,t,n){},f4ea:function(e,t,n){}});
  //# sourceMappingURL=app.fd3bd7b7.js.map