(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{100:function(e,t){},204:function(e,t,a){"use strict";(function(e){a.d(t,"a",function(){return N});var n=a(35),r=a(140),s=a(10),i=a.n(s),o=a(21),c=a(13),l=a(14),u=a(16),h=a(15),m=a(17),d=a(0),p=a.n(d),f=a(56),g=a(311),b=a(312),v=a(53),E=(a(728),a(18)),y=a(52),k=a(173),S=a(205),C=a(208),L=a(271),O=(a(218),a(220),a(209)),j=a(272),w=Object(k.WidthProvider)(k.Responsive),x=function(t){var a={};if(e.localStorage)try{a=JSON.parse(e.localStorage.getItem("rgl-8"))||{}}catch(n){}return a[t]}("layouts")||{},N=function(t){function a(e){var t;return Object(c.a)(this,a),(t=Object(u.a)(this,Object(h.a)(a).call(this,e))).state={isLoading:!0,notes:[],notesSection:[],dashboardMap:[],layouts:JSON.parse(JSON.stringify(x))},t}return Object(m.a)(a,t),Object(l.a)(a,[{key:"resetLayout",value:function(){this.setState({layouts:{}})}},{key:"onLayoutChange",value:function(t,a){var r,s;r="layouts",s=a,e.localStorage&&e.localStorage.setItem("rgl-8",JSON.stringify(Object(n.a)({},r,s))),this.setState({layouts:a})}},{key:"componentDidMount",value:function(){var e=Object(o.a)(i.a.mark(function e(){var t,a,n;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.props.isAuthenticated){e.next=3;break}return e.abrupt("return");case 3:return e.prev=3,e.next=6,this.notes();case 6:return t=e.sent,this.setState({notes:t}),e.t0=this,e.next=11,t;case 11:e.t1=e.sent,a=e.t0.formatLayoutCategories.call(e.t0,e.t1).splice(0),console.log("Home->componentDidMount()->notesSection",a),console.table([a]),this.setState({notesSection:a}),e.next=21;break;case 18:e.prev=18,e.t2=e.catch(3),console.error("Home->notes()->",e.t2);case 21:return e.prev=21,e.next=24,this.dashboardMap();case 24:n=e.sent,this.setState({dashboardMap:n}),console.warn("Home->dashboardMap->",n),e.next=32;break;case 29:e.prev=29,e.t3=e.catch(21),console.info("Home->dashboardMap()->",e.t3);case 32:this.setState({isLoading:!1});case 33:case"end":return e.stop()}},e,this,[[3,18],[21,29]])}));return function(){return e.apply(this,arguments)}}()},{key:"notes",value:function(){return E.a.get("brainstorm","/notes")}},{key:"dashboardMap",value:function(){return E.a.get("brainstorm","/dashboardMap")}},{key:"renderNotesList",value:function(e,t){var a=e.filter(function(e){return e.category===t}),n=a.length;return[{}].concat(a).map(function(e,a){return 0!==a?p.a.createElement(v.LinkContainer,{key:e.noteId,to:"/notes/".concat(e.noteId)},p.a.createElement(f.a,{header:e.content.trim().split("\n")[0]},"Created: ".concat(new Date(e.createdAt).toLocaleString()),"Status:".concat(e.active))):p.a.createElement(f.a,{key:"".concat(a,"categoryheader")},p.a.createElement("h4",null,"Category : ".concat(t)," ",p.a.createElement(g.a,null,n)))})}},{key:"renderLander",value:function(){return p.a.createElement("div",null,p.a.createElement("div",{className:"lander"},p.a.createElement("h1",null,"Brainstorms lab"),p.a.createElement("p",null,"Your ideas in different ways"),p.a.createElement("div",null,p.a.createElement(y.a,{to:"/login",className:"btn btn-info btn-lg"},"Login"),p.a.createElement(y.a,{to:"/signup",className:"btn btn-success btn-lg"},"Signup"))))}},{key:"formatLayoutCategories",value:function(e){var t=Object(r.a)(new Set(e.map(function(e){return e.category})));console.info("formatLayoutCategories->categories->",t);var a={i:"test",x:0,y:0,w:12,h:4};return[{}].concat(t).map(function(t){var n=e.filter(function(e){return e.category===t}).length;return a.i=t,a.y=2*n+2+2,a.h=2*n+2,"string"!==typeof a.i&&(a.i="Add"),JSON.parse(JSON.stringify(a))})}},{key:"renderGroups",value:function(e){var t=this,a=Object(r.a)(new Set(e.map(function(e){return e.category})));return[{}].concat(a).map(function(a,n){return 0!==n?p.a.createElement("div",{key:a,className:"GridComponentContainer"},p.a.createElement(b.a,{key:n},!t.state.isLoading&&t.renderNotesList(e,a))):p.a.createElement("div",{key:n,className:"GridComponentContainer"},p.a.createElement("br",null))})}},{key:"renderNotes",value:function(){return p.a.createElement("div",null,!this.state.isLoading&&this.renderGroups(this.state.notes))}},{key:"renderAddNotes",value:function(){return p.a.createElement("div",{className:"notes GridComponentContainer",key:"AddNotes"},p.a.createElement(v.LinkContainer,{key:"new",to:"/notes/new"},p.a.createElement(f.a,null,p.a.createElement("h4",null,p.a.createElement("b",null,"\uff0b")," ","Create a new note"))))}},{key:"renderAddNotes2",value:function(){return p.a.createElement("div",{className:"notes GridComponentContainer",key:"AddNotes"},p.a.createElement(v.LinkContainer,{key:"new",to:"/notes/new"},p.a.createElement(f.a,null,p.a.createElement("h4",null,p.a.createElement("b",null,"\uff0b")," ","Create a new note"))))}},{key:"renderWorkspace",value:function(){var e=this,t=[this.dashboardMap()].concat(Object(r.a)(this.state.notesSection));return console.info("states.notes->",this.state.notesSection),console.info("layout notes->",t),p.a.createElement("div",{className:"Workspace"},p.a.createElement("button",{onClick:function(){return e.resetLayout()}},"Reset Layout"),p.a.createElement(w,{className:"layout",layouts:this.state.layouts,onLayoutChange:function(t,a){return e.onLayoutChange(t,a)},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},rowHeight:60,width:window.innerWidth-75},p.a.createElement("div",{className:"GridComponentContainer",key:"CubeLoader"},p.a.createElement(C.a,{text:"hola"})),p.a.createElement("div",{className:"GridComponentContainer",key:"CalendarHeatmap"},p.a.createElement(S.a,null)),p.a.createElement("div",{className:"GridComponentContainer",key:"TomatoTimer"},p.a.createElement(L.a,{defaultBreakLength:"5",defaultSessionLength:"25"})),p.a.createElement("div",{className:"GridComponentContainer",key:"DayPhrases"},p.a.createElement(O.a,null)),p.a.createElement("div",{className:"GridComponentContainer",key:"Watch"},p.a.createElement("p",null,"Salvar sus ultimas posiciones y tamanios eso sera dificil. tal vez se podria agregar el componente de reloj"),p.a.createElement(j.a,null)),this.renderAddNotes(),!this.state.isLoading&&this.renderGroups(this.state.notes)))}},{key:"temprender",value:function(){var e=this;return p.a.createElement("div",null,p.a.createElement("button",{onClick:function(){return e.resetLayout()}},"Reset Layout"),p.a.createElement(w,{className:"layout",cols:{lg:12,md:10,sm:6,xs:4,xxs:2},rowHeight:30,layouts:this.state.layouts,onLayoutChange:function(t,a){return e.onLayoutChange(t,a)}},p.a.createElement("div",{key:"1","data-grid":{w:2,h:3,x:0,y:0,minW:2,minH:3}},p.a.createElement("span",{className:"text"},"1")),p.a.createElement("div",{key:"2","data-grid":{w:2,h:3,x:2,y:0,minW:2,minH:3}},p.a.createElement("span",{className:"text"},"2")),p.a.createElement("div",{key:"3","data-grid":{w:2,h:3,x:4,y:0,minW:2,minH:3}},p.a.createElement("span",{className:"text"},"3")),p.a.createElement("div",{key:"4","data-grid":{w:2,h:3,x:6,y:0,minW:2,minH:3}},p.a.createElement("span",{className:"text"},"4")),p.a.createElement("div",{key:"5","data-grid":{w:2,h:3,x:8,y:0,minW:2,minH:3}},p.a.createElement("span",{className:"text"},"5"))))}},{key:"render",value:function(){return p.a.createElement("div",{className:"Home"},this.props.isAuthenticated?!this.state.isLoading&&this.renderWorkspace():this.renderLander())}}],[{key:"defaultProps",get:function(){return{className:"layout",cols:{lg:12,md:10,sm:6,xs:4,xxs:2},rowHeight:30}}}]),a}(d.Component)}).call(this,a(47))},205:function(e,t,a){"use strict";a.d(t,"a",function(){return d});var n=a(13),r=a(14),s=a(16),i=a(15),o=a(17),c=a(0),l=a.n(c),u=a(206),h=a.n(u),m=a(207),d=(a(741),a(743),function(e){function t(e){var a;return Object(n.a)(this,t),(a=Object(s.a)(this,Object(i.a)(t).call(this,e))).today=new Date,a.randomValues=a.getRange(200).map(function(e){return{date:a.shiftDate(a.today,-e),count:a.getRandomInt(1,3)}}),a}return Object(o.a)(t,e),Object(r.a)(t,[{key:"shiftDate",value:function(e,t){var a=new Date(e);return a.setDate(a.getDate()+t),a}},{key:"getRange",value:function(e){return Array.from({length:e},function(e,t){return t})}},{key:"getRandomInt",value:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},{key:"render",value:function(){return l.a.createElement("div",null,l.a.createElement(h.a,{startDate:this.shiftDate(this.today,-150),endDate:this.today,values:this.randomValues,classForValue:function(e){return e?"color-github-".concat(e.count):"color-empty"},tooltipDataAttrs:function(e){return{"data-tip":"".concat(e.date.toISOString().slice(0,10)," has count: ").concat(e.count)}},showWeekdayLabels:!0,onClick:function(e){return alert("Clicked on value with count: ".concat(e.count))}}),l.a.createElement(m.a,null))}}]),t}(c.Component))},208:function(e,t,a){"use strict";var n=a(0),r=a.n(n);a(745);t.a=function(e){var t=e.text;return r.a.createElement("div",{className:"cubecontainer"},r.a.createElement("div",{className:"cube"},r.a.createElement("div",{className:"sides"},r.a.createElement("div",{className:"top"}),r.a.createElement("div",{className:"right"}),r.a.createElement("div",{className:"bottom"}),r.a.createElement("div",{className:"left"}),r.a.createElement("div",{className:"front"}),r.a.createElement("div",{className:"back"}))),r.a.createElement("div",{className:"cubetext"},"Loading ",t))}},209:function(e,t,a){"use strict";a.d(t,"a",function(){return f});var n=a(10),r=a.n(n),s=a(21),i=a(13),o=a(14),c=a(16),l=a(15),u=a(17),h=a(0),m=a.n(h),d=a(18),p=a(320),f=(a(222),function(e){function t(e){var a;return Object(i.a)(this,t),(a=Object(c.a)(this,Object(l.a)(t).call(this,e))).state={},a}return Object(u.a)(t,e),Object(o.a)(t,[{key:"componentDidMount",value:function(){var e=Object(s.a)(r.a.mark(function e(){var t,a,n,s,i,o;return r.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getDayPhrase();case 3:t=e.sent,a=t.dayphraseid,n=t.language,s=t.phrase,i=t.topic,o=t.imageurl,this.setState({dayphrase:t,dayphraseid:a,language:n,phrase:s,topic:i,imageurl:o}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),alert(e.t0);case 11:case"end":return e.stop()}},e,this,[[0,8]])}));return function(){return e.apply(this,arguments)}}()},{key:"getDayPhrase",value:function(){return d.a.get("dayphrases","/dayphrase/random/")}},{key:"updateDayPhrase",value:function(){}},{key:"render",value:function(){return m.a.createElement(p.a,{className:"dayphrases"},this.state.dayphrase&&m.a.createElement(p.a.Body,{className:"dayPhrasesCard"},m.a.createElement("span",null,this.state.phrase),m.a.createElement("p",null,this.state.topic)))}}]),t}(h.Component))},212:function(e,t,a){},214:function(e,t,a){},216:function(e,t,a){},218:function(e,t,a){},220:function(e,t,a){},222:function(e,t,a){},262:function(e,t,a){},264:function(e,t,a){},271:function(e,t,a){"use strict";var n=a(13),r=a(14),s=a(16),i=a(15),o=a(17),c=a(26),l=a(0),u=a.n(l),h=(a(747),function(e){function t(){return Object(n.a)(this,t),Object(s.a)(this,Object(i.a)(t).apply(this,arguments))}return Object(o.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){var e=this.props.isStart?"disable":"";return u.a.createElement("div",{className:"settings"},u.a.createElement("div",{className:"settings-section"},u.a.createElement("label",{id:"break-label"},"Break Length"),u.a.createElement("div",null,u.a.createElement("button",{className:e,id:"break-decrement",onClick:this.props.onDecreaseBreak},"-"),u.a.createElement("span",{id:"break-length"},this.props.breakLength),u.a.createElement("button",{className:e,id:"break-increment",onClick:this.props.onIncreaseBreak},"+"))),u.a.createElement("div",{className:"settings-section"},u.a.createElement("label",{id:"session-label"},"Session Length"),u.a.createElement("div",null,u.a.createElement("button",{className:e,id:"session-decrement",onClick:this.props.onDecreaseSession},"-"),u.a.createElement("span",{id:"session-length"},this.props.sessionLength),u.a.createElement("button",{className:e,id:"session-increment",onClick:this.props.onIncreaseSession},"+"))))}}]),t}(l.Component)),m=(a(212),function(e){function t(){return Object(n.a)(this,t),Object(s.a)(this,Object(i.a)(t).apply(this,arguments))}return Object(o.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){return u.a.createElement("div",{className:"times"},u.a.createElement("div",{className:"times-content"},u.a.createElement("label",{id:"timer-label"},this.props.timeLabel),u.a.createElement("span",{id:"time-left"},function(e){var t=Math.floor(e/60);t<10&&(t="0"+t);var a=e-60*t;return a<10&&(a="0"+a),"".concat(t,":").concat(a)}(this.props.timeLeftInSecond))))}}]),t}(l.Component)),d=(a(214),function(e){function t(){return Object(n.a)(this,t),Object(s.a)(this,Object(i.a)(t).apply(this,arguments))}return Object(o.a)(t,e),Object(r.a)(t,[{key:"render",value:function(){return u.a.createElement("div",{className:"controller"},u.a.createElement("button",{id:"start_stop",onClick:this.props.onStartStop},this.props.isStart?"Stop":"Start"),u.a.createElement("button",{id:"reset",onClick:this.props.onReset},"Reset"))}}]),t}(l.Component));a(216);a.d(t,"a",function(){return p});var p=function(e){function t(e){var a;return Object(n.a)(this,t),(a=Object(s.a)(this,Object(i.a)(t).call(this,e))).audioBeep=u.a.createRef(),a.state={breakLength:Number.parseInt(a.props.defaultBreakLength,10),sessionLength:Number.parseInt(a.props.defaultSessionLength,10),timeLabel:"Session",timeLeftInSecond:60*Number.parseInt(a.props.defaultSessionLength,10),isStart:!1,timerInterval:null},a.onIncreaseBreak=a.onIncreaseBreak.bind(Object(c.a)(Object(c.a)(a))),a.onDecreaseBreak=a.onDecreaseBreak.bind(Object(c.a)(Object(c.a)(a))),a.onIncreaseSession=a.onIncreaseSession.bind(Object(c.a)(Object(c.a)(a))),a.onDecreaseSession=a.onDecreaseSession.bind(Object(c.a)(Object(c.a)(a))),a.onReset=a.onReset.bind(Object(c.a)(Object(c.a)(a))),a.onStartStop=a.onStartStop.bind(Object(c.a)(Object(c.a)(a))),a.decreaseTimer=a.decreaseTimer.bind(Object(c.a)(Object(c.a)(a))),a.phaseControl=a.phaseControl.bind(Object(c.a)(Object(c.a)(a))),a}return Object(o.a)(t,e),Object(r.a)(t,[{key:"onIncreaseBreak",value:function(){this.state.breakLength<60&&!this.state.isStart&&this.setState({breakLength:this.state.breakLength+1})}},{key:"onDecreaseBreak",value:function(){this.state.breakLength>1&&!this.state.isStart&&this.setState({breakLength:this.state.breakLength-1})}},{key:"onIncreaseSession",value:function(){this.state.sessionLength<60&&!this.state.isStart&&this.setState({sessionLength:this.state.sessionLength+1,timeLeftInSecond:60*(this.state.sessionLength+1)})}},{key:"onDecreaseSession",value:function(){this.state.sessionLength>1&&!this.state.isStart&&this.setState({sessionLength:this.state.sessionLength-1,timeLeftInSecond:60*(this.state.sessionLength-1)})}},{key:"onReset",value:function(){this.setState({breakLength:Number.parseInt(this.props.defaultBreakLength,10),sessionLength:Number.parseInt(this.props.defaultSessionLength,10),timeLabel:"Session",timeLeftInSecond:60*Number.parseInt(this.props.defaultSessionLength,10),isStart:!1,timerInterval:null}),this.audioBeep.current.pause(),this.audioBeep.current.currentTime=0,this.state.timerInterval&&clearInterval(this.state.timerInterval)}},{key:"onStartStop",value:function(){var e=this;this.state.isStart?(this.audioBeep.current.pause(),this.audioBeep.current.currentTime=0,this.state.timerInterval&&clearInterval(this.state.timerInterval),this.setState({isStart:!this.state.isStart,timerInterval:null})):this.setState({isStart:!this.state.isStart,timerInterval:setInterval(function(){e.decreaseTimer(),e.phaseControl()},1e3)})}},{key:"decreaseTimer",value:function(){this.setState({timeLeftInSecond:this.state.timeLeftInSecond-1})}},{key:"phaseControl",value:function(){0===this.state.timeLeftInSecond?this.audioBeep.current.play():-1===this.state.timeLeftInSecond&&("Session"===this.state.timeLabel?this.setState({timeLabel:"Break",timeLeftInSecond:60*this.state.breakLength}):this.setState({timeLabel:"Session",timeLeftInSecond:60*this.state.sessionLength}))}},{key:"render",value:function(){return u.a.createElement("div",{className:"pomodoro-clock"},u.a.createElement("div",{className:"pomodoro-clock-header"},u.a.createElement("h1",{className:"pomodoro-clock-header-name"},"pomodoro clock")),u.a.createElement(h,{breakLength:this.state.breakLength,sessionLength:this.state.sessionLength,isStart:this.state.isStart,onDecreaseBreak:this.onDecreaseBreak,onDecreaseSession:this.onDecreaseSession,onIncreaseBreak:this.onIncreaseBreak,onIncreaseSession:this.onIncreaseSession}),u.a.createElement(m,{timeLabel:this.state.timeLabel,timeLeftInSecond:this.state.timeLeftInSecond}),u.a.createElement(d,{onReset:this.onReset,onStartStop:this.onStartStop,isStart:this.state.isStart}),u.a.createElement("audio",{id:"beep",preload:"auto",src:"https://goo.gl/65cBl1",ref:this.audioBeep}))}}]),t}(l.Component)},272:function(e,t,a){"use strict";var n=a(13),r=a(14),s=a(16),i=a(15),o=a(17),c=a(0),l=a.n(c),u=function(e){return l.a.createElement("form",{onSubmit:e.changeDate},"Enter a date (YYYY-MM-DD):",l.a.createElement("input",null),l.a.createElement("input",{type:"submit"}))},h=function(e){return l.a.createElement("div",null,l.a.createElement("h3",null,e.photo.title),l.a.createElement("img",{src:e.photo.url,alt:e.photo.title}),l.a.createElement("p",null,e.photo.explanation))},m=function(e){function t(){var e,a;Object(n.a)(this,t);for(var r=arguments.length,o=new Array(r),c=0;c0&&this.state.password.length>0}},{key:"render",value:function(){return r.a.createElement("div",{className:"Login"},r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement(C.a,{controlId:"email",bsSize:"large"},r.a.createElement(F.a,null,"Email"),r.a.createElement(L.a,{autoFocus:!0,type:"email",value:this.state.email,onChange:this.handleChange})),r.a.createElement(C.a,{controlId:"password",bsSize:"large"},r.a.createElement(F.a,null,"Password"),r.a.createElement(L.a,{value:this.state.password,onChange:this.handleChange,type:"password"})),r.a.createElement(B,{block:!0,bsSize:"large",disabled:!this.validateForm(),type:"submit",isLoading:this.state.isLoading,text:"Login",loadingText:"Logging in\u2026"})),r.a.createElement("hr",null),r.a.createElement(M,{onLogin:this.handleFbLogin}))}}]),t}(n.Component),H=function(e){var t=e.component,a=e.props,n=Object(_.a)(e,["component","props"]);return r.a.createElement(D.a,Object.assign({},n,{render:function(e){return r.a.createElement(t,Object.assign({},e,a))}}))},U=a(315),z=(a(275),function(e){function t(e){var a;return Object(u.a)(this,t),(a=Object(m.a)(this,Object(d.a)(t).call(this,e))).handleChange=function(e){a.setState(Object(P.a)({},e.target.id,e.target.value))},a.handleSubmit=function(){var e=Object(l.a)(c.a.mark(function e(t){var n;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),a.setState({isLoading:!0}),e.prev=2,e.next=5,v.b.signUp({username:a.state.email,password:a.state.password});case 5:n=e.sent,a.setState({newUser:n}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),alert(e.t0.message);case 12:a.setState({isLoading:!1});case 13:case"end":return e.stop()}},e,null,[[2,9]])}));return function(t){return e.apply(this,arguments)}}(),a.handleFbLogin=function(){a.props.userHasAuthenticated(!0)},a.handleConfirmationSubmit=function(){var e=Object(l.a)(c.a.mark(function e(t){return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),a.setState({isLoading:!0}),e.prev=2,e.next=5,v.b.confirmSignUp(a.state.email,a.state.confirmationCode);case 5:return e.next=7,v.b.signIn(a.state.email,a.state.password);case 7:a.props.userHasAuthenticated(!0),a.props.history.push("/"),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(2),alert(e.t0.message),a.setState({isLoading:!1});case 15:case"end":return e.stop()}},e,null,[[2,11]])}));return function(t){return e.apply(this,arguments)}}(),a.state={isLoading:!1,email:"",password:"",confirmPassword:"",confirmationCode:"",newUser:null},a}return Object(p.a)(t,e),Object(h.a)(t,[{key:"validateForm",value:function(){return this.state.email.length>0&&this.state.password.length>0&&this.state.password===this.state.confirmPassword}},{key:"validateConfirmationForm",value:function(){return this.state.confirmationCode.length>0}},{key:"renderConfirmationForm",value:function(){return r.a.createElement("form",{onSubmit:this.handleConfirmationSubmit},r.a.createElement(C.a,{controlId:"confirmationCode",bsSize:"large"},r.a.createElement(F.a,null,"Confirmation Code"),r.a.createElement(L.a,{autoFocus:!0,type:"tel",value:this.state.confirmationCode,onChange:this.handleChange}),r.a.createElement(U.a,null,"Please check your email for the code.")),r.a.createElement(B,{block:!0,bsSize:"large",disabled:!this.validateConfirmationForm(),type:"submit",isLoading:this.state.isLoading,text:"Verify",loadingText:"Verifying\u2026"}))}},{key:"renderForm",value:function(){return r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement(C.a,{controlId:"email",bsSize:"large"},r.a.createElement(F.a,null,"Email"),r.a.createElement(L.a,{autoFocus:!0,type:"email",value:this.state.email,onChange:this.handleChange})),r.a.createElement(C.a,{controlId:"password",bsSize:"large"},r.a.createElement(F.a,null,"Password"),r.a.createElement(L.a,{value:this.state.password,onChange:this.handleChange,type:"password"})),r.a.createElement(C.a,{controlId:"confirmPassword",bsSize:"large"},r.a.createElement(F.a,null,"Confirm Password"),r.a.createElement(L.a,{value:this.state.confirmPassword,onChange:this.handleChange,type:"password"})),r.a.createElement(B,{block:!0,bsSize:"large",disabled:!this.validateForm(),type:"submit",isLoading:this.state.isLoading,text:"Signup",loadingText:"Signing up\u2026"}))}},{key:"render",value:function(){return r.a.createElement("div",{className:"Signup"},null===this.state.newUser?this.renderForm():this.renderConfirmationForm(),r.a.createElement("hr",null),r.a.createElement(M,{onLogin:this.handleFbLogin}))}}]),t}(n.Component)),K=a(316),W=a(754);a(277);function Y(e){return J.apply(this,arguments)}function J(){return(J=Object(l.a)(c.a.mark(function e(t){var a,n;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a="".concat(Date.now(),"-").concat(t.name),e.next=3,v.d.vault.put(a,t,{contentType:t.type});case 3:return n=e.sent,e.abrupt("return",n.key);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}var V=function(e){function t(e){var a;return Object(u.a)(this,t),(a=Object(m.a)(this,Object(d.a)(t).call(this,e))).handleChange=function(e){a.setState(Object(P.a)({},e.target.id,e.target.value))},a.handleFileChange=function(e){a.file=e.target.files[0]},a.handleSubmit=function(){var e=Object(l.a)(c.a.mark(function e(t){var n;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!(a.file&&a.file.size>b.MAX_ATTACHMENT_SIZE)){e.next=4;break}return alert("Please pick a file smaller than ".concat(b.MAX_ATTACHMENT_SIZE/1e6," MB.")),e.abrupt("return");case 4:if(a.setState({isLoading:!0}),e.prev=5,!a.file){e.next=12;break}return e.next=9,Y(a.file);case 9:e.t0=e.sent,e.next=13;break;case 12:e.t0=null;case 13:return n=e.t0,e.next=16,a.createNote({attachment:n,content:a.state.content,category:a.state.category,topic:a.state.topic,tags:a.state.tags,active:a.state.active,order:a.state.order,section:a.state.section,limitdate:a.state.limitDate,finishdate:a.state.finishDate,assigneddate:a.state.assignedDate});case 16:a.props.history.push("/"),e.next=23;break;case 19:e.prev=19,e.t1=e.catch(5),alert(e.t1),a.setState({isLoading:!1});case 23:case"end":return e.stop()}},e,null,[[5,19]])}));return function(t){return e.apply(this,arguments)}}(),a.file=null,a.state={isLoading:null,content:"",category:"",topic:"",tags:"",active:0,order:0,section:"list",limitDate:Date.now(),finishDate:Date.now(),assignedDate:Date.now()},a}return Object(p.a)(t,e),Object(h.a)(t,[{key:"createNote",value:function(e){return v.a.post("brainstorm","/notes",{body:e})}},{key:"validateForm",value:function(){return this.state.content.length>0}},{key:"render",value:function(){return r.a.createElement("div",{className:"NewNote"},r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement(C.a,{controlId:"category"},r.a.createElement(K.a,{componentClass:F.a,sm:2},"Category"),r.a.createElement(K.a,{sm:10},r.a.createElement(L.a,{type:"text",onChange:this.handleChange,value:this.state.category,componentClass:"input",placeholder:"Category"}))),r.a.createElement(C.a,{controlId:"topic"},r.a.createElement(K.a,{componentClass:F.a,sm:2},"Subject"),r.a.createElement(K.a,{sm:10},r.a.createElement(L.a,{type:"text",onChange:this.handleChange,value:this.state.topic,componentClass:"input",placeholder:"Subject"}))),r.a.createElement(C.a,{controlId:"active"},r.a.createElement(W.a,null,r.a.createElement(W.a.Addon,null,r.a.createElement("input",{type:"checkbox",value:this.state.active,onChange:this.handleChange})))),r.a.createElement(C.a,{bsSize:"small",controlId:"content"},r.a.createElement(L.a,{onChange:this.handleChange,value:this.state.content,componentClass:"textarea",placeholder:"Description"})),r.a.createElement(C.a,{controlId:"file"},r.a.createElement(F.a,null,"Attachment"),r.a.createElement(L.a,{onChange:this.handleFileChange,type:"file"})),r.a.createElement(B,{block:!0,bsStyle:"primary",bsSize:"large",disabled:!this.validateForm(),type:"submit",isLoading:this.state.isLoading,text:"Create",loadingText:"Creating\u2026"})))}}]),t}(n.Component),X=(a(279),function(e){function t(e){var a;return Object(u.a)(this,t),(a=Object(m.a)(this,Object(d.a)(t).call(this,e))).handleChange=function(e){a.setState(Object(P.a)({},e.target.id,e.target.value))},a.handleFileChange=function(e){a.file=e.target.files[0]},a.handleSubmit=function(){var e=Object(l.a)(c.a.mark(function e(t){var n;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!(a.file&&a.file.size>b.MAX_ATTACHMENT_SIZE)){e.next=4;break}return alert("Please pick a file smaller than ".concat(b.MAX_ATTACHMENT_SIZE/1e6," MB.")),e.abrupt("return");case 4:if(a.setState({isLoading:!0}),e.prev=5,!a.file){e.next=10;break}return e.next=9,Y(a.file);case 9:n=e.sent;case 10:return e.next=12,a.saveNote({content:a.state.content,attachment:n||a.state.note.attachment,category:a.state.category,topic:a.state.topic,keys:a.state.keys,active:a.state.active,section:a.state.section,order:a.state.order,limitdate:a.state.limitDate,finishdate:a.state.finishDate,assigneddate:a.state.assignedDate});case 12:a.props.history.push("/"),e.next=19;break;case 15:e.prev=15,e.t0=e.catch(5),alert(e.t0),a.setState({isLoading:!1});case 19:case"end":return e.stop()}},e,null,[[5,15]])}));return function(t){return e.apply(this,arguments)}}(),a.handleDelete=function(){var e=Object(l.a)(c.a.mark(function e(t){return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),window.confirm("Are you sure you want to delete this note?")){e.next=4;break}return e.abrupt("return");case 4:return a.setState({isDeleting:!0}),e.prev=5,e.next=8,a.deleteNote();case 8:a.props.history.push("/"),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(5),alert(e.t0),a.setState({isDeleting:!1});case 15:case"end":return e.stop()}},e,null,[[5,11]])}));return function(t){return e.apply(this,arguments)}}(),a.file=null,a.state={isLoading:null,isDeleting:null,note:null,content:"",attachmentURL:null,topic:"",category:"",active:!1,section:null,order:0,limitdate:null,finishdate:null,assigneddate:null},a}return Object(p.a)(t,e),Object(h.a)(t,[{key:"componentDidMount",value:function(){var e=Object(l.a)(c.a.mark(function e(){var t,a,n,r,s,i,o,l,u,h,m,d;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.getNote();case 3:if(a=e.sent,n=a.content,r=a.attachment,s=a.category,i=a.topic,o=a.active,l=a.section,u=a.order,h=a.limitdate,m=a.finishdate,d=a.assigneddate,!r){e.next=9;break}return e.next=8,v.d.vault.get(r);case 8:t=e.sent;case 9:this.setState({note:a,content:n,attachmentURL:t,category:s,topic:i,active:o,section:l,order:u,limitdate:h,finishdate:m,assigneddate:d}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),alert(e.t0);case 15:case"end":return e.stop()}},e,this,[[0,12]])}));return function(){return e.apply(this,arguments)}}()},{key:"getNote",value:function(){return v.a.get("brainstorm","/notes/".concat(this.props.match.params.id))}},{key:"validateForm",value:function(){return this.state.content.length>0}},{key:"formatFilename",value:function(e){return e.replace(/^\w+-/,"")}},{key:"saveNote",value:function(e){return v.a.put("brainstorm","/notes/".concat(this.props.match.params.id),{body:e})}},{key:"deleteNote",value:function(){return v.a.del("brainstorm","/notes/".concat(this.props.match.params.id))}},{key:"render",value:function(){return r.a.createElement("div",{className:"Notes"},this.state.note&&r.a.createElement("form",{onSubmit:this.handleSubmit},r.a.createElement(C.a,{controlId:"category"},r.a.createElement(L.a,{type:"text",onChange:this.handleChange,value:this.state.category,placeholder:"Subject",componentClass:"input"})),r.a.createElement(C.a,{controlId:"topic"},r.a.createElement(L.a,{type:"text",onChange:this.handleChange,value:this.state.topic,placeholder:"Topic",componentClass:"input"})),r.a.createElement(C.a,{controlId:"active"},r.a.createElement(L.a,{type:"text",onChange:this.handleChange,value:this.state.active,placeholder:"Active",componentClass:"input"})),r.a.createElement(C.a,{controlId:"content"},r.a.createElement(L.a,{onChange:this.handleChange,placeholder:"Description",value:this.state.content,componentClass:"textarea"})),this.state.note.attachment&&r.a.createElement(C.a,null,r.a.createElement(F.a,null,"Attachment"),r.a.createElement(L.a.Static,null,r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:this.state.attachmentURL},this.formatFilename(this.state.note.attachment)))),r.a.createElement(C.a,{controlId:"file"},!this.state.note.attachment&&r.a.createElement(F.a,null,"Attachment"),r.a.createElement(L.a,{onChange:this.handleFileChange,type:"file"})),r.a.createElement(B,{block:!0,bsStyle:"primary",bsSize:"large",disabled:!this.validateForm(),type:"submit",isLoading:this.state.isLoading,text:"Save",loadingText:"Saving\u2026"}),r.a.createElement(B,{block:!0,bsStyle:"danger",bsSize:"large",isLoading:this.state.isDeleting,onClick:this.handleDelete,text:"Delete",loadingText:"Deleting\u2026"})))}}]),t}(n.Component)),Z=a(136),q=function(e){var t=e.component,a=e.props,n=Object(_.a)(e,["component","props"]);return r.a.createElement(D.a,Object.assign({},n,{render:function(e){return a.isAuthenticated?r.a.createElement(t,Object.assign({},e,a)):r.a.createElement(Z.a,{to:"/login?redirect=".concat(e.location.pathname).concat(e.location.search)})}}))};var $=function(e){var t=e.component,a=e.props,n=Object(_.a)(e,["component","props"]),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.href;e=e.replace(/[[]]/g,"\\$&");var a=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)","i").exec(t);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}("redirect");return r.a.createElement(D.a,Object.assign({},n,{render:function(e){return a.isAuthenticated?r.a.createElement(Z.a,{to:""===s||null===s?"/":s}):r.a.createElement(t,Object.assign({},e,a))}}))},Q=a(69),ee=(a(286),function(e){function t(e){var a;return Object(u.a)(this,t),(a=Object(m.a)(this,Object(d.a)(t).call(this,e))).handleFieldChange=function(e){a.setState(Object(P.a)({},e.target.id,e.target.value))},a.handleCardFieldChange=function(e){a.setState({isCardComplete:e.complete})},a.handleSubmitClick=function(){var e=Object(l.a)(c.a.mark(function e(t){var n,r,s,i;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),n=a.state.name,a.setState({isProcessing:!0}),e.next=5,a.props.stripe.createToken({name:n});case 5:r=e.sent,s=r.token,i=r.error,a.setState({isProcessing:!1}),a.props.onSubmit(a.state.storage,{token:s,error:i});case 10:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),a.state={name:"",storage:"",isProcessing:!1,isCardComplete:!1},a}return Object(p.a)(t,e),Object(h.a)(t,[{key:"validateForm",value:function(){return""!==this.state.name&&""!==this.state.storage&&this.state.isCardComplete}},{key:"render",value:function(){var e=this.state.isProcessing||this.props.loading;return r.a.createElement("form",{className:"BillingForm",onSubmit:this.handleSubmitClick},r.a.createElement(C.a,{bsSize:"large",controlId:"storage"},r.a.createElement(F.a,null,"Storage"),r.a.createElement(L.a,{min:"0",type:"number",value:this.state.storage,onChange:this.handleFieldChange,placeholder:"Number of notes to store"})),r.a.createElement("hr",null),r.a.createElement(C.a,{bsSize:"large",controlId:"name"},r.a.createElement(F.a,null,"Cardholder's name"),r.a.createElement(L.a,{type:"text",value:this.state.name,onChange:this.handleFieldChange,placeholder:"Name on the card"})),r.a.createElement(F.a,null,"Credit Card Info"),r.a.createElement(Q.CardElement,{className:"card-field",onChange:this.handleCardFieldChange,style:{base:{fontSize:"18px",fontFamily:'"Open Sans", sans-serif'}}}),r.a.createElement(B,{block:!0,bsSize:"large",type:"submit",text:"Purchase",isLoading:e,loadingText:"Purchasing\u2026",disabled:!this.validateForm()}))}}]),t}(n.Component)),te=Object(Q.injectStripe)(ee);a(288);v.e.Logger.LOG_LEVEL="DEBUG";var ae=function(e){function t(e){var a;return Object(u.a)(this,t),(a=Object(m.a)(this,Object(d.a)(t).call(this,e))).handleFormSubmit=function(){var e=Object(l.a)(c.a.mark(function e(t,n){var r,s;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.token,!(s=n.error)){e.next=4;break}return alert(s),e.abrupt("return");case 4:return a.setState({isLoading:!0}),e.prev=5,e.next=8,a.billUser({storage:t,source:r.id});case 8:alert("Your card has been charged successfully!"),a.props.history.push("/"),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(5),alert(e.t0),a.setState({isLoading:!1});case 16:case"end":return e.stop()}},e,null,[[5,12]])}));return function(t,a){return e.apply(this,arguments)}}(),a.handleTestSubmit=function(){var e=Object(l.a)(c.a.mark(function e(t){var n,r;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=new v.c("foo"),t.preventDefault(),r={i:"Watch",x:4,y:10,w:2,h:2},a.setState({isLoading:!0}),e.prev=4,e.next=7,a.createDashboardMap(r);case 7:alert("Your dashboardMap is saved!"),a.props.history.push("/"),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(4),n.error("error happened",e.t0),alert("->"+e.t0),a.setState({isLoading:!1});case 16:case"end":return e.stop()}},e,null,[[4,11]])}));return function(t){return e.apply(this,arguments)}}(),a.state={isLoading:!1},a}return Object(p.a)(t,e),Object(h.a)(t,[{key:"billUser",value:function(e){return v.a.post("brainstorm","/billing",{body:e})}},{key:"createDashboardMap",value:function(e){return v.a.post("brainstorm","/dashboardMap",{body:e})}},{key:"render",value:function(){return r.a.createElement("div",{className:"Settings"},r.a.createElement("div",null,r.a.createElement("p",null,"Section of Configurating templates or views How you prefer the session list big list , Simple 800px or 1200 centered, small cards, dashboard, way.")),r.a.createElement(O.a,{onClick:this.handleTestSubmit},"Test"))}},{key:"renderStripePayFeature",value:function(){return r.a.createElement("div",null,r.a.createElement(Q.StripeProvider,{apiKey:b.STRIPE_KEY},r.a.createElement(Q.Elements,null,r.a.createElement(te,{loading:this.state.isLoading,onSubmit:this.handleFormSubmit}))))}}]),t}(n.Component),ne=function(e){var t=e.childProps;return r.a.createElement(I.a,null,r.a.createElement(H,{path:"/",exact:!0,component:A.a,props:t}),r.a.createElement($,{path:"/login",exact:!0,component:G,props:t}),r.a.createElement($,{path:"/signup",exact:!0,component:z,props:t}),r.a.createElement(q,{path:"/settings",exact:!0,component:ae,props:t}),r.a.createElement(q,{path:"/notes/new",exact:!0,component:V,props:t}),r.a.createElement(q,{path:"/notes/:id",exact:!0,component:X,props:t}),r.a.createElement(D.a,{component:T}))},re=(a(290),function(e){function t(e){var a;return Object(u.a)(this,t),(a=Object(m.a)(this,Object(d.a)(t).call(this,e))).userHasAuthenticated=function(e){a.setState({isAuthenticated:e})},a.handleLogout=function(){var e=Object(l.a)(c.a.mark(function e(t){return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.b.signOut();case 2:a.userHasAuthenticated(!1),a.props.history.push("/login");case 4:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),a.state={isAuthenticated:!1,isAuthenticating:!0},a}return Object(p.a)(t,e),Object(h.a)(t,[{key:"componentDidMount",value:function(){var e=Object(l.a)(c.a.mark(function e(){return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.loadFacebookSDK(),e.prev=1,e.next=4,v.b.currentAuthenticatedUser();case 4:this.userHasAuthenticated(!0),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),"not authenticated"!==e.t0&&alert(e.t0);case 10:this.setState({isAuthenticating:!1});case 11:case"end":return e.stop()}},e,this,[[1,7]])}));return function(){return e.apply(this,arguments)}}()},{key:"loadFacebookSDK",value:function(){window.fbAsyncInit=function(){window.FB.init({appId:b.social.FB,autoLogAppEvents:!0,xfbml:!0,version:"v3.1"})},function(e,t,a){var n,r=e.getElementsByTagName(t)[0];e.getElementById(a)||((n=e.createElement(t)).id=a,n.src="https://connect.facebook.net/en_US/sdk.js",r.parentNode.insertBefore(n,r))}(document,"script","facebook-jssdk")}},{key:"render",value:function(){var e={isAuthenticated:this.state.isAuthenticated,userHasAuthenticated:this.userHasAuthenticated};return!this.state.isAuthenticating&&r.a.createElement("div",{className:"App AppHeader"},r.a.createElement(k.a,{fluid:!0,collapseOnSelect:!0,inverse:!0,fixedTop:!0},r.a.createElement(k.a.Header,null,r.a.createElement(k.a.Brand,null,r.a.createElement(E.a,{to:"/"},"Brainstorms Lab - Work on Your Ideas in different ways")),r.a.createElement(k.a.Toggle,null)),r.a.createElement(k.a.Collapse,null,r.a.createElement(S.a,{pullRight:!0},this.state.isAuthenticated?r.a.createElement(n.Fragment,null,r.a.createElement(k.a.Form,{pullLeft:!0},r.a.createElement(C.a,null,r.a.createElement(L.a,{type:"text",placeholder:"Search"}))," ",r.a.createElement(O.a,{type:"submit"},"Search")),r.a.createElement(j.a,{eventKey:3,title:"Menu",id:"basic-nav-dropdown"},r.a.createElement(N.LinkContainer,{to:"/settings"},r.a.createElement(w.a,{eventKey:3.1},"Settings")),r.a.createElement(w.a,{eventKey:3.2},"Create Access"),r.a.createElement(w.a,{eventKey:3.3},"Select Tools"),r.a.createElement(w.a,{eventKey:3.4},"Journalist Version"),r.a.createElement(w.a,{divider:!0}),r.a.createElement(w.a,{eventKey:3.3},"Help")),r.a.createElement(x.a,{onClick:this.handleLogout},"Logout")):r.a.createElement(n.Fragment,null,r.a.createElement(N.LinkContainer,{to:"/signup"},r.a.createElement(x.a,null,"Signup")),r.a.createElement(N.LinkContainer,{to:"/login"},r.a.createElement(x.a,null,"Login")))))),r.a.createElement(ne,{childProps:e}))}}]),t}(n.Component)),se=Object(y.a)(re);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var ie=a(131);v.e.configure({Auth:{mandatorySignIn:!0,region:b.cognito.REGION,userPoolId:b.cognito.USER_POOL_ID,identityPoolId:b.cognito.IDENTITY_POOL_ID,userPoolWebClientId:b.cognito.APP_CLIENT_ID},Storage:{region:b.s3.REGION,bucket:b.s3.BUCKET,identityPoolId:b.cognito.IDENTITY_POOL_ID},API:{endpoints:[{name:"brainstorm",endpoint:b.apiGateway.NotesURL,region:b.apiGateway.REGION},{name:"dayphrases",endpoint:b.apiGateway.DayPhrasesURL,region:b.apiGateway.REGION}]}}),i.a.render(r.a.createElement(ie.a,null,r.a.createElement(se,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})},322:function(e,t,a){e.exports=a(310)},327:function(e,t,a){},728:function(e,t,a){},743:function(e,t,a){},745:function(e,t,a){},747:function(e,t,a){}},[[322,2,1]]]); //# sourceMappingURL=main.8c561c52.chunk.js.map