From b413f9db775f75d8e5dd44690933f8bd268b1879 Mon Sep 17 00:00:00 2001 From: Tom B Date: Fri, 11 Aug 2017 14:53:00 -0400 Subject: [PATCH] A few changes to API for better Wrapped component support (#472) * Add propTypes to API docs; move innerRef doc to match location in table of contents * Change HOC to Wrapper (be consistent everywhere) * Inject defaultProps.value from wrapped component into Formsy.Wrapper This way users can provide a default value for their form field. Previously, this was possible because mixins were on the same level as the actual component. * Add optional parameter to setState to disable validation * Update prepublish script to clean `lib`; rebuild release folder --- API.md | 47 +++++++++++++++++++++++++------------ package.json | 2 +- release/formsy-react.js | 2 +- release/formsy-react.js.map | 2 +- src/{HOC.js => Wrapper.js} | 29 ++++++++++++++--------- src/index.js | 4 ++-- tests/Element-spec.js | 28 +++++++++++++++++++++- 7 files changed, 82 insertions(+), 32 deletions(-) rename src/{HOC.js => Wrapper.js} (87%) diff --git a/API.md b/API.md index 4a08d8b..4f90394 100644 --- a/API.md +++ b/API.md @@ -37,6 +37,7 @@ - [isFormSubmitted()](#isformsubmitted) - [validate](#validate) - [formNoValidate](#formnovalidate) +- [Formsy.propTypes](#formsyproptypes) - [Formsy.addValidationRule](#formsyaddvalidationrule) - [Validators](#validators) @@ -238,6 +239,26 @@ export default Wrapper(MyInput); ``` The name is required to register the form input component in the form. You can also use dot notation. This will result in the "form model" being a nested object. `{email: 'value', address: {street: 'value'}}`. + +#### innerRef + +Use an `innerRef` prop to get a reference to your DOM node. + +```jsx +class MyForm extends React.Component { + componentDidMount() { + this.searchInput.focus() + } + render() { + return ( + + { this.searchInput = c; }} /> + + ); + } +} +``` + #### value ```jsx @@ -314,7 +335,7 @@ class MyInput extends React.Component { ``` Gets the current value of the form input component. -#### setValue(value) +#### setValue(value[, validate = true]) ```jsx class MyInput extends React.Component { changeValue = (event) => { @@ -329,6 +350,8 @@ class MyInput extends React.Component { ``` Sets the value of your form input component. Notice that it does not have to be a text input. Anything can set a value on the component. Think calendars, checkboxes, autocomplete stuff etc. Running this method will trigger a **setState()** on the component and do a render. +You can also set the value without forcing an immediate validation by passing a second parameter of `false`. This is useful in cases where you want to only validate on blur / change / etc. + #### resetValue() ```jsx class MyInput extends React.Component { @@ -559,22 +582,16 @@ class MyInput extends React.Component { } ``` -#### innerRef - -Use an `innerRef` prop to get a reference to your DOM node. - +### Formsy.propTypes +If you are using React's PropType typechecking, you can spread Formsy's propTypes into your local propTypes to avoid having to repeatedly add `Formsy.Wrapper`'s methods to your components. ```jsx -class MyForm extends React.Component { - componentDidMount() { - this.searchInput.focus() - } - render() { - return ( - - { this.searchInput = c; }} /> - - ); +class MyInput extends React.Component { + static propTypes = { + firstProp: PropTypes.string, + secondProp: PropTypes.object, + ...Formsy.propTypes } + ... } ``` diff --git a/package.json b/package.json index b3252f2..e775b77 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build": "NODE_ENV=production webpack -p --config webpack.production.config.js", "test": "babel-node testrunner", "examples": "webpack-dev-server --config examples/webpack.config.js --content-base examples", - "prepublish": "babel ./src/ -d ./lib/" + "prepublish": "rm -Rf ./lib && babel ./src/ -d ./lib/" }, "author": "Christian Alfoni", "license": "MIT", diff --git a/release/formsy-react.js b/release/formsy-react.js index a514ff3..a906cfe 100644 --- a/release/formsy-react.js +++ b/release/formsy-react.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react")):"function"==typeof define&&define.amd?define(["react"],e):"object"==typeof exports?exports.Formsy=e(require("react")):t.Formsy=e(t.react)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){(function(e){"use strict";function n(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a,s,c,l=Object.assign||function(t){for(var e=1;e0&&this.setInputValidationErrors(this.props.validationErrors);var t=this.inputs.map(function(t){return t.props.name});m.arraysDiffer(this.prevInputNames,t)&&this.validateForm()}},{key:"render",value:function(){var t=this.props,e=(t.mapping,t.validationErrors,t.onSubmit,t.onValid,t.onValidSubmit,t.onInvalid,t.onInvalidSubmit,t.onChange,t.reset,t.preventExternalInvalidation,t.onSuccess,t.onError,n(t,["mapping","validationErrors","onSubmit","onValid","onValidSubmit","onInvalid","onInvalidSubmit","onChange","reset","preventExternalInvalidation","onSuccess","onError"]));return h.createElement("form",l({},e,{onSubmit:this.submit}),this.props.children)}}]),e}(h.Component),a.displayName="Formsy.Form",a.defaultProps={onSuccess:function(){},onError:function(){},onSubmit:function(){},onValidSubmit:function(){},onInvalidSubmit:function(){},onValid:function(){},onInvalid:function(){},onChange:function(){},validationErrors:null,preventExternalInvalidation:!1},a.childContextTypes={formsy:d.object},c=function(){var t=this,e=arguments;this.state={isValid:!0,isSubmitting:!1,canChange:!1},this.reset=function(e){t.setFormPristine(!0),t.resetModel(e)},this.submit=function(e){e&&e.preventDefault(),t.setFormPristine(!1);var r=t.getModel();t.props.onSubmit(r,t.resetModel,t.updateInputsWithError),t.state.isValid?t.props.onValidSubmit(r,t.resetModel,t.updateInputsWithError):t.props.onInvalidSubmit(r,t.resetModel,t.updateInputsWithError)},this.mapModel=function(e){return t.props.mapping?t.props.mapping(e):v.toObj(Object.keys(e).reduce(function(t,r){for(var n=r.split("."),i=t;n.length;){var o=n.shift();i=i[o]=n.length?i[o]||{}:e[r]}return t},{}))},this.getModel=function(){var e=t.getCurrentValues();return t.mapModel(e)},this.resetModel=function(e){t.inputs.forEach(function(t){var r=t.props.name;e&&e.hasOwnProperty(r)?t.setValue(e[r]):t.resetValue()}),t.validateForm()},this.setInputValidationErrors=function(e){t.inputs.forEach(function(t){var r=t.props.name,n=[{_isValid:!(r in e),_validationError:"string"==typeof e[r]?[e[r]]:e[r]}];t.setState.apply(t,n)})},this.isChanged=function(){return!m.isSame(t.getPristineValues(),t.getCurrentValues())},this.getPristineValues=function(){return t.inputs.reduce(function(t,e){var r=e.props.name;return t[r]=e.props.value,t},{})},this.updateInputsWithError=function(e){Object.keys(e).forEach(function(r,n){var i=m.find(t.inputs,function(t){return t.props.name===r});if(!i)throw new Error("You are trying to update an input that does not exist. Verify errors object with input names. "+JSON.stringify(e));var o=[{_isValid:t.props.preventExternalInvalidation||!1,_externalError:"string"==typeof e[r]?[e[r]]:e[r]}];i.setState.apply(i,o)})},this.isFormDisabled=function(){return t.props.disabled},this.getCurrentValues=function(){return t.inputs.reduce(function(t,e){var r=e.props.name;return t[r]=e.state._value,t},{})},this.setFormPristine=function(e){t.setState({_formSubmitted:!e}),t.inputs.forEach(function(t,r){t.setState({_formSubmitted:!e,_isPristine:e})})},this.validate=function(e){t.state.canChange&&t.props.onChange(t.getCurrentValues(),t.isChanged());var r=t.runValidation(e);e.setState({_isValid:r.isValid,_isRequired:r.isRequired,_validationError:r.error,_externalError:null},t.validateForm)},this.runValidation=function(r,n){var i=t.getCurrentValues(),o=r.props.validationErrors,u=r.props.validationError;n=2===e.length?n:r.state._value;var a=t.runRules(n,i,r._validations),s=t.runRules(n,i,r._requiredValidations);"function"==typeof r.validate&&(a.failed=r.validate()?[]:["failed"]);var c=!!Object.keys(r._requiredValidations).length&&!!s.success.length,l=!(a.failed.length||t.props.validationErrors&&t.props.validationErrors[r.props.name]);return{isRequired:c,isValid:!c&&l,error:function(){if(l&&!c)return E;if(a.errors.length)return a.errors;if(this.props.validationErrors&&this.props.validationErrors[r.props.name])return"string"==typeof this.props.validationErrors[r.props.name]?[this.props.validationErrors[r.props.name]]:this.props.validationErrors[r.props.name];if(c){var t=o[s.success[0]];return t?[t]:null}return a.failed.length?a.failed.map(function(t){return o[t]?o[t]:u}).filter(function(t,e,r){return r.indexOf(t)===e}):void 0}.call(t)}},this.runRules=function(t,e,r){var n={errors:[],failed:[],success:[]};return Object.keys(r).length&&Object.keys(r).forEach(function(i){if(y[i]&&"function"==typeof r[i])throw new Error("Formsy does not allow you to override default validations: "+i);if(!y[i]&&"function"!=typeof r[i])throw new Error("Formsy does not have the validation rule: "+i);if("function"==typeof r[i]){var o=r[i](e,t);return void("string"==typeof o?(n.errors.push(o),n.failed.push(i)):o||n.failed.push(i))}if("function"!=typeof r[i]){var o=y[i](e,t,r[i]);return void("string"==typeof o?(n.errors.push(o),n.failed.push(i)):o?n.success.push(i):n.failed.push(i))}return n.success.push(i)}),n},this.validateForm=function(){var e=function(){var t=this.inputs.every(function(t){return t.state._isValid});this.setState({isValid:t}),t?this.props.onValid():this.props.onInvalid(),this.setState({canChange:!0})}.bind(t);t.inputs.forEach(function(r,n){var i=t.runValidation(r);i.isValid&&r.state._externalError&&(i.isValid=!1),r.setState({_isValid:i.isValid,_isRequired:i.isRequired,_validationError:i.error,_externalError:!i.isValid&&r.state._externalError?r.state._externalError:null},n===t.inputs.length-1?e:null)}),t.inputs.length||t.setState({canChange:!0})},this.attachToForm=function(e){t.inputs.indexOf(e)===-1&&t.inputs.push(e),t.validate(e)},this.detachFromForm=function(e){var r=t.inputs.indexOf(e);r!==-1&&(t.inputs=t.inputs.slice(0,r).concat(t.inputs.slice(r+1))),t.validateForm()}},s),e.exports||e.module||e.define&&e.define.amd||(e.Formsy=F),t.exports=F}).call(e,function(){return this}())},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function u(){F&&d&&(F=!1,d.length?h=d.concat(h):y=-1,h.length&&a())}function a(){if(!F){var t=i(u);F=!0;for(var e=h.length;e;){for(d=h,h=[];++y1)for(var r=1;r1?e-1:0),n=1;n2?r-2:0),i=2;i1)throw new Error("Formsy does not support multiple args on string validations. Use object format of validations instead.");return t[n]=!r.length||r[0],t},{}):t||{}};t.exports=function(t){var e=function(e){function r(){var t,e,o,u;n(this,r);for(var a=arguments.length,s=Array(a),c=0;c=i}};t.exports=i},function(t,e){function r(t){return Object.keys(t).reduce(function(e,r){var n=r.match(/[^\[]*/i),i=r.match(/\[.*?\]/g)||[];i=[n[0]].concat(i).map(function(t){return t.replace(/\[|\]/g,"")});for(var o=e;i.length;){var u=i.shift();u in o?o=o[u]:(o[u]=i.length?isNaN(i[0])?{}:[]:t[r],o=o[u])}return e},{})}function n(t){function e(t,r,n){return Array.isArray(n)||"[object Object]"===Object.prototype.toString.call(n)?(Object.keys(n).forEach(function(i){e(t,r+"["+i+"]",n[i])}),t):(t[r]=n,t)}var r=Object.keys(t);return r.reduce(function(r,n){return e(r,n,t[n])},{})}t.exports={fromObj:n,toObj:r}},function(t,e){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i=Object.getOwnPropertySymbols,o=(Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable),u=Object.getPrototypeOf,a=u&&u(Object),s=Object.getOwnPropertyNames;t.exports=function t(e,c,l){if("string"!=typeof c){if(a){var f=u(c);f&&f!==a&&t(e,f,l)}var p=s(c);i&&(p=p.concat(i(c)));for(var d=0;d=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a,s,c,l=Object.assign||function(t){for(var e=1;e0&&this.setInputValidationErrors(this.props.validationErrors);var t=this.inputs.map(function(t){return t.props.name});m.arraysDiffer(this.prevInputNames,t)&&this.validateForm()}},{key:"render",value:function(){var t=this.props,e=(t.mapping,t.validationErrors,t.onSubmit,t.onValid,t.onValidSubmit,t.onInvalid,t.onInvalidSubmit,t.onChange,t.reset,t.preventExternalInvalidation,t.onSuccess,t.onError,n(t,["mapping","validationErrors","onSubmit","onValid","onValidSubmit","onInvalid","onInvalidSubmit","onChange","reset","preventExternalInvalidation","onSuccess","onError"]));return h.createElement("form",l({},e,{onSubmit:this.submit}),this.props.children)}}]),e}(h.Component),a.displayName="Formsy.Form",a.defaultProps={onSuccess:function(){},onError:function(){},onSubmit:function(){},onValidSubmit:function(){},onInvalidSubmit:function(){},onValid:function(){},onInvalid:function(){},onChange:function(){},validationErrors:null,preventExternalInvalidation:!1},a.childContextTypes={formsy:d.object},c=function(){var t=this;this.state={isValid:!0,isSubmitting:!1,canChange:!1},this.reset=function(e){t.setFormPristine(!0),t.resetModel(e)},this.submit=function(e){e&&e.preventDefault(),t.setFormPristine(!1);var r=t.getModel();t.props.onSubmit(r,t.resetModel,t.updateInputsWithError),t.state.isValid?t.props.onValidSubmit(r,t.resetModel,t.updateInputsWithError):t.props.onInvalidSubmit(r,t.resetModel,t.updateInputsWithError)},this.mapModel=function(e){return t.props.mapping?t.props.mapping(e):v.toObj(Object.keys(e).reduce(function(t,r){for(var n=r.split("."),i=t;n.length;){var o=n.shift();i=i[o]=n.length?i[o]||{}:e[r]}return t},{}))},this.getModel=function(){var e=t.getCurrentValues();return t.mapModel(e)},this.resetModel=function(e){t.inputs.forEach(function(t){var r=t.props.name;e&&e.hasOwnProperty(r)?t.setValue(e[r]):t.resetValue()}),t.validateForm()},this.setInputValidationErrors=function(e){t.inputs.forEach(function(t){var r=t.props.name,n=[{_isValid:!(r in e),_validationError:"string"==typeof e[r]?[e[r]]:e[r]}];t.setState.apply(t,n)})},this.isChanged=function(){return!m.isSame(t.getPristineValues(),t.getCurrentValues())},this.getPristineValues=function(){return t.inputs.reduce(function(t,e){var r=e.props.name;return t[r]=e.props.value,t},{})},this.updateInputsWithError=function(e){Object.keys(e).forEach(function(r,n){var i=m.find(t.inputs,function(t){return t.props.name===r});if(!i)throw new Error("You are trying to update an input that does not exist. Verify errors object with input names. "+JSON.stringify(e));var o=[{_isValid:t.props.preventExternalInvalidation||!1,_externalError:"string"==typeof e[r]?[e[r]]:e[r]}];i.setState.apply(i,o)})},this.isFormDisabled=function(){return t.props.disabled},this.getCurrentValues=function(){return t.inputs.reduce(function(t,e){var r=e.props.name;return t[r]=e.state._value,t},{})},this.setFormPristine=function(e){t.setState({_formSubmitted:!e}),t.inputs.forEach(function(t,r){t.setState({_formSubmitted:!e,_isPristine:e})})},this.validate=function(e){t.state.canChange&&t.props.onChange(t.getCurrentValues(),t.isChanged());var r=t.runValidation(e);e.setState({_isValid:r.isValid,_isRequired:r.isRequired,_validationError:r.error,_externalError:null},t.validateForm)},this.runValidation=function(e,r){var n=t.getCurrentValues(),i=e.props.validationErrors,o=e.props.validationError;r=r?r:e.state._value;var u=t.runRules(r,n,e._validations),a=t.runRules(r,n,e._requiredValidations);"function"==typeof e.validate&&(u.failed=e.validate()?[]:["failed"]);var s=!!Object.keys(e._requiredValidations).length&&!!a.success.length,c=!(u.failed.length||t.props.validationErrors&&t.props.validationErrors[e.props.name]);return{isRequired:s,isValid:!s&&c,error:function(){if(c&&!s)return E;if(u.errors.length)return u.errors;if(this.props.validationErrors&&this.props.validationErrors[e.props.name])return"string"==typeof this.props.validationErrors[e.props.name]?[this.props.validationErrors[e.props.name]]:this.props.validationErrors[e.props.name];if(s){var t=i[a.success[0]];return t?[t]:null}return u.failed.length?u.failed.map(function(t){return i[t]?i[t]:o}).filter(function(t,e,r){return r.indexOf(t)===e}):void 0}.call(t)}},this.runRules=function(t,e,r){var n={errors:[],failed:[],success:[]};return Object.keys(r).length&&Object.keys(r).forEach(function(i){if(y[i]&&"function"==typeof r[i])throw new Error("Formsy does not allow you to override default validations: "+i);if(!y[i]&&"function"!=typeof r[i])throw new Error("Formsy does not have the validation rule: "+i);if("function"==typeof r[i]){var o=r[i](e,t);return void("string"==typeof o?(n.errors.push(o),n.failed.push(i)):o||n.failed.push(i))}if("function"!=typeof r[i]){var o=y[i](e,t,r[i]);return void("string"==typeof o?(n.errors.push(o),n.failed.push(i)):o?n.success.push(i):n.failed.push(i))}return n.success.push(i)}),n},this.validateForm=function(){var e=function(){var t=this.inputs.every(function(t){return t.state._isValid});this.setState({isValid:t}),t?this.props.onValid():this.props.onInvalid(),this.setState({canChange:!0})}.bind(t);t.inputs.forEach(function(r,n){var i=t.runValidation(r);i.isValid&&r.state._externalError&&(i.isValid=!1),r.setState({_isValid:i.isValid,_isRequired:i.isRequired,_validationError:i.error,_externalError:!i.isValid&&r.state._externalError?r.state._externalError:null},n===t.inputs.length-1?e:null)}),t.inputs.length||t.setState({canChange:!0})},this.attachToForm=function(e){t.inputs.indexOf(e)===-1&&t.inputs.push(e),t.validate(e)},this.detachFromForm=function(e){var r=t.inputs.indexOf(e);r!==-1&&(t.inputs=t.inputs.slice(0,r).concat(t.inputs.slice(r+1))),t.validateForm()}},s),e.exports||e.module||e.define&&e.define.amd||(e.Formsy=F),t.exports=F}).call(e,function(){return this}())},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function u(){F&&d&&(F=!1,d.length?h=d.concat(h):y=-1,h.length&&a())}function a(){if(!F){var t=i(u);F=!0;for(var e=h.length;e;){for(d=h,h=[];++y1)for(var r=1;r1?e-1:0),n=1;n2?r-2:0),i=2;i1)throw new Error("Formsy does not support multiple args on string validations. Use object format of validations instead.");return t[n]=!r.length||r[0],t},{}):t||{}};t.exports=function(t){var e=function(e){function r(){var e,o,u,a;n(this,r);for(var s=arguments.length,c=Array(s),l=0;l1&&void 0!==arguments[1])||arguments[1];e?u.setState({_value:t,_isPristine:!1},function(){u.context.formsy.validate(u)}):u.setState({_value:t})},u.resetValue=function(){u.setState({_value:u.state._pristineValue,_isPristine:!0},function(){this.context.formsy.validate(this)})},u.getValue=function(){return u.state._value},u.hasValue=function(){return""!==u.state._value},u.getErrorMessage=function(){var t=u.getErrorMessages();return t.length?t[0]:null},u.getErrorMessages=function(){return!u.isValid()||u.showRequired()?u.state._externalError||u.state._validationError||[]:[]},u.isFormDisabled=function(){return u.context.formsy.isFormDisabled()},u.isValid=function(){return u.state._isValid},u.isPristine=function(){return u.state._isPristine},u.isFormSubmitted=function(){return u.state._formSubmitted},u.isRequired=function(){return!!u.props.required},u.showRequired=function(){return u.state._isRequired},u.showError=function(){return!u.showRequired()&&!u.isValid()},u.isValidValue=function(t){return u.context.formsy.isValidValue.call(null,u,t)},a=o,i(u,a)}return o(r,e),s(r,[{key:"componentWillMount",value:function(){var t=this,e=function(){t.setValidations(t.props.validations,t.props.required),t.context.formsy.attachToForm(t)};if(!this.props.name)throw new Error("Form Input requires a name property when used");e()}},{key:"componentWillReceiveProps",value:function(t){this.setValidations(t.validations,t.required)}},{key:"componentDidUpdate",value:function(t){p.isSame(this.props.value,t.value)||this.setValue(this.props.value),p.isSame(this.props.validations,t.validations)&&p.isSame(this.props.required,t.required)||this.context.formsy.validate(this)}},{key:"componentWillUnmount",value:function(){this.context.formsy.detachFromForm(this)}},{key:"render",value:function(){var e=this.props.innerRef,r=a({setValidations:this.setValidations,setValue:this.setValue,resetValue:this.resetValue,getValue:this.getValue,hasValue:this.hasValue,getErrorMessage:this.getErrorMessage,getErrorMessages:this.getErrorMessages,isFormDisabled:this.isFormDisabled,isValid:this.isValid,isPristine:this.isPristine,isFormSubmitted:this.isFormSubmitted,isRequired:this.isRequired,showRequired:this.showRequired,showError:this.showError,isValidValue:this.isValidValue},this.props);return e&&(r.ref=e),c.createElement(t,r)}}]),r}(c.Component);return e.displayName="Formsy("+u(t)+")",e.contextTypes={formsy:l.object},e.defaultProps={validationError:"",validationErrors:{}},f(e,t)}}).call(e,function(){return this}())},function(t,e){"use strict";var r=function(t){return null!==t&&void 0!==t},n=function(t){return""===t},i={isDefaultRequiredValue:function(t,e){return void 0===e||""===e},isExisty:function(t,e){return r(e)},matchRegexp:function(t,e,i){return!r(e)||n(e)||i.test(e)},isUndefined:function(t,e){return void 0===e},isEmptyString:function(t,e){return n(e)},isEmail:function(t,e){return i.matchRegexp(t,e,/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i)},isUrl:function(t,e){return i.matchRegexp(t,e,/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i)},isTrue:function(t,e){return e===!0},isFalse:function(t,e){return e===!1},isNumeric:function(t,e){return"number"==typeof e||i.matchRegexp(t,e,/^[-+]?(?:\d*[.])?\d+$/)},isAlpha:function(t,e){return i.matchRegexp(t,e,/^[A-Z]+$/i)},isAlphanumeric:function(t,e){return i.matchRegexp(t,e,/^[0-9A-Z]+$/i)},isInt:function(t,e){return i.matchRegexp(t,e,/^(?:[-+]?(?:0|[1-9]\d*))$/)},isFloat:function(t,e){return i.matchRegexp(t,e,/^(?:[-+]?(?:\d+))?(?:\.\d*)?(?:[eE][\+\-]?(?:\d+))?$/)},isWords:function(t,e){return i.matchRegexp(t,e,/^[A-Z\s]+$/i)},isSpecialWords:function(t,e){return i.matchRegexp(t,e,/^[A-Z\s\u00C0-\u017F]+$/i)},isLength:function(t,e,i){return!r(e)||n(e)||e.length===i},equals:function(t,e,i){return!r(e)||n(e)||e==i},equalsField:function(t,e,r){return e==t[r]},maxLength:function(t,e,n){return!r(e)||e.length<=n},minLength:function(t,e,i){return!r(e)||n(e)||e.length>=i}};t.exports=i},function(t,e){function r(t){return Object.keys(t).reduce(function(e,r){var n=r.match(/[^\[]*/i),i=r.match(/\[.*?\]/g)||[];i=[n[0]].concat(i).map(function(t){return t.replace(/\[|\]/g,"")});for(var o=e;i.length;){var u=i.shift();u in o?o=o[u]:(o[u]=i.length?isNaN(i[0])?{}:[]:t[r],o=o[u])}return e},{})}function n(t){function e(t,r,n){return Array.isArray(n)||"[object Object]"===Object.prototype.toString.call(n)?(Object.keys(n).forEach(function(i){e(t,r+"["+i+"]",n[i])}),t):(t[r]=n,t)}var r=Object.keys(t);return r.reduce(function(r,n){return e(r,n,t[n])},{})}t.exports={fromObj:n,toObj:r}},function(t,e){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i=Object.getOwnPropertySymbols,o=(Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable),u=Object.getPrototypeOf,a=u&&u(Object),s=Object.getOwnPropertyNames;t.exports=function t(e,c,l){if("string"!=typeof c){if(a){var f=u(c);f&&f!==a&&t(e,f,l)}var p=s(c);i&&(p=p.concat(i(c)));for(var d=0;d= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar PropTypes = __webpack_require__(7);\n\tvar React = global.React || __webpack_require__(8);\n\tvar Formsy = {};\n\tvar validationRules = __webpack_require__(10);\n\tvar formDataToObject = __webpack_require__(11);\n\tvar utils = __webpack_require__(5);\n\tvar HOC = __webpack_require__(9);\n\tvar options = {};\n\tvar emptyArray = [];\n\t\n\tFormsy.Wrapper = HOC;\n\tFormsy.propTypes = {\n\t setValidations: PropTypes.func,\n\t setValue: PropTypes.func,\n\t resetValue: PropTypes.func,\n\t getValue: PropTypes.func,\n\t hasValue: PropTypes.func,\n\t getErrorMessage: PropTypes.func,\n\t getErrorMessages: PropTypes.func,\n\t isFormDisabled: PropTypes.func,\n\t isValid: PropTypes.func,\n\t isPristine: PropTypes.func,\n\t isFormSubmitted: PropTypes.func,\n\t isRequired: PropTypes.func,\n\t showRequired: PropTypes.func,\n\t showError: PropTypes.func,\n\t isValidValue: PropTypes.func\n\t};\n\t\n\tFormsy.defaults = function (passedOptions) {\n\t options = passedOptions;\n\t};\n\t\n\tFormsy.addValidationRule = function (name, func) {\n\t validationRules[name] = func;\n\t};\n\t\n\tFormsy.Form = (_temp2 = _class = function (_React$Component) {\n\t _inherits(FormsyForm, _React$Component);\n\t\n\t function FormsyForm() {\n\t var _ref;\n\t\n\t var _temp, _this, _ret;\n\t\n\t _classCallCheck(this, FormsyForm);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FormsyForm.__proto__ || Object.getPrototypeOf(FormsyForm)).call.apply(_ref, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);\n\t }\n\t\n\t _createClass(FormsyForm, [{\n\t key: 'getChildContext',\n\t value: function getChildContext() {\n\t var _this2 = this;\n\t\n\t return {\n\t formsy: {\n\t attachToForm: this.attachToForm,\n\t detachFromForm: this.detachFromForm,\n\t validate: this.validate,\n\t isFormDisabled: this.isFormDisabled,\n\t isValidValue: function isValidValue(component, value) {\n\t return _this2.runValidation(component, value).isValid;\n\t }\n\t }\n\t };\n\t }\n\t\n\t // Add a map to store the inputs of the form, a model to store\n\t // the values of the form and register child inputs\n\t\n\t }, {\n\t key: 'componentWillMount',\n\t value: function componentWillMount() {\n\t this.inputs = [];\n\t }\n\t }, {\n\t key: 'componentDidMount',\n\t value: function componentDidMount() {\n\t this.validateForm();\n\t }\n\t }, {\n\t key: 'componentWillUpdate',\n\t value: function componentWillUpdate() {\n\t // Keep a reference to input names before form updates,\n\t // to check if inputs has changed after render\n\t this.prevInputNames = this.inputs.map(function (component) {\n\t return component.props.name;\n\t });\n\t }\n\t }, {\n\t key: 'componentDidUpdate',\n\t value: function componentDidUpdate() {\n\t if (this.props.validationErrors && _typeof(this.props.validationErrors) === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n\t this.setInputValidationErrors(this.props.validationErrors);\n\t }\n\t\n\t var newInputNames = this.inputs.map(function (component) {\n\t return component.props.name;\n\t });\n\t if (utils.arraysDiffer(this.prevInputNames, newInputNames)) {\n\t this.validateForm();\n\t }\n\t }\n\t\n\t // Allow resetting to specified data\n\t\n\t\n\t // Update model, submit to url prop and send the model\n\t\n\t\n\t // Reset each key in the model to the original / initial / specified value\n\t\n\t\n\t // Checks if the values have changed from their initial value\n\t\n\t\n\t // Go through errors from server and grab the components\n\t // stored in the inputs map. Change their state to invalid\n\t // and set the serverError message\n\t\n\t\n\t // Use the binded values and the actual input value to\n\t // validate the input and set its state. Then check the\n\t // state of the form itself\n\t\n\t\n\t // Checks validation on current value or a passed value\n\t\n\t\n\t // Validate the form by going through all child input components\n\t // and check their state\n\t\n\t\n\t // Method put on each input component to register\n\t // itself to the form\n\t\n\t\n\t // Method put on each input component to unregister\n\t // itself from the form\n\t\n\t }, {\n\t key: 'render',\n\t value: function render() {\n\t var _props = this.props,\n\t mapping = _props.mapping,\n\t validationErrors = _props.validationErrors,\n\t onSubmit = _props.onSubmit,\n\t onValid = _props.onValid,\n\t onValidSubmit = _props.onValidSubmit,\n\t onInvalid = _props.onInvalid,\n\t onInvalidSubmit = _props.onInvalidSubmit,\n\t onChange = _props.onChange,\n\t reset = _props.reset,\n\t preventExternalInvalidation = _props.preventExternalInvalidation,\n\t onSuccess = _props.onSuccess,\n\t onError = _props.onError,\n\t nonFormsyProps = _objectWithoutProperties(_props, ['mapping', 'validationErrors', 'onSubmit', 'onValid', 'onValidSubmit', 'onInvalid', 'onInvalidSubmit', 'onChange', 'reset', 'preventExternalInvalidation', 'onSuccess', 'onError']);\n\t\n\t return React.createElement(\n\t 'form',\n\t _extends({}, nonFormsyProps, { onSubmit: this.submit }),\n\t this.props.children\n\t );\n\t }\n\t }]);\n\t\n\t return FormsyForm;\n\t}(React.Component), _class.displayName = 'Formsy.Form', _class.defaultProps = {\n\t onSuccess: function onSuccess() {},\n\t onError: function onError() {},\n\t onSubmit: function onSubmit() {},\n\t onValidSubmit: function onValidSubmit() {},\n\t onInvalidSubmit: function onInvalidSubmit() {},\n\t onValid: function onValid() {},\n\t onInvalid: function onInvalid() {},\n\t onChange: function onChange() {},\n\t validationErrors: null,\n\t preventExternalInvalidation: false\n\t}, _class.childContextTypes = {\n\t formsy: PropTypes.object\n\t}, _initialiseProps = function _initialiseProps() {\n\t var _this3 = this,\n\t _arguments = arguments;\n\t\n\t this.state = {\n\t isValid: true,\n\t isSubmitting: false,\n\t canChange: false\n\t };\n\t\n\t this.reset = function (data) {\n\t _this3.setFormPristine(true);\n\t _this3.resetModel(data);\n\t };\n\t\n\t this.submit = function (event) {\n\t event && event.preventDefault();\n\t\n\t // Trigger form as not pristine.\n\t // If any inputs have not been touched yet this will make them dirty\n\t // so validation becomes visible (if based on isPristine)\n\t _this3.setFormPristine(false);\n\t var model = _this3.getModel();\n\t _this3.props.onSubmit(model, _this3.resetModel, _this3.updateInputsWithError);\n\t _this3.state.isValid ? _this3.props.onValidSubmit(model, _this3.resetModel, _this3.updateInputsWithError) : _this3.props.onInvalidSubmit(model, _this3.resetModel, _this3.updateInputsWithError);\n\t };\n\t\n\t this.mapModel = function (model) {\n\t if (_this3.props.mapping) {\n\t return _this3.props.mapping(model);\n\t } else {\n\t return formDataToObject.toObj(Object.keys(model).reduce(function (mappedModel, key) {\n\t\n\t var keyArray = key.split('.');\n\t var base = mappedModel;\n\t while (keyArray.length) {\n\t var currentKey = keyArray.shift();\n\t base = base[currentKey] = keyArray.length ? base[currentKey] || {} : model[key];\n\t }\n\t\n\t return mappedModel;\n\t }, {}));\n\t }\n\t };\n\t\n\t this.getModel = function () {\n\t var currentValues = _this3.getCurrentValues();\n\t return _this3.mapModel(currentValues);\n\t };\n\t\n\t this.resetModel = function (data) {\n\t _this3.inputs.forEach(function (component) {\n\t var name = component.props.name;\n\t if (data && data.hasOwnProperty(name)) {\n\t component.setValue(data[name]);\n\t } else {\n\t component.resetValue();\n\t }\n\t });\n\t _this3.validateForm();\n\t };\n\t\n\t this.setInputValidationErrors = function (errors) {\n\t _this3.inputs.forEach(function (component) {\n\t var name = component.props.name;\n\t var args = [{\n\t _isValid: !(name in errors),\n\t _validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n\t }];\n\t component.setState.apply(component, args);\n\t });\n\t };\n\t\n\t this.isChanged = function () {\n\t return !utils.isSame(_this3.getPristineValues(), _this3.getCurrentValues());\n\t };\n\t\n\t this.getPristineValues = function () {\n\t return _this3.inputs.reduce(function (data, component) {\n\t var name = component.props.name;\n\t data[name] = component.props.value;\n\t return data;\n\t }, {});\n\t };\n\t\n\t this.updateInputsWithError = function (errors) {\n\t Object.keys(errors).forEach(function (name, index) {\n\t var component = utils.find(_this3.inputs, function (component) {\n\t return component.props.name === name;\n\t });\n\t if (!component) {\n\t throw new Error('You are trying to update an input that does not exist. ' + 'Verify errors object with input names. ' + JSON.stringify(errors));\n\t }\n\t var args = [{\n\t _isValid: _this3.props.preventExternalInvalidation || false,\n\t _externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n\t }];\n\t component.setState.apply(component, args);\n\t });\n\t };\n\t\n\t this.isFormDisabled = function () {\n\t return _this3.props.disabled;\n\t };\n\t\n\t this.getCurrentValues = function () {\n\t return _this3.inputs.reduce(function (data, component) {\n\t var name = component.props.name;\n\t data[name] = component.state._value;\n\t return data;\n\t }, {});\n\t };\n\t\n\t this.setFormPristine = function (isPristine) {\n\t _this3.setState({\n\t _formSubmitted: !isPristine\n\t });\n\t\n\t // Iterate through each component and set it as pristine\n\t // or \"dirty\".\n\t _this3.inputs.forEach(function (component, index) {\n\t component.setState({\n\t _formSubmitted: !isPristine,\n\t _isPristine: isPristine\n\t });\n\t });\n\t };\n\t\n\t this.validate = function (component) {\n\t // Trigger onChange\n\t if (_this3.state.canChange) {\n\t _this3.props.onChange(_this3.getCurrentValues(), _this3.isChanged());\n\t }\n\t\n\t var validation = _this3.runValidation(component);\n\t // Run through the validations, split them up and call\n\t // the validator IF there is a value or it is required\n\t component.setState({\n\t _isValid: validation.isValid,\n\t _isRequired: validation.isRequired,\n\t _validationError: validation.error,\n\t _externalError: null\n\t }, _this3.validateForm);\n\t };\n\t\n\t this.runValidation = function (component, value) {\n\t var currentValues = _this3.getCurrentValues();\n\t var validationErrors = component.props.validationErrors;\n\t var validationError = component.props.validationError;\n\t value = _arguments.length === 2 ? value : component.state._value;\n\t\n\t var validationResults = _this3.runRules(value, currentValues, component._validations);\n\t var requiredResults = _this3.runRules(value, currentValues, component._requiredValidations);\n\t\n\t // the component defines an explicit validate function\n\t if (typeof component.validate === \"function\") {\n\t validationResults.failed = component.validate() ? [] : ['failed'];\n\t }\n\t\n\t var isRequired = Object.keys(component._requiredValidations).length ? !!requiredResults.success.length : false;\n\t var isValid = !validationResults.failed.length && !(_this3.props.validationErrors && _this3.props.validationErrors[component.props.name]);\n\t\n\t return {\n\t isRequired: isRequired,\n\t isValid: isRequired ? false : isValid,\n\t error: function () {\n\t\n\t if (isValid && !isRequired) {\n\t return emptyArray;\n\t }\n\t\n\t if (validationResults.errors.length) {\n\t return validationResults.errors;\n\t }\n\t\n\t if (this.props.validationErrors && this.props.validationErrors[component.props.name]) {\n\t return typeof this.props.validationErrors[component.props.name] === 'string' ? [this.props.validationErrors[component.props.name]] : this.props.validationErrors[component.props.name];\n\t }\n\t\n\t if (isRequired) {\n\t var error = validationErrors[requiredResults.success[0]];\n\t return error ? [error] : null;\n\t }\n\t\n\t if (validationResults.failed.length) {\n\t return validationResults.failed.map(function (failed) {\n\t return validationErrors[failed] ? validationErrors[failed] : validationError;\n\t }).filter(function (x, pos, arr) {\n\t // Remove duplicates\n\t return arr.indexOf(x) === pos;\n\t });\n\t }\n\t }.call(_this3)\n\t };\n\t };\n\t\n\t this.runRules = function (value, currentValues, validations) {\n\t var results = {\n\t errors: [],\n\t failed: [],\n\t success: []\n\t };\n\t\n\t if (Object.keys(validations).length) {\n\t Object.keys(validations).forEach(function (validationMethod) {\n\t\n\t if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n\t throw new Error('Formsy does not allow you to override default validations: ' + validationMethod);\n\t }\n\t\n\t if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n\t throw new Error('Formsy does not have the validation rule: ' + validationMethod);\n\t }\n\t\n\t if (typeof validations[validationMethod] === 'function') {\n\t var validation = validations[validationMethod](currentValues, value);\n\t if (typeof validation === 'string') {\n\t results.errors.push(validation);\n\t results.failed.push(validationMethod);\n\t } else if (!validation) {\n\t results.failed.push(validationMethod);\n\t }\n\t return;\n\t } else if (typeof validations[validationMethod] !== 'function') {\n\t var validation = validationRules[validationMethod](currentValues, value, validations[validationMethod]);\n\t if (typeof validation === 'string') {\n\t results.errors.push(validation);\n\t results.failed.push(validationMethod);\n\t } else if (!validation) {\n\t results.failed.push(validationMethod);\n\t } else {\n\t results.success.push(validationMethod);\n\t }\n\t return;\n\t }\n\t\n\t return results.success.push(validationMethod);\n\t });\n\t }\n\t\n\t return results;\n\t };\n\t\n\t this.validateForm = function () {\n\t // We need a callback as we are validating all inputs again. This will\n\t // run when the last component has set its state\n\t var onValidationComplete = function () {\n\t var allIsValid = this.inputs.every(function (component) {\n\t return component.state._isValid;\n\t });\n\t\n\t this.setState({\n\t isValid: allIsValid\n\t });\n\t\n\t if (allIsValid) {\n\t this.props.onValid();\n\t } else {\n\t this.props.onInvalid();\n\t }\n\t\n\t // Tell the form that it can start to trigger change events\n\t this.setState({\n\t canChange: true\n\t });\n\t }.bind(_this3);\n\t\n\t // Run validation again in case affected by other inputs. The\n\t // last component validated will run the onValidationComplete callback\n\t _this3.inputs.forEach(function (component, index) {\n\t var validation = _this3.runValidation(component);\n\t if (validation.isValid && component.state._externalError) {\n\t validation.isValid = false;\n\t }\n\t component.setState({\n\t _isValid: validation.isValid,\n\t _isRequired: validation.isRequired,\n\t _validationError: validation.error,\n\t _externalError: !validation.isValid && component.state._externalError ? component.state._externalError : null\n\t }, index === _this3.inputs.length - 1 ? onValidationComplete : null);\n\t });\n\t\n\t // If there are no inputs, set state where form is ready to trigger\n\t // change event. New inputs might be added later\n\t if (!_this3.inputs.length) {\n\t _this3.setState({\n\t canChange: true\n\t });\n\t }\n\t };\n\t\n\t this.attachToForm = function (component) {\n\t if (_this3.inputs.indexOf(component) === -1) {\n\t _this3.inputs.push(component);\n\t }\n\t\n\t _this3.validate(component);\n\t };\n\t\n\t this.detachFromForm = function (component) {\n\t var componentPos = _this3.inputs.indexOf(component);\n\t\n\t if (componentPos !== -1) {\n\t _this3.inputs = _this3.inputs.slice(0, componentPos).concat(_this3.inputs.slice(componentPos + 1));\n\t }\n\t\n\t _this3.validateForm();\n\t };\n\t}, _temp2);\n\t\n\tif (!global.exports && !global.module && (!global.define || !global.define.amd)) {\n\t global.Formsy = Formsy;\n\t}\n\t\n\tmodule.exports = Formsy;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\t\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things. But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals. It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\t\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\t\n\tfunction defaultSetTimout() {\n\t throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t try {\n\t if (typeof setTimeout === 'function') {\n\t cachedSetTimeout = setTimeout;\n\t } else {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t } catch (e) {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t try {\n\t if (typeof clearTimeout === 'function') {\n\t cachedClearTimeout = clearTimeout;\n\t } else {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t } catch (e) {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t} ())\n\tfunction runTimeout(fun) {\n\t if (cachedSetTimeout === setTimeout) {\n\t //normal enviroments in sane situations\n\t return setTimeout(fun, 0);\n\t }\n\t // if setTimeout wasn't available but was latter defined\n\t if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t cachedSetTimeout = setTimeout;\n\t return setTimeout(fun, 0);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedSetTimeout(fun, 0);\n\t } catch(e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedSetTimeout.call(null, fun, 0);\n\t } catch(e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t return cachedSetTimeout.call(this, fun, 0);\n\t }\n\t }\n\t\n\t\n\t}\n\tfunction runClearTimeout(marker) {\n\t if (cachedClearTimeout === clearTimeout) {\n\t //normal enviroments in sane situations\n\t return clearTimeout(marker);\n\t }\n\t // if clearTimeout wasn't available but was latter defined\n\t if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t cachedClearTimeout = clearTimeout;\n\t return clearTimeout(marker);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedClearTimeout(marker);\n\t } catch (e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedClearTimeout.call(null, marker);\n\t } catch (e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t return cachedClearTimeout.call(this, marker);\n\t }\n\t }\n\t\n\t\n\t\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t if (!draining || !currentQueue) {\n\t return;\n\t }\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\t\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = runTimeout(cleanUpNextTick);\n\t draining = true;\n\t\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t runClearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t runTimeout(drainQueue);\n\t }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\tprocess.prependListener = noop;\n\tprocess.prependOnceListener = noop;\n\t\n\tprocess.listeners = function (name) { return [] }\n\t\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\t/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t * \n\t */\n\t\n\tfunction makeEmptyFunction(arg) {\n\t return function () {\n\t return arg;\n\t };\n\t}\n\t\n\t/**\n\t * This function accepts and discards inputs; it has no side effects. This is\n\t * primarily useful idiomatically for overridable function endpoints which\n\t * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n\t */\n\tvar emptyFunction = function emptyFunction() {};\n\t\n\temptyFunction.thatReturns = makeEmptyFunction;\n\temptyFunction.thatReturnsFalse = makeEmptyFunction(false);\n\temptyFunction.thatReturnsTrue = makeEmptyFunction(true);\n\temptyFunction.thatReturnsNull = makeEmptyFunction(null);\n\temptyFunction.thatReturnsThis = function () {\n\t return this;\n\t};\n\temptyFunction.thatReturnsArgument = function (arg) {\n\t return arg;\n\t};\n\t\n\tmodule.exports = emptyFunction;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t */\n\t\n\t'use strict';\n\t\n\t/**\n\t * Use invariant() to assert state which your program assumes to be true.\n\t *\n\t * Provide sprintf-style format (only %s is supported) and arguments\n\t * to provide information about what broke and what you were\n\t * expecting.\n\t *\n\t * The invariant message will be stripped in production, but the invariant\n\t * will remain to ensure logic does not differ in production.\n\t */\n\t\n\tvar validateFormat = function validateFormat(format) {};\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t validateFormat = function validateFormat(format) {\n\t if (format === undefined) {\n\t throw new Error('invariant requires an error message argument');\n\t }\n\t };\n\t}\n\t\n\tfunction invariant(condition, format, a, b, c, d, e, f) {\n\t validateFormat(format);\n\t\n\t if (!condition) {\n\t var error;\n\t if (format === undefined) {\n\t error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n\t } else {\n\t var args = [a, b, c, d, e, f];\n\t var argIndex = 0;\n\t error = new Error(format.replace(/%s/g, function () {\n\t return args[argIndex++];\n\t }));\n\t error.name = 'Invariant Violation';\n\t }\n\t\n\t error.framesToPop = 1; // we don't care about invariant's own frame\n\t throw error;\n\t }\n\t}\n\t\n\tmodule.exports = invariant;\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\t\n\tmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tmodule.exports = {\n\t arraysDiffer: function arraysDiffer(a, b) {\n\t var isDifferent = false;\n\t if (a.length !== b.length) {\n\t isDifferent = true;\n\t } else {\n\t a.forEach(function (item, index) {\n\t if (!this.isSame(item, b[index])) {\n\t isDifferent = true;\n\t }\n\t }, this);\n\t }\n\t return isDifferent;\n\t },\n\t\n\t objectsDiffer: function objectsDiffer(a, b) {\n\t var isDifferent = false;\n\t if (Object.keys(a).length !== Object.keys(b).length) {\n\t isDifferent = true;\n\t } else {\n\t Object.keys(a).forEach(function (key) {\n\t if (!this.isSame(a[key], b[key])) {\n\t isDifferent = true;\n\t }\n\t }, this);\n\t }\n\t return isDifferent;\n\t },\n\t\n\t isSame: function isSame(a, b) {\n\t if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== (typeof b === 'undefined' ? 'undefined' : _typeof(b))) {\n\t return false;\n\t } else if (Array.isArray(a) && Array.isArray(b)) {\n\t return !this.arraysDiffer(a, b);\n\t } else if (typeof a === 'function') {\n\t return a.toString() === b.toString();\n\t } else if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' && a !== null && b !== null) {\n\t return !this.objectsDiffer(a, b);\n\t }\n\t\n\t return a === b;\n\t },\n\t\n\t find: function find(collection, fn) {\n\t for (var i = 0, l = collection.length; i < l; i++) {\n\t var item = collection[i];\n\t if (fn(item)) {\n\t return item;\n\t }\n\t }\n\t return null;\n\t }\n\t};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2014-2015, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t */\n\t\n\t'use strict';\n\t\n\tvar emptyFunction = __webpack_require__(2);\n\t\n\t/**\n\t * Similar to invariant but only logs a warning if the condition is not met.\n\t * This can be used to log issues in development environments in critical\n\t * paths. Removing the logging code for production environments will keep the\n\t * same logic and follow the same code paths.\n\t */\n\t\n\tvar warning = emptyFunction;\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t var printWarning = function printWarning(format) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t var argIndex = 0;\n\t var message = 'Warning: ' + format.replace(/%s/g, function () {\n\t return args[argIndex++];\n\t });\n\t if (typeof console !== 'undefined') {\n\t console.error(message);\n\t }\n\t try {\n\t // --- Welcome to debugging React ---\n\t // This error was thrown as a convenience so that you can use this stack\n\t // to find the callsite that caused this warning to fire.\n\t throw new Error(message);\n\t } catch (x) {}\n\t };\n\t\n\t warning = function warning(condition, format) {\n\t if (format === undefined) {\n\t throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n\t }\n\t\n\t if (format.indexOf('Failed Composite propType: ') === 0) {\n\t return; // Ignore CompositeComponent proptype check.\n\t }\n\t\n\t if (!condition) {\n\t for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n\t args[_key2 - 2] = arguments[_key2];\n\t }\n\t\n\t printWarning.apply(undefined, [format].concat(args));\n\t }\n\t };\n\t}\n\t\n\tmodule.exports = warning;\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n\t Symbol.for &&\n\t Symbol.for('react.element')) ||\n\t 0xeac7;\n\t\n\t var isValidElement = function(object) {\n\t return typeof object === 'object' &&\n\t object !== null &&\n\t object.$$typeof === REACT_ELEMENT_TYPE;\n\t };\n\t\n\t // By explicitly using `prop-types` you are opting into new development behavior.\n\t // http://fb.me/prop-types-in-prod\n\t var throwOnDirectAccess = true;\n\t module.exports = __webpack_require__(15)(isValidElement, throwOnDirectAccess);\n\t} else {\n\t // By explicitly using `prop-types` you are opting into new production behavior.\n\t // http://fb.me/prop-types-in-prod\n\t module.exports = __webpack_require__(14)();\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_8__;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar React = global.React || __webpack_require__(8);\n\tvar PropTypes = __webpack_require__(7);\n\tvar hoistNonReactStatic = __webpack_require__(12);\n\tvar utils = __webpack_require__(5);\n\t\n\tvar convertValidationsToObject = function convertValidationsToObject(validations) {\n\t if (typeof validations === 'string') {\n\t return validations.split(/\\,(?![^{\\[]*[}\\]])/g).reduce(function (validations, validation) {\n\t var args = validation.split(':');\n\t var validateMethod = args.shift();\n\t\n\t args = args.map(function (arg) {\n\t try {\n\t return JSON.parse(arg);\n\t } catch (e) {\n\t return arg; // It is a string if it can not parse it\n\t }\n\t });\n\t\n\t if (args.length > 1) {\n\t throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n\t }\n\t\n\t validations[validateMethod] = args.length ? args[0] : true;\n\t return validations;\n\t }, {});\n\t }\n\t\n\t return validations || {};\n\t};\n\t\n\tmodule.exports = function (Component) {\n\t var WrappedComponent = function (_React$Component) {\n\t _inherits(WrappedComponent, _React$Component);\n\t\n\t function WrappedComponent() {\n\t var _ref;\n\t\n\t var _temp, _this, _ret;\n\t\n\t _classCallCheck(this, WrappedComponent);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = WrappedComponent.__proto__ || Object.getPrototypeOf(WrappedComponent)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n\t _value: _this.props.value,\n\t _isRequired: false,\n\t _isValid: true,\n\t _isPristine: true,\n\t _pristineValue: _this.props.value,\n\t _validationError: [],\n\t _externalError: null,\n\t _formSubmitted: false\n\t }, _this.setValidations = function (validations, required) {\n\t // Add validations to the store itself as the props object can not be modified\n\t _this._validations = convertValidationsToObject(validations) || {};\n\t _this._requiredValidations = required === true ? { isDefaultRequiredValue: true } : convertValidationsToObject(required);\n\t }, _this.setValue = function (value) {\n\t _this.setState({\n\t _value: value,\n\t _isPristine: false\n\t }, function () {\n\t _this.context.formsy.validate(_this);\n\t //this.props._validate(this);\n\t });\n\t }, _this.resetValue = function () {\n\t _this.setState({\n\t _value: _this.state._pristineValue,\n\t _isPristine: true\n\t }, function () {\n\t this.context.formsy.validate(this);\n\t //this.props._validate(this);\n\t });\n\t }, _this.getValue = function () {\n\t return _this.state._value;\n\t }, _this.hasValue = function () {\n\t return _this.state._value !== '';\n\t }, _this.getErrorMessage = function () {\n\t var messages = _this.getErrorMessages();\n\t return messages.length ? messages[0] : null;\n\t }, _this.getErrorMessages = function () {\n\t return !_this.isValid() || _this.showRequired() ? _this.state._externalError || _this.state._validationError || [] : [];\n\t }, _this.isFormDisabled = function () {\n\t return _this.context.formsy.isFormDisabled();\n\t //return this.props._isFormDisabled();\n\t }, _this.isValid = function () {\n\t return _this.state._isValid;\n\t }, _this.isPristine = function () {\n\t return _this.state._isPristine;\n\t }, _this.isFormSubmitted = function () {\n\t return _this.state._formSubmitted;\n\t }, _this.isRequired = function () {\n\t return !!_this.props.required;\n\t }, _this.showRequired = function () {\n\t return _this.state._isRequired;\n\t }, _this.showError = function () {\n\t return !_this.showRequired() && !_this.isValid();\n\t }, _this.isValidValue = function (value) {\n\t return _this.context.formsy.isValidValue.call(null, _this, value);\n\t //return this.props._isValidValue.call(null, this, value);\n\t }, _temp), _possibleConstructorReturn(_this, _ret);\n\t }\n\t\n\t _createClass(WrappedComponent, [{\n\t key: 'componentWillMount',\n\t value: function componentWillMount() {\n\t var _this2 = this;\n\t\n\t var configure = function configure() {\n\t _this2.setValidations(_this2.props.validations, _this2.props.required);\n\t\n\t // Pass a function instead?\n\t _this2.context.formsy.attachToForm(_this2);\n\t //this.props._attachToForm(this);\n\t };\n\t\n\t if (!this.props.name) {\n\t throw new Error('Form Input requires a name property when used');\n\t }\n\t\n\t configure();\n\t }\n\t\n\t // We have to make the validate method is kept when new props are added\n\t\n\t }, {\n\t key: 'componentWillReceiveProps',\n\t value: function componentWillReceiveProps(nextProps) {\n\t this.setValidations(nextProps.validations, nextProps.required);\n\t }\n\t }, {\n\t key: 'componentDidUpdate',\n\t value: function componentDidUpdate(prevProps) {\n\t // If the value passed has changed, set it. If value is not passed it will\n\t // internally update, and this will never run\n\t if (!utils.isSame(this.props.value, prevProps.value)) {\n\t this.setValue(this.props.value);\n\t }\n\t\n\t // If validations or required is changed, run a new validation\n\t if (!utils.isSame(this.props.validations, prevProps.validations) || !utils.isSame(this.props.required, prevProps.required)) {\n\t this.context.formsy.validate(this);\n\t }\n\t }\n\t\n\t // Detach it when component unmounts\n\t\n\t }, {\n\t key: 'componentWillUnmount',\n\t value: function componentWillUnmount() {\n\t this.context.formsy.detachFromForm(this);\n\t //this.props._detachFromForm(this);\n\t }\n\t\n\t // We validate after the value has been set\n\t\n\t }, {\n\t key: 'render',\n\t value: function render() {\n\t var innerRef = this.props.innerRef;\n\t\n\t var propsForElement = _extends({\n\t setValidations: this.setValidations,\n\t setValue: this.setValue,\n\t resetValue: this.resetValue,\n\t getValue: this.getValue,\n\t hasValue: this.hasValue,\n\t getErrorMessage: this.getErrorMessage,\n\t getErrorMessages: this.getErrorMessages,\n\t isFormDisabled: this.isFormDisabled,\n\t isValid: this.isValid,\n\t isPristine: this.isPristine,\n\t isFormSubmitted: this.isFormSubmitted,\n\t isRequired: this.isRequired,\n\t showRequired: this.showRequired,\n\t showError: this.showError,\n\t isValidValue: this.isValidValue\n\t }, this.props);\n\t\n\t if (innerRef) {\n\t propsForElement.ref = innerRef;\n\t }\n\t\n\t return React.createElement(Component, propsForElement);\n\t }\n\t }]);\n\t\n\t return WrappedComponent;\n\t }(React.Component);\n\t\n\t WrappedComponent.displayName = 'Formsy(' + getDisplayName(Component) + ')';\n\t WrappedComponent.contextTypes = {\n\t formsy: PropTypes.object // What about required?\n\t };\n\t WrappedComponent.defaultProps = {\n\t validationError: '',\n\t validationErrors: {}\n\t };\n\t\n\t return hoistNonReactStatic(WrappedComponent, Component);\n\t};\n\t\n\tfunction getDisplayName(Component) {\n\t return Component.displayName || Component.name || (typeof Component === 'string' ? Component : 'Component');\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar _isExisty = function _isExisty(value) {\n\t return value !== null && value !== undefined;\n\t};\n\t\n\tvar isEmpty = function isEmpty(value) {\n\t return value === '';\n\t};\n\t\n\tvar validations = {\n\t isDefaultRequiredValue: function isDefaultRequiredValue(values, value) {\n\t return value === undefined || value === '';\n\t },\n\t isExisty: function isExisty(values, value) {\n\t return _isExisty(value);\n\t },\n\t matchRegexp: function matchRegexp(values, value, regexp) {\n\t return !_isExisty(value) || isEmpty(value) || regexp.test(value);\n\t },\n\t isUndefined: function isUndefined(values, value) {\n\t return value === undefined;\n\t },\n\t isEmptyString: function isEmptyString(values, value) {\n\t return isEmpty(value);\n\t },\n\t isEmail: function isEmail(values, value) {\n\t return validations.matchRegexp(values, value, /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i);\n\t },\n\t isUrl: function isUrl(values, value) {\n\t return validations.matchRegexp(values, value, /^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i);\n\t },\n\t isTrue: function isTrue(values, value) {\n\t return value === true;\n\t },\n\t isFalse: function isFalse(values, value) {\n\t return value === false;\n\t },\n\t isNumeric: function isNumeric(values, value) {\n\t if (typeof value === 'number') {\n\t return true;\n\t }\n\t return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n\t },\n\t isAlpha: function isAlpha(values, value) {\n\t return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n\t },\n\t isAlphanumeric: function isAlphanumeric(values, value) {\n\t return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n\t },\n\t isInt: function isInt(values, value) {\n\t return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n\t },\n\t isFloat: function isFloat(values, value) {\n\t return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][\\+\\-]?(?:\\d+))?$/);\n\t },\n\t isWords: function isWords(values, value) {\n\t return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n\t },\n\t isSpecialWords: function isSpecialWords(values, value) {\n\t return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n\t },\n\t isLength: function isLength(values, value, length) {\n\t return !_isExisty(value) || isEmpty(value) || value.length === length;\n\t },\n\t equals: function equals(values, value, eql) {\n\t return !_isExisty(value) || isEmpty(value) || value == eql;\n\t },\n\t equalsField: function equalsField(values, value, field) {\n\t return value == values[field];\n\t },\n\t maxLength: function maxLength(values, value, length) {\n\t return !_isExisty(value) || value.length <= length;\n\t },\n\t minLength: function minLength(values, value, length) {\n\t return !_isExisty(value) || isEmpty(value) || value.length >= length;\n\t }\n\t};\n\t\n\tmodule.exports = validations;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\tfunction toObj(source) {\n\t return Object.keys(source).reduce(function (output, key) {\n\t var parentKey = key.match(/[^\\[]*/i);\n\t var paths = key.match(/\\[.*?\\]/g) || [];\n\t paths = [parentKey[0]].concat(paths).map(function (key) {\n\t return key.replace(/\\[|\\]/g, '');\n\t });\n\t var currentPath = output;\n\t while (paths.length) {\n\t var pathKey = paths.shift();\n\t\n\t if (pathKey in currentPath) {\n\t currentPath = currentPath[pathKey];\n\t } else {\n\t currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n\t currentPath = currentPath[pathKey];\n\t }\n\t }\n\t\n\t return output;\n\t }, {});\n\t}\n\t\n\tfunction fromObj(obj) {\n\t function recur(newObj, propName, currVal) {\n\t if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n\t Object.keys(currVal).forEach(function(v) {\n\t recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n\t });\n\t return newObj;\n\t }\n\t\n\t newObj[propName] = currVal;\n\t return newObj;\n\t }\n\t\n\t var keys = Object.keys(obj);\n\t return keys.reduce(function(newObj, propName) {\n\t return recur(newObj, propName, obj[propName]);\n\t }, {});\n\t}\n\t\n\tmodule.exports = {\n\t fromObj: fromObj,\n\t toObj: toObj\n\t}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Copyright 2015, Yahoo! Inc.\n\t * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n\t */\n\t'use strict';\n\t\n\tvar REACT_STATICS = {\n\t childContextTypes: true,\n\t contextTypes: true,\n\t defaultProps: true,\n\t displayName: true,\n\t getDefaultProps: true,\n\t mixins: true,\n\t propTypes: true,\n\t type: true\n\t};\n\t\n\tvar KNOWN_STATICS = {\n\t name: true,\n\t length: true,\n\t prototype: true,\n\t caller: true,\n\t callee: true,\n\t arguments: true,\n\t arity: true\n\t};\n\t\n\tvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\n\tvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\tvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar getPrototypeOf = Object.getPrototypeOf;\n\tvar objectPrototype = getPrototypeOf && getPrototypeOf(Object);\n\tvar getOwnPropertyNames = Object.getOwnPropertyNames;\n\t\n\tmodule.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n\t if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n\t\n\t if (objectPrototype) {\n\t var inheritedComponent = getPrototypeOf(sourceComponent);\n\t if (inheritedComponent && inheritedComponent !== objectPrototype) {\n\t hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n\t }\n\t }\n\t\n\t var keys = getOwnPropertyNames(sourceComponent);\n\t\n\t if (getOwnPropertySymbols) {\n\t keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n\t }\n\t\n\t for (var i = 0; i < keys.length; ++i) {\n\t var key = keys[i];\n\t if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n\t // Only hoist enumerables and non-enumerable functions\n\t if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') {\n\t try { // Avoid failures from read-only properties\n\t targetComponent[key] = sourceComponent[key];\n\t } catch (e) {}\n\t }\n\t }\n\t }\n\t\n\t return targetComponent;\n\t }\n\t\n\t return targetComponent;\n\t};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t var invariant = __webpack_require__(3);\n\t var warning = __webpack_require__(6);\n\t var ReactPropTypesSecret = __webpack_require__(4);\n\t var loggedTypeFailures = {};\n\t}\n\t\n\t/**\n\t * Assert that the values match with the type specs.\n\t * Error messages are memorized and will only be shown once.\n\t *\n\t * @param {object} typeSpecs Map of name to a ReactPropType\n\t * @param {object} values Runtime values that need to be type-checked\n\t * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n\t * @param {string} componentName Name of the component for error messages.\n\t * @param {?Function} getStack Returns the component stack.\n\t * @private\n\t */\n\tfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n\t if (process.env.NODE_ENV !== 'production') {\n\t for (var typeSpecName in typeSpecs) {\n\t if (typeSpecs.hasOwnProperty(typeSpecName)) {\n\t var error;\n\t // Prop type validation may throw. In case they do, we don't want to\n\t // fail the render phase where it didn't fail before. So we log it.\n\t // After these have been cleaned up, we'll let them throw.\n\t try {\n\t // This is intentionally an invariant that gets caught. It's the same\n\t // behavior as without this statement except with a better message.\n\t invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n\t error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n\t } catch (ex) {\n\t error = ex;\n\t }\n\t warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n\t if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n\t // Only monitor this failure once because there tends to be a lot of the\n\t // same error.\n\t loggedTypeFailures[error.message] = true;\n\t\n\t var stack = getStack ? getStack() : '';\n\t\n\t warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n\t }\n\t }\n\t }\n\t }\n\t}\n\t\n\tmodule.exports = checkPropTypes;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tvar emptyFunction = __webpack_require__(2);\n\tvar invariant = __webpack_require__(3);\n\tvar ReactPropTypesSecret = __webpack_require__(4);\n\t\n\tmodule.exports = function() {\n\t function shim(props, propName, componentName, location, propFullName, secret) {\n\t if (secret === ReactPropTypesSecret) {\n\t // It is still safe when called from React.\n\t return;\n\t }\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t };\n\t shim.isRequired = shim;\n\t function getShim() {\n\t return shim;\n\t };\n\t // Important!\n\t // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\t var ReactPropTypes = {\n\t array: shim,\n\t bool: shim,\n\t func: shim,\n\t number: shim,\n\t object: shim,\n\t string: shim,\n\t symbol: shim,\n\t\n\t any: shim,\n\t arrayOf: getShim,\n\t element: shim,\n\t instanceOf: getShim,\n\t node: shim,\n\t objectOf: getShim,\n\t oneOf: getShim,\n\t oneOfType: getShim,\n\t shape: getShim\n\t };\n\t\n\t ReactPropTypes.checkPropTypes = emptyFunction;\n\t ReactPropTypes.PropTypes = ReactPropTypes;\n\t\n\t return ReactPropTypes;\n\t};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tvar emptyFunction = __webpack_require__(2);\n\tvar invariant = __webpack_require__(3);\n\tvar warning = __webpack_require__(6);\n\t\n\tvar ReactPropTypesSecret = __webpack_require__(4);\n\tvar checkPropTypes = __webpack_require__(13);\n\t\n\tmodule.exports = function(isValidElement, throwOnDirectAccess) {\n\t /* global Symbol */\n\t var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n\t var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\t\n\t /**\n\t * Returns the iterator method function contained on the iterable object.\n\t *\n\t * Be sure to invoke the function with the iterable as context:\n\t *\n\t * var iteratorFn = getIteratorFn(myIterable);\n\t * if (iteratorFn) {\n\t * var iterator = iteratorFn.call(myIterable);\n\t * ...\n\t * }\n\t *\n\t * @param {?object} maybeIterable\n\t * @return {?function}\n\t */\n\t function getIteratorFn(maybeIterable) {\n\t var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n\t if (typeof iteratorFn === 'function') {\n\t return iteratorFn;\n\t }\n\t }\n\t\n\t /**\n\t * Collection of methods that allow declaration and validation of props that are\n\t * supplied to React components. Example usage:\n\t *\n\t * var Props = require('ReactPropTypes');\n\t * var MyArticle = React.createClass({\n\t * propTypes: {\n\t * // An optional string prop named \"description\".\n\t * description: Props.string,\n\t *\n\t * // A required enum prop named \"category\".\n\t * category: Props.oneOf(['News','Photos']).isRequired,\n\t *\n\t * // A prop named \"dialog\" that requires an instance of Dialog.\n\t * dialog: Props.instanceOf(Dialog).isRequired\n\t * },\n\t * render: function() { ... }\n\t * });\n\t *\n\t * A more formal specification of how these methods are used:\n\t *\n\t * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n\t * decl := ReactPropTypes.{type}(.isRequired)?\n\t *\n\t * Each and every declaration produces a function with the same signature. This\n\t * allows the creation of custom validation functions. For example:\n\t *\n\t * var MyLink = React.createClass({\n\t * propTypes: {\n\t * // An optional string or URI prop named \"href\".\n\t * href: function(props, propName, componentName) {\n\t * var propValue = props[propName];\n\t * if (propValue != null && typeof propValue !== 'string' &&\n\t * !(propValue instanceof URI)) {\n\t * return new Error(\n\t * 'Expected a string or an URI for ' + propName + ' in ' +\n\t * componentName\n\t * );\n\t * }\n\t * }\n\t * },\n\t * render: function() {...}\n\t * });\n\t *\n\t * @internal\n\t */\n\t\n\t var ANONYMOUS = '<>';\n\t\n\t // Important!\n\t // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n\t var ReactPropTypes = {\n\t array: createPrimitiveTypeChecker('array'),\n\t bool: createPrimitiveTypeChecker('boolean'),\n\t func: createPrimitiveTypeChecker('function'),\n\t number: createPrimitiveTypeChecker('number'),\n\t object: createPrimitiveTypeChecker('object'),\n\t string: createPrimitiveTypeChecker('string'),\n\t symbol: createPrimitiveTypeChecker('symbol'),\n\t\n\t any: createAnyTypeChecker(),\n\t arrayOf: createArrayOfTypeChecker,\n\t element: createElementTypeChecker(),\n\t instanceOf: createInstanceTypeChecker,\n\t node: createNodeChecker(),\n\t objectOf: createObjectOfTypeChecker,\n\t oneOf: createEnumTypeChecker,\n\t oneOfType: createUnionTypeChecker,\n\t shape: createShapeTypeChecker\n\t };\n\t\n\t /**\n\t * inlined Object.is polyfill to avoid requiring consumers ship their own\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n\t */\n\t /*eslint-disable no-self-compare*/\n\t function is(x, y) {\n\t // SameValue algorithm\n\t if (x === y) {\n\t // Steps 1-5, 7-10\n\t // Steps 6.b-6.e: +0 != -0\n\t return x !== 0 || 1 / x === 1 / y;\n\t } else {\n\t // Step 6.a: NaN == NaN\n\t return x !== x && y !== y;\n\t }\n\t }\n\t /*eslint-enable no-self-compare*/\n\t\n\t /**\n\t * We use an Error-like object for backward compatibility as people may call\n\t * PropTypes directly and inspect their output. However, we don't use real\n\t * Errors anymore. We don't inspect their stack anyway, and creating them\n\t * is prohibitively expensive if they are created too often, such as what\n\t * happens in oneOfType() for any type before the one that matched.\n\t */\n\t function PropTypeError(message) {\n\t this.message = message;\n\t this.stack = '';\n\t }\n\t // Make `instanceof Error` still work for returned errors.\n\t PropTypeError.prototype = Error.prototype;\n\t\n\t function createChainableTypeChecker(validate) {\n\t if (process.env.NODE_ENV !== 'production') {\n\t var manualPropTypeCallCache = {};\n\t var manualPropTypeWarningCount = 0;\n\t }\n\t function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n\t componentName = componentName || ANONYMOUS;\n\t propFullName = propFullName || propName;\n\t\n\t if (secret !== ReactPropTypesSecret) {\n\t if (throwOnDirectAccess) {\n\t // New behavior only for users of `prop-types` package\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use `PropTypes.checkPropTypes()` to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n\t // Old behavior for people using React.PropTypes\n\t var cacheKey = componentName + ':' + propName;\n\t if (\n\t !manualPropTypeCallCache[cacheKey] &&\n\t // Avoid spamming the console because they are often not actionable except for lib authors\n\t manualPropTypeWarningCount < 3\n\t ) {\n\t warning(\n\t false,\n\t 'You are manually calling a React.PropTypes validation ' +\n\t 'function for the `%s` prop on `%s`. This is deprecated ' +\n\t 'and will throw in the standalone `prop-types` package. ' +\n\t 'You may be seeing this warning due to a third-party PropTypes ' +\n\t 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n\t propFullName,\n\t componentName\n\t );\n\t manualPropTypeCallCache[cacheKey] = true;\n\t manualPropTypeWarningCount++;\n\t }\n\t }\n\t }\n\t if (props[propName] == null) {\n\t if (isRequired) {\n\t if (props[propName] === null) {\n\t return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n\t }\n\t return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n\t }\n\t return null;\n\t } else {\n\t return validate(props, propName, componentName, location, propFullName);\n\t }\n\t }\n\t\n\t var chainedCheckType = checkType.bind(null, false);\n\t chainedCheckType.isRequired = checkType.bind(null, true);\n\t\n\t return chainedCheckType;\n\t }\n\t\n\t function createPrimitiveTypeChecker(expectedType) {\n\t function validate(props, propName, componentName, location, propFullName, secret) {\n\t var propValue = props[propName];\n\t var propType = getPropType(propValue);\n\t if (propType !== expectedType) {\n\t // `propValue` being instance of, say, date/regexp, pass the 'object'\n\t // check, but we can offer a more precise error message here rather than\n\t // 'of type `object`'.\n\t var preciseType = getPreciseType(propValue);\n\t\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createAnyTypeChecker() {\n\t return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n\t }\n\t\n\t function createArrayOfTypeChecker(typeChecker) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (typeof typeChecker !== 'function') {\n\t return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n\t }\n\t var propValue = props[propName];\n\t if (!Array.isArray(propValue)) {\n\t var propType = getPropType(propValue);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n\t }\n\t for (var i = 0; i < propValue.length; i++) {\n\t var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n\t if (error instanceof Error) {\n\t return error;\n\t }\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createElementTypeChecker() {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t var propValue = props[propName];\n\t if (!isValidElement(propValue)) {\n\t var propType = getPropType(propValue);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createInstanceTypeChecker(expectedClass) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (!(props[propName] instanceof expectedClass)) {\n\t var expectedClassName = expectedClass.name || ANONYMOUS;\n\t var actualClassName = getClassName(props[propName]);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createEnumTypeChecker(expectedValues) {\n\t if (!Array.isArray(expectedValues)) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n\t return emptyFunction.thatReturnsNull;\n\t }\n\t\n\t function validate(props, propName, componentName, location, propFullName) {\n\t var propValue = props[propName];\n\t for (var i = 0; i < expectedValues.length; i++) {\n\t if (is(propValue, expectedValues[i])) {\n\t return null;\n\t }\n\t }\n\t\n\t var valuesString = JSON.stringify(expectedValues);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createObjectOfTypeChecker(typeChecker) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (typeof typeChecker !== 'function') {\n\t return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n\t }\n\t var propValue = props[propName];\n\t var propType = getPropType(propValue);\n\t if (propType !== 'object') {\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n\t }\n\t for (var key in propValue) {\n\t if (propValue.hasOwnProperty(key)) {\n\t var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\t if (error instanceof Error) {\n\t return error;\n\t }\n\t }\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createUnionTypeChecker(arrayOfTypeCheckers) {\n\t if (!Array.isArray(arrayOfTypeCheckers)) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n\t return emptyFunction.thatReturnsNull;\n\t }\n\t\n\t for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n\t var checker = arrayOfTypeCheckers[i];\n\t if (typeof checker !== 'function') {\n\t warning(\n\t false,\n\t 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +\n\t 'received %s at index %s.',\n\t getPostfixForTypeWarning(checker),\n\t i\n\t );\n\t return emptyFunction.thatReturnsNull;\n\t }\n\t }\n\t\n\t function validate(props, propName, componentName, location, propFullName) {\n\t for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n\t var checker = arrayOfTypeCheckers[i];\n\t if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n\t return null;\n\t }\n\t }\n\t\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createNodeChecker() {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (!isNode(props[propName])) {\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createShapeTypeChecker(shapeTypes) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t var propValue = props[propName];\n\t var propType = getPropType(propValue);\n\t if (propType !== 'object') {\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n\t }\n\t for (var key in shapeTypes) {\n\t var checker = shapeTypes[key];\n\t if (!checker) {\n\t continue;\n\t }\n\t var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\t if (error) {\n\t return error;\n\t }\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function isNode(propValue) {\n\t switch (typeof propValue) {\n\t case 'number':\n\t case 'string':\n\t case 'undefined':\n\t return true;\n\t case 'boolean':\n\t return !propValue;\n\t case 'object':\n\t if (Array.isArray(propValue)) {\n\t return propValue.every(isNode);\n\t }\n\t if (propValue === null || isValidElement(propValue)) {\n\t return true;\n\t }\n\t\n\t var iteratorFn = getIteratorFn(propValue);\n\t if (iteratorFn) {\n\t var iterator = iteratorFn.call(propValue);\n\t var step;\n\t if (iteratorFn !== propValue.entries) {\n\t while (!(step = iterator.next()).done) {\n\t if (!isNode(step.value)) {\n\t return false;\n\t }\n\t }\n\t } else {\n\t // Iterator will provide entry [k,v] tuples rather than values.\n\t while (!(step = iterator.next()).done) {\n\t var entry = step.value;\n\t if (entry) {\n\t if (!isNode(entry[1])) {\n\t return false;\n\t }\n\t }\n\t }\n\t }\n\t } else {\n\t return false;\n\t }\n\t\n\t return true;\n\t default:\n\t return false;\n\t }\n\t }\n\t\n\t function isSymbol(propType, propValue) {\n\t // Native Symbol.\n\t if (propType === 'symbol') {\n\t return true;\n\t }\n\t\n\t // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n\t if (propValue['@@toStringTag'] === 'Symbol') {\n\t return true;\n\t }\n\t\n\t // Fallback for non-spec compliant Symbols which are polyfilled.\n\t if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n\t return true;\n\t }\n\t\n\t return false;\n\t }\n\t\n\t // Equivalent of `typeof` but with special handling for array and regexp.\n\t function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }\n\t\n\t // This handles more types than `getPropType`. Only used for error messages.\n\t // See `createPrimitiveTypeChecker`.\n\t function getPreciseType(propValue) {\n\t if (typeof propValue === 'undefined' || propValue === null) {\n\t return '' + propValue;\n\t }\n\t var propType = getPropType(propValue);\n\t if (propType === 'object') {\n\t if (propValue instanceof Date) {\n\t return 'date';\n\t } else if (propValue instanceof RegExp) {\n\t return 'regexp';\n\t }\n\t }\n\t return propType;\n\t }\n\t\n\t // Returns a string that is postfixed to a warning about an invalid type.\n\t // For example, \"undefined\" or \"of type array\"\n\t function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }\n\t\n\t // Returns class name of the object, if any.\n\t function getClassName(propValue) {\n\t if (!propValue.constructor || !propValue.constructor.name) {\n\t return ANONYMOUS;\n\t }\n\t return propValue.constructor.name;\n\t }\n\t\n\t ReactPropTypes.checkPropTypes = checkPropTypes;\n\t ReactPropTypes.PropTypes = ReactPropTypes;\n\t\n\t return ReactPropTypes;\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// formsy-react.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 427fec64593afa2e7522","var PropTypes = require('prop-types');\nvar React = global.React || require('react');\nvar Formsy = {};\nvar validationRules = require('./validationRules.js');\nvar formDataToObject = require('form-data-to-object');\nvar utils = require('./utils.js');\nvar HOC = require('./HOC.js');\nvar options = {};\nvar emptyArray = [];\n\nFormsy.Wrapper = HOC;\nFormsy.propTypes = {\n setValidations: PropTypes.func,\n setValue: PropTypes.func,\n resetValue: PropTypes.func,\n getValue: PropTypes.func,\n hasValue: PropTypes.func,\n getErrorMessage: PropTypes.func,\n getErrorMessages: PropTypes.func,\n isFormDisabled: PropTypes.func,\n isValid: PropTypes.func,\n isPristine: PropTypes.func,\n isFormSubmitted: PropTypes.func,\n isRequired: PropTypes.func,\n showRequired: PropTypes.func,\n showError: PropTypes.func,\n isValidValue: PropTypes.func\n}\n\nFormsy.defaults = function (passedOptions) {\n options = passedOptions;\n};\n\nFormsy.addValidationRule = function (name, func) {\n validationRules[name] = func;\n};\n\nFormsy.Form = class FormsyForm extends React.Component {\n static displayName = 'Formsy.Form'\n\n static defaultProps = {\n onSuccess: function () {},\n onError: function () {},\n onSubmit: function () {},\n onValidSubmit: function () {},\n onInvalidSubmit: function () {},\n onValid: function () {},\n onInvalid: function () {},\n onChange: function () {},\n validationErrors: null,\n preventExternalInvalidation: false\n }\n\n static childContextTypes = {\n formsy: PropTypes.object\n }\n\n state = {\n isValid: true,\n isSubmitting: false,\n canChange: false\n }\n\n getChildContext() {\n return {\n formsy: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n validate: this.validate,\n isFormDisabled: this.isFormDisabled,\n isValidValue: (component, value) => {\n return this.runValidation(component, value).isValid;\n }\n }\n }\n }\n\n // Add a map to store the inputs of the form, a model to store\n // the values of the form and register child inputs\n componentWillMount() {\n this.inputs = [];\n }\n\n componentDidMount() {\n this.validateForm();\n }\n\n componentWillUpdate() {\n // Keep a reference to input names before form updates,\n // to check if inputs has changed after render\n this.prevInputNames = this.inputs.map(component => component.props.name);\n }\n\n componentDidUpdate() {\n if (this.props.validationErrors && typeof this.props.validationErrors === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n this.setInputValidationErrors(this.props.validationErrors);\n }\n\n var newInputNames = this.inputs.map(component => component.props.name);\n if (utils.arraysDiffer(this.prevInputNames, newInputNames)) {\n this.validateForm();\n }\n\n }\n\n // Allow resetting to specified data\n reset = (data) => {\n this.setFormPristine(true);\n this.resetModel(data);\n }\n\n // Update model, submit to url prop and send the model\n submit = (event) => {\n event && event.preventDefault();\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n var model = this.getModel();\n this.props.onSubmit(model, this.resetModel, this.updateInputsWithError);\n this.state.isValid ? this.props.onValidSubmit(model, this.resetModel, this.updateInputsWithError) : this.props.onInvalidSubmit(model, this.resetModel, this.updateInputsWithError);\n\n }\n\n mapModel = (model) => {\n if (this.props.mapping) {\n return this.props.mapping(model)\n } else {\n return formDataToObject.toObj(Object.keys(model).reduce((mappedModel, key) => {\n\n var keyArray = key.split('.');\n var base = mappedModel;\n while (keyArray.length) {\n var currentKey = keyArray.shift();\n base = (base[currentKey] = keyArray.length ? base[currentKey] || {} : model[key]);\n }\n\n return mappedModel;\n\n }, {}));\n }\n }\n\n getModel = () => {\n var currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n }\n\n // Reset each key in the model to the original / initial / specified value\n resetModel = (data) => {\n this.inputs.forEach(component => {\n var name = component.props.name;\n if (data && data.hasOwnProperty(name)) {\n component.setValue(data[name]);\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n }\n\n setInputValidationErrors = (errors) => {\n this.inputs.forEach(component => {\n var name = component.props.name;\n var args = [{\n _isValid: !(name in errors),\n _validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n\n // Checks if the values have changed from their initial value\n isChanged = () => {\n return !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n }\n\n getPristineValues = () => {\n return this.inputs.reduce((data, component) => {\n var name = component.props.name;\n data[name] = component.props.value;\n return data;\n }, {});\n }\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n updateInputsWithError = (errors) => {\n Object.keys(errors).forEach((name, index) => {\n var component = utils.find(this.inputs, component => component.props.name === name);\n if (!component) {\n throw new Error('You are trying to update an input that does not exist. ' +\n 'Verify errors object with input names. ' + JSON.stringify(errors));\n }\n var args = [{\n _isValid: this.props.preventExternalInvalidation || false,\n _externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n\n isFormDisabled = () => {\n return this.props.disabled;\n }\n\n getCurrentValues = () => {\n return this.inputs.reduce((data, component) => {\n var name = component.props.name;\n data[name] = component.state._value;\n return data;\n }, {});\n }\n\n setFormPristine = (isPristine) => {\n this.setState({\n _formSubmitted: !isPristine\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component, index) => {\n component.setState({\n _formSubmitted: !isPristine,\n _isPristine: isPristine\n });\n });\n }\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n validate = (component) => {\n // Trigger onChange\n if (this.state.canChange) {\n this.props.onChange(this.getCurrentValues(), this.isChanged());\n }\n\n var validation = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState({\n _isValid: validation.isValid,\n _isRequired: validation.isRequired,\n _validationError: validation.error,\n _externalError: null\n }, this.validateForm);\n }\n\n // Checks validation on current value or a passed value\n runValidation = (component, value) => {\n var currentValues = this.getCurrentValues();\n var validationErrors = component.props.validationErrors;\n var validationError = component.props.validationError;\n value = arguments.length === 2 ? value : component.state._value;\n\n var validationResults = this.runRules(value, currentValues, component._validations);\n var requiredResults = this.runRules(value, currentValues, component._requiredValidations);\n\n // the component defines an explicit validate function\n if (typeof component.validate === \"function\") {\n validationResults.failed = component.validate() ? [] : ['failed'];\n }\n\n var isRequired = Object.keys(component._requiredValidations).length ? !!requiredResults.success.length : false;\n var isValid = !validationResults.failed.length && !(this.props.validationErrors && this.props.validationErrors[component.props.name]);\n\n return {\n isRequired: isRequired,\n isValid: isRequired ? false : isValid,\n error: (function () {\n\n if (isValid && !isRequired) {\n return emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (this.props.validationErrors && this.props.validationErrors[component.props.name]) {\n return typeof this.props.validationErrors[component.props.name] === 'string' ? [this.props.validationErrors[component.props.name]] : this.props.validationErrors[component.props.name];\n }\n\n if (isRequired) {\n var error = validationErrors[requiredResults.success[0]];\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed.map(function(failed) {\n return validationErrors[failed] ? validationErrors[failed] : validationError;\n }).filter(function(x, pos, arr) {\n // Remove duplicates\n return arr.indexOf(x) === pos;\n });\n }\n\n }.call(this))\n };\n }\n\n runRules = (value, currentValues, validations) => {\n var results = {\n errors: [],\n failed: [],\n success: []\n };\n\n if (Object.keys(validations).length) {\n Object.keys(validations).forEach(function (validationMethod) {\n\n if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n throw new Error('Formsy does not allow you to override default validations: ' + validationMethod);\n }\n\n if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n throw new Error('Formsy does not have the validation rule: ' + validationMethod);\n }\n\n if (typeof validations[validationMethod] === 'function') {\n var validation = validations[validationMethod](currentValues, value);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n }\n return;\n\n } else if (typeof validations[validationMethod] !== 'function') {\n var validation = validationRules[validationMethod](currentValues, value, validations[validationMethod]);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n } else {\n results.success.push(validationMethod);\n }\n return;\n\n }\n\n return results.success.push(validationMethod);\n\n });\n }\n\n return results;\n }\n\n // Validate the form by going through all child input components\n // and check their state\n validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n var onValidationComplete = function () {\n var allIsValid = this.inputs.every(component => {\n return component.state._isValid;\n });\n\n this.setState({\n isValid: allIsValid\n });\n\n if (allIsValid) {\n this.props.onValid();\n } else {\n this.props.onInvalid();\n }\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true\n });\n\n }.bind(this);\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n var validation = this.runValidation(component);\n if (validation.isValid && component.state._externalError) {\n validation.isValid = false;\n }\n component.setState({\n _isValid: validation.isValid,\n _isRequired: validation.isRequired,\n _validationError: validation.error,\n _externalError: !validation.isValid && component.state._externalError ? component.state._externalError : null\n }, index === this.inputs.length - 1 ? onValidationComplete : null);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState({\n canChange: true\n });\n }\n }\n\n // Method put on each input component to register\n // itself to the form\n attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n this.validate(component);\n }\n\n // Method put on each input component to unregister\n // itself from the form\n detachFromForm = (component) => {\n var componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos)\n .concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n }\n\n render() {\n var {\n mapping,\n validationErrors,\n onSubmit,\n onValid,\n onValidSubmit,\n onInvalid,\n onInvalidSubmit,\n onChange,\n reset,\n preventExternalInvalidation,\n onSuccess,\n onError,\n ...nonFormsyProps\n } = this.props;\n\n return (\n
\n {this.props.children}\n
\n );\n\n }\n}\n\nif (!global.exports && !global.module && (!global.define || !global.define.amd)) {\n global.Formsy = Formsy;\n}\n\nmodule.exports = Formsy;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 1\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyFunction.js\n// module id = 2\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/invariant.js\n// module id = 3\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 4\n// module chunks = 0","module.exports = {\n arraysDiffer: function (a, b) {\n var isDifferent = false;\n if (a.length !== b.length) {\n isDifferent = true;\n } else {\n a.forEach(function (item, index) {\n if (!this.isSame(item, b[index])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n objectsDiffer: function (a, b) {\n var isDifferent = false;\n if (Object.keys(a).length !== Object.keys(b).length) {\n isDifferent = true;\n } else {\n Object.keys(a).forEach(function (key) {\n if (!this.isSame(a[key], b[key])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n isSame: function (a, b) {\n if (typeof a !== typeof b) {\n return false;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n return !this.arraysDiffer(a, b);\n } else if (typeof a === 'function') {\n return a.toString() === b.toString();\n } else if (typeof a === 'object' && a !== null && b !== null) {\n return !this.objectsDiffer(a, b);\n }\n\n return a === b;\n },\n\n find: function (collection, fn) {\n for (var i = 0, l = collection.length; i < l; i++) {\n var item = collection[i];\n if (fn(item)) {\n return item;\n }\n }\n return null;\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/warning.js\n// module id = 6\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 7\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_8__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 8\n// module chunks = 0","var React = global.React || require('react');\nvar PropTypes = require('prop-types');\nvar hoistNonReactStatic = require('hoist-non-react-statics');\nvar utils = require('./utils.js');\n\nvar convertValidationsToObject = function (validations) {\n if (typeof validations === 'string') {\n return validations.split(/\\,(?![^{\\[]*[}\\]])/g).reduce(function (validations, validation) {\n var args = validation.split(':');\n var validateMethod = args.shift();\n\n args = args.map(function (arg) {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n }\n\n validations[validateMethod] = args.length ? args[0] : true;\n return validations;\n }, {});\n\n }\n\n return validations || {};\n};\n\nmodule.exports = function (Component) {\n class WrappedComponent extends React.Component {\n static displayName = 'Formsy(' + getDisplayName(Component) + ')';\n\n state = {\n _value: this.props.value,\n _isRequired: false,\n _isValid: true,\n _isPristine: true,\n _pristineValue: this.props.value,\n _validationError: [],\n _externalError: null,\n _formSubmitted: false\n }\n\n static contextTypes = {\n formsy: PropTypes.object // What about required?\n }\n\n static defaultProps = {\n validationError: '',\n validationErrors: {}\n }\n\n componentWillMount() {\n var configure = () => {\n this.setValidations(this.props.validations, this.props.required);\n\n // Pass a function instead?\n this.context.formsy.attachToForm(this);\n //this.props._attachToForm(this);\n }\n\n if (!this.props.name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n configure();\n }\n\n // We have to make the validate method is kept when new props are added\n componentWillReceiveProps(nextProps) {\n this.setValidations(nextProps.validations, nextProps.required);\n }\n\n componentDidUpdate(prevProps) {\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(this.props.value, prevProps.value)) {\n this.setValue(this.props.value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(this.props.validations, prevProps.validations) || !utils.isSame(this.props.required, prevProps.required)) {\n this.context.formsy.validate(this);\n }\n }\n\n // Detach it when component unmounts\n componentWillUnmount() {\n this.context.formsy.detachFromForm(this);\n //this.props._detachFromForm(this);\n }\n\n setValidations = (validations, required) => {\n // Add validations to the store itself as the props object can not be modified\n this._validations = convertValidationsToObject(validations) || {};\n this._requiredValidations = required === true ? {isDefaultRequiredValue: true} : convertValidationsToObject(required);\n }\n\n // We validate after the value has been set\n setValue = (value) => {\n this.setState({\n _value: value,\n _isPristine: false\n }, () => {\n this.context.formsy.validate(this);\n //this.props._validate(this);\n });\n }\n\n resetValue = () => {\n this.setState({\n _value: this.state._pristineValue,\n _isPristine: true\n }, function () {\n this.context.formsy.validate(this);\n //this.props._validate(this);\n });\n }\n\n getValue = () => {\n return this.state._value;\n }\n\n hasValue = () => {\n return this.state._value !== '';\n }\n\n getErrorMessage = () => {\n var messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n }\n\n getErrorMessages = () => {\n return !this.isValid() || this.showRequired() ? (this.state._externalError || this.state._validationError || []) : [];\n }\n\n isFormDisabled = () => {\n return this.context.formsy.isFormDisabled();\n //return this.props._isFormDisabled();\n }\n\n isValid = () => {\n return this.state._isValid;\n }\n\n isPristine = () => {\n return this.state._isPristine;\n }\n\n isFormSubmitted = () => {\n return this.state._formSubmitted;\n }\n\n isRequired = () => {\n return !!this.props.required;\n }\n\n showRequired = () => {\n return this.state._isRequired;\n }\n\n showError = () => {\n return !this.showRequired() && !this.isValid();\n }\n\n isValidValue = (value) => {\n return this.context.formsy.isValidValue.call(null, this, value);\n //return this.props._isValidValue.call(null, this, value);\n }\n\n render() {\n const { innerRef } = this.props;\n const propsForElement = {\n setValidations: this.setValidations,\n setValue: this.setValue,\n resetValue: this.resetValue,\n getValue: this.getValue,\n hasValue: this.hasValue,\n getErrorMessage: this.getErrorMessage,\n getErrorMessages: this.getErrorMessages,\n isFormDisabled: this.isFormDisabled,\n isValid: this.isValid,\n isPristine: this.isPristine,\n isFormSubmitted: this.isFormSubmitted,\n isRequired: this.isRequired,\n showRequired: this.showRequired,\n showError: this.showError,\n isValidValue: this.isValidValue,\n ...this.props\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return \n }\n }\n return hoistNonReactStatic(WrappedComponent, Component);\n};\n\nfunction getDisplayName(Component) {\n return (\n Component.displayName ||\n Component.name ||\n (typeof Component === 'string' ? Component : 'Component')\n );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/HOC.js","var isExisty = function (value) {\n return value !== null && value !== undefined;\n};\n\nvar isEmpty = function (value) {\n return value === '';\n};\n\nvar validations = {\n isDefaultRequiredValue: function (values, value) {\n return value === undefined || value === '';\n },\n isExisty: function (values, value) {\n return isExisty(value);\n },\n matchRegexp: function (values, value, regexp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(value);\n },\n isUndefined: function (values, value) {\n return value === undefined;\n },\n isEmptyString: function (values, value) {\n return isEmpty(value);\n },\n isEmail: function (values, value) {\n return validations.matchRegexp(values, value, /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i);\n },\n isUrl: function (values, value) {\n return validations.matchRegexp(values, value, /^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i);\n },\n isTrue: function (values, value) {\n return value === true;\n },\n isFalse: function (values, value) {\n return value === false;\n },\n isNumeric: function (values, value) {\n if (typeof value === 'number') {\n return true;\n }\n return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n },\n isAlpha: function (values, value) {\n return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n },\n isAlphanumeric: function (values, value) {\n return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n },\n isInt: function (values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n },\n isFloat: function (values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][\\+\\-]?(?:\\d+))?$/);\n },\n isWords: function (values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n },\n isSpecialWords: function (values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n },\n isLength: function (values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length === length;\n },\n equals: function (values, value, eql) {\n return !isExisty(value) || isEmpty(value) || value == eql;\n },\n equalsField: function (values, value, field) {\n return value == values[field];\n },\n maxLength: function (values, value, length) {\n return !isExisty(value) || value.length <= length;\n },\n minLength: function (values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length >= length;\n }\n};\n\nmodule.exports = validations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/validationRules.js","function toObj(source) {\n return Object.keys(source).reduce(function (output, key) {\n var parentKey = key.match(/[^\\[]*/i);\n var paths = key.match(/\\[.*?\\]/g) || [];\n paths = [parentKey[0]].concat(paths).map(function (key) {\n return key.replace(/\\[|\\]/g, '');\n });\n var currentPath = output;\n while (paths.length) {\n var pathKey = paths.shift();\n\n if (pathKey in currentPath) {\n currentPath = currentPath[pathKey];\n } else {\n currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n currentPath = currentPath[pathKey];\n }\n }\n\n return output;\n }, {});\n}\n\nfunction fromObj(obj) {\n function recur(newObj, propName, currVal) {\n if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n Object.keys(currVal).forEach(function(v) {\n recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n });\n return newObj;\n }\n\n newObj[propName] = currVal;\n return newObj;\n }\n\n var keys = Object.keys(obj);\n return keys.reduce(function(newObj, propName) {\n return recur(newObj, propName, obj[propName]);\n }, {});\n}\n\nmodule.exports = {\n fromObj: fromObj,\n toObj: toObj\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/form-data-to-object/index.js\n// module id = 11\n// module chunks = 0","/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n'use strict';\n\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\n\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = getPrototypeOf && getPrototypeOf(Object);\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\n\nmodule.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n // Only hoist enumerables and non-enumerable functions\n if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') {\n try { // Avoid failures from read-only properties\n targetComponent[key] = sourceComponent[key];\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n }\n\n return targetComponent;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hoist-non-react-statics/index.js\n// module id = 12\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/checkPropTypes.js\n// module id = 13\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithThrowingShims.js\n// module id = 14\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithTypeCheckers.js\n// module id = 15\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///formsy-react.js","webpack:///webpack/bootstrap 6c38e20f8aab90d3c5b3","webpack:///./src/index.js","webpack:///./~/process/browser.js","webpack:///./~/fbjs/lib/emptyFunction.js","webpack:///./~/fbjs/lib/invariant.js","webpack:///./~/prop-types/lib/ReactPropTypesSecret.js","webpack:///./src/utils.js","webpack:///./~/fbjs/lib/warning.js","webpack:///./~/prop-types/index.js","webpack:///external \"react\"","webpack:///./src/Wrapper.js","webpack:///./src/validationRules.js","webpack:///./~/form-data-to-object/index.js","webpack:///./~/hoist-non-react-statics/index.js","webpack:///./~/prop-types/checkPropTypes.js","webpack:///./~/prop-types/factoryWithThrowingShims.js","webpack:///./~/prop-types/factoryWithTypeCheckers.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_8__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","global","_objectWithoutProperties","obj","keys","target","i","indexOf","Object","prototype","hasOwnProperty","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","_class","_temp2","_initialiseProps","_extends","assign","arguments","length","source","key","_typeof","Symbol","iterator","_createClass","defineProperties","props","descriptor","defineProperty","protoProps","staticProps","PropTypes","React","Formsy","validationRules","formDataToObject","utils","Wrapper","options","emptyArray","propTypes","setValidations","func","setValue","resetValue","getValue","hasValue","getErrorMessage","getErrorMessages","isFormDisabled","isValid","isPristine","isFormSubmitted","isRequired","showRequired","showError","isValidValue","defaults","passedOptions","addValidationRule","name","Form","_React$Component","FormsyForm","_ref","_temp","_this","_ret","_len","args","Array","_key","getPrototypeOf","apply","concat","_this2","formsy","attachToForm","detachFromForm","validate","component","runValidation","inputs","validateForm","prevInputNames","map","validationErrors","setInputValidationErrors","newInputNames","arraysDiffer","_props","nonFormsyProps","mapping","onSubmit","onValid","onValidSubmit","onInvalid","onInvalidSubmit","onChange","reset","preventExternalInvalidation","onSuccess","onError","createElement","submit","children","Component","displayName","defaultProps","childContextTypes","object","_this3","state","isSubmitting","canChange","data","setFormPristine","resetModel","event","preventDefault","model","getModel","updateInputsWithError","mapModel","toObj","reduce","mappedModel","keyArray","split","base","currentKey","shift","currentValues","getCurrentValues","forEach","errors","_isValid","_validationError","setState","isChanged","isSame","getPristineValues","index","find","Error","JSON","stringify","_externalError","disabled","_value","_formSubmitted","_isPristine","validation","_isRequired","error","validationError","validationResults","runRules","_validations","requiredResults","_requiredValidations","failed","success","filter","x","pos","arr","validations","results","validationMethod","push","onValidationComplete","allIsValid","every","bind","componentPos","slice","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","setTimeout","e","runClearTimeout","marker","cachedClearTimeout","clearTimeout","cleanUpNextTick","draining","currentQueue","queue","queueIndex","drainQueue","timeout","len","run","Item","array","noop","process","nextTick","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","makeEmptyFunction","arg","emptyFunction","thatReturns","thatReturnsFalse","thatReturnsTrue","thatReturnsNull","thatReturnsThis","thatReturnsArgument","invariant","condition","format","a","b","d","f","validateFormat","undefined","argIndex","replace","framesToPop","NODE_ENV","ReactPropTypesSecret","isDifferent","item","objectsDiffer","isArray","toString","collection","fn","l","warning","printWarning","message","console","_len2","_key2","REACT_ELEMENT_TYPE","for","isValidElement","$$typeof","throwOnDirectAccess","getDisplayName","hoistNonReactStatic","convertValidationsToObject","validateMethod","parse","WrappedComponent","_pristineValue","required","isDefaultRequiredValue","context","messages","configure","nextProps","prevProps","innerRef","propsForElement","ref","contextTypes","isExisty","isEmpty","values","matchRegexp","regexp","test","isUndefined","isEmptyString","isEmail","isUrl","isTrue","isFalse","isNumeric","isAlpha","isAlphanumeric","isInt","isFloat","isWords","isSpecialWords","isLength","equals","eql","equalsField","field","maxLength","minLength","output","parentKey","match","paths","currentPath","pathKey","isNaN","fromObj","recur","newObj","propName","currVal","v","REACT_STATICS","getDefaultProps","mixins","type","KNOWN_STATICS","caller","callee","arity","getOwnPropertySymbols","propIsEnumerable","propertyIsEnumerable","objectPrototype","getOwnPropertyNames","hoistNonReactStatics","targetComponent","sourceComponent","blacklist","inheritedComponent","checkPropTypes","typeSpecs","location","componentName","getStack","typeSpecName","ex","loggedTypeFailures","stack","shim","propFullName","secret","getShim","ReactPropTypes","bool","number","string","symbol","any","arrayOf","element","instanceOf","node","objectOf","oneOf","oneOfType","shape","getIteratorFn","maybeIterable","iteratorFn","ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","is","y","PropTypeError","createChainableTypeChecker","checkType","ANONYMOUS","cacheKey","manualPropTypeCallCache","manualPropTypeWarningCount","chainedCheckType","createPrimitiveTypeChecker","expectedType","propValue","propType","getPropType","preciseType","getPreciseType","createAnyTypeChecker","createArrayOfTypeChecker","typeChecker","createElementTypeChecker","createInstanceTypeChecker","expectedClass","expectedClassName","actualClassName","getClassName","createEnumTypeChecker","expectedValues","valuesString","createObjectOfTypeChecker","createUnionTypeChecker","arrayOfTypeCheckers","checker","getPostfixForTypeWarning","createNodeChecker","isNode","createShapeTypeChecker","shapeTypes","step","entries","next","done","entry","isSymbol","RegExp","Date"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,UACA,kBAAAC,gBAAAC,IACAD,QAAA,SAAAJ,GACA,gBAAAC,SACAA,QAAA,OAAAD,EAAAG,QAAA,UAEAJ,EAAA,OAAAC,EAAAD,EAAA,QACCO,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAT,OAGA,IAAAC,GAAAS,EAAAD,IACAT,WACAW,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAZ,EAAAD,QAAAC,IAAAD,QAAAQ,GAGAP,EAAAW,QAAA,EAGAX,EAAAD,QAvBA,GAAAU,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,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IAAA,OAAAA,EACA,SAAAA,CAEA,IAAAC,GAAAC,EAAAF,EACA,eAAAC,EAAA,CACA,GAAAD,YAAAiC,MACA,YACO,IAAAjC,YAAAgC,QACP,eAGA,MAAA/B,GAKA,QAAAoB,GAAA/Y,GACA,GAAA+T,GAAA+D,EAAA9X,EACA,QAAA+T,GACA,YACA,aACA,YAAAA,CACA,eACA,WACA,aACA,WAAAA,CACA,SACA,MAAAA,IAKA,QAAAwE,GAAAb,GACA,MAAAA,GAAA3X,aAAA2X,EAAA3X,YAAAuD,KAGAoU,EAAA3X,YAAAuD,KAFA6T,EAleA,GAAAP,GAAA,kBAAA5V,gBAAAC,SACA4V,EAAA,aAsEAM,EAAA,gBAIAxB,GACA3J,MAAAwL,EAAA,SACA5B,KAAA4B,EAAA,WACApV,KAAAoV,EAAA,YACA3B,OAAA2B,EAAA,UACAhR,OAAAgR,EAAA,UACA1B,OAAA0B,EAAA,UACAzB,OAAAyB,EAAA,UAEAxB,IAAA+B,IACA9B,QAAA+B,EACA9B,QAAAgC,IACA/B,WAAAgC,EACA/B,KAAA4C,IACA3C,SAAAsC,EACArC,MAAAkC,EACAjC,UAAAqC,EACApC,MAAA0C,EA8YA,OA7WAlC,GAAA9X,UAAAwJ,MAAAxJ,UA0WAyW,EAAAb,iBACAa,EAAAlU,UAAAkU,EAEAA,KjB+mD8BrX,KAAKb,EAASQ,EAAoB","file":"formsy-react.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Formsy\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Formsy\"] = factory(root[\"react\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_8__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Formsy\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"Formsy\"] = factory(root[\"react\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_8__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _class, _temp2, _initialiseProps;\n\t\n\tfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar PropTypes = __webpack_require__(7);\n\tvar React = global.React || __webpack_require__(8);\n\tvar Formsy = {};\n\tvar validationRules = __webpack_require__(10);\n\tvar formDataToObject = __webpack_require__(11);\n\tvar utils = __webpack_require__(5);\n\tvar Wrapper = __webpack_require__(9);\n\tvar options = {};\n\tvar emptyArray = [];\n\t\n\tFormsy.Wrapper = Wrapper;\n\tFormsy.propTypes = {\n\t setValidations: PropTypes.func,\n\t setValue: PropTypes.func,\n\t resetValue: PropTypes.func,\n\t getValue: PropTypes.func,\n\t hasValue: PropTypes.func,\n\t getErrorMessage: PropTypes.func,\n\t getErrorMessages: PropTypes.func,\n\t isFormDisabled: PropTypes.func,\n\t isValid: PropTypes.func,\n\t isPristine: PropTypes.func,\n\t isFormSubmitted: PropTypes.func,\n\t isRequired: PropTypes.func,\n\t showRequired: PropTypes.func,\n\t showError: PropTypes.func,\n\t isValidValue: PropTypes.func\n\t};\n\t\n\tFormsy.defaults = function (passedOptions) {\n\t options = passedOptions;\n\t};\n\t\n\tFormsy.addValidationRule = function (name, func) {\n\t validationRules[name] = func;\n\t};\n\t\n\tFormsy.Form = (_temp2 = _class = function (_React$Component) {\n\t _inherits(FormsyForm, _React$Component);\n\t\n\t function FormsyForm() {\n\t var _ref;\n\t\n\t var _temp, _this, _ret;\n\t\n\t _classCallCheck(this, FormsyForm);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = FormsyForm.__proto__ || Object.getPrototypeOf(FormsyForm)).call.apply(_ref, [this].concat(args))), _this), _initialiseProps.call(_this), _temp), _possibleConstructorReturn(_this, _ret);\n\t }\n\t\n\t _createClass(FormsyForm, [{\n\t key: 'getChildContext',\n\t value: function getChildContext() {\n\t var _this2 = this;\n\t\n\t return {\n\t formsy: {\n\t attachToForm: this.attachToForm,\n\t detachFromForm: this.detachFromForm,\n\t validate: this.validate,\n\t isFormDisabled: this.isFormDisabled,\n\t isValidValue: function isValidValue(component, value) {\n\t return _this2.runValidation(component, value).isValid;\n\t }\n\t }\n\t };\n\t }\n\t\n\t // Add a map to store the inputs of the form, a model to store\n\t // the values of the form and register child inputs\n\t\n\t }, {\n\t key: 'componentWillMount',\n\t value: function componentWillMount() {\n\t this.inputs = [];\n\t }\n\t }, {\n\t key: 'componentDidMount',\n\t value: function componentDidMount() {\n\t this.validateForm();\n\t }\n\t }, {\n\t key: 'componentWillUpdate',\n\t value: function componentWillUpdate() {\n\t // Keep a reference to input names before form updates,\n\t // to check if inputs has changed after render\n\t this.prevInputNames = this.inputs.map(function (component) {\n\t return component.props.name;\n\t });\n\t }\n\t }, {\n\t key: 'componentDidUpdate',\n\t value: function componentDidUpdate() {\n\t if (this.props.validationErrors && _typeof(this.props.validationErrors) === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n\t this.setInputValidationErrors(this.props.validationErrors);\n\t }\n\t\n\t var newInputNames = this.inputs.map(function (component) {\n\t return component.props.name;\n\t });\n\t if (utils.arraysDiffer(this.prevInputNames, newInputNames)) {\n\t this.validateForm();\n\t }\n\t }\n\t\n\t // Allow resetting to specified data\n\t\n\t\n\t // Update model, submit to url prop and send the model\n\t\n\t\n\t // Reset each key in the model to the original / initial / specified value\n\t\n\t\n\t // Checks if the values have changed from their initial value\n\t\n\t\n\t // Go through errors from server and grab the components\n\t // stored in the inputs map. Change their state to invalid\n\t // and set the serverError message\n\t\n\t\n\t // Use the binded values and the actual input value to\n\t // validate the input and set its state. Then check the\n\t // state of the form itself\n\t\n\t\n\t // Checks validation on current value or a passed value\n\t\n\t\n\t // Validate the form by going through all child input components\n\t // and check their state\n\t\n\t\n\t // Method put on each input component to register\n\t // itself to the form\n\t\n\t\n\t // Method put on each input component to unregister\n\t // itself from the form\n\t\n\t }, {\n\t key: 'render',\n\t value: function render() {\n\t var _props = this.props,\n\t mapping = _props.mapping,\n\t validationErrors = _props.validationErrors,\n\t onSubmit = _props.onSubmit,\n\t onValid = _props.onValid,\n\t onValidSubmit = _props.onValidSubmit,\n\t onInvalid = _props.onInvalid,\n\t onInvalidSubmit = _props.onInvalidSubmit,\n\t onChange = _props.onChange,\n\t reset = _props.reset,\n\t preventExternalInvalidation = _props.preventExternalInvalidation,\n\t onSuccess = _props.onSuccess,\n\t onError = _props.onError,\n\t nonFormsyProps = _objectWithoutProperties(_props, ['mapping', 'validationErrors', 'onSubmit', 'onValid', 'onValidSubmit', 'onInvalid', 'onInvalidSubmit', 'onChange', 'reset', 'preventExternalInvalidation', 'onSuccess', 'onError']);\n\t\n\t return React.createElement(\n\t 'form',\n\t _extends({}, nonFormsyProps, { onSubmit: this.submit }),\n\t this.props.children\n\t );\n\t }\n\t }]);\n\t\n\t return FormsyForm;\n\t}(React.Component), _class.displayName = 'Formsy.Form', _class.defaultProps = {\n\t onSuccess: function onSuccess() {},\n\t onError: function onError() {},\n\t onSubmit: function onSubmit() {},\n\t onValidSubmit: function onValidSubmit() {},\n\t onInvalidSubmit: function onInvalidSubmit() {},\n\t onValid: function onValid() {},\n\t onInvalid: function onInvalid() {},\n\t onChange: function onChange() {},\n\t validationErrors: null,\n\t preventExternalInvalidation: false\n\t}, _class.childContextTypes = {\n\t formsy: PropTypes.object\n\t}, _initialiseProps = function _initialiseProps() {\n\t var _this3 = this;\n\t\n\t this.state = {\n\t isValid: true,\n\t isSubmitting: false,\n\t canChange: false\n\t };\n\t\n\t this.reset = function (data) {\n\t _this3.setFormPristine(true);\n\t _this3.resetModel(data);\n\t };\n\t\n\t this.submit = function (event) {\n\t event && event.preventDefault();\n\t\n\t // Trigger form as not pristine.\n\t // If any inputs have not been touched yet this will make them dirty\n\t // so validation becomes visible (if based on isPristine)\n\t _this3.setFormPristine(false);\n\t var model = _this3.getModel();\n\t _this3.props.onSubmit(model, _this3.resetModel, _this3.updateInputsWithError);\n\t _this3.state.isValid ? _this3.props.onValidSubmit(model, _this3.resetModel, _this3.updateInputsWithError) : _this3.props.onInvalidSubmit(model, _this3.resetModel, _this3.updateInputsWithError);\n\t };\n\t\n\t this.mapModel = function (model) {\n\t if (_this3.props.mapping) {\n\t return _this3.props.mapping(model);\n\t } else {\n\t return formDataToObject.toObj(Object.keys(model).reduce(function (mappedModel, key) {\n\t\n\t var keyArray = key.split('.');\n\t var base = mappedModel;\n\t while (keyArray.length) {\n\t var currentKey = keyArray.shift();\n\t base = base[currentKey] = keyArray.length ? base[currentKey] || {} : model[key];\n\t }\n\t\n\t return mappedModel;\n\t }, {}));\n\t }\n\t };\n\t\n\t this.getModel = function () {\n\t var currentValues = _this3.getCurrentValues();\n\t return _this3.mapModel(currentValues);\n\t };\n\t\n\t this.resetModel = function (data) {\n\t _this3.inputs.forEach(function (component) {\n\t var name = component.props.name;\n\t if (data && data.hasOwnProperty(name)) {\n\t component.setValue(data[name]);\n\t } else {\n\t component.resetValue();\n\t }\n\t });\n\t _this3.validateForm();\n\t };\n\t\n\t this.setInputValidationErrors = function (errors) {\n\t _this3.inputs.forEach(function (component) {\n\t var name = component.props.name;\n\t var args = [{\n\t _isValid: !(name in errors),\n\t _validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n\t }];\n\t component.setState.apply(component, args);\n\t });\n\t };\n\t\n\t this.isChanged = function () {\n\t return !utils.isSame(_this3.getPristineValues(), _this3.getCurrentValues());\n\t };\n\t\n\t this.getPristineValues = function () {\n\t return _this3.inputs.reduce(function (data, component) {\n\t var name = component.props.name;\n\t data[name] = component.props.value;\n\t return data;\n\t }, {});\n\t };\n\t\n\t this.updateInputsWithError = function (errors) {\n\t Object.keys(errors).forEach(function (name, index) {\n\t var component = utils.find(_this3.inputs, function (component) {\n\t return component.props.name === name;\n\t });\n\t if (!component) {\n\t throw new Error('You are trying to update an input that does not exist. ' + 'Verify errors object with input names. ' + JSON.stringify(errors));\n\t }\n\t var args = [{\n\t _isValid: _this3.props.preventExternalInvalidation || false,\n\t _externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n\t }];\n\t component.setState.apply(component, args);\n\t });\n\t };\n\t\n\t this.isFormDisabled = function () {\n\t return _this3.props.disabled;\n\t };\n\t\n\t this.getCurrentValues = function () {\n\t return _this3.inputs.reduce(function (data, component) {\n\t var name = component.props.name;\n\t data[name] = component.state._value;\n\t return data;\n\t }, {});\n\t };\n\t\n\t this.setFormPristine = function (isPristine) {\n\t _this3.setState({\n\t _formSubmitted: !isPristine\n\t });\n\t\n\t // Iterate through each component and set it as pristine\n\t // or \"dirty\".\n\t _this3.inputs.forEach(function (component, index) {\n\t component.setState({\n\t _formSubmitted: !isPristine,\n\t _isPristine: isPristine\n\t });\n\t });\n\t };\n\t\n\t this.validate = function (component) {\n\t // Trigger onChange\n\t if (_this3.state.canChange) {\n\t _this3.props.onChange(_this3.getCurrentValues(), _this3.isChanged());\n\t }\n\t\n\t var validation = _this3.runValidation(component);\n\t // Run through the validations, split them up and call\n\t // the validator IF there is a value or it is required\n\t component.setState({\n\t _isValid: validation.isValid,\n\t _isRequired: validation.isRequired,\n\t _validationError: validation.error,\n\t _externalError: null\n\t }, _this3.validateForm);\n\t };\n\t\n\t this.runValidation = function (component, value) {\n\t var currentValues = _this3.getCurrentValues();\n\t var validationErrors = component.props.validationErrors;\n\t var validationError = component.props.validationError;\n\t value = value ? value : component.state._value;\n\t\n\t var validationResults = _this3.runRules(value, currentValues, component._validations);\n\t var requiredResults = _this3.runRules(value, currentValues, component._requiredValidations);\n\t\n\t // the component defines an explicit validate function\n\t if (typeof component.validate === \"function\") {\n\t validationResults.failed = component.validate() ? [] : ['failed'];\n\t }\n\t\n\t var isRequired = Object.keys(component._requiredValidations).length ? !!requiredResults.success.length : false;\n\t var isValid = !validationResults.failed.length && !(_this3.props.validationErrors && _this3.props.validationErrors[component.props.name]);\n\t\n\t return {\n\t isRequired: isRequired,\n\t isValid: isRequired ? false : isValid,\n\t error: function () {\n\t\n\t if (isValid && !isRequired) {\n\t return emptyArray;\n\t }\n\t\n\t if (validationResults.errors.length) {\n\t return validationResults.errors;\n\t }\n\t\n\t if (this.props.validationErrors && this.props.validationErrors[component.props.name]) {\n\t return typeof this.props.validationErrors[component.props.name] === 'string' ? [this.props.validationErrors[component.props.name]] : this.props.validationErrors[component.props.name];\n\t }\n\t\n\t if (isRequired) {\n\t var error = validationErrors[requiredResults.success[0]];\n\t return error ? [error] : null;\n\t }\n\t\n\t if (validationResults.failed.length) {\n\t return validationResults.failed.map(function (failed) {\n\t return validationErrors[failed] ? validationErrors[failed] : validationError;\n\t }).filter(function (x, pos, arr) {\n\t // Remove duplicates\n\t return arr.indexOf(x) === pos;\n\t });\n\t }\n\t }.call(_this3)\n\t };\n\t };\n\t\n\t this.runRules = function (value, currentValues, validations) {\n\t var results = {\n\t errors: [],\n\t failed: [],\n\t success: []\n\t };\n\t\n\t if (Object.keys(validations).length) {\n\t Object.keys(validations).forEach(function (validationMethod) {\n\t\n\t if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n\t throw new Error('Formsy does not allow you to override default validations: ' + validationMethod);\n\t }\n\t\n\t if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n\t throw new Error('Formsy does not have the validation rule: ' + validationMethod);\n\t }\n\t\n\t if (typeof validations[validationMethod] === 'function') {\n\t var validation = validations[validationMethod](currentValues, value);\n\t if (typeof validation === 'string') {\n\t results.errors.push(validation);\n\t results.failed.push(validationMethod);\n\t } else if (!validation) {\n\t results.failed.push(validationMethod);\n\t }\n\t return;\n\t } else if (typeof validations[validationMethod] !== 'function') {\n\t var validation = validationRules[validationMethod](currentValues, value, validations[validationMethod]);\n\t if (typeof validation === 'string') {\n\t results.errors.push(validation);\n\t results.failed.push(validationMethod);\n\t } else if (!validation) {\n\t results.failed.push(validationMethod);\n\t } else {\n\t results.success.push(validationMethod);\n\t }\n\t return;\n\t }\n\t\n\t return results.success.push(validationMethod);\n\t });\n\t }\n\t\n\t return results;\n\t };\n\t\n\t this.validateForm = function () {\n\t // We need a callback as we are validating all inputs again. This will\n\t // run when the last component has set its state\n\t var onValidationComplete = function () {\n\t var allIsValid = this.inputs.every(function (component) {\n\t return component.state._isValid;\n\t });\n\t\n\t this.setState({\n\t isValid: allIsValid\n\t });\n\t\n\t if (allIsValid) {\n\t this.props.onValid();\n\t } else {\n\t this.props.onInvalid();\n\t }\n\t\n\t // Tell the form that it can start to trigger change events\n\t this.setState({\n\t canChange: true\n\t });\n\t }.bind(_this3);\n\t\n\t // Run validation again in case affected by other inputs. The\n\t // last component validated will run the onValidationComplete callback\n\t _this3.inputs.forEach(function (component, index) {\n\t var validation = _this3.runValidation(component);\n\t if (validation.isValid && component.state._externalError) {\n\t validation.isValid = false;\n\t }\n\t component.setState({\n\t _isValid: validation.isValid,\n\t _isRequired: validation.isRequired,\n\t _validationError: validation.error,\n\t _externalError: !validation.isValid && component.state._externalError ? component.state._externalError : null\n\t }, index === _this3.inputs.length - 1 ? onValidationComplete : null);\n\t });\n\t\n\t // If there are no inputs, set state where form is ready to trigger\n\t // change event. New inputs might be added later\n\t if (!_this3.inputs.length) {\n\t _this3.setState({\n\t canChange: true\n\t });\n\t }\n\t };\n\t\n\t this.attachToForm = function (component) {\n\t if (_this3.inputs.indexOf(component) === -1) {\n\t _this3.inputs.push(component);\n\t }\n\t\n\t _this3.validate(component);\n\t };\n\t\n\t this.detachFromForm = function (component) {\n\t var componentPos = _this3.inputs.indexOf(component);\n\t\n\t if (componentPos !== -1) {\n\t _this3.inputs = _this3.inputs.slice(0, componentPos).concat(_this3.inputs.slice(componentPos + 1));\n\t }\n\t\n\t _this3.validateForm();\n\t };\n\t}, _temp2);\n\t\n\tif (!global.exports && !global.module && (!global.define || !global.define.amd)) {\n\t global.Formsy = Formsy;\n\t}\n\t\n\tmodule.exports = Formsy;\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\t\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things. But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals. It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\t\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\t\n\tfunction defaultSetTimout() {\n\t throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t try {\n\t if (typeof setTimeout === 'function') {\n\t cachedSetTimeout = setTimeout;\n\t } else {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t } catch (e) {\n\t cachedSetTimeout = defaultSetTimout;\n\t }\n\t try {\n\t if (typeof clearTimeout === 'function') {\n\t cachedClearTimeout = clearTimeout;\n\t } else {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t } catch (e) {\n\t cachedClearTimeout = defaultClearTimeout;\n\t }\n\t} ())\n\tfunction runTimeout(fun) {\n\t if (cachedSetTimeout === setTimeout) {\n\t //normal enviroments in sane situations\n\t return setTimeout(fun, 0);\n\t }\n\t // if setTimeout wasn't available but was latter defined\n\t if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t cachedSetTimeout = setTimeout;\n\t return setTimeout(fun, 0);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedSetTimeout(fun, 0);\n\t } catch(e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedSetTimeout.call(null, fun, 0);\n\t } catch(e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t return cachedSetTimeout.call(this, fun, 0);\n\t }\n\t }\n\t\n\t\n\t}\n\tfunction runClearTimeout(marker) {\n\t if (cachedClearTimeout === clearTimeout) {\n\t //normal enviroments in sane situations\n\t return clearTimeout(marker);\n\t }\n\t // if clearTimeout wasn't available but was latter defined\n\t if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t cachedClearTimeout = clearTimeout;\n\t return clearTimeout(marker);\n\t }\n\t try {\n\t // when when somebody has screwed with setTimeout but no I.E. maddness\n\t return cachedClearTimeout(marker);\n\t } catch (e){\n\t try {\n\t // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t return cachedClearTimeout.call(null, marker);\n\t } catch (e){\n\t // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t return cachedClearTimeout.call(this, marker);\n\t }\n\t }\n\t\n\t\n\t\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t if (!draining || !currentQueue) {\n\t return;\n\t }\n\t draining = false;\n\t if (currentQueue.length) {\n\t queue = currentQueue.concat(queue);\n\t } else {\n\t queueIndex = -1;\n\t }\n\t if (queue.length) {\n\t drainQueue();\n\t }\n\t}\n\t\n\tfunction drainQueue() {\n\t if (draining) {\n\t return;\n\t }\n\t var timeout = runTimeout(cleanUpNextTick);\n\t draining = true;\n\t\n\t var len = queue.length;\n\t while(len) {\n\t currentQueue = queue;\n\t queue = [];\n\t while (++queueIndex < len) {\n\t if (currentQueue) {\n\t currentQueue[queueIndex].run();\n\t }\n\t }\n\t queueIndex = -1;\n\t len = queue.length;\n\t }\n\t currentQueue = null;\n\t draining = false;\n\t runClearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t var args = new Array(arguments.length - 1);\n\t if (arguments.length > 1) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t args[i - 1] = arguments[i];\n\t }\n\t }\n\t queue.push(new Item(fun, args));\n\t if (queue.length === 1 && !draining) {\n\t runTimeout(drainQueue);\n\t }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t this.fun = fun;\n\t this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\tprocess.prependListener = noop;\n\tprocess.prependOnceListener = noop;\n\t\n\tprocess.listeners = function (name) { return [] }\n\t\n\tprocess.binding = function (name) {\n\t throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\t/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t * \n\t */\n\t\n\tfunction makeEmptyFunction(arg) {\n\t return function () {\n\t return arg;\n\t };\n\t}\n\t\n\t/**\n\t * This function accepts and discards inputs; it has no side effects. This is\n\t * primarily useful idiomatically for overridable function endpoints which\n\t * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n\t */\n\tvar emptyFunction = function emptyFunction() {};\n\t\n\temptyFunction.thatReturns = makeEmptyFunction;\n\temptyFunction.thatReturnsFalse = makeEmptyFunction(false);\n\temptyFunction.thatReturnsTrue = makeEmptyFunction(true);\n\temptyFunction.thatReturnsNull = makeEmptyFunction(null);\n\temptyFunction.thatReturnsThis = function () {\n\t return this;\n\t};\n\temptyFunction.thatReturnsArgument = function (arg) {\n\t return arg;\n\t};\n\t\n\tmodule.exports = emptyFunction;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t */\n\t\n\t'use strict';\n\t\n\t/**\n\t * Use invariant() to assert state which your program assumes to be true.\n\t *\n\t * Provide sprintf-style format (only %s is supported) and arguments\n\t * to provide information about what broke and what you were\n\t * expecting.\n\t *\n\t * The invariant message will be stripped in production, but the invariant\n\t * will remain to ensure logic does not differ in production.\n\t */\n\t\n\tvar validateFormat = function validateFormat(format) {};\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t validateFormat = function validateFormat(format) {\n\t if (format === undefined) {\n\t throw new Error('invariant requires an error message argument');\n\t }\n\t };\n\t}\n\t\n\tfunction invariant(condition, format, a, b, c, d, e, f) {\n\t validateFormat(format);\n\t\n\t if (!condition) {\n\t var error;\n\t if (format === undefined) {\n\t error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n\t } else {\n\t var args = [a, b, c, d, e, f];\n\t var argIndex = 0;\n\t error = new Error(format.replace(/%s/g, function () {\n\t return args[argIndex++];\n\t }));\n\t error.name = 'Invariant Violation';\n\t }\n\t\n\t error.framesToPop = 1; // we don't care about invariant's own frame\n\t throw error;\n\t }\n\t}\n\t\n\tmodule.exports = invariant;\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\t\n\tmodule.exports = ReactPropTypesSecret;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\tmodule.exports = {\n\t arraysDiffer: function arraysDiffer(a, b) {\n\t var isDifferent = false;\n\t if (a.length !== b.length) {\n\t isDifferent = true;\n\t } else {\n\t a.forEach(function (item, index) {\n\t if (!this.isSame(item, b[index])) {\n\t isDifferent = true;\n\t }\n\t }, this);\n\t }\n\t return isDifferent;\n\t },\n\t\n\t objectsDiffer: function objectsDiffer(a, b) {\n\t var isDifferent = false;\n\t if (Object.keys(a).length !== Object.keys(b).length) {\n\t isDifferent = true;\n\t } else {\n\t Object.keys(a).forEach(function (key) {\n\t if (!this.isSame(a[key], b[key])) {\n\t isDifferent = true;\n\t }\n\t }, this);\n\t }\n\t return isDifferent;\n\t },\n\t\n\t isSame: function isSame(a, b) {\n\t if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) !== (typeof b === 'undefined' ? 'undefined' : _typeof(b))) {\n\t return false;\n\t } else if (Array.isArray(a) && Array.isArray(b)) {\n\t return !this.arraysDiffer(a, b);\n\t } else if (typeof a === 'function') {\n\t return a.toString() === b.toString();\n\t } else if ((typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' && a !== null && b !== null) {\n\t return !this.objectsDiffer(a, b);\n\t }\n\t\n\t return a === b;\n\t },\n\t\n\t find: function find(collection, fn) {\n\t for (var i = 0, l = collection.length; i < l; i++) {\n\t var item = collection[i];\n\t if (fn(item)) {\n\t return item;\n\t }\n\t }\n\t return null;\n\t }\n\t};\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2014-2015, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t *\n\t */\n\t\n\t'use strict';\n\t\n\tvar emptyFunction = __webpack_require__(2);\n\t\n\t/**\n\t * Similar to invariant but only logs a warning if the condition is not met.\n\t * This can be used to log issues in development environments in critical\n\t * paths. Removing the logging code for production environments will keep the\n\t * same logic and follow the same code paths.\n\t */\n\t\n\tvar warning = emptyFunction;\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t var printWarning = function printWarning(format) {\n\t for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n\t args[_key - 1] = arguments[_key];\n\t }\n\t\n\t var argIndex = 0;\n\t var message = 'Warning: ' + format.replace(/%s/g, function () {\n\t return args[argIndex++];\n\t });\n\t if (typeof console !== 'undefined') {\n\t console.error(message);\n\t }\n\t try {\n\t // --- Welcome to debugging React ---\n\t // This error was thrown as a convenience so that you can use this stack\n\t // to find the callsite that caused this warning to fire.\n\t throw new Error(message);\n\t } catch (x) {}\n\t };\n\t\n\t warning = function warning(condition, format) {\n\t if (format === undefined) {\n\t throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n\t }\n\t\n\t if (format.indexOf('Failed Composite propType: ') === 0) {\n\t return; // Ignore CompositeComponent proptype check.\n\t }\n\t\n\t if (!condition) {\n\t for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n\t args[_key2 - 2] = arguments[_key2];\n\t }\n\t\n\t printWarning.apply(undefined, [format].concat(args));\n\t }\n\t };\n\t}\n\t\n\tmodule.exports = warning;\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n\t Symbol.for &&\n\t Symbol.for('react.element')) ||\n\t 0xeac7;\n\t\n\t var isValidElement = function(object) {\n\t return typeof object === 'object' &&\n\t object !== null &&\n\t object.$$typeof === REACT_ELEMENT_TYPE;\n\t };\n\t\n\t // By explicitly using `prop-types` you are opting into new development behavior.\n\t // http://fb.me/prop-types-in-prod\n\t var throwOnDirectAccess = true;\n\t module.exports = __webpack_require__(15)(isValidElement, throwOnDirectAccess);\n\t} else {\n\t // By explicitly using `prop-types` you are opting into new production behavior.\n\t // http://fb.me/prop-types-in-prod\n\t module.exports = __webpack_require__(14)();\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_8__;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\tvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar React = global.React || __webpack_require__(8);\n\tvar PropTypes = __webpack_require__(7);\n\tvar hoistNonReactStatic = __webpack_require__(12);\n\tvar utils = __webpack_require__(5);\n\t\n\tvar convertValidationsToObject = function convertValidationsToObject(validations) {\n\t if (typeof validations === 'string') {\n\t return validations.split(/\\,(?![^{\\[]*[}\\]])/g).reduce(function (validations, validation) {\n\t var args = validation.split(':');\n\t var validateMethod = args.shift();\n\t\n\t args = args.map(function (arg) {\n\t try {\n\t return JSON.parse(arg);\n\t } catch (e) {\n\t return arg; // It is a string if it can not parse it\n\t }\n\t });\n\t\n\t if (args.length > 1) {\n\t throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n\t }\n\t\n\t validations[validateMethod] = args.length ? args[0] : true;\n\t return validations;\n\t }, {});\n\t }\n\t\n\t return validations || {};\n\t};\n\t\n\tmodule.exports = function (Component) {\n\t var WrappedComponent = function (_React$Component) {\n\t _inherits(WrappedComponent, _React$Component);\n\t\n\t function WrappedComponent() {\n\t var _ref;\n\t\n\t var _temp, _this, _ret;\n\t\n\t _classCallCheck(this, WrappedComponent);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = WrappedComponent.__proto__ || Object.getPrototypeOf(WrappedComponent)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n\t _value: typeof _this.props.value !== 'undefined' ? _this.props.value : Component.defaultProps ? Component.defaultProps.value : undefined,\n\t _isRequired: false,\n\t _isValid: true,\n\t _isPristine: true,\n\t _pristineValue: typeof _this.props.value !== 'undefined' ? _this.props.value : Component.defaultProps ? Component.defaultProps.value : undefined,\n\t _validationError: [],\n\t _externalError: null,\n\t _formSubmitted: false\n\t }, _this.setValidations = function (validations, required) {\n\t // Add validations to the store itself as the props object can not be modified\n\t _this._validations = convertValidationsToObject(validations) || {};\n\t _this._requiredValidations = required === true ? { isDefaultRequiredValue: true } : convertValidationsToObject(required);\n\t }, _this.setValue = function (value) {\n\t var validate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\t\n\t if (!validate) {\n\t _this.setState({\n\t _value: value\n\t });\n\t } else {\n\t _this.setState({\n\t _value: value,\n\t _isPristine: false\n\t }, function () {\n\t _this.context.formsy.validate(_this);\n\t //this.props._validate(this);\n\t });\n\t }\n\t }, _this.resetValue = function () {\n\t _this.setState({\n\t _value: _this.state._pristineValue,\n\t _isPristine: true\n\t }, function () {\n\t this.context.formsy.validate(this);\n\t //this.props._validate(this);\n\t });\n\t }, _this.getValue = function () {\n\t return _this.state._value;\n\t }, _this.hasValue = function () {\n\t return _this.state._value !== '';\n\t }, _this.getErrorMessage = function () {\n\t var messages = _this.getErrorMessages();\n\t return messages.length ? messages[0] : null;\n\t }, _this.getErrorMessages = function () {\n\t return !_this.isValid() || _this.showRequired() ? _this.state._externalError || _this.state._validationError || [] : [];\n\t }, _this.isFormDisabled = function () {\n\t return _this.context.formsy.isFormDisabled();\n\t //return this.props._isFormDisabled();\n\t }, _this.isValid = function () {\n\t return _this.state._isValid;\n\t }, _this.isPristine = function () {\n\t return _this.state._isPristine;\n\t }, _this.isFormSubmitted = function () {\n\t return _this.state._formSubmitted;\n\t }, _this.isRequired = function () {\n\t return !!_this.props.required;\n\t }, _this.showRequired = function () {\n\t return _this.state._isRequired;\n\t }, _this.showError = function () {\n\t return !_this.showRequired() && !_this.isValid();\n\t }, _this.isValidValue = function (value) {\n\t return _this.context.formsy.isValidValue.call(null, _this, value);\n\t //return this.props._isValidValue.call(null, this, value);\n\t }, _temp), _possibleConstructorReturn(_this, _ret);\n\t }\n\t\n\t _createClass(WrappedComponent, [{\n\t key: 'componentWillMount',\n\t value: function componentWillMount() {\n\t var _this2 = this;\n\t\n\t var configure = function configure() {\n\t _this2.setValidations(_this2.props.validations, _this2.props.required);\n\t\n\t // Pass a function instead?\n\t _this2.context.formsy.attachToForm(_this2);\n\t //this.props._attachToForm(this);\n\t };\n\t\n\t if (!this.props.name) {\n\t throw new Error('Form Input requires a name property when used');\n\t }\n\t\n\t configure();\n\t }\n\t\n\t // We have to make the validate method is kept when new props are added\n\t\n\t }, {\n\t key: 'componentWillReceiveProps',\n\t value: function componentWillReceiveProps(nextProps) {\n\t this.setValidations(nextProps.validations, nextProps.required);\n\t }\n\t }, {\n\t key: 'componentDidUpdate',\n\t value: function componentDidUpdate(prevProps) {\n\t // If the value passed has changed, set it. If value is not passed it will\n\t // internally update, and this will never run\n\t if (!utils.isSame(this.props.value, prevProps.value)) {\n\t this.setValue(this.props.value);\n\t }\n\t\n\t // If validations or required is changed, run a new validation\n\t if (!utils.isSame(this.props.validations, prevProps.validations) || !utils.isSame(this.props.required, prevProps.required)) {\n\t this.context.formsy.validate(this);\n\t }\n\t }\n\t\n\t // Detach it when component unmounts\n\t\n\t }, {\n\t key: 'componentWillUnmount',\n\t value: function componentWillUnmount() {\n\t this.context.formsy.detachFromForm(this);\n\t //this.props._detachFromForm(this);\n\t }\n\t\n\t // By default, we validate after the value has been set.\n\t // A user can override this and pass a second parameter of `false` to skip validation.\n\t\n\t }, {\n\t key: 'render',\n\t value: function render() {\n\t var innerRef = this.props.innerRef;\n\t\n\t var propsForElement = _extends({\n\t setValidations: this.setValidations,\n\t setValue: this.setValue,\n\t resetValue: this.resetValue,\n\t getValue: this.getValue,\n\t hasValue: this.hasValue,\n\t getErrorMessage: this.getErrorMessage,\n\t getErrorMessages: this.getErrorMessages,\n\t isFormDisabled: this.isFormDisabled,\n\t isValid: this.isValid,\n\t isPristine: this.isPristine,\n\t isFormSubmitted: this.isFormSubmitted,\n\t isRequired: this.isRequired,\n\t showRequired: this.showRequired,\n\t showError: this.showError,\n\t isValidValue: this.isValidValue\n\t }, this.props);\n\t\n\t if (innerRef) {\n\t propsForElement.ref = innerRef;\n\t }\n\t\n\t return React.createElement(Component, propsForElement);\n\t }\n\t }]);\n\t\n\t return WrappedComponent;\n\t }(React.Component);\n\t\n\t WrappedComponent.displayName = 'Formsy(' + getDisplayName(Component) + ')';\n\t WrappedComponent.contextTypes = {\n\t formsy: PropTypes.object // What about required?\n\t };\n\t WrappedComponent.defaultProps = {\n\t validationError: '',\n\t validationErrors: {}\n\t };\n\t\n\t return hoistNonReactStatic(WrappedComponent, Component);\n\t};\n\t\n\tfunction getDisplayName(Component) {\n\t return Component.displayName || Component.name || (typeof Component === 'string' ? Component : 'Component');\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar _isExisty = function _isExisty(value) {\n\t return value !== null && value !== undefined;\n\t};\n\t\n\tvar isEmpty = function isEmpty(value) {\n\t return value === '';\n\t};\n\t\n\tvar validations = {\n\t isDefaultRequiredValue: function isDefaultRequiredValue(values, value) {\n\t return value === undefined || value === '';\n\t },\n\t isExisty: function isExisty(values, value) {\n\t return _isExisty(value);\n\t },\n\t matchRegexp: function matchRegexp(values, value, regexp) {\n\t return !_isExisty(value) || isEmpty(value) || regexp.test(value);\n\t },\n\t isUndefined: function isUndefined(values, value) {\n\t return value === undefined;\n\t },\n\t isEmptyString: function isEmptyString(values, value) {\n\t return isEmpty(value);\n\t },\n\t isEmail: function isEmail(values, value) {\n\t return validations.matchRegexp(values, value, /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i);\n\t },\n\t isUrl: function isUrl(values, value) {\n\t return validations.matchRegexp(values, value, /^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)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|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i);\n\t },\n\t isTrue: function isTrue(values, value) {\n\t return value === true;\n\t },\n\t isFalse: function isFalse(values, value) {\n\t return value === false;\n\t },\n\t isNumeric: function isNumeric(values, value) {\n\t if (typeof value === 'number') {\n\t return true;\n\t }\n\t return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n\t },\n\t isAlpha: function isAlpha(values, value) {\n\t return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n\t },\n\t isAlphanumeric: function isAlphanumeric(values, value) {\n\t return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n\t },\n\t isInt: function isInt(values, value) {\n\t return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n\t },\n\t isFloat: function isFloat(values, value) {\n\t return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][\\+\\-]?(?:\\d+))?$/);\n\t },\n\t isWords: function isWords(values, value) {\n\t return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n\t },\n\t isSpecialWords: function isSpecialWords(values, value) {\n\t return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n\t },\n\t isLength: function isLength(values, value, length) {\n\t return !_isExisty(value) || isEmpty(value) || value.length === length;\n\t },\n\t equals: function equals(values, value, eql) {\n\t return !_isExisty(value) || isEmpty(value) || value == eql;\n\t },\n\t equalsField: function equalsField(values, value, field) {\n\t return value == values[field];\n\t },\n\t maxLength: function maxLength(values, value, length) {\n\t return !_isExisty(value) || value.length <= length;\n\t },\n\t minLength: function minLength(values, value, length) {\n\t return !_isExisty(value) || isEmpty(value) || value.length >= length;\n\t }\n\t};\n\t\n\tmodule.exports = validations;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\tfunction toObj(source) {\n\t return Object.keys(source).reduce(function (output, key) {\n\t var parentKey = key.match(/[^\\[]*/i);\n\t var paths = key.match(/\\[.*?\\]/g) || [];\n\t paths = [parentKey[0]].concat(paths).map(function (key) {\n\t return key.replace(/\\[|\\]/g, '');\n\t });\n\t var currentPath = output;\n\t while (paths.length) {\n\t var pathKey = paths.shift();\n\t\n\t if (pathKey in currentPath) {\n\t currentPath = currentPath[pathKey];\n\t } else {\n\t currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n\t currentPath = currentPath[pathKey];\n\t }\n\t }\n\t\n\t return output;\n\t }, {});\n\t}\n\t\n\tfunction fromObj(obj) {\n\t function recur(newObj, propName, currVal) {\n\t if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n\t Object.keys(currVal).forEach(function(v) {\n\t recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n\t });\n\t return newObj;\n\t }\n\t\n\t newObj[propName] = currVal;\n\t return newObj;\n\t }\n\t\n\t var keys = Object.keys(obj);\n\t return keys.reduce(function(newObj, propName) {\n\t return recur(newObj, propName, obj[propName]);\n\t }, {});\n\t}\n\t\n\tmodule.exports = {\n\t fromObj: fromObj,\n\t toObj: toObj\n\t}\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Copyright 2015, Yahoo! Inc.\n\t * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n\t */\n\t'use strict';\n\t\n\tvar REACT_STATICS = {\n\t childContextTypes: true,\n\t contextTypes: true,\n\t defaultProps: true,\n\t displayName: true,\n\t getDefaultProps: true,\n\t mixins: true,\n\t propTypes: true,\n\t type: true\n\t};\n\t\n\tvar KNOWN_STATICS = {\n\t name: true,\n\t length: true,\n\t prototype: true,\n\t caller: true,\n\t callee: true,\n\t arguments: true,\n\t arity: true\n\t};\n\t\n\tvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\n\tvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\tvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar getPrototypeOf = Object.getPrototypeOf;\n\tvar objectPrototype = getPrototypeOf && getPrototypeOf(Object);\n\tvar getOwnPropertyNames = Object.getOwnPropertyNames;\n\t\n\tmodule.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n\t if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n\t\n\t if (objectPrototype) {\n\t var inheritedComponent = getPrototypeOf(sourceComponent);\n\t if (inheritedComponent && inheritedComponent !== objectPrototype) {\n\t hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n\t }\n\t }\n\t\n\t var keys = getOwnPropertyNames(sourceComponent);\n\t\n\t if (getOwnPropertySymbols) {\n\t keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n\t }\n\t\n\t for (var i = 0; i < keys.length; ++i) {\n\t var key = keys[i];\n\t if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n\t // Only hoist enumerables and non-enumerable functions\n\t if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') {\n\t try { // Avoid failures from read-only properties\n\t targetComponent[key] = sourceComponent[key];\n\t } catch (e) {}\n\t }\n\t }\n\t }\n\t\n\t return targetComponent;\n\t }\n\t\n\t return targetComponent;\n\t};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tif (process.env.NODE_ENV !== 'production') {\n\t var invariant = __webpack_require__(3);\n\t var warning = __webpack_require__(6);\n\t var ReactPropTypesSecret = __webpack_require__(4);\n\t var loggedTypeFailures = {};\n\t}\n\t\n\t/**\n\t * Assert that the values match with the type specs.\n\t * Error messages are memorized and will only be shown once.\n\t *\n\t * @param {object} typeSpecs Map of name to a ReactPropType\n\t * @param {object} values Runtime values that need to be type-checked\n\t * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n\t * @param {string} componentName Name of the component for error messages.\n\t * @param {?Function} getStack Returns the component stack.\n\t * @private\n\t */\n\tfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n\t if (process.env.NODE_ENV !== 'production') {\n\t for (var typeSpecName in typeSpecs) {\n\t if (typeSpecs.hasOwnProperty(typeSpecName)) {\n\t var error;\n\t // Prop type validation may throw. In case they do, we don't want to\n\t // fail the render phase where it didn't fail before. So we log it.\n\t // After these have been cleaned up, we'll let them throw.\n\t try {\n\t // This is intentionally an invariant that gets caught. It's the same\n\t // behavior as without this statement except with a better message.\n\t invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n\t error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n\t } catch (ex) {\n\t error = ex;\n\t }\n\t warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n\t if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n\t // Only monitor this failure once because there tends to be a lot of the\n\t // same error.\n\t loggedTypeFailures[error.message] = true;\n\t\n\t var stack = getStack ? getStack() : '';\n\t\n\t warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n\t }\n\t }\n\t }\n\t }\n\t}\n\t\n\tmodule.exports = checkPropTypes;\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tvar emptyFunction = __webpack_require__(2);\n\tvar invariant = __webpack_require__(3);\n\tvar ReactPropTypesSecret = __webpack_require__(4);\n\t\n\tmodule.exports = function() {\n\t function shim(props, propName, componentName, location, propFullName, secret) {\n\t if (secret === ReactPropTypesSecret) {\n\t // It is still safe when called from React.\n\t return;\n\t }\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t };\n\t shim.isRequired = shim;\n\t function getShim() {\n\t return shim;\n\t };\n\t // Important!\n\t // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\t var ReactPropTypes = {\n\t array: shim,\n\t bool: shim,\n\t func: shim,\n\t number: shim,\n\t object: shim,\n\t string: shim,\n\t symbol: shim,\n\t\n\t any: shim,\n\t arrayOf: getShim,\n\t element: shim,\n\t instanceOf: getShim,\n\t node: shim,\n\t objectOf: getShim,\n\t oneOf: getShim,\n\t oneOfType: getShim,\n\t shape: getShim\n\t };\n\t\n\t ReactPropTypes.checkPropTypes = emptyFunction;\n\t ReactPropTypes.PropTypes = ReactPropTypes;\n\t\n\t return ReactPropTypes;\n\t};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * Copyright 2013-present, Facebook, Inc.\n\t * All rights reserved.\n\t *\n\t * This source code is licensed under the BSD-style license found in the\n\t * LICENSE file in the root directory of this source tree. An additional grant\n\t * of patent rights can be found in the PATENTS file in the same directory.\n\t */\n\t\n\t'use strict';\n\t\n\tvar emptyFunction = __webpack_require__(2);\n\tvar invariant = __webpack_require__(3);\n\tvar warning = __webpack_require__(6);\n\t\n\tvar ReactPropTypesSecret = __webpack_require__(4);\n\tvar checkPropTypes = __webpack_require__(13);\n\t\n\tmodule.exports = function(isValidElement, throwOnDirectAccess) {\n\t /* global Symbol */\n\t var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n\t var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\t\n\t /**\n\t * Returns the iterator method function contained on the iterable object.\n\t *\n\t * Be sure to invoke the function with the iterable as context:\n\t *\n\t * var iteratorFn = getIteratorFn(myIterable);\n\t * if (iteratorFn) {\n\t * var iterator = iteratorFn.call(myIterable);\n\t * ...\n\t * }\n\t *\n\t * @param {?object} maybeIterable\n\t * @return {?function}\n\t */\n\t function getIteratorFn(maybeIterable) {\n\t var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n\t if (typeof iteratorFn === 'function') {\n\t return iteratorFn;\n\t }\n\t }\n\t\n\t /**\n\t * Collection of methods that allow declaration and validation of props that are\n\t * supplied to React components. Example usage:\n\t *\n\t * var Props = require('ReactPropTypes');\n\t * var MyArticle = React.createClass({\n\t * propTypes: {\n\t * // An optional string prop named \"description\".\n\t * description: Props.string,\n\t *\n\t * // A required enum prop named \"category\".\n\t * category: Props.oneOf(['News','Photos']).isRequired,\n\t *\n\t * // A prop named \"dialog\" that requires an instance of Dialog.\n\t * dialog: Props.instanceOf(Dialog).isRequired\n\t * },\n\t * render: function() { ... }\n\t * });\n\t *\n\t * A more formal specification of how these methods are used:\n\t *\n\t * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n\t * decl := ReactPropTypes.{type}(.isRequired)?\n\t *\n\t * Each and every declaration produces a function with the same signature. This\n\t * allows the creation of custom validation functions. For example:\n\t *\n\t * var MyLink = React.createClass({\n\t * propTypes: {\n\t * // An optional string or URI prop named \"href\".\n\t * href: function(props, propName, componentName) {\n\t * var propValue = props[propName];\n\t * if (propValue != null && typeof propValue !== 'string' &&\n\t * !(propValue instanceof URI)) {\n\t * return new Error(\n\t * 'Expected a string or an URI for ' + propName + ' in ' +\n\t * componentName\n\t * );\n\t * }\n\t * }\n\t * },\n\t * render: function() {...}\n\t * });\n\t *\n\t * @internal\n\t */\n\t\n\t var ANONYMOUS = '<>';\n\t\n\t // Important!\n\t // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n\t var ReactPropTypes = {\n\t array: createPrimitiveTypeChecker('array'),\n\t bool: createPrimitiveTypeChecker('boolean'),\n\t func: createPrimitiveTypeChecker('function'),\n\t number: createPrimitiveTypeChecker('number'),\n\t object: createPrimitiveTypeChecker('object'),\n\t string: createPrimitiveTypeChecker('string'),\n\t symbol: createPrimitiveTypeChecker('symbol'),\n\t\n\t any: createAnyTypeChecker(),\n\t arrayOf: createArrayOfTypeChecker,\n\t element: createElementTypeChecker(),\n\t instanceOf: createInstanceTypeChecker,\n\t node: createNodeChecker(),\n\t objectOf: createObjectOfTypeChecker,\n\t oneOf: createEnumTypeChecker,\n\t oneOfType: createUnionTypeChecker,\n\t shape: createShapeTypeChecker\n\t };\n\t\n\t /**\n\t * inlined Object.is polyfill to avoid requiring consumers ship their own\n\t * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n\t */\n\t /*eslint-disable no-self-compare*/\n\t function is(x, y) {\n\t // SameValue algorithm\n\t if (x === y) {\n\t // Steps 1-5, 7-10\n\t // Steps 6.b-6.e: +0 != -0\n\t return x !== 0 || 1 / x === 1 / y;\n\t } else {\n\t // Step 6.a: NaN == NaN\n\t return x !== x && y !== y;\n\t }\n\t }\n\t /*eslint-enable no-self-compare*/\n\t\n\t /**\n\t * We use an Error-like object for backward compatibility as people may call\n\t * PropTypes directly and inspect their output. However, we don't use real\n\t * Errors anymore. We don't inspect their stack anyway, and creating them\n\t * is prohibitively expensive if they are created too often, such as what\n\t * happens in oneOfType() for any type before the one that matched.\n\t */\n\t function PropTypeError(message) {\n\t this.message = message;\n\t this.stack = '';\n\t }\n\t // Make `instanceof Error` still work for returned errors.\n\t PropTypeError.prototype = Error.prototype;\n\t\n\t function createChainableTypeChecker(validate) {\n\t if (process.env.NODE_ENV !== 'production') {\n\t var manualPropTypeCallCache = {};\n\t var manualPropTypeWarningCount = 0;\n\t }\n\t function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n\t componentName = componentName || ANONYMOUS;\n\t propFullName = propFullName || propName;\n\t\n\t if (secret !== ReactPropTypesSecret) {\n\t if (throwOnDirectAccess) {\n\t // New behavior only for users of `prop-types` package\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use `PropTypes.checkPropTypes()` to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n\t // Old behavior for people using React.PropTypes\n\t var cacheKey = componentName + ':' + propName;\n\t if (\n\t !manualPropTypeCallCache[cacheKey] &&\n\t // Avoid spamming the console because they are often not actionable except for lib authors\n\t manualPropTypeWarningCount < 3\n\t ) {\n\t warning(\n\t false,\n\t 'You are manually calling a React.PropTypes validation ' +\n\t 'function for the `%s` prop on `%s`. This is deprecated ' +\n\t 'and will throw in the standalone `prop-types` package. ' +\n\t 'You may be seeing this warning due to a third-party PropTypes ' +\n\t 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n\t propFullName,\n\t componentName\n\t );\n\t manualPropTypeCallCache[cacheKey] = true;\n\t manualPropTypeWarningCount++;\n\t }\n\t }\n\t }\n\t if (props[propName] == null) {\n\t if (isRequired) {\n\t if (props[propName] === null) {\n\t return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n\t }\n\t return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n\t }\n\t return null;\n\t } else {\n\t return validate(props, propName, componentName, location, propFullName);\n\t }\n\t }\n\t\n\t var chainedCheckType = checkType.bind(null, false);\n\t chainedCheckType.isRequired = checkType.bind(null, true);\n\t\n\t return chainedCheckType;\n\t }\n\t\n\t function createPrimitiveTypeChecker(expectedType) {\n\t function validate(props, propName, componentName, location, propFullName, secret) {\n\t var propValue = props[propName];\n\t var propType = getPropType(propValue);\n\t if (propType !== expectedType) {\n\t // `propValue` being instance of, say, date/regexp, pass the 'object'\n\t // check, but we can offer a more precise error message here rather than\n\t // 'of type `object`'.\n\t var preciseType = getPreciseType(propValue);\n\t\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createAnyTypeChecker() {\n\t return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n\t }\n\t\n\t function createArrayOfTypeChecker(typeChecker) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (typeof typeChecker !== 'function') {\n\t return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n\t }\n\t var propValue = props[propName];\n\t if (!Array.isArray(propValue)) {\n\t var propType = getPropType(propValue);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n\t }\n\t for (var i = 0; i < propValue.length; i++) {\n\t var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n\t if (error instanceof Error) {\n\t return error;\n\t }\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createElementTypeChecker() {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t var propValue = props[propName];\n\t if (!isValidElement(propValue)) {\n\t var propType = getPropType(propValue);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createInstanceTypeChecker(expectedClass) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (!(props[propName] instanceof expectedClass)) {\n\t var expectedClassName = expectedClass.name || ANONYMOUS;\n\t var actualClassName = getClassName(props[propName]);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createEnumTypeChecker(expectedValues) {\n\t if (!Array.isArray(expectedValues)) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n\t return emptyFunction.thatReturnsNull;\n\t }\n\t\n\t function validate(props, propName, componentName, location, propFullName) {\n\t var propValue = props[propName];\n\t for (var i = 0; i < expectedValues.length; i++) {\n\t if (is(propValue, expectedValues[i])) {\n\t return null;\n\t }\n\t }\n\t\n\t var valuesString = JSON.stringify(expectedValues);\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createObjectOfTypeChecker(typeChecker) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (typeof typeChecker !== 'function') {\n\t return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n\t }\n\t var propValue = props[propName];\n\t var propType = getPropType(propValue);\n\t if (propType !== 'object') {\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n\t }\n\t for (var key in propValue) {\n\t if (propValue.hasOwnProperty(key)) {\n\t var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\t if (error instanceof Error) {\n\t return error;\n\t }\n\t }\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createUnionTypeChecker(arrayOfTypeCheckers) {\n\t if (!Array.isArray(arrayOfTypeCheckers)) {\n\t process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n\t return emptyFunction.thatReturnsNull;\n\t }\n\t\n\t for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n\t var checker = arrayOfTypeCheckers[i];\n\t if (typeof checker !== 'function') {\n\t warning(\n\t false,\n\t 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +\n\t 'received %s at index %s.',\n\t getPostfixForTypeWarning(checker),\n\t i\n\t );\n\t return emptyFunction.thatReturnsNull;\n\t }\n\t }\n\t\n\t function validate(props, propName, componentName, location, propFullName) {\n\t for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n\t var checker = arrayOfTypeCheckers[i];\n\t if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n\t return null;\n\t }\n\t }\n\t\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createNodeChecker() {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t if (!isNode(props[propName])) {\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function createShapeTypeChecker(shapeTypes) {\n\t function validate(props, propName, componentName, location, propFullName) {\n\t var propValue = props[propName];\n\t var propType = getPropType(propValue);\n\t if (propType !== 'object') {\n\t return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n\t }\n\t for (var key in shapeTypes) {\n\t var checker = shapeTypes[key];\n\t if (!checker) {\n\t continue;\n\t }\n\t var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n\t if (error) {\n\t return error;\n\t }\n\t }\n\t return null;\n\t }\n\t return createChainableTypeChecker(validate);\n\t }\n\t\n\t function isNode(propValue) {\n\t switch (typeof propValue) {\n\t case 'number':\n\t case 'string':\n\t case 'undefined':\n\t return true;\n\t case 'boolean':\n\t return !propValue;\n\t case 'object':\n\t if (Array.isArray(propValue)) {\n\t return propValue.every(isNode);\n\t }\n\t if (propValue === null || isValidElement(propValue)) {\n\t return true;\n\t }\n\t\n\t var iteratorFn = getIteratorFn(propValue);\n\t if (iteratorFn) {\n\t var iterator = iteratorFn.call(propValue);\n\t var step;\n\t if (iteratorFn !== propValue.entries) {\n\t while (!(step = iterator.next()).done) {\n\t if (!isNode(step.value)) {\n\t return false;\n\t }\n\t }\n\t } else {\n\t // Iterator will provide entry [k,v] tuples rather than values.\n\t while (!(step = iterator.next()).done) {\n\t var entry = step.value;\n\t if (entry) {\n\t if (!isNode(entry[1])) {\n\t return false;\n\t }\n\t }\n\t }\n\t }\n\t } else {\n\t return false;\n\t }\n\t\n\t return true;\n\t default:\n\t return false;\n\t }\n\t }\n\t\n\t function isSymbol(propType, propValue) {\n\t // Native Symbol.\n\t if (propType === 'symbol') {\n\t return true;\n\t }\n\t\n\t // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n\t if (propValue['@@toStringTag'] === 'Symbol') {\n\t return true;\n\t }\n\t\n\t // Fallback for non-spec compliant Symbols which are polyfilled.\n\t if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n\t return true;\n\t }\n\t\n\t return false;\n\t }\n\t\n\t // Equivalent of `typeof` but with special handling for array and regexp.\n\t function getPropType(propValue) {\n\t var propType = typeof propValue;\n\t if (Array.isArray(propValue)) {\n\t return 'array';\n\t }\n\t if (propValue instanceof RegExp) {\n\t // Old webkits (at least until Android 4.0) return 'function' rather than\n\t // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n\t // passes PropTypes.object.\n\t return 'object';\n\t }\n\t if (isSymbol(propType, propValue)) {\n\t return 'symbol';\n\t }\n\t return propType;\n\t }\n\t\n\t // This handles more types than `getPropType`. Only used for error messages.\n\t // See `createPrimitiveTypeChecker`.\n\t function getPreciseType(propValue) {\n\t if (typeof propValue === 'undefined' || propValue === null) {\n\t return '' + propValue;\n\t }\n\t var propType = getPropType(propValue);\n\t if (propType === 'object') {\n\t if (propValue instanceof Date) {\n\t return 'date';\n\t } else if (propValue instanceof RegExp) {\n\t return 'regexp';\n\t }\n\t }\n\t return propType;\n\t }\n\t\n\t // Returns a string that is postfixed to a warning about an invalid type.\n\t // For example, \"undefined\" or \"of type array\"\n\t function getPostfixForTypeWarning(value) {\n\t var type = getPreciseType(value);\n\t switch (type) {\n\t case 'array':\n\t case 'object':\n\t return 'an ' + type;\n\t case 'boolean':\n\t case 'date':\n\t case 'regexp':\n\t return 'a ' + type;\n\t default:\n\t return type;\n\t }\n\t }\n\t\n\t // Returns class name of the object, if any.\n\t function getClassName(propValue) {\n\t if (!propValue.constructor || !propValue.constructor.name) {\n\t return ANONYMOUS;\n\t }\n\t return propValue.constructor.name;\n\t }\n\t\n\t ReactPropTypes.checkPropTypes = checkPropTypes;\n\t ReactPropTypes.PropTypes = ReactPropTypes;\n\t\n\t return ReactPropTypes;\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// formsy-react.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 6c38e20f8aab90d3c5b3","var PropTypes = require('prop-types');\nvar React = global.React || require('react');\nvar Formsy = {};\nvar validationRules = require('./validationRules.js');\nvar formDataToObject = require('form-data-to-object');\nvar utils = require('./utils.js');\nvar Wrapper = require('./Wrapper.js');\nvar options = {};\nvar emptyArray = [];\n\nFormsy.Wrapper = Wrapper;\nFormsy.propTypes = {\n setValidations: PropTypes.func,\n setValue: PropTypes.func,\n resetValue: PropTypes.func,\n getValue: PropTypes.func,\n hasValue: PropTypes.func,\n getErrorMessage: PropTypes.func,\n getErrorMessages: PropTypes.func,\n isFormDisabled: PropTypes.func,\n isValid: PropTypes.func,\n isPristine: PropTypes.func,\n isFormSubmitted: PropTypes.func,\n isRequired: PropTypes.func,\n showRequired: PropTypes.func,\n showError: PropTypes.func,\n isValidValue: PropTypes.func\n}\n\nFormsy.defaults = function (passedOptions) {\n options = passedOptions;\n};\n\nFormsy.addValidationRule = function (name, func) {\n validationRules[name] = func;\n};\n\nFormsy.Form = class FormsyForm extends React.Component {\n static displayName = 'Formsy.Form'\n\n static defaultProps = {\n onSuccess: function () {},\n onError: function () {},\n onSubmit: function () {},\n onValidSubmit: function () {},\n onInvalidSubmit: function () {},\n onValid: function () {},\n onInvalid: function () {},\n onChange: function () {},\n validationErrors: null,\n preventExternalInvalidation: false\n }\n\n static childContextTypes = {\n formsy: PropTypes.object\n }\n\n state = {\n isValid: true,\n isSubmitting: false,\n canChange: false\n }\n\n getChildContext() {\n return {\n formsy: {\n attachToForm: this.attachToForm,\n detachFromForm: this.detachFromForm,\n validate: this.validate,\n isFormDisabled: this.isFormDisabled,\n isValidValue: (component, value) => {\n return this.runValidation(component, value).isValid;\n }\n }\n }\n }\n\n // Add a map to store the inputs of the form, a model to store\n // the values of the form and register child inputs\n componentWillMount() {\n this.inputs = [];\n }\n\n componentDidMount() {\n this.validateForm();\n }\n\n componentWillUpdate() {\n // Keep a reference to input names before form updates,\n // to check if inputs has changed after render\n this.prevInputNames = this.inputs.map(component => component.props.name);\n }\n\n componentDidUpdate() {\n if (this.props.validationErrors && typeof this.props.validationErrors === 'object' && Object.keys(this.props.validationErrors).length > 0) {\n this.setInputValidationErrors(this.props.validationErrors);\n }\n\n var newInputNames = this.inputs.map(component => component.props.name);\n if (utils.arraysDiffer(this.prevInputNames, newInputNames)) {\n this.validateForm();\n }\n\n }\n\n // Allow resetting to specified data\n reset = (data) => {\n this.setFormPristine(true);\n this.resetModel(data);\n }\n\n // Update model, submit to url prop and send the model\n submit = (event) => {\n event && event.preventDefault();\n\n // Trigger form as not pristine.\n // If any inputs have not been touched yet this will make them dirty\n // so validation becomes visible (if based on isPristine)\n this.setFormPristine(false);\n var model = this.getModel();\n this.props.onSubmit(model, this.resetModel, this.updateInputsWithError);\n this.state.isValid ? this.props.onValidSubmit(model, this.resetModel, this.updateInputsWithError) : this.props.onInvalidSubmit(model, this.resetModel, this.updateInputsWithError);\n\n }\n\n mapModel = (model) => {\n if (this.props.mapping) {\n return this.props.mapping(model)\n } else {\n return formDataToObject.toObj(Object.keys(model).reduce((mappedModel, key) => {\n\n var keyArray = key.split('.');\n var base = mappedModel;\n while (keyArray.length) {\n var currentKey = keyArray.shift();\n base = (base[currentKey] = keyArray.length ? base[currentKey] || {} : model[key]);\n }\n\n return mappedModel;\n\n }, {}));\n }\n }\n\n getModel = () => {\n var currentValues = this.getCurrentValues();\n return this.mapModel(currentValues);\n }\n\n // Reset each key in the model to the original / initial / specified value\n resetModel = (data) => {\n this.inputs.forEach(component => {\n var name = component.props.name;\n if (data && data.hasOwnProperty(name)) {\n component.setValue(data[name]);\n } else {\n component.resetValue();\n }\n });\n this.validateForm();\n }\n\n setInputValidationErrors = (errors) => {\n this.inputs.forEach(component => {\n var name = component.props.name;\n var args = [{\n _isValid: !(name in errors),\n _validationError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n\n // Checks if the values have changed from their initial value\n isChanged = () => {\n return !utils.isSame(this.getPristineValues(), this.getCurrentValues());\n }\n\n getPristineValues = () => {\n return this.inputs.reduce((data, component) => {\n var name = component.props.name;\n data[name] = component.props.value;\n return data;\n }, {});\n }\n\n // Go through errors from server and grab the components\n // stored in the inputs map. Change their state to invalid\n // and set the serverError message\n updateInputsWithError = (errors) => {\n Object.keys(errors).forEach((name, index) => {\n var component = utils.find(this.inputs, component => component.props.name === name);\n if (!component) {\n throw new Error('You are trying to update an input that does not exist. ' +\n 'Verify errors object with input names. ' + JSON.stringify(errors));\n }\n var args = [{\n _isValid: this.props.preventExternalInvalidation || false,\n _externalError: typeof errors[name] === 'string' ? [errors[name]] : errors[name]\n }];\n component.setState.apply(component, args);\n });\n }\n\n isFormDisabled = () => {\n return this.props.disabled;\n }\n\n getCurrentValues = () => {\n return this.inputs.reduce((data, component) => {\n var name = component.props.name;\n data[name] = component.state._value;\n return data;\n }, {});\n }\n\n setFormPristine = (isPristine) => {\n this.setState({\n _formSubmitted: !isPristine\n });\n\n // Iterate through each component and set it as pristine\n // or \"dirty\".\n this.inputs.forEach((component, index) => {\n component.setState({\n _formSubmitted: !isPristine,\n _isPristine: isPristine\n });\n });\n }\n\n // Use the binded values and the actual input value to\n // validate the input and set its state. Then check the\n // state of the form itself\n validate = (component) => {\n // Trigger onChange\n if (this.state.canChange) {\n this.props.onChange(this.getCurrentValues(), this.isChanged());\n }\n\n var validation = this.runValidation(component);\n // Run through the validations, split them up and call\n // the validator IF there is a value or it is required\n component.setState({\n _isValid: validation.isValid,\n _isRequired: validation.isRequired,\n _validationError: validation.error,\n _externalError: null\n }, this.validateForm);\n }\n\n // Checks validation on current value or a passed value\n runValidation = (component, value) => {\n var currentValues = this.getCurrentValues();\n var validationErrors = component.props.validationErrors;\n var validationError = component.props.validationError;\n value = value ? value : component.state._value;\n\n var validationResults = this.runRules(value, currentValues, component._validations);\n var requiredResults = this.runRules(value, currentValues, component._requiredValidations);\n\n // the component defines an explicit validate function\n if (typeof component.validate === \"function\") {\n validationResults.failed = component.validate() ? [] : ['failed'];\n }\n\n var isRequired = Object.keys(component._requiredValidations).length ? !!requiredResults.success.length : false;\n var isValid = !validationResults.failed.length && !(this.props.validationErrors && this.props.validationErrors[component.props.name]);\n\n return {\n isRequired: isRequired,\n isValid: isRequired ? false : isValid,\n error: (function () {\n\n if (isValid && !isRequired) {\n return emptyArray;\n }\n\n if (validationResults.errors.length) {\n return validationResults.errors;\n }\n\n if (this.props.validationErrors && this.props.validationErrors[component.props.name]) {\n return typeof this.props.validationErrors[component.props.name] === 'string' ? [this.props.validationErrors[component.props.name]] : this.props.validationErrors[component.props.name];\n }\n\n if (isRequired) {\n var error = validationErrors[requiredResults.success[0]];\n return error ? [error] : null;\n }\n\n if (validationResults.failed.length) {\n return validationResults.failed.map(function(failed) {\n return validationErrors[failed] ? validationErrors[failed] : validationError;\n }).filter(function(x, pos, arr) {\n // Remove duplicates\n return arr.indexOf(x) === pos;\n });\n }\n\n }.call(this))\n };\n }\n\n runRules = (value, currentValues, validations) => {\n var results = {\n errors: [],\n failed: [],\n success: []\n };\n\n if (Object.keys(validations).length) {\n Object.keys(validations).forEach(function (validationMethod) {\n\n if (validationRules[validationMethod] && typeof validations[validationMethod] === 'function') {\n throw new Error('Formsy does not allow you to override default validations: ' + validationMethod);\n }\n\n if (!validationRules[validationMethod] && typeof validations[validationMethod] !== 'function') {\n throw new Error('Formsy does not have the validation rule: ' + validationMethod);\n }\n\n if (typeof validations[validationMethod] === 'function') {\n var validation = validations[validationMethod](currentValues, value);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n }\n return;\n\n } else if (typeof validations[validationMethod] !== 'function') {\n var validation = validationRules[validationMethod](currentValues, value, validations[validationMethod]);\n if (typeof validation === 'string') {\n results.errors.push(validation);\n results.failed.push(validationMethod);\n } else if (!validation) {\n results.failed.push(validationMethod);\n } else {\n results.success.push(validationMethod);\n }\n return;\n\n }\n\n return results.success.push(validationMethod);\n\n });\n }\n\n return results;\n }\n\n // Validate the form by going through all child input components\n // and check their state\n validateForm = () => {\n // We need a callback as we are validating all inputs again. This will\n // run when the last component has set its state\n var onValidationComplete = function () {\n var allIsValid = this.inputs.every(component => {\n return component.state._isValid;\n });\n\n this.setState({\n isValid: allIsValid\n });\n\n if (allIsValid) {\n this.props.onValid();\n } else {\n this.props.onInvalid();\n }\n\n // Tell the form that it can start to trigger change events\n this.setState({\n canChange: true\n });\n\n }.bind(this);\n\n // Run validation again in case affected by other inputs. The\n // last component validated will run the onValidationComplete callback\n this.inputs.forEach((component, index) => {\n var validation = this.runValidation(component);\n if (validation.isValid && component.state._externalError) {\n validation.isValid = false;\n }\n component.setState({\n _isValid: validation.isValid,\n _isRequired: validation.isRequired,\n _validationError: validation.error,\n _externalError: !validation.isValid && component.state._externalError ? component.state._externalError : null\n }, index === this.inputs.length - 1 ? onValidationComplete : null);\n });\n\n // If there are no inputs, set state where form is ready to trigger\n // change event. New inputs might be added later\n if (!this.inputs.length) {\n this.setState({\n canChange: true\n });\n }\n }\n\n // Method put on each input component to register\n // itself to the form\n attachToForm = (component) => {\n if (this.inputs.indexOf(component) === -1) {\n this.inputs.push(component);\n }\n\n this.validate(component);\n }\n\n // Method put on each input component to unregister\n // itself from the form\n detachFromForm = (component) => {\n var componentPos = this.inputs.indexOf(component);\n\n if (componentPos !== -1) {\n this.inputs = this.inputs.slice(0, componentPos)\n .concat(this.inputs.slice(componentPos + 1));\n }\n\n this.validateForm();\n }\n\n render() {\n var {\n mapping,\n validationErrors,\n onSubmit,\n onValid,\n onValidSubmit,\n onInvalid,\n onInvalidSubmit,\n onChange,\n reset,\n preventExternalInvalidation,\n onSuccess,\n onError,\n ...nonFormsyProps\n } = this.props;\n\n return (\n
\n {this.props.children}\n
\n );\n\n }\n}\n\nif (!global.exports && !global.module && (!global.define || !global.define.amd)) {\n global.Formsy = Formsy;\n}\n\nmodule.exports = Formsy;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 1\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyFunction.js\n// module id = 2\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/invariant.js\n// module id = 3\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 4\n// module chunks = 0","module.exports = {\n arraysDiffer: function (a, b) {\n var isDifferent = false;\n if (a.length !== b.length) {\n isDifferent = true;\n } else {\n a.forEach(function (item, index) {\n if (!this.isSame(item, b[index])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n objectsDiffer: function (a, b) {\n var isDifferent = false;\n if (Object.keys(a).length !== Object.keys(b).length) {\n isDifferent = true;\n } else {\n Object.keys(a).forEach(function (key) {\n if (!this.isSame(a[key], b[key])) {\n isDifferent = true;\n }\n }, this);\n }\n return isDifferent;\n },\n\n isSame: function (a, b) {\n if (typeof a !== typeof b) {\n return false;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n return !this.arraysDiffer(a, b);\n } else if (typeof a === 'function') {\n return a.toString() === b.toString();\n } else if (typeof a === 'object' && a !== null && b !== null) {\n return !this.objectsDiffer(a, b);\n }\n\n return a === b;\n },\n\n find: function (collection, fn) {\n for (var i = 0, l = collection.length; i < l; i++) {\n var item = collection[i];\n if (fn(item)) {\n return item;\n }\n }\n return null;\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/warning.js\n// module id = 6\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 7\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_8__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 8\n// module chunks = 0","var React = global.React || require('react');\nvar PropTypes = require('prop-types');\nvar hoistNonReactStatic = require('hoist-non-react-statics');\nvar utils = require('./utils.js');\n\nvar convertValidationsToObject = function (validations) {\n if (typeof validations === 'string') {\n return validations.split(/\\,(?![^{\\[]*[}\\]])/g).reduce(function (validations, validation) {\n var args = validation.split(':');\n var validateMethod = args.shift();\n\n args = args.map(function (arg) {\n try {\n return JSON.parse(arg);\n } catch (e) {\n return arg; // It is a string if it can not parse it\n }\n });\n\n if (args.length > 1) {\n throw new Error('Formsy does not support multiple args on string validations. Use object format of validations instead.');\n }\n\n validations[validateMethod] = args.length ? args[0] : true;\n return validations;\n }, {});\n\n }\n\n return validations || {};\n};\n\nmodule.exports = function (Component) {\n class WrappedComponent extends React.Component {\n static displayName = 'Formsy(' + getDisplayName(Component) + ')';\n\n state = {\n _value: typeof this.props.value !== 'undefined' ? this.props.value : Component.defaultProps ? Component.defaultProps.value : undefined,\n _isRequired: false,\n _isValid: true,\n _isPristine: true,\n _pristineValue: typeof this.props.value !== 'undefined' ? this.props.value : Component.defaultProps ? Component.defaultProps.value : undefined,\n _validationError: [],\n _externalError: null,\n _formSubmitted: false\n }\n\n static contextTypes = {\n formsy: PropTypes.object // What about required?\n }\n\n static defaultProps = {\n validationError: '',\n validationErrors: {}\n }\n\n componentWillMount() {\n var configure = () => {\n this.setValidations(this.props.validations, this.props.required);\n\n // Pass a function instead?\n this.context.formsy.attachToForm(this);\n //this.props._attachToForm(this);\n }\n\n if (!this.props.name) {\n throw new Error('Form Input requires a name property when used');\n }\n\n configure();\n }\n\n // We have to make the validate method is kept when new props are added\n componentWillReceiveProps(nextProps) {\n this.setValidations(nextProps.validations, nextProps.required);\n }\n\n componentDidUpdate(prevProps) {\n // If the value passed has changed, set it. If value is not passed it will\n // internally update, and this will never run\n if (!utils.isSame(this.props.value, prevProps.value)) {\n this.setValue(this.props.value);\n }\n\n // If validations or required is changed, run a new validation\n if (!utils.isSame(this.props.validations, prevProps.validations) || !utils.isSame(this.props.required, prevProps.required)) {\n this.context.formsy.validate(this);\n }\n }\n\n // Detach it when component unmounts\n componentWillUnmount() {\n this.context.formsy.detachFromForm(this);\n //this.props._detachFromForm(this);\n }\n\n setValidations = (validations, required) => {\n // Add validations to the store itself as the props object can not be modified\n this._validations = convertValidationsToObject(validations) || {};\n this._requiredValidations = required === true ? {isDefaultRequiredValue: true} : convertValidationsToObject(required);\n }\n\n // By default, we validate after the value has been set.\n // A user can override this and pass a second parameter of `false` to skip validation.\n setValue = (value, validate = true) => {\n if (!validate) {\n this.setState({\n _value: value\n });\n } else {\n this.setState({\n _value: value,\n _isPristine: false\n }, () => {\n this.context.formsy.validate(this);\n //this.props._validate(this);\n });\n }\n }\n\n resetValue = () => {\n this.setState({\n _value: this.state._pristineValue,\n _isPristine: true\n }, function () {\n this.context.formsy.validate(this);\n //this.props._validate(this);\n });\n }\n\n getValue = () => {\n return this.state._value;\n }\n\n hasValue = () => {\n return this.state._value !== '';\n }\n\n getErrorMessage = () => {\n var messages = this.getErrorMessages();\n return messages.length ? messages[0] : null;\n }\n\n getErrorMessages = () => {\n return !this.isValid() || this.showRequired() ? (this.state._externalError || this.state._validationError || []) : [];\n }\n\n isFormDisabled = () => {\n return this.context.formsy.isFormDisabled();\n //return this.props._isFormDisabled();\n }\n\n isValid = () => {\n return this.state._isValid;\n }\n\n isPristine = () => {\n return this.state._isPristine;\n }\n\n isFormSubmitted = () => {\n return this.state._formSubmitted;\n }\n\n isRequired = () => {\n return !!this.props.required;\n }\n\n showRequired = () => {\n return this.state._isRequired;\n }\n\n showError = () => {\n return !this.showRequired() && !this.isValid();\n }\n\n isValidValue = (value) => {\n return this.context.formsy.isValidValue.call(null, this, value);\n //return this.props._isValidValue.call(null, this, value);\n }\n\n render() {\n const { innerRef } = this.props;\n const propsForElement = {\n setValidations: this.setValidations,\n setValue: this.setValue,\n resetValue: this.resetValue,\n getValue: this.getValue,\n hasValue: this.hasValue,\n getErrorMessage: this.getErrorMessage,\n getErrorMessages: this.getErrorMessages,\n isFormDisabled: this.isFormDisabled,\n isValid: this.isValid,\n isPristine: this.isPristine,\n isFormSubmitted: this.isFormSubmitted,\n isRequired: this.isRequired,\n showRequired: this.showRequired,\n showError: this.showError,\n isValidValue: this.isValidValue,\n ...this.props\n };\n\n if (innerRef) {\n propsForElement.ref = innerRef;\n }\n\n return \n }\n }\n return hoistNonReactStatic(WrappedComponent, Component);\n};\n\nfunction getDisplayName(Component) {\n return (\n Component.displayName ||\n Component.name ||\n (typeof Component === 'string' ? Component : 'Component')\n );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Wrapper.js","var isExisty = function (value) {\n return value !== null && value !== undefined;\n};\n\nvar isEmpty = function (value) {\n return value === '';\n};\n\nvar validations = {\n isDefaultRequiredValue: function (values, value) {\n return value === undefined || value === '';\n },\n isExisty: function (values, value) {\n return isExisty(value);\n },\n matchRegexp: function (values, value, regexp) {\n return !isExisty(value) || isEmpty(value) || regexp.test(value);\n },\n isUndefined: function (values, value) {\n return value === undefined;\n },\n isEmptyString: function (values, value) {\n return isEmpty(value);\n },\n isEmail: function (values, value) {\n return validations.matchRegexp(values, value, /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i);\n },\n isUrl: function (values, value) {\n return validations.matchRegexp(values, value, /^(https?|s?ftp):\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?(#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i);\n },\n isTrue: function (values, value) {\n return value === true;\n },\n isFalse: function (values, value) {\n return value === false;\n },\n isNumeric: function (values, value) {\n if (typeof value === 'number') {\n return true;\n }\n return validations.matchRegexp(values, value, /^[-+]?(?:\\d*[.])?\\d+$/);\n },\n isAlpha: function (values, value) {\n return validations.matchRegexp(values, value, /^[A-Z]+$/i);\n },\n isAlphanumeric: function (values, value) {\n return validations.matchRegexp(values, value, /^[0-9A-Z]+$/i);\n },\n isInt: function (values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:0|[1-9]\\d*))$/);\n },\n isFloat: function (values, value) {\n return validations.matchRegexp(values, value, /^(?:[-+]?(?:\\d+))?(?:\\.\\d*)?(?:[eE][\\+\\-]?(?:\\d+))?$/);\n },\n isWords: function (values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s]+$/i);\n },\n isSpecialWords: function (values, value) {\n return validations.matchRegexp(values, value, /^[A-Z\\s\\u00C0-\\u017F]+$/i);\n },\n isLength: function (values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length === length;\n },\n equals: function (values, value, eql) {\n return !isExisty(value) || isEmpty(value) || value == eql;\n },\n equalsField: function (values, value, field) {\n return value == values[field];\n },\n maxLength: function (values, value, length) {\n return !isExisty(value) || value.length <= length;\n },\n minLength: function (values, value, length) {\n return !isExisty(value) || isEmpty(value) || value.length >= length;\n }\n};\n\nmodule.exports = validations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/validationRules.js","function toObj(source) {\n return Object.keys(source).reduce(function (output, key) {\n var parentKey = key.match(/[^\\[]*/i);\n var paths = key.match(/\\[.*?\\]/g) || [];\n paths = [parentKey[0]].concat(paths).map(function (key) {\n return key.replace(/\\[|\\]/g, '');\n });\n var currentPath = output;\n while (paths.length) {\n var pathKey = paths.shift();\n\n if (pathKey in currentPath) {\n currentPath = currentPath[pathKey];\n } else {\n currentPath[pathKey] = paths.length ? isNaN(paths[0]) ? {} : [] : source[key];\n currentPath = currentPath[pathKey];\n }\n }\n\n return output;\n }, {});\n}\n\nfunction fromObj(obj) {\n function recur(newObj, propName, currVal) {\n if (Array.isArray(currVal) || Object.prototype.toString.call(currVal) === '[object Object]') {\n Object.keys(currVal).forEach(function(v) {\n recur(newObj, propName + \"[\" + v + \"]\", currVal[v]);\n });\n return newObj;\n }\n\n newObj[propName] = currVal;\n return newObj;\n }\n\n var keys = Object.keys(obj);\n return keys.reduce(function(newObj, propName) {\n return recur(newObj, propName, obj[propName]);\n }, {});\n}\n\nmodule.exports = {\n fromObj: fromObj,\n toObj: toObj\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/form-data-to-object/index.js\n// module id = 11\n// module chunks = 0","/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\n'use strict';\n\nvar REACT_STATICS = {\n childContextTypes: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\n\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\n\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = getPrototypeOf && getPrototypeOf(Object);\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\n\nmodule.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components\n\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {\n // Only hoist enumerables and non-enumerable functions\n if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') {\n try { // Avoid failures from read-only properties\n targetComponent[key] = sourceComponent[key];\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n }\n\n return targetComponent;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hoist-non-react-statics/index.js\n// module id = 12\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/checkPropTypes.js\n// module id = 13\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithThrowingShims.js\n// module id = 14\n// module chunks = 0","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithTypeCheckers.js\n// module id = 15\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/src/HOC.js b/src/Wrapper.js similarity index 87% rename from src/HOC.js rename to src/Wrapper.js index 6ef3116..95a3276 100644 --- a/src/HOC.js +++ b/src/Wrapper.js @@ -35,11 +35,11 @@ module.exports = function (Component) { static displayName = 'Formsy(' + getDisplayName(Component) + ')'; state = { - _value: this.props.value, + _value: typeof this.props.value !== 'undefined' ? this.props.value : Component.defaultProps ? Component.defaultProps.value : undefined, _isRequired: false, _isValid: true, _isPristine: true, - _pristineValue: this.props.value, + _pristineValue: typeof this.props.value !== 'undefined' ? this.props.value : Component.defaultProps ? Component.defaultProps.value : undefined, _validationError: [], _externalError: null, _formSubmitted: false @@ -100,15 +100,22 @@ module.exports = function (Component) { this._requiredValidations = required === true ? {isDefaultRequiredValue: true} : convertValidationsToObject(required); } - // We validate after the value has been set - setValue = (value) => { - this.setState({ - _value: value, - _isPristine: false - }, () => { - this.context.formsy.validate(this); - //this.props._validate(this); - }); + // By default, we validate after the value has been set. + // A user can override this and pass a second parameter of `false` to skip validation. + setValue = (value, validate = true) => { + if (!validate) { + this.setState({ + _value: value + }); + } else { + this.setState({ + _value: value, + _isPristine: false + }, () => { + this.context.formsy.validate(this); + //this.props._validate(this); + }); + } } resetValue = () => { diff --git a/src/index.js b/src/index.js index 23bb85a..6701857 100644 --- a/src/index.js +++ b/src/index.js @@ -4,11 +4,11 @@ var Formsy = {}; var validationRules = require('./validationRules.js'); var formDataToObject = require('form-data-to-object'); var utils = require('./utils.js'); -var HOC = require('./HOC.js'); +var Wrapper = require('./Wrapper.js'); var options = {}; var emptyArray = []; -Formsy.Wrapper = HOC; +Formsy.Wrapper = Wrapper; Formsy.propTypes = { setValidations: PropTypes.func, setValue: PropTypes.func, diff --git a/tests/Element-spec.js b/tests/Element-spec.js index a19641b..c8dc529 100644 --- a/tests/Element-spec.js +++ b/tests/Element-spec.js @@ -26,6 +26,33 @@ export default { }, + 'should only set the value and not validate when calling setValue(val, false)': function (test) { + + const Input = Formsy.Wrapper(class TestInput extends React.Component { + updateValue = (event) => { + this.props.setValue(event.target.value, false); + } + render() { + return ; + } + }) + const form = TestUtils.renderIntoDocument( + + + + ); + const inputComponent = TestUtils.findRenderedComponentWithType(form, Input); + const setStateSpy = sinon.spy(inputComponent, 'setState'); + const inputElement = TestUtils.findRenderedDOMComponentWithTag(form, 'INPUT'); + + test.equal(setStateSpy.called, false); + TestUtils.Simulate.change(inputElement, {target: {value: 'foobar'}}); + test.equal(setStateSpy.calledOnce, true); + test.equal(setStateSpy.calledWithExactly({ _value: 'foobar' }), true); + test.done(); + + }, + 'should set back to pristine value when running reset': function (test) { let reset = null; @@ -317,7 +344,6 @@ export default { }, - 'should override all error messages with error messages passed by form': function (test) { class TestForm extends React.Component {