-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.fa369059363ebe2a3f15.js
1 lines (1 loc) · 24.9 KB
/
main.fa369059363ebe2a3f15.js
1
!function(e){function t(t){for(var n,u,i=t[0],l=t[1],p=t[2],s=0,_=[];s<i.length;s++)u=i[s],a[u]&&_.push(a[u][0]),a[u]=0;for(n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n]);for(c&&c(t);_.length;)_.shift()();return o.push.apply(o,p||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,i=1;i<r.length;i++){var l=r[i];0!==a[l]&&(n=!1)}n&&(o.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},a={0:0},o=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/";var i=window.webpackJsonp=window.webpackJsonp||[],l=i.push.bind(i);i.push=t,i=i.slice();for(var p=0;p<i.length;p++)t(i[p]);var c=l;o.push([31,1]),r()}({14:function(module,exports,__webpack_require__){"use strict";(function(module){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=__webpack_require__(1),React=_interopRequireWildcard(_react),_reactRouterDom=__webpack_require__(9),_kittenLogo=__webpack_require__(50),_kittenLogo2=_interopRequireDefault(_kittenLogo);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}__webpack_require__(51),function(){var e=__webpack_require__(2).enterModule;e&&e(module)}();var SiteWrapper=function(_React$Component){function SiteWrapper(){return _classCallCheck(this,SiteWrapper),_possibleConstructorReturn(this,(SiteWrapper.__proto__||Object.getPrototypeOf(SiteWrapper)).apply(this,arguments))}return _inherits(SiteWrapper,_React$Component),_createClass(SiteWrapper,[{key:"render",value:function(){return React.createElement(React.Fragment,null,React.createElement("nav",{className:"sitewrapper-navbar-container"},React.createElement(_reactRouterDom.Link,{className:"sitewrapper-navbar-container-logo",to:"/"},React.createElement("img",{src:_kittenLogo2.default})," I need TP FOR MY BONGHOLE!"),React.createElement(_reactRouterDom.Link,{className:"sitewrapper-navbar-container-newTPRequestButton",role:"button",to:"/urgently-need-tp"},"Urgently need TP!")),React.createElement("main",null,this.props.children))}},{key:"__reactstandin__regenerateByEval",value:function __reactstandin__regenerateByEval(key,code){this[key]=eval(code)}}]),SiteWrapper}(React.Component),_default=SiteWrapper;exports.default=_default,function(){var e=__webpack_require__(2).default,t=__webpack_require__(2).leaveModule;e&&(e.register(SiteWrapper,"SiteWrapper","/Users/philipp/node/dev/tp-app/src/app/pages/SiteWrapper.js"),e.register(_default,"default","/Users/philipp/node/dev/tp-app/src/app/pages/SiteWrapper.js"),t(module))}()}).call(this,__webpack_require__(6)(module))},15:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(54));!function(){var t=r(2).enterModule;t&&t(e)}();var a="http://ineedtpformybonghole.online/ineedtpapi",o=function(e){var t=e.id,r=e.name,n=e.message,a=e.location,o=e.createdAt,u=e.fullfilledAt,i=e.img_url;return{id:t,name:r,message:n,location:a,createdAt:new Date(o),fullfilledAt:u?new Date(u):null,img_url:i}},u=function(e){return null==e?[]:e.map(o)},i=function(){return n.default.get(a+"/getTPRequests").then(function(e){var t=e.data.response;return u(t)})},l=function(e){return n.default.get(a+"/getDetail?id="+e).then(function(e){var t=e.data.response;return o(t)})},p=function(e){return n.default.post(a+"/createTPRequest",e,{headers:{"content-type":"application/json"}})},c=function(e){return n.default.put(a+"/upload",e,{})},s={getUnfullfilledTPRequests:i,fullfillTPRequest:c,createTPRequest:p,getDetail:l};t.default=s,function(){var t=r(2).default,n=r(2).leaveModule;t&&(t.register(a,"API_ENDPOINT","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),t.register(o,"parseTPObject","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),t.register(u,"parseTPObjects","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),t.register(i,"getUnfullfilledTPRequests","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),t.register(l,"getDetail","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),t.register(p,"createTPRequest","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),t.register(c,"fullfillTPRequest","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),t.register(s,"default","/Users/philipp/node/dev/tp-app/src/app/api/index.js"),n(e))}()}).call(this,r(6)(e))},28:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.Loading=t.TextInput=t.Button=void 0;var n=u(r(77)),a=u(r(78)),o=u(r(79));function u(e){return e&&e.__esModule?e:{default:e}}!function(){var t=r(2).enterModule;t&&t(e)}();var i=t.Button=n.default,l=t.TextInput=a.default,p=t.Loading=o.default;!function(){var t=r(2).default,n=r(2).leaveModule;t&&(t.register(i,"Button","/Users/philipp/node/dev/tp-app/src/app/pages/components/index.js"),t.register(l,"TextInput","/Users/philipp/node/dev/tp-app/src/app/pages/components/index.js"),t.register(p,"Loading","/Users/philipp/node/dev/tp-app/src/app/pages/components/index.js"),n(e))}()}).call(this,r(6)(e))},31:function(e,t,r){"use strict";(function(e){var t=o(r(32)),n=o(r(1)),a=o(r(41));function o(e){return e&&e.__esModule?e:{default:e}}!function(){var t=r(2).enterModule;t&&t(e)}();var u=document.getElementById("app");if(!u)throw Error("'Cannot find mount point with id=app");t.default.render(n.default.createElement(a.default,null),u),function(){var t=r(2).default,n=r(2).leaveModule;t&&(t.register("app","MOUNT_POINT_ID","/Users/philipp/node/dev/tp-app/src/app/index.js"),t.register(u,"mountPoint","/Users/philipp/node/dev/tp-app/src/app/index.js"),n(e))}()}).call(this,r(6)(e))},41:function(module,exports,__webpack_require__){"use strict";(function(module){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();__webpack_require__(42),__webpack_require__(44);var _react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(9),_HomePage=__webpack_require__(49),_HomePage2=_interopRequireDefault(_HomePage),_TPDetails=__webpack_require__(76),_TPDetails2=_interopRequireDefault(_TPDetails),_RequestTP=__webpack_require__(85),_RequestTP2=_interopRequireDefault(_RequestTP),_=__webpack_require__(88),_2=_interopRequireDefault(_);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}!function(){var e=__webpack_require__(2).enterModule;e&&e(module)}();var Main=function(_Component){function Main(){return _classCallCheck(this,Main),_possibleConstructorReturn(this,(Main.__proto__||Object.getPrototypeOf(Main)).call(this))}return _inherits(Main,_Component),_createClass(Main,[{key:"render",value:function(){return _react2.default.createElement(_reactRouterDom.BrowserRouter,null,_react2.default.createElement(_reactRouterDom.Switch,null,_react2.default.createElement(_reactRouterDom.Route,{exact:!0,path:"/",component:_HomePage2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/urgently-need-tp",component:_RequestTP2.default}),_react2.default.createElement(_reactRouterDom.Route,{path:"/tp/:tpId",component:_TPDetails2.default}),_react2.default.createElement(_reactRouterDom.Route,{component:_2.default})))}},{key:"__reactstandin__regenerateByEval",value:function __reactstandin__regenerateByEval(key,code){this[key]=eval(code)}}]),Main}(_react.Component),_default=Main;exports.default=_default,function(){var e=__webpack_require__(2).default,t=__webpack_require__(2).leaveModule;e&&(e.register(Main,"Main","/Users/philipp/node/dev/tp-app/src/app/App.js"),e.register(_default,"default","/Users/philipp/node/dev/tp-app/src/app/App.js"),t(module))}()}).call(this,__webpack_require__(6)(module))},42:function(e,t,r){},44:function(e,t,r){},49:function(module,exports,__webpack_require__){"use strict";(function(module){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_SiteWrapper=__webpack_require__(14),_SiteWrapper2=_interopRequireDefault(_SiteWrapper),_reactRouterDom=__webpack_require__(9),_api=__webpack_require__(15),_api2=_interopRequireDefault(_api);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}__webpack_require__(74),function(){var e=__webpack_require__(2).enterModule;e&&e(module)}();var HomePage=function(_Component){function HomePage(){_classCallCheck(this,HomePage);var e=_possibleConstructorReturn(this,(HomePage.__proto__||Object.getPrototypeOf(HomePage)).call(this));return e.state={unfullfilled:[]},e}return _inherits(HomePage,_Component),_createClass(HomePage,[{key:"componentDidMount",value:function(){var e=this;_api2.default.getUnfullfilledTPRequests().then(function(t){e.setState({unfullfilled:t})})}},{key:"render",value:function(){var e=this.state.unfullfilled;return _react2.default.createElement(_SiteWrapper2.default,null,_react2.default.createElement("div",{className:"homepage-main-container"},_react2.default.createElement("h1",null,"THIS IS THE TP PAGE"),_react2.default.createElement(TPRequests,{tps:e})))}},{key:"__reactstandin__regenerateByEval",value:function __reactstandin__regenerateByEval(key,code){this[key]=eval(code)}}]),HomePage}(_react.Component),_default=HomePage;exports.default=_default;var TPRequests=function(e){var t=e.tps.map(function(e){return _react2.default.createElement(TPRequest,{key:e.id,tp:e})});return _react2.default.createElement("div",{className:"homepage-tprequests-container"},t)},TPRequest=function(e){var t=e.tp;return _react2.default.createElement("article",{className:"homepage-tprequest-container"},_react2.default.createElement("h2",null,t.name),_react2.default.createElement("p",null,t.message),_react2.default.createElement(_reactRouterDom.Link,{to:"/tp/"+t.id},"Detail"))};!function(){var e=__webpack_require__(2).default,t=__webpack_require__(2).leaveModule;e&&(e.register(HomePage,"HomePage","/Users/philipp/node/dev/tp-app/src/app/pages/HomePage/index.js"),e.register(TPRequests,"TPRequests","/Users/philipp/node/dev/tp-app/src/app/pages/HomePage/index.js"),e.register(TPRequest,"TPRequest","/Users/philipp/node/dev/tp-app/src/app/pages/HomePage/index.js"),e.register(_default,"default","/Users/philipp/node/dev/tp-app/src/app/pages/HomePage/index.js"),t(module))}()}).call(this,__webpack_require__(6)(module))},50:function(e,t,r){e.exports=r.p+"63a12906e75abe101080b756cf6397da.jpg"},51:function(e,t,r){},74:function(e,t,r){},76:function(module,exports,__webpack_require__){"use strict";(function(module){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(9),_SiteWrapper=__webpack_require__(14),_SiteWrapper2=_interopRequireDefault(_SiteWrapper),_components=__webpack_require__(28),_api=__webpack_require__(15),_api2=_interopRequireDefault(_api),_formik=__webpack_require__(29);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}__webpack_require__(83),function(){var e=__webpack_require__(2).enterModule;e&&e(module)}();var RequestTP=function(_Component){function RequestTP(){_classCallCheck(this,RequestTP);var e=_possibleConstructorReturn(this,(RequestTP.__proto__||Object.getPrototypeOf(RequestTP)).call(this));return e.state={loading:!0,tp:null},e}return _inherits(RequestTP,_Component),_createClass(RequestTP,[{key:"componentDidMount",value:function(){var e=this,t=this.props.match.params.tpId;_api2.default.getDetail(t).then(function(t){e.setState({loading:!1,tp:t})})}},{key:"render",value:function(){var e=this,t=this.state,r=t.tp;return t.loading||null==r?_react2.default.createElement(_components.Loading,null):_react2.default.createElement(_SiteWrapper2.default,null,"Handle TP !",_react2.default.createElement("h1",null,r.name),_react2.default.createElement(_formik.Formik,{enableReinitialize:!0,initialValues:{name:"",message:"",file:null},isInitialValid:!0,validate:function(e){var t=e.name,r=e.message,n={};return""===t&&(n.name="Fill in a name"),""===r&&(n.message="No message? :'-("),n},onSubmit:function(t){var r=t.name,n=t.message,a=t.file,o=new FormData;return o.append("file",a),o.append("name",r),o.append("message",n),_api2.default.fullfillTPRequest(o).then(function(){e.props.history.push("/")}).catch(function(e){return alert(e)})},render:function(e){var t=e.values,r=e.errors,n=e.handleChange,a=(e.handleBlur,e.handleSubmit),o=e.isSubmitting,u=e.setFieldValue;e.dirty,e.isValid;return _react2.default.createElement("form",{onSubmit:function(e){if(e.preventDefault(),!o)return a(e)}},_react2.default.createElement(_components.TextInput,{value:t.name,onChange:n,label:"Name",name:"name",error:r.name}),_react2.default.createElement(_components.TextInput,{value:t.message,onChange:n,label:"Message",name:"message",error:r.message}),_react2.default.createElement("input",{id:"file",name:"file",type:"file",onChange:function(e){u("file",e.currentTarget.files[0])}}),_react2.default.createElement(_components.Button,{type:"submit"},"Submit"))}}))}},{key:"__reactstandin__regenerateByEval",value:function __reactstandin__regenerateByEval(key,code){this[key]=eval(code)}}]),RequestTP}(_react.Component),_default=(0,_reactRouterDom.withRouter)(RequestTP);exports.default=_default,function(){var e=__webpack_require__(2).default,t=__webpack_require__(2).leaveModule;e&&(e.register(RequestTP,"RequestTP","/Users/philipp/node/dev/tp-app/src/app/pages/TPDetails/index.js"),e.register(_default,"default","/Users/philipp/node/dev/tp-app/src/app/pages/TPDetails/index.js"),t(module))}()}).call(this,__webpack_require__(6)(module))},77:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(1));!function(){var t=r(2).enterModule;t&&t(e)}();var a=function(e){var t=e.children,r=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["children"]);return n.default.createElement("button",r,t)};t.default=a,function(){var t=r(2).default,n=r(2).leaveModule;t&&(t.register(a,"default","/Users/philipp/node/dev/tp-app/src/app/pages/components/Button.js"),n(e))}()}).call(this,r(6)(e))},78:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(1));!function(){var t=r(2).enterModule;t&&t(e)}();var a=function(e){var t=e.name,r=e.value,a=e.label,u=e.onChange,i=e.error;return n.default.createElement("label",null,a,n.default.createElement("input",{name:t,value:r,onChange:u}),n.default.createElement(o,{error:i}))};t.default=a;var o=function(e){var t=e.error;return null==t?null:n.default.createElement("p",null,t)};!function(){var t=r(2).default,n=r(2).leaveModule;t&&(t.register(o,"TextInputError","/Users/philipp/node/dev/tp-app/src/app/pages/components/TextInput.js"),t.register(a,"default","/Users/philipp/node/dev/tp-app/src/app/pages/components/TextInput.js"),n(e))}()}).call(this,r(6)(e))},79:function(module,exports,__webpack_require__){"use strict";(function(module){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}!function(){var e=__webpack_require__(2).enterModule;e&&e(module)}();var Loading=function(_Component){function Loading(){return _classCallCheck(this,Loading),_possibleConstructorReturn(this,(Loading.__proto__||Object.getPrototypeOf(Loading)).apply(this,arguments))}return _inherits(Loading,_Component),_createClass(Loading,[{key:"render",value:function(){return _react2.default.createElement("div",{style:{display:"inline-block"}},_react2.default.createElement("h1",null,"Loading..."))}},{key:"__reactstandin__regenerateByEval",value:function __reactstandin__regenerateByEval(key,code){this[key]=eval(code)}}]),Loading}(_react.Component),_default=Loading;exports.default=_default,function(){var e=__webpack_require__(2).default,t=__webpack_require__(2).leaveModule;e&&(e.register(Loading,"Loading","/Users/philipp/node/dev/tp-app/src/app/pages/components/Loading.js"),e.register(_default,"default","/Users/philipp/node/dev/tp-app/src/app/pages/components/Loading.js"),t(module))}()}).call(this,__webpack_require__(6)(module))},83:function(e,t,r){},85:function(module,exports,__webpack_require__){"use strict";(function(module){Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_react=__webpack_require__(1),_react2=_interopRequireDefault(_react),_reactRouterDom=__webpack_require__(9),_SiteWrapper=__webpack_require__(14),_SiteWrapper2=_interopRequireDefault(_SiteWrapper),_components=__webpack_require__(28),_api=__webpack_require__(15),_api2=_interopRequireDefault(_api),_formik=__webpack_require__(29);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}__webpack_require__(86),function(){var e=__webpack_require__(2).enterModule;e&&e(module)}();var RequestTP=function(_Component){function RequestTP(){return _classCallCheck(this,RequestTP),_possibleConstructorReturn(this,(RequestTP.__proto__||Object.getPrototypeOf(RequestTP)).call(this))}return _inherits(RequestTP,_Component),_createClass(RequestTP,[{key:"render",value:function(){var e=this;return _react2.default.createElement(_SiteWrapper2.default,null,"Submit TP",_react2.default.createElement(_formik.Formik,{enableReinitialize:!0,initialValues:{name:"",message:""},isInitialValid:!0,validate:function(e){var t=e.name,r=e.message,n={};return""===t&&(n.name="Fill in a name"),""===r&&(n.message="No message? :'-("),n},onSubmit:function(t){var r=t.name,n=t.message;return _api2.default.createTPRequest({name:r,message:n}).then(function(){e.props.history.push("/")}).catch(function(e){return alert(e)})},render:function(e){var t=e.values,r=e.errors,n=e.handleChange,a=(e.handleBlur,e.handleSubmit),o=e.isSubmitting;e.dirty,e.isValid;return _react2.default.createElement("form",{onSubmit:function(e){if(e.preventDefault(),!o)return a(e)}},_react2.default.createElement(_components.TextInput,{value:t.name,onChange:n,label:"Name",name:"name",error:r.name}),_react2.default.createElement(_components.TextInput,{value:t.message,onChange:n,label:"Message",name:"message",error:r.message}),_react2.default.createElement(_components.Button,{type:"submit"},"Submit"))}}))}},{key:"__reactstandin__regenerateByEval",value:function __reactstandin__regenerateByEval(key,code){this[key]=eval(code)}}]),RequestTP}(_react.Component),_default=(0,_reactRouterDom.withRouter)(RequestTP);exports.default=_default,function(){var e=__webpack_require__(2).default,t=__webpack_require__(2).leaveModule;e&&(e.register(RequestTP,"RequestTP","/Users/philipp/node/dev/tp-app/src/app/pages/RequestTP/index.js"),e.register(_default,"default","/Users/philipp/node/dev/tp-app/src/app/pages/RequestTP/index.js"),t(module))}()}).call(this,__webpack_require__(6)(module))},86:function(e,t,r){},88:function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(1));!function(){var t=r(2).enterModule;t&&t(e)}();var a=function(){return n.default.createElement("section",null,"No TP FOR YOU!")};t.default=a,function(){var t=r(2).default,n=r(2).leaveModule;t&&(t.register(a,"default","/Users/philipp/node/dev/tp-app/src/app/pages/404/index.js"),n(e))}()}).call(this,r(6)(e))}});