UNPKG

364 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom')) :
3 typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom'], factory) :
4 (global = global || self, factory(global.Reactstrap = {}, global.React, global.ReactDOM));
5}(this, function (exports, React, ReactDOM) { 'use strict';
6
7 var React__default = 'default' in React ? React['default'] : React;
8 ReactDOM = ReactDOM && ReactDOM.hasOwnProperty('default') ? ReactDOM['default'] : ReactDOM;
9
10 function _extends() {
11 _extends = Object.assign || function (target) {
12 for (var i = 1; i < arguments.length; i++) {
13 var source = arguments[i];
14
15 for (var key in source) {
16 if (Object.prototype.hasOwnProperty.call(source, key)) {
17 target[key] = source[key];
18 }
19 }
20 }
21
22 return target;
23 };
24
25 return _extends.apply(this, arguments);
26 }
27
28 function _inheritsLoose(subClass, superClass) {
29 subClass.prototype = Object.create(superClass.prototype);
30 subClass.prototype.constructor = subClass;
31 subClass.__proto__ = superClass;
32 }
33
34 function _objectWithoutPropertiesLoose(source, excluded) {
35 if (source == null) return {};
36 var target = {};
37 var sourceKeys = Object.keys(source);
38 var key, i;
39
40 for (i = 0; i < sourceKeys.length; i++) {
41 key = sourceKeys[i];
42 if (excluded.indexOf(key) >= 0) continue;
43 target[key] = source[key];
44 }
45
46 return target;
47 }
48
49 function _assertThisInitialized(self) {
50 if (self === void 0) {
51 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
52 }
53
54 return self;
55 }
56
57 var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
58
59 function unwrapExports (x) {
60 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
61 }
62
63 function createCommonjsModule(fn, module) {
64 return module = { exports: {} }, fn(module, module.exports), module.exports;
65 }
66
67 var reactIs_production_min = createCommonjsModule(function (module, exports) {
68
69 Object.defineProperty(exports, "__esModule", {
70 value: !0
71 });
72 var b = "function" === typeof Symbol && Symbol.for,
73 c = b ? Symbol.for("react.element") : 60103,
74 d = b ? Symbol.for("react.portal") : 60106,
75 e = b ? Symbol.for("react.fragment") : 60107,
76 f = b ? Symbol.for("react.strict_mode") : 60108,
77 g = b ? Symbol.for("react.profiler") : 60114,
78 h = b ? Symbol.for("react.provider") : 60109,
79 k = b ? Symbol.for("react.context") : 60110,
80 l = b ? Symbol.for("react.async_mode") : 60111,
81 m = b ? Symbol.for("react.concurrent_mode") : 60111,
82 n = b ? Symbol.for("react.forward_ref") : 60112,
83 p = b ? Symbol.for("react.suspense") : 60113,
84 q = b ? Symbol.for("react.memo") : 60115,
85 r = b ? Symbol.for("react.lazy") : 60116;
86
87 function t(a) {
88 if ("object" === typeof a && null !== a) {
89 var u = a.$$typeof;
90
91 switch (u) {
92 case c:
93 switch (a = a.type, a) {
94 case l:
95 case m:
96 case e:
97 case g:
98 case f:
99 case p:
100 return a;
101
102 default:
103 switch (a = a && a.$$typeof, a) {
104 case k:
105 case n:
106 case h:
107 return a;
108
109 default:
110 return u;
111 }
112
113 }
114
115 case r:
116 case q:
117 case d:
118 return u;
119 }
120 }
121 }
122
123 function v(a) {
124 return t(a) === m;
125 }
126
127 exports.typeOf = t;
128 exports.AsyncMode = l;
129 exports.ConcurrentMode = m;
130 exports.ContextConsumer = k;
131 exports.ContextProvider = h;
132 exports.Element = c;
133 exports.ForwardRef = n;
134 exports.Fragment = e;
135 exports.Lazy = r;
136 exports.Memo = q;
137 exports.Portal = d;
138 exports.Profiler = g;
139 exports.StrictMode = f;
140 exports.Suspense = p;
141
142 exports.isValidElementType = function (a) {
143 return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || "object" === typeof a && null !== a && (a.$$typeof === r || a.$$typeof === q || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n);
144 };
145
146 exports.isAsyncMode = function (a) {
147 return v(a) || t(a) === l;
148 };
149
150 exports.isConcurrentMode = v;
151
152 exports.isContextConsumer = function (a) {
153 return t(a) === k;
154 };
155
156 exports.isContextProvider = function (a) {
157 return t(a) === h;
158 };
159
160 exports.isElement = function (a) {
161 return "object" === typeof a && null !== a && a.$$typeof === c;
162 };
163
164 exports.isForwardRef = function (a) {
165 return t(a) === n;
166 };
167
168 exports.isFragment = function (a) {
169 return t(a) === e;
170 };
171
172 exports.isLazy = function (a) {
173 return t(a) === r;
174 };
175
176 exports.isMemo = function (a) {
177 return t(a) === q;
178 };
179
180 exports.isPortal = function (a) {
181 return t(a) === d;
182 };
183
184 exports.isProfiler = function (a) {
185 return t(a) === g;
186 };
187
188 exports.isStrictMode = function (a) {
189 return t(a) === f;
190 };
191
192 exports.isSuspense = function (a) {
193 return t(a) === p;
194 };
195 });
196 unwrapExports(reactIs_production_min);
197 var reactIs_production_min_1 = reactIs_production_min.typeOf;
198 var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
199 var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
200 var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
201 var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
202 var reactIs_production_min_6 = reactIs_production_min.Element;
203 var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
204 var reactIs_production_min_8 = reactIs_production_min.Fragment;
205 var reactIs_production_min_9 = reactIs_production_min.Lazy;
206 var reactIs_production_min_10 = reactIs_production_min.Memo;
207 var reactIs_production_min_11 = reactIs_production_min.Portal;
208 var reactIs_production_min_12 = reactIs_production_min.Profiler;
209 var reactIs_production_min_13 = reactIs_production_min.StrictMode;
210 var reactIs_production_min_14 = reactIs_production_min.Suspense;
211 var reactIs_production_min_15 = reactIs_production_min.isValidElementType;
212 var reactIs_production_min_16 = reactIs_production_min.isAsyncMode;
213 var reactIs_production_min_17 = reactIs_production_min.isConcurrentMode;
214 var reactIs_production_min_18 = reactIs_production_min.isContextConsumer;
215 var reactIs_production_min_19 = reactIs_production_min.isContextProvider;
216 var reactIs_production_min_20 = reactIs_production_min.isElement;
217 var reactIs_production_min_21 = reactIs_production_min.isForwardRef;
218 var reactIs_production_min_22 = reactIs_production_min.isFragment;
219 var reactIs_production_min_23 = reactIs_production_min.isLazy;
220 var reactIs_production_min_24 = reactIs_production_min.isMemo;
221 var reactIs_production_min_25 = reactIs_production_min.isPortal;
222 var reactIs_production_min_26 = reactIs_production_min.isProfiler;
223 var reactIs_production_min_27 = reactIs_production_min.isStrictMode;
224 var reactIs_production_min_28 = reactIs_production_min.isSuspense;
225
226 var reactIs_development = createCommonjsModule(function (module, exports) {
227 });
228 unwrapExports(reactIs_development);
229 var reactIs_development_1 = reactIs_development.typeOf;
230 var reactIs_development_2 = reactIs_development.AsyncMode;
231 var reactIs_development_3 = reactIs_development.ConcurrentMode;
232 var reactIs_development_4 = reactIs_development.ContextConsumer;
233 var reactIs_development_5 = reactIs_development.ContextProvider;
234 var reactIs_development_6 = reactIs_development.Element;
235 var reactIs_development_7 = reactIs_development.ForwardRef;
236 var reactIs_development_8 = reactIs_development.Fragment;
237 var reactIs_development_9 = reactIs_development.Lazy;
238 var reactIs_development_10 = reactIs_development.Memo;
239 var reactIs_development_11 = reactIs_development.Portal;
240 var reactIs_development_12 = reactIs_development.Profiler;
241 var reactIs_development_13 = reactIs_development.StrictMode;
242 var reactIs_development_14 = reactIs_development.Suspense;
243 var reactIs_development_15 = reactIs_development.isValidElementType;
244 var reactIs_development_16 = reactIs_development.isAsyncMode;
245 var reactIs_development_17 = reactIs_development.isConcurrentMode;
246 var reactIs_development_18 = reactIs_development.isContextConsumer;
247 var reactIs_development_19 = reactIs_development.isContextProvider;
248 var reactIs_development_20 = reactIs_development.isElement;
249 var reactIs_development_21 = reactIs_development.isForwardRef;
250 var reactIs_development_22 = reactIs_development.isFragment;
251 var reactIs_development_23 = reactIs_development.isLazy;
252 var reactIs_development_24 = reactIs_development.isMemo;
253 var reactIs_development_25 = reactIs_development.isPortal;
254 var reactIs_development_26 = reactIs_development.isProfiler;
255 var reactIs_development_27 = reactIs_development.isStrictMode;
256 var reactIs_development_28 = reactIs_development.isSuspense;
257
258 var reactIs = createCommonjsModule(function (module) {
259
260 {
261 module.exports = reactIs_production_min;
262 }
263 });
264
265 /*
266 object-assign
267 (c) Sindre Sorhus
268 @license MIT
269 */
270 /* eslint-disable no-unused-vars */
271
272 var getOwnPropertySymbols = Object.getOwnPropertySymbols;
273 var hasOwnProperty = Object.prototype.hasOwnProperty;
274 var propIsEnumerable = Object.prototype.propertyIsEnumerable;
275
276 function toObject(val) {
277 if (val === null || val === undefined) {
278 throw new TypeError('Object.assign cannot be called with null or undefined');
279 }
280
281 return Object(val);
282 }
283
284 function shouldUseNative() {
285 try {
286 if (!Object.assign) {
287 return false;
288 } // Detect buggy property enumeration order in older V8 versions.
289 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
290
291
292 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
293
294 test1[5] = 'de';
295
296 if (Object.getOwnPropertyNames(test1)[0] === '5') {
297 return false;
298 } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
299
300
301 var test2 = {};
302
303 for (var i = 0; i < 10; i++) {
304 test2['_' + String.fromCharCode(i)] = i;
305 }
306
307 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
308 return test2[n];
309 });
310
311 if (order2.join('') !== '0123456789') {
312 return false;
313 } // https://bugs.chromium.org/p/v8/issues/detail?id=3056
314
315
316 var test3 = {};
317 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
318 test3[letter] = letter;
319 });
320
321 if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
322 return false;
323 }
324
325 return true;
326 } catch (err) {
327 // We don't expect any of the above to throw, but better to be safe.
328 return false;
329 }
330 }
331
332 var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
333 var from;
334 var to = toObject(target);
335 var symbols;
336
337 for (var s = 1; s < arguments.length; s++) {
338 from = Object(arguments[s]);
339
340 for (var key in from) {
341 if (hasOwnProperty.call(from, key)) {
342 to[key] = from[key];
343 }
344 }
345
346 if (getOwnPropertySymbols) {
347 symbols = getOwnPropertySymbols(from);
348
349 for (var i = 0; i < symbols.length; i++) {
350 if (propIsEnumerable.call(from, symbols[i])) {
351 to[symbols[i]] = from[symbols[i]];
352 }
353 }
354 }
355 }
356
357 return to;
358 };
359
360 /**
361 * Copyright (c) 2013-present, Facebook, Inc.
362 *
363 * This source code is licensed under the MIT license found in the
364 * LICENSE file in the root directory of this source tree.
365 */
366
367 var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
368 var ReactPropTypesSecret_1 = ReactPropTypesSecret;
369
370 var has = Function.call.bind(Object.prototype.hasOwnProperty);
371
372 function emptyFunction() {}
373
374 function emptyFunctionWithReset() {}
375
376 emptyFunctionWithReset.resetWarningCache = emptyFunction;
377
378 var factoryWithThrowingShims = function factoryWithThrowingShims() {
379 function shim(props, propName, componentName, location, propFullName, secret) {
380 if (secret === ReactPropTypesSecret_1) {
381 // It is still safe when called from React.
382 return;
383 }
384
385 var err = new Error('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');
386 err.name = 'Invariant Violation';
387 throw err;
388 }
389 shim.isRequired = shim;
390
391 function getShim() {
392 return shim;
393 }
394 // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
395
396 var ReactPropTypes = {
397 array: shim,
398 bool: shim,
399 func: shim,
400 number: shim,
401 object: shim,
402 string: shim,
403 symbol: shim,
404 any: shim,
405 arrayOf: getShim,
406 element: shim,
407 elementType: shim,
408 instanceOf: getShim,
409 node: shim,
410 objectOf: getShim,
411 oneOf: getShim,
412 oneOfType: getShim,
413 shape: getShim,
414 exact: getShim,
415 checkPropTypes: emptyFunctionWithReset,
416 resetWarningCache: emptyFunction
417 };
418 ReactPropTypes.PropTypes = ReactPropTypes;
419 return ReactPropTypes;
420 };
421
422 var propTypes = createCommonjsModule(function (module) {
423 /**
424 * Copyright (c) 2013-present, Facebook, Inc.
425 *
426 * This source code is licensed under the MIT license found in the
427 * LICENSE file in the root directory of this source tree.
428 */
429 {
430 // By explicitly using `prop-types` you are opting into new production behavior.
431 // http://fb.me/prop-types-in-prod
432 module.exports = factoryWithThrowingShims();
433 }
434 });
435
436 var classnames = createCommonjsModule(function (module) {
437 /*!
438 Copyright (c) 2017 Jed Watson.
439 Licensed under the MIT License (MIT), see
440 http://jedwatson.github.io/classnames
441 */
442
443 /* global define */
444 (function () {
445
446 var hasOwn = {}.hasOwnProperty;
447
448 function classNames() {
449 var classes = [];
450
451 for (var i = 0; i < arguments.length; i++) {
452 var arg = arguments[i];
453 if (!arg) continue;
454 var argType = typeof arg;
455
456 if (argType === 'string' || argType === 'number') {
457 classes.push(arg);
458 } else if (Array.isArray(arg) && arg.length) {
459 var inner = classNames.apply(null, arg);
460
461 if (inner) {
462 classes.push(inner);
463 }
464 } else if (argType === 'object') {
465 for (var key in arg) {
466 if (hasOwn.call(arg, key) && arg[key]) {
467 classes.push(key);
468 }
469 }
470 }
471 }
472
473 return classes.join(' ');
474 }
475
476 if (module.exports) {
477 classNames.default = classNames;
478 module.exports = classNames;
479 } else {
480 window.classNames = classNames;
481 }
482 })();
483 });
484
485 /**
486 * Lodash (Custom Build) <https://lodash.com/>
487 * Build: `lodash modularize exports="npm" -o ./`
488 * Copyright JS Foundation and other contributors <https://js.foundation/>
489 * Released under MIT license <https://lodash.com/license>
490 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
491 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
492 */
493
494 /** `Object#toString` result references. */
495
496 var asyncTag = '[object AsyncFunction]',
497 funcTag = '[object Function]',
498 genTag = '[object GeneratorFunction]',
499 nullTag = '[object Null]',
500 proxyTag = '[object Proxy]',
501 undefinedTag = '[object Undefined]';
502 /** Detect free variable `global` from Node.js. */
503
504 var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
505 /** Detect free variable `self`. */
506
507 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
508 /** Used as a reference to the global object. */
509
510 var root = freeGlobal || freeSelf || Function('return this')();
511 /** Used for built-in method references. */
512
513 var objectProto = Object.prototype;
514 /** Used to check objects for own properties. */
515
516 var hasOwnProperty$1 = objectProto.hasOwnProperty;
517 /**
518 * Used to resolve the
519 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
520 * of values.
521 */
522
523 var nativeObjectToString = objectProto.toString;
524 /** Built-in value references. */
525
526 var Symbol$1 = root.Symbol,
527 symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
528 /**
529 * The base implementation of `getTag` without fallbacks for buggy environments.
530 *
531 * @private
532 * @param {*} value The value to query.
533 * @returns {string} Returns the `toStringTag`.
534 */
535
536 function baseGetTag(value) {
537 if (value == null) {
538 return value === undefined ? undefinedTag : nullTag;
539 }
540
541 return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
542 }
543 /**
544 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
545 *
546 * @private
547 * @param {*} value The value to query.
548 * @returns {string} Returns the raw `toStringTag`.
549 */
550
551
552 function getRawTag(value) {
553 var isOwn = hasOwnProperty$1.call(value, symToStringTag),
554 tag = value[symToStringTag];
555
556 try {
557 value[symToStringTag] = undefined;
558 var unmasked = true;
559 } catch (e) {}
560
561 var result = nativeObjectToString.call(value);
562
563 if (unmasked) {
564 if (isOwn) {
565 value[symToStringTag] = tag;
566 } else {
567 delete value[symToStringTag];
568 }
569 }
570
571 return result;
572 }
573 /**
574 * Converts `value` to a string using `Object.prototype.toString`.
575 *
576 * @private
577 * @param {*} value The value to convert.
578 * @returns {string} Returns the converted string.
579 */
580
581
582 function objectToString(value) {
583 return nativeObjectToString.call(value);
584 }
585 /**
586 * Checks if `value` is classified as a `Function` object.
587 *
588 * @static
589 * @memberOf _
590 * @since 0.1.0
591 * @category Lang
592 * @param {*} value The value to check.
593 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
594 * @example
595 *
596 * _.isFunction(_);
597 * // => true
598 *
599 * _.isFunction(/abc/);
600 * // => false
601 */
602
603
604 function isFunction(value) {
605 if (!isObject(value)) {
606 return false;
607 } // The use of `Object#toString` avoids issues with the `typeof` operator
608 // in Safari 9 which returns 'object' for typed arrays and other constructors.
609
610
611 var tag = baseGetTag(value);
612 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
613 }
614 /**
615 * Checks if `value` is the
616 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
617 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
618 *
619 * @static
620 * @memberOf _
621 * @since 0.1.0
622 * @category Lang
623 * @param {*} value The value to check.
624 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
625 * @example
626 *
627 * _.isObject({});
628 * // => true
629 *
630 * _.isObject([1, 2, 3]);
631 * // => true
632 *
633 * _.isObject(_.noop);
634 * // => true
635 *
636 * _.isObject(null);
637 * // => false
638 */
639
640
641 function isObject(value) {
642 var type = typeof value;
643 return value != null && (type == 'object' || type == 'function');
644 }
645
646 var lodash_isfunction = isFunction;
647
648 function getScrollbarWidth() {
649 var scrollDiv = document.createElement('div'); // .modal-scrollbar-measure styles // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.4/scss/_modal.scss#L106-L113
650
651 scrollDiv.style.position = 'absolute';
652 scrollDiv.style.top = '-9999px';
653 scrollDiv.style.width = '50px';
654 scrollDiv.style.height = '50px';
655 scrollDiv.style.overflow = 'scroll';
656 document.body.appendChild(scrollDiv);
657 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
658 document.body.removeChild(scrollDiv);
659 return scrollbarWidth;
660 }
661 function setScrollbarWidth(padding) {
662 document.body.style.paddingRight = padding > 0 ? padding + "px" : null;
663 }
664 function isBodyOverflowing() {
665 return document.body.clientWidth < window.innerWidth;
666 }
667 function getOriginalBodyPadding() {
668 var style = window.getComputedStyle(document.body, null);
669 return parseInt(style && style.getPropertyValue('padding-right') || 0, 10);
670 }
671 function conditionallyUpdateScrollbar() {
672 var scrollbarWidth = getScrollbarWidth(); // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433
673
674 var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0];
675 var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0;
676
677 if (isBodyOverflowing()) {
678 setScrollbarWidth(bodyPadding + scrollbarWidth);
679 }
680 }
681 var globalCssModule;
682 function setGlobalCssModule(cssModule) {
683 globalCssModule = cssModule;
684 }
685 function mapToCssModules(className, cssModule) {
686 if (className === void 0) {
687 className = '';
688 }
689
690 if (cssModule === void 0) {
691 cssModule = globalCssModule;
692 }
693
694 if (!cssModule) return className;
695 return className.split(' ').map(function (c) {
696 return cssModule[c] || c;
697 }).join(' ');
698 }
699 /**
700 * Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`.
701 */
702
703 function omit(obj, omitKeys) {
704 var result = {};
705 Object.keys(obj).forEach(function (key) {
706 if (omitKeys.indexOf(key) === -1) {
707 result[key] = obj[key];
708 }
709 });
710 return result;
711 }
712 /**
713 * Returns a filtered copy of an object with only the specified keys.
714 */
715
716 function pick(obj, keys) {
717 var pickKeys = Array.isArray(keys) ? keys : [keys];
718 var length = pickKeys.length;
719 var key;
720 var result = {};
721
722 while (length > 0) {
723 length -= 1;
724 key = pickKeys[length];
725 result[key] = obj[key];
726 }
727
728 return result;
729 }
730 var warned = {};
731 function warnOnce(message) {
732 if (!warned[message]) {
733 /* istanbul ignore else */
734 if (typeof console !== 'undefined') {
735 console.error(message); // eslint-disable-line no-console
736 }
737
738 warned[message] = true;
739 }
740 }
741 function deprecated(propType, explanation) {
742 return function validate(props, propName, componentName) {
743 if (props[propName] !== null && typeof props[propName] !== 'undefined') {
744 warnOnce("\"" + propName + "\" property of \"" + componentName + "\" has been deprecated.\n" + explanation);
745 }
746
747 for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
748 rest[_key - 3] = arguments[_key];
749 }
750
751 return propType.apply(void 0, [props, propName, componentName].concat(rest));
752 };
753 } // Shim Element if needed (e.g. in Node environment)
754
755 var Element = typeof window === 'object' && window.Element || function () {};
756
757 function DOMElement(props, propName, componentName) {
758 if (!(props[propName] instanceof Element)) {
759 return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.');
760 }
761 }
762 var targetPropType = propTypes.oneOfType([propTypes.string, propTypes.func, DOMElement, propTypes.shape({
763 current: propTypes.any
764 })]);
765 var tagPropType = propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.shape({
766 $$typeof: propTypes.symbol,
767 render: propTypes.func
768 }), propTypes.arrayOf(propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.shape({
769 $$typeof: propTypes.symbol,
770 render: propTypes.func
771 })]))]);
772 /* eslint key-spacing: ["error", { afterColon: true, align: "value" }] */
773 // These are all setup to match what is in the bootstrap _variables.scss
774 // https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss
775
776 var TransitionTimeouts = {
777 Fade: 150,
778 // $transition-fade
779 Collapse: 350,
780 // $transition-collapse
781 Modal: 300,
782 // $modal-transition
783 Carousel: 600 // $carousel-transition
784
785 }; // Duplicated Transition.propType keys to ensure that Reactstrap builds
786 // for distribution properly exclude these keys for nested child HTML attributes
787 // since `react-transition-group` removes propTypes in production builds.
788
789 var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'];
790 var TransitionStatuses = {
791 ENTERING: 'entering',
792 ENTERED: 'entered',
793 EXITING: 'exiting',
794 EXITED: 'exited'
795 };
796 var keyCodes = {
797 esc: 27,
798 space: 32,
799 enter: 13,
800 tab: 9,
801 up: 38,
802 down: 40,
803 home: 36,
804 end: 35,
805 n: 78,
806 p: 80
807 };
808 var PopperPlacements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
809 var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
810 function isReactRefObj(target) {
811 if (target && typeof target === 'object') {
812 return 'current' in target;
813 }
814
815 return false;
816 }
817 function findDOMElements(target) {
818 if (isReactRefObj(target)) {
819 return target.current;
820 }
821
822 if (lodash_isfunction(target)) {
823 return target();
824 }
825
826 if (typeof target === 'string' && canUseDOM) {
827 var selection = document.querySelectorAll(target);
828
829 if (!selection.length) {
830 selection = document.querySelectorAll("#" + target);
831 }
832
833 if (!selection.length) {
834 throw new Error("The target '" + target + "' could not be identified in the dom, tip: check spelling");
835 }
836
837 return selection;
838 }
839
840 return target;
841 }
842 function isArrayOrNodeList(els) {
843 if (els === null) {
844 return false;
845 }
846
847 return Array.isArray(els) || canUseDOM && typeof els.length === 'number';
848 }
849 function getTarget(target) {
850 var els = findDOMElements(target);
851
852 if (isArrayOrNodeList(els)) {
853 return els[0];
854 }
855
856 return els;
857 }
858 var defaultToggleEvents = ['touchstart', 'click'];
859 function addMultipleEventListeners(_els, handler, _events, useCapture) {
860 var els = _els;
861
862 if (!isArrayOrNodeList(els)) {
863 els = [els];
864 }
865
866 var events = _events;
867
868 if (typeof events === 'string') {
869 events = events.split(/\s+/);
870 }
871
872 if (!isArrayOrNodeList(els) || typeof handler !== 'function' || !Array.isArray(events)) {
873 throw new Error("\n The first argument of this function must be DOM node or an array on DOM nodes or NodeList.\n The second must be a function.\n The third is a string or an array of strings that represents DOM events\n ");
874 }
875
876 Array.prototype.forEach.call(events, function (event) {
877 Array.prototype.forEach.call(els, function (el) {
878 el.addEventListener(event, handler, useCapture);
879 });
880 });
881 return function removeEvents() {
882 Array.prototype.forEach.call(events, function (event) {
883 Array.prototype.forEach.call(els, function (el) {
884 el.removeEventListener(event, handler, useCapture);
885 });
886 });
887 };
888 }
889 var focusableElements = ['a[href]', 'area[href]', 'input:not([disabled]):not([type=hidden])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'object', 'embed', '[tabindex]:not(.modal)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'];
890
891 var utils = /*#__PURE__*/Object.freeze({
892 getScrollbarWidth: getScrollbarWidth,
893 setScrollbarWidth: setScrollbarWidth,
894 isBodyOverflowing: isBodyOverflowing,
895 getOriginalBodyPadding: getOriginalBodyPadding,
896 conditionallyUpdateScrollbar: conditionallyUpdateScrollbar,
897 setGlobalCssModule: setGlobalCssModule,
898 mapToCssModules: mapToCssModules,
899 omit: omit,
900 pick: pick,
901 warnOnce: warnOnce,
902 deprecated: deprecated,
903 DOMElement: DOMElement,
904 targetPropType: targetPropType,
905 tagPropType: tagPropType,
906 TransitionTimeouts: TransitionTimeouts,
907 TransitionPropTypeKeys: TransitionPropTypeKeys,
908 TransitionStatuses: TransitionStatuses,
909 keyCodes: keyCodes,
910 PopperPlacements: PopperPlacements,
911 canUseDOM: canUseDOM,
912 isReactRefObj: isReactRefObj,
913 findDOMElements: findDOMElements,
914 isArrayOrNodeList: isArrayOrNodeList,
915 getTarget: getTarget,
916 defaultToggleEvents: defaultToggleEvents,
917 addMultipleEventListeners: addMultipleEventListeners,
918 focusableElements: focusableElements
919 });
920
921 var propTypes$1 = {
922 tag: tagPropType,
923 fluid: propTypes.bool,
924 className: propTypes.string,
925 cssModule: propTypes.object
926 };
927 var defaultProps = {
928 tag: 'div'
929 };
930
931 var Container = function Container(props) {
932 var className = props.className,
933 cssModule = props.cssModule,
934 fluid = props.fluid,
935 Tag = props.tag,
936 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "fluid", "tag"]);
937
938 var classes = mapToCssModules(classnames(className, fluid ? 'container-fluid' : 'container'), cssModule);
939 return React__default.createElement(Tag, _extends({}, attributes, {
940 className: classes
941 }));
942 };
943
944 Container.propTypes = propTypes$1;
945 Container.defaultProps = defaultProps;
946
947 var propTypes$2 = {
948 tag: tagPropType,
949 noGutters: propTypes.bool,
950 className: propTypes.string,
951 cssModule: propTypes.object,
952 form: propTypes.bool
953 };
954 var defaultProps$1 = {
955 tag: 'div'
956 };
957
958 var Row = function Row(props) {
959 var className = props.className,
960 cssModule = props.cssModule,
961 noGutters = props.noGutters,
962 Tag = props.tag,
963 form = props.form,
964 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "noGutters", "tag", "form"]);
965
966 var classes = mapToCssModules(classnames(className, noGutters ? 'no-gutters' : null, form ? 'form-row' : 'row'), cssModule);
967 return React__default.createElement(Tag, _extends({}, attributes, {
968 className: classes
969 }));
970 };
971
972 Row.propTypes = propTypes$2;
973 Row.defaultProps = defaultProps$1;
974
975 /**
976 * lodash 3.0.2 (Custom Build) <https://lodash.com/>
977 * Build: `lodash modern modularize exports="npm" -o ./`
978 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
979 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
980 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
981 * Available under MIT license <https://lodash.com/license>
982 */
983
984 /**
985 * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
986 * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
987 *
988 * @static
989 * @memberOf _
990 * @category Lang
991 * @param {*} value The value to check.
992 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
993 * @example
994 *
995 * _.isObject({});
996 * // => true
997 *
998 * _.isObject([1, 2, 3]);
999 * // => true
1000 *
1001 * _.isObject(1);
1002 * // => false
1003 */
1004 function isObject$1(value) {
1005 // Avoid a V8 JIT bug in Chrome 19-20.
1006 // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
1007 var type = typeof value;
1008 return !!value && (type == 'object' || type == 'function');
1009 }
1010
1011 var lodash_isobject = isObject$1;
1012
1013 var colWidths = ['xs', 'sm', 'md', 'lg', 'xl'];
1014 var stringOrNumberProp = propTypes.oneOfType([propTypes.number, propTypes.string]);
1015 var columnProps = propTypes.oneOfType([propTypes.bool, propTypes.number, propTypes.string, propTypes.shape({
1016 size: propTypes.oneOfType([propTypes.bool, propTypes.number, propTypes.string]),
1017 order: stringOrNumberProp,
1018 offset: stringOrNumberProp
1019 })]);
1020 var propTypes$3 = {
1021 tag: tagPropType,
1022 xs: columnProps,
1023 sm: columnProps,
1024 md: columnProps,
1025 lg: columnProps,
1026 xl: columnProps,
1027 className: propTypes.string,
1028 cssModule: propTypes.object,
1029 widths: propTypes.array
1030 };
1031 var defaultProps$2 = {
1032 tag: 'div',
1033 widths: colWidths
1034 };
1035
1036 var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) {
1037 if (colSize === true || colSize === '') {
1038 return isXs ? 'col' : "col-" + colWidth;
1039 } else if (colSize === 'auto') {
1040 return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
1041 }
1042
1043 return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
1044 };
1045
1046 var Col = function Col(props) {
1047 var className = props.className,
1048 cssModule = props.cssModule,
1049 widths = props.widths,
1050 Tag = props.tag,
1051 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "widths", "tag"]);
1052
1053 var colClasses = [];
1054 widths.forEach(function (colWidth, i) {
1055 var columnProp = props[colWidth];
1056 delete attributes[colWidth];
1057
1058 if (!columnProp && columnProp !== '') {
1059 return;
1060 }
1061
1062 var isXs = !i;
1063
1064 if (lodash_isobject(columnProp)) {
1065 var _classNames;
1066
1067 var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
1068 var colClass = getColumnSizeClass(isXs, colWidth, columnProp.size);
1069 colClasses.push(mapToCssModules(classnames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames)), cssModule));
1070 } else {
1071 var _colClass = getColumnSizeClass(isXs, colWidth, columnProp);
1072
1073 colClasses.push(_colClass);
1074 }
1075 });
1076
1077 if (!colClasses.length) {
1078 colClasses.push('col');
1079 }
1080
1081 var classes = mapToCssModules(classnames(className, colClasses), cssModule);
1082 return React__default.createElement(Tag, _extends({}, attributes, {
1083 className: classes
1084 }));
1085 };
1086
1087 Col.propTypes = propTypes$3;
1088 Col.defaultProps = defaultProps$2;
1089
1090 var propTypes$4 = {
1091 light: propTypes.bool,
1092 dark: propTypes.bool,
1093 full: propTypes.bool,
1094 fixed: propTypes.string,
1095 sticky: propTypes.string,
1096 color: propTypes.string,
1097 role: propTypes.string,
1098 tag: tagPropType,
1099 className: propTypes.string,
1100 cssModule: propTypes.object,
1101 expand: propTypes.oneOfType([propTypes.bool, propTypes.string])
1102 };
1103 var defaultProps$3 = {
1104 tag: 'nav',
1105 expand: false
1106 };
1107
1108 var getExpandClass = function getExpandClass(expand) {
1109 if (expand === false) {
1110 return false;
1111 } else if (expand === true || expand === 'xs') {
1112 return 'navbar-expand';
1113 }
1114
1115 return "navbar-expand-" + expand;
1116 };
1117
1118 var Navbar = function Navbar(props) {
1119 var _classNames;
1120
1121 var expand = props.expand,
1122 className = props.className,
1123 cssModule = props.cssModule,
1124 light = props.light,
1125 dark = props.dark,
1126 fixed = props.fixed,
1127 sticky = props.sticky,
1128 color = props.color,
1129 Tag = props.tag,
1130 attributes = _objectWithoutPropertiesLoose(props, ["expand", "className", "cssModule", "light", "dark", "fixed", "sticky", "color", "tag"]);
1131
1132 var classes = mapToCssModules(classnames(className, 'navbar', getExpandClass(expand), (_classNames = {
1133 'navbar-light': light,
1134 'navbar-dark': dark
1135 }, _classNames["bg-" + color] = color, _classNames["fixed-" + fixed] = fixed, _classNames["sticky-" + sticky] = sticky, _classNames)), cssModule);
1136 return React__default.createElement(Tag, _extends({}, attributes, {
1137 className: classes
1138 }));
1139 };
1140
1141 Navbar.propTypes = propTypes$4;
1142 Navbar.defaultProps = defaultProps$3;
1143
1144 var propTypes$5 = {
1145 tag: tagPropType,
1146 className: propTypes.string,
1147 cssModule: propTypes.object
1148 };
1149 var defaultProps$4 = {
1150 tag: 'a'
1151 };
1152
1153 var NavbarBrand = function NavbarBrand(props) {
1154 var className = props.className,
1155 cssModule = props.cssModule,
1156 Tag = props.tag,
1157 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
1158
1159 var classes = mapToCssModules(classnames(className, 'navbar-brand'), cssModule);
1160 return React__default.createElement(Tag, _extends({}, attributes, {
1161 className: classes
1162 }));
1163 };
1164
1165 NavbarBrand.propTypes = propTypes$5;
1166 NavbarBrand.defaultProps = defaultProps$4;
1167
1168 var propTypes$6 = {
1169 tag: tagPropType,
1170 type: propTypes.string,
1171 className: propTypes.string,
1172 cssModule: propTypes.object,
1173 children: propTypes.node
1174 };
1175 var defaultProps$5 = {
1176 tag: 'button',
1177 type: 'button'
1178 };
1179
1180 var NavbarToggler = function NavbarToggler(props) {
1181 var className = props.className,
1182 cssModule = props.cssModule,
1183 children = props.children,
1184 Tag = props.tag,
1185 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "tag"]);
1186
1187 var classes = mapToCssModules(classnames(className, 'navbar-toggler'), cssModule);
1188 return React__default.createElement(Tag, _extends({}, attributes, {
1189 className: classes
1190 }), children || React__default.createElement("span", {
1191 className: mapToCssModules('navbar-toggler-icon', cssModule)
1192 }));
1193 };
1194
1195 NavbarToggler.propTypes = propTypes$6;
1196 NavbarToggler.defaultProps = defaultProps$5;
1197
1198 var propTypes$7 = {
1199 tabs: propTypes.bool,
1200 pills: propTypes.bool,
1201 vertical: propTypes.oneOfType([propTypes.bool, propTypes.string]),
1202 horizontal: propTypes.string,
1203 justified: propTypes.bool,
1204 fill: propTypes.bool,
1205 navbar: propTypes.bool,
1206 card: propTypes.bool,
1207 tag: tagPropType,
1208 className: propTypes.string,
1209 cssModule: propTypes.object
1210 };
1211 var defaultProps$6 = {
1212 tag: 'ul',
1213 vertical: false
1214 };
1215
1216 var getVerticalClass = function getVerticalClass(vertical) {
1217 if (vertical === false) {
1218 return false;
1219 } else if (vertical === true || vertical === 'xs') {
1220 return 'flex-column';
1221 }
1222
1223 return "flex-" + vertical + "-column";
1224 };
1225
1226 var Nav = function Nav(props) {
1227 var className = props.className,
1228 cssModule = props.cssModule,
1229 tabs = props.tabs,
1230 pills = props.pills,
1231 vertical = props.vertical,
1232 horizontal = props.horizontal,
1233 justified = props.justified,
1234 fill = props.fill,
1235 navbar = props.navbar,
1236 card = props.card,
1237 Tag = props.tag,
1238 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabs", "pills", "vertical", "horizontal", "justified", "fill", "navbar", "card", "tag"]);
1239
1240 var classes = mapToCssModules(classnames(className, navbar ? 'navbar-nav' : 'nav', horizontal ? "justify-content-" + horizontal : false, getVerticalClass(vertical), {
1241 'nav-tabs': tabs,
1242 'card-header-tabs': card && tabs,
1243 'nav-pills': pills,
1244 'card-header-pills': card && pills,
1245 'nav-justified': justified,
1246 'nav-fill': fill
1247 }), cssModule);
1248 return React__default.createElement(Tag, _extends({}, attributes, {
1249 className: classes
1250 }));
1251 };
1252
1253 Nav.propTypes = propTypes$7;
1254 Nav.defaultProps = defaultProps$6;
1255
1256 var propTypes$8 = {
1257 tag: tagPropType,
1258 active: propTypes.bool,
1259 className: propTypes.string,
1260 cssModule: propTypes.object
1261 };
1262 var defaultProps$7 = {
1263 tag: 'li'
1264 };
1265
1266 var NavItem = function NavItem(props) {
1267 var className = props.className,
1268 cssModule = props.cssModule,
1269 active = props.active,
1270 Tag = props.tag,
1271 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
1272
1273 var classes = mapToCssModules(classnames(className, 'nav-item', active ? 'active' : false), cssModule);
1274 return React__default.createElement(Tag, _extends({}, attributes, {
1275 className: classes
1276 }));
1277 };
1278
1279 NavItem.propTypes = propTypes$8;
1280 NavItem.defaultProps = defaultProps$7;
1281
1282 var propTypes$9 = {
1283 tag: tagPropType,
1284 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
1285 disabled: propTypes.bool,
1286 active: propTypes.bool,
1287 className: propTypes.string,
1288 cssModule: propTypes.object,
1289 onClick: propTypes.func,
1290 href: propTypes.any
1291 };
1292 var defaultProps$8 = {
1293 tag: 'a'
1294 };
1295
1296 var NavLink =
1297 /*#__PURE__*/
1298 function (_React$Component) {
1299 _inheritsLoose(NavLink, _React$Component);
1300
1301 function NavLink(props) {
1302 var _this;
1303
1304 _this = _React$Component.call(this, props) || this;
1305 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
1306 return _this;
1307 }
1308
1309 var _proto = NavLink.prototype;
1310
1311 _proto.onClick = function onClick(e) {
1312 if (this.props.disabled) {
1313 e.preventDefault();
1314 return;
1315 }
1316
1317 if (this.props.href === '#') {
1318 e.preventDefault();
1319 }
1320
1321 if (this.props.onClick) {
1322 this.props.onClick(e);
1323 }
1324 };
1325
1326 _proto.render = function render() {
1327 var _this$props = this.props,
1328 className = _this$props.className,
1329 cssModule = _this$props.cssModule,
1330 active = _this$props.active,
1331 Tag = _this$props.tag,
1332 innerRef = _this$props.innerRef,
1333 attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "active", "tag", "innerRef"]);
1334
1335 var classes = mapToCssModules(classnames(className, 'nav-link', {
1336 disabled: attributes.disabled,
1337 active: active
1338 }), cssModule);
1339 return React__default.createElement(Tag, _extends({}, attributes, {
1340 ref: innerRef,
1341 onClick: this.onClick,
1342 className: classes
1343 }));
1344 };
1345
1346 return NavLink;
1347 }(React__default.Component);
1348
1349 NavLink.propTypes = propTypes$9;
1350 NavLink.defaultProps = defaultProps$8;
1351
1352 var propTypes$a = {
1353 tag: tagPropType,
1354 listTag: tagPropType,
1355 className: propTypes.string,
1356 listClassName: propTypes.string,
1357 cssModule: propTypes.object,
1358 children: propTypes.node,
1359 'aria-label': propTypes.string
1360 };
1361 var defaultProps$9 = {
1362 tag: 'nav',
1363 listTag: 'ol',
1364 'aria-label': 'breadcrumb'
1365 };
1366
1367 var Breadcrumb = function Breadcrumb(props) {
1368 var className = props.className,
1369 listClassName = props.listClassName,
1370 cssModule = props.cssModule,
1371 children = props.children,
1372 Tag = props.tag,
1373 ListTag = props.listTag,
1374 label = props['aria-label'],
1375 attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "children", "tag", "listTag", "aria-label"]);
1376
1377 var classes = mapToCssModules(classnames(className), cssModule);
1378 var listClasses = mapToCssModules(classnames('breadcrumb', listClassName), cssModule);
1379 return React__default.createElement(Tag, _extends({}, attributes, {
1380 className: classes,
1381 "aria-label": label
1382 }), React__default.createElement(ListTag, {
1383 className: listClasses
1384 }, children));
1385 };
1386
1387 Breadcrumb.propTypes = propTypes$a;
1388 Breadcrumb.defaultProps = defaultProps$9;
1389
1390 var propTypes$b = {
1391 tag: tagPropType,
1392 active: propTypes.bool,
1393 className: propTypes.string,
1394 cssModule: propTypes.object
1395 };
1396 var defaultProps$a = {
1397 tag: 'li'
1398 };
1399
1400 var BreadcrumbItem = function BreadcrumbItem(props) {
1401 var className = props.className,
1402 cssModule = props.cssModule,
1403 active = props.active,
1404 Tag = props.tag,
1405 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "active", "tag"]);
1406
1407 var classes = mapToCssModules(classnames(className, active ? 'active' : false, 'breadcrumb-item'), cssModule);
1408 return React__default.createElement(Tag, _extends({}, attributes, {
1409 className: classes,
1410 "aria-current": active ? 'page' : undefined
1411 }));
1412 };
1413
1414 BreadcrumbItem.propTypes = propTypes$b;
1415 BreadcrumbItem.defaultProps = defaultProps$a;
1416
1417 var propTypes$c = {
1418 active: propTypes.bool,
1419 'aria-label': propTypes.string,
1420 block: propTypes.bool,
1421 color: propTypes.string,
1422 disabled: propTypes.bool,
1423 outline: propTypes.bool,
1424 tag: tagPropType,
1425 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
1426 onClick: propTypes.func,
1427 size: propTypes.string,
1428 children: propTypes.node,
1429 className: propTypes.string,
1430 cssModule: propTypes.object,
1431 close: propTypes.bool
1432 };
1433 var defaultProps$b = {
1434 color: 'secondary',
1435 tag: 'button'
1436 };
1437
1438 var Button =
1439 /*#__PURE__*/
1440 function (_React$Component) {
1441 _inheritsLoose(Button, _React$Component);
1442
1443 function Button(props) {
1444 var _this;
1445
1446 _this = _React$Component.call(this, props) || this;
1447 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
1448 return _this;
1449 }
1450
1451 var _proto = Button.prototype;
1452
1453 _proto.onClick = function onClick(e) {
1454 if (this.props.disabled) {
1455 e.preventDefault();
1456 return;
1457 }
1458
1459 if (this.props.onClick) {
1460 this.props.onClick(e);
1461 }
1462 };
1463
1464 _proto.render = function render() {
1465 var _this$props = this.props,
1466 active = _this$props.active,
1467 ariaLabel = _this$props['aria-label'],
1468 block = _this$props.block,
1469 className = _this$props.className,
1470 close = _this$props.close,
1471 cssModule = _this$props.cssModule,
1472 color = _this$props.color,
1473 outline = _this$props.outline,
1474 size = _this$props.size,
1475 Tag = _this$props.tag,
1476 innerRef = _this$props.innerRef,
1477 attributes = _objectWithoutPropertiesLoose(_this$props, ["active", "aria-label", "block", "className", "close", "cssModule", "color", "outline", "size", "tag", "innerRef"]);
1478
1479 if (close && typeof attributes.children === 'undefined') {
1480 attributes.children = React__default.createElement("span", {
1481 "aria-hidden": true
1482 }, "\xD7");
1483 }
1484
1485 var btnOutlineColor = "btn" + (outline ? '-outline' : '') + "-" + color;
1486 var classes = mapToCssModules(classnames(className, {
1487 close: close
1488 }, close || 'btn', close || btnOutlineColor, size ? "btn-" + size : false, block ? 'btn-block' : false, {
1489 active: active,
1490 disabled: this.props.disabled
1491 }), cssModule);
1492
1493 if (attributes.href && Tag === 'button') {
1494 Tag = 'a';
1495 }
1496
1497 var defaultAriaLabel = close ? 'Close' : null;
1498 return React__default.createElement(Tag, _extends({
1499 type: Tag === 'button' && attributes.onClick ? 'button' : undefined
1500 }, attributes, {
1501 className: classes,
1502 ref: innerRef,
1503 onClick: this.onClick,
1504 "aria-label": ariaLabel || defaultAriaLabel
1505 }));
1506 };
1507
1508 return Button;
1509 }(React__default.Component);
1510
1511 Button.propTypes = propTypes$c;
1512 Button.defaultProps = defaultProps$b;
1513
1514 function _objectWithoutPropertiesLoose$1(source, excluded) {
1515 if (source == null) return {};
1516 var target = {};
1517 var sourceKeys = Object.keys(source);
1518 var key, i;
1519
1520 for (i = 0; i < sourceKeys.length; i++) {
1521 key = sourceKeys[i];
1522 if (excluded.indexOf(key) >= 0) continue;
1523 target[key] = source[key];
1524 }
1525
1526 return target;
1527 }
1528
1529 var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose$1;
1530
1531 var _extends_1 = createCommonjsModule(function (module) {
1532 function _extends() {
1533 module.exports = _extends = Object.assign || function (target) {
1534 for (var i = 1; i < arguments.length; i++) {
1535 var source = arguments[i];
1536
1537 for (var key in source) {
1538 if (Object.prototype.hasOwnProperty.call(source, key)) {
1539 target[key] = source[key];
1540 }
1541 }
1542 }
1543
1544 return target;
1545 };
1546
1547 return _extends.apply(this, arguments);
1548 }
1549
1550 module.exports = _extends;
1551 });
1552
1553 function _inheritsLoose$1(subClass, superClass) {
1554 subClass.prototype = Object.create(superClass.prototype);
1555 subClass.prototype.constructor = subClass;
1556 subClass.__proto__ = superClass;
1557 }
1558
1559 var inheritsLoose = _inheritsLoose$1;
1560
1561 function _assertThisInitialized$1(self) {
1562 if (self === void 0) {
1563 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1564 }
1565
1566 return self;
1567 }
1568
1569 var assertThisInitialized = _assertThisInitialized$1;
1570
1571 function _defineProperty(obj, key, value) {
1572 if (key in obj) {
1573 Object.defineProperty(obj, key, {
1574 value: value,
1575 enumerable: true,
1576 configurable: true,
1577 writable: true
1578 });
1579 } else {
1580 obj[key] = value;
1581 }
1582
1583 return obj;
1584 }
1585
1586 var defineProperty = _defineProperty;
1587
1588 /**!
1589 * @fileOverview Kickass library to create and place poppers near their reference elements.
1590 * @version 1.14.7
1591 * @license
1592 * Copyright (c) 2016 Federico Zivolo and contributors
1593 *
1594 * Permission is hereby granted, free of charge, to any person obtaining a copy
1595 * of this software and associated documentation files (the "Software"), to deal
1596 * in the Software without restriction, including without limitation the rights
1597 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1598 * copies of the Software, and to permit persons to whom the Software is
1599 * furnished to do so, subject to the following conditions:
1600 *
1601 * The above copyright notice and this permission notice shall be included in all
1602 * copies or substantial portions of the Software.
1603 *
1604 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1605 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1606 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1607 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1608 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1609 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1610 * SOFTWARE.
1611 */
1612 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
1613 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
1614 var timeoutDuration = 0;
1615
1616 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
1617 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
1618 timeoutDuration = 1;
1619 break;
1620 }
1621 }
1622
1623 function microtaskDebounce(fn) {
1624 var called = false;
1625 return function () {
1626 if (called) {
1627 return;
1628 }
1629
1630 called = true;
1631 window.Promise.resolve().then(function () {
1632 called = false;
1633 fn();
1634 });
1635 };
1636 }
1637
1638 function taskDebounce(fn) {
1639 var scheduled = false;
1640 return function () {
1641 if (!scheduled) {
1642 scheduled = true;
1643 setTimeout(function () {
1644 scheduled = false;
1645 fn();
1646 }, timeoutDuration);
1647 }
1648 };
1649 }
1650
1651 var supportsMicroTasks = isBrowser && window.Promise;
1652 /**
1653 * Create a debounced version of a method, that's asynchronously deferred
1654 * but called in the minimum time possible.
1655 *
1656 * @method
1657 * @memberof Popper.Utils
1658 * @argument {Function} fn
1659 * @returns {Function}
1660 */
1661
1662 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
1663 /**
1664 * Check if the given variable is a function
1665 * @method
1666 * @memberof Popper.Utils
1667 * @argument {Any} functionToCheck - variable to check
1668 * @returns {Boolean} answer to: is a function?
1669 */
1670
1671 function isFunction$1(functionToCheck) {
1672 var getType = {};
1673 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
1674 }
1675 /**
1676 * Get CSS computed property of the given element
1677 * @method
1678 * @memberof Popper.Utils
1679 * @argument {Eement} element
1680 * @argument {String} property
1681 */
1682
1683
1684 function getStyleComputedProperty(element, property) {
1685 if (element.nodeType !== 1) {
1686 return [];
1687 } // NOTE: 1 DOM access here
1688
1689
1690 var window = element.ownerDocument.defaultView;
1691 var css = window.getComputedStyle(element, null);
1692 return property ? css[property] : css;
1693 }
1694 /**
1695 * Returns the parentNode or the host of the element
1696 * @method
1697 * @memberof Popper.Utils
1698 * @argument {Element} element
1699 * @returns {Element} parent
1700 */
1701
1702
1703 function getParentNode(element) {
1704 if (element.nodeName === 'HTML') {
1705 return element;
1706 }
1707
1708 return element.parentNode || element.host;
1709 }
1710 /**
1711 * Returns the scrolling parent of the given element
1712 * @method
1713 * @memberof Popper.Utils
1714 * @argument {Element} element
1715 * @returns {Element} scroll parent
1716 */
1717
1718
1719 function getScrollParent(element) {
1720 // Return body, `getScroll` will take care to get the correct `scrollTop` from it
1721 if (!element) {
1722 return document.body;
1723 }
1724
1725 switch (element.nodeName) {
1726 case 'HTML':
1727 case 'BODY':
1728 return element.ownerDocument.body;
1729
1730 case '#document':
1731 return element.body;
1732 } // Firefox want us to check `-x` and `-y` variations as well
1733
1734
1735 var _getStyleComputedProp = getStyleComputedProperty(element),
1736 overflow = _getStyleComputedProp.overflow,
1737 overflowX = _getStyleComputedProp.overflowX,
1738 overflowY = _getStyleComputedProp.overflowY;
1739
1740 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
1741 return element;
1742 }
1743
1744 return getScrollParent(getParentNode(element));
1745 }
1746
1747 var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
1748 var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
1749 /**
1750 * Determines if the browser is Internet Explorer
1751 * @method
1752 * @memberof Popper.Utils
1753 * @param {Number} version to check
1754 * @returns {Boolean} isIE
1755 */
1756
1757 function isIE(version) {
1758 if (version === 11) {
1759 return isIE11;
1760 }
1761
1762 if (version === 10) {
1763 return isIE10;
1764 }
1765
1766 return isIE11 || isIE10;
1767 }
1768 /**
1769 * Returns the offset parent of the given element
1770 * @method
1771 * @memberof Popper.Utils
1772 * @argument {Element} element
1773 * @returns {Element} offset parent
1774 */
1775
1776
1777 function getOffsetParent(element) {
1778 if (!element) {
1779 return document.documentElement;
1780 }
1781
1782 var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here
1783
1784 var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent
1785
1786 while (offsetParent === noOffsetParent && element.nextElementSibling) {
1787 offsetParent = (element = element.nextElementSibling).offsetParent;
1788 }
1789
1790 var nodeName = offsetParent && offsetParent.nodeName;
1791
1792 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
1793 return element ? element.ownerDocument.documentElement : document.documentElement;
1794 } // .offsetParent will return the closest TH, TD or TABLE in case
1795 // no offsetParent is present, I hate this job...
1796
1797
1798 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
1799 return getOffsetParent(offsetParent);
1800 }
1801
1802 return offsetParent;
1803 }
1804
1805 function isOffsetContainer(element) {
1806 var nodeName = element.nodeName;
1807
1808 if (nodeName === 'BODY') {
1809 return false;
1810 }
1811
1812 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
1813 }
1814 /**
1815 * Finds the root node (document, shadowDOM root) of the given element
1816 * @method
1817 * @memberof Popper.Utils
1818 * @argument {Element} node
1819 * @returns {Element} root node
1820 */
1821
1822
1823 function getRoot(node) {
1824 if (node.parentNode !== null) {
1825 return getRoot(node.parentNode);
1826 }
1827
1828 return node;
1829 }
1830 /**
1831 * Finds the offset parent common to the two provided nodes
1832 * @method
1833 * @memberof Popper.Utils
1834 * @argument {Element} element1
1835 * @argument {Element} element2
1836 * @returns {Element} common offset parent
1837 */
1838
1839
1840 function findCommonOffsetParent(element1, element2) {
1841 // This check is needed to avoid errors in case one of the elements isn't defined for any reason
1842 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
1843 return document.documentElement;
1844 } // Here we make sure to give as "start" the element that comes first in the DOM
1845
1846
1847 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
1848 var start = order ? element1 : element2;
1849 var end = order ? element2 : element1; // Get common ancestor container
1850
1851 var range = document.createRange();
1852 range.setStart(start, 0);
1853 range.setEnd(end, 0);
1854 var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document
1855
1856 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
1857 if (isOffsetContainer(commonAncestorContainer)) {
1858 return commonAncestorContainer;
1859 }
1860
1861 return getOffsetParent(commonAncestorContainer);
1862 } // one of the nodes is inside shadowDOM, find which one
1863
1864
1865 var element1root = getRoot(element1);
1866
1867 if (element1root.host) {
1868 return findCommonOffsetParent(element1root.host, element2);
1869 } else {
1870 return findCommonOffsetParent(element1, getRoot(element2).host);
1871 }
1872 }
1873 /**
1874 * Gets the scroll value of the given element in the given side (top and left)
1875 * @method
1876 * @memberof Popper.Utils
1877 * @argument {Element} element
1878 * @argument {String} side `top` or `left`
1879 * @returns {number} amount of scrolled pixels
1880 */
1881
1882
1883 function getScroll(element) {
1884 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
1885 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
1886 var nodeName = element.nodeName;
1887
1888 if (nodeName === 'BODY' || nodeName === 'HTML') {
1889 var html = element.ownerDocument.documentElement;
1890 var scrollingElement = element.ownerDocument.scrollingElement || html;
1891 return scrollingElement[upperSide];
1892 }
1893
1894 return element[upperSide];
1895 }
1896 /*
1897 * Sum or subtract the element scroll values (left and top) from a given rect object
1898 * @method
1899 * @memberof Popper.Utils
1900 * @param {Object} rect - Rect object you want to change
1901 * @param {HTMLElement} element - The element from the function reads the scroll values
1902 * @param {Boolean} subtract - set to true if you want to subtract the scroll values
1903 * @return {Object} rect - The modifier rect object
1904 */
1905
1906
1907 function includeScroll(rect, element) {
1908 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1909 var scrollTop = getScroll(element, 'top');
1910 var scrollLeft = getScroll(element, 'left');
1911 var modifier = subtract ? -1 : 1;
1912 rect.top += scrollTop * modifier;
1913 rect.bottom += scrollTop * modifier;
1914 rect.left += scrollLeft * modifier;
1915 rect.right += scrollLeft * modifier;
1916 return rect;
1917 }
1918 /*
1919 * Helper to detect borders of a given element
1920 * @method
1921 * @memberof Popper.Utils
1922 * @param {CSSStyleDeclaration} styles
1923 * Result of `getStyleComputedProperty` on the given element
1924 * @param {String} axis - `x` or `y`
1925 * @return {number} borders - The borders size of the given axis
1926 */
1927
1928
1929 function getBordersSize(styles, axis) {
1930 var sideA = axis === 'x' ? 'Left' : 'Top';
1931 var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
1932 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
1933 }
1934
1935 function getSize(axis, body, html, computedStyle) {
1936 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
1937 }
1938
1939 function getWindowSizes(document) {
1940 var body = document.body;
1941 var html = document.documentElement;
1942 var computedStyle = isIE(10) && getComputedStyle(html);
1943 return {
1944 height: getSize('Height', body, html, computedStyle),
1945 width: getSize('Width', body, html, computedStyle)
1946 };
1947 }
1948
1949 var classCallCheck = function classCallCheck(instance, Constructor) {
1950 if (!(instance instanceof Constructor)) {
1951 throw new TypeError("Cannot call a class as a function");
1952 }
1953 };
1954
1955 var createClass = function () {
1956 function defineProperties(target, props) {
1957 for (var i = 0; i < props.length; i++) {
1958 var descriptor = props[i];
1959 descriptor.enumerable = descriptor.enumerable || false;
1960 descriptor.configurable = true;
1961 if ("value" in descriptor) descriptor.writable = true;
1962 Object.defineProperty(target, descriptor.key, descriptor);
1963 }
1964 }
1965
1966 return function (Constructor, protoProps, staticProps) {
1967 if (protoProps) defineProperties(Constructor.prototype, protoProps);
1968 if (staticProps) defineProperties(Constructor, staticProps);
1969 return Constructor;
1970 };
1971 }();
1972
1973 var defineProperty$1 = function defineProperty(obj, key, value) {
1974 if (key in obj) {
1975 Object.defineProperty(obj, key, {
1976 value: value,
1977 enumerable: true,
1978 configurable: true,
1979 writable: true
1980 });
1981 } else {
1982 obj[key] = value;
1983 }
1984
1985 return obj;
1986 };
1987
1988 var _extends$1 = Object.assign || function (target) {
1989 for (var i = 1; i < arguments.length; i++) {
1990 var source = arguments[i];
1991
1992 for (var key in source) {
1993 if (Object.prototype.hasOwnProperty.call(source, key)) {
1994 target[key] = source[key];
1995 }
1996 }
1997 }
1998
1999 return target;
2000 };
2001 /**
2002 * Given element offsets, generate an output similar to getBoundingClientRect
2003 * @method
2004 * @memberof Popper.Utils
2005 * @argument {Object} offsets
2006 * @returns {Object} ClientRect like output
2007 */
2008
2009
2010 function getClientRect(offsets) {
2011 return _extends$1({}, offsets, {
2012 right: offsets.left + offsets.width,
2013 bottom: offsets.top + offsets.height
2014 });
2015 }
2016 /**
2017 * Get bounding client rect of given element
2018 * @method
2019 * @memberof Popper.Utils
2020 * @param {HTMLElement} element
2021 * @return {Object} client rect
2022 */
2023
2024
2025 function getBoundingClientRect(element) {
2026 var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't
2027 // considered in DOM in some circumstances...
2028 // This isn't reproducible in IE10 compatibility mode of IE11
2029
2030 try {
2031 if (isIE(10)) {
2032 rect = element.getBoundingClientRect();
2033 var scrollTop = getScroll(element, 'top');
2034 var scrollLeft = getScroll(element, 'left');
2035 rect.top += scrollTop;
2036 rect.left += scrollLeft;
2037 rect.bottom += scrollTop;
2038 rect.right += scrollLeft;
2039 } else {
2040 rect = element.getBoundingClientRect();
2041 }
2042 } catch (e) {}
2043
2044 var result = {
2045 left: rect.left,
2046 top: rect.top,
2047 width: rect.right - rect.left,
2048 height: rect.bottom - rect.top
2049 }; // subtract scrollbar size from sizes
2050
2051 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
2052 var width = sizes.width || element.clientWidth || result.right - result.left;
2053 var height = sizes.height || element.clientHeight || result.bottom - result.top;
2054 var horizScrollbar = element.offsetWidth - width;
2055 var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
2056 // we make this check conditional for performance reasons
2057
2058 if (horizScrollbar || vertScrollbar) {
2059 var styles = getStyleComputedProperty(element);
2060 horizScrollbar -= getBordersSize(styles, 'x');
2061 vertScrollbar -= getBordersSize(styles, 'y');
2062 result.width -= horizScrollbar;
2063 result.height -= vertScrollbar;
2064 }
2065
2066 return getClientRect(result);
2067 }
2068
2069 function getOffsetRectRelativeToArbitraryNode(children, parent) {
2070 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
2071 var isIE10 = isIE(10);
2072 var isHTML = parent.nodeName === 'HTML';
2073 var childrenRect = getBoundingClientRect(children);
2074 var parentRect = getBoundingClientRect(parent);
2075 var scrollParent = getScrollParent(children);
2076 var styles = getStyleComputedProperty(parent);
2077 var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
2078 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); // In cases where the parent is fixed, we must ignore negative scroll in offset calc
2079
2080 if (fixedPosition && isHTML) {
2081 parentRect.top = Math.max(parentRect.top, 0);
2082 parentRect.left = Math.max(parentRect.left, 0);
2083 }
2084
2085 var offsets = getClientRect({
2086 top: childrenRect.top - parentRect.top - borderTopWidth,
2087 left: childrenRect.left - parentRect.left - borderLeftWidth,
2088 width: childrenRect.width,
2089 height: childrenRect.height
2090 });
2091 offsets.marginTop = 0;
2092 offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent
2093 // we do this only on HTML because it's the only element that behaves
2094 // differently when margins are applied to it. The margins are included in
2095 // the box of the documentElement, in the other cases not.
2096
2097 if (!isIE10 && isHTML) {
2098 var marginTop = parseFloat(styles.marginTop, 10);
2099 var marginLeft = parseFloat(styles.marginLeft, 10);
2100 offsets.top -= borderTopWidth - marginTop;
2101 offsets.bottom -= borderTopWidth - marginTop;
2102 offsets.left -= borderLeftWidth - marginLeft;
2103 offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them
2104
2105 offsets.marginTop = marginTop;
2106 offsets.marginLeft = marginLeft;
2107 }
2108
2109 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
2110 offsets = includeScroll(offsets, parent);
2111 }
2112
2113 return offsets;
2114 }
2115
2116 function getViewportOffsetRectRelativeToArtbitraryNode(element) {
2117 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2118 var html = element.ownerDocument.documentElement;
2119 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
2120 var width = Math.max(html.clientWidth, window.innerWidth || 0);
2121 var height = Math.max(html.clientHeight, window.innerHeight || 0);
2122 var scrollTop = !excludeScroll ? getScroll(html) : 0;
2123 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
2124 var offset = {
2125 top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
2126 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
2127 width: width,
2128 height: height
2129 };
2130 return getClientRect(offset);
2131 }
2132 /**
2133 * Check if the given element is fixed or is inside a fixed parent
2134 * @method
2135 * @memberof Popper.Utils
2136 * @argument {Element} element
2137 * @argument {Element} customContainer
2138 * @returns {Boolean} answer to "isFixed?"
2139 */
2140
2141
2142 function isFixed(element) {
2143 var nodeName = element.nodeName;
2144
2145 if (nodeName === 'BODY' || nodeName === 'HTML') {
2146 return false;
2147 }
2148
2149 if (getStyleComputedProperty(element, 'position') === 'fixed') {
2150 return true;
2151 }
2152
2153 var parentNode = getParentNode(element);
2154
2155 if (!parentNode) {
2156 return false;
2157 }
2158
2159 return isFixed(parentNode);
2160 }
2161 /**
2162 * Finds the first parent of an element that has a transformed property defined
2163 * @method
2164 * @memberof Popper.Utils
2165 * @argument {Element} element
2166 * @returns {Element} first transformed parent or documentElement
2167 */
2168
2169
2170 function getFixedPositionOffsetParent(element) {
2171 // This check is needed to avoid errors in case one of the elements isn't defined for any reason
2172 if (!element || !element.parentElement || isIE()) {
2173 return document.documentElement;
2174 }
2175
2176 var el = element.parentElement;
2177
2178 while (el && getStyleComputedProperty(el, 'transform') === 'none') {
2179 el = el.parentElement;
2180 }
2181
2182 return el || document.documentElement;
2183 }
2184 /**
2185 * Computed the boundaries limits and return them
2186 * @method
2187 * @memberof Popper.Utils
2188 * @param {HTMLElement} popper
2189 * @param {HTMLElement} reference
2190 * @param {number} padding
2191 * @param {HTMLElement} boundariesElement - Element used to define the boundaries
2192 * @param {Boolean} fixedPosition - Is in fixed position mode
2193 * @returns {Object} Coordinates of the boundaries
2194 */
2195
2196
2197 function getBoundaries(popper, reference, padding, boundariesElement) {
2198 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // NOTE: 1 DOM access here
2199
2200 var boundaries = {
2201 top: 0,
2202 left: 0
2203 };
2204 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); // Handle viewport case
2205
2206 if (boundariesElement === 'viewport') {
2207 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
2208 } else {
2209 // Handle other cases based on DOM element used as boundaries
2210 var boundariesNode = void 0;
2211
2212 if (boundariesElement === 'scrollParent') {
2213 boundariesNode = getScrollParent(getParentNode(reference));
2214
2215 if (boundariesNode.nodeName === 'BODY') {
2216 boundariesNode = popper.ownerDocument.documentElement;
2217 }
2218 } else if (boundariesElement === 'window') {
2219 boundariesNode = popper.ownerDocument.documentElement;
2220 } else {
2221 boundariesNode = boundariesElement;
2222 }
2223
2224 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation
2225
2226 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
2227 var _getWindowSizes = getWindowSizes(popper.ownerDocument),
2228 height = _getWindowSizes.height,
2229 width = _getWindowSizes.width;
2230
2231 boundaries.top += offsets.top - offsets.marginTop;
2232 boundaries.bottom = height + offsets.top;
2233 boundaries.left += offsets.left - offsets.marginLeft;
2234 boundaries.right = width + offsets.left;
2235 } else {
2236 // for all the other DOM elements, this one is good
2237 boundaries = offsets;
2238 }
2239 } // Add paddings
2240
2241
2242 padding = padding || 0;
2243 var isPaddingNumber = typeof padding === 'number';
2244 boundaries.left += isPaddingNumber ? padding : padding.left || 0;
2245 boundaries.top += isPaddingNumber ? padding : padding.top || 0;
2246 boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
2247 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
2248 return boundaries;
2249 }
2250
2251 function getArea(_ref) {
2252 var width = _ref.width,
2253 height = _ref.height;
2254 return width * height;
2255 }
2256 /**
2257 * Utility used to transform the `auto` placement to the placement with more
2258 * available space.
2259 * @method
2260 * @memberof Popper.Utils
2261 * @argument {Object} data - The data object generated by update method
2262 * @argument {Object} options - Modifiers configuration and options
2263 * @returns {Object} The data object, properly modified
2264 */
2265
2266
2267 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
2268 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
2269
2270 if (placement.indexOf('auto') === -1) {
2271 return placement;
2272 }
2273
2274 var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
2275 var rects = {
2276 top: {
2277 width: boundaries.width,
2278 height: refRect.top - boundaries.top
2279 },
2280 right: {
2281 width: boundaries.right - refRect.right,
2282 height: boundaries.height
2283 },
2284 bottom: {
2285 width: boundaries.width,
2286 height: boundaries.bottom - refRect.bottom
2287 },
2288 left: {
2289 width: refRect.left - boundaries.left,
2290 height: boundaries.height
2291 }
2292 };
2293 var sortedAreas = Object.keys(rects).map(function (key) {
2294 return _extends$1({
2295 key: key
2296 }, rects[key], {
2297 area: getArea(rects[key])
2298 });
2299 }).sort(function (a, b) {
2300 return b.area - a.area;
2301 });
2302 var filteredAreas = sortedAreas.filter(function (_ref2) {
2303 var width = _ref2.width,
2304 height = _ref2.height;
2305 return width >= popper.clientWidth && height >= popper.clientHeight;
2306 });
2307 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
2308 var variation = placement.split('-')[1];
2309 return computedPlacement + (variation ? '-' + variation : '');
2310 }
2311 /**
2312 * Get offsets to the reference element
2313 * @method
2314 * @memberof Popper.Utils
2315 * @param {Object} state
2316 * @param {Element} popper - the popper element
2317 * @param {Element} reference - the reference element (the popper will be relative to this)
2318 * @param {Element} fixedPosition - is in fixed position mode
2319 * @returns {Object} An object containing the offsets which will be applied to the popper
2320 */
2321
2322
2323 function getReferenceOffsets(state, popper, reference) {
2324 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
2325 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
2326 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
2327 }
2328 /**
2329 * Get the outer sizes of the given element (offset size + margins)
2330 * @method
2331 * @memberof Popper.Utils
2332 * @argument {Element} element
2333 * @returns {Object} object containing width and height properties
2334 */
2335
2336
2337 function getOuterSizes(element) {
2338 var window = element.ownerDocument.defaultView;
2339 var styles = window.getComputedStyle(element);
2340 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
2341 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
2342 var result = {
2343 width: element.offsetWidth + y,
2344 height: element.offsetHeight + x
2345 };
2346 return result;
2347 }
2348 /**
2349 * Get the opposite placement of the given one
2350 * @method
2351 * @memberof Popper.Utils
2352 * @argument {String} placement
2353 * @returns {String} flipped placement
2354 */
2355
2356
2357 function getOppositePlacement(placement) {
2358 var hash = {
2359 left: 'right',
2360 right: 'left',
2361 bottom: 'top',
2362 top: 'bottom'
2363 };
2364 return placement.replace(/left|right|bottom|top/g, function (matched) {
2365 return hash[matched];
2366 });
2367 }
2368 /**
2369 * Get offsets to the popper
2370 * @method
2371 * @memberof Popper.Utils
2372 * @param {Object} position - CSS position the Popper will get applied
2373 * @param {HTMLElement} popper - the popper element
2374 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
2375 * @param {String} placement - one of the valid placement options
2376 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
2377 */
2378
2379
2380 function getPopperOffsets(popper, referenceOffsets, placement) {
2381 placement = placement.split('-')[0]; // Get popper node sizes
2382
2383 var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object
2384
2385 var popperOffsets = {
2386 width: popperRect.width,
2387 height: popperRect.height
2388 }; // depending by the popper placement we have to compute its offsets slightly differently
2389
2390 var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
2391 var mainSide = isHoriz ? 'top' : 'left';
2392 var secondarySide = isHoriz ? 'left' : 'top';
2393 var measurement = isHoriz ? 'height' : 'width';
2394 var secondaryMeasurement = !isHoriz ? 'height' : 'width';
2395 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
2396
2397 if (placement === secondarySide) {
2398 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
2399 } else {
2400 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
2401 }
2402
2403 return popperOffsets;
2404 }
2405 /**
2406 * Mimics the `find` method of Array
2407 * @method
2408 * @memberof Popper.Utils
2409 * @argument {Array} arr
2410 * @argument prop
2411 * @argument value
2412 * @returns index or -1
2413 */
2414
2415
2416 function find(arr, check) {
2417 // use native find if supported
2418 if (Array.prototype.find) {
2419 return arr.find(check);
2420 } // use `filter` to obtain the same behavior of `find`
2421
2422
2423 return arr.filter(check)[0];
2424 }
2425 /**
2426 * Return the index of the matching object
2427 * @method
2428 * @memberof Popper.Utils
2429 * @argument {Array} arr
2430 * @argument prop
2431 * @argument value
2432 * @returns index or -1
2433 */
2434
2435
2436 function findIndex(arr, prop, value) {
2437 // use native findIndex if supported
2438 if (Array.prototype.findIndex) {
2439 return arr.findIndex(function (cur) {
2440 return cur[prop] === value;
2441 });
2442 } // use `find` + `indexOf` if `findIndex` isn't supported
2443
2444
2445 var match = find(arr, function (obj) {
2446 return obj[prop] === value;
2447 });
2448 return arr.indexOf(match);
2449 }
2450 /**
2451 * Loop trough the list of modifiers and run them in order,
2452 * each of them will then edit the data object.
2453 * @method
2454 * @memberof Popper.Utils
2455 * @param {dataObject} data
2456 * @param {Array} modifiers
2457 * @param {String} ends - Optional modifier name used as stopper
2458 * @returns {dataObject}
2459 */
2460
2461
2462 function runModifiers(modifiers, data, ends) {
2463 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
2464 modifiersToRun.forEach(function (modifier) {
2465 if (modifier['function']) {
2466 // eslint-disable-line dot-notation
2467 console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
2468 }
2469
2470 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
2471
2472 if (modifier.enabled && isFunction$1(fn)) {
2473 // Add properties to offsets to make them a complete clientRect object
2474 // we do this before each modifier to make sure the previous one doesn't
2475 // mess with these values
2476 data.offsets.popper = getClientRect(data.offsets.popper);
2477 data.offsets.reference = getClientRect(data.offsets.reference);
2478 data = fn(data, modifier);
2479 }
2480 });
2481 return data;
2482 }
2483 /**
2484 * Updates the position of the popper, computing the new offsets and applying
2485 * the new style.<br />
2486 * Prefer `scheduleUpdate` over `update` because of performance reasons.
2487 * @method
2488 * @memberof Popper
2489 */
2490
2491
2492 function update() {
2493 // if popper is destroyed, don't perform any further update
2494 if (this.state.isDestroyed) {
2495 return;
2496 }
2497
2498 var data = {
2499 instance: this,
2500 styles: {},
2501 arrowStyles: {},
2502 attributes: {},
2503 flipped: false,
2504 offsets: {}
2505 }; // compute reference element offsets
2506
2507 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); // compute auto placement, store placement inside the data object,
2508 // modifiers will be able to edit `placement` if needed
2509 // and refer to originalPlacement to know the original value
2510
2511 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); // store the computed placement inside `originalPlacement`
2512
2513 data.originalPlacement = data.placement;
2514 data.positionFixed = this.options.positionFixed; // compute the popper offsets
2515
2516 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
2517 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers
2518
2519 data = runModifiers(this.modifiers, data); // the first `update` will call `onCreate` callback
2520 // the other ones will call `onUpdate` callback
2521
2522 if (!this.state.isCreated) {
2523 this.state.isCreated = true;
2524 this.options.onCreate(data);
2525 } else {
2526 this.options.onUpdate(data);
2527 }
2528 }
2529 /**
2530 * Helper used to know if the given modifier is enabled.
2531 * @method
2532 * @memberof Popper.Utils
2533 * @returns {Boolean}
2534 */
2535
2536
2537 function isModifierEnabled(modifiers, modifierName) {
2538 return modifiers.some(function (_ref) {
2539 var name = _ref.name,
2540 enabled = _ref.enabled;
2541 return enabled && name === modifierName;
2542 });
2543 }
2544 /**
2545 * Get the prefixed supported property name
2546 * @method
2547 * @memberof Popper.Utils
2548 * @argument {String} property (camelCase)
2549 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
2550 */
2551
2552
2553 function getSupportedPropertyName(property) {
2554 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
2555 var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
2556
2557 for (var i = 0; i < prefixes.length; i++) {
2558 var prefix = prefixes[i];
2559 var toCheck = prefix ? '' + prefix + upperProp : property;
2560
2561 if (typeof document.body.style[toCheck] !== 'undefined') {
2562 return toCheck;
2563 }
2564 }
2565
2566 return null;
2567 }
2568 /**
2569 * Destroys the popper.
2570 * @method
2571 * @memberof Popper
2572 */
2573
2574
2575 function destroy() {
2576 this.state.isDestroyed = true; // touch DOM only if `applyStyle` modifier is enabled
2577
2578 if (isModifierEnabled(this.modifiers, 'applyStyle')) {
2579 this.popper.removeAttribute('x-placement');
2580 this.popper.style.position = '';
2581 this.popper.style.top = '';
2582 this.popper.style.left = '';
2583 this.popper.style.right = '';
2584 this.popper.style.bottom = '';
2585 this.popper.style.willChange = '';
2586 this.popper.style[getSupportedPropertyName('transform')] = '';
2587 }
2588
2589 this.disableEventListeners(); // remove the popper if user explicity asked for the deletion on destroy
2590 // do not use `remove` because IE11 doesn't support it
2591
2592 if (this.options.removeOnDestroy) {
2593 this.popper.parentNode.removeChild(this.popper);
2594 }
2595
2596 return this;
2597 }
2598 /**
2599 * Get the window associated with the element
2600 * @argument {Element} element
2601 * @returns {Window}
2602 */
2603
2604
2605 function getWindow(element) {
2606 var ownerDocument = element.ownerDocument;
2607 return ownerDocument ? ownerDocument.defaultView : window;
2608 }
2609
2610 function attachToScrollParents(scrollParent, event, callback, scrollParents) {
2611 var isBody = scrollParent.nodeName === 'BODY';
2612 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
2613 target.addEventListener(event, callback, {
2614 passive: true
2615 });
2616
2617 if (!isBody) {
2618 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
2619 }
2620
2621 scrollParents.push(target);
2622 }
2623 /**
2624 * Setup needed event listeners used to update the popper position
2625 * @method
2626 * @memberof Popper.Utils
2627 * @private
2628 */
2629
2630
2631 function setupEventListeners(reference, options, state, updateBound) {
2632 // Resize event listener on window
2633 state.updateBound = updateBound;
2634 getWindow(reference).addEventListener('resize', state.updateBound, {
2635 passive: true
2636 }); // Scroll event listener on scroll parents
2637
2638 var scrollElement = getScrollParent(reference);
2639 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
2640 state.scrollElement = scrollElement;
2641 state.eventsEnabled = true;
2642 return state;
2643 }
2644 /**
2645 * It will add resize/scroll events and start recalculating
2646 * position of the popper element when they are triggered.
2647 * @method
2648 * @memberof Popper
2649 */
2650
2651
2652 function enableEventListeners() {
2653 if (!this.state.eventsEnabled) {
2654 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
2655 }
2656 }
2657 /**
2658 * Remove event listeners used to update the popper position
2659 * @method
2660 * @memberof Popper.Utils
2661 * @private
2662 */
2663
2664
2665 function removeEventListeners(reference, state) {
2666 // Remove resize event listener on window
2667 getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents
2668
2669 state.scrollParents.forEach(function (target) {
2670 target.removeEventListener('scroll', state.updateBound);
2671 }); // Reset state
2672
2673 state.updateBound = null;
2674 state.scrollParents = [];
2675 state.scrollElement = null;
2676 state.eventsEnabled = false;
2677 return state;
2678 }
2679 /**
2680 * It will remove resize/scroll events and won't recalculate popper position
2681 * when they are triggered. It also won't trigger `onUpdate` callback anymore,
2682 * unless you call `update` method manually.
2683 * @method
2684 * @memberof Popper
2685 */
2686
2687
2688 function disableEventListeners() {
2689 if (this.state.eventsEnabled) {
2690 cancelAnimationFrame(this.scheduleUpdate);
2691 this.state = removeEventListeners(this.reference, this.state);
2692 }
2693 }
2694 /**
2695 * Tells if a given input is a number
2696 * @method
2697 * @memberof Popper.Utils
2698 * @param {*} input to check
2699 * @return {Boolean}
2700 */
2701
2702
2703 function isNumeric(n) {
2704 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
2705 }
2706 /**
2707 * Set the style to the given popper
2708 * @method
2709 * @memberof Popper.Utils
2710 * @argument {Element} element - Element to apply the style to
2711 * @argument {Object} styles
2712 * Object with a list of properties and values which will be applied to the element
2713 */
2714
2715
2716 function setStyles(element, styles) {
2717 Object.keys(styles).forEach(function (prop) {
2718 var unit = ''; // add unit if the value is numeric and is one of the following
2719
2720 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
2721 unit = 'px';
2722 }
2723
2724 element.style[prop] = styles[prop] + unit;
2725 });
2726 }
2727 /**
2728 * Set the attributes to the given popper
2729 * @method
2730 * @memberof Popper.Utils
2731 * @argument {Element} element - Element to apply the attributes to
2732 * @argument {Object} styles
2733 * Object with a list of properties and values which will be applied to the element
2734 */
2735
2736
2737 function setAttributes(element, attributes) {
2738 Object.keys(attributes).forEach(function (prop) {
2739 var value = attributes[prop];
2740
2741 if (value !== false) {
2742 element.setAttribute(prop, attributes[prop]);
2743 } else {
2744 element.removeAttribute(prop);
2745 }
2746 });
2747 }
2748 /**
2749 * @function
2750 * @memberof Modifiers
2751 * @argument {Object} data - The data object generated by `update` method
2752 * @argument {Object} data.styles - List of style properties - values to apply to popper element
2753 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
2754 * @argument {Object} options - Modifiers configuration and options
2755 * @returns {Object} The same data object
2756 */
2757
2758
2759 function applyStyle(data) {
2760 // any property present in `data.styles` will be applied to the popper,
2761 // in this way we can make the 3rd party modifiers add custom styles to it
2762 // Be aware, modifiers could override the properties defined in the previous
2763 // lines of this modifier!
2764 setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper,
2765 // they will be set as HTML attributes of the element
2766
2767 setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties
2768
2769 if (data.arrowElement && Object.keys(data.arrowStyles).length) {
2770 setStyles(data.arrowElement, data.arrowStyles);
2771 }
2772
2773 return data;
2774 }
2775 /**
2776 * Set the x-placement attribute before everything else because it could be used
2777 * to add margins to the popper margins needs to be calculated to get the
2778 * correct popper offsets.
2779 * @method
2780 * @memberof Popper.modifiers
2781 * @param {HTMLElement} reference - The reference element used to position the popper
2782 * @param {HTMLElement} popper - The HTML element used as popper
2783 * @param {Object} options - Popper.js options
2784 */
2785
2786
2787 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
2788 // compute reference element offsets
2789 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object,
2790 // modifiers will be able to edit `placement` if needed
2791 // and refer to originalPlacement to know the original value
2792
2793 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
2794 popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because
2795 // without the position applied we can't guarantee correct computations
2796
2797 setStyles(popper, {
2798 position: options.positionFixed ? 'fixed' : 'absolute'
2799 });
2800 return options;
2801 }
2802 /**
2803 * @function
2804 * @memberof Popper.Utils
2805 * @argument {Object} data - The data object generated by `update` method
2806 * @argument {Boolean} shouldRound - If the offsets should be rounded at all
2807 * @returns {Object} The popper's position offsets rounded
2808 *
2809 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
2810 * good as it can be within reason.
2811 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
2812 *
2813 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
2814 * as well on High DPI screens).
2815 *
2816 * Firefox prefers no rounding for positioning and does not have blurriness on
2817 * high DPI screens.
2818 *
2819 * Only horizontal placement and left/right values need to be considered.
2820 */
2821
2822
2823 function getRoundedOffsets(data, shouldRound) {
2824 var _data$offsets = data.offsets,
2825 popper = _data$offsets.popper,
2826 reference = _data$offsets.reference;
2827 var round = Math.round,
2828 floor = Math.floor;
2829
2830 var noRound = function noRound(v) {
2831 return v;
2832 };
2833
2834 var referenceWidth = round(reference.width);
2835 var popperWidth = round(popper.width);
2836 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
2837 var isVariation = data.placement.indexOf('-') !== -1;
2838 var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
2839 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
2840 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
2841 var verticalToInteger = !shouldRound ? noRound : round;
2842 return {
2843 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
2844 top: verticalToInteger(popper.top),
2845 bottom: verticalToInteger(popper.bottom),
2846 right: horizontalToInteger(popper.right)
2847 };
2848 }
2849
2850 var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
2851 /**
2852 * @function
2853 * @memberof Modifiers
2854 * @argument {Object} data - The data object generated by `update` method
2855 * @argument {Object} options - Modifiers configuration and options
2856 * @returns {Object} The data object, properly modified
2857 */
2858
2859 function computeStyle(data, options) {
2860 var x = options.x,
2861 y = options.y;
2862 var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2
2863
2864 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
2865 return modifier.name === 'applyStyle';
2866 }).gpuAcceleration;
2867
2868 if (legacyGpuAccelerationOption !== undefined) {
2869 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
2870 }
2871
2872 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
2873 var offsetParent = getOffsetParent(data.instance.popper);
2874 var offsetParentRect = getBoundingClientRect(offsetParent); // Styles
2875
2876 var styles = {
2877 position: popper.position
2878 };
2879 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
2880 var sideA = x === 'bottom' ? 'top' : 'bottom';
2881 var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported,
2882 // we use `translate3d` to apply the position to the popper we
2883 // automatically use the supported prefixed version if needed
2884
2885 var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?)
2886 // If the content of the popper grows once it's been positioned, it
2887 // may happen that the popper gets misplaced because of the new content
2888 // overflowing its reference element
2889 // To avoid this problem, we provide two options (x and y), which allow
2890 // the consumer to define the offset origin.
2891 // If we position a popper on top of a reference element, we can set
2892 // `x` to `top` to make the popper grow towards its top instead of
2893 // its bottom.
2894
2895 var left = void 0,
2896 top = void 0;
2897
2898 if (sideA === 'bottom') {
2899 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
2900 // and not the bottom of the html element
2901 if (offsetParent.nodeName === 'HTML') {
2902 top = -offsetParent.clientHeight + offsets.bottom;
2903 } else {
2904 top = -offsetParentRect.height + offsets.bottom;
2905 }
2906 } else {
2907 top = offsets.top;
2908 }
2909
2910 if (sideB === 'right') {
2911 if (offsetParent.nodeName === 'HTML') {
2912 left = -offsetParent.clientWidth + offsets.right;
2913 } else {
2914 left = -offsetParentRect.width + offsets.right;
2915 }
2916 } else {
2917 left = offsets.left;
2918 }
2919
2920 if (gpuAcceleration && prefixedProperty) {
2921 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
2922 styles[sideA] = 0;
2923 styles[sideB] = 0;
2924 styles.willChange = 'transform';
2925 } else {
2926 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
2927 var invertTop = sideA === 'bottom' ? -1 : 1;
2928 var invertLeft = sideB === 'right' ? -1 : 1;
2929 styles[sideA] = top * invertTop;
2930 styles[sideB] = left * invertLeft;
2931 styles.willChange = sideA + ', ' + sideB;
2932 } // Attributes
2933
2934
2935 var attributes = {
2936 'x-placement': data.placement
2937 }; // Update `data` attributes, styles and arrowStyles
2938
2939 data.attributes = _extends$1({}, attributes, data.attributes);
2940 data.styles = _extends$1({}, styles, data.styles);
2941 data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
2942 return data;
2943 }
2944 /**
2945 * Helper used to know if the given modifier depends from another one.<br />
2946 * It checks if the needed modifier is listed and enabled.
2947 * @method
2948 * @memberof Popper.Utils
2949 * @param {Array} modifiers - list of modifiers
2950 * @param {String} requestingName - name of requesting modifier
2951 * @param {String} requestedName - name of requested modifier
2952 * @returns {Boolean}
2953 */
2954
2955
2956 function isModifierRequired(modifiers, requestingName, requestedName) {
2957 var requesting = find(modifiers, function (_ref) {
2958 var name = _ref.name;
2959 return name === requestingName;
2960 });
2961 var isRequired = !!requesting && modifiers.some(function (modifier) {
2962 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
2963 });
2964
2965 if (!isRequired) {
2966 var _requesting = '`' + requestingName + '`';
2967
2968 var requested = '`' + requestedName + '`';
2969 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
2970 }
2971
2972 return isRequired;
2973 }
2974 /**
2975 * @function
2976 * @memberof Modifiers
2977 * @argument {Object} data - The data object generated by update method
2978 * @argument {Object} options - Modifiers configuration and options
2979 * @returns {Object} The data object, properly modified
2980 */
2981
2982
2983 function arrow(data, options) {
2984 var _data$offsets$arrow; // arrow depends on keepTogether in order to work
2985
2986
2987 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
2988 return data;
2989 }
2990
2991 var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector
2992
2993 if (typeof arrowElement === 'string') {
2994 arrowElement = data.instance.popper.querySelector(arrowElement); // if arrowElement is not found, don't run the modifier
2995
2996 if (!arrowElement) {
2997 return data;
2998 }
2999 } else {
3000 // if the arrowElement isn't a query selector we must check that the
3001 // provided DOM node is child of its popper node
3002 if (!data.instance.popper.contains(arrowElement)) {
3003 console.warn('WARNING: `arrow.element` must be child of its popper element!');
3004 return data;
3005 }
3006 }
3007
3008 var placement = data.placement.split('-')[0];
3009 var _data$offsets = data.offsets,
3010 popper = _data$offsets.popper,
3011 reference = _data$offsets.reference;
3012 var isVertical = ['left', 'right'].indexOf(placement) !== -1;
3013 var len = isVertical ? 'height' : 'width';
3014 var sideCapitalized = isVertical ? 'Top' : 'Left';
3015 var side = sideCapitalized.toLowerCase();
3016 var altSide = isVertical ? 'left' : 'top';
3017 var opSide = isVertical ? 'bottom' : 'right';
3018 var arrowElementSize = getOuterSizes(arrowElement)[len]; //
3019 // extends keepTogether behavior making sure the popper and its
3020 // reference have enough pixels in conjunction
3021 //
3022 // top/left side
3023
3024 if (reference[opSide] - arrowElementSize < popper[side]) {
3025 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
3026 } // bottom/right side
3027
3028
3029 if (reference[side] + arrowElementSize > popper[opSide]) {
3030 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
3031 }
3032
3033 data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper
3034
3035 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets
3036 // take popper margin in account because we don't have this info available
3037
3038 var css = getStyleComputedProperty(data.instance.popper);
3039 var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
3040 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
3041 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; // prevent arrowElement from being placed not contiguously to its popper
3042
3043 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
3044 data.arrowElement = arrowElement;
3045 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty$1(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty$1(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
3046 return data;
3047 }
3048 /**
3049 * Get the opposite placement variation of the given one
3050 * @method
3051 * @memberof Popper.Utils
3052 * @argument {String} placement variation
3053 * @returns {String} flipped placement variation
3054 */
3055
3056
3057 function getOppositeVariation(variation) {
3058 if (variation === 'end') {
3059 return 'start';
3060 } else if (variation === 'start') {
3061 return 'end';
3062 }
3063
3064 return variation;
3065 }
3066 /**
3067 * List of accepted placements to use as values of the `placement` option.<br />
3068 * Valid placements are:
3069 * - `auto`
3070 * - `top`
3071 * - `right`
3072 * - `bottom`
3073 * - `left`
3074 *
3075 * Each placement can have a variation from this list:
3076 * - `-start`
3077 * - `-end`
3078 *
3079 * Variations are interpreted easily if you think of them as the left to right
3080 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
3081 * is right.<br />
3082 * Vertically (`left` and `right`), `start` is top and `end` is bottom.
3083 *
3084 * Some valid examples are:
3085 * - `top-end` (on top of reference, right aligned)
3086 * - `right-start` (on right of reference, top aligned)
3087 * - `bottom` (on bottom, centered)
3088 * - `auto-end` (on the side with more space available, alignment depends by placement)
3089 *
3090 * @static
3091 * @type {Array}
3092 * @enum {String}
3093 * @readonly
3094 * @method placements
3095 * @memberof Popper
3096 */
3097
3098
3099 var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; // Get rid of `auto` `auto-start` and `auto-end`
3100
3101 var validPlacements = placements.slice(3);
3102 /**
3103 * Given an initial placement, returns all the subsequent placements
3104 * clockwise (or counter-clockwise).
3105 *
3106 * @method
3107 * @memberof Popper.Utils
3108 * @argument {String} placement - A valid placement (it accepts variations)
3109 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
3110 * @returns {Array} placements including their variations
3111 */
3112
3113 function clockwise(placement) {
3114 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3115 var index = validPlacements.indexOf(placement);
3116 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
3117 return counter ? arr.reverse() : arr;
3118 }
3119
3120 var BEHAVIORS = {
3121 FLIP: 'flip',
3122 CLOCKWISE: 'clockwise',
3123 COUNTERCLOCKWISE: 'counterclockwise'
3124 };
3125 /**
3126 * @function
3127 * @memberof Modifiers
3128 * @argument {Object} data - The data object generated by update method
3129 * @argument {Object} options - Modifiers configuration and options
3130 * @returns {Object} The data object, properly modified
3131 */
3132
3133 function flip(data, options) {
3134 // if `inner` modifier is enabled, we can't use the `flip` modifier
3135 if (isModifierEnabled(data.instance.modifiers, 'inner')) {
3136 return data;
3137 }
3138
3139 if (data.flipped && data.placement === data.originalPlacement) {
3140 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
3141 return data;
3142 }
3143
3144 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
3145 var placement = data.placement.split('-')[0];
3146 var placementOpposite = getOppositePlacement(placement);
3147 var variation = data.placement.split('-')[1] || '';
3148 var flipOrder = [];
3149
3150 switch (options.behavior) {
3151 case BEHAVIORS.FLIP:
3152 flipOrder = [placement, placementOpposite];
3153 break;
3154
3155 case BEHAVIORS.CLOCKWISE:
3156 flipOrder = clockwise(placement);
3157 break;
3158
3159 case BEHAVIORS.COUNTERCLOCKWISE:
3160 flipOrder = clockwise(placement, true);
3161 break;
3162
3163 default:
3164 flipOrder = options.behavior;
3165 }
3166
3167 flipOrder.forEach(function (step, index) {
3168 if (placement !== step || flipOrder.length === index + 1) {
3169 return data;
3170 }
3171
3172 placement = data.placement.split('-')[0];
3173 placementOpposite = getOppositePlacement(placement);
3174 var popperOffsets = data.offsets.popper;
3175 var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here
3176
3177 var floor = Math.floor;
3178 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
3179 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
3180 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
3181 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
3182 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
3183 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required
3184
3185 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
3186 var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
3187
3188 if (overlapsRef || overflowsBoundaries || flippedVariation) {
3189 // this boolean to detect any flip loop
3190 data.flipped = true;
3191
3192 if (overlapsRef || overflowsBoundaries) {
3193 placement = flipOrder[index + 1];
3194 }
3195
3196 if (flippedVariation) {
3197 variation = getOppositeVariation(variation);
3198 }
3199
3200 data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with
3201 // any additional property we may add in the future
3202
3203 data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
3204 data = runModifiers(data.instance.modifiers, data, 'flip');
3205 }
3206 });
3207 return data;
3208 }
3209 /**
3210 * @function
3211 * @memberof Modifiers
3212 * @argument {Object} data - The data object generated by update method
3213 * @argument {Object} options - Modifiers configuration and options
3214 * @returns {Object} The data object, properly modified
3215 */
3216
3217
3218 function keepTogether(data) {
3219 var _data$offsets = data.offsets,
3220 popper = _data$offsets.popper,
3221 reference = _data$offsets.reference;
3222 var placement = data.placement.split('-')[0];
3223 var floor = Math.floor;
3224 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
3225 var side = isVertical ? 'right' : 'bottom';
3226 var opSide = isVertical ? 'left' : 'top';
3227 var measurement = isVertical ? 'width' : 'height';
3228
3229 if (popper[side] < floor(reference[opSide])) {
3230 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
3231 }
3232
3233 if (popper[opSide] > floor(reference[side])) {
3234 data.offsets.popper[opSide] = floor(reference[side]);
3235 }
3236
3237 return data;
3238 }
3239 /**
3240 * Converts a string containing value + unit into a px value number
3241 * @function
3242 * @memberof {modifiers~offset}
3243 * @private
3244 * @argument {String} str - Value + unit string
3245 * @argument {String} measurement - `height` or `width`
3246 * @argument {Object} popperOffsets
3247 * @argument {Object} referenceOffsets
3248 * @returns {Number|String}
3249 * Value in pixels, or original string if no values were extracted
3250 */
3251
3252
3253 function toValue(str, measurement, popperOffsets, referenceOffsets) {
3254 // separate value from unit
3255 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
3256 var value = +split[1];
3257 var unit = split[2]; // If it's not a number it's an operator, I guess
3258
3259 if (!value) {
3260 return str;
3261 }
3262
3263 if (unit.indexOf('%') === 0) {
3264 var element = void 0;
3265
3266 switch (unit) {
3267 case '%p':
3268 element = popperOffsets;
3269 break;
3270
3271 case '%':
3272 case '%r':
3273 default:
3274 element = referenceOffsets;
3275 }
3276
3277 var rect = getClientRect(element);
3278 return rect[measurement] / 100 * value;
3279 } else if (unit === 'vh' || unit === 'vw') {
3280 // if is a vh or vw, we calculate the size based on the viewport
3281 var size = void 0;
3282
3283 if (unit === 'vh') {
3284 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
3285 } else {
3286 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
3287 }
3288
3289 return size / 100 * value;
3290 } else {
3291 // if is an explicit pixel unit, we get rid of the unit and keep the value
3292 // if is an implicit unit, it's px, and we return just the value
3293 return value;
3294 }
3295 }
3296 /**
3297 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
3298 * @function
3299 * @memberof {modifiers~offset}
3300 * @private
3301 * @argument {String} offset
3302 * @argument {Object} popperOffsets
3303 * @argument {Object} referenceOffsets
3304 * @argument {String} basePlacement
3305 * @returns {Array} a two cells array with x and y offsets in numbers
3306 */
3307
3308
3309 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
3310 var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width
3311 // in this way the first offset will use an axis and the second one
3312 // will use the other one
3313
3314 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands
3315 // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
3316
3317 var fragments = offset.split(/(\+|\-)/).map(function (frag) {
3318 return frag.trim();
3319 }); // Detect if the offset string contains a pair of values or a single one
3320 // they could be separated by comma or space
3321
3322 var divider = fragments.indexOf(find(fragments, function (frag) {
3323 return frag.search(/,|\s/) !== -1;
3324 }));
3325
3326 if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
3327 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
3328 } // If divider is found, we divide the list of values and operands to divide
3329 // them by ofset X and Y.
3330
3331
3332 var splitRegex = /\s*,\s*|\s+/;
3333 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; // Convert the values with units to absolute pixels to allow our computations
3334
3335 ops = ops.map(function (op, index) {
3336 // Most of the units rely on the orientation of the popper
3337 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
3338 var mergeWithPrevious = false;
3339 return op // This aggregates any `+` or `-` sign that aren't considered operators
3340 // e.g.: 10 + +5 => [10, +, +5]
3341 .reduce(function (a, b) {
3342 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
3343 a[a.length - 1] = b;
3344 mergeWithPrevious = true;
3345 return a;
3346 } else if (mergeWithPrevious) {
3347 a[a.length - 1] += b;
3348 mergeWithPrevious = false;
3349 return a;
3350 } else {
3351 return a.concat(b);
3352 }
3353 }, []) // Here we convert the string values into number values (in px)
3354 .map(function (str) {
3355 return toValue(str, measurement, popperOffsets, referenceOffsets);
3356 });
3357 }); // Loop trough the offsets arrays and execute the operations
3358
3359 ops.forEach(function (op, index) {
3360 op.forEach(function (frag, index2) {
3361 if (isNumeric(frag)) {
3362 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
3363 }
3364 });
3365 });
3366 return offsets;
3367 }
3368 /**
3369 * @function
3370 * @memberof Modifiers
3371 * @argument {Object} data - The data object generated by update method
3372 * @argument {Object} options - Modifiers configuration and options
3373 * @argument {Number|String} options.offset=0
3374 * The offset value as described in the modifier description
3375 * @returns {Object} The data object, properly modified
3376 */
3377
3378
3379 function offset(data, _ref) {
3380 var offset = _ref.offset;
3381 var placement = data.placement,
3382 _data$offsets = data.offsets,
3383 popper = _data$offsets.popper,
3384 reference = _data$offsets.reference;
3385 var basePlacement = placement.split('-')[0];
3386 var offsets = void 0;
3387
3388 if (isNumeric(+offset)) {
3389 offsets = [+offset, 0];
3390 } else {
3391 offsets = parseOffset(offset, popper, reference, basePlacement);
3392 }
3393
3394 if (basePlacement === 'left') {
3395 popper.top += offsets[0];
3396 popper.left -= offsets[1];
3397 } else if (basePlacement === 'right') {
3398 popper.top += offsets[0];
3399 popper.left += offsets[1];
3400 } else if (basePlacement === 'top') {
3401 popper.left += offsets[0];
3402 popper.top -= offsets[1];
3403 } else if (basePlacement === 'bottom') {
3404 popper.left += offsets[0];
3405 popper.top += offsets[1];
3406 }
3407
3408 data.popper = popper;
3409 return data;
3410 }
3411 /**
3412 * @function
3413 * @memberof Modifiers
3414 * @argument {Object} data - The data object generated by `update` method
3415 * @argument {Object} options - Modifiers configuration and options
3416 * @returns {Object} The data object, properly modified
3417 */
3418
3419
3420 function preventOverflow(data, options) {
3421 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to
3422 // go one step up and use the next offsetParent as reference to
3423 // avoid to make this modifier completely useless and look like broken
3424
3425 if (data.instance.reference === boundariesElement) {
3426 boundariesElement = getOffsetParent(boundariesElement);
3427 } // NOTE: DOM access here
3428 // resets the popper's position so that the document size can be calculated excluding
3429 // the size of the popper element itself
3430
3431
3432 var transformProp = getSupportedPropertyName('transform');
3433 var popperStyles = data.instance.popper.style; // assignment to help minification
3434
3435 var top = popperStyles.top,
3436 left = popperStyles.left,
3437 transform = popperStyles[transformProp];
3438 popperStyles.top = '';
3439 popperStyles.left = '';
3440 popperStyles[transformProp] = '';
3441 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); // NOTE: DOM access here
3442 // restores the original style properties after the offsets have been computed
3443
3444 popperStyles.top = top;
3445 popperStyles.left = left;
3446 popperStyles[transformProp] = transform;
3447 options.boundaries = boundaries;
3448 var order = options.priority;
3449 var popper = data.offsets.popper;
3450 var check = {
3451 primary: function primary(placement) {
3452 var value = popper[placement];
3453
3454 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
3455 value = Math.max(popper[placement], boundaries[placement]);
3456 }
3457
3458 return defineProperty$1({}, placement, value);
3459 },
3460 secondary: function secondary(placement) {
3461 var mainSide = placement === 'right' ? 'left' : 'top';
3462 var value = popper[mainSide];
3463
3464 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
3465 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
3466 }
3467
3468 return defineProperty$1({}, mainSide, value);
3469 }
3470 };
3471 order.forEach(function (placement) {
3472 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
3473 popper = _extends$1({}, popper, check[side](placement));
3474 });
3475 data.offsets.popper = popper;
3476 return data;
3477 }
3478 /**
3479 * @function
3480 * @memberof Modifiers
3481 * @argument {Object} data - The data object generated by `update` method
3482 * @argument {Object} options - Modifiers configuration and options
3483 * @returns {Object} The data object, properly modified
3484 */
3485
3486
3487 function shift(data) {
3488 var placement = data.placement;
3489 var basePlacement = placement.split('-')[0];
3490 var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier
3491
3492 if (shiftvariation) {
3493 var _data$offsets = data.offsets,
3494 reference = _data$offsets.reference,
3495 popper = _data$offsets.popper;
3496 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
3497 var side = isVertical ? 'left' : 'top';
3498 var measurement = isVertical ? 'width' : 'height';
3499 var shiftOffsets = {
3500 start: defineProperty$1({}, side, reference[side]),
3501 end: defineProperty$1({}, side, reference[side] + reference[measurement] - popper[measurement])
3502 };
3503 data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
3504 }
3505
3506 return data;
3507 }
3508 /**
3509 * @function
3510 * @memberof Modifiers
3511 * @argument {Object} data - The data object generated by update method
3512 * @argument {Object} options - Modifiers configuration and options
3513 * @returns {Object} The data object, properly modified
3514 */
3515
3516
3517 function hide(data) {
3518 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
3519 return data;
3520 }
3521
3522 var refRect = data.offsets.reference;
3523 var bound = find(data.instance.modifiers, function (modifier) {
3524 return modifier.name === 'preventOverflow';
3525 }).boundaries;
3526
3527 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
3528 // Avoid unnecessary DOM access if visibility hasn't changed
3529 if (data.hide === true) {
3530 return data;
3531 }
3532
3533 data.hide = true;
3534 data.attributes['x-out-of-boundaries'] = '';
3535 } else {
3536 // Avoid unnecessary DOM access if visibility hasn't changed
3537 if (data.hide === false) {
3538 return data;
3539 }
3540
3541 data.hide = false;
3542 data.attributes['x-out-of-boundaries'] = false;
3543 }
3544
3545 return data;
3546 }
3547 /**
3548 * @function
3549 * @memberof Modifiers
3550 * @argument {Object} data - The data object generated by `update` method
3551 * @argument {Object} options - Modifiers configuration and options
3552 * @returns {Object} The data object, properly modified
3553 */
3554
3555
3556 function inner(data) {
3557 var placement = data.placement;
3558 var basePlacement = placement.split('-')[0];
3559 var _data$offsets = data.offsets,
3560 popper = _data$offsets.popper,
3561 reference = _data$offsets.reference;
3562 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
3563 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
3564 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
3565 data.placement = getOppositePlacement(placement);
3566 data.offsets.popper = getClientRect(popper);
3567 return data;
3568 }
3569 /**
3570 * Modifier function, each modifier can have a function of this type assigned
3571 * to its `fn` property.<br />
3572 * These functions will be called on each update, this means that you must
3573 * make sure they are performant enough to avoid performance bottlenecks.
3574 *
3575 * @function ModifierFn
3576 * @argument {dataObject} data - The data object generated by `update` method
3577 * @argument {Object} options - Modifiers configuration and options
3578 * @returns {dataObject} The data object, properly modified
3579 */
3580
3581 /**
3582 * Modifiers are plugins used to alter the behavior of your poppers.<br />
3583 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
3584 * needed by the library.
3585 *
3586 * Usually you don't want to override the `order`, `fn` and `onLoad` props.
3587 * All the other properties are configurations that could be tweaked.
3588 * @namespace modifiers
3589 */
3590
3591
3592 var modifiers = {
3593 /**
3594 * Modifier used to shift the popper on the start or end of its reference
3595 * element.<br />
3596 * It will read the variation of the `placement` property.<br />
3597 * It can be one either `-end` or `-start`.
3598 * @memberof modifiers
3599 * @inner
3600 */
3601 shift: {
3602 /** @prop {number} order=100 - Index used to define the order of execution */
3603 order: 100,
3604
3605 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3606 enabled: true,
3607
3608 /** @prop {ModifierFn} */
3609 fn: shift
3610 },
3611
3612 /**
3613 * The `offset` modifier can shift your popper on both its axis.
3614 *
3615 * It accepts the following units:
3616 * - `px` or unit-less, interpreted as pixels
3617 * - `%` or `%r`, percentage relative to the length of the reference element
3618 * - `%p`, percentage relative to the length of the popper element
3619 * - `vw`, CSS viewport width unit
3620 * - `vh`, CSS viewport height unit
3621 *
3622 * For length is intended the main axis relative to the placement of the popper.<br />
3623 * This means that if the placement is `top` or `bottom`, the length will be the
3624 * `width`. In case of `left` or `right`, it will be the `height`.
3625 *
3626 * You can provide a single value (as `Number` or `String`), or a pair of values
3627 * as `String` divided by a comma or one (or more) white spaces.<br />
3628 * The latter is a deprecated method because it leads to confusion and will be
3629 * removed in v2.<br />
3630 * Additionally, it accepts additions and subtractions between different units.
3631 * Note that multiplications and divisions aren't supported.
3632 *
3633 * Valid examples are:
3634 * ```
3635 * 10
3636 * '10%'
3637 * '10, 10'
3638 * '10%, 10'
3639 * '10 + 10%'
3640 * '10 - 5vh + 3%'
3641 * '-10px + 5vh, 5px - 6%'
3642 * ```
3643 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
3644 * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
3645 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
3646 *
3647 * @memberof modifiers
3648 * @inner
3649 */
3650 offset: {
3651 /** @prop {number} order=200 - Index used to define the order of execution */
3652 order: 200,
3653
3654 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3655 enabled: true,
3656
3657 /** @prop {ModifierFn} */
3658 fn: offset,
3659
3660 /** @prop {Number|String} offset=0
3661 * The offset value as described in the modifier description
3662 */
3663 offset: 0
3664 },
3665
3666 /**
3667 * Modifier used to prevent the popper from being positioned outside the boundary.
3668 *
3669 * A scenario exists where the reference itself is not within the boundaries.<br />
3670 * We can say it has "escaped the boundaries" — or just "escaped".<br />
3671 * In this case we need to decide whether the popper should either:
3672 *
3673 * - detach from the reference and remain "trapped" in the boundaries, or
3674 * - if it should ignore the boundary and "escape with its reference"
3675 *
3676 * When `escapeWithReference` is set to`true` and reference is completely
3677 * outside its boundaries, the popper will overflow (or completely leave)
3678 * the boundaries in order to remain attached to the edge of the reference.
3679 *
3680 * @memberof modifiers
3681 * @inner
3682 */
3683 preventOverflow: {
3684 /** @prop {number} order=300 - Index used to define the order of execution */
3685 order: 300,
3686
3687 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3688 enabled: true,
3689
3690 /** @prop {ModifierFn} */
3691 fn: preventOverflow,
3692
3693 /**
3694 * @prop {Array} [priority=['left','right','top','bottom']]
3695 * Popper will try to prevent overflow following these priorities by default,
3696 * then, it could overflow on the left and on top of the `boundariesElement`
3697 */
3698 priority: ['left', 'right', 'top', 'bottom'],
3699
3700 /**
3701 * @prop {number} padding=5
3702 * Amount of pixel used to define a minimum distance between the boundaries
3703 * and the popper. This makes sure the popper always has a little padding
3704 * between the edges of its container
3705 */
3706 padding: 5,
3707
3708 /**
3709 * @prop {String|HTMLElement} boundariesElement='scrollParent'
3710 * Boundaries used by the modifier. Can be `scrollParent`, `window`,
3711 * `viewport` or any DOM element.
3712 */
3713 boundariesElement: 'scrollParent'
3714 },
3715
3716 /**
3717 * Modifier used to make sure the reference and its popper stay near each other
3718 * without leaving any gap between the two. Especially useful when the arrow is
3719 * enabled and you want to ensure that it points to its reference element.
3720 * It cares only about the first axis. You can still have poppers with margin
3721 * between the popper and its reference element.
3722 * @memberof modifiers
3723 * @inner
3724 */
3725 keepTogether: {
3726 /** @prop {number} order=400 - Index used to define the order of execution */
3727 order: 400,
3728
3729 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3730 enabled: true,
3731
3732 /** @prop {ModifierFn} */
3733 fn: keepTogether
3734 },
3735
3736 /**
3737 * This modifier is used to move the `arrowElement` of the popper to make
3738 * sure it is positioned between the reference element and its popper element.
3739 * It will read the outer size of the `arrowElement` node to detect how many
3740 * pixels of conjunction are needed.
3741 *
3742 * It has no effect if no `arrowElement` is provided.
3743 * @memberof modifiers
3744 * @inner
3745 */
3746 arrow: {
3747 /** @prop {number} order=500 - Index used to define the order of execution */
3748 order: 500,
3749
3750 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3751 enabled: true,
3752
3753 /** @prop {ModifierFn} */
3754 fn: arrow,
3755
3756 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
3757 element: '[x-arrow]'
3758 },
3759
3760 /**
3761 * Modifier used to flip the popper's placement when it starts to overlap its
3762 * reference element.
3763 *
3764 * Requires the `preventOverflow` modifier before it in order to work.
3765 *
3766 * **NOTE:** this modifier will interrupt the current update cycle and will
3767 * restart it if it detects the need to flip the placement.
3768 * @memberof modifiers
3769 * @inner
3770 */
3771 flip: {
3772 /** @prop {number} order=600 - Index used to define the order of execution */
3773 order: 600,
3774
3775 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3776 enabled: true,
3777
3778 /** @prop {ModifierFn} */
3779 fn: flip,
3780
3781 /**
3782 * @prop {String|Array} behavior='flip'
3783 * The behavior used to change the popper's placement. It can be one of
3784 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
3785 * placements (with optional variations)
3786 */
3787 behavior: 'flip',
3788
3789 /**
3790 * @prop {number} padding=5
3791 * The popper will flip if it hits the edges of the `boundariesElement`
3792 */
3793 padding: 5,
3794
3795 /**
3796 * @prop {String|HTMLElement} boundariesElement='viewport'
3797 * The element which will define the boundaries of the popper position.
3798 * The popper will never be placed outside of the defined boundaries
3799 * (except if `keepTogether` is enabled)
3800 */
3801 boundariesElement: 'viewport'
3802 },
3803
3804 /**
3805 * Modifier used to make the popper flow toward the inner of the reference element.
3806 * By default, when this modifier is disabled, the popper will be placed outside
3807 * the reference element.
3808 * @memberof modifiers
3809 * @inner
3810 */
3811 inner: {
3812 /** @prop {number} order=700 - Index used to define the order of execution */
3813 order: 700,
3814
3815 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
3816 enabled: false,
3817
3818 /** @prop {ModifierFn} */
3819 fn: inner
3820 },
3821
3822 /**
3823 * Modifier used to hide the popper when its reference element is outside of the
3824 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
3825 * be used to hide with a CSS selector the popper when its reference is
3826 * out of boundaries.
3827 *
3828 * Requires the `preventOverflow` modifier before it in order to work.
3829 * @memberof modifiers
3830 * @inner
3831 */
3832 hide: {
3833 /** @prop {number} order=800 - Index used to define the order of execution */
3834 order: 800,
3835
3836 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3837 enabled: true,
3838
3839 /** @prop {ModifierFn} */
3840 fn: hide
3841 },
3842
3843 /**
3844 * Computes the style that will be applied to the popper element to gets
3845 * properly positioned.
3846 *
3847 * Note that this modifier will not touch the DOM, it just prepares the styles
3848 * so that `applyStyle` modifier can apply it. This separation is useful
3849 * in case you need to replace `applyStyle` with a custom implementation.
3850 *
3851 * This modifier has `850` as `order` value to maintain backward compatibility
3852 * with previous versions of Popper.js. Expect the modifiers ordering method
3853 * to change in future major versions of the library.
3854 *
3855 * @memberof modifiers
3856 * @inner
3857 */
3858 computeStyle: {
3859 /** @prop {number} order=850 - Index used to define the order of execution */
3860 order: 850,
3861
3862 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3863 enabled: true,
3864
3865 /** @prop {ModifierFn} */
3866 fn: computeStyle,
3867
3868 /**
3869 * @prop {Boolean} gpuAcceleration=true
3870 * If true, it uses the CSS 3D transformation to position the popper.
3871 * Otherwise, it will use the `top` and `left` properties
3872 */
3873 gpuAcceleration: true,
3874
3875 /**
3876 * @prop {string} [x='bottom']
3877 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
3878 * Change this if your popper should grow in a direction different from `bottom`
3879 */
3880 x: 'bottom',
3881
3882 /**
3883 * @prop {string} [x='left']
3884 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
3885 * Change this if your popper should grow in a direction different from `right`
3886 */
3887 y: 'right'
3888 },
3889
3890 /**
3891 * Applies the computed styles to the popper element.
3892 *
3893 * All the DOM manipulations are limited to this modifier. This is useful in case
3894 * you want to integrate Popper.js inside a framework or view library and you
3895 * want to delegate all the DOM manipulations to it.
3896 *
3897 * Note that if you disable this modifier, you must make sure the popper element
3898 * has its position set to `absolute` before Popper.js can do its work!
3899 *
3900 * Just disable this modifier and define your own to achieve the desired effect.
3901 *
3902 * @memberof modifiers
3903 * @inner
3904 */
3905 applyStyle: {
3906 /** @prop {number} order=900 - Index used to define the order of execution */
3907 order: 900,
3908
3909 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3910 enabled: true,
3911
3912 /** @prop {ModifierFn} */
3913 fn: applyStyle,
3914
3915 /** @prop {Function} */
3916 onLoad: applyStyleOnLoad,
3917
3918 /**
3919 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
3920 * @prop {Boolean} gpuAcceleration=true
3921 * If true, it uses the CSS 3D transformation to position the popper.
3922 * Otherwise, it will use the `top` and `left` properties
3923 */
3924 gpuAcceleration: undefined
3925 }
3926 };
3927 /**
3928 * The `dataObject` is an object containing all the information used by Popper.js.
3929 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
3930 * @name dataObject
3931 * @property {Object} data.instance The Popper.js instance
3932 * @property {String} data.placement Placement applied to popper
3933 * @property {String} data.originalPlacement Placement originally defined on init
3934 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
3935 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
3936 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
3937 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
3938 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
3939 * @property {Object} data.boundaries Offsets of the popper boundaries
3940 * @property {Object} data.offsets The measurements of popper, reference and arrow elements
3941 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
3942 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
3943 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
3944 */
3945
3946 /**
3947 * Default options provided to Popper.js constructor.<br />
3948 * These can be overridden using the `options` argument of Popper.js.<br />
3949 * To override an option, simply pass an object with the same
3950 * structure of the `options` object, as the 3rd argument. For example:
3951 * ```
3952 * new Popper(ref, pop, {
3953 * modifiers: {
3954 * preventOverflow: { enabled: false }
3955 * }
3956 * })
3957 * ```
3958 * @type {Object}
3959 * @static
3960 * @memberof Popper
3961 */
3962
3963 var Defaults = {
3964 /**
3965 * Popper's placement.
3966 * @prop {Popper.placements} placement='bottom'
3967 */
3968 placement: 'bottom',
3969
3970 /**
3971 * Set this to true if you want popper to position it self in 'fixed' mode
3972 * @prop {Boolean} positionFixed=false
3973 */
3974 positionFixed: false,
3975
3976 /**
3977 * Whether events (resize, scroll) are initially enabled.
3978 * @prop {Boolean} eventsEnabled=true
3979 */
3980 eventsEnabled: true,
3981
3982 /**
3983 * Set to true if you want to automatically remove the popper when
3984 * you call the `destroy` method.
3985 * @prop {Boolean} removeOnDestroy=false
3986 */
3987 removeOnDestroy: false,
3988
3989 /**
3990 * Callback called when the popper is created.<br />
3991 * By default, it is set to no-op.<br />
3992 * Access Popper.js instance with `data.instance`.
3993 * @prop {onCreate}
3994 */
3995 onCreate: function onCreate() {},
3996
3997 /**
3998 * Callback called when the popper is updated. This callback is not called
3999 * on the initialization/creation of the popper, but only on subsequent
4000 * updates.<br />
4001 * By default, it is set to no-op.<br />
4002 * Access Popper.js instance with `data.instance`.
4003 * @prop {onUpdate}
4004 */
4005 onUpdate: function onUpdate() {},
4006
4007 /**
4008 * List of modifiers used to modify the offsets before they are applied to the popper.
4009 * They provide most of the functionalities of Popper.js.
4010 * @prop {modifiers}
4011 */
4012 modifiers: modifiers
4013 };
4014 /**
4015 * @callback onCreate
4016 * @param {dataObject} data
4017 */
4018
4019 /**
4020 * @callback onUpdate
4021 * @param {dataObject} data
4022 */
4023 // Utils
4024 // Methods
4025
4026 var Popper = function () {
4027 /**
4028 * Creates a new Popper.js instance.
4029 * @class Popper
4030 * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
4031 * @param {HTMLElement} popper - The HTML element used as the popper
4032 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
4033 * @return {Object} instance - The generated Popper.js instance
4034 */
4035 function Popper(reference, popper) {
4036 var _this = this;
4037
4038 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4039 classCallCheck(this, Popper);
4040
4041 this.scheduleUpdate = function () {
4042 return requestAnimationFrame(_this.update);
4043 }; // make update() debounced, so that it only runs at most once-per-tick
4044
4045
4046 this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it
4047
4048 this.options = _extends$1({}, Popper.Defaults, options); // init state
4049
4050 this.state = {
4051 isDestroyed: false,
4052 isCreated: false,
4053 scrollParents: []
4054 }; // get reference and popper elements (allow jQuery wrappers)
4055
4056 this.reference = reference && reference.jquery ? reference[0] : reference;
4057 this.popper = popper && popper.jquery ? popper[0] : popper; // Deep merge modifiers options
4058
4059 this.options.modifiers = {};
4060 Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
4061 _this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
4062 }); // Refactoring modifiers' list (Object => Array)
4063
4064 this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
4065 return _extends$1({
4066 name: name
4067 }, _this.options.modifiers[name]);
4068 }) // sort the modifiers by order
4069 .sort(function (a, b) {
4070 return a.order - b.order;
4071 }); // modifiers have the ability to execute arbitrary code when Popper.js get inited
4072 // such code is executed in the same order of its modifier
4073 // they could add new properties to their options configuration
4074 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
4075
4076 this.modifiers.forEach(function (modifierOptions) {
4077 if (modifierOptions.enabled && isFunction$1(modifierOptions.onLoad)) {
4078 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
4079 }
4080 }); // fire the first update to position the popper in the right place
4081
4082 this.update();
4083 var eventsEnabled = this.options.eventsEnabled;
4084
4085 if (eventsEnabled) {
4086 // setup event listeners, they will take care of update the position in specific situations
4087 this.enableEventListeners();
4088 }
4089
4090 this.state.eventsEnabled = eventsEnabled;
4091 } // We can't use class properties because they don't get listed in the
4092 // class prototype and break stuff like Sinon stubs
4093
4094
4095 createClass(Popper, [{
4096 key: 'update',
4097 value: function update$$1() {
4098 return update.call(this);
4099 }
4100 }, {
4101 key: 'destroy',
4102 value: function destroy$$1() {
4103 return destroy.call(this);
4104 }
4105 }, {
4106 key: 'enableEventListeners',
4107 value: function enableEventListeners$$1() {
4108 return enableEventListeners.call(this);
4109 }
4110 }, {
4111 key: 'disableEventListeners',
4112 value: function disableEventListeners$$1() {
4113 return disableEventListeners.call(this);
4114 }
4115 /**
4116 * Schedules an update. It will run on the next UI update available.
4117 * @method scheduleUpdate
4118 * @memberof Popper
4119 */
4120
4121 /**
4122 * Collection of utilities useful when writing custom modifiers.
4123 * Starting from version 1.7, this method is available only if you
4124 * include `popper-utils.js` before `popper.js`.
4125 *
4126 * **DEPRECATION**: This way to access PopperUtils is deprecated
4127 * and will be removed in v2! Use the PopperUtils module directly instead.
4128 * Due to the high instability of the methods contained in Utils, we can't
4129 * guarantee them to follow semver. Use them at your own risk!
4130 * @static
4131 * @private
4132 * @type {Object}
4133 * @deprecated since version 1.8
4134 * @member Utils
4135 * @memberof Popper
4136 */
4137
4138 }]);
4139 return Popper;
4140 }();
4141 /**
4142 * The `referenceObject` is an object that provides an interface compatible with Popper.js
4143 * and lets you use it as replacement of a real DOM node.<br />
4144 * You can use this method to position a popper relatively to a set of coordinates
4145 * in case you don't have a DOM node to use as reference.
4146 *
4147 * ```
4148 * new Popper(referenceObject, popperNode);
4149 * ```
4150 *
4151 * NB: This feature isn't supported in Internet Explorer 10.
4152 * @name referenceObject
4153 * @property {Function} data.getBoundingClientRect
4154 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
4155 * @property {number} data.clientWidth
4156 * An ES6 getter that will return the width of the virtual reference element.
4157 * @property {number} data.clientHeight
4158 * An ES6 getter that will return the height of the virtual reference element.
4159 */
4160
4161
4162 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
4163 Popper.placements = placements;
4164 Popper.Defaults = Defaults;
4165
4166 var key = '__global_unique_id__';
4167
4168 var gud = function gud() {
4169 return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
4170 };
4171
4172 /**
4173 * Copyright (c) 2013-present, Facebook, Inc.
4174 *
4175 * This source code is licensed under the MIT license found in the
4176 * LICENSE file in the root directory of this source tree.
4177 *
4178 *
4179 */
4180
4181 function makeEmptyFunction(arg) {
4182 return function () {
4183 return arg;
4184 };
4185 }
4186 /**
4187 * This function accepts and discards inputs; it has no side effects. This is
4188 * primarily useful idiomatically for overridable function endpoints which
4189 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
4190 */
4191
4192
4193 var emptyFunction$1 = function emptyFunction() {};
4194
4195 emptyFunction$1.thatReturns = makeEmptyFunction;
4196 emptyFunction$1.thatReturnsFalse = makeEmptyFunction(false);
4197 emptyFunction$1.thatReturnsTrue = makeEmptyFunction(true);
4198 emptyFunction$1.thatReturnsNull = makeEmptyFunction(null);
4199
4200 emptyFunction$1.thatReturnsThis = function () {
4201 return this;
4202 };
4203
4204 emptyFunction$1.thatReturnsArgument = function (arg) {
4205 return arg;
4206 };
4207
4208 var emptyFunction_1 = emptyFunction$1;
4209
4210 /**
4211 * Similar to invariant but only logs a warning if the condition is not met.
4212 * This can be used to log issues in development environments in critical
4213 * paths. Removing the logging code for production environments will keep the
4214 * same logic and follow the same code paths.
4215 */
4216
4217
4218 var warning = emptyFunction_1;
4219
4220 var warning_1 = warning;
4221
4222 var implementation = createCommonjsModule(function (module, exports) {
4223
4224 exports.__esModule = true;
4225
4226 var _react2 = _interopRequireDefault(React__default);
4227
4228 var _propTypes2 = _interopRequireDefault(propTypes);
4229
4230 var _gud2 = _interopRequireDefault(gud);
4231
4232 var _warning2 = _interopRequireDefault(warning_1);
4233
4234 function _interopRequireDefault(obj) {
4235 return obj && obj.__esModule ? obj : {
4236 default: obj
4237 };
4238 }
4239
4240 function _classCallCheck(instance, Constructor) {
4241 if (!(instance instanceof Constructor)) {
4242 throw new TypeError("Cannot call a class as a function");
4243 }
4244 }
4245
4246 function _possibleConstructorReturn(self, call) {
4247 if (!self) {
4248 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4249 }
4250
4251 return call && (typeof call === "object" || typeof call === "function") ? call : self;
4252 }
4253
4254 function _inherits(subClass, superClass) {
4255 if (typeof superClass !== "function" && superClass !== null) {
4256 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
4257 }
4258
4259 subClass.prototype = Object.create(superClass && superClass.prototype, {
4260 constructor: {
4261 value: subClass,
4262 enumerable: false,
4263 writable: true,
4264 configurable: true
4265 }
4266 });
4267 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
4268 }
4269
4270 var MAX_SIGNED_31_BIT_INT = 1073741823; // Inlined Object.is polyfill.
4271 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
4272
4273 function objectIs(x, y) {
4274 if (x === y) {
4275 return x !== 0 || 1 / x === 1 / y;
4276 } else {
4277 return x !== x && y !== y;
4278 }
4279 }
4280
4281 function createEventEmitter(value) {
4282 var handlers = [];
4283 return {
4284 on: function on(handler) {
4285 handlers.push(handler);
4286 },
4287 off: function off(handler) {
4288 handlers = handlers.filter(function (h) {
4289 return h !== handler;
4290 });
4291 },
4292 get: function get() {
4293 return value;
4294 },
4295 set: function set(newValue, changedBits) {
4296 value = newValue;
4297 handlers.forEach(function (handler) {
4298 return handler(value, changedBits);
4299 });
4300 }
4301 };
4302 }
4303
4304 function onlyChild(children) {
4305 return Array.isArray(children) ? children[0] : children;
4306 }
4307
4308 function createReactContext(defaultValue, calculateChangedBits) {
4309 var _Provider$childContex, _Consumer$contextType;
4310
4311 var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';
4312
4313 var Provider = function (_Component) {
4314 _inherits(Provider, _Component);
4315
4316 function Provider() {
4317 var _temp, _this, _ret;
4318
4319 _classCallCheck(this, Provider);
4320
4321 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
4322 args[_key] = arguments[_key];
4323 }
4324
4325 return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
4326 }
4327
4328 Provider.prototype.getChildContext = function getChildContext() {
4329 var _ref;
4330
4331 return _ref = {}, _ref[contextProp] = this.emitter, _ref;
4332 };
4333
4334 Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
4335 if (this.props.value !== nextProps.value) {
4336 var oldValue = this.props.value;
4337 var newValue = nextProps.value;
4338 var changedBits = void 0;
4339
4340 if (objectIs(oldValue, newValue)) {
4341 changedBits = 0; // No change
4342 } else {
4343 changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
4344
4345 changedBits |= 0;
4346
4347 if (changedBits !== 0) {
4348 this.emitter.set(nextProps.value, changedBits);
4349 }
4350 }
4351 }
4352 };
4353
4354 Provider.prototype.render = function render() {
4355 return this.props.children;
4356 };
4357
4358 return Provider;
4359 }(React__default.Component);
4360
4361 Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);
4362
4363 var Consumer = function (_Component2) {
4364 _inherits(Consumer, _Component2);
4365
4366 function Consumer() {
4367 var _temp2, _this2, _ret2;
4368
4369 _classCallCheck(this, Consumer);
4370
4371 for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
4372 args[_key2] = arguments[_key2];
4373 }
4374
4375 return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {
4376 value: _this2.getValue()
4377 }, _this2.onUpdate = function (newValue, changedBits) {
4378 var observedBits = _this2.observedBits | 0;
4379
4380 if ((observedBits & changedBits) !== 0) {
4381 _this2.setState({
4382 value: _this2.getValue()
4383 });
4384 }
4385 }, _temp2), _possibleConstructorReturn(_this2, _ret2);
4386 }
4387
4388 Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
4389 var observedBits = nextProps.observedBits;
4390 this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
4391 : observedBits;
4392 };
4393
4394 Consumer.prototype.componentDidMount = function componentDidMount() {
4395 if (this.context[contextProp]) {
4396 this.context[contextProp].on(this.onUpdate);
4397 }
4398
4399 var observedBits = this.props.observedBits;
4400 this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
4401 : observedBits;
4402 };
4403
4404 Consumer.prototype.componentWillUnmount = function componentWillUnmount() {
4405 if (this.context[contextProp]) {
4406 this.context[contextProp].off(this.onUpdate);
4407 }
4408 };
4409
4410 Consumer.prototype.getValue = function getValue() {
4411 if (this.context[contextProp]) {
4412 return this.context[contextProp].get();
4413 } else {
4414 return defaultValue;
4415 }
4416 };
4417
4418 Consumer.prototype.render = function render() {
4419 return onlyChild(this.props.children)(this.state.value);
4420 };
4421
4422 return Consumer;
4423 }(React__default.Component);
4424
4425 Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);
4426 return {
4427 Provider: Provider,
4428 Consumer: Consumer
4429 };
4430 }
4431
4432 exports.default = createReactContext;
4433 module.exports = exports['default'];
4434 });
4435 unwrapExports(implementation);
4436
4437 var lib = createCommonjsModule(function (module, exports) {
4438
4439 exports.__esModule = true;
4440
4441 var _react2 = _interopRequireDefault(React__default);
4442
4443 var _implementation2 = _interopRequireDefault(implementation);
4444
4445 function _interopRequireDefault(obj) {
4446 return obj && obj.__esModule ? obj : {
4447 default: obj
4448 };
4449 }
4450
4451 exports.default = _react2.default.createContext || _implementation2.default;
4452 module.exports = exports['default'];
4453 });
4454 var createContext = unwrapExports(lib);
4455
4456 var ManagerContext = createContext({
4457 setReferenceNode: undefined,
4458 referenceNode: undefined
4459 });
4460
4461 var Manager =
4462 /*#__PURE__*/
4463 function (_React$Component) {
4464 inheritsLoose(Manager, _React$Component);
4465
4466 function Manager() {
4467 var _this;
4468
4469 _this = _React$Component.call(this) || this;
4470
4471 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "setReferenceNode", function (referenceNode) {
4472 if (!referenceNode || _this.state.context.referenceNode === referenceNode) {
4473 return;
4474 }
4475
4476 _this.setState(function (_ref) {
4477 var context = _ref.context;
4478 return {
4479 context: _extends_1({}, context, {
4480 referenceNode: referenceNode
4481 })
4482 };
4483 });
4484 });
4485
4486 _this.state = {
4487 context: {
4488 setReferenceNode: _this.setReferenceNode,
4489 referenceNode: undefined
4490 }
4491 };
4492 return _this;
4493 }
4494
4495 var _proto = Manager.prototype;
4496
4497 _proto.render = function render() {
4498 return React.createElement(ManagerContext.Provider, {
4499 value: this.state.context
4500 }, this.props.children);
4501 };
4502
4503 return Manager;
4504 }(React.Component);
4505
4506 /**
4507 * Takes an argument and if it's an array, returns the first item in the array,
4508 * otherwise returns the argument. Used for Preact compatibility.
4509 */
4510 var unwrapArray = function unwrapArray(arg) {
4511 return Array.isArray(arg) ? arg[0] : arg;
4512 };
4513 /**
4514 * Takes a maybe-undefined function and arbitrary args and invokes the function
4515 * only if it is defined.
4516 */
4517
4518 var safeInvoke = function safeInvoke(fn) {
4519 if (typeof fn === "function") {
4520 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4521 args[_key - 1] = arguments[_key];
4522 }
4523
4524 return fn.apply(void 0, args);
4525 }
4526 };
4527
4528 var initialStyle = {
4529 position: 'absolute',
4530 top: 0,
4531 left: 0,
4532 opacity: 0,
4533 pointerEvents: 'none'
4534 };
4535 var initialArrowStyle = {};
4536 var InnerPopper =
4537 /*#__PURE__*/
4538 function (_React$Component) {
4539 inheritsLoose(InnerPopper, _React$Component);
4540
4541 function InnerPopper() {
4542 var _this;
4543
4544 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4545 args[_key] = arguments[_key];
4546 }
4547
4548 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
4549
4550 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "state", {
4551 data: undefined,
4552 placement: undefined
4553 });
4554
4555 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "popperInstance", void 0);
4556
4557 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "popperNode", null);
4558
4559 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "arrowNode", null);
4560
4561 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "setPopperNode", function (popperNode) {
4562 if (!popperNode || _this.popperNode === popperNode) return;
4563 safeInvoke(_this.props.innerRef, popperNode);
4564 _this.popperNode = popperNode;
4565
4566 _this.updatePopperInstance();
4567 });
4568
4569 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "setArrowNode", function (arrowNode) {
4570 _this.arrowNode = arrowNode;
4571 });
4572
4573 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "updateStateModifier", {
4574 enabled: true,
4575 order: 900,
4576 fn: function fn(data) {
4577 var placement = data.placement;
4578
4579 _this.setState({
4580 data: data,
4581 placement: placement
4582 });
4583
4584 return data;
4585 }
4586 });
4587
4588 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "getOptions", function () {
4589 return {
4590 placement: _this.props.placement,
4591 eventsEnabled: _this.props.eventsEnabled,
4592 positionFixed: _this.props.positionFixed,
4593 modifiers: _extends_1({}, _this.props.modifiers, {
4594 arrow: _extends_1({}, _this.props.modifiers && _this.props.modifiers.arrow, {
4595 enabled: !!_this.arrowNode,
4596 element: _this.arrowNode
4597 }),
4598 applyStyle: {
4599 enabled: false
4600 },
4601 updateStateModifier: _this.updateStateModifier
4602 })
4603 };
4604 });
4605
4606 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "getPopperStyle", function () {
4607 return !_this.popperNode || !_this.state.data ? initialStyle : _extends_1({
4608 position: _this.state.data.offsets.popper.position
4609 }, _this.state.data.styles);
4610 });
4611
4612 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "getPopperPlacement", function () {
4613 return !_this.state.data ? undefined : _this.state.placement;
4614 });
4615
4616 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "getArrowStyle", function () {
4617 return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;
4618 });
4619
4620 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "getOutOfBoundariesState", function () {
4621 return _this.state.data ? _this.state.data.hide : undefined;
4622 });
4623
4624 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "destroyPopperInstance", function () {
4625 if (!_this.popperInstance) return;
4626
4627 _this.popperInstance.destroy();
4628
4629 _this.popperInstance = null;
4630 });
4631
4632 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "updatePopperInstance", function () {
4633 _this.destroyPopperInstance();
4634
4635 var _assertThisInitialize = assertThisInitialized(assertThisInitialized(_this)),
4636 popperNode = _assertThisInitialize.popperNode;
4637
4638 var referenceElement = _this.props.referenceElement;
4639 if (!referenceElement || !popperNode) return;
4640 _this.popperInstance = new Popper(referenceElement, popperNode, _this.getOptions());
4641 });
4642
4643 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "scheduleUpdate", function () {
4644 if (_this.popperInstance) {
4645 _this.popperInstance.scheduleUpdate();
4646 }
4647 });
4648
4649 return _this;
4650 }
4651
4652 var _proto = InnerPopper.prototype;
4653
4654 _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
4655 // If the Popper.js options have changed, update the instance (destroy + create)
4656 if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed) {
4657 this.updatePopperInstance();
4658 } else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {
4659 this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();
4660 } // A placement difference in state means popper determined a new placement
4661 // apart from the props value. By the time the popper element is rendered with
4662 // the new position Popper has already measured it, if the place change triggers
4663 // a size change it will result in a misaligned popper. So we schedule an update to be sure.
4664
4665
4666 if (prevState.placement !== this.state.placement) {
4667 this.scheduleUpdate();
4668 }
4669 };
4670
4671 _proto.componentWillUnmount = function componentWillUnmount() {
4672 safeInvoke(this.props.innerRef, null);
4673 this.destroyPopperInstance();
4674 };
4675
4676 _proto.render = function render() {
4677 return unwrapArray(this.props.children)({
4678 ref: this.setPopperNode,
4679 style: this.getPopperStyle(),
4680 placement: this.getPopperPlacement(),
4681 outOfBoundaries: this.getOutOfBoundariesState(),
4682 scheduleUpdate: this.scheduleUpdate,
4683 arrowProps: {
4684 ref: this.setArrowNode,
4685 style: this.getArrowStyle()
4686 }
4687 });
4688 };
4689
4690 return InnerPopper;
4691 }(React.Component);
4692
4693 defineProperty(InnerPopper, "defaultProps", {
4694 placement: 'bottom',
4695 eventsEnabled: true,
4696 referenceElement: undefined,
4697 positionFixed: false
4698 });
4699 function Popper$1(_ref) {
4700 var referenceElement = _ref.referenceElement,
4701 props = objectWithoutPropertiesLoose(_ref, ["referenceElement"]);
4702
4703 return React.createElement(ManagerContext.Consumer, null, function (_ref2) {
4704 var referenceNode = _ref2.referenceNode;
4705 return React.createElement(InnerPopper, _extends_1({
4706 referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
4707 }, props));
4708 });
4709 }
4710
4711 /**
4712 * Copyright (c) 2014-present, Facebook, Inc.
4713 *
4714 * This source code is licensed under the MIT license found in the
4715 * LICENSE file in the root directory of this source tree.
4716 */
4717
4718 var warning$1 = function warning() {};
4719
4720 var warning_1$1 = warning$1;
4721
4722 var InnerReference =
4723 /*#__PURE__*/
4724 function (_React$Component) {
4725 inheritsLoose(InnerReference, _React$Component);
4726
4727 function InnerReference() {
4728 var _this;
4729
4730 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4731 args[_key] = arguments[_key];
4732 }
4733
4734 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
4735
4736 defineProperty(assertThisInitialized(assertThisInitialized(_this)), "refHandler", function (node) {
4737 safeInvoke(_this.props.innerRef, node);
4738 safeInvoke(_this.props.setReferenceNode, node);
4739 });
4740
4741 return _this;
4742 }
4743
4744 var _proto = InnerReference.prototype;
4745
4746 _proto.render = function render() {
4747 warning_1$1(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
4748 return unwrapArray(this.props.children)({
4749 ref: this.refHandler
4750 });
4751 };
4752
4753 return InnerReference;
4754 }(React.Component);
4755
4756 function Reference(props) {
4757 return React.createElement(ManagerContext.Consumer, null, function (_ref) {
4758 var setReferenceNode = _ref.setReferenceNode;
4759 return React.createElement(InnerReference, _extends_1({
4760 setReferenceNode: setReferenceNode
4761 }, props));
4762 });
4763 }
4764
4765 // Public components
4766 // Public types
4767
4768 /**
4769 * DropdownContext
4770 * {
4771 * toggle: PropTypes.func.isRequired,
4772 * isOpen: PropTypes.bool.isRequired,
4773 * direction: PropTypes.oneOf(['up', 'down', 'left', 'right']).isRequired,
4774 * inNavbar: PropTypes.bool.isRequired,
4775 * }
4776 */
4777
4778 var DropdownContext = React__default.createContext({});
4779
4780 var propTypes$d = {
4781 disabled: propTypes.bool,
4782 direction: propTypes.oneOf(['up', 'down', 'left', 'right']),
4783 group: propTypes.bool,
4784 isOpen: propTypes.bool,
4785 nav: propTypes.bool,
4786 active: propTypes.bool,
4787 addonType: propTypes.oneOfType([propTypes.bool, propTypes.oneOf(['prepend', 'append'])]),
4788 size: propTypes.string,
4789 tag: tagPropType,
4790 toggle: propTypes.func,
4791 children: propTypes.node,
4792 className: propTypes.string,
4793 cssModule: propTypes.object,
4794 inNavbar: propTypes.bool,
4795 setActiveFromChild: propTypes.bool
4796 };
4797 var defaultProps$c = {
4798 isOpen: false,
4799 direction: 'down',
4800 nav: false,
4801 active: false,
4802 addonType: false,
4803 inNavbar: false,
4804 setActiveFromChild: false
4805 };
4806
4807 var Dropdown =
4808 /*#__PURE__*/
4809 function (_React$Component) {
4810 _inheritsLoose(Dropdown, _React$Component);
4811
4812 function Dropdown(props) {
4813 var _this;
4814
4815 _this = _React$Component.call(this, props) || this;
4816 _this.addEvents = _this.addEvents.bind(_assertThisInitialized(_this));
4817 _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
4818 _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
4819 _this.removeEvents = _this.removeEvents.bind(_assertThisInitialized(_this));
4820 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
4821 _this.containerRef = React__default.createRef();
4822 return _this;
4823 }
4824
4825 var _proto = Dropdown.prototype;
4826
4827 _proto.getContextValue = function getContextValue() {
4828 return {
4829 toggle: this.props.toggle,
4830 isOpen: this.props.isOpen,
4831 direction: this.props.direction === 'down' && this.props.dropup ? 'up' : this.props.direction,
4832 inNavbar: this.props.inNavbar
4833 };
4834 };
4835
4836 _proto.componentDidMount = function componentDidMount() {
4837 this.handleProps();
4838 };
4839
4840 _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
4841 if (this.props.isOpen !== prevProps.isOpen) {
4842 this.handleProps();
4843 }
4844 };
4845
4846 _proto.componentWillUnmount = function componentWillUnmount() {
4847 this.removeEvents();
4848 };
4849
4850 _proto.getContainer = function getContainer() {
4851 return this.containerRef.current;
4852 };
4853
4854 _proto.getMenuCtrl = function getMenuCtrl() {
4855 if (this._$menuCtrl) return this._$menuCtrl;
4856 this._$menuCtrl = this.getContainer().querySelector('[aria-expanded]');
4857 return this._$menuCtrl;
4858 };
4859
4860 _proto.getMenuItems = function getMenuItems() {
4861 return [].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'));
4862 };
4863
4864 _proto.addEvents = function addEvents() {
4865 var _this2 = this;
4866
4867 ['click', 'touchstart', 'keyup'].forEach(function (event) {
4868 return document.addEventListener(event, _this2.handleDocumentClick, true);
4869 });
4870 };
4871
4872 _proto.removeEvents = function removeEvents() {
4873 var _this3 = this;
4874
4875 ['click', 'touchstart', 'keyup'].forEach(function (event) {
4876 return document.removeEventListener(event, _this3.handleDocumentClick, true);
4877 });
4878 };
4879
4880 _proto.handleDocumentClick = function handleDocumentClick(e) {
4881 if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return;
4882 var container = this.getContainer();
4883
4884 if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) {
4885 return;
4886 }
4887
4888 this.toggle(e);
4889 };
4890
4891 _proto.handleKeyDown = function handleKeyDown(e) {
4892 var _this4 = this;
4893
4894 if (/input|textarea/i.test(e.target.tagName) || keyCodes.tab === e.which && e.target.getAttribute('role') !== 'menuitem') {
4895 return;
4896 }
4897
4898 e.preventDefault();
4899 if (this.props.disabled) return;
4900
4901 if (this.getMenuCtrl() === e.target) {
4902 if (!this.props.isOpen && [keyCodes.space, keyCodes.enter, keyCodes.up, keyCodes.down].indexOf(e.which) > -1) {
4903 this.toggle(e);
4904 setTimeout(function () {
4905 return _this4.getMenuItems()[0].focus();
4906 });
4907 }
4908 }
4909
4910 if (this.props.isOpen && e.target.getAttribute('role') === 'menuitem') {
4911 if ([keyCodes.tab, keyCodes.esc].indexOf(e.which) > -1) {
4912 this.toggle(e);
4913 this.getMenuCtrl().focus();
4914 } else if ([keyCodes.space, keyCodes.enter].indexOf(e.which) > -1) {
4915 e.target.click();
4916 this.getMenuCtrl().focus();
4917 } else if ([keyCodes.down, keyCodes.up].indexOf(e.which) > -1 || [keyCodes.n, keyCodes.p].indexOf(e.which) > -1 && e.ctrlKey) {
4918 var $menuitems = this.getMenuItems();
4919 var index = $menuitems.indexOf(e.target);
4920
4921 if (keyCodes.up === e.which || keyCodes.p === e.which && e.ctrlKey) {
4922 index = index !== 0 ? index - 1 : $menuitems.length - 1;
4923 } else if (keyCodes.down === e.which || keyCodes.n === e.which && e.ctrlKey) {
4924 index = index === $menuitems.length - 1 ? 0 : index + 1;
4925 }
4926
4927 $menuitems[index].focus();
4928 } else if (keyCodes.end === e.which) {
4929 var _$menuitems = this.getMenuItems();
4930
4931 _$menuitems[_$menuitems.length - 1].focus();
4932 } else if (keyCodes.home === e.which) {
4933 var _$menuitems2 = this.getMenuItems();
4934
4935 _$menuitems2[0].focus();
4936 } else if (e.which >= 48 && e.which <= 90) {
4937 var _$menuitems3 = this.getMenuItems();
4938
4939 var charPressed = String.fromCharCode(e.which).toLowerCase();
4940
4941 for (var i = 0; i < _$menuitems3.length; i += 1) {
4942 var firstLetter = _$menuitems3[i].textContent && _$menuitems3[i].textContent[0].toLowerCase();
4943
4944 if (firstLetter === charPressed) {
4945 _$menuitems3[i].focus();
4946
4947 break;
4948 }
4949 }
4950 }
4951 }
4952 };
4953
4954 _proto.handleProps = function handleProps() {
4955 if (this.props.isOpen) {
4956 this.addEvents();
4957 } else {
4958 this.removeEvents();
4959 }
4960 };
4961
4962 _proto.toggle = function toggle(e) {
4963 if (this.props.disabled) {
4964 return e && e.preventDefault();
4965 }
4966
4967 return this.props.toggle(e);
4968 };
4969
4970 _proto.render = function render() {
4971 var _classNames, _ref;
4972
4973 var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar']),
4974 className = _omit.className,
4975 cssModule = _omit.cssModule,
4976 direction = _omit.direction,
4977 isOpen = _omit.isOpen,
4978 group = _omit.group,
4979 size = _omit.size,
4980 nav = _omit.nav,
4981 setActiveFromChild = _omit.setActiveFromChild,
4982 active = _omit.active,
4983 addonType = _omit.addonType,
4984 tag = _omit.tag,
4985 attrs = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "direction", "isOpen", "group", "size", "nav", "setActiveFromChild", "active", "addonType", "tag"]);
4986
4987 var Tag = tag || (nav ? 'li' : 'div');
4988 var subItemIsActive = false;
4989
4990 if (setActiveFromChild) {
4991 React__default.Children.map(this.props.children[1].props.children, function (dropdownItem) {
4992 if (dropdownItem && dropdownItem.props.active) subItemIsActive = true;
4993 });
4994 }
4995
4996 var classes = mapToCssModules(classnames(className, direction !== 'down' && "drop" + direction, nav && active ? 'active' : false, setActiveFromChild && subItemIsActive ? 'active' : false, (_classNames = {}, _classNames["input-group-" + addonType] = addonType, _classNames['btn-group'] = group, _classNames["btn-group-" + size] = !!size, _classNames.dropdown = !group && !addonType, _classNames.show = isOpen, _classNames['nav-item'] = nav, _classNames)), cssModule);
4997 return React__default.createElement(DropdownContext.Provider, {
4998 value: this.getContextValue()
4999 }, React__default.createElement(Manager, null, React__default.createElement(Tag, _extends({}, attrs, (_ref = {}, _ref[typeof Tag === 'string' ? 'ref' : 'innerRef'] = this.containerRef, _ref), {
5000 onKeyDown: this.handleKeyDown,
5001 className: classes
5002 }))));
5003 };
5004
5005 return Dropdown;
5006 }(React__default.Component);
5007
5008 Dropdown.propTypes = propTypes$d;
5009 Dropdown.defaultProps = defaultProps$c;
5010
5011 var propTypes$e = {
5012 children: propTypes.node
5013 };
5014
5015 var ButtonDropdown = function ButtonDropdown(props) {
5016 return React__default.createElement(Dropdown, _extends({
5017 group: true
5018 }, props));
5019 };
5020
5021 ButtonDropdown.propTypes = propTypes$e;
5022
5023 var propTypes$f = {
5024 tag: tagPropType,
5025 'aria-label': propTypes.string,
5026 className: propTypes.string,
5027 cssModule: propTypes.object,
5028 role: propTypes.string,
5029 size: propTypes.string,
5030 vertical: propTypes.bool
5031 };
5032 var defaultProps$d = {
5033 tag: 'div',
5034 role: 'group'
5035 };
5036
5037 var ButtonGroup = function ButtonGroup(props) {
5038 var className = props.className,
5039 cssModule = props.cssModule,
5040 size = props.size,
5041 vertical = props.vertical,
5042 Tag = props.tag,
5043 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "vertical", "tag"]);
5044
5045 var classes = mapToCssModules(classnames(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule);
5046 return React__default.createElement(Tag, _extends({}, attributes, {
5047 className: classes
5048 }));
5049 };
5050
5051 ButtonGroup.propTypes = propTypes$f;
5052 ButtonGroup.defaultProps = defaultProps$d;
5053
5054 var propTypes$g = {
5055 tag: tagPropType,
5056 'aria-label': propTypes.string,
5057 className: propTypes.string,
5058 cssModule: propTypes.object,
5059 role: propTypes.string
5060 };
5061 var defaultProps$e = {
5062 tag: 'div',
5063 role: 'toolbar'
5064 };
5065
5066 var ButtonToolbar = function ButtonToolbar(props) {
5067 var className = props.className,
5068 cssModule = props.cssModule,
5069 Tag = props.tag,
5070 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
5071
5072 var classes = mapToCssModules(classnames(className, 'btn-toolbar'), cssModule);
5073 return React__default.createElement(Tag, _extends({}, attributes, {
5074 className: classes
5075 }));
5076 };
5077
5078 ButtonToolbar.propTypes = propTypes$g;
5079 ButtonToolbar.defaultProps = defaultProps$e;
5080
5081 var propTypes$h = {
5082 children: propTypes.node,
5083 active: propTypes.bool,
5084 disabled: propTypes.bool,
5085 divider: propTypes.bool,
5086 tag: tagPropType,
5087 header: propTypes.bool,
5088 onClick: propTypes.func,
5089 className: propTypes.string,
5090 cssModule: propTypes.object,
5091 toggle: propTypes.bool
5092 };
5093 var defaultProps$f = {
5094 tag: 'button',
5095 toggle: true
5096 };
5097
5098 var DropdownItem =
5099 /*#__PURE__*/
5100 function (_React$Component) {
5101 _inheritsLoose(DropdownItem, _React$Component);
5102
5103 function DropdownItem(props) {
5104 var _this;
5105
5106 _this = _React$Component.call(this, props) || this;
5107 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
5108 _this.getTabIndex = _this.getTabIndex.bind(_assertThisInitialized(_this));
5109 return _this;
5110 }
5111
5112 var _proto = DropdownItem.prototype;
5113
5114 _proto.onClick = function onClick(e) {
5115 if (this.props.disabled || this.props.header || this.props.divider) {
5116 e.preventDefault();
5117 return;
5118 }
5119
5120 if (this.props.onClick) {
5121 this.props.onClick(e);
5122 }
5123
5124 if (this.props.toggle) {
5125 this.context.toggle(e);
5126 }
5127 };
5128
5129 _proto.getTabIndex = function getTabIndex() {
5130 if (this.props.disabled || this.props.header || this.props.divider) {
5131 return '-1';
5132 }
5133
5134 return '0';
5135 };
5136
5137 _proto.render = function render() {
5138 var tabIndex = this.getTabIndex();
5139 var role = tabIndex > -1 ? 'menuitem' : undefined;
5140
5141 var _omit = omit(this.props, ['toggle']),
5142 className = _omit.className,
5143 cssModule = _omit.cssModule,
5144 divider = _omit.divider,
5145 Tag = _omit.tag,
5146 header = _omit.header,
5147 active = _omit.active,
5148 props = _objectWithoutPropertiesLoose(_omit, ["className", "cssModule", "divider", "tag", "header", "active"]);
5149
5150 var classes = mapToCssModules(classnames(className, {
5151 disabled: props.disabled,
5152 'dropdown-item': !divider && !header,
5153 active: active,
5154 'dropdown-header': header,
5155 'dropdown-divider': divider
5156 }), cssModule);
5157
5158 if (Tag === 'button') {
5159 if (header) {
5160 Tag = 'h6';
5161 } else if (divider) {
5162 Tag = 'div';
5163 } else if (props.href) {
5164 Tag = 'a';
5165 }
5166 }
5167
5168 return React__default.createElement(Tag, _extends({
5169 type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined
5170 }, props, {
5171 tabIndex: tabIndex,
5172 role: role,
5173 className: classes,
5174 onClick: this.onClick
5175 }));
5176 };
5177
5178 return DropdownItem;
5179 }(React__default.Component);
5180
5181 DropdownItem.propTypes = propTypes$h;
5182 DropdownItem.defaultProps = defaultProps$f;
5183 DropdownItem.contextType = DropdownContext;
5184
5185 var propTypes$i = {
5186 tag: tagPropType,
5187 children: propTypes.node.isRequired,
5188 right: propTypes.bool,
5189 flip: propTypes.bool,
5190 modifiers: propTypes.object,
5191 className: propTypes.string,
5192 cssModule: propTypes.object,
5193 persist: propTypes.bool,
5194 positionFixed: propTypes.bool
5195 };
5196 var defaultProps$g = {
5197 tag: 'div',
5198 flip: true
5199 };
5200 var noFlipModifier = {
5201 flip: {
5202 enabled: false
5203 }
5204 };
5205 var directionPositionMap = {
5206 up: 'top',
5207 left: 'left',
5208 right: 'right',
5209 down: 'bottom'
5210 };
5211
5212 var DropdownMenu =
5213 /*#__PURE__*/
5214 function (_React$Component) {
5215 _inheritsLoose(DropdownMenu, _React$Component);
5216
5217 function DropdownMenu() {
5218 return _React$Component.apply(this, arguments) || this;
5219 }
5220
5221 var _proto = DropdownMenu.prototype;
5222
5223 _proto.render = function render() {
5224 var _this = this;
5225
5226 var _this$props = this.props,
5227 className = _this$props.className,
5228 cssModule = _this$props.cssModule,
5229 right = _this$props.right,
5230 tag = _this$props.tag,
5231 flip = _this$props.flip,
5232 modifiers = _this$props.modifiers,
5233 persist = _this$props.persist,
5234 positionFixed = _this$props.positionFixed,
5235 attrs = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "right", "tag", "flip", "modifiers", "persist", "positionFixed"]);
5236
5237 var classes = mapToCssModules(classnames(className, 'dropdown-menu', {
5238 'dropdown-menu-right': right,
5239 show: this.context.isOpen
5240 }), cssModule);
5241 var Tag = tag;
5242
5243 if (persist || this.context.isOpen && !this.context.inNavbar) {
5244 var position1 = directionPositionMap[this.context.direction] || 'bottom';
5245 var position2 = right ? 'end' : 'start';
5246 var poperPlacement = position1 + "-" + position2;
5247 var poperModifiers = !flip ? _extends({}, modifiers, noFlipModifier) : modifiers;
5248 var popperPositionFixed = !!positionFixed;
5249 return React__default.createElement(Popper$1, {
5250 placement: poperPlacement,
5251 modifiers: poperModifiers,
5252 positionFixed: popperPositionFixed
5253 }, function (_ref) {
5254 var ref = _ref.ref,
5255 style = _ref.style,
5256 placement = _ref.placement;
5257 return React__default.createElement(Tag, _extends({
5258 tabIndex: "-1",
5259 role: "menu",
5260 ref: ref,
5261 style: style
5262 }, attrs, {
5263 "aria-hidden": !_this.context.isOpen,
5264 className: classes,
5265 "x-placement": placement
5266 }));
5267 });
5268 }
5269
5270 return React__default.createElement(Tag, _extends({
5271 tabIndex: "-1",
5272 role: "menu"
5273 }, attrs, {
5274 "aria-hidden": !this.context.isOpen,
5275 className: classes,
5276 "x-placement": attrs.placement
5277 }));
5278 };
5279
5280 return DropdownMenu;
5281 }(React__default.Component);
5282 DropdownMenu.propTypes = propTypes$i;
5283 DropdownMenu.defaultProps = defaultProps$g;
5284 DropdownMenu.contextType = DropdownContext;
5285
5286 var propTypes$j = {
5287 caret: propTypes.bool,
5288 color: propTypes.string,
5289 children: propTypes.node,
5290 className: propTypes.string,
5291 cssModule: propTypes.object,
5292 disabled: propTypes.bool,
5293 onClick: propTypes.func,
5294 'aria-haspopup': propTypes.bool,
5295 split: propTypes.bool,
5296 tag: tagPropType,
5297 nav: propTypes.bool
5298 };
5299 var defaultProps$h = {
5300 'aria-haspopup': true,
5301 color: 'secondary'
5302 };
5303
5304 var DropdownToggle =
5305 /*#__PURE__*/
5306 function (_React$Component) {
5307 _inheritsLoose(DropdownToggle, _React$Component);
5308
5309 function DropdownToggle(props) {
5310 var _this;
5311
5312 _this = _React$Component.call(this, props) || this;
5313 _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
5314 return _this;
5315 }
5316
5317 var _proto = DropdownToggle.prototype;
5318
5319 _proto.onClick = function onClick(e) {
5320 if (this.props.disabled) {
5321 e.preventDefault();
5322 return;
5323 }
5324
5325 if (this.props.nav && !this.props.tag) {
5326 e.preventDefault();
5327 }
5328
5329 if (this.props.onClick) {
5330 this.props.onClick(e);
5331 }
5332
5333 this.context.toggle(e);
5334 };
5335
5336 _proto.render = function render() {
5337 var _this2 = this;
5338
5339 var _this$props = this.props,
5340 className = _this$props.className,
5341 color = _this$props.color,
5342 cssModule = _this$props.cssModule,
5343 caret = _this$props.caret,
5344 split = _this$props.split,
5345 nav = _this$props.nav,
5346 tag = _this$props.tag,
5347 props = _objectWithoutPropertiesLoose(_this$props, ["className", "color", "cssModule", "caret", "split", "nav", "tag"]);
5348
5349 var ariaLabel = props['aria-label'] || 'Toggle Dropdown';
5350 var classes = mapToCssModules(classnames(className, {
5351 'dropdown-toggle': caret || split,
5352 'dropdown-toggle-split': split,
5353 'nav-link': nav
5354 }), cssModule);
5355 var children = props.children || React__default.createElement("span", {
5356 className: "sr-only"
5357 }, ariaLabel);
5358 var Tag;
5359
5360 if (nav && !tag) {
5361 Tag = 'a';
5362 props.href = '#';
5363 } else if (!tag) {
5364 Tag = Button;
5365 props.color = color;
5366 props.cssModule = cssModule;
5367 } else {
5368 Tag = tag;
5369 }
5370
5371 if (this.context.inNavbar) {
5372 return React__default.createElement(Tag, _extends({}, props, {
5373 className: classes,
5374 onClick: this.onClick,
5375 "aria-expanded": this.context.isOpen,
5376 children: children
5377 }));
5378 }
5379
5380 return React__default.createElement(Reference, null, function (_ref) {
5381 var _ref2;
5382
5383 var ref = _ref.ref;
5384 return React__default.createElement(Tag, _extends({}, props, (_ref2 = {}, _ref2[typeof Tag === 'string' ? 'ref' : 'innerRef'] = ref, _ref2), {
5385 className: classes,
5386 onClick: _this2.onClick,
5387 "aria-expanded": _this2.context.isOpen,
5388 children: children
5389 }));
5390 });
5391 };
5392
5393 return DropdownToggle;
5394 }(React__default.Component);
5395
5396 DropdownToggle.propTypes = propTypes$j;
5397 DropdownToggle.defaultProps = defaultProps$h;
5398 DropdownToggle.contextType = DropdownContext;
5399
5400 var interopRequireDefault = createCommonjsModule(function (module) {
5401 function _interopRequireDefault(obj) {
5402 return obj && obj.__esModule ? obj : {
5403 "default": obj
5404 };
5405 }
5406
5407 module.exports = _interopRequireDefault;
5408 });
5409 unwrapExports(interopRequireDefault);
5410
5411 var hasClass_1 = createCommonjsModule(function (module, exports) {
5412
5413 exports.__esModule = true;
5414 exports.default = hasClass;
5415
5416 function hasClass(element, className) {
5417 if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
5418 }
5419
5420 module.exports = exports["default"];
5421 });
5422 unwrapExports(hasClass_1);
5423
5424 var addClass_1 = createCommonjsModule(function (module, exports) {
5425
5426 exports.__esModule = true;
5427 exports.default = addClass;
5428
5429 var _hasClass = interopRequireDefault(hasClass_1);
5430
5431 function addClass(element, className) {
5432 if (element.classList) element.classList.add(className);else if (!(0, _hasClass.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);
5433 }
5434
5435 module.exports = exports["default"];
5436 });
5437 unwrapExports(addClass_1);
5438
5439 function replaceClassName(origClass, classToRemove) {
5440 return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
5441 }
5442
5443 var removeClass = function removeClass(element, className) {
5444 if (element.classList) element.classList.remove(className);else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className);else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
5445 };
5446
5447 /**
5448 * Copyright (c) 2013-present, Facebook, Inc.
5449 *
5450 * This source code is licensed under the MIT license found in the
5451 * LICENSE file in the root directory of this source tree.
5452 */
5453 function componentWillMount() {
5454 // Call this.constructor.gDSFP to support sub-classes.
5455 var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
5456
5457 if (state !== null && state !== undefined) {
5458 this.setState(state);
5459 }
5460 }
5461
5462 function componentWillReceiveProps(nextProps) {
5463 // Call this.constructor.gDSFP to support sub-classes.
5464 // Use the setState() updater to ensure state isn't stale in certain edge cases.
5465 function updater(prevState) {
5466 var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
5467 return state !== null && state !== undefined ? state : null;
5468 } // Binding "this" is important for shallow renderer support.
5469
5470
5471 this.setState(updater.bind(this));
5472 }
5473
5474 function componentWillUpdate(nextProps, nextState) {
5475 try {
5476 var prevProps = this.props;
5477 var prevState = this.state;
5478 this.props = nextProps;
5479 this.state = nextState;
5480 this.__reactInternalSnapshotFlag = true;
5481 this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);
5482 } finally {
5483 this.props = prevProps;
5484 this.state = prevState;
5485 }
5486 } // React may warn about cWM/cWRP/cWU methods being deprecated.
5487 // Add a flag to suppress these warnings for this special case.
5488
5489
5490 componentWillMount.__suppressDeprecationWarning = true;
5491 componentWillReceiveProps.__suppressDeprecationWarning = true;
5492 componentWillUpdate.__suppressDeprecationWarning = true;
5493
5494 function polyfill(Component) {
5495 var prototype = Component.prototype;
5496
5497 if (!prototype || !prototype.isReactComponent) {
5498 throw new Error('Can only polyfill class components');
5499 }
5500
5501 if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {
5502 return Component;
5503 } // If new component APIs are defined, "unsafe" lifecycles won't be called.
5504 // Error if any of these lifecycles are present,
5505 // Because they would work differently between older and newer (16.3+) versions of React.
5506
5507
5508 var foundWillMountName = null;
5509 var foundWillReceivePropsName = null;
5510 var foundWillUpdateName = null;
5511
5512 if (typeof prototype.componentWillMount === 'function') {
5513 foundWillMountName = 'componentWillMount';
5514 } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
5515 foundWillMountName = 'UNSAFE_componentWillMount';
5516 }
5517
5518 if (typeof prototype.componentWillReceiveProps === 'function') {
5519 foundWillReceivePropsName = 'componentWillReceiveProps';
5520 } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
5521 foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
5522 }
5523
5524 if (typeof prototype.componentWillUpdate === 'function') {
5525 foundWillUpdateName = 'componentWillUpdate';
5526 } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
5527 foundWillUpdateName = 'UNSAFE_componentWillUpdate';
5528 }
5529
5530 if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
5531 var componentName = Component.displayName || Component.name;
5532 var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
5533 throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') + '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks');
5534 } // React <= 16.2 does not support static getDerivedStateFromProps.
5535 // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
5536 // Newer versions of React will ignore these lifecycles if gDSFP exists.
5537
5538
5539 if (typeof Component.getDerivedStateFromProps === 'function') {
5540 prototype.componentWillMount = componentWillMount;
5541 prototype.componentWillReceiveProps = componentWillReceiveProps;
5542 } // React <= 16.2 does not support getSnapshotBeforeUpdate.
5543 // As a workaround, use cWU to invoke the new lifecycle.
5544 // Newer versions of React will ignore that lifecycle if gSBU exists.
5545
5546
5547 if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
5548 if (typeof prototype.componentDidUpdate !== 'function') {
5549 throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');
5550 }
5551
5552 prototype.componentWillUpdate = componentWillUpdate;
5553 var componentDidUpdate = prototype.componentDidUpdate;
5554
5555 prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {
5556 // 16.3+ will not execute our will-update method;
5557 // It will pass a snapshot value to did-update though.
5558 // Older versions will require our polyfilled will-update value.
5559 // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
5560 // Because for <= 15.x versions this might be a "prevContext" object.
5561 // We also can't just check "__reactInternalSnapshot",
5562 // Because get-snapshot might return a falsy value.
5563 // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
5564 var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;
5565 componentDidUpdate.call(this, prevProps, prevState, snapshot);
5566 };
5567 }
5568
5569 return Component;
5570 }
5571
5572 var reactLifecyclesCompat_es = /*#__PURE__*/Object.freeze({
5573 polyfill: polyfill
5574 });
5575
5576 var PropTypes = createCommonjsModule(function (module, exports) {
5577
5578 exports.__esModule = true;
5579 exports.classNamesShape = exports.timeoutsShape = void 0;
5580
5581 var _propTypes = _interopRequireDefault(propTypes);
5582
5583 function _interopRequireDefault(obj) {
5584 return obj && obj.__esModule ? obj : {
5585 default: obj
5586 };
5587 }
5588
5589 var timeoutsShape = null;
5590 exports.timeoutsShape = timeoutsShape;
5591 var classNamesShape = null;
5592 exports.classNamesShape = classNamesShape;
5593 });
5594 unwrapExports(PropTypes);
5595 var PropTypes_1 = PropTypes.classNamesShape;
5596 var PropTypes_2 = PropTypes.timeoutsShape;
5597
5598 var Transition_1 = createCommonjsModule(function (module, exports) {
5599
5600 exports.__esModule = true;
5601 exports.default = exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = void 0;
5602
5603 var PropTypes = _interopRequireWildcard(propTypes);
5604
5605 var _react = _interopRequireDefault(React__default);
5606
5607 var _reactDom = _interopRequireDefault(ReactDOM);
5608
5609 function _interopRequireDefault(obj) {
5610 return obj && obj.__esModule ? obj : {
5611 default: obj
5612 };
5613 }
5614
5615 function _interopRequireWildcard(obj) {
5616 if (obj && obj.__esModule) {
5617 return obj;
5618 } else {
5619 var newObj = {};
5620
5621 if (obj != null) {
5622 for (var key in obj) {
5623 if (Object.prototype.hasOwnProperty.call(obj, key)) {
5624 var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
5625
5626 if (desc.get || desc.set) {
5627 Object.defineProperty(newObj, key, desc);
5628 } else {
5629 newObj[key] = obj[key];
5630 }
5631 }
5632 }
5633 }
5634
5635 newObj.default = obj;
5636 return newObj;
5637 }
5638 }
5639
5640 function _objectWithoutPropertiesLoose(source, excluded) {
5641 if (source == null) return {};
5642 var target = {};
5643 var sourceKeys = Object.keys(source);
5644 var key, i;
5645
5646 for (i = 0; i < sourceKeys.length; i++) {
5647 key = sourceKeys[i];
5648 if (excluded.indexOf(key) >= 0) continue;
5649 target[key] = source[key];
5650 }
5651
5652 return target;
5653 }
5654
5655 function _inheritsLoose(subClass, superClass) {
5656 subClass.prototype = Object.create(superClass.prototype);
5657 subClass.prototype.constructor = subClass;
5658 subClass.__proto__ = superClass;
5659 }
5660
5661 var UNMOUNTED = 'unmounted';
5662 exports.UNMOUNTED = UNMOUNTED;
5663 var EXITED = 'exited';
5664 exports.EXITED = EXITED;
5665 var ENTERING = 'entering';
5666 exports.ENTERING = ENTERING;
5667 var ENTERED = 'entered';
5668 exports.ENTERED = ENTERED;
5669 var EXITING = 'exiting';
5670 /**
5671 * The Transition component lets you describe a transition from one component
5672 * state to another _over time_ with a simple declarative API. Most commonly
5673 * it's used to animate the mounting and unmounting of a component, but can also
5674 * be used to describe in-place transition states as well.
5675 *
5676 * ---
5677 *
5678 * **Note**: `Transition` is a platform-agnostic base component. If you're using
5679 * transitions in CSS, you'll probably want to use
5680 * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
5681 * instead. It inherits all the features of `Transition`, but contains
5682 * additional features necessary to play nice with CSS transitions (hence the
5683 * name of the component).
5684 *
5685 * ---
5686 *
5687 * By default the `Transition` component does not alter the behavior of the
5688 * component it renders, it only tracks "enter" and "exit" states for the
5689 * components. It's up to you to give meaning and effect to those states. For
5690 * example we can add styles to a component when it enters or exits:
5691 *
5692 * ```jsx
5693 * import { Transition } from 'react-transition-group';
5694 *
5695 * const duration = 300;
5696 *
5697 * const defaultStyle = {
5698 * transition: `opacity ${duration}ms ease-in-out`,
5699 * opacity: 0,
5700 * }
5701 *
5702 * const transitionStyles = {
5703 * entering: { opacity: 0 },
5704 * entered: { opacity: 1 },
5705 * };
5706 *
5707 * const Fade = ({ in: inProp }) => (
5708 * <Transition in={inProp} timeout={duration}>
5709 * {state => (
5710 * <div style={{
5711 * ...defaultStyle,
5712 * ...transitionStyles[state]
5713 * }}>
5714 * I'm a fade Transition!
5715 * </div>
5716 * )}
5717 * </Transition>
5718 * );
5719 * ```
5720 *
5721 * There are 4 main states a Transition can be in:
5722 * - `'entering'`
5723 * - `'entered'`
5724 * - `'exiting'`
5725 * - `'exited'`
5726 *
5727 * Transition state is toggled via the `in` prop. When `true` the component
5728 * begins the "Enter" stage. During this stage, the component will shift from
5729 * its current transition state, to `'entering'` for the duration of the
5730 * transition and then to the `'entered'` stage once it's complete. Let's take
5731 * the following example (we'll use the
5732 * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
5733 *
5734 * ```jsx
5735 * function App() {
5736 * const [inProp, setInProp] = useState(false);
5737 * return (
5738 * <div>
5739 * <Transition in={inProp} timeout={500}>
5740 * {state => (
5741 * // ...
5742 * )}
5743 * </Transition>
5744 * <button onClick={() => setInProp(true)}>
5745 * Click to Enter
5746 * </button>
5747 * </div>
5748 * );
5749 * }
5750 * ```
5751 *
5752 * When the button is clicked the component will shift to the `'entering'` state
5753 * and stay there for 500ms (the value of `timeout`) before it finally switches
5754 * to `'entered'`.
5755 *
5756 * When `in` is `false` the same thing happens except the state moves from
5757 * `'exiting'` to `'exited'`.
5758 */
5759
5760 exports.EXITING = EXITING;
5761
5762 var Transition =
5763 /*#__PURE__*/
5764 function (_React$Component) {
5765 _inheritsLoose(Transition, _React$Component);
5766
5767 function Transition(props, context) {
5768 var _this;
5769
5770 _this = _React$Component.call(this, props, context) || this;
5771 var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears
5772
5773 var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
5774 var initialStatus;
5775 _this.appearStatus = null;
5776
5777 if (props.in) {
5778 if (appear) {
5779 initialStatus = EXITED;
5780 _this.appearStatus = ENTERING;
5781 } else {
5782 initialStatus = ENTERED;
5783 }
5784 } else {
5785 if (props.unmountOnExit || props.mountOnEnter) {
5786 initialStatus = UNMOUNTED;
5787 } else {
5788 initialStatus = EXITED;
5789 }
5790 }
5791
5792 _this.state = {
5793 status: initialStatus
5794 };
5795 _this.nextCallback = null;
5796 return _this;
5797 }
5798
5799 var _proto = Transition.prototype;
5800
5801 _proto.getChildContext = function getChildContext() {
5802 return {
5803 transitionGroup: null // allows for nested Transitions
5804
5805 };
5806 };
5807
5808 Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
5809 var nextIn = _ref.in;
5810
5811 if (nextIn && prevState.status === UNMOUNTED) {
5812 return {
5813 status: EXITED
5814 };
5815 }
5816
5817 return null;
5818 }; // getSnapshotBeforeUpdate(prevProps) {
5819 // let nextStatus = null
5820 // if (prevProps !== this.props) {
5821 // const { status } = this.state
5822 // if (this.props.in) {
5823 // if (status !== ENTERING && status !== ENTERED) {
5824 // nextStatus = ENTERING
5825 // }
5826 // } else {
5827 // if (status === ENTERING || status === ENTERED) {
5828 // nextStatus = EXITING
5829 // }
5830 // }
5831 // }
5832 // return { nextStatus }
5833 // }
5834
5835
5836 _proto.componentDidMount = function componentDidMount() {
5837 this.updateStatus(true, this.appearStatus);
5838 };
5839
5840 _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
5841 var nextStatus = null;
5842
5843 if (prevProps !== this.props) {
5844 var status = this.state.status;
5845
5846 if (this.props.in) {
5847 if (status !== ENTERING && status !== ENTERED) {
5848 nextStatus = ENTERING;
5849 }
5850 } else {
5851 if (status === ENTERING || status === ENTERED) {
5852 nextStatus = EXITING;
5853 }
5854 }
5855 }
5856
5857 this.updateStatus(false, nextStatus);
5858 };
5859
5860 _proto.componentWillUnmount = function componentWillUnmount() {
5861 this.cancelNextCallback();
5862 };
5863
5864 _proto.getTimeouts = function getTimeouts() {
5865 var timeout = this.props.timeout;
5866 var exit, enter, appear;
5867 exit = enter = appear = timeout;
5868
5869 if (timeout != null && typeof timeout !== 'number') {
5870 exit = timeout.exit;
5871 enter = timeout.enter; // TODO: remove fallback for next major
5872
5873 appear = timeout.appear !== undefined ? timeout.appear : enter;
5874 }
5875
5876 return {
5877 exit: exit,
5878 enter: enter,
5879 appear: appear
5880 };
5881 };
5882
5883 _proto.updateStatus = function updateStatus(mounting, nextStatus) {
5884 if (mounting === void 0) {
5885 mounting = false;
5886 }
5887
5888 if (nextStatus !== null) {
5889 // nextStatus will always be ENTERING or EXITING.
5890 this.cancelNextCallback();
5891
5892 var node = _reactDom.default.findDOMNode(this);
5893
5894 if (nextStatus === ENTERING) {
5895 this.performEnter(node, mounting);
5896 } else {
5897 this.performExit(node);
5898 }
5899 } else if (this.props.unmountOnExit && this.state.status === EXITED) {
5900 this.setState({
5901 status: UNMOUNTED
5902 });
5903 }
5904 };
5905
5906 _proto.performEnter = function performEnter(node, mounting) {
5907 var _this2 = this;
5908
5909 var enter = this.props.enter;
5910 var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting;
5911 var timeouts = this.getTimeouts();
5912 var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
5913 // if we are mounting and running this it means appear _must_ be set
5914
5915 if (!mounting && !enter) {
5916 this.safeSetState({
5917 status: ENTERED
5918 }, function () {
5919 _this2.props.onEntered(node);
5920 });
5921 return;
5922 }
5923
5924 this.props.onEnter(node, appearing);
5925 this.safeSetState({
5926 status: ENTERING
5927 }, function () {
5928 _this2.props.onEntering(node, appearing);
5929
5930 _this2.onTransitionEnd(node, enterTimeout, function () {
5931 _this2.safeSetState({
5932 status: ENTERED
5933 }, function () {
5934 _this2.props.onEntered(node, appearing);
5935 });
5936 });
5937 });
5938 };
5939
5940 _proto.performExit = function performExit(node) {
5941 var _this3 = this;
5942
5943 var exit = this.props.exit;
5944 var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
5945
5946 if (!exit) {
5947 this.safeSetState({
5948 status: EXITED
5949 }, function () {
5950 _this3.props.onExited(node);
5951 });
5952 return;
5953 }
5954
5955 this.props.onExit(node);
5956 this.safeSetState({
5957 status: EXITING
5958 }, function () {
5959 _this3.props.onExiting(node);
5960
5961 _this3.onTransitionEnd(node, timeouts.exit, function () {
5962 _this3.safeSetState({
5963 status: EXITED
5964 }, function () {
5965 _this3.props.onExited(node);
5966 });
5967 });
5968 });
5969 };
5970
5971 _proto.cancelNextCallback = function cancelNextCallback() {
5972 if (this.nextCallback !== null) {
5973 this.nextCallback.cancel();
5974 this.nextCallback = null;
5975 }
5976 };
5977
5978 _proto.safeSetState = function safeSetState(nextState, callback) {
5979 // This shouldn't be necessary, but there are weird race conditions with
5980 // setState callbacks and unmounting in testing, so always make sure that
5981 // we can cancel any pending setState callbacks after we unmount.
5982 callback = this.setNextCallback(callback);
5983 this.setState(nextState, callback);
5984 };
5985
5986 _proto.setNextCallback = function setNextCallback(callback) {
5987 var _this4 = this;
5988
5989 var active = true;
5990
5991 this.nextCallback = function (event) {
5992 if (active) {
5993 active = false;
5994 _this4.nextCallback = null;
5995 callback(event);
5996 }
5997 };
5998
5999 this.nextCallback.cancel = function () {
6000 active = false;
6001 };
6002
6003 return this.nextCallback;
6004 };
6005
6006 _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
6007 this.setNextCallback(handler);
6008 var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
6009
6010 if (!node || doesNotHaveTimeoutOrListener) {
6011 setTimeout(this.nextCallback, 0);
6012 return;
6013 }
6014
6015 if (this.props.addEndListener) {
6016 this.props.addEndListener(node, this.nextCallback);
6017 }
6018
6019 if (timeout != null) {
6020 setTimeout(this.nextCallback, timeout);
6021 }
6022 };
6023
6024 _proto.render = function render() {
6025 var status = this.state.status;
6026
6027 if (status === UNMOUNTED) {
6028 return null;
6029 }
6030
6031 var _this$props = this.props,
6032 children = _this$props.children,
6033 childProps = _objectWithoutPropertiesLoose(_this$props, ["children"]); // filter props for Transtition
6034
6035
6036 delete childProps.in;
6037 delete childProps.mountOnEnter;
6038 delete childProps.unmountOnExit;
6039 delete childProps.appear;
6040 delete childProps.enter;
6041 delete childProps.exit;
6042 delete childProps.timeout;
6043 delete childProps.addEndListener;
6044 delete childProps.onEnter;
6045 delete childProps.onEntering;
6046 delete childProps.onEntered;
6047 delete childProps.onExit;
6048 delete childProps.onExiting;
6049 delete childProps.onExited;
6050
6051 if (typeof children === 'function') {
6052 return children(status, childProps);
6053 }
6054
6055 var child = _react.default.Children.only(children);
6056
6057 return _react.default.cloneElement(child, childProps);
6058 };
6059
6060 return Transition;
6061 }(_react.default.Component);
6062
6063 Transition.contextTypes = {
6064 transitionGroup: PropTypes.object
6065 };
6066 Transition.childContextTypes = {
6067 transitionGroup: function transitionGroup() {}
6068 };
6069 Transition.propTypes = {};
6070
6071 function noop() {}
6072
6073 Transition.defaultProps = {
6074 in: false,
6075 mountOnEnter: false,
6076 unmountOnExit: false,
6077 appear: false,
6078 enter: true,
6079 exit: true,
6080 onEnter: noop,
6081 onEntering: noop,
6082 onEntered: noop,
6083 onExit: noop,
6084 onExiting: noop,
6085 onExited: noop
6086 };
6087 Transition.UNMOUNTED = 0;
6088 Transition.EXITED = 1;
6089 Transition.ENTERING = 2;
6090 Transition.ENTERED = 3;
6091 Transition.EXITING = 4;
6092
6093 var _default = (0, reactLifecyclesCompat_es.polyfill)(Transition);
6094
6095 exports.default = _default;
6096 });
6097 unwrapExports(Transition_1);
6098 var Transition_2 = Transition_1.EXITING;
6099 var Transition_3 = Transition_1.ENTERED;
6100 var Transition_4 = Transition_1.ENTERING;
6101 var Transition_5 = Transition_1.EXITED;
6102 var Transition_6 = Transition_1.UNMOUNTED;
6103
6104 var CSSTransition_1 = createCommonjsModule(function (module, exports) {
6105
6106 exports.__esModule = true;
6107 exports.default = void 0;
6108
6109 var PropTypes = _interopRequireWildcard(propTypes);
6110
6111 var _addClass = _interopRequireDefault(addClass_1);
6112
6113 var _removeClass = _interopRequireDefault(removeClass);
6114
6115 var _react = _interopRequireDefault(React__default);
6116
6117 var _Transition = _interopRequireDefault(Transition_1);
6118
6119 function _interopRequireDefault(obj) {
6120 return obj && obj.__esModule ? obj : {
6121 default: obj
6122 };
6123 }
6124
6125 function _interopRequireWildcard(obj) {
6126 if (obj && obj.__esModule) {
6127 return obj;
6128 } else {
6129 var newObj = {};
6130
6131 if (obj != null) {
6132 for (var key in obj) {
6133 if (Object.prototype.hasOwnProperty.call(obj, key)) {
6134 var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
6135
6136 if (desc.get || desc.set) {
6137 Object.defineProperty(newObj, key, desc);
6138 } else {
6139 newObj[key] = obj[key];
6140 }
6141 }
6142 }
6143 }
6144
6145 newObj.default = obj;
6146 return newObj;
6147 }
6148 }
6149
6150 function _extends() {
6151 _extends = Object.assign || function (target) {
6152 for (var i = 1; i < arguments.length; i++) {
6153 var source = arguments[i];
6154
6155 for (var key in source) {
6156 if (Object.prototype.hasOwnProperty.call(source, key)) {
6157 target[key] = source[key];
6158 }
6159 }
6160 }
6161
6162 return target;
6163 };
6164
6165 return _extends.apply(this, arguments);
6166 }
6167
6168 function _inheritsLoose(subClass, superClass) {
6169 subClass.prototype = Object.create(superClass.prototype);
6170 subClass.prototype.constructor = subClass;
6171 subClass.__proto__ = superClass;
6172 }
6173
6174 var addClass = function addClass(node, classes) {
6175 return node && classes && classes.split(' ').forEach(function (c) {
6176 return (0, _addClass.default)(node, c);
6177 });
6178 };
6179
6180 var removeClass$1 = function removeClass(node, classes) {
6181 return node && classes && classes.split(' ').forEach(function (c) {
6182 return (0, _removeClass.default)(node, c);
6183 });
6184 };
6185 /**
6186 * A transition component inspired by the excellent
6187 * [ng-animate](http://www.nganimate.org/) library, you should use it if you're
6188 * using CSS transitions or animations. It's built upon the
6189 * [`Transition`](https://reactcommunity.org/react-transition-group/transition)
6190 * component, so it inherits all of its props.
6191 *
6192 * `CSSTransition` applies a pair of class names during the `appear`, `enter`,
6193 * and `exit` states of the transition. The first class is applied and then a
6194 * second `*-active` class in order to activate the CSSS transition. After the
6195 * transition, matching `*-done` class names are applied to persist the
6196 * transition state.
6197 *
6198 * ```jsx
6199 * function App() {
6200 * const [inProp, setInProp] = useState(false);
6201 * return (
6202 * <div>
6203 * <CSSTransition in={inProp} timeout={200} classNames="my-node">
6204 * <div>
6205 * {"I'll receive my-node-* classes"}
6206 * </div>
6207 * </CSSTransition>
6208 * <button type="button" onClick={() => setInProp(true)}>
6209 * Click to Enter
6210 * </button>
6211 * </div>
6212 * );
6213 * }
6214 * ```
6215 *
6216 * When the `in` prop is set to `true`, the child component will first receive
6217 * the class `example-enter`, then the `example-enter-active` will be added in
6218 * the next tick. `CSSTransition` [forces a
6219 * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)
6220 * between before adding the `example-enter-active`. This is an important trick
6221 * because it allows us to transition between `example-enter` and
6222 * `example-enter-active` even though they were added immediately one after
6223 * another. Most notably, this is what makes it possible for us to animate
6224 * _appearance_.
6225 *
6226 * ```css
6227 * .my-node-enter {
6228 * opacity: 0;
6229 * }
6230 * .my-node-enter-active {
6231 * opacity: 1;
6232 * transition: opacity 200ms;
6233 * }
6234 * .my-node-exit {
6235 * opacity: 1;
6236 * }
6237 * .my-node-exit-active {
6238 * opacity: 0;
6239 * transition: opacity: 200ms;
6240 * }
6241 * ```
6242 *
6243 * `*-active` classes represent which styles you want to animate **to**.
6244 */
6245
6246
6247 var CSSTransition =
6248 /*#__PURE__*/
6249 function (_React$Component) {
6250 _inheritsLoose(CSSTransition, _React$Component);
6251
6252 function CSSTransition() {
6253 var _this;
6254
6255 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6256 args[_key] = arguments[_key];
6257 }
6258
6259 _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
6260
6261 _this.onEnter = function (node, appearing) {
6262 var _this$getClassNames = _this.getClassNames(appearing ? 'appear' : 'enter'),
6263 className = _this$getClassNames.className;
6264
6265 _this.removeClasses(node, 'exit');
6266
6267 addClass(node, className);
6268
6269 if (_this.props.onEnter) {
6270 _this.props.onEnter(node, appearing);
6271 }
6272 };
6273
6274 _this.onEntering = function (node, appearing) {
6275 var _this$getClassNames2 = _this.getClassNames(appearing ? 'appear' : 'enter'),
6276 activeClassName = _this$getClassNames2.activeClassName;
6277
6278 _this.reflowAndAddClass(node, activeClassName);
6279
6280 if (_this.props.onEntering) {
6281 _this.props.onEntering(node, appearing);
6282 }
6283 };
6284
6285 _this.onEntered = function (node, appearing) {
6286 var _this$getClassNames3 = _this.getClassNames('enter'),
6287 doneClassName = _this$getClassNames3.doneClassName;
6288
6289 _this.removeClasses(node, appearing ? 'appear' : 'enter');
6290
6291 addClass(node, doneClassName);
6292
6293 if (_this.props.onEntered) {
6294 _this.props.onEntered(node, appearing);
6295 }
6296 };
6297
6298 _this.onExit = function (node) {
6299 var _this$getClassNames4 = _this.getClassNames('exit'),
6300 className = _this$getClassNames4.className;
6301
6302 _this.removeClasses(node, 'appear');
6303
6304 _this.removeClasses(node, 'enter');
6305
6306 addClass(node, className);
6307
6308 if (_this.props.onExit) {
6309 _this.props.onExit(node);
6310 }
6311 };
6312
6313 _this.onExiting = function (node) {
6314 var _this$getClassNames5 = _this.getClassNames('exit'),
6315 activeClassName = _this$getClassNames5.activeClassName;
6316
6317 _this.reflowAndAddClass(node, activeClassName);
6318
6319 if (_this.props.onExiting) {
6320 _this.props.onExiting(node);
6321 }
6322 };
6323
6324 _this.onExited = function (node) {
6325 var _this$getClassNames6 = _this.getClassNames('exit'),
6326 doneClassName = _this$getClassNames6.doneClassName;
6327
6328 _this.removeClasses(node, 'exit');
6329
6330 addClass(node, doneClassName);
6331
6332 if (_this.props.onExited) {
6333 _this.props.onExited(node);
6334 }
6335 };
6336
6337 _this.getClassNames = function (type) {
6338 var classNames = _this.props.classNames;
6339 var isStringClassNames = typeof classNames === 'string';
6340 var prefix = isStringClassNames && classNames ? classNames + '-' : '';
6341 var className = isStringClassNames ? prefix + type : classNames[type];
6342 var activeClassName = isStringClassNames ? className + '-active' : classNames[type + 'Active'];
6343 var doneClassName = isStringClassNames ? className + '-done' : classNames[type + 'Done'];
6344 return {
6345 className: className,
6346 activeClassName: activeClassName,
6347 doneClassName: doneClassName
6348 };
6349 };
6350
6351 return _this;
6352 }
6353
6354 var _proto = CSSTransition.prototype;
6355
6356 _proto.removeClasses = function removeClasses(node, type) {
6357 var _this$getClassNames7 = this.getClassNames(type),
6358 className = _this$getClassNames7.className,
6359 activeClassName = _this$getClassNames7.activeClassName,
6360 doneClassName = _this$getClassNames7.doneClassName;
6361
6362 className && removeClass$1(node, className);
6363 activeClassName && removeClass$1(node, activeClassName);
6364 doneClassName && removeClass$1(node, doneClassName);
6365 };
6366
6367 _proto.reflowAndAddClass = function reflowAndAddClass(node, className) {
6368 // This is for to force a repaint,
6369 // which is necessary in order to transition styles when adding a class name.
6370 if (className) {
6371 /* eslint-disable no-unused-expressions */
6372 node && node.scrollTop;
6373 /* eslint-enable no-unused-expressions */
6374
6375 addClass(node, className);
6376 }
6377 };
6378
6379 _proto.render = function render() {
6380 var props = _extends({}, this.props);
6381
6382 delete props.classNames;
6383 return _react.default.createElement(_Transition.default, _extends({}, props, {
6384 onEnter: this.onEnter,
6385 onEntered: this.onEntered,
6386 onEntering: this.onEntering,
6387 onExit: this.onExit,
6388 onExiting: this.onExiting,
6389 onExited: this.onExited
6390 }));
6391 };
6392
6393 return CSSTransition;
6394 }(_react.default.Component);
6395
6396 CSSTransition.defaultProps = {
6397 classNames: ''
6398 };
6399 CSSTransition.propTypes = {};
6400 var _default = CSSTransition;
6401 exports.default = _default;
6402 module.exports = exports["default"];
6403 });
6404 unwrapExports(CSSTransition_1);
6405
6406 var ChildMapping = createCommonjsModule(function (module, exports) {
6407
6408 exports.__esModule = true;
6409 exports.getChildMapping = getChildMapping;
6410 exports.mergeChildMappings = mergeChildMappings;
6411 exports.getInitialChildMapping = getInitialChildMapping;
6412 exports.getNextChildMapping = getNextChildMapping;
6413 /**
6414 * Given `this.props.children`, return an object mapping key to child.
6415 *
6416 * @param {*} children `this.props.children`
6417 * @return {object} Mapping of key to child
6418 */
6419
6420 function getChildMapping(children, mapFn) {
6421 var mapper = function mapper(child) {
6422 return mapFn && (0, React__default.isValidElement)(child) ? mapFn(child) : child;
6423 };
6424
6425 var result = Object.create(null);
6426 if (children) React__default.Children.map(children, function (c) {
6427 return c;
6428 }).forEach(function (child) {
6429 // run the map function here instead so that the key is the computed one
6430 result[child.key] = mapper(child);
6431 });
6432 return result;
6433 }
6434 /**
6435 * When you're adding or removing children some may be added or removed in the
6436 * same render pass. We want to show *both* since we want to simultaneously
6437 * animate elements in and out. This function takes a previous set of keys
6438 * and a new set of keys and merges them with its best guess of the correct
6439 * ordering. In the future we may expose some of the utilities in
6440 * ReactMultiChild to make this easy, but for now React itself does not
6441 * directly have this concept of the union of prevChildren and nextChildren
6442 * so we implement it here.
6443 *
6444 * @param {object} prev prev children as returned from
6445 * `ReactTransitionChildMapping.getChildMapping()`.
6446 * @param {object} next next children as returned from
6447 * `ReactTransitionChildMapping.getChildMapping()`.
6448 * @return {object} a key set that contains all keys in `prev` and all keys
6449 * in `next` in a reasonable order.
6450 */
6451
6452
6453 function mergeChildMappings(prev, next) {
6454 prev = prev || {};
6455 next = next || {};
6456
6457 function getValueForKey(key) {
6458 return key in next ? next[key] : prev[key];
6459 } // For each key of `next`, the list of keys to insert before that key in
6460 // the combined list
6461
6462
6463 var nextKeysPending = Object.create(null);
6464 var pendingKeys = [];
6465
6466 for (var prevKey in prev) {
6467 if (prevKey in next) {
6468 if (pendingKeys.length) {
6469 nextKeysPending[prevKey] = pendingKeys;
6470 pendingKeys = [];
6471 }
6472 } else {
6473 pendingKeys.push(prevKey);
6474 }
6475 }
6476
6477 var i;
6478 var childMapping = {};
6479
6480 for (var nextKey in next) {
6481 if (nextKeysPending[nextKey]) {
6482 for (i = 0; i < nextKeysPending[nextKey].length; i++) {
6483 var pendingNextKey = nextKeysPending[nextKey][i];
6484 childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
6485 }
6486 }
6487
6488 childMapping[nextKey] = getValueForKey(nextKey);
6489 } // Finally, add the keys which didn't appear before any key in `next`
6490
6491
6492 for (i = 0; i < pendingKeys.length; i++) {
6493 childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
6494 }
6495
6496 return childMapping;
6497 }
6498
6499 function getProp(child, prop, props) {
6500 return props[prop] != null ? props[prop] : child.props[prop];
6501 }
6502
6503 function getInitialChildMapping(props, onExited) {
6504 return getChildMapping(props.children, function (child) {
6505 return (0, React__default.cloneElement)(child, {
6506 onExited: onExited.bind(null, child),
6507 in: true,
6508 appear: getProp(child, 'appear', props),
6509 enter: getProp(child, 'enter', props),
6510 exit: getProp(child, 'exit', props)
6511 });
6512 });
6513 }
6514
6515 function getNextChildMapping(nextProps, prevChildMapping, onExited) {
6516 var nextChildMapping = getChildMapping(nextProps.children);
6517 var children = mergeChildMappings(prevChildMapping, nextChildMapping);
6518 Object.keys(children).forEach(function (key) {
6519 var child = children[key];
6520 if (!(0, React__default.isValidElement)(child)) return;
6521 var hasPrev = key in prevChildMapping;
6522 var hasNext = key in nextChildMapping;
6523 var prevChild = prevChildMapping[key];
6524 var isLeaving = (0, React__default.isValidElement)(prevChild) && !prevChild.props.in; // item is new (entering)
6525
6526 if (hasNext && (!hasPrev || isLeaving)) {
6527 // console.log('entering', key)
6528 children[key] = (0, React__default.cloneElement)(child, {
6529 onExited: onExited.bind(null, child),
6530 in: true,
6531 exit: getProp(child, 'exit', nextProps),
6532 enter: getProp(child, 'enter', nextProps)
6533 });
6534 } else if (!hasNext && hasPrev && !isLeaving) {
6535 // item is old (exiting)
6536 // console.log('leaving', key)
6537 children[key] = (0, React__default.cloneElement)(child, {
6538 in: false
6539 });
6540 } else if (hasNext && hasPrev && (0, React__default.isValidElement)(prevChild)) {
6541 // item hasn't changed transition states
6542 // copy over the last transition props;
6543 // console.log('unchanged', key)
6544 children[key] = (0, React__default.cloneElement)(child, {
6545 onExited: onExited.bind(null, child),
6546 in: prevChild.props.in,
6547 exit: getProp(child, 'exit', nextProps),
6548 enter: getProp(child, 'enter', nextProps)
6549 });
6550 }
6551 });
6552 return children;
6553 }
6554 });
6555 unwrapExports(ChildMapping);
6556 var ChildMapping_1 = ChildMapping.getChildMapping;
6557 var ChildMapping_2 = ChildMapping.mergeChildMappings;
6558 var ChildMapping_3 = ChildMapping.getInitialChildMapping;
6559 var ChildMapping_4 = ChildMapping.getNextChildMapping;
6560
6561 var TransitionGroup_1 = createCommonjsModule(function (module, exports) {
6562
6563 exports.__esModule = true;
6564 exports.default = void 0;
6565
6566 var _propTypes = _interopRequireDefault(propTypes);
6567
6568 var _react = _interopRequireDefault(React__default);
6569
6570 function _interopRequireDefault(obj) {
6571 return obj && obj.__esModule ? obj : {
6572 default: obj
6573 };
6574 }
6575
6576 function _objectWithoutPropertiesLoose(source, excluded) {
6577 if (source == null) return {};
6578 var target = {};
6579 var sourceKeys = Object.keys(source);
6580 var key, i;
6581
6582 for (i = 0; i < sourceKeys.length; i++) {
6583 key = sourceKeys[i];
6584 if (excluded.indexOf(key) >= 0) continue;
6585 target[key] = source[key];
6586 }
6587
6588 return target;
6589 }
6590
6591 function _extends() {
6592 _extends = Object.assign || function (target) {
6593 for (var i = 1; i < arguments.length; i++) {
6594 var source = arguments[i];
6595
6596 for (var key in source) {
6597 if (Object.prototype.hasOwnProperty.call(source, key)) {
6598 target[key] = source[key];
6599 }
6600 }
6601 }
6602
6603 return target;
6604 };
6605
6606 return _extends.apply(this, arguments);
6607 }
6608
6609 function _inheritsLoose(subClass, superClass) {
6610 subClass.prototype = Object.create(superClass.prototype);
6611 subClass.prototype.constructor = subClass;
6612 subClass.__proto__ = superClass;
6613 }
6614
6615 function _assertThisInitialized(self) {
6616 if (self === void 0) {
6617 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
6618 }
6619
6620 return self;
6621 }
6622
6623 var values = Object.values || function (obj) {
6624 return Object.keys(obj).map(function (k) {
6625 return obj[k];
6626 });
6627 };
6628
6629 var defaultProps = {
6630 component: 'div',
6631 childFactory: function childFactory(child) {
6632 return child;
6633 }
6634 /**
6635 * The `<TransitionGroup>` component manages a set of transition components
6636 * (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
6637 * components, `<TransitionGroup>` is a state machine for managing the mounting
6638 * and unmounting of components over time.
6639 *
6640 * Consider the example below. As items are removed or added to the TodoList the
6641 * `in` prop is toggled automatically by the `<TransitionGroup>`.
6642 *
6643 * Note that `<TransitionGroup>` does not define any animation behavior!
6644 * Exactly _how_ a list item animates is up to the individual transition
6645 * component. This means you can mix and match animations across different list
6646 * items.
6647 */
6648
6649 };
6650
6651 var TransitionGroup =
6652 /*#__PURE__*/
6653 function (_React$Component) {
6654 _inheritsLoose(TransitionGroup, _React$Component);
6655
6656 function TransitionGroup(props, context) {
6657 var _this;
6658
6659 _this = _React$Component.call(this, props, context) || this;
6660
6661 var handleExited = _this.handleExited.bind(_assertThisInitialized(_assertThisInitialized(_this))); // Initial children should all be entering, dependent on appear
6662
6663
6664 _this.state = {
6665 handleExited: handleExited,
6666 firstRender: true
6667 };
6668 return _this;
6669 }
6670
6671 var _proto = TransitionGroup.prototype;
6672
6673 _proto.getChildContext = function getChildContext() {
6674 return {
6675 transitionGroup: {
6676 isMounting: !this.appeared
6677 }
6678 };
6679 };
6680
6681 _proto.componentDidMount = function componentDidMount() {
6682 this.appeared = true;
6683 this.mounted = true;
6684 };
6685
6686 _proto.componentWillUnmount = function componentWillUnmount() {
6687 this.mounted = false;
6688 };
6689
6690 TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
6691 var prevChildMapping = _ref.children,
6692 handleExited = _ref.handleExited,
6693 firstRender = _ref.firstRender;
6694 return {
6695 children: firstRender ? (0, ChildMapping.getInitialChildMapping)(nextProps, handleExited) : (0, ChildMapping.getNextChildMapping)(nextProps, prevChildMapping, handleExited),
6696 firstRender: false
6697 };
6698 };
6699
6700 _proto.handleExited = function handleExited(child, node) {
6701 var currentChildMapping = (0, ChildMapping.getChildMapping)(this.props.children);
6702 if (child.key in currentChildMapping) return;
6703
6704 if (child.props.onExited) {
6705 child.props.onExited(node);
6706 }
6707
6708 if (this.mounted) {
6709 this.setState(function (state) {
6710 var children = _extends({}, state.children);
6711
6712 delete children[child.key];
6713 return {
6714 children: children
6715 };
6716 });
6717 }
6718 };
6719
6720 _proto.render = function render() {
6721 var _this$props = this.props,
6722 Component = _this$props.component,
6723 childFactory = _this$props.childFactory,
6724 props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
6725
6726 var children = values(this.state.children).map(childFactory);
6727 delete props.appear;
6728 delete props.enter;
6729 delete props.exit;
6730
6731 if (Component === null) {
6732 return children;
6733 }
6734
6735 return _react.default.createElement(Component, props, children);
6736 };
6737
6738 return TransitionGroup;
6739 }(_react.default.Component);
6740
6741 TransitionGroup.childContextTypes = {
6742 transitionGroup: _propTypes.default.object.isRequired
6743 };
6744 TransitionGroup.propTypes = {};
6745 TransitionGroup.defaultProps = defaultProps;
6746
6747 var _default = (0, reactLifecyclesCompat_es.polyfill)(TransitionGroup);
6748
6749 exports.default = _default;
6750 module.exports = exports["default"];
6751 });
6752 unwrapExports(TransitionGroup_1);
6753
6754 var ReplaceTransition_1 = createCommonjsModule(function (module, exports) {
6755
6756 exports.__esModule = true;
6757 exports.default = void 0;
6758
6759 var _propTypes = _interopRequireDefault(propTypes);
6760
6761 var _react = _interopRequireDefault(React__default);
6762
6763 var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
6764
6765 function _interopRequireDefault(obj) {
6766 return obj && obj.__esModule ? obj : {
6767 default: obj
6768 };
6769 }
6770
6771 function _objectWithoutPropertiesLoose(source, excluded) {
6772 if (source == null) return {};
6773 var target = {};
6774 var sourceKeys = Object.keys(source);
6775 var key, i;
6776
6777 for (i = 0; i < sourceKeys.length; i++) {
6778 key = sourceKeys[i];
6779 if (excluded.indexOf(key) >= 0) continue;
6780 target[key] = source[key];
6781 }
6782
6783 return target;
6784 }
6785
6786 function _inheritsLoose(subClass, superClass) {
6787 subClass.prototype = Object.create(superClass.prototype);
6788 subClass.prototype.constructor = subClass;
6789 subClass.__proto__ = superClass;
6790 }
6791 /**
6792 * The `<ReplaceTransition>` component is a specialized `Transition` component
6793 * that animates between two children.
6794 *
6795 * ```jsx
6796 * <ReplaceTransition in>
6797 * <Fade><div>I appear first</div></Fade>
6798 * <Fade><div>I replace the above</div></Fade>
6799 * </ReplaceTransition>
6800 * ```
6801 */
6802
6803
6804 var ReplaceTransition =
6805 /*#__PURE__*/
6806 function (_React$Component) {
6807 _inheritsLoose(ReplaceTransition, _React$Component);
6808
6809 function ReplaceTransition() {
6810 var _this;
6811
6812 for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
6813 _args[_key] = arguments[_key];
6814 }
6815
6816 _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
6817
6818 _this.handleEnter = function () {
6819 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
6820 args[_key2] = arguments[_key2];
6821 }
6822
6823 return _this.handleLifecycle('onEnter', 0, args);
6824 };
6825
6826 _this.handleEntering = function () {
6827 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
6828 args[_key3] = arguments[_key3];
6829 }
6830
6831 return _this.handleLifecycle('onEntering', 0, args);
6832 };
6833
6834 _this.handleEntered = function () {
6835 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
6836 args[_key4] = arguments[_key4];
6837 }
6838
6839 return _this.handleLifecycle('onEntered', 0, args);
6840 };
6841
6842 _this.handleExit = function () {
6843 for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
6844 args[_key5] = arguments[_key5];
6845 }
6846
6847 return _this.handleLifecycle('onExit', 1, args);
6848 };
6849
6850 _this.handleExiting = function () {
6851 for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
6852 args[_key6] = arguments[_key6];
6853 }
6854
6855 return _this.handleLifecycle('onExiting', 1, args);
6856 };
6857
6858 _this.handleExited = function () {
6859 for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
6860 args[_key7] = arguments[_key7];
6861 }
6862
6863 return _this.handleLifecycle('onExited', 1, args);
6864 };
6865
6866 return _this;
6867 }
6868
6869 var _proto = ReplaceTransition.prototype;
6870
6871 _proto.handleLifecycle = function handleLifecycle(handler, idx, originalArgs) {
6872 var _child$props;
6873
6874 var children = this.props.children;
6875
6876 var child = _react.default.Children.toArray(children)[idx];
6877
6878 if (child.props[handler]) (_child$props = child.props)[handler].apply(_child$props, originalArgs);
6879 if (this.props[handler]) this.props[handler]((0, ReactDOM.findDOMNode)(this));
6880 };
6881
6882 _proto.render = function render() {
6883 var _this$props = this.props,
6884 children = _this$props.children,
6885 inProp = _this$props.in,
6886 props = _objectWithoutPropertiesLoose(_this$props, ["children", "in"]);
6887
6888 var _React$Children$toArr = _react.default.Children.toArray(children),
6889 first = _React$Children$toArr[0],
6890 second = _React$Children$toArr[1];
6891
6892 delete props.onEnter;
6893 delete props.onEntering;
6894 delete props.onEntered;
6895 delete props.onExit;
6896 delete props.onExiting;
6897 delete props.onExited;
6898 return _react.default.createElement(_TransitionGroup.default, props, inProp ? _react.default.cloneElement(first, {
6899 key: 'first',
6900 onEnter: this.handleEnter,
6901 onEntering: this.handleEntering,
6902 onEntered: this.handleEntered
6903 }) : _react.default.cloneElement(second, {
6904 key: 'second',
6905 onEnter: this.handleExit,
6906 onEntering: this.handleExiting,
6907 onEntered: this.handleExited
6908 }));
6909 };
6910
6911 return ReplaceTransition;
6912 }(_react.default.Component);
6913
6914 ReplaceTransition.propTypes = {};
6915 var _default = ReplaceTransition;
6916 exports.default = _default;
6917 module.exports = exports["default"];
6918 });
6919 unwrapExports(ReplaceTransition_1);
6920
6921 var reactTransitionGroup = createCommonjsModule(function (module) {
6922
6923 var _CSSTransition = _interopRequireDefault(CSSTransition_1);
6924
6925 var _ReplaceTransition = _interopRequireDefault(ReplaceTransition_1);
6926
6927 var _TransitionGroup = _interopRequireDefault(TransitionGroup_1);
6928
6929 var _Transition = _interopRequireDefault(Transition_1);
6930
6931 function _interopRequireDefault(obj) {
6932 return obj && obj.__esModule ? obj : {
6933 default: obj
6934 };
6935 }
6936
6937 module.exports = {
6938 Transition: _Transition.default,
6939 TransitionGroup: _TransitionGroup.default,
6940 ReplaceTransition: _ReplaceTransition.default,
6941 CSSTransition: _CSSTransition.default
6942 };
6943 });
6944 unwrapExports(reactTransitionGroup);
6945 var reactTransitionGroup_1 = reactTransitionGroup.Transition;
6946 var reactTransitionGroup_2 = reactTransitionGroup.TransitionGroup;
6947 var reactTransitionGroup_3 = reactTransitionGroup.ReplaceTransition;
6948 var reactTransitionGroup_4 = reactTransitionGroup.CSSTransition;
6949
6950 var propTypes$k = _extends({}, reactTransitionGroup_1.propTypes, {
6951 children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
6952 tag: tagPropType,
6953 baseClass: propTypes.string,
6954 baseClassActive: propTypes.string,
6955 className: propTypes.string,
6956 cssModule: propTypes.object,
6957 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
6958 });
6959
6960 var defaultProps$i = _extends({}, reactTransitionGroup_1.defaultProps, {
6961 tag: 'div',
6962 baseClass: 'fade',
6963 baseClassActive: 'show',
6964 timeout: TransitionTimeouts.Fade,
6965 appear: true,
6966 enter: true,
6967 exit: true,
6968 in: true
6969 });
6970
6971 function Fade(props) {
6972 var Tag = props.tag,
6973 baseClass = props.baseClass,
6974 baseClassActive = props.baseClassActive,
6975 className = props.className,
6976 cssModule = props.cssModule,
6977 children = props.children,
6978 innerRef = props.innerRef,
6979 otherProps = _objectWithoutPropertiesLoose(props, ["tag", "baseClass", "baseClassActive", "className", "cssModule", "children", "innerRef"]);
6980
6981 var transitionProps = pick(otherProps, TransitionPropTypeKeys);
6982 var childProps = omit(otherProps, TransitionPropTypeKeys);
6983 return React__default.createElement(reactTransitionGroup_1, transitionProps, function (status) {
6984 var isActive = status === 'entered';
6985 var classes = mapToCssModules(classnames(className, baseClass, isActive && baseClassActive), cssModule);
6986 return React__default.createElement(Tag, _extends({
6987 className: classes
6988 }, childProps, {
6989 ref: innerRef
6990 }), children);
6991 });
6992 }
6993
6994 Fade.propTypes = propTypes$k;
6995 Fade.defaultProps = defaultProps$i;
6996
6997 var propTypes$l = {
6998 color: propTypes.string,
6999 pill: propTypes.bool,
7000 tag: tagPropType,
7001 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
7002 children: propTypes.node,
7003 className: propTypes.string,
7004 cssModule: propTypes.object
7005 };
7006 var defaultProps$j = {
7007 color: 'secondary',
7008 pill: false,
7009 tag: 'span'
7010 };
7011
7012 var Badge = function Badge(props) {
7013 var className = props.className,
7014 cssModule = props.cssModule,
7015 color = props.color,
7016 innerRef = props.innerRef,
7017 pill = props.pill,
7018 Tag = props.tag,
7019 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "innerRef", "pill", "tag"]);
7020
7021 var classes = mapToCssModules(classnames(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule);
7022
7023 if (attributes.href && Tag === 'span') {
7024 Tag = 'a';
7025 }
7026
7027 return React__default.createElement(Tag, _extends({}, attributes, {
7028 className: classes,
7029 ref: innerRef
7030 }));
7031 };
7032
7033 Badge.propTypes = propTypes$l;
7034 Badge.defaultProps = defaultProps$j;
7035
7036 var propTypes$m = {
7037 tag: tagPropType,
7038 inverse: propTypes.bool,
7039 color: propTypes.string,
7040 body: propTypes.bool,
7041 outline: propTypes.bool,
7042 className: propTypes.string,
7043 cssModule: propTypes.object,
7044 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
7045 };
7046 var defaultProps$k = {
7047 tag: 'div'
7048 };
7049
7050 var Card = function Card(props) {
7051 var className = props.className,
7052 cssModule = props.cssModule,
7053 color = props.color,
7054 body = props.body,
7055 inverse = props.inverse,
7056 outline = props.outline,
7057 Tag = props.tag,
7058 innerRef = props.innerRef,
7059 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "color", "body", "inverse", "outline", "tag", "innerRef"]);
7060
7061 var classes = mapToCssModules(classnames(className, 'card', inverse ? 'text-white' : false, body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + "-" + color : false), cssModule);
7062 return React__default.createElement(Tag, _extends({}, attributes, {
7063 className: classes,
7064 ref: innerRef
7065 }));
7066 };
7067
7068 Card.propTypes = propTypes$m;
7069 Card.defaultProps = defaultProps$k;
7070
7071 var propTypes$n = {
7072 tag: tagPropType,
7073 className: propTypes.string,
7074 cssModule: propTypes.object
7075 };
7076 var defaultProps$l = {
7077 tag: 'div'
7078 };
7079
7080 var CardGroup = function CardGroup(props) {
7081 var className = props.className,
7082 cssModule = props.cssModule,
7083 Tag = props.tag,
7084 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7085
7086 var classes = mapToCssModules(classnames(className, 'card-group'), cssModule);
7087 return React__default.createElement(Tag, _extends({}, attributes, {
7088 className: classes
7089 }));
7090 };
7091
7092 CardGroup.propTypes = propTypes$n;
7093 CardGroup.defaultProps = defaultProps$l;
7094
7095 var propTypes$o = {
7096 tag: tagPropType,
7097 className: propTypes.string,
7098 cssModule: propTypes.object
7099 };
7100 var defaultProps$m = {
7101 tag: 'div'
7102 };
7103
7104 var CardDeck = function CardDeck(props) {
7105 var className = props.className,
7106 cssModule = props.cssModule,
7107 Tag = props.tag,
7108 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7109
7110 var classes = mapToCssModules(classnames(className, 'card-deck'), cssModule);
7111 return React__default.createElement(Tag, _extends({}, attributes, {
7112 className: classes
7113 }));
7114 };
7115
7116 CardDeck.propTypes = propTypes$o;
7117 CardDeck.defaultProps = defaultProps$m;
7118
7119 var propTypes$p = {
7120 tag: tagPropType,
7121 className: propTypes.string,
7122 cssModule: propTypes.object
7123 };
7124 var defaultProps$n = {
7125 tag: 'div'
7126 };
7127
7128 var CardColumns = function CardColumns(props) {
7129 var className = props.className,
7130 cssModule = props.cssModule,
7131 Tag = props.tag,
7132 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7133
7134 var classes = mapToCssModules(classnames(className, 'card-columns'), cssModule);
7135 return React__default.createElement(Tag, _extends({}, attributes, {
7136 className: classes
7137 }));
7138 };
7139
7140 CardColumns.propTypes = propTypes$p;
7141 CardColumns.defaultProps = defaultProps$n;
7142
7143 var propTypes$q = {
7144 tag: tagPropType,
7145 className: propTypes.string,
7146 cssModule: propTypes.object,
7147 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
7148 };
7149 var defaultProps$o = {
7150 tag: 'div'
7151 };
7152
7153 var CardBody = function CardBody(props) {
7154 var className = props.className,
7155 cssModule = props.cssModule,
7156 innerRef = props.innerRef,
7157 Tag = props.tag,
7158 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
7159
7160 var classes = mapToCssModules(classnames(className, 'card-body'), cssModule);
7161 return React__default.createElement(Tag, _extends({}, attributes, {
7162 className: classes,
7163 ref: innerRef
7164 }));
7165 };
7166
7167 CardBody.propTypes = propTypes$q;
7168 CardBody.defaultProps = defaultProps$o;
7169
7170 var propTypes$r = {
7171 tag: tagPropType,
7172 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
7173 className: propTypes.string,
7174 cssModule: propTypes.object
7175 };
7176 var defaultProps$p = {
7177 tag: 'a'
7178 };
7179
7180 var CardLink = function CardLink(props) {
7181 var className = props.className,
7182 cssModule = props.cssModule,
7183 Tag = props.tag,
7184 innerRef = props.innerRef,
7185 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "innerRef"]);
7186
7187 var classes = mapToCssModules(classnames(className, 'card-link'), cssModule);
7188 return React__default.createElement(Tag, _extends({}, attributes, {
7189 ref: innerRef,
7190 className: classes
7191 }));
7192 };
7193
7194 CardLink.propTypes = propTypes$r;
7195 CardLink.defaultProps = defaultProps$p;
7196
7197 var propTypes$s = {
7198 tag: tagPropType,
7199 className: propTypes.string,
7200 cssModule: propTypes.object
7201 };
7202 var defaultProps$q = {
7203 tag: 'div'
7204 };
7205
7206 var CardFooter = function CardFooter(props) {
7207 var className = props.className,
7208 cssModule = props.cssModule,
7209 Tag = props.tag,
7210 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7211
7212 var classes = mapToCssModules(classnames(className, 'card-footer'), cssModule);
7213 return React__default.createElement(Tag, _extends({}, attributes, {
7214 className: classes
7215 }));
7216 };
7217
7218 CardFooter.propTypes = propTypes$s;
7219 CardFooter.defaultProps = defaultProps$q;
7220
7221 var propTypes$t = {
7222 tag: tagPropType,
7223 className: propTypes.string,
7224 cssModule: propTypes.object
7225 };
7226 var defaultProps$r = {
7227 tag: 'div'
7228 };
7229
7230 var CardHeader = function CardHeader(props) {
7231 var className = props.className,
7232 cssModule = props.cssModule,
7233 Tag = props.tag,
7234 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7235
7236 var classes = mapToCssModules(classnames(className, 'card-header'), cssModule);
7237 return React__default.createElement(Tag, _extends({}, attributes, {
7238 className: classes
7239 }));
7240 };
7241
7242 CardHeader.propTypes = propTypes$t;
7243 CardHeader.defaultProps = defaultProps$r;
7244
7245 var propTypes$u = {
7246 tag: tagPropType,
7247 top: propTypes.bool,
7248 bottom: propTypes.bool,
7249 className: propTypes.string,
7250 cssModule: propTypes.object
7251 };
7252 var defaultProps$s = {
7253 tag: 'img'
7254 };
7255
7256 var CardImg = function CardImg(props) {
7257 var className = props.className,
7258 cssModule = props.cssModule,
7259 top = props.top,
7260 bottom = props.bottom,
7261 Tag = props.tag,
7262 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "top", "bottom", "tag"]);
7263
7264 var cardImgClassName = 'card-img';
7265
7266 if (top) {
7267 cardImgClassName = 'card-img-top';
7268 }
7269
7270 if (bottom) {
7271 cardImgClassName = 'card-img-bottom';
7272 }
7273
7274 var classes = mapToCssModules(classnames(className, cardImgClassName), cssModule);
7275 return React__default.createElement(Tag, _extends({}, attributes, {
7276 className: classes
7277 }));
7278 };
7279
7280 CardImg.propTypes = propTypes$u;
7281 CardImg.defaultProps = defaultProps$s;
7282
7283 var propTypes$v = {
7284 tag: tagPropType,
7285 className: propTypes.string,
7286 cssModule: propTypes.object
7287 };
7288 var defaultProps$t = {
7289 tag: 'div'
7290 };
7291
7292 var CardImgOverlay = function CardImgOverlay(props) {
7293 var className = props.className,
7294 cssModule = props.cssModule,
7295 Tag = props.tag,
7296 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7297
7298 var classes = mapToCssModules(classnames(className, 'card-img-overlay'), cssModule);
7299 return React__default.createElement(Tag, _extends({}, attributes, {
7300 className: classes
7301 }));
7302 };
7303
7304 CardImgOverlay.propTypes = propTypes$v;
7305 CardImgOverlay.defaultProps = defaultProps$t;
7306
7307 var CarouselItem =
7308 /*#__PURE__*/
7309 function (_React$Component) {
7310 _inheritsLoose(CarouselItem, _React$Component);
7311
7312 function CarouselItem(props) {
7313 var _this;
7314
7315 _this = _React$Component.call(this, props) || this;
7316 _this.state = {
7317 startAnimation: false
7318 };
7319 _this.onEnter = _this.onEnter.bind(_assertThisInitialized(_this));
7320 _this.onEntering = _this.onEntering.bind(_assertThisInitialized(_this));
7321 _this.onExit = _this.onExit.bind(_assertThisInitialized(_this));
7322 _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
7323 _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
7324 return _this;
7325 }
7326
7327 var _proto = CarouselItem.prototype;
7328
7329 _proto.onEnter = function onEnter(node, isAppearing) {
7330 this.setState({
7331 startAnimation: false
7332 });
7333 this.props.onEnter(node, isAppearing);
7334 };
7335
7336 _proto.onEntering = function onEntering(node, isAppearing) {
7337 // getting this variable triggers a reflow
7338 var offsetHeight = node.offsetHeight;
7339 this.setState({
7340 startAnimation: true
7341 });
7342 this.props.onEntering(node, isAppearing);
7343 return offsetHeight;
7344 };
7345
7346 _proto.onExit = function onExit(node) {
7347 this.setState({
7348 startAnimation: false
7349 });
7350 this.props.onExit(node);
7351 };
7352
7353 _proto.onExiting = function onExiting(node) {
7354 this.setState({
7355 startAnimation: true
7356 });
7357 node.dispatchEvent(new CustomEvent('slide.bs.carousel'));
7358 this.props.onExiting(node);
7359 };
7360
7361 _proto.onExited = function onExited(node) {
7362 node.dispatchEvent(new CustomEvent('slid.bs.carousel'));
7363 this.props.onExited(node);
7364 };
7365
7366 _proto.render = function render() {
7367 var _this2 = this;
7368
7369 var _this$props = this.props,
7370 isIn = _this$props.in,
7371 children = _this$props.children,
7372 cssModule = _this$props.cssModule,
7373 slide = _this$props.slide,
7374 Tag = _this$props.tag,
7375 className = _this$props.className,
7376 transitionProps = _objectWithoutPropertiesLoose(_this$props, ["in", "children", "cssModule", "slide", "tag", "className"]);
7377
7378 return React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
7379 enter: slide,
7380 exit: slide,
7381 in: isIn,
7382 onEnter: this.onEnter,
7383 onEntering: this.onEntering,
7384 onExit: this.onExit,
7385 onExiting: this.onExiting,
7386 onExited: this.onExited
7387 }), function (status) {
7388 var direction = _this2.context.direction;
7389 var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING;
7390 var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right');
7391 var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev');
7392 var itemClasses = mapToCssModules(classnames(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule);
7393 return React__default.createElement(Tag, {
7394 className: itemClasses
7395 }, children);
7396 });
7397 };
7398
7399 return CarouselItem;
7400 }(React__default.Component);
7401
7402 CarouselItem.propTypes = _extends({}, reactTransitionGroup_1.propTypes, {
7403 tag: tagPropType,
7404 in: propTypes.bool,
7405 cssModule: propTypes.object,
7406 children: propTypes.node,
7407 slide: propTypes.bool,
7408 className: propTypes.string
7409 });
7410 CarouselItem.defaultProps = _extends({}, reactTransitionGroup_1.defaultProps, {
7411 tag: 'div',
7412 timeout: TransitionTimeouts.Carousel,
7413 slide: true
7414 });
7415 CarouselItem.contextTypes = {
7416 direction: propTypes.string
7417 };
7418
7419 var Carousel =
7420 /*#__PURE__*/
7421 function (_React$Component) {
7422 _inheritsLoose(Carousel, _React$Component);
7423
7424 function Carousel(props) {
7425 var _this;
7426
7427 _this = _React$Component.call(this, props) || this;
7428 _this.handleKeyPress = _this.handleKeyPress.bind(_assertThisInitialized(_this));
7429 _this.renderItems = _this.renderItems.bind(_assertThisInitialized(_this));
7430 _this.hoverStart = _this.hoverStart.bind(_assertThisInitialized(_this));
7431 _this.hoverEnd = _this.hoverEnd.bind(_assertThisInitialized(_this));
7432 _this.state = {
7433 direction: 'right',
7434 indicatorClicked: false
7435 };
7436 return _this;
7437 }
7438
7439 var _proto = Carousel.prototype;
7440
7441 _proto.getChildContext = function getChildContext() {
7442 return {
7443 direction: this.state.direction
7444 };
7445 };
7446
7447 _proto.componentDidMount = function componentDidMount() {
7448 // Set up the cycle
7449 if (this.props.ride === 'carousel') {
7450 this.setInterval();
7451 } // TODO: move this to the specific carousel like bootstrap. Currently it will trigger ALL carousels on the page.
7452
7453
7454 document.addEventListener('keyup', this.handleKeyPress);
7455 };
7456
7457 _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
7458 this.setInterval(nextProps); // Calculate the direction to turn
7459
7460 if (this.props.activeIndex + 1 === nextProps.activeIndex) {
7461 this.setState({
7462 direction: 'right'
7463 });
7464 } else if (this.props.activeIndex - 1 === nextProps.activeIndex) {
7465 this.setState({
7466 direction: 'left'
7467 });
7468 } else if (this.props.activeIndex > nextProps.activeIndex) {
7469 this.setState({
7470 direction: this.state.indicatorClicked ? 'left' : 'right'
7471 });
7472 } else if (this.props.activeIndex !== nextProps.activeIndex) {
7473 this.setState({
7474 direction: this.state.indicatorClicked ? 'right' : 'left'
7475 });
7476 }
7477
7478 this.setState({
7479 indicatorClicked: false
7480 });
7481 };
7482
7483 _proto.componentWillUnmount = function componentWillUnmount() {
7484 this.clearInterval();
7485 document.removeEventListener('keyup', this.handleKeyPress);
7486 };
7487
7488 _proto.setInterval = function (_setInterval) {
7489 function setInterval() {
7490 return _setInterval.apply(this, arguments);
7491 }
7492
7493 setInterval.toString = function () {
7494 return _setInterval.toString();
7495 };
7496
7497 return setInterval;
7498 }(function (props) {
7499 if (props === void 0) {
7500 props = this.props;
7501 }
7502
7503 // make sure not to have multiple intervals going...
7504 this.clearInterval();
7505
7506 if (props.interval) {
7507 this.cycleInterval = setInterval(function () {
7508 props.next();
7509 }, parseInt(props.interval, 10));
7510 }
7511 });
7512
7513 _proto.clearInterval = function (_clearInterval) {
7514 function clearInterval() {
7515 return _clearInterval.apply(this, arguments);
7516 }
7517
7518 clearInterval.toString = function () {
7519 return _clearInterval.toString();
7520 };
7521
7522 return clearInterval;
7523 }(function () {
7524 clearInterval(this.cycleInterval);
7525 });
7526
7527 _proto.hoverStart = function hoverStart() {
7528 if (this.props.pause === 'hover') {
7529 this.clearInterval();
7530 }
7531
7532 if (this.props.mouseEnter) {
7533 var _this$props;
7534
7535 (_this$props = this.props).mouseEnter.apply(_this$props, arguments);
7536 }
7537 };
7538
7539 _proto.hoverEnd = function hoverEnd() {
7540 if (this.props.pause === 'hover') {
7541 this.setInterval();
7542 }
7543
7544 if (this.props.mouseLeave) {
7545 var _this$props2;
7546
7547 (_this$props2 = this.props).mouseLeave.apply(_this$props2, arguments);
7548 }
7549 };
7550
7551 _proto.handleKeyPress = function handleKeyPress(evt) {
7552 if (this.props.keyboard) {
7553 if (evt.keyCode === 37) {
7554 this.props.previous();
7555 } else if (evt.keyCode === 39) {
7556 this.props.next();
7557 }
7558 }
7559 };
7560
7561 _proto.renderItems = function renderItems(carouselItems, className) {
7562 var _this2 = this;
7563
7564 var slide = this.props.slide;
7565 return React__default.createElement("div", {
7566 className: className
7567 }, carouselItems.map(function (item, index) {
7568 var isIn = index === _this2.props.activeIndex;
7569 return React__default.cloneElement(item, {
7570 in: isIn,
7571 slide: slide
7572 });
7573 }));
7574 };
7575
7576 _proto.render = function render() {
7577 var _this3 = this;
7578
7579 var _this$props3 = this.props,
7580 cssModule = _this$props3.cssModule,
7581 slide = _this$props3.slide,
7582 className = _this$props3.className;
7583 var outerClasses = mapToCssModules(classnames(className, 'carousel', slide && 'slide'), cssModule);
7584 var innerClasses = mapToCssModules(classnames('carousel-inner'), cssModule); // filter out booleans, null, or undefined
7585
7586 var children = this.props.children.filter(function (child) {
7587 return child !== null && child !== undefined && typeof child !== 'boolean';
7588 });
7589 var slidesOnly = children.every(function (child) {
7590 return child.type === CarouselItem;
7591 }); // Rendering only slides
7592
7593 if (slidesOnly) {
7594 return React__default.createElement("div", {
7595 className: outerClasses,
7596 onMouseEnter: this.hoverStart,
7597 onMouseLeave: this.hoverEnd
7598 }, this.renderItems(children, innerClasses));
7599 } // Rendering slides and controls
7600
7601
7602 if (children[0] instanceof Array) {
7603 var _carouselItems = children[0];
7604 var _controlLeft = children[1];
7605 var _controlRight = children[2];
7606 return React__default.createElement("div", {
7607 className: outerClasses,
7608 onMouseEnter: this.hoverStart,
7609 onMouseLeave: this.hoverEnd
7610 }, this.renderItems(_carouselItems, innerClasses), _controlLeft, _controlRight);
7611 } // Rendering indicators, slides and controls
7612
7613
7614 var indicators = children[0];
7615
7616 var wrappedOnClick = function wrappedOnClick(e) {
7617 if (typeof indicators.props.onClickHandler === 'function') {
7618 _this3.setState({
7619 indicatorClicked: true
7620 }, function () {
7621 return indicators.props.onClickHandler(e);
7622 });
7623 }
7624 };
7625
7626 var wrappedIndicators = React__default.cloneElement(indicators, {
7627 onClickHandler: wrappedOnClick
7628 });
7629 var carouselItems = children[1];
7630 var controlLeft = children[2];
7631 var controlRight = children[3];
7632 return React__default.createElement("div", {
7633 className: outerClasses,
7634 onMouseEnter: this.hoverStart,
7635 onMouseLeave: this.hoverEnd
7636 }, wrappedIndicators, this.renderItems(carouselItems, innerClasses), controlLeft, controlRight);
7637 };
7638
7639 return Carousel;
7640 }(React__default.Component);
7641
7642 Carousel.propTypes = {
7643 // the current active slide of the carousel
7644 activeIndex: propTypes.number,
7645 // a function which should advance the carousel to the next slide (via activeIndex)
7646 next: propTypes.func.isRequired,
7647 // a function which should advance the carousel to the previous slide (via activeIndex)
7648 previous: propTypes.func.isRequired,
7649 // controls if the left and right arrow keys should control the carousel
7650 keyboard: propTypes.bool,
7651
7652 /* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on
7653 * mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover")
7654 */
7655 pause: propTypes.oneOf(['hover', false]),
7656 // Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
7657 // This is how bootstrap defines it... I would prefer a bool named autoplay or something...
7658 ride: propTypes.oneOf(['carousel']),
7659 // the interval at which the carousel automatically cycles (default: 5000)
7660 // eslint-disable-next-line react/no-unused-prop-types
7661 interval: propTypes.oneOfType([propTypes.number, propTypes.string, propTypes.bool]),
7662 children: propTypes.array,
7663 // called when the mouse enters the Carousel
7664 mouseEnter: propTypes.func,
7665 // called when the mouse exits the Carousel
7666 mouseLeave: propTypes.func,
7667 // controls whether the slide animation on the Carousel works or not
7668 slide: propTypes.bool,
7669 cssModule: propTypes.object,
7670 className: propTypes.string
7671 };
7672 Carousel.defaultProps = {
7673 interval: 5000,
7674 pause: 'hover',
7675 keyboard: true,
7676 slide: true
7677 };
7678 Carousel.childContextTypes = {
7679 direction: propTypes.string
7680 };
7681
7682 var CarouselControl = function CarouselControl(props) {
7683 var direction = props.direction,
7684 onClickHandler = props.onClickHandler,
7685 cssModule = props.cssModule,
7686 directionText = props.directionText,
7687 className = props.className;
7688 var anchorClasses = mapToCssModules(classnames(className, "carousel-control-" + direction), cssModule);
7689 var iconClasses = mapToCssModules(classnames("carousel-control-" + direction + "-icon"), cssModule);
7690 var screenReaderClasses = mapToCssModules(classnames('sr-only'), cssModule);
7691 return React__default.createElement("a", {
7692 className: anchorClasses,
7693 role: "button",
7694 tabIndex: "0",
7695 onClick: function onClick(e) {
7696 e.preventDefault();
7697 onClickHandler();
7698 }
7699 }, React__default.createElement("span", {
7700 className: iconClasses,
7701 "aria-hidden": "true"
7702 }), React__default.createElement("span", {
7703 className: screenReaderClasses
7704 }, directionText || direction));
7705 };
7706
7707 CarouselControl.propTypes = {
7708 direction: propTypes.oneOf(['prev', 'next']).isRequired,
7709 onClickHandler: propTypes.func.isRequired,
7710 cssModule: propTypes.object,
7711 directionText: propTypes.string,
7712 className: propTypes.string
7713 };
7714
7715 var CarouselIndicators = function CarouselIndicators(props) {
7716 var items = props.items,
7717 activeIndex = props.activeIndex,
7718 cssModule = props.cssModule,
7719 onClickHandler = props.onClickHandler,
7720 className = props.className;
7721 var listClasses = mapToCssModules(classnames(className, 'carousel-indicators'), cssModule);
7722 var indicators = items.map(function (item, idx) {
7723 var indicatorClasses = mapToCssModules(classnames({
7724 active: activeIndex === idx
7725 }), cssModule);
7726 return React__default.createElement("li", {
7727 key: "" + (item.key || Object.values(item).join('')),
7728 onClick: function onClick(e) {
7729 e.preventDefault();
7730 onClickHandler(idx);
7731 },
7732 className: indicatorClasses
7733 });
7734 });
7735 return React__default.createElement("ol", {
7736 className: listClasses
7737 }, indicators);
7738 };
7739
7740 CarouselIndicators.propTypes = {
7741 items: propTypes.array.isRequired,
7742 activeIndex: propTypes.number.isRequired,
7743 cssModule: propTypes.object,
7744 onClickHandler: propTypes.func.isRequired,
7745 className: propTypes.string
7746 };
7747
7748 var CarouselCaption = function CarouselCaption(props) {
7749 var captionHeader = props.captionHeader,
7750 captionText = props.captionText,
7751 cssModule = props.cssModule,
7752 className = props.className;
7753 var classes = mapToCssModules(classnames(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule);
7754 return React__default.createElement("div", {
7755 className: classes
7756 }, React__default.createElement("h3", null, captionHeader), React__default.createElement("p", null, captionText));
7757 };
7758
7759 CarouselCaption.propTypes = {
7760 captionHeader: propTypes.string,
7761 captionText: propTypes.string.isRequired,
7762 cssModule: propTypes.object,
7763 className: propTypes.string
7764 };
7765
7766 var propTypes$w = {
7767 items: propTypes.array.isRequired,
7768 indicators: propTypes.bool,
7769 controls: propTypes.bool,
7770 autoPlay: propTypes.bool,
7771 defaultActiveIndex: propTypes.number,
7772 activeIndex: propTypes.number,
7773 next: propTypes.func,
7774 previous: propTypes.func,
7775 goToIndex: propTypes.func
7776 };
7777
7778 var UncontrolledCarousel =
7779 /*#__PURE__*/
7780 function (_Component) {
7781 _inheritsLoose(UncontrolledCarousel, _Component);
7782
7783 function UncontrolledCarousel(props) {
7784 var _this;
7785
7786 _this = _Component.call(this, props) || this;
7787 _this.animating = false;
7788 _this.state = {
7789 activeIndex: props.defaultActiveIndex || 0
7790 };
7791 _this.next = _this.next.bind(_assertThisInitialized(_this));
7792 _this.previous = _this.previous.bind(_assertThisInitialized(_this));
7793 _this.goToIndex = _this.goToIndex.bind(_assertThisInitialized(_this));
7794 _this.onExiting = _this.onExiting.bind(_assertThisInitialized(_this));
7795 _this.onExited = _this.onExited.bind(_assertThisInitialized(_this));
7796 return _this;
7797 }
7798
7799 var _proto = UncontrolledCarousel.prototype;
7800
7801 _proto.onExiting = function onExiting() {
7802 this.animating = true;
7803 };
7804
7805 _proto.onExited = function onExited() {
7806 this.animating = false;
7807 };
7808
7809 _proto.next = function next() {
7810 if (this.animating) return;
7811 var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1;
7812 this.setState({
7813 activeIndex: nextIndex
7814 });
7815 };
7816
7817 _proto.previous = function previous() {
7818 if (this.animating) return;
7819 var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1;
7820 this.setState({
7821 activeIndex: nextIndex
7822 });
7823 };
7824
7825 _proto.goToIndex = function goToIndex(newIndex) {
7826 if (this.animating) return;
7827 this.setState({
7828 activeIndex: newIndex
7829 });
7830 };
7831
7832 _proto.render = function render() {
7833 var _this2 = this;
7834
7835 var _this$props = this.props,
7836 defaultActiveIndex = _this$props.defaultActiveIndex,
7837 autoPlay = _this$props.autoPlay,
7838 indicators = _this$props.indicators,
7839 controls = _this$props.controls,
7840 items = _this$props.items,
7841 goToIndex = _this$props.goToIndex,
7842 props = _objectWithoutPropertiesLoose(_this$props, ["defaultActiveIndex", "autoPlay", "indicators", "controls", "items", "goToIndex"]);
7843
7844 var activeIndex = this.state.activeIndex;
7845 var slides = items.map(function (item) {
7846 return React__default.createElement(CarouselItem, {
7847 onExiting: _this2.onExiting,
7848 onExited: _this2.onExited,
7849 key: item.src
7850 }, React__default.createElement("img", {
7851 className: "d-block w-100",
7852 src: item.src,
7853 alt: item.altText
7854 }), React__default.createElement(CarouselCaption, {
7855 captionText: item.caption,
7856 captionHeader: item.header || item.caption
7857 }));
7858 });
7859 return React__default.createElement(Carousel, _extends({
7860 activeIndex: activeIndex,
7861 next: this.next,
7862 previous: this.previous,
7863 ride: autoPlay ? 'carousel' : undefined
7864 }, props), indicators && React__default.createElement(CarouselIndicators, {
7865 items: items,
7866 activeIndex: props.activeIndex || activeIndex,
7867 onClickHandler: goToIndex || this.goToIndex
7868 }), slides, controls && React__default.createElement(CarouselControl, {
7869 direction: "prev",
7870 directionText: "Previous",
7871 onClickHandler: props.previous || this.previous
7872 }), controls && React__default.createElement(CarouselControl, {
7873 direction: "next",
7874 directionText: "Next",
7875 onClickHandler: props.next || this.next
7876 }));
7877 };
7878
7879 return UncontrolledCarousel;
7880 }(React.Component);
7881
7882 UncontrolledCarousel.propTypes = propTypes$w;
7883 UncontrolledCarousel.defaultProps = {
7884 controls: true,
7885 indicators: true,
7886 autoPlay: true
7887 };
7888
7889 var propTypes$x = {
7890 tag: tagPropType,
7891 className: propTypes.string,
7892 cssModule: propTypes.object
7893 };
7894 var defaultProps$u = {
7895 tag: 'div'
7896 };
7897
7898 var CardSubtitle = function CardSubtitle(props) {
7899 var className = props.className,
7900 cssModule = props.cssModule,
7901 Tag = props.tag,
7902 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7903
7904 var classes = mapToCssModules(classnames(className, 'card-subtitle'), cssModule);
7905 return React__default.createElement(Tag, _extends({}, attributes, {
7906 className: classes
7907 }));
7908 };
7909
7910 CardSubtitle.propTypes = propTypes$x;
7911 CardSubtitle.defaultProps = defaultProps$u;
7912
7913 var propTypes$y = {
7914 tag: tagPropType,
7915 className: propTypes.string,
7916 cssModule: propTypes.object
7917 };
7918 var defaultProps$v = {
7919 tag: 'p'
7920 };
7921
7922 var CardText = function CardText(props) {
7923 var className = props.className,
7924 cssModule = props.cssModule,
7925 Tag = props.tag,
7926 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7927
7928 var classes = mapToCssModules(classnames(className, 'card-text'), cssModule);
7929 return React__default.createElement(Tag, _extends({}, attributes, {
7930 className: classes
7931 }));
7932 };
7933
7934 CardText.propTypes = propTypes$y;
7935 CardText.defaultProps = defaultProps$v;
7936
7937 var propTypes$z = {
7938 tag: tagPropType,
7939 className: propTypes.string,
7940 cssModule: propTypes.object
7941 };
7942 var defaultProps$w = {
7943 tag: 'div'
7944 };
7945
7946 var CardTitle = function CardTitle(props) {
7947 var className = props.className,
7948 cssModule = props.cssModule,
7949 Tag = props.tag,
7950 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
7951
7952 var classes = mapToCssModules(classnames(className, 'card-title'), cssModule);
7953 return React__default.createElement(Tag, _extends({}, attributes, {
7954 className: classes
7955 }));
7956 };
7957
7958 CardTitle.propTypes = propTypes$z;
7959 CardTitle.defaultProps = defaultProps$w;
7960
7961 var propTypes$A = {
7962 className: propTypes.string,
7963 id: propTypes.oneOfType([propTypes.string, propTypes.number]).isRequired,
7964 type: propTypes.string.isRequired,
7965 label: propTypes.node,
7966 inline: propTypes.bool,
7967 valid: propTypes.bool,
7968 invalid: propTypes.bool,
7969 bsSize: propTypes.string,
7970 htmlFor: propTypes.string,
7971 cssModule: propTypes.object,
7972 children: propTypes.oneOfType([propTypes.node, propTypes.array, propTypes.func]),
7973 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
7974 };
7975
7976 function CustomInput(props) {
7977 var className = props.className,
7978 label = props.label,
7979 inline = props.inline,
7980 valid = props.valid,
7981 invalid = props.invalid,
7982 cssModule = props.cssModule,
7983 children = props.children,
7984 bsSize = props.bsSize,
7985 innerRef = props.innerRef,
7986 htmlFor = props.htmlFor,
7987 attributes = _objectWithoutPropertiesLoose(props, ["className", "label", "inline", "valid", "invalid", "cssModule", "children", "bsSize", "innerRef", "htmlFor"]);
7988
7989 var type = attributes.type;
7990 var customClass = mapToCssModules(classnames(className, "custom-" + type, bsSize ? "custom-" + type + "-" + bsSize : false), cssModule);
7991 var validationClassNames = mapToCssModules(classnames(invalid && 'is-invalid', valid && 'is-valid'), cssModule);
7992 var labelHtmlFor = htmlFor || attributes.id;
7993
7994 if (type === 'select') {
7995 return React__default.createElement("select", _extends({}, attributes, {
7996 ref: innerRef,
7997 className: classnames(validationClassNames, customClass)
7998 }), children);
7999 }
8000
8001 if (type === 'file') {
8002 return React__default.createElement("div", {
8003 className: customClass
8004 }, React__default.createElement("input", _extends({}, attributes, {
8005 ref: innerRef,
8006 className: classnames(validationClassNames, mapToCssModules('custom-file-input', cssModule))
8007 })), React__default.createElement("label", {
8008 className: mapToCssModules('custom-file-label', cssModule),
8009 htmlFor: labelHtmlFor
8010 }, label || 'Choose file'));
8011 }
8012
8013 if (type !== 'checkbox' && type !== 'radio' && type !== 'switch') {
8014 return React__default.createElement("input", _extends({}, attributes, {
8015 ref: innerRef,
8016 className: classnames(validationClassNames, customClass)
8017 }));
8018 }
8019
8020 var wrapperClasses = classnames(customClass, mapToCssModules(classnames('custom-control', {
8021 'custom-control-inline': inline
8022 }), cssModule));
8023 return React__default.createElement("div", {
8024 className: wrapperClasses
8025 }, React__default.createElement("input", _extends({}, attributes, {
8026 type: type === 'switch' ? 'checkbox' : type,
8027 ref: innerRef,
8028 className: classnames(validationClassNames, mapToCssModules('custom-control-input', cssModule))
8029 })), React__default.createElement("label", {
8030 className: mapToCssModules('custom-control-label', cssModule),
8031 htmlFor: labelHtmlFor
8032 }, label), children);
8033 }
8034
8035 CustomInput.propTypes = propTypes$A;
8036
8037 function noop() {}
8038
8039 var propTypes$B = {
8040 children: propTypes.node.isRequired,
8041 popperClassName: propTypes.string,
8042 placement: propTypes.string,
8043 placementPrefix: propTypes.string,
8044 arrowClassName: propTypes.string,
8045 hideArrow: propTypes.bool,
8046 tag: tagPropType,
8047 isOpen: propTypes.bool.isRequired,
8048 cssModule: propTypes.object,
8049 offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
8050 fallbackPlacement: propTypes.oneOfType([propTypes.string, propTypes.array]),
8051 flip: propTypes.bool,
8052 container: targetPropType,
8053 target: targetPropType.isRequired,
8054 modifiers: propTypes.object,
8055 boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement]),
8056 onClosed: propTypes.func,
8057 fade: propTypes.bool,
8058 transition: propTypes.shape(Fade.propTypes)
8059 };
8060 var defaultProps$x = {
8061 boundariesElement: 'scrollParent',
8062 placement: 'auto',
8063 hideArrow: false,
8064 isOpen: false,
8065 offset: 0,
8066 fallbackPlacement: 'flip',
8067 flip: true,
8068 container: 'body',
8069 modifiers: {},
8070 onClosed: noop,
8071 fade: true,
8072 transition: _extends({}, Fade.defaultProps)
8073 };
8074
8075 var PopperContent =
8076 /*#__PURE__*/
8077 function (_React$Component) {
8078 _inheritsLoose(PopperContent, _React$Component);
8079
8080 function PopperContent(props) {
8081 var _this;
8082
8083 _this = _React$Component.call(this, props) || this;
8084 _this.handlePlacementChange = _this.handlePlacementChange.bind(_assertThisInitialized(_this));
8085 _this.setTargetNode = _this.setTargetNode.bind(_assertThisInitialized(_this));
8086 _this.getTargetNode = _this.getTargetNode.bind(_assertThisInitialized(_this));
8087 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
8088 _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
8089 _this.state = {
8090 isOpen: props.isOpen
8091 };
8092 return _this;
8093 }
8094
8095 PopperContent.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
8096 if (props.isOpen && !state.isOpen) {
8097 return {
8098 isOpen: props.isOpen
8099 };
8100 } else return null;
8101 };
8102
8103 var _proto = PopperContent.prototype;
8104
8105 _proto.componentDidUpdate = function componentDidUpdate() {
8106 if (this._element && this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) {
8107 this._element.childNodes[0].focus();
8108 }
8109 };
8110
8111 _proto.setTargetNode = function setTargetNode(node) {
8112 this.targetNode = node;
8113 };
8114
8115 _proto.getTargetNode = function getTargetNode() {
8116 return this.targetNode;
8117 };
8118
8119 _proto.getContainerNode = function getContainerNode() {
8120 return getTarget(this.props.container);
8121 };
8122
8123 _proto.getRef = function getRef(ref) {
8124 this._element = ref;
8125 };
8126
8127 _proto.handlePlacementChange = function handlePlacementChange(data) {
8128 if (this.state.placement !== data.placement) {
8129 this.setState({
8130 placement: data.placement
8131 });
8132 }
8133
8134 return data;
8135 };
8136
8137 _proto.onClosed = function onClosed() {
8138 this.props.onClosed();
8139 this.setState({
8140 isOpen: false
8141 });
8142 };
8143
8144 _proto.renderChildren = function renderChildren() {
8145 var _this$props = this.props,
8146 cssModule = _this$props.cssModule,
8147 children = _this$props.children,
8148 isOpen = _this$props.isOpen,
8149 flip = _this$props.flip,
8150 target = _this$props.target,
8151 offset = _this$props.offset,
8152 fallbackPlacement = _this$props.fallbackPlacement,
8153 placementPrefix = _this$props.placementPrefix,
8154 _arrowClassName = _this$props.arrowClassName,
8155 hideArrow = _this$props.hideArrow,
8156 _popperClassName = _this$props.popperClassName,
8157 tag = _this$props.tag,
8158 container = _this$props.container,
8159 modifiers = _this$props.modifiers,
8160 boundariesElement = _this$props.boundariesElement,
8161 onClosed = _this$props.onClosed,
8162 fade = _this$props.fade,
8163 transition = _this$props.transition,
8164 attrs = _objectWithoutPropertiesLoose(_this$props, ["cssModule", "children", "isOpen", "flip", "target", "offset", "fallbackPlacement", "placementPrefix", "arrowClassName", "hideArrow", "popperClassName", "tag", "container", "modifiers", "boundariesElement", "onClosed", "fade", "transition"]);
8165
8166 var arrowClassName = mapToCssModules(classnames('arrow', _arrowClassName), cssModule);
8167 var placement = this.state.placement || attrs.placement;
8168 var placementFirstPart = placement.split('-')[0];
8169 var popperClassName = mapToCssModules(classnames(_popperClassName, placementPrefix ? placementPrefix + "-" + placementFirstPart : placementFirstPart), this.props.cssModule);
8170
8171 var extendedModifiers = _extends({
8172 offset: {
8173 offset: offset
8174 },
8175 flip: {
8176 enabled: flip,
8177 behavior: fallbackPlacement
8178 },
8179 preventOverflow: {
8180 boundariesElement: boundariesElement
8181 },
8182 update: {
8183 enabled: true,
8184 order: 950,
8185 fn: this.handlePlacementChange
8186 }
8187 }, modifiers);
8188
8189 var popperTransition = _extends({}, Fade.defaultProps, transition, {
8190 baseClass: fade ? transition.baseClass : '',
8191 timeout: fade ? transition.timeout : 0
8192 });
8193
8194 return React__default.createElement(Fade, _extends({}, popperTransition, attrs, {
8195 in: isOpen,
8196 onExited: this.onClosed,
8197 tag: tag
8198 }), React__default.createElement(Popper$1, {
8199 referenceElement: this.targetNode,
8200 modifiers: extendedModifiers,
8201 placement: placement
8202 }, function (_ref) {
8203 var ref = _ref.ref,
8204 style = _ref.style,
8205 placement = _ref.placement,
8206 arrowProps = _ref.arrowProps;
8207 return React__default.createElement("div", {
8208 ref: ref,
8209 style: style,
8210 className: popperClassName,
8211 "x-placement": placement
8212 }, children, !hideArrow && React__default.createElement("span", {
8213 ref: arrowProps.ref,
8214 className: arrowClassName,
8215 style: arrowProps.style
8216 }));
8217 }));
8218 };
8219
8220 _proto.render = function render() {
8221 this.setTargetNode(getTarget(this.props.target));
8222
8223 if (this.state.isOpen) {
8224 return this.props.container === 'inline' ? this.renderChildren() : ReactDOM.createPortal(React__default.createElement("div", {
8225 ref: this.getRef
8226 }, this.renderChildren()), this.getContainerNode());
8227 }
8228
8229 return null;
8230 };
8231
8232 return PopperContent;
8233 }(React__default.Component);
8234
8235 PopperContent.propTypes = propTypes$B;
8236 PopperContent.defaultProps = defaultProps$x;
8237
8238 var PopperTargetHelper = function PopperTargetHelper(props, context) {
8239 context.popperManager.setTargetNode(getTarget(props.target));
8240 return null;
8241 };
8242
8243 PopperTargetHelper.contextTypes = {
8244 popperManager: propTypes.object.isRequired
8245 };
8246 PopperTargetHelper.propTypes = {
8247 target: targetPropType.isRequired
8248 };
8249
8250 var propTypes$C = {
8251 placement: propTypes.oneOf(PopperPlacements),
8252 target: targetPropType.isRequired,
8253 container: targetPropType,
8254 isOpen: propTypes.bool,
8255 disabled: propTypes.bool,
8256 hideArrow: propTypes.bool,
8257 boundariesElement: propTypes.oneOfType([propTypes.string, DOMElement]),
8258 className: propTypes.string,
8259 innerClassName: propTypes.string,
8260 arrowClassName: propTypes.string,
8261 popperClassName: propTypes.string,
8262 cssModule: propTypes.object,
8263 toggle: propTypes.func,
8264 autohide: propTypes.bool,
8265 placementPrefix: propTypes.string,
8266 delay: propTypes.oneOfType([propTypes.shape({
8267 show: propTypes.number,
8268 hide: propTypes.number
8269 }), propTypes.number]),
8270 modifiers: propTypes.object,
8271 offset: propTypes.oneOfType([propTypes.string, propTypes.number]),
8272 innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object]),
8273 trigger: propTypes.string,
8274 fade: propTypes.bool,
8275 flip: propTypes.bool
8276 };
8277 var DEFAULT_DELAYS = {
8278 show: 0,
8279 hide: 0
8280 };
8281 var defaultProps$y = {
8282 isOpen: false,
8283 hideArrow: false,
8284 autohide: false,
8285 delay: DEFAULT_DELAYS,
8286 toggle: function toggle() {},
8287 trigger: 'click',
8288 fade: true
8289 };
8290
8291 function isInDOMSubtree(element, subtreeRoot) {
8292 return subtreeRoot && (element === subtreeRoot || subtreeRoot.contains(element));
8293 }
8294
8295 var TooltipPopoverWrapper =
8296 /*#__PURE__*/
8297 function (_React$Component) {
8298 _inheritsLoose(TooltipPopoverWrapper, _React$Component);
8299
8300 function TooltipPopoverWrapper(props) {
8301 var _this;
8302
8303 _this = _React$Component.call(this, props) || this;
8304 _this._target = null;
8305 _this.addTargetEvents = _this.addTargetEvents.bind(_assertThisInitialized(_this));
8306 _this.handleDocumentClick = _this.handleDocumentClick.bind(_assertThisInitialized(_this));
8307 _this.removeTargetEvents = _this.removeTargetEvents.bind(_assertThisInitialized(_this));
8308 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
8309 _this.showWithDelay = _this.showWithDelay.bind(_assertThisInitialized(_this));
8310 _this.hideWithDelay = _this.hideWithDelay.bind(_assertThisInitialized(_this));
8311 _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_assertThisInitialized(_this));
8312 _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_assertThisInitialized(_this));
8313 _this.show = _this.show.bind(_assertThisInitialized(_this));
8314 _this.hide = _this.hide.bind(_assertThisInitialized(_this));
8315 _this.onEscKeyDown = _this.onEscKeyDown.bind(_assertThisInitialized(_this));
8316 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
8317 _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
8318 _this.state = {
8319 isOpen: props.isOpen
8320 };
8321 _this._isMounted = false;
8322 return _this;
8323 }
8324
8325 var _proto = TooltipPopoverWrapper.prototype;
8326
8327 _proto.componentDidMount = function componentDidMount() {
8328 this._isMounted = true;
8329 this.updateTarget();
8330 };
8331
8332 _proto.componentWillUnmount = function componentWillUnmount() {
8333 this._isMounted = false;
8334 this.removeTargetEvents();
8335 this.clearShowTimeout();
8336 this.clearHideTimeout();
8337 };
8338
8339 TooltipPopoverWrapper.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
8340 if (props.isOpen && !state.isOpen) {
8341 return {
8342 isOpen: props.isOpen
8343 };
8344 } else return null;
8345 };
8346
8347 _proto.onMouseOverTooltipContent = function onMouseOverTooltipContent() {
8348 if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
8349 if (this._hideTimeout) {
8350 this.clearHideTimeout();
8351 }
8352
8353 if (this.state.isOpen && !this.props.isOpen) {
8354 this.toggle();
8355 }
8356 }
8357 };
8358
8359 _proto.onMouseLeaveTooltipContent = function onMouseLeaveTooltipContent(e) {
8360 if (this.props.trigger.indexOf('hover') > -1 && !this.props.autohide) {
8361 if (this._showTimeout) {
8362 this.clearShowTimeout();
8363 }
8364
8365 e.persist();
8366 this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
8367 }
8368 };
8369
8370 _proto.onEscKeyDown = function onEscKeyDown(e) {
8371 if (e.key === 'Escape') {
8372 this.hide(e);
8373 }
8374 };
8375
8376 _proto.getRef = function getRef(ref) {
8377 var innerRef = this.props.innerRef;
8378
8379 if (innerRef) {
8380 if (typeof innerRef === 'function') {
8381 innerRef(ref);
8382 } else if (typeof innerRef === 'object') {
8383 innerRef.current = ref;
8384 }
8385 }
8386
8387 this._popover = ref;
8388 };
8389
8390 _proto.getDelay = function getDelay(key) {
8391 var delay = this.props.delay;
8392
8393 if (typeof delay === 'object') {
8394 return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key];
8395 }
8396
8397 return delay;
8398 };
8399
8400 _proto.show = function show(e) {
8401 if (!this.props.isOpen) {
8402 this.clearShowTimeout();
8403 this.toggle(e);
8404 }
8405 };
8406
8407 _proto.showWithDelay = function showWithDelay(e) {
8408 if (this._hideTimeout) {
8409 this.clearHideTimeout();
8410 }
8411
8412 this._showTimeout = setTimeout(this.show.bind(this, e), this.getDelay('show'));
8413 };
8414
8415 _proto.hide = function hide(e) {
8416 if (this.props.isOpen) {
8417 this.clearHideTimeout();
8418 this.toggle(e);
8419 }
8420 };
8421
8422 _proto.hideWithDelay = function hideWithDelay(e) {
8423 if (this._showTimeout) {
8424 this.clearShowTimeout();
8425 }
8426
8427 this._hideTimeout = setTimeout(this.hide.bind(this, e), this.getDelay('hide'));
8428 };
8429
8430 _proto.clearShowTimeout = function clearShowTimeout() {
8431 clearTimeout(this._showTimeout);
8432 this._showTimeout = undefined;
8433 };
8434
8435 _proto.clearHideTimeout = function clearHideTimeout() {
8436 clearTimeout(this._hideTimeout);
8437 this._hideTimeout = undefined;
8438 };
8439
8440 _proto.handleDocumentClick = function handleDocumentClick(e) {
8441 var triggers = this.props.trigger.split(' ');
8442
8443 if (triggers.indexOf('legacy') > -1 && (this.props.isOpen || isInDOMSubtree(e.target, this._target))) {
8444 if (this._hideTimeout) {
8445 this.clearHideTimeout();
8446 }
8447
8448 if (this.props.isOpen && !isInDOMSubtree(e.target, this._popover)) {
8449 this.hideWithDelay(e);
8450 } else if (!this.props.isOpen) {
8451 this.showWithDelay(e);
8452 }
8453 } else if (triggers.indexOf('click') > -1 && isInDOMSubtree(e.target, this._target)) {
8454 if (this._hideTimeout) {
8455 this.clearHideTimeout();
8456 }
8457
8458 if (!this.props.isOpen) {
8459 this.showWithDelay(e);
8460 } else {
8461 this.hideWithDelay(e);
8462 }
8463 }
8464 };
8465
8466 _proto.addTargetEvents = function addTargetEvents() {
8467 if (this.props.trigger) {
8468 var triggers = this.props.trigger.split(' ');
8469
8470 if (triggers.indexOf('manual') === -1) {
8471 if (triggers.indexOf('click') > -1 || triggers.indexOf('legacy') > -1) {
8472 document.addEventListener('click', this.handleDocumentClick, true);
8473 }
8474
8475 if (this._target) {
8476 if (triggers.indexOf('hover') > -1) {
8477 this._target.addEventListener('mouseover', this.showWithDelay, true);
8478
8479 this._target.addEventListener('mouseout', this.hideWithDelay, true);
8480 }
8481
8482 if (triggers.indexOf('focus') > -1) {
8483 this._target.addEventListener('focusin', this.show, true);
8484
8485 this._target.addEventListener('focusout', this.hide, true);
8486 }
8487
8488 this._target.addEventListener('keydown', this.onEscKeyDown, true);
8489 }
8490 }
8491 }
8492 };
8493
8494 _proto.removeTargetEvents = function removeTargetEvents() {
8495 if (this._target) {
8496 this._target.removeEventListener('mouseover', this.showWithDelay, true);
8497
8498 this._target.removeEventListener('mouseout', this.hideWithDelay, true);
8499
8500 this._target.removeEventListener('keydown', this.onEscKeyDown, true);
8501
8502 this._target.removeEventListener('focusin', this.show, true);
8503
8504 this._target.removeEventListener('focusout', this.hide, true);
8505 }
8506
8507 document.removeEventListener('click', this.handleDocumentClick, true);
8508 };
8509
8510 _proto.updateTarget = function updateTarget() {
8511 var newTarget = getTarget(this.props.target);
8512
8513 if (newTarget !== this._target) {
8514 this.removeTargetEvents();
8515 this._target = newTarget;
8516 this.addTargetEvents();
8517 }
8518 };
8519
8520 _proto.toggle = function toggle(e) {
8521 if (this.props.disabled || !this._isMounted) {
8522 return e && e.preventDefault();
8523 }
8524
8525 return this.props.toggle(e);
8526 };
8527
8528 _proto.onClosed = function onClosed() {
8529 this.setState({
8530 isOpen: false
8531 });
8532 };
8533
8534 _proto.render = function render() {
8535 if (!this.state.isOpen) {
8536 return null;
8537 }
8538
8539 this.updateTarget();
8540 var _this$props = this.props,
8541 className = _this$props.className,
8542 cssModule = _this$props.cssModule,
8543 innerClassName = _this$props.innerClassName,
8544 target = _this$props.target,
8545 isOpen = _this$props.isOpen,
8546 hideArrow = _this$props.hideArrow,
8547 boundariesElement = _this$props.boundariesElement,
8548 placement = _this$props.placement,
8549 placementPrefix = _this$props.placementPrefix,
8550 arrowClassName = _this$props.arrowClassName,
8551 popperClassName = _this$props.popperClassName,
8552 container = _this$props.container,
8553 modifiers = _this$props.modifiers,
8554 offset = _this$props.offset,
8555 fade = _this$props.fade,
8556 flip = _this$props.flip;
8557 var attributes = omit(this.props, Object.keys(propTypes$C));
8558 var popperClasses = mapToCssModules(popperClassName, cssModule);
8559 var classes = mapToCssModules(innerClassName, cssModule);
8560 return React__default.createElement(PopperContent, {
8561 className: className,
8562 target: target,
8563 isOpen: isOpen,
8564 hideArrow: hideArrow,
8565 boundariesElement: boundariesElement,
8566 placement: placement,
8567 placementPrefix: placementPrefix,
8568 arrowClassName: arrowClassName,
8569 popperClassName: popperClasses,
8570 container: container,
8571 modifiers: modifiers,
8572 offset: offset,
8573 cssModule: cssModule,
8574 onClosed: this.onClosed,
8575 fade: fade,
8576 flip: flip
8577 }, React__default.createElement("div", _extends({}, attributes, {
8578 ref: this.getRef,
8579 className: classes,
8580 role: "tooltip",
8581 "aria-hidden": isOpen,
8582 onMouseOver: this.onMouseOverTooltipContent,
8583 onMouseLeave: this.onMouseLeaveTooltipContent,
8584 onKeyDown: this.onEscKeyDown
8585 })));
8586 };
8587
8588 return TooltipPopoverWrapper;
8589 }(React__default.Component);
8590
8591 TooltipPopoverWrapper.propTypes = propTypes$C;
8592 TooltipPopoverWrapper.defaultProps = defaultProps$y;
8593
8594 var defaultProps$z = {
8595 placement: 'right',
8596 placementPrefix: 'bs-popover',
8597 trigger: 'click'
8598 };
8599
8600 var Popover = function Popover(props) {
8601 var popperClasses = classnames('popover', 'show');
8602 var classes = classnames('popover-inner', props.innerClassName);
8603 return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
8604 popperClassName: popperClasses,
8605 innerClassName: classes
8606 }));
8607 };
8608
8609 Popover.propTypes = propTypes$C;
8610 Popover.defaultProps = defaultProps$z;
8611
8612 var omitKeys = ['defaultOpen'];
8613
8614 var UncontrolledPopover =
8615 /*#__PURE__*/
8616 function (_Component) {
8617 _inheritsLoose(UncontrolledPopover, _Component);
8618
8619 function UncontrolledPopover(props) {
8620 var _this;
8621
8622 _this = _Component.call(this, props) || this;
8623 _this.state = {
8624 isOpen: props.defaultOpen || false
8625 };
8626 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
8627 return _this;
8628 }
8629
8630 var _proto = UncontrolledPopover.prototype;
8631
8632 _proto.toggle = function toggle() {
8633 this.setState({
8634 isOpen: !this.state.isOpen
8635 });
8636 };
8637
8638 _proto.render = function render() {
8639 return React__default.createElement(Popover, _extends({
8640 isOpen: this.state.isOpen,
8641 toggle: this.toggle
8642 }, omit(this.props, omitKeys)));
8643 };
8644
8645 return UncontrolledPopover;
8646 }(React.Component);
8647 UncontrolledPopover.propTypes = _extends({
8648 defaultOpen: propTypes.bool
8649 }, Popover.propTypes);
8650
8651 var propTypes$D = {
8652 tag: tagPropType,
8653 className: propTypes.string,
8654 cssModule: propTypes.object
8655 };
8656 var defaultProps$A = {
8657 tag: 'h3'
8658 };
8659
8660 var PopoverHeader = function PopoverHeader(props) {
8661 var className = props.className,
8662 cssModule = props.cssModule,
8663 Tag = props.tag,
8664 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8665
8666 var classes = mapToCssModules(classnames(className, 'popover-header'), cssModule);
8667 return React__default.createElement(Tag, _extends({}, attributes, {
8668 className: classes
8669 }));
8670 };
8671
8672 PopoverHeader.propTypes = propTypes$D;
8673 PopoverHeader.defaultProps = defaultProps$A;
8674
8675 var propTypes$E = {
8676 tag: tagPropType,
8677 className: propTypes.string,
8678 cssModule: propTypes.object
8679 };
8680 var defaultProps$B = {
8681 tag: 'div'
8682 };
8683
8684 var PopoverBody = function PopoverBody(props) {
8685 var className = props.className,
8686 cssModule = props.cssModule,
8687 Tag = props.tag,
8688 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
8689
8690 var classes = mapToCssModules(classnames(className, 'popover-body'), cssModule);
8691 return React__default.createElement(Tag, _extends({}, attributes, {
8692 className: classes
8693 }));
8694 };
8695
8696 PopoverBody.propTypes = propTypes$E;
8697 PopoverBody.defaultProps = defaultProps$B;
8698
8699 /**
8700 * lodash (Custom Build) <https://lodash.com/>
8701 * Build: `lodash modularize exports="npm" -o ./`
8702 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
8703 * Released under MIT license <https://lodash.com/license>
8704 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
8705 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8706 */
8707
8708 /** Used as references for various `Number` constants. */
8709 var NAN = 0 / 0;
8710 /** `Object#toString` result references. */
8711
8712 var symbolTag = '[object Symbol]';
8713 /** Used to match leading and trailing whitespace. */
8714
8715 var reTrim = /^\s+|\s+$/g;
8716 /** Used to detect bad signed hexadecimal string values. */
8717
8718 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
8719 /** Used to detect binary string values. */
8720
8721 var reIsBinary = /^0b[01]+$/i;
8722 /** Used to detect octal string values. */
8723
8724 var reIsOctal = /^0o[0-7]+$/i;
8725 /** Built-in method references without a dependency on `root`. */
8726
8727 var freeParseInt = parseInt;
8728 /** Used for built-in method references. */
8729
8730 var objectProto$1 = Object.prototype;
8731 /**
8732 * Used to resolve the
8733 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
8734 * of values.
8735 */
8736
8737 var objectToString$1 = objectProto$1.toString;
8738 /**
8739 * Checks if `value` is the
8740 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
8741 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
8742 *
8743 * @static
8744 * @memberOf _
8745 * @since 0.1.0
8746 * @category Lang
8747 * @param {*} value The value to check.
8748 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
8749 * @example
8750 *
8751 * _.isObject({});
8752 * // => true
8753 *
8754 * _.isObject([1, 2, 3]);
8755 * // => true
8756 *
8757 * _.isObject(_.noop);
8758 * // => true
8759 *
8760 * _.isObject(null);
8761 * // => false
8762 */
8763
8764 function isObject$2(value) {
8765 var type = typeof value;
8766 return !!value && (type == 'object' || type == 'function');
8767 }
8768 /**
8769 * Checks if `value` is object-like. A value is object-like if it's not `null`
8770 * and has a `typeof` result of "object".
8771 *
8772 * @static
8773 * @memberOf _
8774 * @since 4.0.0
8775 * @category Lang
8776 * @param {*} value The value to check.
8777 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
8778 * @example
8779 *
8780 * _.isObjectLike({});
8781 * // => true
8782 *
8783 * _.isObjectLike([1, 2, 3]);
8784 * // => true
8785 *
8786 * _.isObjectLike(_.noop);
8787 * // => false
8788 *
8789 * _.isObjectLike(null);
8790 * // => false
8791 */
8792
8793
8794 function isObjectLike(value) {
8795 return !!value && typeof value == 'object';
8796 }
8797 /**
8798 * Checks if `value` is classified as a `Symbol` primitive or object.
8799 *
8800 * @static
8801 * @memberOf _
8802 * @since 4.0.0
8803 * @category Lang
8804 * @param {*} value The value to check.
8805 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
8806 * @example
8807 *
8808 * _.isSymbol(Symbol.iterator);
8809 * // => true
8810 *
8811 * _.isSymbol('abc');
8812 * // => false
8813 */
8814
8815
8816 function isSymbol(value) {
8817 return typeof value == 'symbol' || isObjectLike(value) && objectToString$1.call(value) == symbolTag;
8818 }
8819 /**
8820 * Converts `value` to a number.
8821 *
8822 * @static
8823 * @memberOf _
8824 * @since 4.0.0
8825 * @category Lang
8826 * @param {*} value The value to process.
8827 * @returns {number} Returns the number.
8828 * @example
8829 *
8830 * _.toNumber(3.2);
8831 * // => 3.2
8832 *
8833 * _.toNumber(Number.MIN_VALUE);
8834 * // => 5e-324
8835 *
8836 * _.toNumber(Infinity);
8837 * // => Infinity
8838 *
8839 * _.toNumber('3.2');
8840 * // => 3.2
8841 */
8842
8843
8844 function toNumber(value) {
8845 if (typeof value == 'number') {
8846 return value;
8847 }
8848
8849 if (isSymbol(value)) {
8850 return NAN;
8851 }
8852
8853 if (isObject$2(value)) {
8854 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
8855 value = isObject$2(other) ? other + '' : other;
8856 }
8857
8858 if (typeof value != 'string') {
8859 return value === 0 ? value : +value;
8860 }
8861
8862 value = value.replace(reTrim, '');
8863 var isBinary = reIsBinary.test(value);
8864 return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
8865 }
8866
8867 var lodash_tonumber = toNumber;
8868
8869 var propTypes$F = {
8870 children: propTypes.node,
8871 bar: propTypes.bool,
8872 multi: propTypes.bool,
8873 tag: tagPropType,
8874 value: propTypes.oneOfType([propTypes.string, propTypes.number]),
8875 max: propTypes.oneOfType([propTypes.string, propTypes.number]),
8876 animated: propTypes.bool,
8877 striped: propTypes.bool,
8878 color: propTypes.string,
8879 className: propTypes.string,
8880 barClassName: propTypes.string,
8881 cssModule: propTypes.object
8882 };
8883 var defaultProps$C = {
8884 tag: 'div',
8885 value: 0,
8886 max: 100
8887 };
8888
8889 var Progress = function Progress(props) {
8890 var children = props.children,
8891 className = props.className,
8892 barClassName = props.barClassName,
8893 cssModule = props.cssModule,
8894 value = props.value,
8895 max = props.max,
8896 animated = props.animated,
8897 striped = props.striped,
8898 color = props.color,
8899 bar = props.bar,
8900 multi = props.multi,
8901 Tag = props.tag,
8902 attributes = _objectWithoutPropertiesLoose(props, ["children", "className", "barClassName", "cssModule", "value", "max", "animated", "striped", "color", "bar", "multi", "tag"]);
8903
8904 var percent = lodash_tonumber(value) / lodash_tonumber(max) * 100;
8905 var progressClasses = mapToCssModules(classnames(className, 'progress'), cssModule);
8906 var progressBarClasses = mapToCssModules(classnames('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? "bg-" + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule);
8907 var ProgressBar = multi ? children : React__default.createElement("div", {
8908 className: progressBarClasses,
8909 style: {
8910 width: percent + "%"
8911 },
8912 role: "progressbar",
8913 "aria-valuenow": value,
8914 "aria-valuemin": "0",
8915 "aria-valuemax": max,
8916 children: children
8917 });
8918
8919 if (bar) {
8920 return ProgressBar;
8921 }
8922
8923 return React__default.createElement(Tag, _extends({}, attributes, {
8924 className: progressClasses,
8925 children: ProgressBar
8926 }));
8927 };
8928
8929 Progress.propTypes = propTypes$F;
8930 Progress.defaultProps = defaultProps$C;
8931
8932 var propTypes$G = {
8933 children: propTypes.node.isRequired,
8934 node: propTypes.any
8935 };
8936
8937 var Portal =
8938 /*#__PURE__*/
8939 function (_React$Component) {
8940 _inheritsLoose(Portal, _React$Component);
8941
8942 function Portal() {
8943 return _React$Component.apply(this, arguments) || this;
8944 }
8945
8946 var _proto = Portal.prototype;
8947
8948 _proto.componentWillUnmount = function componentWillUnmount() {
8949 if (this.defaultNode) {
8950 document.body.removeChild(this.defaultNode);
8951 }
8952
8953 this.defaultNode = null;
8954 };
8955
8956 _proto.render = function render() {
8957 if (!canUseDOM) {
8958 return null;
8959 }
8960
8961 if (!this.props.node && !this.defaultNode) {
8962 this.defaultNode = document.createElement('div');
8963 document.body.appendChild(this.defaultNode);
8964 }
8965
8966 return ReactDOM.createPortal(this.props.children, this.props.node || this.defaultNode);
8967 };
8968
8969 return Portal;
8970 }(React__default.Component);
8971
8972 Portal.propTypes = propTypes$G;
8973
8974 function noop$1() {}
8975
8976 var FadePropTypes = propTypes.shape(Fade.propTypes);
8977 var propTypes$H = {
8978 isOpen: propTypes.bool,
8979 autoFocus: propTypes.bool,
8980 centered: propTypes.bool,
8981 scrollable: propTypes.bool,
8982 size: propTypes.string,
8983 toggle: propTypes.func,
8984 keyboard: propTypes.bool,
8985 role: propTypes.string,
8986 labelledBy: propTypes.string,
8987 backdrop: propTypes.oneOfType([propTypes.bool, propTypes.oneOf(['static'])]),
8988 onEnter: propTypes.func,
8989 onExit: propTypes.func,
8990 onOpened: propTypes.func,
8991 onClosed: propTypes.func,
8992 children: propTypes.node,
8993 className: propTypes.string,
8994 wrapClassName: propTypes.string,
8995 modalClassName: propTypes.string,
8996 backdropClassName: propTypes.string,
8997 contentClassName: propTypes.string,
8998 external: propTypes.node,
8999 fade: propTypes.bool,
9000 cssModule: propTypes.object,
9001 zIndex: propTypes.oneOfType([propTypes.number, propTypes.string]),
9002 backdropTransition: FadePropTypes,
9003 modalTransition: FadePropTypes,
9004 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func]),
9005 unmountOnClose: propTypes.bool,
9006 returnFocusAfterClose: propTypes.bool
9007 };
9008 var propsToOmit = Object.keys(propTypes$H);
9009 var defaultProps$D = {
9010 isOpen: false,
9011 autoFocus: true,
9012 centered: false,
9013 scrollable: false,
9014 role: 'dialog',
9015 backdrop: true,
9016 keyboard: true,
9017 zIndex: 1050,
9018 fade: true,
9019 onOpened: noop$1,
9020 onClosed: noop$1,
9021 modalTransition: {
9022 timeout: TransitionTimeouts.Modal
9023 },
9024 backdropTransition: {
9025 mountOnEnter: true,
9026 timeout: TransitionTimeouts.Fade // uses standard fade transition
9027
9028 },
9029 unmountOnClose: true,
9030 returnFocusAfterClose: true
9031 };
9032
9033 var Modal =
9034 /*#__PURE__*/
9035 function (_React$Component) {
9036 _inheritsLoose(Modal, _React$Component);
9037
9038 function Modal(props) {
9039 var _this;
9040
9041 _this = _React$Component.call(this, props) || this;
9042 _this._element = null;
9043 _this._originalBodyPadding = null;
9044 _this.getFocusableChildren = _this.getFocusableChildren.bind(_assertThisInitialized(_this));
9045 _this.handleBackdropClick = _this.handleBackdropClick.bind(_assertThisInitialized(_this));
9046 _this.handleBackdropMouseDown = _this.handleBackdropMouseDown.bind(_assertThisInitialized(_this));
9047 _this.handleEscape = _this.handleEscape.bind(_assertThisInitialized(_this));
9048 _this.handleTab = _this.handleTab.bind(_assertThisInitialized(_this));
9049 _this.onOpened = _this.onOpened.bind(_assertThisInitialized(_this));
9050 _this.onClosed = _this.onClosed.bind(_assertThisInitialized(_this));
9051 _this.manageFocusAfterClose = _this.manageFocusAfterClose.bind(_assertThisInitialized(_this));
9052 _this.state = {
9053 isOpen: false
9054 };
9055 return _this;
9056 }
9057
9058 var _proto = Modal.prototype;
9059
9060 _proto.componentDidMount = function componentDidMount() {
9061 var _this$props = this.props,
9062 isOpen = _this$props.isOpen,
9063 autoFocus = _this$props.autoFocus,
9064 onEnter = _this$props.onEnter;
9065
9066 if (isOpen) {
9067 this.init();
9068 this.setState({
9069 isOpen: true
9070 });
9071
9072 if (autoFocus) {
9073 this.setFocus();
9074 }
9075 }
9076
9077 if (onEnter) {
9078 onEnter();
9079 }
9080
9081 this._isMounted = true;
9082 };
9083
9084 _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
9085 if (this.props.isOpen && !prevProps.isOpen) {
9086 this.init();
9087 this.setState({
9088 isOpen: true
9089 }); // let render() renders Modal Dialog first
9090
9091 return;
9092 } // now Modal Dialog is rendered and we can refer this._element and this._dialog
9093
9094
9095 if (this.props.autoFocus && this.state.isOpen && !prevState.isOpen) {
9096 this.setFocus();
9097 }
9098
9099 if (this._element && prevProps.zIndex !== this.props.zIndex) {
9100 this._element.style.zIndex = this.props.zIndex;
9101 }
9102 };
9103
9104 _proto.componentWillUnmount = function componentWillUnmount() {
9105 if (this.props.onExit) {
9106 this.props.onExit();
9107 }
9108
9109 if (this._element) {
9110 this.destroy();
9111
9112 if (this.state.isOpen) {
9113 this.close();
9114 }
9115 }
9116
9117 this._isMounted = false;
9118 };
9119
9120 _proto.onOpened = function onOpened(node, isAppearing) {
9121 this.props.onOpened();
9122 (this.props.modalTransition.onEntered || noop$1)(node, isAppearing);
9123 };
9124
9125 _proto.onClosed = function onClosed(node) {
9126 var unmountOnClose = this.props.unmountOnClose; // so all methods get called before it is unmounted
9127
9128 this.props.onClosed();
9129 (this.props.modalTransition.onExited || noop$1)(node);
9130
9131 if (unmountOnClose) {
9132 this.destroy();
9133 }
9134
9135 this.close();
9136
9137 if (this._isMounted) {
9138 this.setState({
9139 isOpen: false
9140 });
9141 }
9142 };
9143
9144 _proto.setFocus = function setFocus() {
9145 if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') {
9146 this._dialog.parentNode.focus();
9147 }
9148 };
9149
9150 _proto.getFocusableChildren = function getFocusableChildren() {
9151 return this._element.querySelectorAll(focusableElements.join(', '));
9152 };
9153
9154 _proto.getFocusedChild = function getFocusedChild() {
9155 var currentFocus;
9156 var focusableChildren = this.getFocusableChildren();
9157
9158 try {
9159 currentFocus = document.activeElement;
9160 } catch (err) {
9161 currentFocus = focusableChildren[0];
9162 }
9163
9164 return currentFocus;
9165 } // not mouseUp because scrollbar fires it, shouldn't close when user scrolls
9166 ;
9167
9168 _proto.handleBackdropClick = function handleBackdropClick(e) {
9169 if (e.target === this._mouseDownElement) {
9170 e.stopPropagation();
9171 if (!this.props.isOpen || this.props.backdrop !== true) return;
9172 var backdrop = this._dialog ? this._dialog.parentNode : null;
9173
9174 if (backdrop && e.target === backdrop && this.props.toggle) {
9175 this.props.toggle(e);
9176 }
9177 }
9178 };
9179
9180 _proto.handleTab = function handleTab(e) {
9181 if (e.which !== 9) return;
9182 var focusableChildren = this.getFocusableChildren();
9183 var totalFocusable = focusableChildren.length;
9184 if (totalFocusable === 0) return;
9185 var currentFocus = this.getFocusedChild();
9186 var focusedIndex = 0;
9187
9188 for (var i = 0; i < totalFocusable; i += 1) {
9189 if (focusableChildren[i] === currentFocus) {
9190 focusedIndex = i;
9191 break;
9192 }
9193 }
9194
9195 if (e.shiftKey && focusedIndex === 0) {
9196 e.preventDefault();
9197 focusableChildren[totalFocusable - 1].focus();
9198 } else if (!e.shiftKey && focusedIndex === totalFocusable - 1) {
9199 e.preventDefault();
9200 focusableChildren[0].focus();
9201 }
9202 };
9203
9204 _proto.handleBackdropMouseDown = function handleBackdropMouseDown(e) {
9205 this._mouseDownElement = e.target;
9206 };
9207
9208 _proto.handleEscape = function handleEscape(e) {
9209 if (this.props.isOpen && this.props.keyboard && e.keyCode === 27 && this.props.toggle) {
9210 e.preventDefault();
9211 e.stopPropagation();
9212 this.props.toggle(e);
9213 }
9214 };
9215
9216 _proto.init = function init() {
9217 try {
9218 this._triggeringElement = document.activeElement;
9219 } catch (err) {
9220 this._triggeringElement = null;
9221 }
9222
9223 if (!this._element) {
9224 this._element = document.createElement('div');
9225
9226 this._element.setAttribute('tabindex', '-1');
9227
9228 this._element.style.position = 'relative';
9229 this._element.style.zIndex = this.props.zIndex;
9230 document.body.appendChild(this._element);
9231 }
9232
9233 this._originalBodyPadding = getOriginalBodyPadding();
9234 conditionallyUpdateScrollbar();
9235
9236 if (Modal.openCount === 0) {
9237 document.body.className = classnames(document.body.className, mapToCssModules('modal-open', this.props.cssModule));
9238 }
9239
9240 Modal.openCount += 1;
9241 };
9242
9243 _proto.destroy = function destroy() {
9244 if (this._element) {
9245 document.body.removeChild(this._element);
9246 this._element = null;
9247 }
9248
9249 this.manageFocusAfterClose();
9250 };
9251
9252 _proto.manageFocusAfterClose = function manageFocusAfterClose() {
9253 if (this._triggeringElement) {
9254 var returnFocusAfterClose = this.props.returnFocusAfterClose;
9255 if (this._triggeringElement.focus && returnFocusAfterClose) this._triggeringElement.focus();
9256 this._triggeringElement = null;
9257 }
9258 };
9259
9260 _proto.close = function close() {
9261 if (Modal.openCount <= 1) {
9262 var modalOpenClassName = mapToCssModules('modal-open', this.props.cssModule); // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened`
9263
9264 var modalOpenClassNameRegex = new RegExp("(^| )" + modalOpenClassName + "( |$)");
9265 document.body.className = document.body.className.replace(modalOpenClassNameRegex, ' ').trim();
9266 }
9267
9268 this.manageFocusAfterClose();
9269 Modal.openCount = Math.max(0, Modal.openCount - 1);
9270 setScrollbarWidth(this._originalBodyPadding);
9271 };
9272
9273 _proto.renderModalDialog = function renderModalDialog() {
9274 var _classNames,
9275 _this2 = this;
9276
9277 var attributes = omit(this.props, propsToOmit);
9278 var dialogBaseClass = 'modal-dialog';
9279 return React__default.createElement("div", _extends({}, attributes, {
9280 className: mapToCssModules(classnames(dialogBaseClass, this.props.className, (_classNames = {}, _classNames["modal-" + this.props.size] = this.props.size, _classNames[dialogBaseClass + "-centered"] = this.props.centered, _classNames[dialogBaseClass + "-scrollable"] = this.props.scrollable, _classNames)), this.props.cssModule),
9281 role: "document",
9282 ref: function ref(c) {
9283 _this2._dialog = c;
9284 }
9285 }), React__default.createElement("div", {
9286 className: mapToCssModules(classnames('modal-content', this.props.contentClassName), this.props.cssModule)
9287 }, this.props.children));
9288 };
9289
9290 _proto.render = function render() {
9291 var unmountOnClose = this.props.unmountOnClose;
9292
9293 if (!!this._element && (this.state.isOpen || !unmountOnClose)) {
9294 var isModalHidden = !!this._element && !this.state.isOpen && !unmountOnClose;
9295 this._element.style.display = isModalHidden ? 'none' : 'block';
9296 var _this$props2 = this.props,
9297 wrapClassName = _this$props2.wrapClassName,
9298 modalClassName = _this$props2.modalClassName,
9299 backdropClassName = _this$props2.backdropClassName,
9300 cssModule = _this$props2.cssModule,
9301 isOpen = _this$props2.isOpen,
9302 backdrop = _this$props2.backdrop,
9303 role = _this$props2.role,
9304 labelledBy = _this$props2.labelledBy,
9305 external = _this$props2.external,
9306 innerRef = _this$props2.innerRef;
9307 var modalAttributes = {
9308 onClick: this.handleBackdropClick,
9309 onMouseDown: this.handleBackdropMouseDown,
9310 onKeyUp: this.handleEscape,
9311 onKeyDown: this.handleTab,
9312 style: {
9313 display: 'block'
9314 },
9315 'aria-labelledby': labelledBy,
9316 role: role,
9317 tabIndex: '-1'
9318 };
9319 var hasTransition = this.props.fade;
9320
9321 var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, {
9322 baseClass: hasTransition ? this.props.modalTransition.baseClass : '',
9323 timeout: hasTransition ? this.props.modalTransition.timeout : 0
9324 });
9325
9326 var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, {
9327 baseClass: hasTransition ? this.props.backdropTransition.baseClass : '',
9328 timeout: hasTransition ? this.props.backdropTransition.timeout : 0
9329 });
9330
9331 var Backdrop = backdrop && (hasTransition ? React__default.createElement(Fade, _extends({}, backdropTransition, {
9332 in: isOpen && !!backdrop,
9333 cssModule: cssModule,
9334 className: mapToCssModules(classnames('modal-backdrop', backdropClassName), cssModule)
9335 })) : React__default.createElement("div", {
9336 className: mapToCssModules(classnames('modal-backdrop', 'show', backdropClassName), cssModule)
9337 }));
9338 return React__default.createElement(Portal, {
9339 node: this._element
9340 }, React__default.createElement("div", {
9341 className: mapToCssModules(wrapClassName)
9342 }, React__default.createElement(Fade, _extends({}, modalAttributes, modalTransition, {
9343 in: isOpen,
9344 onEntered: this.onOpened,
9345 onExited: this.onClosed,
9346 cssModule: cssModule,
9347 className: mapToCssModules(classnames('modal', modalClassName), cssModule),
9348 innerRef: innerRef
9349 }), external, this.renderModalDialog()), Backdrop));
9350 }
9351
9352 return null;
9353 };
9354
9355 return Modal;
9356 }(React__default.Component);
9357
9358 Modal.propTypes = propTypes$H;
9359 Modal.defaultProps = defaultProps$D;
9360 Modal.openCount = 0;
9361
9362 var propTypes$I = {
9363 tag: tagPropType,
9364 wrapTag: tagPropType,
9365 toggle: propTypes.func,
9366 className: propTypes.string,
9367 cssModule: propTypes.object,
9368 children: propTypes.node,
9369 closeAriaLabel: propTypes.string,
9370 charCode: propTypes.oneOfType([propTypes.string, propTypes.number]),
9371 close: propTypes.object
9372 };
9373 var defaultProps$E = {
9374 tag: 'h5',
9375 wrapTag: 'div',
9376 closeAriaLabel: 'Close',
9377 charCode: 215
9378 };
9379
9380 var ModalHeader = function ModalHeader(props) {
9381 var closeButton;
9382
9383 var className = props.className,
9384 cssModule = props.cssModule,
9385 children = props.children,
9386 toggle = props.toggle,
9387 Tag = props.tag,
9388 WrapTag = props.wrapTag,
9389 closeAriaLabel = props.closeAriaLabel,
9390 charCode = props.charCode,
9391 close = props.close,
9392 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close"]);
9393
9394 var classes = mapToCssModules(classnames(className, 'modal-header'), cssModule);
9395
9396 if (!close && toggle) {
9397 var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
9398 closeButton = React__default.createElement("button", {
9399 type: "button",
9400 onClick: toggle,
9401 className: mapToCssModules('close', cssModule),
9402 "aria-label": closeAriaLabel
9403 }, React__default.createElement("span", {
9404 "aria-hidden": "true"
9405 }, closeIcon));
9406 }
9407
9408 return React__default.createElement(WrapTag, _extends({}, attributes, {
9409 className: classes
9410 }), React__default.createElement(Tag, {
9411 className: mapToCssModules('modal-title', cssModule)
9412 }, children), close || closeButton);
9413 };
9414
9415 ModalHeader.propTypes = propTypes$I;
9416 ModalHeader.defaultProps = defaultProps$E;
9417
9418 var propTypes$J = {
9419 tag: tagPropType,
9420 className: propTypes.string,
9421 cssModule: propTypes.object
9422 };
9423 var defaultProps$F = {
9424 tag: 'div'
9425 };
9426
9427 var ModalBody = function ModalBody(props) {
9428 var className = props.className,
9429 cssModule = props.cssModule,
9430 Tag = props.tag,
9431 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
9432
9433 var classes = mapToCssModules(classnames(className, 'modal-body'), cssModule);
9434 return React__default.createElement(Tag, _extends({}, attributes, {
9435 className: classes
9436 }));
9437 };
9438
9439 ModalBody.propTypes = propTypes$J;
9440 ModalBody.defaultProps = defaultProps$F;
9441
9442 var propTypes$K = {
9443 tag: tagPropType,
9444 className: propTypes.string,
9445 cssModule: propTypes.object
9446 };
9447 var defaultProps$G = {
9448 tag: 'div'
9449 };
9450
9451 var ModalFooter = function ModalFooter(props) {
9452 var className = props.className,
9453 cssModule = props.cssModule,
9454 Tag = props.tag,
9455 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
9456
9457 var classes = mapToCssModules(classnames(className, 'modal-footer'), cssModule);
9458 return React__default.createElement(Tag, _extends({}, attributes, {
9459 className: classes
9460 }));
9461 };
9462
9463 ModalFooter.propTypes = propTypes$K;
9464 ModalFooter.defaultProps = defaultProps$G;
9465
9466 var defaultProps$H = {
9467 placement: 'top',
9468 autohide: true,
9469 placementPrefix: 'bs-tooltip',
9470 trigger: 'click hover focus'
9471 };
9472
9473 var Tooltip = function Tooltip(props) {
9474 var popperClasses = classnames('tooltip', 'show');
9475 var classes = classnames('tooltip-inner', props.innerClassName);
9476 return React__default.createElement(TooltipPopoverWrapper, _extends({}, props, {
9477 popperClassName: popperClasses,
9478 innerClassName: classes
9479 }));
9480 };
9481
9482 Tooltip.propTypes = propTypes$C;
9483 Tooltip.defaultProps = defaultProps$H;
9484
9485 var propTypes$L = {
9486 className: propTypes.string,
9487 cssModule: propTypes.object,
9488 size: propTypes.string,
9489 bordered: propTypes.bool,
9490 borderless: propTypes.bool,
9491 striped: propTypes.bool,
9492 dark: propTypes.bool,
9493 hover: propTypes.bool,
9494 responsive: propTypes.oneOfType([propTypes.bool, propTypes.string]),
9495 tag: tagPropType,
9496 responsiveTag: tagPropType,
9497 innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
9498 };
9499 var defaultProps$I = {
9500 tag: 'table',
9501 responsiveTag: 'div'
9502 };
9503
9504 var Table = function Table(props) {
9505 var className = props.className,
9506 cssModule = props.cssModule,
9507 size = props.size,
9508 bordered = props.bordered,
9509 borderless = props.borderless,
9510 striped = props.striped,
9511 dark = props.dark,
9512 hover = props.hover,
9513 responsive = props.responsive,
9514 Tag = props.tag,
9515 ResponsiveTag = props.responsiveTag,
9516 innerRef = props.innerRef,
9517 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "size", "bordered", "borderless", "striped", "dark", "hover", "responsive", "tag", "responsiveTag", "innerRef"]);
9518
9519 var classes = mapToCssModules(classnames(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, borderless ? 'table-borderless' : false, striped ? 'table-striped' : false, dark ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule);
9520 var table = React__default.createElement(Tag, _extends({}, attributes, {
9521 ref: innerRef,
9522 className: classes
9523 }));
9524
9525 if (responsive) {
9526 var responsiveClassName = mapToCssModules(responsive === true ? 'table-responsive' : "table-responsive-" + responsive, cssModule);
9527 return React__default.createElement(ResponsiveTag, {
9528 className: responsiveClassName
9529 }, table);
9530 }
9531
9532 return table;
9533 };
9534
9535 Table.propTypes = propTypes$L;
9536 Table.defaultProps = defaultProps$I;
9537
9538 var propTypes$M = {
9539 tag: tagPropType,
9540 flush: propTypes.bool,
9541 className: propTypes.string,
9542 cssModule: propTypes.object
9543 };
9544 var defaultProps$J = {
9545 tag: 'ul'
9546 };
9547
9548 var ListGroup = function ListGroup(props) {
9549 var className = props.className,
9550 cssModule = props.cssModule,
9551 Tag = props.tag,
9552 flush = props.flush,
9553 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "flush"]);
9554
9555 var classes = mapToCssModules(classnames(className, 'list-group', flush ? 'list-group-flush' : false), cssModule);
9556 return React__default.createElement(Tag, _extends({}, attributes, {
9557 className: classes
9558 }));
9559 };
9560
9561 ListGroup.propTypes = propTypes$M;
9562 ListGroup.defaultProps = defaultProps$J;
9563
9564 var propTypes$N = {
9565 children: propTypes.node,
9566 inline: propTypes.bool,
9567 tag: tagPropType,
9568 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
9569 className: propTypes.string,
9570 cssModule: propTypes.object
9571 };
9572 var defaultProps$K = {
9573 tag: 'form'
9574 };
9575
9576 var Form =
9577 /*#__PURE__*/
9578 function (_Component) {
9579 _inheritsLoose(Form, _Component);
9580
9581 function Form(props) {
9582 var _this;
9583
9584 _this = _Component.call(this, props) || this;
9585 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
9586 _this.submit = _this.submit.bind(_assertThisInitialized(_this));
9587 return _this;
9588 }
9589
9590 var _proto = Form.prototype;
9591
9592 _proto.getRef = function getRef(ref) {
9593 if (this.props.innerRef) {
9594 this.props.innerRef(ref);
9595 }
9596
9597 this.ref = ref;
9598 };
9599
9600 _proto.submit = function submit() {
9601 if (this.ref) {
9602 this.ref.submit();
9603 }
9604 };
9605
9606 _proto.render = function render() {
9607 var _this$props = this.props,
9608 className = _this$props.className,
9609 cssModule = _this$props.cssModule,
9610 inline = _this$props.inline,
9611 Tag = _this$props.tag,
9612 innerRef = _this$props.innerRef,
9613 attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "inline", "tag", "innerRef"]);
9614
9615 var classes = mapToCssModules(classnames(className, inline ? 'form-inline' : false), cssModule);
9616 return React__default.createElement(Tag, _extends({}, attributes, {
9617 ref: innerRef,
9618 className: classes
9619 }));
9620 };
9621
9622 return Form;
9623 }(React.Component);
9624
9625 Form.propTypes = propTypes$N;
9626 Form.defaultProps = defaultProps$K;
9627
9628 var propTypes$O = {
9629 children: propTypes.node,
9630 tag: tagPropType,
9631 className: propTypes.string,
9632 cssModule: propTypes.object,
9633 valid: propTypes.bool,
9634 tooltip: propTypes.bool
9635 };
9636 var defaultProps$L = {
9637 tag: 'div',
9638 valid: undefined
9639 };
9640
9641 var FormFeedback = function FormFeedback(props) {
9642 var className = props.className,
9643 cssModule = props.cssModule,
9644 valid = props.valid,
9645 tooltip = props.tooltip,
9646 Tag = props.tag,
9647 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "valid", "tooltip", "tag"]);
9648
9649 var validMode = tooltip ? 'tooltip' : 'feedback';
9650 var classes = mapToCssModules(classnames(className, valid ? "valid-" + validMode : "invalid-" + validMode), cssModule);
9651 return React__default.createElement(Tag, _extends({}, attributes, {
9652 className: classes
9653 }));
9654 };
9655
9656 FormFeedback.propTypes = propTypes$O;
9657 FormFeedback.defaultProps = defaultProps$L;
9658
9659 var propTypes$P = {
9660 children: propTypes.node,
9661 row: propTypes.bool,
9662 check: propTypes.bool,
9663 inline: propTypes.bool,
9664 disabled: propTypes.bool,
9665 tag: tagPropType,
9666 className: propTypes.string,
9667 cssModule: propTypes.object
9668 };
9669 var defaultProps$M = {
9670 tag: 'div'
9671 };
9672
9673 var FormGroup = function FormGroup(props) {
9674 var className = props.className,
9675 cssModule = props.cssModule,
9676 row = props.row,
9677 disabled = props.disabled,
9678 check = props.check,
9679 inline = props.inline,
9680 Tag = props.tag,
9681 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "row", "disabled", "check", "inline", "tag"]);
9682
9683 var classes = mapToCssModules(classnames(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule);
9684
9685 if (Tag === 'fieldset') {
9686 attributes.disabled = disabled;
9687 }
9688
9689 return React__default.createElement(Tag, _extends({}, attributes, {
9690 className: classes
9691 }));
9692 };
9693
9694 FormGroup.propTypes = propTypes$P;
9695 FormGroup.defaultProps = defaultProps$M;
9696
9697 var propTypes$Q = {
9698 children: propTypes.node,
9699 inline: propTypes.bool,
9700 tag: tagPropType,
9701 color: propTypes.string,
9702 className: propTypes.string,
9703 cssModule: propTypes.object
9704 };
9705 var defaultProps$N = {
9706 tag: 'small',
9707 color: 'muted'
9708 };
9709
9710 var FormText = function FormText(props) {
9711 var className = props.className,
9712 cssModule = props.cssModule,
9713 inline = props.inline,
9714 color = props.color,
9715 Tag = props.tag,
9716 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "inline", "color", "tag"]);
9717
9718 var classes = mapToCssModules(classnames(className, !inline ? 'form-text' : false, color ? "text-" + color : false), cssModule);
9719 return React__default.createElement(Tag, _extends({}, attributes, {
9720 className: classes
9721 }));
9722 };
9723
9724 FormText.propTypes = propTypes$Q;
9725 FormText.defaultProps = defaultProps$N;
9726
9727 var propTypes$R = {
9728 children: propTypes.node,
9729 type: propTypes.string,
9730 size: propTypes.string,
9731 bsSize: propTypes.string,
9732 valid: propTypes.bool,
9733 invalid: propTypes.bool,
9734 tag: tagPropType,
9735 innerRef: propTypes.oneOfType([propTypes.object, propTypes.func, propTypes.string]),
9736 plaintext: propTypes.bool,
9737 addon: propTypes.bool,
9738 className: propTypes.string,
9739 cssModule: propTypes.object
9740 };
9741 var defaultProps$O = {
9742 type: 'text'
9743 };
9744
9745 var Input =
9746 /*#__PURE__*/
9747 function (_React$Component) {
9748 _inheritsLoose(Input, _React$Component);
9749
9750 function Input(props) {
9751 var _this;
9752
9753 _this = _React$Component.call(this, props) || this;
9754 _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
9755 _this.focus = _this.focus.bind(_assertThisInitialized(_this));
9756 return _this;
9757 }
9758
9759 var _proto = Input.prototype;
9760
9761 _proto.getRef = function getRef(ref) {
9762 if (this.props.innerRef) {
9763 this.props.innerRef(ref);
9764 }
9765
9766 this.ref = ref;
9767 };
9768
9769 _proto.focus = function focus() {
9770 if (this.ref) {
9771 this.ref.focus();
9772 }
9773 };
9774
9775 _proto.render = function render() {
9776 var _this$props = this.props,
9777 className = _this$props.className,
9778 cssModule = _this$props.cssModule,
9779 type = _this$props.type,
9780 bsSize = _this$props.bsSize,
9781 valid = _this$props.valid,
9782 invalid = _this$props.invalid,
9783 tag = _this$props.tag,
9784 addon = _this$props.addon,
9785 plaintext = _this$props.plaintext,
9786 innerRef = _this$props.innerRef,
9787 attributes = _objectWithoutPropertiesLoose(_this$props, ["className", "cssModule", "type", "bsSize", "valid", "invalid", "tag", "addon", "plaintext", "innerRef"]);
9788
9789 var checkInput = ['radio', 'checkbox'].indexOf(type) > -1;
9790 var isNotaNumber = new RegExp('\\D', 'g');
9791 var fileInput = type === 'file';
9792 var textareaInput = type === 'textarea';
9793 var selectInput = type === 'select';
9794 var Tag = tag || (selectInput || textareaInput ? type : 'input');
9795 var formControlClass = 'form-control';
9796
9797 if (plaintext) {
9798 formControlClass = formControlClass + "-plaintext";
9799 Tag = tag || 'input';
9800 } else if (fileInput) {
9801 formControlClass = formControlClass + "-file";
9802 } else if (checkInput) {
9803 if (addon) {
9804 formControlClass = null;
9805 } else {
9806 formControlClass = 'form-check-input';
9807 }
9808 }
9809
9810 if (attributes.size && isNotaNumber.test(attributes.size)) {
9811 warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.');
9812 bsSize = attributes.size;
9813 delete attributes.size;
9814 }
9815
9816 var classes = mapToCssModules(classnames(className, invalid && 'is-invalid', valid && 'is-valid', bsSize ? "form-control-" + bsSize : false, formControlClass), cssModule);
9817
9818 if (Tag === 'input' || tag && typeof tag === 'function') {
9819 attributes.type = type;
9820 }
9821
9822 if (attributes.children && !(plaintext || type === 'select' || typeof Tag !== 'string' || Tag === 'select')) {
9823 warnOnce("Input with a type of \"" + type + "\" cannot have children. Please use \"value\"/\"defaultValue\" instead.");
9824 delete attributes.children;
9825 }
9826
9827 return React__default.createElement(Tag, _extends({}, attributes, {
9828 ref: innerRef,
9829 className: classes
9830 }));
9831 };
9832
9833 return Input;
9834 }(React__default.Component);
9835
9836 Input.propTypes = propTypes$R;
9837 Input.defaultProps = defaultProps$O;
9838
9839 var propTypes$S = {
9840 tag: tagPropType,
9841 size: propTypes.string,
9842 className: propTypes.string,
9843 cssModule: propTypes.object
9844 };
9845 var defaultProps$P = {
9846 tag: 'div'
9847 };
9848
9849 var InputGroup = function InputGroup(props) {
9850 var className = props.className,
9851 cssModule = props.cssModule,
9852 Tag = props.tag,
9853 size = props.size,
9854 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "size"]);
9855
9856 var classes = mapToCssModules(classnames(className, 'input-group', size ? "input-group-" + size : null), cssModule);
9857 return React__default.createElement(Tag, _extends({}, attributes, {
9858 className: classes
9859 }));
9860 };
9861
9862 InputGroup.propTypes = propTypes$S;
9863 InputGroup.defaultProps = defaultProps$P;
9864
9865 var propTypes$T = {
9866 tag: tagPropType,
9867 className: propTypes.string,
9868 cssModule: propTypes.object
9869 };
9870 var defaultProps$Q = {
9871 tag: 'span'
9872 };
9873
9874 var InputGroupText = function InputGroupText(props) {
9875 var className = props.className,
9876 cssModule = props.cssModule,
9877 Tag = props.tag,
9878 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
9879
9880 var classes = mapToCssModules(classnames(className, 'input-group-text'), cssModule);
9881 return React__default.createElement(Tag, _extends({}, attributes, {
9882 className: classes
9883 }));
9884 };
9885
9886 InputGroupText.propTypes = propTypes$T;
9887 InputGroupText.defaultProps = defaultProps$Q;
9888
9889 var propTypes$U = {
9890 tag: tagPropType,
9891 addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
9892 children: propTypes.node,
9893 className: propTypes.string,
9894 cssModule: propTypes.object
9895 };
9896 var defaultProps$R = {
9897 tag: 'div'
9898 };
9899
9900 var InputGroupAddon = function InputGroupAddon(props) {
9901 var className = props.className,
9902 cssModule = props.cssModule,
9903 Tag = props.tag,
9904 addonType = props.addonType,
9905 children = props.children,
9906 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "addonType", "children"]);
9907
9908 var classes = mapToCssModules(classnames(className, 'input-group-' + addonType), cssModule); // Convenience to assist with transition
9909
9910 if (typeof children === 'string') {
9911 return React__default.createElement(Tag, _extends({}, attributes, {
9912 className: classes
9913 }), React__default.createElement(InputGroupText, {
9914 children: children
9915 }));
9916 }
9917
9918 return React__default.createElement(Tag, _extends({}, attributes, {
9919 className: classes,
9920 children: children
9921 }));
9922 };
9923
9924 InputGroupAddon.propTypes = propTypes$U;
9925 InputGroupAddon.defaultProps = defaultProps$R;
9926
9927 var propTypes$V = {
9928 addonType: propTypes.oneOf(['prepend', 'append']).isRequired,
9929 children: propTypes.node
9930 };
9931
9932 var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) {
9933 return React__default.createElement(Dropdown, props);
9934 };
9935
9936 InputGroupButtonDropdown.propTypes = propTypes$V;
9937
9938 var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl'];
9939 var stringOrNumberProp$1 = propTypes.oneOfType([propTypes.number, propTypes.string]);
9940 var columnProps$1 = propTypes.oneOfType([propTypes.string, propTypes.number, propTypes.shape({
9941 size: stringOrNumberProp$1,
9942 order: stringOrNumberProp$1,
9943 offset: stringOrNumberProp$1
9944 })]);
9945 var propTypes$W = {
9946 children: propTypes.node,
9947 hidden: propTypes.bool,
9948 check: propTypes.bool,
9949 size: propTypes.string,
9950 for: propTypes.string,
9951 tag: tagPropType,
9952 className: propTypes.string,
9953 cssModule: propTypes.object,
9954 xs: columnProps$1,
9955 sm: columnProps$1,
9956 md: columnProps$1,
9957 lg: columnProps$1,
9958 xl: columnProps$1,
9959 widths: propTypes.array
9960 };
9961 var defaultProps$S = {
9962 tag: 'label',
9963 widths: colWidths$1
9964 };
9965
9966 var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) {
9967 if (colSize === true || colSize === '') {
9968 return isXs ? 'col' : "col-" + colWidth;
9969 } else if (colSize === 'auto') {
9970 return isXs ? 'col-auto' : "col-" + colWidth + "-auto";
9971 }
9972
9973 return isXs ? "col-" + colSize : "col-" + colWidth + "-" + colSize;
9974 };
9975
9976 var Label = function Label(props) {
9977 var className = props.className,
9978 cssModule = props.cssModule,
9979 hidden = props.hidden,
9980 widths = props.widths,
9981 Tag = props.tag,
9982 check = props.check,
9983 size = props.size,
9984 htmlFor = props.for,
9985 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "hidden", "widths", "tag", "check", "size", "for"]);
9986
9987 var colClasses = [];
9988 widths.forEach(function (colWidth, i) {
9989 var columnProp = props[colWidth];
9990 delete attributes[colWidth];
9991
9992 if (!columnProp && columnProp !== '') {
9993 return;
9994 }
9995
9996 var isXs = !i;
9997 var colClass;
9998
9999 if (lodash_isobject(columnProp)) {
10000 var _classNames;
10001
10002 var colSizeInterfix = isXs ? '-' : "-" + colWidth + "-";
10003 colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size);
10004 colClasses.push(mapToCssModules(classnames((_classNames = {}, _classNames[colClass] = columnProp.size || columnProp.size === '', _classNames["order" + colSizeInterfix + columnProp.order] = columnProp.order || columnProp.order === 0, _classNames["offset" + colSizeInterfix + columnProp.offset] = columnProp.offset || columnProp.offset === 0, _classNames))), cssModule);
10005 } else {
10006 colClass = getColumnSizeClass$1(isXs, colWidth, columnProp);
10007 colClasses.push(colClass);
10008 }
10009 });
10010 var classes = mapToCssModules(classnames(className, hidden ? 'sr-only' : false, check ? 'form-check-label' : false, size ? "col-form-label-" + size : false, colClasses, colClasses.length ? 'col-form-label' : false), cssModule);
10011 return React__default.createElement(Tag, _extends({
10012 htmlFor: htmlFor
10013 }, attributes, {
10014 className: classes
10015 }));
10016 };
10017
10018 Label.propTypes = propTypes$W;
10019 Label.defaultProps = defaultProps$S;
10020
10021 var propTypes$X = {
10022 body: propTypes.bool,
10023 bottom: propTypes.bool,
10024 children: propTypes.node,
10025 className: propTypes.string,
10026 cssModule: propTypes.object,
10027 heading: propTypes.bool,
10028 left: propTypes.bool,
10029 list: propTypes.bool,
10030 middle: propTypes.bool,
10031 object: propTypes.bool,
10032 right: propTypes.bool,
10033 tag: tagPropType,
10034 top: propTypes.bool
10035 };
10036
10037 var Media = function Media(props) {
10038 var body = props.body,
10039 bottom = props.bottom,
10040 className = props.className,
10041 cssModule = props.cssModule,
10042 heading = props.heading,
10043 left = props.left,
10044 list = props.list,
10045 middle = props.middle,
10046 object = props.object,
10047 right = props.right,
10048 tag = props.tag,
10049 top = props.top,
10050 attributes = _objectWithoutPropertiesLoose(props, ["body", "bottom", "className", "cssModule", "heading", "left", "list", "middle", "object", "right", "tag", "top"]);
10051
10052 var defaultTag;
10053
10054 if (heading) {
10055 defaultTag = 'h4';
10056 } else if (attributes.href) {
10057 defaultTag = 'a';
10058 } else if (attributes.src || object) {
10059 defaultTag = 'img';
10060 } else if (list) {
10061 defaultTag = 'ul';
10062 } else {
10063 defaultTag = 'div';
10064 }
10065
10066 var Tag = tag || defaultTag;
10067 var classes = mapToCssModules(classnames(className, {
10068 'media-body': body,
10069 'media-heading': heading,
10070 'media-left': left,
10071 'media-right': right,
10072 'media-top': top,
10073 'media-bottom': bottom,
10074 'media-middle': middle,
10075 'media-object': object,
10076 'media-list': list,
10077 media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list
10078 }), cssModule);
10079 return React__default.createElement(Tag, _extends({}, attributes, {
10080 className: classes
10081 }));
10082 };
10083
10084 Media.propTypes = propTypes$X;
10085
10086 var propTypes$Y = {
10087 children: propTypes.node,
10088 className: propTypes.string,
10089 listClassName: propTypes.string,
10090 cssModule: propTypes.object,
10091 size: propTypes.string,
10092 tag: tagPropType,
10093 listTag: tagPropType,
10094 'aria-label': propTypes.string
10095 };
10096 var defaultProps$T = {
10097 tag: 'nav',
10098 listTag: 'ul',
10099 'aria-label': 'pagination'
10100 };
10101
10102 var Pagination = function Pagination(props) {
10103 var _classNames;
10104
10105 var className = props.className,
10106 listClassName = props.listClassName,
10107 cssModule = props.cssModule,
10108 size = props.size,
10109 Tag = props.tag,
10110 ListTag = props.listTag,
10111 label = props['aria-label'],
10112 attributes = _objectWithoutPropertiesLoose(props, ["className", "listClassName", "cssModule", "size", "tag", "listTag", "aria-label"]);
10113
10114 var classes = mapToCssModules(classnames(className), cssModule);
10115 var listClasses = mapToCssModules(classnames(listClassName, 'pagination', (_classNames = {}, _classNames["pagination-" + size] = !!size, _classNames)), cssModule);
10116 return React__default.createElement(Tag, {
10117 className: classes,
10118 "aria-label": label
10119 }, React__default.createElement(ListTag, _extends({}, attributes, {
10120 className: listClasses
10121 })));
10122 };
10123
10124 Pagination.propTypes = propTypes$Y;
10125 Pagination.defaultProps = defaultProps$T;
10126
10127 var propTypes$Z = {
10128 active: propTypes.bool,
10129 children: propTypes.node,
10130 className: propTypes.string,
10131 cssModule: propTypes.object,
10132 disabled: propTypes.bool,
10133 tag: tagPropType
10134 };
10135 var defaultProps$U = {
10136 tag: 'li'
10137 };
10138
10139 var PaginationItem = function PaginationItem(props) {
10140 var active = props.active,
10141 className = props.className,
10142 cssModule = props.cssModule,
10143 disabled = props.disabled,
10144 Tag = props.tag,
10145 attributes = _objectWithoutPropertiesLoose(props, ["active", "className", "cssModule", "disabled", "tag"]);
10146
10147 var classes = mapToCssModules(classnames(className, 'page-item', {
10148 active: active,
10149 disabled: disabled
10150 }), cssModule);
10151 return React__default.createElement(Tag, _extends({}, attributes, {
10152 className: classes
10153 }));
10154 };
10155
10156 PaginationItem.propTypes = propTypes$Z;
10157 PaginationItem.defaultProps = defaultProps$U;
10158
10159 var propTypes$_ = {
10160 'aria-label': propTypes.string,
10161 children: propTypes.node,
10162 className: propTypes.string,
10163 cssModule: propTypes.object,
10164 next: propTypes.bool,
10165 previous: propTypes.bool,
10166 first: propTypes.bool,
10167 last: propTypes.bool,
10168 tag: tagPropType
10169 };
10170 var defaultProps$V = {
10171 tag: 'a'
10172 };
10173
10174 var PaginationLink = function PaginationLink(props) {
10175 var className = props.className,
10176 cssModule = props.cssModule,
10177 next = props.next,
10178 previous = props.previous,
10179 first = props.first,
10180 last = props.last,
10181 Tag = props.tag,
10182 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "next", "previous", "first", "last", "tag"]);
10183
10184 var classes = mapToCssModules(classnames(className, 'page-link'), cssModule);
10185 var defaultAriaLabel;
10186
10187 if (previous) {
10188 defaultAriaLabel = 'Previous';
10189 } else if (next) {
10190 defaultAriaLabel = 'Next';
10191 } else if (first) {
10192 defaultAriaLabel = 'First';
10193 } else if (last) {
10194 defaultAriaLabel = 'Last';
10195 }
10196
10197 var ariaLabel = props['aria-label'] || defaultAriaLabel;
10198 var defaultCaret;
10199
10200 if (previous) {
10201 defaultCaret = "\u2039";
10202 } else if (next) {
10203 defaultCaret = "\u203A";
10204 } else if (first) {
10205 defaultCaret = "\xAB";
10206 } else if (last) {
10207 defaultCaret = "\xBB";
10208 }
10209
10210 var children = props.children;
10211
10212 if (children && Array.isArray(children) && children.length === 0) {
10213 children = null;
10214 }
10215
10216 if (!attributes.href && Tag === 'a') {
10217 Tag = 'button';
10218 }
10219
10220 if (previous || next || first || last) {
10221 children = [React__default.createElement("span", {
10222 "aria-hidden": "true",
10223 key: "caret"
10224 }, children || defaultCaret), React__default.createElement("span", {
10225 className: "sr-only",
10226 key: "sr"
10227 }, ariaLabel)];
10228 }
10229
10230 return React__default.createElement(Tag, _extends({}, attributes, {
10231 className: classes,
10232 "aria-label": ariaLabel
10233 }), children);
10234 };
10235
10236 PaginationLink.propTypes = propTypes$_;
10237 PaginationLink.defaultProps = defaultProps$V;
10238
10239 /**
10240 * TabContext
10241 * {
10242 * activeTabId: PropTypes.any
10243 * }
10244 */
10245
10246 var TabContext = React__default.createContext({});
10247
10248 var propTypes$$ = {
10249 tag: tagPropType,
10250 activeTab: propTypes.any,
10251 className: propTypes.string,
10252 cssModule: propTypes.object
10253 };
10254 var defaultProps$W = {
10255 tag: 'div'
10256 };
10257
10258 var TabContent =
10259 /*#__PURE__*/
10260 function (_Component) {
10261 _inheritsLoose(TabContent, _Component);
10262
10263 TabContent.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
10264 if (prevState.activeTab !== nextProps.activeTab) {
10265 return {
10266 activeTab: nextProps.activeTab
10267 };
10268 }
10269
10270 return null;
10271 };
10272
10273 function TabContent(props) {
10274 var _this;
10275
10276 _this = _Component.call(this, props) || this;
10277 _this.state = {
10278 activeTab: _this.props.activeTab
10279 };
10280 return _this;
10281 }
10282
10283 var _proto = TabContent.prototype;
10284
10285 _proto.render = function render() {
10286 var _this$props = this.props,
10287 className = _this$props.className,
10288 cssModule = _this$props.cssModule,
10289 Tag = _this$props.tag;
10290 var attributes = omit(this.props, Object.keys(propTypes$$));
10291 var classes = mapToCssModules(classnames('tab-content', className), cssModule);
10292 return React__default.createElement(TabContext.Provider, {
10293 value: {
10294 activeTabId: this.state.activeTab
10295 }
10296 }, React__default.createElement(Tag, _extends({}, attributes, {
10297 className: classes
10298 })));
10299 };
10300
10301 return TabContent;
10302 }(React.Component);
10303
10304 polyfill(TabContent);
10305 TabContent.propTypes = propTypes$$;
10306 TabContent.defaultProps = defaultProps$W;
10307
10308 var propTypes$10 = {
10309 tag: tagPropType,
10310 className: propTypes.string,
10311 cssModule: propTypes.object,
10312 tabId: propTypes.any
10313 };
10314 var defaultProps$X = {
10315 tag: 'div'
10316 };
10317 function TabPane(props) {
10318 var className = props.className,
10319 cssModule = props.cssModule,
10320 tabId = props.tabId,
10321 Tag = props.tag,
10322 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tabId", "tag"]);
10323
10324 var getClasses = function getClasses(activeTabId) {
10325 return mapToCssModules(classnames('tab-pane', className, {
10326 active: tabId === activeTabId
10327 }), cssModule);
10328 };
10329
10330 return React__default.createElement(TabContext.Consumer, null, function (_ref) {
10331 var activeTabId = _ref.activeTabId;
10332 return React__default.createElement(Tag, _extends({}, attributes, {
10333 className: getClasses(activeTabId)
10334 }));
10335 });
10336 }
10337 TabPane.propTypes = propTypes$10;
10338 TabPane.defaultProps = defaultProps$X;
10339
10340 var propTypes$11 = {
10341 tag: tagPropType,
10342 fluid: propTypes.bool,
10343 className: propTypes.string,
10344 cssModule: propTypes.object
10345 };
10346 var defaultProps$Y = {
10347 tag: 'div'
10348 };
10349
10350 var Jumbotron = function Jumbotron(props) {
10351 var className = props.className,
10352 cssModule = props.cssModule,
10353 Tag = props.tag,
10354 fluid = props.fluid,
10355 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "fluid"]);
10356
10357 var classes = mapToCssModules(classnames(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule);
10358 return React__default.createElement(Tag, _extends({}, attributes, {
10359 className: classes
10360 }));
10361 };
10362
10363 Jumbotron.propTypes = propTypes$11;
10364 Jumbotron.defaultProps = defaultProps$Y;
10365
10366 var propTypes$12 = {
10367 children: propTypes.node,
10368 className: propTypes.string,
10369 closeClassName: propTypes.string,
10370 closeAriaLabel: propTypes.string,
10371 cssModule: propTypes.object,
10372 color: propTypes.string,
10373 fade: propTypes.bool,
10374 isOpen: propTypes.bool,
10375 toggle: propTypes.func,
10376 tag: tagPropType,
10377 transition: propTypes.shape(Fade.propTypes),
10378 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
10379 };
10380 var defaultProps$Z = {
10381 color: 'success',
10382 isOpen: true,
10383 tag: 'div',
10384 closeAriaLabel: 'Close',
10385 fade: true,
10386 transition: _extends({}, Fade.defaultProps, {
10387 unmountOnExit: true
10388 })
10389 };
10390
10391 function Alert(props) {
10392 var className = props.className,
10393 closeClassName = props.closeClassName,
10394 closeAriaLabel = props.closeAriaLabel,
10395 cssModule = props.cssModule,
10396 Tag = props.tag,
10397 color = props.color,
10398 isOpen = props.isOpen,
10399 toggle = props.toggle,
10400 children = props.children,
10401 transition = props.transition,
10402 fade = props.fade,
10403 innerRef = props.innerRef,
10404 attributes = _objectWithoutPropertiesLoose(props, ["className", "closeClassName", "closeAriaLabel", "cssModule", "tag", "color", "isOpen", "toggle", "children", "transition", "fade", "innerRef"]);
10405
10406 var classes = mapToCssModules(classnames(className, 'alert', "alert-" + color, {
10407 'alert-dismissible': toggle
10408 }), cssModule);
10409 var closeClasses = mapToCssModules(classnames('close', closeClassName), cssModule);
10410
10411 var alertTransition = _extends({}, Fade.defaultProps, transition, {
10412 baseClass: fade ? transition.baseClass : '',
10413 timeout: fade ? transition.timeout : 0
10414 });
10415
10416 return React__default.createElement(Fade, _extends({}, attributes, alertTransition, {
10417 tag: Tag,
10418 className: classes,
10419 in: isOpen,
10420 role: "alert",
10421 innerRef: innerRef
10422 }), toggle ? React__default.createElement("button", {
10423 type: "button",
10424 className: closeClasses,
10425 "aria-label": closeAriaLabel,
10426 onClick: toggle
10427 }, React__default.createElement("span", {
10428 "aria-hidden": "true"
10429 }, "\xD7")) : null, children);
10430 }
10431
10432 Alert.propTypes = propTypes$12;
10433 Alert.defaultProps = defaultProps$Z;
10434
10435 var propTypes$13 = {
10436 children: propTypes.node,
10437 className: propTypes.string,
10438 cssModule: propTypes.object,
10439 fade: propTypes.bool,
10440 isOpen: propTypes.bool,
10441 tag: tagPropType,
10442 transition: propTypes.shape(Fade.propTypes),
10443 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
10444 };
10445 var defaultProps$_ = {
10446 isOpen: true,
10447 tag: 'div',
10448 fade: true,
10449 transition: _extends({}, Fade.defaultProps, {
10450 unmountOnExit: true
10451 })
10452 };
10453
10454 function Toast(props) {
10455 var className = props.className,
10456 cssModule = props.cssModule,
10457 Tag = props.tag,
10458 isOpen = props.isOpen,
10459 children = props.children,
10460 transition = props.transition,
10461 fade = props.fade,
10462 innerRef = props.innerRef,
10463 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "isOpen", "children", "transition", "fade", "innerRef"]);
10464
10465 var classes = mapToCssModules(classnames(className, 'toast'), cssModule);
10466
10467 var toastTransition = _extends({}, Fade.defaultProps, transition, {
10468 baseClass: fade ? transition.baseClass : '',
10469 timeout: fade ? transition.timeout : 0
10470 });
10471
10472 return React__default.createElement(Fade, _extends({}, attributes, toastTransition, {
10473 tag: Tag,
10474 className: classes,
10475 in: isOpen,
10476 role: "alert",
10477 innerRef: innerRef
10478 }), children);
10479 }
10480
10481 Toast.propTypes = propTypes$13;
10482 Toast.defaultProps = defaultProps$_;
10483
10484 var propTypes$14 = {
10485 tag: tagPropType,
10486 className: propTypes.string,
10487 cssModule: propTypes.object,
10488 innerRef: propTypes.oneOfType([propTypes.object, propTypes.string, propTypes.func])
10489 };
10490 var defaultProps$$ = {
10491 tag: 'div'
10492 };
10493
10494 var ToastBody = function ToastBody(props) {
10495 var className = props.className,
10496 cssModule = props.cssModule,
10497 innerRef = props.innerRef,
10498 Tag = props.tag,
10499 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "innerRef", "tag"]);
10500
10501 var classes = mapToCssModules(classnames(className, 'toast-body'), cssModule);
10502 return React__default.createElement(Tag, _extends({}, attributes, {
10503 className: classes,
10504 ref: innerRef
10505 }));
10506 };
10507
10508 ToastBody.propTypes = propTypes$14;
10509 ToastBody.defaultProps = defaultProps$$;
10510
10511 var propTypes$15 = {
10512 tag: tagPropType,
10513 icon: propTypes.oneOfType([propTypes.string, propTypes.node]),
10514 wrapTag: tagPropType,
10515 toggle: propTypes.func,
10516 className: propTypes.string,
10517 cssModule: propTypes.object,
10518 children: propTypes.node,
10519 closeAriaLabel: propTypes.string,
10520 charCode: propTypes.oneOfType([propTypes.string, propTypes.number]),
10521 close: propTypes.object
10522 };
10523 var defaultProps$10 = {
10524 tag: 'strong',
10525 wrapTag: 'div',
10526 tagClassName: 'mr-auto',
10527 closeAriaLabel: 'Close',
10528 charCode: 215
10529 };
10530
10531 var ToastHeader = function ToastHeader(props) {
10532 var closeButton;
10533 var icon;
10534
10535 var className = props.className,
10536 cssModule = props.cssModule,
10537 children = props.children,
10538 toggle = props.toggle,
10539 Tag = props.tag,
10540 WrapTag = props.wrapTag,
10541 closeAriaLabel = props.closeAriaLabel,
10542 charCode = props.charCode,
10543 close = props.close,
10544 tagClassName = props.tagClassName,
10545 iconProp = props.icon,
10546 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "children", "toggle", "tag", "wrapTag", "closeAriaLabel", "charCode", "close", "tagClassName", "icon"]);
10547
10548 var classes = mapToCssModules(classnames(className, 'toast-header'), cssModule);
10549
10550 if (!close && toggle) {
10551 var closeIcon = typeof charCode === 'number' ? String.fromCharCode(charCode) : charCode;
10552 closeButton = React__default.createElement("button", {
10553 type: "button",
10554 onClick: toggle,
10555 className: mapToCssModules('close', cssModule),
10556 "aria-label": closeAriaLabel
10557 }, React__default.createElement("span", {
10558 "aria-hidden": "true"
10559 }, closeIcon));
10560 }
10561
10562 if (typeof iconProp === "string") {
10563 icon = React__default.createElement("svg", {
10564 className: mapToCssModules("rounded text-" + iconProp),
10565 width: "20",
10566 height: "20",
10567 xmlns: "http://www.w3.org/2000/svg",
10568 preserveAspectRatio: "xMidYMid slice",
10569 focusable: "false",
10570 role: "img"
10571 }, React__default.createElement("rect", {
10572 fill: "currentColor",
10573 width: "100%",
10574 height: "100%"
10575 }));
10576 } else if (iconProp) {
10577 icon = iconProp;
10578 }
10579
10580 return React__default.createElement(WrapTag, _extends({}, attributes, {
10581 className: classes
10582 }), icon, React__default.createElement(Tag, {
10583 className: mapToCssModules(classnames(tagClassName, {
10584 "ml-2": icon != null
10585 }), cssModule)
10586 }, children), close || closeButton);
10587 };
10588
10589 ToastHeader.propTypes = propTypes$15;
10590 ToastHeader.defaultProps = defaultProps$10;
10591
10592 var _transitionStatusToCl;
10593
10594 var propTypes$16 = _extends({}, reactTransitionGroup_1.propTypes, {
10595 isOpen: propTypes.bool,
10596 children: propTypes.oneOfType([propTypes.arrayOf(propTypes.node), propTypes.node]),
10597 tag: tagPropType,
10598 className: propTypes.node,
10599 navbar: propTypes.bool,
10600 cssModule: propTypes.object,
10601 innerRef: propTypes.oneOfType([propTypes.func, propTypes.string, propTypes.object])
10602 });
10603
10604 var defaultProps$11 = _extends({}, reactTransitionGroup_1.defaultProps, {
10605 isOpen: false,
10606 appear: false,
10607 enter: true,
10608 exit: true,
10609 tag: 'div',
10610 timeout: TransitionTimeouts.Collapse
10611 });
10612
10613 var transitionStatusToClassHash = (_transitionStatusToCl = {}, _transitionStatusToCl[TransitionStatuses.ENTERING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.ENTERED] = 'collapse show', _transitionStatusToCl[TransitionStatuses.EXITING] = 'collapsing', _transitionStatusToCl[TransitionStatuses.EXITED] = 'collapse', _transitionStatusToCl);
10614
10615 function getTransitionClass(status) {
10616 return transitionStatusToClassHash[status] || 'collapse';
10617 }
10618
10619 function getHeight(node) {
10620 return node.scrollHeight;
10621 }
10622
10623 var Collapse =
10624 /*#__PURE__*/
10625 function (_Component) {
10626 _inheritsLoose(Collapse, _Component);
10627
10628 function Collapse(props) {
10629 var _this;
10630
10631 _this = _Component.call(this, props) || this;
10632 _this.state = {
10633 height: null
10634 };
10635 ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) {
10636 _this[name] = _this[name].bind(_assertThisInitialized(_this));
10637 });
10638 return _this;
10639 }
10640
10641 var _proto = Collapse.prototype;
10642
10643 _proto.onEntering = function onEntering(node, isAppearing) {
10644 this.setState({
10645 height: getHeight(node)
10646 });
10647 this.props.onEntering(node, isAppearing);
10648 };
10649
10650 _proto.onEntered = function onEntered(node, isAppearing) {
10651 this.setState({
10652 height: null
10653 });
10654 this.props.onEntered(node, isAppearing);
10655 };
10656
10657 _proto.onExit = function onExit(node) {
10658 this.setState({
10659 height: getHeight(node)
10660 });
10661 this.props.onExit(node);
10662 };
10663
10664 _proto.onExiting = function onExiting(node) {
10665 // getting this variable triggers a reflow
10666 var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars
10667
10668 this.setState({
10669 height: 0
10670 });
10671 this.props.onExiting(node);
10672 };
10673
10674 _proto.onExited = function onExited(node) {
10675 this.setState({
10676 height: null
10677 });
10678 this.props.onExited(node);
10679 };
10680
10681 _proto.render = function render() {
10682 var _this2 = this;
10683
10684 var _this$props = this.props,
10685 Tag = _this$props.tag,
10686 isOpen = _this$props.isOpen,
10687 className = _this$props.className,
10688 navbar = _this$props.navbar,
10689 cssModule = _this$props.cssModule,
10690 children = _this$props.children,
10691 innerRef = _this$props.innerRef,
10692 otherProps = _objectWithoutPropertiesLoose(_this$props, ["tag", "isOpen", "className", "navbar", "cssModule", "children", "innerRef"]);
10693
10694 var height = this.state.height;
10695 var transitionProps = pick(otherProps, TransitionPropTypeKeys);
10696 var childProps = omit(otherProps, TransitionPropTypeKeys);
10697 return React__default.createElement(reactTransitionGroup_1, _extends({}, transitionProps, {
10698 in: isOpen,
10699 onEntering: this.onEntering,
10700 onEntered: this.onEntered,
10701 onExit: this.onExit,
10702 onExiting: this.onExiting,
10703 onExited: this.onExited
10704 }), function (status) {
10705 var collapseClass = getTransitionClass(status);
10706 var classes = mapToCssModules(classnames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);
10707 var style = height === null ? null : {
10708 height: height
10709 };
10710 return React__default.createElement(Tag, _extends({}, childProps, {
10711 style: _extends({}, childProps.style, style),
10712 className: classes,
10713 ref: _this2.props.innerRef
10714 }), children);
10715 });
10716 };
10717
10718 return Collapse;
10719 }(React.Component);
10720
10721 Collapse.propTypes = propTypes$16;
10722 Collapse.defaultProps = defaultProps$11;
10723
10724 var propTypes$17 = {
10725 tag: tagPropType,
10726 active: propTypes.bool,
10727 disabled: propTypes.bool,
10728 color: propTypes.string,
10729 action: propTypes.bool,
10730 className: propTypes.any,
10731 cssModule: propTypes.object
10732 };
10733 var defaultProps$12 = {
10734 tag: 'li'
10735 };
10736
10737 var handleDisabledOnClick = function handleDisabledOnClick(e) {
10738 e.preventDefault();
10739 };
10740
10741 var ListGroupItem = function ListGroupItem(props) {
10742 var className = props.className,
10743 cssModule = props.cssModule,
10744 Tag = props.tag,
10745 active = props.active,
10746 disabled = props.disabled,
10747 action = props.action,
10748 color = props.color,
10749 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag", "active", "disabled", "action", "color"]);
10750
10751 var classes = mapToCssModules(classnames(className, active ? 'active' : false, disabled ? 'disabled' : false, action ? 'list-group-item-action' : false, color ? "list-group-item-" + color : false, 'list-group-item'), cssModule); // Prevent click event when disabled.
10752
10753 if (disabled) {
10754 attributes.onClick = handleDisabledOnClick;
10755 }
10756
10757 return React__default.createElement(Tag, _extends({}, attributes, {
10758 className: classes
10759 }));
10760 };
10761
10762 ListGroupItem.propTypes = propTypes$17;
10763 ListGroupItem.defaultProps = defaultProps$12;
10764
10765 var propTypes$18 = {
10766 tag: tagPropType,
10767 className: propTypes.any,
10768 cssModule: propTypes.object
10769 };
10770 var defaultProps$13 = {
10771 tag: 'h5'
10772 };
10773
10774 var ListGroupItemHeading = function ListGroupItemHeading(props) {
10775 var className = props.className,
10776 cssModule = props.cssModule,
10777 Tag = props.tag,
10778 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
10779
10780 var classes = mapToCssModules(classnames(className, 'list-group-item-heading'), cssModule);
10781 return React__default.createElement(Tag, _extends({}, attributes, {
10782 className: classes
10783 }));
10784 };
10785
10786 ListGroupItemHeading.propTypes = propTypes$18;
10787 ListGroupItemHeading.defaultProps = defaultProps$13;
10788
10789 var propTypes$19 = {
10790 tag: tagPropType,
10791 className: propTypes.any,
10792 cssModule: propTypes.object
10793 };
10794 var defaultProps$14 = {
10795 tag: 'p'
10796 };
10797
10798 var ListGroupItemText = function ListGroupItemText(props) {
10799 var className = props.className,
10800 cssModule = props.cssModule,
10801 Tag = props.tag,
10802 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "tag"]);
10803
10804 var classes = mapToCssModules(classnames(className, 'list-group-item-text'), cssModule);
10805 return React__default.createElement(Tag, _extends({}, attributes, {
10806 className: classes
10807 }));
10808 };
10809
10810 ListGroupItemText.propTypes = propTypes$19;
10811 ListGroupItemText.defaultProps = defaultProps$14;
10812
10813 var UncontrolledAlert =
10814 /*#__PURE__*/
10815 function (_Component) {
10816 _inheritsLoose(UncontrolledAlert, _Component);
10817
10818 function UncontrolledAlert(props) {
10819 var _this;
10820
10821 _this = _Component.call(this, props) || this;
10822 _this.state = {
10823 isOpen: true
10824 };
10825 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
10826 return _this;
10827 }
10828
10829 var _proto = UncontrolledAlert.prototype;
10830
10831 _proto.toggle = function toggle() {
10832 this.setState({
10833 isOpen: !this.state.isOpen
10834 });
10835 };
10836
10837 _proto.render = function render() {
10838 return React__default.createElement(Alert, _extends({
10839 isOpen: this.state.isOpen,
10840 toggle: this.toggle
10841 }, this.props));
10842 };
10843
10844 return UncontrolledAlert;
10845 }(React.Component);
10846
10847 var omitKeys$1 = ['defaultOpen'];
10848
10849 var UncontrolledButtonDropdown =
10850 /*#__PURE__*/
10851 function (_Component) {
10852 _inheritsLoose(UncontrolledButtonDropdown, _Component);
10853
10854 function UncontrolledButtonDropdown(props) {
10855 var _this;
10856
10857 _this = _Component.call(this, props) || this;
10858 _this.state = {
10859 isOpen: props.defaultOpen || false
10860 };
10861 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
10862 return _this;
10863 }
10864
10865 var _proto = UncontrolledButtonDropdown.prototype;
10866
10867 _proto.toggle = function toggle() {
10868 this.setState({
10869 isOpen: !this.state.isOpen
10870 });
10871 };
10872
10873 _proto.render = function render() {
10874 return React__default.createElement(ButtonDropdown, _extends({
10875 isOpen: this.state.isOpen,
10876 toggle: this.toggle
10877 }, omit(this.props, omitKeys$1)));
10878 };
10879
10880 return UncontrolledButtonDropdown;
10881 }(React.Component);
10882 UncontrolledButtonDropdown.propTypes = _extends({
10883 defaultOpen: propTypes.bool
10884 }, ButtonDropdown.propTypes);
10885
10886 var omitKeys$2 = ['toggleEvents', 'defaultOpen'];
10887 var propTypes$1a = {
10888 defaultOpen: propTypes.bool,
10889 toggler: propTypes.string.isRequired,
10890 toggleEvents: propTypes.arrayOf(propTypes.string)
10891 };
10892 var defaultProps$15 = {
10893 toggleEvents: defaultToggleEvents
10894 };
10895
10896 var UncontrolledCollapse =
10897 /*#__PURE__*/
10898 function (_Component) {
10899 _inheritsLoose(UncontrolledCollapse, _Component);
10900
10901 function UncontrolledCollapse(props) {
10902 var _this;
10903
10904 _this = _Component.call(this, props) || this;
10905 _this.togglers = null;
10906 _this.removeEventListeners = null;
10907 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
10908 _this.state = {
10909 isOpen: props.defaultOpen || false
10910 };
10911 return _this;
10912 }
10913
10914 var _proto = UncontrolledCollapse.prototype;
10915
10916 _proto.componentDidMount = function componentDidMount() {
10917 this.togglers = findDOMElements(this.props.toggler);
10918
10919 if (this.togglers.length) {
10920 this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);
10921 }
10922 };
10923
10924 _proto.componentWillUnmount = function componentWillUnmount() {
10925 if (this.togglers.length && this.removeEventListeners) {
10926 this.removeEventListeners();
10927 }
10928 };
10929
10930 _proto.toggle = function toggle(e) {
10931 this.setState(function (_ref) {
10932 var isOpen = _ref.isOpen;
10933 return {
10934 isOpen: !isOpen
10935 };
10936 });
10937 e.preventDefault();
10938 };
10939
10940 _proto.render = function render() {
10941 return React__default.createElement(Collapse, _extends({
10942 isOpen: this.state.isOpen
10943 }, omit(this.props, omitKeys$2)));
10944 };
10945
10946 return UncontrolledCollapse;
10947 }(React.Component);
10948
10949 UncontrolledCollapse.propTypes = propTypes$1a;
10950 UncontrolledCollapse.defaultProps = defaultProps$15;
10951
10952 var omitKeys$3 = ['defaultOpen'];
10953
10954 var UncontrolledDropdown =
10955 /*#__PURE__*/
10956 function (_Component) {
10957 _inheritsLoose(UncontrolledDropdown, _Component);
10958
10959 function UncontrolledDropdown(props) {
10960 var _this;
10961
10962 _this = _Component.call(this, props) || this;
10963 _this.state = {
10964 isOpen: props.defaultOpen || false
10965 };
10966 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
10967 return _this;
10968 }
10969
10970 var _proto = UncontrolledDropdown.prototype;
10971
10972 _proto.toggle = function toggle() {
10973 this.setState({
10974 isOpen: !this.state.isOpen
10975 });
10976 };
10977
10978 _proto.render = function render() {
10979 return React__default.createElement(Dropdown, _extends({
10980 isOpen: this.state.isOpen,
10981 toggle: this.toggle
10982 }, omit(this.props, omitKeys$3)));
10983 };
10984
10985 return UncontrolledDropdown;
10986 }(React.Component);
10987 UncontrolledDropdown.propTypes = _extends({
10988 defaultOpen: propTypes.bool
10989 }, Dropdown.propTypes);
10990
10991 var omitKeys$4 = ['defaultOpen'];
10992
10993 var UncontrolledTooltip =
10994 /*#__PURE__*/
10995 function (_Component) {
10996 _inheritsLoose(UncontrolledTooltip, _Component);
10997
10998 function UncontrolledTooltip(props) {
10999 var _this;
11000
11001 _this = _Component.call(this, props) || this;
11002 _this.state = {
11003 isOpen: props.defaultOpen || false
11004 };
11005 _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));
11006 return _this;
11007 }
11008
11009 var _proto = UncontrolledTooltip.prototype;
11010
11011 _proto.toggle = function toggle() {
11012 this.setState({
11013 isOpen: !this.state.isOpen
11014 });
11015 };
11016
11017 _proto.render = function render() {
11018 return React__default.createElement(Tooltip, _extends({
11019 isOpen: this.state.isOpen,
11020 toggle: this.toggle
11021 }, omit(this.props, omitKeys$4)));
11022 };
11023
11024 return UncontrolledTooltip;
11025 }(React.Component);
11026 UncontrolledTooltip.propTypes = _extends({
11027 defaultOpen: propTypes.bool
11028 }, Tooltip.propTypes);
11029
11030 var propTypes$1b = {
11031 tag: tagPropType,
11032 type: propTypes.string,
11033 size: propTypes.string,
11034 color: propTypes.string,
11035 className: propTypes.string,
11036 cssModule: propTypes.object,
11037 children: propTypes.string
11038 };
11039 var defaultProps$16 = {
11040 tag: 'div',
11041 type: 'border',
11042 children: 'Loading...'
11043 };
11044
11045 var Spinner = function Spinner(props) {
11046 var className = props.className,
11047 cssModule = props.cssModule,
11048 type = props.type,
11049 size = props.size,
11050 color = props.color,
11051 children = props.children,
11052 Tag = props.tag,
11053 attributes = _objectWithoutPropertiesLoose(props, ["className", "cssModule", "type", "size", "color", "children", "tag"]);
11054
11055 var classes = mapToCssModules(classnames(className, size ? "spinner-" + type + "-" + size : false, "spinner-" + type, color ? "text-" + color : false), cssModule);
11056 return React__default.createElement(Tag, _extends({
11057 role: "status"
11058 }, attributes, {
11059 className: classes
11060 }), children && React__default.createElement("span", {
11061 className: mapToCssModules('sr-only', cssModule)
11062 }, children));
11063 };
11064
11065 Spinner.propTypes = propTypes$1b;
11066 Spinner.defaultProps = defaultProps$16;
11067
11068 exports.Alert = Alert;
11069 exports.Badge = Badge;
11070 exports.Breadcrumb = Breadcrumb;
11071 exports.BreadcrumbItem = BreadcrumbItem;
11072 exports.Button = Button;
11073 exports.ButtonDropdown = ButtonDropdown;
11074 exports.ButtonGroup = ButtonGroup;
11075 exports.ButtonToolbar = ButtonToolbar;
11076 exports.Card = Card;
11077 exports.CardBody = CardBody;
11078 exports.CardColumns = CardColumns;
11079 exports.CardDeck = CardDeck;
11080 exports.CardFooter = CardFooter;
11081 exports.CardGroup = CardGroup;
11082 exports.CardHeader = CardHeader;
11083 exports.CardImg = CardImg;
11084 exports.CardImgOverlay = CardImgOverlay;
11085 exports.CardLink = CardLink;
11086 exports.CardSubtitle = CardSubtitle;
11087 exports.CardText = CardText;
11088 exports.CardTitle = CardTitle;
11089 exports.Carousel = Carousel;
11090 exports.CarouselCaption = CarouselCaption;
11091 exports.CarouselControl = CarouselControl;
11092 exports.CarouselIndicators = CarouselIndicators;
11093 exports.CarouselItem = CarouselItem;
11094 exports.Col = Col;
11095 exports.Collapse = Collapse;
11096 exports.Container = Container;
11097 exports.CustomInput = CustomInput;
11098 exports.Dropdown = Dropdown;
11099 exports.DropdownItem = DropdownItem;
11100 exports.DropdownMenu = DropdownMenu;
11101 exports.DropdownToggle = DropdownToggle;
11102 exports.Fade = Fade;
11103 exports.Form = Form;
11104 exports.FormFeedback = FormFeedback;
11105 exports.FormGroup = FormGroup;
11106 exports.FormText = FormText;
11107 exports.Input = Input;
11108 exports.InputGroup = InputGroup;
11109 exports.InputGroupAddon = InputGroupAddon;
11110 exports.InputGroupButtonDropdown = InputGroupButtonDropdown;
11111 exports.InputGroupText = InputGroupText;
11112 exports.Jumbotron = Jumbotron;
11113 exports.Label = Label;
11114 exports.ListGroup = ListGroup;
11115 exports.ListGroupItem = ListGroupItem;
11116 exports.ListGroupItemHeading = ListGroupItemHeading;
11117 exports.ListGroupItemText = ListGroupItemText;
11118 exports.Media = Media;
11119 exports.Modal = Modal;
11120 exports.ModalBody = ModalBody;
11121 exports.ModalFooter = ModalFooter;
11122 exports.ModalHeader = ModalHeader;
11123 exports.Nav = Nav;
11124 exports.NavItem = NavItem;
11125 exports.NavLink = NavLink;
11126 exports.Navbar = Navbar;
11127 exports.NavbarBrand = NavbarBrand;
11128 exports.NavbarToggler = NavbarToggler;
11129 exports.Pagination = Pagination;
11130 exports.PaginationItem = PaginationItem;
11131 exports.PaginationLink = PaginationLink;
11132 exports.Popover = Popover;
11133 exports.PopoverBody = PopoverBody;
11134 exports.PopoverHeader = PopoverHeader;
11135 exports.PopperContent = PopperContent;
11136 exports.PopperTargetHelper = PopperTargetHelper;
11137 exports.Progress = Progress;
11138 exports.Row = Row;
11139 exports.Spinner = Spinner;
11140 exports.TabContent = TabContent;
11141 exports.TabPane = TabPane;
11142 exports.Table = Table;
11143 exports.Toast = Toast;
11144 exports.ToastBody = ToastBody;
11145 exports.ToastHeader = ToastHeader;
11146 exports.Tooltip = Tooltip;
11147 exports.UncontrolledAlert = UncontrolledAlert;
11148 exports.UncontrolledButtonDropdown = UncontrolledButtonDropdown;
11149 exports.UncontrolledCarousel = UncontrolledCarousel;
11150 exports.UncontrolledCollapse = UncontrolledCollapse;
11151 exports.UncontrolledDropdown = UncontrolledDropdown;
11152 exports.UncontrolledPopover = UncontrolledPopover;
11153 exports.UncontrolledTooltip = UncontrolledTooltip;
11154 exports.Util = utils;
11155
11156 Object.defineProperty(exports, '__esModule', { value: true });
11157
11158}));
11159//# sourceMappingURL=reactstrap.full.js.map