diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 37df7c33..00000000 --- a/.babelrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "presets": ["env"], - "plugins": [ - "transform-object-rest-spread", - "transform-react-jsx" - ] -} \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 64128dcc..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,68 +0,0 @@ -var ecmaFeatures = { - 'jsx': true, - 'arrowFunctions': true, - 'blockBindings': true, - 'defaultParams': true, - 'destructuring': true, - 'forOf': true, - 'generators': true, - 'objectLiteralComputedProperties': true, - 'objectLiteralShorthandMethods': true, - 'objectLiteralShorthandProperties': true, - 'experimentalObjectRestSpread': true, - 'restParams': true, - 'spread': true, - 'templateStrings': true, - 'modules': true, - 'classes': true -}; - -var rules = { - 'comma-dangle': 0, - 'new-cap': 0, - 'arrow-body-style': 0, - 'prefer-template': 0, - 'no-underscore-dangle': 0, - 'object-shorthand': 0, - 'func-names': 0, - 'no-extra-parens': ['error', 'functions'], - 'dot-notation': 0, - 'max-len': 0, - 'camelcase': 0, - 'react/jsx-pascal-case': 0, - 'prefer-const': 0, - 'react/jsx-filename-extension': 0, - 'linebreak-style': 0, - 'react/require-extension': 0, - 'react/no-children-prop': 0, - 'react/require-default-props': 0, - 'react/forbid-prop-types': 0, - 'jsx-a11y/no-noninteractive-element-interactions': 1, - 'no-nested-ternary': 0, - 'class-methods-use-this': 0, - 'import/no-extraneous-dependencies': 0, - 'jsx-a11y/href-no-hash': 0, - 'object-curly-newline': 0 -}; - -module.exports = { - "root": true, - 'extends': 'airbnb', - 'env': { - 'browser': true, - 'node': true, - 'es6': true - }, - 'globals': { - 'describe': true, - 'it': true - }, - 'plugins': [ - 'react' - ], - 'parserOptions': { - 'sourceType': 'module', - 'ecmaFeatures': ecmaFeatures - }, - rules: rules -}; \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2e397d5b..20d98978 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,22 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +/node_modules +package-lock.json + +# testing +/demo/dist + +# testing +/coverage + +# production +/es +/lib +/umd + +# misc .DS_Store .idea -package-lock.json -# Folders to ignore -node_modules \ No newline at end of file +npm-debug.log* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..06e30d93 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +sudo: false + +language: node_js +node_js: + - 8 + +before_install: + - npm install codecov.io coveralls + +after_success: + - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js + - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + +branches: + only: + - master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d8b09848 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,25 @@ +## Prerequisites + +[Node.js](http://nodejs.org/) >= v4 must be installed. + +## Installation + +- Running `npm install` in the component's root directory will install everything you need for development. + +## Demo Development Server + +- `npm start` will run a development server with the component's demo app at [http://localhost:3000](http://localhost:3000) with hot module reloading. + +## Running Tests + +- `npm test` will run the tests once. + +- `npm run test:coverage` will run the tests and produce a coverage report in `coverage/`. + +- `npm run test:watch` will run the tests on every change. + +## Building + +- `npm run build` will build the component for publishing to npm and also bundle the demo app. + +- `npm run clean` will delete built resources. diff --git a/README.md b/README.md index 466e9d05..449c910b 100644 --- a/README.md +++ b/README.md @@ -1 +1,34 @@ -# @coreui/react `v2.0.0-alpha` +## @coreui/react v2 + +[![Travis][build-badge]][build] +[![npm package][npm-badge]][npm] +[![Coveralls][coveralls-badge]][coveralls] + +_@coreui/react v2_ :construction: +- work in progress :warning: +- bootstrapped with [nwb](https://github.com/insin/nwb) toolkit + +[build-badge]: https://img.shields.io/travis/user/repo/master.png?style=flat-square +[build]: https://travis-ci.org/user/repo + +[npm-badge]: https://img.shields.io/npm/v/@coreui/react.png?style=flat-square +[npm]: https://www.npmjs.com/package/@coreui/react + +[coveralls-badge]: https://img.shields.io/coveralls/user/repo/master.png?style=flat-square +[coveralls]: https://coveralls.io/github/user/repo + +#### `npm run` scripts + +`package.json` is configured with `"scripts"` we can use with `npm run` while developing the project. + +Command | Description | +--- | --- +`npm start` | start a development server for the demo app +`npm test` | run tests +`npm run test:coverage` | run tests and produce a code coverage report in `coverage/` +`npm run test:watch` | start a test server and re-run tests on every change +`npm run build` | prepare for publishing to npm +`npm run clean` | delete built resources + +#### see also: +- [Developing React Components and Libraries with nwb](https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb) diff --git a/build/index.js b/build/index.js deleted file mode 100644 index 24e28795..00000000 --- a/build/index.js +++ /dev/null @@ -1,18344 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(require("react"), require("react-dom")); - else if(typeof define === 'function' && define.amd) - define("@CoreUI/React", ["react", "react-dom"], factory); - else if(typeof exports === 'object') - exports["@CoreUI/React"] = factory(require("react"), require("react-dom")); - else - root["@CoreUI/React"] = factory(root["React"], root["ReactDOM"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_68__) { -return /******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 31); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_0__; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -if (process.env.NODE_ENV !== 'production') { - var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; - - var isValidElement = function(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; - }; - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = __webpack_require__(33)(isValidElement, throwOnDirectAccess); -} else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = __webpack_require__(36)(); -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = function() {}; - -if (process.env.NODE_ENV !== 'production') { - warning = function(condition, format, args) { - var len = arguments.length; - args = new Array(len > 2 ? len - 2 : 0); - for (var key = 2; key < len; key++) { - args[key - 2] = arguments[key]; - } - if (format === undefined) { - throw new Error( - '`warning(condition, format, ...args)` requires a warning ' + - 'message argument' - ); - } - - if (format.length < 10 || (/^[s\W]*$/).test(format)) { - throw new Error( - 'The warning format should be able to uniquely identify this ' + - 'warning. Please, use a more descriptive format than: ' + format - ); - } - - if (!condition) { - var argIndex = 0; - var message = 'Warning: ' + - format.replace(/%s/g, function() { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch(x) {} - } - }; -} - -module.exports = warning; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ - -(function () { - 'use strict'; - - var hasOwn = {}.hasOwnProperty; - - function classNames () { - var classes = []; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - - var argType = typeof arg; - - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (Array.isArray(arg)) { - classes.push(classNames.apply(null, arg)); - } else if (argType === 'object') { - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } - } - - return classes.join(' '); - } - - if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { - return classNames; - }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - window.classNames = classNames; - } -}()); - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var invariant = function(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; - -module.exports = invariant; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.asideMenuCssClasses = exports.sidebarCssClasses = undefined; - -var _classes = __webpack_require__(37); - -exports.sidebarCssClasses = _classes.sidebarCssClasses; -exports.asideMenuCssClasses = _classes.asideMenuCssClasses; - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -var addLeadingSlash = exports.addLeadingSlash = function addLeadingSlash(path) { - return path.charAt(0) === '/' ? path : '/' + path; -}; - -var stripLeadingSlash = exports.stripLeadingSlash = function stripLeadingSlash(path) { - return path.charAt(0) === '/' ? path.substr(1) : path; -}; - -var hasBasename = exports.hasBasename = function hasBasename(path, prefix) { - return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); -}; - -var stripBasename = exports.stripBasename = function stripBasename(path, prefix) { - return hasBasename(path, prefix) ? path.substr(prefix.length) : path; -}; - -var stripTrailingSlash = exports.stripTrailingSlash = function stripTrailingSlash(path) { - return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; -}; - -var parsePath = exports.parsePath = function parsePath(path) { - var pathname = path || '/'; - var search = ''; - var hash = ''; - - var hashIndex = pathname.indexOf('#'); - if (hashIndex !== -1) { - hash = pathname.substr(hashIndex); - pathname = pathname.substr(0, hashIndex); - } - - var searchIndex = pathname.indexOf('?'); - if (searchIndex !== -1) { - search = pathname.substr(searchIndex); - pathname = pathname.substr(0, searchIndex); - } - - return { - pathname: pathname, - search: search === '?' ? '' : search, - hash: hash === '#' ? '' : hash - }; -}; - -var createPath = exports.createPath = function createPath(location) { - var pathname = location.pathname, - search = location.search, - hash = location.hash; - - - var path = pathname || '/'; - - if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search; - - if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash; - - return path; -}; - -/***/ }), -/* 8 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addLeadingSlash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return stripLeadingSlash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hasBasename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return stripBasename; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return stripTrailingSlash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return parsePath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createPath; }); -var addLeadingSlash = function addLeadingSlash(path) { - return path.charAt(0) === '/' ? path : '/' + path; -}; - -var stripLeadingSlash = function stripLeadingSlash(path) { - return path.charAt(0) === '/' ? path.substr(1) : path; -}; - -var hasBasename = function hasBasename(path, prefix) { - return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path); -}; - -var stripBasename = function stripBasename(path, prefix) { - return hasBasename(path, prefix) ? path.substr(prefix.length) : path; -}; - -var stripTrailingSlash = function stripTrailingSlash(path) { - return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path; -}; - -var parsePath = function parsePath(path) { - var pathname = path || '/'; - var search = ''; - var hash = ''; - - var hashIndex = pathname.indexOf('#'); - if (hashIndex !== -1) { - hash = pathname.substr(hashIndex); - pathname = pathname.substr(0, hashIndex); - } - - var searchIndex = pathname.indexOf('?'); - if (searchIndex !== -1) { - search = pathname.substr(searchIndex); - pathname = pathname.substr(0, searchIndex); - } - - return { - pathname: pathname, - search: search === '?' ? '' : search, - hash: hash === '#' ? '' : hash - }; -}; - -var createPath = function createPath(location) { - var pathname = location.pathname, - search = location.search, - hash = location.hash; - - - var path = pathname || '/'; - - if (search && search !== '?') path += search.charAt(0) === '?' ? search : '?' + search; - - if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : '#' + hash; - - return path; -}; - -/***/ }), -/* 9 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createLocation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return locationsAreEqual; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_resolve_pathname__ = __webpack_require__(23); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_value_equal__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__PathUtils__ = __webpack_require__(8); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - - - - -var createLocation = function createLocation(path, state, key, currentLocation) { - var location = void 0; - if (typeof path === 'string') { - // Two-arg form: push(path, state) - location = Object(__WEBPACK_IMPORTED_MODULE_2__PathUtils__["d" /* parsePath */])(path); - location.state = state; - } else { - // One-arg form: push(location) - location = _extends({}, path); - - if (location.pathname === undefined) location.pathname = ''; - - if (location.search) { - if (location.search.charAt(0) !== '?') location.search = '?' + location.search; - } else { - location.search = ''; - } - - if (location.hash) { - if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; - } else { - location.hash = ''; - } - - if (state !== undefined && location.state === undefined) location.state = state; - } - - try { - location.pathname = decodeURI(location.pathname); - } catch (e) { - if (e instanceof URIError) { - throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); - } else { - throw e; - } - } - - if (key) location.key = key; - - if (currentLocation) { - // Resolve incomplete/relative pathname relative to current location. - if (!location.pathname) { - location.pathname = currentLocation.pathname; - } else if (location.pathname.charAt(0) !== '/') { - location.pathname = Object(__WEBPACK_IMPORTED_MODULE_0_resolve_pathname__["default"])(location.pathname, currentLocation.pathname); - } - } else { - // When there is no prior location and pathname is empty, set it to / - if (!location.pathname) { - location.pathname = '/'; - } - } - - return location; -}; - -var locationsAreEqual = function locationsAreEqual(a, b) { - return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && Object(__WEBPACK_IMPORTED_MODULE_1_value_equal__["default"])(a.state, b.state); -}; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; - -module.exports = emptyFunction; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var validateFormat = function validateFormat(format) {}; - -if (process.env.NODE_ENV !== 'production') { - validateFormat = function validateFormat(format) { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - }; -} - -function invariant(condition, format, a, b, c, d, e, f) { - validateFormat(format); - - if (!condition) { - var error; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -} - -module.exports = invariant; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.locationsAreEqual = exports.createLocation = undefined; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _resolvePathname = __webpack_require__(23); - -var _resolvePathname2 = _interopRequireDefault(_resolvePathname); - -var _valueEqual = __webpack_require__(24); - -var _valueEqual2 = _interopRequireDefault(_valueEqual); - -var _PathUtils = __webpack_require__(7); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var createLocation = exports.createLocation = function createLocation(path, state, key, currentLocation) { - var location = void 0; - if (typeof path === 'string') { - // Two-arg form: push(path, state) - location = (0, _PathUtils.parsePath)(path); - location.state = state; - } else { - // One-arg form: push(location) - location = _extends({}, path); - - if (location.pathname === undefined) location.pathname = ''; - - if (location.search) { - if (location.search.charAt(0) !== '?') location.search = '?' + location.search; - } else { - location.search = ''; - } - - if (location.hash) { - if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash; - } else { - location.hash = ''; - } - - if (state !== undefined && location.state === undefined) location.state = state; - } - - try { - location.pathname = decodeURI(location.pathname); - } catch (e) { - if (e instanceof URIError) { - throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.'); - } else { - throw e; - } - } - - if (key) location.key = key; - - if (currentLocation) { - // Resolve incomplete/relative pathname relative to current location. - if (!location.pathname) { - location.pathname = currentLocation.pathname; - } else if (location.pathname.charAt(0) !== '/') { - location.pathname = (0, _resolvePathname2.default)(location.pathname, currentLocation.pathname); - } - } else { - // When there is no prior location and pathname is empty, set it to / - if (!location.pathname) { - location.pathname = '/'; - } - } - - return location; -}; - -var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a, b) { - return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && (0, _valueEqual2.default)(a.state, b.state); -}; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _warning = __webpack_require__(2); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var createTransitionManager = function createTransitionManager() { - var prompt = null; - - var setPrompt = function setPrompt(nextPrompt) { - (0, _warning2.default)(prompt == null, 'A history supports only one prompt at a time'); - - prompt = nextPrompt; - - return function () { - if (prompt === nextPrompt) prompt = null; - }; - }; - - var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) { - // TODO: If another transition starts while we're still confirming - // the previous one, we may end up in a weird state. Figure out the - // best way to handle this. - if (prompt != null) { - var result = typeof prompt === 'function' ? prompt(location, action) : prompt; - - if (typeof result === 'string') { - if (typeof getUserConfirmation === 'function') { - getUserConfirmation(result, callback); - } else { - (0, _warning2.default)(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); - - callback(true); - } - } else { - // Return false from a transition hook to cancel the transition. - callback(result !== false); - } - } else { - callback(true); - } - }; - - var listeners = []; - - var appendListener = function appendListener(fn) { - var isActive = true; - - var listener = function listener() { - if (isActive) fn.apply(undefined, arguments); - }; - - listeners.push(listener); - - return function () { - isActive = false; - listeners = listeners.filter(function (item) { - return item !== listener; - }); - }; - }; - - var notifyListeners = function notifyListeners() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - listeners.forEach(function (listener) { - return listener.apply(undefined, args); - }); - }; - - return { - setPrompt: setPrompt, - confirmTransitionTo: confirmTransitionTo, - appendListener: appendListener, - notifyListeners: notifyListeners - }; -}; - -exports.default = createTransitionManager; - -/***/ }), -/* 15 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Router__ = __webpack_require__(16); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Router__["a" /* default */]); - -/***/ }), -/* 16 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - -/** - * The public API for putting history on context. - */ - -var Router = function (_React$Component) { - _inherits(Router, _React$Component); - - function Router() { - var _temp, _this, _ret; - - _classCallCheck(this, Router); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { - match: _this.computeMatch(_this.props.history.location.pathname) - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - Router.prototype.getChildContext = function getChildContext() { - return { - router: _extends({}, this.context.router, { - history: this.props.history, - route: { - location: this.props.history.location, - match: this.state.match - } - }) - }; - }; - - Router.prototype.computeMatch = function computeMatch(pathname) { - return { - path: '/', - url: '/', - params: {}, - isExact: pathname === '/' - }; - }; - - Router.prototype.componentWillMount = function componentWillMount() { - var _this2 = this; - - var _props = this.props, - children = _props.children, - history = _props.history; - - - __WEBPACK_IMPORTED_MODULE_1_invariant___default()(children == null || __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 1, 'A may have only one child element'); - - // Do this here so we can setState when a changes the - // location in componentWillMount. This happens e.g. when doing - // server rendering using a . - this.unlisten = history.listen(function () { - _this2.setState({ - match: _this2.computeMatch(history.location.pathname) - }); - }); - }; - - Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(this.props.history === nextProps.history, 'You cannot change '); - }; - - Router.prototype.componentWillUnmount = function componentWillUnmount() { - this.unlisten(); - }; - - Router.prototype.render = function render() { - var children = this.props.children; - - return children ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children) : null; - }; - - return Router; -}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component); - -Router.propTypes = { - history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired, - children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node -}; -Router.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object -}; -Router.childContextTypes = { - router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired -}; - - -/* harmony default export */ __webpack_exports__["a"] = (Router); - -/***/ }), -/* 17 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(48); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__); - - -var patternCache = {}; -var cacheLimit = 10000; -var cacheCount = 0; - -var compilePath = function compilePath(pattern, options) { - var cacheKey = '' + options.end + options.strict + options.sensitive; - var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {}); - - if (cache[pattern]) return cache[pattern]; - - var keys = []; - var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default()(pattern, keys, options); - var compiledPattern = { re: re, keys: keys }; - - if (cacheCount < cacheLimit) { - cache[pattern] = compiledPattern; - cacheCount++; - } - - return compiledPattern; -}; - -/** - * Public API for matching a URL pathname to a path pattern. - */ -var matchPath = function matchPath(pathname) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - if (typeof options === 'string') options = { path: options }; - - var _options = options, - _options$path = _options.path, - path = _options$path === undefined ? '/' : _options$path, - _options$exact = _options.exact, - exact = _options$exact === undefined ? false : _options$exact, - _options$strict = _options.strict, - strict = _options$strict === undefined ? false : _options$strict, - _options$sensitive = _options.sensitive, - sensitive = _options$sensitive === undefined ? false : _options$sensitive; - - var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }), - re = _compilePath.re, - keys = _compilePath.keys; - - var match = re.exec(pathname); - - if (!match) return null; - - var url = match[0], - values = match.slice(1); - - var isExact = pathname === url; - - if (exact && !isExact) return null; - - return { - path: path, // the path pattern used to match - url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL - isExact: isExact, // whether or not we matched exactly - params: keys.reduce(function (memo, key, index) { - memo[key.name] = values[index]; - return memo; - }, {}) - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (matchPath); - -/***/ }), -/* 18 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); - - -var createTransitionManager = function createTransitionManager() { - var prompt = null; - - var setPrompt = function setPrompt(nextPrompt) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(prompt == null, 'A history supports only one prompt at a time'); - - prompt = nextPrompt; - - return function () { - if (prompt === nextPrompt) prompt = null; - }; - }; - - var confirmTransitionTo = function confirmTransitionTo(location, action, getUserConfirmation, callback) { - // TODO: If another transition starts while we're still confirming - // the previous one, we may end up in a weird state. Figure out the - // best way to handle this. - if (prompt != null) { - var result = typeof prompt === 'function' ? prompt(location, action) : prompt; - - if (typeof result === 'string') { - if (typeof getUserConfirmation === 'function') { - getUserConfirmation(result, callback); - } else { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(false, 'A history needs a getUserConfirmation function in order to use a prompt message'); - - callback(true); - } - } else { - // Return false from a transition hook to cancel the transition. - callback(result !== false); - } - } else { - callback(true); - } - }; - - var listeners = []; - - var appendListener = function appendListener(fn) { - var isActive = true; - - var listener = function listener() { - if (isActive) fn.apply(undefined, arguments); - }; - - listeners.push(listener); - - return function () { - isActive = false; - listeners = listeners.filter(function (item) { - return item !== listener; - }); - }; - }; - - var notifyListeners = function notifyListeners() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - listeners.forEach(function (listener) { - return listener.apply(undefined, args); - }); - }; - - return { - setPrompt: setPrompt, - confirmTransitionTo: confirmTransitionTo, - appendListener: appendListener, - notifyListeners: notifyListeners - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (createTransitionManager); - -/***/ }), -/* 19 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Alert", function() { return Alert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Container", function() { return Container; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Row", function() { return Row; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Col", function() { return Col; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Navbar", function() { return Navbar; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavbarBrand", function() { return NavbarBrand; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavbarToggler", function() { return NavbarToggler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nav", function() { return Nav; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavItem", function() { return NavItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavDropdown", function() { return NavDropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavLink", function() { return NavLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Breadcrumb", function() { return Breadcrumb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BreadcrumbItem", function() { return BreadcrumbItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return Button; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ButtonDropdown", function() { return ButtonDropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return ButtonGroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ButtonToolbar", function() { return ButtonToolbar; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return Dropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownItem", function() { return DropdownItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return DropdownMenu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DropdownToggle", function() { return DropdownToggle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Fade", function() { return Fade; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Badge", function() { return Badge; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Card", function() { return Card; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardLink", function() { return CardLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardGroup", function() { return CardGroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardDeck", function() { return CardDeck; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardColumns", function() { return CardColumns; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardBody", function() { return CardBody; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardBlock", function() { return CardBlock; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardFooter", function() { return CardFooter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardHeader", function() { return CardHeader; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardImg", function() { return CardImg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardImgOverlay", function() { return CardImgOverlay; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Carousel", function() { return Carousel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UncontrolledCarousel", function() { return UncontrolledCarousel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CarouselControl", function() { return CarouselControl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CarouselItem", function() { return CarouselItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CarouselIndicators", function() { return CarouselIndicators; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CarouselCaption", function() { return CarouselCaption; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardSubtitle", function() { return CardSubtitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardText", function() { return CardText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CardTitle", function() { return CardTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Popover", function() { return Popover; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverContent", function() { return PopoverContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverBody", function() { return PopoverBody; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverTitle", function() { return PopoverTitle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopoverHeader", function() { return PopoverHeader; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Progress", function() { return Progress; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Modal", function() { return Modal; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModalHeader", function() { return ModalHeader; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModalBody", function() { return ModalBody; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ModalFooter", function() { return ModalFooter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopperContent", function() { return PopperContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopperTargetHelper", function() { return PopperTargetHelper; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return Tooltip; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Table", function() { return Table; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListGroup", function() { return ListGroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Form", function() { return Form; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormFeedback", function() { return FormFeedback; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormGroup", function() { return FormGroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FormText", function() { return FormText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputGroup", function() { return InputGroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputGroupAddon", function() { return InputGroupAddon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputGroupButton", function() { return InputGroupButton; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputGroupButtonDropdown", function() { return InputGroupButtonDropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputGroupText", function() { return InputGroupText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Label", function() { return Label; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Media", function() { return Media; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Pagination", function() { return Pagination; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationItem", function() { return PaginationItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PaginationLink", function() { return PaginationLink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabContent", function() { return TabContent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TabPane", function() { return TabPane; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Jumbotron", function() { return Jumbotron; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Collapse", function() { return Collapse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListGroupItem", function() { return ListGroupItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListGroupItemText", function() { return ListGroupItemText; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ListGroupItemHeading", function() { return ListGroupItemHeading; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UncontrolledAlert", function() { return UncontrolledAlert; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UncontrolledButtonDropdown", function() { return UncontrolledButtonDropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UncontrolledDropdown", function() { return UncontrolledDropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UncontrolledNavDropdown", function() { return UncontrolledNavDropdown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UncontrolledTooltip", function() { return UncontrolledTooltip; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Util", function() { return utils; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_isfunction__ = __webpack_require__(66); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_isfunction___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_isfunction__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isobject__ = __webpack_require__(67); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_lodash_isobject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_lodash_isobject__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom__ = __webpack_require__(68); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react_dom__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_popper__ = __webpack_require__(69); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_popper___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_popper__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_tonumber__ = __webpack_require__(75); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_lodash_tonumber___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_lodash_tonumber__); - - - - - - - - - -// https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.4/js/src/modal.js#L436-L443 -function getScrollbarWidth() { - 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 - scrollDiv.style.position = 'absolute'; - scrollDiv.style.top = '-9999px'; - scrollDiv.style.width = '50px'; - scrollDiv.style.height = '50px'; - scrollDiv.style.overflow = 'scroll'; - document.body.appendChild(scrollDiv); - var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; - document.body.removeChild(scrollDiv); - return scrollbarWidth; -} - -function setScrollbarWidth(padding) { - document.body.style.paddingRight = padding > 0 ? padding + 'px' : null; -} - -function isBodyOverflowing() { - return document.body.clientWidth < window.innerWidth; -} - -function getOriginalBodyPadding() { - var style = window.getComputedStyle(document.body, null); - - return parseInt(style && style.getPropertyValue('padding-right') || 0, 10); -} - -function conditionallyUpdateScrollbar() { - var scrollbarWidth = getScrollbarWidth(); - // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433 - var fixedContent = document.querySelectorAll('.fixed-top, .fixed-bottom, .is-fixed, .sticky-top')[0]; - var bodyPadding = fixedContent ? parseInt(fixedContent.style.paddingRight || 0, 10) : 0; - - if (isBodyOverflowing()) { - setScrollbarWidth(bodyPadding + scrollbarWidth); - } -} - -var globalCssModule = void 0; - -function setGlobalCssModule(cssModule) { - globalCssModule = cssModule; -} - -function mapToCssModules() { - var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var cssModule = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalCssModule; - - if (!cssModule) return className; - return className.split(' ').map(function (c) { - return cssModule[c] || c; - }).join(' '); -} - -/** - * Returns a new object with the key/value pairs from `obj` that are not in the array `omitKeys`. - */ -function omit(obj, omitKeys) { - var result = {}; - Object.keys(obj).forEach(function (key) { - if (omitKeys.indexOf(key) === -1) { - result[key] = obj[key]; - } - }); - return result; -} - -/** - * Returns a filtered copy of an object with only the specified keys. - */ -function pick(obj, keys) { - var pickKeys = Array.isArray(keys) ? keys : [keys]; - var length = pickKeys.length; - var key = void 0; - var result = {}; - - while (length > 0) { - length -= 1; - key = pickKeys[length]; - result[key] = obj[key]; - } - return result; -} - -var warned = {}; - -function warnOnce(message) { - if (!warned[message]) { - /* istanbul ignore else */ - if (typeof console !== 'undefined') { - console.error(message); // eslint-disable-line no-console - } - warned[message] = true; - } -} - -function deprecated(propType, explanation) { - return function validate(props, propName, componentName) { - if (props[propName] !== null && typeof props[propName] !== 'undefined') { - warnOnce('"' + propName + '" property of "' + componentName + '" has been deprecated.\n' + explanation); - } - - for (var _len = arguments.length, rest = Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { - rest[_key - 3] = arguments[_key]; - } - - return propType.apply(undefined, [props, propName, componentName].concat(rest)); - }; -} - -function DOMElement(props, propName, componentName) { - if (!(props[propName] instanceof Element)) { - return new Error('Invalid prop `' + propName + '` supplied to `' + componentName + '`. Expected prop to be an instance of Element. Validation failed.'); - } -} - -function getTarget(target) { - if (__WEBPACK_IMPORTED_MODULE_3_lodash_isfunction___default()(target)) { - return target(); - } - - if (typeof target === 'string' && document) { - var selection = document.querySelector(target); - if (selection === null) { - selection = document.querySelector('#' + target); - } - if (selection === null) { - throw new Error('The target \'' + target + '\' could not be identified in the dom, tip: check spelling'); - } - return selection; - } - - return target; -} - -/* eslint key-spacing: ["error", { afterColon: true, align: "value" }] */ -// These are all setup to match what is in the bootstrap _variables.scss -// https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss -var TransitionTimeouts = { - Fade: 150, // $transition-fade - Collapse: 350, // $transition-collapse - Modal: 300, // $modal-transition - Carousel: 600 // $carousel-transition -}; - -// Duplicated Transition.propType keys to ensure that Reactstrap builds -// for distribution properly exclude these keys for nested child HTML attributes -// since `react-transition-group` removes propTypes in production builds. -var TransitionPropTypeKeys = ['in', 'mountOnEnter', 'unmountOnExit', 'appear', 'enter', 'exit', 'timeout', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited']; - -var TransitionStatuses = { - ENTERING: 'entering', - ENTERED: 'entered', - EXITING: 'exiting', - EXITED: 'exited' -}; - -var keyCodes = { - esc: 27, - space: 32, - tab: 9, - up: 38, - down: 40 -}; - -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']; - -var utils = Object.freeze({ - getScrollbarWidth: getScrollbarWidth, - setScrollbarWidth: setScrollbarWidth, - isBodyOverflowing: isBodyOverflowing, - getOriginalBodyPadding: getOriginalBodyPadding, - conditionallyUpdateScrollbar: conditionallyUpdateScrollbar, - setGlobalCssModule: setGlobalCssModule, - mapToCssModules: mapToCssModules, - omit: omit, - pick: pick, - warnOnce: warnOnce, - deprecated: deprecated, - DOMElement: DOMElement, - getTarget: getTarget, - TransitionTimeouts: TransitionTimeouts, - TransitionPropTypeKeys: TransitionPropTypeKeys, - TransitionStatuses: TransitionStatuses, - keyCodes: keyCodes, - PopperPlacements: PopperPlacements -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; -} : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; -}; - - - - - - - - - - - -var classCallCheck = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -var createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); - - - - - -var defineProperty = function (obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - -var _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - - - -var inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -}; - - - - - - - - - -var objectWithoutProperties = function (obj, keys) { - var target = {}; - - for (var i in obj) { - if (keys.indexOf(i) >= 0) continue; - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; - target[i] = obj[i]; - } - - return target; -}; - -var possibleConstructorReturn = function (self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && (typeof call === "object" || typeof call === "function") ? call : self; -}; - -var propTypes = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - fluid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps = { - tag: 'div' -}; - -var Container = function Container(props) { - var className = props.className, - cssModule = props.cssModule, - fluid = props.fluid, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'fluid', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, fluid ? 'container-fluid' : 'container'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Container.propTypes = propTypes; -Container.defaultProps = defaultProps; - -var propTypes$1 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - noGutters: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$1 = { - tag: 'div' -}; - -var Row = function Row(props) { - var className = props.className, - cssModule = props.cssModule, - noGutters = props.noGutters, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'noGutters', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, noGutters ? 'no-gutters' : null, 'row'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Row.propTypes = propTypes$1; -Row.defaultProps = defaultProps$1; - -var colWidths = ['xs', 'sm', 'md', 'lg', 'xl']; -var stringOrNumberProp = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]); - -var columnProps = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - push: deprecated(stringOrNumberProp, 'Please use the prop "order"'), - pull: deprecated(stringOrNumberProp, 'Please use the prop "order"'), - order: stringOrNumberProp, - offset: stringOrNumberProp -})]); - -var propTypes$2 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - xs: columnProps, - sm: columnProps, - md: columnProps, - lg: columnProps, - xl: columnProps, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - widths: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array -}; - -var defaultProps$2 = { - tag: 'div', - widths: colWidths -}; - -var getColumnSizeClass = function getColumnSizeClass(isXs, colWidth, colSize) { - if (colSize === true || colSize === '') { - return isXs ? 'col' : 'col-' + colWidth; - } else if (colSize === 'auto') { - return isXs ? 'col-auto' : 'col-' + colWidth + '-auto'; - } - - return isXs ? 'col-' + colSize : 'col-' + colWidth + '-' + colSize; -}; - -var Col = function Col(props) { - var className = props.className, - cssModule = props.cssModule, - widths = props.widths, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'widths', 'tag']); - - var colClasses = []; - - widths.forEach(function (colWidth, i) { - var columnProp = props[colWidth]; - - if (!i && columnProp === undefined) { - columnProp = true; - } - - delete attributes[colWidth]; - - if (!columnProp && columnProp !== '') { - return; - } - - var isXs = !i; - var colClass = void 0; - - if (__WEBPACK_IMPORTED_MODULE_4_lodash_isobject___default()(columnProp)) { - var _classNames; - - var colSizeInterfix = isXs ? '-' : '-' + colWidth + '-'; - colClass = getColumnSizeClass(isXs, colWidth, columnProp.size); - - colClasses.push(mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()((_classNames = {}, defineProperty(_classNames, colClass, columnProp.size || columnProp.size === ''), defineProperty(_classNames, 'order' + colSizeInterfix + columnProp.order, columnProp.order || columnProp.order === 0), defineProperty(_classNames, 'offset' + colSizeInterfix + columnProp.offset, columnProp.offset || columnProp.offset === 0), _classNames))), cssModule); - } else { - colClass = getColumnSizeClass(isXs, colWidth, columnProp); - colClasses.push(colClass); - } - }); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, colClasses), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Col.propTypes = propTypes$2; -Col.defaultProps = defaultProps$2; - -var propTypes$3 = { - light: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - dark: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - inverse: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the prop "dark"'), - full: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - fixed: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - sticky: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - toggleable: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), 'Please use the prop "expand"'), - expand: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) -}; - -var defaultProps$3 = { - tag: 'nav', - expand: false -}; - -var getExpandClass = function getExpandClass(expand) { - if (expand === false) { - return false; - } else if (expand === true || expand === 'xs') { - return 'navbar-expand'; - } - - return 'navbar-expand-' + expand; -}; - -// To better maintain backwards compatibility while toggleable is deprecated. -// We must map breakpoints to the next breakpoint so that toggleable and expand do the same things at the same breakpoint. -var toggleableToExpand = { - xs: 'sm', - sm: 'md', - md: 'lg', - lg: 'xl' -}; - -var getToggleableClass = function getToggleableClass(toggleable) { - if (toggleable === undefined || toggleable === 'xl') { - return false; - } else if (toggleable === false) { - return 'navbar-expand'; - } - - return 'navbar-expand-' + (toggleable === true ? 'sm' : toggleableToExpand[toggleable] || toggleable); -}; - -var Navbar = function Navbar(props) { - var _classNames; - - var toggleable = props.toggleable, - expand = props.expand, - className = props.className, - cssModule = props.cssModule, - light = props.light, - dark = props.dark, - inverse = props.inverse, - fixed = props.fixed, - sticky = props.sticky, - color = props.color, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['toggleable', 'expand', 'className', 'cssModule', 'light', 'dark', 'inverse', 'fixed', 'sticky', 'color', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'navbar', getExpandClass(expand) || getToggleableClass(toggleable), (_classNames = { - 'navbar-light': light, - 'navbar-dark': inverse || dark - }, defineProperty(_classNames, 'bg-' + color, color), defineProperty(_classNames, 'fixed-' + fixed, fixed), defineProperty(_classNames, 'sticky-' + sticky, sticky), _classNames)), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Navbar.propTypes = propTypes$3; -Navbar.defaultProps = defaultProps$3; - -var propTypes$4 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$4 = { - tag: 'a' -}; - -var NavbarBrand = function NavbarBrand(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'navbar-brand'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -NavbarBrand.propTypes = propTypes$4; -NavbarBrand.defaultProps = defaultProps$4; - -var propTypes$5 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - type: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node -}; - -var defaultProps$5 = { - tag: 'button', - type: 'button' -}; - -var NavbarToggler = function NavbarToggler(props) { - var className = props.className, - cssModule = props.cssModule, - children = props.children, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'children', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'navbar-toggler'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Tag, - _extends({}, attributes, { className: classes }), - children || __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span', { className: mapToCssModules('navbar-toggler-icon', cssModule) }) - ); -}; - -NavbarToggler.propTypes = propTypes$5; -NavbarToggler.defaultProps = defaultProps$5; - -var propTypes$6 = { - tabs: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - pills: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - vertical: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - horizontal: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - justified: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - fill: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - navbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - card: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$6 = { - tag: 'ul', - vertical: false -}; - -var getVerticalClass = function getVerticalClass(vertical) { - if (vertical === false) { - return false; - } else if (vertical === true || vertical === 'xs') { - return 'flex-column'; - } - - return 'flex-' + vertical + '-column'; -}; - -var Nav = function Nav(props) { - var className = props.className, - cssModule = props.cssModule, - tabs = props.tabs, - pills = props.pills, - vertical = props.vertical, - horizontal = props.horizontal, - justified = props.justified, - fill = props.fill, - navbar = props.navbar, - card = props.card, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tabs', 'pills', 'vertical', 'horizontal', 'justified', 'fill', 'navbar', 'card', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, navbar ? 'navbar-nav' : 'nav', horizontal ? 'justify-content-' + horizontal : false, getVerticalClass(vertical), { - 'nav-tabs': tabs, - 'card-header-tabs': card && tabs, - 'nav-pills': pills, - 'card-header-pills': card && pills, - 'nav-justified': justified, - 'nav-fill': fill - }), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Nav.propTypes = propTypes$6; -Nav.defaultProps = defaultProps$6; - -var propTypes$7 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$7 = { - tag: 'li' -}; - -var NavItem = function NavItem(props) { - var className = props.className, - cssModule = props.cssModule, - active = props.active, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'active', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'nav-item', active ? 'active' : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -NavItem.propTypes = propTypes$7; -NavItem.defaultProps = defaultProps$7; - -/* eslint react/no-find-dom-node: 0 */ -// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md - -var propTypes$8 = { - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - dropup: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - group: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - nav: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append'])]), - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool -}; - -var defaultProps$8 = { - isOpen: false, - dropup: false, - nav: false, - addonType: false, - inNavbar: false -}; - -var childContextTypes = { - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, - dropup: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, - inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired -}; - -var Dropdown = function (_React$Component) { - inherits(Dropdown, _React$Component); - - function Dropdown(props) { - classCallCheck(this, Dropdown); - - var _this = possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props)); - - _this.addEvents = _this.addEvents.bind(_this); - _this.handleDocumentClick = _this.handleDocumentClick.bind(_this); - _this.handleKeyDown = _this.handleKeyDown.bind(_this); - _this.removeEvents = _this.removeEvents.bind(_this); - _this.toggle = _this.toggle.bind(_this); - return _this; - } - - createClass(Dropdown, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - toggle: this.props.toggle, - isOpen: this.props.isOpen, - dropup: this.props.dropup, - inNavbar: this.props.inNavbar - }; - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this.handleProps(); - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (this.props.isOpen !== prevProps.isOpen) { - this.handleProps(); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.removeEvents(); - } - }, { - key: 'getContainer', - value: function getContainer() { - return __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.findDOMNode(this); - } - }, { - key: 'addEvents', - value: function addEvents() { - var _this2 = this; - - ['click', 'touchstart', 'keyup'].forEach(function (event) { - return document.addEventListener(event, _this2.handleDocumentClick, true); - }); - } - }, { - key: 'removeEvents', - value: function removeEvents() { - var _this3 = this; - - ['click', 'touchstart', 'keyup'].forEach(function (event) { - return document.removeEventListener(event, _this3.handleDocumentClick, true); - }); - } - }, { - key: 'handleDocumentClick', - value: function handleDocumentClick(e) { - if (e && (e.which === 3 || e.type === 'keyup' && e.which !== keyCodes.tab)) return; - var container = this.getContainer(); - - if (container.contains(e.target) && container !== e.target && (e.type !== 'keyup' || e.which === keyCodes.tab)) { - return; - } - - this.toggle(e); - } - }, { - key: 'handleKeyDown', - value: function handleKeyDown(e) { - if ([keyCodes.esc, keyCodes.up, keyCodes.down, keyCodes.space].indexOf(e.which) === -1 || /button/i.test(e.target.tagName) && e.which === keyCodes.space || /input|textarea/i.test(e.target.tagName)) { - return; - } - - e.preventDefault(); - if (this.props.disabled) return; - - var container = this.getContainer(); - - if (e.which === keyCodes.space && this.props.isOpen && container !== e.target) { - e.target.click(); - } - - if (e.which === keyCodes.esc || !this.props.isOpen) { - this.toggle(e); - container.querySelector('[aria-expanded]').focus(); - return; - } - - var menuClass = mapToCssModules('dropdown-menu', this.props.cssModule); - var itemClass = mapToCssModules('dropdown-item', this.props.cssModule); - var disabledClass = mapToCssModules('disabled', this.props.cssModule); - - var items = container.querySelectorAll('.' + menuClass + ' .' + itemClass + ':not(.' + disabledClass + ')'); - - if (!items.length) return; - - var index = -1; - for (var i = 0; i < items.length; i += 1) { - if (items[i] === e.target) { - index = i; - break; - } - } - - if (e.which === keyCodes.up && index > 0) { - index -= 1; - } - - if (e.which === keyCodes.down && index < items.length - 1) { - index += 1; - } - - if (index < 0) { - index = 0; - } - - items[index].focus(); - } - }, { - key: 'handleProps', - value: function handleProps() { - if (this.props.isOpen) { - this.addEvents(); - } else { - this.removeEvents(); - } - } - }, { - key: 'toggle', - value: function toggle(e) { - if (this.props.disabled) { - return e && e.preventDefault(); - } - - return this.props.toggle(e); - } - }, { - key: 'render', - value: function render() { - var _classNames; - - var _omit = omit(this.props, ['toggle', 'disabled', 'inNavbar']), - className = _omit.className, - cssModule = _omit.cssModule, - dropup = _omit.dropup, - isOpen = _omit.isOpen, - group = _omit.group, - size = _omit.size, - nav = _omit.nav, - addonType = _omit.addonType, - attrs = objectWithoutProperties(_omit, ['className', 'cssModule', 'dropup', 'isOpen', 'group', 'size', 'nav', 'addonType']); - - attrs.tag = attrs.tag || (nav ? 'li' : 'div'); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, (_classNames = {}, defineProperty(_classNames, 'input-group-' + addonType, addonType), defineProperty(_classNames, 'btn-group', group), defineProperty(_classNames, 'btn-group-' + size, !!size), defineProperty(_classNames, 'dropdown', !group && !addonType), defineProperty(_classNames, 'show', isOpen), defineProperty(_classNames, 'dropup', dropup), defineProperty(_classNames, 'nav-item', nav), _classNames)), cssModule); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6_react_popper__["Manager"], _extends({}, attrs, { className: classes, onKeyDown: this.handleKeyDown })); - } - }]); - return Dropdown; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Dropdown.propTypes = propTypes$8; -Dropdown.defaultProps = defaultProps$8; -Dropdown.childContextTypes = childContextTypes; - -function NavDropdown(props) { - warnOnce('The "NavDropdown" component has been deprecated.\nPlease use component "Dropdown" with nav prop.'); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, _extends({ nav: true }, props)); -} - -var propTypes$9 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - href: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any -}; - -var defaultProps$9 = { - tag: 'a' -}; - -var NavLink = function (_React$Component) { - inherits(NavLink, _React$Component); - - function NavLink(props) { - classCallCheck(this, NavLink); - - var _this = possibleConstructorReturn(this, (NavLink.__proto__ || Object.getPrototypeOf(NavLink)).call(this, props)); - - _this.onClick = _this.onClick.bind(_this); - return _this; - } - - createClass(NavLink, [{ - key: 'onClick', - value: function onClick(e) { - if (this.props.disabled) { - e.preventDefault(); - return; - } - - if (this.props.href === '#') { - e.preventDefault(); - } - - if (this.props.onClick) { - this.props.onClick(e); - } - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - cssModule = _props.cssModule, - active = _props.active, - Tag = _props.tag, - innerRef = _props.innerRef, - attributes = objectWithoutProperties(_props, ['className', 'cssModule', 'active', 'tag', 'innerRef']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'nav-link', { - disabled: attributes.disabled, - active: active - }), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, onClick: this.onClick, className: classes })); - } - }]); - return NavLink; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -NavLink.propTypes = propTypes$9; -NavLink.defaultProps = defaultProps$9; - -var propTypes$10 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$10 = { - tag: 'ol' -}; - -var Breadcrumb = function Breadcrumb(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'breadcrumb'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Breadcrumb.propTypes = propTypes$10; -Breadcrumb.defaultProps = defaultProps$10; - -var propTypes$11 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$11 = { - tag: 'li' -}; - -var BreadcrumbItem = function BreadcrumbItem(props) { - var className = props.className, - cssModule = props.cssModule, - active = props.active, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'active', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, active ? 'active' : false, 'breadcrumb-item'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -BreadcrumbItem.propTypes = propTypes$11; -BreadcrumbItem.defaultProps = defaultProps$11; - -var propTypes$12 = { - active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - outline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$12 = { - color: 'secondary', - tag: 'button' -}; - -var Button = function (_React$Component) { - inherits(Button, _React$Component); - - function Button(props) { - classCallCheck(this, Button); - - var _this = possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props)); - - _this.onClick = _this.onClick.bind(_this); - return _this; - } - - createClass(Button, [{ - key: 'onClick', - value: function onClick(e) { - if (this.props.disabled) { - e.preventDefault(); - return; - } - - if (this.props.onClick) { - this.props.onClick(e); - } - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - active = _props.active, - block = _props.block, - className = _props.className, - cssModule = _props.cssModule, - color = _props.color, - outline = _props.outline, - size = _props.size, - Tag = _props.tag, - innerRef = _props.innerRef, - attributes = objectWithoutProperties(_props, ['active', 'block', 'className', 'cssModule', 'color', 'outline', 'size', 'tag', 'innerRef']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'btn', 'btn' + (outline ? '-outline' : '') + '-' + color, size ? 'btn-' + size : false, block ? 'btn-block' : false, { active: active, disabled: this.props.disabled }), cssModule); - - if (attributes.href && Tag === 'button') { - Tag = 'a'; - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ - type: Tag === 'button' && attributes.onClick ? 'button' : undefined - }, attributes, { - className: classes, - ref: innerRef, - onClick: this.onClick - })); - } - }]); - return Button; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Button.propTypes = propTypes$12; -Button.defaultProps = defaultProps$12; - -var propTypes$13 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node -}; - -var ButtonDropdown = function ButtonDropdown(props) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, _extends({ group: true }, props)); -}; - -ButtonDropdown.propTypes = propTypes$13; - -var propTypes$14 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - 'aria-label': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - vertical: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool -}; - -var defaultProps$13 = { - tag: 'div', - role: 'group' -}; - -var ButtonGroup = function ButtonGroup(props) { - var className = props.className, - cssModule = props.cssModule, - size = props.size, - vertical = props.vertical, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'size', 'vertical', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, size ? 'btn-group-' + size : false, vertical ? 'btn-group-vertical' : 'btn-group'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ButtonGroup.propTypes = propTypes$14; -ButtonGroup.defaultProps = defaultProps$13; - -var propTypes$15 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - 'aria-label': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -var defaultProps$14 = { - tag: 'div', - role: 'toolbar' -}; - -var ButtonToolbar = function ButtonToolbar(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'btn-toolbar'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ButtonToolbar.propTypes = propTypes$15; -ButtonToolbar.defaultProps = defaultProps$14; - -var propTypes$16 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - divider: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - header: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool -}; - -var contextTypes = { - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func -}; - -var defaultProps$15 = { - tag: 'button', - toggle: true -}; - -var DropdownItem = function (_React$Component) { - inherits(DropdownItem, _React$Component); - - function DropdownItem(props) { - classCallCheck(this, DropdownItem); - - var _this = possibleConstructorReturn(this, (DropdownItem.__proto__ || Object.getPrototypeOf(DropdownItem)).call(this, props)); - - _this.onClick = _this.onClick.bind(_this); - _this.getTabIndex = _this.getTabIndex.bind(_this); - return _this; - } - - createClass(DropdownItem, [{ - key: 'onClick', - value: function onClick(e) { - if (this.props.disabled || this.props.header || this.props.divider) { - e.preventDefault(); - return; - } - - if (this.props.onClick) { - this.props.onClick(e); - } - - if (this.props.toggle) { - this.context.toggle(e); - } - } - }, { - key: 'getTabIndex', - value: function getTabIndex() { - if (this.props.disabled || this.props.header || this.props.divider) { - return '-1'; - } - - return '0'; - } - }, { - key: 'render', - value: function render() { - var tabIndex = this.getTabIndex(); - - var _omit = omit(this.props, ['toggle']), - className = _omit.className, - cssModule = _omit.cssModule, - divider = _omit.divider, - Tag = _omit.tag, - header = _omit.header, - active = _omit.active, - props = objectWithoutProperties(_omit, ['className', 'cssModule', 'divider', 'tag', 'header', 'active']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, { - disabled: props.disabled, - 'dropdown-item': !divider && !header, - active: active, - 'dropdown-header': header, - 'dropdown-divider': divider - }), cssModule); - - if (Tag === 'button') { - if (header) { - Tag = 'h6'; - } else if (divider) { - Tag = 'div'; - } else if (props.href) { - Tag = 'a'; - } - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ - type: Tag === 'button' && (props.onClick || this.props.toggle) ? 'button' : undefined - }, props, { - tabIndex: tabIndex, - className: classes, - onClick: this.onClick - })); - } - }]); - return DropdownItem; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -DropdownItem.propTypes = propTypes$16; -DropdownItem.defaultProps = defaultProps$15; -DropdownItem.contextTypes = contextTypes; - -var propTypes$17 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node.isRequired, - right: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - flip: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$16 = { - tag: 'div', - flip: true -}; - -var contextTypes$1 = { - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, - dropup: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, - inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired -}; - -var noFlipModifier = { flip: { enabled: false } }; - -var DropdownMenu = function DropdownMenu(props, context) { - var className = props.className, - cssModule = props.cssModule, - right = props.right, - tag = props.tag, - flip = props.flip, - attrs = objectWithoutProperties(props, ['className', 'cssModule', 'right', 'tag', 'flip']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'dropdown-menu', { - 'dropdown-menu-right': right, - show: context.isOpen - }), cssModule); - - var Tag = tag; - - if (context.isOpen && !context.inNavbar) { - Tag = __WEBPACK_IMPORTED_MODULE_6_react_popper__["Popper"]; - var position1 = context.dropup ? 'top' : 'bottom'; - var position2 = right ? 'end' : 'start'; - attrs.placement = position1 + '-' + position2; - attrs.component = tag; - attrs.modifiers = !flip ? noFlipModifier : undefined; - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ - tabIndex: '-1', - role: 'menu' - }, attrs, { - 'aria-hidden': !context.isOpen, - className: classes - })); -}; - -DropdownMenu.propTypes = propTypes$17; -DropdownMenu.defaultProps = defaultProps$16; -DropdownMenu.contextTypes = contextTypes$1; - -var propTypes$18 = { - caret: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - 'aria-haspopup': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - split: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - nav: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool -}; - -var defaultProps$17 = { - 'aria-haspopup': true, - color: 'secondary' -}; - -var contextTypes$2 = { - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - inNavbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired -}; - -var DropdownToggle = function (_React$Component) { - inherits(DropdownToggle, _React$Component); - - function DropdownToggle(props) { - classCallCheck(this, DropdownToggle); - - var _this = possibleConstructorReturn(this, (DropdownToggle.__proto__ || Object.getPrototypeOf(DropdownToggle)).call(this, props)); - - _this.onClick = _this.onClick.bind(_this); - return _this; - } - - createClass(DropdownToggle, [{ - key: 'onClick', - value: function onClick(e) { - if (this.props.disabled) { - e.preventDefault(); - return; - } - - if (this.props.nav && !this.props.tag) { - e.preventDefault(); - } - - if (this.props.onClick) { - this.props.onClick(e); - } - - this.context.toggle(e); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - color = _props.color, - cssModule = _props.cssModule, - caret = _props.caret, - split = _props.split, - nav = _props.nav, - tag = _props.tag, - props = objectWithoutProperties(_props, ['className', 'color', 'cssModule', 'caret', 'split', 'nav', 'tag']); - - var ariaLabel = props['aria-label'] || 'Toggle Dropdown'; - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, { - 'dropdown-toggle': caret || split, - 'dropdown-toggle-split': split, - 'nav-link': nav - }), cssModule); - var children = props.children || __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'span', - { className: 'sr-only' }, - ariaLabel - ); - - var Tag = void 0; - - if (nav && !tag) { - Tag = 'a'; - props.href = '#'; - } else if (!tag) { - Tag = Button; - props.color = color; - props.cssModule = cssModule; - } else { - Tag = tag; - } - - if (this.context.inNavbar) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, props, { - className: classes, - onClick: this.onClick, - 'aria-expanded': this.context.isOpen, - children: children - })); - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6_react_popper__["Target"], _extends({}, props, { - className: classes, - component: Tag, - onClick: this.onClick, - 'aria-expanded': this.context.isOpen, - children: children - })); - } - }]); - return DropdownToggle; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -DropdownToggle.propTypes = propTypes$18; -DropdownToggle.defaultProps = defaultProps$17; -DropdownToggle.contextTypes = contextTypes$2; - -function unwrapExports (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var PropTypes$1 = createCommonjsModule(function (module, exports) { - 'use strict'; - - exports.__esModule = true; - exports.classNamesShape = exports.timeoutsShape = undefined; - exports.transitionTimeout = transitionTimeout; - - var _propTypes2 = _interopRequireDefault(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - - function transitionTimeout(transitionType) { - var timeoutPropName = 'transition' + transitionType + 'Timeout'; - var enabledPropName = 'transition' + transitionType; - - return function (props) { - // If the transition is enabled - if (props[enabledPropName]) { - // If no timeout duration is provided - if (props[timeoutPropName] == null) { - return new Error(timeoutPropName + ' wasn\'t supplied to CSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.'); - - // If the duration isn't a number - } else if (typeof props[timeoutPropName] !== 'number') { - return new Error(timeoutPropName + ' must be a number (in milliseconds)'); - } - } - - return null; - }; - } - - var timeoutsShape = exports.timeoutsShape = _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ - enter: _propTypes2.default.number, - exit: _propTypes2.default.number - }).isRequired]); - - var classNamesShape = exports.classNamesShape = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ - enter: _propTypes2.default.string, - exit: _propTypes2.default.string, - active: _propTypes2.default.string - }), _propTypes2.default.shape({ - enter: _propTypes2.default.string, - enterActive: _propTypes2.default.string, - exit: _propTypes2.default.string, - exitActive: _propTypes2.default.string - })]); -}); - -unwrapExports(PropTypes$1); - -var Transition_1 = createCommonjsModule(function (module, exports) { - 'use strict'; - - exports.__esModule = true; - exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined; - - var PropTypes$$1 = _interopRequireWildcard(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a); - - var _react2 = _interopRequireDefault(__WEBPACK_IMPORTED_MODULE_0_react___default.a); - - var _reactDom2 = _interopRequireDefault(__WEBPACK_IMPORTED_MODULE_5_react_dom___default.a); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - - function _interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {};if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; - } - }newObj.default = obj;return newObj; - } - } - - function _objectWithoutProperties(obj, keys) { - var target = {};for (var i in obj) { - if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i]; - }return target; - } - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - - function _possibleConstructorReturn(self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; - } - - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass))); - }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; - } - - var UNMOUNTED = exports.UNMOUNTED = 'unmounted'; - var EXITED = exports.EXITED = 'exited'; - var ENTERING = exports.ENTERING = 'entering'; - var ENTERED = exports.ENTERED = 'entered'; - var EXITING = exports.EXITING = 'exiting'; - - /** - * The Transition component lets you describe a transition from one component - * state to another _over time_ with a simple declarative API. Most commonly - * it's used to animate the mounting and unmounting of a component, but can also - * be used to describe in-place transition states as well. - * - * By default the `Transition` component does not alter the behavior of the - * component it renders, it only tracks "enter" and "exit" states for the components. - * It's up to you to give meaning and effect to those states. For example we can - * add styles to a component when it enters or exits: - * - * ```jsx - * import Transition from 'react-transition-group/Transition'; - * - * const duration = 300; - * - * const defaultStyle = { - * transition: `opacity ${duration}ms ease-in-out`, - * opacity: 0, - * } - * - * const transitionStyles = { - * entering: { opacity: 0 }, - * entered: { opacity: 1 }, - * }; - * - * const Fade = ({ in: inProp }) => ( - * - * {(state) => ( - *
- * I'm A fade Transition! - *
- * )} - *
- * ); - * ``` - * - * As noted the `Transition` component doesn't _do_ anything by itself to its child component. - * What it does do is track transition states over time so you can update the - * component (such as by adding styles or classes) when it changes states. - * - * There are 4 main states a Transition can be in: - * - `ENTERING` - * - `ENTERED` - * - `EXITING` - * - `EXITED` - * - * Transition state is toggled via the `in` prop. When `true` the component begins the - * "Enter" stage. During this stage, the component will shift from its current transition state, - * to `'entering'` for the duration of the transition and then to the `'entered'` stage once - * it's complete. Let's take the following example: - * - * ```jsx - * state= { in: false }; - * - * toggleEnterState = () => { - * this.setState({ in: true }); - * } - * - * render() { - * return ( - *
- * - * - *
- * ); - * } - * ``` - * - * When the button is clicked the component will shift to the `'entering'` state and - * stay there for 500ms (the value of `timeout`) when finally switches to `'entered'`. - * - * When `in` is `false` the same thing happens except the state moves from `'exiting'` to `'exited'`. - */ - - var Transition = function (_React$Component) { - _inherits(Transition, _React$Component); - - function Transition(props, context) { - _classCallCheck(this, Transition); - - var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); - - var parentGroup = context.transitionGroup; - // In the context of a TransitionGroup all enters are really appears - var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear; - - var initialStatus = void 0; - _this.nextStatus = null; - - if (props.in) { - if (appear) { - initialStatus = EXITED; - _this.nextStatus = ENTERING; - } else { - initialStatus = ENTERED; - } - } else { - if (props.unmountOnExit || props.mountOnEnter) { - initialStatus = UNMOUNTED; - } else { - initialStatus = EXITED; - } - } - - _this.state = { status: initialStatus }; - - _this.nextCallback = null; - return _this; - } - - Transition.prototype.getChildContext = function getChildContext() { - return { transitionGroup: null }; // allows for nested Transitions - }; - - Transition.prototype.componentDidMount = function componentDidMount() { - this.updateStatus(true); - }; - - Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - var _ref = this.pendingState || this.state, - status = _ref.status; - - if (nextProps.in) { - if (status === UNMOUNTED) { - this.setState({ status: EXITED }); - } - if (status !== ENTERING && status !== ENTERED) { - this.nextStatus = ENTERING; - } - } else { - if (status === ENTERING || status === ENTERED) { - this.nextStatus = EXITING; - } - } - }; - - Transition.prototype.componentDidUpdate = function componentDidUpdate() { - this.updateStatus(); - }; - - Transition.prototype.componentWillUnmount = function componentWillUnmount() { - this.cancelNextCallback(); - }; - - Transition.prototype.getTimeouts = function getTimeouts() { - var timeout = this.props.timeout; - - var exit = void 0, - enter = void 0, - appear = void 0; - - exit = enter = appear = timeout; - - if (timeout != null && typeof timeout !== 'number') { - exit = timeout.exit; - enter = timeout.enter; - appear = timeout.appear; - } - return { exit: exit, enter: enter, appear: appear }; - }; - - Transition.prototype.updateStatus = function updateStatus() { - var mounting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - var nextStatus = this.nextStatus; - - if (nextStatus !== null) { - this.nextStatus = null; - // nextStatus will always be ENTERING or EXITING. - this.cancelNextCallback(); - var node = _reactDom2.default.findDOMNode(this); - - if (nextStatus === ENTERING) { - this.performEnter(node, mounting); - } else { - this.performExit(node); - } - } else if (this.props.unmountOnExit && this.state.status === EXITED) { - this.setState({ status: UNMOUNTED }); - } - }; - - Transition.prototype.performEnter = function performEnter(node, mounting) { - var _this2 = this; - - var enter = this.props.enter; - - var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting; - - var timeouts = this.getTimeouts(); - - // no enter animation skip right to ENTERED - // if we are mounting and running this it means appear _must_ be set - if (!mounting && !enter) { - this.safeSetState({ status: ENTERED }, function () { - _this2.props.onEntered(node); - }); - return; - } - - this.props.onEnter(node, appearing); - - this.safeSetState({ status: ENTERING }, function () { - _this2.props.onEntering(node, appearing); - - // FIXME: appear timeout? - _this2.onTransitionEnd(node, timeouts.enter, function () { - _this2.safeSetState({ status: ENTERED }, function () { - _this2.props.onEntered(node, appearing); - }); - }); - }); - }; - - Transition.prototype.performExit = function performExit(node) { - var _this3 = this; - - var exit = this.props.exit; - - var timeouts = this.getTimeouts(); - - // no exit animation skip right to EXITED - if (!exit) { - this.safeSetState({ status: EXITED }, function () { - _this3.props.onExited(node); - }); - return; - } - this.props.onExit(node); - - this.safeSetState({ status: EXITING }, function () { - _this3.props.onExiting(node); - - _this3.onTransitionEnd(node, timeouts.exit, function () { - _this3.safeSetState({ status: EXITED }, function () { - _this3.props.onExited(node); - }); - }); - }); - }; - - Transition.prototype.cancelNextCallback = function cancelNextCallback() { - if (this.nextCallback !== null) { - this.nextCallback.cancel(); - this.nextCallback = null; - } - }; - - Transition.prototype.safeSetState = function safeSetState(nextState, callback) { - var _this4 = this; - - // We need to track pending updates for instances where a cWRP fires quickly - // after cDM and before the state flushes, which would double trigger a - // transition - this.pendingState = nextState; - - // This shouldn't be necessary, but there are weird race conditions with - // setState callbacks and unmounting in testing, so always make sure that - // we can cancel any pending setState callbacks after we unmount. - callback = this.setNextCallback(callback); - this.setState(nextState, function () { - _this4.pendingState = null; - callback(); - }); - }; - - Transition.prototype.setNextCallback = function setNextCallback(callback) { - var _this5 = this; - - var active = true; - - this.nextCallback = function (event) { - if (active) { - active = false; - _this5.nextCallback = null; - - callback(event); - } - }; - - this.nextCallback.cancel = function () { - active = false; - }; - - return this.nextCallback; - }; - - Transition.prototype.onTransitionEnd = function onTransitionEnd(node, timeout, handler) { - this.setNextCallback(handler); - - if (node) { - if (this.props.addEndListener) { - this.props.addEndListener(node, this.nextCallback); - } - if (timeout != null) { - setTimeout(this.nextCallback, timeout); - } - } else { - setTimeout(this.nextCallback, 0); - } - }; - - Transition.prototype.render = function render() { - var status = this.state.status; - if (status === UNMOUNTED) { - return null; - } - - var _props = this.props, - children = _props.children, - childProps = _objectWithoutProperties(_props, ['children']); - // filter props for Transtition - - - delete childProps.in; - delete childProps.mountOnEnter; - delete childProps.unmountOnExit; - delete childProps.appear; - delete childProps.enter; - delete childProps.exit; - delete childProps.timeout; - delete childProps.addEndListener; - delete childProps.onEnter; - delete childProps.onEntering; - delete childProps.onEntered; - delete childProps.onExit; - delete childProps.onExiting; - delete childProps.onExited; - - if (typeof children === 'function') { - return children(status, childProps); - } - - var child = _react2.default.Children.only(children); - return _react2.default.cloneElement(child, childProps); - }; - - return Transition; - }(_react2.default.Component); - - Transition.contextTypes = { - transitionGroup: PropTypes$$1.object - }; - Transition.childContextTypes = { - transitionGroup: function transitionGroup() {} - }; - - Transition.propTypes = process.env.NODE_ENV !== "production" ? { - /** - * A `function` child can be used instead of a React element. - * This function is called with the current transition status - * ('entering', 'entered', 'exiting', 'exited', 'unmounted'), which can used - * to apply context specific props to a component. - * - * ```jsx - * - * {(status) => ( - * - * )} - * - * ``` - */ - children: PropTypes$$1.oneOfType([PropTypes$$1.func.isRequired, PropTypes$$1.element.isRequired]).isRequired, - - /** - * Show the component; triggers the enter or exit states - */ - in: PropTypes$$1.bool, - - /** - * By default the child component is mounted immediately along with - * the parent `Transition` component. If you want to "lazy mount" the component on the - * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay - * mounted, even on "exited", unless you also specify `unmountOnExit`. - */ - mountOnEnter: PropTypes$$1.bool, - - /** - * By default the child component stays mounted after it reaches the `'exited'` state. - * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. - */ - unmountOnExit: PropTypes$$1.bool, - - /** - * Normally a component is not transitioned if it is shown when the `` component mounts. - * If you want to transition on the first mount set `appear` to `true`, and the - * component will transition in as soon as the `` mounts. - * - * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition. - */ - appear: PropTypes$$1.bool, - - /** - * Enable or disable enter transitions. - */ - enter: PropTypes$$1.bool, - - /** - * Enable or disable exit transitions. - */ - exit: PropTypes$$1.bool, - - /** - * The duration of the transition, in milliseconds. - * Required unless `addEventListener` is provided - * - * You may specify a single timeout for all transitions like: `timeout={500}`, - * or individually like: - * - * ```jsx - * timeout={{ - * enter: 300, - * exit: 500, - * }} - * ``` - * - * @type {number | { enter?: number, exit?: number }} - */ - timeout: function timeout(props) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var pt = PropTypes$1.timeoutsShape; - if (!props.addEndListener) pt = pt.isRequired; - return pt.apply(undefined, [props].concat(args)); - }, - - /** - * Add a custom transition end trigger. Called with the transitioning - * DOM node and a `done` callback. Allows for more fine grained transition end - * logic. **Note:** Timeouts are still used as a fallback if provided. - * - * ```jsx - * addEndListener={(node, done) => { - * // use the css transitionend event to mark the finish of a transition - * node.addEventListener('transitionend', done, false); - * }} - * ``` - */ - addEndListener: PropTypes$$1.func, - - /** - * Callback fired before the "entering" status is applied. An extra parameter - * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount - * - * @type Function(node: HtmlElement, isAppearing: bool) -> void - */ - onEnter: PropTypes$$1.func, - - /** - * Callback fired after the "entering" status is applied. An extra parameter - * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount - * - * @type Function(node: HtmlElement, isAppearing: bool) - */ - onEntering: PropTypes$$1.func, - - /** - * Callback fired after the "entered" status is applied. An extra parameter - * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount - * - * @type Function(node: HtmlElement, isAppearing: bool) -> void - */ - onEntered: PropTypes$$1.func, - - /** - * Callback fired before the "exiting" status is applied. - * - * @type Function(node: HtmlElement) -> void - */ - onExit: PropTypes$$1.func, - - /** - * Callback fired after the "exiting" status is applied. - * - * @type Function(node: HtmlElement) -> void - */ - onExiting: PropTypes$$1.func, - - /** - * Callback fired after the "exited" status is applied. - * - * @type Function(node: HtmlElement) -> void - */ - onExited: PropTypes$$1.func - } : {}; - - // Name the function so it is clearer in the documentation - function noop() {} - - Transition.defaultProps = { - in: false, - mountOnEnter: false, - unmountOnExit: false, - appear: false, - enter: true, - exit: true, - - onEnter: noop, - onEntering: noop, - onEntered: noop, - - onExit: noop, - onExiting: noop, - onExited: noop - }; - - Transition.UNMOUNTED = 0; - Transition.EXITED = 1; - Transition.ENTERING = 2; - Transition.ENTERED = 3; - Transition.EXITING = 4; - - exports.default = Transition; -}); - -var Transition = unwrapExports(Transition_1); - -var propTypes$19 = _extends({}, Transition.propTypes, { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node]), - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func]), - baseClass: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - baseClassActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}); - -var defaultProps$18 = _extends({}, Transition.defaultProps, { - tag: 'div', - baseClass: 'fade', - baseClassActive: 'show', - timeout: TransitionTimeouts.Fade, - appear: true, - enter: true, - exit: true, - in: true -}); - -function Fade(props) { - var Tag = props.tag, - baseClass = props.baseClass, - baseClassActive = props.baseClassActive, - className = props.className, - cssModule = props.cssModule, - children = props.children, - otherProps = objectWithoutProperties(props, ['tag', 'baseClass', 'baseClassActive', 'className', 'cssModule', 'children']); - - // In NODE_ENV=production the Transition.propTypes are wrapped which results in an - // empty object "{}". This is the result of the `react-transition-group` babel - // configuration settings. Therefore, to ensure that production builds work without - // error, we can either explicitly define keys or use the Transition.defaultProps. - // Using the Transition.defaultProps excludes any required props. Thus, the best - // solution is to explicitly define required props in our utilities and reference these. - // This also gives us more flexibility in the future to remove the prop-types - // dependency in distribution builds (Similar to how `react-transition-group` does). - // Note: Without omitting the `react-transition-group` props, the resulting child - // Tag component would inherit the Transition properties as attributes for the HTML - // element which results in errors/warnings for non-valid attributes. - - var transitionProps = pick(otherProps, TransitionPropTypeKeys); - var childProps = omit(otherProps, TransitionPropTypeKeys); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Transition, - transitionProps, - function (status) { - var isActive = status === 'entered'; - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, baseClass, isActive && baseClassActive), cssModule); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Tag, - _extends({ className: classes }, childProps), - children - ); - } - ); -} - -Fade.propTypes = propTypes$19; -Fade.defaultProps = defaultProps$18; - -var propTypes$20 = { - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - pill: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$19 = { - color: 'secondary', - pill: false, - tag: 'span' -}; - -var Badge = function Badge(props) { - var className = props.className, - cssModule = props.cssModule, - color = props.color, - pill = props.pill, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'color', 'pill', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'badge', 'badge-' + color, pill ? 'badge-pill' : false), cssModule); - - if (attributes.href && Tag === 'span') { - Tag = 'a'; - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Badge.propTypes = propTypes$20; -Badge.defaultProps = defaultProps$19; - -var propTypes$21 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - inverse: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - block: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the props "body"'), - body: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - outline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$20 = { - tag: 'div' -}; - -var Card = function Card(props) { - var className = props.className, - cssModule = props.cssModule, - color = props.color, - block = props.block, - body = props.body, - inverse = props.inverse, - outline = props.outline, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'color', 'block', 'body', 'inverse', 'outline', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card', inverse ? 'text-white' : false, block || body ? 'card-body' : false, color ? (outline ? 'border' : 'bg') + '-' + color : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Card.propTypes = propTypes$21; -Card.defaultProps = defaultProps$20; - -var propTypes$22 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$21 = { - tag: 'div' -}; - -var CardGroup = function CardGroup(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-group'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardGroup.propTypes = propTypes$22; -CardGroup.defaultProps = defaultProps$21; - -var propTypes$23 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$22 = { - tag: 'div' -}; - -var CardDeck = function CardDeck(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-deck'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardDeck.propTypes = propTypes$23; -CardDeck.defaultProps = defaultProps$22; - -var propTypes$24 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$23 = { - tag: 'div' -}; - -var CardColumns = function CardColumns(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-columns'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardColumns.propTypes = propTypes$24; -CardColumns.defaultProps = defaultProps$23; - -var propTypes$25 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$24 = { - tag: 'div' -}; - -var CardBody = function CardBody(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-body'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardBody.propTypes = propTypes$25; -CardBody.defaultProps = defaultProps$24; - -function CardBlock(props) { - warnOnce('The "CardBlock" component has been deprecated.\nPlease use component "CardBody".'); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CardBody, props); -} - -var propTypes$26 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$25 = { - tag: 'a' -}; - -var CardLink = function CardLink(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - innerRef = props.innerRef, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'innerRef']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-link'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, className: classes })); -}; - -CardLink.propTypes = propTypes$26; -CardLink.defaultProps = defaultProps$25; - -var propTypes$27 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$26 = { - tag: 'div' -}; - -var CardFooter = function CardFooter(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-footer'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardFooter.propTypes = propTypes$27; -CardFooter.defaultProps = defaultProps$26; - -var propTypes$28 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$27 = { - tag: 'div' -}; - -var CardHeader = function CardHeader(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-header'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardHeader.propTypes = propTypes$28; -CardHeader.defaultProps = defaultProps$27; - -var propTypes$29 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - top: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - bottom: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$28 = { - tag: 'img' -}; - -var CardImg = function CardImg(props) { - var className = props.className, - cssModule = props.cssModule, - top = props.top, - bottom = props.bottom, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'top', 'bottom', 'tag']); - - - var cardImgClassName = 'card-img'; - if (top) { - cardImgClassName = 'card-img-top'; - } - if (bottom) { - cardImgClassName = 'card-img-bottom'; - } - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, cardImgClassName), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardImg.propTypes = propTypes$29; -CardImg.defaultProps = defaultProps$28; - -var propTypes$30 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$29 = { - tag: 'div' -}; - -var CardImgOverlay = function CardImgOverlay(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-img-overlay'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardImgOverlay.propTypes = propTypes$30; -CardImgOverlay.defaultProps = defaultProps$29; - -var CarouselItem = function (_React$Component) { - inherits(CarouselItem, _React$Component); - - function CarouselItem(props) { - classCallCheck(this, CarouselItem); - - var _this = possibleConstructorReturn(this, (CarouselItem.__proto__ || Object.getPrototypeOf(CarouselItem)).call(this, props)); - - _this.state = { - startAnimation: false - }; - - _this.onEnter = _this.onEnter.bind(_this); - _this.onEntering = _this.onEntering.bind(_this); - _this.onExit = _this.onExit.bind(_this); - _this.onExiting = _this.onExiting.bind(_this); - _this.onExited = _this.onExited.bind(_this); - return _this; - } - - createClass(CarouselItem, [{ - key: 'onEnter', - value: function onEnter(node, isAppearing) { - this.setState({ startAnimation: false }); - this.props.onEnter(node, isAppearing); - } - }, { - key: 'onEntering', - value: function onEntering(node, isAppearing) { - // getting this variable triggers a reflow - var offsetHeight = node.offsetHeight; - this.setState({ startAnimation: true }); - this.props.onEntering(node, isAppearing); - return offsetHeight; - } - }, { - key: 'onExit', - value: function onExit(node) { - this.setState({ startAnimation: false }); - this.props.onExit(node); - } - }, { - key: 'onExiting', - value: function onExiting(node) { - this.setState({ startAnimation: true }); - node.dispatchEvent(new CustomEvent('slide.bs.carousel')); - this.props.onExiting(node); - } - }, { - key: 'onExited', - value: function onExited(node) { - node.dispatchEvent(new CustomEvent('slid.bs.carousel')); - this.props.onExited(node); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props = this.props, - isIn = _props.in, - children = _props.children, - cssModule = _props.cssModule, - slide = _props.slide, - Tag = _props.tag, - className = _props.className, - transitionProps = objectWithoutProperties(_props, ['in', 'children', 'cssModule', 'slide', 'tag', 'className']); - - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Transition, - _extends({}, transitionProps, { - enter: slide, - exit: slide, - 'in': isIn, - onEnter: this.onEnter, - onEntering: this.onEntering, - onExit: this.onExit, - onExiting: this.onExiting, - onExited: this.onExited - }), - function (status) { - var direction = _this2.context.direction; - - var isActive = status === TransitionStatuses.ENTERED || status === TransitionStatuses.EXITING; - var directionClassName = (status === TransitionStatuses.ENTERING || status === TransitionStatuses.EXITING) && _this2.state.startAnimation && (direction === 'right' ? 'carousel-item-left' : 'carousel-item-right'); - var orderClassName = status === TransitionStatuses.ENTERING && (direction === 'right' ? 'carousel-item-next' : 'carousel-item-prev'); - var itemClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-item', isActive && 'active', directionClassName, orderClassName), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Tag, - { className: itemClasses }, - children - ); - } - ); - } - }]); - return CarouselItem; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -CarouselItem.propTypes = _extends({}, Transition.propTypes, { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - in: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - slide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}); - -CarouselItem.defaultProps = _extends({}, Transition.defaultProps, { - tag: 'div', - timeout: TransitionTimeouts.Carousel, - slide: true -}); - -CarouselItem.contextTypes = { - direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -var Carousel = function (_React$Component) { - inherits(Carousel, _React$Component); - - function Carousel(props) { - classCallCheck(this, Carousel); - - var _this = possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, props)); - - _this.handleKeyPress = _this.handleKeyPress.bind(_this); - _this.renderItems = _this.renderItems.bind(_this); - _this.hoverStart = _this.hoverStart.bind(_this); - _this.hoverEnd = _this.hoverEnd.bind(_this); - _this.state = { direction: 'right' }; - return _this; - } - - createClass(Carousel, [{ - key: 'getChildContext', - value: function getChildContext() { - return { direction: this.state.direction }; - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - // Set up the cycle - if (this.props.ride === 'carousel') { - this.setInterval(); - } - - // TODO: move this to the specific carousel like bootstrap. Currently it will trigger ALL carousels on the page. - document.addEventListener('keyup', this.handleKeyPress); - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - this.setInterval(nextProps); - // Calculate the direction to turn - if (this.props.activeIndex + 1 === nextProps.activeIndex) { - this.setState({ direction: 'right' }); - } else if (this.props.activeIndex - 1 === nextProps.activeIndex) { - this.setState({ direction: 'left' }); - } else if (this.props.activeIndex > nextProps.activeIndex) { - this.setState({ direction: 'right' }); - } else if (this.props.activeIndex !== nextProps.activeIndex) { - this.setState({ direction: 'left' }); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.clearInterval(); - document.removeEventListener('keyup', this.handleKeyPress); - } - }, { - key: 'setInterval', - value: function (_setInterval) { - function setInterval() { - return _setInterval.apply(this, arguments); - } - - setInterval.toString = function () { - return _setInterval.toString(); - }; - - return setInterval; - }(function () { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; - - // make sure not to have multiple intervals going... - this.clearInterval(); - if (props.interval) { - this.cycleInterval = setInterval(function () { - props.next(); - }, parseInt(props.interval, 10)); - } - }) - }, { - key: 'clearInterval', - value: function (_clearInterval) { - function clearInterval() { - return _clearInterval.apply(this, arguments); - } - - clearInterval.toString = function () { - return _clearInterval.toString(); - }; - - return clearInterval; - }(function () { - clearInterval(this.cycleInterval); - }) - }, { - key: 'hoverStart', - value: function hoverStart() { - if (this.props.pause === 'hover') { - this.clearInterval(); - } - if (this.props.mouseEnter) { - var _props; - - (_props = this.props).mouseEnter.apply(_props, arguments); - } - } - }, { - key: 'hoverEnd', - value: function hoverEnd() { - if (this.props.pause === 'hover') { - this.setInterval(); - } - if (this.props.mouseLeave) { - var _props2; - - (_props2 = this.props).mouseLeave.apply(_props2, arguments); - } - } - }, { - key: 'handleKeyPress', - value: function handleKeyPress(evt) { - if (this.props.keyboard) { - if (evt.keyCode === 37) { - this.props.previous(); - } else if (evt.keyCode === 39) { - this.props.next(); - } - } - } - }, { - key: 'renderItems', - value: function renderItems(carouselItems, className) { - var _this2 = this; - - var slide = this.props.slide; - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - { role: 'listbox', className: className }, - carouselItems.map(function (item, index) { - var isIn = index === _this2.props.activeIndex; - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(item, { - in: isIn, - slide: slide - }); - }) - ); - } - }, { - key: 'render', - value: function render() { - var _props3 = this.props, - children = _props3.children, - cssModule = _props3.cssModule, - slide = _props3.slide, - className = _props3.className; - - var outerClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel', slide && 'slide'), cssModule); - - var innerClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('carousel-inner'), cssModule); - - var slidesOnly = children.every(function (child) { - return child.type === CarouselItem; - }); - - // Rendering only slides - if (slidesOnly) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - { className: outerClasses, onMouseEnter: this.hoverStart, onMouseLeave: this.hoverEnd }, - this.renderItems(children, innerClasses) - ); - } - - // Rendering slides and controls - if (children[0] instanceof Array) { - var _carouselItems = children[0]; - var _controlLeft = children[1]; - var _controlRight = children[2]; - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - { className: outerClasses, onMouseEnter: this.hoverStart, onMouseLeave: this.hoverEnd }, - this.renderItems(_carouselItems, innerClasses), - _controlLeft, - _controlRight - ); - } - - // Rendering indicators, slides and controls - var indicators = children[0]; - var carouselItems = children[1]; - var controlLeft = children[2]; - var controlRight = children[3]; - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - { className: outerClasses, onMouseEnter: this.hoverStart, onMouseLeave: this.hoverEnd }, - indicators, - this.renderItems(carouselItems, innerClasses), - controlLeft, - controlRight - ); - } - }]); - return Carousel; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Carousel.propTypes = { - // the current active slide of the carousel - activeIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, - // a function which should advance the carousel to the next slide (via activeIndex) - next: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - // a function which should advance the carousel to the previous slide (via activeIndex) - previous: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - // controls if the left and right arrow keys should control the carousel - keyboard: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - /* If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on - * mouseleave. If set to false, hovering over the carousel won't pause it. (default: "hover") - */ - pause: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['hover', false]), - // Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load. - // This is how bootstrap defines it... I would prefer a bool named autoplay or something... - ride: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['carousel']), - // the interval at which the carousel automatically cycles (default: 5000) - // eslint-disable-next-line react/no-unused-prop-types - interval: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool]), - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array, - // called when the mouse enters the Carousel - mouseEnter: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - // called when the mouse exits the Carousel - mouseLeave: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - // controls whether the slide animation on the Carousel works or not - slide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -Carousel.defaultProps = { - interval: 5000, - pause: 'hover', - keyboard: true, - slide: true -}; - -Carousel.childContextTypes = { - direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -var CarouselControl = function CarouselControl(props) { - var direction = props.direction, - onClickHandler = props.onClickHandler, - cssModule = props.cssModule, - directionText = props.directionText, - className = props.className; - - - var anchorClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-control-' + direction), cssModule); - - var iconClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('carousel-control-' + direction + '-icon'), cssModule); - - var screenReaderClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('sr-only'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'a', - { - className: anchorClasses, - role: 'button', - tabIndex: '0', - onClick: function onClick(e) { - e.preventDefault(); - onClickHandler(); - } - }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span', { className: iconClasses, 'aria-hidden': 'true' }), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'span', - { className: screenReaderClasses }, - directionText || direction - ) - ); -}; - -CarouselControl.propTypes = { - direction: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prev', 'next']).isRequired, - onClickHandler: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - directionText: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -var CarouselIndicators = function CarouselIndicators(props) { - var items = props.items, - activeIndex = props.activeIndex, - cssModule = props.cssModule, - onClickHandler = props.onClickHandler, - className = props.className; - - - var listClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-indicators'), cssModule); - var indicators = items.map(function (item, idx) { - var indicatorClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()({ active: activeIndex === idx }), cssModule); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('li', { - key: '' + (item.key || item.src) + item.caption + item.altText, - onClick: function onClick(e) { - e.preventDefault(); - onClickHandler(idx); - }, - className: indicatorClasses - }); - }); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'ol', - { className: listClasses }, - indicators - ); -}; - -CarouselIndicators.propTypes = { - items: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array.isRequired, - activeIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number.isRequired, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - onClickHandler: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -var CarouselCaption = function CarouselCaption(props) { - var captionHeader = props.captionHeader, - captionText = props.captionText, - cssModule = props.cssModule, - className = props.className; - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'carousel-caption', 'd-none', 'd-md-block'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - { className: classes }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'h3', - null, - captionHeader - ), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'p', - null, - captionText - ) - ); -}; - -CarouselCaption.propTypes = { - captionHeader: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - captionText: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string.isRequired, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -var propTypes$31 = { - items: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array.isRequired, - indicators: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - controls: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - autoPlay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - activeIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, - next: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - previous: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - goToIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func -}; - -var UncontrolledCarousel = function (_Component) { - inherits(UncontrolledCarousel, _Component); - - function UncontrolledCarousel(props) { - classCallCheck(this, UncontrolledCarousel); - - var _this = possibleConstructorReturn(this, (UncontrolledCarousel.__proto__ || Object.getPrototypeOf(UncontrolledCarousel)).call(this, props)); - - _this.animating = false; - _this.state = { activeIndex: 0 }; - _this.next = _this.next.bind(_this); - _this.previous = _this.previous.bind(_this); - _this.goToIndex = _this.goToIndex.bind(_this); - _this.onExiting = _this.onExiting.bind(_this); - _this.onExited = _this.onExited.bind(_this); - return _this; - } - - createClass(UncontrolledCarousel, [{ - key: 'onExiting', - value: function onExiting() { - this.animating = true; - } - }, { - key: 'onExited', - value: function onExited() { - this.animating = false; - } - }, { - key: 'next', - value: function next() { - if (this.animating) return; - var nextIndex = this.state.activeIndex === this.props.items.length - 1 ? 0 : this.state.activeIndex + 1; - this.setState({ activeIndex: nextIndex }); - } - }, { - key: 'previous', - value: function previous() { - if (this.animating) return; - var nextIndex = this.state.activeIndex === 0 ? this.props.items.length - 1 : this.state.activeIndex - 1; - this.setState({ activeIndex: nextIndex }); - } - }, { - key: 'goToIndex', - value: function goToIndex(newIndex) { - if (this.animating) return; - this.setState({ activeIndex: newIndex }); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props = this.props, - autoPlay = _props.autoPlay, - indicators = _props.indicators, - controls = _props.controls, - items = _props.items, - goToIndex = _props.goToIndex, - props = objectWithoutProperties(_props, ['autoPlay', 'indicators', 'controls', 'items', 'goToIndex']); - var activeIndex = this.state.activeIndex; - - - var slides = items.map(function (item) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - CarouselItem, - { - onExiting: _this2.onExiting, - onExited: _this2.onExited, - key: item.src - }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('img', { src: item.src, alt: item.altText }), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselCaption, { captionText: item.caption, captionHeader: item.caption }) - ); - }); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Carousel, - _extends({ - activeIndex: activeIndex, - next: this.next, - previous: this.previous, - ride: autoPlay ? 'carousel' : undefined - }, props), - indicators && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselIndicators, { - items: items, - activeIndex: props.activeIndex || activeIndex, - onClickHandler: goToIndex || this.goToIndex - }), - slides, - controls && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselControl, { - direction: 'prev', - directionText: 'Previous', - onClickHandler: props.previous || this.previous - }), - controls && __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(CarouselControl, { - direction: 'next', - directionText: 'Next', - onClickHandler: props.next || this.next - }) - ); - } - }]); - return UncontrolledCarousel; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - -UncontrolledCarousel.propTypes = propTypes$31; -UncontrolledCarousel.defaultProps = { - controls: true, - indicators: true, - autoPlay: true -}; - -var propTypes$32 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$30 = { - tag: 'h6' -}; - -var CardSubtitle = function CardSubtitle(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-subtitle'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardSubtitle.propTypes = propTypes$32; -CardSubtitle.defaultProps = defaultProps$30; - -var propTypes$33 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$31 = { - tag: 'p' -}; - -var CardText = function CardText(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-text'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardText.propTypes = propTypes$33; -CardText.defaultProps = defaultProps$31; - -var propTypes$34 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$32 = { - tag: 'h5' -}; - -var CardTitle = function CardTitle(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'card-title'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -CardTitle.propTypes = propTypes$34; -CardTitle.defaultProps = defaultProps$32; - -var propTypes$35 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node.isRequired, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - placement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - placementPrefix: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool.isRequired, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - offset: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), - fallbackPlacement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array]), - flip: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - container: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]), - target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired, - modifiers: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$33 = { - placement: 'auto', - isOpen: false, - offset: 0, - fallbackPlacement: 'flip', - flip: true, - container: 'body', - modifiers: {} -}; - -var childContextTypes$1 = { - popperManager: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired -}; - -var PopperContent = function (_React$Component) { - inherits(PopperContent, _React$Component); - - function PopperContent(props) { - classCallCheck(this, PopperContent); - - var _this = possibleConstructorReturn(this, (PopperContent.__proto__ || Object.getPrototypeOf(PopperContent)).call(this, props)); - - _this.handlePlacementChange = _this.handlePlacementChange.bind(_this); - _this.setTargetNode = _this.setTargetNode.bind(_this); - _this.getTargetNode = _this.getTargetNode.bind(_this); - _this.state = {}; - return _this; - } - - createClass(PopperContent, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - popperManager: { - setTargetNode: this.setTargetNode, - getTargetNode: this.getTargetNode - } - }; - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this.handleProps(); - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (this.props.isOpen !== prevProps.isOpen) { - this.handleProps(); - } else if (this._element) { - // rerender - this.renderIntoSubtree(); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.hide(); - } - }, { - key: 'setTargetNode', - value: function setTargetNode(node) { - this.targetNode = node; - } - }, { - key: 'getTargetNode', - value: function getTargetNode() { - return this.targetNode; - } - }, { - key: 'getContainerNode', - value: function getContainerNode() { - return getTarget(this.props.container); - } - }, { - key: 'handlePlacementChange', - value: function handlePlacementChange(data) { - if (this.state.placement !== data.placement) { - this.setState({ placement: data.placement }); - } - return data; - } - }, { - key: 'handleProps', - value: function handleProps() { - if (this.props.container !== 'inline') { - if (this.props.isOpen) { - this.show(); - } else { - this.hide(); - } - } - } - }, { - key: 'hide', - value: function hide() { - if (this._element) { - this.getContainerNode().removeChild(this._element); - __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unmountComponentAtNode(this._element); - this._element = null; - } - } - }, { - key: 'show', - value: function show() { - this._element = document.createElement('div'); - this.getContainerNode().appendChild(this._element); - this.renderIntoSubtree(); - if (this._element.childNodes && this._element.childNodes[0] && this._element.childNodes[0].focus) { - this._element.childNodes[0].focus(); - } - } - }, { - key: 'renderIntoSubtree', - value: function renderIntoSubtree() { - __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unstable_renderSubtreeIntoContainer(this, this.renderChildren(), this._element); - } - }, { - key: 'renderChildren', - value: function renderChildren() { - var _props = this.props, - cssModule = _props.cssModule, - children = _props.children, - isOpen = _props.isOpen, - flip = _props.flip, - target = _props.target, - offset = _props.offset, - fallbackPlacement = _props.fallbackPlacement, - placementPrefix = _props.placementPrefix, - className = _props.className, - tag = _props.tag, - container = _props.container, - modifiers = _props.modifiers, - attrs = objectWithoutProperties(_props, ['cssModule', 'children', 'isOpen', 'flip', 'target', 'offset', 'fallbackPlacement', 'placementPrefix', 'className', 'tag', 'container', 'modifiers']); - - var arrowClassName = mapToCssModules('arrow', cssModule); - var placement = (this.state.placement || attrs.placement).split('-')[0]; - var popperClassName = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, placementPrefix ? placementPrefix + '-' + placement : placement), this.props.cssModule); - - var extendedModifiers = _extends({ - offset: { offset: offset }, - flip: { enabled: flip, behavior: fallbackPlacement }, - update: { - enabled: true, - order: 950, - fn: this.handlePlacementChange - } - }, modifiers); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_6_react_popper__["Popper"], - _extends({ modifiers: extendedModifiers }, attrs, { component: tag, className: popperClassName }), - children, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6_react_popper__["Arrow"], { className: arrowClassName }) - ); - } - }, { - key: 'render', - value: function render() { - this.setTargetNode(getTarget(this.props.target)); - - if (this.props.container === 'inline') { - return this.props.isOpen ? this.renderChildren() : null; - } - - return null; - } - }]); - return PopperContent; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -PopperContent.propTypes = propTypes$35; -PopperContent.defaultProps = defaultProps$33; -PopperContent.childContextTypes = childContextTypes$1; - -var PopperTargetHelper = function PopperTargetHelper(props, context) { - context.popperManager.setTargetNode(getTarget(props.target)); - return null; -}; - -PopperTargetHelper.contextTypes = { - popperManager: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired -}; - -PopperTargetHelper.propTypes = { - target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired -}; - -var propTypes$36 = { - placement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(PopperPlacements), - target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired, - container: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]), - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - innerClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - placementPrefix: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - delay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ show: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, hide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number }), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), - modifiers: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var DEFAULT_DELAYS = { - show: 0, - hide: 0 -}; - -var defaultProps$34 = { - isOpen: false, - placement: 'right', - placementPrefix: 'bs-popover', - delay: DEFAULT_DELAYS, - toggle: function toggle() {} -}; - -var Popover = function (_React$Component) { - inherits(Popover, _React$Component); - - function Popover(props) { - classCallCheck(this, Popover); - - var _this = possibleConstructorReturn(this, (Popover.__proto__ || Object.getPrototypeOf(Popover)).call(this, props)); - - _this.addTargetEvents = _this.addTargetEvents.bind(_this); - _this.handleDocumentClick = _this.handleDocumentClick.bind(_this); - _this.removeTargetEvents = _this.removeTargetEvents.bind(_this); - _this.getRef = _this.getRef.bind(_this); - _this.toggle = _this.toggle.bind(_this); - _this.show = _this.show.bind(_this); - _this.hide = _this.hide.bind(_this); - return _this; - } - - createClass(Popover, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this._target = getTarget(this.props.target); - this.handleProps(); - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this.handleProps(); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.clearShowTimeout(); - this.clearHideTimeout(); - this.removeTargetEvents(); - } - }, { - key: 'getRef', - value: function getRef(ref) { - this._popover = ref; - } - }, { - key: 'getDelay', - value: function getDelay(key) { - var delay = this.props.delay; - - if ((typeof delay === 'undefined' ? 'undefined' : _typeof(delay)) === 'object') { - return isNaN(delay[key]) ? DEFAULT_DELAYS[key] : delay[key]; - } - return delay; - } - }, { - key: 'handleProps', - value: function handleProps() { - if (this.props.isOpen) { - this.show(); - } else { - this.hide(); - } - } - }, { - key: 'show', - value: function show() { - this.clearHideTimeout(); - this.addTargetEvents(); - if (!this.props.isOpen) { - this.clearShowTimeout(); - this._showTimeout = setTimeout(this.toggle, this.getDelay('show')); - } - } - }, { - key: 'hide', - value: function hide() { - this.clearShowTimeout(); - this.removeTargetEvents(); - if (this.props.isOpen) { - this.clearHideTimeout(); - this._hideTimeout = setTimeout(this.toggle, this.getDelay('hide')); - } - } - }, { - key: 'clearShowTimeout', - value: function clearShowTimeout() { - clearTimeout(this._showTimeout); - this._showTimeout = undefined; - } - }, { - key: 'clearHideTimeout', - value: function clearHideTimeout() { - clearTimeout(this._hideTimeout); - this._hideTimeout = undefined; - } - }, { - key: 'handleDocumentClick', - value: function handleDocumentClick(e) { - if (e.target !== this._target && !this._target.contains(e.target) && e.target !== this._popover && !(this._popover && this._popover.contains(e.target))) { - if (this._hideTimeout) { - this.clearHideTimeout(); - } - - if (this.props.isOpen) { - this.toggle(); - } - } - } - }, { - key: 'addTargetEvents', - value: function addTargetEvents() { - var _this2 = this; - - ['click', 'touchstart'].forEach(function (event) { - return document.addEventListener(event, _this2.handleDocumentClick, true); - }); - } - }, { - key: 'removeTargetEvents', - value: function removeTargetEvents() { - var _this3 = this; - - ['click', 'touchstart'].forEach(function (event) { - return document.removeEventListener(event, _this3.handleDocumentClick, true); - }); - } - }, { - key: 'toggle', - value: function toggle(e) { - if (this.props.disabled) { - return e && e.preventDefault(); - } - - return this.props.toggle(); - } - }, { - key: 'render', - value: function render() { - if (!this.props.isOpen) { - return null; - } - - var attributes = omit(this.props, Object.keys(propTypes$36)); - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('popover-inner', this.props.innerClassName), this.props.cssModule); - - var popperClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('popover', 'show', this.props.className), this.props.cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - PopperContent, - { - className: popperClasses, - target: this.props.target, - isOpen: this.props.isOpen, - placement: this.props.placement, - placementPrefix: this.props.placementPrefix, - container: this.props.container, - modifiers: this.props.modifiers - }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', _extends({}, attributes, { className: classes, ref: this.getRef })) - ); - } - }]); - return Popover; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Popover.propTypes = propTypes$36; -Popover.defaultProps = defaultProps$34; - -var propTypes$37 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$35 = { - tag: 'h3' -}; - -var PopoverHeader = function PopoverHeader(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'popover-header'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -PopoverHeader.propTypes = propTypes$37; -PopoverHeader.defaultProps = defaultProps$35; - -function PopoverTitle(props) { - warnOnce('The "PopoverTitle" component has been deprecated.\nPlease use component "PopoverHeader".'); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(PopoverHeader, props); -} - -var propTypes$38 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$36 = { - tag: 'div' -}; - -var PopoverBody = function PopoverBody(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'popover-body'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -PopoverBody.propTypes = propTypes$38; -PopoverBody.defaultProps = defaultProps$36; - -function PopoverContent(props) { - warnOnce('The "PopoverContent" component has been deprecated.\nPlease use component "PopoverBody".'); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(PopoverBody, props); -} - -var propTypes$39 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - bar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - multi: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - value: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), - max: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), - animated: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - striped: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - barClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$37 = { - tag: 'div', - value: 0, - max: 100 -}; - -var Progress = function Progress(props) { - var children = props.children, - className = props.className, - barClassName = props.barClassName, - cssModule = props.cssModule, - value = props.value, - max = props.max, - animated = props.animated, - striped = props.striped, - color = props.color, - bar = props.bar, - multi = props.multi, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['children', 'className', 'barClassName', 'cssModule', 'value', 'max', 'animated', 'striped', 'color', 'bar', 'multi', 'tag']); - - - var percent = __WEBPACK_IMPORTED_MODULE_7_lodash_tonumber___default()(value) / __WEBPACK_IMPORTED_MODULE_7_lodash_tonumber___default()(max) * 100; - - var progressClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'progress'), cssModule); - - var progressBarClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('progress-bar', bar ? className || barClassName : barClassName, animated ? 'progress-bar-animated' : null, color ? 'bg-' + color : null, striped || animated ? 'progress-bar-striped' : null), cssModule); - - var ProgressBar = multi ? children : __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', { - className: progressBarClasses, - style: { width: percent + '%' }, - role: 'progressbar', - 'aria-valuenow': value, - 'aria-valuemin': '0', - 'aria-valuemax': max, - children: children - }); - - if (bar) { - return ProgressBar; - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: progressClasses, children: ProgressBar })); -}; - -Progress.propTypes = propTypes$39; -Progress.defaultProps = defaultProps$37; - -function noop() {} - -var FadePropTypes = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape(Fade.propTypes); - -var propTypes$40 = { - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - autoFocus: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - keyboard: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - role: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - labelledBy: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - backdrop: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['static'])]), - onEnter: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - onExit: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - onOpened: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - onClosed: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - wrapClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - modalClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - backdropClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - contentClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - fade: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - zIndex: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - backdropTransition: FadePropTypes, - modalTransition: FadePropTypes -}; - -var propsToOmit = Object.keys(propTypes$40); - -var defaultProps$38 = { - isOpen: false, - autoFocus: true, - role: 'dialog', - backdrop: true, - keyboard: true, - zIndex: 1050, - fade: true, - onOpened: noop, - onClosed: noop, - modalTransition: { - timeout: TransitionTimeouts.Modal - }, - backdropTransition: { - mountOnEnter: true, - timeout: TransitionTimeouts.Fade // uses standard fade transition - } -}; - -var Modal = function (_React$Component) { - inherits(Modal, _React$Component); - - function Modal(props) { - classCallCheck(this, Modal); - - var _this = possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, props)); - - _this.originalBodyPadding = null; - _this.isBodyOverflowing = false; - _this.togglePortal = _this.togglePortal.bind(_this); - _this.handleBackdropClick = _this.handleBackdropClick.bind(_this); - _this.handleEscape = _this.handleEscape.bind(_this); - _this.destroy = _this.destroy.bind(_this); - _this.onOpened = _this.onOpened.bind(_this); - _this.onClosed = _this.onClosed.bind(_this); - return _this; - } - - createClass(Modal, [{ - key: 'componentDidMount', - value: function componentDidMount() { - if (this.props.isOpen) { - this.togglePortal(); - } - if (this.props.onEnter) { - this.props.onEnter(); - } - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate(prevProps) { - if (this.props.isOpen !== prevProps.isOpen) { - // handle portal events/dom updates - this.togglePortal(); - } else if (this._element) { - // rerender portal - this.renderIntoSubtree(); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.destroy(); - if (this.props.onExit) { - this.props.onExit(); - } - } - }, { - key: 'onOpened', - value: function onOpened(node, isAppearing) { - this.props.onOpened(); - (this.props.modalTransition.onEntered || noop)(node, isAppearing); - } - }, { - key: 'onClosed', - value: function onClosed(node) { - var _this2 = this; - - // so all methods get called before it is unmounted - setTimeout(function () { - return _this2.destroy(); - }, 0); - this.props.onClosed(); - (this.props.modalTransition.onExited || noop)(node); - } - }, { - key: 'handleEscape', - value: function handleEscape(e) { - if (this.props.keyboard && e.keyCode === 27 && this.props.toggle) { - this.props.toggle(); - } - } - }, { - key: 'handleBackdropClick', - value: function handleBackdropClick(e) { - if (this.props.backdrop !== true) return; - - var container = this._dialog; - - if (e.target && !container.contains(e.target) && this.props.toggle) { - this.props.toggle(); - } - } - }, { - key: 'togglePortal', - value: function togglePortal() { - if (this.props.isOpen) { - if (this.props.autoFocus) { - this._focus = true; - } - this.show(); - } else { - this.hide(); - } - } - }, { - key: 'destroy', - value: function destroy() { - if (this._element) { - __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unmountComponentAtNode(this._element); - document.body.removeChild(this._element); - this._element = null; - } - - // Use regex to prevent matching `modal-open` as part of a different class, e.g. `my-modal-opened` - var classes = document.body.className.replace(/(^| )modal-open( |$)/, ' '); - document.body.className = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(classes).trim(), this.props.cssModule); - setScrollbarWidth(this.originalBodyPadding); - } - }, { - key: 'hide', - value: function hide() { - this.renderIntoSubtree(); - } - }, { - key: 'show', - value: function show() { - if (this._dialog) { - if (this.props.toggle) { - this.props.toggle(true); - } - return; - } - var classes = document.body.className; - this._element = document.createElement('div'); - this._element.setAttribute('tabindex', '-1'); - this._element.style.position = 'relative'; - this._element.style.zIndex = this.props.zIndex; - this.originalBodyPadding = getOriginalBodyPadding(); - - conditionallyUpdateScrollbar(); - - document.body.appendChild(this._element); - - document.body.className = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(classes, 'modal-open'), this.props.cssModule); - - this.renderIntoSubtree(); - } - }, { - key: 'renderModalDialog', - value: function renderModalDialog() { - var _this3 = this; - - var attributes = omit(this.props, propsToOmit); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - _extends({ - className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('modal-dialog', this.props.className, defineProperty({}, 'modal-' + this.props.size, this.props.size)), this.props.cssModule), - role: 'document', - ref: function ref(c) { - _this3._dialog = c; - } - }, attributes), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - { - className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('modal-content', this.props.contentClassName), this.props.cssModule) - }, - this.props.children - ) - ); - } - }, { - key: 'renderIntoSubtree', - value: function renderIntoSubtree() { - __WEBPACK_IMPORTED_MODULE_5_react_dom___default.a.unstable_renderSubtreeIntoContainer(this, this.renderChildren(), this._element); - - // check if modal should receive focus - if (this._focus) { - if (this._dialog && this._dialog.parentNode && typeof this._dialog.parentNode.focus === 'function') { - this._dialog.parentNode.focus(); - } - this._focus = false; - } - } - }, { - key: 'renderChildren', - value: function renderChildren() { - var _props = this.props, - wrapClassName = _props.wrapClassName, - modalClassName = _props.modalClassName, - backdropClassName = _props.backdropClassName, - cssModule = _props.cssModule, - isOpen = _props.isOpen, - backdrop = _props.backdrop, - role = _props.role, - labelledBy = _props.labelledBy; - - - var modalAttributes = { - onClickCapture: this.handleBackdropClick, - onKeyUp: this.handleEscape, - style: { display: 'block' }, - 'aria-labelledby': labelledBy, - role: role, - tabIndex: '-1' - }; - - var hasTransition = this.props.fade; - var modalTransition = _extends({}, Fade.defaultProps, this.props.modalTransition, { - baseClass: hasTransition ? this.props.modalTransition.baseClass : '', - timeout: hasTransition ? this.props.modalTransition.timeout : 0 - }); - var backdropTransition = _extends({}, Fade.defaultProps, this.props.backdropTransition, { - baseClass: hasTransition ? this.props.backdropTransition.baseClass : '', - timeout: hasTransition ? this.props.backdropTransition.timeout : 0 - }); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'div', - { className: mapToCssModules(wrapClassName) }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Fade, - _extends({}, modalAttributes, modalTransition, { - 'in': isOpen, - onEntered: this.onOpened, - onExited: this.onClosed, - cssModule: cssModule, - className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('modal', modalClassName), cssModule) - }), - this.renderModalDialog() - ), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Fade, _extends({}, backdropTransition, { - 'in': isOpen && !!backdrop, - cssModule: cssModule, - className: mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('modal-backdrop', backdropClassName), cssModule) - })) - ); - } - }, { - key: 'render', - value: function render() { - return null; - } - }]); - return Modal; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Modal.propTypes = propTypes$40; -Modal.defaultProps = defaultProps$38; - -var propTypes$41 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - wrapTag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - closeAriaLabel: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -var defaultProps$39 = { - tag: 'h5', - wrapTag: 'div', - closeAriaLabel: 'Close' -}; - -var ModalHeader = function ModalHeader(props) { - var closeButton = void 0; - var className = props.className, - cssModule = props.cssModule, - children = props.children, - toggle = props.toggle, - Tag = props.tag, - WrapTag = props.wrapTag, - closeAriaLabel = props.closeAriaLabel, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'children', 'toggle', 'tag', 'wrapTag', 'closeAriaLabel']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'modal-header'), cssModule); - - if (toggle) { - closeButton = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'button', - { type: 'button', onClick: toggle, className: mapToCssModules('close', cssModule), 'aria-label': closeAriaLabel }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'span', - { 'aria-hidden': 'true' }, - String.fromCharCode(215) - ) - ); - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - WrapTag, - _extends({}, attributes, { className: classes }), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Tag, - { className: mapToCssModules('modal-title', cssModule) }, - children - ), - closeButton - ); -}; - -ModalHeader.propTypes = propTypes$41; -ModalHeader.defaultProps = defaultProps$39; - -var propTypes$42 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$40 = { - tag: 'div' -}; - -var ModalBody = function ModalBody(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'modal-body'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ModalBody.propTypes = propTypes$42; -ModalBody.defaultProps = defaultProps$40; - -var propTypes$43 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$41 = { - tag: 'div' -}; - -var ModalFooter = function ModalFooter(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'modal-footer'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ModalFooter.propTypes = propTypes$43; -ModalFooter.defaultProps = defaultProps$41; - -var propTypes$44 = { - placement: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(PopperPlacements), - target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]).isRequired, - container: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, DOMElement]), - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - innerClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - autohide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - placementPrefix: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - delay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ show: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, hide: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number }), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number]), - modifiers: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var DEFAULT_DELAYS$1 = { - show: 0, - hide: 250 -}; - -var defaultProps$42 = { - isOpen: false, - placement: 'top', - placementPrefix: 'bs-tooltip', - delay: DEFAULT_DELAYS$1, - autohide: true, - toggle: function toggle() {} -}; - -var Tooltip = function (_React$Component) { - inherits(Tooltip, _React$Component); - - function Tooltip(props) { - classCallCheck(this, Tooltip); - - var _this = possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, props)); - - _this.addTargetEvents = _this.addTargetEvents.bind(_this); - _this.handleDocumentClick = _this.handleDocumentClick.bind(_this); - _this.removeTargetEvents = _this.removeTargetEvents.bind(_this); - _this.toggle = _this.toggle.bind(_this); - _this.onMouseOverTooltip = _this.onMouseOverTooltip.bind(_this); - _this.onMouseLeaveTooltip = _this.onMouseLeaveTooltip.bind(_this); - _this.onMouseOverTooltipContent = _this.onMouseOverTooltipContent.bind(_this); - _this.onMouseLeaveTooltipContent = _this.onMouseLeaveTooltipContent.bind(_this); - _this.show = _this.show.bind(_this); - _this.hide = _this.hide.bind(_this); - return _this; - } - - createClass(Tooltip, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this._target = getTarget(this.props.target); - this.addTargetEvents(); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.removeTargetEvents(); - } - }, { - key: 'onMouseOverTooltip', - value: function onMouseOverTooltip() { - if (this._hideTimeout) { - this.clearHideTimeout(); - } - this._showTimeout = setTimeout(this.show, this.getDelay('show')); - } - }, { - key: 'onMouseLeaveTooltip', - value: function onMouseLeaveTooltip() { - if (this._showTimeout) { - this.clearShowTimeout(); - } - this._hideTimeout = setTimeout(this.hide, this.getDelay('hide')); - } - }, { - key: 'onMouseOverTooltipContent', - value: function onMouseOverTooltipContent() { - if (this.props.autohide) { - return; - } - if (this._hideTimeout) { - this.clearHideTimeout(); - } - } - }, { - key: 'onMouseLeaveTooltipContent', - value: function onMouseLeaveTooltipContent() { - if (this.props.autohide) { - return; - } - if (this._showTimeout) { - this.clearShowTimeout(); - } - this._hideTimeout = setTimeout(this.hide, this.getDelay('hide')); - } - }, { - key: 'getDelay', - value: function getDelay(key) { - var delay = this.props.delay; - - if ((typeof delay === 'undefined' ? 'undefined' : _typeof(delay)) === 'object') { - return isNaN(delay[key]) ? DEFAULT_DELAYS$1[key] : delay[key]; - } - return delay; - } - }, { - key: 'show', - value: function show() { - if (!this.props.isOpen) { - this.clearShowTimeout(); - this.toggle(); - } - } - }, { - key: 'hide', - value: function hide() { - if (this.props.isOpen) { - this.clearHideTimeout(); - this.toggle(); - } - } - }, { - key: 'clearShowTimeout', - value: function clearShowTimeout() { - clearTimeout(this._showTimeout); - this._showTimeout = undefined; - } - }, { - key: 'clearHideTimeout', - value: function clearHideTimeout() { - clearTimeout(this._hideTimeout); - this._hideTimeout = undefined; - } - }, { - key: 'handleDocumentClick', - value: function handleDocumentClick(e) { - if (e.target === this._target || this._target.contains(e.target)) { - if (this._hideTimeout) { - this.clearHideTimeout(); - } - - if (!this.props.isOpen) { - this.toggle(); - } - } - } - }, { - key: 'addTargetEvents', - value: function addTargetEvents() { - var _this2 = this; - - this._target.addEventListener('mouseover', this.onMouseOverTooltip, true); - this._target.addEventListener('mouseout', this.onMouseLeaveTooltip, true); - ['click', 'touchstart'].forEach(function (event) { - return document.addEventListener(event, _this2.handleDocumentClick, true); - }); - } - }, { - key: 'removeTargetEvents', - value: function removeTargetEvents() { - var _this3 = this; - - this._target.removeEventListener('mouseover', this.onMouseOverTooltip, true); - this._target.removeEventListener('mouseout', this.onMouseLeaveTooltip, true); - ['click', 'touchstart'].forEach(function (event) { - return document.removeEventListener(event, _this3.handleDocumentClick, true); - }); - } - }, { - key: 'toggle', - value: function toggle(e) { - if (this.props.disabled) { - return e && e.preventDefault(); - } - - return this.props.toggle(); - } - }, { - key: 'render', - value: function render() { - if (!this.props.isOpen) { - return null; - } - - var attributes = omit(this.props, Object.keys(propTypes$44)); - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tooltip-inner', this.props.innerClassName), this.props.cssModule); - - var popperClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tooltip', 'show', this.props.className), this.props.cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - PopperContent, - { - className: popperClasses, - target: this.props.target, - isOpen: this.props.isOpen, - placement: this.props.placement, - placementPrefix: this.props.placementPrefix, - container: this.props.container, - modifiers: this.props.modifiers - }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('div', _extends({}, attributes, { - className: classes, - onMouseOver: this.onMouseOverTooltipContent, - onMouseLeave: this.onMouseLeaveTooltipContent - })) - ); - } - }]); - return Tooltip; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Tooltip.propTypes = propTypes$44; -Tooltip.defaultProps = defaultProps$42; - -var propTypes$45 = { - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - bordered: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - striped: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - inverse: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the prop "dark"'), - dark: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - hover: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - responsive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - responsiveTag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) -}; - -var defaultProps$43 = { - tag: 'table', - responsiveTag: 'div' -}; - -var Table = function Table(props) { - var className = props.className, - cssModule = props.cssModule, - size = props.size, - bordered = props.bordered, - striped = props.striped, - inverse = props.inverse, - dark = props.dark, - hover = props.hover, - responsive = props.responsive, - Tag = props.tag, - ResponsiveTag = props.responsiveTag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'size', 'bordered', 'striped', 'inverse', 'dark', 'hover', 'responsive', 'tag', 'responsiveTag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'table', size ? 'table-' + size : false, bordered ? 'table-bordered' : false, striped ? 'table-striped' : false, dark || inverse ? 'table-dark' : false, hover ? 'table-hover' : false), cssModule); - - var table = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); - - if (responsive) { - var responsiveClassName = responsive === true ? 'table-responsive' : 'table-responsive-' + responsive; - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - ResponsiveTag, - { className: responsiveClassName }, - table - ); - } - - return table; -}; - -Table.propTypes = propTypes$45; -Table.defaultProps = defaultProps$43; - -var propTypes$46 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - flush: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$44 = { - tag: 'ul' -}; - -var ListGroup = function ListGroup(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - flush = props.flush, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'flush']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'list-group', flush ? 'list-group-flush' : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ListGroup.propTypes = propTypes$46; -ListGroup.defaultProps = defaultProps$44; - -var propTypes$47 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - inline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$45 = { - tag: 'form' -}; - -var Form = function Form(props) { - var className = props.className, - cssModule = props.cssModule, - inline = props.inline, - Tag = props.tag, - innerRef = props.innerRef, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'inline', 'tag', 'innerRef']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, inline ? 'form-inline' : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, className: classes })); -}; - -Form.propTypes = propTypes$47; -Form.defaultProps = defaultProps$45; - -var propTypes$48 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$46 = { - tag: 'div' -}; - -var FormFeedback = function FormFeedback(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'invalid-feedback'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -FormFeedback.propTypes = propTypes$48; -FormFeedback.defaultProps = defaultProps$46; - -var propTypes$49 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - row: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - check: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - inline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$47 = { - tag: 'div' -}; - -var FormGroup = function FormGroup(props) { - var className = props.className, - cssModule = props.cssModule, - row = props.row, - disabled = props.disabled, - check = props.check, - inline = props.inline, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'row', 'disabled', 'check', 'inline', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, row ? 'row' : false, check ? 'form-check' : 'form-group', check && inline ? 'form-check-inline' : false, check && disabled ? 'disabled' : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -FormGroup.propTypes = propTypes$49; -FormGroup.defaultProps = defaultProps$47; - -var propTypes$50 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - inline: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$48 = { - tag: 'small', - color: 'muted' -}; - -var FormText = function FormText(props) { - var className = props.className, - cssModule = props.cssModule, - inline = props.inline, - color = props.color, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'inline', 'color', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, !inline ? 'form-text' : false, color ? 'text-' + color : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -FormText.propTypes = propTypes$50; -FormText.defaultProps = defaultProps$48; - -/* eslint react/prefer-stateless-function: 0 */ - -var propTypes$51 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - type: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - bsSize: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - state: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, 'Please use the prop "valid"'), - valid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - static: deprecated(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, 'Please use the prop "plaintext"'), - plaintext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - addon: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$49 = { - type: 'text' -}; - -var Input = function (_React$Component) { - inherits(Input, _React$Component); - - function Input() { - classCallCheck(this, Input); - return possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).apply(this, arguments)); - } - - createClass(Input, [{ - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - cssModule = _props.cssModule, - type = _props.type, - bsSize = _props.bsSize, - state = _props.state, - valid = _props.valid, - tag = _props.tag, - addon = _props.addon, - staticInput = _props.static, - plaintext = _props.plaintext, - innerRef = _props.innerRef, - attributes = objectWithoutProperties(_props, ['className', 'cssModule', 'type', 'bsSize', 'state', 'valid', 'tag', 'addon', 'static', 'plaintext', 'innerRef']); - - - var checkInput = ['radio', 'checkbox'].indexOf(type) > -1; - var isNotaNumber = new RegExp('\\D', 'g'); - - var fileInput = type === 'file'; - var textareaInput = type === 'textarea'; - var selectInput = type === 'select'; - var Tag = tag || (selectInput || textareaInput ? type : 'input'); - - var formControlClass = 'form-control'; - - if (plaintext || staticInput) { - formControlClass = formControlClass + '-plaintext'; - Tag = tag || 'p'; - } else if (fileInput) { - formControlClass = formControlClass + '-file'; - } else if (checkInput) { - if (addon) { - formControlClass = null; - } else { - formControlClass = 'form-check-input'; - } - } - - if (state && typeof valid === 'undefined') { - if (state === 'danger') { - valid = false; - } else if (state === 'success') { - valid = true; - } - } - - if (attributes.size && isNotaNumber.test(attributes.size)) { - warnOnce('Please use the prop "bsSize" instead of the "size" to bootstrap\'s input sizing.'); - bsSize = attributes.size; - delete attributes.size; - } - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, valid === false && 'is-invalid', valid && 'is-valid', bsSize ? 'form-control-' + bsSize : false, formControlClass), cssModule); - - if (Tag === 'input' || typeof tag !== 'string') { - attributes.type = type; - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { ref: innerRef, className: classes })); - } - }]); - return Input; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Input.propTypes = propTypes$51; -Input.defaultProps = defaultProps$49; - -var propTypes$52 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$50 = { - tag: 'div' -}; - -var InputGroup = function InputGroup(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - size = props.size, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'size']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'input-group', size ? 'input-group-' + size : null), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -InputGroup.propTypes = propTypes$52; -InputGroup.defaultProps = defaultProps$50; - -var propTypes$54 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$52 = { - tag: 'span' -}; - -var InputGroupText = function InputGroupText(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'input-group-text'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -InputGroupText.propTypes = propTypes$54; -InputGroupText.defaultProps = defaultProps$52; - -var propTypes$53 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append']).isRequired, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$51 = { - tag: 'div' -}; - -var InputGroupAddon = function InputGroupAddon(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - addonType = props.addonType, - children = props.children, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'addonType', 'children']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'input-group-' + addonType), cssModule); - - // Convenience to assist with transition - if (typeof children === 'string') { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Tag, - _extends({}, attributes, { className: classes }), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(InputGroupText, { children: children }) - ); - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes, children: children })); -}; - -InputGroupAddon.propTypes = propTypes$53; -InputGroupAddon.defaultProps = defaultProps$51; - -var propTypes$55 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append']).isRequired, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - groupClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - groupAttributes: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var InputGroupButton = function InputGroupButton(props) { - warnOnce('The "InputGroupButton" component has been deprecated.\nPlease use component "InputGroupAddon".'); - - var children = props.children, - groupClassName = props.groupClassName, - groupAttributes = props.groupAttributes, - propsWithoutGroup = objectWithoutProperties(props, ['children', 'groupClassName', 'groupAttributes']); - - - if (typeof children === 'string') { - var cssModule = propsWithoutGroup.cssModule, - tag = propsWithoutGroup.tag, - addonType = propsWithoutGroup.addonType, - attributes = objectWithoutProperties(propsWithoutGroup, ['cssModule', 'tag', 'addonType']); - - - var allGroupAttributes = _extends({}, groupAttributes, { - cssModule: cssModule, - tag: tag, - addonType: addonType - }); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - InputGroupAddon, - _extends({}, allGroupAttributes, { className: groupClassName }), - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Button, _extends({}, attributes, { children: children })) - ); - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(InputGroupAddon, _extends({}, props, { children: children })); -}; - -InputGroupButton.propTypes = propTypes$55; - -var propTypes$56 = { - addonType: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['prepend', 'append']).isRequired, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node -}; - -var InputGroupButtonDropdown = function InputGroupButtonDropdown(props) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, props); -}; - -InputGroupButtonDropdown.propTypes = propTypes$56; - -var colWidths$1 = ['xs', 'sm', 'md', 'lg', 'xl']; - -var stringOrNumberProp$1 = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]); - -var columnProps$1 = __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - size: stringOrNumberProp$1, - push: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'), - pull: deprecated(stringOrNumberProp$1, 'Please use the prop "order"'), - order: stringOrNumberProp$1, - offset: stringOrNumberProp$1 -})]); - -var propTypes$57 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - hidden: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - check: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - for: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - xs: columnProps$1, - sm: columnProps$1, - md: columnProps$1, - lg: columnProps$1, - xl: columnProps$1, - widths: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.array -}; - -var defaultProps$53 = { - tag: 'label', - widths: colWidths$1 -}; - -var getColumnSizeClass$1 = function getColumnSizeClass(isXs, colWidth, colSize) { - if (colSize === true || colSize === '') { - return isXs ? 'col' : 'col-' + colWidth; - } else if (colSize === 'auto') { - return isXs ? 'col-auto' : 'col-' + colWidth + '-auto'; - } - - return isXs ? 'col-' + colSize : 'col-' + colWidth + '-' + colSize; -}; - -var Label = function Label(props) { - var className = props.className, - cssModule = props.cssModule, - hidden = props.hidden, - widths = props.widths, - Tag = props.tag, - check = props.check, - size = props.size, - htmlFor = props.for, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'hidden', 'widths', 'tag', 'check', 'size', 'for']); - - - var colClasses = []; - - widths.forEach(function (colWidth, i) { - var columnProp = props[colWidth]; - - delete attributes[colWidth]; - - if (!columnProp && columnProp !== '') { - return; - } - - var isXs = !i; - var colClass = void 0; - - if (__WEBPACK_IMPORTED_MODULE_4_lodash_isobject___default()(columnProp)) { - var _classNames; - - var colSizeInterfix = isXs ? '-' : '-' + colWidth + '-'; - colClass = getColumnSizeClass$1(isXs, colWidth, columnProp.size); - - colClasses.push(mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()((_classNames = {}, defineProperty(_classNames, colClass, columnProp.size || columnProp.size === ''), defineProperty(_classNames, 'order' + colSizeInterfix + columnProp.order, columnProp.order || columnProp.order === 0), defineProperty(_classNames, 'offset' + colSizeInterfix + columnProp.offset, columnProp.offset || columnProp.offset === 0), _classNames))), cssModule); - } else { - colClass = getColumnSizeClass$1(isXs, colWidth, columnProp); - colClasses.push(colClass); - } - }); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, hidden ? 'sr-only' : false, check ? 'form-check-label' : false, size ? 'col-form-label-' + size : false, colClasses, colClasses.length ? 'col-form-label' : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({ htmlFor: htmlFor }, attributes, { className: classes })); -}; - -Label.propTypes = propTypes$57; -Label.defaultProps = defaultProps$53; - -var propTypes$58 = { - body: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - bottom: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - heading: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - left: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - list: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - middle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - object: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - right: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - top: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool -}; - -var Media = function Media(props) { - var body = props.body, - bottom = props.bottom, - className = props.className, - cssModule = props.cssModule, - heading = props.heading, - left = props.left, - list = props.list, - middle = props.middle, - object = props.object, - right = props.right, - tag = props.tag, - top = props.top, - attributes = objectWithoutProperties(props, ['body', 'bottom', 'className', 'cssModule', 'heading', 'left', 'list', 'middle', 'object', 'right', 'tag', 'top']); - - - var defaultTag = void 0; - if (heading) { - defaultTag = 'h4'; - } else if (left || right) { - defaultTag = 'a'; - } else if (object) { - defaultTag = 'img'; - } else if (list) { - defaultTag = 'ul'; - } else { - defaultTag = 'div'; - } - var Tag = tag || defaultTag; - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, { - 'media-body': body, - 'media-heading': heading, - 'media-left': left, - 'media-right': right, - 'media-top': top, - 'media-bottom': bottom, - 'media-middle': middle, - 'media-object': object, - 'media-list': list, - media: !body && !heading && !left && !right && !top && !bottom && !middle && !object && !list - }), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Media.propTypes = propTypes$58; - -var propTypes$59 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - size: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) -}; - -var defaultProps$54 = { - tag: 'ul' -}; - -var Pagination = function Pagination(props) { - var className = props.className, - cssModule = props.cssModule, - size = props.size, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'size', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'pagination', defineProperty({}, 'pagination-' + size, !!size)), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Pagination.propTypes = propTypes$59; -Pagination.defaultProps = defaultProps$54; - -var propTypes$60 = { - active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) -}; - -var defaultProps$55 = { - tag: 'li' -}; - -var PaginationItem = function PaginationItem(props) { - var active = props.active, - className = props.className, - cssModule = props.cssModule, - disabled = props.disabled, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['active', 'className', 'cssModule', 'disabled', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'page-item', { - active: active, - disabled: disabled - }), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -PaginationItem.propTypes = propTypes$60; -PaginationItem.defaultProps = defaultProps$55; - -var propTypes$61 = { - 'aria-label': __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - next: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - previous: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]) -}; - -var defaultProps$56 = { - tag: 'a' -}; - -var PaginationLink = function PaginationLink(props) { - var className = props.className, - cssModule = props.cssModule, - next = props.next, - previous = props.previous, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'next', 'previous', 'tag']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'page-link'), cssModule); - - var defaultAriaLabel = void 0; - if (previous) { - defaultAriaLabel = 'Previous'; - } else if (next) { - defaultAriaLabel = 'Next'; - } - var ariaLabel = props['aria-label'] || defaultAriaLabel; - - var defaultCaret = void 0; - if (previous) { - defaultCaret = '\xAB'; - } else if (next) { - defaultCaret = '\xBB'; - } - - var children = props.children; - if (children && Array.isArray(children) && children.length === 0) { - children = null; - } - - if (previous || next) { - children = [__WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'span', - { - 'aria-hidden': 'true', - key: 'caret' - }, - children || defaultCaret - ), __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'span', - { - className: 'sr-only', - key: 'sr' - }, - ariaLabel - )]; - } - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Tag, - _extends({}, attributes, { - className: classes, - 'aria-label': ariaLabel - }), - children - ); -}; - -PaginationLink.propTypes = propTypes$61; -PaginationLink.defaultProps = defaultProps$56; - -var propTypes$62 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - activeTab: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$57 = { - tag: 'div' -}; - -var childContextTypes$2 = { - activeTabId: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any -}; - -var TabContent = function (_Component) { - inherits(TabContent, _Component); - - function TabContent(props) { - classCallCheck(this, TabContent); - - var _this = possibleConstructorReturn(this, (TabContent.__proto__ || Object.getPrototypeOf(TabContent)).call(this, props)); - - _this.state = { - activeTab: _this.props.activeTab - }; - return _this; - } - - createClass(TabContent, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - activeTabId: this.state.activeTab - }; - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (this.state.activeTab !== nextProps.activeTab) { - this.setState({ - activeTab: nextProps.activeTab - }); - } - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - cssModule = _props.cssModule, - Tag = _props.tag; - - - var attributes = omit(this.props, Object.keys(propTypes$62)); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tab-content', className), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); - } - }]); - return TabContent; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - -TabContent.propTypes = propTypes$62; -TabContent.defaultProps = defaultProps$57; -TabContent.childContextTypes = childContextTypes$2; - -var propTypes$63 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - tabId: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any -}; - -var defaultProps$58 = { - tag: 'div' -}; - -var contextTypes$3 = { - activeTabId: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any -}; - -function TabPane(props, context) { - var className = props.className, - cssModule = props.cssModule, - tabId = props.tabId, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tabId', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('tab-pane', className, { active: tabId === context.activeTabId }), cssModule); - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -} -TabPane.propTypes = propTypes$63; -TabPane.defaultProps = defaultProps$58; -TabPane.contextTypes = contextTypes$3; - -var propTypes$64 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - fluid: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$59 = { - tag: 'div' -}; - -var Jumbotron = function Jumbotron(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - fluid = props.fluid, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'fluid']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'jumbotron', fluid ? 'jumbotron-fluid' : false), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -Jumbotron.propTypes = propTypes$64; -Jumbotron.defaultProps = defaultProps$59; - -var propTypes$65 = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - closeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - closeAriaLabel: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - toggle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - transition: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape(Fade.propTypes) -}; - -var defaultProps$60 = { - color: 'success', - isOpen: true, - tag: 'div', - closeAriaLabel: 'Close', - transition: _extends({}, Fade.defaultProps, { - unmountOnExit: true - }) -}; - -function Alert(props) { - var className = props.className, - closeClassName = props.closeClassName, - closeAriaLabel = props.closeAriaLabel, - cssModule = props.cssModule, - Tag = props.tag, - color = props.color, - isOpen = props.isOpen, - toggle = props.toggle, - children = props.children, - transition = props.transition, - attributes = objectWithoutProperties(props, ['className', 'closeClassName', 'closeAriaLabel', 'cssModule', 'tag', 'color', 'isOpen', 'toggle', 'children', 'transition']); - - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'alert', 'alert-' + color, { 'alert-dismissible': toggle }), cssModule); - - var closeClasses = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()('close', closeClassName), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Fade, - _extends({}, attributes, transition, { tag: Tag, className: classes, 'in': isOpen, role: 'alert' }), - toggle ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'button', - { type: 'button', className: closeClasses, 'aria-label': closeAriaLabel, onClick: toggle }, - __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - 'span', - { 'aria-hidden': 'true' }, - '\xD7' - ) - ) : null, - children - ); -} - -Alert.propTypes = propTypes$65; -Alert.defaultProps = defaultProps$60; - -var _transitionStatusToCl; - -var propTypes$66 = _extends({}, Transition.propTypes, { - isOpen: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node]), - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - navbar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}); - -var defaultProps$61 = _extends({}, Transition.defaultProps, { - isOpen: false, - appear: false, - enter: true, - exit: true, - tag: 'div', - timeout: TransitionTimeouts.Collapse -}); - -var transitionStatusToClassHash = (_transitionStatusToCl = {}, defineProperty(_transitionStatusToCl, TransitionStatuses.ENTERING, 'collapsing'), defineProperty(_transitionStatusToCl, TransitionStatuses.ENTERED, 'collapse show'), defineProperty(_transitionStatusToCl, TransitionStatuses.EXITING, 'collapsing'), defineProperty(_transitionStatusToCl, TransitionStatuses.EXITED, 'collapse'), _transitionStatusToCl); - -function getTransitionClass(status) { - return transitionStatusToClassHash[status] || 'collapse'; -} - -function getHeight(node) { - return node.scrollHeight; -} - -var Collapse = function (_Component) { - inherits(Collapse, _Component); - - function Collapse(props) { - classCallCheck(this, Collapse); - - var _this = possibleConstructorReturn(this, (Collapse.__proto__ || Object.getPrototypeOf(Collapse)).call(this, props)); - - _this.state = { - height: null - }; - - ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach(function (name) { - _this[name] = _this[name].bind(_this); - }); - return _this; - } - - createClass(Collapse, [{ - key: 'onEntering', - value: function onEntering(node, isAppearing) { - this.setState({ height: getHeight(node) }); - this.props.onEntering(node, isAppearing); - } - }, { - key: 'onEntered', - value: function onEntered(node, isAppearing) { - this.setState({ height: null }); - this.props.onEntered(node, isAppearing); - } - }, { - key: 'onExit', - value: function onExit(node) { - this.setState({ height: getHeight(node) }); - this.props.onExit(node); - } - }, { - key: 'onExiting', - value: function onExiting(node) { - // getting this variable triggers a reflow - var _unused = node.offsetHeight; // eslint-disable-line no-unused-vars - this.setState({ height: 0 }); - this.props.onExiting(node); - } - }, { - key: 'onExited', - value: function onExited(node) { - this.setState({ height: null }); - this.props.onExited(node); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - Tag = _props.tag, - isOpen = _props.isOpen, - className = _props.className, - navbar = _props.navbar, - cssModule = _props.cssModule, - children = _props.children, - otherProps = objectWithoutProperties(_props, ['tag', 'isOpen', 'className', 'navbar', 'cssModule', 'children']); - var height = this.state.height; - - // In NODE_ENV=production the Transition.propTypes are wrapped which results in an - // empty object "{}". This is the result of the `react-transition-group` babel - // configuration settings. Therefore, to ensure that production builds work without - // error, we can either explicitly define keys or use the Transition.defaultProps. - // Using the Transition.defaultProps excludes any required props. Thus, the best - // solution is to explicitly define required props in our utilities and reference these. - // This also gives us more flexibility in the future to remove the prop-types - // dependency in distribution builds (Similar to how `react-transition-group` does). - // Note: Without omitting the `react-transition-group` props, the resulting child - // Tag component would inherit the Transition properties as attributes for the HTML - // element which results in errors/warnings for non-valid attributes. - - var transitionProps = pick(otherProps, TransitionPropTypeKeys); - var childProps = omit(otherProps, TransitionPropTypeKeys); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Transition, - _extends({}, transitionProps, { - 'in': isOpen, - onEntering: this.onEntering, - onEntered: this.onEntered, - onExit: this.onExit, - onExiting: this.onExiting, - onExited: this.onExited - }), - function (status) { - var collapseClass = getTransitionClass(status); - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, collapseClass, navbar && 'navbar-collapse'), cssModule); - var style = height === null ? null : { height: height }; - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - Tag, - _extends({}, childProps, { - style: _extends({}, childProps.style, style), - className: classes - }), - children - ); - } - ); - } - }]); - return Collapse; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - -Collapse.propTypes = propTypes$66; -Collapse.defaultProps = defaultProps$61; - -var propTypes$67 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - disabled: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - color: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - action: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$62 = { - tag: 'li' -}; - -var handleDisabledOnClick = function handleDisabledOnClick(e) { - e.preventDefault(); -}; - -var ListGroupItem = function ListGroupItem(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - active = props.active, - disabled = props.disabled, - action = props.action, - color = props.color, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag', 'active', 'disabled', 'action', 'color']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(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. - if (disabled) { - attributes.onClick = handleDisabledOnClick; - } - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ListGroupItem.propTypes = propTypes$67; -ListGroupItem.defaultProps = defaultProps$62; - -var propTypes$68 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$63 = { - tag: 'h5' -}; - -var ListGroupItemHeading = function ListGroupItemHeading(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'list-group-item-heading'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ListGroupItemHeading.propTypes = propTypes$68; -ListGroupItemHeading.defaultProps = defaultProps$63; - -var propTypes$69 = { - tag: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]), - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, - cssModule: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - -var defaultProps$64 = { - tag: 'p' -}; - -var ListGroupItemText = function ListGroupItemText(props) { - var className = props.className, - cssModule = props.cssModule, - Tag = props.tag, - attributes = objectWithoutProperties(props, ['className', 'cssModule', 'tag']); - - var classes = mapToCssModules(__WEBPACK_IMPORTED_MODULE_2_classnames___default()(className, 'list-group-item-text'), cssModule); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tag, _extends({}, attributes, { className: classes })); -}; - -ListGroupItemText.propTypes = propTypes$69; -ListGroupItemText.defaultProps = defaultProps$64; - -var UncontrolledAlert = function (_Component) { - inherits(UncontrolledAlert, _Component); - - function UncontrolledAlert(props) { - classCallCheck(this, UncontrolledAlert); - - var _this = possibleConstructorReturn(this, (UncontrolledAlert.__proto__ || Object.getPrototypeOf(UncontrolledAlert)).call(this, props)); - - _this.state = { isOpen: true }; - _this.toggle = _this.toggle.bind(_this); - return _this; - } - - createClass(UncontrolledAlert, [{ - key: 'toggle', - value: function toggle() { - this.setState({ isOpen: !this.state.isOpen }); - } - }, { - key: 'render', - value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Alert, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); - } - }]); - return UncontrolledAlert; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - -var UncontrolledButtonDropdown = function (_Component) { - inherits(UncontrolledButtonDropdown, _Component); - - function UncontrolledButtonDropdown(props) { - classCallCheck(this, UncontrolledButtonDropdown); - - var _this = possibleConstructorReturn(this, (UncontrolledButtonDropdown.__proto__ || Object.getPrototypeOf(UncontrolledButtonDropdown)).call(this, props)); - - _this.state = { isOpen: false }; - _this.toggle = _this.toggle.bind(_this); - return _this; - } - - createClass(UncontrolledButtonDropdown, [{ - key: 'toggle', - value: function toggle() { - this.setState({ isOpen: !this.state.isOpen }); - } - }, { - key: 'render', - value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(ButtonDropdown, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); - } - }]); - return UncontrolledButtonDropdown; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - -var UncontrolledDropdown = function (_Component) { - inherits(UncontrolledDropdown, _Component); - - function UncontrolledDropdown(props) { - classCallCheck(this, UncontrolledDropdown); - - var _this = possibleConstructorReturn(this, (UncontrolledDropdown.__proto__ || Object.getPrototypeOf(UncontrolledDropdown)).call(this, props)); - - _this.state = { isOpen: false }; - _this.toggle = _this.toggle.bind(_this); - return _this; - } - - createClass(UncontrolledDropdown, [{ - key: 'toggle', - value: function toggle() { - this.setState({ isOpen: !this.state.isOpen }); - } - }, { - key: 'render', - value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Dropdown, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); - } - }]); - return UncontrolledDropdown; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - -var UncontrolledNavDropdown = function (_Component) { - inherits(UncontrolledNavDropdown, _Component); - - function UncontrolledNavDropdown(props) { - classCallCheck(this, UncontrolledNavDropdown); - - var _this = possibleConstructorReturn(this, (UncontrolledNavDropdown.__proto__ || Object.getPrototypeOf(UncontrolledNavDropdown)).call(this, props)); - - _this.state = { isOpen: false }; - _this.toggle = _this.toggle.bind(_this); - return _this; - } - - createClass(UncontrolledNavDropdown, [{ - key: 'toggle', - value: function toggle() { - this.setState({ isOpen: !this.state.isOpen }); - } - }, { - key: 'render', - value: function render() { - warnOnce('The "UncontrolledNavDropdown" component has been deprecated.\nPlease use component "UncontrolledDropdown" with nav prop.'); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(NavDropdown, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); - } - }]); - return UncontrolledNavDropdown; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - -var UncontrolledTooltip = function (_Component) { - inherits(UncontrolledTooltip, _Component); - - function UncontrolledTooltip(props) { - classCallCheck(this, UncontrolledTooltip); - - var _this = possibleConstructorReturn(this, (UncontrolledTooltip.__proto__ || Object.getPrototypeOf(UncontrolledTooltip)).call(this, props)); - - _this.state = { isOpen: false }; - _this.toggle = _this.toggle.bind(_this); - return _this; - } - - createClass(UncontrolledTooltip, [{ - key: 'toggle', - value: function toggle() { - this.setState({ isOpen: !this.state.isOpen }); - } - }, { - key: 'render', - value: function render() { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Tooltip, _extends({ isOpen: this.state.isOpen, toggle: this.toggle }, this.props)); - } - }]); - return UncontrolledTooltip; -}(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); - - -//# sourceMappingURL=reactstrap.es.js.map - -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(5))) - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyFunction = __webpack_require__(10); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -module.exports = warning; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var RemoveClasses = function RemoveClasses(NewClassNames) { - var MatchClasses = NewClassNames.map(function (Class) { - return document.body.classList.contains(Class); - }); - return MatchClasses.indexOf(true) !== -1; -}; - -var ToggleClasses = function ToggleClasses(Toggle, ClassNames) { - var Level = ClassNames.indexOf(Toggle); - var NewClassNames = ClassNames.slice(0, Level + 1); - if (RemoveClasses(NewClassNames)) { - NewClassNames.map(function (Class) { - return document.body.classList.remove(Class); - }); - } else { - document.body.classList.add(Toggle); - } -}; - -exports.ToggleClasses = ToggleClasses; - -/***/ }), -/* 22 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__ = __webpack_require__(40); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserRouter", function() { return __WEBPACK_IMPORTED_MODULE_0__BrowserRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__HashRouter__ = __webpack_require__(42); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "HashRouter", function() { return __WEBPACK_IMPORTED_MODULE_1__HashRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Link__ = __webpack_require__(26); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return __WEBPACK_IMPORTED_MODULE_2__Link__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__ = __webpack_require__(44); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return __WEBPACK_IMPORTED_MODULE_3__MemoryRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__NavLink__ = __webpack_require__(47); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NavLink", function() { return __WEBPACK_IMPORTED_MODULE_4__NavLink__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Prompt__ = __webpack_require__(50); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Prompt", function() { return __WEBPACK_IMPORTED_MODULE_5__Prompt__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__(52); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_6__Redirect__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(27); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_7__Route__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__Router__ = __webpack_require__(15); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_8__Router__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__StaticRouter__ = __webpack_require__(58); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return __WEBPACK_IMPORTED_MODULE_9__StaticRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__Switch__ = __webpack_require__(60); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return __WEBPACK_IMPORTED_MODULE_10__Switch__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__matchPath__ = __webpack_require__(62); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_11__matchPath__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__withRouter__ = __webpack_require__(63); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_12__withRouter__["a"]; }); - - - - - - - - - - - - - - - - - - - - - - - - - - - -/***/ }), -/* 23 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -function isAbsolute(pathname) { - return pathname.charAt(0) === '/'; -} - -// About 1.5x faster than the two-arg version of Array#splice() -function spliceOne(list, index) { - for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) { - list[i] = list[k]; - } - - list.pop(); -} - -// This implementation is based heavily on node's url.parse -function resolvePathname(to) { - var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - - var toParts = to && to.split('/') || []; - var fromParts = from && from.split('/') || []; - - var isToAbs = to && isAbsolute(to); - var isFromAbs = from && isAbsolute(from); - var mustEndAbs = isToAbs || isFromAbs; - - if (to && isAbsolute(to)) { - // to is absolute - fromParts = toParts; - } else if (toParts.length) { - // to is relative, drop the filename - fromParts.pop(); - fromParts = fromParts.concat(toParts); - } - - if (!fromParts.length) return '/'; - - var hasTrailingSlash = void 0; - if (fromParts.length) { - var last = fromParts[fromParts.length - 1]; - hasTrailingSlash = last === '.' || last === '..' || last === ''; - } else { - hasTrailingSlash = false; - } - - var up = 0; - for (var i = fromParts.length; i >= 0; i--) { - var part = fromParts[i]; - - if (part === '.') { - spliceOne(fromParts, i); - } else if (part === '..') { - spliceOne(fromParts, i); - up++; - } else if (up) { - spliceOne(fromParts, i); - up--; - } - } - - if (!mustEndAbs) for (; up--; up) { - fromParts.unshift('..'); - }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift(''); - - var result = fromParts.join('/'); - - if (hasTrailingSlash && result.substr(-1) !== '/') result += '/'; - - return result; -} - -/* harmony default export */ __webpack_exports__["default"] = (resolvePathname); - -/***/ }), -/* 24 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -function valueEqual(a, b) { - if (a === b) return true; - - if (a == null || b == null) return false; - - if (Array.isArray(a)) { - return Array.isArray(b) && a.length === b.length && a.every(function (item, index) { - return valueEqual(item, b[index]); - }); - } - - var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a); - var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b); - - if (aType !== bType) return false; - - if (aType === 'object') { - var aValue = a.valueOf(); - var bValue = b.valueOf(); - - if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue); - - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); - - if (aKeys.length !== bKeys.length) return false; - - return aKeys.every(function (key) { - return valueEqual(a[key], b[key]); - }); - } - - return false; -} - -/* harmony default export */ __webpack_exports__["default"] = (valueEqual); - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - -var addEventListener = exports.addEventListener = function addEventListener(node, event, listener) { - return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener); -}; - -var removeEventListener = exports.removeEventListener = function removeEventListener(node, event, listener) { - return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener); -}; - -var getConfirmation = exports.getConfirmation = function getConfirmation(message, callback) { - return callback(window.confirm(message)); -}; // eslint-disable-line no-alert - -/** - * Returns true if the HTML5 history API is supported. Taken from Modernizr. - * - * https://github.com/Modernizr/Modernizr/blob/master/LICENSE - * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 - */ -var supportsHistory = exports.supportsHistory = function supportsHistory() { - var ua = window.navigator.userAgent; - - if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; - - return window.history && 'pushState' in window.history; -}; - -/** - * Returns true if browser fires popstate on hash change. - * IE10 and IE11 do not. - */ -var supportsPopStateOnHashChange = exports.supportsPopStateOnHashChange = function supportsPopStateOnHashChange() { - return window.navigator.userAgent.indexOf('Trident') === -1; -}; - -/** - * Returns false if using go(n) with hash history causes a full page reload. - */ -var supportsGoWithoutReloadUsingHash = exports.supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() { - return window.navigator.userAgent.indexOf('Firefox') === -1; -}; - -/** - * Returns true if a given popstate event is an extraneous WebKit event. - * Accounts for the fact that Chrome on iOS fires real popstate events - * containing undefined state when pressing the back button. - */ -var isExtraneousPopstateEvent = exports.isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) { - return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; -}; - -/***/ }), -/* 26 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - -var isModifiedEvent = function isModifiedEvent(event) { - return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); -}; - -/** - * The public API for rendering a history-aware . - */ - -var Link = function (_React$Component) { - _inherits(Link, _React$Component); - - function Link() { - var _temp, _this, _ret; - - _classCallCheck(this, Link); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) { - if (_this.props.onClick) _this.props.onClick(event); - - if (!event.defaultPrevented && // onClick prevented default - event.button === 0 && // ignore right clicks - !_this.props.target && // let browser handle "target=_blank" etc. - !isModifiedEvent(event) // ignore clicks with modifier keys - ) { - event.preventDefault(); - - var history = _this.context.router.history; - var _this$props = _this.props, - replace = _this$props.replace, - to = _this$props.to; - - - if (replace) { - history.replace(to); - } else { - history.push(to); - } - } - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - Link.prototype.render = function render() { - var _props = this.props, - replace = _props.replace, - to = _props.to, - innerRef = _props.innerRef, - props = _objectWithoutProperties(_props, ['replace', 'to', 'innerRef']); // eslint-disable-line no-unused-vars - - __WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router, 'You should not use outside a '); - - var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('a', _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef })); - }; - - return Link; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Link.propTypes = { - onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired, - innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func]) -}; -Link.defaultProps = { - replace: false -}; -Link.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired - }).isRequired - }).isRequired -}; - - -/* harmony default export */ __webpack_exports__["a"] = (Link); - -/***/ }), -/* 27 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__ = __webpack_require__(28); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__["a" /* default */]); - -/***/ }), -/* 28 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(17); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - - -var isEmptyChildren = function isEmptyChildren(children) { - return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 0; -}; - -/** - * The public API for matching a single path and rendering. - */ - -var Route = function (_React$Component) { - _inherits(Route, _React$Component); - - function Route() { - var _temp, _this, _ret; - - _classCallCheck(this, Route); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { - match: _this.computeMatch(_this.props, _this.context.router) - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - Route.prototype.getChildContext = function getChildContext() { - return { - router: _extends({}, this.context.router, { - route: { - location: this.props.location || this.context.router.route.location, - match: this.state.match - } - }) - }; - }; - - Route.prototype.computeMatch = function computeMatch(_ref, router) { - var computedMatch = _ref.computedMatch, - location = _ref.location, - path = _ref.path, - strict = _ref.strict, - exact = _ref.exact, - sensitive = _ref.sensitive; - - if (computedMatch) return computedMatch; // already computed the match for us - - __WEBPACK_IMPORTED_MODULE_1_invariant___default()(router, 'You should not use or withRouter() outside a '); - - var route = router.route; - - var pathname = (location || route.location).pathname; - - return path ? Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" /* default */])(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }) : route.match; - }; - - Route.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.render), 'You should not use and in the same route; will be ignored'); - - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use and in the same route; will be ignored'); - - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), 'You should not use and in the same route; will be ignored'); - }; - - Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); - - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); - - this.setState({ - match: this.computeMatch(nextProps, nextContext.router) - }); - }; - - Route.prototype.render = function render() { - var match = this.state.match; - var _props = this.props, - children = _props.children, - component = _props.component, - render = _props.render; - var _context$router = this.context.router, - history = _context$router.history, - route = _context$router.route, - staticContext = _context$router.staticContext; - - var location = this.props.location || route.location; - var props = { match: match, location: location, history: history, staticContext: staticContext }; - - return component ? // component prop gets first priority, only called if there's a match - match ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(component, props) : null : render ? // render prop is next, only called if there's a match - match ? render(props) : null : children ? // children come last, always called - typeof children === 'function' ? children(props) : !isEmptyChildren(children) ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children) : null : null; - }; - - return Route; -}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component); - -Route.propTypes = { - computedMatch: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object, // private, from - path: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, - exact: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool, - strict: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool, - sensitive: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool, - component: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, - render: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, - children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node]), - location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object -}; -Route.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired, - route: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired, - staticContext: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object - }) -}; -Route.childContextTypes = { - router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired -}; - - -/* harmony default export */ __webpack_exports__["a"] = (Route); - -/***/ }), -/* 29 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return canUseDOM; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addEventListener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return removeEventListener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getConfirmation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return supportsHistory; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return supportsPopStateOnHashChange; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return supportsGoWithoutReloadUsingHash; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isExtraneousPopstateEvent; }); -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - -var addEventListener = function addEventListener(node, event, listener) { - return node.addEventListener ? node.addEventListener(event, listener, false) : node.attachEvent('on' + event, listener); -}; - -var removeEventListener = function removeEventListener(node, event, listener) { - return node.removeEventListener ? node.removeEventListener(event, listener, false) : node.detachEvent('on' + event, listener); -}; - -var getConfirmation = function getConfirmation(message, callback) { - return callback(window.confirm(message)); -}; // eslint-disable-line no-alert - -/** - * Returns true if the HTML5 history API is supported. Taken from Modernizr. - * - * https://github.com/Modernizr/Modernizr/blob/master/LICENSE - * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js - * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586 - */ -var supportsHistory = function supportsHistory() { - var ua = window.navigator.userAgent; - - if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; - - return window.history && 'pushState' in window.history; -}; - -/** - * Returns true if browser fires popstate on hash change. - * IE10 and IE11 do not. - */ -var supportsPopStateOnHashChange = function supportsPopStateOnHashChange() { - return window.navigator.userAgent.indexOf('Trident') === -1; -}; - -/** - * Returns false if using go(n) with hash history causes a full page reload. - */ -var supportsGoWithoutReloadUsingHash = function supportsGoWithoutReloadUsingHash() { - return window.navigator.userAgent.indexOf('Firefox') === -1; -}; - -/** - * Returns true if a given popstate event is an extraneous WebKit event. - * Accounts for the fact that Chrome on iOS fires real popstate events - * containing undefined state when pressing the back button. - */ -var isExtraneousPopstateEvent = function isExtraneousPopstateEvent(event) { - return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; -}; - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AppLayout = exports.AppSidebarMinimizer = exports.AppSidebarFooter = exports.AppSidebarForm = exports.AppSidebarHeader = exports.AppSidebarNav = exports.AppSidebarToggler = exports.AppSidebar = exports.AppNavbarBrand = exports.AppHeaderDropdown = exports.AppHeader = exports.AppFooter = exports.AppBreadcrumb = exports.AppAsideToggler = exports.AppAside = undefined; - -var _Aside = __webpack_require__(32); - -var _Aside2 = _interopRequireDefault(_Aside); - -var _AsideToggler = __webpack_require__(38); - -var _AsideToggler2 = _interopRequireDefault(_AsideToggler); - -var _Breadcrumb = __webpack_require__(39); - -var _Breadcrumb2 = _interopRequireDefault(_Breadcrumb); - -var _Footer = __webpack_require__(76); - -var _Footer2 = _interopRequireDefault(_Footer); - -var _Header = __webpack_require__(77); - -var _Header2 = _interopRequireDefault(_Header); - -var _HeaderDropdown = __webpack_require__(78); - -var _HeaderDropdown2 = _interopRequireDefault(_HeaderDropdown); - -var _NavbarBrand = __webpack_require__(79); - -var _NavbarBrand2 = _interopRequireDefault(_NavbarBrand); - -var _index = __webpack_require__(80); - -var _Shared = __webpack_require__(6); - -var _Shared2 = _interopRequireDefault(_Shared); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.AppAside = _Aside2.default; -exports.AppAsideToggler = _AsideToggler2.default; -exports.AppBreadcrumb = _Breadcrumb2.default; -exports.AppFooter = _Footer2.default; -exports.AppHeader = _Header2.default; -exports.AppHeaderDropdown = _HeaderDropdown2.default; -exports.AppNavbarBrand = _NavbarBrand2.default; -exports.AppSidebar = _index.AppSidebar; -exports.AppSidebarToggler = _index.AppSidebarToggler; -exports.AppSidebarNav = _index.AppSidebarNav; -exports.AppSidebarHeader = _index.AppSidebarHeader; -exports.AppSidebarForm = _index.AppSidebarForm; -exports.AppSidebarFooter = _index.AppSidebarFooter; -exports.AppSidebarMinimizer = _index.AppSidebarMinimizer; -exports.AppLayout = _Shared2.default; - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _Shared = __webpack_require__(6); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var propTypes = { - children: _propTypes2.default.node, - className: _propTypes2.default.string, - display: _propTypes2.default.string, - fixed: _propTypes2.default.bool, - hidden: _propTypes2.default.bool, - isOpen: _propTypes2.default.bool, - offCanvas: _propTypes2.default.bool, - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]) -}; - -var defaultProps = { - tag: 'aside', - display: '', - fixed: false, - hidden: false, - isOpen: false, - offCanvas: true -}; - -var AppAside = function (_Component) { - _inherits(AppAside, _Component); - - function AppAside(props) { - _classCallCheck(this, AppAside); - - var _this = _possibleConstructorReturn(this, (AppAside.__proto__ || Object.getPrototypeOf(AppAside)).call(this, props)); - - _this.isFixed = _this.isFixed.bind(_this); - _this.isHidden = _this.isHidden.bind(_this); - _this.isOffCanvas = _this.isOffCanvas.bind(_this); - _this.displayBreakpoint = _this.displayBreakpoint.bind(_this); - return _this; - } - - _createClass(AppAside, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.isFixed(this.props.fixed); - this.isHidden(this.props.hidden); - this.isOffCanvas(this.props.offCanvas); - this.displayBreakpoint(this.props.display); - } - }, { - key: 'isHidden', - value: function isHidden(hidden) { - if (hidden) { - document.body.classList.add('aside-menu-hidden'); - } - } - }, { - key: 'isFixed', - value: function isFixed(fixed) { - if (fixed) { - document.body.classList.add('aside-menu-fixed'); - } - } - }, { - key: 'isOffCanvas', - value: function isOffCanvas(offCanvas) { - if (offCanvas) { - document.body.classList.add('aside-menu-off-canvas'); - } - } - }, { - key: 'displayBreakpoint', - value: function displayBreakpoint(display) { - var cssTemplate = 'aside-menu-' + display + '-show'; - - var _asideMenuCssClasses$ = _slicedToArray(_Shared.asideMenuCssClasses[0], 1), - cssClass = _asideMenuCssClasses$[0]; - - if (display && _Shared.asideMenuCssClasses.indexOf(cssTemplate) > -1) { - cssClass = cssTemplate; - } - document.body.classList.add(cssClass); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - display = _props.display, - fixed = _props.fixed, - hidden = _props.hidden, - offCanvas = _props.offCanvas, - isOpen = _props.isOpen, - Tag = _props.tag, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'display', 'fixed', 'hidden', 'offCanvas', 'isOpen', 'tag']); - - var classes = (0, _classnames2.default)(className, 'aside-menu'); - - return _react2.default.createElement( - Tag, - _extends({}, attributes, { className: classes }), - children - ); - } - }]); - - return AppAside; -}(_react.Component); - -AppAside.propTypes = propTypes; -AppAside.defaultProps = defaultProps; - -exports.default = AppAside; - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var emptyFunction = __webpack_require__(10); -var invariant = __webpack_require__(11); -var warning = __webpack_require__(20); -var assign = __webpack_require__(34); - -var ReactPropTypesSecret = __webpack_require__(12); -var checkPropTypes = __webpack_require__(35); - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - - var ANONYMOUS = '<>'; - - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker, - }; - - /** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - } - /*eslint-enable no-self-compare*/ - - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; - - function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use `PropTypes.checkPropTypes()` to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - warning( - false, - 'You are manually calling a React.PropTypes validation ' + - 'function for the `%s` prop on `%s`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', - propFullName, - componentName - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturnsNull); - } - - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); - } - - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - warning( - false, - 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + - 'received %s at index %s.', - getPostfixForTypeWarning(checker), - i - ); - return emptyFunction.thatReturnsNull; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); - } - - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createStrictShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - // We need to check all keys in case some are required but missing from - // props. - var allKeys = assign({}, props[propName], shapeTypes); - for (var key in allKeys) { - var checker = shapeTypes[key]; - if (!checker) { - return new PropTypeError( - 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + - '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') - ); - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - - return createChainableTypeChecker(validate); - } - - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // Equivalent of `typeof` but with special handling for array and regexp. - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; - } - - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; - } - - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } - } - - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - - -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -if (process.env.NODE_ENV !== 'production') { - var invariant = __webpack_require__(11); - var warning = __webpack_require__(20); - var ReactPropTypesSecret = __webpack_require__(12); - var loggedTypeFailures = {}; -} - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (process.env.NODE_ENV !== 'production') { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var stack = getStack ? getStack() : ''; - - warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); - } - } - } - } -} - -module.exports = checkPropTypes; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var emptyFunction = __webpack_require__(10); -var invariant = __webpack_require__(11); -var ReactPropTypesSecret = __webpack_require__(12); - -module.exports = function() { - function shim(props, propName, componentName, location, propFullName, secret) { - if (secret === ReactPropTypesSecret) { - // It is still safe when called from React. - return; - } - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use PropTypes.checkPropTypes() to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - }; - shim.isRequired = shim; - function getShim() { - return shim; - }; - // Important! - // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. - var ReactPropTypes = { - array: shim, - bool: shim, - func: shim, - number: shim, - object: shim, - string: shim, - symbol: shim, - - any: shim, - arrayOf: getShim, - element: shim, - instanceOf: getShim, - node: shim, - objectOf: getShim, - oneOf: getShim, - oneOfType: getShim, - shape: getShim, - exact: getShim - }; - - ReactPropTypes.checkPropTypes = emptyFunction; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var sidebarCssClasses = exports.sidebarCssClasses = ['sidebar-show', 'sidebar-sm-show', 'sidebar-md-show', 'sidebar-lg-show', 'sidebar-xl-show']; - -var asideMenuCssClasses = exports.asideMenuCssClasses = ['aside-menu-show', 'aside-menu-sm-show', 'aside-menu-md-show', 'aside-menu-lg-show', 'aside-menu-xl-show']; - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _Shared = __webpack_require__(6); - -var _toggleClasses = __webpack_require__(21); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var propTypes = { - children: _propTypes2.default.node, - className: _propTypes2.default.string, - display: _propTypes2.default.any, - mobile: _propTypes2.default.bool, - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]), - type: _propTypes2.default.string -}; - -var defaultProps = { - display: 'lg', - mobile: false, - tag: 'button', - type: 'button' -}; - -var AppAsideToggler = function (_Component) { - _inherits(AppAsideToggler, _Component); - - function AppAsideToggler(props) { - _classCallCheck(this, AppAsideToggler); - - var _this = _possibleConstructorReturn(this, (AppAsideToggler.__proto__ || Object.getPrototypeOf(AppAsideToggler)).call(this, props)); - - _this.asideToggle = _this.asideToggle.bind(_this); - - _this.state = {}; - return _this; - } - - _createClass(AppAsideToggler, [{ - key: 'asideToggle', - value: function asideToggle(e) { - e.preventDefault(); - - if (this.props.mobile) { - document.body.classList.toggle('aside-menu-show'); - } else { - var display = this.props.display; - var cssTemplate = 'aside-menu-' + display + '-show'; - - var _asideMenuCssClasses$ = _slicedToArray(_Shared.asideMenuCssClasses[0], 1), - cssClass = _asideMenuCssClasses$[0]; - - if (display && _Shared.asideMenuCssClasses.indexOf(cssTemplate) > -1) { - cssClass = cssTemplate; - } - (0, _toggleClasses.ToggleClasses)(cssClass, _Shared.asideMenuCssClasses); - } - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - mobile = _props.mobile, - Tag = _props.tag, - display = _props.display, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'mobile', 'tag', 'display']); - - var classes = (0, _classnames2.default)(className, 'navbar-toggler'); - - return _react2.default.createElement( - 'button', - _extends({ - type: 'button', - className: classes - }, attributes, { - onClick: this.asideToggle - }), - children || _react2.default.createElement('span', { className: 'navbar-toggler-icon' }) - ); - } - }]); - - return AppAsideToggler; -}(_react.Component); - -AppAsideToggler.propTypes = propTypes; -AppAsideToggler.defaultProps = defaultProps; - -exports.default = AppAsideToggler; - -/***/ }), -/* 39 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactRouterDom = __webpack_require__(22); - -var _reactstrap = __webpack_require__(19); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var routes = void 0; - -var getPaths = function getPaths(pathname) { - var paths = ['/']; - - if (pathname === '/') return paths; - - pathname.split('/').reduce(function (prev, curr) { - var currPath = prev + '/' + curr; - paths.push(currPath); - return currPath; - }); - return paths; -}; - -var findRouteName = function findRouteName(url) { - var aroute = routes.find(function (route) { - return route.path === url; - }); - if (aroute && aroute.name) { - return aroute.name; - } - return null; -}; - -var BreadcrumbsItem = function BreadcrumbsItem(_ref) { - var match = _ref.match; - - var routeName = findRouteName(match.url); - if (routeName) { - return match.isExact ? _react2.default.createElement( - _reactstrap.BreadcrumbItem, - { active: true }, - routeName - ) : _react2.default.createElement( - _reactstrap.BreadcrumbItem, - null, - _react2.default.createElement( - _reactRouterDom.Link, - { to: match.url || '' }, - routeName - ) - ); - } - return null; -}; - -BreadcrumbsItem.propTypes = { - match: _propTypes2.default.shape({ - url: _propTypes2.default.string - }) -}; - -var Breadcrumbs = function Breadcrumbs(args) { - var paths = getPaths(args.location.pathname); - var items = paths.map(function (path, i) { - return _react2.default.createElement(_reactRouterDom.Route, { key: i.toString(), path: path, component: BreadcrumbsItem }); - }); - return _react2.default.createElement( - _reactstrap.Breadcrumb, - null, - items - ); -}; - -var propTypes = { - children: _propTypes2.default.node, - className: _propTypes2.default.string, - appRoutes: _propTypes2.default.any, - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]) -}; - -var defaultProps = { - tag: 'div', - className: '', - appRoutes: [{ path: '/', exact: true, name: 'Home', component: null }] -}; - -var AppBreadcrumb = function (_Component) { - _inherits(AppBreadcrumb, _Component); - - function AppBreadcrumb(props) { - _classCallCheck(this, AppBreadcrumb); - - var _this = _possibleConstructorReturn(this, (AppBreadcrumb.__proto__ || Object.getPrototypeOf(AppBreadcrumb)).call(this, props)); - - _this.state = { routes: props.appRoutes }; - routes = _this.state.routes; - return _this; - } - - _createClass(AppBreadcrumb, [{ - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - appRoutes = _props.appRoutes, - Tag = _props.tag, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'appRoutes', 'tag']); - - var classes = (0, _classnames2.default)(className); - - return _react2.default.createElement( - Tag, - { className: classes }, - _react2.default.createElement(_reactRouterDom.Route, _extends({ path: '/:path', component: Breadcrumbs }, attributes)) - ); - } - }]); - - return AppBreadcrumb; -}(_react.Component); - -AppBreadcrumb.propTypes = propTypes; -AppBreadcrumb.defaultProps = defaultProps; - -exports.default = AppBreadcrumb; - -/***/ }), -/* 40 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory__ = __webpack_require__(41); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(15); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - - -/** - * The public API for a that uses HTML5 history. - */ - -var BrowserRouter = function (_React$Component) { - _inherits(BrowserRouter, _React$Component); - - function BrowserRouter() { - var _temp, _this, _ret; - - _classCallCheck(this, BrowserRouter); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_3_history_createBrowserHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret); - } - - BrowserRouter.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, ' ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { BrowserRouter as Router }`.'); - }; - - BrowserRouter.prototype.render = function render() { - return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], { history: this.history, children: this.props.children }); - }; - - return BrowserRouter; -}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component); - -BrowserRouter.propTypes = { - basename: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, - forceRefresh: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, - getUserConfirmation: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, - keyLength: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number, - children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node -}; - - -/* harmony default export */ __webpack_exports__["a"] = (BrowserRouter); - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _warning = __webpack_require__(2); - -var _warning2 = _interopRequireDefault(_warning); - -var _invariant = __webpack_require__(4); - -var _invariant2 = _interopRequireDefault(_invariant); - -var _LocationUtils = __webpack_require__(13); - -var _PathUtils = __webpack_require__(7); - -var _createTransitionManager = __webpack_require__(14); - -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); - -var _DOMUtils = __webpack_require__(25); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var PopStateEvent = 'popstate'; -var HashChangeEvent = 'hashchange'; - -var getHistoryState = function getHistoryState() { - try { - return window.history.state || {}; - } catch (e) { - // IE 11 sometimes throws when accessing window.history.state - // See https://github.com/ReactTraining/history/pull/289 - return {}; - } -}; - -/** - * Creates a history object that uses the HTML5 history API including - * pushState, replaceState, and the popstate event. - */ -var createBrowserHistory = function createBrowserHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Browser history needs a DOM'); - - var globalHistory = window.history; - var canUseHistory = (0, _DOMUtils.supportsHistory)(); - var needsHashChangeListener = !(0, _DOMUtils.supportsPopStateOnHashChange)(); - - var _props$forceRefresh = props.forceRefresh, - forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh, - _props$getUserConfirm = props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, - _props$keyLength = props.keyLength, - keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; - - var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; - - var getDOMLocation = function getDOMLocation(historyState) { - var _ref = historyState || {}, - key = _ref.key, - state = _ref.state; - - var _window$location = window.location, - pathname = _window$location.pathname, - search = _window$location.search, - hash = _window$location.hash; - - - var path = pathname + search + hash; - - (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); - - if (basename) path = (0, _PathUtils.stripBasename)(path, basename); - - return (0, _LocationUtils.createLocation)(path, state, key); - }; - - var createKey = function createKey() { - return Math.random().toString(36).substr(2, keyLength); - }; - - var transitionManager = (0, _createTransitionManager2.default)(); - - var setState = function setState(nextState) { - _extends(history, nextState); - - history.length = globalHistory.length; - - transitionManager.notifyListeners(history.location, history.action); - }; - - var handlePopState = function handlePopState(event) { - // Ignore extraneous popstate events in WebKit. - if ((0, _DOMUtils.isExtraneousPopstateEvent)(event)) return; - - handlePop(getDOMLocation(event.state)); - }; - - var handleHashChange = function handleHashChange() { - handlePop(getDOMLocation(getHistoryState())); - }; - - var forceNextPop = false; - - var handlePop = function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ action: action, location: location }); - } else { - revertPop(location); - } - }); - } - }; - - var revertPop = function revertPop(fromLocation) { - var toLocation = history.location; - - // TODO: We could probably make this more reliable by - // keeping a list of keys we've seen in sessionStorage. - // Instead, we just default to 0 for keys we don't know. - - var toIndex = allKeys.indexOf(toLocation.key); - - if (toIndex === -1) toIndex = 0; - - var fromIndex = allKeys.indexOf(fromLocation.key); - - if (fromIndex === -1) fromIndex = 0; - - var delta = toIndex - fromIndex; - - if (delta) { - forceNextPop = true; - go(delta); - } - }; - - var initialLocation = getDOMLocation(getHistoryState()); - var allKeys = [initialLocation.key]; - - // Public interface - - var createHref = function createHref(location) { - return basename + (0, _PathUtils.createPath)(location); - }; - - var push = function push(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'PUSH'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var href = createHref(location); - var key = location.key, - state = location.state; - - - if (canUseHistory) { - globalHistory.pushState({ key: key, state: state }, null, href); - - if (forceRefresh) { - window.location.href = href; - } else { - var prevIndex = allKeys.indexOf(history.location.key); - var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); - - nextKeys.push(location.key); - allKeys = nextKeys; - - setState({ action: action, location: location }); - } - } else { - (0, _warning2.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); - - window.location.href = href; - } - }); - }; - - var replace = function replace(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'REPLACE'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var href = createHref(location); - var key = location.key, - state = location.state; - - - if (canUseHistory) { - globalHistory.replaceState({ key: key, state: state }, null, href); - - if (forceRefresh) { - window.location.replace(href); - } else { - var prevIndex = allKeys.indexOf(history.location.key); - - if (prevIndex !== -1) allKeys[prevIndex] = location.key; - - setState({ action: action, location: location }); - } - } else { - (0, _warning2.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); - - window.location.replace(href); - } - }); - }; - - var go = function go(n) { - globalHistory.go(n); - }; - - var goBack = function goBack() { - return go(-1); - }; - - var goForward = function goForward() { - return go(1); - }; - - var listenerCount = 0; - - var checkDOMListeners = function checkDOMListeners(delta) { - listenerCount += delta; - - if (listenerCount === 1) { - (0, _DOMUtils.addEventListener)(window, PopStateEvent, handlePopState); - - if (needsHashChangeListener) (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); - } else if (listenerCount === 0) { - (0, _DOMUtils.removeEventListener)(window, PopStateEvent, handlePopState); - - if (needsHashChangeListener) (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); - } - }; - - var isBlocked = false; - - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - var unblock = transitionManager.setPrompt(prompt); - - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; - } - - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); - } - - return unblock(); - }; - }; - - var listen = function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); - - return function () { - checkDOMListeners(-1); - unlisten(); - }; - }; - - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen - }; - - return history; -}; - -exports.default = createBrowserHistory; - -/***/ }), -/* 42 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createHashHistory__ = __webpack_require__(43); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_createHashHistory__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(15); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - - -/** - * The public API for a that uses window.location.hash. - */ - -var HashRouter = function (_React$Component) { - _inherits(HashRouter, _React$Component); - - function HashRouter() { - var _temp, _this, _ret; - - _classCallCheck(this, HashRouter); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_3_history_createHashHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret); - } - - HashRouter.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, ' ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { HashRouter as Router }`.'); - }; - - HashRouter.prototype.render = function render() { - return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], { history: this.history, children: this.props.children }); - }; - - return HashRouter; -}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component); - -HashRouter.propTypes = { - basename: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, - getUserConfirmation: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, - hashType: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.oneOf(['hashbang', 'noslash', 'slash']), - children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node -}; - - -/* harmony default export */ __webpack_exports__["a"] = (HashRouter); - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _warning = __webpack_require__(2); - -var _warning2 = _interopRequireDefault(_warning); - -var _invariant = __webpack_require__(4); - -var _invariant2 = _interopRequireDefault(_invariant); - -var _LocationUtils = __webpack_require__(13); - -var _PathUtils = __webpack_require__(7); - -var _createTransitionManager = __webpack_require__(14); - -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); - -var _DOMUtils = __webpack_require__(25); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var HashChangeEvent = 'hashchange'; - -var HashPathCoders = { - hashbang: { - encodePath: function encodePath(path) { - return path.charAt(0) === '!' ? path : '!/' + (0, _PathUtils.stripLeadingSlash)(path); - }, - decodePath: function decodePath(path) { - return path.charAt(0) === '!' ? path.substr(1) : path; - } - }, - noslash: { - encodePath: _PathUtils.stripLeadingSlash, - decodePath: _PathUtils.addLeadingSlash - }, - slash: { - encodePath: _PathUtils.addLeadingSlash, - decodePath: _PathUtils.addLeadingSlash - } -}; - -var getHashPath = function getHashPath() { - // We can't use window.location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - var href = window.location.href; - var hashIndex = href.indexOf('#'); - return hashIndex === -1 ? '' : href.substring(hashIndex + 1); -}; - -var pushHashPath = function pushHashPath(path) { - return window.location.hash = path; -}; - -var replaceHashPath = function replaceHashPath(path) { - var hashIndex = window.location.href.indexOf('#'); - - window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); -}; - -var createHashHistory = function createHashHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - (0, _invariant2.default)(_DOMUtils.canUseDOM, 'Hash history needs a DOM'); - - var globalHistory = window.history; - var canGoWithoutReload = (0, _DOMUtils.supportsGoWithoutReloadUsingHash)(); - - var _props$getUserConfirm = props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === undefined ? _DOMUtils.getConfirmation : _props$getUserConfirm, - _props$hashType = props.hashType, - hashType = _props$hashType === undefined ? 'slash' : _props$hashType; - - var basename = props.basename ? (0, _PathUtils.stripTrailingSlash)((0, _PathUtils.addLeadingSlash)(props.basename)) : ''; - - var _HashPathCoders$hashT = HashPathCoders[hashType], - encodePath = _HashPathCoders$hashT.encodePath, - decodePath = _HashPathCoders$hashT.decodePath; - - - var getDOMLocation = function getDOMLocation() { - var path = decodePath(getHashPath()); - - (0, _warning2.default)(!basename || (0, _PathUtils.hasBasename)(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); - - if (basename) path = (0, _PathUtils.stripBasename)(path, basename); - - return (0, _LocationUtils.createLocation)(path); - }; - - var transitionManager = (0, _createTransitionManager2.default)(); - - var setState = function setState(nextState) { - _extends(history, nextState); - - history.length = globalHistory.length; - - transitionManager.notifyListeners(history.location, history.action); - }; - - var forceNextPop = false; - var ignorePath = null; - - var handleHashChange = function handleHashChange() { - var path = getHashPath(); - var encodedPath = encodePath(path); - - if (path !== encodedPath) { - // Ensure we always have a properly-encoded hash. - replaceHashPath(encodedPath); - } else { - var location = getDOMLocation(); - var prevLocation = history.location; - - if (!forceNextPop && (0, _LocationUtils.locationsAreEqual)(prevLocation, location)) return; // A hashchange doesn't always == location change. - - if (ignorePath === (0, _PathUtils.createPath)(location)) return; // Ignore this change; we already setState in push/replace. - - ignorePath = null; - - handlePop(location); - } - }; - - var handlePop = function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ action: action, location: location }); - } else { - revertPop(location); - } - }); - } - }; - - var revertPop = function revertPop(fromLocation) { - var toLocation = history.location; - - // TODO: We could probably make this more reliable by - // keeping a list of paths we've seen in sessionStorage. - // Instead, we just default to 0 for paths we don't know. - - var toIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(toLocation)); - - if (toIndex === -1) toIndex = 0; - - var fromIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(fromLocation)); - - if (fromIndex === -1) fromIndex = 0; - - var delta = toIndex - fromIndex; - - if (delta) { - forceNextPop = true; - go(delta); - } - }; - - // Ensure the hash is encoded properly before doing anything else. - var path = getHashPath(); - var encodedPath = encodePath(path); - - if (path !== encodedPath) replaceHashPath(encodedPath); - - var initialLocation = getDOMLocation(); - var allPaths = [(0, _PathUtils.createPath)(initialLocation)]; - - // Public interface - - var createHref = function createHref(location) { - return '#' + encodePath(basename + (0, _PathUtils.createPath)(location)); - }; - - var push = function push(path, state) { - (0, _warning2.default)(state === undefined, 'Hash history cannot push state; it is ignored'); - - var action = 'PUSH'; - var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var path = (0, _PathUtils.createPath)(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; - - if (hashChanged) { - // We cannot tell if a hashchange was caused by a PUSH, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - pushHashPath(encodedPath); - - var prevIndex = allPaths.lastIndexOf((0, _PathUtils.createPath)(history.location)); - var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); - - nextPaths.push(path); - allPaths = nextPaths; - - setState({ action: action, location: location }); - } else { - (0, _warning2.default)(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); - - setState(); - } - }); - }; - - var replace = function replace(path, state) { - (0, _warning2.default)(state === undefined, 'Hash history cannot replace state; it is ignored'); - - var action = 'REPLACE'; - var location = (0, _LocationUtils.createLocation)(path, undefined, undefined, history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var path = (0, _PathUtils.createPath)(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; - - if (hashChanged) { - // We cannot tell if a hashchange was caused by a REPLACE, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - replaceHashPath(encodedPath); - } - - var prevIndex = allPaths.indexOf((0, _PathUtils.createPath)(history.location)); - - if (prevIndex !== -1) allPaths[prevIndex] = path; - - setState({ action: action, location: location }); - }); - }; - - var go = function go(n) { - (0, _warning2.default)(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); - - globalHistory.go(n); - }; - - var goBack = function goBack() { - return go(-1); - }; - - var goForward = function goForward() { - return go(1); - }; - - var listenerCount = 0; - - var checkDOMListeners = function checkDOMListeners(delta) { - listenerCount += delta; - - if (listenerCount === 1) { - (0, _DOMUtils.addEventListener)(window, HashChangeEvent, handleHashChange); - } else if (listenerCount === 0) { - (0, _DOMUtils.removeEventListener)(window, HashChangeEvent, handleHashChange); - } - }; - - var isBlocked = false; - - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - var unblock = transitionManager.setPrompt(prompt); - - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; - } - - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); - } - - return unblock(); - }; - }; - - var listen = function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); - - return function () { - checkDOMListeners(-1); - unlisten(); - }; - }; - - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen - }; - - return history; -}; - -exports.default = createHashHistory; - -/***/ }), -/* 44 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_MemoryRouter__ = __webpack_require__(45); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_MemoryRouter__["a" /* default */]); - -/***/ }), -/* 45 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory__ = __webpack_require__(46); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Router__ = __webpack_require__(16); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - - -/** - * The public API for a that stores location in memory. - */ - -var MemoryRouter = function (_React$Component) { - _inherits(MemoryRouter, _React$Component); - - function MemoryRouter() { - var _temp, _this, _ret; - - _classCallCheck(this, MemoryRouter); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.history = __WEBPACK_IMPORTED_MODULE_3_history_createMemoryHistory___default()(_this.props), _temp), _possibleConstructorReturn(_this, _ret); - } - - MemoryRouter.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, ' ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { MemoryRouter as Router }`.'); - }; - - MemoryRouter.prototype.render = function render() { - return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__Router__["a" /* default */], { history: this.history, children: this.props.children }); - }; - - return MemoryRouter; -}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component); - -MemoryRouter.propTypes = { - initialEntries: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.array, - initialIndex: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number, - getUserConfirmation: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.func, - keyLength: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.number, - children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.node -}; - - -/* harmony default export */ __webpack_exports__["a"] = (MemoryRouter); - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _warning = __webpack_require__(2); - -var _warning2 = _interopRequireDefault(_warning); - -var _PathUtils = __webpack_require__(7); - -var _LocationUtils = __webpack_require__(13); - -var _createTransitionManager = __webpack_require__(14); - -var _createTransitionManager2 = _interopRequireDefault(_createTransitionManager); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var clamp = function clamp(n, lowerBound, upperBound) { - return Math.min(Math.max(n, lowerBound), upperBound); -}; - -/** - * Creates a history object that stores locations in memory. - */ -var createMemoryHistory = function createMemoryHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var getUserConfirmation = props.getUserConfirmation, - _props$initialEntries = props.initialEntries, - initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries, - _props$initialIndex = props.initialIndex, - initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex, - _props$keyLength = props.keyLength, - keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; - - - var transitionManager = (0, _createTransitionManager2.default)(); - - var setState = function setState(nextState) { - _extends(history, nextState); - - history.length = history.entries.length; - - transitionManager.notifyListeners(history.location, history.action); - }; - - var createKey = function createKey() { - return Math.random().toString(36).substr(2, keyLength); - }; - - var index = clamp(initialIndex, 0, initialEntries.length - 1); - var entries = initialEntries.map(function (entry) { - return typeof entry === 'string' ? (0, _LocationUtils.createLocation)(entry, undefined, createKey()) : (0, _LocationUtils.createLocation)(entry, undefined, entry.key || createKey()); - }); - - // Public interface - - var createHref = _PathUtils.createPath; - - var push = function push(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'PUSH'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var prevIndex = history.index; - var nextIndex = prevIndex + 1; - - var nextEntries = history.entries.slice(0); - if (nextEntries.length > nextIndex) { - nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); - } else { - nextEntries.push(location); - } - - setState({ - action: action, - location: location, - index: nextIndex, - entries: nextEntries - }); - }); - }; - - var replace = function replace(path, state) { - (0, _warning2.default)(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'REPLACE'; - var location = (0, _LocationUtils.createLocation)(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - history.entries[history.index] = location; - - setState({ action: action, location: location }); - }); - }; - - var go = function go(n) { - var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); - - var action = 'POP'; - var location = history.entries[nextIndex]; - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ - action: action, - location: location, - index: nextIndex - }); - } else { - // Mimic the behavior of DOM histories by - // causing a render after a cancelled POP. - setState(); - } - }); - }; - - var goBack = function goBack() { - return go(-1); - }; - - var goForward = function goForward() { - return go(1); - }; - - var canGo = function canGo(n) { - var nextIndex = history.index + n; - return nextIndex >= 0 && nextIndex < history.entries.length; - }; - - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - return transitionManager.setPrompt(prompt); - }; - - var listen = function listen(listener) { - return transitionManager.appendListener(listener); - }; - - var history = { - length: entries.length, - action: 'POP', - location: entries[index], - index: index, - entries: entries, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - canGo: canGo, - block: block, - listen: listen - }; - - return history; -}; - -exports.default = createMemoryHistory; - -/***/ }), -/* 47 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Route__ = __webpack_require__(27); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Link__ = __webpack_require__(26); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - - - - - - -/** - * A wrapper that knows if it's "active" or not. - */ -var NavLink = function NavLink(_ref) { - var to = _ref.to, - exact = _ref.exact, - strict = _ref.strict, - location = _ref.location, - activeClassName = _ref.activeClassName, - className = _ref.className, - activeStyle = _ref.activeStyle, - style = _ref.style, - getIsActive = _ref.isActive, - ariaCurrent = _ref.ariaCurrent, - rest = _objectWithoutProperties(_ref, ['to', 'exact', 'strict', 'location', 'activeClassName', 'className', 'activeStyle', 'style', 'isActive', 'ariaCurrent']); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2__Route__["a" /* default */], { - path: (typeof to === 'undefined' ? 'undefined' : _typeof(to)) === 'object' ? to.pathname : to, - exact: exact, - strict: strict, - location: location, - children: function children(_ref2) { - var location = _ref2.location, - match = _ref2.match; - - var isActive = !!(getIsActive ? getIsActive(match, location) : match); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */], _extends({ - to: to, - className: isActive ? [className, activeClassName].filter(function (i) { - return i; - }).join(' ') : className, - style: isActive ? _extends({}, style, activeStyle) : style, - 'aria-current': isActive && ariaCurrent - }, rest)); - } - }); -}; - -NavLink.propTypes = { - to: __WEBPACK_IMPORTED_MODULE_3__Link__["a" /* default */].propTypes.to, - exact: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - strict: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - activeClassName: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - activeStyle: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, - isActive: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, - ariaCurrent: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOf(['page', 'step', 'location', 'true']) -}; - -NavLink.defaultProps = { - activeClassName: 'active', - ariaCurrent: 'true' -}; - -/* harmony default export */ __webpack_exports__["a"] = (NavLink); - -/***/ }), -/* 48 */ -/***/ (function(module, exports, __webpack_require__) { - -var isarray = __webpack_require__(49) - -/** - * Expose `pathToRegexp`. - */ -module.exports = pathToRegexp -module.exports.parse = parse -module.exports.compile = compile -module.exports.tokensToFunction = tokensToFunction -module.exports.tokensToRegExp = tokensToRegExp - -/** - * The main path matching regexp utility. - * - * @type {RegExp} - */ -var PATH_REGEXP = new RegExp([ - // Match escaped characters that would otherwise appear in future matches. - // This allows the user to escape special characters that won't transform. - '(\\\\.)', - // Match Express-style parameters and un-named parameters with a prefix - // and optional suffixes. Matches appear as: - // - // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] - // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] - // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] - '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' -].join('|'), 'g') - -/** - * Parse a string for the raw tokens. - * - * @param {string} str - * @param {Object=} options - * @return {!Array} - */ -function parse (str, options) { - var tokens = [] - var key = 0 - var index = 0 - var path = '' - var defaultDelimiter = options && options.delimiter || '/' - var res - - while ((res = PATH_REGEXP.exec(str)) != null) { - var m = res[0] - var escaped = res[1] - var offset = res.index - path += str.slice(index, offset) - index = offset + m.length - - // Ignore already escaped sequences. - if (escaped) { - path += escaped[1] - continue - } - - var next = str[index] - var prefix = res[2] - var name = res[3] - var capture = res[4] - var group = res[5] - var modifier = res[6] - var asterisk = res[7] - - // Push the current path onto the tokens. - if (path) { - tokens.push(path) - path = '' - } - - var partial = prefix != null && next != null && next !== prefix - var repeat = modifier === '+' || modifier === '*' - var optional = modifier === '?' || modifier === '*' - var delimiter = res[2] || defaultDelimiter - var pattern = capture || group - - tokens.push({ - name: name || key++, - prefix: prefix || '', - delimiter: delimiter, - optional: optional, - repeat: repeat, - partial: partial, - asterisk: !!asterisk, - pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') - }) - } - - // Match any characters still remaining. - if (index < str.length) { - path += str.substr(index) - } - - // If the path exists, push it onto the end. - if (path) { - tokens.push(path) - } - - return tokens -} - -/** - * Compile a string to a template function for the path. - * - * @param {string} str - * @param {Object=} options - * @return {!function(Object=, Object=)} - */ -function compile (str, options) { - return tokensToFunction(parse(str, options)) -} - -/** - * Prettier encoding of URI path segments. - * - * @param {string} - * @return {string} - */ -function encodeURIComponentPretty (str) { - return encodeURI(str).replace(/[\/?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} - -/** - * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. - * - * @param {string} - * @return {string} - */ -function encodeAsterisk (str) { - return encodeURI(str).replace(/[?#]/g, function (c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) -} - -/** - * Expose a method for transforming tokens into the path function. - */ -function tokensToFunction (tokens) { - // Compile all the tokens into regexps. - var matches = new Array(tokens.length) - - // Compile all the patterns before compilation. - for (var i = 0; i < tokens.length; i++) { - if (typeof tokens[i] === 'object') { - matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$') - } - } - - return function (obj, opts) { - var path = '' - var data = obj || {} - var options = opts || {} - var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent - - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] - - if (typeof token === 'string') { - path += token - - continue - } - - var value = data[token.name] - var segment - - if (value == null) { - if (token.optional) { - // Prepend partial segment prefixes. - if (token.partial) { - path += token.prefix - } - - continue - } else { - throw new TypeError('Expected "' + token.name + '" to be defined') - } - } - - if (isarray(value)) { - if (!token.repeat) { - throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') - } - - if (value.length === 0) { - if (token.optional) { - continue - } else { - throw new TypeError('Expected "' + token.name + '" to not be empty') - } - } - - for (var j = 0; j < value.length; j++) { - segment = encode(value[j]) - - if (!matches[i].test(segment)) { - throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') - } - - path += (j === 0 ? token.prefix : token.delimiter) + segment - } - - continue - } - - segment = token.asterisk ? encodeAsterisk(value) : encode(value) - - if (!matches[i].test(segment)) { - throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') - } - - path += token.prefix + segment - } - - return path - } -} - -/** - * Escape a regular expression string. - * - * @param {string} str - * @return {string} - */ -function escapeString (str) { - return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') -} - -/** - * Escape the capturing group by escaping special characters and meaning. - * - * @param {string} group - * @return {string} - */ -function escapeGroup (group) { - return group.replace(/([=!:$\/()])/g, '\\$1') -} - -/** - * Attach the keys as a property of the regexp. - * - * @param {!RegExp} re - * @param {Array} keys - * @return {!RegExp} - */ -function attachKeys (re, keys) { - re.keys = keys - return re -} - -/** - * Get the flags for a regexp from the options. - * - * @param {Object} options - * @return {string} - */ -function flags (options) { - return options.sensitive ? '' : 'i' -} - -/** - * Pull out keys from a regexp. - * - * @param {!RegExp} path - * @param {!Array} keys - * @return {!RegExp} - */ -function regexpToRegexp (path, keys) { - // Use a negative lookahead to match only capturing groups. - var groups = path.source.match(/\((?!\?)/g) - - if (groups) { - for (var i = 0; i < groups.length; i++) { - keys.push({ - name: i, - prefix: null, - delimiter: null, - optional: false, - repeat: false, - partial: false, - asterisk: false, - pattern: null - }) - } - } - - return attachKeys(path, keys) -} - -/** - * Transform an array into a regexp. - * - * @param {!Array} path - * @param {Array} keys - * @param {!Object} options - * @return {!RegExp} - */ -function arrayToRegexp (path, keys, options) { - var parts = [] - - for (var i = 0; i < path.length; i++) { - parts.push(pathToRegexp(path[i], keys, options).source) - } - - var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)) - - return attachKeys(regexp, keys) -} - -/** - * Create a path regexp from string input. - * - * @param {string} path - * @param {!Array} keys - * @param {!Object} options - * @return {!RegExp} - */ -function stringToRegexp (path, keys, options) { - return tokensToRegExp(parse(path, options), keys, options) -} - -/** - * Expose a function for taking tokens and returning a RegExp. - * - * @param {!Array} tokens - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function tokensToRegExp (tokens, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } - - options = options || {} - - var strict = options.strict - var end = options.end !== false - var route = '' - - // Iterate over the tokens and create our regexp string. - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i] - - if (typeof token === 'string') { - route += escapeString(token) - } else { - var prefix = escapeString(token.prefix) - var capture = '(?:' + token.pattern + ')' - - keys.push(token) - - if (token.repeat) { - capture += '(?:' + prefix + capture + ')*' - } - - if (token.optional) { - if (!token.partial) { - capture = '(?:' + prefix + '(' + capture + '))?' - } else { - capture = prefix + '(' + capture + ')?' - } - } else { - capture = prefix + '(' + capture + ')' - } - - route += capture - } - } - - var delimiter = escapeString(options.delimiter || '/') - var endsWithDelimiter = route.slice(-delimiter.length) === delimiter - - // In non-strict mode we allow a slash at the end of match. If the path to - // match already ends with a slash, we remove it for consistency. The slash - // is valid at the end of a path match, not in the middle. This is important - // in non-ending mode, where "/test/" shouldn't match "/test//route". - if (!strict) { - route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?' - } - - if (end) { - route += '$' - } else { - // In non-ending mode, we need the capturing groups to match as much as - // possible by using a positive lookahead to the end or next path segment. - route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)' - } - - return attachKeys(new RegExp('^' + route, flags(options)), keys) -} - -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - * - * @param {(string|RegExp|Array)} path - * @param {(Array|Object)=} keys - * @param {Object=} options - * @return {!RegExp} - */ -function pathToRegexp (path, keys, options) { - if (!isarray(keys)) { - options = /** @type {!Object} */ (keys || options) - keys = [] - } - - options = options || {} - - if (path instanceof RegExp) { - return regexpToRegexp(path, /** @type {!Array} */ (keys)) - } - - if (isarray(path)) { - return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) - } - - return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) -} - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - - -/***/ }), -/* 50 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Prompt__ = __webpack_require__(51); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Prompt__["a" /* default */]); - -/***/ }), -/* 51 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - -/** - * The public API for prompting the user before navigating away - * from a screen with a component. - */ - -var Prompt = function (_React$Component) { - _inherits(Prompt, _React$Component); - - function Prompt() { - _classCallCheck(this, Prompt); - - return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); - } - - Prompt.prototype.enable = function enable(message) { - if (this.unblock) this.unblock(); - - this.unblock = this.context.router.history.block(message); - }; - - Prompt.prototype.disable = function disable() { - if (this.unblock) { - this.unblock(); - this.unblock = null; - } - }; - - Prompt.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router, 'You should not use outside a '); - - if (this.props.when) this.enable(this.props.message); - }; - - Prompt.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - if (nextProps.when) { - if (!this.props.when || this.props.message !== nextProps.message) this.enable(nextProps.message); - } else { - this.disable(); - } - }; - - Prompt.prototype.componentWillUnmount = function componentWillUnmount() { - this.disable(); - }; - - Prompt.prototype.render = function render() { - return null; - }; - - return Prompt; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Prompt.propTypes = { - when: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - message: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string]).isRequired -}; -Prompt.defaultProps = { - when: true -}; -Prompt.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - block: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired - }).isRequired - }).isRequired -}; - - -/* harmony default export */ __webpack_exports__["a"] = (Prompt); - -/***/ }), -/* 52 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Redirect__ = __webpack_require__(53); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Redirect__["a" /* default */]); - -/***/ }), -/* 53 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_history__ = __webpack_require__(54); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - - -/** - * The public API for updating the location programmatically - * with a component. - */ - -var Redirect = function (_React$Component) { - _inherits(Redirect, _React$Component); - - function Redirect() { - _classCallCheck(this, Redirect); - - return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); - } - - Redirect.prototype.isStatic = function isStatic() { - return this.context.router && this.context.router.staticContext; - }; - - Redirect.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router, 'You should not use outside a '); - - if (this.isStatic()) this.perform(); - }; - - Redirect.prototype.componentDidMount = function componentDidMount() { - if (!this.isStatic()) this.perform(); - }; - - Redirect.prototype.componentDidUpdate = function componentDidUpdate(prevProps) { - var prevTo = Object(__WEBPACK_IMPORTED_MODULE_4_history__["a" /* createLocation */])(prevProps.to); - var nextTo = Object(__WEBPACK_IMPORTED_MODULE_4_history__["a" /* createLocation */])(this.props.to); - - if (Object(__WEBPACK_IMPORTED_MODULE_4_history__["b" /* locationsAreEqual */])(prevTo, nextTo)) { - __WEBPACK_IMPORTED_MODULE_2_warning___default()(false, 'You tried to redirect to the same route you\'re currently on: ' + ('"' + nextTo.pathname + nextTo.search + '"')); - return; - } - - this.perform(); - }; - - Redirect.prototype.perform = function perform() { - var history = this.context.router.history; - var _props = this.props, - push = _props.push, - to = _props.to; - - - if (push) { - history.push(to); - } else { - history.replace(to); - } - }; - - Redirect.prototype.render = function render() { - return null; - }; - - return Redirect; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Redirect.propTypes = { - push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, - from: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, - to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired -}; -Redirect.defaultProps = { - push: false -}; -Redirect.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, - replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired - }).isRequired, - staticContext: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object - }).isRequired -}; - - -/* harmony default export */ __webpack_exports__["a"] = (Redirect); - -/***/ }), -/* 54 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createBrowserHistory__ = __webpack_require__(55); -/* unused harmony reexport createBrowserHistory */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createHashHistory__ = __webpack_require__(56); -/* unused harmony reexport createHashHistory */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__createMemoryHistory__ = __webpack_require__(57); -/* unused harmony reexport createMemoryHistory */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__LocationUtils__ = __webpack_require__(9); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_3__LocationUtils__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__LocationUtils__["b"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__PathUtils__ = __webpack_require__(8); -/* unused harmony reexport parsePath */ -/* unused harmony reexport createPath */ - - - - - - - - - - -/***/ }), -/* 55 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__PathUtils__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__createTransitionManager__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(29); -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - - - - - - - -var PopStateEvent = 'popstate'; -var HashChangeEvent = 'hashchange'; - -var getHistoryState = function getHistoryState() { - try { - return window.history.state || {}; - } catch (e) { - // IE 11 sometimes throws when accessing window.history.state - // See https://github.com/ReactTraining/history/pull/289 - return {}; - } -}; - -/** - * Creates a history object that uses the HTML5 history API including - * pushState, replaceState, and the popstate event. - */ -var createBrowserHistory = function createBrowserHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - __WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["b" /* canUseDOM */], 'Browser history needs a DOM'); - - var globalHistory = window.history; - var canUseHistory = Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["g" /* supportsHistory */])(); - var needsHashChangeListener = !Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["h" /* supportsPopStateOnHashChange */])(); - - var _props$forceRefresh = props.forceRefresh, - forceRefresh = _props$forceRefresh === undefined ? false : _props$forceRefresh, - _props$getUserConfirm = props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === undefined ? __WEBPACK_IMPORTED_MODULE_5__DOMUtils__["c" /* getConfirmation */] : _props$getUserConfirm, - _props$keyLength = props.keyLength, - keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; - - var basename = props.basename ? Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["g" /* stripTrailingSlash */])(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* addLeadingSlash */])(props.basename)) : ''; - - var getDOMLocation = function getDOMLocation(historyState) { - var _ref = historyState || {}, - key = _ref.key, - state = _ref.state; - - var _window$location = window.location, - pathname = _window$location.pathname, - search = _window$location.search, - hash = _window$location.hash; - - - var path = pathname + search + hash; - - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename || Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["c" /* hasBasename */])(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); - - if (basename) path = Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["e" /* stripBasename */])(path, basename); - - return Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, key); - }; - - var createKey = function createKey() { - return Math.random().toString(36).substr(2, keyLength); - }; - - var transitionManager = Object(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__["a" /* default */])(); - - var setState = function setState(nextState) { - _extends(history, nextState); - - history.length = globalHistory.length; - - transitionManager.notifyListeners(history.location, history.action); - }; - - var handlePopState = function handlePopState(event) { - // Ignore extraneous popstate events in WebKit. - if (Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["d" /* isExtraneousPopstateEvent */])(event)) return; - - handlePop(getDOMLocation(event.state)); - }; - - var handleHashChange = function handleHashChange() { - handlePop(getDOMLocation(getHistoryState())); - }; - - var forceNextPop = false; - - var handlePop = function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ action: action, location: location }); - } else { - revertPop(location); - } - }); - } - }; - - var revertPop = function revertPop(fromLocation) { - var toLocation = history.location; - - // TODO: We could probably make this more reliable by - // keeping a list of keys we've seen in sessionStorage. - // Instead, we just default to 0 for keys we don't know. - - var toIndex = allKeys.indexOf(toLocation.key); - - if (toIndex === -1) toIndex = 0; - - var fromIndex = allKeys.indexOf(fromLocation.key); - - if (fromIndex === -1) fromIndex = 0; - - var delta = toIndex - fromIndex; - - if (delta) { - forceNextPop = true; - go(delta); - } - }; - - var initialLocation = getDOMLocation(getHistoryState()); - var allKeys = [initialLocation.key]; - - // Public interface - - var createHref = function createHref(location) { - return basename + Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(location); - }; - - var push = function push(path, state) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'PUSH'; - var location = Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var href = createHref(location); - var key = location.key, - state = location.state; - - - if (canUseHistory) { - globalHistory.pushState({ key: key, state: state }, null, href); - - if (forceRefresh) { - window.location.href = href; - } else { - var prevIndex = allKeys.indexOf(history.location.key); - var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); - - nextKeys.push(location.key); - allKeys = nextKeys; - - setState({ action: action, location: location }); - } - } else { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history'); - - window.location.href = href; - } - }); - }; - - var replace = function replace(path, state) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'REPLACE'; - var location = Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var href = createHref(location); - var key = location.key, - state = location.state; - - - if (canUseHistory) { - globalHistory.replaceState({ key: key, state: state }, null, href); - - if (forceRefresh) { - window.location.replace(href); - } else { - var prevIndex = allKeys.indexOf(history.location.key); - - if (prevIndex !== -1) allKeys[prevIndex] = location.key; - - setState({ action: action, location: location }); - } - } else { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history'); - - window.location.replace(href); - } - }); - }; - - var go = function go(n) { - globalHistory.go(n); - }; - - var goBack = function goBack() { - return go(-1); - }; - - var goForward = function goForward() { - return go(1); - }; - - var listenerCount = 0; - - var checkDOMListeners = function checkDOMListeners(delta) { - listenerCount += delta; - - if (listenerCount === 1) { - Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["a" /* addEventListener */])(window, PopStateEvent, handlePopState); - - if (needsHashChangeListener) Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["a" /* addEventListener */])(window, HashChangeEvent, handleHashChange); - } else if (listenerCount === 0) { - Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["e" /* removeEventListener */])(window, PopStateEvent, handlePopState); - - if (needsHashChangeListener) Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["e" /* removeEventListener */])(window, HashChangeEvent, handleHashChange); - } - }; - - var isBlocked = false; - - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - var unblock = transitionManager.setPrompt(prompt); - - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; - } - - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); - } - - return unblock(); - }; - }; - - var listen = function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); - - return function () { - checkDOMListeners(-1); - unlisten(); - }; - }; - - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen - }; - - return history; -}; - -/* unused harmony default export */ var _unused_webpack_default_export = (createBrowserHistory); - -/***/ }), -/* 56 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__PathUtils__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__createTransitionManager__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DOMUtils__ = __webpack_require__(29); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - - - - - - - -var HashChangeEvent = 'hashchange'; - -var HashPathCoders = { - hashbang: { - encodePath: function encodePath(path) { - return path.charAt(0) === '!' ? path : '!/' + Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["f" /* stripLeadingSlash */])(path); - }, - decodePath: function decodePath(path) { - return path.charAt(0) === '!' ? path.substr(1) : path; - } - }, - noslash: { - encodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["f" /* stripLeadingSlash */], - decodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* addLeadingSlash */] - }, - slash: { - encodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* addLeadingSlash */], - decodePath: __WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* addLeadingSlash */] - } -}; - -var getHashPath = function getHashPath() { - // We can't use window.location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - var href = window.location.href; - var hashIndex = href.indexOf('#'); - return hashIndex === -1 ? '' : href.substring(hashIndex + 1); -}; - -var pushHashPath = function pushHashPath(path) { - return window.location.hash = path; -}; - -var replaceHashPath = function replaceHashPath(path) { - var hashIndex = window.location.href.indexOf('#'); - - window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path); -}; - -var createHashHistory = function createHashHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - __WEBPACK_IMPORTED_MODULE_1_invariant___default()(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["b" /* canUseDOM */], 'Hash history needs a DOM'); - - var globalHistory = window.history; - var canGoWithoutReload = Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["f" /* supportsGoWithoutReloadUsingHash */])(); - - var _props$getUserConfirm = props.getUserConfirmation, - getUserConfirmation = _props$getUserConfirm === undefined ? __WEBPACK_IMPORTED_MODULE_5__DOMUtils__["c" /* getConfirmation */] : _props$getUserConfirm, - _props$hashType = props.hashType, - hashType = _props$hashType === undefined ? 'slash' : _props$hashType; - - var basename = props.basename ? Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["g" /* stripTrailingSlash */])(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["a" /* addLeadingSlash */])(props.basename)) : ''; - - var _HashPathCoders$hashT = HashPathCoders[hashType], - encodePath = _HashPathCoders$hashT.encodePath, - decodePath = _HashPathCoders$hashT.decodePath; - - - var getDOMLocation = function getDOMLocation() { - var path = decodePath(getHashPath()); - - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!basename || Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["c" /* hasBasename */])(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".'); - - if (basename) path = Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["e" /* stripBasename */])(path, basename); - - return Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path); - }; - - var transitionManager = Object(__WEBPACK_IMPORTED_MODULE_4__createTransitionManager__["a" /* default */])(); - - var setState = function setState(nextState) { - _extends(history, nextState); - - history.length = globalHistory.length; - - transitionManager.notifyListeners(history.location, history.action); - }; - - var forceNextPop = false; - var ignorePath = null; - - var handleHashChange = function handleHashChange() { - var path = getHashPath(); - var encodedPath = encodePath(path); - - if (path !== encodedPath) { - // Ensure we always have a properly-encoded hash. - replaceHashPath(encodedPath); - } else { - var location = getDOMLocation(); - var prevLocation = history.location; - - if (!forceNextPop && Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["b" /* locationsAreEqual */])(prevLocation, location)) return; // A hashchange doesn't always == location change. - - if (ignorePath === Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(location)) return; // Ignore this change; we already setState in push/replace. - - ignorePath = null; - - handlePop(location); - } - }; - - var handlePop = function handlePop(location) { - if (forceNextPop) { - forceNextPop = false; - setState(); - } else { - var action = 'POP'; - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ action: action, location: location }); - } else { - revertPop(location); - } - }); - } - }; - - var revertPop = function revertPop(fromLocation) { - var toLocation = history.location; - - // TODO: We could probably make this more reliable by - // keeping a list of paths we've seen in sessionStorage. - // Instead, we just default to 0 for paths we don't know. - - var toIndex = allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(toLocation)); - - if (toIndex === -1) toIndex = 0; - - var fromIndex = allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(fromLocation)); - - if (fromIndex === -1) fromIndex = 0; - - var delta = toIndex - fromIndex; - - if (delta) { - forceNextPop = true; - go(delta); - } - }; - - // Ensure the hash is encoded properly before doing anything else. - var path = getHashPath(); - var encodedPath = encodePath(path); - - if (path !== encodedPath) replaceHashPath(encodedPath); - - var initialLocation = getDOMLocation(); - var allPaths = [Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(initialLocation)]; - - // Public interface - - var createHref = function createHref(location) { - return '#' + encodePath(basename + Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(location)); - }; - - var push = function push(path, state) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Hash history cannot push state; it is ignored'); - - var action = 'PUSH'; - var location = Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, undefined, undefined, history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var path = Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; - - if (hashChanged) { - // We cannot tell if a hashchange was caused by a PUSH, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - pushHashPath(encodedPath); - - var prevIndex = allPaths.lastIndexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(history.location)); - var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1); - - nextPaths.push(path); - allPaths = nextPaths; - - setState({ action: action, location: location }); - } else { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack'); - - setState(); - } - }); - }; - - var replace = function replace(path, state) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(state === undefined, 'Hash history cannot replace state; it is ignored'); - - var action = 'REPLACE'; - var location = Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, undefined, undefined, history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var path = Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(location); - var encodedPath = encodePath(basename + path); - var hashChanged = getHashPath() !== encodedPath; - - if (hashChanged) { - // We cannot tell if a hashchange was caused by a REPLACE, so we'd - // rather setState here and ignore the hashchange. The caveat here - // is that other hash histories in the page will consider it a POP. - ignorePath = path; - replaceHashPath(encodedPath); - } - - var prevIndex = allPaths.indexOf(Object(__WEBPACK_IMPORTED_MODULE_3__PathUtils__["b" /* createPath */])(history.location)); - - if (prevIndex !== -1) allPaths[prevIndex] = path; - - setState({ action: action, location: location }); - }); - }; - - var go = function go(n) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser'); - - globalHistory.go(n); - }; - - var goBack = function goBack() { - return go(-1); - }; - - var goForward = function goForward() { - return go(1); - }; - - var listenerCount = 0; - - var checkDOMListeners = function checkDOMListeners(delta) { - listenerCount += delta; - - if (listenerCount === 1) { - Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["a" /* addEventListener */])(window, HashChangeEvent, handleHashChange); - } else if (listenerCount === 0) { - Object(__WEBPACK_IMPORTED_MODULE_5__DOMUtils__["e" /* removeEventListener */])(window, HashChangeEvent, handleHashChange); - } - }; - - var isBlocked = false; - - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - - var unblock = transitionManager.setPrompt(prompt); - - if (!isBlocked) { - checkDOMListeners(1); - isBlocked = true; - } - - return function () { - if (isBlocked) { - isBlocked = false; - checkDOMListeners(-1); - } - - return unblock(); - }; - }; - - var listen = function listen(listener) { - var unlisten = transitionManager.appendListener(listener); - checkDOMListeners(1); - - return function () { - checkDOMListeners(-1); - unlisten(); - }; - }; - - var history = { - length: globalHistory.length, - action: 'POP', - location: initialLocation, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - block: block, - listen: listen - }; - - return history; -}; - -/* unused harmony default export */ var _unused_webpack_default_export = (createHashHistory); - -/***/ }), -/* 57 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__PathUtils__ = __webpack_require__(8); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__LocationUtils__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__createTransitionManager__ = __webpack_require__(18); -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - - - - - -var clamp = function clamp(n, lowerBound, upperBound) { - return Math.min(Math.max(n, lowerBound), upperBound); -}; - -/** - * Creates a history object that stores locations in memory. - */ -var createMemoryHistory = function createMemoryHistory() { - var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var getUserConfirmation = props.getUserConfirmation, - _props$initialEntries = props.initialEntries, - initialEntries = _props$initialEntries === undefined ? ['/'] : _props$initialEntries, - _props$initialIndex = props.initialIndex, - initialIndex = _props$initialIndex === undefined ? 0 : _props$initialIndex, - _props$keyLength = props.keyLength, - keyLength = _props$keyLength === undefined ? 6 : _props$keyLength; - - - var transitionManager = Object(__WEBPACK_IMPORTED_MODULE_3__createTransitionManager__["a" /* default */])(); - - var setState = function setState(nextState) { - _extends(history, nextState); - - history.length = history.entries.length; - - transitionManager.notifyListeners(history.location, history.action); - }; - - var createKey = function createKey() { - return Math.random().toString(36).substr(2, keyLength); - }; - - var index = clamp(initialIndex, 0, initialEntries.length - 1); - var entries = initialEntries.map(function (entry) { - return typeof entry === 'string' ? Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(entry, undefined, createKey()) : Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(entry, undefined, entry.key || createKey()); - }); - - // Public interface - - var createHref = __WEBPACK_IMPORTED_MODULE_1__PathUtils__["b" /* createPath */]; - - var push = function push(path, state) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'PUSH'; - var location = Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - var prevIndex = history.index; - var nextIndex = prevIndex + 1; - - var nextEntries = history.entries.slice(0); - if (nextEntries.length > nextIndex) { - nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); - } else { - nextEntries.push(location); - } - - setState({ - action: action, - location: location, - index: nextIndex, - entries: nextEntries - }); - }); - }; - - var replace = function replace(path, state) { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!((typeof path === 'undefined' ? 'undefined' : _typeof(path)) === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored'); - - var action = 'REPLACE'; - var location = Object(__WEBPACK_IMPORTED_MODULE_2__LocationUtils__["a" /* createLocation */])(path, state, createKey(), history.location); - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (!ok) return; - - history.entries[history.index] = location; - - setState({ action: action, location: location }); - }); - }; - - var go = function go(n) { - var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); - - var action = 'POP'; - var location = history.entries[nextIndex]; - - transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { - if (ok) { - setState({ - action: action, - location: location, - index: nextIndex - }); - } else { - // Mimic the behavior of DOM histories by - // causing a render after a cancelled POP. - setState(); - } - }); - }; - - var goBack = function goBack() { - return go(-1); - }; - - var goForward = function goForward() { - return go(1); - }; - - var canGo = function canGo(n) { - var nextIndex = history.index + n; - return nextIndex >= 0 && nextIndex < history.entries.length; - }; - - var block = function block() { - var prompt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - return transitionManager.setPrompt(prompt); - }; - - var listen = function listen(listener) { - return transitionManager.appendListener(listener); - }; - - var history = { - length: entries.length, - action: 'POP', - location: entries[index], - index: index, - entries: entries, - createHref: createHref, - push: push, - replace: replace, - go: go, - goBack: goBack, - goForward: goForward, - canGo: canGo, - block: block, - listen: listen - }; - - return history; -}; - -/* unused harmony default export */ var _unused_webpack_default_export = (createMemoryHistory); - -/***/ }), -/* 58 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_StaticRouter__ = __webpack_require__(59); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_StaticRouter__["a" /* default */]); - -/***/ }), -/* 59 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_history_PathUtils__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_history_PathUtils___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_history_PathUtils__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Router__ = __webpack_require__(16); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - - - -var normalizeLocation = function normalizeLocation(object) { - var _object$pathname = object.pathname, - pathname = _object$pathname === undefined ? '/' : _object$pathname, - _object$search = object.search, - search = _object$search === undefined ? '' : _object$search, - _object$hash = object.hash, - hash = _object$hash === undefined ? '' : _object$hash; - - - return { - pathname: pathname, - search: search === '?' ? '' : search, - hash: hash === '#' ? '' : hash - }; -}; - -var addBasename = function addBasename(basename, location) { - if (!basename) return location; - - return _extends({}, location, { - pathname: Object(__WEBPACK_IMPORTED_MODULE_4_history_PathUtils__["addLeadingSlash"])(basename) + location.pathname - }); -}; - -var stripBasename = function stripBasename(basename, location) { - if (!basename) return location; - - var base = Object(__WEBPACK_IMPORTED_MODULE_4_history_PathUtils__["addLeadingSlash"])(basename); - - if (location.pathname.indexOf(base) !== 0) return location; - - return _extends({}, location, { - pathname: location.pathname.substr(base.length) - }); -}; - -var createLocation = function createLocation(location) { - return typeof location === 'string' ? Object(__WEBPACK_IMPORTED_MODULE_4_history_PathUtils__["parsePath"])(location) : normalizeLocation(location); -}; - -var createURL = function createURL(location) { - return typeof location === 'string' ? location : Object(__WEBPACK_IMPORTED_MODULE_4_history_PathUtils__["createPath"])(location); -}; - -var staticHandler = function staticHandler(methodName) { - return function () { - __WEBPACK_IMPORTED_MODULE_1_invariant___default()(false, 'You cannot %s with ', methodName); - }; -}; - -var noop = function noop() {}; - -/** - * The public top-level API for a "static" , so-called because it - * can't actually change the current location. Instead, it just records - * location changes in a context object. Useful mainly in testing and - * server-rendering scenarios. - */ - -var StaticRouter = function (_React$Component) { - _inherits(StaticRouter, _React$Component); - - function StaticRouter() { - var _temp, _this, _ret; - - _classCallCheck(this, StaticRouter); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.createHref = function (path) { - return Object(__WEBPACK_IMPORTED_MODULE_4_history_PathUtils__["addLeadingSlash"])(_this.props.basename + createURL(path)); - }, _this.handlePush = function (location) { - var _this$props = _this.props, - basename = _this$props.basename, - context = _this$props.context; - - context.action = 'PUSH'; - context.location = addBasename(basename, createLocation(location)); - context.url = createURL(context.location); - }, _this.handleReplace = function (location) { - var _this$props2 = _this.props, - basename = _this$props2.basename, - context = _this$props2.context; - - context.action = 'REPLACE'; - context.location = addBasename(basename, createLocation(location)); - context.url = createURL(context.location); - }, _this.handleListen = function () { - return noop; - }, _this.handleBlock = function () { - return noop; - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - StaticRouter.prototype.getChildContext = function getChildContext() { - return { - router: { - staticContext: this.props.context - } - }; - }; - - StaticRouter.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_0_warning___default()(!this.props.history, ' ignores the history prop. To use a custom history, ' + 'use `import { Router }` instead of `import { StaticRouter as Router }`.'); - }; - - StaticRouter.prototype.render = function render() { - var _props = this.props, - basename = _props.basename, - context = _props.context, - location = _props.location, - props = _objectWithoutProperties(_props, ['basename', 'context', 'location']); - - var history = { - createHref: this.createHref, - action: 'POP', - location: stripBasename(basename, createLocation(location)), - push: this.handlePush, - replace: this.handleReplace, - go: staticHandler('go'), - goBack: staticHandler('goBack'), - goForward: staticHandler('goForward'), - listen: this.handleListen, - block: this.handleBlock - }; - - return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_5__Router__["a" /* default */], _extends({}, props, { history: history })); - }; - - return StaticRouter; -}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component); - -StaticRouter.propTypes = { - basename: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, - context: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired, - location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object]) -}; -StaticRouter.defaultProps = { - basename: '', - location: '/' -}; -StaticRouter.childContextTypes = { - router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired -}; - - -/* harmony default export */ __webpack_exports__["a"] = (StaticRouter); - -/***/ }), -/* 60 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Switch__ = __webpack_require__(61); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Switch__["a" /* default */]); - -/***/ }), -/* 61 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_warning___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_warning__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_invariant__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(17); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - - - - - - - -/** - * The public API for rendering the first that matches. - */ - -var Switch = function (_React$Component) { - _inherits(Switch, _React$Component); - - function Switch() { - _classCallCheck(this, Switch); - - return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); - } - - Switch.prototype.componentWillMount = function componentWillMount() { - __WEBPACK_IMPORTED_MODULE_3_invariant___default()(this.context.router, 'You should not use outside a '); - }; - - Switch.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - __WEBPACK_IMPORTED_MODULE_2_warning___default()(!(nextProps.location && !this.props.location), ' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'); - - __WEBPACK_IMPORTED_MODULE_2_warning___default()(!(!nextProps.location && this.props.location), ' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'); - }; - - Switch.prototype.render = function render() { - var route = this.context.router.route; - var children = this.props.children; - - var location = this.props.location || route.location; - - var match = void 0, - child = void 0; - __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (element) { - if (!__WEBPACK_IMPORTED_MODULE_0_react___default.a.isValidElement(element)) return; - - var _element$props = element.props, - pathProp = _element$props.path, - exact = _element$props.exact, - strict = _element$props.strict, - sensitive = _element$props.sensitive, - from = _element$props.from; - - var path = pathProp || from; - - if (match == null) { - child = element; - match = path ? Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" /* default */])(location.pathname, { path: path, exact: exact, strict: strict, sensitive: sensitive }) : route.match; - } - }); - - return match ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(child, { location: location, computedMatch: match }) : null; - }; - - return Switch; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -Switch.contextTypes = { - router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({ - route: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired - }).isRequired -}; -Switch.propTypes = { - children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node, - location: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object -}; - - -/* harmony default export */ __webpack_exports__["a"] = (Switch); - -/***/ }), -/* 62 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_matchPath__ = __webpack_require__(17); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_matchPath__["a" /* default */]); - -/***/ }), -/* 63 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_withRouter__ = __webpack_require__(64); -// Written in this round about way for babel-transform-imports - - -/* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_withRouter__["a" /* default */]); - -/***/ }), -/* 64 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Route__ = __webpack_require__(28); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - - - - - - -/** - * A public higher-order component to access the imperative API - */ -var withRouter = function withRouter(Component) { - var C = function C(props) { - var wrappedComponentRef = props.wrappedComponentRef, - remainingProps = _objectWithoutProperties(props, ['wrappedComponentRef']); - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3__Route__["a" /* default */], { render: function render(routeComponentProps) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(Component, _extends({}, remainingProps, routeComponentProps, { ref: wrappedComponentRef })); - } }); - }; - - C.displayName = 'withRouter(' + (Component.displayName || Component.name) + ')'; - C.WrappedComponent = Component; - C.propTypes = { - wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func - }; - - return __WEBPACK_IMPORTED_MODULE_2_hoist_non_react_statics___default()(C, Component); -}; - -/* harmony default export */ __webpack_exports__["a"] = (withRouter); - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright 2015, Yahoo! Inc. - * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. - */ -(function (global, factory) { - true ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global.hoistNonReactStatics = factory()); -}(this, (function () { - 'use strict'; - - var REACT_STATICS = { - childContextTypes: true, - contextTypes: true, - defaultProps: true, - displayName: true, - getDefaultProps: true, - getDerivedStateFromProps: true, - mixins: true, - propTypes: true, - type: true - }; - - var KNOWN_STATICS = { - name: true, - length: true, - prototype: true, - caller: true, - callee: true, - arguments: true, - arity: true - }; - - var defineProperty = Object.defineProperty; - var getOwnPropertyNames = Object.getOwnPropertyNames; - var getOwnPropertySymbols = Object.getOwnPropertySymbols; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var getPrototypeOf = Object.getPrototypeOf; - var objectPrototype = getPrototypeOf && getPrototypeOf(Object); - - return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { - if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components - - if (objectPrototype) { - var inheritedComponent = getPrototypeOf(sourceComponent); - if (inheritedComponent && inheritedComponent !== objectPrototype) { - hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); - } - } - - var keys = getOwnPropertyNames(sourceComponent); - - if (getOwnPropertySymbols) { - keys = keys.concat(getOwnPropertySymbols(sourceComponent)); - } - - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { - var descriptor = getOwnPropertyDescriptor(sourceComponent, key); - try { // Avoid failures from read-only properties - defineProperty(targetComponent, key, descriptor); - } catch (e) {} - } - } - - return targetComponent; - } - - return targetComponent; - }; -}))); - - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {/** - * Lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright JS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - nullTag = '[object Null]', - proxyTag = '[object Proxy]', - undefinedTag = '[object Undefined]'; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol, - symToStringTag = Symbol ? Symbol.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} - -module.exports = isFunction; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30))) - -/***/ }), -/* 67 */ -/***/ (function(module, exports) { - -/** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -module.exports = isObject; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports) { - -module.exports = __WEBPACK_EXTERNAL_MODULE_68__; - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Arrow = exports.Popper = exports.Target = exports.Manager = undefined; - -var _Manager2 = __webpack_require__(70); - -var _Manager3 = _interopRequireDefault(_Manager2); - -var _Target2 = __webpack_require__(71); - -var _Target3 = _interopRequireDefault(_Target2); - -var _Popper2 = __webpack_require__(72); - -var _Popper3 = _interopRequireDefault(_Popper2); - -var _Arrow2 = __webpack_require__(74); - -var _Arrow3 = _interopRequireDefault(_Arrow2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.Manager = _Manager3.default; -exports.Target = _Target3.default; -exports.Popper = _Popper3.default; -exports.Arrow = _Arrow3.default; - -/***/ }), -/* 70 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Manager = function (_Component) { - _inherits(Manager, _Component); - - function Manager() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, Manager); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Manager.__proto__ || Object.getPrototypeOf(Manager)).call.apply(_ref, [this].concat(args))), _this), _this._setTargetNode = function (node) { - _this._targetNode = node; - }, _this._getTargetNode = function () { - return _this._targetNode; - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(Manager, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - popperManager: { - setTargetNode: this._setTargetNode, - getTargetNode: this._getTargetNode - } - }; - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - tag = _props.tag, - children = _props.children, - restProps = _objectWithoutProperties(_props, ['tag', 'children']); - - if (tag !== false) { - return (0, _react.createElement)(tag, restProps, children); - } else { - return children; - } - } - }]); - - return Manager; -}(_react.Component); - -Manager.childContextTypes = { - popperManager: _propTypes2.default.object.isRequired -}; -Manager.propTypes = { - tag: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool]) -}; -Manager.defaultProps = { - tag: 'div' -}; -exports.default = Manager; - -/***/ }), -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -var Target = function Target(props, context) { - var _props$component = props.component, - component = _props$component === undefined ? 'div' : _props$component, - innerRef = props.innerRef, - children = props.children, - restProps = _objectWithoutProperties(props, ['component', 'innerRef', 'children']); - - var popperManager = context.popperManager; - - var targetRef = function targetRef(node) { - popperManager.setTargetNode(node); - if (typeof innerRef === 'function') { - innerRef(node); - } - }; - - if (typeof children === 'function') { - var targetProps = { ref: targetRef }; - return children({ targetProps: targetProps, restProps: restProps }); - } - - var componentProps = _extends({}, restProps); - - if (typeof component === 'string') { - componentProps.ref = targetRef; - } else { - componentProps.innerRef = targetRef; - } - - return (0, _react.createElement)(component, componentProps, children); -}; - -Target.contextTypes = { - popperManager: _propTypes2.default.object.isRequired -}; - -Target.propTypes = { - component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), - innerRef: _propTypes2.default.func, - children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) -}; - -exports.default = Target; - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _popper = __webpack_require__(73); - -var _popper2 = _interopRequireDefault(_popper); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var Popper = function (_Component) { - _inherits(Popper, _Component); - - function Popper() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, Popper); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Popper.__proto__ || Object.getPrototypeOf(Popper)).call.apply(_ref, [this].concat(args))), _this), _this.state = {}, _this._setArrowNode = function (node) { - _this._arrowNode = node; - }, _this._getTargetNode = function () { - return _this.context.popperManager.getTargetNode(); - }, _this._getOffsets = function (data) { - return Object.keys(data.offsets).map(function (key) { - return data.offsets[key]; - }); - }, _this._isDataDirty = function (data) { - if (_this.state.data) { - return JSON.stringify(_this._getOffsets(_this.state.data)) !== JSON.stringify(_this._getOffsets(data)); - } else { - return true; - } - }, _this._updateStateModifier = { - enabled: true, - order: 900, - fn: function fn(data) { - if (_this._isDataDirty(data)) { - _this.setState({ data: data }); - } - return data; - } - }, _this._getPopperStyle = function () { - var data = _this.state.data; - - // If Popper isn't instantiated, hide the popperElement - // to avoid flash of unstyled content - - if (!data) { - return { - position: 'absolute', - pointerEvents: 'none', - opacity: 0 - }; - } - - var _data$offsets$popper = data.offsets.popper, - top = _data$offsets$popper.top, - left = _data$offsets$popper.left, - position = _data$offsets$popper.position; - - - return _extends({ - position: position - }, data.styles); - }, _this._getPopperPlacement = function () { - return _this.state.data ? _this.state.data.placement : undefined; - }, _this._getPopperHide = function () { - return !!_this.state.data && _this.state.data.hide ? '' : undefined; - }, _this._getArrowStyle = function () { - if (!_this.state.data || !_this.state.data.offsets.arrow) { - return {}; - } else { - var _this$state$data$offs = _this.state.data.offsets.arrow, - top = _this$state$data$offs.top, - left = _this$state$data$offs.left; - - return { top: top, left: left }; - } - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(Popper, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - popper: { - setArrowNode: this._setArrowNode, - getArrowStyle: this._getArrowStyle - } - }; - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate(lastProps) { - if (lastProps.placement !== this.props.placement || lastProps.eventsEnabled !== this.props.eventsEnabled) { - this._destroyPopper(); - this._createPopper(); - } - - if (lastProps.children !== this.props.children) { - this._popper.scheduleUpdate(); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this._destroyPopper(); - } - }, { - key: '_createPopper', - value: function _createPopper() { - var _props = this.props, - placement = _props.placement, - eventsEnabled = _props.eventsEnabled; - - var modifiers = _extends({}, this.props.modifiers, { - applyStyle: { enabled: false }, - updateState: this._updateStateModifier - }); - - if (this._arrowNode) { - modifiers.arrow = { - element: this._arrowNode - }; - } - - this._popper = new _popper2.default(this._getTargetNode(), this._node, { - placement: placement, - eventsEnabled: eventsEnabled, - modifiers: modifiers - }); - - // schedule an update to make sure everything gets positioned correctly - // after being instantiated - this._popper.scheduleUpdate(); - } - }, { - key: '_destroyPopper', - value: function _destroyPopper() { - if (this._popper) { - this._popper.destroy(); - } - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props2 = this.props, - component = _props2.component, - innerRef = _props2.innerRef, - placement = _props2.placement, - eventsEnabled = _props2.eventsEnabled, - modifiers = _props2.modifiers, - children = _props2.children, - restProps = _objectWithoutProperties(_props2, ['component', 'innerRef', 'placement', 'eventsEnabled', 'modifiers', 'children']); - - var popperRef = function popperRef(node) { - _this2._node = node; - if (node) { - _this2._createPopper(); - } else { - _this2._destroyPopper(); - } - if (typeof innerRef === 'function') { - innerRef(node); - } - }; - var popperStyle = this._getPopperStyle(); - var popperPlacement = this._getPopperPlacement(); - var popperHide = this._getPopperHide(); - - if (typeof children === 'function') { - var _popperProps; - - var popperProps = (_popperProps = { - ref: popperRef, - style: popperStyle - }, _defineProperty(_popperProps, 'data-placement', popperPlacement), _defineProperty(_popperProps, 'data-x-out-of-boundaries', popperHide), _popperProps); - - return children({ - popperProps: popperProps, - restProps: restProps, - scheduleUpdate: function scheduleUpdate() { - // _createPopper will scheduleUpdate, - // so calling this before this._popper exists - // can be a noop. - _this2._popper && _this2._popper.scheduleUpdate(); - } - }); - } - - var componentProps = _extends({}, restProps, { - style: _extends({}, restProps.style, popperStyle), - 'data-placement': popperPlacement, - 'data-x-out-of-boundaries': popperHide - }); - - if (typeof component === 'string') { - componentProps.ref = popperRef; - } else { - componentProps.innerRef = popperRef; - } - - return (0, _react.createElement)(component, componentProps, children); - } - }]); - - return Popper; -}(_react.Component); - -Popper.contextTypes = { - popperManager: _propTypes2.default.object.isRequired -}; -Popper.childContextTypes = { - popper: _propTypes2.default.object.isRequired -}; -Popper.propTypes = { - component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), - innerRef: _propTypes2.default.func, - placement: _propTypes2.default.oneOf(_popper2.default.placements), - eventsEnabled: _propTypes2.default.bool, - modifiers: _propTypes2.default.object, - children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) -}; -Popper.defaultProps = { - component: 'div', - placement: 'bottom', - eventsEnabled: true, - modifiers: {} -}; -exports.default = Popper; - -/***/ }), -/* 73 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(global) {/**! - * @fileOverview Kickass library to create and place poppers near their reference elements. - * @version 1.14.0 - * @license - * Copyright (c) 2016 Federico Zivolo and contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; -var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; -var timeoutDuration = 0; -for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { - if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { - timeoutDuration = 1; - break; - } -} - -function microtaskDebounce(fn) { - var called = false; - return function () { - if (called) { - return; - } - called = true; - window.Promise.resolve().then(function () { - called = false; - fn(); - }); - }; -} - -function taskDebounce(fn) { - var scheduled = false; - return function () { - if (!scheduled) { - scheduled = true; - setTimeout(function () { - scheduled = false; - fn(); - }, timeoutDuration); - } - }; -} - -var supportsMicroTasks = isBrowser && window.Promise; - -/** -* Create a debounced version of a method, that's asynchronously deferred -* but called in the minimum time possible. -* -* @method -* @memberof Popper.Utils -* @argument {Function} fn -* @returns {Function} -*/ -var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; - -/** - * Check if the given variable is a function - * @method - * @memberof Popper.Utils - * @argument {Any} functionToCheck - variable to check - * @returns {Boolean} answer to: is a function? - */ -function isFunction(functionToCheck) { - var getType = {}; - return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; -} - -/** - * Get CSS computed property of the given element - * @method - * @memberof Popper.Utils - * @argument {Eement} element - * @argument {String} property - */ -function getStyleComputedProperty(element, property) { - if (element.nodeType !== 1) { - return []; - } - // NOTE: 1 DOM access here - var css = getComputedStyle(element, null); - return property ? css[property] : css; -} - -/** - * Returns the parentNode or the host of the element - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} parent - */ -function getParentNode(element) { - if (element.nodeName === 'HTML') { - return element; - } - return element.parentNode || element.host; -} - -/** - * Returns the scrolling parent of the given element - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} scroll parent - */ -function getScrollParent(element) { - // Return body, `getScroll` will take care to get the correct `scrollTop` from it - if (!element) { - return document.body; - } - - switch (element.nodeName) { - case 'HTML': - case 'BODY': - return element.ownerDocument.body; - case '#document': - return element.body; - } - - // Firefox want us to check `-x` and `-y` variations as well - - var _getStyleComputedProp = getStyleComputedProperty(element), - overflow = _getStyleComputedProp.overflow, - overflowX = _getStyleComputedProp.overflowX, - overflowY = _getStyleComputedProp.overflowY; - - if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { - return element; - } - - return getScrollParent(getParentNode(element)); -} - -/** - * Tells if you are running Internet Explorer - * @method - * @memberof Popper.Utils - * @argument {number} version to check - * @returns {Boolean} isIE - */ -var cache = {}; - -var isIE = function () { - var version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'all'; - - version = version.toString(); - if (cache.hasOwnProperty(version)) { - return cache[version]; - } - switch (version) { - case '11': - cache[version] = navigator.userAgent.indexOf('Trident') !== -1; - break; - case '10': - cache[version] = navigator.appVersion.indexOf('MSIE 10') !== -1; - break; - case 'all': - cache[version] = navigator.userAgent.indexOf('Trident') !== -1 || navigator.userAgent.indexOf('MSIE') !== -1; - break; - } - - //Set IE - cache.all = cache.all || Object.keys(cache).some(function (key) { - return cache[key]; - }); - return cache[version]; -}; - -/** - * Returns the offset parent of the given element - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} offset parent - */ -function getOffsetParent(element) { - if (!element) { - return document.documentElement; - } - - var noOffsetParent = isIE(10) ? document.body : null; - - // NOTE: 1 DOM access here - var offsetParent = element.offsetParent; - // Skip hidden elements which don't have an offsetParent - while (offsetParent === noOffsetParent && element.nextElementSibling) { - offsetParent = (element = element.nextElementSibling).offsetParent; - } - - var nodeName = offsetParent && offsetParent.nodeName; - - if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { - return element ? element.ownerDocument.documentElement : document.documentElement; - } - - // .offsetParent will return the closest TD or TABLE in case - // no offsetParent is present, I hate this job... - if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { - return getOffsetParent(offsetParent); - } - - return offsetParent; -} - -function isOffsetContainer(element) { - var nodeName = element.nodeName; - - if (nodeName === 'BODY') { - return false; - } - return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; -} - -/** - * Finds the root node (document, shadowDOM root) of the given element - * @method - * @memberof Popper.Utils - * @argument {Element} node - * @returns {Element} root node - */ -function getRoot(node) { - if (node.parentNode !== null) { - return getRoot(node.parentNode); - } - - return node; -} - -/** - * Finds the offset parent common to the two provided nodes - * @method - * @memberof Popper.Utils - * @argument {Element} element1 - * @argument {Element} element2 - * @returns {Element} common offset parent - */ -function findCommonOffsetParent(element1, element2) { - // This check is needed to avoid errors in case one of the elements isn't defined for any reason - if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { - return document.documentElement; - } - - // Here we make sure to give as "start" the element that comes first in the DOM - var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; - var start = order ? element1 : element2; - var end = order ? element2 : element1; - - // Get common ancestor container - var range = document.createRange(); - range.setStart(start, 0); - range.setEnd(end, 0); - var commonAncestorContainer = range.commonAncestorContainer; - - // Both nodes are inside #document - - if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { - if (isOffsetContainer(commonAncestorContainer)) { - return commonAncestorContainer; - } - - return getOffsetParent(commonAncestorContainer); - } - - // one of the nodes is inside shadowDOM, find which one - var element1root = getRoot(element1); - if (element1root.host) { - return findCommonOffsetParent(element1root.host, element2); - } else { - return findCommonOffsetParent(element1, getRoot(element2).host); - } -} - -/** - * Gets the scroll value of the given element in the given side (top and left) - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @argument {String} side `top` or `left` - * @returns {number} amount of scrolled pixels - */ -function getScroll(element) { - var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; - - var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; - var nodeName = element.nodeName; - - if (nodeName === 'BODY' || nodeName === 'HTML') { - var html = element.ownerDocument.documentElement; - var scrollingElement = element.ownerDocument.scrollingElement || html; - return scrollingElement[upperSide]; - } - - return element[upperSide]; -} - -/* - * Sum or subtract the element scroll values (left and top) from a given rect object - * @method - * @memberof Popper.Utils - * @param {Object} rect - Rect object you want to change - * @param {HTMLElement} element - The element from the function reads the scroll values - * @param {Boolean} subtract - set to true if you want to subtract the scroll values - * @return {Object} rect - The modifier rect object - */ -function includeScroll(rect, element) { - var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - var scrollTop = getScroll(element, 'top'); - var scrollLeft = getScroll(element, 'left'); - var modifier = subtract ? -1 : 1; - rect.top += scrollTop * modifier; - rect.bottom += scrollTop * modifier; - rect.left += scrollLeft * modifier; - rect.right += scrollLeft * modifier; - return rect; -} - -/* - * Helper to detect borders of a given element - * @method - * @memberof Popper.Utils - * @param {CSSStyleDeclaration} styles - * Result of `getStyleComputedProperty` on the given element - * @param {String} axis - `x` or `y` - * @return {number} borders - The borders size of the given axis - */ - -function getBordersSize(styles, axis) { - var sideA = axis === 'x' ? 'Left' : 'Top'; - var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; - - return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10); -} - -function getSize(axis, body, html, computedStyle) { - return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0); -} - -function getWindowSizes() { - var body = document.body; - var html = document.documentElement; - var computedStyle = isIE(10) && getComputedStyle(html); - - return { - height: getSize('Height', body, html, computedStyle), - width: getSize('Width', body, html, computedStyle) - }; -} - -var classCallCheck = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -var createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); - - - - - -var defineProperty = function (obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - -var _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -/** - * Given element offsets, generate an output similar to getBoundingClientRect - * @method - * @memberof Popper.Utils - * @argument {Object} offsets - * @returns {Object} ClientRect like output - */ -function getClientRect(offsets) { - return _extends({}, offsets, { - right: offsets.left + offsets.width, - bottom: offsets.top + offsets.height - }); -} - -/** - * Get bounding client rect of given element - * @method - * @memberof Popper.Utils - * @param {HTMLElement} element - * @return {Object} client rect - */ -function getBoundingClientRect(element) { - var rect = {}; - - // IE10 10 FIX: Please, don't ask, the element isn't - // considered in DOM in some circumstances... - // This isn't reproducible in IE10 compatibility mode of IE11 - try { - if (isIE(10)) { - rect = element.getBoundingClientRect(); - var scrollTop = getScroll(element, 'top'); - var scrollLeft = getScroll(element, 'left'); - rect.top += scrollTop; - rect.left += scrollLeft; - rect.bottom += scrollTop; - rect.right += scrollLeft; - } else { - rect = element.getBoundingClientRect(); - } - } catch (e) {} - - var result = { - left: rect.left, - top: rect.top, - width: rect.right - rect.left, - height: rect.bottom - rect.top - }; - - // subtract scrollbar size from sizes - var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {}; - var width = sizes.width || element.clientWidth || result.right - result.left; - var height = sizes.height || element.clientHeight || result.bottom - result.top; - - var horizScrollbar = element.offsetWidth - width; - var vertScrollbar = element.offsetHeight - height; - - // if an hypothetical scrollbar is detected, we must be sure it's not a `border` - // we make this check conditional for performance reasons - if (horizScrollbar || vertScrollbar) { - var styles = getStyleComputedProperty(element); - horizScrollbar -= getBordersSize(styles, 'x'); - vertScrollbar -= getBordersSize(styles, 'y'); - - result.width -= horizScrollbar; - result.height -= vertScrollbar; - } - - return getClientRect(result); -} - -function getOffsetRectRelativeToArbitraryNode(children, parent) { - var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - var isIE10 = isIE(10); - var isHTML = parent.nodeName === 'HTML'; - var childrenRect = getBoundingClientRect(children); - var parentRect = getBoundingClientRect(parent); - var scrollParent = getScrollParent(children); - - var styles = getStyleComputedProperty(parent); - var borderTopWidth = parseFloat(styles.borderTopWidth, 10); - var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10); - - // In cases where the parent is fixed, we must ignore negative scroll in offset calc - if (fixedPosition && parent.nodeName === 'HTML') { - parentRect.top = Math.max(parentRect.top, 0); - parentRect.left = Math.max(parentRect.left, 0); - } - var offsets = getClientRect({ - top: childrenRect.top - parentRect.top - borderTopWidth, - left: childrenRect.left - parentRect.left - borderLeftWidth, - width: childrenRect.width, - height: childrenRect.height - }); - offsets.marginTop = 0; - offsets.marginLeft = 0; - - // Subtract margins of documentElement in case it's being used as parent - // we do this only on HTML because it's the only element that behaves - // differently when margins are applied to it. The margins are included in - // the box of the documentElement, in the other cases not. - if (!isIE10 && isHTML) { - var marginTop = parseFloat(styles.marginTop, 10); - var marginLeft = parseFloat(styles.marginLeft, 10); - - offsets.top -= borderTopWidth - marginTop; - offsets.bottom -= borderTopWidth - marginTop; - offsets.left -= borderLeftWidth - marginLeft; - offsets.right -= borderLeftWidth - marginLeft; - - // Attach marginTop and marginLeft because in some circumstances we may need them - offsets.marginTop = marginTop; - offsets.marginLeft = marginLeft; - } - - if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { - offsets = includeScroll(offsets, parent); - } - - return offsets; -} - -function getViewportOffsetRectRelativeToArtbitraryNode(element) { - var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var html = element.ownerDocument.documentElement; - var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); - var width = Math.max(html.clientWidth, window.innerWidth || 0); - var height = Math.max(html.clientHeight, window.innerHeight || 0); - - var scrollTop = !excludeScroll ? getScroll(html) : 0; - var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; - - var offset = { - top: scrollTop - relativeOffset.top + relativeOffset.marginTop, - left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, - width: width, - height: height - }; - - return getClientRect(offset); -} - -/** - * Check if the given element is fixed or is inside a fixed parent - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @argument {Element} customContainer - * @returns {Boolean} answer to "isFixed?" - */ -function isFixed(element) { - var nodeName = element.nodeName; - if (nodeName === 'BODY' || nodeName === 'HTML') { - return false; - } - if (getStyleComputedProperty(element, 'position') === 'fixed') { - return true; - } - return isFixed(getParentNode(element)); -} - -/** - * Finds the first parent of an element that has a transformed property defined - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Element} first transformed parent or documentElement - */ - -function getFixedPositionOffsetParent(element) { - // This check is needed to avoid errors in case one of the elements isn't defined for any reason - if (!element || !element.parentElement || isIE()) { - return document.documentElement; - } - var el = element.parentElement; - while (el && getStyleComputedProperty(el, 'transform') === 'none') { - el = el.parentElement; - } - return el || document.documentElement; -} - -/** - * Computed the boundaries limits and return them - * @method - * @memberof Popper.Utils - * @param {HTMLElement} popper - * @param {HTMLElement} reference - * @param {number} padding - * @param {HTMLElement} boundariesElement - Element used to define the boundaries - * @param {Boolean} fixedPosition - Is in fixed position mode - * @returns {Object} Coordinates of the boundaries - */ -function getBoundaries(popper, reference, padding, boundariesElement) { - var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; - - // NOTE: 1 DOM access here - - var boundaries = { top: 0, left: 0 }; - var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); - - // Handle viewport case - if (boundariesElement === 'viewport') { - boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); - } else { - // Handle other cases based on DOM element used as boundaries - var boundariesNode = void 0; - if (boundariesElement === 'scrollParent') { - boundariesNode = getScrollParent(getParentNode(reference)); - if (boundariesNode.nodeName === 'BODY') { - boundariesNode = popper.ownerDocument.documentElement; - } - } else if (boundariesElement === 'window') { - boundariesNode = popper.ownerDocument.documentElement; - } else { - boundariesNode = boundariesElement; - } - - var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); - - // In case of HTML, we need a different computation - if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { - var _getWindowSizes = getWindowSizes(), - height = _getWindowSizes.height, - width = _getWindowSizes.width; - - boundaries.top += offsets.top - offsets.marginTop; - boundaries.bottom = height + offsets.top; - boundaries.left += offsets.left - offsets.marginLeft; - boundaries.right = width + offsets.left; - } else { - // for all the other DOM elements, this one is good - boundaries = offsets; - } - } - - // Add paddings - boundaries.left += padding; - boundaries.top += padding; - boundaries.right -= padding; - boundaries.bottom -= padding; - - return boundaries; -} - -function getArea(_ref) { - var width = _ref.width, - height = _ref.height; - - return width * height; -} - -/** - * Utility used to transform the `auto` placement to the placement with more - * available space. - * @method - * @memberof Popper.Utils - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { - var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; - - if (placement.indexOf('auto') === -1) { - return placement; - } - - var boundaries = getBoundaries(popper, reference, padding, boundariesElement); - - var rects = { - top: { - width: boundaries.width, - height: refRect.top - boundaries.top - }, - right: { - width: boundaries.right - refRect.right, - height: boundaries.height - }, - bottom: { - width: boundaries.width, - height: boundaries.bottom - refRect.bottom - }, - left: { - width: refRect.left - boundaries.left, - height: boundaries.height - } - }; - - var sortedAreas = Object.keys(rects).map(function (key) { - return _extends({ - key: key - }, rects[key], { - area: getArea(rects[key]) - }); - }).sort(function (a, b) { - return b.area - a.area; - }); - - var filteredAreas = sortedAreas.filter(function (_ref2) { - var width = _ref2.width, - height = _ref2.height; - return width >= popper.clientWidth && height >= popper.clientHeight; - }); - - var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; - - var variation = placement.split('-')[1]; - - return computedPlacement + (variation ? '-' + variation : ''); -} - -/** - * Get offsets to the reference element - * @method - * @memberof Popper.Utils - * @param {Object} state - * @param {Element} popper - the popper element - * @param {Element} reference - the reference element (the popper will be relative to this) - * @param {Element} fixedPosition - is in fixed position mode - * @returns {Object} An object containing the offsets which will be applied to the popper - */ -function getReferenceOffsets(state, popper, reference) { - var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; - - var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference); - return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); -} - -/** - * Get the outer sizes of the given element (offset size + margins) - * @method - * @memberof Popper.Utils - * @argument {Element} element - * @returns {Object} object containing width and height properties - */ -function getOuterSizes(element) { - var styles = getComputedStyle(element); - var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom); - var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight); - var result = { - width: element.offsetWidth + y, - height: element.offsetHeight + x - }; - return result; -} - -/** - * Get the opposite placement of the given one - * @method - * @memberof Popper.Utils - * @argument {String} placement - * @returns {String} flipped placement - */ -function getOppositePlacement(placement) { - var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; - return placement.replace(/left|right|bottom|top/g, function (matched) { - return hash[matched]; - }); -} - -/** - * Get offsets to the popper - * @method - * @memberof Popper.Utils - * @param {Object} position - CSS position the Popper will get applied - * @param {HTMLElement} popper - the popper element - * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) - * @param {String} placement - one of the valid placement options - * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper - */ -function getPopperOffsets(popper, referenceOffsets, placement) { - placement = placement.split('-')[0]; - - // Get popper node sizes - var popperRect = getOuterSizes(popper); - - // Add position, width and height to our offsets object - var popperOffsets = { - width: popperRect.width, - height: popperRect.height - }; - - // depending by the popper placement we have to compute its offsets slightly differently - var isHoriz = ['right', 'left'].indexOf(placement) !== -1; - var mainSide = isHoriz ? 'top' : 'left'; - var secondarySide = isHoriz ? 'left' : 'top'; - var measurement = isHoriz ? 'height' : 'width'; - var secondaryMeasurement = !isHoriz ? 'height' : 'width'; - - popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; - if (placement === secondarySide) { - popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; - } else { - popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; - } - - return popperOffsets; -} - -/** - * Mimics the `find` method of Array - * @method - * @memberof Popper.Utils - * @argument {Array} arr - * @argument prop - * @argument value - * @returns index or -1 - */ -function find(arr, check) { - // use native find if supported - if (Array.prototype.find) { - return arr.find(check); - } - - // use `filter` to obtain the same behavior of `find` - return arr.filter(check)[0]; -} - -/** - * Return the index of the matching object - * @method - * @memberof Popper.Utils - * @argument {Array} arr - * @argument prop - * @argument value - * @returns index or -1 - */ -function findIndex(arr, prop, value) { - // use native findIndex if supported - if (Array.prototype.findIndex) { - return arr.findIndex(function (cur) { - return cur[prop] === value; - }); - } - - // use `find` + `indexOf` if `findIndex` isn't supported - var match = find(arr, function (obj) { - return obj[prop] === value; - }); - return arr.indexOf(match); -} - -/** - * Loop trough the list of modifiers and run them in order, - * each of them will then edit the data object. - * @method - * @memberof Popper.Utils - * @param {dataObject} data - * @param {Array} modifiers - * @param {String} ends - Optional modifier name used as stopper - * @returns {dataObject} - */ -function runModifiers(modifiers, data, ends) { - var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); - - modifiersToRun.forEach(function (modifier) { - if (modifier['function']) { - // eslint-disable-line dot-notation - console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); - } - var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation - if (modifier.enabled && isFunction(fn)) { - // Add properties to offsets to make them a complete clientRect object - // we do this before each modifier to make sure the previous one doesn't - // mess with these values - data.offsets.popper = getClientRect(data.offsets.popper); - data.offsets.reference = getClientRect(data.offsets.reference); - - data = fn(data, modifier); - } - }); - - return data; -} - -/** - * Updates the position of the popper, computing the new offsets and applying - * the new style.
- * Prefer `scheduleUpdate` over `update` because of performance reasons. - * @method - * @memberof Popper - */ -function update() { - // if popper is destroyed, don't perform any further update - if (this.state.isDestroyed) { - return; - } - - var data = { - instance: this, - styles: {}, - arrowStyles: {}, - attributes: {}, - flipped: false, - offsets: {} - }; - - // compute reference element offsets - data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); - - // compute auto placement, store placement inside the data object, - // modifiers will be able to edit `placement` if needed - // and refer to originalPlacement to know the original value - 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` - data.originalPlacement = data.placement; - - data.positionFixed = this.options.positionFixed; - - // compute the popper offsets - data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); - data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; - - // run the modifiers - data = runModifiers(this.modifiers, data); - - // the first `update` will call `onCreate` callback - // the other ones will call `onUpdate` callback - if (!this.state.isCreated) { - this.state.isCreated = true; - this.options.onCreate(data); - } else { - this.options.onUpdate(data); - } -} - -/** - * Helper used to know if the given modifier is enabled. - * @method - * @memberof Popper.Utils - * @returns {Boolean} - */ -function isModifierEnabled(modifiers, modifierName) { - return modifiers.some(function (_ref) { - var name = _ref.name, - enabled = _ref.enabled; - return enabled && name === modifierName; - }); -} - -/** - * Get the prefixed supported property name - * @method - * @memberof Popper.Utils - * @argument {String} property (camelCase) - * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) - */ -function getSupportedPropertyName(property) { - var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; - var upperProp = property.charAt(0).toUpperCase() + property.slice(1); - - for (var i = 0; i < prefixes.length; i++) { - var prefix = prefixes[i]; - var toCheck = prefix ? '' + prefix + upperProp : property; - if (typeof document.body.style[toCheck] !== 'undefined') { - return toCheck; - } - } - return null; -} - -/** - * Destroy the popper - * @method - * @memberof Popper - */ -function destroy() { - this.state.isDestroyed = true; - - // touch DOM only if `applyStyle` modifier is enabled - if (isModifierEnabled(this.modifiers, 'applyStyle')) { - this.popper.removeAttribute('x-placement'); - this.popper.style.position = ''; - this.popper.style.top = ''; - this.popper.style.left = ''; - this.popper.style.right = ''; - this.popper.style.bottom = ''; - this.popper.style.willChange = ''; - this.popper.style[getSupportedPropertyName('transform')] = ''; - } - - this.disableEventListeners(); - - // remove the popper if user explicity asked for the deletion on destroy - // do not use `remove` because IE11 doesn't support it - if (this.options.removeOnDestroy) { - this.popper.parentNode.removeChild(this.popper); - } - return this; -} - -/** - * Get the window associated with the element - * @argument {Element} element - * @returns {Window} - */ -function getWindow(element) { - var ownerDocument = element.ownerDocument; - return ownerDocument ? ownerDocument.defaultView : window; -} - -function attachToScrollParents(scrollParent, event, callback, scrollParents) { - var isBody = scrollParent.nodeName === 'BODY'; - var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; - target.addEventListener(event, callback, { passive: true }); - - if (!isBody) { - attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); - } - scrollParents.push(target); -} - -/** - * Setup needed event listeners used to update the popper position - * @method - * @memberof Popper.Utils - * @private - */ -function setupEventListeners(reference, options, state, updateBound) { - // Resize event listener on window - state.updateBound = updateBound; - getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); - - // Scroll event listener on scroll parents - var scrollElement = getScrollParent(reference); - attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); - state.scrollElement = scrollElement; - state.eventsEnabled = true; - - return state; -} - -/** - * It will add resize/scroll events and start recalculating - * position of the popper element when they are triggered. - * @method - * @memberof Popper - */ -function enableEventListeners() { - if (!this.state.eventsEnabled) { - this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); - } -} - -/** - * Remove event listeners used to update the popper position - * @method - * @memberof Popper.Utils - * @private - */ -function removeEventListeners(reference, state) { - // Remove resize event listener on window - getWindow(reference).removeEventListener('resize', state.updateBound); - - // Remove scroll event listener on scroll parents - state.scrollParents.forEach(function (target) { - target.removeEventListener('scroll', state.updateBound); - }); - - // Reset state - state.updateBound = null; - state.scrollParents = []; - state.scrollElement = null; - state.eventsEnabled = false; - return state; -} - -/** - * It will remove resize/scroll events and won't recalculate popper position - * when they are triggered. It also won't trigger onUpdate callback anymore, - * unless you call `update` method manually. - * @method - * @memberof Popper - */ -function disableEventListeners() { - if (this.state.eventsEnabled) { - cancelAnimationFrame(this.scheduleUpdate); - this.state = removeEventListeners(this.reference, this.state); - } -} - -/** - * Tells if a given input is a number - * @method - * @memberof Popper.Utils - * @param {*} input to check - * @return {Boolean} - */ -function isNumeric(n) { - return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); -} - -/** - * Set the style to the given popper - * @method - * @memberof Popper.Utils - * @argument {Element} element - Element to apply the style to - * @argument {Object} styles - * Object with a list of properties and values which will be applied to the element - */ -function setStyles(element, styles) { - Object.keys(styles).forEach(function (prop) { - var unit = ''; - // add unit if the value is numeric and is one of the following - if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { - unit = 'px'; - } - element.style[prop] = styles[prop] + unit; - }); -} - -/** - * Set the attributes to the given popper - * @method - * @memberof Popper.Utils - * @argument {Element} element - Element to apply the attributes to - * @argument {Object} styles - * Object with a list of properties and values which will be applied to the element - */ -function setAttributes(element, attributes) { - Object.keys(attributes).forEach(function (prop) { - var value = attributes[prop]; - if (value !== false) { - element.setAttribute(prop, attributes[prop]); - } else { - element.removeAttribute(prop); - } - }); -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} data.styles - List of style properties - values to apply to popper element - * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The same data object - */ -function applyStyle(data) { - // any property present in `data.styles` will be applied to the popper, - // in this way we can make the 3rd party modifiers add custom styles to it - // Be aware, modifiers could override the properties defined in the previous - // lines of this modifier! - setStyles(data.instance.popper, data.styles); - - // any property present in `data.attributes` will be applied to the popper, - // they will be set as HTML attributes of the element - setAttributes(data.instance.popper, data.attributes); - - // if arrowElement is defined and arrowStyles has some properties - if (data.arrowElement && Object.keys(data.arrowStyles).length) { - setStyles(data.arrowElement, data.arrowStyles); - } - - return data; -} - -/** - * Set the x-placement attribute before everything else because it could be used - * to add margins to the popper margins needs to be calculated to get the - * correct popper offsets. - * @method - * @memberof Popper.modifiers - * @param {HTMLElement} reference - The reference element used to position the popper - * @param {HTMLElement} popper - The HTML element used as popper - * @param {Object} options - Popper.js options - */ -function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { - // compute reference element offsets - var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); - - // compute auto placement, store placement inside the data object, - // modifiers will be able to edit `placement` if needed - // and refer to originalPlacement to know the original value - var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); - - popper.setAttribute('x-placement', placement); - - // Apply `position` to popper before anything else because - // without the position applied we can't guarantee correct computations - setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); - - return options; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function computeStyle(data, options) { - var x = options.x, - y = options.y; - var popper = data.offsets.popper; - - // Remove this legacy support in Popper.js v2 - - var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { - return modifier.name === 'applyStyle'; - }).gpuAcceleration; - if (legacyGpuAccelerationOption !== undefined) { - console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); - } - var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; - - var offsetParent = getOffsetParent(data.instance.popper); - var offsetParentRect = getBoundingClientRect(offsetParent); - - // Styles - var styles = { - position: popper.position - }; - - // floor sides to avoid blurry text - var offsets = { - left: Math.floor(popper.left), - top: Math.floor(popper.top), - bottom: Math.floor(popper.bottom), - right: Math.floor(popper.right) - }; - - var sideA = x === 'bottom' ? 'top' : 'bottom'; - var sideB = y === 'right' ? 'left' : 'right'; - - // if gpuAcceleration is set to `true` and transform is supported, - // we use `translate3d` to apply the position to the popper we - // automatically use the supported prefixed version if needed - var prefixedProperty = getSupportedPropertyName('transform'); - - // now, let's make a step back and look at this code closely (wtf?) - // If the content of the popper grows once it's been positioned, it - // may happen that the popper gets misplaced because of the new content - // overflowing its reference element - // To avoid this problem, we provide two options (x and y), which allow - // the consumer to define the offset origin. - // If we position a popper on top of a reference element, we can set - // `x` to `top` to make the popper grow towards its top instead of - // its bottom. - var left = void 0, - top = void 0; - if (sideA === 'bottom') { - top = -offsetParentRect.height + offsets.bottom; - } else { - top = offsets.top; - } - if (sideB === 'right') { - left = -offsetParentRect.width + offsets.right; - } else { - left = offsets.left; - } - if (gpuAcceleration && prefixedProperty) { - styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; - styles[sideA] = 0; - styles[sideB] = 0; - styles.willChange = 'transform'; - } else { - // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties - var invertTop = sideA === 'bottom' ? -1 : 1; - var invertLeft = sideB === 'right' ? -1 : 1; - styles[sideA] = top * invertTop; - styles[sideB] = left * invertLeft; - styles.willChange = sideA + ', ' + sideB; - } - - // Attributes - var attributes = { - 'x-placement': data.placement - }; - - // Update `data` attributes, styles and arrowStyles - data.attributes = _extends({}, attributes, data.attributes); - data.styles = _extends({}, styles, data.styles); - data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); - - return data; -} - -/** - * Helper used to know if the given modifier depends from another one.
- * It checks if the needed modifier is listed and enabled. - * @method - * @memberof Popper.Utils - * @param {Array} modifiers - list of modifiers - * @param {String} requestingName - name of requesting modifier - * @param {String} requestedName - name of requested modifier - * @returns {Boolean} - */ -function isModifierRequired(modifiers, requestingName, requestedName) { - var requesting = find(modifiers, function (_ref) { - var name = _ref.name; - return name === requestingName; - }); - - var isRequired = !!requesting && modifiers.some(function (modifier) { - return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; - }); - - if (!isRequired) { - var _requesting = '`' + requestingName + '`'; - var requested = '`' + requestedName + '`'; - console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); - } - return isRequired; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function arrow(data, options) { - var _data$offsets$arrow; - - // arrow depends on keepTogether in order to work - if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { - return data; - } - - var arrowElement = options.element; - - // if arrowElement is a string, suppose it's a CSS selector - if (typeof arrowElement === 'string') { - arrowElement = data.instance.popper.querySelector(arrowElement); - - // if arrowElement is not found, don't run the modifier - if (!arrowElement) { - return data; - } - } else { - // if the arrowElement isn't a query selector we must check that the - // provided DOM node is child of its popper node - if (!data.instance.popper.contains(arrowElement)) { - console.warn('WARNING: `arrow.element` must be child of its popper element!'); - return data; - } - } - - var placement = data.placement.split('-')[0]; - var _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var isVertical = ['left', 'right'].indexOf(placement) !== -1; - - var len = isVertical ? 'height' : 'width'; - var sideCapitalized = isVertical ? 'Top' : 'Left'; - var side = sideCapitalized.toLowerCase(); - var altSide = isVertical ? 'left' : 'top'; - var opSide = isVertical ? 'bottom' : 'right'; - var arrowElementSize = getOuterSizes(arrowElement)[len]; - - // - // extends keepTogether behavior making sure the popper and its - // reference have enough pixels in conjuction - // - - // top/left side - if (reference[opSide] - arrowElementSize < popper[side]) { - data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); - } - // bottom/right side - if (reference[side] + arrowElementSize > popper[opSide]) { - data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; - } - data.offsets.popper = getClientRect(data.offsets.popper); - - // compute center of the popper - var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; - - // Compute the sideValue using the updated popper offsets - // take popper margin in account because we don't have this info available - var css = getStyleComputedProperty(data.instance.popper); - var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10); - var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10); - var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; - - // prevent arrowElement from being placed not contiguously to its popper - sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); - - data.arrowElement = arrowElement; - data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); - - return data; -} - -/** - * Get the opposite placement variation of the given one - * @method - * @memberof Popper.Utils - * @argument {String} placement variation - * @returns {String} flipped placement variation - */ -function getOppositeVariation(variation) { - if (variation === 'end') { - return 'start'; - } else if (variation === 'start') { - return 'end'; - } - return variation; -} - -/** - * List of accepted placements to use as values of the `placement` option.
- * Valid placements are: - * - `auto` - * - `top` - * - `right` - * - `bottom` - * - `left` - * - * Each placement can have a variation from this list: - * - `-start` - * - `-end` - * - * Variations are interpreted easily if you think of them as the left to right - * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` - * is right.
- * Vertically (`left` and `right`), `start` is top and `end` is bottom. - * - * Some valid examples are: - * - `top-end` (on top of reference, right aligned) - * - `right-start` (on right of reference, top aligned) - * - `bottom` (on bottom, centered) - * - `auto-right` (on the side with more space available, alignment depends by placement) - * - * @static - * @type {Array} - * @enum {String} - * @readonly - * @method placements - * @memberof Popper - */ -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` -var validPlacements = placements.slice(3); - -/** - * Given an initial placement, returns all the subsequent placements - * clockwise (or counter-clockwise). - * - * @method - * @memberof Popper.Utils - * @argument {String} placement - A valid placement (it accepts variations) - * @argument {Boolean} counter - Set to true to walk the placements counterclockwise - * @returns {Array} placements including their variations - */ -function clockwise(placement) { - var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - var index = validPlacements.indexOf(placement); - var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); - return counter ? arr.reverse() : arr; -} - -var BEHAVIORS = { - FLIP: 'flip', - CLOCKWISE: 'clockwise', - COUNTERCLOCKWISE: 'counterclockwise' -}; - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function flip(data, options) { - // if `inner` modifier is enabled, we can't use the `flip` modifier - if (isModifierEnabled(data.instance.modifiers, 'inner')) { - return data; - } - - if (data.flipped && data.placement === data.originalPlacement) { - // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides - return data; - } - - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); - - var placement = data.placement.split('-')[0]; - var placementOpposite = getOppositePlacement(placement); - var variation = data.placement.split('-')[1] || ''; - - var flipOrder = []; - - switch (options.behavior) { - case BEHAVIORS.FLIP: - flipOrder = [placement, placementOpposite]; - break; - case BEHAVIORS.CLOCKWISE: - flipOrder = clockwise(placement); - break; - case BEHAVIORS.COUNTERCLOCKWISE: - flipOrder = clockwise(placement, true); - break; - default: - flipOrder = options.behavior; - } - - flipOrder.forEach(function (step, index) { - if (placement !== step || flipOrder.length === index + 1) { - return data; - } - - placement = data.placement.split('-')[0]; - placementOpposite = getOppositePlacement(placement); - - var popperOffsets = data.offsets.popper; - var refOffsets = data.offsets.reference; - - // using floor because the reference offsets may contain decimals we are not going to consider here - var floor = Math.floor; - 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); - - var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); - var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); - var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); - var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); - - var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; - - // flip the variation if required - var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; - var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); - - if (overlapsRef || overflowsBoundaries || flippedVariation) { - // this boolean to detect any flip loop - data.flipped = true; - - if (overlapsRef || overflowsBoundaries) { - placement = flipOrder[index + 1]; - } - - if (flippedVariation) { - variation = getOppositeVariation(variation); - } - - data.placement = placement + (variation ? '-' + variation : ''); - - // this object contains `position`, we want to preserve it along with - // any additional property we may add in the future - data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); - - data = runModifiers(data.instance.modifiers, data, 'flip'); - } - }); - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function keepTogether(data) { - var _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var placement = data.placement.split('-')[0]; - var floor = Math.floor; - var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; - var side = isVertical ? 'right' : 'bottom'; - var opSide = isVertical ? 'left' : 'top'; - var measurement = isVertical ? 'width' : 'height'; - - if (popper[side] < floor(reference[opSide])) { - data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; - } - if (popper[opSide] > floor(reference[side])) { - data.offsets.popper[opSide] = floor(reference[side]); - } - - return data; -} - -/** - * Converts a string containing value + unit into a px value number - * @function - * @memberof {modifiers~offset} - * @private - * @argument {String} str - Value + unit string - * @argument {String} measurement - `height` or `width` - * @argument {Object} popperOffsets - * @argument {Object} referenceOffsets - * @returns {Number|String} - * Value in pixels, or original string if no values were extracted - */ -function toValue(str, measurement, popperOffsets, referenceOffsets) { - // separate value from unit - var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); - var value = +split[1]; - var unit = split[2]; - - // If it's not a number it's an operator, I guess - if (!value) { - return str; - } - - if (unit.indexOf('%') === 0) { - var element = void 0; - switch (unit) { - case '%p': - element = popperOffsets; - break; - case '%': - case '%r': - default: - element = referenceOffsets; - } - - var rect = getClientRect(element); - return rect[measurement] / 100 * value; - } else if (unit === 'vh' || unit === 'vw') { - // if is a vh or vw, we calculate the size based on the viewport - var size = void 0; - if (unit === 'vh') { - size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); - } else { - size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); - } - return size / 100 * value; - } else { - // if is an explicit pixel unit, we get rid of the unit and keep the value - // if is an implicit unit, it's px, and we return just the value - return value; - } -} - -/** - * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. - * @function - * @memberof {modifiers~offset} - * @private - * @argument {String} offset - * @argument {Object} popperOffsets - * @argument {Object} referenceOffsets - * @argument {String} basePlacement - * @returns {Array} a two cells array with x and y offsets in numbers - */ -function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { - var offsets = [0, 0]; - - // Use height if placement is left or right and index is 0 otherwise use width - // in this way the first offset will use an axis and the second one - // will use the other one - var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; - - // Split the offset string to obtain a list of values and operands - // The regex addresses values with the plus or minus sign in front (+10, -20, etc) - var fragments = offset.split(/(\+|\-)/).map(function (frag) { - return frag.trim(); - }); - - // Detect if the offset string contains a pair of values or a single one - // they could be separated by comma or space - var divider = fragments.indexOf(find(fragments, function (frag) { - return frag.search(/,|\s/) !== -1; - })); - - if (fragments[divider] && fragments[divider].indexOf(',') === -1) { - console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); - } - - // If divider is found, we divide the list of values and operands to divide - // them by ofset X and Y. - var splitRegex = /\s*,\s*|\s+/; - 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 - ops = ops.map(function (op, index) { - // Most of the units rely on the orientation of the popper - var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; - var mergeWithPrevious = false; - return op - // This aggregates any `+` or `-` sign that aren't considered operators - // e.g.: 10 + +5 => [10, +, +5] - .reduce(function (a, b) { - if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { - a[a.length - 1] = b; - mergeWithPrevious = true; - return a; - } else if (mergeWithPrevious) { - a[a.length - 1] += b; - mergeWithPrevious = false; - return a; - } else { - return a.concat(b); - } - }, []) - // Here we convert the string values into number values (in px) - .map(function (str) { - return toValue(str, measurement, popperOffsets, referenceOffsets); - }); - }); - - // Loop trough the offsets arrays and execute the operations - ops.forEach(function (op, index) { - op.forEach(function (frag, index2) { - if (isNumeric(frag)) { - offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); - } - }); - }); - return offsets; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @argument {Number|String} options.offset=0 - * The offset value as described in the modifier description - * @returns {Object} The data object, properly modified - */ -function offset(data, _ref) { - var offset = _ref.offset; - var placement = data.placement, - _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var basePlacement = placement.split('-')[0]; - - var offsets = void 0; - if (isNumeric(+offset)) { - offsets = [+offset, 0]; - } else { - offsets = parseOffset(offset, popper, reference, basePlacement); - } - - if (basePlacement === 'left') { - popper.top += offsets[0]; - popper.left -= offsets[1]; - } else if (basePlacement === 'right') { - popper.top += offsets[0]; - popper.left += offsets[1]; - } else if (basePlacement === 'top') { - popper.left += offsets[0]; - popper.top -= offsets[1]; - } else if (basePlacement === 'bottom') { - popper.left += offsets[0]; - popper.top += offsets[1]; - } - - data.popper = popper; - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function preventOverflow(data, options) { - var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); - - // If offsetParent is the reference element, we really want to - // go one step up and use the next offsetParent as reference to - // avoid to make this modifier completely useless and look like broken - if (data.instance.reference === boundariesElement) { - boundariesElement = getOffsetParent(boundariesElement); - } - - var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); - options.boundaries = boundaries; - - var order = options.priority; - var popper = data.offsets.popper; - - var check = { - primary: function primary(placement) { - var value = popper[placement]; - if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { - value = Math.max(popper[placement], boundaries[placement]); - } - return defineProperty({}, placement, value); - }, - secondary: function secondary(placement) { - var mainSide = placement === 'right' ? 'left' : 'top'; - var value = popper[mainSide]; - if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { - value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); - } - return defineProperty({}, mainSide, value); - } - }; - - order.forEach(function (placement) { - var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; - popper = _extends({}, popper, check[side](placement)); - }); - - data.offsets.popper = popper; - - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function shift(data) { - var placement = data.placement; - var basePlacement = placement.split('-')[0]; - var shiftvariation = placement.split('-')[1]; - - // if shift shiftvariation is specified, run the modifier - if (shiftvariation) { - var _data$offsets = data.offsets, - reference = _data$offsets.reference, - popper = _data$offsets.popper; - - var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; - var side = isVertical ? 'left' : 'top'; - var measurement = isVertical ? 'width' : 'height'; - - var shiftOffsets = { - start: defineProperty({}, side, reference[side]), - end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) - }; - - data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); - } - - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by update method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function hide(data) { - if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { - return data; - } - - var refRect = data.offsets.reference; - var bound = find(data.instance.modifiers, function (modifier) { - return modifier.name === 'preventOverflow'; - }).boundaries; - - if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { - // Avoid unnecessary DOM access if visibility hasn't changed - if (data.hide === true) { - return data; - } - - data.hide = true; - data.attributes['x-out-of-boundaries'] = ''; - } else { - // Avoid unnecessary DOM access if visibility hasn't changed - if (data.hide === false) { - return data; - } - - data.hide = false; - data.attributes['x-out-of-boundaries'] = false; - } - - return data; -} - -/** - * @function - * @memberof Modifiers - * @argument {Object} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {Object} The data object, properly modified - */ -function inner(data) { - var placement = data.placement; - var basePlacement = placement.split('-')[0]; - var _data$offsets = data.offsets, - popper = _data$offsets.popper, - reference = _data$offsets.reference; - - var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; - - var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; - - popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); - - data.placement = getOppositePlacement(placement); - data.offsets.popper = getClientRect(popper); - - return data; -} - -/** - * Modifier function, each modifier can have a function of this type assigned - * to its `fn` property.
- * These functions will be called on each update, this means that you must - * make sure they are performant enough to avoid performance bottlenecks. - * - * @function ModifierFn - * @argument {dataObject} data - The data object generated by `update` method - * @argument {Object} options - Modifiers configuration and options - * @returns {dataObject} The data object, properly modified - */ - -/** - * Modifiers are plugins used to alter the behavior of your poppers.
- * Popper.js uses a set of 9 modifiers to provide all the basic functionalities - * needed by the library. - * - * Usually you don't want to override the `order`, `fn` and `onLoad` props. - * All the other properties are configurations that could be tweaked. - * @namespace modifiers - */ -var modifiers = { - /** - * Modifier used to shift the popper on the start or end of its reference - * element.
- * It will read the variation of the `placement` property.
- * It can be one either `-end` or `-start`. - * @memberof modifiers - * @inner - */ - shift: { - /** @prop {number} order=100 - Index used to define the order of execution */ - order: 100, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: shift - }, - - /** - * The `offset` modifier can shift your popper on both its axis. - * - * It accepts the following units: - * - `px` or unitless, interpreted as pixels - * - `%` or `%r`, percentage relative to the length of the reference element - * - `%p`, percentage relative to the length of the popper element - * - `vw`, CSS viewport width unit - * - `vh`, CSS viewport height unit - * - * For length is intended the main axis relative to the placement of the popper.
- * This means that if the placement is `top` or `bottom`, the length will be the - * `width`. In case of `left` or `right`, it will be the height. - * - * You can provide a single value (as `Number` or `String`), or a pair of values - * as `String` divided by a comma or one (or more) white spaces.
- * The latter is a deprecated method because it leads to confusion and will be - * removed in v2.
- * Additionally, it accepts additions and subtractions between different units. - * Note that multiplications and divisions aren't supported. - * - * Valid examples are: - * ``` - * 10 - * '10%' - * '10, 10' - * '10%, 10' - * '10 + 10%' - * '10 - 5vh + 3%' - * '-10px + 5vh, 5px - 6%' - * ``` - * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap - * > with their reference element, unfortunately, you will have to disable the `flip` modifier. - * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373) - * - * @memberof modifiers - * @inner - */ - offset: { - /** @prop {number} order=200 - Index used to define the order of execution */ - order: 200, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: offset, - /** @prop {Number|String} offset=0 - * The offset value as described in the modifier description - */ - offset: 0 - }, - - /** - * Modifier used to prevent the popper from being positioned outside the boundary. - * - * An scenario exists where the reference itself is not within the boundaries.
- * We can say it has "escaped the boundaries" — or just "escaped".
- * In this case we need to decide whether the popper should either: - * - * - detach from the reference and remain "trapped" in the boundaries, or - * - if it should ignore the boundary and "escape with its reference" - * - * When `escapeWithReference` is set to`true` and reference is completely - * outside its boundaries, the popper will overflow (or completely leave) - * the boundaries in order to remain attached to the edge of the reference. - * - * @memberof modifiers - * @inner - */ - preventOverflow: { - /** @prop {number} order=300 - Index used to define the order of execution */ - order: 300, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: preventOverflow, - /** - * @prop {Array} [priority=['left','right','top','bottom']] - * Popper will try to prevent overflow following these priorities by default, - * then, it could overflow on the left and on top of the `boundariesElement` - */ - priority: ['left', 'right', 'top', 'bottom'], - /** - * @prop {number} padding=5 - * Amount of pixel used to define a minimum distance between the boundaries - * and the popper this makes sure the popper has always a little padding - * between the edges of its container - */ - padding: 5, - /** - * @prop {String|HTMLElement} boundariesElement='scrollParent' - * Boundaries used by the modifier, can be `scrollParent`, `window`, - * `viewport` or any DOM element. - */ - boundariesElement: 'scrollParent' - }, - - /** - * Modifier used to make sure the reference and its popper stay near eachothers - * without leaving any gap between the two. Expecially useful when the arrow is - * enabled and you want to assure it to point to its reference element. - * It cares only about the first axis, you can still have poppers with margin - * between the popper and its reference element. - * @memberof modifiers - * @inner - */ - keepTogether: { - /** @prop {number} order=400 - Index used to define the order of execution */ - order: 400, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: keepTogether - }, - - /** - * This modifier is used to move the `arrowElement` of the popper to make - * sure it is positioned between the reference element and its popper element. - * It will read the outer size of the `arrowElement` node to detect how many - * pixels of conjuction are needed. - * - * It has no effect if no `arrowElement` is provided. - * @memberof modifiers - * @inner - */ - arrow: { - /** @prop {number} order=500 - Index used to define the order of execution */ - order: 500, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: arrow, - /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ - element: '[x-arrow]' - }, - - /** - * Modifier used to flip the popper's placement when it starts to overlap its - * reference element. - * - * Requires the `preventOverflow` modifier before it in order to work. - * - * **NOTE:** this modifier will interrupt the current update cycle and will - * restart it if it detects the need to flip the placement. - * @memberof modifiers - * @inner - */ - flip: { - /** @prop {number} order=600 - Index used to define the order of execution */ - order: 600, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: flip, - /** - * @prop {String|Array} behavior='flip' - * The behavior used to change the popper's placement. It can be one of - * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid - * placements (with optional variations). - */ - behavior: 'flip', - /** - * @prop {number} padding=5 - * The popper will flip if it hits the edges of the `boundariesElement` - */ - padding: 5, - /** - * @prop {String|HTMLElement} boundariesElement='viewport' - * The element which will define the boundaries of the popper position, - * the popper will never be placed outside of the defined boundaries - * (except if keepTogether is enabled) - */ - boundariesElement: 'viewport' - }, - - /** - * Modifier used to make the popper flow toward the inner of the reference element. - * By default, when this modifier is disabled, the popper will be placed outside - * the reference element. - * @memberof modifiers - * @inner - */ - inner: { - /** @prop {number} order=700 - Index used to define the order of execution */ - order: 700, - /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ - enabled: false, - /** @prop {ModifierFn} */ - fn: inner - }, - - /** - * Modifier used to hide the popper when its reference element is outside of the - * popper boundaries. It will set a `x-out-of-boundaries` attribute which can - * be used to hide with a CSS selector the popper when its reference is - * out of boundaries. - * - * Requires the `preventOverflow` modifier before it in order to work. - * @memberof modifiers - * @inner - */ - hide: { - /** @prop {number} order=800 - Index used to define the order of execution */ - order: 800, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: hide - }, - - /** - * Computes the style that will be applied to the popper element to gets - * properly positioned. - * - * Note that this modifier will not touch the DOM, it just prepares the styles - * so that `applyStyle` modifier can apply it. This separation is useful - * in case you need to replace `applyStyle` with a custom implementation. - * - * This modifier has `850` as `order` value to maintain backward compatibility - * with previous versions of Popper.js. Expect the modifiers ordering method - * to change in future major versions of the library. - * - * @memberof modifiers - * @inner - */ - computeStyle: { - /** @prop {number} order=850 - Index used to define the order of execution */ - order: 850, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: computeStyle, - /** - * @prop {Boolean} gpuAcceleration=true - * If true, it uses the CSS 3d transformation to position the popper. - * Otherwise, it will use the `top` and `left` properties. - */ - gpuAcceleration: true, - /** - * @prop {string} [x='bottom'] - * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. - * Change this if your popper should grow in a direction different from `bottom` - */ - x: 'bottom', - /** - * @prop {string} [x='left'] - * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. - * Change this if your popper should grow in a direction different from `right` - */ - y: 'right' - }, - - /** - * Applies the computed styles to the popper element. - * - * All the DOM manipulations are limited to this modifier. This is useful in case - * you want to integrate Popper.js inside a framework or view library and you - * want to delegate all the DOM manipulations to it. - * - * Note that if you disable this modifier, you must make sure the popper element - * has its position set to `absolute` before Popper.js can do its work! - * - * Just disable this modifier and define you own to achieve the desired effect. - * - * @memberof modifiers - * @inner - */ - applyStyle: { - /** @prop {number} order=900 - Index used to define the order of execution */ - order: 900, - /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ - enabled: true, - /** @prop {ModifierFn} */ - fn: applyStyle, - /** @prop {Function} */ - onLoad: applyStyleOnLoad, - /** - * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier - * @prop {Boolean} gpuAcceleration=true - * If true, it uses the CSS 3d transformation to position the popper. - * Otherwise, it will use the `top` and `left` properties. - */ - gpuAcceleration: undefined - } -}; - -/** - * The `dataObject` is an object containing all the informations used by Popper.js - * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks. - * @name dataObject - * @property {Object} data.instance The Popper.js instance - * @property {String} data.placement Placement applied to popper - * @property {String} data.originalPlacement Placement originally defined on init - * @property {Boolean} data.flipped True if popper has been flipped by flip modifier - * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper. - * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier - * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`) - * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`) - * @property {Object} data.boundaries Offsets of the popper boundaries - * @property {Object} data.offsets The measurements of popper, reference and arrow elements. - * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values - * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values - * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 - */ - -/** - * Default options provided to Popper.js constructor.
- * These can be overriden using the `options` argument of Popper.js.
- * To override an option, simply pass as 3rd argument an object with the same - * structure of this object, example: - * ``` - * new Popper(ref, pop, { - * modifiers: { - * preventOverflow: { enabled: false } - * } - * }) - * ``` - * @type {Object} - * @static - * @memberof Popper - */ -var Defaults = { - /** - * Popper's placement - * @prop {Popper.placements} placement='bottom' - */ - placement: 'bottom', - - /** - * Set this to true if you want popper to position it self in 'fixed' mode - * @prop {Boolean} positionFixed=false - */ - positionFixed: false, - - /** - * Whether events (resize, scroll) are initially enabled - * @prop {Boolean} eventsEnabled=true - */ - eventsEnabled: true, - - /** - * Set to true if you want to automatically remove the popper when - * you call the `destroy` method. - * @prop {Boolean} removeOnDestroy=false - */ - removeOnDestroy: false, - - /** - * Callback called when the popper is created.
- * By default, is set to no-op.
- * Access Popper.js instance with `data.instance`. - * @prop {onCreate} - */ - onCreate: function onCreate() {}, - - /** - * Callback called when the popper is updated, this callback is not called - * on the initialization/creation of the popper, but only on subsequent - * updates.
- * By default, is set to no-op.
- * Access Popper.js instance with `data.instance`. - * @prop {onUpdate} - */ - onUpdate: function onUpdate() {}, - - /** - * List of modifiers used to modify the offsets before they are applied to the popper. - * They provide most of the functionalities of Popper.js - * @prop {modifiers} - */ - modifiers: modifiers -}; - -/** - * @callback onCreate - * @param {dataObject} data - */ - -/** - * @callback onUpdate - * @param {dataObject} data - */ - -// Utils -// Methods -var Popper = function () { - /** - * Create a new Popper.js instance - * @class Popper - * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper - * @param {HTMLElement} popper - The HTML element used as popper. - * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) - * @return {Object} instance - The generated Popper.js instance - */ - function Popper(reference, popper) { - var _this = this; - - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - classCallCheck(this, Popper); - - this.scheduleUpdate = function () { - return requestAnimationFrame(_this.update); - }; - - // make update() debounced, so that it only runs at most once-per-tick - this.update = debounce(this.update.bind(this)); - - // with {} we create a new object with the options inside it - this.options = _extends({}, Popper.Defaults, options); - - // init state - this.state = { - isDestroyed: false, - isCreated: false, - scrollParents: [] - }; - - // get reference and popper elements (allow jQuery wrappers) - this.reference = reference && reference.jquery ? reference[0] : reference; - this.popper = popper && popper.jquery ? popper[0] : popper; - - // Deep merge modifiers options - this.options.modifiers = {}; - Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { - _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); - }); - - // Refactoring modifiers' list (Object => Array) - this.modifiers = Object.keys(this.options.modifiers).map(function (name) { - return _extends({ - name: name - }, _this.options.modifiers[name]); - }) - // sort the modifiers by order - .sort(function (a, b) { - return a.order - b.order; - }); - - // modifiers have the ability to execute arbitrary code when Popper.js get inited - // such code is executed in the same order of its modifier - // they could add new properties to their options configuration - // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! - this.modifiers.forEach(function (modifierOptions) { - if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { - modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); - } - }); - - // fire the first update to position the popper in the right place - this.update(); - - var eventsEnabled = this.options.eventsEnabled; - if (eventsEnabled) { - // setup event listeners, they will take care of update the position in specific situations - this.enableEventListeners(); - } - - this.state.eventsEnabled = eventsEnabled; - } - - // We can't use class properties because they don't get listed in the - // class prototype and break stuff like Sinon stubs - - - createClass(Popper, [{ - key: 'update', - value: function update$$1() { - return update.call(this); - } - }, { - key: 'destroy', - value: function destroy$$1() { - return destroy.call(this); - } - }, { - key: 'enableEventListeners', - value: function enableEventListeners$$1() { - return enableEventListeners.call(this); - } - }, { - key: 'disableEventListeners', - value: function disableEventListeners$$1() { - return disableEventListeners.call(this); - } - - /** - * Schedule an update, it will run on the next UI update available - * @method scheduleUpdate - * @memberof Popper - */ - - - /** - * Collection of utilities useful when writing custom modifiers. - * Starting from version 1.7, this method is available only if you - * include `popper-utils.js` before `popper.js`. - * - * **DEPRECATION**: This way to access PopperUtils is deprecated - * and will be removed in v2! Use the PopperUtils module directly instead. - * Due to the high instability of the methods contained in Utils, we can't - * guarantee them to follow semver. Use them at your own risk! - * @static - * @private - * @type {Object} - * @deprecated since version 1.8 - * @member Utils - * @memberof Popper - */ - - }]); - return Popper; -}(); - -/** - * The `referenceObject` is an object that provides an interface compatible with Popper.js - * and lets you use it as replacement of a real DOM node.
- * You can use this method to position a popper relatively to a set of coordinates - * in case you don't have a DOM node to use as reference. - * - * ``` - * new Popper(referenceObject, popperNode); - * ``` - * - * NB: This feature isn't supported in Internet Explorer 10 - * @name referenceObject - * @property {Function} data.getBoundingClientRect - * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. - * @property {number} data.clientWidth - * An ES6 getter that will return the width of the virtual reference element. - * @property {number} data.clientHeight - * An ES6 getter that will return the height of the virtual reference element. - */ - - -Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; -Popper.placements = placements; -Popper.Defaults = Defaults; - -/* harmony default export */ __webpack_exports__["default"] = (Popper); -//# sourceMappingURL=popper.js.map - -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(30))) - -/***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -var Arrow = function Arrow(props, context) { - var _props$component = props.component, - component = _props$component === undefined ? 'span' : _props$component, - innerRef = props.innerRef, - children = props.children, - restProps = _objectWithoutProperties(props, ['component', 'innerRef', 'children']); - - var popper = context.popper; - - var arrowRef = function arrowRef(node) { - popper.setArrowNode(node); - if (typeof innerRef === 'function') { - innerRef(node); - } - }; - var arrowStyle = popper.getArrowStyle(); - - if (typeof children === 'function') { - var arrowProps = { - ref: arrowRef, - style: arrowStyle - }; - return children({ arrowProps: arrowProps, restProps: restProps }); - } - - var componentProps = _extends({}, restProps, { - style: _extends({}, arrowStyle, restProps.style) - }); - - if (typeof component === 'string') { - componentProps.ref = arrowRef; - } else { - componentProps.innerRef = arrowRef; - } - - return (0, _react.createElement)(component, componentProps, children); -}; - -Arrow.contextTypes = { - popper: _propTypes2.default.object.isRequired -}; - -Arrow.propTypes = { - component: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]), - innerRef: _propTypes2.default.func, - children: _propTypes2.default.oneOfType([_propTypes2.default.node, _propTypes2.default.func]) -}; - -exports.default = Arrow; - -/***/ }), -/* 75 */ -/***/ (function(module, exports) { - -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = toNumber; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -// import Replace from "./../Shared/replace"; - -var propTypes = { - children: _propTypes2.default.node, - className: _propTypes2.default.string, - fixed: _propTypes2.default.bool, - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]) -}; - -var defaultProps = { - tag: 'footer', - fixed: false -}; - -var AppFooter = function (_Component) { - _inherits(AppFooter, _Component); - - function AppFooter(props) { - _classCallCheck(this, AppFooter); - - var _this = _possibleConstructorReturn(this, (AppFooter.__proto__ || Object.getPrototypeOf(AppFooter)).call(this, props)); - - _this.isFixed = _this.isFixed.bind(_this); - return _this; - } - - _createClass(AppFooter, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.isFixed(this.props.fixed); - } - }, { - key: 'isFixed', - value: function isFixed(fixed) { - if (fixed) { - document.body.classList.add('footer-fixed'); - } - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - fixed = _props.fixed, - Tag = _props.tag, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'fixed', 'tag']); - - var classes = (0, _classnames2.default)(className, 'app-footer'); - - return _react2.default.createElement( - Tag, - _extends({ className: classes }, attributes), - children - ); - } - }]); - - return AppFooter; -}(_react.Component); - -AppFooter.propTypes = propTypes; -AppFooter.defaultProps = defaultProps; - -exports.default = AppFooter; - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var propTypes = { - children: _propTypes2.default.node, - className: _propTypes2.default.string, - fixed: _propTypes2.default.bool, - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]) -}; - -var defaultProps = { - tag: 'header', - fixed: false -}; - -var AppHeader = function (_Component) { - _inherits(AppHeader, _Component); - - function AppHeader() { - _classCallCheck(this, AppHeader); - - return _possibleConstructorReturn(this, (AppHeader.__proto__ || Object.getPrototypeOf(AppHeader)).apply(this, arguments)); - } - - _createClass(AppHeader, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.isFixed(this.props.fixed); - } - }, { - key: 'isFixed', - value: function isFixed(fixed) { - if (fixed) { - document.body.classList.add('header-fixed'); - } - } - }, { - key: 'breakpoint', - value: function breakpoint(_breakpoint) { - return _breakpoint || ''; - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - fixed = _props.fixed, - Tag = _props.tag, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'fixed', 'tag']); - - var classes = (0, _classnames2.default)(className, 'app-header', 'navbar'); - - return _react2.default.createElement( - Tag, - _extends({ className: classes }, attributes), - children - ); - } - }]); - - return AppHeader; -}(_react.Component); - -AppHeader.propTypes = propTypes; -AppHeader.defaultProps = defaultProps; - -exports.default = AppHeader; - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactstrap = __webpack_require__(19); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var propTypes = { - children: _propTypes2.default.node -}; - -var defaultProps = {}; - -var AppHeaderDropdown = function (_Component) { - _inherits(AppHeaderDropdown, _Component); - - function AppHeaderDropdown(props) { - _classCallCheck(this, AppHeaderDropdown); - - var _this = _possibleConstructorReturn(this, (AppHeaderDropdown.__proto__ || Object.getPrototypeOf(AppHeaderDropdown)).call(this, props)); - - _this.toggle = _this.toggle.bind(_this); - _this.state = { - dropdownOpen: false - }; - return _this; - } - - _createClass(AppHeaderDropdown, [{ - key: 'toggle', - value: function toggle() { - this.setState({ - dropdownOpen: !this.state.dropdownOpen - }); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - attributes = _objectWithoutProperties(_props, ['children']); - - return _react2.default.createElement( - _reactstrap.Dropdown, - _extends({ nav: true, isOpen: this.state.dropdownOpen, toggle: this.toggle }, attributes), - children - ); - } - }]); - - return AppHeaderDropdown; -}(_react.Component); - -AppHeaderDropdown.propTypes = propTypes; -AppHeaderDropdown.defaultProps = defaultProps; - -exports.default = AppHeaderDropdown; - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var propTypes = { - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]), - children: _propTypes2.default.node, - className: _propTypes2.default.string, - brand: _propTypes2.default.any, - full: _propTypes2.default.any, - minimized: _propTypes2.default.any -}; - -var defaultProps = { - tag: 'a' -}; - -var AppNavbarBrand = function (_Component) { - _inherits(AppNavbarBrand, _Component); - - function AppNavbarBrand() { - _classCallCheck(this, AppNavbarBrand); - - return _possibleConstructorReturn(this, (AppNavbarBrand.__proto__ || Object.getPrototypeOf(AppNavbarBrand)).apply(this, arguments)); - } - - _createClass(AppNavbarBrand, [{ - key: 'imgSrc', - value: function imgSrc(brand) { - return brand.src ? brand.src : ''; - } - }, { - key: 'imgWidth', - value: function imgWidth(brand) { - return brand.width ? brand.width : 'auto'; - } - }, { - key: 'imgHeight', - value: function imgHeight(brand) { - return brand.height ? brand.height : 'auto'; - } - }, { - key: 'imgAlt', - value: function imgAlt(brand) { - return brand.alt ? brand.alt : ''; - } - }, { - key: 'navbarBrandImg', - value: function navbarBrandImg(props, classBrand, key) { - return _react2.default.createElement('img', { - src: this.imgSrc(props), - width: this.imgWidth(props), - height: this.imgHeight(props), - alt: this.imgAlt(props), - className: classBrand, - key: key.toString() - }); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - Tag = _props.tag, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'tag']); - - var classes = (0, _classnames2.default)(className, 'navbar-brand'); - - var img = []; - if (this.props.brand) { - var props = this.props.brand; - var classBrand = 'navbar-brand'; - img.push(this.navbarBrandImg(props, classBrand, img.length + 1)); - } - if (this.props.full) { - var _props2 = this.props.full; - var _classBrand = 'navbar-brand-full'; - img.push(this.navbarBrandImg(_props2, _classBrand, img.length + 1)); - } - if (this.props.minimized) { - var _props3 = this.props.minimized; - var _classBrand2 = 'navbar-brand-minimized'; - img.push(this.navbarBrandImg(_props3, _classBrand2, img.length + 1)); - } - - return _react2.default.createElement( - Tag, - _extends({}, attributes, { className: classes }), - children || img - ); - } - }]); - - return AppNavbarBrand; -}(_react.Component); - -AppNavbarBrand.propTypes = propTypes; -AppNavbarBrand.defaultProps = defaultProps; - -exports.default = AppNavbarBrand; - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AppSidebarToggler = exports.AppSidebarMinimizer = exports.AppSidebarHeader = exports.AppSidebarForm = exports.AppSidebarFooter = exports.AppSidebarNav = exports.AppSidebar = undefined; - -var _Sidebar = __webpack_require__(81); - -var _Sidebar2 = _interopRequireDefault(_Sidebar); - -var _SidebarNav = __webpack_require__(82); - -var _SidebarNav2 = _interopRequireDefault(_SidebarNav); - -var _SidebarFooter = __webpack_require__(87); - -var _SidebarFooter2 = _interopRequireDefault(_SidebarFooter); - -var _SidebarForm = __webpack_require__(88); - -var _SidebarForm2 = _interopRequireDefault(_SidebarForm); - -var _SidebarHeader = __webpack_require__(89); - -var _SidebarHeader2 = _interopRequireDefault(_SidebarHeader); - -var _SidebarMinimizer = __webpack_require__(90); - -var _SidebarMinimizer2 = _interopRequireDefault(_SidebarMinimizer); - -var _SidebarToggler = __webpack_require__(91); - -var _SidebarToggler2 = _interopRequireDefault(_SidebarToggler); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.AppSidebar = _Sidebar2.default; -exports.AppSidebarNav = _SidebarNav2.default; -exports.AppSidebarFooter = _SidebarFooter2.default; -exports.AppSidebarForm = _SidebarForm2.default; -exports.AppSidebarHeader = _SidebarHeader2.default; -exports.AppSidebarMinimizer = _SidebarMinimizer2.default; -exports.AppSidebarToggler = _SidebarToggler2.default; - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _Shared = __webpack_require__(6); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var propTypes = { - children: _propTypes2.default.node, - className: _propTypes2.default.string, - compact: _propTypes2.default.bool, - display: _propTypes2.default.string, - fixed: _propTypes2.default.bool, - minimized: _propTypes2.default.bool, - isOpen: _propTypes2.default.bool, - offCanvas: _propTypes2.default.bool, - staticContext: _propTypes2.default.any, - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]) -}; - -var defaultProps = { - tag: 'div', - compact: false, - display: '', - fixed: false, - minimized: false, - isOpen: false, - offCanvas: false -}; - -var AppSidebar = function (_Component) { - _inherits(AppSidebar, _Component); - - function AppSidebar(props) { - _classCallCheck(this, AppSidebar); - - var _this = _possibleConstructorReturn(this, (AppSidebar.__proto__ || Object.getPrototypeOf(AppSidebar)).call(this, props)); - - _this.isCompact = _this.isCompact.bind(_this); - _this.isFixed = _this.isFixed.bind(_this); - _this.isMinimized = _this.isMinimized.bind(_this); - _this.isOffCanvas = _this.isOffCanvas.bind(_this); - _this.displayBreakpoint = _this.displayBreakpoint.bind(_this); - return _this; - } - - _createClass(AppSidebar, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.displayBreakpoint(this.props.display); - this.isCompact(this.props.compact); - this.isFixed(this.props.fixed); - this.isMinimized(this.props.minimized); - this.isOffCanvas(this.props.offCanvas); - } - }, { - key: 'isCompact', - value: function isCompact(compact) { - if (compact) { - document.body.classList.add('sidebar-compact'); - } - } - }, { - key: 'isFixed', - value: function isFixed(fixed) { - if (fixed) { - document.body.classList.add('sidebar-fixed'); - } - } - }, { - key: 'isMinimized', - value: function isMinimized(minimized) { - if (minimized) { - document.body.classList.add('sidebar-minimized'); - } - } - }, { - key: 'isOffCanvas', - value: function isOffCanvas(offCanvas) { - if (offCanvas) { - document.body.classList.add('sidebar-off-canvas'); - } - } - }, { - key: 'displayBreakpoint', - value: function displayBreakpoint(display) { - var cssTemplate = 'sidebar-' + display + '-show'; - - var _sidebarCssClasses$ = _slicedToArray(_Shared.sidebarCssClasses[0], 1), - cssClass = _sidebarCssClasses$[0]; - - if (display && _Shared.sidebarCssClasses.indexOf(cssTemplate) > -1) { - cssClass = cssTemplate; - } - document.body.classList.add(cssClass); - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - compact = _props.compact, - display = _props.display, - fixed = _props.fixed, - minimized = _props.minimized, - offCanvas = _props.offCanvas, - isOpen = _props.isOpen, - Tag = _props.tag, - staticContext = _props.staticContext, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'compact', 'display', 'fixed', 'minimized', 'offCanvas', 'isOpen', 'tag', 'staticContext']); - - var classes = (0, _classnames2.default)(className, 'sidebar'); - - // sidebar-nav root - return _react2.default.createElement( - Tag, - _extends({ className: classes }, attributes), - children - ); - } - }]); - - return AppSidebar; -}(_react.Component); - -AppSidebar.propTypes = propTypes; -AppSidebar.defaultProps = defaultProps; - -exports.default = AppSidebar; - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactRouterDom = __webpack_require__(22); - -var _reactstrap = __webpack_require__(19); - -var _classnames = __webpack_require__(3); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _propTypes = __webpack_require__(1); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactPerfectScrollbar = __webpack_require__(83); - -var _reactPerfectScrollbar2 = _interopRequireDefault(_reactPerfectScrollbar); - -__webpack_require__(86); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var propTypes = { - children: _propTypes2.default.node, - className: _propTypes2.default.string, - navConfig: _propTypes2.default.any, - navFunc: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]), - isOpen: _propTypes2.default.bool, - staticContext: _propTypes2.default.any, - tag: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.string]) -}; - -var defaultProps = { - tag: 'nav', - navConfig: { - items: [{ - name: 'Dashboard', - url: '/dashboard', - icon: 'icon-speedometer', - badge: { variant: 'info', text: 'NEW' } - }] - }, - isOpen: false -}; - -var AppSidebarNav = function (_Component) { - _inherits(AppSidebarNav, _Component); - - function AppSidebarNav(props) { - _classCallCheck(this, AppSidebarNav); - - var _this = _possibleConstructorReturn(this, (AppSidebarNav.__proto__ || Object.getPrototypeOf(AppSidebarNav)).call(this, props)); - - _this.handleClick = _this.handleClick.bind(_this); - _this.activeRoute = _this.activeRoute.bind(_this); - _this.hideMobile = _this.hideMobile.bind(_this); - return _this; - } - - _createClass(AppSidebarNav, [{ - key: 'handleClick', - value: function handleClick(e) { - e.preventDefault(); - e.target.parentElement.classList.toggle('open'); - } - }, { - key: 'activeRoute', - value: function activeRoute(routeName, props) { - return props.location.pathname.indexOf(routeName) > -1 ? 'nav-item nav-dropdown open' : 'nav-item nav-dropdown'; - } - }, { - key: 'hideMobile', - value: function hideMobile() { - if (document.body.classList.contains('sidebar-show')) { - document.body.classList.toggle('sidebar-show'); - } - } - - // nav list - - }, { - key: 'navList', - value: function navList(items) { - var _this2 = this; - - return items.map(function (item, index) { - return _this2.navType(item, index); - }); - } - - // nav type - - }, { - key: 'navType', - value: function navType(item, idx) { - return item.title ? this.navTitle(item, idx) : item.divider ? this.navDivider(item, idx) : item.label ? this.navLabel(item, idx) : item.children ? this.navDropdown(item, idx) : this.navItem(item, idx); - } - - // nav list section title - - }, { - key: 'navTitle', - value: function navTitle(title, key) { - var classes = (0, _classnames2.default)('nav-title', title.class); - return _react2.default.createElement( - 'li', - { key: key, className: classes }, - this.navWrapper(title), - ' ' - ); - } - - // simple wrapper for nav-title item - - }, { - key: 'navWrapper', - value: function navWrapper(item) { - return item.wrapper && item.wrapper.element ? _react2.default.createElement(item.wrapper.element, item.wrapper.attributes, item.name) : item.name; - } - - // nav list divider - - }, { - key: 'navDivider', - value: function navDivider(divider, key) { - var classes = (0, _classnames2.default)('divider', divider.class); - return _react2.default.createElement('li', { key: key, className: classes }); - } - - // nav label with nav link - - }, { - key: 'navLabel', - value: function navLabel(item, key) { - var classes = { - item: (0, _classnames2.default)('hidden-cn', item.class), - link: (0, _classnames2.default)('nav-label', item.class ? item.class : ''), - icon: (0, _classnames2.default)('nav-icon', !item.icon ? 'fa fa-circle' : item.icon, item.label.variant ? 'text-' + item.label.variant : '', item.label.class ? item.label.class : '') - }; - return this.navLink(item, key, classes); - } - - // nav dropdown - - }, { - key: 'navDropdown', - value: function navDropdown(item, key) { - var classIcon = (0, _classnames2.default)('nav-icon', item.icon); - return _react2.default.createElement( - 'li', - { key: key, className: this.activeRoute(item.url, this.props) }, - _react2.default.createElement( - 'a', - { className: 'nav-link nav-dropdown-toggle', href: '#', onClick: this.handleClick }, - _react2.default.createElement('i', { className: classIcon }), - item.name - ), - _react2.default.createElement( - 'ul', - { className: 'nav-dropdown-items' }, - this.navList(item.children) - ) - ); - } - - // nav item with nav link - - }, { - key: 'navItem', - value: function navItem(item, key) { - var classes = { - item: (0, _classnames2.default)(item.class), - link: (0, _classnames2.default)('nav-link', item.variant ? 'nav-link-' + item.variant : ''), - icon: (0, _classnames2.default)('nav-icon', item.icon) - }; - return this.navLink(item, key, classes); - } - - // nav link - - }, { - key: 'navLink', - value: function navLink(item, key, classes) { - var url = item.url ? item.url : ''; - return _react2.default.createElement( - _reactstrap.NavItem, - { key: key, className: classes.item }, - this.isExternal(url) ? _react2.default.createElement( - _reactstrap.NavLink, - { href: url, className: classes.link, active: true }, - _react2.default.createElement('i', { className: classes.icon }), - item.name, - this.navBadge(item.badge) - ) : _react2.default.createElement( - _reactRouterDom.NavLink, - { to: url, className: classes.link, activeClassName: 'active', onClick: this.hideMobile }, - _react2.default.createElement('i', { className: classes.icon }), - item.name, - this.navBadge(item.badge) - ) - ); - } - - // badge addon to NavItem - - }, { - key: 'navBadge', - value: function navBadge(badge) { - if (badge) { - var classes = (0, _classnames2.default)(badge.class); - return _react2.default.createElement( - _reactstrap.Badge, - { className: classes, color: badge.variant }, - badge.text - ); - } - return null; - } - }, { - key: 'isExternal', - value: function isExternal(url) { - var link = url ? url.substring(0, 4) : ''; - return link === 'http'; - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - className = _props.className, - children = _props.children, - isOpen = _props.isOpen, - Tag = _props.tag, - navConfig = _props.navConfig, - staticContext = _props.staticContext, - attributes = _objectWithoutProperties(_props, ['className', 'children', 'isOpen', 'tag', 'navConfig', 'staticContext']); - - var navClasses = (0, _classnames2.default)(className, 'sidebar-nav'); - - // sidebar-nav root - return _react2.default.createElement( - _reactPerfectScrollbar2.default, - _extends({ className: navClasses }, attributes), - _react2.default.createElement( - _reactstrap.Nav, - null, - children || this.navList(navConfig.items) - ) - ); - } - }]); - - return AppSidebarNav; -}(_react.Component); - -AppSidebarNav.propTypes = propTypes; -AppSidebarNav.defaultProps = defaultProps; - -exports.default = AppSidebarNav; - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _scrollbar = __webpack_require__(84); - -var _scrollbar2 = _interopRequireDefault(_scrollbar); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _scrollbar2.default; -module.exports = exports['default']; - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(1); - -var _perfectScrollbar = __webpack_require__(85); - -var _perfectScrollbar2 = _interopRequireDefault(_perfectScrollbar); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var handlerNameByEvent = { - 'ps-scroll-y': 'onScrollY', - 'ps-scroll-x': 'onScrollX', - 'ps-scroll-up': 'onScrollUp', - 'ps-scroll-down': 'onScrollDown', - 'ps-scroll-left': 'onScrollLeft', - 'ps-scroll-right': 'onScrollRight', - 'ps-y-reach-start': 'onYReachStart', - 'ps-y-reach-end': 'onYReachEnd', - 'ps-x-reach-start': 'onXReachStart', - 'ps-x-reach-end': 'onXReachEnd' -}; -Object.freeze(handlerNameByEvent); - -var ScrollBar = function (_Component) { - _inherits(ScrollBar, _Component); - - function ScrollBar(props) { - _classCallCheck(this, ScrollBar); - - var _this = _possibleConstructorReturn(this, (ScrollBar.__proto__ || Object.getPrototypeOf(ScrollBar)).call(this, props)); - - _this.handleRef = function (ref) { - _this._container = ref; - _this.props.containerRef(ref); - }; - - _this._handlerByEvent = new Map(); - return _this; - } - - _createClass(ScrollBar, [{ - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - - this._ps = new _perfectScrollbar2.default(this._container, this.props.option); - // hook up events - Object.keys(handlerNameByEvent).forEach(function (key) { - var callback = _this2.props[handlerNameByEvent[key]]; - if (callback) { - var handler = function handler() { - return callback(_this2._container); - }; - _this2._handlerByEvent.set(key, handler); - _this2._container.addEventListener(key, handler, false); - } - }); - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this._ps.update(); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - var _this3 = this; - - // unhook up evens - Object.keys(this._handlerByEvent).forEach(function (value, key) { - _this3._container.removeEventListener(key, value, false); - }); - this._handlerByEvent.clear(); - this._ps.destroy(); - this._ps = null; - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - children = _props.children, - className = _props.className; - - - return _react2.default.createElement( - 'div', - { className: 'scrollbar-container ' + className, ref: this.handleRef }, - children - ); - } - }]); - - return ScrollBar; -}(_react.Component); - -exports.default = ScrollBar; - - -ScrollBar.defaultProps = { - className: '', - option: undefined, - containerRef: function containerRef() {}, - onScrollY: undefined, - onScrollX: undefined, - onScrollUp: undefined, - onScrollDown: undefined, - onScrollLeft: undefined, - onScrollRight: undefined, - onYReachStart: undefined, - onYReachEnd: undefined, - onXReachStart: undefined, - onXReachEnd: undefined -}; - -ScrollBar.propTypes = { - children: _propTypes.PropTypes.node.isRequired, - className: _propTypes.PropTypes.string, - option: _propTypes.PropTypes.object, - containerRef: _propTypes.PropTypes.func, - onScrollY: _propTypes.PropTypes.func, - onScrollX: _propTypes.PropTypes.func, - onScrollUp: _propTypes.PropTypes.func, - onScrollDown: _propTypes.PropTypes.func, - onScrollLeft: _propTypes.PropTypes.func, - onScrollRight: _propTypes.PropTypes.func, - onYReachStart: _propTypes.PropTypes.func, - onYReachEnd: _propTypes.PropTypes.func, - onXReachStart: _propTypes.PropTypes.func, - onXReachEnd: _propTypes.PropTypes.func -}; -module.exports = exports['default']; - -/***/ }), -/* 85 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/*! - * perfect-scrollbar v1.3.0 - * (c) 2017 Hyunje Jun - * @license MIT - */ -function get(element) { - return getComputedStyle(element); -} - -function set(element, obj) { - for (var key in obj) { - var val = obj[key]; - if (typeof val === 'number') { - val = val + "px"; - } - element.style[key] = val; - } - return element; -} - -function div(className) { - var div = document.createElement('div'); - div.className = className; - return div; -} - -var elMatches = - typeof Element !== 'undefined' && - (Element.prototype.matches || - Element.prototype.webkitMatchesSelector || - Element.prototype.msMatchesSelector); - -function matches(element, query) { - if (!elMatches) { - throw new Error('No element matching method supported'); - } - - return elMatches.call(element, query); -} - -function remove(element) { - if (element.remove) { - element.remove(); - } else { - if (element.parentNode) { - element.parentNode.removeChild(element); - } - } -} - -function queryChildren(element, selector) { - return Array.prototype.filter.call(element.children, function (child) { return matches(child, selector); } - ); -} - -var cls = { - main: 'ps', - element: { - thumb: function (x) { return ("ps__thumb-" + x); }, - rail: function (x) { return ("ps__rail-" + x); }, - consuming: 'ps__child--consume', - }, - state: { - focus: 'ps--focus', - active: function (x) { return ("ps--active-" + x); }, - scrolling: function (x) { return ("ps--scrolling-" + x); }, - }, -}; - -/* - * Helper methods - */ -var scrollingClassTimeout = { x: null, y: null }; - -function addScrollingClass(i, x) { - var classList = i.element.classList; - var className = cls.state.scrolling(x); - - if (classList.contains(className)) { - clearTimeout(scrollingClassTimeout[x]); - } else { - classList.add(className); - } -} - -function removeScrollingClass(i, x) { - scrollingClassTimeout[x] = setTimeout( - function () { return i.isAlive && i.element.classList.remove(cls.state.scrolling(x)); }, - i.settings.scrollingThreshold - ); -} - -function setScrollingClassInstantly(i, x) { - addScrollingClass(i, x); - removeScrollingClass(i, x); -} - -var EventElement = function EventElement(element) { - this.element = element; - this.handlers = {}; -}; - -var prototypeAccessors = { isEmpty: { configurable: true } }; - -EventElement.prototype.bind = function bind (eventName, handler) { - if (typeof this.handlers[eventName] === 'undefined') { - this.handlers[eventName] = []; - } - this.handlers[eventName].push(handler); - this.element.addEventListener(eventName, handler, false); -}; - -EventElement.prototype.unbind = function unbind (eventName, target) { - var this$1 = this; - - this.handlers[eventName] = this.handlers[eventName].filter(function (handler) { - if (target && handler !== target) { - return true; - } - this$1.element.removeEventListener(eventName, handler, false); - return false; - }); -}; - -EventElement.prototype.unbindAll = function unbindAll () { - var this$1 = this; - - for (var name in this$1.handlers) { - this$1.unbind(name); - } -}; - -prototypeAccessors.isEmpty.get = function () { - var this$1 = this; - - return Object.keys(this.handlers).every( - function (key) { return this$1.handlers[key].length === 0; } - ); -}; - -Object.defineProperties( EventElement.prototype, prototypeAccessors ); - -var EventManager = function EventManager() { - this.eventElements = []; -}; - -EventManager.prototype.eventElement = function eventElement (element) { - var ee = this.eventElements.filter(function (ee) { return ee.element === element; })[0]; - if (!ee) { - ee = new EventElement(element); - this.eventElements.push(ee); - } - return ee; -}; - -EventManager.prototype.bind = function bind (element, eventName, handler) { - this.eventElement(element).bind(eventName, handler); -}; - -EventManager.prototype.unbind = function unbind (element, eventName, handler) { - var ee = this.eventElement(element); - ee.unbind(eventName, handler); - - if (ee.isEmpty) { - // remove - this.eventElements.splice(this.eventElements.indexOf(ee), 1); - } -}; - -EventManager.prototype.unbindAll = function unbindAll () { - this.eventElements.forEach(function (e) { return e.unbindAll(); }); - this.eventElements = []; -}; - -EventManager.prototype.once = function once (element, eventName, handler) { - var ee = this.eventElement(element); - var onceHandler = function (evt) { - ee.unbind(eventName, onceHandler); - handler(evt); - }; - ee.bind(eventName, onceHandler); -}; - -function createEvent(name) { - if (typeof window.CustomEvent === 'function') { - return new CustomEvent(name); - } else { - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(name, false, false, undefined); - return evt; - } -} - -var processScrollDiff = function( - i, - axis, - diff, - useScrollingClass, - forceFireReachEvent -) { - if ( useScrollingClass === void 0 ) useScrollingClass = true; - if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false; - - var fields; - if (axis === 'top') { - fields = [ - 'contentHeight', - 'containerHeight', - 'scrollTop', - 'y', - 'up', - 'down' ]; - } else if (axis === 'left') { - fields = [ - 'contentWidth', - 'containerWidth', - 'scrollLeft', - 'x', - 'left', - 'right' ]; - } else { - throw new Error('A proper axis should be provided'); - } - - processScrollDiff$1(i, diff, fields, useScrollingClass, forceFireReachEvent); -}; - -function processScrollDiff$1( - i, - diff, - ref, - useScrollingClass, - forceFireReachEvent -) { - var contentHeight = ref[0]; - var containerHeight = ref[1]; - var scrollTop = ref[2]; - var y = ref[3]; - var up = ref[4]; - var down = ref[5]; - if ( useScrollingClass === void 0 ) useScrollingClass = true; - if ( forceFireReachEvent === void 0 ) forceFireReachEvent = false; - - var element = i.element; - - // reset reach - i.reach[y] = null; - - // 1 for subpixel rounding - if (element[scrollTop] < 1) { - i.reach[y] = 'start'; - } - - // 1 for subpixel rounding - if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) { - i.reach[y] = 'end'; - } - - if (diff) { - element.dispatchEvent(createEvent(("ps-scroll-" + y))); - - if (diff < 0) { - element.dispatchEvent(createEvent(("ps-scroll-" + up))); - } else if (diff > 0) { - element.dispatchEvent(createEvent(("ps-scroll-" + down))); - } - - if (useScrollingClass) { - setScrollingClassInstantly(i, y); - } - } - - if (i.reach[y] && (diff || forceFireReachEvent)) { - element.dispatchEvent(createEvent(("ps-" + y + "-reach-" + (i.reach[y])))); - } -} - -function toInt(x) { - return parseInt(x, 10) || 0; -} - -function isEditable(el) { - return ( - matches(el, 'input,[contenteditable]') || - matches(el, 'select,[contenteditable]') || - matches(el, 'textarea,[contenteditable]') || - matches(el, 'button,[contenteditable]') - ); -} - -function outerWidth(element) { - var styles = get(element); - return ( - toInt(styles.width) + - toInt(styles.paddingLeft) + - toInt(styles.paddingRight) + - toInt(styles.borderLeftWidth) + - toInt(styles.borderRightWidth) - ); -} - -var env = { - isWebKit: - typeof document !== 'undefined' && - 'WebkitAppearance' in document.documentElement.style, - supportsTouch: - typeof window !== 'undefined' && - ('ontouchstart' in window || - (window.DocumentTouch && document instanceof window.DocumentTouch)), - supportsIePointer: - typeof navigator !== 'undefined' && navigator.msMaxTouchPoints, - isChrome: - typeof navigator !== 'undefined' && - /Chrome/i.test(navigator && navigator.userAgent), -}; - -var updateGeometry = function(i) { - var element = i.element; - - i.containerWidth = element.clientWidth; - i.containerHeight = element.clientHeight; - i.contentWidth = element.scrollWidth; - i.contentHeight = element.scrollHeight; - - if (!element.contains(i.scrollbarXRail)) { - // clean up and append - queryChildren(element, cls.element.rail('x')).forEach(function (el) { return remove(el); } - ); - element.appendChild(i.scrollbarXRail); - } - if (!element.contains(i.scrollbarYRail)) { - // clean up and append - queryChildren(element, cls.element.rail('y')).forEach(function (el) { return remove(el); } - ); - element.appendChild(i.scrollbarYRail); - } - - if ( - !i.settings.suppressScrollX && - i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth - ) { - i.scrollbarXActive = true; - i.railXWidth = i.containerWidth - i.railXMarginWidth; - i.railXRatio = i.containerWidth / i.railXWidth; - i.scrollbarXWidth = getThumbSize( - i, - toInt(i.railXWidth * i.containerWidth / i.contentWidth) - ); - i.scrollbarXLeft = toInt( - (i.negativeScrollAdjustment + element.scrollLeft) * - (i.railXWidth - i.scrollbarXWidth) / - (i.contentWidth - i.containerWidth) - ); - } else { - i.scrollbarXActive = false; - } - - if ( - !i.settings.suppressScrollY && - i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight - ) { - i.scrollbarYActive = true; - i.railYHeight = i.containerHeight - i.railYMarginHeight; - i.railYRatio = i.containerHeight / i.railYHeight; - i.scrollbarYHeight = getThumbSize( - i, - toInt(i.railYHeight * i.containerHeight / i.contentHeight) - ); - i.scrollbarYTop = toInt( - element.scrollTop * - (i.railYHeight - i.scrollbarYHeight) / - (i.contentHeight - i.containerHeight) - ); - } else { - i.scrollbarYActive = false; - } - - if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) { - i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth; - } - if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) { - i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight; - } - - updateCss(element, i); - - if (i.scrollbarXActive) { - element.classList.add(cls.state.active('x')); - } else { - element.classList.remove(cls.state.active('x')); - i.scrollbarXWidth = 0; - i.scrollbarXLeft = 0; - element.scrollLeft = 0; - } - if (i.scrollbarYActive) { - element.classList.add(cls.state.active('y')); - } else { - element.classList.remove(cls.state.active('y')); - i.scrollbarYHeight = 0; - i.scrollbarYTop = 0; - element.scrollTop = 0; - } -}; - -function getThumbSize(i, thumbSize) { - if (i.settings.minScrollbarLength) { - thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength); - } - if (i.settings.maxScrollbarLength) { - thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength); - } - return thumbSize; -} - -function updateCss(element, i) { - var xRailOffset = { width: i.railXWidth }; - if (i.isRtl) { - xRailOffset.left = - i.negativeScrollAdjustment + - element.scrollLeft + - i.containerWidth - - i.contentWidth; - } else { - xRailOffset.left = element.scrollLeft; - } - if (i.isScrollbarXUsingBottom) { - xRailOffset.bottom = i.scrollbarXBottom - element.scrollTop; - } else { - xRailOffset.top = i.scrollbarXTop + element.scrollTop; - } - set(i.scrollbarXRail, xRailOffset); - - var yRailOffset = { top: element.scrollTop, height: i.railYHeight }; - if (i.isScrollbarYUsingRight) { - if (i.isRtl) { - yRailOffset.right = - i.contentWidth - - (i.negativeScrollAdjustment + element.scrollLeft) - - i.scrollbarYRight - - i.scrollbarYOuterWidth; - } else { - yRailOffset.right = i.scrollbarYRight - element.scrollLeft; - } - } else { - if (i.isRtl) { - yRailOffset.left = - i.negativeScrollAdjustment + - element.scrollLeft + - i.containerWidth * 2 - - i.contentWidth - - i.scrollbarYLeft - - i.scrollbarYOuterWidth; - } else { - yRailOffset.left = i.scrollbarYLeft + element.scrollLeft; - } - } - set(i.scrollbarYRail, yRailOffset); - - set(i.scrollbarX, { - left: i.scrollbarXLeft, - width: i.scrollbarXWidth - i.railBorderXWidth, - }); - set(i.scrollbarY, { - top: i.scrollbarYTop, - height: i.scrollbarYHeight - i.railBorderYWidth, - }); -} - -var clickRail = function(i) { - i.event.bind(i.scrollbarY, 'mousedown', function (e) { return e.stopPropagation(); }); - i.event.bind(i.scrollbarYRail, 'mousedown', function (e) { - var positionTop = - e.pageY - - window.pageYOffset - - i.scrollbarYRail.getBoundingClientRect().top; - var direction = positionTop > i.scrollbarYTop ? 1 : -1; - - i.element.scrollTop += direction * i.containerHeight; - updateGeometry(i); - - e.stopPropagation(); - }); - - i.event.bind(i.scrollbarX, 'mousedown', function (e) { return e.stopPropagation(); }); - i.event.bind(i.scrollbarXRail, 'mousedown', function (e) { - var positionLeft = - e.pageX - - window.pageXOffset - - i.scrollbarXRail.getBoundingClientRect().left; - var direction = positionLeft > i.scrollbarXLeft ? 1 : -1; - - i.element.scrollLeft += direction * i.containerWidth; - updateGeometry(i); - - e.stopPropagation(); - }); -}; - -var dragThumb = function(i) { - bindMouseScrollHandler(i, [ - 'containerWidth', - 'contentWidth', - 'pageX', - 'railXWidth', - 'scrollbarX', - 'scrollbarXWidth', - 'scrollLeft', - 'x' ]); - bindMouseScrollHandler(i, [ - 'containerHeight', - 'contentHeight', - 'pageY', - 'railYHeight', - 'scrollbarY', - 'scrollbarYHeight', - 'scrollTop', - 'y' ]); -}; - -function bindMouseScrollHandler( - i, - ref -) { - var containerHeight = ref[0]; - var contentHeight = ref[1]; - var pageY = ref[2]; - var railYHeight = ref[3]; - var scrollbarY = ref[4]; - var scrollbarYHeight = ref[5]; - var scrollTop = ref[6]; - var y = ref[7]; - - var element = i.element; - - var startingScrollTop = null; - var startingMousePageY = null; - var scrollBy = null; - - function mouseMoveHandler(e) { - element[scrollTop] = - startingScrollTop + scrollBy * (e[pageY] - startingMousePageY); - addScrollingClass(i, y); - updateGeometry(i); - - e.stopPropagation(); - e.preventDefault(); - } - - function mouseUpHandler() { - removeScrollingClass(i, y); - i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler); - } - - i.event.bind(i[scrollbarY], 'mousedown', function (e) { - startingScrollTop = element[scrollTop]; - startingMousePageY = e[pageY]; - scrollBy = - (i[contentHeight] - i[containerHeight]) / - (i[railYHeight] - i[scrollbarYHeight]); - - i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler); - i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler); - - e.stopPropagation(); - e.preventDefault(); - }); -} - -var keyboard = function(i) { - var element = i.element; - - var elementHovered = function () { return matches(element, ':hover'); }; - var scrollbarFocused = function () { return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus'); }; - - function shouldPreventDefault(deltaX, deltaY) { - var scrollTop = element.scrollTop; - if (deltaX === 0) { - if (!i.scrollbarYActive) { - return false; - } - if ( - (scrollTop === 0 && deltaY > 0) || - (scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0) - ) { - return !i.settings.wheelPropagation; - } - } - - var scrollLeft = element.scrollLeft; - if (deltaY === 0) { - if (!i.scrollbarXActive) { - return false; - } - if ( - (scrollLeft === 0 && deltaX < 0) || - (scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0) - ) { - return !i.settings.wheelPropagation; - } - } - return true; - } - - i.event.bind(i.ownerDocument, 'keydown', function (e) { - if ( - (e.isDefaultPrevented && e.isDefaultPrevented()) || - e.defaultPrevented - ) { - return; - } - - if (!elementHovered() && !scrollbarFocused()) { - return; - } - - var activeElement = document.activeElement - ? document.activeElement - : i.ownerDocument.activeElement; - if (activeElement) { - if (activeElement.tagName === 'IFRAME') { - activeElement = activeElement.contentDocument.activeElement; - } else { - // go deeper if element is a webcomponent - while (activeElement.shadowRoot) { - activeElement = activeElement.shadowRoot.activeElement; - } - } - if (isEditable(activeElement)) { - return; - } - } - - var deltaX = 0; - var deltaY = 0; - - switch (e.which) { - case 37: // left - if (e.metaKey) { - deltaX = -i.contentWidth; - } else if (e.altKey) { - deltaX = -i.containerWidth; - } else { - deltaX = -30; - } - break; - case 38: // up - if (e.metaKey) { - deltaY = i.contentHeight; - } else if (e.altKey) { - deltaY = i.containerHeight; - } else { - deltaY = 30; - } - break; - case 39: // right - if (e.metaKey) { - deltaX = i.contentWidth; - } else if (e.altKey) { - deltaX = i.containerWidth; - } else { - deltaX = 30; - } - break; - case 40: // down - if (e.metaKey) { - deltaY = -i.contentHeight; - } else if (e.altKey) { - deltaY = -i.containerHeight; - } else { - deltaY = -30; - } - break; - case 32: // space bar - if (e.shiftKey) { - deltaY = i.containerHeight; - } else { - deltaY = -i.containerHeight; - } - break; - case 33: // page up - deltaY = i.containerHeight; - break; - case 34: // page down - deltaY = -i.containerHeight; - break; - case 36: // home - deltaY = i.contentHeight; - break; - case 35: // end - deltaY = -i.contentHeight; - break; - default: - return; - } - - if (i.settings.suppressScrollX && deltaX !== 0) { - return; - } - if (i.settings.suppressScrollY && deltaY !== 0) { - return; - } - - element.scrollTop -= deltaY; - element.scrollLeft += deltaX; - updateGeometry(i); - - if (shouldPreventDefault(deltaX, deltaY)) { - e.preventDefault(); - } - }); -}; - -var wheel = function(i) { - var element = i.element; - - function shouldPreventDefault(deltaX, deltaY) { - var isTop = element.scrollTop === 0; - var isBottom = - element.scrollTop + element.offsetHeight === element.scrollHeight; - var isLeft = element.scrollLeft === 0; - var isRight = - element.scrollLeft + element.offsetWidth === element.offsetWidth; - - var hitsBound; - - // pick axis with primary direction - if (Math.abs(deltaY) > Math.abs(deltaX)) { - hitsBound = isTop || isBottom; - } else { - hitsBound = isLeft || isRight; - } - - return hitsBound ? !i.settings.wheelPropagation : true; - } - - function getDeltaFromEvent(e) { - var deltaX = e.deltaX; - var deltaY = -1 * e.deltaY; - - if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') { - // OS X Safari - deltaX = -1 * e.wheelDeltaX / 6; - deltaY = e.wheelDeltaY / 6; - } - - if (e.deltaMode && e.deltaMode === 1) { - // Firefox in deltaMode 1: Line scrolling - deltaX *= 10; - deltaY *= 10; - } - - if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) { - // IE in some mouse drivers - deltaX = 0; - deltaY = e.wheelDelta; - } - - if (e.shiftKey) { - // reverse axis with shift key - return [-deltaY, -deltaX]; - } - return [deltaX, deltaY]; - } - - function shouldBeConsumedByChild(target, deltaX, deltaY) { - // FIXME: this is a workaround for