ship-components-typeahead
Version:
Material Design React Typeahead Component
7 lines • 27.6 kB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("React"),require("classnames"),require("react-dom"),require("ship-components-outsideclick"),require("ship-components-textinput"));else if("function"==typeof define&&define.amd)define(["React","classnames","react-dom","ship-components-outsideclick","ship-components-textinput"],t);else{var n="object"==typeof exports?t(require("React"),require("classnames"),require("react-dom"),require("ship-components-outsideclick"),require("ship-components-textinput")):t(e.React,e.classnames,e["react-dom"],e["ship-components-outsideclick"],e["ship-components-textinput"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(e,t,n,r,o){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":u(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 "+("undefined"==typeof t?"undefined":u(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)}var u="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};Object.defineProperty(t,"__esModule",{value:!0});var l=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},c="function"==typeof Symbol&&"symbol"===u(Symbol.iterator)?function(e){return"undefined"==typeof e?"undefined":u(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":"undefined"==typeof e?"undefined":u(e)},p=n(7),f=r(p),d=n(3),h=r(d),y=n(8),v=r(y),m=n(12),b=r(m),g=n(19),w=r(g),S=n(18),x=r(S),O=n(10),E=r(O),j=n(2),T=r(j),P=function(e){function t(n){i(this,t);var r=a(this,e.call(this,n));r.state={hide:!0,visible:r.getResults.call(r,n.value,n.options),currentValue:n.value,selected:0};var o=["getResults","handleChange","handleSelected","handleHide","keyEvent","handleKeyDown","handleBlur","_onEnter","_onUp","_onDown","handleValidate","handleOutsideClick"];return o.forEach(function(e){return r[e]=r[e].bind(r)}),r}return s(t,e),t.prototype.componentDidMount=function(){this.props.scrollParentClass&&window.addEventListener("resize",this.handleHide)},t.prototype.componentWillReceiveProps=function(e){var t=this.state.currentValue;e.value!==this.props.value&&(t=e.value);var n=this.getResults(t,e.options);this.setState({currentValue:t,visible:n,selected:0})},t.prototype.componentWillUnmount=function(){this.props.scrollParentClass&&window.removeEventListener("resize",this.handleHide)},t.prototype.handleHide=function(){this.setState({hide:!0})},t.prototype.getResults=function(e,t){"undefined"==typeof e&&(e="");var n=b.default.filter(e.toString()||"",t,{pre:"<span class='"+this.props.matchedClass+"'>",post:"</span>",extract:this.props.extract}),r=n.findIndex(function(t){return t.original.value===e});if(r>-1){var o=n.splice(r,1)[0];n.unshift(o)}return this.props.maxVisible&&this.props.maxVisible>0&&(n=n.slice(0,this.props.maxVisible)),n},t.prototype.handleChange=function(e,t){var n=this,r={currentValue:e.target.value||"",selected:0};r.visible=r.currentValue.length>0?this.getResults(r.currentValue,this.props.options):[],r.hide=!1,1===r.visible.length&&(r.hide=r.visible[0].original.value===e.target.value),this.setState(r,function(){"function"==typeof n.props.onChange&&n.props.onChange({target:{value:n.state.currentValue}}),"function"==typeof t&&t()})},t.prototype.handleSelected=function(e,t){var n=this;if(t.stopPropagation(),"object"!==("undefined"==typeof e?"undefined":c(e)))throw new TypeError("Option is not an object");if(""!==this.state.currentValue.length&&0!==this.state.visible.length){var r={target:{value:e.original.value}};this.handleChange(r,function(){"function"==typeof n.props.onSelected&&n.props.onSelected(e,t);var r={hide:!0};n.props.clearOnSelect&&(r.currentValue="",r.selected=0,r.visible=[]),n.setState(r)})}},t.prototype.keyEvent=function(e){switch(e){case"Enter":return this.state.hide?void 0:this._onEnter;case"ArrowDown":case"Down":return this._onDown;case"ArrowUp":case"Up":return this._onUp;default:return}},t.prototype._onEnter=function(e){this.state.visible[this.state.selected]&&this.handleSelected(this.getSelected(),e)},t.prototype.getSelected=function(){return this.state.visible[this.state.selected]},t.prototype._onUp=function(){var e=this.state.selected;this.setState({selected:e>0?e-1:0})},t.prototype._onDown=function(){var e=this.state.selected,t=this.state.visible.length-1;this.setState({selected:e<t?e+1:t})},t.prototype.stopHiding=function(){this.state.hide===!0&&this.setState({hide:!1})},t.prototype.isSpecialKey=function(e){return["Alt","CapsLock","Control","Fn","Meta","Shift","Tab"].includes(e)},t.prototype.handleKeyDown=function(e){this.isSpecialKey(e.key)||this.stopHiding();var t=this.keyEvent(e.key);"function"==typeof t&&(e.preventDefault(),t.call(this,e)),"function"==typeof this.props.onKeyDown&&this.props.onKeyDown(e)},t.prototype.handleOutsideClick=function(){this.setState({hide:!0})},t.prototype.handleBlur=function(e){"function"==typeof this.props.onBlur&&this.props.onBlur(e),this.setState({hide:!0})},t.prototype.renderEmpty=function(e){return f.default.createElement("div",{className:e},f.default.createElement("div",{className:"typeahead--container"},f.default.createElement("div",{className:"typeahead--input form-input"},this.state.currentValue)))},t.prototype.handleValidate=function(e){return"function"!=typeof this.props.validate||this.props.validate(e,this.getSelected())},t.prototype.getCurrentValue=function(){var e=this,t=this.props.options.find(function(t){return t.value===e.state.currentValue}),n=t?t.name:this.state.currentValue;return n},t.prototype.render=function(){var e,t=(0,v.default)("typeahead",this.props.className,(e={},o(e,T.default.editable,this.props.editable),o(e,"typeahead--editable",this.props.editable),e));if(!this.props.editable)return this.renderEmpty(t);var n=null;return this.refs.textInput&&"object"===c(this.refs.textInput)&&(n={editable:!0,validate:this.handleValidate,minRows:1,maxRows:1,error:this.props.error}),f.default.createElement("div",{className:t},f.default.createElement(x.default,{className:(0,v.default)("typeahead--container",T.default.container),onClick:this.handleOutsideClick.bind(this)},f.default.createElement("div",null,f.default.createElement(w.default,l({ref:"textInput",className:(0,v.default)("typeahead--input",T.default.input),onChange:this.handleChange,onKeyDown:this.handleKeyDown,onBlur:this.handleBlur,onFocus:this.props.onFocus,value:this.getCurrentValue(),label:this.props.placeholder},n)),this.props.isLoading?f.default.createElement("span",{className:(0,v.default)("icon-refresh",T.default.loading)}):null),f.default.createElement(E.default,{scrollingParentClass:this.props.scrollParentClass,onScrollingParentScroll:this.handleHide,hidden:this.state.hide,empty:this.state.hide||this.props.isLoading?void 0:this.props.empty,selected:this.state.selected,value:this.state.currentValue,extract:this.props.extract,visible:this.state.hide?[]:this.state.visible,onSelected:this.handleSelected})))},t}(f.default.Component),_=h.default.number,N=h.default.string,C=h.default.array,D=h.default.bool,k=h.default.func;P.propTypes={maxVisible:_,matchedClass:N,placeholder:N,value:N,label:N,options:C,clearOnSelect:D,editable:D,empty:D,isLoading:D,extract:k,onChange:k},P.defaultProps={isLoading:!1,editable:!0,empty:!1,options:[],label:"",value:"",placeholder:"",maxVisible:5,clearOnSelect:!1,matchedClass:"typeahead-found",extract:function(e){return e}},t.default=P},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function i(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){y&&d&&(y=!1,d.length?h=d.concat(h):v=-1,h.length&&s())}function s(){if(!y){var e=o(a);y=!0;for(var t=h.length;t;){for(d=h,h=[];++v<t;)d&&d[v].run();v=-1,t=h.length}d=null,y=!1,i(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,p,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(e){p=r}}();var d,h=[],y=!1,v=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new u(e,t)),1!==h.length||y||o(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t){e.exports={container:"typeahead--container",list:"typeahead--list",item:"typeahead--item",hidden:"typeahead--hidden",selected:"typeahead--selected",found:"typeahead--found",loading:"typeahead--loading",spin:"typeahead--spin",editable:"typeahead--editable"}},function(e,t,n){(function(t){if("production"!==t.env.NODE_ENV){var r="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,o=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},i=!0;e.exports=n(15)(o,i)}else e.exports=n(14)()}).call(t,n(1))},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){(function(t){"use strict";function n(e,t,n,o,i,a,s,u){if(r(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,o,i,a,s,u],p=0;l=new Error(t.replace(/%s/g,function(){return c[p++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var r=function(e){};"production"!==t.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),e.exports=n}).call(t,n(1))},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){(function(t){"use strict";var r=n(5),o=r;if("production"!==t.env.NODE_ENV){var i=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+e.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(e){}};o=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];i.apply(void 0,[t].concat(r))}}}e.exports=o}).call(t,n(1))},function(e,t,n){(function(e){"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"!==("undefined"==typeof t?"undefined":s(t))&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof t?"undefined":s(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)}var s="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};Object.defineProperty(t,"__esModule",{value:!0});var u=n(7),l=r(u),c=n(3),p=r(c),f=n(17),d=r(f),h=n(8),y=r(h),v=n(11),m=r(v),b=n(2),g=r(b),w=function(t){function n(e){o(this,n);var r=i(this,t.call(this,e));return r.state={fixedDropdownStyle:{top:"inherit",width:"inherit",left:"inherit",position:"fixed"}},r}return a(n,t),n.prototype.componentDidUpdate=function(e){this.shouldCalculateDropdownStyle(e)&&this.setState(this.fixedDropdownStyle())},n.prototype.componentWillUnmount=function(){this.scrollParent&&this.scrollParent.removeEventListener("scroll",this.props.onScrollingParentScroll)},n.prototype.shouldCalculateDropdownStyle=function(e){return this.props.scrollingParentClass&&this.props.visible.length>0&&(e.hidden&&!this.props.hidden||this.props.visible.length!==e.visible.length)},n.prototype.registerScrollParent=function(e){var t=d.default.findDOMNode(this);if(t)for(var n=t.parentNode;n&&n!==document;){if(n.classList.contains(e))return n.addEventListener("scroll",this.props.onScrollingParentScroll),this.scrollParent=n,n;n=n.parentNode}},n.prototype.fixedDropdownStyle=function(){if(!this.scrollParent&&!this.registerScrollParent(this.props.scrollingParentClass))return void("production"!==e.env.NODE_ENV&&console.error("<Typeahead /> could not get scrollParent for fixedDropdownStyle()"));for(var t=d.default.findDOMNode(this).parentNode,n=t,r=0,o=this.scrollParent.scrollTop;n;)r+=n.offsetTop,n=n.offsetParent;return{fixedDropdownStyle:{width:t.offsetWidth+"px",position:"fixed",left:"inherit",top:r-o+t.offsetHeight+"px"}}},n.prototype.getDropdownStyle=function(){return this.props.scrollingParentClass&&this.props.visible.length>0?this.state.fixedDropdownStyle:{}},n.prototype.hasOptions=function(){return this.props.value&&this.props.visible instanceof Array&&this.props.visible.length>0},n.prototype.render=function(){var e=this;if(0===this.props.visible.length&&this.props.empty!==!1)return l.default.createElement("ul",{className:g.default.list},l.default.createElement(m.default,{empty:this.props.empty}));var t=this.hasOptions()?g.default.list:(0,y.default)(g.default.list,g.default.hidden),n=this.getDropdownStyle();return l.default.createElement("ul",{style:n,className:(0,y.default)("typeahead--list",t)},this.props.visible.filter(function(e){return e&&e.score&&e.original}).sort(function(e,t){return t.score-e.score}).map(function(t,n){var r=e.props.extract(t.original);return l.default.createElement(m.default,{key:r,selected:e.props.selected===n,option:t,onClick:e.props.onSelected.bind(null,t)})}))},n}(l.default.Component);t.default=w;var S=p.default.number,x=p.default.string,O=p.default.array,E=p.default.bool,j=p.default.func;w.propTypes={selected:S,value:x,visible:O,empty:E,extract:j,onSelected:j},w.defaultProps={empty:!1,visible:[],onSelected:function(){}}}).call(t,n(1))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==("undefined"==typeof t?"undefined":u(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 "+("undefined"==typeof t?"undefined":u(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)}var u="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};Object.defineProperty(t,"__esModule",{value:!0});var l=n(7),c=r(l),p=n(3),f=r(p),d=n(8),h=r(d),y=n(2),v=r(y),m=function(e){function t(n){i(this,t);var r=a(this,e.call(this,n));return r.handleMouseDown=r.handleMouseDown.bind(r),r}return s(t,e),t.prototype.handleMouseDown=function(e){e.preventDefault(),"function"==typeof this.props.onClick&&this.props.onClick(e)},t.prototype.render=function(){var e=(0,h.default)("typeahead--item",v.default.item,o({"typeahead--selected":this.props.selected},v.default.selected,this.props.selected));return this.props.empty?c.default.createElement("li",{className:e},"string"==typeof this.props.empty?this.props.empty:"No Results..."):c.default.createElement("li",{className:e,onMouseDown:this.handleMouseDown,dangerouslySetInnerHTML:{__html:this.props.option.string}})},t}(c.default.Component);t.default=m;var b=f.default.bool,g=f.default.object;m.propTypes={selected:b,empty:b,option:g},m.defaultProps={empty:!1,option:{original:"",string:""}}},function(e,t,n){!function(){var t={};e.exports=t,t.simpleFilter=function(e,n){return n.filter(function(n){return t.test(e,n)})},t.test=function(e,n){return null!==t.match(e,n)},t.match=function(e,t,n){n=n||{};var r,o=0,i=[],a=t.length,s=0,u=0,l=n.pre||"",c=n.post||"",p=n.caseSensitive&&t||t.toLowerCase();e=n.caseSensitive&&e||e.toLowerCase();for(var f=0;f<a;f++)r=t[f],p[f]===e[o]?(r=l+r+c,o+=1,u+=1+u):u=0,s+=u,i[i.length]=r;return o===e.length?(s=p===e?1/0:s,{rendered:i.join(""),score:s}):null},t.filter=function(e,n,r){return n&&0!==n.length?"string"!=typeof e?n:(r=r||{},n.reduce(function(n,o,i,a){var s=o;r.extract&&(s=r.extract(o));var u=t.match(e,s,r);return null!=u&&(n[n.length]={string:u.rendered,score:u.score,index:i,original:o}),n},[]).sort(function(e,t){var n=t.score-e.score;return n?n:e.index-t.index})):[]}}()},function(e,t,n){(function(t){"use strict";function r(e,n,r,u,l){if("production"!==t.env.NODE_ENV)for(var c in e)if(e.hasOwnProperty(c)){var p;try{o("function"==typeof e[c],"%s: %s type `%s` is invalid; it must be a function, usually from the `prop-types` package, but received `%s`.",u||"React class",r,c,typeof e[c]),p=e[c](n,c,u,r,null,a)}catch(e){p=e}if(i(!p||p 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).",u||"React class",r,c,typeof p),p instanceof Error&&!(p.message in s)){s[p.message]=!0;var f=l?l():"";i(!1,"Failed %s type: %s%s",r,p.message,null!=f?f:"")}}}if("production"!==t.env.NODE_ENV)var o=n(6),i=n(9),a=n(4),s={};e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";var r=n(5),o=n(6),i=n(4);e.exports=function(){function e(e,t,n,r,a,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,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){(function(t){"use strict";var r=n(5),o=n(6),i=n(9),a=n(16),s=n(4),u=n(13);e.exports=function(e,n){function l(e){var t=e&&(C&&e[C]||e[D]);if("function"==typeof t)return t}function c(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function p(e){this.message=e,this.stack=""}function f(e){function r(r,l,c,f,d,h,y){if(f=f||k,h=h||c,y!==s)if(n)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 if("production"!==t.env.NODE_ENV&&"undefined"!=typeof console){var v=f+":"+c;!a[v]&&u<3&&(i(!1,"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.",h,f),a[v]=!0,u++)}return null==l[c]?r?new p(null===l[c]?"The "+d+" `"+h+"` is marked as required "+("in `"+f+"`, but its value is `null`."):"The "+d+" `"+h+"` is marked as required in "+("`"+f+"`, but its value is `undefined`.")):null:e(l,c,f,d,h)}if("production"!==t.env.NODE_ENV)var a={},u=0;var l=r.bind(null,!1);return l.isRequired=r.bind(null,!0),l}function d(e){function t(t,n,r,o,i,a){var s=t[n],u=T(s);if(u!==e){var l=P(s);return new p("Invalid "+o+" `"+i+"` of type "+("`"+l+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return f(t)}function h(){return f(r.thatReturnsNull)}function y(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a)){var u=T(a);return new p("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l<a.length;l++){var c=e(a,l,r,o,i+"["+l+"]",s);if(c instanceof Error)return c}return null}return f(t)}function v(){function t(t,n,r,o,i){var a=t[n];if(!e(a)){var s=T(a);return new p("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return f(t)}function m(e){function t(t,n,r,o,i){if(!(t[n]instanceof e)){var a=e.name||k,s=N(t[n]);return new p("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("instance of `"+a+"`."))}return null}return f(t)}function b(e){function n(t,n,r,o,i){for(var a=t[n],s=0;s<e.length;s++)if(c(a,e[s]))return null;var u=JSON.stringify(e);return new p("Invalid "+o+" `"+i+"` of value `"+a+"` "+("supplied to `"+r+"`, expected one of "+u+"."))}return Array.isArray(e)?f(n):("production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function g(e){function t(t,n,r,o,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],u=T(a);if("object"!==u)return new p("Invalid "+o+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an object."));for(var l in a)if(a.hasOwnProperty(l)){var c=e(a,l,r,o,i+"."+l,s);if(c instanceof Error)return c}return null}return f(t)}function w(e){function n(t,n,r,o,i){for(var a=0;a<e.length;a++){var u=e[a];if(null==u(t,n,r,o,i,s))return null}return new p("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}if(!Array.isArray(e))return"production"!==t.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull;for(var o=0;o<e.length;o++){var a=e[o];if("function"!=typeof a)return i(!1,"Invalid argument supplied to oneOfType. Expected an array of check functions, but received %s at index %s.",_(a),o),r.thatReturnsNull}return f(n)}function S(){function e(e,t,n,r,o){return E(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return f(e)}function x(e){function t(t,n,r,o,i){var a=t[n],u=T(a);if("object"!==u)return new p("Invalid "+o+" `"+i+"` of type `"+u+"` "+("supplied to `"+r+"`, expected `object`."));for(var l in e){var c=e[l];if(c){var f=c(a,l,r,o,i+"."+l,s);if(f)return f}}return null}return f(t)}function O(e){function t(t,n,r,o,i){var u=t[n],l=T(u);if("object"!==l)return new p("Invalid "+o+" `"+i+"` of type `"+l+"` "+("supplied to `"+r+"`, expected `object`."));var c=a({},t[n],e);for(var f in c){var d=e[f];if(!d)return new p("Invalid "+o+" `"+i+"` key `"+f+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=d(u,f,r,o,i+"."+f,s);if(h)return h}return null}return f(t)}function E(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(E);if(null===t||e(t))return!0;var n=l(t);if(!n)return!1;var r,o=n.call(t);if(n!==t.entries){for(;!(r=o.next()).done;)if(!E(r.value))return!1}else for(;!(r=o.next()).done;){var i=r.value;if(i&&!E(i[1]))return!1}return!0;default:return!1}}function j(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function T(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":j(t,e)?"symbol":t}function P(e){if("undefined"==typeof e||null===e)return""+e;var t=T(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function _(e){var t=P(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}function N(e){return e.constructor&&e.constructor.name?e.constructor.name:k}var C="function"==typeof Symbol&&Symbol.iterator,D="@@iterator",k="<<anonymous>>",R={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),symbol:d("symbol"),any:h(),arrayOf:y,element:v(),instanceOf:m,node:S(),objectOf:g,oneOf:b,oneOfType:w,shape:x,exact:O};return p.prototype=Error.prototype,R.checkPropTypes=u,R.PropTypes=R,R}}).call(t,n(1))},function(e,t){/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){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;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,s,u=n(e),l=1;l<arguments.length;l++){r=Object(arguments[l]);for(var c in r)i.call(r,c)&&(u[c]=r[c]);if(o){s=o(r);for(var p=0;p<s.length;p++)a.call(r,s[p])&&(u[s[p]]=r[s[p]])}}return u}},function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t){e.exports=o}])});
//# sourceMappingURL=Typeahead.min.js.map