From 4f5106dcf2d22d0d243954e8f4f6aa4fb761d3d2 Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 11:57:16 -0700 Subject: [PATCH 01/12] React.renderToStaticMarkup -> ReactDOMServer.renderToStaticMarkup --- package.json | 4 ++-- tests/customAsserts.js | 2 +- tests/formsets-server.js | 4 ++-- tests/tests.js | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d7271f7..daae6dd 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "gulp-util": "^3.0.2", "jshint-stylish": "^1.0.0", "qqunit": "^0.6.0", - "react": ">=0.14.0", - "react-dom": ">=0.14.0", + "react": ">=0.15.0", + "react-dom": ">=0.15.0", "vinyl-source-stream": "^1.0.0" }, "peerDependencies": { diff --git a/tests/customAsserts.js b/tests/customAsserts.js index cb23909..d27aa32 100644 --- a/tests/customAsserts.js +++ b/tests/customAsserts.js @@ -101,7 +101,7 @@ var reactHTMLEqual = (function() { component = React.createElement(reactClass) } - var html = React.renderToStaticMarkup(component) + var html = ReactDOMServer.renderToStaticMarkup(component) // Remove HTML for any wrapper element which was added if (wrapped) { html = html.replace(wrapperElement, '') diff --git a/tests/formsets-server.js b/tests/formsets-server.js index 9b29762..90add62 100644 --- a/tests/formsets-server.js +++ b/tests/formsets-server.js @@ -959,8 +959,8 @@ QUnit.test("Empty forms are unbound", 3, function() { strictEqual(emptyForms[0].isInitialRender, true) strictEqual(emptyForms[1].isInitialRender, true) // The empty forms should be equal - equal(React.renderToStaticMarkup(React.createElement(RenderForm, {form: emptyForms[0]})), - React.renderToStaticMarkup(React.createElement(RenderForm, {form: emptyForms[1]}))) + equal(ReactDOMServer.renderToStaticMarkup(React.createElement(RenderForm, {form: emptyForms[0]})), + ReactDOMServer.renderToStaticMarkup(React.createElement(RenderForm, {form: emptyForms[1]}))) }) QUnit.test("Empty formset is valid", 2, function() { diff --git a/tests/tests.js b/tests/tests.js index d47843a..f06dfc0 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -8,6 +8,7 @@ global.navigator = {userAgent: 'fake'} object.extend(global, require('./customAsserts.js')) global.React = window.React = require('react/dist/react.js') +global.ReactDOMServer = window.ReactDOMServer = require('react-dom/server') global.isomorph = require('isomorph') global.forms = require('../dist/newforms.js') From a10ff03f64be8daabc0d7856b3496cbb3d79950e Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 12:11:21 -0700 Subject: [PATCH 02/12] update one test --- dist/newforms.js | 196 ++++++++++++++++++++++++----------------------- tests/forms.js | 4 +- 2 files changed, 102 insertions(+), 98 deletions(-) diff --git a/dist/newforms.js b/dist/newforms.js index dc75d2c..f077e93 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 - https://github.com/insin/newforms + * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:10:56 GMT) - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o)>} an object containing * submittable value(s) held in the form's .elements collection, with * properties named as per element names or ids. */ -function getFormData(form, options) { - if (!form) { - throw new Error('A form is required by getFormData, was given form=' + form) - } +function getFormData(form) { + var options = arguments.length <= 1 || arguments[1] === undefined ? { trim: false } : arguments[1]; - if (!options) { - options = {trim: false} + if (!form) { + throw new Error('A form is required by getFormData, was given form=' + form); } - var data = {} - var elementName - var elementNames = [] - var elementNameLookup = {} + var data = {}; + var elementName = undefined; + var elementNames = []; + var elementNameLookup = {}; // Get unique submittable element names for the form for (var i = 0, l = form.elements.length; i < l; i++) { - var element = form.elements[i] - if (IGNORED_INPUT_TYPES[element.type] || element.disabled) { - continue + var element = form.elements[i]; + if (IGNORED_ELEMENT_TYPES[element.type] || element.disabled) { + continue; } - elementName = element.name || element.id + elementName = element.name || element.id; if (elementName && !elementNameLookup[elementName]) { - elementNames.push(elementName) - elementNameLookup[elementName] = true + elementNames.push(elementName); + elementNameLookup[elementName] = true; } } // Extract element data name-by-name for consistent handling of special cases // around elements which contain multiple inputs. - for (i = 0, l = elementNames.length; i < l; i++) { - elementName = elementNames[i] - var value = getNamedFormElementData(form, elementName, options) + for (var i = 0, l = elementNames.length; i < l; i++) { + elementName = elementNames[i]; + var value = getNamedFormElementData(form, elementName, options); if (value != null) { - data[elementName] = value + data[elementName] = value; } } - return data + return data; } /** * @param {HTMLFormElement} form * @param {string} elementName + * @param {Object} options * @return {(string|Array.)} submittable value(s) in the form for a * named element from its .elements collection, or null if there was no * element with that name or the element had no submittable value(s). */ -function getNamedFormElementData(form, elementName, options) { +function getNamedFormElementData(form, elementName) { + var options = arguments.length <= 2 || arguments[2] === undefined ? { trim: false } : arguments[2]; + if (!form) { - throw new Error('A form is required by getNamedFormElementData, was given form=' + form) + throw new Error('A form is required by getNamedFormElementData, was given form=' + form); } if (!elementName && toString.call(elementName) !== '[object String]') { - throw new Error('A form element name is required by getNamedFormElementData, was given elementName=' + elementName) + throw new Error('A form element name is required by getNamedFormElementData, was given elementName=' + elementName); } - var element = form.elements[elementName] + var element = form.elements[elementName]; if (!element || element.disabled) { - return null + return null; } - var trim = !!(options && options.trim) - if (!NODE_LIST_CLASSES[toString.call(element)]) { - return getFormElementValue(element, trim) + return getFormElementValue(element, options.trim); } // Deal with multiple form controls which have the same name - var data = [] - var allRadios = true + var data = []; + var allRadios = true; for (var i = 0, l = element.length; i < l; i++) { if (element[i].disabled) { - continue + continue; } if (allRadios && element[i].type !== 'radio') { - allRadios = false + allRadios = false; } - var value = getFormElementValue(element[i], trim) + var value = getFormElementValue(element[i], options.trim); if (value != null) { - data = data.concat(value) + data = data.concat(value); } } // Special case for an element with multiple same-named inputs which were all // radio buttons: if there was a selected value, only return the value. if (allRadios && data.length === 1) { - return data[0] + return data[0]; } - return (data.length > 0 ? data : null) + return data.length > 0 ? data : null; } /** @@ -8223,57 +8227,57 @@ function getNamedFormElementData(form, elementName, options) { * value(s), or null if it had none. */ function getFormElementValue(element, trim) { - var value = null + var value = null; + var type = element.type; - if (element.type === 'select-one') { + if (type === 'select-one') { if (element.options.length) { - value = element.options[element.selectedIndex].value + value = element.options[element.selectedIndex].value; } - return value + return value; } - if (element.type === 'select-multiple') { - value = [] + if (type === 'select-multiple') { + value = []; for (var i = 0, l = element.options.length; i < l; i++) { if (element.options[i].selected) { - value.push(element.options[i].value) + value.push(element.options[i].value); } } if (value.length === 0) { - value = null + value = null; } - return value + return value; } // If a file input doesn't have a files attribute, fall through to using its // value attribute. - if (element.type === 'file' && 'files' in element) { + if (type === 'file' && 'files' in element) { if (element.multiple) { - value = slice.call(element.files) + value = slice.call(element.files); if (value.length === 0) { - value = null + value = null; } - } - else { + } else { // Should be null if not present, according to the spec - value = element.files[0] + value = element.files[0]; } - return value + return value; } - if (!CHECKED_INPUT_TYPES[element.type]) { - value = (trim ? element.value.replace(TRIM_RE, '') : element.value) - } - else if (element.checked) { - value = element.value + if (!CHECKED_INPUT_TYPES[type]) { + value = trim ? element.value.replace(TRIM_RE, '') : element.value; + } else if (element.checked) { + value = element.value; } - return value + return value; } -getFormData.getNamedFormElementData = getNamedFormElementData +getFormData.getNamedFormElementData = getNamedFormElementData; -module.exports = getFormData +exports['default'] = getFormData; +module.exports = exports['default']; },{}],82:[function(require,module,exports){ 'use strict'; diff --git a/tests/forms.js b/tests/forms.js index d41f66b..e5ef59a 100644 --- a/tests/forms.js +++ b/tests/forms.js @@ -33,7 +33,7 @@ QUnit.test("Form", 12, function() { '') reactHTMLEqual(function() { return p.boundField("birthday").render() }, '') - try { p.boundField("nonexistentfield") } catch (e) { equal(e.message, "Form does not have a 'nonexistentfield' field.") } + try { p.boundField("nonexistentfield") } catch (e) { equal(e.message, "'childConstructor' does not have a 'nonexistentfield' field.") } var formOutput = [], boundFields = p.boundFields() for (var i = 0, boundField; boundField = boundFields[i]; i++) { @@ -90,7 +90,7 @@ QUnit.test('Updating form data', 32, function() { deepEqual(p.errors('birthday').messages(), ["Enter a valid date."], 'Invalid updateData data generates an error message') deepEqual(p.data, {birthday: 'invalid'}, 'form.data contains the updated data') errorEqual(p.updateData.bind(p, {nonexistentfield: true}), - "Form has no field named 'nonexistentfield'", + "'childConstructor' has no field named 'nonexistentfield'", 'An Error is thrown if updateData contains invalid field names') p.updateData({birthday: '1940-10-9'}) From 218cb1548b492521c1df7a4e9b093d76e6bfa65a Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 12:15:07 -0700 Subject: [PATCH 03/12] will revert --- dist/newforms.js | 2 +- tests/extra.js | 162 +---------------------------------------------- tests/tests.js | 23 +------ 3 files changed, 5 insertions(+), 182 deletions(-) diff --git a/dist/newforms.js b/dist/newforms.js index f077e93..12f0c23 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:10:56 GMT) - https://github.com/insin/newforms + * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:12:08 GMT) - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o\ -
\ -\ -\ -
\ -') - - var ComplexField = forms.MultiValueField.extend({ - constructor: function(kwargs) { - if (!(this instanceof ComplexField)) return new ComplexField(kwargs) - kwargs.fields = [ - forms.CharField() - , forms.MultipleChoiceField({choices: [["J", "John"], ["P", "Paul"], ["G", "George"], ["R", "Ringo"]]}) - , forms.SplitDateTimeField() - ] - forms.MultiValueField.call(this, kwargs) - } - }) - ComplexField.prototype.compress = function(dataList) { - if (dataList instanceof Array && dataList.length > 0) { - return [dataList[0], - dataList[1].join(""), - time.strftime(dataList[2], "%Y-%m-%d %H:%M:%S")].join(",") - } - return null - } - - var f = ComplexField({widget: w}) - equal(f.clean(["some text", ["J", "P"], ["2007-04-25", "6:24:00"]]), - "some text,JP,2007-04-25 06:24:00") - cleanErrorEqual(f, "Select a valid choice. X is not one of the available choices.", - ["some text", ["X"], ["2007-04-25", "6:24:00"]]) - - // If insufficient data is provided, null is substituted - cleanErrorEqual(f, "This field is required.", ["some text", ["JP"]]) - - // Test with no initial data - strictEqual(f._hasChanged(null, ["some text", ["J", "P"], ["2007-04-25","6:24:00"]]), true) - // Test when data is the same as initial - strictEqual(f._hasChanged("some text,JP,2007-04-25 06:24:00", - ["some text", ["J", "P"], ["2007-04-25","6:24:00"]]), false) - // Test when the first widget's data has changed - strictEqual(f._hasChanged("some text,JP,2007-04-25 06:24:00", - ["other text", ["J","P"], ["2007-04-25","6:24:00"]]), true) - // Test when the last widget's data has changed. This ensures that it is - // not short circuiting while testing the widgets. - strictEqual(f._hasChanged("some text,JP,2007-04-25 06:24:00", - ["some text", ["J","P"], ["2009-04-25","11:44:00"]]), true) - - var ComplexFieldForm = forms.Form.extend({ - field1: ComplexField({widget: w}) - }) - f = new ComplexFieldForm() - reactHTMLEqual(React.createElement(forms.RenderForm, {form: f}), -'
\ -
\ - \ -
\ -\ -\ -
\ -\ -\ -
\ -
') - - f = new ComplexFieldForm({data: {field1_0: "some text", field1_1 :["J", "P"], field1_2_0: "2007-04-25", field1_2_1: "06:24:00"}}) - reactHTMLEqual(React.createElement(forms.RenderForm, {form: f}), -'
\ - \ -
\ -\ -\ -
\ -\ -\ -
\ -
') - - equal(f.cleanedData["field1"], "some text,JP,2007-04-25 06:24:00") -}) - QUnit.test("Extra attrs", 1, function() { var extraAttrs = {"className": "special"} var TestForm = forms.Form.extend({ @@ -139,40 +14,7 @@ QUnit.test("Extra attrs", 1, function() { ') }) -QUnit.test("Data field", 2, function() { - var DataForm = forms.Form.extend({ - data: forms.CharField({maxLength: 10}) - }) - - var f = new DataForm({data: {data: "xyzzy"}}) - strictEqual(f.isValid(), true) - deepEqual(f.cleanedData, {data: "xyzzy"}) -}) - -QUnit.test("Forms with *only* hidden fields", 1, function() { - // A form with *only* hidden fields that has errors is going to be very - // unusual. - var HiddenForm = forms.Form.extend({ - data: forms.IntegerField({widget: forms.HiddenInput}) - }) - var f = new HiddenForm({data: {}}) - reactHTMLEqual(React.createElement(forms.RenderForm, {form: f}), -'
\ -
    \ -
  • (Hidden field data) This field is required.
  • \ -
\ -
\ -
\ -\ -
') -}) -QUnit.test("SlugField normalisation", 1, function() { - var f = forms.SlugField() - equal(f.clean(' aa-bb-cc '), 'aa-bb-cc') -}) +// expected: -QUnit.test("URLField normalisation", 1, function() { - var f = forms.URLField() - equal(f.clean('http://example.com/ '), 'http://example.com/') -}) +// actual: diff --git a/tests/tests.js b/tests/tests.js index f06dfc0..e79df6e 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -12,27 +12,8 @@ global.ReactDOMServer = window.ReactDOMServer = require('react-dom/server') global.isomorph = require('isomorph') global.forms = require('../dist/newforms.js') -var tests = [ 'util.js' - , 'formats.js' - , 'locales.js' - , 'forms.js' - , 'forms-browser.js' - , 'forms-server.js' - , 'formsets.js' - , 'formsets-server.js' - , 'fields.js' - , 'fields-browser.js' - , 'fields-server.js' - , 'errormessages.js' - , 'errormessages-server.js' - , 'widgets.js' - , 'widgets-server.js' - , 'extra.js' - , 'regressions.js' - , 'docs.js' - , 'docs-server.js' - //, 'dom-initial.js' - , 'components.js' +var tests = [ + 'extra.js' ].map(function(t) { return path.join(__dirname, t) }) qqunit.Runner.run(tests, function(stats) { From 6583daa206b1997ad5a2667e3e6c4d6ffb50f235 Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 12:23:02 -0700 Subject: [PATCH 04/12] Revert " will revert" This reverts commit 218cb1548b492521c1df7a4e9b093d76e6bfa65a. --- dist/newforms.js | 2 +- tests/extra.js | 162 ++++++++++++++++++++++++++++++++++++++++++++++- tests/tests.js | 23 ++++++- 3 files changed, 182 insertions(+), 5 deletions(-) diff --git a/dist/newforms.js b/dist/newforms.js index 12f0c23..f077e93 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:12:08 GMT) - https://github.com/insin/newforms + * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:10:56 GMT) - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o\ +
\ +\ +\ +
\ +') + + var ComplexField = forms.MultiValueField.extend({ + constructor: function(kwargs) { + if (!(this instanceof ComplexField)) return new ComplexField(kwargs) + kwargs.fields = [ + forms.CharField() + , forms.MultipleChoiceField({choices: [["J", "John"], ["P", "Paul"], ["G", "George"], ["R", "Ringo"]]}) + , forms.SplitDateTimeField() + ] + forms.MultiValueField.call(this, kwargs) + } + }) + ComplexField.prototype.compress = function(dataList) { + if (dataList instanceof Array && dataList.length > 0) { + return [dataList[0], + dataList[1].join(""), + time.strftime(dataList[2], "%Y-%m-%d %H:%M:%S")].join(",") + } + return null + } + + var f = ComplexField({widget: w}) + equal(f.clean(["some text", ["J", "P"], ["2007-04-25", "6:24:00"]]), + "some text,JP,2007-04-25 06:24:00") + cleanErrorEqual(f, "Select a valid choice. X is not one of the available choices.", + ["some text", ["X"], ["2007-04-25", "6:24:00"]]) + + // If insufficient data is provided, null is substituted + cleanErrorEqual(f, "This field is required.", ["some text", ["JP"]]) + + // Test with no initial data + strictEqual(f._hasChanged(null, ["some text", ["J", "P"], ["2007-04-25","6:24:00"]]), true) + // Test when data is the same as initial + strictEqual(f._hasChanged("some text,JP,2007-04-25 06:24:00", + ["some text", ["J", "P"], ["2007-04-25","6:24:00"]]), false) + // Test when the first widget's data has changed + strictEqual(f._hasChanged("some text,JP,2007-04-25 06:24:00", + ["other text", ["J","P"], ["2007-04-25","6:24:00"]]), true) + // Test when the last widget's data has changed. This ensures that it is + // not short circuiting while testing the widgets. + strictEqual(f._hasChanged("some text,JP,2007-04-25 06:24:00", + ["some text", ["J","P"], ["2009-04-25","11:44:00"]]), true) + + var ComplexFieldForm = forms.Form.extend({ + field1: ComplexField({widget: w}) + }) + f = new ComplexFieldForm() + reactHTMLEqual(React.createElement(forms.RenderForm, {form: f}), +'
\ +
\ + \ +
\ +\ +\ +
\ +\ +\ +
\ +
') + + f = new ComplexFieldForm({data: {field1_0: "some text", field1_1 :["J", "P"], field1_2_0: "2007-04-25", field1_2_1: "06:24:00"}}) + reactHTMLEqual(React.createElement(forms.RenderForm, {form: f}), +'
\ + \ +
\ +\ +\ +
\ +\ +\ +
\ +
') + + equal(f.cleanedData["field1"], "some text,JP,2007-04-25 06:24:00") +}) + QUnit.test("Extra attrs", 1, function() { var extraAttrs = {"className": "special"} var TestForm = forms.Form.extend({ @@ -14,7 +139,40 @@ QUnit.test("Extra attrs", 1, function() { ') }) +QUnit.test("Data field", 2, function() { + var DataForm = forms.Form.extend({ + data: forms.CharField({maxLength: 10}) + }) + + var f = new DataForm({data: {data: "xyzzy"}}) + strictEqual(f.isValid(), true) + deepEqual(f.cleanedData, {data: "xyzzy"}) +}) + +QUnit.test("Forms with *only* hidden fields", 1, function() { + // A form with *only* hidden fields that has errors is going to be very + // unusual. + var HiddenForm = forms.Form.extend({ + data: forms.IntegerField({widget: forms.HiddenInput}) + }) + var f = new HiddenForm({data: {}}) + reactHTMLEqual(React.createElement(forms.RenderForm, {form: f}), +'
\ +
    \ +
  • (Hidden field data) This field is required.
  • \ +
\ +
\ +
\ +\ +
') +}) -// expected: +QUnit.test("SlugField normalisation", 1, function() { + var f = forms.SlugField() + equal(f.clean(' aa-bb-cc '), 'aa-bb-cc') +}) -// actual: +QUnit.test("URLField normalisation", 1, function() { + var f = forms.URLField() + equal(f.clean('http://example.com/ '), 'http://example.com/') +}) diff --git a/tests/tests.js b/tests/tests.js index e79df6e..f06dfc0 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -12,8 +12,27 @@ global.ReactDOMServer = window.ReactDOMServer = require('react-dom/server') global.isomorph = require('isomorph') global.forms = require('../dist/newforms.js') -var tests = [ - 'extra.js' +var tests = [ 'util.js' + , 'formats.js' + , 'locales.js' + , 'forms.js' + , 'forms-browser.js' + , 'forms-server.js' + , 'formsets.js' + , 'formsets-server.js' + , 'fields.js' + , 'fields-browser.js' + , 'fields-server.js' + , 'errormessages.js' + , 'errormessages-server.js' + , 'widgets.js' + , 'widgets-server.js' + , 'extra.js' + , 'regressions.js' + , 'docs.js' + , 'docs-server.js' + //, 'dom-initial.js' + , 'components.js' ].map(function(t) { return path.join(__dirname, t) }) qqunit.Runner.run(tests, function(stats) { From 70b9e5eee9f233d753ce3497a6d9bdec5533e50d Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 12:28:51 -0700 Subject: [PATCH 05/12] one more test fix --- tests/forms.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/forms.js b/tests/forms.js index e5ef59a..c699e99 100644 --- a/tests/forms.js +++ b/tests/forms.js @@ -1705,7 +1705,7 @@ QUnit.test("Forms with prefixes", 30, function() { deepEqual(p.errors("last_name").messages(), ["This field is required."]) deepEqual(p.errors("birthday").messages(), ["This field is required."]) deepEqual(p.boundField("first_name").errors().messages(), ["This field is required."]) - try { p.boundField("person1-first_name"); } catch(e) { equal(e.message, "Form does not have a 'person1-first_name' field."); } + try { p.boundField("person1-first_name"); } catch(e) { equal(e.message, "'childConstructor' does not have a 'person1-first_name' field."); } // In this example, the data doesn't have a prefix, but the form requires // it, so the form doesn't "see" the fields. From 8db08606ad603d01bddfef0b0a1750622c67f3c5 Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 12:34:34 -0700 Subject: [PATCH 06/12] use htmldiffer to compare HTML elements without attribute order --- dist/newforms.js | 2 +- package.json | 1 + tests/customAsserts.js | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dist/newforms.js b/dist/newforms.js index f077e93..8d61a66 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:10:56 GMT) - https://github.com/insin/newforms + * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:34:23 GMT) - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0.15.0", diff --git a/tests/customAsserts.js b/tests/customAsserts.js index d27aa32..de8d2ee 100644 --- a/tests/customAsserts.js +++ b/tests/customAsserts.js @@ -67,6 +67,9 @@ function validationErrorEqual(validator, message, value) { * Custom assertion for contents created with ReactElements. */ var reactHTMLEqual = (function() { + var HtmlDiffer = require('html-differ').HtmlDiffer, + htmlDiffer = new HtmlDiffer; + var wrapperElement = /^
|<\/div>$/g return function reactHTMLEqual(component, expectedHTML, message) { @@ -106,7 +109,11 @@ var reactHTMLEqual = (function() { if (wrapped) { html = html.replace(wrapperElement, '') } - equal(html, expectedHTML, message) + + ok( + htmlDiffer.isEqual(html, expectedHTML), + message + ) } })() From 774ed2a8c50bfef486d1529be2b3b12edf2fcd22 Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 12:42:09 -0700 Subject: [PATCH 07/12] deprecations --- dist/newforms.js | 4653 +++++++++++++++++++++++++++++- package.json | 1 + src/components/FormRow.jsx | 16 +- src/components/ProgressMixin.jsx | 5 +- src/components/RenderForm.jsx | 46 +- src/components/RenderFormSet.jsx | 60 +- tests/customAsserts.js | 2 +- tests/docs.js | 6 +- tests/dom-initial.js | 2 +- tests/tests.js | 1 + 10 files changed, 4599 insertions(+), 193 deletions(-) diff --git a/dist/newforms.js b/dist/newforms.js index 8d61a66..736a354 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:34:23 GMT) - https://github.com/insin/newforms + * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:41:58 GMT) - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if ("development" !== 'production') { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if ("development" !== 'production') { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if ("development" !== 'production') { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if ("development" !== 'production') { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if ("development" !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if ("development" !== 'production') { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } + + return; + } + + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if ("development" !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isInherited = name in Constructor; + _invariant( + !isInherited, + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if ("development" !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if ("development" !== 'production') { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if ("development" !== 'production') { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if ("development" !== 'production') { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if ("development" !== 'production') { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if ("development" !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if ("development" !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if ("development" !== 'production') { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + +},{"fbjs/lib/emptyObject":84,"fbjs/lib/invariant":85,"fbjs/lib/warning":86,"object-assign":94}],82:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var React = require('react'); +var factory = require('./factory'); + +if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); +} + +// Hack to grab NoopUpdateQueue from isomorphic React +var ReactNoopUpdateQueue = new React.Component().updater; + +module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue +); + +},{"./factory":81,"react":125}],83:[function(require,module,exports){ +"use strict"; + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +function makeEmptyFunction(arg) { + return function () { + return arg; + }; +} + +/** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ +var emptyFunction = function emptyFunction() {}; + +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function () { + return this; +}; +emptyFunction.thatReturnsArgument = function (arg) { + return arg; +}; + +module.exports = emptyFunction; +},{}],84:[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var emptyObject = {}; + +if ("development" !== 'production') { + Object.freeze(emptyObject); +} + +module.exports = emptyObject; +},{}],85:[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var validateFormat = function validateFormat(format) {}; + +if ("development" !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +module.exports = invariant; +},{}],86:[function(require,module,exports){ +/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var emptyFunction = require('./emptyFunction'); + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = emptyFunction; + +if ("development" !== 'production') { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +module.exports = warning; +},{"./emptyFunction":83}],87:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -8278,7 +9374,7 @@ getFormData.getNamedFormElementData = getNamedFormElementData; exports['default'] = getFormData; module.exports = exports['default']; -},{}],82:[function(require,module,exports){ +},{}],88:[function(require,module,exports){ 'use strict'; var hasOwn = Object.prototype.hasOwnProperty @@ -8624,7 +9720,7 @@ module.exports = { , deepCopy: deepCopy } -},{}],83:[function(require,module,exports){ +},{}],89:[function(require,module,exports){ 'use strict'; var slice = Array.prototype.slice @@ -8681,7 +9777,7 @@ module.exports = { , fileSize: fileSize } -},{}],84:[function(require,module,exports){ +},{}],90:[function(require,module,exports){ 'use strict'; var toString = Object.prototype.toString @@ -8749,7 +9845,7 @@ module.exports = { , String: isString } -},{}],85:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ 'use strict'; /** @@ -8895,7 +9991,7 @@ module.exports = { , setDefault: setDefault } -},{}],86:[function(require,module,exports){ +},{}],92:[function(require,module,exports){ 'use strict'; var is = require('./is') @@ -9248,7 +10344,7 @@ time.strftime = function(date, format, locale) { module.exports = time -},{"./is":84}],87:[function(require,module,exports){ +},{"./is":90}],93:[function(require,module,exports){ 'use strict'; // parseUri 1.2.2 @@ -9339,7 +10435,3308 @@ module.exports = { , makeUri: makeUri } -},{}],88:[function(require,module,exports){ +},{}],94:[function(require,module,exports){ +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + +'use strict'; +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + +},{}],95:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +if ("development" !== 'production') { + var invariant = require('fbjs/lib/invariant'); + var warning = require('fbjs/lib/warning'); + var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + var loggedTypeFailures = {}; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if ("development" !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + 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); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + 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); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } +} + +module.exports = checkPropTypes; + +},{"./lib/ReactPropTypesSecret":100,"fbjs/lib/invariant":85,"fbjs/lib/warning":86}],96:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +// React 15.5 references this module, and assumes PropTypes are still callable in production. +// Therefore we re-export development-only version with all the PropTypes checks here. +// However if one is migrating to the `prop-types` npm library, they will go through the +// `index.js` entry point, and it will branch depending on the environment. +var factory = require('./factoryWithTypeCheckers'); +module.exports = function(isValidElement) { + // It is still allowed in 15.5. + var throwOnDirectAccess = false; + return factory(isValidElement, throwOnDirectAccess); +}; + +},{"./factoryWithTypeCheckers":98}],97:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use PropTypes.checkPropTypes() to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +},{"./lib/ReactPropTypesSecret":100,"fbjs/lib/emptyFunction":83,"fbjs/lib/invariant":85}],98:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); + +var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); +var checkPropTypes = require('./checkPropTypes'); + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if ("development" !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if ("development" !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + "development" !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +},{"./checkPropTypes":95,"./lib/ReactPropTypesSecret":100,"fbjs/lib/emptyFunction":83,"fbjs/lib/invariant":85,"fbjs/lib/warning":86}],99:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +if ("development" !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); +} + +},{"./factoryWithThrowingShims":97,"./factoryWithTypeCheckers":98}],100:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + +},{}],101:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +/** + * Escape and wrap key so it is safe to use as a reactid + * + * @param {string} key to be escaped. + * @return {string} the escaped key. + */ + +function escape(key) { + var escapeRegex = /[=:]/g; + var escaperLookup = { + '=': '=0', + ':': '=2' + }; + var escapedString = ('' + key).replace(escapeRegex, function (match) { + return escaperLookup[match]; + }); + + return '$' + escapedString; +} + +/** + * Unescape and unwrap key for human-readable display + * + * @param {string} key to unescape. + * @return {string} the unescaped key. + */ +function unescape(key) { + var unescapeRegex = /(=0|=2)/g; + var unescaperLookup = { + '=0': '=', + '=2': ':' + }; + var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); + + return ('' + keySubstring).replace(unescapeRegex, function (match) { + return unescaperLookup[match]; + }); +} + +var KeyEscapeUtils = { + escape: escape, + unescape: unescape +}; + +module.exports = KeyEscapeUtils; +},{}],102:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +var _prodInvariant = require('./reactProdInvariant'); + +var invariant = require('fbjs/lib/invariant'); + +/** + * Static poolers. Several custom versions for each potential number of + * arguments. A completely generic pooler is easy to implement, but would + * require accessing the `arguments` object. In each of these, `this` refers to + * the Class itself, not an instance. If any others are needed, simply add them + * here, or in their own files. + */ +var oneArgumentPooler = function (copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, copyFieldsFrom); + return instance; + } else { + return new Klass(copyFieldsFrom); + } +}; + +var twoArgumentPooler = function (a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2); + return instance; + } else { + return new Klass(a1, a2); + } +}; + +var threeArgumentPooler = function (a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3); + return instance; + } else { + return new Klass(a1, a2, a3); + } +}; + +var fourArgumentPooler = function (a1, a2, a3, a4) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + Klass.call(instance, a1, a2, a3, a4); + return instance; + } else { + return new Klass(a1, a2, a3, a4); + } +}; + +var standardReleaser = function (instance) { + var Klass = this; + !(instance instanceof Klass) ? "development" !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; + instance.destructor(); + if (Klass.instancePool.length < Klass.poolSize) { + Klass.instancePool.push(instance); + } +}; + +var DEFAULT_POOL_SIZE = 10; +var DEFAULT_POOLER = oneArgumentPooler; + +/** + * Augments `CopyConstructor` to be a poolable class, augmenting only the class + * itself (statically) not adding any prototypical fields. Any CopyConstructor + * you give this may have a `poolSize` property, and will look for a + * prototypical `destructor` on instances. + * + * @param {Function} CopyConstructor Constructor that can be used to reset. + * @param {Function} pooler Customizable pooler. + */ +var addPoolingTo = function (CopyConstructor, pooler) { + // Casting as any so that flow ignores the actual implementation and trusts + // it to match the type we declared + var NewKlass = CopyConstructor; + NewKlass.instancePool = []; + NewKlass.getPooled = pooler || DEFAULT_POOLER; + if (!NewKlass.poolSize) { + NewKlass.poolSize = DEFAULT_POOL_SIZE; + } + NewKlass.release = standardReleaser; + return NewKlass; +}; + +var PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fourArgumentPooler: fourArgumentPooler +}; + +module.exports = PooledClass; +},{"./reactProdInvariant":123,"fbjs/lib/invariant":85}],103:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _assign = require('object-assign'); + +var ReactBaseClasses = require('./ReactBaseClasses'); +var ReactChildren = require('./ReactChildren'); +var ReactDOMFactories = require('./ReactDOMFactories'); +var ReactElement = require('./ReactElement'); +var ReactPropTypes = require('./ReactPropTypes'); +var ReactVersion = require('./ReactVersion'); + +var createReactClass = require('./createClass'); +var onlyChild = require('./onlyChild'); + +var createElement = ReactElement.createElement; +var createFactory = ReactElement.createFactory; +var cloneElement = ReactElement.cloneElement; + +if ("development" !== 'production') { + var lowPriorityWarning = require('./lowPriorityWarning'); + var canDefineProperty = require('./canDefineProperty'); + var ReactElementValidator = require('./ReactElementValidator'); + var didWarnPropTypesDeprecated = false; + createElement = ReactElementValidator.createElement; + createFactory = ReactElementValidator.createFactory; + cloneElement = ReactElementValidator.cloneElement; +} + +var __spread = _assign; +var createMixin = function (mixin) { + return mixin; +}; + +if ("development" !== 'production') { + var warnedForSpread = false; + var warnedForCreateMixin = false; + __spread = function () { + lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.'); + warnedForSpread = true; + return _assign.apply(null, arguments); + }; + + createMixin = function (mixin) { + lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.'); + warnedForCreateMixin = true; + return mixin; + }; +} + +var React = { + // Modern + + Children: { + map: ReactChildren.map, + forEach: ReactChildren.forEach, + count: ReactChildren.count, + toArray: ReactChildren.toArray, + only: onlyChild + }, + + Component: ReactBaseClasses.Component, + PureComponent: ReactBaseClasses.PureComponent, + + createElement: createElement, + cloneElement: cloneElement, + isValidElement: ReactElement.isValidElement, + + // Classic + + PropTypes: ReactPropTypes, + createClass: createReactClass, + createFactory: createFactory, + createMixin: createMixin, + + // This looks DOM specific but these are actually isomorphic helpers + // since they are just generating DOM strings. + DOM: ReactDOMFactories, + + version: ReactVersion, + + // Deprecated hook for JSX spread, don't use this for anything. + __spread: __spread +}; + +if ("development" !== 'production') { + var warnedForCreateClass = false; + if (canDefineProperty) { + Object.defineProperty(React, 'PropTypes', { + get: function () { + lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs'); + didWarnPropTypesDeprecated = true; + return ReactPropTypes; + } + }); + + Object.defineProperty(React, 'createClass', { + get: function () { + lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class'); + warnedForCreateClass = true; + return createReactClass; + } + }); + } + + // React.DOM factories are deprecated. Wrap these methods so that + // invocations of the React.DOM namespace and alert users to switch + // to the `react-dom-factories` package. + React.DOM = {}; + var warnedForFactories = false; + Object.keys(ReactDOMFactories).forEach(function (factory) { + React.DOM[factory] = function () { + if (!warnedForFactories) { + lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory); + warnedForFactories = true; + } + return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments); + }; + }); +} + +module.exports = React; +},{"./ReactBaseClasses":104,"./ReactChildren":105,"./ReactDOMFactories":108,"./ReactElement":109,"./ReactElementValidator":111,"./ReactPropTypes":114,"./ReactVersion":116,"./canDefineProperty":117,"./createClass":119,"./lowPriorityWarning":121,"./onlyChild":122,"object-assign":94}],104:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _prodInvariant = require('./reactProdInvariant'), + _assign = require('object-assign'); + +var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); + +var canDefineProperty = require('./canDefineProperty'); +var emptyObject = require('fbjs/lib/emptyObject'); +var invariant = require('fbjs/lib/invariant'); +var lowPriorityWarning = require('./lowPriorityWarning'); + +/** + * Base class helpers for the updating state of a component. + */ +function ReactComponent(props, context, updater) { + this.props = props; + this.context = context; + this.refs = emptyObject; + // We initialize the default updater but the real one gets injected by the + // renderer. + this.updater = updater || ReactNoopUpdateQueue; +} + +ReactComponent.prototype.isReactComponent = {}; + +/** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */ +ReactComponent.prototype.setState = function (partialState, callback) { + !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? "development" !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; + this.updater.enqueueSetState(this, partialState); + if (callback) { + this.updater.enqueueCallback(this, callback, 'setState'); + } +}; + +/** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */ +ReactComponent.prototype.forceUpdate = function (callback) { + this.updater.enqueueForceUpdate(this); + if (callback) { + this.updater.enqueueCallback(this, callback, 'forceUpdate'); + } +}; + +/** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */ +if ("development" !== 'production') { + var deprecatedAPIs = { + isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], + replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] + }; + var defineDeprecationWarning = function (methodName, info) { + if (canDefineProperty) { + Object.defineProperty(ReactComponent.prototype, methodName, { + get: function () { + lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); + return undefined; + } + }); + } + }; + for (var fnName in deprecatedAPIs) { + if (deprecatedAPIs.hasOwnProperty(fnName)) { + defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); + } + } +} + +/** + * Base class helpers for the updating state of a component. + */ +function ReactPureComponent(props, context, updater) { + // Duplicated from ReactComponent. + this.props = props; + this.context = context; + this.refs = emptyObject; + // We initialize the default updater but the real one gets injected by the + // renderer. + this.updater = updater || ReactNoopUpdateQueue; +} + +function ComponentDummy() {} +ComponentDummy.prototype = ReactComponent.prototype; +ReactPureComponent.prototype = new ComponentDummy(); +ReactPureComponent.prototype.constructor = ReactPureComponent; +// Avoid an extra prototype jump for these methods. +_assign(ReactPureComponent.prototype, ReactComponent.prototype); +ReactPureComponent.prototype.isPureReactComponent = true; + +module.exports = { + Component: ReactComponent, + PureComponent: ReactPureComponent +}; +},{"./ReactNoopUpdateQueue":112,"./canDefineProperty":117,"./lowPriorityWarning":121,"./reactProdInvariant":123,"fbjs/lib/emptyObject":84,"fbjs/lib/invariant":85,"object-assign":94}],105:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var PooledClass = require('./PooledClass'); +var ReactElement = require('./ReactElement'); + +var emptyFunction = require('fbjs/lib/emptyFunction'); +var traverseAllChildren = require('./traverseAllChildren'); + +var twoArgumentPooler = PooledClass.twoArgumentPooler; +var fourArgumentPooler = PooledClass.fourArgumentPooler; + +var userProvidedKeyEscapeRegex = /\/+/g; +function escapeUserProvidedKey(text) { + return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); +} + +/** + * PooledClass representing the bookkeeping associated with performing a child + * traversal. Allows avoiding binding callbacks. + * + * @constructor ForEachBookKeeping + * @param {!function} forEachFunction Function to perform traversal with. + * @param {?*} forEachContext Context to perform context with. + */ +function ForEachBookKeeping(forEachFunction, forEachContext) { + this.func = forEachFunction; + this.context = forEachContext; + this.count = 0; +} +ForEachBookKeeping.prototype.destructor = function () { + this.func = null; + this.context = null; + this.count = 0; +}; +PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); + +function forEachSingleChild(bookKeeping, child, name) { + var func = bookKeeping.func, + context = bookKeeping.context; + + func.call(context, child, bookKeeping.count++); +} + +/** + * Iterates through children that are typically specified as `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach + * + * The provided forEachFunc(child, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} forEachFunc + * @param {*} forEachContext Context for forEachContext. + */ +function forEachChildren(children, forEachFunc, forEachContext) { + if (children == null) { + return children; + } + var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); + traverseAllChildren(children, forEachSingleChild, traverseContext); + ForEachBookKeeping.release(traverseContext); +} + +/** + * PooledClass representing the bookkeeping associated with performing a child + * mapping. Allows avoiding binding callbacks. + * + * @constructor MapBookKeeping + * @param {!*} mapResult Object containing the ordered map of results. + * @param {!function} mapFunction Function to perform mapping with. + * @param {?*} mapContext Context to perform mapping with. + */ +function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { + this.result = mapResult; + this.keyPrefix = keyPrefix; + this.func = mapFunction; + this.context = mapContext; + this.count = 0; +} +MapBookKeeping.prototype.destructor = function () { + this.result = null; + this.keyPrefix = null; + this.func = null; + this.context = null; + this.count = 0; +}; +PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); + +function mapSingleChildIntoContext(bookKeeping, child, childKey) { + var result = bookKeeping.result, + keyPrefix = bookKeeping.keyPrefix, + func = bookKeeping.func, + context = bookKeeping.context; + + + var mappedChild = func.call(context, child, bookKeeping.count++); + if (Array.isArray(mappedChild)) { + mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); + } else if (mappedChild != null) { + if (ReactElement.isValidElement(mappedChild)) { + mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, + // Keep both the (mapped) and old keys if they differ, just as + // traverseAllChildren used to do for objects as children + keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); + } + result.push(mappedChild); + } +} + +function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { + var escapedPrefix = ''; + if (prefix != null) { + escapedPrefix = escapeUserProvidedKey(prefix) + '/'; + } + var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); + traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); + MapBookKeeping.release(traverseContext); +} + +/** + * Maps children that are typically specified as `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map + * + * The provided mapFunction(child, key, index) will be called for each + * leaf child. + * + * @param {?*} children Children tree container. + * @param {function(*, int)} func The map function. + * @param {*} context Context for mapFunction. + * @return {object} Object containing the ordered map of results. + */ +function mapChildren(children, func, context) { + if (children == null) { + return children; + } + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, func, context); + return result; +} + +function forEachSingleChildDummy(traverseContext, child, name) { + return null; +} + +/** + * Count the number of children that are typically specified as + * `props.children`. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count + * + * @param {?*} children Children tree container. + * @return {number} The number of children. + */ +function countChildren(children, context) { + return traverseAllChildren(children, forEachSingleChildDummy, null); +} + +/** + * Flatten a children object (typically specified as `props.children`) and + * return an array with appropriately re-keyed children. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray + */ +function toArray(children) { + var result = []; + mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); + return result; +} + +var ReactChildren = { + forEach: forEachChildren, + map: mapChildren, + mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, + count: countChildren, + toArray: toArray +}; + +module.exports = ReactChildren; +},{"./PooledClass":102,"./ReactElement":109,"./traverseAllChildren":124,"fbjs/lib/emptyFunction":83}],106:[function(require,module,exports){ +/** + * Copyright 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +var _prodInvariant = require('./reactProdInvariant'); + +var ReactCurrentOwner = require('./ReactCurrentOwner'); + +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); + +function isNative(fn) { + // Based on isNative() from Lodash + var funcToString = Function.prototype.toString; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var reIsNative = RegExp('^' + funcToString + // Take an example native function source for comparison + .call(hasOwnProperty + // Strip regex characters so we can use it for regex + ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&' + // Remove hasOwnProperty from the template to make it generic + ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + try { + var source = funcToString.call(fn); + return reIsNative.test(source); + } catch (err) { + return false; + } +} + +var canUseCollections = +// Array.from +typeof Array.from === 'function' && +// Map +typeof Map === 'function' && isNative(Map) && +// Map.prototype.keys +Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) && +// Set +typeof Set === 'function' && isNative(Set) && +// Set.prototype.keys +Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys); + +var setItem; +var getItem; +var removeItem; +var getItemIDs; +var addRoot; +var removeRoot; +var getRootIDs; + +if (canUseCollections) { + var itemMap = new Map(); + var rootIDSet = new Set(); + + setItem = function (id, item) { + itemMap.set(id, item); + }; + getItem = function (id) { + return itemMap.get(id); + }; + removeItem = function (id) { + itemMap['delete'](id); + }; + getItemIDs = function () { + return Array.from(itemMap.keys()); + }; + + addRoot = function (id) { + rootIDSet.add(id); + }; + removeRoot = function (id) { + rootIDSet['delete'](id); + }; + getRootIDs = function () { + return Array.from(rootIDSet.keys()); + }; +} else { + var itemByKey = {}; + var rootByKey = {}; + + // Use non-numeric keys to prevent V8 performance issues: + // https://github.com/facebook/react/pull/7232 + var getKeyFromID = function (id) { + return '.' + id; + }; + var getIDFromKey = function (key) { + return parseInt(key.substr(1), 10); + }; + + setItem = function (id, item) { + var key = getKeyFromID(id); + itemByKey[key] = item; + }; + getItem = function (id) { + var key = getKeyFromID(id); + return itemByKey[key]; + }; + removeItem = function (id) { + var key = getKeyFromID(id); + delete itemByKey[key]; + }; + getItemIDs = function () { + return Object.keys(itemByKey).map(getIDFromKey); + }; + + addRoot = function (id) { + var key = getKeyFromID(id); + rootByKey[key] = true; + }; + removeRoot = function (id) { + var key = getKeyFromID(id); + delete rootByKey[key]; + }; + getRootIDs = function () { + return Object.keys(rootByKey).map(getIDFromKey); + }; +} + +var unmountedIDs = []; + +function purgeDeep(id) { + var item = getItem(id); + if (item) { + var childIDs = item.childIDs; + + removeItem(id); + childIDs.forEach(purgeDeep); + } +} + +function describeComponentFrame(name, source, ownerName) { + return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); +} + +function getDisplayName(element) { + if (element == null) { + return '#empty'; + } else if (typeof element === 'string' || typeof element === 'number') { + return '#text'; + } else if (typeof element.type === 'string') { + return element.type; + } else { + return element.type.displayName || element.type.name || 'Unknown'; + } +} + +function describeID(id) { + var name = ReactComponentTreeHook.getDisplayName(id); + var element = ReactComponentTreeHook.getElement(id); + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var ownerName; + if (ownerID) { + ownerName = ReactComponentTreeHook.getDisplayName(ownerID); + } + "development" !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0; + return describeComponentFrame(name, element && element._source, ownerName); +} + +var ReactComponentTreeHook = { + onSetChildren: function (id, nextChildIDs) { + var item = getItem(id); + !item ? "development" !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; + item.childIDs = nextChildIDs; + + for (var i = 0; i < nextChildIDs.length; i++) { + var nextChildID = nextChildIDs[i]; + var nextChild = getItem(nextChildID); + !nextChild ? "development" !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0; + !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? "development" !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0; + !nextChild.isMounted ? "development" !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; + if (nextChild.parentID == null) { + nextChild.parentID = id; + // TODO: This shouldn't be necessary but mounting a new root during in + // componentWillMount currently causes not-yet-mounted components to + // be purged from our tree data so their parent id is missing. + } + !(nextChild.parentID === id) ? "development" !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0; + } + }, + onBeforeMountComponent: function (id, element, parentID) { + var item = { + element: element, + parentID: parentID, + text: null, + childIDs: [], + isMounted: false, + updateCount: 0 + }; + setItem(id, item); + }, + onBeforeUpdateComponent: function (id, element) { + var item = getItem(id); + if (!item || !item.isMounted) { + // We may end up here as a result of setState() in componentWillUnmount(). + // In this case, ignore the element. + return; + } + item.element = element; + }, + onMountComponent: function (id) { + var item = getItem(id); + !item ? "development" !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; + item.isMounted = true; + var isRoot = item.parentID === 0; + if (isRoot) { + addRoot(id); + } + }, + onUpdateComponent: function (id) { + var item = getItem(id); + if (!item || !item.isMounted) { + // We may end up here as a result of setState() in componentWillUnmount(). + // In this case, ignore the element. + return; + } + item.updateCount++; + }, + onUnmountComponent: function (id) { + var item = getItem(id); + if (item) { + // We need to check if it exists. + // `item` might not exist if it is inside an error boundary, and a sibling + // error boundary child threw while mounting. Then this instance never + // got a chance to mount, but it still gets an unmounting event during + // the error boundary cleanup. + item.isMounted = false; + var isRoot = item.parentID === 0; + if (isRoot) { + removeRoot(id); + } + } + unmountedIDs.push(id); + }, + purgeUnmountedComponents: function () { + if (ReactComponentTreeHook._preventPurging) { + // Should only be used for testing. + return; + } + + for (var i = 0; i < unmountedIDs.length; i++) { + var id = unmountedIDs[i]; + purgeDeep(id); + } + unmountedIDs.length = 0; + }, + isMounted: function (id) { + var item = getItem(id); + return item ? item.isMounted : false; + }, + getCurrentStackAddendum: function (topElement) { + var info = ''; + if (topElement) { + var name = getDisplayName(topElement); + var owner = topElement._owner; + info += describeComponentFrame(name, topElement._source, owner && owner.getName()); + } + + var currentOwner = ReactCurrentOwner.current; + var id = currentOwner && currentOwner._debugID; + + info += ReactComponentTreeHook.getStackAddendumByID(id); + return info; + }, + getStackAddendumByID: function (id) { + var info = ''; + while (id) { + info += describeID(id); + id = ReactComponentTreeHook.getParentID(id); + } + return info; + }, + getChildIDs: function (id) { + var item = getItem(id); + return item ? item.childIDs : []; + }, + getDisplayName: function (id) { + var element = ReactComponentTreeHook.getElement(id); + if (!element) { + return null; + } + return getDisplayName(element); + }, + getElement: function (id) { + var item = getItem(id); + return item ? item.element : null; + }, + getOwnerID: function (id) { + var element = ReactComponentTreeHook.getElement(id); + if (!element || !element._owner) { + return null; + } + return element._owner._debugID; + }, + getParentID: function (id) { + var item = getItem(id); + return item ? item.parentID : null; + }, + getSource: function (id) { + var item = getItem(id); + var element = item ? item.element : null; + var source = element != null ? element._source : null; + return source; + }, + getText: function (id) { + var element = ReactComponentTreeHook.getElement(id); + if (typeof element === 'string') { + return element; + } else if (typeof element === 'number') { + return '' + element; + } else { + return null; + } + }, + getUpdateCount: function (id) { + var item = getItem(id); + return item ? item.updateCount : 0; + }, + + + getRootIDs: getRootIDs, + getRegisteredIDs: getItemIDs, + + pushNonStandardWarningStack: function (isCreatingElement, currentSource) { + if (typeof console.reactStack !== 'function') { + return; + } + + var stack = []; + var currentOwner = ReactCurrentOwner.current; + var id = currentOwner && currentOwner._debugID; + + try { + if (isCreatingElement) { + stack.push({ + name: id ? ReactComponentTreeHook.getDisplayName(id) : null, + fileName: currentSource ? currentSource.fileName : null, + lineNumber: currentSource ? currentSource.lineNumber : null + }); + } + + while (id) { + var element = ReactComponentTreeHook.getElement(id); + var parentID = ReactComponentTreeHook.getParentID(id); + var ownerID = ReactComponentTreeHook.getOwnerID(id); + var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null; + var source = element && element._source; + stack.push({ + name: ownerName, + fileName: source ? source.fileName : null, + lineNumber: source ? source.lineNumber : null + }); + id = parentID; + } + } catch (err) { + // Internal state is messed up. + // Stop building the stack (it's just a nice to have). + } + + console.reactStack(stack); + }, + popNonStandardWarningStack: function () { + if (typeof console.reactStackEnd !== 'function') { + return; + } + console.reactStackEnd(); + } +}; + +module.exports = ReactComponentTreeHook; +},{"./ReactCurrentOwner":107,"./reactProdInvariant":123,"fbjs/lib/invariant":85,"fbjs/lib/warning":86}],107:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +/** + * Keeps track of the current owner. + * + * The current owner is the component who should own any components that are + * currently being constructed. + */ +var ReactCurrentOwner = { + /** + * @internal + * @type {ReactComponent} + */ + current: null +}; + +module.exports = ReactCurrentOwner; +},{}],108:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var ReactElement = require('./ReactElement'); + +/** + * Create a factory that creates HTML tag elements. + * + * @private + */ +var createDOMFactory = ReactElement.createFactory; +if ("development" !== 'production') { + var ReactElementValidator = require('./ReactElementValidator'); + createDOMFactory = ReactElementValidator.createFactory; +} + +/** + * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. + * + * @public + */ +var ReactDOMFactories = { + a: createDOMFactory('a'), + abbr: createDOMFactory('abbr'), + address: createDOMFactory('address'), + area: createDOMFactory('area'), + article: createDOMFactory('article'), + aside: createDOMFactory('aside'), + audio: createDOMFactory('audio'), + b: createDOMFactory('b'), + base: createDOMFactory('base'), + bdi: createDOMFactory('bdi'), + bdo: createDOMFactory('bdo'), + big: createDOMFactory('big'), + blockquote: createDOMFactory('blockquote'), + body: createDOMFactory('body'), + br: createDOMFactory('br'), + button: createDOMFactory('button'), + canvas: createDOMFactory('canvas'), + caption: createDOMFactory('caption'), + cite: createDOMFactory('cite'), + code: createDOMFactory('code'), + col: createDOMFactory('col'), + colgroup: createDOMFactory('colgroup'), + data: createDOMFactory('data'), + datalist: createDOMFactory('datalist'), + dd: createDOMFactory('dd'), + del: createDOMFactory('del'), + details: createDOMFactory('details'), + dfn: createDOMFactory('dfn'), + dialog: createDOMFactory('dialog'), + div: createDOMFactory('div'), + dl: createDOMFactory('dl'), + dt: createDOMFactory('dt'), + em: createDOMFactory('em'), + embed: createDOMFactory('embed'), + fieldset: createDOMFactory('fieldset'), + figcaption: createDOMFactory('figcaption'), + figure: createDOMFactory('figure'), + footer: createDOMFactory('footer'), + form: createDOMFactory('form'), + h1: createDOMFactory('h1'), + h2: createDOMFactory('h2'), + h3: createDOMFactory('h3'), + h4: createDOMFactory('h4'), + h5: createDOMFactory('h5'), + h6: createDOMFactory('h6'), + head: createDOMFactory('head'), + header: createDOMFactory('header'), + hgroup: createDOMFactory('hgroup'), + hr: createDOMFactory('hr'), + html: createDOMFactory('html'), + i: createDOMFactory('i'), + iframe: createDOMFactory('iframe'), + img: createDOMFactory('img'), + input: createDOMFactory('input'), + ins: createDOMFactory('ins'), + kbd: createDOMFactory('kbd'), + keygen: createDOMFactory('keygen'), + label: createDOMFactory('label'), + legend: createDOMFactory('legend'), + li: createDOMFactory('li'), + link: createDOMFactory('link'), + main: createDOMFactory('main'), + map: createDOMFactory('map'), + mark: createDOMFactory('mark'), + menu: createDOMFactory('menu'), + menuitem: createDOMFactory('menuitem'), + meta: createDOMFactory('meta'), + meter: createDOMFactory('meter'), + nav: createDOMFactory('nav'), + noscript: createDOMFactory('noscript'), + object: createDOMFactory('object'), + ol: createDOMFactory('ol'), + optgroup: createDOMFactory('optgroup'), + option: createDOMFactory('option'), + output: createDOMFactory('output'), + p: createDOMFactory('p'), + param: createDOMFactory('param'), + picture: createDOMFactory('picture'), + pre: createDOMFactory('pre'), + progress: createDOMFactory('progress'), + q: createDOMFactory('q'), + rp: createDOMFactory('rp'), + rt: createDOMFactory('rt'), + ruby: createDOMFactory('ruby'), + s: createDOMFactory('s'), + samp: createDOMFactory('samp'), + script: createDOMFactory('script'), + section: createDOMFactory('section'), + select: createDOMFactory('select'), + small: createDOMFactory('small'), + source: createDOMFactory('source'), + span: createDOMFactory('span'), + strong: createDOMFactory('strong'), + style: createDOMFactory('style'), + sub: createDOMFactory('sub'), + summary: createDOMFactory('summary'), + sup: createDOMFactory('sup'), + table: createDOMFactory('table'), + tbody: createDOMFactory('tbody'), + td: createDOMFactory('td'), + textarea: createDOMFactory('textarea'), + tfoot: createDOMFactory('tfoot'), + th: createDOMFactory('th'), + thead: createDOMFactory('thead'), + time: createDOMFactory('time'), + title: createDOMFactory('title'), + tr: createDOMFactory('tr'), + track: createDOMFactory('track'), + u: createDOMFactory('u'), + ul: createDOMFactory('ul'), + 'var': createDOMFactory('var'), + video: createDOMFactory('video'), + wbr: createDOMFactory('wbr'), + + // SVG + circle: createDOMFactory('circle'), + clipPath: createDOMFactory('clipPath'), + defs: createDOMFactory('defs'), + ellipse: createDOMFactory('ellipse'), + g: createDOMFactory('g'), + image: createDOMFactory('image'), + line: createDOMFactory('line'), + linearGradient: createDOMFactory('linearGradient'), + mask: createDOMFactory('mask'), + path: createDOMFactory('path'), + pattern: createDOMFactory('pattern'), + polygon: createDOMFactory('polygon'), + polyline: createDOMFactory('polyline'), + radialGradient: createDOMFactory('radialGradient'), + rect: createDOMFactory('rect'), + stop: createDOMFactory('stop'), + svg: createDOMFactory('svg'), + text: createDOMFactory('text'), + tspan: createDOMFactory('tspan') +}; + +module.exports = ReactDOMFactories; +},{"./ReactElement":109,"./ReactElementValidator":111}],109:[function(require,module,exports){ +/** + * Copyright 2014-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _assign = require('object-assign'); + +var ReactCurrentOwner = require('./ReactCurrentOwner'); + +var warning = require('fbjs/lib/warning'); +var canDefineProperty = require('./canDefineProperty'); +var hasOwnProperty = Object.prototype.hasOwnProperty; + +var REACT_ELEMENT_TYPE = require('./ReactElementSymbol'); + +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; + +var specialPropKeyWarningShown, specialPropRefWarningShown; + +function hasValidRef(config) { + if ("development" !== 'production') { + if (hasOwnProperty.call(config, 'ref')) { + var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.ref !== undefined; +} + +function hasValidKey(config) { + if ("development" !== 'production') { + if (hasOwnProperty.call(config, 'key')) { + var getter = Object.getOwnPropertyDescriptor(config, 'key').get; + if (getter && getter.isReactWarning) { + return false; + } + } + } + return config.key !== undefined; +} + +function defineKeyPropWarningGetter(props, displayName) { + var warnAboutAccessingKey = function () { + if (!specialPropKeyWarningShown) { + specialPropKeyWarningShown = true; + "development" !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; + } + }; + warnAboutAccessingKey.isReactWarning = true; + Object.defineProperty(props, 'key', { + get: warnAboutAccessingKey, + configurable: true + }); +} + +function defineRefPropWarningGetter(props, displayName) { + var warnAboutAccessingRef = function () { + if (!specialPropRefWarningShown) { + specialPropRefWarningShown = true; + "development" !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; + } + }; + warnAboutAccessingRef.isReactWarning = true; + Object.defineProperty(props, 'ref', { + get: warnAboutAccessingRef, + configurable: true + }); +} + +/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, no instanceof check + * will work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} key + * @param {string|object} ref + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @param {*} owner + * @param {*} props + * @internal + */ +var ReactElement = function (type, key, ref, self, source, owner, props) { + var element = { + // This tag allow us to uniquely identify this as a React Element + $$typeof: REACT_ELEMENT_TYPE, + + // Built-in properties that belong on the element + type: type, + key: key, + ref: ref, + props: props, + + // Record the component responsible for creating this element. + _owner: owner + }; + + if ("development" !== 'production') { + // The validation flag is currently mutative. We put it on + // an external backing store so that we can freeze the whole object. + // This can be replaced with a WeakMap once they are implemented in + // commonly used development environments. + element._store = {}; + + // To make comparing ReactElements easier for testing purposes, we make + // the validation flag non-enumerable (where possible, which should + // include every environment we run tests in), so the test framework + // ignores it. + if (canDefineProperty) { + Object.defineProperty(element._store, 'validated', { + configurable: false, + enumerable: false, + writable: true, + value: false + }); + // self and source are DEV only properties. + Object.defineProperty(element, '_self', { + configurable: false, + enumerable: false, + writable: false, + value: self + }); + // Two elements created in two different places should be considered + // equal for testing purposes and therefore we hide it from enumeration. + Object.defineProperty(element, '_source', { + configurable: false, + enumerable: false, + writable: false, + value: source + }); + } else { + element._store.validated = false; + element._self = self; + element._source = source; + } + if (Object.freeze) { + Object.freeze(element.props); + Object.freeze(element); + } + } + + return element; +}; + +/** + * Create and return a new ReactElement of the given type. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement + */ +ReactElement.createElement = function (type, config, children) { + var propName; + + // Reserved names are extracted + var props = {}; + + var key = null; + var ref = null; + var self = null; + var source = null; + + if (config != null) { + if (hasValidRef(config)) { + ref = config.ref; + } + if (hasValidKey(config)) { + key = '' + config.key; + } + + self = config.__self === undefined ? null : config.__self; + source = config.__source === undefined ? null : config.__source; + // Remaining properties are added to a new props object + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + props[propName] = config[propName]; + } + } + } + + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + if ("development" !== 'production') { + if (Object.freeze) { + Object.freeze(childArray); + } + } + props.children = childArray; + } + + // Resolve default props + if (type && type.defaultProps) { + var defaultProps = type.defaultProps; + for (propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + } + if ("development" !== 'production') { + if (key || ref) { + if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { + var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; + if (key) { + defineKeyPropWarningGetter(props, displayName); + } + if (ref) { + defineRefPropWarningGetter(props, displayName); + } + } + } + } + return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); +}; + +/** + * Return a function that produces ReactElements of a given type. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory + */ +ReactElement.createFactory = function (type) { + var factory = ReactElement.createElement.bind(null, type); + // Expose the type on the factory and the prototype so that it can be + // easily accessed on elements. E.g. `.type === Foo`. + // This should not be named `constructor` since this may not be the function + // that created the element, and it may not even be a constructor. + // Legacy hook TODO: Warn if this is accessed + factory.type = type; + return factory; +}; + +ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { + var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); + + return newElement; +}; + +/** + * Clone and return a new ReactElement using element as the starting point. + * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement + */ +ReactElement.cloneElement = function (element, config, children) { + var propName; + + // Original props are copied + var props = _assign({}, element.props); + + // Reserved names are extracted + var key = element.key; + var ref = element.ref; + // Self is preserved since the owner is preserved. + var self = element._self; + // Source is preserved since cloneElement is unlikely to be targeted by a + // transpiler, and the original source is probably a better indicator of the + // true owner. + var source = element._source; + + // Owner will be preserved, unless ref is overridden + var owner = element._owner; + + if (config != null) { + if (hasValidRef(config)) { + // Silently steal the ref from the parent. + ref = config.ref; + owner = ReactCurrentOwner.current; + } + if (hasValidKey(config)) { + key = '' + config.key; + } + + // Remaining properties override existing props + var defaultProps; + if (element.type && element.type.defaultProps) { + defaultProps = element.type.defaultProps; + } + for (propName in config) { + if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { + if (config[propName] === undefined && defaultProps !== undefined) { + // Resolve default props + props[propName] = defaultProps[propName]; + } else { + props[propName] = config[propName]; + } + } + } + } + + // Children can be more than one argument, and those are transferred onto + // the newly allocated props object. + var childrenLength = arguments.length - 2; + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 2]; + } + props.children = childArray; + } + + return ReactElement(element.type, key, ref, self, source, owner, props); +}; + +/** + * Verifies the object is a ReactElement. + * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement + * @param {?object} object + * @return {boolean} True if `object` is a valid component. + * @final + */ +ReactElement.isValidElement = function (object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +}; + +module.exports = ReactElement; +},{"./ReactCurrentOwner":107,"./ReactElementSymbol":110,"./canDefineProperty":117,"fbjs/lib/warning":86,"object-assign":94}],110:[function(require,module,exports){ +/** + * Copyright 2014-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +// The Symbol used to tag the ReactElement type. If there is no native Symbol +// nor polyfill, then a plain number is used for performance. + +var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; + +module.exports = REACT_ELEMENT_TYPE; +},{}],111:[function(require,module,exports){ +/** + * Copyright 2014-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * ReactElementValidator provides a wrapper around a element factory + * which validates the props passed to the element. This is intended to be + * used only in DEV and could be replaced by a static type checker for languages + * that support it. + */ + +'use strict'; + +var ReactCurrentOwner = require('./ReactCurrentOwner'); +var ReactComponentTreeHook = require('./ReactComponentTreeHook'); +var ReactElement = require('./ReactElement'); + +var checkReactTypeSpec = require('./checkReactTypeSpec'); + +var canDefineProperty = require('./canDefineProperty'); +var getIteratorFn = require('./getIteratorFn'); +var warning = require('fbjs/lib/warning'); +var lowPriorityWarning = require('./lowPriorityWarning'); + +function getDeclarationErrorAddendum() { + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + return ' Check the render method of `' + name + '`.'; + } + } + return ''; +} + +function getSourceInfoErrorAddendum(elementProps) { + if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) { + var source = elementProps.__source; + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return ' Check your code at ' + fileName + ':' + lineNumber + '.'; + } + return ''; +} + +/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */ +var ownerHasKeyUseWarning = {}; + +function getCurrentComponentErrorInfo(parentType) { + var info = getDeclarationErrorAddendum(); + + if (!info) { + var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; + if (parentName) { + info = ' Check the top-level render call using <' + parentName + '>.'; + } + } + return info; +} + +/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */ +function validateExplicitKey(element, parentType) { + if (!element._store || element._store.validated || element.key != null) { + return; + } + element._store.validated = true; + + var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); + + var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); + if (memoizer[currentComponentErrorInfo]) { + return; + } + memoizer[currentComponentErrorInfo] = true; + + // Usually the current owner is the offender, but if it accepts children as a + // property, it may be the creator of the child that's responsible for + // assigning it a key. + var childOwner = ''; + if (element && element._owner && element._owner !== ReactCurrentOwner.current) { + // Give the component that originally created this child. + childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; + } + + "development" !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; +} + +/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */ +function validateChildKeys(node, parentType) { + if (typeof node !== 'object') { + return; + } + if (Array.isArray(node)) { + for (var i = 0; i < node.length; i++) { + var child = node[i]; + if (ReactElement.isValidElement(child)) { + validateExplicitKey(child, parentType); + } + } + } else if (ReactElement.isValidElement(node)) { + // This element was passed in a valid location. + if (node._store) { + node._store.validated = true; + } + } else if (node) { + var iteratorFn = getIteratorFn(node); + // Entry iterators provide implicit keys. + if (iteratorFn) { + if (iteratorFn !== node.entries) { + var iterator = iteratorFn.call(node); + var step; + while (!(step = iterator.next()).done) { + if (ReactElement.isValidElement(step.value)) { + validateExplicitKey(step.value, parentType); + } + } + } + } + } +} + +/** + * Given an element, validate that its props follow the propTypes definition, + * provided by the type. + * + * @param {ReactElement} element + */ +function validatePropTypes(element) { + var componentClass = element.type; + if (typeof componentClass !== 'function') { + return; + } + var name = componentClass.displayName || componentClass.name; + if (componentClass.propTypes) { + checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); + } + if (typeof componentClass.getDefaultProps === 'function') { + "development" !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; + } +} + +var ReactElementValidator = { + createElement: function (type, props, children) { + var validType = typeof type === 'string' || typeof type === 'function'; + // We warn in this case but don't throw. We expect the element creation to + // succeed and there will likely be errors in render. + if (!validType) { + if (typeof type !== 'function' && typeof type !== 'string') { + var info = ''; + if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { + info += ' You likely forgot to export your component from the file ' + "it's defined in."; + } + + var sourceInfo = getSourceInfoErrorAddendum(props); + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + info += ReactComponentTreeHook.getCurrentStackAddendum(); + + var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null; + ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource); + "development" !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; + ReactComponentTreeHook.popNonStandardWarningStack(); + } + } + + var element = ReactElement.createElement.apply(this, arguments); + + // The result can be nullish if a mock or a custom function is used. + // TODO: Drop this when these are no longer allowed as the type argument. + if (element == null) { + return element; + } + + // Skip key warning if the type isn't valid since our key validation logic + // doesn't expect a non-string/function type and can throw confusing errors. + // We don't want exception behavior to differ between dev and prod. + // (Rendering will throw with a helpful message and as soon as the type is + // fixed, the key warnings will appear.) + if (validType) { + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], type); + } + } + + validatePropTypes(element); + + return element; + }, + + createFactory: function (type) { + var validatedFactory = ReactElementValidator.createElement.bind(null, type); + // Legacy hook TODO: Warn if this is accessed + validatedFactory.type = type; + + if ("development" !== 'production') { + if (canDefineProperty) { + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); + Object.defineProperty(this, 'type', { + value: type + }); + return type; + } + }); + } + } + + return validatedFactory; + }, + + cloneElement: function (element, props, children) { + var newElement = ReactElement.cloneElement.apply(this, arguments); + for (var i = 2; i < arguments.length; i++) { + validateChildKeys(arguments[i], newElement.type); + } + validatePropTypes(newElement); + return newElement; + } +}; + +module.exports = ReactElementValidator; +},{"./ReactComponentTreeHook":106,"./ReactCurrentOwner":107,"./ReactElement":109,"./canDefineProperty":117,"./checkReactTypeSpec":118,"./getIteratorFn":120,"./lowPriorityWarning":121,"fbjs/lib/warning":86}],112:[function(require,module,exports){ +/** + * Copyright 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var warning = require('fbjs/lib/warning'); + +function warnNoop(publicInstance, callerName) { + if ("development" !== 'production') { + var constructor = publicInstance.constructor; + "development" !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; + } +} + +/** + * This is the abstract API for an update queue. + */ +var ReactNoopUpdateQueue = { + /** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function (publicInstance) { + return false; + }, + + /** + * Enqueue a callback that will be executed after all the pending updates + * have processed. + * + * @param {ReactClass} publicInstance The instance to use as `this` context. + * @param {?function} callback Called after state is updated. + * @internal + */ + enqueueCallback: function (publicInstance, callback) {}, + + /** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @internal + */ + enqueueForceUpdate: function (publicInstance) { + warnNoop(publicInstance, 'forceUpdate'); + }, + + /** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @internal + */ + enqueueReplaceState: function (publicInstance, completeState) { + warnNoop(publicInstance, 'replaceState'); + }, + + /** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @internal + */ + enqueueSetState: function (publicInstance, partialState) { + warnNoop(publicInstance, 'setState'); + } +}; + +module.exports = ReactNoopUpdateQueue; +},{"fbjs/lib/warning":86}],113:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +var ReactPropTypeLocationNames = {}; + +if ("development" !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} + +module.exports = ReactPropTypeLocationNames; +},{}],114:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _require = require('./ReactElement'), + isValidElement = _require.isValidElement; + +var factory = require('prop-types/factory'); + +module.exports = factory(isValidElement); +},{"./ReactElement":109,"prop-types/factory":96}],115:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; +},{}],116:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +module.exports = '15.6.1'; +},{}],117:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +var canDefineProperty = false; +if ("development" !== 'production') { + try { + // $FlowFixMe https://github.com/facebook/flow/issues/285 + Object.defineProperty({}, 'x', { get: function () {} }); + canDefineProperty = true; + } catch (x) { + // IE will fail on defineProperty + } +} + +module.exports = canDefineProperty; +},{}],118:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _prodInvariant = require('./reactProdInvariant'); + +var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); +var ReactPropTypesSecret = require('./ReactPropTypesSecret'); + +var invariant = require('fbjs/lib/invariant'); +var warning = require('fbjs/lib/warning'); + +var ReactComponentTreeHook; + +if (typeof process !== 'undefined' && process.env && "development" === 'test') { + // Temporary hack. + // Inline requires don't work well with Jest: + // https://github.com/facebook/react/issues/7240 + // Remove the inline requires when we don't need them anymore: + // https://github.com/facebook/react/pull/7178 + ReactComponentTreeHook = require('./ReactComponentTreeHook'); +} + +var loggedTypeFailures = {}; + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?object} element The React element that is being type-checked + * @param {?number} debugID The React component instance that is being type-checked + * @private + */ +function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + !(typeof typeSpecs[typeSpecName] === 'function') ? "development" !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + "development" !== 'production' ? 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', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var componentStackInfo = ''; + + if ("development" !== 'production') { + if (!ReactComponentTreeHook) { + ReactComponentTreeHook = require('./ReactComponentTreeHook'); + } + if (debugID !== null) { + componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); + } else if (element !== null) { + componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); + } + } + + "development" !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; + } + } + } +} + +module.exports = checkReactTypeSpec; +},{"./ReactComponentTreeHook":106,"./ReactPropTypeLocationNames":113,"./ReactPropTypesSecret":115,"./reactProdInvariant":123,"fbjs/lib/invariant":85,"fbjs/lib/warning":86}],119:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _require = require('./ReactBaseClasses'), + Component = _require.Component; + +var _require2 = require('./ReactElement'), + isValidElement = _require2.isValidElement; + +var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); +var factory = require('create-react-class/factory'); + +module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue); +},{"./ReactBaseClasses":104,"./ReactElement":109,"./ReactNoopUpdateQueue":112,"create-react-class/factory":81}],120:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ + +'use strict'; + +/* global Symbol */ + +var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + +/** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ +function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } +} + +module.exports = getIteratorFn; +},{}],121:[function(require,module,exports){ +/** + * Copyright 2014-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var lowPriorityWarning = function () {}; + +if ("development" !== 'production') { + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.warn(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + lowPriorityWarning = function (condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +module.exports = lowPriorityWarning; +},{}],122:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +'use strict'; + +var _prodInvariant = require('./reactProdInvariant'); + +var ReactElement = require('./ReactElement'); + +var invariant = require('fbjs/lib/invariant'); + +/** + * Returns the first child in a collection of children and verifies that there + * is only one child in the collection. + * + * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only + * + * The current implementation of this function assumes that a single child gets + * passed without a wrapper, but the purpose of this helper function is to + * abstract away the particular structure of children. + * + * @param {?object} children Child collection structure. + * @return {ReactElement} The first and only `ReactElement` contained in the + * structure. + */ +function onlyChild(children) { + !ReactElement.isValidElement(children) ? "development" !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0; + return children; +} + +module.exports = onlyChild; +},{"./ReactElement":109,"./reactProdInvariant":123,"fbjs/lib/invariant":85}],123:[function(require,module,exports){ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * + */ +'use strict'; + +/** + * WARNING: DO NOT manually require this module. + * This is a replacement for `invariant(...)` used by the error code system + * and will _only_ be required by the corresponding babel pass. + * It always throws. + */ + +function reactProdInvariant(code) { + var argCount = arguments.length - 1; + + var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; + + for (var argIdx = 0; argIdx < argCount; argIdx++) { + message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); + } + + message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; + + var error = new Error(message); + error.name = 'Invariant Violation'; + error.framesToPop = 1; // we don't care about reactProdInvariant's own frame + + throw error; +} + +module.exports = reactProdInvariant; +},{}],124:[function(require,module,exports){ +/** + * Copyright 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +'use strict'; + +var _prodInvariant = require('./reactProdInvariant'); + +var ReactCurrentOwner = require('./ReactCurrentOwner'); +var REACT_ELEMENT_TYPE = require('./ReactElementSymbol'); + +var getIteratorFn = require('./getIteratorFn'); +var invariant = require('fbjs/lib/invariant'); +var KeyEscapeUtils = require('./KeyEscapeUtils'); +var warning = require('fbjs/lib/warning'); + +var SEPARATOR = '.'; +var SUBSEPARATOR = ':'; + +/** + * This is inlined from ReactElement since this file is shared between + * isomorphic and renderers. We could extract this to a + * + */ + +/** + * TODO: Test that a single child and an array with one item have the same key + * pattern. + */ + +var didWarnAboutMaps = false; + +/** + * Generate a key string that identifies a component within a set. + * + * @param {*} component A component that could contain a manual key. + * @param {number} index Index that is used if a manual key is not provided. + * @return {string} + */ +function getComponentKey(component, index) { + // Do some typechecking here since we call this blindly. We want to ensure + // that we don't block potential future ES APIs. + if (component && typeof component === 'object' && component.key != null) { + // Explicit key + return KeyEscapeUtils.escape(component.key); + } + // Implicit key determined by the index in the set + return index.toString(36); +} + +/** + * @param {?*} children Children tree container. + * @param {!string} nameSoFar Name of the key path so far. + * @param {!function} callback Callback to invoke with each child found. + * @param {?*} traverseContext Used to pass information throughout the traversal + * process. + * @return {!number} The number of children in this subtree. + */ +function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + + if (type === 'undefined' || type === 'boolean') { + // All of the above are perceived as null. + children = null; + } + + if (children === null || type === 'string' || type === 'number' || + // The following is inlined from ReactElement. This means we can optimize + // some checks. React Fiber also inlines this logic for similar purposes. + type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { + callback(traverseContext, children, + // If it's the only child, treat the name as if it was wrapped in an array + // so that it's consistent if the number of children grows. + nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); + return 1; + } + + var child; + var nextName; + var subtreeCount = 0; // Count of children found in the current subtree. + var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; + + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + child = children[i]; + nextName = nextNamePrefix + getComponentKey(child, i); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + var iteratorFn = getIteratorFn(children); + if (iteratorFn) { + var iterator = iteratorFn.call(children); + var step; + if (iteratorFn !== children.entries) { + var ii = 0; + while (!(step = iterator.next()).done) { + child = step.value; + nextName = nextNamePrefix + getComponentKey(child, ii++); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } else { + if ("development" !== 'production') { + var mapsAsChildrenAddendum = ''; + if (ReactCurrentOwner.current) { + var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); + if (mapsAsChildrenOwnerName) { + mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; + } + } + "development" !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; + didWarnAboutMaps = true; + } + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + child = entry[1]; + nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); + subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); + } + } + } + } else if (type === 'object') { + var addendum = ''; + if ("development" !== 'production') { + addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; + if (children._isReactElement) { + addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; + } + if (ReactCurrentOwner.current) { + var name = ReactCurrentOwner.current.getName(); + if (name) { + addendum += ' Check the render method of `' + name + '`.'; + } + } + } + var childrenString = String(children); + !false ? "development" !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; + } + } + + return subtreeCount; +} + +/** + * Traverses children that are typically specified as `props.children`, but + * might also be specified through attributes: + * + * - `traverseAllChildren(this.props.children, ...)` + * - `traverseAllChildren(this.props.leftPanelChildren, ...)` + * + * The `traverseContext` is an optional argument that is passed through the + * entire traversal. It can be used to store accumulations or anything else that + * the callback might find relevant. + * + * @param {?*} children Children tree object. + * @param {!function} callback To invoke upon traversing each child. + * @param {?*} traverseContext Context for traversal. + * @return {!number} The number of children in this subtree. + */ +function traverseAllChildren(children, callback, traverseContext) { + if (children == null) { + return 0; + } + + return traverseAllChildrenImpl(children, '', callback, traverseContext); +} + +module.exports = traverseAllChildren; +},{"./KeyEscapeUtils":101,"./ReactCurrentOwner":107,"./ReactElementSymbol":110,"./getIteratorFn":120,"./reactProdInvariant":123,"fbjs/lib/invariant":85,"fbjs/lib/warning":86}],125:[function(require,module,exports){ +'use strict'; + +module.exports = require('./lib/React'); + +},{"./lib/React":103}],126:[function(require,module,exports){ 'use strict'; var Concur = require('Concur') @@ -9502,13 +13899,13 @@ module.exports = { ValidationError: ValidationError } -},{"Concur":79,"isomorph/format":83,"isomorph/is":84,"isomorph/object":85}],89:[function(require,module,exports){ +},{"Concur":79,"isomorph/format":89,"isomorph/is":90,"isomorph/object":91}],127:[function(require,module,exports){ 'use strict'; // HACK: requiring './validators' here makes the circular import in ipv6.js work // after browserification. module.exports = require('./validators') -},{"./validators":91}],90:[function(require,module,exports){ +},{"./validators":129}],128:[function(require,module,exports){ 'use strict'; var object = require('isomorph/object') @@ -9792,7 +14189,7 @@ module.exports = { , isValidIPv6Address: isValidIPv6Address } -},{"./errors":88,"./validators":91,"isomorph/object":85}],91:[function(require,module,exports){ +},{"./errors":126,"./validators":129,"isomorph/object":91}],129:[function(require,module,exports){ 'use strict'; var Concur = require('Concur') @@ -10138,5 +14535,5 @@ module.exports = { , ipv6: ipv6 } -},{"./errors":88,"./ipv6":90,"Concur":79,"isomorph/is":84,"isomorph/object":85,"isomorph/url":87,"punycode":80}]},{},[1])(1) +},{"./errors":126,"./ipv6":128,"Concur":79,"isomorph/is":90,"isomorph/object":91,"isomorph/url":93,"punycode":80}]},{},[1])(1) }); \ No newline at end of file diff --git a/package.json b/package.json index 2a1077b..40dcf56 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "envify": "^3.4.0", "get-form-data": "^1.2.2", "isomorph": "^0.3.0", + "prop-types": "^15.5.10", "validators": "^0.3.1" }, "devDependencies": { diff --git a/src/components/FormRow.jsx b/src/components/FormRow.jsx index 94cc519..65bffec 100644 --- a/src/components/FormRow.jsx +++ b/src/components/FormRow.jsx @@ -1,6 +1,8 @@ 'use strict'; var React = require('react') +var PropTypes = require('prop-types') +var createReactClass = require('create-react-class') var BoundField = require('../BoundField') var ProgressMixin = require('./ProgressMixin') @@ -10,14 +12,14 @@ var ProgressMixin = require('./ProgressMixin') * if a BoundField is given, it will be used to display a field's label, widget, * error message(s), help text and async pending indicator. */ -var FormRow = React.createClass({ +var FormRow = createReactClass({ mixins: [ProgressMixin], propTypes: { - bf: React.PropTypes.instanceOf(BoundField) - , className: React.PropTypes.string - , component: React.PropTypes.any - , content: React.PropTypes.any - , hidden: React.PropTypes.bool + bf: PropTypes.instanceOf(BoundField) + , className: PropTypes.string + , component: PropTypes.any + , content: PropTypes.any + , hidden: PropTypes.bool , __all__(props) { if (!props.bf && !props.content) { return new Error( @@ -66,4 +68,4 @@ var FormRow = React.createClass({ } }) -module.exports = FormRow \ No newline at end of file +module.exports = FormRow diff --git a/src/components/ProgressMixin.jsx b/src/components/ProgressMixin.jsx index cd709dd..cea95ba 100644 --- a/src/components/ProgressMixin.jsx +++ b/src/components/ProgressMixin.jsx @@ -2,10 +2,11 @@ var is = require('isomorph/is') var React = require('react') +var PropTypes = require('prop-types') var ProgressMixin = { propTypes: { - progress: React.PropTypes.any // Component or function to render async progress + progress: PropTypes.any // Component or function to render async progress }, renderProgress() { @@ -19,4 +20,4 @@ var ProgressMixin = { } } -module.exports = ProgressMixin \ No newline at end of file +module.exports = ProgressMixin diff --git a/src/components/RenderForm.jsx b/src/components/RenderForm.jsx index cc91232..2de6d49 100644 --- a/src/components/RenderForm.jsx +++ b/src/components/RenderForm.jsx @@ -2,6 +2,8 @@ var object = require('isomorph/object') var React = require('react') +var PropTypes = require('prop-types') +var createReactClass = require('create-react-class') var ErrorObject = require('../ErrorObject') var Form = require('../Form') @@ -13,19 +15,19 @@ var {autoIdChecker, getProps} = require('../util') var formProps = { autoId: autoIdChecker -, controlled: React.PropTypes.bool -, data: React.PropTypes.object -, emptyPermitted: React.PropTypes.bool -, errorConstructor: React.PropTypes.func -, errors: React.PropTypes.instanceOf(ErrorObject) -, files: React.PropTypes.object -, initial: React.PropTypes.object -, labelSuffix: React.PropTypes.string -, onChange: React.PropTypes.func -, prefix: React.PropTypes.string -, validation: React.PropTypes.oneOfType([ - React.PropTypes.string - , React.PropTypes.object +, controlled: PropTypes.bool +, data: PropTypes.object +, emptyPermitted: PropTypes.bool +, errorConstructor: PropTypes.func +, errors: PropTypes.instanceOf(ErrorObject) +, files: PropTypes.object +, initial: PropTypes.object +, labelSuffix: PropTypes.string +, onChange: PropTypes.func +, prefix: PropTypes.string +, validation: PropTypes.oneOfType([ + PropTypes.string + , PropTypes.object ]) } @@ -34,21 +36,21 @@ var formProps = { * is given, an instance will be created when the component is mounted, and any * additional props will be passed to the constructor as options. */ -var RenderForm = React.createClass({ +var RenderForm = createReactClass({ mixins: [ProgressMixin], propTypes: object.extend({}, formProps, { - className: React.PropTypes.string // Class for the component wrapping all rows - , component: React.PropTypes.any // Component to wrap all rows - , form: React.PropTypes.oneOfType([ // Form instance or constructor - React.PropTypes.func, - React.PropTypes.instanceOf(Form) + className: PropTypes.string // Class for the component wrapping all rows + , component: PropTypes.any // Component to wrap all rows + , form: PropTypes.oneOfType([ // Form instance or constructor + PropTypes.func, + PropTypes.instanceOf(Form) ]).isRequired - , row: React.PropTypes.any // Component to render form rows - , rowComponent: React.PropTypes.any // Component to wrap each row + , row: PropTypes.any // Component to render form rows + , rowComponent: PropTypes.any // Component to wrap each row }), childContextTypes: { - form: React.PropTypes.instanceOf(Form) + form: PropTypes.instanceOf(Form) }, getChildContext() { diff --git a/src/components/RenderFormSet.jsx b/src/components/RenderFormSet.jsx index fa5d8ed..86c2b41 100644 --- a/src/components/RenderFormSet.jsx +++ b/src/components/RenderFormSet.jsx @@ -2,6 +2,8 @@ var object = require('isomorph/object') var React = require('react') +var PropTypes = require('prop-types') +var createReactClass = require('create-react-class') var FormRow = require('./FormRow') var FormSet = require('../FormSet') @@ -12,26 +14,26 @@ var {NON_FIELD_ERRORS} = require('../constants') var {autoIdChecker, getProps} = require('../util') var formsetProps = { - canDelete: React.PropTypes.bool -, canOrder: React.PropTypes.bool -, extra: React.PropTypes.number -, form: React.PropTypes.func -, maxNum: React.PropTypes.number -, minNum: React.PropTypes.number -, validateMax: React.PropTypes.bool -, validateMin: React.PropTypes.bool + canDelete: PropTypes.bool +, canOrder: PropTypes.bool +, extra: PropTypes.number +, form: PropTypes.func +, maxNum: PropTypes.number +, minNum: PropTypes.number +, validateMax: PropTypes.bool +, validateMin: PropTypes.bool , autoId: autoIdChecker -, controlled: React.PropTypes.bool -, data: React.PropTypes.object -, errorConstructor: React.PropTypes.func -, files: React.PropTypes.object -, initial: React.PropTypes.object -, onChange: React.PropTypes.func -, prefix: React.PropTypes.string -, validation: React.PropTypes.oneOfType([ - React.PropTypes.string - , React.PropTypes.object +, controlled: PropTypes.bool +, data: PropTypes.object +, errorConstructor: PropTypes.func +, files: PropTypes.object +, initial: PropTypes.object +, onChange: PropTypes.func +, prefix: PropTypes.string +, validation: PropTypes.oneOfType([ + PropTypes.string + , PropTypes.object ]) } @@ -41,19 +43,19 @@ var formsetProps = { * mounted, and any additional props will be passed to the constructor as * options. */ -var RenderFormSet = React.createClass({ +var RenderFormSet = createReactClass({ mixins: [ProgressMixin], propTypes: object.extend({}, formsetProps, { - className: React.PropTypes.string // Class for the component wrapping all forms - , component: React.PropTypes.any // Component to wrap all forms - , formComponent: React.PropTypes.any // Component to wrap each form - , formset: React.PropTypes.oneOfType([ // Formset instance or constructor - React.PropTypes.func, - React.PropTypes.instanceOf(FormSet) + className: PropTypes.string // Class for the component wrapping all forms + , component: PropTypes.any // Component to wrap all forms + , formComponent: PropTypes.any // Component to wrap each form + , formset: PropTypes.oneOfType([ // Formset instance or constructor + PropTypes.func, + PropTypes.instanceOf(FormSet) ]) - , row: React.PropTypes.any // Component to render form rows - , rowComponent: React.PropTypes.any // Component to wrap each form row - , useManagementForm: React.PropTypes.bool // Should ManagementForm hidden fields be rendered? + , row: PropTypes.any // Component to render form rows + , rowComponent: PropTypes.any // Component to wrap each form row + , useManagementForm: PropTypes.bool // Should ManagementForm hidden fields be rendered? , __all__(props) { if (!props.form && !props.formset) { return new Error( @@ -128,4 +130,4 @@ var RenderFormSet = React.createClass({ } }) -module.exports = RenderFormSet \ No newline at end of file +module.exports = RenderFormSet diff --git a/tests/customAsserts.js b/tests/customAsserts.js index de8d2ee..9d739d9 100644 --- a/tests/customAsserts.js +++ b/tests/customAsserts.js @@ -91,7 +91,7 @@ var reactHTMLEqual = (function() { // rendering should be passsed. if (typeof component == 'function') { var renderFunc = component - var reactClass = React.createClass({ + var reactClass = createReactClass({ render: function() { var rendered = renderFunc() if (Array.isArray(rendered)) { diff --git a/tests/docs.js b/tests/docs.js index b6347cb..17d8e44 100644 --- a/tests/docs.js +++ b/tests/docs.js @@ -29,7 +29,7 @@ function repr(o) { // ================================================================ overview === QUnit.test('Overview - Customising form display', function() { - var Contact = React.createClass({displayName: 'Contact', + var Contact = createReactClass({displayName: 'Contact', getInitialState: function() { return {form: new ContactForm()} } @@ -74,7 +74,7 @@ QUnit.test('Overview - Customising form display', function() { }) QUnit.test("Overview - Looping over the Form's Fields", function() { - var Contact = React.createClass({displayName: 'Contact', + var Contact = createReactClass({displayName: 'Contact', getInitialState: function() { return {form: new ContactForm()} } @@ -580,7 +580,7 @@ var MultiRecipientContactForm = forms.Form.extend({ // =================================================================== react === QUnit.test('Forms and React - Using a Form in a React component', function() { - var Contact = React.createClass({displayName: 'Contact', + var Contact = createReactClass({displayName: 'Contact', render: function() { return React.createElement('form', {ref:"form", onSubmit:this.onSubmit, action:"/contact", method:"POST"}, React.createElement(forms.RenderForm, {form: ContactForm, ref: 'contactForm'}), diff --git a/tests/dom-initial.js b/tests/dom-initial.js index 4dc031a..008e9d2 100644 --- a/tests/dom-initial.js +++ b/tests/dom-initial.js @@ -8,7 +8,7 @@ void function() { function renderField(field, cb) { var _Form = forms.Form.extend({f: field}) - var _Component = React.createClass({ + var _Component = createReactClass({ displayName: 'QUnitTestComponent' , render: function() { return React.createElement('form', {id: 'form'} diff --git a/tests/tests.js b/tests/tests.js index f06dfc0..2104a65 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -9,6 +9,7 @@ global.navigator = {userAgent: 'fake'} object.extend(global, require('./customAsserts.js')) global.React = window.React = require('react/dist/react.js') global.ReactDOMServer = window.ReactDOMServer = require('react-dom/server') +global.createReactClass = window.createReactClass = require('create-react-class') global.isomorph = require('isomorph') global.forms = require('../dist/newforms.js') From 91a731c5a89494735e71723d0e832f93967e290d Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 12:44:24 -0700 Subject: [PATCH 08/12] React.__spread -> Object.assign --- dist/newforms.js | 2 +- docs/_static/js/deps.js | 86 ++++++++++++++++++++--------------------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/dist/newforms.js b/dist/newforms.js index 736a354..0a14ce0 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:41:58 GMT) - https://github.com/insin/newforms + * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:44:14 GMT) - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0 && React.createElement(props.row, { - className: form.hiddenFieldRowCssClass, - component: props.rowComponent, - content: hiddenFields, - hidden: true, + className: form.hiddenFieldRowCssClass, + component: props.rowComponent, + content: hiddenFields, + hidden: true, key: form.addPrefix('__hidden__')} ) ) @@ -6386,30 +6386,30 @@ var RenderFormSet = React.createClass({displayName: "RenderFormSet", } var topErrors = formset.nonFormErrors() - return React.createElement(props.component, React.__spread({}, attrs), + return React.createElement(props.component, Object.assign({}, attrs), topErrors.isPopulated() && React.createElement(props.row, { - className: formset.errorCssClass, - content: topErrors.render(), - key: formset.addPrefix(NON_FIELD_ERRORS), + className: formset.errorCssClass, + content: topErrors.render(), + key: formset.addPrefix(NON_FIELD_ERRORS), rowComponent: props.rowComponent} - ), + ), formset.forms().map(function(form) {return React.createElement(RenderForm, { - form: form, - formComponent: props.formComponent, - progress: props.progress, - row: props.row, + form: form, + formComponent: props.formComponent, + progress: props.progress, + row: props.row, rowComponent: props.rowComponent} - );}), + );}), formset.nonFormPending() && React.createElement(props.row, { - className: formset.pendingRowCssClass, - content: this.renderProgress(), - key: formset.addPrefix('__pending__'), + className: formset.pendingRowCssClass, + content: this.renderProgress(), + key: formset.addPrefix('__pending__'), rowComponent: props.rowComponent} - ), + ), props.useManagementForm && React.createElement(RenderForm, { - form: formset.managementForm(), - formComponent: props.formComponent, - row: props.row, + form: formset.managementForm(), + formComponent: props.formComponent, + row: props.row, rowComponent: props.rowComponent} ) ) @@ -27839,7 +27839,7 @@ module.exports = performanceNow; * * @providesModule shallowEqual * @typechecks - * + * */ 'use strict'; From d614a2730a484c508415b741b95d18b810d86184 Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 13:05:43 -0700 Subject: [PATCH 09/12] dist --- dist/newforms.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/newforms.js b/dist/newforms.js index 0a14ce0..2231bbf 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 19:44:14 GMT) - https://github.com/insin/newforms + * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 20:05:30 GMT) - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o Date: Wed, 30 Aug 2017 18:15:15 -0700 Subject: [PATCH 10/12] dist --- dist/newforms.js | 2 +- dist/newforms.min.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dist/newforms.js b/dist/newforms.js index 2231bbf..fb0e3b0 100644 --- a/dist/newforms.js +++ b/dist/newforms.js @@ -1,5 +1,5 @@ /** - * newforms 0.13.2 (dev build at Wed, 30 Aug 2017 20:05:30 GMT) - https://github.com/insin/newforms + * newforms 0.13.2 - https://github.com/insin/newforms * MIT Licensed */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.forms = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;oe;e++)try{return this.strpdate(t,this.inputFormats[e])}catch(n){}}throw u(this.errorMessages.invalid,{code:"invalid"})},h.prototype.strpdate=function(t,e){return n.strpdate(t,e,s.getDefaultLocale())},h.prototype._hasChanged=function(t,e){try{e=this.toJavaScript(e)}catch(i){if(!(i instanceof u))throw i;return!0}return t=this.toJavaScript(t),t&&e?t.getTime()!==e.getTime():t!==e},e.exports=h},{"./Field":26,"./formats":75,"./locales":77,"./util":78,"isomorph/is":84,"isomorph/object":85,"isomorph/time":86,validators:89}],3:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("./CheckboxInput"),n=t("./Field"),o=t("validators"),s=o.ValidationError,a=n.extend({widget:r,constructor:function l(t){return this instanceof l?void n.call(this,t):new l(t)}});a.prototype.toJavaScript=function(t){if(t=!i.String(t)||"false"!=t.toLowerCase()&&"0"!=t?Boolean(t):!1,t=n.prototype.toJavaScript.call(this,t),!t&&this.required)throw s(this.errorMessages.required,{code:"required"});return t},a.prototype._hasChanged=function(t,e){return"false"===t&&(t=!1),Boolean(t)!=Boolean(e)},e.exports=a},{"./CheckboxInput":8,"./Field":26,"isomorph/is":84,validators:89}],4:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/is"),n=t("isomorph/format").formatObj,o=t("isomorph/object"),s="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,a=t("./TextInput"),l=t("./Textarea"),u=t("./util"),c=u.prettyName,d=":?.!",h=i.extend({constructor:function p(t,e,i){return this instanceof p?(this.form=t,this.field=e,this.name=i,this.htmlName=t.addPrefix(i),this.htmlInitialName=t.addInitialPrefix(i),this.htmlInitialId=t.addInitialPrefix(this.autoId()),this.label=null!==this.field.label?this.field.label:c(i),void(this.helpText=e.helpText||"")):new p(t,e,i)}});h.prototype.isEmpty=function(){return this.field.isEmptyValue(this.value())},h.prototype.isPending=function(){return"undefined"!=typeof this.form._pendingAsyncValidation[this.name]},h.prototype.isCleaned=function(){return"undefined"!=typeof this.form.cleanedData[this.name]},h.prototype.isHidden=function(){return this.field.widget.isHidden},h.prototype.status=function(){return this.isPending()?"pending":this.errors().isPopulated()?"error":this.isCleaned()?"valid":"default"},h.prototype.autoId=function(){var t=this.form.autoId;return t?(t=""+t,-1!=t.indexOf("{name}")?n(t,{name:this.htmlName}):this.htmlName):""},h.prototype.data=function(){return this.field.widget.valueFromData(this.form.data,this.form.files,this.htmlName)},h.prototype.errors=function(){return this.form.errors(this.name)||new this.form.errorConstructor},h.prototype.errorMessage=function(){return this.errors().first()},h.prototype.errorMessages=function(){return this.errors().messages()},h.prototype.idForLabel=function(){var t=this.field.widget,e=o.get(t.attrs,"id",this.autoId());return t.idForLabel(e)},h.prototype.value=function(){var t;return t=this.form.isInitialRender?this.initialValue():this.field.boundData(this.data(),o.get(this.form.initial,this.name,this.field.initial)),this.field.prepareValue(t)},h.prototype.initialValue=function(){var t=o.get(this.form.initial,this.name,this.field.initial);return r.Function(t)&&(t=t()),t},h.prototype.asWidget=function(t){t=o.extend({widget:null,attrs:null,onlyInitial:!1},t);var e=null!==t.widget?t.widget:this.field.widget,i=null!==t.attrs?t.attrs:{},r=this.autoId(),n=t.onlyInitial?this.htmlInitialName:this.htmlName;r&&"undefined"==typeof i.id&&"undefined"==typeof e.attrs.id&&(i.id=t.onlyInitial?this.htmlInitialId:r),"undefined"==typeof i.key&&(i.key=n);var s=this._getValidation(e);if(i.onChange=this.form._handleFieldEvent.bind(this.form,{event:"onChange",validate:!!s.onChange,delay:s.onChangeDelay}),"manual"!=s&&s.events)for(var a=0,l=s.events.length;l>a;a++){var u=s.events[a];i[u]=this.form._handleFieldEvent.bind(this.form,{event:u})}var c={attrs:i,controlled:this._isControlled(e)};return e.needsInitialValue&&(c.initialValue=this.initialValue()),e.render(n,this.value(),c)},h.prototype.asHidden=function(t){return t=o.extend({},t,{widget:new this.field.hiddenWidget}),this.asWidget(t)},h.prototype.asText=function(t){return t=o.extend({},t,{widget:a()}),this.asWidget(t)},h.prototype.asTextarea=function(t){return t=o.extend({},t,{widget:l()}),this.asWidget(t)},h.prototype.cssClasses=function(t){var e=t?[t]:[];null!==this.field.cssClass&&e.push(this.field.cssClass),"undefined"!=typeof this.form.rowCssClass&&e.push(this.form.rowCssClass);var i=this.status();return"undefined"!=typeof this.form[i+"CssClass"]&&e.push(this.form[i+"CssClass"]),this.field.required?"undefined"!=typeof this.form.requiredCssClass&&e.push(this.form.requiredCssClass):"undefined"!=typeof this.form.optionalCssClass&&e.push(this.form.optionalCssClass),e.join(" ")},h.prototype.helpTextTag=function(t){if(t=o.extend({tagName:"span",attrs:null,contents:this.helpText},t),t.contents){var e=o.extend({className:"helpText"},t.attrs),i=t.contents;return r.Object(i)&&o.hasOwn(i,"__html")?(e.dangerouslySetInnerHTML=i,s.createElement(t.tagName,e)):s.createElement(t.tagName,e,i)}},h.prototype.labelTag=function(t){t=o.extend({contents:this.label,attrs:null,labelSuffix:this.form.labelSuffix},t);var e=this._addLabelSuffix(t.contents,t.labelSuffix),i=this.field.widget,r=o.get(i.attrs,"id",this.autoId());if(r){var n=o.extend(t.attrs||{},{htmlFor:i.idForLabel(r)});e=s.createElement("label",n,e)}return e},h.prototype.render=function(t){return this.field.showHiddenInitial?s.createElement("div",null,this.asWidget(t),this.asHidden({onlyInitial:!0})):this.asWidget(t)},h.prototype.subWidgets=function(){var t=this.field.widget.attrs.id||this.autoId(),e={attrs:{}};return t&&(e.attrs.id=t),this.field.widget.subWidgets(this.htmlName,this.value(),e)},h.prototype._addLabelSuffix=function(t,e){return e&&-1==d.indexOf(t.charAt(t.length-1))?t+e:t},h.prototype._isControlled=function(t){0===arguments.length&&(t=this.field.widget);var e=!1;return t.isValueSettable&&(e=null!==this.field.controlled?this.field.controlled:this.form.controlled),e},h.prototype._getValidation=function(t){var e=this.field.validation||this.form.validation;return"manual"!==e&&null!==t.validation&&(e=t.validation),e},e.exports=h},{"./TextInput":64,"./Textarea":65,"./util":78,Concur:79,"isomorph/format":83,"isomorph/is":84,"isomorph/object":85}],5:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./Field"),n=t("./PasswordInput"),o=t("./TextInput"),s=t("validators"),a=s.MinLengthValidator,l=s.MaxLengthValidator,u=r.extend({constructor:function c(t){return this instanceof c?(t=i.extend({maxLength:null,minLength:null},t),this.maxLength=t.maxLength,this.minLength=t.minLength,r.call(this,t),null!==this.minLength&&this.validators.push(a(this.minLength)),void(null!==this.maxLength&&this.validators.push(l(this.maxLength)))):new c(t)}});u.prototype.toJavaScript=function(t){return this.isEmptyValue(t)?"":""+t},u.prototype.getWidgetAttrs=function(t){var e=r.prototype.getWidgetAttrs.call(this,t);return null!==this.maxLength&&(t instanceof o||t instanceof n)&&(e.maxLength=""+this.maxLength),e},e.exports=u},{"./Field":26,"./PasswordInput":48,"./TextInput":64,"isomorph/object":85,validators:89}],6:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("./ChoiceInput"),n=r.extend({constructor:function o(t,e,n,s,a,l){if(!(this instanceof o))return new o(t,e,n,s,a,l);i.Array(e)||(e=[e]),r.call(this,t,e,n,s,a,l);for(var u=0,c=this.value.length;c>u;u++)this.value[u]=""+this.value[u]},inputType:"checkbox"});n.prototype.isChecked=function(){return-1!==this.value.indexOf(this.choiceValue)},e.exports=n},{"./ChoiceInput":12,"isomorph/is":84}],7:[function(t,e){"use strict";var i=t("./CheckboxChoiceInput"),r=t("./ChoiceFieldRenderer"),n=r.extend({constructor:function o(t,e,i,n,s){return this instanceof o?void r.apply(this,arguments):new o(t,e,i,n,s)},choiceInputConstructor:i});e.exports=n},{"./CheckboxChoiceInput":6,"./ChoiceFieldRenderer":11}],8:[function(t,e){"use strict";function i(t){return t!==!1&&null!=t&&""!==t}var r=t("isomorph/is"),n=t("isomorph/object"),o="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,s=t("./Widget"),a=s.extend({constructor:function l(t){return this instanceof s?(t=n.extend({checkTest:i},t),s.call(this,t),void(this.checkTest=t.checkTest)):new l(t)},validation:{onChange:!0}});a.prototype.render=function(t,e,i){i=n.extend({},i);var r=this.buildAttrs(i.attrs,{type:"checkbox",name:t});""!==e&&e!==!0&&e!==!1&&null!==e&&void 0!==e&&(r.value=e);var s=i.controlled?"checked":"defaultChecked";return r[s]=this.checkTest(e),o.createElement("input",r)},a.prototype.valueFromData=function(t,e,i){if("undefined"==typeof t[i])return!1;var o=t[i],s={"true":!0,"false":!1};return r.String(o)&&(o=n.get(s,o.toLowerCase(),o)),!!o},e.exports=a},{"./Widget":72,"isomorph/is":84,"isomorph/object":85}],9:[function(t,e){"use strict";var i=t("./CheckboxFieldRenderer"),r=t("./RendererMixin"),n=t("./SelectMultiple"),o=n.extend({__mixins__:[r],constructor:function(t){return this instanceof o?(r.call(this,t),void n.call(this,t)):new o(t)},renderer:i,_emptyValue:[]});e.exports=o},{"./CheckboxFieldRenderer":7,"./RendererMixin":56,"./SelectMultiple":58}],10:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n=t("./Field"),o=t("./Select"),s=t("validators"),a=s.ValidationError,l=t("./util"),u=l.normaliseChoices,c=n.extend({widget:o,defaultErrorMessages:{invalidChoice:"Select a valid choice. {value} is not one of the available choices."},constructor:function d(t){return this instanceof d?(t=r.extend({choices:[]},t),n.call(this,t),void this.setChoices(t.choices)):new d(t)}});c.prototype.choices=function(){return this._choices},c.prototype.setChoices=function(t){this._choices=this.widget.choices=u(t)},c.prototype.toJavaScript=function(t){return this.isEmptyValue(t)?"":""+t},c.prototype.validate=function(t){if(n.prototype.validate.call(this,t),t&&!this.validValue(t))throw a(this.errorMessages.invalidChoice,{code:"invalidChoice",params:{value:t}})},c.prototype.validValue=function(t){for(var e=this.choices(),r=0,n=e.length;n>r;r++)if(i.Array(e[r][1])){for(var o=e[r][1],s=0,a=o.length;a>s;s++)if(t===""+o[s][0])return!0}else if(t===""+e[r][0])return!0;return!1},e.exports=c},{"./Field":26,"./Select":57,"./util":78,"isomorph/is":84,"isomorph/object":85,validators:89}],11:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/is"),n=t("isomorph/object"),o="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,s=i.extend({constructor:function a(t,e,i,r,n){return this instanceof a?(this.name=t,this.value=e,this.attrs=i,this.controlled=r,void(this.choices=n)):new a(t,e,i,r,n)},choiceInputConstructor:null});s.prototype.choiceInputs=function(){for(var t=[],e=0,i=this.choices.length;i>e;e++)t.push(this.choiceInputConstructor(this.name,this.value,n.extend({},this.attrs),this.controlled,this.choices[e],e));return t},s.prototype.choiceInput=function(t){if(t>=this.choices.length)throw new Error("Index out of bounds: "+t);return this.choiceInputConstructor(this.name,this.value,n.extend({},this.attrs),this.controlled,this.choices[t],t)},s.prototype.render=function(){for(var t=n.get(this.attrs,"id",null),e=n.pop(this.attrs,"key",null),i=[],a=0,l=this.choices.length;l>a;a++){var u=this.choices[a],c=u[0],d=u[1];if(r.Array(d)){var h=n.extend({},this.attrs);t&&(h.id+="_"+a),e&&(h.key+="_"+a);var p=s(this.name,this.value,h,this.controlled,d);p.choiceInputConstructor=this.choiceInputConstructor,i.push(o.createElement("li",null,c,p.render()))}else{var f=this.choiceInputConstructor(this.name,this.value,n.extend({},this.attrs),this.controlled,u,a);i.push(o.createElement("li",null,f.render()))}}var m={};return t&&(m.id=t),o.createElement("ul",m,i)},e.exports=s},{Concur:79,"isomorph/is":84,"isomorph/object":85}],12:[function(t,e){"use strict";var i=t("isomorph/object"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n=t("./SubWidget"),o=t("./Widget"),s=n.extend({constructor:function(t,e,i,r,n,o){this.name=t,this.value=e,this.attrs=i,this.controlled=r,this.choiceValue=""+n[0],this.choiceLabel=""+n[1],this.index=o,"undefined"!=typeof this.attrs.id&&(this.attrs.id+="_"+this.index),"undefined"!=typeof this.attrs.key&&(this.attrs.key+="_"+this.index)},inputType:null});s.prototype.render=function(){var t={};return this.idForLabel()&&(t.htmlFor=this.idForLabel()),r.createElement("label",t,this.tag()," ",this.choiceLabel)},s.prototype.isChecked=function(){return this.value===this.choiceValue},s.prototype.tag=function(){var t=o.prototype.buildAttrs.call(this,{},{type:this.inputType,name:this.name,value:this.choiceValue}),e=this.controlled?"checked":"defaultChecked";return t[e]=this.isChecked(),r.createElement("input",t)},s.prototype.idForLabel=function(){return i.get(this.attrs,"id","")},e.exports=s},{"./SubWidget":63,"./Widget":72,"isomorph/object":85}],13:[function(t,e){"use strict";var i=t("isomorph/object"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n=t("./CheckboxInput"),o=t("./FileInput"),s=t("./util"),a=s.formatToArray,l={},u=o.extend({needsInitialValue:!0,isValueSettable:!1,constructor:function c(t){return this instanceof c?void o.call(this,t):new c(t)},initialText:"Currently",inputText:"Change",clearCheckboxLabel:"Clear",templateWithInitial:function(t){return a("{initialText}: {initial} {clearTemplate}{br}{inputText}: {input}",i.extend(t,{br:r.createElement("br",null)}))},templateWithClear:function(t){return a("{checkbox} {label}",i.extend(t,{label:r.createElement("label",{htmlFor:t.checkboxId},t.label)}))},urlMarkupTemplate:function(t,e){return r.createElement("a",{href:t},e)}});u.FILE_INPUT_CONTRADICTION=l,u.prototype.clearCheckboxName=function(t){return t+"-clear"},u.prototype.clearCheckboxId=function(t){return t+"_id"},u.prototype.render=function(t,e,s){s=i.extend({attrs:{}},s),s.attrs.key="input";var a=o.prototype.render.call(this,t,e,s),l=s.initialValue;if(!l&&e&&"undefined"!=typeof e.url&&(l=e),l&&"undefined"!=typeof l.url){var u;if(!this.isRequired){var c=this.clearCheckboxName(t),d=this.clearCheckboxId(c);u=this.templateWithClear({checkbox:n().render(c,!1,{attrs:{id:d}}),checkboxId:d,label:this.clearCheckboxLabel})}var h=this.templateWithInitial({initialText:this.initialText,initial:this.urlMarkupTemplate(l.url,""+l),clearTemplate:u,inputText:this.inputText,input:a});return r.createElement("span",null,h)}return r.createElement("span",null,a)},u.prototype.valueFromData=function(t,e,i){var r=o.prototype.valueFromData(t,e,i);return!this.isRequired&&n.prototype.valueFromData.call(this,t,e,this.clearCheckboxName(i))?r?l:!1:r},e.exports=u},{"./CheckboxInput":8,"./FileInput":28,"./util":78,"isomorph/object":85}],14:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./Field"),n=r.extend({constructor:function o(t){if(!(this instanceof o))return new o(t);t=i.extend({fields:[]},t),r.call(this,t);for(var e=0,n=t.fields.length;n>e;e++)t.fields[e].required=!1;this.fields=t.fields}});n.prototype.clean=function(t){r.prototype.clean.call(this,t);for(var e=0,i=this.fields.length;i>e;e++)t=this.fields[e].clean(t);return t},e.exports=n},{"./Field":26,"isomorph/object":85}],15:[function(t,e){"use strict";var i=t("./BaseTemporalField"),r=t("./DateInput"),n=i.extend({widget:r,inputFormatType:"DATE_INPUT_FORMATS",defaultErrorMessages:{invalid:"Enter a valid date."},constructor:function o(t){return this instanceof o?void i.call(this,t):new o(t)}});n.prototype.toJavaScript=function(t){return this.isEmptyValue(t)?null:t instanceof Date?new Date(t.getFullYear(),t.getMonth(),t.getDate()):i.prototype.toJavaScript.call(this,t)},e.exports=n},{"./BaseTemporalField":2,"./DateInput":16}],16:[function(t,e){"use strict";var i=t("./DateTimeBaseInput"),r=i.extend({formatType:"DATE_INPUT_FORMATS",constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t)}});e.exports=r},{"./DateTimeBaseInput":17}],17:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n=t("isomorph/time"),o=t("./formats"),s=t("./locales"),a=t("./TextInput"),l=a.extend({formatType:"",constructor:function(t){t=r.extend({format:null},t),a.call(this,t),this.format=t.format}});l.prototype._formatValue=function(t){return i.Date(t)?(null===this.format&&(this.format=o.getFormat(this.formatType)[0]),n.strftime(t,this.format,s.getDefaultLocale())):t},e.exports=l},{"./TextInput":64,"./formats":75,"./locales":77,"isomorph/is":84,"isomorph/object":85,"isomorph/time":86}],18:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("./BaseTemporalField"),n=t("./DateTimeInput"),o=t("validators"),s=o.ValidationError,a=r.extend({widget:n,inputFormatType:"DATETIME_INPUT_FORMATS",defaultErrorMessages:{invalid:"Enter a valid date/time."},constructor:function l(t){return this instanceof l?void r.call(this,t):new l(t)}});a.prototype.toJavaScript=function(t){if(this.isEmptyValue(t))return null;if(t instanceof Date)return t;if(i.Array(t)){if(2!=t.length)throw s(this.errorMessages.invalid,{code:"invalid"});if(this.isEmptyValue(t[0])&&this.isEmptyValue(t[1]))return null;t=t.join(" ")}return r.prototype.toJavaScript.call(this,t)},e.exports=a},{"./BaseTemporalField":2,"./DateTimeInput":19,"isomorph/is":84,validators:89}],19:[function(t,e){"use strict";var i=t("./DateTimeBaseInput"),r=i.extend({formatType:"DATETIME_INPUT_FORMATS",constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t)}});e.exports=r},{"./DateTimeBaseInput":17}],20:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./Field"),n=t("./IntegerField"),o=t("validators"),s=o.ValidationError,a=t("./util"),l=a.strip,u=n.extend({defaultErrorMessages:{invalid:"Enter a number.",maxDigits:"Ensure that there are no more than {max} digits in total.",maxDecimalPlaces:"Ensure that there are no more than {max} decimal places.",maxWholeDigits:"Ensure that there are no more than {max} digits before the decimal point."},constructor:function c(t){return this instanceof c?(t=i.extend({maxDigits:null,decimalPlaces:null},t),this.maxDigits=t.maxDigits,this.decimalPlaces=t.decimalPlaces,void n.call(this,t)):new c(t)}});u.DECIMAL_REGEXP=/^[-+]?(?:\d+(?:\.\d*)?|(?:\d+)?\.\d+)$/,u.prototype.clean=function(t){if(r.prototype.validate.call(this,t),this.isEmptyValue(t))return null;if(t=l(""+t),!u.DECIMAL_REGEXP.test(t))throw s(this.errorMessages.invalid,{code:"invalid"});var e=!1;("+"==t.charAt(0)||"-"==t.charAt(0))&&(e="-"==t.charAt(0),t=t.substr(1)),t=t.replace(/^0+/,""),(""===t||"."==t)&&(t="0"),t.indexOf(".")==t.length-1&&(t=t.substring(0,t.length-1));var i=t.split("."),n=i[0].length,o=2==i.length?i[1].length:0,a=n+o;if(null!==this.maxDigits&&a>this.maxDigits)throw s(this.errorMessages.maxDigits,{code:"maxDigits",params:{max:this.maxDigits}});if(null!==this.decimalPlaces&&o>this.decimalPlaces)throw s(this.errorMessages.maxDecimalPlaces,{code:"maxDecimalPlaces",params:{max:this.decimalPlaces}});if(null!==this.maxDigits&&null!==this.decimalPlaces&&n>this.maxDigits-this.decimalPlaces)throw s(this.errorMessages.maxWholeDigits,{code:"maxWholeDigits",params:{max:this.maxDigits-this.decimalPlaces}});return"."==t.charAt(0)&&(t="0"+t),e&&(t="-"+t),this.runValidators(parseFloat(t)),t},u.prototype.getWidgetAttrs=function(t){var e=n.prototype.getWidgetAttrs.call(this,t);if(!i.hasOwn(t.attrs,"step")){var r="any";null!==this.decimalPlaces&&(r=0===this.decimalPlaces?"1":this.decimalPlaces<7?"0."+"000001".slice(-this.decimalPlaces):"1e-"+this.decimalPlaces),i.setDefault(e,"step",r)}return e},e.exports=u},{"./Field":26,"./IntegerField":39,"./util":78,"isomorph/object":85,validators:89}],21:[function(t,e){"use strict";function i(t){var e=[];Object.keys(t).forEach(function(i){t[i]instanceof o&&(e.push([i,t[i]]),delete t[i])}),e.sort(function(t,e){return t[1].creationCounter-e[1].creationCounter}),t.declaredFields=n.fromItems(e);var i={};if(n.hasOwn(this,"declaredFields")&&n.extend(i,this.declaredFields),n.hasOwn(t,"__mixins__")){var s=t.__mixins__;r.Array(s)||(s=[s]);for(var a=0,l=s.length;l>a;a++){var u=s[a];if(r.Function(u)&&n.hasOwn(u.prototype,"declaredFields")){n.extend(i,u.prototype.declaredFields),Object.keys(u.prototype).forEach(function(t){n.hasOwn(i,t)&&delete i[t]});var c=n.extend({},u.prototype);delete c.baseFields,delete c.declaredFields,delete c.constructor,s[a]=c}}t.__mixins__=s}if(n.extend(i,t.declaredFields),Object.keys(t).forEach(function(t){n.hasOwn(i,t)&&delete i[t]}),t.baseFields=i,t.declaredFields=i,n.hasOwn(t,"clean")&&r.Array(t.clean)){var d=t.clean.pop();d.fields=n.lookup(t.clean),t.clean=d}}var r=t("isomorph/is"),n=t("isomorph/object"),o=t("./Field");e.exports=i},{"./Field":26,"isomorph/is":84,"isomorph/object":85}],22:[function(t,e){"use strict";var i=t("./util"),r=t("./CharField"),n=t("./EmailInput"),o=t("validators"),s=o.validateEmail,a=r.extend({widget:n,defaultValidators:[s],constructor:function l(t){return this instanceof l?void r.call(this,t):new l(t)}});a.prototype.clean=function(t){return t=i.strip(this.toJavaScript(t)),r.prototype.clean.call(this,t)},e.exports=a},{"./CharField":5,"./EmailInput":23,"./util":78,validators:89}],23:[function(t,e){"use strict";var i=t("./TextInput"),r=i.extend({constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t)},inputType:"email"});e.exports=r},{"./TextInput":64}],24:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/object"),n="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,o=t("validators"),s=o.ValidationError,a=i.extend({constructor:function l(t){return this instanceof l?void(this.data=t||[]):new l(t)}});a.fromJSON=function(t){var e=new a;return e.fromJSON(t),e},a.prototype.extend=function(t){this.data.push.apply(this.data,t)},a.prototype.length=function(){return this.data.length},a.prototype.isPopulated=function(){return this.length()>0},a.prototype.first=function(){if(this.data.length>0){var t=this.data[0];return t instanceof s&&(t=t.messages()[0]),t}},a.prototype.messages=function(){for(var t=[],e=0,i=this.data.length;i>e;e++){var r=this.data[e];r instanceof s&&(r=r.messages()[0]),t.push(r)}return t},a.prototype.render=function(t){return this.asUl(t)},a.prototype.asUl=function(t){return this.isPopulated()?(t=r.extend({className:"errorlist"},t),n.createElement("ul",{className:t.className},this.messages().map(function(t){return n.createElement("li",null,t)}))):void 0},a.prototype.asText=a.prototype.toString=function(){return this.messages().map(function(t){return"* "+t}).join("\n")},a.prototype.asData=function(){return this.data},a.prototype.toJSON=function(){return new s(this.data).errorList.map(function(t){return{message:t.messages()[0],code:t.code||""}})},a.prototype.fromJSON=function(t){this.data=t.map(function(t){return new s(t.message,{code:t.code})})},e.exports=a},{Concur:79,"isomorph/object":85,validators:89}],25:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/object"),n="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,o=t("./ErrorList"),s=i.extend({constructor:function a(){return this instanceof a?void(this.errors={}):new a}});s.fromJSON=function(t,e){var i=new s;return i.fromJSON(t,e),i},s.prototype.set=function(t,e){this.errors[t]=e},s.prototype.get=function(t){return this.errors[t]},s.prototype.remove=function(t){return delete this.errors[t]},s.prototype.removeAll=function(t){for(var e=0,i=t.length;i>e;e++)delete this.errors[t[e]]},s.prototype.hasField=function(t){return r.hasOwn(this.errors,t)},s.prototype.length=function(){return Object.keys(this.errors).length},s.prototype.isPopulated=function(){return this.length()>0},s.prototype.render=function(t){return this.asUl(t)},s.prototype.asUl=function(t){t=r.extend({className:"errorlist"},t);var e=Object.keys(this.errors).map(function(t){return n.createElement("li",null,t,this.errors[t].asUl())}.bind(this));if(0!==e.length)return n.createElement("ul",{className:t.className},e)},s.prototype.asText=s.prototype.toString=function(){return Object.keys(this.errors).map(function(t){var e=this.errors[t].messages();return["* "+t].concat(e.map(function(t){return" * "+t})).join("\n")}.bind(this)).join("\n")},s.prototype.asData=function(){var t={};return Object.keys(this.errors).map(function(e){t[e]=this.errors[e].asData()}.bind(this)),t},s.prototype.toJSON=function(){var t={};return Object.keys(this.errors).map(function(e){t[e]=this.errors[e].toJSON()}.bind(this)),t},s.prototype.fromJSON=function(t,e){e=e||o,this.errors={};for(var i=Object.keys(t),r=0,n=i.length;n>r;r++){var s=i[r];this.errors[s]=e.fromJSON(t[s])}},e.exports=s},{"./ErrorList":24,Concur:79,"isomorph/object":85}],26:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/is"),n=t("isomorph/object"),o=t("./HiddenInput"),s=t("./Widget"),a=t("./TextInput"),l=t("validators"),u=l.EMPTY_VALUES,c=l.ValidationError,d=t("./util"),h=d.normaliseValidation,p=i.extend({widget:a,hiddenWidget:o,defaultValidators:[],defaultErrorMessages:{required:"This field is required."},emptyValues:u.slice(),emptyValueArray:!0,constructor:function f(t){t=n.extend({required:!0,widget:null,label:null,initial:null,helpText:null,errorMessages:null,showHiddenInitial:!1,validators:[],cssClass:null,validation:null,controlled:null,custom:null,widgetAttrs:{}},t),this.required=t.required,this.label=t.label,this.initial=t.initial,this.showHiddenInitial=t.showHiddenInitial,this.helpText=t.helpText||"",this.cssClass=t.cssClass,this.validation=h(t.validation),this.controlled=t.controlled,this.custom=t.custom,this.widgetAttrs=t.widgetAttrs;var e=t.widget||this.widget;e instanceof s||(e=new e),e.isRequired=this.required,n.extend(e.attrs,this.getWidgetAttrs(e)),this.widget=e,this.creationCounter=f.creationCounter++;for(var i=[{}],r=this.constructor.__mro__.length-1;r>=0;r--)i.push(n.get(this.constructor.__mro__[r].prototype,"defaultErrorMessages",null));i.push(t.errorMessages),this.errorMessages=n.extend.apply(n,i),this.validators=this.defaultValidators.concat(t.validators)}});p.creationCounter=0,p.prototype.prepareValue=function(t){return t},p.prototype.toJavaScript=function(t){return t},p.prototype.isEmptyValue=function(t){return-1!=this.emptyValues.indexOf(t)?!0:this.emptyValueArray===!0&&r.Array(t)&&0===t.length},p.prototype.validate=function(t){if(this.required&&this.isEmptyValue(t))throw c(this.errorMessages.required,{code:"required"})},p.prototype.runValidators=function(t){if(!this.isEmptyValue(t)){for(var e=[],i=0,r=this.validators.length;r>i;i++){var o=this.validators[i];try{o(t)}catch(s){if(!(s instanceof c))throw s; -n.hasOwn(s,"code")&&n.hasOwn(this.errorMessages,s.code)&&(s.message=this.errorMessages[s.code]),e.push.apply(e,s.errorList)}}if(e.length>0)throw c(e)}},p.prototype.clean=function(t){return t=this.toJavaScript(t),this.validate(t),this.runValidators(t),t},p.prototype.boundData=function(t){return t},p.prototype.getWidgetAttrs=function(){return n.extend({},this.widgetAttrs)},p.prototype._hasChanged=function(t,e){var i=null===t?"":t;try{e=this.toJavaScript(e),"function"==typeof this._coerce&&(e=this._coerce(e))}catch(r){if(!(r instanceof c))throw r;return!0}var n=null===e?"":e;return""+i!=""+n},e.exports=p},{"./HiddenInput":35,"./TextInput":64,"./Widget":72,"./util":78,Concur:79,"isomorph/is":84,"isomorph/object":85,validators:89}],27:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n=t("./env"),o=t("./ClearableFileInput"),s=t("./Field"),a=t("validators"),l=a.ValidationError,u=s.extend({widget:o,defaultErrorMessages:{invalid:"No file was submitted. Check the encoding type on the form.",missing:"No file was submitted.",empty:"The submitted file is empty.",maxLength:"Ensure this filename has at most {max} characters (it has {length}).",contradiction:"Please either submit a file or check the clear checkbox, not both."},constructor:function c(t){return this instanceof c?(t=r.extend({maxLength:null,allowEmptyFile:!1},t),this.maxLength=t.maxLength,this.allowEmptyFile=t.allowEmptyFile,delete t.maxLength,void s.call(this,t)):new c(t)}});u.prototype.toJavaScript=function(t){if(this.isEmptyValue(t))return null;if(n.browser&&i.String(t))return t;if("undefined"==typeof t.name||"undefined"==typeof t.size)throw l(this.errorMessages.invalid,{code:"invalid"});var e=t.name,r=Number(t.size);if(null!==this.maxLength&&e.length>this.maxLength)throw l(this.errorMessages.maxLength,{code:"maxLength",params:{max:this.maxLength,length:e.length}});if(!e)throw l(this.errorMessages.invalid,{code:"invalid"});if(!this.allowEmptyFile&&0===r)throw l(this.errorMessages.empty,{code:"empty"});return t},u.prototype.clean=function(t,e){if(t===o.FILE_INPUT_CONTRADICTION)throw l(this.errorMessages.contradiction,{code:"contradiction"});if(t===!1){if(!this.required)return!1;t=null}return!t&&e?e:s.prototype.clean.call(this,t)},u.prototype.boundData=function(t,e){return null===t||t===o.FILE_INPUT_CONTRADICTION?e:t},u.prototype._hasChanged=function(t,e){return null!==e},e.exports=u},{"./ClearableFileInput":13,"./Field":26,"./env":74,"isomorph/is":84,"isomorph/object":85,validators:89}],28:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./Input"),n=t("./env"),o=r.extend({constructor:function s(t){return this instanceof s?void r.call(this,t):new s(t)},inputType:"file",needsMultipartForm:!0,validation:{onChange:!0},isValueSettable:!1});o.prototype.render=function(t,e,i){return r.prototype.render.call(this,t,null,i)},o.prototype.valueFromData=function(t,e,r){var o=e;return!n.browser||r in e||(o=t),i.get(o,r,null)},e.exports=o},{"./Input":38,"./env":74,"isomorph/object":85}],29:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./ChoiceField"),n=r.extend({constructor:function o(t,e){return this instanceof o?(e=i.extend({match:null,recursive:!1,required:!0,widget:null,label:null,initial:null,helpText:null,allowFiles:!0,allowFolders:!1},e),this.path=t,this.match=i.pop(e,"match"),this.recursive=i.pop(e,"recursive"),this.allowFiles=i.pop(e,"allowFiles"),this.allowFolders=i.pop(e,"allowFolders"),delete e.match,delete e.recursive,e.choices=[],r.call(this,e),this.setChoices(this.required?[]:[["","---------"]]),null!==this.match&&(this.matchRE=new RegExp(this.match)),void(this.widget.choices=this.choices())):new o(t,e)}});e.exports=n},{"./ChoiceField":10,"isomorph/object":85}],30:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./Field"),n=t("./IntegerField"),o=t("validators"),s=o.ValidationError,a=t("./util"),l=a.strip,u=n.extend({defaultErrorMessages:{invalid:"Enter a number."},constructor:function c(t){return this instanceof c?void n.call(this,t):new c(t)}});u.FLOAT_REGEXP=/^[-+]?(?:\d+(?:\.\d*)?|(?:\d+)?\.\d+)$/,u.prototype.toJavaScript=function(t){if(t=r.prototype.toJavaScript.call(this,t),this.isEmptyValue(t))return null;if(t=l(t),!u.FLOAT_REGEXP.test(t))throw s(this.errorMessages.invalid,{code:"invalid"});if(t=parseFloat(t),isNaN(t))throw s(this.errorMessages.invalid,{code:"invalid"});return t},u.prototype._hasChanged=function(t,e){var i=null===e?"":e,r=null===t?"":t;return r===i?!1:""===r||""===i?!0:parseFloat(""+r)!=parseFloat(""+i)},u.prototype.getWidgetAttrs=function(t){var e=n.prototype.getWidgetAttrs.call(this,t);return i.hasOwn(t.attrs,"step")||i.setDefault(e,"step","any"),e},e.exports=u},{"./Field":26,"./IntegerField":39,"./util":78,"isomorph/object":85,validators:89}],31:[function(t,e){"use strict";function i(){}function r(t,e){if(u.Array(t)&&u.Array(e)){if(t.length!=e.length)return!0;for(var i=0,r=t.length;r>i;i++)if(t[i]!=e[i])return!0;return!1}return t!=e}var n=t("Concur"),o=t("get-form-data"),s=t("isomorph/copy"),a=t("isomorph/format"),l=a.formatObj,u=t("isomorph/is"),c=t("isomorph/object"),d=t("./constants"),h=t("./BoundField"),p=t("./DeclarativeFieldsMeta"),f=t("./ErrorList"),m=t("./ErrorObject"),g=t("./FileField"),v=t("./MultipleFileField"),y=t("validators"),x=y.ValidationError,w=t("./util"),F=w.cancellable,_=w.debounce,b=(w.info,w.warning,w.normaliseValidation),C={},E=d.NON_FIELD_ERRORS,I=n.extend({__meta__:p,prefixFormat:"{prefix}-{name}",constructor:function(t){t=c.extend({data:null,files:null,autoId:"id_{name}",prefix:null,initial:null,errorConstructor:f,labelSuffix:":",emptyPermitted:!1,validation:null,controlled:!1,onChange:null,errors:null},t),this.isInitialRender=null==t.data&&null==t.files,this.data=t.data||{},this.files=t.files||{},this.autoId=t.autoId,this.prefix=t.prefix,this.initial=t.initial||{},this.cleanedData={},this.errorConstructor=t.errorConstructor,this.labelSuffix=t.labelSuffix,this.emptyPermitted=t.emptyPermitted,this.controlled=t.controlled,this.onChange=t.onChange,u.Function(t.onChange)&&null==t.validation&&(t.validation="auto"),this.validation=b(t.validation||"manual"),this._errors=t.errors,this._pendingEventValidation={},this._lastValidatedData={},this._lastHasChanged=null,this._pendingValidation={},this._pendingAsyncValidation={},this._runCleanAfter={},this._onValidate=null,this.fields=s.deepCopy(this.baseFields),this.isInitialRender&&this._copyInitialToData()}}),T=I.extend;I.extend=function(t,e){return T.call(this,c.extend({},t),e)},I.prototype._stateChanged=function(){"function"==typeof this.onChange&&this.onChange()},I.prototype._copyInitialToData=function(){for(var t=c.extend(this._fieldInitialData(),this.initial),e=Object.keys(t),i=0,r=e.length;r>i;i++){var n=e[i];"undefined"!=typeof this.fields[n]&&this.fields[n].widget.isValueSettable&&(this.data[this.addPrefix(n)]=t[n])}},I.prototype._fieldInitialData=function(){for(var t={},e=Object.keys(this.fields),i=0,r=e.length;r>i;i++){var n=e[i],o=this.fields[n].initial;null!==o&&(t[n]=o)}return t},I.prototype._formName=function(){var t=this.displayName||this.constructor.name;return t?"'"+t+"'":"Form"},I.prototype._needsOnChange=function(){if(this.controlled===!0)return!0;for(var t=Object.keys(this.fields),e=0,i=t.length;i>e;e++)if(this.fields[t[e]].controlled===!0)return!0;return!1},I.prototype.validate=function(t,e){return this._cancelPendingOperations(),u.Function(t)&&(e=t,t=null),t&&("function"==typeof t.getDOMNode&&(t=t.getDOMNode()),this.data=o(t)),this.isAsync()?this._validateAsync(e):this._validateSync()},I.prototype._validateAsync=function(t){if(!u.Function(t))throw new Error("You must provide a callback to validate() when a form has asynchronous validation.");this.isInitialRender&&(this.isInitialRender=!1),this._onValidate=t,this.fullClean(),this._stateChanged()},I.prototype._validateSync=function(){return this.isInitialRender&&(this.isInitialRender=!1),this.fullClean(),this._stateChanged(),this.isValid()},I.prototype.fullClean=function(){return this._errors=new m,this.isInitialRender?void 0:(this.cleanedData={},this.emptyPermitted&&!this.hasChanged()?void this._finishedValidation(null):void this._cleanFields())},I.prototype.partialClean=function(t){if(this._removeErrors(t),this.emptyPermitted&&!this.hasChanged())return void(this._errors.isPopulated()&&(this._errors=m()));this._preCleanFields(t);for(var e=0,i=t.length;i>e;e++)this._cleanField(t[e])},I.prototype._cleanFields=function(){var t=Object.keys(this.fields);this._preCleanFields(t);for(var e=0,i=t.length;i>e;e++)this._cleanField(t[e])},I.prototype._preCleanFields=function(t){c.extend(this._pendingValidation,c.lookup(t));var e,i;if("undefined"!=typeof this.clean.fields)for(e=0,i=t.length;i>e;e++)this.clean.fields[t[e]]&&(this._runCleanAfter[t[e]]=!0);else for(e=0,i=t.length;i>e;e++)this.fields[t[e]]&&(this._runCleanAfter[t[e]]=!0)},I.prototype._cleanField=function(t){if(!c.hasOwn(this.fields,t))throw new Error(this._formName()+" has no field named '"+t+"'");var e=this.fields[t],i=e.widget.valueFromData(this.data,this.files,this.addPrefix(t)),r=!1,n=null;try{if(e instanceof g){var o=c.get(this.initial,t,e.initial);i=e.clean(i,o)}else i=e.clean(i);this.cleanedData[t]=i;var s=this._getCustomClean(t);u.Function(s)&&(r=this._runCustomClean(t,s))}catch(a){a instanceof x?this.addError(t,a):n=a}r||this._fieldCleaned(t,n)},I.prototype._getCustomClean=function(t){return this["clean"+t.charAt(0).toUpperCase()+t.substr(1)]||this["clean_"+t]},I.prototype._runCustomClean=function(t,e){if(0===e.length)return e.call(this),!1;"undefined"!=typeof this._pendingAsyncValidation[t]&&c.pop(this._pendingAsyncValidation,t).cancel();var i=function(e,i){i&&this.addError(t==E?null:t,i),this._fieldCleaned(t,e),this._stateChanged()}.bind(this),r=F(i),n=e.call(this,r);return n!==!1?(n&&"function"==typeof n.onCancel&&(i.onCancel=n.onCancel),this._pendingAsyncValidation[t]=r,!0):void 0},I.prototype._fieldCleaned=function(t,e){var i=delete this._pendingValidation[t];return this._pendingAsyncValidation[t]&&delete this._pendingAsyncValidation[t],e?(this._pendingValidation={},this._runCleanAfter={},void this._finishedValidation(e)):this._runCleanAfter[t]&&(delete this._runCleanAfter[t],u.Empty(this._runCleanAfter))?void this._cleanForm():void(i&&u.Empty(this._pendingValidation)&&this._finishedValidation(null))},I.prototype.clean=i,I.prototype._cleanForm=function(){var t=!1,e=null;try{this.clean!==i&&(t=this._runCustomClean(E,this.clean))}catch(r){r instanceof x?this.addError(null,r):e=r}t||this._fieldCleaned(E,e)},I.prototype._finishedValidation=function(t){if(this.isAsync()){if(u.Function(this._onValidate)){var e=this._onValidate;if(this._onValidate=null,t)return e(t);var i=this.isValid();e(null,i,i?this.cleanedData:null)}}else if(t)throw t},I.prototype._cancelPendingOperations=function(){Object.keys(this._pendingEventValidation).forEach(function(t){c.pop(this._pendingEventValidation,t).cancel()}.bind(this)),Object.keys(this._pendingAsyncValidation).forEach(function(t){c.pop(this._pendingAsyncValidation,t).cancel()}.bind(this))},I.prototype._handleFieldEvent=function(t,e){var i=e.target.name,n=this.removePrefix(e.target.getAttribute("data-newforms-field")||i),s=this.fields[n],a=o.getNamedFormElementData(e.target.form,i);if(this.data[i]=a,s instanceof g&&"files"in e.target){var l=e.target.files;this.files[i]=s instanceof v?Array.prototype.slice.call(l):l[0]}if(this.isInitialRender&&(this.isInitialRender=!1),(this.controlled||s.controlled)&&this._stateChanged(),t.validate!==!1){var u=!1;if("onBlur"==t.event){if("undefined"!=typeof this._pendingEventValidation[n])return void this._pendingEventValidation[n].trigger();u=s.required&&s.isEmptyValue(a)}if(!u){var d=c.get(this._lastValidatedData,n,C);u=d===C}if(!u){var h=s.widget.valueFromData(this.data,this.files,this.addPrefix(n));u=r(d,h)}u||"undefined"==typeof this._pendingEventValidation[n]||c.pop(this._pendingEventValidation,n).cancel(),u&&(t.delay?this._delayedFieldValidation(n,t.delay):this._immediateFieldValidation(n))}},I.prototype._delayedFieldValidation=function(t,e){"undefined"==typeof this._pendingEventValidation[t]&&(this._pendingEventValidation[t]=_(function(){delete this._pendingEventValidation[t],this._immediateFieldValidation(t)}.bind(this),e)),this._pendingEventValidation[t]()},I.prototype._immediateFieldValidation=function(t){"undefined"!=typeof this._pendingEventValidation[t]&&c.pop(this._pendingEventValidation,t).cancel(),this._lastValidatedData[t]=this.fields[t].widget.valueFromData(this.data,this.files,this.addPrefix(t)),this.partialClean([t]),this._stateChanged()},I.prototype.reset=function(t){this._cancelPendingOperations(),"undefined"!=typeof t&&(this.initial=t),this.data={},this.cleanedData={},this.isInitialRender=!0,this._errors=null,this._lastHasChanged=null,this._pendingValidation={},this._runCleanAfter={},this._lastValidatedData={},this._onValidate=null,this._copyInitialToData(),this._stateChanged()},I.prototype.setData=function(t,e){if(e=c.extend({prefixed:!1,validate:!0,_triggerStateChange:!0},e),this.data=e.prefixed?t:this._prefixData(t),this.isInitialRender&&(this.isInitialRender=!1),e.validate){this._errors=null;var i=this.isValid()}else this._errors=new m;return e._triggerStateChange&&this._stateChanged(),e.validate&&!this.isAsync()?i:void 0},I.prototype.setFormData=function(t,e){return this.setData(t,c.extend(e||{},{prefixed:!0}))},I.prototype.updateData=function(t,e){e=c.extend({prefixed:!1,validate:!0,clearValidation:!0},e),c.extend(this.data,e.prefixed?t:this._prefixData(t)),this.isInitialRender&&(this.isInitialRender=!1);var i=Object.keys(t);e.prefixed&&(i=i.map(this.removePrefix.bind(this))),e.validate?this.partialClean(i):e.clearValidation&&(this._removeErrors(i),this._removeCleanedData(i),this._cleanForm()),this._stateChanged()},I.prototype._removeCleanedData=function(t){for(var e=0,i=t.length;i>e;e++)delete this.cleanedData[t[e]]},I.prototype.boundField=function(t){if(!c.hasOwn(this.fields,t))throw new Error(this._formName()+" does not have a '"+t+"' field.");return new h(this,this.fields[t],t)},I.prototype.boundFields=function(t){for(var e=[],i=Object.keys(this.fields),r=0,n=i.length;n>r;r++){var o=i[r];(!t||t(this.fields[o],o))&&e.push(new h(this,this.fields[o],o))}return e},I.prototype.boundFieldsObj=function(){for(var t={},e=Object.keys(this.fields),i=0,r=e.length;r>i;i++){var n=e[i];t[n]=new h(this,this.fields[n],n)}return t},I.prototype.hiddenFields=function(){return this.boundFields(function(t){return t.widget.isHidden})},I.prototype.visibleFields=function(){return this.boundFields(function(t){return!t.widget.isHidden})},I.prototype.addError=function(t,e){if(e instanceof x||(e=x(e)),c.hasOwn(e,"errorObj")){if(null!==t)throw new Error("The 'field' argument to form.addError() must be null when the 'error' argument contains errors for multiple fields.");e=e.errorObj}else{var i=e.errorList;e={},e[t||E]=i}for(var r=Object.keys(e),n=0,o=r.length;o>n;n++){if(t=r[n],i=e[t],this._errors.hasField(t))for(var s=c.lookup(this._errors.get(t).messages()),a=f(i).messages(),l=i.length-1;l>=0;l--)s[a[l]]&&i.splice(l,1);else{if(t!==E&&!c.hasOwn(this.fields,t))throw new Error(this._formName()+" has no field named '"+t+"'");this._errors.set(t,new this.errorConstructor)}i.length>0&&this._errors.get(t).extend(i),c.hasOwn(this.cleanedData,t)&&delete this.cleanedData[t]}},I.prototype.errors=function(t){return null==this._errors&&this.fullClean(),t?this._errors.get(t):this._errors},I.prototype.nonFieldErrors=function(){return this.errors(E)||new this.errorConstructor},I.prototype.setErrors=function(t){this._errors=t,this._stateChanged()},I.prototype._removeErrors=function(t){null==this._errors?this._errors=m():(this._errors.remove(E),this._errors.removeAll(t))},I.prototype.changedData=function(t){for(var e,i=[],r=Object.keys(this.fields),n=0,o=r.length;o>n;n++){var s=r[n],a=this.fields[s],l=this.addPrefix(s),d=a.widget.valueFromData(this.data,this.files,l);if(a.showHiddenInitial){var h=this.addInitialPrefix(s),p=new a.hiddenWidget;try{e=p.valueFromData(this.data,this.files,h)}catch(f){if(!(f instanceof x))throw f;if(t)return!0;i.push(s);continue}}else e=c.get(this.initial,s,a.initial),u.Function(e)&&(e=e());if(a._hasChanged(e,d)){if(t)return!0;i.push(s)}}return t?!1:i},I.prototype.hasChanged=function(){return this._lastHasChanged=this.changedData(!0),this._lastHasChanged},I.prototype.isAsync=function(){if(1==this.clean.length)return!0;for(var t=Object.keys(this.fields),e=0,i=t.length;i>e;e++){var r=this._getCustomClean(t[e]);if(u.Function(r)&&1==r.length)return!0}return!1},I.prototype.isComplete=function(){if(!this.isValid()||this.isPending())return!1;for(var t=Object.keys(this.fields),e=0,i=t.length;i>e;e++){var r=t[e];if(this.fields[r].required&&"undefined"==typeof this.cleanedData[r])return!1}return!0},I.prototype.isMultipart=function(){for(var t=Object.keys(this.fields),e=0,i=t.length;i>e;e++)if(this.fields[t[e]].widget.needsMultipartForm)return!0;return!1},I.prototype.isPending=function(){return!u.Empty(this._pendingAsyncValidation)},I.prototype.isValid=function(){return this.isInitialRender?!1:!this.errors().isPopulated()},I.prototype.nonFieldPending=function(){return"undefined"!=typeof this._pendingAsyncValidation[E]},I.prototype.notEmpty=function(){return this.emptyPermitted&&this._lastHasChanged===!0},I.prototype.addInitialPrefix=function(t){return"initial-"+this.addPrefix(t)},I.prototype.addPrefix=function(t){return null!==this.prefix?l(this.prefixFormat,{prefix:this.prefix,name:t}):t},I.prototype.removePrefix=function(t){if(null!==this.prefix){var e=this.prefixFormat.replace("{prefix}",this.prefix),i=e.indexOf("{name}"),r=t.length-e.length;return t.substr(i,6+r)}return t},I.prototype._deprefixData=function(t){if(null==this.prefix)return t;for(var e={},i=Object.keys(t),r=0,n=i.length;n>r;r++)e[this.removePrefix(i[r])]=t[i[r]];return e},I.prototype._prefixData=function(t){if(null==this.prefix)return t;for(var e={},i=Object.keys(t),r=0,n=i.length;n>r;r++)e[this.addPrefix(i[r])]=t[i[r]];return e},e.exports=I},{"./BoundField":4,"./DeclarativeFieldsMeta":21,"./ErrorList":24,"./ErrorObject":25,"./FileField":27,"./MultipleFileField":43,"./constants":73,"./util":78,Concur:79,"get-form-data":81,"isomorph/copy":82,"isomorph/format":83,"isomorph/is":84,"isomorph/object":85,validators:89}],32:[function(t,e){"use strict";var i="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,r=t("./BoundField"),n=t("./ProgressMixin"),o=i.createClass({displayName:"FormRow",mixins:[n],propTypes:{bf:i.PropTypes.instanceOf(r),className:i.PropTypes.string,component:i.PropTypes.any,content:i.PropTypes.any,hidden:i.PropTypes.bool,__all__:function(t){return t.bf||t.content?t.bf&&t.content?new Error("Both `bf` and `content` props were passed to `FormRow` - `bf` will be ignored."):void 0:new Error("Invalid props supplied to `FormRow`, either `bf` or `content` must be specified.")}},getDefaultProps:function(){return{component:"div"}},render:function(){var t={};if(this.props.className&&(t.className=this.props.className),this.props.hidden&&(t.style={display:"none"}),this.props.content)return i.createElement(this.props.component,i.__spread({},t),this.props.content);var e=this.props.bf,r=e.isPending();return i.createElement(this.props.component,i.__spread({},t),e.label&&e.labelTag()," ",e.render(),r&&" ",r&&this.renderProgress(),e.errors().render(),e.helpText&&" ",e.helpTextTag())}});e.exports=o},{"./BoundField":4,"./ProgressMixin":49}],33:[function(t,e){"use strict";function i(){}var r=t("Concur"),n=t("get-form-data"),o=t("isomorph/is"),s=t("isomorph/format"),a=s.formatObj,l=t("isomorph/object"),u=t("./constants"),c=t("./env"),d=t("./BooleanField"),h=t("./ErrorList"),p=t("./Form"),f=t("./HiddenInput"),m=t("./IntegerField"),g=t("./isFormAsync"),v=t("validators"),y=v.ValidationError,x=t("./util"),w=x.cancellable,F="clean",_="DELETE",b="INITIAL_FORMS",C="MAX_NUM_FORMS",E="MIN_NUM_FORMS",I="ORDER",T="TOTAL_FORMS",M=u.FORMSET_DEFAULT_MIN_NUM,V=u.FORMSET_DEFAULT_MAX_NUM,O=function(){var t={};return t[T]=m({widget:f}),t[b]=m({widget:f}),t[E]=m({required:!1,widget:f}),t[C]=m({required:!1,widget:f}),p.extend(t)}(),D=r.extend({prefixFormat:"{prefix}-{index}",constructor:function(t){if(t=l.extend({form:this.form||null,extra:o.Number(this.extra)?this.extra:1,canOrder:this.canOrder||!1,canDelete:this.canDelete||!1,maxNum:o.Number(this.maxNum)?this.maxNum:V,validateMax:this.validateMax||!1,minNum:o.Number(this.minNum)?this.minNum:M,validateMin:this.validateMin||!1,managementFormCssClass:this.magagementFormCssClass||null,data:null,files:null,autoId:"id_{name}",prefix:null,initial:null,errorConstructor:h,validation:null,controlled:!1,onChange:null},t),!o.Function(t.form))throw new Error("A FormSet must be given a Form constructor to use, either via its constructor's `form` option or via its prototype, passing a `form` property to `FormSet.extend()`.");this.form=t.form,this.extra=t.extra+t.minNum,this.canOrder=t.canOrder,this.canDelete=t.canDelete,this.maxNum=t.maxNum,this.validateMax=t.validateMax,this.minNum=t.minNum,this.validateMin=t.validateMin,this.absoluteMax=t.maxNum+V,this.isInitialRender=null===t.data&&null===t.files,this.prefix=t.prefix||this.getDefaultPrefix(),this.autoId=t.autoId,this.data=t.data||{},this.files=t.files||{},this.initial=t.initial,this.errorConstructor=t.errorConstructor,this.managementFormCssClass=t.managementFormCssClass,this.validation=t.validation,this.controlled=t.controlled,this.onChange=t.onChange,this._forms=null,this._errors=null,this._nonFormErrors=null,this._pendingValidation={},this._pendingAsyncValidation={},this._cleanFormsetAfter={},this._onValidate=null}});D.prototype._formsetName=function(){var t=this.displayName||this.constructor.name;return t?"'"+t+"'":"FormSet"},D.prototype._stateChanged=function(){"function"==typeof this.onChange&&this.onChange()},D.prototype.validate=function(t,e){return this._cancelPendingOperations(),o.Function(t)&&(e=t,t=null),t&&("function"==typeof t.getDOMNode&&(t=t.getDOMNode()),this.setData(n(t),{validate:!1,_triggerStateChange:!1})),this.isAsync()?this._validateAsync(e):this._validateSync()},D.prototype._validateAsync=function(t){if(!o.Function(t))throw new Error("You must provide a callback to validate() when a formset or its form has asynchronous validation.");this.isInitialRender&&(this.isInitialRender=!1),this._onValidate=t,this.fullClean(),this._stateChanged()},D.prototype._validateSync=function(){return this.isInitialRender&&(this.isInitialRender=!1),this.fullClean(),this._stateChanged(),this.isValid()},D.prototype.fullClean=function(){this._errors=[],this._nonFormErrors=new this.errorConstructor,this.isInitialRender||this._cleanForms()},D.prototype._cleanForms=function(){var t=this.forms(),e=l.lookup(Object.keys(t));l.extend(this._pendingValidation,e),l.extend(this._cleanFormsetAfter,e);for(var i=0,r=t.length;r>i;i++)this._cleanForm(i,t[i]);0===t.length&&(this._cleanFormsetAfter.empty=!0,this._formCleaned("empty",null))},D.prototype._cleanForm=function(t,e){if(!e.isAsync())return e.validate(),this._errors[t]=e.errors(),void this._formCleaned(t,null);"undefined"!=typeof this._pendingAsyncValidation[t]&&l.pop(this._pendingAsyncValidation,t).cancel();var i=function(i){i||(this._errors[t]=e.errors()),this._formCleaned(t,i),this._stateChanged()}.bind(this);i.onCancel=function(){e._cancelPendingOperations()},this._pendingAsyncValidation[t]=w(i),e.validate(i)},D.prototype._formCleaned=function(t,e){return delete this._pendingValidation[t],this._pendingAsyncValidation[t]&&delete this._pendingAsyncValidation[t],e?(this._pendingValidation={},this._cleanFormsetAfter={},void this._finishedValidation(e)):this._cleanFormsetAfter[t]&&(delete this._cleanFormsetAfter[t],o.Empty(this._cleanFormsetAfter))?void this._cleanFormset():void(t==F&&this._finishedValidation(null))},D.prototype.clean=i,D.prototype._cleanFormset=function(){var t=!1,e=null;try{var r=this.totalFormCount(),n=this.deletedForms().length;if(this.validateMax&&r-n>this.maxNum||!c.browser&&this.managementForm().cleanedData[T]>this.absoluteMax)throw y("Please submit "+this.maxNum+" or fewer forms.",{code:"tooManyForms"});if(this.validateMin&&r-nthis.maxNum&&this.maxNum>=0&&(e=t),null!==this.maxNum&&e>this.maxNum&&this.maxNum>=0&&(e=this.maxNum),e}return Math.min(this.managementForm().cleanedData[T],this.absoluteMax)},D.prototype.initialFormCount=function(){return c.browser||this.isInitialRender?null!==this.initial&&this.initial.length>0?this.initial.length:0:this.managementForm().cleanedData[b]},D.prototype.forms=function(){if(null!==this._forms)return this._forms;for(var t=[],e=this.totalFormCount(),i=0;e>i;i++)t.push(this._constructForm(i));return this._forms=t,t},D.prototype.addAnother=function(){var t=this.totalFormCount();this.extra++,null!==this._forms&&(this._forms[t]=this._constructForm(t)),this._stateChanged()},D.prototype.removeForm=function(t){if(0===this.extra)throw new Error("Can't remove a form when there are no extra forms");this.extra--,null!==this._forms&&this._forms.splice(t,1),null!==this._errors&&this._errors.splice(t,1),this._stateChanged()},D.prototype._constructForm=function(t){var e={autoId:this.autoId,prefix:this.addPrefix(t),errorConstructor:this.errorConstructor,validation:this.validation,controlled:this.controlled,onChange:this.onChange};this.isInitialRender||(e.data=this.data,e.files=this.files),null!==this.initial&&this.initial.length>0&&"undefined"!=typeof this.initial[t]&&(e.initial=this.initial[t]),t>=this.initialFormCount()&&(e.emptyPermitted=!0);var i=new this.form(e);return this.addFields(i,t),i},D.prototype.initialForms=function(){return this.forms().slice(0,this.initialFormCount())},D.prototype.extraForms=function(){return this.forms().slice(this.initialFormCount())},D.prototype.emptyForm=function(){var t={autoId:this.autoId,prefix:this.addPrefix("__prefix__"),emptyPermitted:!0},e=new this.form(t);return this.addFields(e,null),e},D.prototype.deletedForms=function(){if(!this.isValid()||!this.canDelete)return[];var t=this.forms();if("undefined"==typeof this._deletedFormIndexes){this._deletedFormIndexes=[];for(var e=0,i=t.length;i>e;e++){var r=t[e];e>=this.initialFormCount()&&!r.hasChanged()||this._shouldDeleteForm(r)&&this._deletedFormIndexes.push(e)}}return this._deletedFormIndexes.map(function(e){return t[e]})},D.prototype.orderedForms=function(){if(!this.isValid()||!this.canOrder)throw new Error(this.constructor.name+" object has no attribute 'orderedForms'");var t=this.forms();if("undefined"==typeof this._ordering){this._ordering=[];for(var e=0,i=t.length;i>e;e++){var r=t[e];e>=this.initialFormCount()&&!r.hasChanged()||this.canDelete&&this._shouldDeleteForm(r)||this._ordering.push([e,r.cleanedData[I]])}this._ordering.sort(function(t,e){return null===t[1]&&null===e[1]?t[0]-e[0]:null===t[1]?1:null===e[1]?-1:t[1]-e[1]})}return this._ordering.map(function(e){return t[e[0]]})},D.prototype.addFields=function(t,e){this.canOrder&&(t.fields[I]=m(null!=e&&ee;e++)if(t[e].hasChanged())return!0;return!1},D.prototype.isAsync=function(){return 1==this.clean.length||g(this.form)},D.prototype.isMultipart=function(){return this.forms().length>0&&this.forms()[0].isMultipart()},D.prototype.isPending=function(){return!o.Empty(this._pendingAsyncValidation)},D.prototype.isValid=function(){if(this.isInitialRender)return!1;for(var t=this.errors(),e=this.forms(),i=0,r=t.length;r>i;i++)if(t[i].isPopulated()){if(this.canDelete&&this._shouldDeleteForm(e[i]))continue;return!1}return!this.nonFormErrors().isPopulated()},D.prototype.nonFormPending=function(){return"undefined"!=typeof this._pendingAsyncValidation[F]},D.prototype.addPrefix=function(t){return a(this.prefixFormat,{prefix:this.prefix,index:t})},D.prototype.getDefaultPrefix=function(){return"form"},e.exports=D},{"./BooleanField":3,"./ErrorList":24,"./Form":31,"./HiddenInput":35,"./IntegerField":39,"./constants":73,"./env":74,"./isFormAsync":76,"./util":78,Concur:79,"get-form-data":81,"isomorph/format":83,"isomorph/is":84,"isomorph/object":85,validators:89}],34:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("validators"),n=t("./CharField"),o=r.ipv6.cleanIPv6Address,s=n.extend({constructor:function a(t){return this instanceof a?(t=i.extend({protocol:"both",unpackIPv4:!1},t),this.unpackIPv4=t.unpackIPv4,this.defaultValidators=r.ipAddressValidators(t.protocol,t.unpackIPv4).validators,void n.call(this,t)):new a(t)}});s.prototype.toJavaScript=function(t){return t?t&&-1!=t.indexOf(":")?o(t,{unpackIPv4:this.unpackIPv4}):t:""},e.exports=s},{"./CharField":5,"isomorph/object":85,validators:89}],35:[function(t,e){"use strict";var i=t("./Input"),r=i.extend({constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t) -},inputType:"hidden",isHidden:!0});e.exports=r},{"./Input":38}],36:[function(t,e){"use strict";var i=t("./CharField"),r=t("validators"),n=r.validateIPv4Address,o=i.extend({defaultValidators:[n],constructor:function s(t){return this instanceof s?void i.call(this,t):new s(t)}});e.exports=o},{"./CharField":5,validators:89}],37:[function(t,e){"use strict";var i=t("./FileField"),r=i.extend({defaultErrorMessages:{invalidImage:"Upload a valid image. The file you uploaded was either not an image or a corrupted image."},constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t)}});r.prototype.toJavaScript=function(t,e){var r=i.prototype.toJavaScript.call(this,t,e);return null===r?null:r},r.prototype.getWidgetAttrs=function(t){var e=i.prototype.getWidgetAttrs.call(this,t);return e.accept="image/*",e},e.exports=r},{"./FileField":27}],38:[function(t,e){"use strict";var i=t("isomorph/object"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n=t("./Widget"),o=n.extend({constructor:function s(t){return this instanceof s?void n.call(this,t):new s(t)},inputType:null});o.prototype._formatValue=function(t){return t},o.prototype.render=function(t,e,n){n=i.extend({attrs:null},n),null===e&&(e="");var o=this.buildAttrs(n.attrs,{type:this.inputType,name:t}),s=n.controlled||this.isHidden?"value":"defaultValue";return("defaultValue"!=s||""!==e)&&(o[s]=""!==e?""+this._formatValue(e):e),r.createElement("input",o)},e.exports=o},{"./Widget":72,"isomorph/object":85}],39:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./Field"),n=t("./NumberInput"),o=t("validators"),s=o.MaxValueValidator,a=o.MinValueValidator,l=o.ValidationError,u=r.extend({widget:n,defaultErrorMessages:{invalid:"Enter a whole number."},constructor:function c(t){return this instanceof c?(t=i.extend({maxValue:null,minValue:null},t),this.maxValue=t.maxValue,this.minValue=t.minValue,r.call(this,t),null!==this.minValue&&this.validators.push(a(this.minValue)),void(null!==this.maxValue&&this.validators.push(s(this.maxValue)))):new c(t)}});u.prototype.toJavaScript=function(t){if(t=r.prototype.toJavaScript.call(this,t),this.isEmptyValue(t))return null;if(t=Number(t),isNaN(t)||-1!=t.toString().indexOf("."))throw l(this.errorMessages.invalid,{code:"invalid"});return t},u.prototype.getWidgetAttrs=function(t){var e=r.prototype.getWidgetAttrs.call(this,t);return null===this.minValue||i.hasOwn(t.attrs,"min")||i.setDefault(e,"min",this.minValue),null===this.maxValue||i.hasOwn(t.attrs,"max")||i.setDefault(e,"max",this.maxValue),e},e.exports=u},{"./Field":26,"./NumberInput":47,"isomorph/object":85,validators:89}],40:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n=t("./Field"),o=t("validators"),s=o.ValidationError,a=n.extend({defaultErrorMessages:{invalid:"Enter a list of values.",incomplete:"Enter a complete value."},constructor:function l(t){if(!(this instanceof n))return new l(t);t=r.extend({fields:[]},t),this.requireAllFields=r.pop(t,"requireAllFields",!0),n.call(this,t);for(var e=0,i=t.fields.length;i>e;e++){var o=t.fields[e];r.setDefault(o.errorMessages,"incomplete",this.errorMessages.incomplete),this.requireAllFields&&(o.required=!1)}this.fields=t.fields}});a.prototype.validate=function(){},a.prototype.clean=function(t){var e=[],r=[];if(t&&!i.Array(t))throw s(this.errorMessages.invalid,{code:"invalid"});var n=!0;if(i.Array(t))for(var o=0,a=t.length;a>o;o++)if(t[o]){n=!1;break}if(!t||n){if(this.required)throw s(this.errorMessages.required,{code:"required"});return this.compress([])}for(o=0,a=this.fields.length;a>o;o++){var l=this.fields[o],u=t[o];if(void 0===u&&(u=null),this.isEmptyValue(u))if(this.requireAllFields){if(this.required)throw s(this.errorMessages.required,{code:"required"})}else if(l.required){-1==r.indexOf(l.errorMessages.incomplete)&&r.push(l.errorMessages.incomplete);continue}try{e.push(l.clean(u))}catch(c){if(!(c instanceof s))throw c;r=r.concat(c.messages().filter(function(t){return-1==r.indexOf(t)}))}}if(0!==r.length)throw s(r);var d=this.compress(e);return this.validate(d),this.runValidators(d),d},a.prototype.compress=function(){throw new Error("Subclasses must implement this method.")},a.prototype._hasChanged=function(t,e){if(null===t){t=[];for(var r=0,n=e.length;n>r;r++)t.push("")}else i.Array(t)||(t=this.widget.decompress(t));for(r=0,n=this.fields.length;n>r;r++)if(this.fields[r]._hasChanged(t[r],e[r]))return!0;return!1},e.exports=a},{"./Field":26,"isomorph/is":84,"isomorph/object":85,validators:89}],41:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,o=t("./Widget"),s=o.extend({constructor:function a(t,e){if(!(this instanceof a))return new a(t,e);this.widgets=[];for(var i=!1,r=0,n=t.length;n>r;r++){var s=t[r]instanceof o?t[r]:new t[r];s.needsMultipartForm&&(i=!0),this.widgets.push(s)}this.needsMultipartForm=i,o.call(this,e)}});s.prototype.render=function(t,e,n){n=r.extend({},n),i.Array(e)||(e=this.decompress(e));for(var o=this.buildAttrs(n.attrs,{"data-newforms-field":t}),s=r.get(o,"id",null),a=r.get(o,"key",null),l=[],u=0,c=this.widgets.length;c>u;u++){var d=this.widgets[u],h=null;"undefined"!=typeof e[u]&&(h=e[u]),s&&(o.id=s+"_"+u),a&&(o.key=a+"_"+u),l.push(d.render(t+"_"+u,h,{attrs:o,controlled:n.controlled}))}return this.formatOutput(l)},s.prototype.idForLabel=function(t){return t&&(t+="_0"),t},s.prototype.valueFromData=function(t,e,i){for(var r=[],n=0,o=this.widgets.length;o>n;n++)r[n]=this.widgets[n].valueFromData(t,e,i+"_"+n);return r},s.prototype.formatOutput=function(t){return n.createElement("div",null,t)},s.prototype.decompress=function(){throw new Error("MultiWidget subclasses must implement a decompress() method.")},e.exports=s},{"./Widget":72,"isomorph/is":84,"isomorph/object":85}],42:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n=t("./ChoiceField"),o=t("./MultipleHiddenInput"),s=t("./SelectMultiple"),a=t("validators"),l=a.ValidationError,u=n.extend({hiddenWidget:o,widget:s,defaultErrorMessages:{invalidChoice:"Select a valid choice. {value} is not one of the available choices.",invalidList:"Enter a list of values."},constructor:function c(t){return this instanceof c?void n.call(this,t):new c(t)}});u.prototype.toJavaScript=function(t){if(this.isEmptyValue(t))return[];if(!i.Array(t))throw l(this.errorMessages.invalidList,{code:"invalidList"});for(var e=[],r=0,n=t.length;n>r;r++)e.push(""+t[r]);return e},u.prototype.validate=function(t){if(this.required&&!t.length)throw l(this.errorMessages.required,{code:"required"});for(var e=0,i=t.length;i>e;e++)if(!this.validValue(t[e]))throw l(this.errorMessages.invalidChoice,{code:"invalidChoice",params:{value:t[e]}})},u.prototype._hasChanged=function(t,e){if(null===t&&(t=[]),null===e&&(e=[]),t.length!=e.length)return!0;for(var i=r.lookup(e),n=0,o=t.length;o>n;n++)if("undefined"==typeof i[""+t[n]])return!0;return!1},e.exports=u},{"./ChoiceField":10,"./MultipleHiddenInput":44,"./SelectMultiple":58,"isomorph/is":84,"isomorph/object":85,validators:89}],43:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("./env"),n=t("./Field"),o=t("./FileInput"),s=t("./FileField"),a=t("validators"),l=a.ValidationError,u=s.extend({widget:o,defaultErrorMessages:{invalid:"No files were submitted. Check the encoding type on the form.",missing:"No files were submitted.",empty:"{name} is empty.",maxLength:"Ensure filenames have at most {max} characters ({name} has {length})."},constructor:function c(t){return this instanceof c?void s.call(this,t):new c(t)}});u.prototype.getWidgetAttrs=function(t){var e=s.prototype.getWidgetAttrs.call(this,t);return e.multiple=!0,e},u.prototype.toJavaScript=function(t){if(this.isEmptyValue(t))return[];if(r.browser&&i.String(t))return t;for(var e=0,n=t.length;n>e;e++){var o=t[e];if("undefined"==typeof o.name||"undefined"==typeof o.size)throw l(this.errorMessages.invalid,{code:"invalid"});var s=o.name,a=Number(o.size);if(null!==this.maxLength&&s.length>this.maxLength)throw l(this.errorMessages.maxLength,{code:"maxLength",params:{max:this.maxLength,name:s,length:s.length}});if(!s)throw l(this.errorMessages.invalid,{code:"invalid"});if(!this.allowEmptyFile&&0===a)throw l(this.errorMessages.empty,{code:"empty",params:{name:s}})}return t},u.prototype.clean=function(t,e){return this.isEmptyValue(t)&&!this.isEmptyValue(e)?e:n.prototype.clean.call(this,t)},u.prototype.validate=function(t){if(this.required&&!t.length)throw l(this.errorMessages.required,{code:"required"})},u.prototype._hasChanged=function(t,e){return!this.isEmptyValue(e)},e.exports=u},{"./Field":26,"./FileField":27,"./FileInput":28,"./env":74,"isomorph/is":84,validators:89}],44:[function(t,e){"use strict";var i=t("isomorph/object"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n=t("./HiddenInput"),o=n.extend({constructor:function s(t){return this instanceof s?void n.call(this,t):new s(t)}});o.prototype.render=function(t,e,n){n=i.extend({attrs:null},n),null===e&&(e=[]);for(var o=this.buildAttrs(n.attrs,{type:this.inputType,name:t}),s=i.get(o,"id",null),a=i.get(o,"key",null),l=[],u=0,c=e.length;c>u;u++){var d=i.extend({},o,{value:e[u]});s&&(d.id=s+"_"+u),a&&(d.key=s+"_"+u),l.push(r.createElement("input",d))}return r.createElement("div",null,l)},o.prototype.valueFromData=function(t,e,i){return"undefined"!=typeof t[i]?[].concat(t[i]):null},e.exports=o},{"./HiddenInput":35,"isomorph/object":85}],45:[function(t,e){"use strict";var i=t("./BooleanField"),r=t("./NullBooleanSelect"),n=i.extend({widget:r,constructor:function o(t){return this instanceof o?void i.call(this,t):new o(t)}});n.prototype.toJavaScript=function(t){return t===!0||"True"==t||"true"==t||"1"==t?!0:t===!1||"False"==t||"false"==t||"0"==t?!1:null},n.prototype.validate=function(){},n.prototype._hasChanged=function(t,e){return null!==t&&(t=Boolean(t)),null!==e&&(e=Boolean(e)),t!=e},e.exports=n},{"./BooleanField":3,"./NullBooleanSelect":46}],46:[function(t,e){"use strict";var i=t("./Select"),r=i.extend({constructor:function n(t){return this instanceof n?(t=t||{},t.choices=[["1","Unknown"],["2","Yes"],["3","No"]],void i.call(this,t)):new n(t)}});r.prototype.render=function(t,e,r){return e=e===!0||"2"==e?"2":e===!1||"3"==e?"3":"1",i.prototype.render.call(this,t,e,r)},r.prototype.valueFromData=function(t,e,i){var r=null;if("undefined"!=typeof t[i]){var n=t[i];n===!0||"True"==n||"true"==n||"2"==n?r=!0:(n===!1||"False"==n||"false"==n||"3"==n)&&(r=!1)}return r},e.exports=r},{"./Select":57}],47:[function(t,e){"use strict";var i=t("./TextInput"),r=i.extend({constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t)},inputType:"number"});e.exports=r},{"./TextInput":64}],48:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./env"),n=t("./TextInput"),o=n.extend({constructor:function s(t){return this instanceof s?(t=i.extend({renderValue:!1},t),n.call(this,t),void(this.renderValue=t.renderValue)):new s(t)},inputType:"password"});o.prototype.render=function(t,e,i){return r.browser||this.renderValue||(e=""),n.prototype.render.call(this,t,e,i)},e.exports=o},{"./TextInput":64,"./env":74,"isomorph/object":85}],49:[function(t,e){"use strict";var i=t("isomorph/is"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n={propTypes:{progress:r.PropTypes.any},renderProgress:function(){return this.props.progress?i.Function(this.props.progress)?this.props.progress():r.createElement(this.props.progress,null):r.createElement("progress",null,"Validating...")}};e.exports=n},{"isomorph/is":84}],50:[function(t,e){"use strict";var i=t("./ChoiceInput"),r=i.extend({constructor:function n(t,e,r,o,s,a){return this instanceof n?(i.call(this,t,e,r,o,s,a),void(this.value=""+this.value)):new n(t,e,r,o,s,a)},inputType:"radio"});e.exports=r},{"./ChoiceInput":12}],51:[function(t,e){"use strict";var i=t("./ChoiceFieldRenderer"),r=t("./RadioChoiceInput"),n=i.extend({constructor:function o(t,e,r,n,s){return this instanceof o?void i.apply(this,arguments):new o(t,e,r,n,s)},choiceInputConstructor:r});e.exports=n},{"./ChoiceFieldRenderer":11,"./RadioChoiceInput":50}],52:[function(t,e){"use strict";var i=t("./RadioFieldRenderer"),r=t("./RendererMixin"),n=t("./Select"),o=n.extend({__mixins__:[r],constructor:function(t){return this instanceof o?(r.call(this,t),void n.call(this,t)):new o(t)},renderer:i,_emptyValue:""});e.exports=o},{"./RadioFieldRenderer":51,"./RendererMixin":56,"./Select":57}],53:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("./CharField"),n=t("validators"),o=n.RegexValidator,s=r.extend({constructor:function a(t,e){return this instanceof a?(r.call(this,e),i.String(t)&&(t=new RegExp(t)),this.regex=t,void this.validators.push(o({regex:this.regex}))):new a(t,e)}});e.exports=s},{"./CharField":5,"isomorph/is":84,validators:89}],54:[function(t,e){"use strict";var i=t("isomorph/object"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n=t("./ErrorObject"),o=t("./Form"),s=t("./FormRow"),a=t("./ProgressMixin"),l=t("./constants"),u=l.NON_FIELD_ERRORS,c=t("./util"),d=c.autoIdChecker,h=c.getProps,p={autoId:d,controlled:r.PropTypes.bool,data:r.PropTypes.object,emptyPermitted:r.PropTypes.bool,errorConstructor:r.PropTypes.func,errors:r.PropTypes.instanceOf(n),files:r.PropTypes.object,initial:r.PropTypes.object,labelSuffix:r.PropTypes.string,onChange:r.PropTypes.func,prefix:r.PropTypes.string,validation:r.PropTypes.oneOfType([r.PropTypes.string,r.PropTypes.object])},f=r.createClass({displayName:"RenderForm",mixins:[a],propTypes:i.extend({},p,{className:r.PropTypes.string,component:r.PropTypes.any,form:r.PropTypes.oneOfType([r.PropTypes.func,r.PropTypes.instanceOf(o)]).isRequired,row:r.PropTypes.any,rowComponent:r.PropTypes.any}),childContextTypes:{form:r.PropTypes.instanceOf(o)},getChildContext:function(){return{form:this.form}},getDefaultProps:function(){return{component:"div",row:s,rowComponent:"div"}},componentWillMount:function(){this.form=this.props.form instanceof o?this.props.form:new this.props.form(i.extend({onChange:this.forceUpdate.bind(this)},h(this.props,Object.keys(p))))},getForm:function(){return this.form},render:function(){if(0!==r.Children.count(this.props.children))return r.cloneElement(r.Children.only(this.props.children),{form:this.form});var t=this,e=t.form,i=t.props,n={};this.props.className&&(n.className=i.className);var o=e.nonFieldErrors(),s=e.hiddenFields().map(function(t){var e=t.errors();return e.isPopulated&&o.extend(e.messages().map(function(e){return"(Hidden field "+t.name+") "+e})),t.render()});return r.createElement(i.component,r.__spread({},n),o.isPopulated()&&r.createElement(i.row,{className:e.errorCssClass,component:i.rowComponent,content:o.render(),key:e.addPrefix(u)}),e.visibleFields().map(function(t){return r.createElement(i.row,{bf:t,className:t.cssClasses(),component:i.rowComponent,key:t.htmlName,progress:i.progress})}),e.nonFieldPending()&&r.createElement(i.row,{className:e.pendingRowCssClass,component:i.rowComponent,content:this.renderProgress(),key:e.addPrefix("__pending__")}),s.length>0&&r.createElement(i.row,{className:e.hiddenFieldRowCssClass,component:i.rowComponent,content:s,hidden:!0,key:e.addPrefix("__hidden__")}))}});e.exports=f},{"./ErrorObject":25,"./Form":31,"./FormRow":32,"./ProgressMixin":49,"./constants":73,"./util":78,"isomorph/object":85}],55:[function(t,e){"use strict";var i=t("isomorph/object"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n=t("./FormRow"),o=t("./FormSet"),s=t("./ProgressMixin"),a=t("./RenderForm"),l=t("./constants"),u=l.NON_FIELD_ERRORS,c=t("./util"),d=c.autoIdChecker,h=c.getProps,p={canDelete:r.PropTypes.bool,canOrder:r.PropTypes.bool,extra:r.PropTypes.number,form:r.PropTypes.func,maxNum:r.PropTypes.number,minNum:r.PropTypes.number,validateMax:r.PropTypes.bool,validateMin:r.PropTypes.bool,autoId:d,controlled:r.PropTypes.bool,data:r.PropTypes.object,errorConstructor:r.PropTypes.func,files:r.PropTypes.object,initial:r.PropTypes.object,onChange:r.PropTypes.func,prefix:r.PropTypes.string,validation:r.PropTypes.oneOfType([r.PropTypes.string,r.PropTypes.object])},f=r.createClass({displayName:"RenderFormSet",mixins:[s],propTypes:i.extend({},p,{className:r.PropTypes.string,component:r.PropTypes.any,formComponent:r.PropTypes.any,formset:r.PropTypes.oneOfType([r.PropTypes.func,r.PropTypes.instanceOf(o)]),row:r.PropTypes.any,rowComponent:r.PropTypes.any,useManagementForm:r.PropTypes.bool,__all__:function(t){return t.form||t.formset?void 0:new Error("Invalid props supplied to `RenderFormSet`, either `form` or `formset` must be specified.")}}),getDefaultProps:function(){return{component:"div",formComponent:"div",formset:o,row:n,rowComponent:"div",useManagementForm:!1}},componentWillMount:function(){this.formset=this.props.formset instanceof o?this.props.formset:new this.props.formset(i.extend({onChange:this.forceUpdate.bind(this)},h(this.props,Object.keys(p))))},getFormset:function(){return this.formset},render:function(){var t=this,e=t.formset,i=t.props,n={};this.props.className&&(n.className=i.className);var o=e.nonFormErrors();return r.createElement(i.component,r.__spread({},n),o.isPopulated()&&r.createElement(i.row,{className:e.errorCssClass,content:o.render(),key:e.addPrefix(u),rowComponent:i.rowComponent}),e.forms().map(function(t){return r.createElement(a,{form:t,formComponent:i.formComponent,progress:i.progress,row:i.row,rowComponent:i.rowComponent})}),e.nonFormPending()&&r.createElement(i.row,{className:e.pendingRowCssClass,content:this.renderProgress(),key:e.addPrefix("__pending__"),rowComponent:i.rowComponent}),i.useManagementForm&&r.createElement(a,{form:e.managementForm(),formComponent:i.formComponent,row:i.row,rowComponent:i.rowComponent}))}});e.exports=f},{"./FormRow":32,"./FormSet":33,"./ProgressMixin":49,"./RenderForm":54,"./constants":73,"./util":78,"isomorph/object":85}],56:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/object"),n=i.extend({constructor:function(t){t=r.extend({renderer:null},t),null!==t.renderer&&(this.renderer=t.renderer)},_emptyValue:null,validation:{onChange:!0}});n.prototype.subWidgets=function(t,e,i){return this.getRenderer(t,e,i).choiceInputs()},n.prototype.getRenderer=function(t,e,i){i=r.extend({choices:[],controlled:!1},i),null===e&&(e=this._emptyValue);var n=this.buildAttrs(i.attrs),o=this.choices.concat(i.choices);return new this.renderer(t,e,n,i.controlled,o)},n.prototype.render=function(t,e,i){return this.getRenderer(t,e,i).render()},n.prototype.idForLabel=function(t){return t&&(t+="_0"),t},e.exports=n},{Concur:79,"isomorph/object":85}],57:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,o=t("./Widget"),s=t("./util"),a=s.normaliseChoices,l=o.extend({constructor:function u(t){return this instanceof u?(t=r.extend({choices:[]},t),o.call(this,t),void(this.choices=a(t.choices))):new u(t)},allowMultipleSelected:!1,validation:{onChange:!0}});l.prototype.render=function(t,e,i){i=r.extend({choices:[]},i),null===e&&(e="");var o=this.buildAttrs(i.attrs,{name:t}),s=this.renderOptions(i.choices),a=i.controlled?"value":"defaultValue";return o[a]=e,n.createElement("select",o,s)},l.prototype.renderOptions=function(t){for(var e,r=[],o=this.choices.concat(a(t)),s=0,l=o.length;l>s;s++)if(e=o[s],i.Array(e[1])){for(var u=[],c=e[1],d=0,h=c.length;h>d;d++)u.push(this.renderOption(c[d][0],c[d][1]));r.push(n.createElement("optgroup",{label:e[0],key:e[9]},u))}else r.push(this.renderOption(e[0],e[1]));return r},l.prototype.renderOption=function(t,e){t=""+t;var i={value:t,key:t+e};return n.createElement("option",i,e)},e.exports=l},{"./Widget":72,"./util":78,"isomorph/is":84,"isomorph/object":85}],58:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,o=t("./Select"),s=o.extend({constructor:function a(t){return this instanceof a?void o.call(this,t):new a(t)},allowMultipleSelected:!0,validation:{onChange:!0}});s.prototype.render=function(t,e,o){o=r.extend({choices:[]},o),null===e&&(e=[]),i.Array(e)||(e=[e]);var s=this.buildAttrs(o.attrs,{name:t,multiple:"multiple"}),a=this.renderOptions(o.choices),l=o.controlled?"value":"defaultValue";return s[l]=e,n.createElement("select",s,a)},s.prototype.valueFromData=function(t,e,i){return r.hasOwn(t,i)&&null!=t[i]?[].concat(t[i]):null},e.exports=s},{"./Select":57,"isomorph/is":84,"isomorph/object":85}],59:[function(t,e){"use strict";var i=t("validators"),r=t("./CharField"),n=t("./util"),o=n.strip,s=r.extend({defaultValidators:[i.validateSlug],constructor:function a(t){return this instanceof a?void r.call(this,t):new a(t)}});s.prototype.clean=function(t){return t=o(this.toJavaScript(t)),r.prototype.clean.call(this,t)},e.exports=s},{"./CharField":5,"./util":78,validators:89}],60:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n=t("./DateField"),o=t("./MultiValueField"),s=t("./SplitDateTimeWidget"),a=t("./SplitHiddenDateTimeWidget"),l=t("./TimeField"),u=t("validators"),c=u.ValidationError,d=o.extend({hiddenWidget:a,widget:s,defaultErrorMessages:{invalidDate:"Enter a valid date.",invalidTime:"Enter a valid time."},constructor:function h(t){if(!(this instanceof h))return new h(t);t=r.extend({inputDateFormats:null,inputTimeFormats:null},t);var e=r.extend({},this.defaultErrorMessages);"undefined"!=typeof t.errorMessages&&r.extend(e,t.errorMessages),t.fields=[n({inputFormats:t.inputDateFormats,errorMessages:{invalid:e.invalidDate}}),l({inputFormats:t.inputTimeFormats,errorMessages:{invalid:e.invalidTime}})],o.call(this,t)}});d.prototype.compress=function(t){if(i.Array(t)&&t.length>0){var e=t[0],r=t[1];if(this.isEmptyValue(e))throw c(this.errorMessages.invalidDate,{code:"invalidDate"});if(this.isEmptyValue(r))throw c(this.errorMessages.invalidTime,{code:"invalidTime"});return new Date(e.getFullYear(),e.getMonth(),e.getDate(),r.getHours(),r.getMinutes(),r.getSeconds())}return null},e.exports=d},{"./DateField":15,"./MultiValueField":40,"./SplitDateTimeWidget":61,"./SplitHiddenDateTimeWidget":62,"./TimeField":66,"isomorph/is":84,"isomorph/object":85,validators:89}],61:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./DateInput"),n=t("./MultiWidget"),o=t("./TimeInput"),s=n.extend({constructor:function a(t){if(!(this instanceof a))return new a(t);t=i.extend({dateFormat:null,timeFormat:null},t);var e=[r({attrs:t.attrs,format:t.dateFormat}),o({attrs:t.attrs,format:t.timeFormat})];n.call(this,e,t.attrs)}});s.prototype.decompress=function(t){return t?[new Date(t.getFullYear(),t.getMonth(),t.getDate()),new Date(1900,0,1,t.getHours(),t.getMinutes(),t.getSeconds())]:[null,null]},e.exports=s},{"./DateInput":16,"./MultiWidget":41,"./TimeInput":67,"isomorph/object":85}],62:[function(t,e){"use strict";var i=t("./SplitDateTimeWidget"),r=i.extend({constructor:function n(t){if(!(this instanceof n))return new n(t);i.call(this,t);for(var e=0,r=this.widgets.length;r>e;e++)this.widgets[e].inputType="hidden",this.widgets[e].isHidden=!0},isHidden:!0});e.exports=r},{"./SplitDateTimeWidget":61}],63:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/object"),n=i.extend({constructor:function o(t,e,i,n){return this instanceof o?(this.parentWidget=t,this.name=e,this.value=i,n=r.extend({attrs:null,choices:[]},n),this.attrs=n.attrs,void(this.choices=n.choices)):new o(t,e,i,n)}});n.prototype.render=function(){var t={attrs:this.attrs};return this.choices.length&&(t.choices=this.choices),this.parentWidget.render(this.name,this.value,t)},e.exports=n},{Concur:79,"isomorph/object":85}],64:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./Input"),n=r.extend({constructor:function o(t){return this instanceof o?(t=i.extend({attrs:null},t),null!=t.attrs&&(this.inputType=i.pop(t.attrs,"type",this.inputType)),void r.call(this,t)):new o(t)},inputType:"text"});e.exports=n},{"./Input":38,"isomorph/object":85}],65:[function(t,e){"use strict";var i=t("isomorph/object"),r="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,n=t("./Widget"),o=n.extend({constructor:function s(t){return this instanceof s?(t=i.extend({attrs:null},t),t.attrs=i.extend({rows:"3",cols:"40"},t.attrs),void n.call(this,t)):new s(t)}});o.prototype.render=function(t,e,n){n=i.extend({},n),null===e&&(e="");var o=this.buildAttrs(n.attrs,{name:t}),s=n.controlled?"value":"defaultValue";return o[s]=e,r.createElement("textarea",o)},e.exports=o},{"./Widget":72,"isomorph/object":85}],66:[function(t,e){"use strict";var i=t("isomorph/time"),r=t("./locales"),n=t("./BaseTemporalField"),o=t("./TimeInput"),s=n.extend({widget:o,inputFormatType:"TIME_INPUT_FORMATS",defaultErrorMessages:{invalid:"Enter a valid time."},constructor:function a(t){return this instanceof a?void n.call(this,t):new a(t)}});s.prototype.toJavaScript=function(t){return this.isEmptyValue(t)?null:t instanceof Date?new Date(1900,0,1,t.getHours(),t.getMinutes(),t.getSeconds()):n.prototype.toJavaScript.call(this,t)},s.prototype.strpdate=function(t,e){var n=i.strptime(t,e,r.getDefaultLocale());return new Date(1900,0,1,n[3],n[4],n[5])},e.exports=s},{"./BaseTemporalField":2,"./TimeInput":67,"./locales":77,"isomorph/time":86}],67:[function(t,e){"use strict";var i=t("./DateTimeBaseInput"),r=i.extend({formatType:"TIME_INPUT_FORMATS",constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t)}});e.exports=r},{"./DateTimeBaseInput":17}],68:[function(t,e){"use strict";var i=t("isomorph/object"),r=t("./ChoiceField"),n=t("validators"),o=n.ValidationError,s=r.extend({constructor:function a(t){return this instanceof a?(t=i.extend({coerce:function(t){return t},emptyValue:""},t),this.coerce=i.pop(t,"coerce"),this.emptyValue=i.pop(t,"emptyValue"),void r.call(this,t)):new a(t)}});s.prototype._coerce=function(t){if(t===this.emptyValue||this.isEmptyValue(t))return this.emptyValue;try{t=this.coerce(t)}catch(e){throw o(this.errorMessages.invalidChoice,{code:"invalidChoice",params:{value:t}})}return t},s.prototype.clean=function(t){return t=r.prototype.clean.call(this,t),this._coerce(t)},e.exports=s},{"./ChoiceField":10,"isomorph/object":85,validators:89}],69:[function(t,e){"use strict";var i=t("isomorph/is"),r=t("isomorph/object"),n=t("./MultipleChoiceField"),o=t("validators"),s=o.ValidationError,a=n.extend({constructor:function l(t){return this instanceof l?(t=r.extend({coerce:function(t){return t},emptyValue:[]},t),this.coerce=r.pop(t,"coerce"),this.emptyValue=r.pop(t,"emptyValue"),void n.call(this,t)):new l(t)}});a.prototype._coerce=function(t){if(t===this.emptyValue||this.isEmptyValue(t)||i.Array(t)&&!t.length)return this.emptyValue;for(var e=[],r=0,n=t.length;n>r;r++)try{e.push(this.coerce(t[r]))}catch(o){throw s(this.errorMessages.invalidChoice,{code:"invalidChoice",params:{value:t[r]}})}return e},a.prototype.clean=function(t){return t=n.prototype.clean.call(this,t),this._coerce(t)},a.prototype.validate=function(t){if(t!==this.emptyValue||i.Array(t)&&t.length)n.prototype.validate.call(this,t);else if(this.required)throw s(this.errorMessages.required,{code:"required"})},e.exports=a},{"./MultipleChoiceField":42,"isomorph/is":84,"isomorph/object":85,validators:89}],70:[function(t,e){"use strict";var i=t("isomorph/url"),r=t("./CharField"),n=t("./URLInput"),o=t("validators"),s=o.URLValidator,a=t("./util"),l=a.strip,u=r.extend({widget:n,defaultErrorMessages:{invalid:"Enter a valid URL."},defaultValidators:[s()],constructor:function c(t){return this instanceof c?void r.call(this,t):new c(t)}});u.prototype.toJavaScript=function(t){if(t){var e=i.parseUri(t);e.protocol||(e.protocol="http"),e.path||(e.path="/"),t=i.makeUri(e)}return r.prototype.toJavaScript.call(this,t)},u.prototype.clean=function(t){return t=l(this.toJavaScript(t)),r.prototype.clean.call(this,t)},e.exports=u},{"./CharField":5,"./URLInput":71,"./util":78,"isomorph/url":87,validators:89}],71:[function(t,e){"use strict";var i=t("./TextInput"),r=i.extend({constructor:function n(t){return this instanceof n?void i.call(this,t):new n(t)},inputType:"url"});e.exports=r},{"./TextInput":64}],72:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/object"),n=t("./SubWidget"),o=i.extend({constructor:function(t){t=r.extend({attrs:null},t),this.attrs=r.extend({},t.attrs)},isHidden:!1,needsMultipartForm:!1,isRequired:!1,validation:null,needsInitialValue:!1,isValueSettable:!0});o.prototype.subWidgets=function(t,e,i){return[n(this,t,e,i)]},o.prototype.render=function(){throw new Error("Constructors extending Widget must implement a render() method.")},o.prototype.buildAttrs=function(t,e){return r.extend({},this.attrs,e,t)},o.prototype.valueFromData=function(t,e,i){return r.get(t,i,null)},o.prototype.idForLabel=function(t){return t},e.exports=o},{"./SubWidget":63,Concur:79,"isomorph/object":85}],73:[function(t,e){"use strict";e.exports={FORMSET_DEFAULT_MAX_NUM:1e3,FORMSET_DEFAULT_MIN_NUM:0,NON_FIELD_ERRORS:"__all__"}},{}],74:[function(t,e){"use strict";e.exports={browser:"undefined"!=typeof window}},{}],75:[function(t,e){"use strict";function i(t,e){e||(e=n.getDefaultLocale());var i=t+":"+e;if(!r.hasOwn(s,i)){for(var a=n.getLocales(e),l=[],u=0,c=a.length;c>u;u++){var d=a[u];if(r.hasOwn(d,t)){l=d[t].slice();break}}if(r.hasOwn(o,t))for(var h=o[t],p=0,f=h.length;f>p;p++){var m=h[p];-1==l.indexOf(m)&&l.push(m)}s[i]=l}return s[i]}var r=t("isomorph/object"),n=t("./locales"),o={DATE_INPUT_FORMATS:["%Y-%m-%d"],TIME_INPUT_FORMATS:["%H:%M:%S","%H:%M"],DATETIME_INPUT_FORMATS:["%Y-%m-%d %H:%M:%S","%Y-%m-%d %H:%M","%Y-%m-%d"]},s={};e.exports={getFormat:i}},{"./locales":77,"isomorph/object":85}],76:[function(t,e){"use strict";function i(t){var e=t.prototype;if(1==e.clean.length)return!0;for(var i=Object.keys(e.baseFields),n=0,o=i.length;o>n;n++){var s=e._getCustomClean(i[n]);if(r.Function(s)&&1==s.length)return!0}return!1}var r=t("isomorph/is");e.exports=i},{"isomorph/is":84}],77:[function(t,e){"use strict";function i(t,e){c[t]=e,l.locales[t]=e}function r(t){if(t){if(a.hasOwn(c,t))return c[t];if(-1!=t.indexOf("_")&&(t=t.split("_")[0],a.hasOwn(c,t)))return c[t]}return c[u.lang]}function n(t){if(t){var e=[];if(a.hasOwn(c,t)&&e.push(c[t]),-1!=t.indexOf("_")&&(t=t.split("_")[0],a.hasOwn(c,t)&&e.push(c[t])),e.length)return e}return[c[u.lang]]}function o(t){if(!a.hasOwn(c,t))throw new Error("Unknown locale: "+t);u.lang=t}function s(){return u.lang}var a=t("isomorph/object"),l=t("isomorph/time"),u={lang:"en"},c={en:{DATE_INPUT_FORMATS:["%Y-%m-%d","%m/%d/%Y","%m/%d/%y","%b %d %Y","%b %d, %Y","%d %b %Y","%d %b, %Y","%B %d %Y","%B %d, %Y","%d %B %Y","%d %B, %Y"],DATETIME_INPUT_FORMATS:["%Y-%m-%d %H:%M:%S","%Y-%m-%d %H:%M","%Y-%m-%d","%m/%d/%Y %H:%M:%S","%m/%d/%Y %H:%M","%m/%d/%Y","%m/%d/%y %H:%M:%S","%m/%d/%y %H:%M","%m/%d/%y"]},en_GB:{DATE_INPUT_FORMATS:["%d/%m/%Y","%d/%m/%y","%b %d %Y","%b %d, %Y","%d %b %Y","%d %b, %Y","%B %d %Y","%B %d, %Y","%d %B %Y","%d %B, %Y"],DATETIME_INPUT_FORMATS:["%Y-%m-%d %H:%M:%S","%Y-%m-%d %H:%M","%Y-%m-%d","%d/%m/%Y %H:%M:%S","%d/%m/%Y %H:%M","%d/%m/%Y","%d/%m/%y %H:%M:%S","%d/%m/%y %H:%M","%d/%m/%y"]}};e.exports={addLocale:i,getDefaultLocale:s,getLocale:r,getLocales:n,setDefaultLocale:o}},{"isomorph/object":85,"isomorph/time":86}],78:[function(t,e){"use strict";function i(t,e,i){for(var r=t.split(/\{(\w+)\}/g),n=1,o=r.length;o>n;n+=2)r[n]=y.hasOwn(e,r[n])?e[r[n]]:"{"+r[n]+"}";return(!i||i&&i.strip!==!1)&&(r=r.filter(function(t){return""!==t})),r}function r(t,e){for(var i={},r=0,n=e.length;n>r;r++){var o=e[r];y.hasOwn(t,o)&&(i[o]=t[o])}return i}function n(t,e){var i=t[e];return v.Function(i)&&(i=i.call(t)),i}function o(t,e,i){return t.map(function(t){return[n(t,e),n(t,i)]})}function s(t){if(!t.length)return t;for(var e,i=[],r=0,n=t.length;n>r;r++){if(e=t[r],v.Array(e)||(e=[e,e]),2!=e.length)throw new Error("Choices in a choice list must contain exactly 2 values, but got "+JSON.stringify(e)); -if(v.Array(e[1])){for(var o,s=[],a=e[1],l=0,u=a.length;u>l;l++){if(o=a[l],v.Array(o)||(o=[o,o]),2!=o.length)throw new Error("Choices in an optgroup choice list must contain exactly 2 values, but got "+JSON.stringify(o));s.push(o)}i.push([e[0],s])}else i.push(e)}return i}function a(t){t=t.map(function(t){return 0===t.indexOf("on")?t:"on"+t.charAt(0).toUpperCase()+t.substr(1)});var e=t.indexOf("onChange");return-1!=e&&t.splice(e,1),{events:t,onChange:-1!=e}}function l(t){return a(w(t).split(/ +/g))}function u(t){if(!t||"manual"===t)return t;if("auto"===t)return{events:["onBlur"],onChange:!0,onChangeDelay:369};if(v.String(t))return l(t);if(v.Object(t)){var e;if(v.String(t.on))e=l(t.on);else{if(!v.Array(t.on))throw new Error("Validation config Objects must have an 'on' String or Array");e=a(t.on)}return e.onChangeDelay=y.get(t,"onChangeDelay",t.delay),e}throw new Error("Unexpected validation config: "+t)}function c(t,e,i){var r,n,o,s,a,l=function(){o=this,n=arguments,s=new Date;var l=function(){var u=new Date-s;e>u?r=setTimeout(l,e-u):(r=null,i||(a=t.apply(o,n)))},u=i&&!r;return r||(r=setTimeout(l,e)),u&&(a=t.apply(o,n)),a};return l.cancel=function(){r&&clearTimeout(r)},l.trigger=function(){return l.cancel(),t.apply(o,n)},l}function d(t){var e=!1,i=function(){e||t.apply(null,arguments)};return i.cancel=function(){e=!0,v.Function(t.onCancel)&&t.onCancel()},i}function h(t){return"function"==typeof t.getDOMNode&&(t=t.getDOMNode()),g(t)}function p(t,e){for(var i=h(t),r=!0,n=0,o=e.length;o>n;n++)e[n].setFormData(i)||(r=!1);return r}function f(t){for(var e=!0,i=0,r=t.length;r>i;i++)t[i].isValid()||(e=!1);return e}function m(t,e,i,r){var n=t.autoId;return!t.autoId||v.String(n)&&-1!=n.indexOf("{name}")?void 0:new Error("Invalid `autoId` "+r+" supplied to `"+i+"`. Must be falsy or a String containing a `{name}` placeholder")}var g=t("get-form-data"),v=t("isomorph/is"),y=t("isomorph/object"),x=function(){var t=/([A-Z]+)/g,e=/[ _]+/,i=/^[A-Z][A-Z0-9]+$/;return function(r){var n=r.replace(t," $1").split(e);""===n[0]&&n.splice(0,1);for(var o=0,s=n.length;s>o;o++)0===o?n[0]=n[0].charAt(0).toUpperCase()+n[0].substr(1):i.test(n[o])||(n[o]=n[o].charAt(0).toLowerCase()+n[o].substr(1));return n.join(" ")}}(),w=function(){var t=/(^\s+|\s+$)/g;return function(e){return(""+e).replace(t,"")}}(),F=function(){},_=function(){};e.exports={allValid:f,autoIdChecker:m,cancellable:d,debounce:c,info:F,formatToArray:i,getFormData:h,getProps:r,makeChoices:o,normaliseChoices:s,normaliseValidation:u,prettyName:x,strip:w,validateAll:p,warning:_}},{"get-form-data":81,"isomorph/is":84,"isomorph/object":85}],79:[function(t,e){"use strict";function i(t){return u.call(t).slice(8,-1).toLowerCase()}function r(t,e){var i=function(){};return i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t}function n(t,e){for(var i in e)l.call(e,i)&&(t[i]=e[i]);return t}function o(t,e){"function"==i(e)?n(t,e.prototype):n(t,e)}function s(t){var e=t.__mixins__;"array"!=i(e)&&(e=[e]);for(var r={},s=0,a=e.length;a>s;s++)o(r,e[s]);return delete t.__mixins__,n(r,t)}function a(t,e,i,o){return null==e&&(e=function(){t.apply(this,arguments)}),i.constructor=e,t!==c&&(r(e,t),e.__super__=t.prototype),n(e.prototype,i),n(e,o),e}var l=Object.prototype.hasOwnProperty,u=Object.prototype.toString,c=e.exports=function(){};c.__mro__=[],c.extend=function(t,e){t=t||{},e=e||{},"undefined"!=typeof this.prototype.__meta__&&this.prototype.__meta__(t,e);var i=l.call(t,"constructor")?t.constructor:null;return l.call(t,"__mixins__")&&(t=s(t)),l.call(e,"__mixins__")&&(e=s(e)),i=a(this,i,t,e),i.extend=this.extend,i.__mro__=[i].concat(this.__mro__),i}},{}],80:[function(e,i,r){!function(e){function n(t){throw RangeError(P[t])}function o(t,e){for(var i=t.length;i--;)t[i]=e(t[i]);return t}function s(t,e){return o(t.split(A),e).join(".")}function a(t){for(var e,i,r=[],n=0,o=t.length;o>n;)e=t.charCodeAt(n++),e>=55296&&56319>=e&&o>n?(i=t.charCodeAt(n++),56320==(64512&i)?r.push(((1023&e)<<10)+(1023&i)+65536):(r.push(e),n--)):r.push(e);return r}function l(t){return o(t,function(t){var e="";return t>65535&&(t-=65536,e+=R(t>>>10&1023|55296),t=56320|1023&t),e+=R(t)}).join("")}function u(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:_}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function d(t,e,i){var r=0;for(t=i?S(t/I):t>>1,t+=S(t/e);t>j*C>>1;r+=_)t=S(t/j);return S(r+(j+1)*t/(t+E))}function h(t){var e,i,r,o,s,a,c,h,p,f,m=[],g=t.length,v=0,y=M,x=T;for(i=t.lastIndexOf(V),0>i&&(i=0),r=0;i>r;++r)t.charCodeAt(r)>=128&&n("not-basic"),m.push(t.charCodeAt(r));for(o=i>0?i+1:0;g>o;){for(s=v,a=1,c=_;o>=g&&n("invalid-input"),h=u(t.charCodeAt(o++)),(h>=_||h>S((F-v)/a))&&n("overflow"),v+=h*a,p=x>=c?b:c>=x+C?C:c-x,!(p>h);c+=_)f=_-p,a>S(F/f)&&n("overflow"),a*=f;e=m.length+1,x=d(v-s,e,0==s),S(v/e)>F-y&&n("overflow"),y+=S(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function p(t){var e,i,r,o,s,l,u,h,p,f,m,g,v,y,x,w=[];for(t=a(t),g=t.length,e=M,i=0,s=T,l=0;g>l;++l)m=t[l],128>m&&w.push(R(m));for(r=o=w.length,o&&w.push(V);g>r;){for(u=F,l=0;g>l;++l)m=t[l],m>=e&&u>m&&(u=m);for(v=r+1,u-e>S((F-i)/v)&&n("overflow"),i+=(u-e)*v,e=u,l=0;g>l;++l)if(m=t[l],e>m&&++i>F&&n("overflow"),m==e){for(h=i,p=_;f=s>=p?b:p>=s+C?C:p-s,!(f>h);p+=_)x=h-f,y=_-f,w.push(R(c(f+x%y,0))),h=S(x/y);w.push(R(c(h,0))),s=d(i,v,r==o),i=0,++r}++i,++e}return w.join("")}function f(t){return s(t,function(t){return O.test(t)?h(t.slice(4).toLowerCase()):t})}function m(t){return s(t,function(t){return D.test(t)?"xn--"+p(t):t})}var g="object"==typeof r&&r,v="object"==typeof i&&i&&i.exports==g&&i,y="object"==typeof global&&global;(y.global===y||y.window===y)&&(e=y);var x,w,F=2147483647,_=36,b=1,C=26,E=38,I=700,T=72,M=128,V="-",O=/^xn--/,D=/[^ -~]/,A=/\x2E|\u3002|\uFF0E|\uFF61/g,P={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=_-b,S=Math.floor,R=String.fromCharCode;if(x={version:"1.2.4",ucs2:{decode:a,encode:l},decode:h,encode:p,toASCII:m,toUnicode:f},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(g&&!g.nodeType)if(v)v.exports=x;else for(w in x)x.hasOwnProperty(w)&&(g[w]=x[w]);else e.punycode=x}(this)},{}],81:[function(t,e){"use strict";function i(t,e){if(!t)throw new Error("A form is required by getFormData, was given form="+t);e||(e={trim:!1});for(var i,n={},o=[],a={},l=0,u=t.elements.length;u>l;l++){var c=t.elements[l];s[c.type]||c.disabled||(i=c.name||c.id,i&&!a[i]&&(o.push(i),a[i]=!0))}for(l=0,u=o.length;u>l;l++){i=o[l];var d=r(t,i,e);null!=d&&(n[i]=d)}return n}function r(t,e,i){if(!t)throw new Error("A form is required by getNamedFormElementData, was given form="+t);if(!e&&"[object String]"!==c.call(e))throw new Error("A form element name is required by getNamedFormElementData, was given elementName="+e);var r=t.elements[e];if(!r||r.disabled)return null;var s=!(!i||!i.trim);if(!o[c.call(r)])return n(r,s);for(var a=[],l=!0,u=0,d=r.length;d>u;u++)if(!r[u].disabled){l&&"radio"!==r[u].type&&(l=!1);var h=n(r[u],s);null!=h&&(a=a.concat(h))}return l&&1===a.length?a[0]:a.length>0?a:null}function n(t,e){var i=null;if("select-one"===t.type)return t.options.length&&(i=t.options[t.selectedIndex].value),i;if("select-multiple"===t.type){i=[];for(var r=0,n=t.options.length;n>r;r++)t.options[r].selected&&i.push(t.options[r].value);return 0===i.length&&(i=null),i}return"file"===t.type&&"files"in t?(t.multiple?(i=u.call(t.files),0===i.length&&(i=null)):i=t.files[0],i):(a[t.type]?t.checked&&(i=t.value):i=e?t.value.replace(l,""):t.value,i)}var o={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},s={button:!0,reset:!0,submit:!0,fieldset:!0},a={checkbox:!0,radio:!0},l=/^\s+|\s+$/g,u=Array.prototype.slice,c=Object.prototype.toString;i.getNamedFormElementData=r,e.exports=i},{}],82:[function(t,e){"use strict";function i(){}function r(t){return"object"==typeof t?(i.prototype=t,new i):t}function n(t){var e,i;if("object"!=typeof t)return t;var n=t.valueOf();if(t==n){e=new t.constructor(n);var o="string"!=c(t);for(i in t)!l.call(t,i)||!o&&h.test(i)||(e[i]=t[i]);return e}if(t instanceof t.constructor&&t.constructor!==Object){e=r(t.constructor.prototype);for(i in t)l.call(t,i)&&(e[i]=t[i])}else{e={};for(i in t)e[i]=t[i]}return e}function o(t){for(var e in t)this[e]=t[e]}function s(){this.copiedObjects=[];var t=this;this.recursiveDeepCopy=function(e){return t.deepCopy(e)},this.depth=0}function a(t,e){var i=new s;return e&&(i.maxDepth=e),i.deepCopy(t)}var l=Object.prototype.hasOwnProperty,u=Object.prototype.toString,c=function(t){return u.call(t).slice(8,-1).toLowerCase()},d={"boolean":!0,number:!0,string:!0},h=/^(?:\d+|length)$/,p=[];o.prototype={constructor:o,canCopy:function(){return!1},create:function(){},populate:function(){}},s.prototype={constructor:s,maxDepth:256,cacheResult:function(t,e){this.copiedObjects.push([t,e])},getCachedResult:function(t){for(var e=this.copiedObjects,i=e.length,r=0;i>r;r++)if(e[r][0]===t)return e[r][1];return void 0},deepCopy:function(t){if(null===t)return null;if("object"!=typeof t)return t;var e=this.getCachedResult(t);if(e)return e;for(var i=0;ithis.maxDepth)throw new Error("Exceeded max recursion depth in deep copy.");return t.populate(this.recursiveDeepCopy,e,i),this.depth--,i}},a.DeepCopier=o,a.deepCopiers=p,a.register=function(t){t instanceof o||(t=new o(t)),p.unshift(t)},a.register({canCopy:function(){return!0},create:function(t){return t instanceof t.constructor?r(t.constructor.prototype):{}},populate:function(t,e,i){for(var r in e)l.call(e,r)&&(i[r]=t(e[r]));return i}}),a.register({canCopy:function(t){return d[c(t)]},create:function(t){return new t.constructor(t.valueOf())},populate:function(t,e,i){var r="string"!=c(e);for(var n in e)!l.call(e,n)||!r&&h.test(n)||(i[n]=t(e[n]));return i}}),a.register({canCopy:function(t){return"regexp"==c(t)},create:function(t){return t}}),a.register({canCopy:function(t){return"date"==c(t)},create:function(t){return new Date(t)}}),a.register({canCopy:function(t){return"array"==c(t)},create:function(t){return new t.constructor},populate:function(t,e,i){for(var r=0;re&&i-1&&(r=u.charAt(i)+"B"),n.toFixed(2).replace(c,"")+" "+r}var s=Array.prototype.slice,a=/%[%s]/g,l=/({{?)(\w+)}/g,u="kMGTPEZY",c=/\.00$|0$/;e.exports={format:i,formatArr:r,formatObj:n,fileSize:o}},{}],84:[function(t,e){"use strict";function i(t){return"[object Array]"==h.call(t)}function r(t){return"[object Boolean]"==h.call(t)}function n(t){return"[object Date]"==h.call(t)}function o(t){return"[object Error]"==h.call(t)}function s(t){return"[object Function]"==h.call(t)}function a(t){return"[object Number]"==h.call(t)}function l(t){return"[object Object]"==h.call(t)}function u(t){return"[object RegExp]"==h.call(t)}function c(t){return"[object String]"==h.call(t)}function d(t){for(var e in t)return!1;return!0}var h=Object.prototype.toString;e.exports={Array:i,Boolean:r,Date:n,Empty:d,Error:o,Function:s,NaN:isNaN,Number:a,Object:l,RegExp:u,String:c}},{}],85:[function(t,e){"use strict";function i(t){for(var e,i=1,r=arguments.length;r>i;i++)if(e=arguments[i])for(var n in e)c(e,n)&&(t[n]=e[n]);return t}function r(t,e){var i=function(){};return i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t}function n(t){var e=[];for(var i in t)c(t,i)&&e.push([i,t[i]]);return e}function o(t){for(var e,i={},r=0,n=t.length;n>r;r++)e=t[r],i[e[0]]=e[1];return i}function s(t){for(var e={},i=0,r=t.length;r>i;i++)e[""+t[i]]=!0;return e}function a(t,e,i){return c(t,e)?t[e]:i}function l(t,e,i){if(null==t)throw new Error("pop was given "+t);if(c(t,e)){var r=t[e];return delete t[e],r}if(2==arguments.length)throw new Error("pop was given an object which didn't have an own '"+e+"' property, without a default value to return");return i}function u(t,e,i){if(null==t)throw new Error("setDefault was given "+t);return i=i||null,c(t,e)?t[e]:(t[e]=i,i)}var c=function(){var t=Object.prototype.hasOwnProperty;return function(e,i){return t.call(e,i)}}(),d=function(){var t=Object.prototype.toString;return function(e){return t.call(e).slice(8,-1).toLowerCase()}}();e.exports={hasOwn:c,type:d,extend:i,inherits:r,items:n,fromItems:o,lookup:s,get:a,pop:l,setDefault:u}},{}],86:[function(t,e){"use strict";function i(t){return 10>t?"0"+t:t}function r(t,e){for(var i=0,r=e.length;r>i;i++)if(t===e[i])return i;return-1}function n(t,e){this.format=t,this.locale=e;var i=n._cache[e.name+"|"+t];void 0!==i?(this.re=i[0],this.matchOrder=i[1]):this.compilePattern()}var o=t("./is"),s={b:function(t){return"("+t.b.join("|")+")"},B:function(t){return"("+t.B.join("|")+")"},p:function(t){return"("+t.AM+"|"+t.PM+")"},d:"(\\d\\d?)",H:"(\\d\\d?)",I:"(\\d\\d?)",m:"(\\d\\d?)",M:"(\\d\\d?)",S:"(\\d\\d?)",y:"(\\d\\d?)",Y:"(\\d{4})","%":"%"},a={a:function(t,e){return e.a[t.getDay()]},A:function(t,e){return e.A[t.getDay()]},b:function(t,e){return e.b[t.getMonth()]},B:function(t,e){return e.B[t.getMonth()]},d:function(t){return i(t.getDate(),2)},H:function(t){return i(t.getHours(),2)},M:function(t){return i(t.getMinutes(),2)},m:function(t){return i(t.getMonth()+1,2)},S:function(t){return i(t.getSeconds(),2)},w:function(t){return t.getDay()},Y:function(t){return t.getFullYear()},"%":function(){return"%"}},l=/[^%]%$/;n._cache={},n.prototype.compilePattern=function(){for(var t,e,i=this.format.split(/(?:\s|\t|\n)+/).join(" "),r=[],a=[],l=0,u=i.length;u>l;l++)if(t=i.charAt(l),"%"==t){if(l==u-1)throw new Error("strptime format ends with raw %");if(t=i.charAt(++l),e=s[t],void 0===e)throw new Error("strptime format contains an unknown directive: %"+t);r.push(o.Function(e)?e(this.locale):e),"%"!=t&&a.push(t)}else r.push(" "===t?" +":t);this.re=new RegExp("^"+r.join("")+"$"),this.matchOrder=a,n._cache[this.locale.name+"|"+this.format]=[this.re,a]},n.prototype.parse=function(t){var e=this.re.exec(t);if(null===e)throw new Error("Time data did not match format: data="+t+", format="+this.format);for(var i=[1900,1,1,0,0,0],n={},o=1,s=e.length;s>o;o++)n[this.matchOrder[o-1]]=e[o];if(n.hasOwnProperty("Y"))i[0]=parseInt(n.Y,10);else if(n.hasOwnProperty("y")){var a=parseInt(n.y,10);68>a?a=2e3+a:100>a&&(a=1900+a),i[0]=a}if(n.hasOwnProperty("m")){var l=parseInt(n.m,10);if(1>l||l>12)throw new Error("Month is out of range: "+l);i[1]=l}else n.hasOwnProperty("B")?i[1]=r(n.B,this.locale.B)+1:n.hasOwnProperty("b")&&(i[1]=r(n.b,this.locale.b)+1);if(n.hasOwnProperty("d")){var u=parseInt(n.d,10);if(1>u||u>31)throw new Error("Day is out of range: "+u);i[2]=u}var c;if(n.hasOwnProperty("H")){if(c=parseInt(n.H,10),c>23)throw new Error("Hour is out of range: "+c);i[3]=c}else if(n.hasOwnProperty("I")){if(c=parseInt(n.I,10),1>c||c>12)throw new Error("Hour is out of range: "+c);12==c&&(c=0),i[3]=c,n.hasOwnProperty("p")&&n.p==this.locale.PM&&(i[3]=i[3]+12)}if(n.hasOwnProperty("M")){var d=parseInt(n.M,10);if(d>59)throw new Error("Minute is out of range: "+d);i[4]=d}if(n.hasOwnProperty("S")){var h=parseInt(n.S,10);if(h>59)throw new Error("Second is out of range: "+h);i[5]=h}if(u=i[2],l=i[1],a=i[0],(4==l||6==l||9==l||11==l)&&u>30||2==l&&u>(a%4===0&&a%100!==0||a%400===0?29:28))throw new Error("Day is out of range: "+u);return i};var u={defaultLocale:"en",locales:{en:{name:"en",a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AM:"AM",b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],PM:"PM"}}},c=u.getLocale=function(t){if(t){if(u.locales.hasOwnProperty(t))return u.locales[t];if(t.length>2){var e=t.substring(0,2);if(u.locales.hasOwnProperty(e))return u.locales[e]}}return u.locales[u.defaultLocale]},d=u.strptime=function(t,e,i){return new n(e,c(i)).parse(t)};u.strpdate=function(t,e,i){var r=d(t,e,i);return new Date(r[0],r[1]-1,r[2],r[3],r[4],r[5])},u.strftime=function(t,e,i){if(l.test(e))throw new Error("strftime format ends with raw %");return i=c(i),e.replace(/(%.)/g,function(e,r){var n=r.charAt(1);if("undefined"==typeof a[n])throw new Error("strftime format contains an unknown directive: "+r);return a[n](t,i)})},e.exports=u},{"./is":84}],87:[function(t,e){"use strict";function i(t){for(var e=i.options,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[e.key[o]]=r[o]||"";return n[e.q.name]={},n[e.key[12]].replace(e.q.parser,function(t,i,r){i&&(n[e.q.name][i]=r)}),n}function r(t){var e="";t.protocol&&(e+=t.protocol+"://"),t.user&&(e+=t.user),t.password&&(e+=":"+t.password),(t.user||t.password)&&(e+="@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path);var i=t.queryKey,r=[];for(var n in i)if(i.hasOwnProperty(n)){var o=encodeURIComponent(i[n]);n=encodeURIComponent(n),r.push(o?n+"="+o:n)}return r.length>0&&(e+="?"+r.join("&")),t.anchor&&(e+="#"+t.anchor),e}i.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.exports={parseUri:i,makeUri:r}},{}],88:[function(t,e){"use strict";var i=t("Concur"),r=t("isomorph/format").formatObj,n=t("isomorph/is"),o=t("isomorph/object"),s="__all__",a=i.extend({constructor:function l(t,e){if(!(this instanceof l))return new l(t,e);e=o.extend({code:null,params:null},e);var i=e.code,r=e.params;t instanceof l&&(o.hasOwn(t,"errorObj")?t=t.errorObj:o.hasOwn(t,"message")?t=t.errorList:(i=t.code,r=t.params,t=t.message)),n.Object(t)?(this.errorObj={},Object.keys(t).forEach(function(e){var i=t[e];i instanceof l||(i=l(i)),this.errorObj[e]=i.errorList}.bind(this))):n.Array(t)?(this.errorList=[],t.forEach(function(t){t instanceof l||(t=l(t)),this.errorList.push.apply(this.errorList,t.errorList)}.bind(this))):(this.message=t,this.code=i,this.params=r,this.errorList=[this])}});a.prototype.messageObj=function(){if(!o.hasOwn(this,"errorObj"))throw new Error("ValidationError has no errorObj");return this.__iter__()},a.prototype.messages=function(){if(o.hasOwn(this,"errorObj")){var t=[];return Object.keys(this.errorObj).forEach(function(e){var i=this.errorObj[e];t.push.apply(t,a(i).__iter__())}.bind(this)),t}return this.__iter__()},a.prototype.__iter__=function(){if(o.hasOwn(this,"errorObj")){var t={};return Object.keys(this.errorObj).forEach(function(e){var i=this.errorObj[e];t[e]=a(i).__iter__()}.bind(this)),t}return this.errorList.map(function(t){var e=t.message;return t.params&&(e=r(e,t.params)),e})},a.prototype.updateErrorObj=function(t){if(o.hasOwn(this,"errorObj"))t?Object.keys(this.errorObj).forEach(function(e){o.hasOwn(t,e)||(t[e]=[]);var i=t[e];i.push.apply(i,this.errorObj[e])}.bind(this)):t=this.errorObj;else{o.hasOwn(t,s)||(t[s]=[]);var e=t[s];e.push.apply(e,this.errorList)}return t},a.prototype.toString=function(){return"ValidationError("+JSON.stringify(this.__iter__())+")"},e.exports={ValidationError:a}},{Concur:79,"isomorph/format":83,"isomorph/is":84,"isomorph/object":85}],89:[function(t,e){"use strict";e.exports=t("./validators")},{"./validators":91}],90:[function(t,e){"use strict";function i(t,e){e=c.extend({unpackIPv4:!1,errorMessage:"This is not a valid IPv6 address."},e);var i=-1,a=0,l=-1,u=0;if(!o(t))throw h(e.errorMessage,{code:"invalid"});if(t=s(t),t=r(t),e.unpackIPv4){var d=n(t);if(d)return d}for(var p=t.split(":"),f=0,m=p.length;m>f;f++)p[f]=p[f].replace(/^0+/,""),""===p[f]&&(p[f]="0"),"0"==p[f]?(u+=1,-1==l&&(l=f),u>a&&(a=u,i=l)):(u=0,l=-1);if(a>1){var g=i+a;g==p.length&&p.push(""),p.splice(i,a,""),0===i&&p.unshift("")}return p.join(":").toLowerCase()}function r(t){if(0!==t.toLowerCase().indexOf("0000:0000:0000:0000:0000:ffff:"))return t;var e=t.split(":");if(-1!=e[e.length-1].indexOf("."))return t;var i=[parseInt(e[6].substring(0,2),16),parseInt(e[6].substring(2,4),16),parseInt(e[7].substring(0,2),16),parseInt(e[7].substring(2,4),16)].join(".");return e.slice(0,6).join(":")+":"+i}function n(t){if(0!==t.toLowerCase().indexOf("0000:0000:0000:0000:0000:ffff:"))return null;var e=t.split(":");return e.pop()}function o(e){var i=t("./validators").validateIPv4Address;if(-1==e.indexOf(":"))return!1;if(u(e,"::")>1)return!1;if(-1!=e.indexOf(":::"))return!1;if(":"==e.charAt(0)&&":"!=e.charAt(1)||":"==e.charAt(e.length-1)&&":"!=e.charAt(e.length-2))return!1;if(u(e,":")>7)return!1;if(-1==e.indexOf("::")&&7!=u(e,":")&&3!=u(e,"."))return!1;e=s(e);for(var r,n=e.split(":"),o=0,a=n.length;a>o;o++)if(r=n[o],3==u(r,".")){if(e.split(":").pop()!=r)return!1;try{i(r)}catch(l){if(!(l instanceof h))throw l;return!1}}else{if(!p.test(r))return!1;var c=parseInt(r,16);if(isNaN(c)||0>c||c>65535)return!1}return!0}function s(t){if(!a(t))return t;var e=[],i=t.split("::"),r=-1!=t.split(":").pop().indexOf(".")?7:8;if(i.length>1){var n=i[0].split(":").length+i[1].split(":").length;e=i[0].split(":");for(var o=0,s=r-n;s>o;o++)e.push("0000");e=e.concat(i[1].split(":"))}else e=t.split(":");var u=[];for(o=0,s=e.length;s>o;o++)u.push(l(e[o],4)+e[o].toLowerCase());return u.join(":")}function a(t){if(1==u(t,"::"))return!0;for(var e=t.split(":"),i=0,r=e.length;r>i;i++)if(e[i].length<4)return!0;return!1}function l(t,e){return t.length>=e?"":new Array(e-t.length+1).join("0")}function u(t,e){return t.split(e).length-1}var c=t("isomorph/object"),d=t("./errors"),h=d.ValidationError,p=/^[0-9a-f]+$/;e.exports={cleanIPv6Address:i,isValidIPv6Address:o}},{"./errors":88,"./validators":91,"isomorph/object":85}],91:[function(t,e){"use strict";function i(t,e,i){var r=t.split(e);return i?[r.slice(0,-i).join(e)].concat(r.slice(-i)):r}function r(t){if(!f(t))throw p("Enter a valid IPv6 address.",{code:"invalid"})}function n(t){try{b(t)}catch(e){if(!(e instanceof p))throw e;try{r(t)}catch(e){if(!(e instanceof p))throw e;throw p("Enter a valid IPv4 or IPv6 address.",{code:"invalid"})}}}function o(t,e){if("both"!=t&&e)throw new Error('You can only use unpackIPv4 if protocol is set to "both"');if(t=t.toLowerCase(),"undefined"==typeof C[t])throw new Error('The protocol "'+t+'" is unknown');return C[t]}var s=t("Concur"),a=t("isomorph/is"),l=t("isomorph/object"),u=t("punycode"),c=t("isomorph/url"),d=t("./errors"),h=t("./ipv6"),p=d.ValidationError,f=h.isValidIPv6Address,m=[null,void 0,""],g=s.extend({constructor:function(t){return this instanceof g?(t=l.extend({regex:null,message:null,code:null,inverseMatch:null},t),t.regex&&(this.regex=t.regex),t.message&&(this.message=t.message),t.code&&(this.code=t.code),t.inverseMatch&&(this.inverseMatch=t.inverseMatch),a.String(this.regex)&&(this.regex=new RegExp(this.regex)),this.__call__.bind(this)):new g(t)},regex:"",message:"Enter a valid value.",code:"invalid",inverseMatch:!1,__call__:function(t){if(this.inverseMatch===this.regex.test(""+t))throw p(this.message,{code:this.code})}}),v=g.extend({regex:new RegExp("^(?:[a-z0-9\\.\\-]*)://(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+(?:[A-Z]{2,6}\\.?|[A-Z0-9-]{2,}\\.?)|localhost|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|\\[?[A-F0-9]*:[A-F0-9:]+\\]?)(?::\\d+)?(?:/?|[/?]\\S+)$","i"),message:"Enter a valid URL.",schemes:["http","https","ftp","ftps"],constructor:function(t){return this instanceof v?(t=l.extend({schemes:null},t),g.call(this,t),null!==t.schemes&&(this.schemes=t.schemes),this.__call__.bind(this)):new v(t)},__call__:function(t){t=""+t;var e=t.split("://")[0].toLowerCase();if(-1===this.schemes.indexOf(e))throw p(this.message,{code:this.code});try{g.prototype.__call__.call(this,t)}catch(i){if(!(i instanceof p))throw i;var r=c.parseUri(t);try{r.host=u.toASCII(r.host)}catch(n){throw i}t=c.makeUri(r),g.prototype.__call__.call(this,t)}}}),y=s.extend({message:"Enter a valid email address.",code:"invalid",userRegex:new RegExp("(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$|^\"([\\001-\\010\\013\\014\\016-\\037!#-\\[\\]-\\177]|\\\\[\\001-\\011\\013\\014\\016-\\177])*\"$)","i"),domainRegex:new RegExp("^(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,})$|^\\[(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\]$","i"),domainWhitelist:["localhost"],constructor:function(t){return this instanceof y?(t=l.extend({message:null,code:null,whitelist:null},t),null!==t.message&&(this.message=t.message),null!==t.code&&(this.code=t.code),null!==t.whitelist&&(this.domainWhitelist=t.whitelist),this.__call__.bind(this)):new y(t)},__call__:function(t){if(t=""+t,!t||-1==t.indexOf("@"))throw p(this.message,{code:this.code});var e=i(t,"@",1),r=e[0],n=e[1];if(!this.userRegex.test(r))throw p(this.message,{code:this.code});if(-1==this.domainWhitelist.indexOf(n)&&!this.domainRegex.test(n)){try{if(n=u.toASCII(n),this.domainRegex.test(n))return}catch(o){}throw p(this.message,{code:this.code})}}}),x=y(),w=/^[-a-zA-Z0-9_]+$/,F=g({regex:w,message:'Enter a valid "slug" consisting of letters, numbers, underscores or hyphens.',code:"invalid"}),_=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,b=g({regex:_,message:"Enter a valid IPv4 address.",code:"invalid"}),C={both:{validators:[n],message:"Enter a valid IPv4 or IPv6 address."},ipv4:{validators:[b],message:"Enter a valid IPv4 address."},ipv6:{validators:[r],message:"Enter a valid IPv6 address."}},E=/^[\d,]+$/,I=g({regex:E,message:"Enter only digits separated by commas.",code:"invalid"}),T=s.extend({constructor:function(t){return this instanceof T?(this.limitValue=t,this.__call__.bind(this)):new T(t)},compare:function(t,e){return t!==e},clean:function(t){return t},message:"Ensure this value is {limitValue} (it is {showValue}).",code:"limitValue",__call__:function(t){var e=this.clean(t),i={limitValue:this.limitValue,showValue:e};if(this.compare(e,this.limitValue))throw p(this.message,{code:this.code,params:i})}}),M=T.extend({constructor:function(t){return this instanceof M?T.call(this,t):new M(t)},compare:function(t,e){return t>e},message:"Ensure this value is less than or equal to {limitValue}.",code:"maxValue"}),V=T.extend({constructor:function(t){return this instanceof V?T.call(this,t):new V(t)},compare:function(t,e){return e>t},message:"Ensure this value is greater than or equal to {limitValue}.",code:"minValue"}),O=T.extend({constructor:function(t){return this instanceof O?T.call(this,t):new O(t)},compare:function(t,e){return e>t},clean:function(t){return t.length},message:"Ensure this value has at least {limitValue} characters (it has {showValue}).",code:"minLength"}),D=T.extend({constructor:function(t){return this instanceof D?T.call(this,t):new D(t)},compare:function(t,e){return t>e},clean:function(t){return t.length},message:"Ensure this value has at most {limitValue} characters (it has {showValue}).",code:"maxLength"});e.exports={EMPTY_VALUES:m,RegexValidator:g,URLValidator:v,EmailValidator:y,validateEmail:x,validateSlug:F,validateIPv4Address:b,validateIPv6Address:r,validateIPv46Address:n,ipAddressValidators:o,validateCommaSeparatedIntegerList:I,BaseValidator:T,MaxValueValidator:M,MinValueValidator:V,MaxLengthValidator:D,MinLengthValidator:O,ValidationError:p,ipv6:h}},{"./errors":88,"./ipv6":90,Concur:79,"isomorph/is":84,"isomorph/object":85,"isomorph/url":87,punycode:80}]},{},[1])(1)}); \ No newline at end of file +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.forms=t()}}(function(){var t;return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a=this.choices.length)throw new Error("Index out of bounds: "+t);return this.choiceInputConstructor(this.name,this.value,o.extend({},this.attrs),this.controlled,this.choices[t],t)},s.prototype.render=function(){for(var t=o.get(this.attrs,"id",null),e=o.pop(this.attrs,"key",null),r=[],n=0,l=this.choices.length;nthis.maxDigits)throw s(this.errorMessages.maxDigits,{code:"maxDigits",params:{max:this.maxDigits}});if(null!==this.decimalPlaces&&o>this.decimalPlaces)throw s(this.errorMessages.maxDecimalPlaces,{code:"maxDecimalPlaces",params:{max:this.decimalPlaces}});if(null!==this.maxDigits&&null!==this.decimalPlaces&&n>this.maxDigits-this.decimalPlaces)throw s(this.errorMessages.maxWholeDigits,{code:"maxWholeDigits",params:{max:this.maxDigits-this.decimalPlaces}});return"."==t.charAt(0)&&(t="0"+t),e&&(t="-"+t),this.runValidators(parseFloat(t)),t},c.prototype.getWidgetAttrs=function(t){var e=o.prototype.getWidgetAttrs.call(this,t);if(!n.hasOwn(t.attrs,"step")){var r="any";null!==this.decimalPlaces&&(r=0===this.decimalPlaces?"1":this.decimalPlaces<7?"0."+"000001".slice(-this.decimalPlaces):"1e-"+this.decimalPlaces),n.setDefault(e,"step",r)}return e},e.exports=c},{"./Field":26,"./IntegerField":39,"./util":78,"isomorph/object":91,validators:127}],21:[function(t,e,r){"use strict";function n(t){var e=[];Object.keys(t).forEach(function(r){t[r]instanceof a&&(e.push([r,t[r]]),delete t[r])}),e.sort(function(t,e){return t[1].creationCounter-e[1].creationCounter}),t.declaredFields=o.fromItems(e);var r={};if(o.hasOwn(this,"declaredFields")&&o.extend(r,this.declaredFields),o.hasOwn(t,"__mixins__")){var n=t.__mixins__;i.Array(n)||(n=[n]);for(var s=0,l=n.length;s0},l.prototype.first=function(){if(this.data.length>0){var t=this.data[0];return t instanceof s&&(t=t.messages()[0]),t}},l.prototype.messages=function(){for(var t=[],e=0,r=this.data.length;e0},s.prototype.render=function(t){return this.asUl(t)},s.prototype.asUl=function(t){t=i.extend({className:"errorlist"},t);var e=Object.keys(this.errors).map(function(t){return o.createElement("li",null,t,this.errors[t].asUl())}.bind(this));if(0!==e.length)return o.createElement("ul",{className:t.className},e)},s.prototype.asText=s.prototype.toString=function(){return Object.keys(this.errors).map(function(t){var e=this.errors[t].messages();return["* "+t].concat(e.map(function(t){return" * "+t})).join("\n")}.bind(this)).join("\n")},s.prototype.asData=function(){var t={};return Object.keys(this.errors).map(function(e){t[e]=this.errors[e].asData()}.bind(this)),t},s.prototype.toJSON=function(){var t={};return Object.keys(this.errors).map(function(e){t[e]=this.errors[e].toJSON()}.bind(this)),t},s.prototype.fromJSON=function(t,e){e=e||a,this.errors={};for(var r=Object.keys(t),n=0,i=r.length;n=0;n--)r.push(o.get(this.constructor.__mro__[n].prototype,"defaultErrorMessages",null));r.push(t.errorMessages),this.errorMessages=o.extend.apply(o,r),this.validators=this.defaultValidators.concat(t.validators)}});f.creationCounter=0,f.prototype.prepareValue=function(t){return t},f.prototype.toJavaScript=function(t){return t},f.prototype.isEmptyValue=function(t){return this.emptyValues.indexOf(t)!=-1||this.emptyValueArray===!0&&i.Array(t)&&0===t.length},f.prototype.validate=function(t){if(this.required&&this.isEmptyValue(t))throw d(this.errorMessages.required,{code:"required"})},f.prototype.runValidators=function(t){if(!this.isEmptyValue(t)){for(var e=[],r=0,n=this.validators.length;r0)throw d(e)}},f.prototype.clean=function(t){return t=this.toJavaScript(t),this.validate(t),this.runValidators(t),t},f.prototype.boundData=function(t,e){return t},f.prototype.getWidgetAttrs=function(t){return o.extend({},this.widgetAttrs)},f.prototype._hasChanged=function(t,e){var r=null===t?"":t;try{e=this.toJavaScript(e),"function"==typeof this._coerce&&(e=this._coerce(e))}catch(n){if(!(n instanceof d))throw n;return!0}var i=null===e?"":e;return""+r!=""+i},e.exports=f},{"./HiddenInput":35,"./TextInput":64,"./Widget":72,"./util":78,Concur:79,"isomorph/is":90,"isomorph/object":91,validators:127}],27:[function(t,e,r){"use strict";var n=t("isomorph/is"),i=t("isomorph/object"),o=t("./env"),a=t("./ClearableFileInput"),s=t("./Field"),l=t("validators"),u=l.ValidationError,c=s.extend({widget:a,defaultErrorMessages:{invalid:"No file was submitted. Check the encoding type on the form.",missing:"No file was submitted.",empty:"The submitted file is empty.",maxLength:"Ensure this filename has at most {max} characters (it has {length}).",contradiction:"Please either submit a file or check the clear checkbox, not both."},constructor:function d(t){return this instanceof d?(t=i.extend({maxLength:null,allowEmptyFile:!1},t),this.maxLength=t.maxLength,this.allowEmptyFile=t.allowEmptyFile,delete t.maxLength,void s.call(this,t)):new d(t)}});c.prototype.toJavaScript=function(t,e){if(this.isEmptyValue(t))return null;if(o.browser&&n.String(t))return t;if("undefined"==typeof t.name||"undefined"==typeof t.size)throw u(this.errorMessages.invalid,{code:"invalid"});var r=t.name,i=Number(t.size);if(null!==this.maxLength&&r.length>this.maxLength)throw u(this.errorMessages.maxLength,{code:"maxLength",params:{max:this.maxLength,length:r.length}});if(!r)throw u(this.errorMessages.invalid,{code:"invalid"});if(!this.allowEmptyFile&&0===i)throw u(this.errorMessages.empty,{code:"empty"});return t},c.prototype.clean=function(t,e){if(t===a.FILE_INPUT_CONTRADICTION)throw u(this.errorMessages.contradiction,{code:"contradiction"});if(t===!1){if(!this.required)return!1;t=null}return!t&&e?e:s.prototype.clean.call(this,t)},c.prototype.boundData=function(t,e){return null===t||t===a.FILE_INPUT_CONTRADICTION?e:t},c.prototype._hasChanged=function(t,e){return null!==e},e.exports=c},{"./ClearableFileInput":13,"./Field":26,"./env":74,"isomorph/is":90,"isomorph/object":91,validators:127}],28:[function(t,e,r){"use strict";var n=t("isomorph/object"),i=t("./Input"),o=t("./env"),a=i.extend({constructor:function s(t){return this instanceof s?void i.call(this,t):new s(t)},inputType:"file",needsMultipartForm:!0,validation:{onChange:!0},isValueSettable:!1});a.prototype.render=function(t,e,r){return i.prototype.render.call(this,t,null,r)},a.prototype.valueFromData=function(t,e,r){var i=e;return!o.browser||r in e||(i=t),n.get(i,r,null)},e.exports=a},{"./Input":38,"./env":74,"isomorph/object":91}],29:[function(t,e,r){"use strict";var n=t("isomorph/object"),i=t("./ChoiceField"),o=i.extend({constructor:function a(t,e){return this instanceof a?(e=n.extend({match:null,recursive:!1,required:!0,widget:null,label:null,initial:null,helpText:null,allowFiles:!0,allowFolders:!1},e),this.path=t,this.match=n.pop(e,"match"),this.recursive=n.pop(e,"recursive"),this.allowFiles=n.pop(e,"allowFiles"),this.allowFolders=n.pop(e,"allowFolders"),delete e.match,delete e.recursive,e.choices=[],i.call(this,e),this.required?this.setChoices([]):this.setChoices([["","---------"]]),null!==this.match&&(this.matchRE=new RegExp(this.match)),void(this.widget.choices=this.choices())):new a(t,e)}});e.exports=o},{"./ChoiceField":10,"isomorph/object":91}],30:[function(t,e,r){"use strict";var n=t("isomorph/object"),i=t("./Field"),o=t("./IntegerField"),a=t("validators"),s=a.ValidationError,l=t("./util"),u=l.strip,c=o.extend({defaultErrorMessages:{invalid:"Enter a number."},constructor:function d(t){return this instanceof d?void o.call(this,t):new d(t)}});c.FLOAT_REGEXP=/^[-+]?(?:\d+(?:\.\d*)?|(?:\d+)?\.\d+)$/,c.prototype.toJavaScript=function(t){if(t=i.prototype.toJavaScript.call(this,t),this.isEmptyValue(t))return null;if(t=u(t),!c.FLOAT_REGEXP.test(t))throw s(this.errorMessages.invalid,{code:"invalid"});if(t=parseFloat(t),isNaN(t))throw s(this.errorMessages.invalid,{code:"invalid"});return t},c.prototype._hasChanged=function(t,e){var r=null===e?"":e,n=null===t?"":t;return n!==r&&(""===n||""===r||parseFloat(""+n)!=parseFloat(""+r))},c.prototype.getWidgetAttrs=function(t){var e=o.prototype.getWidgetAttrs.call(this,t);return n.hasOwn(t.attrs,"step")||n.setDefault(e,"step","any"),e},e.exports=c},{"./Field":26,"./IntegerField":39,"./util":78,"isomorph/object":91,validators:127}],31:[function(t,e,r){"use strict";function n(){}function i(t,e){if(c.Array(t)&&c.Array(e)){if(t.length!=e.length)return!0;for(var r=0,n=t.length;r=0;l--)a[s[l]]&&r.splice(l,1);else{if(t!==I&&!d.hasOwn(this.fields,t))throw new Error(this._formName()+" has no field named '"+t+"'");this._errors.set(t,new this.errorConstructor)}r.length>0&&this._errors.get(t).extend(r),d.hasOwn(this.cleanedData,t)&&delete this.cleanedData[t]}},O.prototype.errors=function(t){return null==this._errors&&this.fullClean(),t?this._errors.get(t):this._errors},O.prototype.nonFieldErrors=function(){return this.errors(I)||new this.errorConstructor},O.prototype.setErrors=function(t){this._errors=t,this._stateChanged()},O.prototype._removeErrors=function(t){null==this._errors?this._errors=v():(this._errors.remove(I),this._errors.removeAll(t))},O.prototype.changedData=function(t){for(var e,r=[],n=Object.keys(this.fields),i=0,o=n.length;ithis.maxNum||!d.browser&&this.managementForm().cleanedData[j]>this.absoluteMax)throw b("Please submit "+this.maxNum+" or fewer forms.",{code:"tooManyForms"});if(this.validateMin&&r-ithis.maxNum&&this.maxNum>=0&&(e=t),null!==this.maxNum&&e>this.maxNum&&this.maxNum>=0&&(e=this.maxNum),e}return Math.min(this.managementForm().cleanedData[j],this.absoluteMax)},R.prototype.initialFormCount=function(){return d.browser||this.isInitialRender?null!==this.initial&&this.initial.length>0?this.initial.length:0:this.managementForm().cleanedData[C]},R.prototype.forms=function(){if(null!==this._forms)return this._forms;for(var t=[],e=this.totalFormCount(),r=0;r0&&"undefined"!=typeof this.initial[t]&&(e.initial=this.initial[t]),t>=this.initialFormCount()&&(e.emptyPermitted=!0);var r=new this.form(e);return this.addFields(r,t),r},R.prototype.initialForms=function(){return this.forms().slice(0,this.initialFormCount())},R.prototype.extraForms=function(){return this.forms().slice(this.initialFormCount())},R.prototype.emptyForm=function(){var t={autoId:this.autoId,prefix:this.addPrefix("__prefix__"),emptyPermitted:!0},e=new this.form(t);return this.addFields(e,null),e},R.prototype.deletedForms=function(){if(!this.isValid()||!this.canDelete)return[];var t=this.forms();if("undefined"==typeof this._deletedFormIndexes){this._deletedFormIndexes=[];for(var e=0,r=t.length;e=this.initialFormCount()&&!n.hasChanged()||this._shouldDeleteForm(n)&&this._deletedFormIndexes.push(e)}}return this._deletedFormIndexes.map(function(e){return t[e]})},R.prototype.orderedForms=function(){if(!this.isValid()||!this.canOrder)throw new Error(this.constructor.name+" object has no attribute 'orderedForms'");var t=this.forms();if("undefined"==typeof this._ordering){this._ordering=[];for(var e=0,r=t.length;e=this.initialFormCount()&&!n.hasChanged()||this.canDelete&&this._shouldDeleteForm(n)||this._ordering.push([e,n.cleanedData[O]])}this._ordering.sort(function(t,e){return null===t[1]&&null===e[1]?t[0]-e[0]:null===t[1]?1:null===e[1]?-1:t[1]-e[1]})}return this._ordering.map(function(e){return t[e[0]]})},R.prototype.addFields=function(t,e){this.canOrder&&(null!=e&&e0&&this.forms()[0].isMultipart()},R.prototype.isPending=function(){return!a.Empty(this._pendingAsyncValidation)},R.prototype.isValid=function(){if(this.isInitialRender)return!1;for(var t=this.errors(),e=this.forms(),r=0,n=t.length;rthis.maxLength)throw u(this.errorMessages.maxLength,{code:"maxLength",params:{max:this.maxLength,name:s,length:s.length}});if(!s)throw u(this.errorMessages.invalid,{code:"invalid"});if(!this.allowEmptyFile&&0===l)throw u(this.errorMessages.empty,{code:"empty",params:{name:s}})}return t},c.prototype.clean=function(t,e){return this.isEmptyValue(t)&&!this.isEmptyValue(e)?e:o.prototype.clean.call(this,t)},c.prototype.validate=function(t){if(this.required&&!t.length)throw u(this.errorMessages.required,{code:"required"})},c.prototype._hasChanged=function(t,e){return!this.isEmptyValue(e)},e.exports=c},{"./Field":26,"./FileField":27,"./FileInput":28,"./env":74,"isomorph/is":90,validators:127}],44:[function(t,e,r){"use strict";var n=t("isomorph/object"),i="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,o=t("./HiddenInput"),a=o.extend({constructor:function s(t){return this instanceof s?void o.call(this,t):new s(t)}});a.prototype.render=function(t,e,r){r=n.extend({attrs:null},r),null===e&&(e=[]);for(var o=this.buildAttrs(r.attrs,{type:this.inputType,name:t}),a=n.get(o,"id",null),s=n.get(o,"key",null),l=[],u=0,c=e.length;u0&&i.createElement(r.row,{className:e.hiddenFieldRowCssClass,component:r.rowComponent,content:a,hidden:!0,key:e.addPrefix("__hidden__")}))}});e.exports=g},{"./ErrorObject":25,"./Form":31,"./FormRow":32,"./ProgressMixin":49,"./constants":73,"./util":78,"create-react-class":82,"isomorph/object":91,"prop-types":99}],55:[function(t,e,r){"use strict";var n=t("isomorph/object"),i="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,o=t("prop-types"),a=t("create-react-class"),s=t("./FormRow"),l=t("./FormSet"),u=t("./ProgressMixin"),c=t("./RenderForm"),d=t("./constants"),p=d.NON_FIELD_ERRORS,h=t("./util"),f=h.autoIdChecker,m=h.getProps,v={canDelete:o.bool,canOrder:o.bool,extra:o.number,form:o.func,maxNum:o.number,minNum:o.number,validateMax:o.bool,validateMin:o.bool,autoId:f,controlled:o.bool,data:o.object,errorConstructor:o.func,files:o.object,initial:o.object,onChange:o.func,prefix:o.string,validation:o.oneOfType([o.string,o.object])},g=a({mixins:[u],propTypes:n.extend({},v,{className:o.string,component:o.any,formComponent:o.any,formset:o.oneOfType([o.func,o.instanceOf(l)]),row:o.any,rowComponent:o.any,useManagementForm:o.bool,__all__:function(t){if(!t.form&&!t.formset)return new Error("Invalid props supplied to `RenderFormSet`, either `form` or `formset` must be specified.")}}),getDefaultProps:function(){return{component:"div",formComponent:"div",formset:l,row:s,rowComponent:"div",useManagementForm:!1}},componentWillMount:function(){this.props.formset instanceof l?this.formset=this.props.formset:this.formset=new this.props.formset(n.extend({onChange:this.forceUpdate.bind(this)},m(this.props,Object.keys(v))))},getFormset:function(){return this.formset},render:function(){var t=this,e=t.formset,r=t.props,n={};this.props.className&&(n.className=r.className);var o=e.nonFormErrors();return i.createElement(r.component,i.__spread({},n),o.isPopulated()&&i.createElement(r.row,{className:e.errorCssClass,content:o.render(),key:e.addPrefix(p),rowComponent:r.rowComponent}),e.forms().map(function(t){return i.createElement(c,{form:t,formComponent:r.formComponent,progress:r.progress,row:r.row,rowComponent:r.rowComponent})}),e.nonFormPending()&&i.createElement(r.row,{className:e.pendingRowCssClass,content:this.renderProgress(),key:e.addPrefix("__pending__"),rowComponent:r.rowComponent}),r.useManagementForm&&i.createElement(c,{form:e.managementForm(),formComponent:r.formComponent,row:r.row,rowComponent:r.rowComponent}))}});e.exports=g},{"./FormRow":32,"./FormSet":33,"./ProgressMixin":49,"./RenderForm":54,"./constants":73,"./util":78,"create-react-class":82,"isomorph/object":91,"prop-types":99}],56:[function(t,e,r){"use strict";var n=t("Concur"),i=t("isomorph/object"),o=n.extend({constructor:function(t){t=i.extend({renderer:null},t),null!==t.renderer&&(this.renderer=t.renderer)},_emptyValue:null,validation:{onChange:!0}});o.prototype.subWidgets=function(t,e,r){return this.getRenderer(t,e,r).choiceInputs()},o.prototype.getRenderer=function(t,e,r){r=i.extend({choices:[],controlled:!1},r),null===e&&(e=this._emptyValue);var n=this.buildAttrs(r.attrs),o=this.choices.concat(r.choices);return new this.renderer(t,e,n,r.controlled,o)},o.prototype.render=function(t,e,r){return this.getRenderer(t,e,r).render()},o.prototype.idForLabel=function(t){return t&&(t+="_0"),t},e.exports=o},{Concur:79,"isomorph/object":91}],57:[function(t,e,r){"use strict";var n=t("isomorph/is"),i=t("isomorph/object"),o="undefined"!=typeof window?window.React:"undefined"!=typeof global?global.React:null,a=t("./Widget"),s=t("./util"),l=s.normaliseChoices,u=a.extend({constructor:function c(t){return this instanceof c?(t=i.extend({choices:[]},t),a.call(this,t),void(this.choices=l(t.choices))):new c(t)},allowMultipleSelected:!1,validation:{onChange:!0}});u.prototype.render=function(t,e,r){r=i.extend({choices:[]},r),null===e&&(e="");var n=this.buildAttrs(r.attrs,{name:t}),a=this.renderOptions(r.choices),s=r.controlled?"value":"defaultValue";return n[s]=e,o.createElement("select",n,a)},u.prototype.renderOptions=function(t){for(var e,r=[],i=this.choices.concat(l(t)),a=0,s=i.length;a0){var e=t[0],r=t[1];if(this.isEmptyValue(e))throw d(this.errorMessages.invalidDate,{code:"invalidDate"});if(this.isEmptyValue(r))throw d(this.errorMessages.invalidTime,{code:"invalidTime"});return new Date(e.getFullYear(),e.getMonth(),e.getDate(),r.getHours(),r.getMinutes(),r.getSeconds())}return null},e.exports=p},{"./DateField":15,"./MultiValueField":40,"./SplitDateTimeWidget":61,"./SplitHiddenDateTimeWidget":62,"./TimeField":66,"isomorph/is":90,"isomorph/object":91,validators:127}],61:[function(t,e,r){"use strict";var n=t("isomorph/object"),i=t("./DateInput"),o=t("./MultiWidget"),a=t("./TimeInput"),s=o.extend({constructor:function l(t){if(!(this instanceof l))return new l(t);t=n.extend({dateFormat:null,timeFormat:null},t);var e=[i({attrs:t.attrs,format:t.dateFormat}),a({attrs:t.attrs,format:t.timeFormat})];o.call(this,e,t.attrs)}});s.prototype.decompress=function(t){return t?[new Date(t.getFullYear(),t.getMonth(),t.getDate()),new Date(1900,0,1,t.getHours(),t.getMinutes(),t.getSeconds())]:[null,null]},e.exports=s},{"./DateInput":16,"./MultiWidget":41,"./TimeInput":67,"isomorph/object":91}],62:[function(t,e,r){"use strict";var n=t("./SplitDateTimeWidget"),i=n.extend({constructor:function o(t){if(!(this instanceof o))return new o(t);n.call(this,t);for(var e=0,r=this.widgets.length;e=55296&&e<=56319&&i65535&&(t-=65536,e+=V(t>>>10&1023|55296),t=56320|1023&t),e+=V(t)}).join("")}function u(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:_}function c(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function d(t,e,r){var n=0;for(t=r?S(t/I):t>>1,t+=S(t/e);t>A*C>>1;n+=_)t=S(t/A);return S(n+(A+1)*t/(t+E))}function p(t){var e,r,n,o,a,s,c,p,h,f,m=[],v=t.length,g=0,y=j,b=O;for(r=t.lastIndexOf(D),r<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(o=r>0?r+1:0;o=v&&i("invalid-input"),p=u(t.charCodeAt(o++)),(p>=_||p>S((w-g)/s))&&i("overflow"),g+=p*s,h=c<=b?F:c>=b+C?C:c-b,!(pS(w/f)&&i("overflow"),s*=f;e=m.length+1,b=d(g-a,e,0==a),S(g/e)>w-y&&i("overflow"),y+=S(g/e),g%=e,m.splice(g++,0,y)}return l(m)}function h(t){var e,r,n,o,a,l,u,p,h,f,m,v,g,y,b,x=[];for(t=s(t),v=t.length,e=j,r=0,a=O,l=0;l=e&&mS((w-r)/g)&&i("overflow"),r+=(u-e)*g,e=u,l=0;lw&&i("overflow"),m==e){for(p=r,h=_;f=h<=a?F:h>=a+C?C:h-a,!(p= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=_-F,S=Math.floor,V=String.fromCharCode;if(b={version:"1.2.4",ucs2:{decode:s,encode:l},decode:p,encode:h,toASCII:m,toUnicode:f},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return b});else if(v&&!v.nodeType)if(g)g.exports=b;else for(x in b)b.hasOwnProperty(x)&&(v[x]=b[x]);else e.punycode=b}(this)},{}],81:[function(t,e,r){"use strict";function n(t){return t}function i(t,e,r){function i(t,e){var r=y.hasOwnProperty(e)?y[e]:null;_.hasOwnProperty(e)&&l("OVERRIDE_BASE"===r,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",e),t&&l("DEFINE_MANY"===r||"DEFINE_MANY_MERGED"===r,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",e)}function o(t,r){if(r){l("function"!=typeof r,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),l(!e(r),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var n=t.prototype,o=n.__reactAutoBindPairs;r.hasOwnProperty(u)&&b.mixins(t,r.mixins);for(var a in r)if(r.hasOwnProperty(a)&&a!==u){var s=r[a],c=n.hasOwnProperty(a);if(i(c,a),b.hasOwnProperty(a))b[a](t,s);else{var d=y.hasOwnProperty(a),f="function"==typeof s,m=f&&!d&&!c&&r.autobind!==!1;if(m)o.push(a,s),n[a]=s;else if(c){var v=y[a];l(d&&("DEFINE_MANY_MERGED"===v||"DEFINE_MANY"===v),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",v,a),"DEFINE_MANY_MERGED"===v?n[a]=p(n[a],s):"DEFINE_MANY"===v&&(n[a]=h(n[a],s))}else n[a]=s}}}else;}function c(t,e){if(e)for(var r in e){var n=e[r];if(e.hasOwnProperty(r)){var i=r in b;l(!i,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',r);var o=r in t;l(!o,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",r),t[r]=n}}}function d(t,e){l(t&&e&&"object"==typeof t&&"object"==typeof e,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var r in e)e.hasOwnProperty(r)&&(l(void 0===t[r],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",r),t[r]=e[r]);return t}function p(t,e){return function(){var r=t.apply(this,arguments),n=e.apply(this,arguments);if(null==r)return n;if(null==n)return r;var i={};return d(i,r),d(i,n),i}}function h(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function f(t,e){var r=e.bind(t);return r}function m(t){for(var e=t.__reactAutoBindPairs,r=0;r0?i:null}function o(t,e){var r=null,n=t.type;if("select-one"===n)return t.options.length&&(r=t.options[t.selectedIndex].value),r;if("select-multiple"===n){r=[];for(var i=0,o=t.options.length;ithis.maxDepth)throw new Error("Exceeded max recursion depth in deep copy.");return t.populate(this.recursiveDeepCopy,e,r),this.depth--,r}},l.DeepCopier=a,l.deepCopiers=f,l.register=function(t){t instanceof a||(t=new a(t)),f.unshift(t)},l.register({canCopy:function(t){return!0},create:function(t){return t instanceof t.constructor?i(t.constructor.prototype):{}},populate:function(t,e,r){for(var n in e)u.call(e,n)&&(r[n]=t(e[n]));return r}}),l.register({canCopy:function(t){return p[d(t)]},create:function(t){return new t.constructor(t.valueOf())},populate:function(t,e,r){var n="string"!=d(e);for(var i in e)!u.call(e,i)||!n&&h.test(i)||(r[i]=t(e[i]));return r}}),l.register({canCopy:function(t){return"regexp"==d(t)},create:function(t){return t}}),l.register({canCopy:function(t){return"date"==d(t)},create:function(t){return new Date(t)}}),l.register({canCopy:function(t){return"array"==d(t)},create:function(t){return new t.constructor},populate:function(t,e,r){for(var n=0;ne&&r-1&&(n=c.charAt(r)+"B"),i.toFixed(2).replace(d,"")+" "+n}var s=Array.prototype.slice,l=/%[%s]/g,u=/({{?)(\w+)}/g,c="kMGTPEZY",d=/\.00$|0$/;e.exports={format:n,formatArr:i,formatObj:o,fileSize:a}},{}],90:[function(t,e,r){"use strict";function n(t){return"[object Array]"==h.call(t)}function i(t){return"[object Boolean]"==h.call(t)}function o(t){return"[object Date]"==h.call(t)}function a(t){return"[object Error]"==h.call(t)}function s(t){return"[object Function]"==h.call(t)}function l(t){return"[object Number]"==h.call(t)}function u(t){return"[object Object]"==h.call(t)}function c(t){return"[object RegExp]"==h.call(t)}function d(t){return"[object String]"==h.call(t)}function p(t){for(var e in t)return!1;return!0}var h=Object.prototype.toString;e.exports={Array:n,Boolean:i,Date:o,Empty:p,Error:a,Function:s,NaN:isNaN,Number:l,Object:u,RegExp:c,String:d}},{}],91:[function(t,e,r){"use strict";function n(t){for(var e,r=1,n=arguments.length;r12)throw new Error("Month is out of range: "+l);r[1]=l}else n.hasOwnProperty("B")?r[1]=i(n.B,this.locale.B)+1:n.hasOwnProperty("b")&&(r[1]=i(n.b,this.locale.b)+1);if(n.hasOwnProperty("d")){var u=parseInt(n.d,10);if(u<1||u>31)throw new Error("Day is out of range: "+u);r[2]=u}var c;if(n.hasOwnProperty("H")){if(c=parseInt(n.H,10),c>23)throw new Error("Hour is out of range: "+c);r[3]=c}else if(n.hasOwnProperty("I")){if(c=parseInt(n.I,10),c<1||c>12)throw new Error("Hour is out of range: "+c);12==c&&(c=0),r[3]=c,n.hasOwnProperty("p")&&n.p==this.locale.PM&&(r[3]=r[3]+12)}if(n.hasOwnProperty("M")){var d=parseInt(n.M,10);if(d>59)throw new Error("Minute is out of range: "+d);r[4]=d}if(n.hasOwnProperty("S")){var p=parseInt(n.S,10);if(p>59)throw new Error("Second is out of range: "+p);r[5]=p}if(u=r[2],l=r[1],s=r[0],(4==l||6==l||9==l||11==l)&&u>30||2==l&&u>(s%4===0&&s%100!==0||s%400===0?29:28))throw new Error("Day is out of range: "+u);return r};var c={defaultLocale:"en",locales:{en:{name:"en",a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AM:"AM",b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],PM:"PM"}}},d=c.getLocale=function(t){if(t){if(c.locales.hasOwnProperty(t))return c.locales[t];if(t.length>2){var e=t.substring(0,2);if(c.locales.hasOwnProperty(e))return c.locales[e]}}return c.locales[c.defaultLocale]},p=c.strptime=function(t,e,r){return new o(e,d(r)).parse(t)};c.strpdate=function(t,e,r){var n=p(t,e,r);return new Date(n[0],n[1]-1,n[2],n[3],n[4],n[5])},c.strftime=function(t,e,r){if(u.test(e))throw new Error("strftime format ends with raw %");return r=d(r),e.replace(/(%.)/g,function(e,n){var i=n.charAt(1);if("undefined"==typeof l[i])throw new Error("strftime format contains an unknown directive: "+n);return l[i](t,r)})},e.exports=c},{"./is":90}],93:[function(t,e,r){"use strict";function n(t){for(var e=n.options,r=e.parser[e.strictMode?"strict":"loose"].exec(t),i={},o=14;o--;)i[e.key[o]]=r[o]||"";return i[e.q.name]={},i[e.key[12]].replace(e.q.parser,function(t,r,n){r&&(i[e.q.name][r]=n)}),i}function i(t){var e="";t.protocol&&(e+=t.protocol+"://"),t.user&&(e+=t.user),t.password&&(e+=":"+t.password),(t.user||t.password)&&(e+="@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path);var r=t.queryKey,n=[];for(var i in r)if(r.hasOwnProperty(i)){var o=encodeURIComponent(r[i]);i=encodeURIComponent(i),o?n.push(i+"="+o):n.push(i)}return n.length>0&&(e+="?"+n.join("&")),t.anchor&&(e+="#"+t.anchor),e}n.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.exports={parseUri:n,makeUri:i}},{}],94:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function i(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var n=Object.getOwnPropertyNames(e).map(function(t){return e[t]});if("0123456789"!==n.join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(o){return!1}}var o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;e.exports=i()?Object.assign:function(t,e){for(var r,i,l=n(t),u=1;u1){for(var v=Array(m),g=0;g1){for(var b=Array(y),x=0;x.")}return e}function a(t,e){if(t._store&&!t._store.validated&&null==t.key){t._store.validated=!0;var r=f.uniqueKey||(f.uniqueKey={}),n=o(e);if(!r[n]){r[n]=!0;var i="";t&&t._owner&&t._owner!==u.current&&(i=" It was passed a child from "+t._owner.getName()+".")}}}function s(t,e){if("object"==typeof t)if(Array.isArray(t))for(var r=0;rn&&(n=u,r=l)):(u=0,l=-1);if(n>1){var v=r+n;v==p.length&&p.push(""),p.splice(r,n,""),0===r&&p.unshift("")}return p.join(":").toLowerCase()}function i(t){if(0!==t.toLowerCase().indexOf("0000:0000:0000:0000:0000:ffff:"))return t;var e=t.split(":");if(e[e.length-1].indexOf(".")!=-1)return t;var r=[parseInt(e[6].substring(0,2),16),parseInt(e[6].substring(2,4),16),parseInt(e[7].substring(0,2),16),parseInt(e[7].substring(2,4),16)].join(".");return e.slice(0,6).join(":")+":"+r}function o(t){if(0!==t.toLowerCase().indexOf("0000:0000:0000:0000:0000:ffff:"))return null;var e=t.split(":");return e.pop()}function a(e){var r=t("./validators").validateIPv4Address;if(e.indexOf(":")==-1)return!1;if(c(e,"::")>1)return!1;if(e.indexOf(":::")!=-1)return!1;if(":"==e.charAt(0)&&":"!=e.charAt(1)||":"==e.charAt(e.length-1)&&":"!=e.charAt(e.length-2))return!1;if(c(e,":")>7)return!1;if(e.indexOf("::")==-1&&7!=c(e,":")&&3!=c(e,"."))return!1;e=s(e);for(var n,i=e.split(":"),o=0,a=i.length;o65535)return!1}return!0}function s(t){if(!l(t))return t;var e=[],r=t.split("::"),n=t.split(":").pop().indexOf(".")!=-1?7:8;if(r.length>1){var i=r[0].split(":").length+r[1].split(":").length;e=r[0].split(":");for(var o=0,a=n-i;o=e?"":new Array(e-t.length+1).join("0")}function c(t,e){return t.split(e).length-1}var d=t("isomorph/object"),p=t("./errors"),h=p.ValidationError,f=/^[0-9a-f]+$/;e.exports={cleanIPv6Address:n,isValidIPv6Address:a}},{"./errors":126,"./validators":129,"isomorph/object":91}],129:[function(t,e,r){"use strict";function n(t,e,r){var n=t.split(e);return r?[n.slice(0,-r).join(e)].concat(n.slice(-r)):n}function i(t){if(!m(t))throw f("Enter a valid IPv6 address.",{code:"invalid"})}function o(t){try{C(t)}catch(e){if(!(e instanceof f))throw e;try{i(t)}catch(e){if(!(e instanceof f))throw e;throw f("Enter a valid IPv4 or IPv6 address.",{code:"invalid"})}}}function a(t,e){if("both"!=t&&e)throw new Error('You can only use unpackIPv4 if protocol is set to "both"');if(t=t.toLowerCase(),"undefined"==typeof E[t])throw new Error('The protocol "'+t+'" is unknown');return E[t]}var s=t("Concur"),l=t("isomorph/is"),u=t("isomorph/object"),c=t("punycode"),d=t("isomorph/url"),p=t("./errors"),h=t("./ipv6"),f=p.ValidationError,m=h.isValidIPv6Address,v=[null,void 0,""],g=s.extend({constructor:function(t){return this instanceof g?(t=u.extend({regex:null,message:null,code:null,inverseMatch:null},t),t.regex&&(this.regex=t.regex),t.message&&(this.message=t.message),t.code&&(this.code=t.code),t.inverseMatch&&(this.inverseMatch=t.inverseMatch),l.String(this.regex)&&(this.regex=new RegExp(this.regex)),this.__call__.bind(this)):new g(t)},regex:"",message:"Enter a valid value.",code:"invalid",inverseMatch:!1,__call__:function(t){if(this.inverseMatch===this.regex.test(""+t))throw f(this.message,{code:this.code})}}),y=g.extend({regex:new RegExp("^(?:[a-z0-9\\.\\-]*)://(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+(?:[A-Z]{2,6}\\.?|[A-Z0-9-]{2,}\\.?)|localhost|\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|\\[?[A-F0-9]*:[A-F0-9:]+\\]?)(?::\\d+)?(?:/?|[/?]\\S+)$","i"),message:"Enter a valid URL.",schemes:["http","https","ftp","ftps"],constructor:function(t){return this instanceof y?(t=u.extend({schemes:null},t),g.call(this,t),null!==t.schemes&&(this.schemes=t.schemes),this.__call__.bind(this)):new y(t)},__call__:function(t){t=""+t;var e=t.split("://")[0].toLowerCase();if(this.schemes.indexOf(e)===-1)throw f(this.message,{code:this.code});try{g.prototype.__call__.call(this,t)}catch(r){if(!(r instanceof f))throw r;var n=d.parseUri(t);try{n.host=c.toASCII(n.host)}catch(i){throw r}t=d.makeUri(n),g.prototype.__call__.call(this,t)}}}),b=s.extend({message:"Enter a valid email address.",code:"invalid",userRegex:new RegExp("(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$|^\"([\\001-\\010\\013\\014\\016-\\037!#-\\[\\]-\\177]|\\\\[\\001-\\011\\013\\014\\016-\\177])*\"$)","i"),domainRegex:new RegExp("^(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\\.)+(?:[A-Z]{2,6}|[A-Z0-9-]{2,})$|^\\[(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\]$","i"),domainWhitelist:["localhost"],constructor:function(t){return this instanceof b?(t=u.extend({message:null,code:null,whitelist:null},t),null!==t.message&&(this.message=t.message),null!==t.code&&(this.code=t.code),null!==t.whitelist&&(this.domainWhitelist=t.whitelist),this.__call__.bind(this)):new b(t)},__call__:function(t){if(t=""+t,!t||t.indexOf("@")==-1)throw f(this.message,{code:this.code});var e=n(t,"@",1),r=e[0],i=e[1];if(!this.userRegex.test(r))throw f(this.message,{code:this.code});if(this.domainWhitelist.indexOf(i)==-1&&!this.domainRegex.test(i)){try{if(i=c.toASCII(i),this.domainRegex.test(i))return}catch(o){}throw f(this.message,{code:this.code})}}}),x=b(),w=/^[-a-zA-Z0-9_]+$/,_=g({regex:w,message:'Enter a valid "slug" consisting of letters, numbers, underscores or hyphens.',code:"invalid"}),F=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/,C=g({regex:F,message:"Enter a valid IPv4 address.",code:"invalid"}),E={both:{validators:[o],message:"Enter a valid IPv4 or IPv6 address."},ipv4:{validators:[C],message:"Enter a valid IPv4 address."},ipv6:{validators:[i],message:"Enter a valid IPv6 address."}},I=/^[\d,]+$/,O=g({regex:I,message:"Enter only digits separated by commas.",code:"invalid"}),j=s.extend({constructor:function(t){return this instanceof j?(this.limitValue=t,this.__call__.bind(this)):new j(t)},compare:function(t,e){return t!==e},clean:function(t){return t},message:"Ensure this value is {limitValue} (it is {showValue}).",code:"limitValue",__call__:function(t){var e=this.clean(t),r={limitValue:this.limitValue,showValue:e};if(this.compare(e,this.limitValue))throw f(this.message,{code:this.code,params:r})}}),D=j.extend({constructor:function(t){return this instanceof D?j.call(this,t):new D(t)},compare:function(t,e){return t>e},message:"Ensure this value is less than or equal to {limitValue}.",code:"maxValue"}),M=j.extend({constructor:function(t){return this instanceof M?j.call(this,t):new M(t)},compare:function(t,e){return te},clean:function(t){return t.length},message:"Ensure this value has at most {limitValue} characters (it has {showValue}).",code:"maxLength"});e.exports={EMPTY_VALUES:v,RegexValidator:g,URLValidator:y,EmailValidator:b,validateEmail:x,validateSlug:_,validateIPv4Address:C,validateIPv6Address:i,validateIPv46Address:o,ipAddressValidators:a,validateCommaSeparatedIntegerList:O,BaseValidator:j,MaxValueValidator:D,MinValueValidator:M,MaxLengthValidator:R,MinLengthValidator:T,ValidationError:f,ipv6:h}},{"./errors":126,"./ipv6":128,Concur:79,"isomorph/is":90,"isomorph/object":91,"isomorph/url":93,punycode:80}]},{},[1])(1)}); \ No newline at end of file From 3b08d55dc6cee85a9189c36f60f7e623e0824980 Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 18:18:37 -0700 Subject: [PATCH 11/12] update package.json --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 40dcf56..feae1a0 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "newforms", + "name": "newforms-ajb", "description": "An isomorphic form-handling library for React", - "version": "0.13.2", - "author": "Jonny Buchanan ", + "version": "0.0.1", + "author": "Adam Becker ", "keywords": [ "isomorphic", "form-handling", @@ -17,7 +17,7 @@ "main": "./lib/newforms.js", "repository": { "type": "git", - "url": "http://github.com/insin/newforms.git" + "url": "http://github.com/ajb/newforms.git" }, "dependencies": { "Concur": "^0.3.0", From bcdb5b46284bbcfee712f0060087945cc75cb8a5 Mon Sep 17 00:00:00 2001 From: Adam Becker Date: Wed, 30 Aug 2017 18:18:49 -0700 Subject: [PATCH 12/12] version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index feae1a0..b441f97 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "newforms-ajb", "description": "An isomorphic form-handling library for React", - "version": "0.0.1", + "version": "0.0.1-rc.1", "author": "Adam Becker ", "keywords": [ "isomorphic",