forked from rstgroup/react-components-form
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutocompleteField.js
11 lines (11 loc) · 69.6 KB
/
AutocompleteField.js
1
2
3
4
5
6
7
8
9
10
11
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=45)}([function(e,t,n){"use strict";e.exports=n(28)},function(e,t,n){e.exports=n(23)()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.FieldConnect=void 0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(1),p=r(d),g=n(11),h=t.FieldConnect=function(e){var t=function(t){function n(e){o(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.listeners=[],t.fieldValue=null,t.fieldValidationErrors=null,t.onChangeData=t.onChangeData.bind(t),t.submit=t.submit.bind(t),t.getValidationErrors=t.getValidationErrors.bind(t),t.getPath=t.getPath.bind(t),t.hasValidationError=t.hasValidationError.bind(t),t.getPropsFromSchema=t.getPropsFromSchema.bind(t),t.getEventsEmitter=t.getEventsEmitter.bind(t),t.getFieldAttributes=t.getFieldAttributes.bind(t),t}return u(n,t),l(n,[{key:"shouldComponentUpdate",value:function(e){var t=Object.assign({},e),n=Object.assign({},this.props),r=this.props.name,o=this.context,i=o.getModel,u=o.getValidationErrors;return(0,g.isNotEqualValue)(i(r),this.fieldValue)||(0,g.isNotEqualValue)(u(r),this.fieldValidationErrors)||(0,g.isNotEqualObject)(t,n)}},{key:"updateModelWithValueOrOptions",value:function(){var e=this.props,t=e.name,n=e.value,r=e.options,o=e.defaultOption,i=this.context.setModel;t&&"function"==typeof i&&(n?i(t,n):Array.isArray(r)&&r.length&&void 0!==o&&i(t,r[o].label?r[o].value:r[o]))}},{key:"registerListeners",value:function(){var e=this,t=this.props,n=t.onModelChange,r=t.onEmitEvents,o=this.context.eventsEmitter;if(o&&("function"==typeof n&&(this.onModelChangeMethod=function(t){return n(t,e)},o.listen("modelChange",this.onModelChangeMethod)),r)){if(Array.isArray(r))return void r.forEach(function(t){var n=t.name,r=t.method,i={name:n,method:function(t){return r(t,e)}};e.listeners.push(i),o.listen(n,i.method)});var i=r.name,u=r.method,s={name:i,method:function(t){return u(t,e)}};this.listeners.push(s),o.listen(i,s.method)}}},{key:"unregisterListeners",value:function(){var e=this.props.onEmitEvents,t=this.context.eventsEmitter;t&&("function"==typeof this.onModelChangeMethod&&t.unlisten("modelChange",this.onModelChangeMethod),e&&this.listeners.length>0&&this.listeners.forEach(function(e){var n=e.name,r=e.method;t.unlisten(n,r)}))}},{key:"componentWillMount",value:function(){this.updateModelWithValueOrOptions(),this.registerListeners()}},{key:"componentWillUnmount",value:function(){this.unregisterListeners()}},{key:"getChildContext",value:function(){return{getSchema:this.context.getSchema,getPath:this.getPath}}},{key:"onChangeData",value:function(e){var t=this.props,n=t.name,r=t.callbacks.onChange,o=this.context,i=o.setModel,u=o.eventsEmitter,s=o.getPath;"function"==typeof i&&i(n,e,function(){u&&u.emit("modelChange",{name:s()+"."+n,value:e}),"function"==typeof r&&r(e)})}},{key:"setCurrentFielValue",value:function(e){return Array.isArray(e)?void(this.fieldValue=(0,g.cloneArray)(e)):"object"===(void 0===e?"undefined":a(e))?void(this.fieldValue=(0,g.cloneObject)(e)):void(this.fieldValue=e)}},{key:"getValue",value:function(){var e=this.props,t=e.name,n=e.value,r=this.context.getModel;if("function"!=typeof r)return n;var o=r(t),i=void 0!==o?o:n;return this.setCurrentFielValue(i),i}},{key:"getPropsFromSchema",value:function(){var e=this.props.name,t=this.context.getSchema;if("function"==typeof t)return t(e)}},{key:"getEventsEmitter",value:function(){return this.context.eventsEmitter}},{key:"submit",value:function(e){var t=this.context.submitForm;"function"==typeof t&&t(e)}},{key:"getValidationErrors",value:function(){var e=this.props,t=e.name,n=e.callbacks.onError,r=this.context.getValidationErrors,o=[];return"function"==typeof r&&(o=r(t)),this.fieldValidationErrors=o,"function"==typeof n&&Object.keys(o).length>0&&n(o),o}},{key:"getPath",value:function(){var e=this.props.name,t=this.context.getPath;return"function"!=typeof t?e:t()+"."+e}},{key:"getFieldAttributes",value:function(){var e=this.props,t=e.fieldAttributes,n=e.callbacks,r=n.onFocus,o=n.onBlur;return Object.assign({},{onFocus:r,onBlur:o},t)}},{key:"hasValidationError",value:function(){return this.getValidationErrors().length>0}},{key:"render",value:function(){return f.default.createElement(e,s({},this.getPropsFromSchema(),this.props,{onChange:this.onChangeData,submit:this.submit,validationErrors:this.getValidationErrors(),hasValidationError:this.hasValidationError(),value:this.getValue(),eventsEmitter:this.getEventsEmitter(),path:this.getPath(),fieldAttributes:this.getFieldAttributes()}))}}]),n}(f.default.Component);return t.contextTypes={setModel:p.default.func,getModel:p.default.func,getSchema:p.default.func,submitForm:p.default.func,getValidationErrors:p.default.func,getPath:p.default.func,eventsEmitter:p.default.shape({emit:p.default.func,registerEvent:p.default.func,listen:p.default.func,unregisterEvent:p.default.func,unlisten:p.default.func})},t.childContextTypes={getSchema:p.default.func,getPath:p.default.func},t.defaultProps={callbacks:{}},t.propTypes={name:p.default.string,value:p.default.any,fieldAttributes:p.default.shape({}),options:p.default.arrayOf(p.default.oneOfType([p.default.string,p.default.shape({})])),defaultOption:p.default.number,onModelChange:p.default.func,onEmitEvents:p.default.oneOfType([p.default.shape({name:p.default.string,method:p.default.func}),p.default.arrayOf(p.default.shape({name:p.default.string,method:p.default.func}))]),callbacks:p.default.shape({onChange:p.default.func,onError:p.default.func,onFocus:p.default.func,onBlur:p.default.func})},t};t.default=h},function(e,t,n){"use strict";function r(e,t,n,r,i,u,s,a){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,u,s,a],f=0;l=new Error(t.replace(/%s/g,function(){return c[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorField=void 0;var o=n(0),i=r(o),u=n(1),s=r(u),a=t.ErrorField=function(e){var t=e.errors,n=void 0===t?[]:t,r=e.className,o=e.itemClassName,u=e.ErrorComponent,s=Array.isArray(n)?n:[n];return u&&i.default.createElement(u,{className:r,itemClassName:o,errors:s})||i.default.createElement("div",{className:r},s.map(function(e){return i.default.createElement("div",{className:o,key:e},e)}))};a.propTypes={errors:s.default.oneOfType([s.default.arrayOf(s.default.string),s.default.arrayOf(s.default.arrayOf(s.default.string)),s.default.string]),className:s.default.string,itemClassName:s.default.string,ErrorComponent:s.default.func},t.default=a},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function o(e){return void 0!==e.key}var i=n(9),u=n(15),s=(n(8),n(18),Object.prototype.hasOwnProperty),a=n(16),l={key:!0,ref:!0,__self:!0,__source:!0},c=function(e,t,n,r,o,i,u){var s={$$typeof:a,type:e,key:t,ref:n,props:u,_owner:i};return s};c.createElement=function(e,t,n){var i,a={},f=null,d=null;if(null!=t){r(t)&&(d=t.ref),o(t)&&(f=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(i in t)s.call(t,i)&&!l.hasOwnProperty(i)&&(a[i]=t[i])}var p=arguments.length-2;if(1===p)a.children=n;else if(p>1){for(var g=Array(p),h=0;h<p;h++)g[h]=arguments[h+2];a.children=g}if(e&&e.defaultProps){var m=e.defaultProps;for(i in m)void 0===a[i]&&(a[i]=m[i])}return c(e,f,d,0,0,u.current,a)},c.createFactory=function(e){var t=c.createElement.bind(null,e);return t.type=e,t},c.cloneAndReplaceKey=function(e,t){return c(e.type,t,e.ref,e._self,e._source,e._owner,e.props)},c.cloneElement=function(e,t,n){var a,f=i({},e.props),d=e.key,p=e.ref,g=(e._self,e._source,e._owner);if(null!=t){r(t)&&(p=t.ref,g=u.current),o(t)&&(d=""+t.key);var h;e.type&&e.type.defaultProps&&(h=e.type.defaultProps);for(a in t)s.call(t,a)&&!l.hasOwnProperty(a)&&(void 0===t[a]&&void 0!==h?f[a]=h[a]:f[a]=t[a])}var m=arguments.length-2;if(1===m)f.children=n;else if(m>1){for(var y=Array(m),v=0;v<m;v++)y[v]=arguments[v+2];f.children=y}return c(e.type,d,p,0,0,g,f)},c.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},e.exports=c},function(e,t,n){var r,o;/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r))e.push(n.apply(null,r));else if("object"===o)for(var u in r)i.call(r,u)&&r[u]&&e.push(u)}}return e.join(" ")}var i={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";var r=n(7),o=r;e.exports=o},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,a=r(e),l=1;l<arguments.length;l++){n=Object(arguments[l]);for(var c in n)i.call(n,c)&&(a[c]=n[c]);if(o){s=o(n);for(var f=0;f<s.length;f++)u.call(n,s[f])&&(a[s[f]]=n[s[f]])}}return a}},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r<t;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);n+=" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";var o=new Error(n);throw o.name="Invariant Violation",o.framesToPop=1,o}e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=(t.get=function(e,t,n){var o=t.split("."),i=e;return"object"===(void 0===e?"undefined":r(e))?(o.forEach(function(e){if(i!==n&&i[e])return void(i=i[e]);i=n}),i):n},t.cloneArray=function e(t){return Array.isArray(t)?t.map(function(t){return Array.isArray(t)?e(t):"object"!==(void 0===t?"undefined":r(t))||t instanceof Date?t:i(t)}):t}),i=t.cloneObject=function e(t){var n={};return Object.keys(t).forEach(function(i){var u=o(t[i]);if(!("object"!==r(t[i])||Array.isArray(t[i])||t[i]instanceof Date))return void(n[i]=e(u));n[i]=u}),n},u=t.isNullOrUndefined=function(e){return null===e||void 0===e},s=t.hasDifferentKeysLength=function(e,t){return Object.keys(e).length!==Object.keys(t).length},a=t.isNotEqualArray=function(e,t){if(e.length!==t.length)return!0;var n=!1;return e.forEach(function(e,r){l(t[r],e)&&(n=!0)}),n},l=t.isNotEqualValue=function(e,t){var n=void 0===e?"undefined":r(e),o=void 0===t?"undefined":r(t);return n!==o||("object"!==n||"object"!==o)&&e!==t||(Array.isArray(e)?a(e,t):"object"===n&&c(e,t))},c=t.isNotEqualObject=function(e,t){if(u(e)||u(t))return!1;if(d(e)||d(t))return e!==t;if(s(e,t))return!0;for(var n=Object.keys(e),r=!1,o=0;!r&&n.length>=o;){var i=n[o];l(e[i],t[i])&&(r=!0),o+=1}return r},f=t.isClassConstructor=function(e){try{new e}catch(e){return!1}return!0},d=t.isReactComponentOrElement=function e(t){if(f(t)){var n=new t;return"object"===r(n.isReactComponent)||e(n)}if("object"===(void 0===t?"undefined":r(t))){var o=Symbol("react.element").toString();if(t.$$typeof&&t.$$typeof.toString()===o)return!0}return!1}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||a}function o(e,t,n){this.props=e,this.context=t,this.refs=l,this.updater=n||a}function i(){}var u=n(10),s=n(9),a=n(17),l=(n(18),n(12));n(3),n(35);r.prototype.isReactComponent={},r.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&u("85"),this.updater.enqueueSetState(this,e),t&&this.updater.enqueueCallback(this,t,"setState")},r.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this),e&&this.updater.enqueueCallback(this,e,"forceUpdate")};i.prototype=r.prototype,o.prototype=new i,o.prototype.constructor=o,s(o.prototype,r.prototype),o.prototype.isPureReactComponent=!0,e.exports={Component:r,PureComponent:o}},function(e,t,n){"use strict";var r={current:null};e.exports=r},function(e,t,n){"use strict";var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=r},function(e,t,n){"use strict";var r=(n(8),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){},enqueueReplaceState:function(e,t){},enqueueSetState:function(e,t){}});e.exports=r},function(e,t,n){"use strict";var r=!1;e.exports=r},,function(e,t,n){"use strict";function r(e){return e}function o(e,t,n){function o(e,t){var n=v.hasOwnProperty(t)?v[t]:null;w.hasOwnProperty(t)&&s("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&s("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function l(e,n){if(n){s("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),s(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,i=r.__reactAutoBindPairs;n.hasOwnProperty(a)&&b.mixins(e,n.mixins);for(var u in n)if(n.hasOwnProperty(u)&&u!==a){var l=n[u],c=r.hasOwnProperty(u);if(o(c,u),b.hasOwnProperty(u))b[u](e,l);else{var f=v.hasOwnProperty(u),g="function"==typeof l,h=g&&!f&&!c&&!1!==n.autobind;if(h)i.push(u,l),r[u]=l;else if(c){var m=v[u];s(f&&("DEFINE_MANY_MERGED"===m||"DEFINE_MANY"===m),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,u),"DEFINE_MANY_MERGED"===m?r[u]=d(r[u],l):"DEFINE_MANY"===m&&(r[u]=p(r[u],l))}else r[u]=l}}}else;}function c(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in b;s(!o,'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.',n);var i=n in e;s(!i,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function f(e,t){s(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(s(void 0===e[n],"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.",n),e[n]=t[n]);return e}function d(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return f(o,n),f(o,r),o}}function p(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function g(e,t){var n=t.bind(e);return n}function h(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=g(e,o)}}function m(e){var t=r(function(e,r,o){this.__reactAutoBindPairs.length&&h(this),this.props=e,this.context=r,this.refs=u,this.updater=o||n,this.state=null;var i=this.getInitialState?this.getInitialState():null;s("object"==typeof i&&!Array.isArray(i),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=i});t.prototype=new x,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],y.forEach(l.bind(null,t)),l(t,S),l(t,e),l(t,I),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),s(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in v)t.prototype[o]||(t.prototype[o]=null);return t}var y=[],v={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},b={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)l(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=i({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=i({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=d(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=i({},e.propTypes,t)},statics:function(e,t){c(e,t)},autobind:function(){}},S={componentDidMount:function(){this.__isMounted=!0}},I={componentWillUnmount:function(){this.__isMounted=!1}},w={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},x=function(){};return i(x.prototype,e.prototype,w),m}var i=n(9),u=n(12),s=n(3),a="mixins";e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,o){}e.exports=r},function(e,t,n){"use strict";var r=n(24);e.exports=function(e){return r(e,!1)}},function(e,t,n){"use strict";var r=n(7),o=n(3),i=n(13);e.exports=function(){function e(e,t,n,r,u,s){s!==i&&o(!1,"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")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";var r=n(7),o=n(3),i=n(8),u=n(13),s=n(21);e.exports=function(e,t){function n(e){var t=e&&(E&&e[E]||e[O]);if("function"==typeof t)return t}function a(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function l(e){this.message=e,this.stack=""}function c(e){function n(n,r,i,s,a,c,f){if(s=s||_,c=c||i,f!==u)if(t)o(!1,"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;return null==r[i]?n?new l(null===r[i]?"The "+a+" `"+c+"` is marked as required in `"+s+"`, but its value is `null`.":"The "+a+" `"+c+"` is marked as required in `"+s+"`, but its value is `undefined`."):null:e(r,i,s,a,c)}var r=n.bind(null,!1);return r.isRequired=n.bind(null,!0),r}function f(e){function t(t,n,r,o,i,u){var s=t[n];if(S(s)!==e)return new l("Invalid "+o+" `"+i+"` of type `"+I(s)+"` supplied to `"+r+"`, expected `"+e+"`.");return null}return c(t)}function d(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s)){return new l("Invalid "+o+" `"+i+"` of type `"+S(s)+"` supplied to `"+r+"`, expected an array.")}for(var a=0;a<s.length;a++){var c=e(s,a,r,o,i+"["+a+"]",u);if(c instanceof Error)return c}return null}return c(t)}function p(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var u=e.name||_;return new l("Invalid "+o+" `"+i+"` of type `"+x(t[n])+"` supplied to `"+r+"`, expected instance of `"+u+"`.")}return null}return c(t)}function g(e){function t(t,n,r,o,i){for(var u=t[n],s=0;s<e.length;s++)if(a(u,e[s]))return null;return new l("Invalid "+o+" `"+i+"` of value `"+u+"` supplied to `"+r+"`, expected one of "+JSON.stringify(e)+".")}return Array.isArray(e)?c(t):r.thatReturnsNull}function h(e){function t(t,n,r,o,i){if("function"!=typeof e)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],a=S(s);if("object"!==a)return new l("Invalid "+o+" `"+i+"` of type `"+a+"` supplied to `"+r+"`, expected an object.");for(var c in s)if(s.hasOwnProperty(c)){var f=e(s,c,r,o,i+"."+c,u);if(f instanceof Error)return f}return null}return c(t)}function m(e){function t(t,n,r,o,i){for(var s=0;s<e.length;s++){if(null==(0,e[s])(t,n,r,o,i,u))return null}return new l("Invalid "+o+" `"+i+"` supplied to `"+r+"`.")}if(!Array.isArray(e))return r.thatReturnsNull;for(var n=0;n<e.length;n++){var o=e[n];if("function"!=typeof o)return i(!1,"Invalid argument supplid to oneOfType. Expected an array of check functions, but received %s at index %s.",w(o),n),r.thatReturnsNull}return c(t)}function y(e){function t(t,n,r,o,i){var s=t[n],a=S(s);if("object"!==a)return new l("Invalid "+o+" `"+i+"` of type `"+a+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var f=e[c];if(f){var d=f(s,c,r,o,i+"."+c,u);if(d)return d}}return null}return c(t)}function v(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(v);if(null===t||e(t))return!0;var r=n(t);if(!r)return!1;var o,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!v(o.value))return!1}else for(;!(o=i.next()).done;){var u=o.value;if(u&&!v(u[1]))return!1}return!0;default:return!1}}function b(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function S(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":b(t,e)?"symbol":t}function I(e){if(void 0===e||null===e)return""+e;var t=S(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function w(e){var t=I(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function x(e){return e.constructor&&e.constructor.name?e.constructor.name:_}var E="function"==typeof Symbol&&Symbol.iterator,O="@@iterator",_="<<anonymous>>",C={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:function(){return c(r.thatReturnsNull)}(),arrayOf:d,element:function(){function t(t,n,r,o,i){var u=t[n];if(!e(u)){return new l("Invalid "+o+" `"+i+"` of type `"+S(u)+"` supplied to `"+r+"`, expected a single ReactElement.")}return null}return c(t)}(),instanceOf:p,node:function(){function e(e,t,n,r,o){return v(e[t])?null:new l("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}return c(e)}(),objectOf:h,oneOf:g,oneOfType:m,shape:y};return l.prototype=Error.prototype,C.checkPropTypes=s,C.PropTypes=C,C}},function(e,t,n){"use strict";function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(e===t)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!0;var u={},s=void 0,a=void 0;for(s=0,a=n.length;s<a;s++)u[n[s]]=!0;for(s=0,a=r.length;s<a;s++){var l=r[s],c=e[l],f=t[l];if(c!==f){if(!u[l]||null===c||null===f||"object"!==(void 0===c?"undefined":o(c))||"object"!==(void 0===f?"undefined":o(f)))return!0;var d=Object.keys(c),p=Object.keys(f);if(d.length!==p.length)return!0;for(var g=0,h=d.length;g<h;g++){var m=d[g];if(c[m]!==f[m])return!0}}}return!1}Object.defineProperty(t,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=r},function(e,t,n){"use strict";function r(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function o(e){var t=/(=0|=2)/g,n={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return n[e]})}var i={escape:r,unescape:o};e.exports=i},function(e,t,n){"use strict";var r=n(10),o=(n(3),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),i=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},u=function(e,t,n){var r=this;if(r.instancePool.length){var o=r.instancePool.pop();return r.call(o,e,t,n),o}return new r(e,t,n)},s=function(e,t,n,r){var o=this;if(o.instancePool.length){var i=o.instancePool.pop();return o.call(i,e,t,n,r),i}return new o(e,t,n,r)},a=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length<t.poolSize&&t.instancePool.push(e)},l=o,c=function(e,t){var n=e;return n.instancePool=[],n.getPooled=t||l,n.poolSize||(n.poolSize=10),n.release=a,n},f={addPoolingTo:c,oneArgumentPooler:o,twoArgumentPooler:i,threeArgumentPooler:u,fourArgumentPooler:s};e.exports=f},function(e,t,n){"use strict";var r=n(9),o=n(14),i=n(29),u=n(30),s=n(5),a=n(31),l=n(32),c=n(33),f=n(36),d=s.createElement,p=s.createFactory,g=s.cloneElement,h=r,m=function(e){return e},y={Children:{map:i.map,forEach:i.forEach,count:i.count,toArray:i.toArray,only:f},Component:o.Component,PureComponent:o.PureComponent,createElement:d,cloneElement:g,isValidElement:s.isValidElement,PropTypes:a,createClass:c,createFactory:p,createMixin:m,DOM:u,version:l,__spread:h};e.exports=y},function(e,t,n){"use strict";function r(e){return(""+e).replace(S,"$&/")}function o(e,t){this.func=e,this.context=t,this.count=0}function i(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function u(e,t,n){if(null==e)return e;var r=o.getPooled(t,n);y(e,i,r),o.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function a(e,t,n){var o=e.result,i=e.keyPrefix,u=e.func,s=e.context,a=u.call(s,t,e.count++);Array.isArray(a)?l(a,o,n,m.thatReturnsArgument):null!=a&&(h.isValidElement(a)&&(a=h.cloneAndReplaceKey(a,i+(!a.key||t&&t.key===a.key?"":r(a.key)+"/")+n)),o.push(a))}function l(e,t,n,o,i){var u="";null!=n&&(u=r(n)+"/");var l=s.getPooled(t,u,o,i);y(e,a,l),s.release(l)}function c(e,t,n){if(null==e)return e;var r=[];return l(e,r,null,t,n),r}function f(e,t,n){return null}function d(e,t){return y(e,f,null)}function p(e){var t=[];return l(e,t,null,m.thatReturnsArgument),t}var g=n(27),h=n(5),m=n(7),y=n(37),v=g.twoArgumentPooler,b=g.fourArgumentPooler,S=/\/+/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},g.addPoolingTo(o,v),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},g.addPoolingTo(s,b);var I={forEach:u,map:c,mapIntoWithKeyPrefixInternal:l,count:d,toArray:p};e.exports=I},function(e,t,n){"use strict";var r=n(5),o=r.createFactory,i={a:o("a"),abbr:o("abbr"),address:o("address"),area:o("area"),article:o("article"),aside:o("aside"),audio:o("audio"),b:o("b"),base:o("base"),bdi:o("bdi"),bdo:o("bdo"),big:o("big"),blockquote:o("blockquote"),body:o("body"),br:o("br"),button:o("button"),canvas:o("canvas"),caption:o("caption"),cite:o("cite"),code:o("code"),col:o("col"),colgroup:o("colgroup"),data:o("data"),datalist:o("datalist"),dd:o("dd"),del:o("del"),details:o("details"),dfn:o("dfn"),dialog:o("dialog"),div:o("div"),dl:o("dl"),dt:o("dt"),em:o("em"),embed:o("embed"),fieldset:o("fieldset"),figcaption:o("figcaption"),figure:o("figure"),footer:o("footer"),form:o("form"),h1:o("h1"),h2:o("h2"),h3:o("h3"),h4:o("h4"),h5:o("h5"),h6:o("h6"),head:o("head"),header:o("header"),hgroup:o("hgroup"),hr:o("hr"),html:o("html"),i:o("i"),iframe:o("iframe"),img:o("img"),input:o("input"),ins:o("ins"),kbd:o("kbd"),keygen:o("keygen"),label:o("label"),legend:o("legend"),li:o("li"),link:o("link"),main:o("main"),map:o("map"),mark:o("mark"),menu:o("menu"),menuitem:o("menuitem"),meta:o("meta"),meter:o("meter"),nav:o("nav"),noscript:o("noscript"),object:o("object"),ol:o("ol"),optgroup:o("optgroup"),option:o("option"),output:o("output"),p:o("p"),param:o("param"),picture:o("picture"),pre:o("pre"),progress:o("progress"),q:o("q"),rp:o("rp"),rt:o("rt"),ruby:o("ruby"),s:o("s"),samp:o("samp"),script:o("script"),section:o("section"),select:o("select"),small:o("small"),source:o("source"),span:o("span"),strong:o("strong"),style:o("style"),sub:o("sub"),summary:o("summary"),sup:o("sup"),table:o("table"),tbody:o("tbody"),td:o("td"),textarea:o("textarea"),tfoot:o("tfoot"),th:o("th"),thead:o("thead"),time:o("time"),title:o("title"),tr:o("tr"),track:o("track"),u:o("u"),ul:o("ul"),var:o("var"),video:o("video"),wbr:o("wbr"),circle:o("circle"),clipPath:o("clipPath"),defs:o("defs"),ellipse:o("ellipse"),g:o("g"),image:o("image"),line:o("line"),linearGradient:o("linearGradient"),mask:o("mask"),path:o("path"),pattern:o("pattern"),polygon:o("polygon"),polyline:o("polyline"),radialGradient:o("radialGradient"),rect:o("rect"),stop:o("stop"),svg:o("svg"),text:o("text"),tspan:o("tspan")};e.exports=i},function(e,t,n){"use strict";var r=n(5),o=r.isValidElement,i=n(22);e.exports=i(o)},function(e,t,n){"use strict";e.exports="15.6.1"},function(e,t,n){"use strict";var r=n(14),o=r.Component,i=n(5),u=i.isValidElement,s=n(17),a=n(20);e.exports=a(o,u,s)},function(e,t,n){"use strict";function r(e){var t=e&&(o&&e[o]||e[i]);if("function"==typeof t)return t}var o="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=r},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";function r(e){return i.isValidElement(e)||o("143"),e}var o=n(10),i=n(5);n(3);e.exports=r},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?l.escape(e.key):t.toString(36)}function o(e,t,n,i){var d=typeof e;if("undefined"!==d&&"boolean"!==d||(e=null),null===e||"string"===d||"number"===d||"object"===d&&e.$$typeof===s)return n(i,e,""===t?c+r(e,0):t),1;var p,g,h=0,m=""===t?c:t+f;if(Array.isArray(e))for(var y=0;y<e.length;y++)p=e[y],g=m+r(p,y),h+=o(p,g,n,i);else{var v=a(e);if(v){var b,S=v.call(e);if(v!==e.entries)for(var I=0;!(b=S.next()).done;)p=b.value,g=m+r(p,I++),h+=o(p,g,n,i);else for(;!(b=S.next()).done;){var w=b.value;w&&(p=w[1],g=m+l.escape(w[0])+f+r(p,0),h+=o(p,g,n,i))}}else if("object"===d){var x="",E=String(e);u("31","[object Object]"===E?"object with keys {"+Object.keys(e).join(", ")+"}":E,x)}}return h}function i(e,t,n){return null==e?0:o(e,"",t,n)}var u=n(10),s=(n(15),n(16)),a=n(34),l=(n(3),n(26)),c=(n(8),"."),f=":";e.exports=i},,,,,,,,function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.AutocompleteField=void 0;var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),f=n(1),d=r(f),p=n(2),g=r(p),h=n(4),m=r(h),y=n(11),v=n(6),b=r(v),S=n(51),I=r(S),w=t.AutocompleteField=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onSuggestionsFetchRequested=function(e){var t=e.value,r=n.props,o=r.getOptions,i=r.searchKey;if("function"==typeof o)return void o(t,i).then(function(e){n.setState({suggestions:e})});n.setState({suggestions:n.getSuggestions(t)})},n.onSuggestionsClearRequested=function(){n.setState({suggestions:n.getSuggestions("")})},n.state={suggestions:n.getSuggestions("")},n.renderInputComponent=n.renderInputComponent.bind(n),n.shouldRenderSuggestions=n.shouldRenderSuggestions.bind(n),n.onChange=n.onChange.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.suggestionsFilter=n.suggestionsFilter.bind(n),n.applySectionFilter=n.applySectionFilter.bind(n),n.onSuggestionsFetchRequested=n.onSuggestionsFetchRequested.bind(n),n.onSuggestionsClearRequested=n.onSuggestionsClearRequested.bind(n),n}return u(t,e),a(t,null,[{key:"renderSuggestion",value:function(e){return c.default.createElement("div",null,e)}},{key:"renderSectionTitle",value:function(e){return c.default.createElement("div",null,e.title)}},{key:"getSuggestion",value:function(e){return e}},{key:"getSectionSuggestions",value:function(e){return e.suggestions}}]),a(t,[{key:"renderInputComponent",value:function(e){return c.default.createElement("input",e)}},{key:"shouldRenderSuggestions",value:function(){return!0}},{key:"suggestionsFilter",value:function(e,t){return t?function(n){return!!(0,y.get)(n,t,"").match(new RegExp(e,"i"))}:function(t){return t.match(e)}}},{key:"applySectionFilter",value:function(e,n,r){var o=this,i=this.props.sectionSuggestionsIndex,u=void 0===i?"suggestions":i,s=(0,y.cloneArray)(e),a=[];return s.forEach(function(e){var i=t.getSectionSuggestions(e).filter(o.suggestionsFilter(n,r));i.length&&(e[u]=i,a.push(e))}),a}},{key:"getSuggestions",value:function(e){var t=this.props,n=t.options,r=t.multiSection,o=t.searchKey,i=t.alwaysRenderSuggestions,u=t.suggestionsShownIfFieldEmpty,s=void 0!==u&&u,a=e.trim();return""===a?s||i?n:[]:r?this.applySectionFilter(n,a,o):n.filter(this.suggestionsFilter(a,o))}},{key:"onChange",value:function(e,t){var n=t.newValue;(0,this.props.onChange)(n)}},{key:"onKeyDown",value:function(e){13===e.keyCode&&(e.preventDefault(),e.stopPropagation())}},{key:"render",value:function(){var e=this.props,n=e.wrapperClassName,r=e.name,o=e.className,i=e.theme,u=e.validationErrors,a=e.hasValidationError,l=e.value,f=e.label,d=e.placeholder,p=e.errorStyles,g=e.fieldAttributes,h=e.renderInputComponent,y=void 0===h?this.renderInputComponent:h,v=e.renderItem,S=void 0===v?t.renderSuggestion:v,w=e.getValue,x=void 0===w?t.getSuggestion:w,E=e.multiSection,O=void 0!==E&&E,_=e.renderSectionTitle,C=void 0===_?t.renderSectionTitle:_,P=e.getSectionSuggestions,j=void 0===P?t.getSectionSuggestions:P,k=e.shouldRenderSuggestions,R=void 0===k?this.shouldRenderSuggestions:k,D=e.sectionSuggestionsIndex,A=void 0===D?"suggestions":D,T=e.onSuggestionSelected,M=void 0===T?null:T,F=e.alwaysRenderSuggestions;return c.default.createElement("div",{className:(0,b.default)(n,a&&p.fieldClassName)},f&&c.default.createElement("label",null,f),c.default.createElement(I.default,{inputProps:s({className:o,placeholder:d,value:l,name:r,onChange:this.onChange,onKeyDown:this.onKeyDown},g),renderInputComponent:y,suggestions:this.state.suggestions,renderSuggestion:S,getSuggestionValue:x,onSuggestionsFetchRequested:this.onSuggestionsFetchRequested,onSuggestionsClearRequested:this.onSuggestionsClearRequested,theme:i,multiSection:O,renderSectionTitle:C,getSectionSuggestions:j,sectionSuggestionsIndex:A,shouldRenderSuggestions:R,alwaysRenderSuggestions:F,onSuggestionSelected:M}),a&&c.default.createElement(m.default,s({errors:u},p)))}}]),t}(l.Component);w.propTypes={wrapperClassName:d.default.string,className:d.default.string,name:d.default.string,onChange:d.default.func.isRequired,validationErrors:d.default.oneOfType([d.default.arrayOf(d.default.string),d.default.arrayOf(d.default.arrayOf(d.default.string)),d.default.string,d.default.shape({})]),hasValidationError:d.default.bool,value:d.default.string,label:d.default.string,renderItem:d.default.func,getValue:d.default.func,getOptions:d.default.func,searchKey:d.default.string,items:d.default.arrayOf(d.default.oneOfType([d.default.shape({}),d.default.string,d.default.number])),placeholder:d.default.string,errorStyles:d.default.shape({className:d.default.string,itemClassName:d.default.string}),fieldAttributes:d.default.shape({}),renderInputComponent:d.default.func,multiSection:d.default.bool,renderSectionTitle:d.default.func,getSectionSuggestions:d.default.func,shouldRenderSuggestions:d.default.func,suggestionsShownIfFieldEmpty:d.default.bool,onSuggestionSelected:d.default.func,alwaysRenderSuggestions:d.default.bool},w.defaultProps={value:"",errorStyles:{},fieldAttributes:{},theme:{},options:[]},t.default=(0,g.default)(w)},,,,,,function(e,t,n){"use strict";e.exports=n(52).default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),f=n(1),d=r(f),p=n(62),g=r(p),h=n(58),m=r(h),y=n(53),v=function(){return!0},b=function(e){return e.trim().length>0},S=function(e){var t=e.containerProps,n=e.children;return c.default.createElement("div",t,n)},I=function(e){function t(e){var n=e.alwaysRenderSuggestions;o(this,t);var r=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return w.call(r),r.state={isFocused:!1,isCollapsed:!n,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null},r.justPressedUpDown=!1,r}return u(t,e),a(t,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),this.input=this.autowhatever.input,this.suggestionsContainer=this.autowhatever.itemsContainer}},{key:"componentWillReceiveProps",value:function(e){(0,g.default)(e.suggestions,this.props.suggestions)?e.highlightFirstSuggestion&&e.suggestions.length>0&&!1===this.justPressedUpDown&&this.highlightFirstSuggestion():this.willRenderSuggestions(e)?(e.highlightFirstSuggestion&&this.highlightFirstSuggestion(),this.state.isCollapsed&&!this.justSelectedSuggestion&&this.revealSuggestions()):this.resetHighlightedSuggestion()}},{key:"componentDidUpdate",value:function(e,t){var n=this.props.onSuggestionHighlighted;if(n){var r=this.state,o=r.highlightedSectionIndex,i=r.highlightedSuggestionIndex;if(o!==t.highlightedSectionIndex||i!==t.highlightedSuggestionIndex){n({suggestion:this.getHighlightedSuggestion()})}}}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown)}},{key:"updateHighlightedSuggestion",value:function(e,t,n){this.setState(function(r){var o=r.valueBeforeUpDown;return null===t?o=null:null===o&&void 0!==n&&(o=n),{highlightedSectionIndex:e,highlightedSuggestionIndex:t,valueBeforeUpDown:o}})}},{key:"resetHighlightedSuggestion",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.setState(function(t){var n=t.valueBeforeUpDown;return{highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:e?null:n}})}},{key:"revealSuggestions",value:function(){this.setState({isCollapsed:!1})}},{key:"closeSuggestions",value:function(){this.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!0})}},{key:"getSuggestion",value:function(e,t){var n=this.props,r=n.suggestions,o=n.multiSection,i=n.getSectionSuggestions;return o?i(r[e])[t]:r[t]}},{key:"getHighlightedSuggestion",value:function(){var e=this.state,t=e.highlightedSectionIndex,n=e.highlightedSuggestionIndex;return null===n?null:this.getSuggestion(t,n)}},{key:"getSuggestionValueByIndex",value:function(e,t){return(0,this.props.getSuggestionValue)(this.getSuggestion(e,t))}},{key:"getSuggestionIndices",value:function(e){var t=e.getAttribute("data-section-index"),n=e.getAttribute("data-suggestion-index");return{sectionIndex:"string"==typeof t?parseInt(t,10):null,suggestionIndex:parseInt(n,10)}}},{key:"findSuggestionElement",value:function(e){var t=e;do{if(null!==t.getAttribute("data-suggestion-index"))return t;t=t.parentNode}while(null!==t);throw console.error("Clicked element:",e),new Error("Couldn't find suggestion element")}},{key:"maybeCallOnChange",value:function(e,t,n){var r=this.props.inputProps,o=r.value,i=r.onChange;t!==o&&i(e,{newValue:t,method:n})}},{key:"willRenderSuggestions",value:function(e){var t=e.suggestions,n=e.inputProps,r=e.shouldRenderSuggestions,o=n.value;return t.length>0&&r(o)}},{key:"getQuery",value:function(){var e=this.props.inputProps,t=e.value;return(this.state.valueBeforeUpDown||t).trim()}},{key:"render",value:function(){var e=this,t=this.props,n=t.suggestions,r=t.renderInputComponent,o=t.onSuggestionsFetchRequested,i=t.renderSuggestion,u=t.inputProps,a=t.multiSection,l=t.renderSectionTitle,f=t.id,d=t.getSectionSuggestions,p=t.theme,g=t.getSuggestionValue,h=t.alwaysRenderSuggestions,b=this.state,S=b.isFocused,I=b.isCollapsed,w=b.highlightedSectionIndex,x=b.highlightedSuggestionIndex,E=b.valueBeforeUpDown,O=h?v:this.props.shouldRenderSuggestions,_=u.value,C=u.onFocus,P=u.onKeyDown,j=this.willRenderSuggestions(this.props),k=h||S&&!I&&j,R=k?n:[],D=s({},u,{onFocus:function(t){if(!e.justSelectedSuggestion&&!e.justClickedOnSuggestionsContainer){var n=O(_);e.setState({isFocused:!0,isCollapsed:!n}),C&&C(t),n&&o({value:_,reason:"input-focused"})}},onBlur:function(t){if(e.justClickedOnSuggestionsContainer)return void e.input.focus();e.blurEvent=t,e.justSelectedSuggestion||(e.onBlur(),e.onSuggestionsClearRequested())},onChange:function(t){var n=t.target.value,r=O(n);e.maybeCallOnChange(t,n,"type"),e.setState({highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!r}),r?o({value:n,reason:"input-changed"}):e.onSuggestionsClearRequested()},onKeyDown:function(t,r){var i=t.keyCode;switch(i){case 40:case 38:if(I)O(_)&&(o({value:_,reason:"suggestions-revealed"}),e.revealSuggestions());else if(n.length>0){var u=r.newHighlightedSectionIndex,s=r.newHighlightedItemIndex,a=void 0;a=null===s?null===E?_:E:e.getSuggestionValueByIndex(u,s),e.updateHighlightedSuggestion(u,s,_),e.maybeCallOnChange(t,a,40===i?"down":"up")}t.preventDefault(),e.justPressedUpDown=!0,setTimeout(function(){e.justPressedUpDown=!1});break;case 13:if(229===t.keyCode)break;var l=e.getHighlightedSuggestion();if(k&&!h&&e.closeSuggestions(),null!==l){var c=g(l);e.maybeCallOnChange(t,c,"enter"),e.onSuggestionSelected(t,{suggestion:l,suggestionValue:c,suggestionIndex:x,sectionIndex:w,method:"enter"}),e.justSelectedSuggestion=!0,setTimeout(function(){e.justSelectedSuggestion=!1})}break;case 27:k&&t.preventDefault();var f=k&&!h;if(null===E){if(!f){e.maybeCallOnChange(t,"","escape"),O("")?o({value:"",reason:"escape-pressed"}):e.onSuggestionsClearRequested()}}else e.maybeCallOnChange(t,E,"escape");f?(e.onSuggestionsClearRequested(),e.closeSuggestions()):e.resetHighlightedSuggestion()}P&&P(t)}}),A={query:this.getQuery()};return c.default.createElement(m.default,{multiSection:a,items:R,renderInputComponent:r,renderItemsContainer:this.renderSuggestionsContainer,renderItem:i,renderItemData:A,renderSectionTitle:l,getSectionItems:d,highlightedSectionIndex:w,highlightedItemIndex:x,inputProps:D,itemProps:this.itemProps,theme:(0,y.mapToAutowhateverTheme)(p),id:f,ref:this.storeAutowhateverRef})}}]),t}(l.Component);I.propTypes={suggestions:d.default.array.isRequired,onSuggestionsFetchRequested:function(e,t){if("function"!=typeof e[t])throw new Error("'onSuggestionsFetchRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsFetchRequestedProp")},onSuggestionsClearRequested:function(e,t){var n=e[t];if(!1===e.alwaysRenderSuggestions&&"function"!=typeof n)throw new Error("'onSuggestionsClearRequested' must be implemented. See: https://github.com/moroshko/react-autosuggest#onSuggestionsClearRequestedProp")},onSuggestionSelected:d.default.func,onSuggestionHighlighted:d.default.func,renderInputComponent:d.default.func,renderSuggestionsContainer:d.default.func,getSuggestionValue:d.default.func.isRequired,renderSuggestion:d.default.func.isRequired,inputProps:function(e,t){var n=e[t];if(!n.hasOwnProperty("value"))throw new Error("'inputProps' must have 'value'.");if(!n.hasOwnProperty("onChange"))throw new Error("'inputProps' must have 'onChange'.")},shouldRenderSuggestions:d.default.func,alwaysRenderSuggestions:d.default.bool,multiSection:d.default.bool,renderSectionTitle:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'renderSectionTitle' must be implemented. See: https://github.com/moroshko/react-autosuggest#renderSectionTitleProp")},getSectionSuggestions:function(e,t){var n=e[t];if(!0===e.multiSection&&"function"!=typeof n)throw new Error("'getSectionSuggestions' must be implemented. See: https://github.com/moroshko/react-autosuggest#getSectionSuggestionsProp")},focusInputOnSuggestionClick:d.default.bool,highlightFirstSuggestion:d.default.bool,theme:d.default.object,id:d.default.string},I.defaultProps={renderSuggestionsContainer:S,shouldRenderSuggestions:b,alwaysRenderSuggestions:!1,multiSection:!1,focusInputOnSuggestionClick:!0,highlightFirstSuggestion:!1,theme:y.defaultTheme,id:"1"};var w=function(){var e=this;this.onDocumentMouseDown=function(t){e.justClickedOnSuggestionsContainer=!1;for(var n=t.detail&&t.detail.target||t.target;null!==n&&n!==document;){if(null!==n.getAttribute("data-suggestion-index"))return;if(n===e.suggestionsContainer)return void(e.justClickedOnSuggestionsContainer=!0);n=n.parentNode}},this.storeAutowhateverRef=function(t){null!==t&&(e.autowhatever=t)},this.onSuggestionMouseEnter=function(t,n){var r=n.sectionIndex,o=n.itemIndex;e.updateHighlightedSuggestion(r,o)},this.highlightFirstSuggestion=function(){e.updateHighlightedSuggestion(e.props.multiSection?0:null,0)},this.onSuggestionMouseDown=function(){e.justSelectedSuggestion=!0},this.onSuggestionsClearRequested=function(){var t=e.props.onSuggestionsClearRequested;t&&t()},this.onSuggestionSelected=function(t,n){var r=e.props,o=r.alwaysRenderSuggestions,i=r.onSuggestionSelected,u=r.onSuggestionsFetchRequested;i&&i(t,n),o?u({value:n.suggestionValue,reason:"suggestion-selected"}):e.onSuggestionsClearRequested(),e.resetHighlightedSuggestion()},this.onSuggestionClick=function(t){var n=e.props,r=n.alwaysRenderSuggestions,o=n.focusInputOnSuggestionClick,i=e.getSuggestionIndices(e.findSuggestionElement(t.target)),u=i.sectionIndex,s=i.suggestionIndex,a=e.getSuggestion(u,s),l=e.props.getSuggestionValue(a);e.maybeCallOnChange(t,l,"click"),e.onSuggestionSelected(t,{suggestion:a,suggestionValue:l,suggestionIndex:s,sectionIndex:u,method:"click"}),r||e.closeSuggestions(),!0===o?e.input.focus():e.onBlur(),setTimeout(function(){e.justSelectedSuggestion=!1})},this.onBlur=function(){var t=e.props,n=t.inputProps,r=t.shouldRenderSuggestions,o=n.value,i=n.onBlur,u=e.getHighlightedSuggestion(),s=r(o);e.setState({isFocused:!1,highlightedSectionIndex:null,highlightedSuggestionIndex:null,valueBeforeUpDown:null,isCollapsed:!s}),i&&i(e.blurEvent,{highlightedSuggestion:u})},this.resetHighlightedSuggestionOnMouseLeave=function(){e.resetHighlightedSuggestion(!1)},this.itemProps=function(t){return{"data-section-index":t.sectionIndex,"data-suggestion-index":t.itemIndex,onMouseEnter:e.onSuggestionMouseEnter,onMouseLeave:e.resetHighlightedSuggestionOnMouseLeave,onMouseDown:e.onSuggestionMouseDown,onTouchStart:e.onSuggestionMouseDown,onClick:e.onSuggestionClick}},this.renderSuggestionsContainer=function(t){var n=t.containerProps,r=t.children;return(0,e.props.renderSuggestionsContainer)({containerProps:n,children:r,query:e.getQuery()})}};t.default=I},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultTheme={container:"react-autosuggest__container",containerOpen:"react-autosuggest__container--open",input:"react-autosuggest__input",inputOpen:"react-autosuggest__input--open",inputFocused:"react-autosuggest__input--focused",suggestionsContainer:"react-autosuggest__suggestions-container",suggestionsContainerOpen:"react-autosuggest__suggestions-container--open",suggestionsList:"react-autosuggest__suggestions-list",suggestion:"react-autosuggest__suggestion",suggestionFirst:"react-autosuggest__suggestion--first",suggestionHighlighted:"react-autosuggest__suggestion--highlighted",sectionContainer:"react-autosuggest__section-container",sectionContainerFirst:"react-autosuggest__section-container--first",sectionTitle:"react-autosuggest__section-title"},t.mapToAutowhateverTheme=function(e){var t={};for(var n in e)switch(n){case"suggestionsContainer":t.itemsContainer=e[n];break;case"suggestionsContainerOpen":t.itemsContainerOpen=e[n];break;case"suggestion":t.item=e[n];break;case"suggestionFirst":t.itemFirst=e[n];break;case"suggestionHighlighted":t.itemHighlighted=e[n];break;case"suggestionsList":t.itemsList=e[n];break;default:t[n]=e[n]}return t}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(1),p=r(d),g=n(61),h=r(g),m=n(59),y=r(m),v=n(57),b=r(v),S=n(56),I=r(S),w={},x=function(e){return f.default.createElement("input",e)},E=function(e){var t=e.containerProps,n=e.children;return f.default.createElement("div",t,n)},O={container:"react-autowhatever__container",containerOpen:"react-autowhatever__container--open",input:"react-autowhatever__input",inputOpen:"react-autowhatever__input--open",inputFocused:"react-autowhatever__input--focused",itemsContainer:"react-autowhatever__items-container",itemsContainerOpen:"react-autowhatever__items-container--open",itemsList:"react-autowhatever__items-list",item:"react-autowhatever__item",itemFirst:"react-autowhatever__item--first",itemHighlighted:"react-autowhatever__item--highlighted",sectionContainer:"react-autowhatever__section-container",sectionContainerFirst:"react-autowhatever__section-container--first",sectionTitle:"react-autowhatever__section-title"},_=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.storeInputReference=function(e){null!==e&&(n.input=e)},n.storeItemsContainerReference=function(e){null!==e&&(n.itemsContainer=e)},n.onHighlightedItemChange=function(e){n.highlightedItem=e},n.getItemId=function(e,t){return null===t?null:"react-autowhatever-"+n.props.id+"-"+(null===e?"":"section-"+e)+"-item-"+t},n.onFocus=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!0}),t.onFocus&&t.onFocus(e)},n.onBlur=function(e){var t=n.props.inputProps;n.setState({isInputFocused:!1}),t.onBlur&&t.onBlur(e)},n.onKeyDown=function(e){var t=n.props,r=t.inputProps,o=t.highlightedSectionIndex,i=t.highlightedItemIndex;switch(e.key){case"ArrowDown":case"ArrowUp":var u="ArrowDown"===e.key?"next":"prev",s=n.sectionIterator[u]([o,i]),l=a(s,2),c=l[0],f=l[1];r.onKeyDown(e,{newHighlightedSectionIndex:c,newHighlightedItemIndex:f});break;default:r.onKeyDown(e,{highlightedSectionIndex:o,highlightedItemIndex:i})}},n.highlightedItem=null,n.state={isInputFocused:!1},n.setSectionsItems(e),n.setSectionIterator(e),n.setTheme(e),n}return u(t,e),l(t,[{key:"componentDidMount",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"componentWillReceiveProps",value:function(e){e.items!==this.props.items&&this.setSectionsItems(e),e.items===this.props.items&&e.multiSection===this.props.multiSection||this.setSectionIterator(e),e.theme!==this.props.theme&&this.setTheme(e)}},{key:"componentDidUpdate",value:function(){this.ensureHighlightedItemIsVisible()}},{key:"setSectionsItems",value:function(e){e.multiSection&&(this.sectionsItems=e.items.map(function(t){return e.getSectionItems(t)}),this.sectionsLengths=this.sectionsItems.map(function(e){return e.length}),this.allSectionsAreEmpty=this.sectionsLengths.every(function(e){return 0===e}))}},{key:"setSectionIterator",value:function(e){this.sectionIterator=(0,h.default)({multiSection:e.multiSection,data:e.multiSection?this.sectionsLengths:e.items.length})}},{key:"setTheme",value:function(e){this.theme=(0,y.default)(e.theme)}},{key:"renderSections",value:function(){var e=this;if(this.allSectionsAreEmpty)return null;var t=this.theme,n=this.props,r=n.id,o=n.items,i=n.renderItem,u=n.renderItemData,s=n.renderSectionTitle,a=n.highlightedSectionIndex,l=n.highlightedItemIndex,c=n.itemProps;return o.map(function(n,o){var d="react-autowhatever-"+r+"-",p=d+"section-"+o+"-",g=0===o;return f.default.createElement("div",t(p+"container","sectionContainer",g&&"sectionContainerFirst"),f.default.createElement(b.default,{section:n,renderSectionTitle:s,theme:t,sectionKeyPrefix:p}),f.default.createElement(I.default,{items:e.sectionsItems[o],itemProps:c,renderItem:i,renderItemData:u,sectionIndex:o,highlightedItemIndex:a===o?l:null,onHighlightedItemChange:e.onHighlightedItemChange,getItemId:e.getItemId,theme:t,keyPrefix:d,ref:e.storeItemsListReference}))})}},{key:"renderItems",value:function(){var e=this.props.items;if(0===e.length)return null;var t=this.theme,n=this.props,r=n.id,o=n.renderItem,i=n.renderItemData,u=n.highlightedSectionIndex,s=n.highlightedItemIndex,a=n.itemProps;return f.default.createElement(I.default,{items:e,itemProps:a,renderItem:o,renderItemData:i,highlightedItemIndex:null===u?s:null,onHighlightedItemChange:this.onHighlightedItemChange,getItemId:this.getItemId,theme:t,keyPrefix:"react-autowhatever-"+r+"-"})}},{key:"ensureHighlightedItemIsVisible",value:function(){var e=this.highlightedItem;if(e){var t=this.itemsContainer,n=e.offsetParent===t?e.offsetTop:e.offsetTop-t.offsetTop,r=t.scrollTop;n<r?r=n:n+e.offsetHeight>r+t.offsetHeight&&(r=n+e.offsetHeight-t.offsetHeight),r!==t.scrollTop&&(t.scrollTop=r)}}},{key:"render",value:function(){var e=this.theme,t=this.props,n=t.id,r=t.multiSection,o=t.renderInputComponent,i=t.renderItemsContainer,u=t.highlightedSectionIndex,a=t.highlightedItemIndex,l=this.state.isInputFocused,c=r?this.renderSections():this.renderItems(),d=null!==c,p=this.getItemId(u,a),g=e("react-autowhatever-"+n+"-container","container",d&&"containerOpen"),h="react-autowhatever-"+n,m=o(s({type:"text",value:"",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-owns":h,"aria-expanded":d,"aria-haspopup":d,"aria-activedescendant":p},e("react-autowhatever-"+n+"-input","input",d&&"inputOpen",l&&"inputFocused"),this.props.inputProps,{onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.props.inputProps.onKeyDown&&this.onKeyDown,ref:this.storeInputReference})),y=i({containerProps:s({id:h},e("react-autowhatever-"+n+"-items-container","itemsContainer",d&&"itemsContainerOpen"),{ref:this.storeItemsContainerReference}),children:c});return f.default.createElement("div",g,m,y)}}]),t}(c.Component);_.propTypes={id:p.default.string,multiSection:p.default.bool,renderInputComponent:p.default.func,renderItemsContainer:p.default.func,items:p.default.array.isRequired,renderItem:p.default.func,renderItemData:p.default.object,renderSectionTitle:p.default.func,getSectionItems:p.default.func,inputProps:p.default.object,itemProps:p.default.oneOfType([p.default.object,p.default.func]),highlightedSectionIndex:p.default.number,highlightedItemIndex:p.default.number,theme:p.default.oneOfType([p.default.object,p.default.array])},_.defaultProps={id:"1",multiSection:!1,renderInputComponent:x,renderItemsContainer:E,renderItem:function(){throw new Error("`renderItem` must be provided")},renderItemData:w,renderSectionTitle:function(){throw new Error("`renderSectionTitle` must be provided")},getSectionItems:function(){throw new Error("`getSectionItems` must be provided")},inputProps:w,itemProps:w,highlightedSectionIndex:null,highlightedItemIndex:null,theme:O},t.default=_},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),f=r(c),d=n(1),p=r(d),g=n(25),h=r(g),m=function(e){function t(){var e,n,r,o;i(this,t);for(var s=arguments.length,a=Array(s),l=0;l<s;l++)a[l]=arguments[l];return n=r=u(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeItemReference=function(e){null!==e&&(r.item=e)},r.onMouseEnter=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseEnter(e,{sectionIndex:n,itemIndex:o})},r.onMouseLeave=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseLeave(e,{sectionIndex:n,itemIndex:o})},r.onMouseDown=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onMouseDown(e,{sectionIndex:n,itemIndex:o})},r.onClick=function(e){var t=r.props,n=t.sectionIndex,o=t.itemIndex;r.props.onClick(e,{sectionIndex:n,itemIndex:o})},o=n,u(r,o)}return s(t,e),l(t,[{key:"shouldComponentUpdate",value:function(e){return(0,h.default)(e,this.props,["renderItemData"])}},{key:"render",value:function(){var e=this.props,t=e.isHighlighted,n=e.item,r=e.renderItem,i=e.renderItemData,u=o(e,["isHighlighted","item","renderItem","renderItemData"]);return delete u.sectionIndex,delete u.itemIndex,"function"==typeof u.onMouseEnter&&(u.onMouseEnter=this.onMouseEnter),"function"==typeof u.onMouseLeave&&(u.onMouseLeave=this.onMouseLeave),"function"==typeof u.onMouseDown&&(u.onMouseDown=this.onMouseDown),"function"==typeof u.onClick&&(u.onClick=this.onClick),f.default.createElement("li",a({role:"option"},u,{ref:this.storeItemReference}),r(n,a({isHighlighted:t},i)))}}]),t}(c.Component);m.propTypes={sectionIndex:p.default.number,isHighlighted:p.default.bool.isRequired,itemIndex:p.default.number.isRequired,item:p.default.any.isRequired,renderItem:p.default.func.isRequired,renderItemData:p.default.object.isRequired,onMouseEnter:p.default.func,onMouseLeave:p.default.func,onMouseDown:p.default.func,onClick:p.default.func},t.default=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(0),c=r(l),f=n(1),d=r(f),p=n(55),g=r(p),h=n(25),m=r(h),y=function(e){function t(){var e,n,r,u;o(this,t);for(var s=arguments.length,a=Array(s),l=0;l<s;l++)a[l]=arguments[l];return n=r=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a))),r.storeHighlightedItemReference=function(e){r.props.onHighlightedItemChange(null===e?null:e.item)},u=n,i(r,u)}return u(t,e),a(t,[{key:"shouldComponentUpdate",value:function(e){return(0,m.default)(e,this.props,["itemProps"])}},{key:"render",value:function(){var e=this,t=this.props,n=t.items,r=t.itemProps,o=t.renderItem,i=t.renderItemData,u=t.sectionIndex,a=t.highlightedItemIndex,l=t.getItemId,f=t.theme,d=t.keyPrefix,p=null===u?d:d+"section-"+u+"-",h="function"==typeof r;return c.default.createElement("ul",s({role:"listbox"},f(p+"items-list","itemsList")),n.map(function(t,n){var d=0===n,m=n===a,y=p+"item-"+n,v=h?r({sectionIndex:u,itemIndex:n}):r,b=s({id:l(u,n)},f(y,"item",d&&"itemFirst",m&&"itemHighlighted"),v);return m&&(b.ref=e.storeHighlightedItemReference),c.default.createElement(g.default,s({},b,{sectionIndex:u,isHighlighted:m,itemIndex:n,item:t,renderItem:o,renderItemData:i}))}))}}]),t}(l.Component);y.propTypes={items:d.default.array.isRequired,itemProps:d.default.oneOfType([d.default.object,d.default.func]),renderItem:d.default.func.isRequired,renderItemData:d.default.object.isRequired,sectionIndex:d.default.number,highlightedItemIndex:d.default.number,onHighlightedItemChange:d.default.func.isRequired,getItemId:d.default.func.isRequired,theme:d.default.func.isRequired,keyPrefix:d.default.string.isRequired},y.defaultProps={sectionIndex:null},t.default=y},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(0),l=r(a),c=n(1),f=r(c),d=n(25),p=r(d),g=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return u(t,e),s(t,[{key:"shouldComponentUpdate",value:function(e){return(0,p.default)(e,this.props)}},{key:"render",value:function(){var e=this.props,t=e.section,n=e.renderSectionTitle,r=e.theme,o=e.sectionKeyPrefix,i=n(t);return i?l.default.createElement("div",r(o+"title","sectionTitle"),i):null}}]),t}(a.Component);g.propTypes={section:f.default.any.isRequired,renderSectionTitle:f.default.func.isRequired,theme:f.default.func.isRequired,sectionKeyPrefix:f.default.string.isRequired},t.default=g},function(e,t,n){"use strict";e.exports=n(54).default},function(e,t,n){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=n(60),u=function(e){return e&&e.__esModule?e:{default:e}}(i),s=function(e){return e};t.default=function(e){var t=Array.isArray(e)&&2===e.length?e:[e,null],n=o(t,2),i=n[0],a=n[1];return function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var l=n.map(function(e){return i[e]}).filter(s);return"string"==typeof l[0]||"function"==typeof a?{key:e,className:a?a.apply(void 0,r(l)):l.join(" ")}:{key:e,style:u.default.apply(void 0,[{}].concat(r(l)))}}},e.exports=t.default},function(e,t,n){"use strict";function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function o(e){var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t.filter(function(t){return i.call(e,t)})}var i=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var n,i,u=r(e),s=1;s<arguments.length;s++){n=arguments[s],i=o(Object(n));for(var a=0;a<i.length;a++)u[i[a]]=n[i[a]]}return u}},function(e,t,n){"use strict";var r=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var u,s=e[Symbol.iterator]();!(r=(u=s.next()).done)&&(n.push(u.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.exports=function(e){function t(e){for(null===e?e=0:e++;e<s.length&&0===s[e];)e++;return e===s.length?null:e}function n(e){for(null===e?e=s.length-1:e--;e>=0&&0===s[e];)e--;return-1===e?null:e}function o(e){var n=r(e,2),o=n[0],i=n[1];return a?null===i||i===s[o]-1?(o=t(o),null===o?[null,null]:[o,0]):[o,i+1]:0===s||i===s-1?[null,null]:null===i?[null,0]:[null,i+1]}function i(e){var t=r(e,2),o=t[0],i=t[1];return a?null===i||0===i?(o=n(o),null===o?[null,null]:[o,s[o]-1]):[o,i-1]:0===s||0===i?[null,null]:null===i?[null,s-1]:[null,i-1]}function u(e){return null===o(e)[1]}var s=e.data,a=e.multiSection;return{next:o,prev:i,isLast:u}}},function(e,t){e.exports=function(e,t){if(e===t)return!0;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}}])});